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 #define tkcom1 mapbyte1[1]
24 #define tkcom2 mapbyte1[2]
27 #define unkl (mapbyte2+4)
28 #define chrlow mapbyte3
29 #define chrhigh mapbyte4
31 static uint8 tekker=0x80;
33 static DECLFR(tekread)
38 static void tekprom(void)
43 ROM_BANK16(0x8000,prgb[0]);
44 ROM_BANK16(0xC000,prgb[2]);
49 ROM_BANK8(0x8000,prgb[0]);
50 ROM_BANK8(0xa000,prgb[1]);
51 ROM_BANK8(0xc000,prgb[2]);
52 ROM_BANK8(0xe000,prgb[3]);
57 static void tekvrom(void)
63 VROM_BANK8(chrlow[0]|(chrhigh[0]<<8));
67 VROM_BANK4(x<<10,chrlow[x]|(chrhigh[x]<<8));
71 VROM_BANK2(x<<10,chrlow[x]|(chrhigh[x]<<8));
75 VROM_BANK1(x<<10,chrlow[x]|(chrhigh[x]<<8));
80 static DECLFW(Mapper90_write)
84 if(A>=0x8000 && A<=0x8003)
89 else if(A>=0x9000 && A<=0x9007)
94 else if(A>=0xa000 && A<=0xa007)
99 else if(A>=0xb000 && A<=0xb003)
106 case 0xc000:IRQLatch=V;break;
109 case 0xc001:X6502_IRQEnd(FCEU_IQEXT);
112 case 0xc002:X6502_IRQEnd(FCEU_IQEXT);
117 case 0xc003:IRQa=1;break;
119 case 0xd000:tkcom1=V;break;
120 case 0xd001:switch(V&3){
121 case 0x00:MIRROR_SET(0);break;
122 case 0x01:MIRROR_SET(1);break;
123 case 0x02:onemir(0);break;
124 case 0x03:onemir(1);break;
131 static void Mapper90_hb(void)
140 X6502_IRQBegin(FCEU_IQEXT);
147 void Mapper90_init(void)
150 SetWriteHandler(0x8000,0xffff,Mapper90_write);
151 SetReadHandler(0x5000,0x5000,tekread);
152 GameHBIRQHook=Mapper90_hb;