1 /* FCE Ultra - NES/Famicom Emulator
\r
3 * Copyright notice for this file:
\r
4 * Copyright (C) 2006 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
\r
19 * Mortal Kombat 2 YOKO */
\r
24 static uint8 reg[8];
\r
26 static SFORMAT StateRegs[]=
\r
32 static void Sync(void)
\r
34 // FCEU_printf("(%02x, %02x)\n",reg[3],reg[4]);
\r
35 setprg8(0x8000,reg[0]);
\r
36 setprg8(0xA000,reg[1]);
\r
37 setprg8(0xC000,reg[2]);
\r
39 // setchr2(0x0000,reg[3]);
\r
40 // setchr2(0x0800,reg[4]);
\r
41 // setchr2(0x1000,reg[5]);
\r
42 // setchr2(0x1800,reg[6]);
\r
43 setchr2(0x0000,reg[3]);
\r
44 setchr2(0x0800,reg[4]);
\r
45 setchr2(0x1000,reg[5]);
\r
46 setchr2(0x1800,reg[6]);
\r
49 static DECLFW(MCN22MWrite)
\r
51 //FCEU_printf("bs %04x %02x\n",A,V);
\r
56 case 0x8c02: reg[A&3]=V; break;
\r
57 case 0x8d10: reg[3]=V; break;
\r
58 case 0x8d11: reg[4]=V; break;
\r
59 case 0x8d16: reg[5]=V; break;
\r
60 case 0x8d17: reg[6]=V; break;
\r
65 static void MCN22MPower(void)
\r
67 reg[0]=reg[1]=reg[2]=0;
\r
69 SetReadHandler(0x8000,0xFFFF,CartBR);
\r
70 SetWriteHandler(0x8000,0xFFFF,MCN22MWrite);
\r
73 static void MCN22MIRQHook(void)
\r
75 int count = IRQCount;
\r
76 if(!count || IRQReload)
\r
78 IRQCount = IRQLatch;
\r
87 X6502_IRQBegin(FCEU_IQEXT);
\r
92 static void StateRestore(int version)
\r
97 void UNLCN22M_Init(CartInfo *info)
\r
99 info->Power=MCN22MPower;
\r
100 // GameHBIRQHook=MCN22MIRQHook;
\r
101 GameStateRestore=StateRestore;
\r
102 AddExState(&StateRegs, ~0, 0, 0);
\r