summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/nes
diff options
context:
space:
mode:
author 0kmg <9137159+0kmg@users.noreply.github.com>2021-09-13 02:30:23 -0800
committer 0kmg <9137159+0kmg@users.noreply.github.com>2021-09-13 18:57:17 -0800
commite37c964756e39aa50dd3d00c6b610a33a0a7fc30 (patch)
treed87c36f47434afbe9fa9e19332fc51b2cc7e470b /src/devices/bus/nes
parente30ee3c9a20c7d43804c2c69113b8f150b2d118e (diff)
bus/nes: Added support for 820720C and JY820845C multicarts.
New working software list additions (nes.xml) ----------------------------------- 1993 Super HiK 8 in 1 (G-002) [NewRisingSun] 7 in 1 1993 Chess Series (JY-015) [Consolethinks, NewRisingSun]
Diffstat (limited to 'src/devices/bus/nes')
-rw-r--r--src/devices/bus/nes/mmc1_clones.cpp79
-rw-r--r--src/devices/bus/nes/mmc1_clones.h33
-rw-r--r--src/devices/bus/nes/mmc3_clones.cpp89
-rw-r--r--src/devices/bus/nes/mmc3_clones.h26
-rw-r--r--src/devices/bus/nes/nes_carts.cpp2
-rw-r--r--src/devices/bus/nes/nes_ines.hxx4
-rw-r--r--src/devices/bus/nes/nes_pcb.hxx2
-rw-r--r--src/devices/bus/nes/nes_slot.h4
8 files changed, 229 insertions, 10 deletions
diff --git a/src/devices/bus/nes/mmc1_clones.cpp b/src/devices/bus/nes/mmc1_clones.cpp
index eb5b7d937ab..b0502e5f394 100644
--- a/src/devices/bus/nes/mmc1_clones.cpp
+++ b/src/devices/bus/nes/mmc1_clones.cpp
@@ -28,11 +28,17 @@
// constructor
//-------------------------------------------------
-DEFINE_DEVICE_TYPE(NES_NINJARYU, nes_ninjaryu_device, "nes_ninjaryu", "NES Cart Ninja Ryukenden Chinese PCB")
-DEFINE_DEVICE_TYPE(NES_RESETSXROM, nes_resetsxrom_device, "nes_resetsxrom", "NES Cart BMC RESET-SXROM PCB")
-DEFINE_DEVICE_TYPE(NES_TXC_22110, nes_txc_22110_device, "nes_txc_22110", "NES Cart TXC 01-22110-000 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_JY820845C, nes_bmc_jy820845c_device, "nes_bmc_jy820845c", "NES Cart BMC JY820845C PCB")
+DEFINE_DEVICE_TYPE(NES_NINJARYU, nes_ninjaryu_device, "nes_ninjaryu", "NES Cart Ninja Ryukenden Chinese PCB")
+DEFINE_DEVICE_TYPE(NES_RESETSXROM, nes_resetsxrom_device, "nes_resetsxrom", "NES Cart BMC RESET-SXROM PCB")
+DEFINE_DEVICE_TYPE(NES_TXC_22110, nes_txc_22110_device, "nes_txc_22110", "NES Cart TXC 01-22110-000 PCB")
+nes_bmc_jy820845c_device::nes_bmc_jy820845c_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : nes_sxrom_device(mconfig, NES_BMC_JY820845C, tag, owner, clock), m_latch0(0), m_mode(0)
+{
+}
+
nes_ninjaryu_device::nes_ninjaryu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_sxrom_device(mconfig, NES_NINJARYU, tag, owner, clock)
{
@@ -50,6 +56,22 @@ nes_txc_22110_device::nes_txc_22110_device(const machine_config &mconfig, const
+void nes_bmc_jy820845c_device::device_start()
+{
+ nes_sxrom_device::device_start();
+ save_item(NAME(m_latch0));
+ save_item(NAME(m_mode));
+}
+
+void nes_bmc_jy820845c_device::pcb_reset()
+{
+ nes_sxrom_device::pcb_reset();
+
+ m_latch0 = 0;
+ m_mode = 0;
+ update_banks();
+}
+
void nes_resetsxrom_device::device_start()
{
nes_sxrom_device::device_start();
@@ -117,6 +139,57 @@ void nes_ninjaryu_device::write_h(offs_t offset, u8 data)
/*-------------------------------------------------
+ BMC-JY820845C
+
+ Games: 7 in 1 1993 Chess Series (JY-015)
+
+ MMC1 clone with banking for multigame menu.
+
+ NES 2.0: mapper 550
+
+ In MAME: Supported.
+
+ -------------------------------------------------*/
+
+void nes_bmc_jy820845c_device::update_banks() // used by menu and MHROM games
+{
+ prg32((m_mode & 0x07) << 1 | BIT(m_latch0, 4));
+ chr8((m_mode & 0x06) << 1 | (m_latch0 & 0x03), CHRROM);
+}
+
+void nes_bmc_jy820845c_device::write_m(offs_t offset, u8 data)
+{
+ LOG_MMC(("bmc_jy820845c write_m, offset: %04x, data: %02x\n", offset, data));
+
+ nes_sxrom_device::write_m(offset, data); // register overlaid on WRAM
+
+ if (offset >= 0x1000 && !BIT(m_mode, 3))
+ {
+ m_mode = offset & 0x0f;
+ if ((m_mode & 0x06) == 0x06) // MMC1 mode
+ {
+ set_prg();
+ set_chr();
+ }
+ else
+ update_banks();
+ }
+}
+
+void nes_bmc_jy820845c_device::write_h(offs_t offset, u8 data)
+{
+ LOG_MMC(("bmc_jy820845c write_h, offset: %04x, data: %02x\n", offset, data));
+
+ m_latch0 = data;
+
+ if ((m_mode & 0x06) == 0x06)
+ nes_sxrom_device::write_h(offset, data);
+ else
+ update_banks();
+}
+
+/*-------------------------------------------------
+
BMC-RESET-SXROM
Games: 4 in 1 (JY-021, JY-022, JY-051)
diff --git a/src/devices/bus/nes/mmc1_clones.h b/src/devices/bus/nes/mmc1_clones.h
index 310dfb7c098..2a1b7441cea 100644
--- a/src/devices/bus/nes/mmc1_clones.h
+++ b/src/devices/bus/nes/mmc1_clones.h
@@ -8,6 +8,32 @@
#include "mmc1.h"
+// ======================> nes_bmc_jy820845c_device
+
+class nes_bmc_jy820845c_device : public nes_sxrom_device
+{
+public:
+ // construction/destruction
+ nes_bmc_jy820845c_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+
+ 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;
+
+ virtual void set_prg() override { nes_sxrom_device::set_prg(0x18, 0x07); }
+ virtual void set_chr() override { nes_sxrom_device::set_chr(0x18, 0x07); }
+
+private:
+ void update_banks();
+ u8 m_latch0, m_mode;
+};
+
+
// ======================> nes_ninjaryu_device
class nes_ninjaryu_device : public nes_sxrom_device
@@ -73,8 +99,9 @@ private:
// device type definition
-DECLARE_DEVICE_TYPE(NES_NINJARYU, nes_ninjaryu_device)
-DECLARE_DEVICE_TYPE(NES_RESETSXROM, nes_resetsxrom_device)
-DECLARE_DEVICE_TYPE(NES_TXC_22110, nes_txc_22110_device)
+DECLARE_DEVICE_TYPE(NES_BMC_JY820845C, nes_bmc_jy820845c_device)
+DECLARE_DEVICE_TYPE(NES_NINJARYU, nes_ninjaryu_device)
+DECLARE_DEVICE_TYPE(NES_RESETSXROM, nes_resetsxrom_device)
+DECLARE_DEVICE_TYPE(NES_TXC_22110, nes_txc_22110_device)
#endif // MAME_BUS_NES_MMC1_CLONES_H
diff --git a/src/devices/bus/nes/mmc3_clones.cpp b/src/devices/bus/nes/mmc3_clones.cpp
index 75a539923bb..4ab3aa8b6ec 100644
--- a/src/devices/bus/nes/mmc3_clones.cpp
+++ b/src/devices/bus/nes/mmc3_clones.cpp
@@ -73,6 +73,7 @@ DEFINE_DEVICE_TYPE(NES_BMC_GN45, nes_bmc_gn45_device, "nes_bmc_gn45",
DEFINE_DEVICE_TYPE(NES_BMC_GOLD7IN1, nes_bmc_gold7in1_device, "nes_bmc_gold7in1", "NES Cart BMC Golden 7 in 1 PCB")
DEFINE_DEVICE_TYPE(NES_BMC_K3006, nes_bmc_k3006_device, "nes_bmc_k3006", "NES Cart BMC K-3006 PCB")
DEFINE_DEVICE_TYPE(NES_BMC_411120C, nes_bmc_411120c_device, "nes_bmc_411120c", "NES Cart BMC 411120C PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_820720C, nes_bmc_820720c_device, "nes_bmc_820720c", "NES Cart BMC 820720C PCB")
DEFINE_DEVICE_TYPE(NES_BMC_830118C, nes_bmc_830118c_device, "nes_bmc_830118c", "NES Cart BMC 830118C PCB")
DEFINE_DEVICE_TYPE(NES_BMC_830832C, nes_bmc_830832c_device, "nes_bmc_830832c", "NES Cart BMC 830832C PCB")
DEFINE_DEVICE_TYPE(NES_BMC_841101C, nes_bmc_841101c_device, "nes_bmc_841101c", "NES Cart BMC 841101C PCB")
@@ -325,6 +326,11 @@ nes_bmc_411120c_device::nes_bmc_411120c_device(const machine_config &mconfig, co
{
}
+nes_bmc_820720c_device::nes_bmc_820720c_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : nes_txrom_device(mconfig, NES_BMC_820720C, tag, owner, clock), m_reg(0)
+{
+}
+
nes_bmc_830118c_device::nes_bmc_830118c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: nes_txrom_device(mconfig, NES_BMC_830118C, tag, owner, clock), m_reg(0)
{
@@ -752,6 +758,20 @@ void nes_bmc_411120c_device::pcb_reset()
mmc3_common_initialize(0x0f, 0x7f, 0);
}
+void nes_bmc_820720c_device::device_start()
+{
+ mmc3_start();
+ save_item(NAME(m_reg));
+}
+
+void nes_bmc_820720c_device::pcb_reset()
+{
+ m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
+
+ m_reg = 0;
+ mmc3_common_initialize(0x0f, 0xff, 0);
+}
+
void nes_bmc_830118c_device::device_start()
{
mmc3_start();
@@ -2635,6 +2655,75 @@ void nes_bmc_411120c_device::write_m(offs_t offset, u8 data)
/*-------------------------------------------------
+ BMC-820720C
+
+ Games: 1993 Super HiK 8 in 1 (G-002)
+
+ MMC3 clone with banking for multigame menu.
+
+ NES 2.0: mapper 393
+
+ In MAME: Supported.
+
+ -------------------------------------------------*/
+
+void nes_bmc_820720c_device::set_prg(int prg_base, int prg_mask)
+{
+ switch (m_reg >> 4)
+ {
+ case 0: // MMC3 mode
+ case 1:
+ nes_txrom_device::set_prg(prg_base, prg_mask);
+ break;
+ case 2: // BNROM mode
+ prg32((prg_base | (m_mmc_prg_bank[BIT(m_latch, 6) << 1] & prg_mask)) >> 2);
+ break;
+ case 3: // UNROM mode
+ prg16_89ab(m_prg_base >> 1);
+ prg16_cdef(m_prg_base >> 1 | 0x07);
+ break;
+ }
+}
+
+void nes_bmc_820720c_device::set_chr(u8 chr, int chr_base, int chr_mask)
+{
+ if (BIT(m_reg, 3))
+ chr8(0, CHRRAM);
+ else
+ nes_txrom_device::set_chr(chr, chr_base, chr_mask);
+}
+
+void nes_bmc_820720c_device::write_m(offs_t offset, u8 data)
+{
+ LOG_MMC(("bmc_820720c write_m, offset: %04x, data: %02x\n", offset, data));
+
+ if ((m_wram_protect & 0xc0) == 0x80)
+ {
+ m_reg = offset & 0x3f;
+
+ m_prg_base = (m_reg & 0x07) << 4;
+ set_prg(m_prg_base, m_prg_mask);
+
+ m_chr_base = (m_reg & 0x01) << 8;
+ set_chr(m_chr_source, m_chr_base, m_chr_mask);
+ }
+}
+
+void nes_bmc_820720c_device::write_h(offs_t offset, u8 data)
+{
+ LOG_MMC(("bmc_820720c write_h, offset: %04x, data: %02x\n", offset, data));
+
+ txrom_write(offset, data); // MMC3 regs always written (for mirroring in non-MMC3 modes)
+
+ if ((m_reg & 0x30) == 0x30) // UNROM mode
+ {
+ prg16_89ab(m_prg_base >> 1 | (data & 0x07));
+ prg16_cdef(m_prg_base >> 1 | 0x07);
+ }
+}
+
+/*-------------------------------------------------
+
BMC-830118C
diff --git a/src/devices/bus/nes/mmc3_clones.h b/src/devices/bus/nes/mmc3_clones.h
index d402291b84f..ce2a01b91eb 100644
--- a/src/devices/bus/nes/mmc3_clones.h
+++ b/src/devices/bus/nes/mmc3_clones.h
@@ -833,6 +833,31 @@ private:
};
+// ======================> nes_bmc_820720c_device
+
+class nes_bmc_820720c_device : public nes_txrom_device
+{
+public:
+ // construction/destruction
+ nes_bmc_820720c_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+
+ 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;
+
+ virtual void set_prg(int prg_base, int prg_mask) override;
+ virtual void set_chr(u8 chr, int chr_base, int chr_mask) override;
+
+private:
+ u8 m_reg;
+};
+
+
// ======================> nes_bmc_830118c_device
class nes_bmc_830118c_device : public nes_txrom_device
@@ -973,6 +998,7 @@ DECLARE_DEVICE_TYPE(NES_BMC_GN45, nes_bmc_gn45_device)
DECLARE_DEVICE_TYPE(NES_BMC_GOLD7IN1, nes_bmc_gold7in1_device)
DECLARE_DEVICE_TYPE(NES_BMC_K3006, nes_bmc_k3006_device)
DECLARE_DEVICE_TYPE(NES_BMC_411120C, nes_bmc_411120c_device)
+DECLARE_DEVICE_TYPE(NES_BMC_820720C, nes_bmc_820720c_device)
DECLARE_DEVICE_TYPE(NES_BMC_830118C, nes_bmc_830118c_device)
DECLARE_DEVICE_TYPE(NES_BMC_830832C, nes_bmc_830832c_device)
DECLARE_DEVICE_TYPE(NES_BMC_841101C, nes_bmc_841101c_device)
diff --git a/src/devices/bus/nes/nes_carts.cpp b/src/devices/bus/nes/nes_carts.cpp
index 817a3ad79b9..0c6c5bb0f56 100644
--- a/src/devices/bus/nes/nes_carts.cpp
+++ b/src/devices/bus/nes/nes_carts.cpp
@@ -374,6 +374,7 @@ void nes_cart(device_slot_interface &device)
device.option_add_internal("bmc_810544c", NES_BMC_810544C);
device.option_add_internal("bmc_830425c", NES_BMC_830425C);
device.option_add_internal("bmc_850437c", NES_BMC_850437C);
+ device.option_add_internal("bmc_jy820845c", NES_BMC_JY820845C);
device.option_add_internal("n32_4in1", NES_N32_4IN1);
device.option_add_internal("ntd03", NES_NTD03);
device.option_add_internal("bmc_ctc09", NES_BMC_CTC09);
@@ -443,6 +444,7 @@ void nes_cart(device_slot_interface &device)
device.option_add_internal("bmc_gn45", NES_BMC_GN45);
device.option_add_internal("bmc_gold7in1", NES_BMC_GOLD7IN1);
device.option_add_internal("bmc_411120c", NES_BMC_411120C);
+ device.option_add_internal("bmc_820720c", NES_BMC_820720C);
device.option_add_internal("bmc_830118c", NES_BMC_830118C);
device.option_add_internal("bmc_830832c", NES_BMC_830832C);
device.option_add_internal("bmc_841101c", NES_BMC_841101C);
diff --git a/src/devices/bus/nes/nes_ines.hxx b/src/devices/bus/nes/nes_ines.hxx
index 8a08f7033b6..665496f5a9b 100644
--- a/src/devices/bus/nes/nes_ines.hxx
+++ b/src/devices/bus/nes/nes_ines.hxx
@@ -428,7 +428,7 @@ static const nes_mmc mmc_list[] =
// 390 variant of mapper 236?
// 391 BS-110 MMC3 clone
// 392 8-in-1 variant of mc_sv16
- // 393 820720C multicart
+ { 393, BMC_820720C },
// 394 Realtec HSK007 multicart
// 395 Realtec 8210 multicarts
{ 396, BMC_850437C },
@@ -510,7 +510,7 @@ static const nes_mmc mmc_list[] =
// 547 Konami QTa adapter games
// { 548, BTL_CTC15 }, // Almana no Kiseki alt FDS conversion (dump available?)
{ 549, KAISER_KS7016B }, // Meikyuu Jiin Dababa alt FDS conversion
- // 550 JY-015 multicart
+ { 550, BMC_JY820845C },
// 551 variant of mapper 178, likely shenghuo, jingkzx, xiaokecq, zgfyun in nes.xml
// 552 TAITO_X1_017, this is a correction of mapper 82. We should drop 82 and only support the accurate dumps of 552?
{ 553, SACHEN_3013 }, // Dong Dong Nao 1
diff --git a/src/devices/bus/nes/nes_pcb.hxx b/src/devices/bus/nes/nes_pcb.hxx
index 75438bb5735..b97138aad0d 100644
--- a/src/devices/bus/nes/nes_pcb.hxx
+++ b/src/devices/bus/nes/nes_pcb.hxx
@@ -259,6 +259,7 @@ static const nes_pcb pcb_list[] =
{ "bmc_810544c", BMC_810544C },
{ "bmc_830425c", BMC_830425C },
{ "bmc_850437c", BMC_850437C },
+ { "bmc_jy820845c", BMC_JY820845C },
{ "n32_4in1", BMC_N32_4IN1 },
{ "ntd03", BMC_NTD_03 },
{ "bmc_ctc09", BMC_CTC09 },
@@ -320,6 +321,7 @@ static const nes_pcb pcb_list[] =
{ "bmc_gn45", BMC_GN45 },
{ "bmc_gold7in1", BMC_GOLD_7IN1 },
{ "bmc_411120c", BMC_411120C },
+ { "bmc_820720c", BMC_820720C },
{ "bmc_830118c", BMC_830118C },
{ "bmc_830832c", BMC_830832C },
{ "bmc_841101c", BMC_841101C },
diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h
index 4a30a30c44a..90a2c73a603 100644
--- a/src/devices/bus/nes/nes_slot.h
+++ b/src/devices/bus/nes/nes_slot.h
@@ -98,9 +98,9 @@ enum
BMC_GKA, BMC_GKB, BMC_GKCXIN1, BMC_HP898F, BMC_VT5201, BMC_BENSHIENG,
BMC_60311C, BMC_80013B, BMC_810544C, BMC_830425C, BMC_850437C,
BMC_N32_4IN1, BMC_NT639, BMC_NTD_03, BMC_G63IN1,
- BMC_FCGENJIN_8IN1, BMC_FK23C, BMC_FK23CA,
+ BMC_FCGENJIN_8IN1, BMC_FK23C, BMC_FK23CA, BMC_JY820845C,
BMC_PJOY84, BMC_TH22913, BMC_11160, BMC_G146,
- BMC_2751, BMC_8157, BMC_830118C, BMC_830832C, BMC_841101C,
+ BMC_2751, BMC_8157, BMC_820720C, BMC_830118C, BMC_830832C, BMC_841101C,
BMC_411120C, BMC_GOLD150, BMC_GOLD260, BMC_SUPER22,
BMC_12IN1, BMC_4IN1RESET, BMC_42IN1RESET, BMC_LITTLECOM160, BMC_CTC09,
BMC_K1029, BMC_K3006, BMC_K3036, BMC_K3046, BMC_SA005A, BMC_TJ03,