From c874a82db9ed2d4768cfa1989640e2ee4be115eb Mon Sep 17 00:00:00 2001 From: 0kmg <9137159+0kmg@users.noreply.github.com> Date: Mon, 19 Jul 2021 15:05:38 -0800 Subject: [PATCH] bus/nes: Added support for another Ai Senshi Nicol bootleg. - Also changed nazomfds to reflect lack of battery backed RAM. Game remains not working. New working software list additions ----------------------------------- Ai Senshi Nicol (Asia, FDS conversion, alt) --- hash/nes.xml | 27 ++++++++++++-- src/devices/bus/nes/bootleg.cpp | 61 ++++++++++++++++++++++++++++--- src/devices/bus/nes/bootleg.h | 19 ++++++++++ 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 | 3 +- 7 files changed, 103 insertions(+), 11 deletions(-) diff --git a/hash/nes.xml b/hash/nes.xml index 448e7d90221..abb56824c85 100644 --- a/hash/nes.xml +++ b/hash/nes.xml @@ -66480,6 +66480,26 @@ Also notice that VRAM & WRAM are probably incorrect for some of these sets, at t + + + Ai Senshi Nicol (Asia, FDS conversion, alt) + 19?? + Whirlwind Manu + + + + + + + + + + + + + + + Akumajou Dracula (Asia, FDS conversion) 19?? @@ -66538,6 +66558,7 @@ Also notice that VRAM & WRAM are probably incorrect for some of these sets, at t Almana no Kiseki (Asia, FDS conversion, Alt 2) 19?? Whirlwind Manu + @@ -66735,6 +66756,7 @@ Also notice that VRAM & WRAM are probably incorrect for some of these sets, at t Green Beret (Asia, FDS conversion) 19?? Whirlwind Manu + @@ -66936,9 +66958,8 @@ Also notice that VRAM & WRAM are probably incorrect for some of these sets, at t - - - + + diff --git a/src/devices/bus/nes/bootleg.cpp b/src/devices/bus/nes/bootleg.cpp index 9dc0d5585c1..f9c8340a635 100644 --- a/src/devices/bus/nes/bootleg.cpp +++ b/src/devices/bus/nes/bootleg.cpp @@ -56,6 +56,7 @@ DEFINE_DEVICE_TYPE(NES_LH10, nes_lh10_device, "nes_lh10", "N DEFINE_DEVICE_TYPE(NES_LH28_LH54, nes_lh28_lh54_device, "nes_lh28_lh54", "NES Cart LH28/LH54 Pirate PCBs") DEFINE_DEVICE_TYPE(NES_LH31, nes_lh31_device, "nes_lh31", "NES Cart LH31 Pirate PCB") DEFINE_DEVICE_TYPE(NES_LH32, nes_lh32_device, "nes_lh32", "NES Cart LH32 Pirate PCB") +DEFINE_DEVICE_TYPE(NES_LH51, nes_lh51_device, "nes_lh51", "NES Cart LH51 Pirate PCB") DEFINE_DEVICE_TYPE(NES_LH53, nes_lh53_device, "nes_lh53", "NES Cart LH53 Pirate PCB") DEFINE_DEVICE_TYPE(NES_2708, nes_2708_device, "nes_2708", "NES Cart BTL-2708 Pirate PCB") DEFINE_DEVICE_TYPE(NES_AC08, nes_ac08_device, "nes_ac08", "NES Cart AC08 Pirate PCB") @@ -164,6 +165,11 @@ nes_lh10_device::nes_lh10_device(const machine_config &mconfig, const char *tag, { } +nes_lh51_device::nes_lh51_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_nrom_device(mconfig, NES_LH51, tag, owner, clock) +{ +} + nes_lh53_device::nes_lh53_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_LH53, tag, owner, clock), m_irq_count(0), m_irq_enable(0), m_reg(0), irq_timer(nullptr) { @@ -489,6 +495,17 @@ void nes_lh10_device::pcb_reset() std::fill(std::begin(m_reg), std::end(m_reg), 0x00); } +void nes_lh51_device::device_start() +{ + common_start(); +} + +void nes_lh51_device::pcb_reset() +{ + prg32((m_prg_chunks >> 1) - 1); // first 8K is switchable, the rest fixed + chr8(0, CHRRAM); +} + void nes_lh53_device::device_start() { common_start(); @@ -1504,14 +1521,47 @@ void nes_lh10_device::write_h(offs_t offset, uint8_t data) } } +/*------------------------------------------------- + + UNL-LH51 + + Games: Ai Senshi Nicol (Whirlwind Manu FDS conversion) + + A simple board with swappable 8K PRG at 0x8000-0x9fff, + fixed PRG above that, and 8K WRAM at 0x6000-0x7fff. + The game's sound code is broken and does not work on + real hardware. + + NES 2.0: mapper 309 + + In MAME: Supported. + + -------------------------------------------------*/ + +void nes_lh51_device::write_h(offs_t offset, u8 data) +{ + LOG_MMC(("lh51 write_h, offset: %04x, data: %02x\n", offset, data)); + + switch (offset & 0x6000) + { + case 0x0000: + case 0x1000: + prg8_89(data & 0x0f); + break; + case 0x6000: + case 0x7000: + set_nt_mirroring(BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); + break; + } +} + /*------------------------------------------------- UNL-LH53 Games: Nazo no Murasamejou (FDS conversion) - This PCB maps WRAM (w/battery) in 0xb800-0xd7ff and - PRG in 0x6000-0x7fff + This PCB maps WRAM in 0xb800-0xd7ff and PRG in 0x6000-0x7fff NES 2.0: mapper 535 @@ -1538,7 +1588,7 @@ void nes_lh53_device::device_timer(emu_timer &timer, device_timer_id id, int par uint8_t nes_lh53_device::read_m(offs_t offset) { LOG_MMC(("lh53 read_m, offset: %04x\n", offset)); - return m_prg[(m_reg * 0x2000) + (offset & 0x1fff)]; + return m_prg[m_reg * 0x2000 + offset]; } uint8_t nes_lh53_device::read_h(offs_t offset) @@ -1546,7 +1596,7 @@ uint8_t nes_lh53_device::read_h(offs_t offset) // LOG_MMC(("lh53 read_h, offset: %04x\n", offset)); if (offset >= 0x3800 && offset < 0x5800) - return m_battery[offset & 0x1fff]; + return m_prgram[offset - 0x3800]; return hi_access_rom(offset); } @@ -1556,8 +1606,7 @@ void nes_lh53_device::write_h(offs_t offset, uint8_t data) LOG_MMC(("lh53 write_h, offset: %04x, data: %02x\n", offset, data)); if (offset >= 0x3800 && offset < 0x5800) - m_battery[offset & 0x1fff] = data; - + m_prgram[offset - 0x3800] = data; else { switch (offset & 0x7000) diff --git a/src/devices/bus/nes/bootleg.h b/src/devices/bus/nes/bootleg.h index 498df640279..1e09064b04a 100644 --- a/src/devices/bus/nes/bootleg.h +++ b/src/devices/bus/nes/bootleg.h @@ -437,6 +437,24 @@ private: }; +// ======================> nes_lh51_device + +class nes_lh51_device : public nes_nrom_device +{ +public: + // construction/destruction + nes_lh51_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; + +protected: + // device-level overrides + virtual void device_start() override; +}; + + // ======================> nes_lh53_device class nes_lh53_device : public nes_nrom_device @@ -600,6 +618,7 @@ DECLARE_DEVICE_TYPE(NES_LH10, nes_lh10_device) DECLARE_DEVICE_TYPE(NES_LH28_LH54, nes_lh28_lh54_device) DECLARE_DEVICE_TYPE(NES_LH31, nes_lh31_device) DECLARE_DEVICE_TYPE(NES_LH32, nes_lh32_device) +DECLARE_DEVICE_TYPE(NES_LH51, nes_lh51_device) DECLARE_DEVICE_TYPE(NES_LH53, nes_lh53_device) DECLARE_DEVICE_TYPE(NES_2708, nes_2708_device) DECLARE_DEVICE_TYPE(NES_AC08, nes_ac08_device) diff --git a/src/devices/bus/nes/nes_carts.cpp b/src/devices/bus/nes/nes_carts.cpp index 681f733ddb9..8754db26256 100644 --- a/src/devices/bus/nes/nes_carts.cpp +++ b/src/devices/bus/nes/nes_carts.cpp @@ -313,6 +313,7 @@ void nes_cart(device_slot_interface &device) device.option_add_internal("unl_lh28_lh54", NES_LH28_LH54); // used in Falsion, Meikyuu Jiin Dababa FDS conversions device.option_add_internal("unl_lh31", NES_LH31); // used in Bubble Bobble alt FDS conversion device.option_add_internal("unl_lh32", NES_LH32); // used by Monty no Doki Doki Daidassou FDS conversion + device.option_add_internal("unl_lh51", NES_LH51); // used in Ai Senshi Nicol alt FDS conversion device.option_add_internal("unl_lh53", NES_LH53); // used in Nazo no Murasamejou (FDS Conversion); device.option_add_internal("unl_ac08", NES_AC08); // used by Green Beret FDS conversion device.option_add_internal("sgpipe", NES_SHUIGUAN); // mapper 183 diff --git a/src/devices/bus/nes/nes_ines.hxx b/src/devices/bus/nes/nes_ines.hxx index adc514f5bc6..751afedf2a2 100644 --- a/src/devices/bus/nes/nes_ines.hxx +++ b/src/devices/bus/nes/nes_ines.hxx @@ -343,7 +343,7 @@ static const nes_mmc mmc_list[] = { 306, KAISER_KS7016 }, // Exciting Basket FDS conversion { 307, KAISER_KS7037 }, // Metroid FDS conversion // 308 Batman (Sunsoft) pirate on VRC2 clone hardware - // { 309, UNL_LH51 }, // Ai Senshi Nicol alt FDS conversion (dump available?) + { 309, UNL_LH51 }, // Ai Senshi Nicol alt FDS conversion // 310 variant of mapper 125? // 311 Unused (previously assigned in error to a bad SMB2 pirate dump) { 312, KAISER_KS7013B }, // Highway Star FDS conversion diff --git a/src/devices/bus/nes/nes_pcb.hxx b/src/devices/bus/nes/nes_pcb.hxx index c3963a074bc..b4f84f8bd2d 100644 --- a/src/devices/bus/nes/nes_pcb.hxx +++ b/src/devices/bus/nes/nes_pcb.hxx @@ -308,6 +308,7 @@ static const nes_pcb pcb_list[] = { "unl_lh28_lh54", UNL_LH28_LH54 }, { "unl_lh31", UNL_LH31 }, { "unl_lh32", UNL_LH32 }, + { "unl_lh51", UNL_LH51 }, { "unl_lh53", UNL_LH53 }, { "unl_ac08", UNL_AC08 }, { "unl_malisb", UNL_MALISB }, diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h index e760833d7a6..10f0f131ff3 100644 --- a/src/devices/bus/nes/nes_slot.h +++ b/src/devices/bus/nes/nes_slot.h @@ -118,7 +118,8 @@ enum KAISER_KS7022, KAISER_KS7030, KAISER_KS7031, KAISER_KS7032, KAISER_KS7037, KAISER_KS7057, KAISER_KS7058, // Whirlwind Manu - UNL_DH08, UNL_LE05, UNL_LH10, UNL_LH28_LH54, UNL_LH31, UNL_LH32, UNL_LH53, + UNL_DH08, UNL_LE05, UNL_LH10, UNL_LH28_LH54, + UNL_LH31, UNL_LH32, UNL_LH51, UNL_LH53, /* Misc: these are needed to convert mappers to boards, I will sort them later */ OPENCORP_DAOU306, HES_BOARD, SVISION16_BOARD, RUMBLESTATION_BOARD, JYCOMPANY_A, JYCOMPANY_B, JYCOMPANY_C, MAGICSERIES_MD, KASING_BOARD, FUTUREMEDIA_BOARD, FUKUTAKE_BOARD, SOMARI_SL12,