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
21 /* Not finished. Darn evil game... *Mumble*... */
28 static void DoPRG(void)
32 setprg8(0xC000,regs[4]);
33 setprg8(0xA000,regs[5]);
39 setprg8(0x8000,regs[4]);
40 setprg8(0xA000,regs[5]);
46 static void DoCHR(void)
48 uint32 base=(cmd&0x80)<<5;
50 setchr2(0x0000^base,regs[0]);
51 setchr2(0x0800^base,regs[2]);
53 setchr1(0x1000^base,regs[6]);
54 setchr1(0x1400^base,regs[1]);
55 setchr1(0x1800^base,regs[7]);
56 setchr1(0x1c00^base,regs[3]);
59 static DECLFW(H2288Write)
61 //printf("$%04x:$%02x, $%04x\n",A,V,X.PC.W);
65 case 0xa000:setmirror((V&1)^1);break;
66 case 0x8000:// DumpMem("out",0x0000,0xFFFF);
67 cmd=V;DoPRG();DoCHR();break;
68 case 0x8001:regs[cmd&7]=V;
69 if((cmd&7)==4 || (cmd&7)==5)
77 static DECLFR(H2288Read)
79 //printf("Rd: $%04x, $%04x\n",A,X.PC.W);
80 return((X.DB&0xFE)|(A&(A>>8)));
83 static void H2288Reset(void)
87 SetReadHandler(0x5800,0x5FFF,H2288Read);
88 SetReadHandler(0x8000,0xFFFF,CartBR);
89 SetWriteHandler(0x8000,0xFFFF,H2288Write);
90 for(x=0;x<8;x++) regs[x]=0;
98 BoardPower=H2288Reset;