1 /* FCE Ultra - NES/Famicom Emulator
\r
3 * Copyright notice for this file:
\r
4 * Copyright (C) 1998 BERO
\r
5 * Copyright (C) 2002 Xodnizel
\r
6 * Copyright (C) 2012 CaH4e3
\r
8 * This program is free software; you can redistribute it and/or modify
\r
9 * it under the terms of the GNU General Public License as published by
\r
10 * the Free Software Foundation; either version 2 of the License, or
\r
11 * (at your option) any later version.
\r
13 * This program is distributed in the hope that it will be useful,
\r
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
16 * GNU General Public License for more details.
\r
18 * You should have received a copy of the GNU General Public License
\r
19 * along with this program; if not, write to the Free Software
\r
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
\r
24 * I might want to add some code to the mapper 96 PPU hook function
\r
25 * to not change CHR banks if the attribute table is being accessed,
\r
26 * if I make emulation a little more accurate in the future.
\r
32 static uint8 reg, ppulatch;
\r
34 static SFORMAT StateRegs[]=
\r
37 {&ppulatch, 1, "PPUL"},
\r
41 static void Sync(void)
\r
44 setprg32(0x8000,reg & 3);
\r
45 setchr4(0x0000,(reg & 4) | ppulatch);
\r
46 setchr4(0x1000,(reg & 4) | 3);
\r
49 static DECLFW(M96Write)
\r
55 static void FP_FASTAPASS(1) M96Hook(uint32 A)
\r
57 if((A & 0x3000) == 0x2000)
\r
59 ppulatch = (A>>8) & 3;
\r
64 static void M96Power(void)
\r
68 SetReadHandler(0x8000,0xffff,CartBR);
\r
69 SetWriteHandler(0x8000,0xffff,M96Write);
\r
72 static void StateRestore(int version)
\r
77 void Mapper96_Init(CartInfo *info)
\r
79 info->Power=M96Power;
\r
81 GameStateRestore=StateRestore;
\r
82 AddExState(&StateRegs, ~0, 0, 0);
\r