mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-02-22 06:02:28 +01:00
byuu says: Changelog: - Emulator::Interface::Medium::bootable removed - Emulator::Interface::load(bool required) argument removed [File::Required makes no sense on a folder] - Super Famicom.sys now has user-configurable properties (CPU,PPU1,PPU2 version; PPU1 VRAM size, Region override) - old nall/property removed completely - volatile flags supported on coprocessor RAM files now (still not in icarus, though) - (hopefully) fixed SNES Multitap support (needs testing) - fixed an OAM tiledata range clipping limit in 128KiB VRAM mode (doesn't fix Yoshi's Island, sadly) - (hopefully, again) fixed the input polling bug hex_usr reported - re-added dialog box for when File::Required files are missing - really cool: if you're missing a boot ROM, BIOS ROM, or IPL ROM, it warns you immediately - you don't have to select a game before seeing the error message anymore - fixed cheats.bml load/save location
91 lines
2.4 KiB
C++
91 lines
2.4 KiB
C++
auto System::serialize() -> serializer {
|
|
serializer s(serializeSize);
|
|
|
|
uint signature = 0x31545342;
|
|
char version[16] = {0};
|
|
char hash[64] = {0};
|
|
char description[512] = {0};
|
|
memory::copy(&version, (const char*)Emulator::SerializerVersion, Emulator::SerializerVersion.size());
|
|
memory::copy(&hash, (const char*)cartridge.sha256(), 64);
|
|
|
|
s.integer(signature);
|
|
s.array(version);
|
|
s.array(hash);
|
|
s.array(description);
|
|
|
|
serializeAll(s);
|
|
return s;
|
|
}
|
|
|
|
auto System::unserialize(serializer& s) -> bool {
|
|
uint signature = 0;
|
|
char version[16] = {0};
|
|
char hash[64] = {0};
|
|
char description[512] = {0};
|
|
|
|
s.integer(signature);
|
|
s.array(version);
|
|
s.array(hash);
|
|
s.array(description);
|
|
|
|
if(signature != 0x31545342) return false;
|
|
if(string{version} != Emulator::SerializerVersion) return false;
|
|
|
|
power();
|
|
serializeAll(s);
|
|
return true;
|
|
}
|
|
|
|
//internal
|
|
|
|
auto System::serialize(serializer& s) -> void {
|
|
s.integer((uint&)information.region);
|
|
}
|
|
|
|
auto System::serializeAll(serializer& s) -> void {
|
|
cartridge.serialize(s);
|
|
system.serialize(s);
|
|
random.serialize(s);
|
|
cpu.serialize(s);
|
|
smp.serialize(s);
|
|
ppu.serialize(s);
|
|
dsp.serialize(s);
|
|
|
|
if(cartridge.has.ICD2) icd2.serialize(s);
|
|
if(cartridge.has.MCC) mcc.serialize(s);
|
|
if(cartridge.has.Event) event.serialize(s);
|
|
if(cartridge.has.SA1) sa1.serialize(s);
|
|
if(cartridge.has.SuperFX) superfx.serialize(s);
|
|
if(cartridge.has.ARMDSP) armdsp.serialize(s);
|
|
if(cartridge.has.HitachiDSP) hitachidsp.serialize(s);
|
|
if(cartridge.has.NECDSP) necdsp.serialize(s);
|
|
if(cartridge.has.EpsonRTC) epsonrtc.serialize(s);
|
|
if(cartridge.has.SharpRTC) sharprtc.serialize(s);
|
|
if(cartridge.has.SPC7110) spc7110.serialize(s);
|
|
if(cartridge.has.SDD1) sdd1.serialize(s);
|
|
if(cartridge.has.OBC1) obc1.serialize(s);
|
|
if(cartridge.has.MSU1) msu1.serialize(s);
|
|
|
|
if(cartridge.has.SufamiTurboSlots) sufamiturboA.serialize(s), sufamiturboB.serialize(s);
|
|
}
|
|
|
|
//perform dry-run state save:
|
|
//determines exactly how many bytes are needed to save state for this cartridge,
|
|
//as amount varies per game (eg different RAM sizes, special chips, etc.)
|
|
auto System::serializeInit() -> void {
|
|
serializer s;
|
|
|
|
uint signature = 0;
|
|
char version[16] = {0};
|
|
char hash[64] = {0};
|
|
char description[512] = {0};
|
|
|
|
s.integer(signature);
|
|
s.array(version);
|
|
s.array(hash);
|
|
s.array(description);
|
|
|
|
serializeAll(s);
|
|
serializeSize = s.size();
|
|
}
|