MINDKIDS accessible as NES 2.0 m268.1; mapper 224 is MINDKIDS; remove KT-008 remnants from mmc3.c

This commit is contained in:
NewRisingSun
2021-04-10 14:38:49 +02:00
parent 3ee931f44f
commit 0657d21366
6 changed files with 48 additions and 76 deletions

View File

@@ -1,50 +0,0 @@
/* FCEUmm - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2019 Libretro Team
*
* 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
*/
/* 2019-05-29 - Mapper 224, KT-008
* iNES Mapper 224 is used for the 晶科泰 (Jncota) KT-008 PCB.
* It's an MMC3 clone that supports 1024 KiB of PRG-ROM through an additional
* outer bank register at $5000.
* http://wiki.nesdev.com/w/index.php/INES_Mapper_224 */
#include "mapinc.h"
#include "mmc3.h"
static void M224PW(uint32 A, uint8 V) {
setprg8(A, (V & 0x3f) | ((EXPREGS[0] << 4) & 0x40));
}
static DECLFW(Mapper224Write) {
EXPREGS[0] = V;
FixMMC3PRG(MMC3_cmd);
}
static void M224Power(void) {
EXPREGS[0] = 0;
GenMMC3Power();
SetWriteHandler(0x5000, 0x5000, Mapper224Write);
}
void Mapper224_Init(CartInfo *info) {
GenMMC3_Init(info, 1024, 0, 8, 0);
pwrap = M224PW;
info->Power = M224Power;
AddExState(EXPREGS, 1, 0, "EXPR");
}

View File

@@ -174,3 +174,12 @@ void MINDKIDS_Init(CartInfo *info) {
info->Reset = COOLBOYReset;
AddExState(EXPREGS, 4, 0, "EXPR");
}
void Mapper268_Init(CartInfo *info) {
/* Technically, the distinction between COOLBOY ($6000-$7FFF) and MINDKIDS ($5000-$5FFF) is based on a solder pad setting. */
/* In NES 2.0, the submapper field is used to distinguish between the two settings. */
if (info->submapper == 1)
MINDKIDS_Init(info);
else
COOLBOY_Init(info);
}

View File

@@ -184,17 +184,6 @@ DECLFW(MMC3_IRQWrite) {
}
}
/* KT-008 boards hack 2-in-1, TODO assign to new ines mapper, most dump of KT-boards on the net are mapper 4, so need database or goodnes fix support */
DECLFW(KT008HackWrite) {
/* FCEU_printf("%04x:%04x\n",A,V); */
switch (A & 3) {
case 0: kt_extra = V; FixMMC3PRG(MMC3_cmd); break;
case 1: break; /* unk */
case 2: break; /* unk */
case 3: break; /* unk */
}
}
static void ClockMMC3Counter(void) {
int count = IRQCount;
if (!count || IRQReload) {
@@ -236,9 +225,7 @@ static void GENPWRAP(uint32 A, uint8 V) {
/* [NJ102] Mo Dao Jie (C) has 1024Mb MMC3 BOARD, maybe something other will be broken
* also HengGe BBC-2x boards enables this mode as default board mode at boot up
*/
setprg8(A, (V & 0x7F)/* | ((kt_extra & 4) << 4)*/);
/* KT-008 boards hack 2-in-1, TODO assign to new ines mapper, most dump of KT-boards on the net are mapper 4, so need database or goodnes fix support */
/* KT-008 boards should be assigned to mapper 224 */
setprg8(A, (V & 0x7F));
}
static void GENMWRAP(uint8 V) {
@@ -265,9 +252,6 @@ void GenMMC3Power(void) {
SetWriteHandler(0xC000, 0xFFFF, MMC3_IRQWrite);
SetReadHandler(0x8000, 0xFFFF, CartBR);
/* KT-008 boards hack 2-in-1, TODO assign to new ines mapper, most dump of KT-boards on the net are mapper 4, so need database or goodnes fix support */
/* SetWriteHandler(0x5000,0x5FFF, KT008HackWrite); */ /* KT-008 boards should be assigned to mapper 224 */
A001B = A000B = 0;
setmirror(1);
if (mmc3opts & 1) {
@@ -321,9 +305,6 @@ void GenMMC3_Init(CartInfo *info, int prg, int chr, int wram, int battery) {
info->SaveGameLen[0] = WRAMSIZE;
}
/* KT-008 boards hack 2-in-1, TODO assign to new ines mapper, most dump of KT-boards on the net are mapper 4, so need database or goodnes fix support */
/* KT-008 boards should be assigned to mapper 224 */
AddExState(&kt_extra, 1, 0, "KTEX");
AddExState(MMC3_StateRegs, ~0, 0, 0);
info->Power = GenMMC3Power;