From 73e0aacb8c962748e1bd20ae348c0bac9ff29ee0 Mon Sep 17 00:00:00 2001 From: bbbradsmith Date: Wed, 24 Nov 2021 01:08:38 -0500 Subject: [PATCH] Mapper 71 fix hardwired mirroring restore after power/savestate, fix uninitialized preg. See issue #389 --- src/boards/71.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/boards/71.cpp b/src/boards/71.cpp index 37c05aab..0fbf5855 100644 --- a/src/boards/71.cpp +++ b/src/boards/71.cpp @@ -21,6 +21,7 @@ #include "mapinc.h" static uint8 preg, mirr; +static int hardmirr; static SFORMAT StateRegs[] = { @@ -35,6 +36,8 @@ static void Sync(void) { setchr8(0); if(mirr) setmirror(mirr); + else + setmirror(hardmirr); // restore hardwired mirroring } static DECLFW(M71Write) { @@ -46,6 +49,7 @@ static DECLFW(M71Write) { } static void M71Power(void) { + preg = 0; mirr = 0; Sync(); SetReadHandler(0x8000, 0xFFFF, CartBR); @@ -57,6 +61,7 @@ static void StateRestore(int version) { } void Mapper71_Init(CartInfo *info) { + hardmirr = info->mirror; info->Power = M71Power; GameStateRestore = StateRestore;