Add 128KByte SRAM support in cheats and netplay client

This commit is contained in:
qwertymodo 2021-08-25 10:12:11 -07:00
parent 041108ddf2
commit 46f11f61da
4 changed files with 5 additions and 5 deletions

View File

@ -146,7 +146,7 @@ const char * S9xGameGenieToRaw (const char *code, uint32 &address, uint8 &byte)
void S9xStartCheatSearch (SCheatData *d)
{
memmove(d->CWRAM, d->RAM, 0x20000);
memmove(d->CSRAM, d->SRAM, 0x10000);
memmove(d->CSRAM, d->SRAM, 0x80000);
memmove(d->CIRAM, &d->FillRAM[0x3000], 0x2000);
memset((char *) d->ALL_BITS, 0xff, 0x32000 >> 3);
}

View File

@ -33,7 +33,7 @@ struct SCheatData
std::vector<struct SCheatGroup> g;
bool8 enabled;
uint8 CWRAM[0x20000];
uint8 CSRAM[0x10000];
uint8 CSRAM[0x80000];
uint8 CIRAM[0x2000];
uint8 *RAM;
uint8 *FillRAM;

View File

@ -62,7 +62,7 @@ static inline uint8 S9xGetByteFree (uint32 Address)
case CMemory::MAP_HIROM_SRAM:
case CMemory::MAP_RONLY_SRAM:
byte = *(Memory.SRAM + (((Address & 0x7fff) - 0x6000 + ((Address & 0xf0000) >> 3)) & Memory.SRAMMask));
byte = *(Memory.SRAM + (((Address & 0x7fff) - 0x6000 + ((Address & 0x1f0000) >> 3)) & Memory.SRAMMask));
return (byte);
case CMemory::MAP_BWRAM:
@ -153,7 +153,7 @@ static inline void S9xSetByteFree (uint8 Byte, uint32 Address)
case CMemory::MAP_HIROM_SRAM:
if (Memory.SRAMMask)
{
*(Memory.SRAM + (((Address & 0x7fff) - 0x6000 + ((Address & 0xf0000) >> 3)) & Memory.SRAMMask)) = Byte;
*(Memory.SRAM + (((Address & 0x7fff) - 0x6000 + ((Address & 0x1f0000) >> 3)) & Memory.SRAMMask)) = Byte;
CPU.SRAMModified = TRUE;
}
return;

View File

@ -668,7 +668,7 @@ bool8 S9xNPGetROMImage (uint32 len)
void S9xNPGetSRAMData (uint32 len)
{
if (len > 0x10000)
if (len > 0x70000)
{
S9xNPSetError ("Length error in S-RAM data received from server.");
S9xNPDisconnect ();