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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
\r
23 static uint8 is_large_banks, hw_switch;
\r
24 static uint8 large_bank;
\r
25 static uint8 prg_bank;
\r
26 static uint8 chr_bank;
\r
27 static uint8 bank_mode;
\r
28 static uint8 mirroring;
\r
29 static SFORMAT StateRegs[]=
\r
31 {&large_bank, 1, "LB"},
\r
32 {&hw_switch, 1, "DPSW"},
\r
33 {&prg_bank, 1, "PRG"},
\r
34 {&chr_bank, 1, "CHR"},
\r
35 {&bank_mode, 1, "BM"},
\r
36 {&mirroring, 1, "MIRR"},
\r
40 static void Sync(void)
\r
45 case 0x10: setprg16(0x8000,large_bank|prg_bank);
\r
46 setprg16(0xC000,large_bank|7);
\r
48 case 0x20: setprg32(0x8000,(large_bank|prg_bank)>>1);
\r
50 case 0x30: setprg16(0x8000,large_bank|prg_bank);
\r
51 setprg16(0xC000,large_bank|prg_bank);
\r
54 setmirror(mirroring);
\r
59 static DECLFR(BMC70in1Read)
\r
62 // if(is_large_banks)
\r
63 return CartBR((A&0xFFF0)|hw_switch);
\r
65 // return CartBR((A&0xFFF0)|hw_switch);
\r
70 static DECLFW(BMC70in1Write)
\r
79 mirroring=((A&0x20)>>5)^1;
\r
81 large_bank=(A&3)<<3;
\r
88 static void BMC70in1Reset(void)
\r
97 static void BMC70in1Power(void)
\r
103 SetReadHandler(0x8000,0xFFFF,BMC70in1Read);
\r
104 SetWriteHandler(0x8000,0xffff,BMC70in1Write);
\r
107 static void StateRestore(int version)
\r
112 void BMC70in1_Init(CartInfo *info)
\r
116 info->Power=BMC70in1Power;
\r
117 info->Reset=BMC70in1Reset;
\r
118 GameStateRestore=StateRestore;
\r
119 AddExState(&StateRegs, ~0, 0, 0);
\r
122 void BMC70in1B_Init(CartInfo *info)
\r
126 info->Power=BMC70in1Power;
\r
127 info->Reset=BMC70in1Reset;
\r
128 GameStateRestore=StateRestore;
\r
129 AddExState(&StateRegs, ~0, 0, 0);
\r