MCPcopy Create free account
hub / github.com/TASEmulators/fceux / AddCheatGGPAR

Function AddCheatGGPAR

src/drivers/common/cheat.cpp:270–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268
269
270static 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
310static void AddCheatGG(void)
311{

Callers 2

AddCheatGGFunction · 0.85
AddCheatPARFunction · 0.85

Calls 5

GetStringFunction · 0.85
GetYNFunction · 0.85
FCEUI_DecodePARFunction · 0.85
FCEUI_DecodeGGFunction · 0.85
FCEUI_AddCheatFunction · 0.85

Tested by

no test coverage detected