1 /* FCE Ultra - NES/Famicom Emulator
\r
3 * Copyright notice for this file:
\r
4 * Copyright (C) 2006 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
\r
20 * 700in1 and 400in1 carts
\r
27 static uint16 cmd, bank;
\r
29 static SFORMAT StateRegs[]=
\r
36 static void Sync(void)
\r
38 setmirror((cmd&1)^1);
\r
44 setprg16(0x8000,((cmd&0xfc)>>2)|bank);
\r
45 setprg16(0xC000,((cmd&0xfc)>>2)|7);
\r
49 setprg16(0x8000,((cmd&0xfc)>>2)|(bank&6));
\r
50 setprg16(0xC000,((cmd&0xfc)>>2)|((bank&6)|1));
\r
55 setprg16(0x8000,((cmd&0xfc)>>2)|bank);
\r
56 setprg16(0xC000,((cmd&0xfc)>>2)|bank);
\r
60 static uint16 ass = 0;
\r
62 static DECLFW(UNLN625092WriteCommand)
\r
67 setprg16(0x8000,ass);
\r
68 setprg16(0xC000,ass);
\r
76 static DECLFW(UNLN625092WriteBank)
\r
82 static void UNLN625092Power(void)
\r
87 SetReadHandler(0x8000,0xFFFF,CartBR);
\r
88 SetWriteHandler(0x8000,0xBFFF,UNLN625092WriteCommand);
\r
89 SetWriteHandler(0xC000,0xFFFF,UNLN625092WriteBank);
\r
92 static void UNLN625092Reset(void)
\r
97 FCEU_printf("%04x\n",ass);
\r
100 static void StateRestore(int version)
\r
105 void UNLN625092_Init(CartInfo *info)
\r
107 info->Reset=UNLN625092Reset;
\r
108 info->Power=UNLN625092Power;
\r
109 GameStateRestore=StateRestore;
\r
110 AddExState(&StateRegs, ~0, 0, 0);
\r