Cheats: Fix RAW cheats that use zero-page address
This commit is contained in:
@@ -1991,6 +1991,9 @@ void retro_cheat_set(unsigned index, bool enabled, const char *code)
|
|||||||
a = strtoul(codepart, NULL, 16);
|
a = strtoul(codepart, NULL, 16);
|
||||||
v = strtoul(codepart + 5, NULL, 16);
|
v = strtoul(codepart + 5, NULL, 16);
|
||||||
c = -1;
|
c = -1;
|
||||||
|
/* Zero-page addressing modes don't go through the normal read/write handlers in FCEU, so
|
||||||
|
* we must do the old hacky method of RAM cheats. */
|
||||||
|
if (a < 0x0100) type = 0;
|
||||||
FCEUI_AddCheat(name, a, v, c, type);
|
FCEUI_AddCheat(name, a, v, c, type);
|
||||||
}
|
}
|
||||||
else if ((strlen(codepart) == 10) && (codepart[4] == '?') && (codepart[7] == ':'))
|
else if ((strlen(codepart) == 10) && (codepart[4] == '?') && (codepart[7] == ':'))
|
||||||
@@ -2002,6 +2005,9 @@ void retro_cheat_set(unsigned index, bool enabled, const char *code)
|
|||||||
a = strtoul(codepart, NULL, 16);
|
a = strtoul(codepart, NULL, 16);
|
||||||
v = strtoul(codepart + 8, NULL, 16);
|
v = strtoul(codepart + 8, NULL, 16);
|
||||||
c = strtoul(codepart + 5, NULL, 16);
|
c = strtoul(codepart + 5, NULL, 16);
|
||||||
|
/* Zero-page addressing modes don't go through the normal read/write handlers in FCEU, so
|
||||||
|
* we must do the old hacky method of RAM cheats. */
|
||||||
|
if (a < 0x0100) type = 0;
|
||||||
FCEUI_AddCheat(name, a, v, c, type);
|
FCEUI_AddCheat(name, a, v, c, type);
|
||||||
}
|
}
|
||||||
else if (FCEUI_DecodeGG(codepart, &a, &v, &c))
|
else if (FCEUI_DecodeGG(codepart, &a, &v, &c))
|
||||||
|
|||||||
Reference in New Issue
Block a user