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
23 #define ctrl mapbyte1[6]
25 static void DoCHR(void)
30 VROM_BANK2((x<<11)|((ctrl&2)<<11),mapbyte1[x]>>1);
32 VROM_BANK1((x<<10) | (((ctrl&2)^2)<<11),mapbyte1[2+x]);
35 static DECLFW(Mapper82_write)
49 case 0x7efa:V>>=2;mapbyte2[0]=V;ROM_BANK8(0x8000,V);break;
50 case 0x7efb:V>>=2;mapbyte2[1]=V;ROM_BANK8(0xa000,V);break;
51 case 0x7efc:V>>=2;mapbyte2[2]=V;ROM_BANK8(0xc000,V);break;
55 void Mapper82_init(void)
59 /* external WRAM might end at $73FF */
60 SetWriteHandler(0x7ef0,0x7efc,Mapper82_write);