notaz.gp2x.de
/
fceu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
merge mapper code from FCEUX
[fceu.git]
/
boards
/
karaoke.c
diff --git
a/boards/karaoke.c
b/boards/karaoke.c
index
eccf9c2
..
dfb4cc8
100644
(file)
--- a/
boards/karaoke.c
+++ b/
boards/karaoke.c
@@
-15,64
+15,57
@@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 5
9 Temple Place, Suite 330, Boston, MA 02111-1307
USA
+ * Foundation, Inc., 5
1 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
#include "mapinc.h"
*/
#include "mapinc.h"
-static uint8 DReg;
-static SFORMAT StateRegs[]=
-{
- {&DReg, 1, "DREG"},
- {0}
-};
+extern uint32 ROM_size;
+static uint8 latche;
static void Sync(void)
{
static void Sync(void)
{
- if(
DReg
)
+ if(
latche
)
{
{
- if(
DReg &
0x10)
- setprg16(0x8000,(
DReg
&7));
+ if(
latche&
0x10)
+ setprg16(0x8000,(
latche
&7));
else
else
- setprg16(0x8000,(
DReg
&7)|8);
+ setprg16(0x8000,(
latche
&7)|8);
}
else
}
else
- setprg16(0x8000,7);
-}
-
-static void StateRestore(int version)
-{
- Sync();
+ setprg16(0x8000,7+(ROM_size>>4));
}
static DECLFW(M188Write)
{
}
static DECLFW(M188Write)
{
-
DReg
=V;
+
latche
=V;
Sync();
}
Sync();
}
-static DECLFR(
testr
)
+static DECLFR(
ExtDev
)
{
return(3);
}
{
return(3);
}
-
static void Power(void)
{
static void Power(void)
{
- setchr8(0);
- setprg8(0xc000,0xE);
- setprg8(0xe000,0xF);
- DReg = 0;
+ latche=0;
Sync();
Sync();
- SetReadHandler(0x6000,0x7FFF,testr);
+ setchr8(0);
+ setprg16(0xc000,0x7);
+ SetReadHandler(0x6000,0x7FFF,ExtDev);
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0x8000,0xFFFF,M188Write);
}
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0x8000,0xFFFF,M188Write);
}
+static void StateRestore(int version)
+{
+ Sync();
+}
void Mapper188_Init(CartInfo *info)
{
info->Power=Power;
GameStateRestore=StateRestore;
void Mapper188_Init(CartInfo *info)
{
info->Power=Power;
GameStateRestore=StateRestore;
- AddExState(&
StateRegs, ~0, 0, 0
);
+ AddExState(&
latche, 1, 0, "LATCH"
);
}
}