1 /* FCE Ultra - NES/Famicom Emulator
3 * Copyright notice for this file:
4 * Copyright (C) 2002 Xodnizel
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
25 static uint8 CCache[8];
27 static void Fudou_PPU(uint32 A)
50 CCache[0]=CCache[1]=mapbyte2[0]>>7;
51 CCache[2]=CCache[3]=mapbyte2[1]>>7;
54 CCache[4+x]=mapbyte2[2+x]>>7;
56 onemir(CCache[lastA]);
59 MIRROR_SET2(mapbyte1[0]&1);
62 static DECLFW(Mapper80_write)
66 case 0x7ef0: mapbyte2[0]=V;VROM_BANK2(0x0000,(V>>1)&0x3F);mira();break;
67 case 0x7ef1: mapbyte2[1]=V;VROM_BANK2(0x0800,(V>>1)&0x3f);mira();break;
69 case 0x7ef2: mapbyte2[2]=V;VROM_BANK1(0x1000,V);mira();break;
70 case 0x7ef3: mapbyte2[3]=V;VROM_BANK1(0x1400,V);mira();break;
71 case 0x7ef4: mapbyte2[4]=V;VROM_BANK1(0x1800,V);mira();break;
72 case 0x7ef5: mapbyte2[5]=V;VROM_BANK1(0x1c00,V);mira();break;
73 case 0x7ef6: mapbyte1[0]=V;mira();break;
75 case 0x7efb: ROM_BANK8(0x8000,V);break;
77 case 0x7efc: ROM_BANK8(0xA000,V);break;
79 case 0x7eff: ROM_BANK8(0xC000,V);break;
83 static void booga(int version)
88 void Mapper80_init(void)
90 SetWriteHandler(0x4020,0x7eff,Mapper80_write);// 7f00-7fff battery backed ram inside mapper chip,
\r
91 // controlled by 7ef8 register, A8 - enable, FF - disable (?)
\r
92 MapStateRestore=booga;
96 void Mapper207_init(void)