X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=boards%2F8157.c;h=ef4255866f34f01e1e64baf202b1f7481995182b;hb=0d6a66c2a80f50ae51327cd406f9df14d99ad02e;hp=3c4a4fb59bdb30be3fa9988707e1c8f915fd6170;hpb=d97315ac0bca825d2d50a44453bc5652946e2c67;p=fceu.git diff --git a/boards/8157.c b/boards/8157.c index 3c4a4fb..ef42558 100644 --- a/boards/8157.c +++ b/boards/8157.c @@ -21,9 +21,11 @@ #include "mapinc.h" static uint16 cmdreg; +static uint8 invalid_data; static SFORMAT StateRegs[]= { - {&cmdreg, 2, "CMDREG"}, + {&invalid_data, 1, "INVD"}, + {&cmdreg, 2, "CREG"}, {0} }; @@ -36,7 +38,7 @@ static void Sync(void) static DECLFR(UNL8157Read) { - if(cmdreg&0x100) + if(invalid_data&&cmdreg&0x100) return 0xFF; else return CartBR(A); @@ -53,13 +55,15 @@ static void UNL8157Power(void) setchr8(0); SetWriteHandler(0x8000,0xFFFF,UNL8157Write); SetReadHandler(0x8000,0xFFFF,UNL8157Read); - cmdreg=0; + cmdreg=0x200; + invalid_data=1; Sync(); } static void UNL8157Reset(void) { cmdreg=0; + invalid_data^=1; Sync(); }