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
23 static void Fixerit(void)
27 case 0:vnapage[0]=vnapage[2]=CHRptr[0]+(((mapbyte1[0]|128)&CHRmask1[0])<<10);
28 vnapage[1]=vnapage[3]=CHRptr[0]+(((mapbyte1[1]|128)&CHRmask1[0])<<10);
30 case 1:vnapage[0]=vnapage[1]=CHRptr[0]+(((mapbyte1[0]|128)&CHRmask1[0])<<10);
31 vnapage[2]=vnapage[3]=CHRptr[0]+(((mapbyte1[1]|128)&CHRmask1[0])<<10);
33 case 2:vnapage[0]=vnapage[1]=vnapage[2]=vnapage[3]=CHRptr[0]+(((mapbyte1[0]|128)&CHRmask1[0])<<10);
35 case 3:vnapage[0]=vnapage[1]=vnapage[2]=vnapage[3]=CHRptr[0]+(((mapbyte1[1]|128)&CHRmask1[0])<<10);
40 DECLFW(Mapper68_write)
42 // FCEU_printf("%04x,%04x\n",A,V);
45 if(A>=0x8000 && A<=0xB000)
47 VROM_BANK2((A-0x8000)>>1,V);
51 case 0xc000:mapbyte1[0]=V;
52 if(VROM_size && mapbyte2[0]&0x10)
56 case 0xd000:mapbyte1[1]=V;
57 if(VROM_size && mapbyte2[0]&0x10)
61 case 0xe000: mapbyte2[0]=V;
66 case 0:MIRROR_SET2(1);break;
67 case 1:MIRROR_SET2(0);break;
68 case 2:onemir(0);break;
69 case 3:onemir(1);break;
78 case 0xf000: ROM_BANK16(0x8000,V);break;
82 static void Mapper68_StateRestore(int version)
84 if(!(mapbyte2[0]&0x10))
88 case 0:MIRROR_SET(0);break;
89 case 1:MIRROR_SET(1);break;
90 case 2:onemir(0);break;
91 case 3:onemir(1);break;
101 void Mapper68_init(void)
103 SetWriteHandler(0x8000,0xffff,Mapper68_write);
104 MapStateRestore=Mapper68_StateRestore;