From 7e85f58f716cfceff7ad4a92e492498f25d8a5a6 Mon Sep 17 00:00:00 2001 From: 0kmg <9137159+0kmg@users.noreply.github.com> Date: Thu, 2 Dec 2021 18:46:30 -0900 Subject: bus/nes: Added support for a 5/20 in 1 cartridge. (#8879) New working software list additions (nes.xml) ----------------------------------- 5 in 1 1993 Copyright [NewRisingSun] --- hash/nes.xml | 17 ++++++++++ src/devices/bus/nes/mmc3_clones.cpp | 64 +++++++++++++++++++++++++++++++++++-- src/devices/bus/nes/mmc3_clones.h | 22 +++++++++++++ src/devices/bus/nes/nes_carts.cpp | 2 +- src/devices/bus/nes/nes_ines.hxx | 2 +- src/devices/bus/nes/nes_pcb.hxx | 1 + src/devices/bus/nes/nes_slot.h | 2 +- 7 files changed, 105 insertions(+), 5 deletions(-) diff --git a/hash/nes.xml b/hash/nes.xml index f76672aa36f..1c1386d6c84 100644 --- a/hash/nes.xml +++ b/hash/nes.xml @@ -81750,6 +81750,23 @@ be better to redump them properly. --> + + + 5 in 1 1993 Copyright + 1993 + <pirate> + + + + + + + + + + + + 5 in 1 (K5003) 19?? diff --git a/src/devices/bus/nes/mmc3_clones.cpp b/src/devices/bus/nes/mmc3_clones.cpp index 63ed9eee4e1..f4613a3cee3 100644 --- a/src/devices/bus/nes/mmc3_clones.cpp +++ b/src/devices/bus/nes/mmc3_clones.cpp @@ -62,6 +62,7 @@ DEFINE_DEVICE_TYPE(NES_NT639, nes_nt639_device, "nes_nt639", DEFINE_DEVICE_TYPE(NES_RESETTXROM, nes_resettxrom_device, "nes_resettxrom", "NES Cart BMC RESET-TXROM PCB") DEFINE_DEVICE_TYPE(NES_S24IN1SC03, nes_s24in1sc03_device, "nes_s24in1c03", "NES Cart Super 24 in 1 SC-03 PCB") DEFINE_DEVICE_TYPE(NES_TECHLINE9IN1, nes_tech9in1_device, "nes_tech9in1", "NES Cart Techline 9 in 1 PCB") +DEFINE_DEVICE_TYPE(NES_BMC_5IN1, nes_bmc_5in1_device, "nes_bmc_5in1", "NES Cart BMC 5 in 1 1993 Copyright PCB") DEFINE_DEVICE_TYPE(NES_BMC_8IN1, nes_bmc_8in1_device, "nes_bmc_8in1", "NES Cart BMC GRM070 8 in 1 PCB") DEFINE_DEVICE_TYPE(NES_BMC_15IN1, nes_bmc_15in1_device, "nes_bmc_15in1", "NES Cart BMC 15 in 1 PCB") DEFINE_DEVICE_TYPE(NES_BMC_SBIG7, nes_bmc_sbig7_device, "nes_bmc_sbig7", "NES Cart BMC Super BIG 7 in 1 PCB") @@ -96,6 +97,13 @@ INPUT_PORTS_START( sachen_shero ) PORT_CONFSETTING( 0x80, u8"\u4f8d\u9b42 (Shìhún)" ) // 侍魂 INPUT_PORTS_END +INPUT_PORTS_START( bmc_5in1 ) + PORT_START("JUMPER") + PORT_CONFNAME( 0x01, 0x01, "Menu Type" ) + PORT_CONFSETTING( 0x00, "20 in 1" ) + PORT_CONFSETTING( 0x01, "5 in 1" ) +INPUT_PORTS_END + INPUT_PORTS_START( bmc_f600 ) PORT_START("JUMPER") PORT_CONFNAME( 0x80, 0x80, "Menu Type" ) @@ -113,6 +121,11 @@ ioport_constructor nes_sachen_shero_device::device_input_ports() const return INPUT_PORTS_NAME( sachen_shero ); } +ioport_constructor nes_bmc_5in1_device::device_input_ports() const +{ + return INPUT_PORTS_NAME( bmc_5in1 ); +} + ioport_constructor nes_bmc_f600_device::device_input_ports() const { return INPUT_PORTS_NAME( bmc_f600 ); @@ -311,6 +324,12 @@ nes_tech9in1_device::nes_tech9in1_device(const machine_config &mconfig, const ch { } +nes_bmc_5in1_device::nes_bmc_5in1_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_txrom_device(mconfig, NES_BMC_5IN1, tag, owner, clock) + , m_jumper(*this, "JUMPER") +{ +} + nes_bmc_8in1_device::nes_bmc_8in1_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_txrom_device(mconfig, NES_BMC_8IN1, tag, owner, clock) { @@ -768,6 +787,13 @@ void nes_tech9in1_device::pcb_reset() mmc3_common_initialize(0x1f, 0xff, 0); } +void nes_bmc_5in1_device::pcb_reset() +{ + m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; + mmc3_common_initialize(0x0f, 0x7f, 0); + prg32(0); +} + void nes_bmc_8in1_device::pcb_reset() { m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; @@ -2552,6 +2578,40 @@ void nes_tech9in1_device::write_l(offs_t offset, u8 data) } } +/*------------------------------------------------- + + BMC-5IN1 + + Unknown Bootleg Multigame Board + Games: 5 in 1 1993 Copyright + + NES 2.0: mapper 334 + + In MAME: Supported. + + -------------------------------------------------*/ + +u8 nes_bmc_5in1_device::read_m(offs_t offset) +{ + LOG_MMC(("bmc_5in1 read_m, offset: %04x\n", offset)); + + if ((offset & 0x03) == 0x02) + return (get_open_bus() & 0xfe) | m_jumper->read(); + else + return get_open_bus(); +} + +void nes_bmc_5in1_device::write_m(offs_t offset, u8 data) +{ + LOG_MMC(("bmc_5in1 write_m, offset: %04x, data: %02x\n", offset, data)); + + if ((m_wram_protect & 0xc0) == 0x80) + { + if (!(offset & 0x03)) + prg32((data >> 1) & 0x03); + } +} + /*------------------------------------------------- BMC-NEWSTAR-GRM070-8IN1 @@ -3144,8 +3204,8 @@ void nes_bmc_k3033_device::prg_cb(int start, int bank) void nes_bmc_k3033_device::write_m(offs_t offset, u8 data) { - LOG_MMC(("bmc_k3033 write_m, offset: %04x, data: %02x\n", offset, data)) -; + LOG_MMC(("bmc_k3033 write_m, offset: %04x, data: %02x\n", offset, data)); + if ((m_wram_protect & 0xc0) == 0x80) { m_mmc3_mode = BIT(offset, 5); diff --git a/src/devices/bus/nes/mmc3_clones.h b/src/devices/bus/nes/mmc3_clones.h index f71adaac9ef..1c592f6b07b 100644 --- a/src/devices/bus/nes/mmc3_clones.h +++ b/src/devices/bus/nes/mmc3_clones.h @@ -652,6 +652,27 @@ private: }; +// ======================> nes_bmc_5in1_device + +class nes_bmc_5in1_device : public nes_txrom_device +{ +public: + // construction/destruction + nes_bmc_5in1_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 pcb_reset() override; + +protected: + virtual ioport_constructor device_input_ports() const override; + +private: + required_ioport m_jumper; +}; + + // ======================> nes_bmc_8in1_device class nes_bmc_8in1_device : public nes_txrom_device @@ -1184,6 +1205,7 @@ DECLARE_DEVICE_TYPE(NES_NT639, nes_nt639_device) DECLARE_DEVICE_TYPE(NES_RESETTXROM, nes_resettxrom_device) DECLARE_DEVICE_TYPE(NES_S24IN1SC03, nes_s24in1sc03_device) DECLARE_DEVICE_TYPE(NES_TECHLINE9IN1, nes_tech9in1_device) +DECLARE_DEVICE_TYPE(NES_BMC_5IN1, nes_bmc_5in1_device) DECLARE_DEVICE_TYPE(NES_BMC_8IN1, nes_bmc_8in1_device) DECLARE_DEVICE_TYPE(NES_BMC_15IN1, nes_bmc_15in1_device) DECLARE_DEVICE_TYPE(NES_BMC_SBIG7, nes_bmc_sbig7_device) diff --git a/src/devices/bus/nes/nes_carts.cpp b/src/devices/bus/nes/nes_carts.cpp index 9e3249ae928..dbdc74112f8 100644 --- a/src/devices/bus/nes/nes_carts.cpp +++ b/src/devices/bus/nes/nes_carts.cpp @@ -449,6 +449,7 @@ void nes_cart(device_slot_interface &device) device.option_add_internal("s24in1c03", NES_S24IN1SC03); device.option_add_internal("smd133", NES_SMD133); device.option_add_internal("tech9in1", NES_TECHLINE9IN1); + device.option_add_internal("bmc_5in1", NES_BMC_5IN1); device.option_add_internal("bmc_8in1", NES_BMC_8IN1); device.option_add_internal("bmc_15in1", NES_BMC_15IN1); device.option_add_internal("bmc_sbig7in1", NES_BMC_SBIG7); @@ -485,7 +486,6 @@ void nes_cart(device_slot_interface &device) device.option_add_internal("unl_dance", NES_NROM); // UNSUPPORTED device.option_add_internal("onebus", NES_NROM); // UNSUPPORTED device.option_add_internal("pec586", NES_NROM); // UNSUPPORTED - device.option_add_internal("unl_drgnfgt", NES_NROM); // UNSUPPORTED // are there dumps of games with these boards? device.option_add_internal("bmc_hik_kof", NES_NROM); // mapper 251 - UNSUPPORTED device.option_add_internal("bmc_13in1jy110", NES_NROM); // [mentioned in FCEUMM source - we need more info] - UNSUPPORTED diff --git a/src/devices/bus/nes/nes_ines.hxx b/src/devices/bus/nes/nes_ines.hxx index ddffcae5695..739525ddf88 100644 --- a/src/devices/bus/nes/nes_ines.hxx +++ b/src/devices/bus/nes/nes_ines.hxx @@ -369,7 +369,7 @@ static const nes_mmc mmc_list[] = { 331, BMC_12IN1 }, { 332, BMC_WS }, { 333, BMC_8IN1 }, - // 334 5/20-in-1 1993 Copyright multicart, not in nes.xml? + { 334, BMC_5IN1_1993 }, { 335, BMC_CTC09 }, { 336, BMC_K3046 }, // { 337, BMC_CTC_12IN1 }, not in nes.xml diff --git a/src/devices/bus/nes/nes_pcb.hxx b/src/devices/bus/nes/nes_pcb.hxx index f625aef1ccc..83db5969792 100644 --- a/src/devices/bus/nes/nes_pcb.hxx +++ b/src/devices/bus/nes/nes_pcb.hxx @@ -321,6 +321,7 @@ static const nes_pcb pcb_list[] = { "s24in1c03", BMC_S24IN1SC03 }, { "smd133", SMD133_BOARD }, { "tech9in1", BMC_TECHLINE9IN1 }, + { "bmc_5in1", BMC_5IN1_1993 }, { "bmc_8in1", BMC_8IN1 }, { "bmc_15in1", BMC_15IN1 }, { "bmc_sbig7in1", BMC_SUPERBIG_7IN1 }, diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h index 2648a09bc1b..143f09b7005 100644 --- a/src/devices/bus/nes/nes_slot.h +++ b/src/devices/bus/nes/nes_slot.h @@ -93,7 +93,7 @@ enum BMC_36IN1, BMC_21IN1, BMC_150IN1, BMC_35IN1, BMC_64IN1, BMC_8IN1, BMC_15IN1, BMC_SUPERHIK_300IN1, BMC_SUPERGUN_20IN1, BMC_72IN1, BMC_SUPER_42IN1, BMC_76IN1, - BMC_31IN1, BMC_22GAMES, BMC_20IN1, + BMC_31IN1, BMC_22GAMES, BMC_20IN1, BMC_5IN1_1993, BMC_70IN1, BMC_500IN1, BMC_800IN1, BMC_1200IN1, BMC_GKA, BMC_GKB, BMC_GKCXIN1, BMC_GN91B, BMC_HP898F, BMC_VT5201, BMC_BENSHIENG, -- cgit v1.2.3