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
23 static void Fixerit(void)
27 case 0:vnapage[0]=vnapage[2]=VROM+(((mapbyte1[0]|128)&CHRmask1[0])<<10);
28 vnapage[1]=vnapage[3]=VROM+(((mapbyte1[1]|128)&CHRmask1[0])<<10);
30 case 1:vnapage[0]=vnapage[1]=VROM+(((mapbyte1[0]|128)&CHRmask1[0])<<10);
31 vnapage[2]=vnapage[3]=VROM+(((mapbyte1[1]|128)&CHRmask1[0])<<10);
33 case 2:vnapage[0]=vnapage[1]=vnapage[2]=vnapage[3]=VROM+(((mapbyte1[0]|128)&CHRmask1[0])<<10);
35 case 3:vnapage[0]=vnapage[1]=vnapage[2]=vnapage[3]=VROM+(((mapbyte1[1]|128)&CHRmask1[0])<<10);
40 DECLFW(Mapper68_write)
44 if(A>=0x8000 && A<=0xB000)
46 VROM_BANK2((A-0x8000)>>1,V);
50 case 0xc000:mapbyte1[0]=V;
51 if(VROM_size && mapbyte2[0]&0x10)
55 case 0xd000:mapbyte1[1]=V;
56 if(VROM_size && mapbyte2[0]&0x10)
60 case 0xe000: mapbyte2[0]=V;
65 case 0:MIRROR_SET2(1);break;
66 case 1:MIRROR_SET2(0);break;
67 case 2:onemir(0);break;
68 case 3:onemir(1);break;
77 case 0xf000: ROM_BANK16(0x8000,V);break;
81 static void Mapper68_StateRestore(int version)
83 if(!(mapbyte2[0]&0x10))
87 case 0:MIRROR_SET(0);break;
88 case 1:MIRROR_SET(1);break;
89 case 2:onemir(0);break;
90 case 3:onemir(1);break;
100 void Mapper68_init(void)
102 SetWriteHandler(0x8000,0xffff,Mapper68_write);
103 MapStateRestore=Mapper68_StateRestore;