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
23 static uint8 is_large_banks;
24 static uint8 large_bank;
25 static uint8 prg_bank;
26 static uint8 chr_bank;
27 static uint8 bank_mode;
28 static uint8 mirroring;
29 static SFORMAT StateRegs[]=
31 {&large_bank, 1, "LB"},
32 {&prg_bank, 1, "PRG"},
33 {&chr_bank, 1, "CHR"},
34 {&bank_mode, 1, "BM"},
35 {&mirroring, 1, "MIRR"},
39 static void Sync(void)
44 case 0x10: setprg16(0x8000,large_bank|prg_bank);
45 setprg16(0xC000,large_bank|7);
47 case 0x20: setprg32(0x8000,(large_bank|prg_bank)>>1);
49 case 0x30: setprg16(0x8000,large_bank|prg_bank);
50 setprg16(0xC000,large_bank|prg_bank);
58 static DECLFR(BMC70in1Read)
62 return CartBR((A&0xFFF0)|0x06);
64 return CartBR((A&0xFFF0)|0x0d);
69 static DECLFW(BMC70in1Write)
78 mirroring=((A&0x20)>>5)^1;
87 static void BMC70in1Power(void)
93 SetReadHandler(0x8000,0xFFFF,BMC70in1Read);
94 SetWriteHandler(0x8000,0xffff,BMC70in1Write);
97 static void StateRestore(int version)
102 void BMC70in1_Init(CartInfo *info)
105 info->Power=BMC70in1Power;
106 GameStateRestore=StateRestore;
107 AddExState(&StateRegs, ~0, 0, 0);
110 void BMC70in1B_Init(CartInfo *info)
113 info->Power=BMC70in1Power;
114 GameStateRestore=StateRestore;
115 AddExState(&StateRegs, ~0, 0, 0);