From 9be98f7c8f7aee6f8172c322116af0f473228bee Mon Sep 17 00:00:00 2001
From: 0kmg <9137159+0kmg@users.noreply.github.com>
Date: Tue, 10 Aug 2021 09:51:46 -0800
Subject: [PATCH] bus/nes: Fixed BMC 411120-C cartridge emulation and added a
compatible game. (#8416)
New working software list additions
-----------------------------------
19 in 1 (K-3088) [anonymous]
Software list items promoted to working
---------------------------------------
4 in 1 (411120-C)
---
hash/nes.xml | 21 ++++++++++++---
src/devices/bus/nes/mmc3_clones.cpp | 41 ++++++++++++++++-------------
src/devices/bus/nes/mmc3_clones.h | 7 +++--
src/devices/bus/nes/nes_ines.hxx | 2 +-
4 files changed, 45 insertions(+), 26 deletions(-)
diff --git a/hash/nes.xml b/hash/nes.xml
index af166a6705e..66e0c9fdb15 100644
--- a/hash/nes.xml
+++ b/hash/nes.xml
@@ -78154,6 +78154,21 @@ be better to redump them properly. -->
+
+ 19 in 1 (K-3088)
+ 199?
+ <pirate>
+
+
+
+
+
+
+
+
+
+
+
190 in 1
19??
@@ -78920,10 +78935,10 @@ be better to redump them properly. -->
-
+
4 in 1 (411120-C)
- 19??
- <unknown>
+ 199?
+ <pirate>
diff --git a/src/devices/bus/nes/mmc3_clones.cpp b/src/devices/bus/nes/mmc3_clones.cpp
index 2c12e7e4c6c..58f06d9309b 100644
--- a/src/devices/bus/nes/mmc3_clones.cpp
+++ b/src/devices/bus/nes/mmc3_clones.cpp
@@ -251,7 +251,7 @@ nes_bmc_k3006_device::nes_bmc_k3006_device(const machine_config &mconfig, const
{
}
-nes_bmc_411120c_device::nes_bmc_411120c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+nes_bmc_411120c_device::nes_bmc_411120c_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_txrom_device(mconfig, NES_BMC_411120C, tag, owner, clock), m_reg(0)
{
}
@@ -642,7 +642,7 @@ void nes_bmc_411120c_device::pcb_reset()
m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
m_reg = 0;
- mmc3_common_initialize(0x7f, 0x7f, 0);
+ mmc3_common_initialize(0x0f, 0x7f, 0);
}
void nes_bmc_830118c_device::device_start()
@@ -2550,36 +2550,41 @@ void nes_bmc_k3006_device::write_m(offs_t offset, u8 data)
/*-------------------------------------------------
- BMC-411120C
+ BMC-411120C, BMC-810849-C
+ Games: 4 in 1, 19 in 1
- MMC3 clone
+ MMC3 clone with banking for multigame menu.
+ NES 2.0: mapper 287
- In MESS: Very Preliminary Support
+ In MAME: Supported.
-------------------------------------------------*/
void nes_bmc_411120c_device::prg_cb(int start, int bank)
{
- if (m_reg & 8) // & 0xc when DSW change (diff menu?)
- prg32(((m_reg >> 4) & 3) | 0x0c);
- else
- prg8_x(start, (bank & 0x0f) | ((m_reg & 0x03) << 4));
+ if (!BIT(m_reg, 3)) // all games use MMC3 PRG banking except Master Fighter II
+ nes_txrom_device::prg_cb(start, bank);
}
-void nes_bmc_411120c_device::chr_cb(int start, int bank, int source)
-{
- chr1_x(start, bank | ((m_reg & 3) << 7), source);
-}
-
-void nes_bmc_411120c_device::write_m(offs_t offset, uint8_t data)
+void nes_bmc_411120c_device::write_m(offs_t offset, u8 data)
{
LOG_MMC(("bmc_411120c write_m, offset: %04x, data: %02x\n", offset, data));
- m_reg = data;
- set_prg(m_prg_base, m_prg_mask);
- set_chr(m_chr_source, m_chr_base, m_chr_mask);
+ if (BIT(m_wram_protect, 7))
+ {
+ m_reg = offset;
+ if (BIT(m_reg, 3))
+ prg32((m_reg & 0x07) << 2 | (m_reg & 0x30) >> 4);
+ else
+ {
+ m_prg_base = (m_reg & 0x07) << 4;
+ set_prg(m_prg_base, m_prg_mask);
+ }
+ m_chr_base = (m_reg & 0x07) << 7;
+ set_chr(m_chr_source, m_chr_base, m_chr_mask);
+ }
}
/*-------------------------------------------------
diff --git a/src/devices/bus/nes/mmc3_clones.h b/src/devices/bus/nes/mmc3_clones.h
index deb352c476c..c44b529dc88 100644
--- a/src/devices/bus/nes/mmc3_clones.h
+++ b/src/devices/bus/nes/mmc3_clones.h
@@ -692,11 +692,10 @@ class nes_bmc_411120c_device : public nes_txrom_device
{
public:
// construction/destruction
- nes_bmc_411120c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ nes_bmc_411120c_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
- virtual void write_m(offs_t offset, uint8_t data) override;
+ virtual void write_m(offs_t offset, u8 data) override;
virtual void prg_cb(int start, int bank) override;
- virtual void chr_cb(int start, int bank, int source) override;
virtual void pcb_reset() override;
@@ -705,7 +704,7 @@ protected:
virtual void device_start() override;
private:
- uint8_t m_reg;
+ u8 m_reg;
};
diff --git a/src/devices/bus/nes/nes_ines.hxx b/src/devices/bus/nes/nes_ines.hxx
index d3fd9063787..d6bc4203233 100644
--- a/src/devices/bus/nes/nes_ines.hxx
+++ b/src/devices/bus/nes/nes_ines.hxx
@@ -322,7 +322,7 @@ static const nes_mmc mmc_list[] =
// 284 UNL_DRIPGAME, not in nes.xml
{ 285, BMC_A65AS },
{ 286, BMC_BENSHIENG },
- { 287, BMC_411120C }, // also BMC-K-3088, not in nes.xml?
+ { 287, BMC_411120C },
// 288 GKCX1 21 in 1 multicarts, not in nes.xml?
// { 289, BMC_60311C }, not in nes.xml?
{ 290, BMC_NTD_03 },