notaz.gp2x.de
/
fceu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
release r2, update credits
[fceu.git]
/
mappers
/
228.c
diff --git
a/mappers/228.c
b/mappers/228.c
index
e38063d
..
d08485a
100644
(file)
--- a/
mappers/228.c
+++ b/
mappers/228.c
@@
-1,7
+1,7
@@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
- * Copyright (C) 2002
Ben Parnel
l
+ * Copyright (C) 2002
Xodnize
l
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-20,34
+20,51
@@
#include "mapinc.h"
#include "mapinc.h"
+//16 bits of ram in total
+//only use bottom 4 bits as ram though
+static uint8 mapper228_ram[4];
+
+static DECLFR(Mapper228_read)
+{
+ return mapper228_ram[A & 3] & 0xF;
+}
+
static DECLFW(Mapper228_write)
{
uint32 page,pagel,pageh;
static DECLFW(Mapper228_write)
{
uint32 page,pagel,pageh;
+ //write to ram
+ if (A < 0x6000)
+ {
+ mapper228_ram[A & 3] = V;
+ return;
+ }
MIRROR_SET((A>>13)&1);
MIRROR_SET((A>>13)&1);
-
page=(A>>7)&0x3F;
page=(A>>7)&0x3F;
+
if((page&0x30)==0x30)
page-=0x10;
if((page&0x30)==0x30)
page-=0x10;
-
+
pagel=pageh=(page<<1) + (((A>>6)&1)&((A>>5)&1));
pageh+=((A>>5)&1)^1;
ROM_BANK16(0x8000,pagel);
ROM_BANK16(0xC000,pageh);
VROM_BANK8( (V&0x3) | ((A&0xF)<<2) );
pagel=pageh=(page<<1) + (((A>>6)&1)&((A>>5)&1));
pageh+=((A>>5)&1)^1;
ROM_BANK16(0x8000,pagel);
ROM_BANK16(0xC000,pageh);
VROM_BANK8( (V&0x3) | ((A&0xF)<<2) );
- X6502_Rebase();
}
static void A52Reset(void)
{
}
static void A52Reset(void)
{
-
Mapper228_write(0,
0);
+
Mapper228_write(0x8000,
0);
}
void Mapper228_init(void)
{
MapperReset=A52Reset;
A52Reset();
}
void Mapper228_init(void)
{
MapperReset=A52Reset;
A52Reset();
- SetWriteHandler(0x8000,0xffff,Mapper228_write);
+ SetWriteHandler(0x8000, 0xFFFF, Mapper228_write);
+ SetWriteHandler(0x4020, 0x5FFF, Mapper228_write);
+ SetReadHandler (0x4020, 0x5FFF, Mapper228_read);
+ AddExState(mapper228_ram, 4, 0, "MRAM");
}
}