add BIOS and firmware to savestates
This commit is contained in:
parent
1da6b33574
commit
6f7a2b3413
|
@ -858,8 +858,8 @@ bool DoSavestate(Savestate* file)
|
|||
file->VarArray(SharedWRAM, SharedWRAMSize);
|
||||
file->VarArray(ARM7WRAM, ARM7WRAMSize);
|
||||
|
||||
//file->VarArray(ARM9BIOS, 0x1000);
|
||||
//file->VarArray(ARM7BIOS, 0x4000);
|
||||
file->VarArray(ARM9BIOS, 0x1000);
|
||||
file->VarArray(ARM7BIOS, 0x4000);
|
||||
|
||||
file->VarArray(ExMemCnt, 2*sizeof(u16));
|
||||
file->VarArray(ROMSeed0, 2*8);
|
||||
|
|
22
src/SPI.cpp
22
src/SPI.cpp
|
@ -458,6 +458,28 @@ void DoSavestate(Savestate* file)
|
|||
|
||||
// CHECKME/TODO: trust the firmware to stay the same?????
|
||||
// embedding the whole firmware in the savestate would be derpo tho??
|
||||
file->Var32(&FirmwareLength);
|
||||
if (file->Saving)
|
||||
{
|
||||
file->VarArray(Firmware, FirmwareLength);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Firmware) delete[] Firmware;
|
||||
Firmware = new u8[FirmwareLength];
|
||||
file->VarArray(Firmware, FirmwareLength);
|
||||
|
||||
FirmwareMask = FirmwareLength - 1;
|
||||
|
||||
u32 userdata = 0x7FE00 & FirmwareMask;
|
||||
if (*(u16*)&Firmware[userdata+0x170] == ((*(u16*)&Firmware[userdata+0x70] + 1) & 0x7F))
|
||||
{
|
||||
if (VerifyCRC16(0xFFFF, userdata+0x100, 0x70, userdata+0x172))
|
||||
userdata += 0x100;
|
||||
}
|
||||
|
||||
UserSettings = userdata;
|
||||
}
|
||||
|
||||
file->Var32(&Hold);
|
||||
file->Var8(&CurCmd);
|
||||
|
|
Loading…
Reference in New Issue