From 3f7fe14addcdca95653a71755ff3025b7221554b Mon Sep 17 00:00:00 2001 From: 0kmg <9137159+0kmg@users.noreply.github.com> Date: Fri, 17 Sep 2021 14:07:25 -0800 Subject: [PATCH] bus/nes: Added support for two more multicarts. New working software list additions ----------------------------------- 9 in 1 (Journey to the West) [anonymous] Super 8 in 1 (Supervision menu) [v5100v5100] --- hash/nes.xml | 40 +++++++++++++++++ src/devices/bus/nes/mmc3_clones.cpp | 70 +++++++++++++++++++++++++++++ src/devices/bus/nes/mmc3_clones.h | 25 +++++++++++ src/devices/bus/nes/multigame.cpp | 57 ++++++++++++++++++++++- src/devices/bus/nes/multigame.h | 22 +++++++++ src/devices/bus/nes/nes_carts.cpp | 2 + src/devices/bus/nes/nes_ines.hxx | 4 +- src/devices/bus/nes/nes_pcb.hxx | 2 + src/devices/bus/nes/nes_slot.h | 5 ++- 9 files changed, 222 insertions(+), 5 deletions(-) diff --git a/hash/nes.xml b/hash/nes.xml index 4025572b55f..a8de04a8bfd 100644 --- a/hash/nes.xml +++ b/hash/nes.xml @@ -81111,6 +81111,29 @@ be better to redump them properly. --> + + + Super 8 in 1 (Supervision menu) + 199? + <pirate> + + + + + + + + + + + + + + + + + + 80 in 1 19?? @@ -81224,6 +81247,23 @@ be better to redump them properly. --> + + + 9 in 1 (Journey to the West) + 199? + <pirate> + + + + + + + + + + + + 9 in 1 King001 19?? diff --git a/src/devices/bus/nes/mmc3_clones.cpp b/src/devices/bus/nes/mmc3_clones.cpp index 4ab3aa8b6ec..7f272e15828 100644 --- a/src/devices/bus/nes/mmc3_clones.cpp +++ b/src/devices/bus/nes/mmc3_clones.cpp @@ -72,6 +72,7 @@ DEFINE_DEVICE_TYPE(NES_BMC_F15, nes_bmc_f15_device, "nes_bmc_f15", DEFINE_DEVICE_TYPE(NES_BMC_GN45, nes_bmc_gn45_device, "nes_bmc_gn45", "NES Cart BMC GN-45 PCB") 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_00202650, nes_bmc_00202650_device, "nes_bmc_00202650", "NES Cart BMC 00202650 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") @@ -321,6 +322,11 @@ nes_bmc_k3006_device::nes_bmc_k3006_device(const machine_config &mconfig, const { } +nes_bmc_00202650_device::nes_bmc_00202650_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_txrom_device(mconfig, NES_BMC_00202650, tag, owner, clock), m_mmc3_mode(false) +{ +} + 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) { @@ -744,6 +750,24 @@ void nes_bmc_k3006_device::pcb_reset() prg16_cdef(0); } +void nes_bmc_00202650_device::device_start() +{ + mmc3_start(); + save_item(NAME(m_mmc3_mode)); +} + +void nes_bmc_00202650_device::pcb_reset() +{ + m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; + + m_mmc3_mode = false; + mmc3_common_initialize(0x0f, 0x7f, 0); + + // PCB has an extra 32KB boot menu chip, only the menu uses the CHRRAM + prg32((m_prg_chunks >> 1) - 1); + chr8(0, CHRRAM); +} + void nes_bmc_411120c_device::device_start() { mmc3_start(); @@ -2614,6 +2638,52 @@ void nes_bmc_k3006_device::write_m(offs_t offset, u8 data) } } +/*------------------------------------------------- + + BMC-00202650 + + Games: 8 in 1 + + MMC3 clone with banking for multigame menu. + + NES 2.0: mapper 392 + + In MAME: Supported. + + TODO: Soft reset does work for some games some of the + time. Seems to be caused by main RAM contents. Does + this happen on hardware? + + -------------------------------------------------*/ + +void nes_bmc_00202650_device::set_prg(int prg_base, int prg_mask) +{ + if (m_mmc3_mode) + nes_txrom_device::set_prg(prg_base, prg_mask); +} + +void nes_bmc_00202650_device::set_chr(u8 chr, int chr_base, int chr_mask) +{ + if (m_mmc3_mode) + nes_txrom_device::set_chr(chr, chr_base, chr_mask); +} + +void nes_bmc_00202650_device::write_m(offs_t offset, u8 data) +{ + LOG_MMC(("bmc_00202650 write_m, offset: %04x, data: %02x\n", offset, data)); + + if (!m_mmc3_mode) + { + m_mmc3_mode = BIT(data, 4); + + m_prg_base = (data & 0x07) << 4; + set_prg(m_prg_base, m_prg_mask); + + m_chr_base = m_prg_base << 3; + set_chr(m_chr_source, m_chr_base, m_chr_mask); + } +} + /*------------------------------------------------- BMC-411120C, BMC-810849-C diff --git a/src/devices/bus/nes/mmc3_clones.h b/src/devices/bus/nes/mmc3_clones.h index ce2a01b91eb..ba86ed4ab2d 100644 --- a/src/devices/bus/nes/mmc3_clones.h +++ b/src/devices/bus/nes/mmc3_clones.h @@ -811,6 +811,30 @@ public: }; +// ======================> nes_bmc_00202650_device + +class nes_bmc_00202650_device : public nes_txrom_device +{ +public: + // construction/destruction + nes_bmc_00202650_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 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: + bool m_mmc3_mode; +}; + + // ======================> nes_bmc_411120c_device class nes_bmc_411120c_device : public nes_txrom_device @@ -997,6 +1021,7 @@ DECLARE_DEVICE_TYPE(NES_BMC_F15, nes_bmc_f15_device) 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_00202650, nes_bmc_00202650_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) diff --git a/src/devices/bus/nes/multigame.cpp b/src/devices/bus/nes/multigame.cpp index 18ae4573048..0e808dcac49 100644 --- a/src/devices/bus/nes/multigame.cpp +++ b/src/devices/bus/nes/multigame.cpp @@ -46,6 +46,7 @@ DEFINE_DEVICE_TYPE(NES_BMC_60311C, nes_bmc_60311c_device, "nes_bmc_60311 DEFINE_DEVICE_TYPE(NES_BMC_80013B, nes_bmc_80013b_device, "nes_bmc_80013b", "NES Cart BMC 80013-B PCB") DEFINE_DEVICE_TYPE(NES_BMC_810544C, nes_bmc_810544c_device, "nes_bmc_810544c", "NES Cart BMC 810544-C-A1 PCB") DEFINE_DEVICE_TYPE(NES_BMC_830425C, nes_bmc_830425c_device, "nes_bmc_830425c", "NES Cart BMC 830425C-4391T PCB") +DEFINE_DEVICE_TYPE(NES_BMC_830928C, nes_bmc_830928c_device, "nes_bmc_830928c", "NES Cart BMC 830928C PCB") DEFINE_DEVICE_TYPE(NES_BMC_850437C, nes_bmc_850437c_device, "nes_bmc_850437c", "NES Cart BMC 850437C PCB") DEFINE_DEVICE_TYPE(NES_NTD03, nes_ntd03_device, "nes_ntd03", "NES Cart NTD-03 PCB") DEFINE_DEVICE_TYPE(NES_BMC_CTC09, nes_bmc_ctc09_device, "nes_bmc_ctc09", "NES Cart BMC CTC-09 PCB") @@ -205,6 +206,11 @@ nes_bmc_830425c_device::nes_bmc_830425c_device(const machine_config &mconfig, co { } +nes_bmc_830928c_device::nes_bmc_830928c_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_nrom_device(mconfig, NES_BMC_830928C, tag, owner, clock), m_latch(0) +{ +} + nes_bmc_850437c_device::nes_bmc_850437c_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_BMC_850437C, tag, owner, clock) { @@ -664,6 +670,21 @@ void nes_bmc_830425c_device::pcb_reset() m_latch = 0; } +void nes_bmc_830928c_device::device_start() +{ + common_start(); + save_item(NAME(m_latch)); +} + +void nes_bmc_830928c_device::pcb_reset() +{ + prg16_89ab(0); + prg16_cdef(7); + chr8(0, CHRRAM); + + m_latch = 0; +} + void nes_bmc_850437c_device::device_start() { common_start(); @@ -1609,7 +1630,6 @@ void nes_bmc_810544c_device::write_h(offs_t offset, u8 data) chr8(offset & 0x0f, CHRROM); } - /*------------------------------------------------- BMC-830425C-4391T @@ -1635,6 +1655,41 @@ void nes_bmc_830425c_device::write_h(offs_t offset, u8 data) prg16_cdef(outer | mode); } +/*------------------------------------------------- + + BMC-830928C + + Games: 9 in 1 + + NES 2.0: mapper 382 + + In MAME: Supported. + + -------------------------------------------------*/ + +void nes_bmc_830928c_device::write_h(offs_t offset, u8 data) +{ + LOG_MMC(("bmc_830928c write_h, offset: %04x, data: %02x\n", offset, data)); + + // this pcb is subject to bus conflict + data = account_bus_conflict(offset, data); + + if (!BIT(m_latch, 5)) + { + m_latch = offset & 0x3f; + set_nt_mirroring(BIT(m_latch, 4) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); + } + + u8 outer = (m_latch & 0x07) << 3; + if (BIT(m_latch, 3)) // BNROM mode + prg32(outer >> 1 | (data & 0x03)); + else // UNROM mode + { + prg16_89ab(outer | (data & 0x07)); + prg16_cdef(outer | 7); + } +} + /*------------------------------------------------- BMC-850437C diff --git a/src/devices/bus/nes/multigame.h b/src/devices/bus/nes/multigame.h index 51cfb3be3d9..9125263bc7a 100644 --- a/src/devices/bus/nes/multigame.h +++ b/src/devices/bus/nes/multigame.h @@ -342,6 +342,27 @@ private: }; +// ======================> nes_bmc_830928c_device + +class nes_bmc_830928c_device : public nes_nrom_device +{ +public: + // construction/destruction + nes_bmc_830928c_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + 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: + u8 m_latch; +}; + + // ======================> nes_bmc_850437c_device class nes_bmc_850437c_device : public nes_nrom_device @@ -1170,6 +1191,7 @@ DECLARE_DEVICE_TYPE(NES_BMC_60311C, nes_bmc_60311c_device) DECLARE_DEVICE_TYPE(NES_BMC_80013B, nes_bmc_80013b_device) DECLARE_DEVICE_TYPE(NES_BMC_810544C, nes_bmc_810544c_device) DECLARE_DEVICE_TYPE(NES_BMC_830425C, nes_bmc_830425c_device) +DECLARE_DEVICE_TYPE(NES_BMC_830928C, nes_bmc_830928c_device) DECLARE_DEVICE_TYPE(NES_BMC_850437C, nes_bmc_850437c_device) DECLARE_DEVICE_TYPE(NES_NTD03, nes_ntd03_device) DECLARE_DEVICE_TYPE(NES_BMC_CTC09, nes_bmc_ctc09_device) diff --git a/src/devices/bus/nes/nes_carts.cpp b/src/devices/bus/nes/nes_carts.cpp index e4fd93c2ddb..7dd29d39472 100644 --- a/src/devices/bus/nes/nes_carts.cpp +++ b/src/devices/bus/nes/nes_carts.cpp @@ -373,6 +373,7 @@ void nes_cart(device_slot_interface &device) device.option_add_internal("bmc_60311c", NES_BMC_60311C); device.option_add_internal("bmc_80013b", NES_BMC_80013B); device.option_add_internal("bmc_810544c", NES_BMC_810544C); + device.option_add_internal("bmc_830928c", NES_BMC_830928C); 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); @@ -442,6 +443,7 @@ void nes_cart(device_slot_interface &device) device.option_add_internal("bmc_f15", NES_BMC_F15); device.option_add_internal("bmc_gn45", NES_BMC_GN45); device.option_add_internal("bmc_gold7in1", NES_BMC_GOLD7IN1); + device.option_add_internal("bmc_00202650", NES_BMC_00202650); 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); diff --git a/src/devices/bus/nes/nes_ines.hxx b/src/devices/bus/nes/nes_ines.hxx index cd5d373c36e..59d723c6ad6 100644 --- a/src/devices/bus/nes/nes_ines.hxx +++ b/src/devices/bus/nes/nes_ines.hxx @@ -417,7 +417,7 @@ static const nes_mmc mmc_list[] = // 379 35-in-1 multicart, similar to mapper 38 // 380 970630C multicart { 381, UNL_KN42 }, // 2-in-1 Big Nose games - // 382 830928C 5-in-1 and 9-in-1 multicarts + { 382, BMC_830928C }, // 383 JY-014 multicart // 384 4-in-1 VRC4 clone with Crisis Force // 385 NTDEC 2779 5-in-1, not in nes.xml? @@ -427,7 +427,7 @@ static const nes_mmc mmc_list[] = { 389, CALTRON_9IN1 }, // 390 variant of mapper 236? // 391 BS-110 MMC3 clone - // 392 8-in-1 variant of mc_sv16 + { 392, BMC_00202650 }, { 393, BMC_820720C }, // 394 Realtec HSK007 multicart // 395 Realtec 8210 multicarts diff --git a/src/devices/bus/nes/nes_pcb.hxx b/src/devices/bus/nes/nes_pcb.hxx index e2253dc3321..31ac7bc61a5 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_80013b", BMC_80013B }, { "bmc_810544c", BMC_810544C }, { "bmc_830425c", BMC_830425C }, + { "bmc_830928c", BMC_830928C }, { "bmc_850437c", BMC_850437C }, { "bmc_jy820845c", BMC_JY820845C }, { "n32_4in1", BMC_N32_4IN1 }, @@ -320,6 +321,7 @@ static const nes_pcb pcb_list[] = { "bmc_f15", BMC_F15 }, { "bmc_gn45", BMC_GN45 }, { "bmc_gold7in1", BMC_GOLD_7IN1 }, + { "bmc_00202650", BMC_00202650 }, { "bmc_411120c", BMC_411120C }, { "bmc_820720c", BMC_820720C }, { "bmc_830118c", BMC_830118C }, diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h index c9cb6873549..e6795406226 100644 --- a/src/devices/bus/nes/nes_slot.h +++ b/src/devices/bus/nes/nes_slot.h @@ -96,11 +96,12 @@ enum BMC_31IN1, BMC_22GAMES, BMC_20IN1, BMC_70IN1, BMC_500IN1, BMC_800IN1, BMC_1200IN1, BMC_GKA, BMC_GKB, BMC_GKCXIN1, BMC_HP898F, BMC_VT5201, BMC_BENSHIENG, - BMC_60311C, BMC_80013B, BMC_810544C, BMC_830425C, BMC_850437C, + BMC_60311C, BMC_80013B, BMC_810544C, BMC_830425C, BMC_830928C, BMC_850437C, BMC_N32_4IN1, BMC_NT639, BMC_NTD_03, BMC_G63IN1, BMC_FCGENJIN_8IN1, BMC_FK23C, BMC_FK23CA, BMC_JY820845C, BMC_PJOY84, BMC_TH22913, BMC_11160, BMC_G146, - BMC_2751, BMC_8157, BMC_820720C, BMC_830118C, BMC_830832C, BMC_841101C, + BMC_2751, BMC_8157, BMC_00202650, + BMC_820720C, BMC_830118C, BMC_830832C, BMC_841101C, BMC_411120C, BMC_GOLD150, BMC_GOLD260, BMC_12IN1, BMC_4IN1RESET, BMC_42IN1RESET, BMC_LITTLECOM160, BMC_CTC09, BMC_K1029, BMC_K3006, BMC_K3036, BMC_K3046, BMC_SA005A, BMC_TJ03,