mapper 21, 22, 25 boardification, merged to one vrc board source

This commit is contained in:
CaH4e3 2012-10-27 15:07:35 +00:00
parent 89d7da894f
commit 13e88c076d
14 changed files with 283 additions and 546 deletions

View File

@ -1,204 +0,0 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2007 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "mapinc.h"
static uint8 is23;
static uint16 IRQCount;
static uint8 IRQLatch,IRQa;
static uint8 prgreg[2];
static uint8 chrreg[8];
static uint8 regcmd, irqcmd, mirr, big_bank;
static uint16 acount=0;
static uint8 *WRAM=NULL;
static uint32 WRAMSIZE;
static SFORMAT StateRegs[]=
{
{prgreg, 2, "PREG"},
{chrreg, 8, "CREG"},
{&regcmd, 1, "CMDR"},
{&irqcmd, 1, "CMDI"},
{&mirr, 1, "MIRR"},
{&big_bank, 1, "BIGB"},
{&IRQCount, 2, "IRQC"},
{&IRQLatch, 1, "IRQL"},
{&IRQa, 1, "IRQA"},
{0}
};
static void Sync(void)
{
if(regcmd&2)
{
setprg8(0xC000,prgreg[0]|big_bank);
setprg8(0x8000,((~1)&0x1F)|big_bank);
}
else
{
setprg8(0x8000,prgreg[0]|big_bank);
setprg8(0xC000,((~1)&0x1F)|big_bank);
}
setprg8(0xA000,prgreg[1]|big_bank);
setprg8(0xE000,((~0)&0x1F)|big_bank);
if(UNIFchrrama)
setchr8(0);
else
{
uint8 i;
for(i=0; i<8; i++)
setchr1(i<<10, chrreg[i]);
}
switch(mirr&0x3)
{
case 0: setmirror(MI_V); break;
case 1: setmirror(MI_H); break;
case 2: setmirror(MI_0); break;
case 3: setmirror(MI_1); break;
}
}
static DECLFW(M23Write)
{
// FCEU_printf("%04x:%04x\n",A,V);
A|=((A>>2)&0x3)|((A>>4)&0x3)|((A>>6)&0x3); // actually there is many-in-one mapper source, some pirate or
// licensed games use various address bits for registers
A&=0xF003;
if((A>=0xB000)&&(A<=0xE003))
{
if(UNIFchrrama)
big_bank=(V&8)<<2; // my personally many-in-one feature ;) just for support pirate cart 2-in-1
else
{
uint16 i=((A>>1)&1)|((A-0xB000)>>11);
chrreg[i]&=(0xF0)>>((A&1)<<2);
chrreg[i]|=(V&0xF)<<((A&1)<<2);
}
Sync();
}
else
switch(A&0xF003)
{
case 0x8000:
case 0x8001:
case 0x8002:
case 0x8003: if(is23)
prgreg[0]=V&0x1F;
Sync();
break;
case 0xA000:
case 0xA001:
case 0xA002:
case 0xA003: if(is23)
prgreg[1]=V&0x1F;
else
{
prgreg[0]=(V<<1)&0x1F;
prgreg[1]=((V<<1)&0x1F)|1;
}
Sync();
break;
case 0x9000:
case 0x9001: if(V!=0xFF) mirr=V; Sync(); break;
case 0x9002:
case 0x9003: regcmd=V; Sync(); break;
case 0xF000: X6502_IRQEnd(FCEU_IQEXT); IRQLatch&=0xF0; IRQLatch|=V&0xF; break;
case 0xF001: X6502_IRQEnd(FCEU_IQEXT); IRQLatch&=0x0F; IRQLatch|=V<<4; break;
case 0xF002: X6502_IRQEnd(FCEU_IQEXT); acount=0; IRQCount=IRQLatch; IRQa=V&2; irqcmd=V&1; break;
case 0xF003: X6502_IRQEnd(FCEU_IQEXT); IRQa=irqcmd; break;
}
}
static void M23Power(void)
{
big_bank=0x20;
Sync();
setprg8r(0x10,0x6000,0); // another many-in-one code, WRAM actually contain only WaiWaiWorld game
SetReadHandler(0x6000,0x7FFF,CartBR);
SetWriteHandler(0x6000,0x7FFF,CartBW);
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0x8000,0xFFFF,M23Write);
}
void M23IRQHook(int a)
{
#define LCYCS 341
if(IRQa)
{
acount+=a*3;
if(acount>=LCYCS)
{
while(acount>=LCYCS)
{
acount-=LCYCS;
IRQCount++;
if(IRQCount&0x100)
{
X6502_IRQBegin(FCEU_IQEXT);
IRQCount=IRQLatch;
}
}
}
}
}
static void StateRestore(int version)
{
Sync();
}
static void M23Close(void)
{
if(WRAM)
FCEU_gfree(WRAM);
}
void Mapper23_Init(CartInfo *info)
{
is23=1;
info->Power=M23Power;
info->Close=M23Close;
MapIRQHook=M23IRQHook;
GameStateRestore=StateRestore;
WRAMSIZE=8192;
WRAM=(uint8*)FCEU_gmalloc(WRAMSIZE);
SetupCartPRGMapping(0x10,WRAM,WRAMSIZE,1);
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
AddExState(&StateRegs, ~0, 0, 0);
}
void UNLT230_Init(CartInfo *info)
{
is23=0;
info->Power=M23Power;
info->Close=M23Close;
MapIRQHook=M23IRQHook;
GameStateRestore=StateRestore;
WRAMSIZE=8192;
WRAM=(uint8*)FCEU_gmalloc(WRAMSIZE);
SetupCartPRGMapping(0x10,WRAM,WRAMSIZE,1);
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
AddExState(&StateRegs, ~0, 0, 0);
}

View File

@ -32,7 +32,6 @@ my_list = Split("""
208.cpp
222.cpp
225.cpp
23.cpp
235.cpp
253.cpp
34.cpp
@ -117,6 +116,7 @@ t-262.cpp
tengen.cpp
tf-1201.cpp
transformer.cpp
vrc2and4.cpp
vrc7.cpp
yoko.cpp
""")

261
src/boards/vrc2and4.cpp Normal file
View File

@ -0,0 +1,261 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2007 CaH4e3
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "mapinc.h"
static uint8 isPirate, is22;
static uint16 IRQCount;
static uint8 IRQLatch, IRQa;
static uint8 prgreg[2];
static uint8 chrreg[8];
static uint8 regcmd, irqcmd, mirr, big_bank;
static uint16 acount = 0;
static uint8 *WRAM = NULL;
static uint32 WRAMSIZE;
static SFORMAT StateRegs[] =
{
{ prgreg, 2, "PREG" },
{ chrreg, 8, "CREG" },
{ &regcmd, 1, "CMDR" },
{ &irqcmd, 1, "CMDI" },
{ &mirr, 1, "MIRR" },
{ &big_bank, 1, "BIGB" },
{ &IRQCount, 2, "IRQC" },
{ &IRQLatch, 1, "IRQL" },
{ &IRQa, 1, "IRQA" },
{ 0 }
};
static void Sync(void) {
if (regcmd & 2) {
setprg8(0xC000, prgreg[0] | big_bank);
setprg8(0x8000, ((~1) & 0x1F) | big_bank);
}else {
setprg8(0x8000, prgreg[0] | big_bank);
setprg8(0xC000, ((~1) & 0x1F) | big_bank);
}
setprg8(0xA000, prgreg[1] | big_bank);
setprg8(0xE000, ((~0) & 0x1F) | big_bank);
if (UNIFchrrama)
setchr8(0);
else{
uint8 i;
for (i = 0; i < 8; i++)
setchr1(i << 10, chrreg[i] >> is22);
}
switch (mirr & 0x3) {
case 0: setmirror(MI_V); break;
case 1: setmirror(MI_H); break;
case 2: setmirror(MI_0); break;
case 3: setmirror(MI_1); break;
}
}
static DECLFW(VRC24Write) {
A &= 0xF003;
if ((A >= 0xB000) && (A <= 0xE003)) {
if (UNIFchrrama)
big_bank = (V & 8) << 2; // my personally many-in-one feature ;) just for support pirate cart 2-in-1
else{
uint16 i = ((A >> 1) & 1) | ((A - 0xB000) >> 11);
chrreg[i] &= (0xF0) >> ((A & 1) << 2);
chrreg[i] |= (V & 0xF) << ((A & 1) << 2);
}
Sync();
}else
switch (A & 0xF003) {
case 0x8000:
case 0x8001:
case 0x8002:
case 0x8003:
if (!isPirate) {
prgreg[0] = V & 0x1F;
Sync();
}
break;
case 0xA000:
case 0xA001:
case 0xA002:
case 0xA003:
if (!isPirate)
prgreg[1] = V & 0x1F;
else{
prgreg[0] = (V << 1) & 0x1F;
prgreg[1] = ((V << 1) & 0x1F) | 1;
}
Sync();
break;
case 0x9000:
case 0x9001: if (V != 0xFF) mirr = V; Sync(); break;
case 0x9002:
case 0x9003: regcmd = V; Sync(); break;
case 0xF000: X6502_IRQEnd(FCEU_IQEXT); IRQLatch &= 0xF0; IRQLatch |= V & 0xF; break;
case 0xF001: X6502_IRQEnd(FCEU_IQEXT); IRQLatch &= 0x0F; IRQLatch |= V << 4; break;
case 0xF002: X6502_IRQEnd(FCEU_IQEXT); acount = 0; IRQCount = IRQLatch; IRQa = V & 2; irqcmd = V & 1; break;
case 0xF003: X6502_IRQEnd(FCEU_IQEXT); IRQa = irqcmd; break;
}
}
static DECLFW(M21Write) {
A = (A & 0xF000) | ((A >> 1) & 0x3); // Ganbare Goemon Gaiden 2 - Tenka no Zaihou (J) [!] isn't mapper 21 actually,
// it's mapper 23 by wirings
VRC24Write(A, V);
}
static DECLFW(M22Write) {
A |= ((A >> 2) & 0x3); // It's just swapped lines from 21 mapper
//
VRC24Write((A & 0xF000) | ((A >> 1) & 1) | ((A << 1) & 2), V);
}
static DECLFW(M23Write) {
A |= ((A >> 2) & 0x3) | ((A >> 4) & 0x3) | ((A >> 6) & 0x3);// actually there is many-in-one mapper source, some pirate or
// licensed games use various address bits for registers
VRC24Write(A, V);
}
static void M21Power(void) {
Sync();
SetReadHandler(0x8000, 0xFFFF, CartBR);
SetWriteHandler(0x8000, 0xFFFF, M21Write);
}
static void M22Power(void) {
Sync();
SetReadHandler(0x8000, 0xFFFF, CartBR);
SetWriteHandler(0x8000, 0xFFFF, M22Write);
}
static void M23Power(void) {
big_bank = 0x20;
Sync();
setprg8r(0x10, 0x6000, 0); // Only two Goemon games are have battery backed RAM, three more shooters
// (Parodius Da!, Gradius 2 and Crisis Force uses 2k or SRAM at 6000-67FF only
SetReadHandler(0x6000, 0x7FFF, CartBR);
SetWriteHandler(0x6000, 0x7FFF, CartBW);
SetReadHandler(0x8000, 0xFFFF, CartBR);
SetWriteHandler(0x8000, 0xFFFF, M23Write);
}
static void M25Power(void) {
big_bank = 0x20;
Sync();
setprg8r(0x10, 0x6000, 0);
SetReadHandler(0x6000, 0x7FFF, CartBR);
SetWriteHandler(0x6000, 0x7FFF, CartBW);
SetReadHandler(0x8000, 0xFFFF, CartBR);
SetWriteHandler(0x8000, 0xFFFF, M22Write);
}
void VRC24IRQHook(int a) {
#define LCYCS 341
if (IRQa) {
acount += a * 3;
if (acount >= LCYCS) {
while (acount >= LCYCS) {
acount -= LCYCS;
IRQCount++;
if (IRQCount & 0x100) {
X6502_IRQBegin(FCEU_IQEXT);
IRQCount = IRQLatch;
}
}
}
}
}
static void StateRestore(int version) {
Sync();
}
static void VRC24Close(void) {
if (WRAM)
FCEU_gfree(WRAM);
WRAM = NULL;
}
void Mapper21_Init(CartInfo *info) {
isPirate = 0;
is22 = 0;
info->Power = M21Power;
MapIRQHook = VRC24IRQHook;
GameStateRestore = StateRestore;
AddExState(&StateRegs, ~0, 0, 0);
}
void Mapper22_Init(CartInfo *info) {
isPirate = 0;
is22 = 1;
info->Power = M22Power;
GameStateRestore = StateRestore;
AddExState(&StateRegs, ~0, 0, 0);
}
void Mapper23_Init(CartInfo *info) {
isPirate = 0;
is22 = 0;
info->Power = M23Power;
info->Close = VRC24Close;
MapIRQHook = VRC24IRQHook;
GameStateRestore = StateRestore;
WRAMSIZE = 8192;
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
if(info->battery) {
info->SaveGame[0]=WRAM;
info->SaveGameLen[0]=WRAMSIZE;
}
AddExState(&StateRegs, ~0, 0, 0);
}
void Mapper25_Init(CartInfo *info) {
isPirate = 0;
is22 = 0;
info->Power = M25Power;
info->Close = VRC24Close;
MapIRQHook = VRC24IRQHook;
GameStateRestore = StateRestore;
WRAMSIZE = 8192;
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
if(info->battery) {
info->SaveGame[0]=WRAM;
info->SaveGameLen[0]=WRAMSIZE;
}
AddExState(&StateRegs, ~0, 0, 0);
}
void UNLT230_Init(CartInfo *info) {
isPirate = 1;
is22 = 0;
Mapper23_Init(info);
}

View File

@ -81,6 +81,7 @@
{0x6e68e31a, 16, 8}, /* Dragon Ball 3*/
{0x183859d2, 16, -1},
{0x33b899c9, 16, -1}, /* Dragon Ball - Dai Maou Fukkatsu (J) [!] */
{0x286fcd20, 23, -1}, /* Ganbare Goemon Gaiden 2 - Tenka no Zaihou (J) [!] */
{0x5555fca3, 32, 8},
{0x283ad224, 32, 8}, /* Ai Sensei no Oshiete */
{0x243a8735, 32, 0x10|4}, /* Major League */

View File

@ -545,11 +545,11 @@ static BMAPPINGLocal bmap[] = {
{"", 18, Mapper18_Init},
{"Namcot 106", 19, Mapper19_Init},
// {"", 20, Mapper20_Init},
// {"", 21, Mapper21_Init},
// {"", 22, Mapper22_Init},
{"Konami VRC2 type B", 23, Mapper23_Init},
// {"", 24, Mapper24_Init},
// {"", 25, Mapper25_Init},
{"Konami VRC2/VRC4", 21, Mapper21_Init},
{"Konami VRC2/VRC4", 22, Mapper22_Init},
{"Konami VRC2/VRC4", 23, Mapper23_Init},
// {"Konami VRC6", 24, Mapper24_Init},
{"Konami VRC2/VRC4", 25, Mapper25_Init},
// {"", 26, Mapper26_Init},
// {"", 27, Mapper27_Init},
// {"", 28, Mapper28_Init},
@ -1192,11 +1192,11 @@ void (*MapInitTab[256])(void)=
0, //Mapper18_init,
0,
0,
Mapper21_init,
Mapper22_init,
0, //Mapper21_init,
0, //Mapper22_init,
0, //Mapper23_init,
Mapper24_init,
Mapper25_init,
0, //Mapper25_init,
Mapper26_init,
Mapper27_init,
0,

View File

@ -166,11 +166,11 @@ void Mapper14_init(void);
//void Mapper18_init(void);
void Mapper19_init(void);
void Mapper20_init(void);
void Mapper21_init(void);
void Mapper22_init(void);
//void Mapper21_init(void);
//void Mapper22_init(void);
//void Mapper23_init(void);
void Mapper24_init(void);
void Mapper25_init(void);
//void Mapper25_init(void);
void Mapper26_init(void);
void Mapper27_init(void);
void Mapper28_init(void);
@ -378,7 +378,10 @@ void Mapper16_Init(CartInfo *);
void Mapper17_Init(CartInfo *);
void Mapper18_Init(CartInfo *);
void Mapper19_Init(CartInfo *);
void Mapper21_Init(CartInfo *);
void Mapper22_Init(CartInfo *);
void Mapper23_Init(CartInfo *);
void Mapper25_Init(CartInfo *);
void Mapper34_Init(CartInfo *);
void Mapper36_Init(CartInfo *);
void Mapper37_Init(CartInfo *);

View File

@ -1,106 +0,0 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2002 Xodnizel
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "mapinc.h"
#define K4buf mapbyte2
#define K4IRQ mapbyte1[1]
#define K4sel mapbyte1[0]
static int acount=0;
DECLFW(Mapper21_write)
{
A|=((A>>5)&0xF);
if((A&0xF000)==0xA000)
ROM_BANK8(0xA000,V);
else if((A&0xF000)==0x8000)
{
if(K4sel&2)
ROM_BANK8(0xC000,V);
else
ROM_BANK8(0x8000,V);
}
else if(A>=0xb000 && A<=0xefff)
{
A&=0xF006;
{
int x=((A>>2)&1)|((A-0xB000)>>11);
K4buf[x]&=(0xF0)>>((A&2)<<1);
K4buf[x]|=(V&0xF)<<((A&2)<<1);
VROM_BANK1(x<<10,K4buf[x]);
}
}
else switch(A&0xF006)
{
case 0x9000:
switch(V&0x3)
{
case 0:MIRROR_SET(0);break;
case 1:MIRROR_SET(1);break;
case 2:onemir(0);break;
case 3:onemir(1);break;
}
break;
case 0x9006:
case 0x9004:
case 0x9002:if((K4sel&2)!=(V&2))
{
uint8 swa;
swa=PRGBankList[0];
ROM_BANK8(0x8000,PRGBankList[2]);
ROM_BANK8(0xc000,swa);
}
K4sel=V;
break;
case 0xf000:IRQLatch&=0xF0;IRQLatch|=V&0xF;break;
case 0xf002:IRQLatch&=0x0F;IRQLatch|=V<<4;break;
case 0xf004:IRQCount=IRQLatch;acount=0;
IRQa=V&2;K4IRQ=V&1;
X6502_IRQEnd(FCEU_IQEXT);
break;
case 0xf006:IRQa=K4IRQ;X6502_IRQEnd(FCEU_IQEXT);break;
}
}
static void KonamiIRQHook(int a)
{
#define LCYCS ((227*2)+1)
//#define LCYCS 341
if(IRQa)
{
// acount+=a*3;
acount+=a*4;
if(acount>=LCYCS)
{
doagainbub:acount-=LCYCS;IRQCount++;
if(IRQCount&0x100) {X6502_IRQBegin(FCEU_IQEXT);IRQCount=IRQLatch;}
if(acount>=LCYCS) goto doagainbub;
}
}
}
void Mapper21_init(void)
{
SetWriteHandler(0x8000,0xffff,Mapper21_write);
MapIRQHook=KonamiIRQHook;
}

View File

@ -1,64 +0,0 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2002 Xodnizel
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* (VRC4 mapper)
*/
#include "mapinc.h"
#define K4buf mapbyte2
DECLFW(Mapper22_write)
{
if(A<=0xAFFF)
{
switch(A&0xF000)
{
case 0x8000:ROM_BANK8(0x8000,V);break;
case 0xa000:ROM_BANK8(0xA000,V);break;
case 0x9000:switch(V&3)
{
case 0x00:MIRROR_SET2(1);break;
case 0x01:MIRROR_SET2(0);break;
case 0x02:onemir(0);break;
case 0x03:onemir(1);break;
}
break;
}
}
else
{
A&=0xF003;
if(A>=0xb000 && A<=0xe003)
{
int x=(A&1)|((A-0xB000)>>11);
K4buf[x]&=(0xF0)>>((A&2)<<1);
K4buf[x]|=(V&0xF)<<((A&2)<<1);
VROM_BANK1(x<<10,K4buf[x]>>1);
}
}
}
void Mapper22_init(void)
{
SetWriteHandler(0x8000,0xffff,Mapper22_write);
}

View File

@ -1,115 +0,0 @@
/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2002 Xodnizel
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* (VRCII mapper)
*/
#include "mapinc.h"
#define K4buf mapbyte2
#define K4IRQ mapbyte1[1]
#define K4sel mapbyte1[0]
static int acount=0;
static int weirdo=0;
static DECLFW(Mapper25_write)
{
if(A==0xC007)
{
weirdo=8; // Ganbare Goemon Gaiden does strange things!!! at the end credits
// quick dirty hack, seems there is no other games with such PCB, so
// we never know if it will not work for something else lol
VROM_BANK1(0x0000,0xFC);
VROM_BANK1(0x0400,0xFD);
VROM_BANK1(0x0800,0xFF);
}
A=(A&0xF003)|((A&0xC)>>2);
if((A&0xF000)==0xA000)
ROM_BANK8(0xA000,V);
else if(A>=0xB000 && A<=0xEFFF)
{
int x=(A&1)|((A-0xB000)>>11);
K4buf[x]&=(0xF0)>>((A&2)<<1);
K4buf[x]|=(V&0xF)<<((A&2)<<1);
if(weirdo)
weirdo--;
else
VROM_BANK1(x<<10,K4buf[x]);
}
else if((A&0xF000)==0x8000)
{
if(K4sel&2)
ROM_BANK8(0xC000,V);
else
ROM_BANK8(0x8000,V);
}
else switch(A)
{
case 0x9000:switch(V&0x3)
{
case 0:MIRROR_SET(0);break;
case 1:MIRROR_SET(1);break;
case 2:onemir(0);break;
case 3:onemir(1);break;
}
break;
case 0x9001:if((K4sel&2)!=(V&2))
{
uint8 swa;
swa=PRGBankList[0];
ROM_BANK8(0x8000,PRGBankList[2]);
ROM_BANK8(0xc000,swa);
}
K4sel=V;
break;
case 0xf000:IRQLatch&=0xF0;IRQLatch|=V&0xF;break;
case 0xf002:IRQLatch&=0x0F;IRQLatch|=V<<4;break;
case 0xf001:IRQCount=IRQLatch;IRQa=V&2;K4IRQ=V&1;acount=0;X6502_IRQEnd(FCEU_IQEXT);break;
case 0xf003:IRQa=K4IRQ;X6502_IRQEnd(FCEU_IQEXT);break;
}
}
static void KonamiIRQHook(int a)
{
// #define LCYCS ((227*2))
#define LCYCS 341
if(IRQa)
{
acount+=a*3;
// acount+=a*4;
if(acount>=LCYCS)
{
doagainbub:acount-=LCYCS;IRQCount++;
if(IRQCount&0x100)
{//acount=0;
X6502_IRQBegin(FCEU_IQEXT);IRQCount=IRQLatch;
}
if(acount>=LCYCS) goto doagainbub;
}
}
}
void Mapper25_init(void)
{
SetWriteHandler(0x8000,0xffff,Mapper25_write);
MapIRQHook=KonamiIRQHook;
}

View File

@ -1,6 +1,4 @@
my_list = Split("""
21.cpp
22.cpp
228.cpp
230.cpp
232.cpp
@ -8,7 +6,6 @@ my_list = Split("""
244.cpp
246.cpp
24and26.cpp
25.cpp
255.cpp
27.cpp
32.cpp

View File

@ -259,7 +259,6 @@
<ClCompile Include="..\src\boards\208.cpp" />
<ClCompile Include="..\src\boards\222.cpp" />
<ClCompile Include="..\src\boards\225.cpp" />
<ClCompile Include="..\src\boards\23.cpp" />
<ClCompile Include="..\src\boards\235.cpp" />
<ClCompile Include="..\src\boards\253.cpp" />
<ClCompile Include="..\src\boards\34.cpp" />
@ -298,6 +297,7 @@
<ClCompile Include="..\src\boards\pec-586.cpp" />
<ClCompile Include="..\src\boards\sa-9602b.cpp" />
<ClCompile Include="..\src\boards\transformer.cpp" />
<ClCompile Include="..\src\boards\vrc2and4.cpp" />
<ClCompile Include="..\src\boards\vrc7.cpp" />
<ClCompile Include="..\src\boards\yoko.cpp" />
<ClCompile Include="..\src\boards\__dummy_mapper.cpp">
@ -569,8 +569,6 @@
<ClCompile Include="..\src\input\suborkb.cpp" />
<ClCompile Include="..\src\input\toprider.cpp" />
<ClCompile Include="..\src\input\zapper.cpp" />
<ClCompile Include="..\src\mappers\21.cpp" />
<ClCompile Include="..\src\mappers\22.cpp" />
<ClCompile Include="..\src\mappers\228.cpp" />
<ClCompile Include="..\src\mappers\230.cpp" />
<ClCompile Include="..\src\mappers\232.cpp" />
@ -578,7 +576,6 @@
<ClCompile Include="..\src\mappers\244.cpp" />
<ClCompile Include="..\src\mappers\246.cpp" />
<ClCompile Include="..\src\mappers\24and26.cpp" />
<ClCompile Include="..\src\mappers\25.cpp" />
<ClCompile Include="..\src\mappers\255.cpp" />
<ClCompile Include="..\src\mappers\27.cpp" />
<ClCompile Include="..\src\mappers\32.cpp" />

View File

@ -121,9 +121,6 @@
<ClCompile Include="..\src\boards\222.cpp">
<Filter>boards</Filter>
</ClCompile>
<ClCompile Include="..\src\boards\23.cpp">
<Filter>boards</Filter>
</ClCompile>
<ClCompile Include="..\src\boards\235.cpp">
<Filter>boards</Filter>
</ClCompile>
@ -647,12 +644,6 @@
<ClCompile Include="..\src\lua\src\print.c">
<Filter>drivers\win\lua</Filter>
</ClCompile>
<ClCompile Include="..\src\mappers\21.cpp">
<Filter>mappers</Filter>
</ClCompile>
<ClCompile Include="..\src\mappers\22.cpp">
<Filter>mappers</Filter>
</ClCompile>
<ClCompile Include="..\src\mappers\228.cpp">
<Filter>mappers</Filter>
</ClCompile>
@ -674,9 +665,6 @@
<ClCompile Include="..\src\mappers\24and26.cpp">
<Filter>mappers</Filter>
</ClCompile>
<ClCompile Include="..\src\mappers\25.cpp">
<Filter>mappers</Filter>
</ClCompile>
<ClCompile Include="..\src\mappers\255.cpp">
<Filter>mappers</Filter>
</ClCompile>
@ -976,6 +964,9 @@
<ClCompile Include="..\src\boards\225.cpp">
<Filter>boards</Filter>
</ClCompile>
<ClCompile Include="..\src\boards\vrc2and4.cpp">
<Filter>boards</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\cart.h">

View File

@ -682,7 +682,7 @@
>
</File>
<File
RelativePath="..\src\boards\23.cpp"
RelativePath="..\src\boards\vrc2and4.cpp"
>
</File>
<File
@ -4124,10 +4124,6 @@
<Filter
Name="mappers"
>
<File
RelativePath="..\src\mappers\21.cpp"
>
</File>
<File
RelativePath="..\src\mappers\215.cpp"
>
@ -4136,10 +4132,6 @@
RelativePath="..\src\mappers\217.cpp"
>
</File>
<File
RelativePath="..\src\mappers\22.cpp"
>
</File>
<File
RelativePath="..\src\mappers\228.cpp"
>
@ -4168,10 +4160,6 @@
RelativePath="..\src\mappers\24and26.cpp"
>
</File>
<File
RelativePath="..\src\mappers\25.cpp"
>
</File>
<File
RelativePath="..\src\mappers\255.cpp"
>

View File

@ -462,7 +462,7 @@
>
</File>
<File
RelativePath="..\src\boards\23.cpp"
RelativePath="..\src\boards\vrc2and4.cpp"
>
</File>
<File
@ -2245,10 +2245,6 @@
RelativePath="..\src\mappers\204.cpp"
>
</File>
<File
RelativePath="..\src\mappers\21.cpp"
>
</File>
<File
RelativePath="..\src\mappers\212.cpp"
>
@ -2269,10 +2265,6 @@
RelativePath="..\src\mappers\217.cpp"
>
</File>
<File
RelativePath="..\src\mappers\22.cpp"
>
</File>
<File
RelativePath="..\src\mappers\225.cpp"
>
@ -2325,10 +2317,6 @@
RelativePath="..\src\mappers\24and26.cpp"
>
</File>
<File
RelativePath="..\src\mappers\25.cpp"
>
</File>
<File
RelativePath="..\src\mappers\255.cpp"
>