1 /* FCE Ultra - NES/Famicom Emulator
3 * Copyright notice for this file:
4 * Copyright (C) 2005 CaH4e3
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 * BMC 42-in-1 reset switch
27 static SFORMAT StateRegs[]=
29 {&latche, 1, "LATCHE"},
30 {&hrd_sw, 1, "HRDSW"},
34 static void Sync(void)
37 setprg32r(hrd_sw,0x8000,(latche>>1)&0x0f);
40 setprg16r(hrd_sw,0x8000,latche&0x1f);
41 setprg16r(hrd_sw,0xC000,latche&0x1f);
45 case 0: setmirrorw(0,0,0,1); break;
46 case 1: setmirror(MI_V); break;
47 case 2: setmirror(MI_H); break;
48 case 3: setmirror(MI_1); break;
52 static DECLFW(BMC42in1rWrite)
58 static void BMC42in1rReset(void)
64 static void BMC42in1rPower(void)
70 SetWriteHandler(0x8000,0xFFFF,BMC42in1rWrite);
71 SetReadHandler(0x8000,0xFFFF,CartBR);
74 static void StateRestore(int version)
79 void BMC42in1r_Init(CartInfo *info)
81 info->Power=BMC42in1rPower;
82 info->Reset=BMC42in1rReset;
83 AddExState(&StateRegs, ~0, 0, 0);
84 GameStateRestore=StateRestore;