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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 static void DoPRG(void)
26 int32 b=((rg[0]>>1)&0xF) | ((rg[0]>>3)&0x10) | ((rg[1]&1)<<5);
27 if(rg[0]&0x20) // 16 KB
29 ROM_BANK16(0x8000,(b<<1)|(rg[0]&1));
30 ROM_BANK16(0xC000,(b<<1)|(rg[0]&1));
36 static DECLFW(Mapper226_write)
43 PPUCHRRAM=0; // Write protected.
45 PPUCHRRAM=0xFF; // Not write protected.
48 MIRROR_SET2((rg[0]>>6)&1);
51 static void M26Reset(void)
59 static void M26Restore(int version)
63 PPUCHRRAM=0; // Write protected.
65 PPUCHRRAM=0xFF; // Not write protected.
66 MIRROR_SET2((rg[0]>>6)&1);
69 void Mapper226_init(void)
71 SetWriteHandler(0x8000,0xffff,Mapper226_write);
73 GameStateRestore=M26Restore;
77 #ifdef OLD // What the heck is this??
78 DECLFW(Mapper226_write)
80 MIRROR_SET((A>>13)&1);
86 ROM_BANK16(0x8000,(((A>>7))<<1)+1);
87 ROM_BANK16(0xC000,(((A>>7))<<1)+1);
91 ROM_BANK16(0x8000,(((A>>7))<<1));
92 ROM_BANK16(0xC000,(((A>>7))<<1));
101 void Mapper226_init(void)
103 SetWriteHandler(0x8000,0xffff,Mapper226_write);