From 8f27418c41130bf733cb85bddb3de8152f7d4159 Mon Sep 17 00:00:00 2001
From: 0kmg <9137159+0kmg@users.noreply.github.com>
Date: Tue, 14 Dec 2021 06:32:19 -0900
Subject: bus/nes: Added support for TF2740 related multicart boards. (#8925)
New working software list additions (nes.xml)
-----------------------------------
10000000 in 1 (KB46) [Consolethinks, Nikolka]
14 in 1 (FL-14A) [Consolethinks, Nikolka]
158 in 1 (AB-5027) [Consolethinks, Nikolka]
40 in 1 (110-05) [Consolethinks, Nikolka]
9999 in 1 (108-03) [Consolethinks, Nikolka]
---
hash/nes.xml | 76 ++++++++++++++++++++++++++++++++++++++
src/devices/bus/nes/multigame.cpp | 78 ++++++++++++++++++++++++++++++++++++++-
src/devices/bus/nes/multigame.h | 26 +++++++++++++
src/devices/bus/nes/nes_carts.cpp | 1 +
src/devices/bus/nes/nes_ines.hxx | 2 +-
src/devices/bus/nes/nes_pcb.hxx | 1 +
src/devices/bus/nes/nes_slot.h | 4 +-
7 files changed, 184 insertions(+), 4 deletions(-)
diff --git a/hash/nes.xml b/hash/nes.xml
index e79bf5656d2..122ec649bc9 100644
--- a/hash/nes.xml
+++ b/hash/nes.xml
@@ -79487,6 +79487,21 @@ be better to redump them properly. -->
+
+ 10000000 in 1 (KB46)
+ 19??
+ <pirate>
+
+
+
+
+
+
+
+
+
+
+
101 in 1 Games
19??
@@ -79757,6 +79772,21 @@ be better to redump them properly. -->
+
+ 14 in 1 (FL-14A)
+ 19??
+ <pirate>
+
+
+
+
+
+
+
+
+
+
+
14 in 1 (NTDEC)
1988
@@ -79917,6 +79947,21 @@ be better to redump them properly. -->
+
+ 158 in 1 (AB-5027)
+ 19??
+ <pirate>
+
+
+
+
+
+
+
+
+
+
+
16 in 1 (SA005-A)
19??
@@ -81760,6 +81805,21 @@ be better to redump them properly. -->
+
+ 40 in 1 (110-05)
+ 19??
+ <pirate>
+
+
+
+
+
+
+
+
+
+
+
400 in 1
19??
@@ -83187,6 +83247,22 @@ be better to redump them properly. -->
+
+
+ 9999 in 1 (108-03)
+ 19??
+ <pirate>
+
+
+
+
+
+
+
+
+
+
+
9999999 in 1
19??
diff --git a/src/devices/bus/nes/multigame.cpp b/src/devices/bus/nes/multigame.cpp
index bc947a1ef51..a2d445a88de 100644
--- a/src/devices/bus/nes/multigame.cpp
+++ b/src/devices/bus/nes/multigame.cpp
@@ -63,6 +63,7 @@ DEFINE_DEVICE_TYPE(NES_BMC_K1029, nes_bmc_k1029_device, "nes_bmc_k1029
DEFINE_DEVICE_TYPE(NES_BMC_K3036, nes_bmc_k3036_device, "nes_bmc_k3036", "NES Cart BMC K-3036 PCB")
DEFINE_DEVICE_TYPE(NES_BMC_K3046, nes_bmc_k3046_device, "nes_bmc_k3046", "NES Cart BMC K-3046 PCB")
DEFINE_DEVICE_TYPE(NES_BMC_SA005A, nes_bmc_sa005a_device, "nes_bmc_sa005a", "NES Cart BMC SA005-A PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_TF2740, nes_bmc_tf2740_device, "nes_bmc_tf2740", "NES Cart BMC TF2740 PCB")
DEFINE_DEVICE_TYPE(NES_BMC_TJ03, nes_bmc_tj03_device, "nes_bmc_tj03", "NES Cart BMC TJ-03 PCB")
DEFINE_DEVICE_TYPE(NES_BMC_WS, nes_bmc_ws_device, "nes_bmc_ws", "NES Cart BMC WS PCB")
DEFINE_DEVICE_TYPE(NES_BMC_11160, nes_bmc_11160_device, "nes_bmc_1160", "NES Cart BMC-1160 PCB")
@@ -272,6 +273,11 @@ nes_bmc_sa005a_device::nes_bmc_sa005a_device(const machine_config &mconfig, cons
{
}
+nes_bmc_tf2740_device::nes_bmc_tf2740_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : nes_nrom_device(mconfig, NES_BMC_TF2740, tag, owner, clock), m_jumper(0)
+{
+}
+
nes_bmc_tj03_device::nes_bmc_tj03_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_BMC_TJ03, tag, owner, clock)
{
@@ -801,6 +807,22 @@ void nes_bmc_sa005a_device::pcb_reset()
chr8(0, CHRROM);
}
+void nes_bmc_tf2740_device::device_start()
+{
+ common_start();
+ save_item(NAME(m_reg));
+ save_item(NAME(m_jumper));
+}
+
+void nes_bmc_tf2740_device::pcb_reset()
+{
+ prg16_89ab(0);
+ prg16_cdef(0);
+ chr8(0, CHRROM);
+
+ m_reg[0] = m_reg[1] = m_reg[2] = 0;
+}
+
void nes_bmc_ws_device::device_start()
{
common_start();
@@ -1565,7 +1587,7 @@ u8 nes_vt5201_device::read_h(offs_t offset)
LOG_MMC(("bmc_vt5201 read_h, offset: %04x\n", offset));
if (BIT(m_latch, 0))
- return (get_open_bus() & 0xfc) | m_jumper; // TODO: add jumper settings, m_jumper is 0 for now
+ return (get_open_bus() & ~0x03) | m_jumper; // TODO: add jumper settings, m_jumper is 0 for now
else
return hi_access_rom(offset);
}
@@ -2055,6 +2077,60 @@ void nes_bmc_sa005a_device::write_h(offs_t offset, u8 data)
set_nt_mirroring(BIT(offset, 3) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
}
+/*-------------------------------------------------
+
+ BMC-TF2740
+
+ Games: 14 in 1, 40 in 1, 158 in 1, 9999 in 1,
+ 10000000 in 1
+
+ NES 2.0: mapper 428
+
+ In MAME: Supported.
+
+ -------------------------------------------------*/
+
+void nes_bmc_tf2740_device::update_chr()
+{
+ chr8(m_reg[2] & 0xc0 ? (m_reg[1] & 0x04) | (m_reg[0] & 0x03) : m_reg[1] & 0x07, CHRROM);
+}
+
+void nes_bmc_tf2740_device::write_m(offs_t offset, u8 data)
+{
+ LOG_MMC(("bmc_tf2740 write_m, offset: %04x, data: %02x\n", offset, data));
+
+ switch (offset & 0x03)
+ {
+ case 0x01:
+ {
+ u8 bank = data >> 5;
+ u8 mode = BIT(data, 4);
+ prg16_89ab(bank & ~mode);
+ prg16_cdef(bank | mode);
+
+ set_nt_mirroring(BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ [[fallthrough]];
+ }
+ case 0x02:
+ m_reg[offset & 0x03] = data;
+ update_chr();
+ break;
+ }
+}
+
+void nes_bmc_tf2740_device::write_h(offs_t offset, u8 data)
+{
+ LOG_MMC(("bmc_tf2740 write_h, offset: %04x, data: %02x\n", offset, data));
+ m_reg[0] = data;
+ update_chr();
+}
+
+u8 nes_bmc_tf2740_device::read_m(offs_t offset)
+{
+ LOG_MMC(("bmc_tf2740 read_m, offset: %04x\n", offset));
+ return (get_open_bus() & ~0x03) | m_jumper; // TODO: add jumper settings, m_jumper is 0 for now
+}
+
/*-------------------------------------------------
BMC-TJ-03
diff --git a/src/devices/bus/nes/multigame.h b/src/devices/bus/nes/multigame.h
index c4c19f4de7d..648e293f840 100644
--- a/src/devices/bus/nes/multigame.h
+++ b/src/devices/bus/nes/multigame.h
@@ -545,6 +545,31 @@ public:
};
+// ======================> nes_bmc_tf2740_device
+
+class nes_bmc_tf2740_device : public nes_nrom_device
+{
+public:
+ // construction/destruction
+ nes_bmc_tf2740_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+
+ virtual u8 read_m(offs_t offset) override;
+ virtual void write_m(offs_t offset, u8 data) override;
+ virtual void write_h(offs_t offset, u8 data) override;
+
+ virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+private:
+ void update_chr();
+ u8 m_reg[3];
+ u8 m_jumper;
+};
+
+
// ======================> nes_bmc_tj03_device
class nes_bmc_tj03_device : public nes_nrom_device
@@ -1232,6 +1257,7 @@ DECLARE_DEVICE_TYPE(NES_BMC_K1029, nes_bmc_k1029_device)
DECLARE_DEVICE_TYPE(NES_BMC_K3036, nes_bmc_k3036_device)
DECLARE_DEVICE_TYPE(NES_BMC_K3046, nes_bmc_k3046_device)
DECLARE_DEVICE_TYPE(NES_BMC_SA005A, nes_bmc_sa005a_device)
+DECLARE_DEVICE_TYPE(NES_BMC_TF2740, nes_bmc_tf2740_device)
DECLARE_DEVICE_TYPE(NES_BMC_TJ03, nes_bmc_tj03_device)
DECLARE_DEVICE_TYPE(NES_BMC_WS, nes_bmc_ws_device)
DECLARE_DEVICE_TYPE(NES_BMC_11160, nes_bmc_11160_device)
diff --git a/src/devices/bus/nes/nes_carts.cpp b/src/devices/bus/nes/nes_carts.cpp
index 58acce6cd1d..fa70103c0db 100644
--- a/src/devices/bus/nes/nes_carts.cpp
+++ b/src/devices/bus/nes/nes_carts.cpp
@@ -404,6 +404,7 @@ void nes_cart(device_slot_interface &device)
device.option_add_internal("bmc_k3036", NES_BMC_K3036);
device.option_add_internal("bmc_k3046", NES_BMC_K3046);
device.option_add_internal("bmc_sa005a", NES_BMC_SA005A);
+ device.option_add_internal("bmc_tf2740", NES_BMC_TF2740);
device.option_add_internal("bmc_tj03", NES_BMC_TJ03);
device.option_add_internal("bmc_ws", NES_BMC_WS);
device.option_add_internal("bmc_g146", NES_BMC_G146);
diff --git a/src/devices/bus/nes/nes_ines.hxx b/src/devices/bus/nes/nes_ines.hxx
index fc4e7995ff7..4e6baa00c5f 100644
--- a/src/devices/bus/nes/nes_ines.hxx
+++ b/src/devices/bus/nes/nes_ines.hxx
@@ -463,7 +463,7 @@ static const nes_mmc mmc_list[] =
// 425 Cube Tech PnP
// 426 PnP
// 427 PnP
- // 428 a couple multicarts
+ { 428, BMC_TF2740 },
// 429 Unused
// 430 Unused
{ 431, BMC_GN91B },
diff --git a/src/devices/bus/nes/nes_pcb.hxx b/src/devices/bus/nes/nes_pcb.hxx
index c417986ba58..647a9c00bfc 100644
--- a/src/devices/bus/nes/nes_pcb.hxx
+++ b/src/devices/bus/nes/nes_pcb.hxx
@@ -284,6 +284,7 @@ static const nes_pcb pcb_list[] =
{ "bmc_k3036", BMC_K3036 },
{ "bmc_k3046", BMC_K3046 },
{ "bmc_sa005a", BMC_SA005A },
+ { "bmc_tf2740", BMC_TF2740 },
{ "bmc_tj03", BMC_TJ03 },
{ "bmc_ws", BMC_WS },
{ "bmc_hik300", BMC_SUPERHIK_300IN1 },
diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h
index bc89cc10c6c..1a0905f44d6 100644
--- a/src/devices/bus/nes/nes_slot.h
+++ b/src/devices/bus/nes/nes_slot.h
@@ -107,8 +107,8 @@ enum
BMC_830832C, BMC_YY841101C, BMC_YY841155C,
BMC_GOLD150, BMC_GOLD260,
BMC_12IN1, BMC_4IN1RESET, BMC_42IN1RESET, BMC_LITTLECOM160, BMC_CTC09,
- BMC_K1029, BMC_K3006, BMC_K3033, BMC_K3036, BMC_K3046, BMC_SA005A, BMC_TJ03,
- BMC_RESETSXROM, BMC_RESETTXROM, BMC_TECHLINE9IN1,
+ BMC_K1029, BMC_K3006, BMC_K3033, BMC_K3036, BMC_K3046, BMC_SA005A,
+ BMC_TF2740, BMC_TJ03, BMC_RESETSXROM, BMC_RESETTXROM, BMC_TECHLINE9IN1,
// Unlicensed
UNL_8237, UNL_8237A, UNL_CC21, UNL_AX40G, UNL_AX5705, UNL_KN42,
UNL_KOF97, UNL_N625092, UNL_SC127, UNL_SMB2J, UNL_T230, UNL_MMALEE,
--
cgit v1.2.3