1
/* FCE Ultra - NES/Famicom Emulator
3
* Copyright notice for this file:
4
* Copyright (C) 2008 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
21
// T-227-1, 820632, MMC3 based, multimenu, 60000in1 (0010) dip switches
26
static uint8 reset_flag = 0x07;
28
static void BMCT2271CW(uint32 A, uint8 V)
34
va|=(EXPREGS[0]&0x10)<<4;
39
va|=(EXPREGS[0]&0x18)<<4;
44
static void BMCT2271PW(uint32 A, uint8 V)
51
va|=(EXPREGS[0]&0x10)<<1;
56
va|=(EXPREGS[0]&0x18)<<1;
60
case 0x00: setprg8(A,va); break;
63
va=(va&0xFD)|((EXPREGS[0]&4)>>1);
66
setprg16(0x8000,va >> 1);
67
setprg16(0xC000,va >> 1);
72
case 0x03: if(A<0xC000) setprg32(0x8000,va >> 2); break;
77
static DECLFW(BMCT2271LoWrite)
79
if(!(EXPREGS[0]&0x80))
80
EXPREGS[0] = A & 0xFF;
85
static DECLFR(BMCT2271HiRead)
88
if(EXPREGS[0]&0x40) av = (av & 0xFFF0)|reset_flag;
92
static void BMCT2271Reset(void)
100
static void BMCT2271Power(void)
104
SetWriteHandler(0x6000,0x7FFF,BMCT2271LoWrite);
105
SetReadHandler(0x8000,0xFFFF,BMCT2271HiRead);
108
void BMCT2271_Init(CartInfo *info)
110
GenMMC3_Init(info, 128, 128, 8, 0);
113
info->Power=BMCT2271Power;
114
info->Reset=BMCT2271Reset;
115
AddExState(EXPREGS, 1, 0, "EXPR");