From 64a32a5ef1d504abf832e901253ddc5271c42803 Mon Sep 17 00:00:00 2001 From: 0kmg <9137159+0kmg@users.noreply.github.com> Date: Sat, 11 Sep 2021 19:31:28 -0800 Subject: [PATCH] bus/nes: More fixes for various multicart types. - Fixed graphics glitches in the following boards: BMC-20IN1 (Kaiser 20 in 1), BMC-SUPER700IN1 (700 in 1, 190 in 1), BMC-VT5201 (six multicarts). - Simplified BMC-21IN1 board (21 in 1, 8 in 1). New working software list additions (nes.xml) ----------------------------------- Super 190 in 1 [anonymous] --- hash/nes.xml | 25 ++++-- src/devices/bus/nes/multigame.cpp | 145 ++++++++++++------------------ src/devices/bus/nes/multigame.h | 38 +++----- src/devices/bus/nes/nes_carts.cpp | 3 +- src/devices/bus/nes/nes_ines.hxx | 2 +- src/devices/bus/nes/nes_pcb.hxx | 3 +- src/devices/bus/nes/nes_unif.hxx | 4 +- 7 files changed, 91 insertions(+), 129 deletions(-) diff --git a/hash/nes.xml b/hash/nes.xml index a6424faeb2b..6657c8bef4c 100644 --- a/hash/nes.xml +++ b/hash/nes.xml @@ -80281,7 +80281,7 @@ be better to redump them properly. --> 19?? <unknown> - + @@ -80707,7 +80707,7 @@ be better to redump them properly. --> 19?? <unknown> - + @@ -80938,7 +80938,7 @@ be better to redump them properly. --> 19?? <unknown> - + @@ -80992,7 +80992,7 @@ be better to redump them properly. --> 19?? <unknown> - + @@ -81016,6 +81016,7 @@ be better to redump them properly. --> + @@ -81915,6 +81916,21 @@ to check why this is different --> + + Super 190 in 1 + 19?? + <pirate> + + + + + + + + + + + Super 200 in 1 MD-8802 (Incomplete?) @@ -82089,7 +82105,6 @@ to check why this is different --> - diff --git a/src/devices/bus/nes/multigame.cpp b/src/devices/bus/nes/multigame.cpp index 759c517a247..179b2297765 100644 --- a/src/devices/bus/nes/multigame.cpp +++ b/src/devices/bus/nes/multigame.cpp @@ -186,8 +186,8 @@ nes_bmc_190in1_device::nes_bmc_190in1_device(const machine_config &mconfig, cons { } -nes_vt5201_device::nes_vt5201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : nes_nrom_device(mconfig, NES_VT5201, tag, owner, clock), m_latch(0), m_dipsetting(0) +nes_vt5201_device::nes_vt5201_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_nrom_device(mconfig, NES_VT5201, tag, owner, clock), m_latch(0), m_jumper(0) { } @@ -298,7 +298,7 @@ nes_bmc_hik300_device::nes_bmc_hik300_device(const machine_config &mconfig, cons { } -nes_bmc_s700_device::nes_bmc_s700_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_bmc_s700_device::nes_bmc_s700_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_BMC_S700, tag, owner, clock) { } @@ -323,12 +323,12 @@ nes_bmc_12in1_device::nes_bmc_12in1_device(const machine_config &mconfig, const { } -nes_bmc_20in1_device::nes_bmc_20in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_bmc_20in1_device::nes_bmc_20in1_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_BMC_20IN1, tag, owner, clock) { } -nes_bmc_21in1_device::nes_bmc_21in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_bmc_21in1_device::nes_bmc_21in1_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_BMC_21IN1, tag, owner, clock) { } @@ -614,17 +614,16 @@ void nes_vt5201_device::device_start() { common_start(); save_item(NAME(m_latch)); - save_item(NAME(m_dipsetting)); + save_item(NAME(m_jumper)); } void nes_vt5201_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; prg32(0); - chr8(0, m_chr_source); + chr8(0, CHRROM); m_latch = 0; - m_dipsetting = 0; + m_jumper = 0; } void nes_bmc_80013b_device::device_start() @@ -827,18 +826,6 @@ void nes_bmc_hik300_device::pcb_reset() chr8(0, CHRROM); } -void nes_bmc_s700_device::device_start() -{ - common_start(); -} - -void nes_bmc_s700_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - void nes_bmc_ball11_device::device_start() { common_start(); @@ -913,32 +900,6 @@ void nes_bmc_12in1_device::pcb_reset() update_banks(); } -void nes_bmc_20in1_device::device_start() -{ - common_start(); -} - -void nes_bmc_20in1_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg16_89ab(0); - prg16_cdef(m_prg_chunks - 1); - chr8(0, m_chr_source); - set_nt_mirroring(PPU_MIRROR_VERT); -} - -void nes_bmc_21in1_device::device_start() -{ - common_start(); -} - -void nes_bmc_21in1_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg32(0); - chr8(0, m_chr_source); -} - void nes_bmc_35in1_device::device_start() { common_start(); @@ -1576,36 +1537,41 @@ void nes_bmc_190in1_device::write_h(offs_t offset, u8 data) /*------------------------------------------------- - BMC-VT5201 + BMC-VT5201, BMC-T3H53, BMC-D1038 + + Games: Super 35 in 1, TN 95 in 1, 46 in 1, 65 in 1, + 74 in 1, 77 in 1 + + iNES: mapper 59 + + In MAME: Supported. -------------------------------------------------*/ -void nes_vt5201_device::write_h(offs_t offset, uint8_t data) +void nes_vt5201_device::write_h(offs_t offset, u8 data) { - LOG_MMC(("vt5201 wirte_h, offset: %04x, data: %02x\n", offset, data)); + LOG_MMC(("vt5201 write_h, offset: %04x, data: %02x\n", offset, data)); - m_latch = BIT(offset, 8); - - // not sure about this mirroring bit!! - // without it TN 95 in 1 has glitches in Lunar Ball; with it TN 95 in 1 has glitches in Galaxian! - set_nt_mirroring(BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); - if (BIT(offset, 7)) + if (!BIT(m_latch, 1)) // lock bit { - prg16_89ab((offset >> 4) & 0x07); - prg16_cdef((offset >> 4) & 0x07); + m_latch = offset >> 8; + + u8 bank = (offset >> 4) & 0x07; + u8 mode = !BIT(offset, 7); + prg16_89ab(bank & ~mode); + prg16_cdef(bank | mode); + + chr8(offset & 0x07, CHRROM); + set_nt_mirroring(BIT(offset, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); } - else - prg32((offset >> 5) & 0x03); - chr8(offset, CHRROM); } -uint8_t nes_vt5201_device::read_h(offs_t offset) +u8 nes_vt5201_device::read_h(offs_t offset) { LOG_MMC(("bmc_vt5201 read_h, offset: %04x\n", offset)); - // m_dipsetting = ioport("CARTDIPS")->read(); - if (m_latch) - return m_dipsetting; // cart mode, depending on the Dip Switches (always zero atm, given we have no way to add cart-based DIPs) + if (BIT(m_latch, 0)) + return (get_open_bus() & 0xfc) | m_jumper; // TODO: add jumper settings, m_jumper is 0 for now else return hi_access_rom(offset); } @@ -2237,31 +2203,33 @@ void nes_bmc_hik300_device::write_h(offs_t offset, u8 data) BMC-SUPER-700IN1 Unknown Bootleg Multigame Board - Games: Super 700 in 1 + Games: Super 700 in 1, Super 190 in 1 iNES: mapper 62 - In MESS: Supported. + In MAME: Supported. + + TODO: + - Investigate why Gradius menu items 643-649 crash + 700-in-1 after pressing start at title screen. + Gradius works from other menu numbers fine. + - Slalom and Star Force have the wrong mirroring + on 190-in-1. Bug on cart, bad dump, or is there + another bit that affects mirroring? -------------------------------------------------*/ -void nes_bmc_s700_device::write_h(offs_t offset, uint8_t data) +void nes_bmc_s700_device::write_h(offs_t offset, u8 data) { - LOG_MMC(("bmc_s700 write_h, offset :%04x, data: %02x\n", offset, data)); + LOG_MMC(("bmc_s700 write_h, offset: %04x, data: %02x\n", offset, data)); - chr8(((offset & 0x1f) << 2) | (data & 0x03), CHRROM); + u8 bank = (offset & 0x40) | ((offset >> 8) & 0x3f); + u8 mode = !BIT(offset, 5); + prg16_89ab(bank & ~mode); + prg16_cdef(bank | mode); - if (offset & 0x20) - { - prg16_89ab((offset & 0x40) | ((offset >> 8) & 0x3f)); - prg16_cdef((offset & 0x40) | ((offset >> 8) & 0x3f)); - } - else - { - prg32(((offset & 0x40) | ((offset >> 8) & 0x3f)) >> 1); - } - - set_nt_mirroring(BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); + chr8((offset & 0x1f) << 2 | (data & 0x03), CHRROM); + set_nt_mirroring(BIT(offset, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); } /*------------------------------------------------- @@ -2454,18 +2422,17 @@ void nes_bmc_12in1_device::write_h(offs_t offset, uint8_t data) iNES: mapper 231 - In MESS: Supported. + In MAME: Supported. -------------------------------------------------*/ -void nes_bmc_20in1_device::write_h(offs_t offset, uint8_t data) +void nes_bmc_20in1_device::write_h(offs_t offset, u8 data) { LOG_MMC(("bmc_20in1 write_h, offset: %04x, data: %02x\n", offset, data)); - set_nt_mirroring(BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); - - prg16_89ab((offset & 0x1e)); - prg16_cdef((offset & 0x1e) | ((offset & 0x20) ? 1 : 0)); + prg16_89ab(offset & 0x1e); + prg16_cdef((offset & 0x1e) | BIT(offset, 5)); + set_nt_mirroring(BIT(offset, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); } /*------------------------------------------------- @@ -2477,11 +2444,11 @@ void nes_bmc_20in1_device::write_h(offs_t offset, uint8_t data) iNES: mapper 201 - In MESS: Supported. + In MAME: Supported. -------------------------------------------------*/ -void nes_bmc_21in1_device::write_h(offs_t offset, uint8_t data) +void nes_bmc_21in1_device::write_h(offs_t offset, u8 data) { LOG_MMC(("bmc_21in1 write_h, offset: %04x, data: %02x\n", offset, data)); diff --git a/src/devices/bus/nes/multigame.h b/src/devices/bus/nes/multigame.h index df73fa302d9..d8eaf82b82e 100644 --- a/src/devices/bus/nes/multigame.h +++ b/src/devices/bus/nes/multigame.h @@ -265,10 +265,10 @@ class nes_vt5201_device : public nes_nrom_device { public: // construction/destruction - nes_vt5201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_vt5201_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual uint8_t read_h(offs_t offset) override; - virtual void write_h(offs_t offset, uint8_t data) override; + virtual u8 read_h(offs_t offset) override; + virtual void write_h(offs_t offset, u8 data) override; virtual void pcb_reset() override; @@ -277,7 +277,7 @@ protected: virtual void device_start() override; private: - uint8_t m_latch, m_dipsetting; + u8 m_latch, m_jumper; }; @@ -645,15 +645,9 @@ class nes_bmc_s700_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_s700_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_bmc_s700_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; }; @@ -753,15 +747,9 @@ class nes_bmc_20in1_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_20in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_bmc_20in1_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; }; @@ -771,15 +759,9 @@ class nes_bmc_21in1_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_21in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_bmc_21in1_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; }; diff --git a/src/devices/bus/nes/nes_carts.cpp b/src/devices/bus/nes/nes_carts.cpp index 1b85ef7347a..219f44ef6a3 100644 --- a/src/devices/bus/nes/nes_carts.cpp +++ b/src/devices/bus/nes/nes_carts.cpp @@ -367,8 +367,7 @@ void nes_cart(device_slot_interface &device) device.option_add_internal("novel2", NES_NOVEL2); // mapper 213... same as BMC-NOVELDIAMOND9999999IN1 board? device.option_add_internal("studyngame", NES_STUDYNGAME); // mapper 39 device.option_add_internal("sgun20in1", NES_SUPERGUN20IN1); - device.option_add_internal("bmc_vt5201", NES_VT5201); // mapper 59? - device.option_add_internal("bmc_d1038", NES_VT5201); // mapper 59? + device.option_add_internal("bmc_vt5201", NES_VT5201); // mapper 59 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); diff --git a/src/devices/bus/nes/nes_ines.hxx b/src/devices/bus/nes/nes_ines.hxx index c68ea5b628c..adf37fec1ac 100644 --- a/src/devices/bus/nes/nes_ines.hxx +++ b/src/devices/bus/nes/nes_ines.hxx @@ -91,7 +91,7 @@ static const nes_mmc mmc_list[] = { 56, KAISER_KS202 }, { 57, BMC_GKA }, { 58, BMC_GKB }, - // 59 BMC-T3H53 and BMC-D1038 + { 59, BMC_VT5201 }, // and BMC-T3H53, BMC-D1038 { 60, BMC_4IN1RESET }, { 61, RCM_TF9IN1 }, { 62, BMC_SUPER_700IN1 }, diff --git a/src/devices/bus/nes/nes_pcb.hxx b/src/devices/bus/nes/nes_pcb.hxx index d35c726e88c..6931155587f 100644 --- a/src/devices/bus/nes/nes_pcb.hxx +++ b/src/devices/bus/nes/nes_pcb.hxx @@ -252,8 +252,7 @@ static const nes_pcb pcb_list[] = { "novel2", BMC_NOVEL2 }, // mapper 213... same as BMC-NOVELDIAMOND9999999IN1 board? { "studyngame", UNL_STUDYNGAME }, // mapper 39 { "sgun20in1", BMC_SUPERGUN_20IN1 }, - { "bmc_vt5201", BMC_VT5201 }, // mapper 59? - { "bmc_d1038", BMC_VT5201 }, // mapper 59? + { "bmc_vt5201", BMC_VT5201 }, // mapper 59 { "bmc_60311c", BMC_60311C }, { "bmc_80013b", BMC_80013B }, { "bmc_810544c", BMC_810544C }, diff --git a/src/devices/bus/nes/nes_unif.hxx b/src/devices/bus/nes/nes_unif.hxx index ca8aca47104..29d51b94d8d 100644 --- a/src/devices/bus/nes/nes_unif.hxx +++ b/src/devices/bus/nes/nes_unif.hxx @@ -114,7 +114,7 @@ static const unif unif_list[] = { "UNL-YOKO", 0, 0, CHRRAM_0, YOKO_BOARD}, // similar to mapper 83, but not the same { "UNL-FS304", 0, 8, CHRRAM_8, WAIXING_FS304}, // used in Zelda 3 by Waixing { "UNL-43272", 0, 0, CHRRAM_0, UNL_43272}, // used in Gaau Hok Gwong Cheung - { "BTL-MARIO1-MALEE2", 0, 0, CHRRAM_0, UNL_MMALEE}, // mapper 55? + { "BTL-MARIO1-MALEE2", 0, 0, CHRRAM_0, UNL_MMALEE}, // mapper 55 { "BMC-FK23C", 0, 0, CHRRAM_0, BMC_FK23C}, { "BMC-FK23CA", 0, 0, CHRRAM_0, BMC_FK23CA}, { "BMC-GHOSTBUSTERS63IN1", 0, 0, CHRRAM_8, BMC_G63IN1 }, @@ -123,7 +123,7 @@ static const unif unif_list[] = { "BMC-411120-C", 0, 0, CHRRAM_0, BMC_411120C}, { "BMC-8157", 0, 0, CHRRAM_8, BMC_8157}, { "BMC-830118C", 0, 0, CHRRAM_0, BMC_830118C}, - { "BMC-D1038", 0, 0, CHRRAM_0, BMC_VT5201}, // mapper 60? + { "BMC-D1038", 0, 0, CHRRAM_0, BMC_VT5201}, // mapper 59 { "BMC-SUPERVISION16IN1", 0, 0, CHRRAM_0, SVISION16_BOARD}, // mapper 53 { "BMC-NTD-03", 0, 0, CHRRAM_0, BMC_NTD_03}, { "UNL-AC08", 0, 0, CHRRAM_0, UNL_AC08},