1 /* FCE Ultra - NES/Famicom Emulator
3 * Copyright notice for this file:
4 * Copyright (C) 2002 Ben Parnell
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));
37 static DECLFW(Mapper226_write)
44 PPUCHRRAM=0; // Write protected.
46 PPUCHRRAM=0xFF; // Not write protected.
49 MIRROR_SET2((rg[0]>>6)&1);
52 static void M26Reset(void)
60 static void M26Restore(int version)
64 PPUCHRRAM=0; // Write protected.
66 PPUCHRRAM=0xFF; // Not write protected.
67 MIRROR_SET2((rg[0]>>6)&1);
70 void Mapper226_init(void)
72 SetWriteHandler(0x8000,0xffff,Mapper226_write);
74 GameStateRestore=M26Restore;
78 #ifdef OLD // What the heck is this??
79 DECLFW(Mapper226_write)
81 MIRROR_SET((A>>13)&1);
87 ROM_BANK16(0x8000,(((A>>7))<<1)+1);
88 ROM_BANK16(0xC000,(((A>>7))<<1)+1);
92 ROM_BANK16(0x8000,(((A>>7))<<1));
93 ROM_BANK16(0xC000,(((A>>7))<<1));
102 void Mapper226_init(void)
104 SetWriteHandler(0x8000,0xffff,Mapper226_write);