From 181e344bb94450baf4beb6b62643699eb4e90eb9 Mon Sep 17 00:00:00 2001 From: CaH4e3 Date: Tue, 8 Sep 2015 19:22:42 +0000 Subject: [PATCH] UNIF EH8813A - hw switch added --- trunk/src/boards/eh8813a.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/trunk/src/boards/eh8813a.cpp b/trunk/src/boards/eh8813a.cpp index 8e2b6bc7..34f7ce66 100644 --- a/trunk/src/boards/eh8813a.cpp +++ b/trunk/src/boards/eh8813a.cpp @@ -21,12 +21,13 @@ #include "mapinc.h" static uint16 addrlatch; -static uint8 datalatch; +static uint8 datalatch, hw_mode; static SFORMAT StateRegs[] = { { &addrlatch, 2, "ADRL" }, { &datalatch, 1, "DATL" }, + { &hw_mode, 1, "HWMO" }, { 0 } }; @@ -52,12 +53,12 @@ static DECLFW(EH8813AWrite) { static DECLFR(EH8813ARead) { if (addrlatch & 0x40) - A &= 0xFFF0; + A= (A & 0xFFF0) + hw_mode; return CartBR(A); } static void EH8813APower(void) { - addrlatch = datalatch = 0; + addrlatch = datalatch = hw_mode = 0; Sync(); SetReadHandler(0x8000, 0xFFFF, EH8813ARead); SetWriteHandler(0x8000, 0xFFFF, EH8813AWrite); @@ -65,6 +66,8 @@ static void EH8813APower(void) { static void EH8813AReset(void) { addrlatch = datalatch = 0; + hw_mode = (hw_mode + 1) & 0xF; + FCEU_printf("Hardware Switch is %01X\n", hw_mode); Sync(); }