From 385dd471d15e6ecd8ece8481e402d11dd81e65d0 Mon Sep 17 00:00:00 2001 From: zeromus Date: Wed, 6 Jun 2012 19:32:16 +0000 Subject: [PATCH] experiment to combine fk23c and the chinese 176 --- src/boards/176.cpp | 15 +++------------ src/boards/fk23c.cpp | 23 +++++++++++++++++++++-- src/ines.cpp | 4 ++-- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/src/boards/176.cpp b/src/boards/176.cpp index ccd2a625..ab20fe8c 100644 --- a/src/boards/176.cpp +++ b/src/boards/176.cpp @@ -48,7 +48,7 @@ static void Sync(void) static DECLFW(M176Write_5001) { - if(sbw) + if(sbw) { prg[0] = V*4; prg[1] = V*4+1; @@ -120,17 +120,8 @@ static void M176Power(void) sbw = 0; prg[0] = 0; prg[1] = 1; - if(ROM_size > 32) - { - prg[2] = ROM_size-2; - prg[3] = ROM_size-1; - } - else - { - prg[2] = ROM_size*2-2; - prg[3] = ROM_size*2-1; - } - + prg[2] = (ROM_size-2)&63; + prg[3] = (ROM_size-1)&63; Sync(); } diff --git a/src/boards/fk23c.cpp b/src/boards/fk23c.cpp index 7be10d6c..0f000ec2 100644 --- a/src/boards/fk23c.cpp +++ b/src/boards/fk23c.cpp @@ -40,6 +40,12 @@ static void BMCFK23CCW(uint32 A, uint8 V) } } +//some games are wired differently, and this will need to be changed. +//for instance, WAIXING176 needs prg_bonus=1, and cah4e3's 4-in-1's need prg_bonus=0 +static int prg_bonus = 0; +static int prg_mask = 0x7F>>(prg_bonus); + +//PRG wrapper static void BMCFK23CPW(uint32 A, uint8 V) { if((EXPREGS[0]&7)==4) @@ -52,9 +58,17 @@ static void BMCFK23CPW(uint32 A, uint8 V) else { if(EXPREGS[0]&3) - setprg8(A,(V&(0x3F>>(EXPREGS[0]&3)))|(EXPREGS[1]<<1)); - else + { + uint32 blocksize = (6+prg_bonus)-(EXPREGS[0]&3); + uint32 mask = (1<