mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-02-24 07:02:27 +01:00
byuu says: Changelog: - fc/controller: added ControllerPort class; removed Peripherals class - md/controller/gamepad: removed X,Y,Z buttons since this isn't a 6-button controller - ms/controller: added ControllerPort class (not used in Game Gear mode); removed Peripherals class - pce/controller: added ControllerPort class; removed Peripherals class - processor/spc700: idle(address) is part of SMP class again, contains flag to detect mov (x)+ edge case - sfc/controller/super-scope,justifier: use CPU frequency instead of hard-coding NTSC frequency - sfc/cpu: move 4x8-bit SMP ports to SMP class - sfc/smp: move APU RAM to DSP class - sfc/smp: improved emulation of TEST registers bits 4-7 [information from nocash] - d4,d5 is RAM wait states (1,2,5,10) - d6,d7 is ROM/IO wait states (1,2,5,10) - sfc/smp: code cleanup to new style (order from lowest to highest bits; use .bit(s) functions) - sfc/smp: $00f8,$00f9 are P4/P5 auxiliary ports; named the registers better
68 lines
1.4 KiB
C++
68 lines
1.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;
|
|
char version[16];
|
|
char hash[64];
|
|
char description[512];
|
|
|
|
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;
|
|
}
|
|
|
|
auto System::serialize(serializer& s) -> void {
|
|
}
|
|
|
|
auto System::serializeAll(serializer& s) -> void {
|
|
system.serialize(s);
|
|
cartridge.serialize(s);
|
|
cpu.serialize(s);
|
|
apu.serialize(s);
|
|
ppu.serialize(s);
|
|
controllerPort1.serialize(s);
|
|
controllerPort2.serialize(s);
|
|
}
|
|
|
|
auto System::serializeInit() -> void {
|
|
serializer s;
|
|
|
|
uint signature = 0;
|
|
char version[16];
|
|
char hash[64];
|
|
char description[512];
|
|
|
|
s.integer(signature);
|
|
s.array(version);
|
|
s.array(hash);
|
|
s.array(description);
|
|
|
|
serializeAll(s);
|
|
_serializeSize = s.size();
|
|
}
|