From af18af07e920f39803027ad06e0bface94bd7bd4 Mon Sep 17 00:00:00 2001 From: 0kmg <9137159+0kmg@users.noreply.github.com> Date: Wed, 6 Oct 2021 18:21:06 -0800 Subject: [PATCH] bus/nes: Added support for Golden Mario Party II multicart. (#8667) New working software list additions (nes.xml) ----------------------------------- Golden Mario Party II - Around the World 6 in 1 [krzsyiobal, NewRisingSun] --- hash/nes.xml | 22 ++++++- src/devices/bus/nes/mmc3.cpp | 9 ++- src/devices/bus/nes/mmc3.h | 3 + src/devices/bus/nes/mmc3_clones.cpp | 97 +++++++++++++++++++++++++++++ src/devices/bus/nes/mmc3_clones.h | 27 ++++++++ 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 | 2 +- 9 files changed, 158 insertions(+), 6 deletions(-) diff --git a/hash/nes.xml b/hash/nes.xml index d5202ffbffb..bf6d675c602 100644 --- a/hash/nes.xml +++ b/hash/nes.xml @@ -82163,8 +82163,7 @@ be better to redump them properly. --> - + Mario 7 in 1 (Bad Dump) 19?? @@ -82203,6 +82202,25 @@ to check why this is different --> + + Golden Mario Party II - Around the World 6 in 1 + 199? + <pirate> + + + + + + + + + + + + + + + New 4 in 1 Supergame (YH4239) 19?? diff --git a/src/devices/bus/nes/mmc3.cpp b/src/devices/bus/nes/mmc3.cpp index dfc57f59b71..9e991603ec3 100644 --- a/src/devices/bus/nes/mmc3.cpp +++ b/src/devices/bus/nes/mmc3.cpp @@ -69,8 +69,13 @@ nes_hkrom_device::nes_hkrom_device(const machine_config &mconfig, const char *ta { } -nes_txsrom_device::nes_txsrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : nes_txrom_device(mconfig, NES_TXSROM, tag, owner, clock) +nes_txsrom_device::nes_txsrom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : nes_txrom_device(mconfig, type, tag, owner, clock) +{ +} + +nes_txsrom_device::nes_txsrom_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_txsrom_device(mconfig, NES_TXSROM, tag, owner, clock) { } diff --git a/src/devices/bus/nes/mmc3.h b/src/devices/bus/nes/mmc3.h index 5ef9e8dbdaa..6b7ace77e53 100644 --- a/src/devices/bus/nes/mmc3.h +++ b/src/devices/bus/nes/mmc3.h @@ -93,6 +93,9 @@ public: virtual void chr_cb(int start, int bank, int source) override; protected: + // construction/destruction + nes_txsrom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); + void set_mirror(); }; diff --git a/src/devices/bus/nes/mmc3_clones.cpp b/src/devices/bus/nes/mmc3_clones.cpp index 99f0f1d3542..b4282eacd06 100644 --- a/src/devices/bus/nes/mmc3_clones.cpp +++ b/src/devices/bus/nes/mmc3_clones.cpp @@ -69,6 +69,7 @@ DEFINE_DEVICE_TYPE(NES_BMC_HIK8, nes_bmc_hik8_device, "nes_bmc_hik8", DEFINE_DEVICE_TYPE(NES_BMC_HIK4, nes_bmc_hik4_device, "nes_bmc_hik4", "NES Cart BMC HIK 4 in 1 PCB") DEFINE_DEVICE_TYPE(NES_BMC_MARIO7IN1, nes_bmc_mario7in1_device, "nes_bmc_mario7in1", "NES Cart BMC Mario 7 in 1 PCB") DEFINE_DEVICE_TYPE(NES_BMC_F15, nes_bmc_f15_device, "nes_bmc_f15", "NES Cart BMC F-15 PCB") +DEFINE_DEVICE_TYPE(NES_BMC_F600, nes_bmc_f600_device, "nes_bmc_f600", "NES Cart BMC F600 PCB") 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") @@ -91,6 +92,13 @@ INPUT_PORTS_START( sachen_shero ) PORT_CONFSETTING( 0x80, u8"\u4f8d\u9b42 (Shìhún)" ) // 侍魂 INPUT_PORTS_END +INPUT_PORTS_START( bmc_f600 ) + PORT_START("JUMPER") + PORT_CONFNAME( 0x80, 0x80, "Menu Type" ) + PORT_CONFSETTING( 0x00, "Mario 67 in 1" ) + PORT_CONFSETTING( 0x80, "Mario Party II (6 in 1)" ) +INPUT_PORTS_END + //------------------------------------------------- // input_ports - device-specific input ports @@ -101,6 +109,11 @@ ioport_constructor nes_sachen_shero_device::device_input_ports() const return INPUT_PORTS_NAME( sachen_shero ); } +ioport_constructor nes_bmc_f600_device::device_input_ports() const +{ + return INPUT_PORTS_NAME( bmc_f600 ); +} + //************************************************************************** @@ -334,6 +347,13 @@ nes_bmc_f15_device::nes_bmc_f15_device(const machine_config &mconfig, const char { } +nes_bmc_f600_device::nes_bmc_f600_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_txsrom_device(mconfig, NES_BMC_F600, tag, owner, clock) + , m_jumper(*this, "JUMPER") + , m_reg(0) +{ +} + nes_bmc_gn45_device::nes_bmc_gn45_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_txrom_device(mconfig, NES_BMC_GN45, tag, owner, clock), m_lock(false) { @@ -764,6 +784,20 @@ void nes_bmc_f15_device::pcb_reset() prg16_cdef(0); } +void nes_bmc_f600_device::device_start() +{ + mmc3_start(); + save_item(NAME(m_reg)); +} + +void nes_bmc_f600_device::pcb_reset() +{ + m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; + + m_reg = 0; + mmc3_common_initialize(0x1f, 0x7f, 0); +} + void nes_bmc_gn45_device::device_start() { mmc3_start(); @@ -2660,6 +2694,69 @@ void nes_bmc_f15_device::prg_cb(int start, int bank) // Ignore MMC3 PRG bank switching. Master Fighter II (game #150) uses the bank switching above. } +/*------------------------------------------------- + + BMC-F600 + + Games: Golden Mario Party II 6 in 1 + + MMC3 clone with banking for multigame menu. Note, + this cart has one TxSROM game (SMB4) and so it uses + the nonstandard MMC3 mirroring of those boards. + + NES 2.0: mapper 370 + + In MAME: Supported. + + -------------------------------------------------*/ + +u8 nes_bmc_f600_device::read_l(offs_t offset) +{ + LOG_MMC(("bmc_f600 read_l, offset: %04x\n", offset)); + + offset += 0x100; + if (offset >= 0x1000) + return (get_open_bus() & 0x7f) | m_jumper->read(); + else + return get_open_bus(); +} + +void nes_bmc_f600_device::write_l(offs_t offset, u8 data) +{ + LOG_MMC(("bmc_f600 write_l, offset: %04x, data: %02x\n", offset, data)); + + offset += 0x100; + if (offset >= 0x1000) + { + m_reg = offset; + + m_prg_base = (m_reg & 0x38) << 1; + m_prg_mask = 0x1f >> BIT(m_reg, 5); + set_prg(m_prg_base, m_prg_mask); + + m_chr_base = (m_reg & 0x07) << 7; + m_chr_mask = 0xff >> !BIT(m_reg, 2); + set_chr(m_chr_source, m_chr_base, m_chr_mask); + } +} + +void nes_bmc_f600_device::write_h(offs_t offset, u8 data) +{ + LOG_MMC(("bmc_f600 write_h, offset: %04x, data: %02x\n", offset, data)); + if ((m_reg & 0x07) == 1) + nes_txsrom_device::write_h(offset, data); + else + nes_txrom_device::write_h(offset, data); +} + +void nes_bmc_f600_device::chr_cb(int start, int bank, int source) +{ + if ((m_reg & 0x07) == 1) + nes_txsrom_device::chr_cb(start, bank, source); + else + nes_txrom_device::chr_cb(start, bank, source); +} + /*------------------------------------------------- BMC-FCGENJIN-8IN1 diff --git a/src/devices/bus/nes/mmc3_clones.h b/src/devices/bus/nes/mmc3_clones.h index ba8311cc384..f5cf970728b 100644 --- a/src/devices/bus/nes/mmc3_clones.h +++ b/src/devices/bus/nes/mmc3_clones.h @@ -758,6 +758,32 @@ public: }; +// ======================> nes_bmc_f600_device + +class nes_bmc_f600_device : public nes_txsrom_device +{ +public: + // construction/destruction + nes_bmc_f600_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + virtual u8 read_l(offs_t offset) override; + virtual void write_l(offs_t offset, u8 data) override; + virtual void write_h(offs_t offset, u8 data) override; + virtual void chr_cb(int start, int bank, int source) override; + + virtual void pcb_reset() override; + +protected: + // device-level overrides + virtual ioport_constructor device_input_ports() const override; + virtual void device_start() override; + +private: + required_ioport m_jumper; + u8 m_reg; +}; + + // ======================> nes_bmc_gn45_device class nes_bmc_gn45_device : public nes_txrom_device @@ -1062,6 +1088,7 @@ DECLARE_DEVICE_TYPE(NES_BMC_HIK8, nes_bmc_hik8_device) DECLARE_DEVICE_TYPE(NES_BMC_HIK4, nes_bmc_hik4_device) DECLARE_DEVICE_TYPE(NES_BMC_MARIO7IN1, nes_bmc_mario7in1_device) DECLARE_DEVICE_TYPE(NES_BMC_F15, nes_bmc_f15_device) +DECLARE_DEVICE_TYPE(NES_BMC_F600, nes_bmc_f600_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) diff --git a/src/devices/bus/nes/nes_carts.cpp b/src/devices/bus/nes/nes_carts.cpp index c12e3dbfdba..c90ea67c8bf 100644 --- a/src/devices/bus/nes/nes_carts.cpp +++ b/src/devices/bus/nes/nes_carts.cpp @@ -446,6 +446,7 @@ void nes_cart(device_slot_interface &device) device.option_add_internal("bmc_hik4in1", NES_BMC_HIK4); device.option_add_internal("bmc_mario7in1", NES_BMC_MARIO7IN1); device.option_add_internal("bmc_f15", NES_BMC_F15); + device.option_add_internal("bmc_f600", NES_BMC_F600); 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); diff --git a/src/devices/bus/nes/nes_ines.hxx b/src/devices/bus/nes/nes_ines.hxx index 232ca0dbfe8..1eaae491cfb 100644 --- a/src/devices/bus/nes/nes_ines.hxx +++ b/src/devices/bus/nes/nes_ines.hxx @@ -405,7 +405,7 @@ static const nes_mmc mmc_list[] = // 367 7-in-1 cart that is a close variant of mapper 205 { 368, BTL_YUNG08 }, // SMB2 FDS conversion // 369 Super Mario Bros Party multicart - // 370 Golden Mario Party II multicart + { 370, BMC_F600 }, // Golden Mario Party II multicart // 371 Spanish PEC-586 computer main cart // 372 Rockman 1-6 multicart very close to mapper 45 // 373 Super 4-in-1, not in nes.xml? diff --git a/src/devices/bus/nes/nes_pcb.hxx b/src/devices/bus/nes/nes_pcb.hxx index ff897bc1886..ea4ee0b70b5 100644 --- a/src/devices/bus/nes/nes_pcb.hxx +++ b/src/devices/bus/nes/nes_pcb.hxx @@ -320,6 +320,7 @@ static const nes_pcb pcb_list[] = { "bmc_hik4in1", BMC_SUPERHIK_4IN1 }, { "bmc_mario7in1", BMC_MARIOPARTY_7IN1 }, { "bmc_f15", BMC_F15 }, + { "bmc_f600", BMC_F600 }, { "bmc_gn45", BMC_GN45 }, { "bmc_gold7in1", BMC_GOLD_7IN1 }, { "bmc_00202650", BMC_00202650 }, diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h index 14d3d3ef8ac..b83a4eecc65 100644 --- a/src/devices/bus/nes/nes_slot.h +++ b/src/devices/bus/nes/nes_slot.h @@ -85,7 +85,7 @@ enum TXC_22110, TXC_22211, TXC_COMMANDOS, TXC_DUMARACING, TXC_MJBLOCK, TXC_STRIKEW, TXC_TW, // Multigame Carts - BMC_64IN1NR, BMC_190IN1, BMC_A65AS, BMC_A88S1, BMC_F15, + BMC_64IN1NR, BMC_190IN1, BMC_A65AS, BMC_A88S1, BMC_F15, BMC_F600, BMC_GN45, BMC_HIK8IN1, BMC_S24IN1SC03, BMC_T262, BMC_TELETUBBIES, BMC_WS, BMC_SUPERBIG_7IN1, BMC_SUPERHIK_4IN1, BMC_BALLGAMES_11IN1, BMC_MARIOPARTY_7IN1, BMC_GOLD_7IN1, BMC_SUPER_700IN1, BMC_FAMILY_4646,