implement namco 340 NT mirroring register (fixes wagyan land 3)

This commit is contained in:
zeromus 2018-05-26 20:44:46 -04:00
parent e5f98c7c57
commit c5bb44a37f
1 changed files with 19 additions and 1 deletions

View File

@ -57,9 +57,23 @@ static SFORMAT N106_StateRegs[] = {
{ PRG, 3, "PRG" },
{ CHR, 8, "CHR" },
{ NTAPage, 4, "NTA" },
{ &gorfus, 1, "GORF" },
{ &dopol, 1, "DOPO" },
{ &gorko, 1, "GORK" },
{ 0 }
};
static void SyncMirror()
{
switch(gorko) {
case 0: setmirror(MI_0); break;
case 1: setmirror(MI_V); break;
case 2: setmirror(MI_H); break;
case 3: setmirror(MI_0); break;
}
}
static void SyncPRG(void) {
setprg8(0x8000, PRG[0]);
setprg8(0xa000, PRG[1]);
@ -179,8 +193,11 @@ static DECLFW(Mapper19_write) {
X6502_IRQEnd(FCEU_IQEXT);
break;
case 0xE000:
gorko = V & 0xC0;
PRG[0] = V & 0x3F;
if(is210) {
gorko = V>>6;
SyncMirror();
}
SyncPRG();
break;
case 0xE800:
@ -333,6 +350,7 @@ static void Mapper19_StateRestore(int version) {
SyncPRG();
FixNTAR();
FixCRR();
SyncMirror();
int x;
for (x = 0x40; x < 0x80; x++)
FixCache(x, IRAM[x]);