92
src/boards/104.c
Normal file
92
src/boards/104.c
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
/* FCE Ultra - NES/Famicom Emulator
|
||||||
|
*
|
||||||
|
* Copyright notice for this file:
|
||||||
|
* Copyright (C) 2012
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
*
|
||||||
|
* Pegasus 5-in-1 (Golden Five) (Unl)
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "mapinc.h"
|
||||||
|
|
||||||
|
static uint8 preg[2];
|
||||||
|
static uint8 *WRAM = NULL;
|
||||||
|
static uint32 WRAMSIZE;
|
||||||
|
|
||||||
|
static SFORMAT StateRegs[] =
|
||||||
|
{
|
||||||
|
{ preg, 2, "PREG" },
|
||||||
|
{ 0 }
|
||||||
|
};
|
||||||
|
|
||||||
|
static void Sync(void) {
|
||||||
|
setprg8r(0x10, 0x6000, 0);
|
||||||
|
setprg16(0x8000, preg[0]);
|
||||||
|
setprg16(0xC000, preg[1]);
|
||||||
|
setchr8(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static DECLFW(M104WriteBank) {
|
||||||
|
if ((V & 8) > 0) {
|
||||||
|
preg[0] = ((V << 4) & 0x70) | (preg[0] & 0x0F);
|
||||||
|
preg[1] = ((V << 4) & 0x70) | 0x0F;
|
||||||
|
Sync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static DECLFW(M104WritePreg) {
|
||||||
|
preg[0] = (preg[0] & 0x70) | (V & 0x0F);
|
||||||
|
Sync();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void M104Close(void) {
|
||||||
|
if (WRAM)
|
||||||
|
FCEU_gfree(WRAM);
|
||||||
|
WRAM = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void M104Power(void) {
|
||||||
|
preg[1] = 0x0F;
|
||||||
|
Sync();
|
||||||
|
SetReadHandler(0x6000, 0x7fff, CartBR);
|
||||||
|
SetWriteHandler(0x6000, 0x7fff, CartBW);
|
||||||
|
SetWriteHandler(0x8000, 0x9FFF, M104WriteBank);
|
||||||
|
SetWriteHandler(0xC000, 0xFFFF, M104WritePreg);
|
||||||
|
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||||
|
setmirror(MI_V);
|
||||||
|
FCEU_CheatAddRAM(WRAMSIZE >> 10, 0x6000, WRAM);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void StateRestore(int version) {
|
||||||
|
Sync();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Mapper104_Init(CartInfo *info) {
|
||||||
|
info->Power = M104Power;
|
||||||
|
info->Close = M104Close;
|
||||||
|
AddExState(&StateRegs, ~0, 0, 0);
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
GameStateRestore = StateRestore;
|
||||||
|
}
|
||||||
@@ -1,203 +1,287 @@
|
|||||||
/* FCE Ultra - NES/Famicom Emulator
|
/* FCE Ultra - NES/Famicom Emulator
|
||||||
*
|
*
|
||||||
* Copyright notice for this file:
|
* Copyright notice for this file:
|
||||||
* Copyright (C) 2006 CaH4e3
|
* Copyright (C) 2006 CaH4e3
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "mapinc.h"
|
#include "mapinc.h"
|
||||||
#include "mmc3.h"
|
#include "mmc3.h"
|
||||||
|
|
||||||
static uint8 unromchr;
|
static int is_BMCFK23CA;
|
||||||
static uint32 dipswitch = 0;
|
static uint8 unromchr;
|
||||||
static uint8 *CHRRAM = NULL;
|
static uint32 dipswitch = 0;
|
||||||
static uint32 CHRRAMSize;
|
static uint8 *CHRRAM = NULL;
|
||||||
|
static uint32 CHRRAMSize;
|
||||||
static void BMCFK23CCW(uint32 A, uint8 V) {
|
|
||||||
if (EXPREGS[0] & 0x40)
|
static void BMCFK23CCW(uint32 A, uint8 V) {
|
||||||
setchr8(EXPREGS[2] | unromchr);
|
if (EXPREGS[0] & 0x40)
|
||||||
else if (EXPREGS[0] & 0x20) {
|
setchr8(EXPREGS[2] | unromchr);
|
||||||
setchr1r(0x10, A, V);
|
else if (EXPREGS[0] & 0x20) {
|
||||||
} else {
|
setchr1r(0x10, A, V);
|
||||||
uint16 base = (EXPREGS[2] & 0x7F) << 3;
|
} else {
|
||||||
if (EXPREGS[3] & 2) {
|
uint16 base=(EXPREGS[2] & 0x7F) << 3;
|
||||||
int cbase = (MMC3_cmd & 0x80) << 5;
|
if (EXPREGS[3] & 2) {
|
||||||
setchr1(A, V | base);
|
int cbase = (MMC3_cmd & 0x80) << 5;
|
||||||
setchr1(0x0000 ^ cbase, DRegBuf[0] | base);
|
setchr1(A, V | base);
|
||||||
setchr1(0x0400 ^ cbase, EXPREGS[6] | base);
|
setchr1(0x0000 ^ cbase, DRegBuf[0] | base);
|
||||||
setchr1(0x0800 ^ cbase, DRegBuf[1] | base);
|
setchr1(0x0400 ^ cbase, EXPREGS[6] | base);
|
||||||
setchr1(0x0c00 ^ cbase, EXPREGS[7] | base);
|
setchr1(0x0800 ^ cbase, DRegBuf[1] | base);
|
||||||
} else
|
setchr1(0x0c00 ^ cbase, EXPREGS[7] | base);
|
||||||
setchr1(A, V | base);
|
} else
|
||||||
}
|
setchr1(A, V | base);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
static void BMCFK23CPW(uint32 A, uint8 V) {
|
|
||||||
uint32 bank = (EXPREGS[1] & 0x1F);
|
//some games are wired differently, and this will need to be changed.
|
||||||
uint32 hiblock = ((EXPREGS[0] & 8) << 4) | ((EXPREGS[0] & 0x80) << 1) | (UNIFchrrama ? ((EXPREGS[2] & 0x40) << 3) : 0);
|
//all the WXN games require prg_bonus = 1, and cah4e3's multicarts require prg_bonus = 0
|
||||||
uint32 block = (EXPREGS[1] & 0x60) | hiblock;
|
//we'll populate this from a game database
|
||||||
uint32 extra = (EXPREGS[3] & 2);
|
static int prg_mask;
|
||||||
switch (EXPREGS[0] & 7) {
|
static int prg_bonus = 1;
|
||||||
case 0:
|
|
||||||
setprg8(A, (block << 1) | (V & 0x3F));
|
//prg_bonus = 0
|
||||||
if (extra) {
|
//4-in-1 (FK23C8021)[p1][!].nes
|
||||||
setprg8(0xC000, EXPREGS[4]);
|
//4-in-1 (FK23C8033)[p1][!].nes
|
||||||
setprg8(0xE000, EXPREGS[5]);
|
//4-in-1 (FK23C8043)[p1][!].nes
|
||||||
}
|
//4-in-1 (FK23Cxxxx, S-0210A PCB)[p1][!].nes
|
||||||
break;
|
|
||||||
case 1:
|
//prg_bonus = 1
|
||||||
setprg8(A, ((hiblock | (EXPREGS[1] & 0x70)) << 1) | (V & 0x1F));
|
//[m176]大富翁2-上海大亨.wxn.nes
|
||||||
if (extra) {
|
//[m176]宠物翡翠.fix.nes
|
||||||
setprg8(0xC000, EXPREGS[4]);
|
//[m176]格兰帝亚.wxn.nes
|
||||||
setprg8(0xE000, EXPREGS[5]);
|
//[m176]梦幻之星.wxn.nes
|
||||||
}
|
//[m176]水浒神兽.fix.nes
|
||||||
break;
|
//[m176]西楚霸王.fix.nes
|
||||||
case 2:
|
//[m176]超级大富翁.wxn.nes
|
||||||
setprg8(A, ((hiblock | (EXPREGS[1] & 0x78)) << 1) | (V & 0x0F));
|
//[m176]雄霸天下.wxn.nes
|
||||||
if (extra) {
|
|
||||||
setprg8(0xC000, EXPREGS[4]);
|
//works as-is under virtuanes m176
|
||||||
setprg8(0xE000, EXPREGS[5]);
|
//[m176]三侠五义.wxn.nes
|
||||||
}
|
//[m176]口袋金.fix.nes
|
||||||
break;
|
//[m176]爆笑三国.fix.nes
|
||||||
case 3:
|
|
||||||
setprg16(0x8000, (bank | block));
|
//needs other tweaks
|
||||||
setprg16(0xC000, (bank | block));
|
//[m176]三国忠烈传.wxn.nes
|
||||||
break;
|
//[m176]破釜沉舟.fix.nes
|
||||||
case 4:
|
|
||||||
setprg32(0x8000, (bank | block) >> 1);
|
static uint64 CartList[] =
|
||||||
break;
|
{
|
||||||
}
|
0x1606b8c2aff8d942LL, // 4-in-1 (BS-8088) [p1][!].nes
|
||||||
setprg8r(0x10, 0x6000, A001B & 3);
|
0x62b51b108a01d2beLL, // 4-in-1 (FK23C8021) [p1][!].nes
|
||||||
}
|
0xa37eb9163e001a46LL, // 4-in-1 (FK23C8026) [p1][!].nes
|
||||||
|
0x8bb48490d8d22711LL, // 4-in-1 (FK23C8033) [p1][!].nes
|
||||||
static DECLFW(BMCFK23CHiWrite) {
|
0xc75888d7b48cd378LL, // 4-in-1 (FK23C8043) [p1][!].nes
|
||||||
if (EXPREGS[0] & 0x40) {
|
0xde5ce25860233f7eLL, // 4-in-1 (FK23C8045) [p1][!].nes
|
||||||
if (EXPREGS[0] & 0x30)
|
0x8b6c9fc7769a5500LL, // 4-in-1 (FK23C8052) [p1][!].nes
|
||||||
unromchr = 0;
|
0x5b3aa4cdc484a088LL, // 4-in-1 (FK23C8056) [p1][!].nes
|
||||||
else {
|
0x497344d14c308a1aLL, // 4-in-1 (FK23C8078) (Ch) [p1].nes
|
||||||
unromchr = V & 3;
|
0x9342bf9bae1c798aLL, // 4-in-1 (FK23C8079) [p1][!].nes
|
||||||
FixMMC3CHR(MMC3_cmd);
|
0xf81a376fa54fdd69LL, // 4-in-1 (FK23Cxxxx, S-0210A PCB)[p1][!].nes
|
||||||
}
|
0x8fd9c235957a6df0LL, // 5-in-1 (K5003) [p1][!]-1125) (Ch).nes
|
||||||
} else {
|
0x0315924d00dd7807LL, // Mortal Kombat 30 Peoples (DH1043) (Ch).nes
|
||||||
if ((A == 0x8001) && (EXPREGS[3] & 2) && (MMC3_cmd & 8)) {
|
0x4b99c39fdb66128aLL, // 4-in-1 (FK23C8078) (Ch) [p1][U][!].unf
|
||||||
EXPREGS[4 | (MMC3_cmd & 3)] = V;
|
0 /* Abandon all hope if the game has 0 in the lower 64-bits of its MD5 hash */
|
||||||
FixMMC3PRG(MMC3_cmd);
|
};
|
||||||
FixMMC3CHR(MMC3_cmd);
|
|
||||||
} else
|
static void DetectPRGbonus(uint64 md5partial) {
|
||||||
if (A < 0xC000) {
|
int x;
|
||||||
if (UNIFchrrama) { // hacky... strange behaviour, must be bit scramble due to pcb layot restrictions
|
x = 0;
|
||||||
// check if it not interfer with other dumps
|
while (CartList[x] != 0) {
|
||||||
if ((A == 0x8000) && (V == 0x46))
|
if (CartList[x] == md5partial) {
|
||||||
V = 0x47;
|
prg_bonus = 0;
|
||||||
else if ((A == 0x8000) && (V == 0x47))
|
return;
|
||||||
V = 0x46;
|
}
|
||||||
}
|
x++;
|
||||||
MMC3_CMDWrite(A, V);
|
}
|
||||||
FixMMC3PRG(MMC3_cmd);
|
}
|
||||||
} else
|
|
||||||
MMC3_IRQWrite(A, V);
|
static void BMCFK23CPW(uint32 A, uint8 V) {
|
||||||
}
|
uint32 bank = (EXPREGS[1] & 0x1F);
|
||||||
}
|
uint32 hiblock = ((EXPREGS[0] & 8) << 4) | ((EXPREGS[0] & 0x80) << 1) | (UNIFchrrama ? ((EXPREGS[2] & 0x40) << 3) : 0);
|
||||||
|
uint32 block = (EXPREGS[1] & 0x60) | hiblock;
|
||||||
static DECLFW(BMCFK23CWrite) {
|
uint32 extra = (EXPREGS[3] & 2);
|
||||||
// FCEU_printf("lo %04x:%02x\n",A,V);
|
|
||||||
if (dipswitch) { // íóëåâîé äèï áåðåò ëþáûå çàïèñè ïî äåôîëòó, äàëüøå èäåò âûáîð
|
if ((EXPREGS[0] & 7) == 4)
|
||||||
if (A & (1 << (dipswitch + 3))) {
|
setprg32(0x8000, EXPREGS[1] >> 1);
|
||||||
EXPREGS[A & 3] = V;
|
else if ((EXPREGS[0] & 7) == 3) {
|
||||||
// FCEU_printf(" reg %d set!\n",A&3);
|
setprg16(0x8000, EXPREGS[1]);
|
||||||
FixMMC3PRG(MMC3_cmd);
|
setprg16(0xC000, EXPREGS[1]);
|
||||||
FixMMC3CHR(MMC3_cmd);
|
} else {
|
||||||
}
|
if (EXPREGS[0] & 3) {
|
||||||
} else {
|
uint32 blocksize = (6) - (EXPREGS[0] & 3);
|
||||||
EXPREGS[A & 3] = V;
|
uint32 mask = (1 << blocksize) - 1;
|
||||||
// FCEU_printf(" reg %d set!\n",A&3);
|
V &= mask;
|
||||||
FixMMC3PRG(MMC3_cmd);
|
//V &= 63; //? is this a good idea?
|
||||||
FixMMC3CHR(MMC3_cmd);
|
V |= (EXPREGS[1] << 1);
|
||||||
}
|
setprg8(A, V);
|
||||||
if (EXPREGS[3] & 2)
|
} else
|
||||||
EXPREGS[0] &= ~7; // hacky hacky! if someone wants extra banking, then for sure doesn't want mode 4 for it! (allow to run A version boards on normal mapper)
|
setprg8(A, V & prg_mask);
|
||||||
}
|
if (EXPREGS[3] & 2) {
|
||||||
|
setprg8(0xC000, EXPREGS[4]);
|
||||||
static void BMCFK23CReset(void) {
|
setprg8(0xE000, EXPREGS[5]);
|
||||||
if (dipswitch <= 8)
|
}
|
||||||
dipswitch++;
|
}
|
||||||
else
|
setprg8r(0x10, 0x6000, A001B & 3);
|
||||||
dipswitch = 0;
|
}
|
||||||
EXPREGS[0] = EXPREGS[1] = EXPREGS[2] = EXPREGS[3] = 0;
|
|
||||||
EXPREGS[4] = EXPREGS[5] = EXPREGS[6] = EXPREGS[7] = 0xFF;
|
static DECLFW(BMCFK23CHiWrite) {
|
||||||
MMC3RegReset();
|
if (EXPREGS[0] & 0x40) {
|
||||||
FixMMC3PRG(MMC3_cmd);
|
if (EXPREGS[0] & 0x30)
|
||||||
FixMMC3CHR(MMC3_cmd);
|
unromchr = 0;
|
||||||
}
|
else {
|
||||||
|
unromchr = V & 3;
|
||||||
static void BMCFK23CPower(void) {
|
FixMMC3CHR(MMC3_cmd);
|
||||||
GenMMC3Power();
|
}
|
||||||
EXPREGS[0] = 4;
|
} else {
|
||||||
EXPREGS[1] = 0xFF;
|
if ((A == 0x8001) && (EXPREGS[3] & 2 && MMC3_cmd & 8)) {
|
||||||
EXPREGS[2] = EXPREGS[3] = 0;
|
EXPREGS[4 | (MMC3_cmd & 3)] = V;
|
||||||
dipswitch = 0;
|
FixMMC3PRG(MMC3_cmd);
|
||||||
EXPREGS[4] = EXPREGS[5] = EXPREGS[6] = EXPREGS[7] = 0xFF;
|
FixMMC3CHR(MMC3_cmd);
|
||||||
SetWriteHandler(0x5000, 0x5fff, BMCFK23CWrite);
|
} else
|
||||||
SetWriteHandler(0x8000, 0xFFFF, BMCFK23CHiWrite);
|
if (A < 0xC000) {
|
||||||
FixMMC3PRG(MMC3_cmd);
|
if (UNIFchrrama) { // hacky... strange behaviour, must be bit scramble due to pcb layot restrictions
|
||||||
FixMMC3CHR(MMC3_cmd);
|
// check if it not interfer with other dumps
|
||||||
}
|
if ((A == 0x8000) && (V == 0x46))
|
||||||
|
V = 0x47;
|
||||||
static void BMCFK23CAPower(void) {
|
else if ((A==0x8000) && (V == 0x47))
|
||||||
GenMMC3Power();
|
V = 0x46;
|
||||||
dipswitch = 0;
|
}
|
||||||
EXPREGS[0] = EXPREGS[1] = EXPREGS[2] = EXPREGS[3] = 0;
|
MMC3_CMDWrite(A, V);
|
||||||
EXPREGS[4] = EXPREGS[5] = EXPREGS[6] = EXPREGS[7] = 0xFF;
|
FixMMC3PRG(MMC3_cmd);
|
||||||
SetWriteHandler(0x5000, 0x5fff, BMCFK23CWrite);
|
} else
|
||||||
SetWriteHandler(0x8000, 0xFFFF, BMCFK23CHiWrite);
|
MMC3_IRQWrite(A, V);
|
||||||
FixMMC3PRG(MMC3_cmd);
|
}
|
||||||
FixMMC3CHR(MMC3_cmd);
|
}
|
||||||
}
|
|
||||||
|
static DECLFW(BMCFK23CWrite) {
|
||||||
static void BMCFK23CAClose(void) {
|
if (A & (1 << (dipswitch + 4))) {
|
||||||
if (CHRRAM)
|
EXPREGS[A & 3] = V;
|
||||||
FCEU_gfree(CHRRAM);
|
|
||||||
CHRRAM = NULL;
|
int remap = 0;
|
||||||
}
|
|
||||||
|
//sometimes writing to reg0 causes remappings to occur. we think the 2 signifies this.
|
||||||
void BMCFK23C_Init(CartInfo *info) {
|
//if not, 0x24 is a value that is known to work
|
||||||
GenMMC3_Init(info, 512, 256, 128, 0);
|
//however, the low 4 bits are known to control the mapping mode, so 0x20 is more likely to be the immediate remap flag
|
||||||
cwrap = BMCFK23CCW;
|
remap |= ((EXPREGS[0] & 0xF0) == 0x20);
|
||||||
pwrap = BMCFK23CPW;
|
|
||||||
info->Power = BMCFK23CPower;
|
//this is an actual mapping reg. i think reg0 controls what happens when reg1 is written. anyway, we have to immediately remap these
|
||||||
info->Reset = BMCFK23CReset;
|
remap |= (A & 3) == 1;
|
||||||
AddExState(EXPREGS, 8, 0, "EXPR");
|
//this too.
|
||||||
AddExState(&unromchr, 1, 0, "UCHR");
|
remap |= (A & 3) == 2;
|
||||||
AddExState(&dipswitch, 1, 0, "DPSW");
|
|
||||||
}
|
if(remap)
|
||||||
|
{
|
||||||
void BMCFK23CA_Init(CartInfo *info) {
|
FixMMC3PRG(MMC3_cmd);
|
||||||
GenMMC3_Init(info, 512, 256, 128, 0);
|
FixMMC3CHR(MMC3_cmd);
|
||||||
cwrap = BMCFK23CCW;
|
}
|
||||||
pwrap = BMCFK23CPW;
|
}
|
||||||
info->Power = BMCFK23CAPower;
|
|
||||||
info->Reset = BMCFK23CReset;
|
if(is_BMCFK23CA)
|
||||||
info->Close = BMCFK23CAClose;
|
{
|
||||||
|
if(EXPREGS[3] & 2)
|
||||||
CHRRAMSize = 8192;
|
EXPREGS[0] &= ~7; // hacky hacky! if someone wants extra banking, then for sure doesn't want mode 4 for it! (allow to run A version boards on normal mapper)
|
||||||
CHRRAM = (uint8*)FCEU_gmalloc(CHRRAMSize);
|
}
|
||||||
SetupCartCHRMapping(0x10, CHRRAM, CHRRAMSize, 1);
|
}
|
||||||
AddExState(CHRRAM, CHRRAMSize, 0, "CRAM");
|
|
||||||
|
static void BMCFK23CReset(void) {
|
||||||
AddExState(EXPREGS, 8, 0, "EXPR");
|
//NOT NECESSARY ANYMORE
|
||||||
AddExState(&unromchr, 1, 0, "UCHR");
|
//this little hack makes sure that we try all the dip switch settings eventually, if we reset enough
|
||||||
AddExState(&dipswitch, 1, 0, "DPSW");
|
// dipswitch++;
|
||||||
}
|
// dipswitch&=7;
|
||||||
|
//printf("BMCFK23C dipswitch set to %d\n",dipswitch);
|
||||||
|
|
||||||
|
EXPREGS[0] = EXPREGS[1] = EXPREGS[2] = EXPREGS[3] = 0;
|
||||||
|
EXPREGS[4] = EXPREGS[5] = EXPREGS[6] = EXPREGS[7] = 0xFF;
|
||||||
|
MMC3RegReset();
|
||||||
|
FixMMC3PRG(MMC3_cmd);
|
||||||
|
FixMMC3CHR(MMC3_cmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void BMCFK23CPower(void) {
|
||||||
|
GenMMC3Power();
|
||||||
|
dipswitch = 0;
|
||||||
|
EXPREGS[0] = EXPREGS[1] = EXPREGS[2] = EXPREGS[3] = 0;
|
||||||
|
EXPREGS[4] = EXPREGS[5] = EXPREGS[6] = EXPREGS[7] = 0xFF;
|
||||||
|
SetWriteHandler(0x5000, 0x5fff, BMCFK23CWrite);
|
||||||
|
SetWriteHandler(0x8000, 0xFFFF, BMCFK23CHiWrite);
|
||||||
|
FixMMC3PRG(MMC3_cmd);
|
||||||
|
FixMMC3CHR(MMC3_cmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void BMCFK23CAPower(void) {
|
||||||
|
GenMMC3Power();
|
||||||
|
dipswitch = 0;
|
||||||
|
EXPREGS[0] = EXPREGS[1] = EXPREGS[2] = EXPREGS[3] = 0;
|
||||||
|
EXPREGS[4] = EXPREGS[5] = EXPREGS[6] = EXPREGS[7] = 0xFF;
|
||||||
|
SetWriteHandler(0x5000, 0x5fff, BMCFK23CWrite);
|
||||||
|
SetWriteHandler(0x8000, 0xFFFF, BMCFK23CHiWrite);
|
||||||
|
FixMMC3PRG(MMC3_cmd);
|
||||||
|
FixMMC3CHR(MMC3_cmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void BMCFK23CAClose(void) {
|
||||||
|
if (CHRRAM)
|
||||||
|
FCEU_gfree(CHRRAM);
|
||||||
|
CHRRAM=NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void BMCFK23C_Init(CartInfo *info) {
|
||||||
|
is_BMCFK23CA = 0;
|
||||||
|
|
||||||
|
GenMMC3_Init(info, 512, 256, 8, 0);
|
||||||
|
cwrap = BMCFK23CCW;
|
||||||
|
pwrap = BMCFK23CPW;
|
||||||
|
info->Power = BMCFK23CPower;
|
||||||
|
info->Reset = BMCFK23CReset;
|
||||||
|
AddExState(EXPREGS, 8, 0, "EXPR");
|
||||||
|
AddExState(&unromchr, 1, 0, "UCHR");
|
||||||
|
AddExState(&dipswitch, 1, 0, "DPSW");
|
||||||
|
|
||||||
|
int x;
|
||||||
|
uint64 partialmd5 = 0;
|
||||||
|
for (x = 0; x < 8; x++)
|
||||||
|
partialmd5 |= (uint64)info->MD5[15 - x] << (x * 8);
|
||||||
|
DetectPRGbonus(partialmd5);
|
||||||
|
prg_mask = 0x7F >> (prg_bonus);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BMCFK23CA_Init(CartInfo *info)
|
||||||
|
{
|
||||||
|
is_BMCFK23CA = 1;
|
||||||
|
|
||||||
|
GenMMC3_Init(info, 512, 256, 8, 0);
|
||||||
|
cwrap=BMCFK23CCW;
|
||||||
|
pwrap=BMCFK23CPW;
|
||||||
|
info->Power=BMCFK23CAPower;
|
||||||
|
info->Reset=BMCFK23CReset;
|
||||||
|
info->Close=BMCFK23CAClose;
|
||||||
|
|
||||||
|
CHRRAMSize=8192;
|
||||||
|
CHRRAM=(uint8*)FCEU_gmalloc(CHRRAMSize);
|
||||||
|
SetupCartCHRMapping(0x10, CHRRAM, CHRRAMSize, 1);
|
||||||
|
AddExState(CHRRAM, CHRRAMSize, 0, "CRAM");
|
||||||
|
|
||||||
|
AddExState(EXPREGS, 8, 0, "EXPR");
|
||||||
|
AddExState(&unromchr, 1, 0, "UCHR");
|
||||||
|
AddExState(&dipswitch, 1, 0, "DPSW");
|
||||||
|
|
||||||
|
int x;
|
||||||
|
uint64 partialmd5 = 0;
|
||||||
|
for (x = 0; x < 8; x++)
|
||||||
|
partialmd5 |= (uint64)info->MD5[15 - x] << (x * 8);
|
||||||
|
DetectPRGbonus(partialmd5);
|
||||||
|
prg_mask = 0x7F >> (prg_bonus);
|
||||||
|
}
|
||||||
|
|||||||
@@ -137,6 +137,7 @@
|
|||||||
{0xbb7c5f7a, 89, 8}, /* Mito Koumon or something similar */
|
{0xbb7c5f7a, 89, 8}, /* Mito Koumon or something similar */
|
||||||
{0x10119e6b, 93, 8}, /* Fantasy Zone (Japan) */
|
{0x10119e6b, 93, 8}, /* Fantasy Zone (Japan) */
|
||||||
{0x0da5e32e, 101, -1}, /* new Uruusey Yatsura */
|
{0x0da5e32e, 101, -1}, /* new Uruusey Yatsura */
|
||||||
|
{0x6096f84e, 104, 1}, /* Pegasus 5-in-1 (Golden Five) (Unl) */
|
||||||
{0x8eab381c, 113, 1}, /* Death Bots */
|
{0x8eab381c, 113, 1}, /* Death Bots */
|
||||||
{0x3d3ff543, 113, 0}, /* Kazama Jun to Asama Yuuko no AV Dragon Mahjong (Japan) (Unl) */
|
{0x3d3ff543, 113, 0}, /* Kazama Jun to Asama Yuuko no AV Dragon Mahjong (Japan) (Unl) */
|
||||||
{0x68379fdb, 113, 1}, /* Pipemania (Australia) (HES) (Unl) */
|
{0x68379fdb, 113, 1}, /* Pipemania (Australia) (HES) (Unl) */
|
||||||
@@ -202,6 +203,19 @@
|
|||||||
{0x1c098942, 162, -1}, /* Xi You Ji Hou Zhuan (Ch) */
|
{0x1c098942, 162, -1}, /* Xi You Ji Hou Zhuan (Ch) */
|
||||||
{0x081caaff, 163, -1}, /* Commandos (Ch) */
|
{0x081caaff, 163, -1}, /* Commandos (Ch) */
|
||||||
{0x02c41438, 176, -1}, /* Xing He Zhan Shi (C) */
|
{0x02c41438, 176, -1}, /* Xing He Zhan Shi (C) */
|
||||||
|
{0x409601a5, 176, -1}, /* 4-in-1 (BS-8088) [p1][!] */
|
||||||
|
{0xa391549d, 176, -1}, /* 4-in-1 (FK23C8021) [p1][!] */
|
||||||
|
{0x06d13d9e, 176, -1}, /* 4-in-1 (FK23C8026) [p1][!] */
|
||||||
|
{0x2ebd5fd6, 176, -1}, /* 4-in-1 (FK23C8033) [p1][!] */
|
||||||
|
{0x23e4906a, 176, -1}, /* 4-in-1 (FK23C8043) [p1][!] */
|
||||||
|
{0x10155a92, 176, -1}, /* 4-in-1 (FK23C8045) [p1][!] */
|
||||||
|
{0x8baeedc0, 176, -1}, /* 4-in-1 (FK23C8052) [p1][!] */
|
||||||
|
{0x39307391, 176, -1}, /* 4-in-1 (FK23C8056) [p1][!] */
|
||||||
|
{0x72ceab1e, 176, -1}, /* 4-in-1 (FK23C8078) (Ch) [p1] */
|
||||||
|
{0x07d3f6cb, 176, -1}, /* 4-in-1 (FK23C8079) [p1][!] */
|
||||||
|
{0xc6d97331, 176, -1}, /* 4-in-1 (FK23Cxxxx, S-0210A PCB)[p1][!] */
|
||||||
|
{0x17d43af9, 176, -1}, /* 5-in-1 (K5003) [p1][!]-1125) (Ch) */
|
||||||
|
{0x20379331, 176, -1}, /* Mortal Kombat 30 Peoples (DH1043) (Ch) */
|
||||||
{0x558c0dc3, 178, -1}, /* Super 2in1 (unl)[!] {mapper unsupported} */
|
{0x558c0dc3, 178, -1}, /* Super 2in1 (unl)[!] {mapper unsupported} */
|
||||||
{0xc68363f6, 180, 0}, /* Crazy Climber */
|
{0xc68363f6, 180, 0}, /* Crazy Climber */
|
||||||
{0x0f05ff0a, 181, -1}, /* Seicross (redump) */
|
{0x0f05ff0a, 181, -1}, /* Seicross (redump) */
|
||||||
|
|||||||
@@ -495,7 +495,7 @@ static BMAPPINGLocal bmap[] = {
|
|||||||
{(uint8_t*)"", 101, Mapper101_Init},
|
{(uint8_t*)"", 101, Mapper101_Init},
|
||||||
// {(uint8_t*)"", 102, Mapper102_Init},
|
// {(uint8_t*)"", 102, Mapper102_Init},
|
||||||
{(uint8_t*)"FDS DOKIDOKI FULL", 103, Mapper103_Init},
|
{(uint8_t*)"FDS DOKIDOKI FULL", 103, Mapper103_Init},
|
||||||
// {(uint8_t*)"", 104, Mapper104_Init},
|
{(uint8_t*)"CAMERICA GOLDENFIVE", 104, Mapper104_Init},
|
||||||
{(uint8_t*)"NES-EVENT NWC1990", 105, Mapper105_Init},
|
{(uint8_t*)"NES-EVENT NWC1990", 105, Mapper105_Init},
|
||||||
{(uint8_t*)"SMB3 PIRATE A", 106, Mapper106_Init},
|
{(uint8_t*)"SMB3 PIRATE A", 106, Mapper106_Init},
|
||||||
{(uint8_t*)"MAGIC CORP A", 107, Mapper107_Init},
|
{(uint8_t*)"MAGIC CORP A", 107, Mapper107_Init},
|
||||||
@@ -831,7 +831,7 @@ static int iNES_Init(int num) {
|
|||||||
case 13: CHRRAMSize = 16 * 1024; break;
|
case 13: CHRRAMSize = 16 * 1024; break;
|
||||||
case 6:
|
case 6:
|
||||||
case 96: CHRRAMSize = 32 * 1024; break;
|
case 96: CHRRAMSize = 32 * 1024; break;
|
||||||
case 176: CHRRAMSize = 256 * 1024; break;
|
case 176: CHRRAMSize = 128 * 1024; break;
|
||||||
default: CHRRAMSize = 8 * 1024; break;
|
default: CHRRAMSize = 8 * 1024; break;
|
||||||
}
|
}
|
||||||
if ((VROM = (uint8*)malloc(CHRRAMSize)) == NULL) return 0;
|
if ((VROM = (uint8*)malloc(CHRRAMSize)) == NULL) return 0;
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ void Mapper97_Init(CartInfo *);
|
|||||||
void Mapper99_Init(CartInfo *);
|
void Mapper99_Init(CartInfo *);
|
||||||
void Mapper101_Init(CartInfo *);
|
void Mapper101_Init(CartInfo *);
|
||||||
void Mapper103_Init(CartInfo *);
|
void Mapper103_Init(CartInfo *);
|
||||||
|
void Mapper104_Init(CartInfo *);
|
||||||
void Mapper105_Init(CartInfo *);
|
void Mapper105_Init(CartInfo *);
|
||||||
void Mapper106_Init(CartInfo *);
|
void Mapper106_Init(CartInfo *);
|
||||||
void Mapper107_Init(CartInfo *);
|
void Mapper107_Init(CartInfo *);
|
||||||
|
|||||||
Reference in New Issue
Block a user