Skip to content

Commit

Permalink
Fix NeoGeo Save States
Browse files Browse the repository at this point in the history
  • Loading branch information
remutro authored and LukeUsher committed Jan 3, 2023
1 parent d40b890 commit 6213019
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 1 deletion.
10 changes: 10 additions & 0 deletions ares/ng/apu/serialization.cpp
@@ -1,4 +1,14 @@
auto APU::serialize(serializer& s) -> void {
Z80::serialize(s);
Thread::serialize(s);
s(ram);
s(communication.input);
s(communication.output);
s(nmi.pending);
s(nmi.enable);
s(irq.pending);
s(rom.bankA);
s(rom.bankB);
s(rom.bankC);
s(rom.bankD);
}
3 changes: 3 additions & 0 deletions ares/ng/cpu/serialization.cpp
@@ -1,4 +1,7 @@
auto CPU::serialize(serializer& s) -> void {
M68000::serialize(s);
Thread::serialize(s);
s(io.interruptPending);
s(io.vectorSelect);
s(io.fixSelect);
}
28 changes: 28 additions & 0 deletions ares/ng/lspc/serialization.cpp
@@ -1,3 +1,31 @@
auto LSPC::serialize(serializer& s) -> void {
Thread::serialize(s);
s(vram);
s(pram);
s(animation.disable);
s(animation.speed);
s(animation.counter);
s(animation.frame);
s(timer.interruptEnable);
s(timer.reloadOnChange);
s(timer.reloadOnVblank);
s(timer.reloadOnZero);
s(timer.reload);
s(timer.counter);
s(timer.stopPAL);
s(irq.powerAcknowledge);
s(irq.timerAcknowledge);
s(irq.vblankAcknowledge);
s(io.hcounter);
s(io.vcounter);
s(io.shadow);
s(io.vramAddress);
s(io.vramIncrement);
s(io.pramBank);
for(u16 x = 0; x < 256; x++)
for(u16 y = 0; y < 256; y++)
s(vscale[x][y]);
for(u16 x = 0; x < 16; x++)
for(u16 y = 0; y < 16; y++)
s(hscale[x][y]);
}
2 changes: 2 additions & 0 deletions ares/ng/opnb/serialization.cpp
@@ -1,4 +1,6 @@
auto OPNB::serialize(serializer& s) -> void {
YM2610::serialize(s);
Thread::serialize(s);
s(cyclesUntilFmSsg);
s(cyclesUntilPcmA);
}
9 changes: 8 additions & 1 deletion ares/ng/system/serialization.cpp
Expand Up @@ -30,7 +30,7 @@ auto System::unserialize(serializer& s) -> bool {
if(signature != SerializerSignature) return false;
if(string{version} != SerializerVersion) return false;

if(synchronize) power();
if(synchronize) power(/* reset = */ false);
serialize(s, synchronize);
return true;
}
Expand All @@ -45,4 +45,11 @@ auto System::serialize(serializer& s, bool synchronize) -> void {
s(apu);
s(lspc);
s(opnb);
s(wram);
s(io.sramLock);
s(io.slotSelect);
s(io.ledMarquee);
s(io.ledLatch1);
s(io.ledLatch2);
s(io.ledData);
}

0 comments on commit 6213019

Please sign in to comment.