| 268 | |
| 269 | |
| 270 | static void AddCheatGGPAR(int which) |
| 271 | { |
| 272 | int A, V, C; |
| 273 | int type; |
| 274 | char name[256],code[256]; |
| 275 | |
| 276 | printf("Name: "); |
| 277 | GetString(name,256); |
| 278 | |
| 279 | printf("Code: "); |
| 280 | GetString(code,256); |
| 281 | |
| 282 | printf("Add cheat \"%s\" for code \"%s\"?",name,code); |
| 283 | if(GetYN(0)) |
| 284 | { |
| 285 | if(which) |
| 286 | { |
| 287 | if(!FCEUI_DecodePAR(code,&A,&V,&C,&type)) |
| 288 | { |
| 289 | puts("Invalid Game Genie code."); |
| 290 | return; |
| 291 | } |
| 292 | } |
| 293 | else |
| 294 | { |
| 295 | if(!FCEUI_DecodeGG(code,&A,&V,&C)) |
| 296 | { |
| 297 | puts("Invalid Game Genie code."); |
| 298 | return; |
| 299 | } |
| 300 | type=1; |
| 301 | } |
| 302 | |
| 303 | if(FCEUI_AddCheat(name,A,V,C,type)) |
| 304 | puts("Cheat added."); |
| 305 | else |
| 306 | puts("Error adding cheat."); |
| 307 | } |
| 308 | } |
| 309 | |
| 310 | static void AddCheatGG(void) |
| 311 | { |
no test coverage detected