From 8e1a92eb3d5a43e6410cebba173b5efb01763dfb Mon Sep 17 00:00:00 2001 From: 0kmg <9137159+0kmg@users.noreply.github.com> Date: Wed, 15 Sep 2021 00:20:10 -0800 Subject: [PATCH] bus/nes: Added support for an NTDEC 14 in 1 cartridge. New working software list additions (nes.xml) ----------------------------------- 14 in 1 (NTDEC) [Consolethinks, Nikolka] --- hash/nes.xml | 16 ++++++++++++ src/devices/bus/nes/nes_carts.cpp | 1 + src/devices/bus/nes/nes_ines.hxx | 4 ++- src/devices/bus/nes/nes_pcb.hxx | 1 + src/devices/bus/nes/nes_slot.h | 2 +- src/devices/bus/nes/ntdec.cpp | 43 +++++++++++++++++++++++++++++-- src/devices/bus/nes/ntdec.h | 15 +++++++++++ 7 files changed, 78 insertions(+), 4 deletions(-) diff --git a/hash/nes.xml b/hash/nes.xml index 31f9ac83722..65bebe025c5 100644 --- a/hash/nes.xml +++ b/hash/nes.xml @@ -78478,6 +78478,22 @@ be better to redump them properly. --> + + 14 in 1 (NTDEC) + 1988 + NTDEC + + + + + + + + + + + + 15 in 1 (KS-122) 19?? diff --git a/src/devices/bus/nes/nes_carts.cpp b/src/devices/bus/nes/nes_carts.cpp index 0c6c5bb0f56..c2903ca0f6e 100644 --- a/src/devices/bus/nes/nes_carts.cpp +++ b/src/devices/bus/nes/nes_carts.cpp @@ -194,6 +194,7 @@ void nes_cart(device_slot_interface &device) device.option_add_internal("cne_fsb", NES_CNE_FSB); device.option_add_internal("cne_shlz", NES_CNE_SHLZ); device.option_add_internal("nanjing", NES_NANJING); // mapper 163 + device.option_add_internal("ntdec_2746", NES_NTDEC_2746); device.option_add_internal("ntdec_asder", NES_NTDEC_ASDER); // mapper 112 device.option_add_internal("ntdec_fh", NES_NTDEC_FH); // mapper 193 device.option_add_internal("ntdec_n715021", NES_NTDEC_N715021); // mapper 81 diff --git a/src/devices/bus/nes/nes_ines.hxx b/src/devices/bus/nes/nes_ines.hxx index 665496f5a9b..ec8468c3173 100644 --- a/src/devices/bus/nes/nes_ines.hxx +++ b/src/devices/bus/nes/nes_ines.hxx @@ -469,7 +469,9 @@ static const nes_mmc mmc_list[] = // 431 Realtec GN-91B // 432 Realtec 8090 // 433 NC-20MB 20 in 1 (CA-006) - // 434...442 Unused + // 434 S-009 + { 435, NTDEC_2746 }, + // 436...442 Unused // 443 NC3000M multicart // 444 NC7000M multicart // 445...511 Unused diff --git a/src/devices/bus/nes/nes_pcb.hxx b/src/devices/bus/nes/nes_pcb.hxx index b97138aad0d..abd5ebecff6 100644 --- a/src/devices/bus/nes/nes_pcb.hxx +++ b/src/devices/bus/nes/nes_pcb.hxx @@ -108,6 +108,7 @@ static const nes_pcb pcb_list[] = { "cne_fsb", CNE_FSB }, { "cne_shlz", CNE_SHLZ }, { "nanjing", NANJING_BOARD }, // mapper 163 + { "ntdec_2746", NTDEC_2746 }, { "ntdec_asder", NTDEC_ASDER }, // mapper 112 { "ntdec_fh", NTDEC_FIGHTINGHERO }, // mapper 193 { "ntdec_n715021", NTDEC_N715021 }, // mapper 81 diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h index 90a2c73a603..13876e45ae1 100644 --- a/src/devices/bus/nes/nes_slot.h +++ b/src/devices/bus/nes/nes_slot.h @@ -65,7 +65,7 @@ enum NAMCOT_163, NAMCOT_175, NAMCOT_340, NAMCOT_3425, NAMCOT_34X3, NAMCOT_3446, // NTDEC - NTDEC_ASDER, NTDEC_FIGHTINGHERO, NTDEC_N715021, + NTDEC_2746, NTDEC_ASDER, NTDEC_FIGHTINGHERO, NTDEC_N715021, // Rex Soft REXSOFT_SL1632, REXSOFT_DBZ5, // Sachen diff --git a/src/devices/bus/nes/ntdec.cpp b/src/devices/bus/nes/ntdec.cpp index 5967eb51b6c..94c521dd6b8 100644 --- a/src/devices/bus/nes/ntdec.cpp +++ b/src/devices/bus/nes/ntdec.cpp @@ -8,6 +8,7 @@ Here we emulate the following PCBs + * NTDEC 2746 [mapper 435] * NTDEC ASDER [mapper 112] * NTDEC Fighting Hero [mapper 193] * NTDEC N715021 [mapper 81] @@ -35,13 +36,19 @@ // constructor //------------------------------------------------- +DEFINE_DEVICE_TYPE(NES_NTDEC_2746, nes_ntdec_2746_device, "nes_ntdec_2746", "NES Cart NTDEC 2746 PCB") DEFINE_DEVICE_TYPE(NES_NTDEC_ASDER, nes_ntdec_asder_device, "nes_ntdec_asder", "NES Cart NTDEC Asder PCB") DEFINE_DEVICE_TYPE(NES_NTDEC_FH, nes_ntdec_fh_device, "nes_ntdec_fh", "NES Cart NTDEC Fighting Hero PCB") DEFINE_DEVICE_TYPE(NES_NTDEC_N715021, nes_ntdec_n715021_device, "nes_ntdec_n715021", "NES Cart NTDEC N715021 PCB") +nes_ntdec_2746_device::nes_ntdec_2746_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_nrom_device(mconfig, NES_NTDEC_2746, tag, owner, clock) +{ +} + nes_ntdec_asder_device::nes_ntdec_asder_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : nes_nrom_device(mconfig, NES_NTDEC_ASDER, tag, owner, clock) , m_latch(0), m_chr_outer(0) + : nes_nrom_device(mconfig, NES_NTDEC_ASDER, tag, owner, clock), m_latch(0), m_chr_outer(0) { } @@ -58,6 +65,13 @@ nes_ntdec_n715021_device::nes_ntdec_n715021_device(const machine_config &mconfig +void nes_ntdec_2746_device::pcb_reset() +{ + prg16_89ab(0); + prg16_cdef(0); + chr8(0, CHRROM); +} + void nes_ntdec_asder_device::device_start() { common_start(); @@ -95,6 +109,31 @@ void nes_ntdec_n715021_device::pcb_reset() mapper specific handlers -------------------------------------------------*/ +/*------------------------------------------------- + + NTDEC 2746 Board + + Games: 14 in 1 + + NES 2.0: mapper 435 + + In MAME: Supported. + + -------------------------------------------------*/ + +void nes_ntdec_2746_device::write_h(offs_t offset, u8 data) +{ + LOG_MMC(("ntdec_2746 write_h, offset: %04x, data: %02x\n", offset, data)); + + u8 bank = bitswap<4>(offset, 9, 8, 7, 5); + u8 mode = BIT(offset, 6); + prg16_89ab(bank & ~mode); + prg16_cdef(bank | mode); + + chr8(offset & 0x0f, CHRROM); + set_nt_mirroring(BIT(offset, 4) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); +} + /*------------------------------------------------- NTDEC ASDER Bootleg Board @@ -206,7 +245,7 @@ void nes_ntdec_fh_device::write_m(offs_t offset, u8 data) void nes_ntdec_n715021_device::write_h(offs_t offset, u8 data) { - LOG_MMC(("ntdec_n715021 write_m, offset: %04x, data: %02x\n", offset, data)); + LOG_MMC(("ntdec_n715021 write_h, offset: %04x, data: %02x\n", offset, data)); prg16_89ab((offset >> 2) & 0x03); chr8(offset & 0x03, CHRROM); } diff --git a/src/devices/bus/nes/ntdec.h b/src/devices/bus/nes/ntdec.h index 160511a388a..061dda0e32a 100644 --- a/src/devices/bus/nes/ntdec.h +++ b/src/devices/bus/nes/ntdec.h @@ -8,6 +8,20 @@ #include "nxrom.h" +// ======================> nes_ntdec_2746_device + +class nes_ntdec_2746_device : public nes_nrom_device +{ +public: + // construction/destruction + nes_ntdec_2746_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + virtual void write_h(offs_t offset, u8 data) override; + + virtual void pcb_reset() override; +}; + + // ======================> nes_ntdec_asder_device class nes_ntdec_asder_device : public nes_nrom_device @@ -58,6 +72,7 @@ public: // device type definition +DECLARE_DEVICE_TYPE(NES_NTDEC_2746, nes_ntdec_2746_device) DECLARE_DEVICE_TYPE(NES_NTDEC_ASDER, nes_ntdec_asder_device) DECLARE_DEVICE_TYPE(NES_NTDEC_FH, nes_ntdec_fh_device) DECLARE_DEVICE_TYPE(NES_NTDEC_N715021, nes_ntdec_n715021_device)