From 6eee76c1a0c7e4f317bf55dde5ddb2d25356b6be Mon Sep 17 00:00:00 2001 From: 0kmg <9137159+0kmg@users.noreply.github.com> Date: Thu, 30 Sep 2021 01:11:02 -0800 Subject: [PATCH] bus/nes: Added support for original Dongdongnao II cartridge. (#8628) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Also set correct board type for Yeong-eo Pyramid, fixing title screen graphics, and identified it as a (licensed) clone of Dongdongnao II. New working software list additions (nes.xml) ----------------------------------- Dòngdòngnǎo II: Guózhōng Yīngwén (I) (Taiwan) [MLX] --- hash/nes.xml | 37 +++++++++++++++---- 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 +- src/devices/bus/nes/sachen.cpp | 61 ++++++++++++++++++++++++++++++- src/devices/bus/nes/sachen.h | 23 ++++++++++++ src/mame/machine/nes.cpp | 1 + 8 files changed, 116 insertions(+), 12 deletions(-) diff --git a/hash/nes.xml b/hash/nes.xml index 2e21a9a8cf5..f758551fbd2 100644 --- a/hash/nes.xml +++ b/hash/nes.xml @@ -52330,14 +52330,15 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx - - English Pyramid (Pirate) + + Yeong-eo, Pyramid (Korea) 1991 - Sachen - + Kuk Je Academy + + - - + + @@ -53444,11 +53445,31 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx - Middle School English - Dong Dong Nao II (Tw) - + Dòngdòngnǎo II: Guózhōng Yīngwén (I) (Taiwan) 1989 Sachen + + + + + + + + + + + + + + + + + Dòngdòngnǎo II: Guózhōng Yīngwén (I) (Taiwan, alt) + 1989 + Sachen + + diff --git a/src/devices/bus/nes/nes_carts.cpp b/src/devices/bus/nes/nes_carts.cpp index 8237cb0bca0..2ee3e4d06f3 100644 --- a/src/devices/bus/nes/nes_carts.cpp +++ b/src/devices/bus/nes/nes_carts.cpp @@ -209,6 +209,7 @@ void nes_cart(device_slot_interface &device) device.option_add_internal("sa72008", NES_SACHEN_SA72008); device.option_add_internal("tca01", NES_SACHEN_TCA01); device.option_add_internal("s3013", NES_SACHEN_3013); + device.option_add_internal("s3014", NES_SACHEN_3014); device.option_add_internal("s8259a", NES_SACHEN_8259A); device.option_add_internal("s8259b", NES_SACHEN_8259B); device.option_add_internal("s8259c", NES_SACHEN_8259C); diff --git a/src/devices/bus/nes/nes_ines.hxx b/src/devices/bus/nes/nes_ines.hxx index 6f31c9abbe0..af365d9688b 100644 --- a/src/devices/bus/nes/nes_ines.hxx +++ b/src/devices/bus/nes/nes_ines.hxx @@ -496,7 +496,7 @@ static const nes_mmc mmc_list[] = { 530, UNL_AX5705 }, // Super Mario Bros Pocker Mali // 531 Used by Asder PC-95 Famicom clone built into a keyboard // 532 Emulator only mapper for Chinese version of sangoht2? - // 533 Used by dongdng2 which is a CNROM variant with protection? + { 533, SACHEN_3014 }, // Dong Dong Nao II // 534 Are these all PnPs? Is one mc_101 or a clone not in nes.xml? { 535, UNL_LH53 }, // Nazo no Murasamejo FDS conversion // 536 and 537 Waixing FS303, mapper 195 variants? diff --git a/src/devices/bus/nes/nes_pcb.hxx b/src/devices/bus/nes/nes_pcb.hxx index 799f17a15b6..49daf61ec80 100644 --- a/src/devices/bus/nes/nes_pcb.hxx +++ b/src/devices/bus/nes/nes_pcb.hxx @@ -117,6 +117,7 @@ static const nes_pcb pcb_list[] = { "sa72008", SACHEN_SA72008 }, { "tca01", SACHEN_TCA01 }, { "s3013", SACHEN_3013 }, + { "s3014", SACHEN_3014 }, { "s8259a", SACHEN_8259A }, { "s8259b", SACHEN_8259B }, { "s8259c", SACHEN_8259C }, diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h index fc4459c458a..cdf05bef93f 100644 --- a/src/devices/bus/nes/nes_slot.h +++ b/src/devices/bus/nes/nes_slot.h @@ -71,7 +71,7 @@ enum SACHEN_8259A, SACHEN_8259B, SACHEN_8259C, SACHEN_8259D, SACHEN_SA009, SACHEN_SA0036, SACHEN_SA0037, SACHEN_SA72007, SACHEN_SA72008, SACHEN_SA9602B, - SACHEN_TCA01, SACHEN_TCU01, SACHEN_TCU02, SACHEN_3013, + SACHEN_TCA01, SACHEN_TCU01, SACHEN_TCU02, SACHEN_3013, SACHEN_3014, SACHEN_74LS374, SACHEN_74LS374_ALT, SACHEN_SHERO, // Sunsoft SUNSOFT_1, SUNSOFT_2, SUNSOFT_3, SUNSOFT_4, diff --git a/src/devices/bus/nes/sachen.cpp b/src/devices/bus/nes/sachen.cpp index 816ca04ffd1..61bb0a80111 100644 --- a/src/devices/bus/nes/sachen.cpp +++ b/src/devices/bus/nes/sachen.cpp @@ -17,6 +17,7 @@ * Sachen TCU-01 [mapper 147] * Sachen TCU-02 [mapper 136] * Sachen 3013 [mapper 553] + * Sachen 3014 [mapper 533] * Sachen Discrete PCBs [mapper 150 & 243] * Sachen 8259 [mapper 141 (A), 138 (B), 139 (C), 137 (D)] @@ -54,6 +55,7 @@ DEFINE_DEVICE_TYPE(NES_SACHEN_TCA01, nes_sachen_tca01_device, "nes_tca DEFINE_DEVICE_TYPE(NES_SACHEN_TCU01, nes_sachen_tcu01_device, "nes_tcu01", "NES Cart Sachen TCU-01 PCB") DEFINE_DEVICE_TYPE(NES_SACHEN_TCU02, nes_sachen_tcu02_device, "nes_tcu02", "NES Cart Sachen TCU-02 PCB") DEFINE_DEVICE_TYPE(NES_SACHEN_3013, nes_sachen_3013_device, "nes_3013", "NES Cart Sachen 3013 PCB") +DEFINE_DEVICE_TYPE(NES_SACHEN_3014, nes_sachen_3014_device, "nes_3014", "NES Cart Sachen 3014 PCB") DEFINE_DEVICE_TYPE(NES_SACHEN_74X374, nes_sachen_74x374_device, "nes_s74x374", "NES Cart Sachen 74*374 PCB") DEFINE_DEVICE_TYPE(NES_SACHEN_74X374_ALT, nes_sachen_74x374_alt_device, "nes_s74x374a", "NES Cart Sachen 74*374 Alt PCB") DEFINE_DEVICE_TYPE(NES_SACHEN_8259A, nes_sachen_8259a_device, "nes_s8259a", "NES Cart Sachen 8259A PCB") @@ -107,6 +109,11 @@ nes_sachen_3013_device::nes_sachen_3013_device(const machine_config &mconfig, co { } +nes_sachen_3014_device::nes_sachen_3014_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_nrom_device(mconfig, NES_SACHEN_3014, tag, owner, clock), m_latch(0) +{ +} + nes_sachen_74x374_device::nes_sachen_74x374_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, type, tag, owner, clock), m_latch(0), m_mmc_vrom_bank(0) { @@ -250,6 +257,20 @@ void nes_sachen_tcu02_device::pcb_reset() m_latch = 0; } +void nes_sachen_3014_device::device_start() +{ + common_start(); + save_item(NAME(m_latch)); +} + +void nes_sachen_3014_device::pcb_reset() +{ + prg32(0); + chr8(0, CHRROM); + + m_latch = 0; +} + void nes_sachen_74x374_device::device_start() { common_start(); @@ -503,7 +524,44 @@ uint8_t nes_sachen_tcu02_device::read_l(offs_t offset) u8 nes_sachen_3013_device::read_h(offs_t offset) { - return (offset < 0x4000) ? 0x3a : hi_access_rom(offset); + return (offset < 0x4000) ? 0x3a : hi_access_rom(offset); +} + +/*------------------------------------------------- + + Sachen 3014 board (also marked with serial SA-003) + + Games: Dong Dong Nao 2 + + This board is a CNROM variant with simple protection. + The upper nibble of high address writes is latched + and read back in the lower nibble at 0xe000-0xefff. + + NES 2.0: mapper 533 + + In MAME: Supported. + + -------------------------------------------------*/ + +void nes_sachen_3014_device::write_h(offs_t offset, u8 data) +{ + LOG_MMC(("Sachen 3014 write_h, offset: %04x, data: %02x\n", offset, data)); + + // this pcb is subject to bus conflict + data = account_bus_conflict(offset, data); + + m_latch = data >> 4; + chr8(m_latch & 1, CHRROM); +} + +u8 nes_sachen_3014_device::read_h(offs_t offset) +{ +// LOG_MMC(("Sachen 3014 read_h, offset: %04x\n", offset)); + u8 temp = hi_access_rom(offset); + + if ((offset & 0x7000) == 0x6000) + temp = (temp & 0xf0) | m_latch; + return temp; } /*------------------------------------------------- @@ -540,7 +598,6 @@ void nes_sachen_74x374_device::set_mirror(uint8_t nt) // also used by mappers 13 } } - void nes_sachen_74x374_device::write_l(offs_t offset, uint8_t data) { LOG_MMC(("Sachen 74*374 write_l, offset: %04x, data: %02x\n", offset, data)); diff --git a/src/devices/bus/nes/sachen.h b/src/devices/bus/nes/sachen.h index 3c73bcd23be..eefe9c07ce0 100644 --- a/src/devices/bus/nes/sachen.h +++ b/src/devices/bus/nes/sachen.h @@ -170,6 +170,28 @@ public: }; +// ======================> nes_sachen_3014_device + +class nes_sachen_3014_device : public nes_nrom_device +{ +public: + // construction/destruction + nes_sachen_3014_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; +}; + + // ======================> nes_sachen_74x374_device class nes_sachen_74x374_device : public nes_nrom_device @@ -283,6 +305,7 @@ DECLARE_DEVICE_TYPE(NES_SACHEN_TCA01, nes_sachen_tca01_device) DECLARE_DEVICE_TYPE(NES_SACHEN_TCU01, nes_sachen_tcu01_device) DECLARE_DEVICE_TYPE(NES_SACHEN_TCU02, nes_sachen_tcu02_device) DECLARE_DEVICE_TYPE(NES_SACHEN_3013, nes_sachen_3013_device) +DECLARE_DEVICE_TYPE(NES_SACHEN_3014, nes_sachen_3014_device) DECLARE_DEVICE_TYPE(NES_SACHEN_74X374, nes_sachen_74x374_device) DECLARE_DEVICE_TYPE(NES_SACHEN_74X374_ALT, nes_sachen_74x374_alt_device) DECLARE_DEVICE_TYPE(NES_SACHEN_8259A, nes_sachen_8259a_device) diff --git a/src/mame/machine/nes.cpp b/src/mame/machine/nes.cpp index 2f4e29e5323..d5fd83f2201 100644 --- a/src/mame/machine/nes.cpp +++ b/src/mame/machine/nes.cpp @@ -92,6 +92,7 @@ void nes_state::machine_start() KAISER_KS7037, KAISER_KS7057, SACHEN_3013, + SACHEN_3014, STD_DISKSYS, STD_EXROM, STD_NROM368,