diff options
author | 0kmg <9137159+0kmg@users.noreply.github.com> | 2021-07-12 07:23:44 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-13 01:23:44 +1000 |
commit | adffe506b2d426eaf05e06ee71ce7a85cccfcbd9 (patch) | |
tree | 578aee0e9b09930473daffd9e4e3276e8bdd3b5b /src | |
parent | 13ec17f884a1b4133365cb922bf21723eb5ee086 (diff) |
bus/nes: Added support for a couple Chinese unlicensed carts. (#8195)
Software list items promoted to working (nes.xml)
---------------------------------------
Fāngkuài Zǒngdòngyuán (China)
Korean Igo (Korea)
Ninja Ryukenden (China)
Diffstat (limited to 'src')
-rw-r--r-- | src/devices/bus/nes/nes_carts.cpp | 6 | ||||
-rw-r--r-- | src/devices/bus/nes/nes_ines.hxx | 3 | ||||
-rw-r--r-- | src/devices/bus/nes/nes_pcb.hxx | 4 | ||||
-rw-r--r-- | src/devices/bus/nes/nes_slot.h | 2 | ||||
-rw-r--r-- | src/devices/bus/nes/pirate.cpp | 174 | ||||
-rw-r--r-- | src/devices/bus/nes/pirate.h | 47 | ||||
-rw-r--r-- | src/mame/machine/nes.cpp | 2 |
7 files changed, 227 insertions, 11 deletions
diff --git a/src/devices/bus/nes/nes_carts.cpp b/src/devices/bus/nes/nes_carts.cpp index 28f9ce9e443..b8cae170c52 100644 --- a/src/devices/bus/nes/nes_carts.cpp +++ b/src/devices/bus/nes/nes_carts.cpp @@ -285,7 +285,9 @@ void nes_cart(device_slot_interface &device) device.option_add_internal("unl_whero", NES_WHERO); // mapper 27 device.option_add_internal("unl_43272", NES_43272); // used in Gaau Hok Gwong Cheung device.option_add_internal("tf1201", NES_TF1201); - device.option_add_internal("unl_cfight", NES_CITYFIGHT); // used by City Fighter IV + device.option_add_internal("unl_cfight", NES_CITYFIGHT); // used by City Fighter IV + device.option_add_internal("ninjaryu", NES_NINJARYU); // used by Ninja Ryukenden Chinese + device.option_add_internal("unl_eh8813a", NES_EH8813A); // used by Dr. Mario II device.option_add_internal("zemina", NES_ZEMINA); // mapper 190 - Magic Kid GooGoo // misc bootleg boards device.option_add_internal("ax5705", NES_AX5705); @@ -410,7 +412,6 @@ void nes_cart(device_slot_interface &device) device.option_add_internal("unrom512", NES_UNROM512); device.option_add_internal("2a03pur", NES_2A03PURITANS); // other unsupported... - device.option_add_internal("ninjaryu", NES_NROM); // mapper 111 - UNSUPPORTED device.option_add_internal("unl_dance", NES_NROM); // UNSUPPORTED device.option_add_internal("onebus", NES_NROM); // UNSUPPORTED device.option_add_internal("pec586", NES_NROM); // UNSUPPORTED @@ -418,7 +419,6 @@ void nes_cart(device_slot_interface &device) device.option_add_internal("bmc_f15", NES_NROM); // UNSUPPORTED device.option_add_internal("bmc_hp898f", NES_NROM); // UNSUPPORTED device.option_add_internal("bmc_8in1", NES_NROM); // UNSUPPORTED - device.option_add_internal("unl_eh8813a", NES_NROM); // UNSUPPORTED device.option_add_internal("unl_158b", NES_NROM); // UNSUPPORTED device.option_add_internal("unl_drgnfgt", NES_NROM); // UNSUPPORTED // are there dumps of games with these boards? diff --git a/src/devices/bus/nes/nes_ines.hxx b/src/devices/bus/nes/nes_ines.hxx index 594f8534dfd..c8bcfb2d840 100644 --- a/src/devices/bus/nes/nes_ines.hxx +++ b/src/devices/bus/nes/nes_ines.hxx @@ -142,7 +142,8 @@ static const nes_mmc mmc_list[] = { 108, UNL_LH28_LH54 }, // 108 has 4 variant boards // 109 Unused // 110 Unused - // 111 Ninja Ryuukenden Chinese? - Unsupported + // 111 GTROM 512 + Flash, currently unsupported + // Old mapper 111: Ninja Ryukenden Chinese - currently supported in software list only { 112, NTDEC_ASDER }, { 113, HES_BOARD }, { 114, SUPERGAME_LIONKING }, diff --git a/src/devices/bus/nes/nes_pcb.hxx b/src/devices/bus/nes/nes_pcb.hxx index d0026b1a377..cb0acf43c2b 100644 --- a/src/devices/bus/nes/nes_pcb.hxx +++ b/src/devices/bus/nes/nes_pcb.hxx @@ -315,6 +315,8 @@ static const nes_pcb pcb_list[] = { "unl_43272", UNL_43272 }, { "tf1201", UNL_TF1201 }, { "unl_cfight", UNL_CITYFIGHT }, + { "ninjaryu", UNL_NINJARYU }, + { "unl_eh8813a", UNL_EH8813A }, // Dr. Mario II { "nocash_nochr", NOCASH_NOCHR }, { "action53", UNL_ACTION53 }, { "cufrom", UNL_CUFROM }, @@ -324,7 +326,6 @@ static const nes_pcb pcb_list[] = { "ffe4", FFE4_BOARD }, { "ffe8", FFE8_BOARD }, { "8237a", UNSUPPORTED_BOARD }, - { "ninjaryu", UNSUPPORTED_BOARD }, { "unl_dance", UNSUPPORTED_BOARD }, { "bmc_hik_kof", UNSUPPORTED_BOARD }, { "onebus", UNSUPPORTED_BOARD }, @@ -335,7 +336,6 @@ static const nes_pcb pcb_list[] = { "bmc_f15", UNSUPPORTED_BOARD }, // 150-in-1 Unchained Melody { "bmc_hp898f", UNSUPPORTED_BOARD }, // Primasoft 9999999-in-1 { "bmc_8in1", UNSUPPORTED_BOARD }, // Super 8-in-1 (Incl. Rockin' Kats) - { "unl_eh8813a", UNSUPPORTED_BOARD }, // Dr. Mario II { "unl_158b", UNSUPPORTED_BOARD }, // Blood of Jurassic { "unl_drgnfgt", UNSUPPORTED_BOARD }, // Dragon Fighter by Flying Star { "test", TEST_BOARD }, diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h index b1c992f1ffb..8d74b8353f9 100644 --- a/src/devices/bus/nes/nes_slot.h +++ b/src/devices/bus/nes/nes_slot.h @@ -107,7 +107,7 @@ enum UNL_SF3, UNL_RACERMATE, UNL_EDU2K, UNL_STUDYNGAME, UNL_603_5052, UNL_H2288, UNL_2708, UNL_MALISB, UNL_AC08, UNL_A9746, UNL_WORLDHERO, - UNL_43272, UNL_TF1201, UNL_CITYFIGHT, UNL_RT01, + UNL_43272, UNL_TF1201, UNL_CITYFIGHT, UNL_NINJARYU, UNL_EH8813A, UNL_RT01, /* Bootleg boards */ BTL_SMB2JA, BTL_MARIOBABY, BTL_AISENSHINICOL, BTL_TOBIDASE, BTL_SMB2JB, BTL_09034A, BTL_SMB3, BTL_SBROS11, BTL_DRAGONNINJA, diff --git a/src/devices/bus/nes/pirate.cpp b/src/devices/bus/nes/pirate.cpp index 667e5329ef6..f1d825322d5 100644 --- a/src/devices/bus/nes/pirate.cpp +++ b/src/devices/bus/nes/pirate.cpp @@ -49,6 +49,8 @@ DEFINE_DEVICE_TYPE(NES_WHERO, nes_whero_device, "nes_whero", " DEFINE_DEVICE_TYPE(NES_43272, nes_43272_device, "nes_43272", "NES Cart UNL-43272 PCB") DEFINE_DEVICE_TYPE(NES_TF1201, nes_tf1201_device, "nes_tf1201", "NES Cart UNL-TF1201 PCB") DEFINE_DEVICE_TYPE(NES_CITYFIGHT, nes_cityfight_device, "nes_cityfight", "NES Cart City Fighter PCB") +DEFINE_DEVICE_TYPE(NES_NINJARYU, nes_ninjaryu_device, "nes_ninjaryu", "NES Cart Ninja Ryukenden Chinese PCB") +DEFINE_DEVICE_TYPE(NES_EH8813A, nes_eh8813a_device, "nes_eh8813a", "NES Cart UNL-EH8813A PCB") nes_agci_device::nes_agci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) @@ -126,6 +128,16 @@ nes_cityfight_device::nes_cityfight_device(const machine_config &mconfig, const { } +nes_ninjaryu_device::nes_ninjaryu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : nes_nrom_device(mconfig, NES_NINJARYU, tag, owner, clock) +{ +} + +nes_eh8813a_device::nes_eh8813a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : nes_nrom_device(mconfig, NES_EH8813A, tag, owner, clock), m_dipsetting(0), m_latch(0) +{ +} + @@ -405,6 +417,41 @@ void nes_cityfight_device::pcb_reset() m_irq_count = 0; } +void nes_ninjaryu_device::device_start() +{ + common_start(); + save_item(NAME(m_reg)); +} + +void nes_ninjaryu_device::pcb_reset() +{ + m_reg[0] = 0x0f; + m_reg[1] = m_reg[2] = m_reg[3] = 0; + + set_nt_mirroring(PPU_MIRROR_HORZ); + update_prg(); + update_chr(); +} + +void nes_eh8813a_device::device_start() +{ + common_start(); + save_item(NAME(m_dipsetting)); + save_item(NAME(m_latch)); +} + +void nes_eh8813a_device::pcb_reset() +{ + m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; + prg16_89ab(0); + prg16_89ab(m_prg_chunks - 1); + chr8(0, m_chr_source); + set_nt_mirroring(PPU_MIRROR_VERT); + + m_dipsetting = 0; // no means to adjust cart DIPs - unimplemented + m_latch = 0; +} + /*------------------------------------------------- @@ -571,7 +618,7 @@ void nes_futuremedia_device::write_h(offs_t offset, uint8_t data) break; case 0x5000: - set_nt_mirroring(BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); + set_nt_mirroring(BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); break; case 0x4001: @@ -903,7 +950,7 @@ void nes_mk2_device::write_m(offs_t offset, uint8_t data) /*------------------------------------------------- - UNL-WOLRDHERO board emulation + UNL-WORLDHERO board emulation iNES: @@ -1069,7 +1116,7 @@ void nes_tf1201_device::write_h(offs_t offset, uint8_t data) update_prg(); break; case 0x1000: - set_nt_mirroring(BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); + set_nt_mirroring(BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); break; case 0x1001: m_swap = data & 0x03; @@ -1219,6 +1266,127 @@ void nes_cityfight_device::write_h(offs_t offset, uint8_t data) } +/*------------------------------------------------- + + UNL-NINJARYU + + Games: Ninja Ryukenden Chinese + + This board is mentioned on the NesDev page describing + mapper 111, which used to be assigned to this. It has + registers similar to MMC1 but without the need to write to + them serially. The one existing game has 256K CHR, so this + must have at least 1 more bit for CHR banking. Other differences? + + In MAME: Preliminary supported. + + -------------------------------------------------*/ + +void nes_ninjaryu_device::update_prg() +{ + if (!BIT(m_reg[0], 3)) + prg32((m_reg[3] >> 1) & 0x07); // 32K mode + else if (BIT(m_reg[0], 2)) + { + prg16_89ab(m_reg[3] & 0x0f); + prg16_cdef(m_prg_chunks - 1); // 16K mode fixed last bank + } + else + { + prg16_89ab(0); // 16K mode fixed first bank + prg16_cdef(m_reg[3] & 0x0f); + } +} + +void nes_ninjaryu_device::update_chr() +{ + if (BIT(m_reg[0], 4)) + { + chr4_0(m_reg[1], CHRROM); + chr4_4(m_reg[2], CHRROM); + } + else + chr8(m_reg[1] >> 1, CHRROM); +} + +void nes_ninjaryu_device::write_h(offs_t offset, uint8_t data) +{ + LOG_MMC(("unl_ninjaryu write_h, offset: %04x, data: %02x\n", offset, data)); + + m_reg[(offset >> 13) & 0x03] = data & 0x3f; + + switch (offset & 0x6000) + { + case 0x0000: + switch (data & 0x03) + { + case 0x00: set_nt_mirroring(PPU_MIRROR_LOW); break; + case 0x01: set_nt_mirroring(PPU_MIRROR_HIGH); break; + case 0x02: set_nt_mirroring(PPU_MIRROR_VERT); break; + case 0x03: set_nt_mirroring(PPU_MIRROR_HORZ); break; + } + update_prg(); + update_chr(); + break; + case 0x2000: + case 0x4000: + update_chr(); + break; + case 0x6000: + update_prg(); + break; + } +} + + +/*------------------------------------------------- + + UNL-EH8813A + + Games: Dr. Mario II + + Board is used in multicarts other than this? "BY ES" + in pause menu suggests this may be by Waixing. Title + menus change with DIP settings (currently unimplemented), + but it is unclear if PCB has switch or solder pads or...? + + NES 2.0: mapper 519 + + In MAME: Preliminary supported. + + -------------------------------------------------*/ + +void nes_eh8813a_device::write_h(offs_t offset, uint8_t data) +{ + LOG_MMC(("unl_eh8813a write_h, offset: %04x, data: %02x\n", offset, data)); + + if (BIT(offset, 8)) + return; + + chr8(data & 0x7f, m_chr_source); + set_nt_mirroring(BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); + + uint8_t bank = offset & 0x3f; + if (BIT(offset, 7)) + { + prg16_89ab(bank); + prg16_cdef(bank); + } + else + prg32(bank >> 1); + + m_latch = BIT(offset, 6); +} + +uint8_t nes_eh8813a_device::read_h(offs_t offset) +{ + LOG_MMC(("unl_eh8813a read_h, offset: %04x\n", offset)); + if (m_latch) + offset = (offset & 0xfff0) | m_dipsetting; + return hi_access_rom(offset); +} + + #ifdef UNUSED_FUNCTION /*------------------------------------------------- diff --git a/src/devices/bus/nes/pirate.h b/src/devices/bus/nes/pirate.h index e99bd703aec..4119cd00004 100644 --- a/src/devices/bus/nes/pirate.h +++ b/src/devices/bus/nes/pirate.h @@ -349,6 +349,51 @@ private: }; +// ======================> nes_ninjaryu_device + +class nes_ninjaryu_device : public nes_nrom_device +{ +public: + // construction/destruction + nes_ninjaryu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t 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; + +private: + void update_prg(); + void update_chr(); + uint8_t m_reg[4]; +}; + + +// ======================> nes_eh8813a_device + +class nes_eh8813a_device : public nes_nrom_device +{ +public: + // construction/destruction + nes_eh8813a_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_dipsetting, m_latch; +}; + + #ifdef UNUSED_FUNCTION // ======================> nes_fujiya_device @@ -390,6 +435,8 @@ DECLARE_DEVICE_TYPE(NES_WHERO, nes_whero_device) DECLARE_DEVICE_TYPE(NES_43272, nes_43272_device) DECLARE_DEVICE_TYPE(NES_TF1201, nes_tf1201_device) DECLARE_DEVICE_TYPE(NES_CITYFIGHT, nes_cityfight_device) +DECLARE_DEVICE_TYPE(NES_NINJARYU, nes_ninjaryu_device) +DECLARE_DEVICE_TYPE(NES_EH8813A, nes_eh8813a_device) //DECLARE_DEVICE_TYPE(NES_FUJIYA, nes_fujiya_device) #endif // MAME_BUS_NES_PIRATE_H diff --git a/src/mame/machine/nes.cpp b/src/mame/machine/nes.cpp index be8cc45d2e0..dcbda5e0413 100644 --- a/src/mame/machine/nes.cpp +++ b/src/mame/machine/nes.cpp @@ -75,7 +75,7 @@ void nes_state::machine_start() || m_cartslot->get_pcb_id() == BANDAI_DATACH || m_cartslot->get_pcb_id() == BANDAI_KARAOKE || m_cartslot->get_pcb_id() == UNL_2A03PURITANS || m_cartslot->get_pcb_id() == AVE_MAXI15 || m_cartslot->get_pcb_id() == BTL_PALTHENA || m_cartslot->get_pcb_id() == KAISER_KS7010 || m_cartslot->get_pcb_id() == KAISER_KS7022 || m_cartslot->get_pcb_id() == KAISER_KS7030 || m_cartslot->get_pcb_id() == KAISER_KS7031 || m_cartslot->get_pcb_id() == KAISER_KS7037 || m_cartslot->get_pcb_id() == KAISER_KS7057 || m_cartslot->get_pcb_id() == BMC_VT5201 || m_cartslot->get_pcb_id() == UNL_LH32 || m_cartslot->get_pcb_id() == UNL_LH10 || m_cartslot->get_pcb_id() == UNL_2708 || m_cartslot->get_pcb_id() == UNL_RT01 - || m_cartslot->get_pcb_id() == UNL_43272 || m_cartslot->get_pcb_id() == BMC_G63IN1 || m_cartslot->get_pcb_id() == BMC_8157 + || m_cartslot->get_pcb_id() == UNL_43272 || m_cartslot->get_pcb_id() == UNL_EH8813A || m_cartslot->get_pcb_id() == BMC_G63IN1 || m_cartslot->get_pcb_id() == BMC_8157 || m_cartslot->get_pcb_id() == BMC_GOLD150 || m_cartslot->get_pcb_id() == BMC_CH001 || m_cartslot->get_pcb_id() == BMC_70IN1 || m_cartslot->get_pcb_id() == BMC_800IN1) { |