Update Ganbare Goemon Gaiden 2 to use Mapper21 based on sources

This commit is contained in:
retro-wertz
2017-10-01 23:39:19 +08:00
parent 3f0f8fe455
commit 52281a4474
2 changed files with 17 additions and 18 deletions

View File

@@ -131,9 +131,7 @@ static DECLFW(VRC24Write) {
}
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
*/
A = (A & 0xF000) | ((A >> 1) & 0x3) | ((A >> 6) & 0x3); /* Ganbare Goemon Gaiden 2 - Tenka no Zaihou (J) [!] is Mapper 21*/
VRC24Write(A, V);
}
@@ -154,14 +152,18 @@ static DECLFW(M22Write) {
}
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
*/
A |= ((A >> 2) & 0x3) | ((A >> 4) & 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();
setprg8r(0x10, 0x6000, 0);
SetReadHandler(0x6000, 0x7FFF, CartBR);
SetWriteHandler(0x6000, 0x7FFF, CartBW);
FCEU_CheatAddRAM(WRAMSIZE >> 10, 0x6000, WRAM);
SetReadHandler(0x8000, 0xFFFF, CartBR);
SetWriteHandler(0x8000, 0xFFFF, M21Write);
}
@@ -223,16 +225,6 @@ static void VRC24Close(void) {
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;
@@ -260,6 +252,13 @@ void VRC24_Init(CartInfo *info) {
AddExState(&StateRegs, ~0, 0, 0);
}
void Mapper21_Init(CartInfo *info) {
isPirate = 0;
is22 = 0;
info->Power = M21Power;
VRC24_Init(info);
}
void Mapper23_Init(CartInfo *info) {
isPirate = 0;
is22 = 0;

View File

@@ -105,7 +105,7 @@
{0x6e68e31a, 16, 8}, /* Dragon Ball 3*/
{0x33b899c9, 16, -1}, /* Dragon Ball - Dai Maou Fukkatsu (J) [!] */
{0xa262a81f, 16, -1}, /* Rokudenashi Blues (J) */
{0x286fcd20, 23, -1}, /* Ganbare Goemon Gaiden 2 - Tenka no Zaihou (J) [!] */
{0x286fcd20, 21, -1}, /* Ganbare Goemon Gaiden 2 - Tenka no Zaihou (J) [!] */
{0xe4a291ce, 23, -1}, /* World Hero (Unl) [!] */
{0x51e9cd33, 23, -1}, /* World Hero (Unl) [b1] */
{0x105dd586, 27, -1}, /* Mi Hun Che variations... */
@@ -275,7 +275,7 @@
{0x276237b3, 206, 0}, /* Karnov */
{0xa5e6baf9, 206, 1}, /* Dragon Slayer 4 - Drasle Family (Japan) */
{0x4f2f1846, 206, 1}, /* Famista '89 - Kaimaku Han!! (J) */
{0x22d6d5bd, 206, 1}, /* Jikuu Yuuden - Debias (J) */
{0x22d6d5bd, 206, 1}, /* Jikuu Yuuden - Debias (J) */
{0x9d21fe96, 206, 1}, /* Lupin Sansei - Pandora no Isan (Japan) */
{0x96dfc776, 206, 1}, /* R.B.I. Baseball 2 (USA) (Unl) */
{0xfd63e7ac, 206, 1}, /* R.B.I. Baseball 3 (USA) (Unl) */