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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
\r
20 * BMC 42-in-1 reset switch
\r
25 static uint8 regs[4];
\r
27 static SFORMAT StateRegs[]=
\r
33 static void Sync(void)
\r
38 setprg32(0x8000,regs[1]&0x1F);
\r
41 int bank=((regs[1]&0x1f)<<1)|((regs[1]>>6)&1);
\r
42 setprg16(0x8000,bank);
\r
43 setprg16(0xC000,bank);
\r
48 int bank=((regs[1]&0x1f)<<1)|((regs[1]>>6)&1);
\r
49 setprg16(0xC000,bank);
\r
55 setchr8((regs[2]<<2)|((regs[0]>>1)&3));
\r
58 static DECLFW(BMC64in1nrWriteLo)
\r
64 static DECLFW(BMC64in1nrWriteHi)
\r
70 static void BMC64in1nrPower(void)
\r
76 SetWriteHandler(0x5000,0x5003,BMC64in1nrWriteLo);
\r
77 SetWriteHandler(0x8000,0xFFFF,BMC64in1nrWriteHi);
\r
78 SetReadHandler(0x8000,0xFFFF,CartBR);
\r
81 static void StateRestore(int version)
\r
86 void BMC64in1nr_Init(CartInfo *info)
\r
88 info->Power=BMC64in1nrPower;
\r
89 AddExState(&StateRegs, ~0, 0, 0);
\r
90 GameStateRestore=StateRestore;
\r