mirror of
https://github.com/libretro/Genesis-Plus-GX.git
synced 2024-11-23 08:19:39 +00:00
[libretro] fixed cheat support regression introduced in previous commit
This commit is contained in:
parent
98b5c60355
commit
90bb356a17
Binary file not shown.
@ -2243,34 +2243,40 @@ static void apply_cheats(void)
|
|||||||
{
|
{
|
||||||
if (cheatlist[i].enable)
|
if (cheatlist[i].enable)
|
||||||
{
|
{
|
||||||
if (cheatlist[i].address < cart.romsize)
|
/* detect Work RAM patch */
|
||||||
|
if (cheatlist[i].address >= 0xFF0000)
|
||||||
{
|
{
|
||||||
/* detect Work RAM patch */
|
/* add RAM patch */
|
||||||
if (cheatlist[i].address >= 0xFF0000)
|
cheatIndexes[maxRAMcheats++] = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* check if Mega-CD game is running */
|
||||||
|
else if ((system_hw == SYSTEM_MCD) && !scd.cartridge.boot)
|
||||||
|
{
|
||||||
|
/* detect PRG-RAM patch (Sub-CPU side) */
|
||||||
|
if (cheatlist[i].address < 0x80000)
|
||||||
{
|
{
|
||||||
/* add RAM patch */
|
/* add RAM patch */
|
||||||
|
cheatIndexes[maxRAMcheats++] = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* detect Word-RAM patch (Main-CPU side)*/
|
||||||
|
else if ((cheatlist[i].address >= 0x200000) && (cheatlist[i].address < 0x240000))
|
||||||
|
{
|
||||||
|
/* add RAM patch */
|
||||||
cheatIndexes[maxRAMcheats++] = i;
|
cheatIndexes[maxRAMcheats++] = i;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* check if Mega-CD game is running */
|
/* detect cartridge ROM patch */
|
||||||
else if ((system_hw == SYSTEM_MCD) && !scd.cartridge.boot)
|
else if (cheatlist[i].address < cart.romsize)
|
||||||
|
{
|
||||||
|
if ((system_hw & SYSTEM_PBC) == SYSTEM_MD)
|
||||||
{
|
{
|
||||||
/* detect PRG-RAM patch (Sub-CPU side) */
|
/* patch ROM data */
|
||||||
if (cheatlist[i].address < 0x80000)
|
cheatlist[i].old = *(uint16_t *)(cart.rom + (cheatlist[i].address & 0xFFFFFE));
|
||||||
{
|
*(uint16_t *)(cart.rom + (cheatlist[i].address & 0xFFFFFE)) = cheatlist[i].data;
|
||||||
/* add RAM patch */
|
|
||||||
cheatIndexes[maxRAMcheats++] = i;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* detect Word-RAM patch (Main-CPU side)*/
|
|
||||||
else if ((cheatlist[i].address >= 0x200000) && (cheatlist[i].address < 0x240000))
|
|
||||||
{
|
|
||||||
/* add RAM patch */
|
|
||||||
cheatIndexes[maxRAMcheats++] = i;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* detect cartridge ROM patch */
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* add ROM patch */
|
/* add ROM patch */
|
||||||
|
Loading…
Reference in New Issue
Block a user