1 /* FCE Ultra - NES/Famicom Emulator
\r
3 * Copyright notice for this file:
\r
4 * Copyright (C) 2005 CaH4e3
\r
6 * This program is free software; you can redistribute it and/or modify
\r
7 * it under the terms of the GNU General Public License as published by
\r
8 * the Free Software Foundation; either version 2 of the License, or
\r
9 * (at your option) any later version.
\r
11 * This program is distributed in the hope that it will be useful,
\r
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 * GNU General Public License for more details.
\r
16 * You should have received a copy of the GNU General Public License
\r
17 * along with this program; if not, write to the Free Software
\r
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
\r
20 * A98402 board, A9711, A9746 similar
\r
21 * King of Fighters 96, The (Unl), Street Fighter Zero 2 (Unl)
\r
28 static void M187CW(uint32 A, uint8 V)
\r
30 if((A&0x1000)==((MMC3_cmd&0x80)<<5))
\r
36 static void M187PW(uint32 A, uint8 V)
\r
40 uint8 bank=EXPREGS[0]&0x1F;
\r
44 setprg32(0x8000,bank>>2);
\r
46 setprg32(0x8000,bank>>1); // hacky hacky! two mappers in one! need real hw carts to test
\r
50 setprg16(0x8000,bank);
\r
51 setprg16(0xC000,bank);
\r
58 static DECLFW(M187Write8000)
\r
64 static DECLFW(M187Write8001)
\r
70 static DECLFW(M187WriteLo)
\r
72 if((A==0x5000)||(A==0x6000))
\r
75 FixMMC3PRG(MMC3_cmd);
\r
79 static uint8 prot_data[4] = { 0x83, 0x83, 0x42, 0x00 };
\r
80 static DECLFR(M187Read)
\r
82 return prot_data[EXPREGS[1]&3];
\r
85 static void M187Power(void)
\r
87 EXPREGS[0]=EXPREGS[1]=0;
\r
89 SetReadHandler(0x5000,0x5FFF,M187Read);
\r
90 SetWriteHandler(0x5000,0x6FFF,M187WriteLo);
\r
91 SetWriteHandler(0x8000,0x8000,M187Write8000);
\r
92 SetWriteHandler(0x8001,0x8001,M187Write8001);
\r
95 void Mapper187_Init(CartInfo *info)
\r
97 GenMMC3_Init(info, 256, 256, 0, 0);
\r
100 info->Power=M187Power;
\r
101 AddExState(EXPREGS, 3, 0, "EXPR");
\r