1
/* FCE Ultra - NES/Famicom Emulator
3
* Copyright notice for this file:
4
* Copyright (C) 2007 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
23
static uint8 reg[4], IRQa;
24
static int16 IRQCount, IRQPause;
26
static int16 Count = 0x0000;
28
static SFORMAT StateRegs[]=
32
{&IRQCount, 2, "IRQC"},
36
static void Sync(void)
42
//#define Count 0x1800
45
static DECLFW(UNL3DBlockWrite)
53
case 0x4800: reg[0]=V; break;
54
case 0x4900: reg[1]=V; break;
55
case 0x4a00: reg[2]=V; break;
56
case 0x4e00: reg[3]=V; IRQCount=Count; IRQPause=Pause; IRQa=1; X6502_IRQEnd(FCEU_IQEXT); break;
60
static void UNL3DBlockPower(void)
63
SetReadHandler(0x8000,0xFFFF,CartBR);
64
SetWriteHandler(0x4800,0x4E00,UNL3DBlockWrite);
67
static void UNL3DBlockReset(void)
70
FCEU_printf("Count=%04x\n",Count);
73
static void UNL3DBlockIRQHook(int a)
86
X6502_IRQBegin(FCEU_IQEXT);
92
X6502_IRQEnd(FCEU_IQEXT);
98
static void StateRestore(int version)
103
void UNL3DBlock_Init(CartInfo *info)
105
info->Power=UNL3DBlockPower;
106
info->Reset=UNL3DBlockReset;
107
MapIRQHook=UNL3DBlockIRQHook;
108
GameStateRestore=StateRestore;
109
AddExState(&StateRegs, ~0, 0, 0);