1 /* FCE Ultra - NES/Famicom Emulator
\r
3 * Copyright notice for this file:
\r
4 * Copyright (C) 2005 CaH4e3
\r
6 * This program is free software; you can redistribute it and/or modify
\r
7 * it under the terms of the GNU General Public License as published by
\r
8 * the Free Software Foundation; either version 2 of the License, or
\r
9 * (at your option) any later version.
\r
11 * This program is distributed in the hope that it will be useful,
\r
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 * GNU General Public License for more details.
\r
16 * You should have received a copy of the GNU General Public License
\r
17 * along with this program; if not, write to the Free Software
\r
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
\r
24 static uint8 *DummyCHR=NULL;
\r
25 static uint8 datareg;
\r
26 static void(*Sync)(void);
\r
29 static SFORMAT StateRegs[]=
\r
31 {&datareg, 1, "DREG"},
\r
36 //1 0x0F, 0xF0 - Bird Week
\r
37 //2 0x33, 0x00 - B-Wings
\r
38 //3 0x11, 0x00 - Mighty Bomb Jack
\r
39 //4 0x22, 0x20 - Sansuu 1 Nen, Sansuu 2 Nen
\r
40 //5 0xFF, 0x00 - Sansuu 3 Nen
\r
41 //6 0x21, 0x13 - Spy vs Spy
\r
42 //7 0x20, 0x21 - Seicross
\r
44 static void Sync185(void)
\r
46 // little dirty eh? ;_)
\r
47 if((datareg&3)&&(datareg!=0x13)) // 1, 2, 3, 4, 5, 6
\r
53 static void Sync181(void)
\r
55 if(!(datareg&1)) // 7
\r
61 static DECLFW(MWrite)
\r
67 static void MPower(void)
\r
72 setprg16(0xC000,~0);
\r
73 SetWriteHandler(0x8000,0xFFFF,MWrite);
\r
74 SetReadHandler(0x8000,0xFFFF,CartBR);
\r
77 static void MClose(void)
\r
80 FCEU_gfree(DummyCHR);
\r
84 static void MRestore(int version)
\r
89 void Mapper185_Init(CartInfo *info)
\r
95 GameStateRestore=MRestore;
\r
96 DummyCHR=(uint8*)FCEU_gmalloc(8192);
\r
99 SetupCartCHRMapping(0x10,DummyCHR,8192,0);
\r
100 AddExState(StateRegs, ~0, 0, 0);
\r
103 void Mapper181_Init(CartInfo *info)
\r
107 info->Power=MPower;
\r
108 info->Close=MClose;
\r
109 GameStateRestore=MRestore;
\r
110 DummyCHR=(uint8*)FCEU_gmalloc(8192);
\r
111 for(x=0;x<8192;x++)
\r
113 SetupCartCHRMapping(0x10,DummyCHR,8192,0);
\r
114 AddExState(StateRegs, ~0, 0, 0);
\r