Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NeoGeo Save States #926

Merged
merged 1 commit into from Jan 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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);
}