1 /* FCE Ultra - NES/Famicom Emulator
\r
3 * Copyright notice for this file:
\r
4 * Copyright (C) 2006 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 uint16 addrreg;
\r
24 static uint8 datareg;
\r
26 static SFORMAT StateRegs[]=
\r
28 {&addrreg, 2, "AREG"},
\r
29 {&datareg, 1, "DREG"},
\r
34 static void Sync(void)
\r
36 uint16 base=((addrreg&0x60)>>2)|((addrreg&0x100)>>3);
\r
37 setprg16(0x8000,(datareg&7)|base);
\r
38 setprg16(0xC000,7|base);
\r
39 setmirror(((addrreg&2)>>1)^1);
\r
42 static DECLFW(BMCT262Write)
\r
44 if(busy||(A==0x8000))
\r
54 static void BMCT262Power(void)
\r
57 SetWriteHandler(0x8000,0xFFFF,BMCT262Write);
\r
58 SetReadHandler(0x8000,0xFFFF,CartBR);
\r
65 static void BMCT262Reset(void)
\r
73 static void BMCT262Restore(int version)
\r
78 void BMCT262_Init(CartInfo *info)
\r
80 info->Power=BMCT262Power;
\r
81 info->Reset=BMCT262Reset;
\r
82 GameStateRestore=BMCT262Restore;
\r
83 AddExState(&StateRegs, ~0, 0, 0);
\r