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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 static uint8 *CHRRAM = NULL; // there is no more extern CHRRAM in mmc3.h
25 // I need chrram here and local static == local
26 static int masko8[8]={63,31,15,1,3,0,0,0};
28 static void Super24PW(uint32 A, uint8 V)
30 uint32 NV=V&masko8[EXPREGS[0]&7];
32 setprg8r((NV>>6)&0xF,A,NV);
35 static void Super24CW(uint32 A, uint8 V)
41 uint32 NV=V|(EXPREGS[2]<<3);
42 setchr1r((NV>>9)&0xF,A,NV);
46 static DECLFW(Super24Write)
50 case 0x5FF0: EXPREGS[0]=V;
54 case 0x5FF1: EXPREGS[1]=V;
57 case 0x5FF2: EXPREGS[2]=V;
63 static void Super24Power(void)
69 SetWriteHandler(0x5000,0x7FFF,Super24Write);
70 SetReadHandler(0x8000,0xFFFF,CartBR);
73 static void Super24Reset(void)
81 static void Super24Close(void)
88 void Super24_Init(CartInfo *info)
90 GenMMC3_Init(info, 128, 256, 0, 0);
91 info->Power=Super24Power;
92 info->Reset=Super24Reset;
93 info->Close=Super24Close;
96 CHRRAM=(uint8*)FCEU_gmalloc(8192);
97 SetupCartCHRMapping(0x10, CHRRAM, 8192, 1);
98 AddExState(CHRRAM, 8192, 0, "CHRR");
99 AddExState(EXPREGS, 3, 0, "BIG2");