From 6c3bdae4484a60b0e5acc4a4922d2af050494449 Mon Sep 17 00:00:00 2001 From: 0kmg <9137159+0kmg@users.noreply.github.com> Date: Mon, 4 Apr 2022 11:31:21 -0800 Subject: [PATCH] bus/nes: Correct and consolidate Golden Game multicart emulation. (#9511) New working software list additions (nes.xml) ----------------------------------- 1500 in 1 [MLX] Golden Game: 210 in 1 [kmg] Software list items promoted to working (nes.xml) --------------------------------------- Golden Game: 150 in 1 [kmg] Golden Game: 260 in 1 [kmg] --- hash/nes.xml | 102 +++++++++++++++++--------- src/devices/bus/nes/multigame.cpp | 115 ++++-------------------------- src/devices/bus/nes/multigame.h | 33 +-------- src/devices/bus/nes/nes_carts.cpp | 3 +- src/devices/bus/nes/nes_ines.hxx | 2 +- src/devices/bus/nes/nes_pcb.hxx | 1 - src/devices/bus/nes/nes_slot.h | 3 +- src/mame/machine/nes.cpp | 1 - 8 files changed, 88 insertions(+), 172 deletions(-) diff --git a/hash/nes.xml b/hash/nes.xml index 7531f607d1e..59c9f28a465 100644 --- a/hash/nes.xml +++ b/hash/nes.xml @@ -80950,22 +80950,6 @@ be better to redump them properly. --> - - 150 in 1 (Alt Games) - 19?? - <pirate> - - - - - - - - - - - - 150 in 1 (Alt Games 2) 19?? @@ -81181,6 +81165,22 @@ be better to redump them properly. --> + + 1500 in 1 + 199? + <pirate> + + + + + + + + + + + + 1994 Super HIK 14 in 1 (G-136) 19?? @@ -81619,22 +81619,6 @@ be better to redump them properly. --> - - 260 in 1 - 19?? - <pirate> - - - - - - - - - - - - 295 in 1 19?? @@ -84703,6 +84687,60 @@ be better to redump them properly. --> + + Golden Game: 150 in 1 + 199? + RCM Group + + + + + + + + + + + + + + + + Golden Game: 210 in 1 + 199? + RCM Group + + + + + + + + + + + + + + + + Golden Game: 260 in 1 + 199? + RCM Group + + + + + + + + + + + + + + King Series Super 4 in 1 (K4M03) diff --git a/src/devices/bus/nes/multigame.cpp b/src/devices/bus/nes/multigame.cpp index 1b66b581ed2..15a1d2efb29 100644 --- a/src/devices/bus/nes/multigame.cpp +++ b/src/devices/bus/nes/multigame.cpp @@ -97,8 +97,7 @@ DEFINE_DEVICE_TYPE(NES_BMC_190IN1, nes_bmc_190in1_device, "nes_bmc_190in DEFINE_DEVICE_TYPE(NES_BMC_500IN1, nes_bmc_500in1_device, "nes_bmc_500in1", "NES Cart BMC 500 in 1 PCB") DEFINE_DEVICE_TYPE(NES_BMC_800IN1, nes_bmc_800in1_device, "nes_bmc_800in1", "NES Cart BMC 800 in 1 PCB") DEFINE_DEVICE_TYPE(NES_BMC_1200IN1, nes_bmc_1200in1_device, "nes_bmc_1200in1", "NES Cart BMC 1200 in 1 PCB") -DEFINE_DEVICE_TYPE(NES_BMC_GOLD150, nes_bmc_gold150_device, "nes_bmc_gold150", "NES Cart BMC Golden 150 in 1 PCB") -DEFINE_DEVICE_TYPE(NES_BMC_GOLD260, nes_bmc_gold260_device, "nes_bmc_gold260", "NES Cart BMC Golden 260 in 1 PCB") +DEFINE_DEVICE_TYPE(NES_BMC_GOLD260, nes_bmc_gold260_device, "nes_bmc_gold260", "NES Cart BMC Golden Game X in 1 PCB") DEFINE_DEVICE_TYPE(NES_BMC_TH22913, nes_bmc_th22913_device, "nes_bmc_th22913", "NES Cart BMC TH2291-3 PCB") DEFINE_DEVICE_TYPE(NES_BMC_82AB, nes_bmc_82ab_device, "nes_bmc_82ab", "NES Cart BMC 82AB PCB") DEFINE_DEVICE_TYPE(NES_BMC_4IN1RESET, nes_bmc_4in1reset_device, "nes_bmc_4in1reset", "NES Cart BMC 4 in 1 (Reset Based) PCB") @@ -437,12 +436,7 @@ nes_bmc_1200in1_device::nes_bmc_1200in1_device(const machine_config &mconfig, co { } -nes_bmc_gold150_device::nes_bmc_gold150_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : nes_nrom_device(mconfig, NES_BMC_GOLD150, tag, owner, clock), m_latch(0) -{ -} - -nes_bmc_gold260_device::nes_bmc_gold260_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_bmc_gold260_device::nes_bmc_gold260_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_BMC_GOLD260, tag, owner, clock) { } @@ -1125,33 +1119,6 @@ void nes_bmc_1200in1_device::pcb_reset() m_vram_protect = 0; } -void nes_bmc_gold150_device::device_start() -{ - common_start(); - save_item(NAME(m_latch)); -} - -void nes_bmc_gold150_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); - - m_latch = 0; -} - -void nes_bmc_gold260_device::device_start() -{ - common_start(); -} - -void nes_bmc_gold260_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - // This PCB is fully emulated here :) void nes_bmc_4in1reset_device::device_start() { @@ -3174,88 +3141,32 @@ void nes_bmc_1200in1_device::write_h(offs_t offset, uint8_t data) set_nt_mirroring(BIT(offset, 1) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); } - /*------------------------------------------------- BMC-GOLDEN260IN1 Unknown Bootleg Multigame Board - Games: + Games: Golden Game 150 in 1, Golden Game 210 in 1, + Golden Game 260 in 1, 1500 in 1 iNES: mapper 235 - In MESS: Preliminary Supported. + In MAME: Supported. + + TODO: Return open bus when ROM sockets are empty? -------------------------------------------------*/ -void nes_bmc_gold260_device::write_h(offs_t offset, uint8_t data) +void nes_bmc_gold260_device::write_h(offs_t offset, u8 data) { - int bank = (offset & 0x1f) | ((offset & 0x0300) >> 3); LOG_MMC(("bmc_gold260 write_h, offset: %04x, data: %02x\n", offset, data)); - if (offset & 0x400) - set_nt_mirroring(PPU_MIRROR_LOW); - else - set_nt_mirroring(BIT(offset, 13) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); + u8 bank = bitswap<8>(offset, 9, 8, 4, 3, 2, 1, 0, 12); + u8 mode = !BIT(offset, 11); + prg16_89ab(bank & ~mode); + prg16_cdef(bank | mode); - if (offset & 0x800) - { - bank = (bank << 1) | BIT(offset, 12); - prg16_89ab(bank); - prg16_cdef(bank); - } - else - prg32(bank); -} - - -/*------------------------------------------------- - - BMC-GOLDEN150IN1 - - Unknown Bootleg Multigame Board - Games: - - iNES: mapper 235 - - Same as the above + open bus in 0x8000-0xffff when - enabled - - In MESS: Preliminary Supported. - - -------------------------------------------------*/ - - -void nes_bmc_gold150_device::write_h(offs_t offset, uint8_t data) -{ - int bank = (offset & 0x1f) | ((offset & 0x0200) >> 4); - LOG_MMC(("bmc_gold150 write_h, offset: %04x, data: %02x\n", offset, data)); - - m_latch = (offset & 0x0100); - - if (offset & 0x400) - set_nt_mirroring(PPU_MIRROR_LOW); - else - set_nt_mirroring(BIT(offset, 13) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); - - if (offset & 0x800) - { - bank = (bank << 1) | BIT(offset, 12); - prg16_89ab(bank); - prg16_cdef(bank); - } - else - prg32(bank); -} - -uint8_t nes_bmc_gold150_device::read_h(offs_t offset) -{ - LOG_MMC(("bmc_gold150 read_h, offset: %04x\n", offset)); - - if (m_latch) - return get_open_bus(); - else - return hi_access_rom(offset); + set_nt_mirroring(BIT(offset, 10) ? PPU_MIRROR_LOW : BIT(offset, 13) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); } /*------------------------------------------------- diff --git a/src/devices/bus/nes/multigame.h b/src/devices/bus/nes/multigame.h index 668ed6384aa..2278a163011 100644 --- a/src/devices/bus/nes/multigame.h +++ b/src/devices/bus/nes/multigame.h @@ -1072,43 +1072,15 @@ private: }; -// ======================> nes_bmc_gold150_device - -class nes_bmc_gold150_device : public nes_nrom_device -{ -public: - // construction/destruction - nes_bmc_gold150_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - - virtual uint8_t read_h(offs_t offset) override; - virtual void write_h(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; - -private: - uint8_t m_latch; -}; - - // ======================> nes_bmc_gold260_device class nes_bmc_gold260_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_gold260_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_bmc_gold260_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual void write_h(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; - -protected: - // device-level overrides - virtual void device_start() override; + virtual void write_h(offs_t offset, u8 data) override; }; @@ -1413,7 +1385,6 @@ DECLARE_DEVICE_TYPE(NES_BMC_190IN1, nes_bmc_190in1_device) DECLARE_DEVICE_TYPE(NES_BMC_500IN1, nes_bmc_500in1_device) DECLARE_DEVICE_TYPE(NES_BMC_800IN1, nes_bmc_800in1_device) DECLARE_DEVICE_TYPE(NES_BMC_1200IN1, nes_bmc_1200in1_device) -DECLARE_DEVICE_TYPE(NES_BMC_GOLD150, nes_bmc_gold150_device) DECLARE_DEVICE_TYPE(NES_BMC_GOLD260, nes_bmc_gold260_device) DECLARE_DEVICE_TYPE(NES_BMC_4IN1RESET, nes_bmc_4in1reset_device) DECLARE_DEVICE_TYPE(NES_BMC_42IN1RESET, nes_bmc_42in1reset_device) diff --git a/src/devices/bus/nes/nes_carts.cpp b/src/devices/bus/nes/nes_carts.cpp index 4cf827fc544..ebdb8ad17a0 100644 --- a/src/devices/bus/nes/nes_carts.cpp +++ b/src/devices/bus/nes/nes_carts.cpp @@ -441,8 +441,7 @@ void nes_cart(device_slot_interface &device) device.option_add_internal("bmc_500in1", NES_BMC_500IN1); device.option_add_internal("bmc_800in1", NES_BMC_800IN1); // mapper 236 device.option_add_internal("bmc_1200in1", NES_BMC_1200IN1); - device.option_add_internal("bmc_gold150", NES_BMC_GOLD150); // mapper 235 with 2M PRG - device.option_add_internal("bmc_gold260", NES_BMC_GOLD260); // mapper 235 with 4M PRG + device.option_add_internal("bmc_gold260", NES_BMC_GOLD260); // mapper 235 device.option_add_internal("bmc_th22913", NES_BMC_TH22913); // mapper 63 device.option_add_internal("bmc_reset4", NES_BMC_4IN1RESET); // mapper 60 with 64k prg and 32k chr device.option_add_internal("bmc_reset42", NES_BMC_42IN1RESET); // mapper 233 diff --git a/src/devices/bus/nes/nes_ines.hxx b/src/devices/bus/nes/nes_ines.hxx index e5d909ef8c9..c84f6114933 100644 --- a/src/devices/bus/nes/nes_ines.hxx +++ b/src/devices/bus/nes/nes_ines.hxx @@ -268,7 +268,7 @@ static const nes_mmc mmc_list[] = { 232, CAMERICA_BF9096 }, { 233, BMC_42IN1RESET }, { 234, AVE_MAXI15 }, - { 235, BMC_GOLD150 }, // 235 Golden Game x-in-1 - Unsupported + { 235, BMC_GOLD260 }, // 235 Golden Game x-in-1 games { 236, BMC_70IN1 }, { 237, BMC_TELETUBBIES }, { 238, UNL_603_5052 }, diff --git a/src/devices/bus/nes/nes_pcb.hxx b/src/devices/bus/nes/nes_pcb.hxx index f09348a9824..9c59cc4d973 100644 --- a/src/devices/bus/nes/nes_pcb.hxx +++ b/src/devices/bus/nes/nes_pcb.hxx @@ -356,7 +356,6 @@ static const nes_pcb pcb_list[] = { "bmc_yy841101c", BMC_YY841101C }, { "bmc_yy841155c", BMC_YY841155C }, { "pjoy84", BMC_PJOY84 }, - { "bmc_gold150", BMC_GOLD150 }, { "bmc_gold260", BMC_GOLD260 }, { "bmc_th22913", BMC_TH22913 }, { "bmc_reset4", BMC_4IN1RESET }, diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h index a76c60e78ee..b919a135fda 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_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, @@ -106,7 +106,6 @@ enum BMC_2751, BMC_8157, BMC_00202650, BMC_411120C, BMC_810305C, BMC_820720C, BMC_830118C, BMC_830832C, BMC_YY841101C, BMC_YY841155C, - BMC_GOLD150, BMC_GOLD260, BMC_12IN1, BMC_4IN1RESET, BMC_42IN1RESET, BMC_LITTLECOM160, BMC_K1029, BMC_K3006, BMC_K3033, BMC_K3036, BMC_K3046, BMC_K3071, BMC_SA005A, BMC_TF2740, BMC_TJ03, BMC_RESETSXROM, BMC_RESETTXROM, BMC_TECHLINE9IN1, diff --git a/src/mame/machine/nes.cpp b/src/mame/machine/nes.cpp index ddd1e5076f8..8dcb8fdc968 100644 --- a/src/mame/machine/nes.cpp +++ b/src/mame/machine/nes.cpp @@ -89,7 +89,6 @@ void nes_state::machine_start() BMC_800IN1, BMC_8157, BMC_970630C, - BMC_GOLD150, BMC_KC885, BMC_TELETUBBIES, BMC_VT5201,