1 /* FCE Ultra - NES/Famicom Emulator
3 * Copyright notice for this file:
4 * Copyright (C) 2006 CaH4e3
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
25 static uint8 *WRAM=NULL;
26 static uint32 WRAMSIZE;
27 static uint8 *CHRRAM=NULL;
28 static uint32 CHRRAMSIZE;
31 static SFORMAT StateRegs[]=
37 static void Sync(void)
41 static DECLFW(MNNNWrite)
45 static void MNNNPower(void)
47 SetReadHandler(0x8000,0xFFFF,CartBR);
48 SetWriteHandler(0x8000,0xFFFF,MNNNWrite);
51 static void MNNNReset(void)
56 static void MNNNClose(void)
66 static void MNNNIRQHook(void)
68 X6502_IRQBegin(FCEU_IQEXT);
71 static void StateRestore(int version)
76 void MapperNNN_Init(CartInfo *info)
78 info->Reset=MNNNReset;
79 info->Power=MNNNPower;
80 // info->Close=MNNNClose;
81 GameHBIRQHook=MNNNIRQHook;
82 GameStateRestore=StateRestore;
85 CHRRAM=(uint8*)FCEU_gmalloc(CHRRAMSIZE);
86 SetupCartPRGMapping(0x10,CHRRAM,CHRRAMSIZE,1);
87 AddExState(CHRRAM, CHRRAMSIZE, 0, "WRAM");
91 WRAM=(uint8*)FCEU_gmalloc(WRAMSIZE);
92 SetupCartPRGMapping(0x10,WRAM,WRAMSIZE,1);
93 AddExState(WRAM, WRAMSIZE, 0, "WRAM");
95 AddExState(&StateRegs, ~0, 0, 0);