mirror of https://github.com/snes9xgit/snes9x.git
Add 128KByte SRAM support in cheats and netplay client
This commit is contained in:
parent
041108ddf2
commit
46f11f61da
|
@ -146,7 +146,7 @@ const char * S9xGameGenieToRaw (const char *code, uint32 &address, uint8 &byte)
|
||||||
void S9xStartCheatSearch (SCheatData *d)
|
void S9xStartCheatSearch (SCheatData *d)
|
||||||
{
|
{
|
||||||
memmove(d->CWRAM, d->RAM, 0x20000);
|
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);
|
memmove(d->CIRAM, &d->FillRAM[0x3000], 0x2000);
|
||||||
memset((char *) d->ALL_BITS, 0xff, 0x32000 >> 3);
|
memset((char *) d->ALL_BITS, 0xff, 0x32000 >> 3);
|
||||||
}
|
}
|
||||||
|
|
2
cheats.h
2
cheats.h
|
@ -33,7 +33,7 @@ struct SCheatData
|
||||||
std::vector<struct SCheatGroup> g;
|
std::vector<struct SCheatGroup> g;
|
||||||
bool8 enabled;
|
bool8 enabled;
|
||||||
uint8 CWRAM[0x20000];
|
uint8 CWRAM[0x20000];
|
||||||
uint8 CSRAM[0x10000];
|
uint8 CSRAM[0x80000];
|
||||||
uint8 CIRAM[0x2000];
|
uint8 CIRAM[0x2000];
|
||||||
uint8 *RAM;
|
uint8 *RAM;
|
||||||
uint8 *FillRAM;
|
uint8 *FillRAM;
|
||||||
|
|
|
@ -62,7 +62,7 @@ static inline uint8 S9xGetByteFree (uint32 Address)
|
||||||
|
|
||||||
case CMemory::MAP_HIROM_SRAM:
|
case CMemory::MAP_HIROM_SRAM:
|
||||||
case CMemory::MAP_RONLY_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);
|
return (byte);
|
||||||
|
|
||||||
case CMemory::MAP_BWRAM:
|
case CMemory::MAP_BWRAM:
|
||||||
|
@ -153,7 +153,7 @@ static inline void S9xSetByteFree (uint8 Byte, uint32 Address)
|
||||||
case CMemory::MAP_HIROM_SRAM:
|
case CMemory::MAP_HIROM_SRAM:
|
||||||
if (Memory.SRAMMask)
|
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;
|
CPU.SRAMModified = TRUE;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -668,7 +668,7 @@ bool8 S9xNPGetROMImage (uint32 len)
|
||||||
|
|
||||||
void S9xNPGetSRAMData (uint32 len)
|
void S9xNPGetSRAMData (uint32 len)
|
||||||
{
|
{
|
||||||
if (len > 0x10000)
|
if (len > 0x70000)
|
||||||
{
|
{
|
||||||
S9xNPSetError ("Length error in S-RAM data received from server.");
|
S9xNPSetError ("Length error in S-RAM data received from server.");
|
||||||
S9xNPDisconnect ();
|
S9xNPDisconnect ();
|
||||||
|
|
Loading…
Reference in New Issue