| 220 | } |
| 221 | |
| 222 | static void ModifyCheat(int num) |
| 223 | { |
| 224 | std::string name; |
| 225 | std::string *pName; |
| 226 | char buf[256]; |
| 227 | uint32 A; |
| 228 | uint8 V; |
| 229 | int compare; |
| 230 | int type; |
| 231 | |
| 232 | int s; |
| 233 | int t; |
| 234 | |
| 235 | FCEUI_GetCheat(num, &name, &A, &V, &compare, &s, &type); |
| 236 | |
| 237 | printf("Name [%s]: ",name.c_str()); |
| 238 | GetString(buf,256); |
| 239 | |
| 240 | /* This obviously doesn't allow for cheats with no names. Bah. Who wants |
| 241 | nameless cheats anyway... |
| 242 | */ |
| 243 | |
| 244 | if(buf[0]) |
| 245 | pName=&name; // Change name when FCEUI_SetCheat() is called. |
| 246 | else |
| 247 | pName=nullptr; // Don't change name when FCEUI_SetCheat() is called. |
| 248 | |
| 249 | printf("Address [$%04x]: ",(unsigned int)A); |
| 250 | A=GetH16(A); |
| 251 | |
| 252 | printf("Value [%03u]: ",(unsigned int)V); |
| 253 | V=Get8(V); |
| 254 | |
| 255 | printf("Compare [%3d]: ",compare); |
| 256 | compare=GetI(compare); |
| 257 | |
| 258 | printf("Type(0=Old Style, 1=Read Substitute) [%1d]: ",type); |
| 259 | type=GetI(type)?1:0; |
| 260 | |
| 261 | printf("Enable [%s]: ",s?"Y":"N"); |
| 262 | t=getchar(); |
| 263 | if(t=='Y' || t=='y') s=1; |
| 264 | else if(t=='N' || t=='n') s=0; |
| 265 | |
| 266 | FCEUI_SetCheat(num,pName,A,V,compare,s,type); |
| 267 | } |
| 268 | |
| 269 | |
| 270 | static void AddCheatGGPAR(int which) |
no test coverage detected