From e65b7309898f9f0a2571221e8652ae187faa6ca8 Mon Sep 17 00:00:00 2001 From: 0kmg <9137159+0kmg@users.noreply.github.com> Date: Wed, 6 Apr 2022 14:15:30 -0800 Subject: [PATCH] bus/nes: Added support for multicart board DS-9-27. (#9525) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New working software list additions (nes.xml) ----------------------------------- Gàishì 190 in 1 [Consolethinks] --- hash/nes.xml | 20 +++++++ src/devices/bus/nes/multigame.cpp | 91 +++++++++++++++++++++++++++++++ src/devices/bus/nes/multigame.h | 23 ++++++++ src/devices/bus/nes/nes_carts.cpp | 1 + src/devices/bus/nes/nes_ines.hxx | 8 ++- src/devices/bus/nes/nes_pcb.hxx | 1 + src/devices/bus/nes/nes_slot.h | 2 +- src/mame/machine/nes.cpp | 1 + 8 files changed, 145 insertions(+), 2 deletions(-) diff --git a/hash/nes.xml b/hash/nes.xml index bfda46a54731f..9668bb0c9dc53 100644 --- a/hash/nes.xml +++ b/hash/nes.xml @@ -81184,6 +81184,26 @@ be better to redump them properly. --> + + Gàishì 190 in 1 + 1992 + <pirate> + + + + + + + + + + + + + + + + 1500 in 1 199? diff --git a/src/devices/bus/nes/multigame.cpp b/src/devices/bus/nes/multigame.cpp index 5f3d7ea6724f5..58d6cc256247a 100644 --- a/src/devices/bus/nes/multigame.cpp +++ b/src/devices/bus/nes/multigame.cpp @@ -56,6 +56,7 @@ DEFINE_DEVICE_TYPE(NES_BMC_970630C, nes_bmc_970630c_device, "nes_bmc_97063 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") DEFINE_DEVICE_TYPE(NES_BMC_CTC12IN1, nes_bmc_ctc12in1_device, "nes_bmc_ctc12in1", "NES Cart BMC CTC-12IN1 PCB") +DEFINE_DEVICE_TYPE(NES_BMC_DS927, nes_bmc_ds927_device, "nes_bmc_ds927", "NES Cart BMC DS-9-27 PCB") DEFINE_DEVICE_TYPE(NES_BMC_FAM250, nes_bmc_fam250_device, "nes_bmc_fam250", "NES Cart BMC FAM250 PCB") DEFINE_DEVICE_TYPE(NES_BMC_GKA, nes_bmc_gka_device, "nes_bmc_gka", "NES Cart BMC GK-A PCB") DEFINE_DEVICE_TYPE(NES_BMC_GKB, nes_bmc_gkb_device, "nes_bmc_gkb", "NES Cart BMC GK-B PCB") @@ -239,6 +240,11 @@ nes_bmc_ctc09_device::nes_bmc_ctc09_device(const machine_config &mconfig, const { } +nes_bmc_ds927_device::nes_bmc_ds927_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_nrom_device(mconfig, NES_BMC_DS927, tag, owner, clock), m_latch(0), m_mode(0) +{ +} + nes_bmc_gka_device::nes_bmc_gka_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_BMC_GKA, tag, owner, clock) { @@ -761,6 +767,24 @@ void nes_bmc_ctc09_device::pcb_reset() // contents?). Soft reset can similarly crash the main menu (BTANB?). } +void nes_bmc_ds927_device::device_start() +{ + common_start(); + save_item(NAME(m_latch)); + save_item(NAME(m_mode)); +} + +void nes_bmc_ds927_device::pcb_reset() +{ + assert(m_prgram.size() >= 0x2000); + + prg16_89ab(0); + prg16_cdef(0); + + m_latch = 0; + m_mode = 0; +} + void nes_bmc_gka_device::device_start() { common_start(); @@ -1858,6 +1882,73 @@ void nes_bmc_ctc09_device::write_h(offs_t offset, u8 data) chr8(data & 0x0f, CHRROM); } +/*------------------------------------------------- + + Board DS-9-27 + + Games: 190 in 1 + + Bizarro board of mostly simple games that has + 8K of WRAM that is mappable, with mirroring in + NROM128 mode, to anywhere in upper memory. + + NES 2.0: mapper 452 + + In MAME: Supported. + + -------------------------------------------------*/ + +u8 nes_bmc_ds927_device::read_h(offs_t offset) +{ +// LOG_MMC(("bmc_ds927 read_h, offset: %04x\n", offset)); + + int bits = m_mode == 1 ? 1 : 2; + + if (BIT(offset, 13, bits) == BIT(m_latch, 4, bits)) + return m_prgram[offset & 0x1fff]; + + return hi_access_rom(offset); +} + +void nes_bmc_ds927_device::write_h(offs_t offset, u8 data) +{ + LOG_MMC(("bmc_ds927 write_h, offset: %04x, data: %02x\n", offset, data)); + + if (offset < 0x6000) + { + m_latch = data; + m_mode = bitswap<2>(data, 3, 1); + + int bank = BIT(offset, 1, 7); + + switch (m_mode) + { + case 0: + prg16_89ab(bank >> 1); + prg16_cdef(0); + break; + case 1: + for (int i = 0; i < 4; i++) + prg8_x(i, bank); + break; + case 2: + case 3: + prg8_89(bank); + prg8_ab(bank | 1); + prg8_cd(bank | 2); + prg8_ef(bank | 3 | (data & 0x04)); + break; + } + } + + set_nt_mirroring(BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); + + int bits = m_mode == 1 ? 1 : 2; + + if (BIT(offset, 13, bits) == BIT(m_latch, 4, bits)) + m_prgram[offset & 0x1fff] = data; +} + /*------------------------------------------------- Board BMC-GKA diff --git a/src/devices/bus/nes/multigame.h b/src/devices/bus/nes/multigame.h index 13139b6201b9f..afe126e5b7b4b 100644 --- a/src/devices/bus/nes/multigame.h +++ b/src/devices/bus/nes/multigame.h @@ -397,6 +397,28 @@ class nes_bmc_ctc09_device : public nes_nrom_device }; +// ======================> nes_bmc_ds927_device + +class nes_bmc_ds927_device : public nes_nrom_device +{ +public: + // construction/destruction + nes_bmc_ds927_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + virtual u8 read_h(offs_t offset) 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: + u8 m_latch, m_mode; +}; + + // ======================> nes_bmc_gka_device class nes_bmc_gka_device : public nes_nrom_device @@ -1322,6 +1344,7 @@ DECLARE_DEVICE_TYPE(NES_BMC_970630C, nes_bmc_970630c_device) DECLARE_DEVICE_TYPE(NES_NTD03, nes_ntd03_device) DECLARE_DEVICE_TYPE(NES_BMC_CTC09, nes_bmc_ctc09_device) DECLARE_DEVICE_TYPE(NES_BMC_CTC12IN1, nes_bmc_ctc12in1_device) +DECLARE_DEVICE_TYPE(NES_BMC_DS927, nes_bmc_ds927_device) DECLARE_DEVICE_TYPE(NES_BMC_FAM250, nes_bmc_fam250_device) DECLARE_DEVICE_TYPE(NES_BMC_GKA, nes_bmc_gka_device) DECLARE_DEVICE_TYPE(NES_BMC_GKB, nes_bmc_gkb_device) diff --git a/src/devices/bus/nes/nes_carts.cpp b/src/devices/bus/nes/nes_carts.cpp index ebdb8ad17a077..93cca5a75f6e7 100644 --- a/src/devices/bus/nes/nes_carts.cpp +++ b/src/devices/bus/nes/nes_carts.cpp @@ -398,6 +398,7 @@ void nes_cart(device_slot_interface &device) device.option_add_internal("ntd03", NES_NTD03); device.option_add_internal("bmc_ctc09", NES_BMC_CTC09); device.option_add_internal("bmc_ctc12in1", NES_BMC_CTC12IN1); + device.option_add_internal("bmc_ds927", NES_BMC_DS927); device.option_add_internal("bmc_fam250", NES_BMC_FAM250); device.option_add_internal("bmc_gka", NES_BMC_GKA); device.option_add_internal("bmc_gkb", NES_BMC_GKB); diff --git a/src/devices/bus/nes/nes_ines.hxx b/src/devices/bus/nes/nes_ines.hxx index c84f61149338a..b7cdca3fa35a3 100644 --- a/src/devices/bus/nes/nes_ines.hxx +++ b/src/devices/bus/nes/nes_ines.hxx @@ -483,7 +483,13 @@ static const nes_mmc mmc_list[] = // 445 DG574B MMC3-compatible multicart // 446 Mindkids SMD172B_FPGA board // 447 VRC4-based KL-06 multicart - // 448...511 Unused + // 448 VRC4-based 830768C multicart + // 449 Super Games King multicart + // 450 VRC2-based YY841157C multicart + // 451 homebrew Haratyler HP/MP + { 452, BMC_DS927 }, + // 453 Realtec 8042 + // 454...511 Unused // 512 probably the correct MMC3 clone for chuugokt in nes.xml { 513, SACHEN_SA9602B }, // 514 seems to be for skaraok, currently set to UNKNOWN in nes.xml diff --git a/src/devices/bus/nes/nes_pcb.hxx b/src/devices/bus/nes/nes_pcb.hxx index 9c59cc4d9733d..d409d81969c63 100644 --- a/src/devices/bus/nes/nes_pcb.hxx +++ b/src/devices/bus/nes/nes_pcb.hxx @@ -278,6 +278,7 @@ static const nes_pcb pcb_list[] = { "ntd03", BMC_NTD_03 }, { "bmc_ctc09", BMC_CTC09 }, { "bmc_ctc12in1", BMC_CTC_12IN1 }, + { "bmc_ds927", BMC_DS927 }, { "bmc_fam250", BMC_FAM250 }, { "bmc_gka", BMC_GKA }, { "bmc_gkb", BMC_GKB }, diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h index b919a135fdada..95ae301ce1f19 100644 --- a/src/devices/bus/nes/nes_slot.h +++ b/src/devices/bus/nes/nes_slot.h @@ -95,7 +95,7 @@ enum BMC_72IN1, BMC_SUPER_42IN1, BMC_76IN1, 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_GOLD260, + BMC_DS927, BMC_GKA, BMC_GKB, BMC_GKCXIN1, BMC_GN91B, BMC_GOLD260, BMC_HP898F, BMC_VT5201, BMC_BENSHIENG, BMC_CTC09, BMC_CTC_12IN1, BMC_60311C, BMC_80013B, BMC_810544C, BMC_82AB, BMC_830425C, BMC_830506C, BMC_830928C, BMC_850437C, BMC_891227, BMC_970630C, diff --git a/src/mame/machine/nes.cpp b/src/mame/machine/nes.cpp index 8dcb8fdc968fb..4f0b747e77d56 100644 --- a/src/mame/machine/nes.cpp +++ b/src/mame/machine/nes.cpp @@ -89,6 +89,7 @@ void nes_state::machine_start() BMC_800IN1, BMC_8157, BMC_970630C, + BMC_DS927, BMC_KC885, BMC_TELETUBBIES, BMC_VT5201,