mirror of
https://github.com/dborth/snes9xgx.git
synced 2025-01-24 00:51:14 +01:00
fix cheat file parsing, fix superscope pause button
This commit is contained in:
parent
e033f976b2
commit
bcdc1dc56f
@ -33,21 +33,21 @@ static bool NGCLoadCheatFile (int length)
|
|||||||
|
|
||||||
while (offset < length)
|
while (offset < length)
|
||||||
{
|
{
|
||||||
if(Cheat.num_cheats < MAX_CHEATS)
|
if(Cheat.num_cheats >= MAX_CHEATS || (length - offset) < 28)
|
||||||
{
|
break;
|
||||||
memcpy (data, savebuffer+offset, 28);
|
|
||||||
offset += 28;
|
|
||||||
|
|
||||||
Cheat.c [Cheat.num_cheats].enabled = (data [0] & 4) == 0;
|
memcpy (data, savebuffer+offset, 28);
|
||||||
Cheat.c [Cheat.num_cheats].byte = data [1];
|
offset += 28;
|
||||||
Cheat.c [Cheat.num_cheats].address = data [2] | (data [3] << 8) | (data [4] << 16);
|
|
||||||
Cheat.c [Cheat.num_cheats].saved_byte = data [5];
|
Cheat.c [Cheat.num_cheats].enabled = (data [0] & 4) == 0;
|
||||||
Cheat.c [Cheat.num_cheats].saved = (data [0] & 8) != 0;
|
Cheat.c [Cheat.num_cheats].byte = data [1];
|
||||||
memmove (Cheat.c [Cheat.num_cheats].name, &data [8], 20);
|
Cheat.c [Cheat.num_cheats].address = data [2] | (data [3] << 8) | (data [4] << 16);
|
||||||
Cheat.c [Cheat.num_cheats++].name [20] = 0;
|
Cheat.c [Cheat.num_cheats].saved_byte = data [5];
|
||||||
}
|
Cheat.c [Cheat.num_cheats].saved = (data [0] & 8) != 0;
|
||||||
|
memcpy (Cheat.c [Cheat.num_cheats].name, &data[8], 20);
|
||||||
|
Cheat.c [Cheat.num_cheats].name[20] = 0;
|
||||||
|
Cheat.num_cheats++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -466,7 +466,7 @@ void decodepad (int pad)
|
|||||||
{
|
{
|
||||||
// buttons
|
// buttons
|
||||||
offset = 0x50;
|
offset = 0x50;
|
||||||
for (i = 0; i < 5; i++)
|
for (i = 0; i < 6; i++)
|
||||||
{
|
{
|
||||||
if (jp & btnmap[CTRL_SCOPE][CTRLR_GCPAD][i]
|
if (jp & btnmap[CTRL_SCOPE][CTRLR_GCPAD][i]
|
||||||
#ifdef HW_RVL
|
#ifdef HW_RVL
|
||||||
|
Loading…
x
Reference in New Issue
Block a user