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
24 static uint8 *CHRRAM = NULL;
25 static int masko8[8]={63,31,15,1,3,0,0,0};
27 static void Super24PW(uint32 A, uint8 V)
29 uint32 NV=V&masko8[EXPREGS[0]&7];
31 setprg8r((NV>>6)&0xF,A,NV);
34 static void Super24CW(uint32 A, uint8 V)
40 uint32 NV=V|(EXPREGS[2]<<3);
41 setchr1r((NV>>9)&0xF,A,NV);
45 static DECLFW(Super24Write)
49 case 0x5FF0: EXPREGS[0]=V;
53 case 0x5FF1: EXPREGS[1]=V;
56 case 0x5FF2: EXPREGS[2]=V;
62 static void Super24Power(void)
68 SetWriteHandler(0x5000,0x7FFF,Super24Write);
69 SetReadHandler(0x8000,0xFFFF,CartBR);
72 static void Super24Reset(void)
80 static void Super24Close(void)
87 void Super24_Init(CartInfo *info)
89 GenMMC3_Init(info, 128, 256, 0, 0);
90 info->Power=Super24Power;
91 info->Reset=Super24Reset;
92 info->Close=Super24Close;
95 CHRRAM=(uint8*)FCEU_gmalloc(8192);
96 SetupCartCHRMapping(0x10, CHRRAM, 8192, 1);
97 AddExState(CHRRAM, 8192, 0, "CHRR");
98 AddExState(EXPREGS, 3, 0, "BIG2");