- FCEUI_SetCheat(num,name,A,V,s);
+ FCEUI_SetCheat(num,name,A,V,compare,s,type);
+}
+
+
+static void AddCheatGGPAR(int which)
+{
+ uint16 A;
+ uint8 V;
+ int C;
+ int type;
+ char name[256],code[256];
+
+ printf("Name: ");
+ GetString(name,256);
+
+ printf("Code: ");
+ GetString(code,256);
+
+ printf("Add cheat \"%s\" for code \"%s\"?",name,code);
+ if(GetYN(0))
+ {
+ if(which)
+ {
+ if(!FCEUI_DecodePAR(code,&A,&V,&C,&type))
+ {
+ puts("Invalid Game Genie code.");
+ return;
+ }
+ }
+ else
+ {
+ if(!FCEUI_DecodeGG(code,&A,&V,&C))
+ {
+ puts("Invalid Game Genie code.");
+ return;
+ }
+ type=1;
+ }
+
+ if(FCEUI_AddCheat(name,A,V,C,type))
+ puts("Cheat added.");
+ else
+ puts("Error adding cheat.");
+ }
+}
+
+static void AddCheatGG(void)
+{
+ AddCheatGGPAR(0);
+}
+
+static void AddCheatPAR(void)
+{
+ AddCheatGGPAR(1);