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
25 static uint8 bank_mode;
26 static uint8 bank_value;
28 static SFORMAT StateRegs[]=
33 static void Sync(void)
35 FCEU_printf("%02x: %02x %02x\n", bank_mode, bank_value, prgb[0]);
39 setprg32(0x8000,bank_value&7); break;
41 setprg16(0x8000,((8+(bank_value&7))>>1)+prgb[1]);
42 setprg16(0xC000,(bank_value&7)>>1);
44 setprg32(0x8000,8+(bank_value&7)); break;
46 setprg16(0x8000,((8+(bank_value&7))>>1)+prgb[1]);
47 setprg16(0xC000,((8+(bank_value&7))>>1)+prgb[3]);
49 setprg8(0x8000,prgb[0]>>2);
50 setprg8(0xa000,prgb[1]);
51 setprg8(0xc000,prgb[2]);
55 setprg8(0x8000,prgb[0]);
56 setprg8(0xa000,prgb[1]);
57 setprg8(0xc000,prgb[2]);
58 setprg8(0xe000,prgb[3]);
63 static DECLFW(BMC13in1JY110Write)
65 FCEU_printf("%04x:%04x\n",A,V);
71 case 0x8003: prgb[A&3]=V; break;
72 case 0xD000: bank_mode=V; break;
73 case 0xD001: setmirror(V&3);
75 case 0xD003: bank_value=V; break;
80 static void BMC13in1JY110Power(void)
82 prgb[0]=prgb[1]=prgb[2]=prgb[3]=0;
87 SetWriteHandler(0x8000,0xFFFF,BMC13in1JY110Write);
88 SetReadHandler(0x8000,0xFFFF,CartBR);
91 static void StateRestore(int version)
96 void BMC13in1JY110_Init(CartInfo *info)
98 info->Power=BMC13in1JY110Power;
99 AddExState(&StateRegs, ~0, 0, 0);
100 GameStateRestore=StateRestore;