From 2f05c221de52e1018d235edc063d0cffbb045075 Mon Sep 17 00:00:00 2001 From: NewRisingSun <8vytz1+dhp372pv94ebg@sharklasers.com> Date: Fri, 4 Mar 2022 22:25:50 +0100 Subject: [PATCH] Mapper 351: Correct state saving/loading --- src/boards/351.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/boards/351.c b/src/boards/351.c index a719813..199953c 100644 --- a/src/boards/351.c +++ b/src/boards/351.c @@ -38,6 +38,7 @@ static SFORMAT stateRegs[] = { { MMC1_reg, 4, "MMC1" }, { &MMC1_shift, 1, "M1SH" }, { &MMC1_count, 1, "M1CN" }, + { &MMC1_filter, 1, "M1FI" }, { MMC3_reg, 1, "MMC3" }, { &MMC3_index, 1, "M3IX" }, { &MMC3_mirroring, 1, "M3MI" }, @@ -239,6 +240,11 @@ static void applyMode() { } } +static void Mapper351_restore (int version) { + applyMode(); + sync(); +} + static DECLFR(readDIP) { return dip; } @@ -283,7 +289,7 @@ void Mapper351_Init (CartInfo *info) { info->Power = Mapper351_power; MapIRQHook = cpuCycle; GameHBIRQHook = horizontalBlanking; - GameStateRestore = applyMode; + GameStateRestore = Mapper351_restore; AddExState(stateRegs, ~0, 0, 0); }