X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=fceu.git;a=blobdiff_plain;f=boards%2F187.c;h=0852cba713d51349778f68ee2cc91c30c7305227;hp=0f497488dc5c5bd3480219ffee26587f73920df0;hb=43725da7349c85fa13e828fdbf20cc7ac8d298d6;hpb=386f5371eb984fb9c2860c83e740890a75cd45c1 diff --git a/boards/187.c b/boards/187.c index 0f49748..0852cba 100644 --- a/boards/187.c +++ b/boards/187.c @@ -15,7 +15,11 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * A98402 board, A9711, A9746 similar + * King of Fighters 96, The (Unl), Street Fighter Zero 2 (Unl) + * */ #include "mapinc.h" @@ -35,7 +39,12 @@ static void M187PW(uint32 A, uint8 V) { uint8 bank=EXPREGS[0]&0x1F; if(EXPREGS[0]&0x20) - setprg32(0x8000,bank>>2); + { + if(EXPREGS[0]&0x40) + setprg32(0x8000,bank>>2); + else + setprg32(0x8000,bank>>1); // hacky hacky! two mappers in one! need real hw carts to test + } else { setprg16(0x8000,bank); @@ -48,28 +57,19 @@ static void M187PW(uint32 A, uint8 V) static DECLFW(M187Write8000) { - EXPREGS[2]=1; + EXPREGS[1]=1; MMC3_CMDWrite(A,V); } static DECLFW(M187Write8001) { - if(EXPREGS[2]) + if(EXPREGS[1]) MMC3_CMDWrite(A,V); } -static DECLFW(M187Write8003) -{ - EXPREGS[2]=0; - if(V==0x28)setprg8(0xC000,0x17); - else if(V==0x2A)setprg8(0xA000,0x0F); -} - - static DECLFW(M187WriteLo) { - EXPREGS[1]=V; - if(A==0x5000) + if((A==0x5000)||(A==0x6000)) { EXPREGS[0]=V; FixMMC3PRG(MMC3_cmd); @@ -84,13 +84,12 @@ static DECLFR(M187Read) static void M187Power(void) { - EXPREGS[0]=EXPREGS[1]=EXPREGS[2]=0; + EXPREGS[0]=EXPREGS[1]=0; GenMMC3Power(); SetReadHandler(0x5000,0x5FFF,M187Read); - SetWriteHandler(0x5000,0x5FFF,M187WriteLo); + SetWriteHandler(0x5000,0x6FFF,M187WriteLo); SetWriteHandler(0x8000,0x8000,M187Write8000); SetWriteHandler(0x8001,0x8001,M187Write8001); - SetWriteHandler(0x8003,0x8003,M187Write8003); } void Mapper187_Init(CartInfo *info)