From 2aeed0b4fa215fc1fe421c8f40d22efc8b62bde7 Mon Sep 17 00:00:00 2001 From: 0kmg <9137159+0kmg@users.noreply.github.com> Date: Thu, 14 Apr 2022 18:10:32 -0800 Subject: bus/nes: Added support for Chinese translations of Genghis Khan, Square's Tom Sawyer, and Tenchi wo Kurau II. (#9569) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Software list items promoted to working (nes.xml) --------------------------------------- Dàtáng Fēngyún VI Dài (China) Chéngjísīhán (China) Fēngsè Huànxiǎng (China) Tāngmǔ Lìxiǎn Jì (China) Tenchi wo Kurau II - Shokatsu Koumei Den (China) Tenchi wo Kurau II - Shokatsu Koumei Den (China, alt) Tūnshí Tiāndì II (China) Tūnshí Tiāndì II (China, alt) Tūnshí Tiāndì II (China, alt 2) Tūnshí Tiāndì III (China) --- hash/nes.xml | 114 +++++++++++++++++++++++++------------- src/devices/bus/nes/mmc3.cpp | 2 +- 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/waixing.cpp | 106 +++++++++++++---------------------- src/devices/bus/nes/waixing.h | 44 ++++++++------- 8 files changed, 141 insertions(+), 131 deletions(-) diff --git a/hash/nes.xml b/hash/nes.xml index df87d6767d6..70de1e41193 100644 --- a/hash/nes.xml +++ b/hash/nes.xml @@ -57904,21 +57904,24 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx - - Cheng Ji Si Han (Chi) - 19?? + + Chéngjísīhán (China) + 2005 Waixing - - + + + + + @@ -57926,21 +57929,24 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx - - Tang Mu Li Xian Ji (Chi) - 19?? + + Tāngmǔ Lìxiǎn Jì (China) + 2005 Waixing - + - - + + + + + @@ -58102,21 +58108,28 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx - - Feng Se Huan Xiang (Chi) - 19?? + + Fēngsè Huànxiǎng (China) + 2005 Waixing - - + + + + + + + + + @@ -62301,9 +62314,9 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx - - Tenchi wo Kurau II - Shokatsu Koumei Den (Chi, Simplified) - 19?? + + Tenchi wo Kurau II - Shokatsu Koumei Den (China) + 1994 Waixing? @@ -62314,6 +62327,9 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx + + + @@ -62321,9 +62337,9 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx - - Tenchi wo Kurau II - Shokatsu Koumei Den (Chi, Traditional) - 19?? + + Tenchi wo Kurau II - Shokatsu Koumei Den (China, alt) + 1994 Waixing? @@ -62334,6 +62350,9 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx + + + @@ -62341,9 +62360,9 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx - - Tun Shi Tian Di II (Chi, Alt 2) - 19?? + + Tūnshí Tiāndì II (China, alt 2) + 1994 XianFeng Katong @@ -62354,6 +62373,9 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx + + + @@ -62361,9 +62383,9 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx - - Tun Shi Tian Di II (Chi) - 19?? + + Tūnshí Tiāndì II (China) + 1994 XianFeng Katong @@ -62375,6 +62397,9 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx + + + @@ -62382,9 +62407,9 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx - - Tun Shi Tian Di II (Chi, Alt) - 19?? + + Tūnshí Tiāndì II (China, alt) + 1994 XianFeng Katong @@ -62396,6 +62421,9 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx + + + @@ -62403,11 +62431,11 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx - - Tun Shi Tian Di III (Chi) - 19?? + + Tūnshí Tiāndì III (China) + 1994 Waixing? - + @@ -62417,6 +62445,9 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx + + + @@ -64214,20 +64245,23 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx - - Da Tang Feng Yun VI Dai (Chi) + + Dàtáng Fēngyún VI Dài (China) 19?? HengGedianzi - + - - + + + + + diff --git a/src/devices/bus/nes/mmc3.cpp b/src/devices/bus/nes/mmc3.cpp index 924f206481d..f697d193434 100644 --- a/src/devices/bus/nes/mmc3.cpp +++ b/src/devices/bus/nes/mmc3.cpp @@ -345,7 +345,7 @@ void nes_txrom_device::write_m(offs_t offset, uint8_t data) { if (!m_battery.empty()) m_battery[offset & (m_battery.size() - 1)] = data; - if (!m_prgram.empty()) + else if (!m_prgram.empty()) m_prgram[offset & (m_prgram.size() - 1)] = data; } } diff --git a/src/devices/bus/nes/nes_carts.cpp b/src/devices/bus/nes/nes_carts.cpp index 2b7113cb012..5445ed6e90b 100644 --- a/src/devices/bus/nes/nes_carts.cpp +++ b/src/devices/bus/nes/nes_carts.cpp @@ -237,6 +237,7 @@ void nes_cart(device_slot_interface &device) device.option_add_internal("waixing_d", NES_WAIXING_D); device.option_add_internal("waixing_e", NES_WAIXING_E); device.option_add_internal("waixing_f", NES_WAIXING_F); + device.option_add_internal("waixing_f1", NES_WAIXING_F1); device.option_add_internal("waixing_g", NES_WAIXING_G); device.option_add_internal("waixing_h", NES_WAIXING_H); device.option_add_internal("waixing_h1", NES_WAIXING_H1); // FIXME: Made up boards the different WRAM protect banks (see Shen Mi Jin San Jiao) diff --git a/src/devices/bus/nes/nes_ines.hxx b/src/devices/bus/nes/nes_ines.hxx index c1b966023c9..87374379cd2 100644 --- a/src/devices/bus/nes/nes_ines.hxx +++ b/src/devices/bus/nes/nes_ines.hxx @@ -232,7 +232,7 @@ static const nes_mmc mmc_list[] = { 196, BTL_SBROS11 }, { 197, UNL_SF3 }, { 198, WAIXING_TYPE_F }, - { 199, WAIXING_TYPE_G }, + { 199, WAIXING_TYPE_F1 }, { 200, BMC_36IN1 }, { 201, BMC_21IN1 }, { 202, BMC_150IN1 }, diff --git a/src/devices/bus/nes/nes_pcb.hxx b/src/devices/bus/nes/nes_pcb.hxx index c520864c829..0f3f009cd54 100644 --- a/src/devices/bus/nes/nes_pcb.hxx +++ b/src/devices/bus/nes/nes_pcb.hxx @@ -145,6 +145,7 @@ static const nes_pcb pcb_list[] = { "waixing_d", WAIXING_TYPE_D }, { "waixing_e", WAIXING_TYPE_E }, { "waixing_f", WAIXING_TYPE_F }, + { "waixing_f1", WAIXING_TYPE_F1 }, { "waixing_g", WAIXING_TYPE_G }, { "waixing_h", WAIXING_TYPE_H }, { "waixing_h1", WAIXING_TYPE_H1 }, diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h index ea46c273366..ff96195f03e 100644 --- a/src/devices/bus/nes/nes_slot.h +++ b/src/devices/bus/nes/nes_slot.h @@ -139,7 +139,7 @@ enum CNE_DECATHLON, CNE_FSB, CNE_SHLZ, COCOMA_BOARD, CONY_BOARD, CONY1K_BOARD, SMD133_BOARD, YOKO_BOARD, RCM_GS2015, RCM_GS2004, RCM_GS2013, RCM_TF9IN1, RCM_3DBLOCK, WAIXING_TYPE_A, WAIXING_TYPE_A1, WAIXING_TYPE_B, WAIXING_TYPE_C, WAIXING_TYPE_D, - WAIXING_TYPE_E, WAIXING_TYPE_F, WAIXING_TYPE_G, WAIXING_TYPE_H, WAIXING_TYPE_H1, + WAIXING_TYPE_E, WAIXING_TYPE_F, WAIXING_TYPE_F1, WAIXING_TYPE_G, WAIXING_TYPE_H, WAIXING_TYPE_H1, WAIXING_TYPE_I, WAIXING_TYPE_J, WAIXING_FS304, WAIXING_SGZLZ, WAIXING_SGZ, WAIXING_WXZS, WAIXING_SECURITY, WAIXING_SH2, WAIXING_DQ8, WAIXING_FFV, WAIXING_WXZS2, SUPERGAME_LIONKING, SUPERGAME_BOOGERMAN, diff --git a/src/devices/bus/nes/waixing.cpp b/src/devices/bus/nes/waixing.cpp index 2120fca3941..a83272d0acf 100644 --- a/src/devices/bus/nes/waixing.cpp +++ b/src/devices/bus/nes/waixing.cpp @@ -38,6 +38,7 @@ DEFINE_DEVICE_TYPE(NES_WAIXING_C, nes_waixing_c_device, "nes_waixing_c", DEFINE_DEVICE_TYPE(NES_WAIXING_D, nes_waixing_d_device, "nes_waixing_d", "NES Cart Waixing Type D PCB") DEFINE_DEVICE_TYPE(NES_WAIXING_E, nes_waixing_e_device, "nes_waixing_e", "NES Cart Waixing Type E PCB") DEFINE_DEVICE_TYPE(NES_WAIXING_F, nes_waixing_f_device, "nes_waixing_f", "NES Cart Waixing Type F PCB") +DEFINE_DEVICE_TYPE(NES_WAIXING_F1, nes_waixing_f1_device, "nes_waixing_f1", "NES Cart Waixing Type F1 PCB") DEFINE_DEVICE_TYPE(NES_WAIXING_G, nes_waixing_g_device, "nes_waixing_g", "NES Cart Waixing Type G PCB") DEFINE_DEVICE_TYPE(NES_WAIXING_H, nes_waixing_h_device, "nes_waixing_h", "NES Cart Waixing Type H PCB") DEFINE_DEVICE_TYPE(NES_WAIXING_H1, nes_waixing_h1_device, "nes_waixing_h1", "NES Cart Waixing Type H (Alt) PCB") @@ -88,8 +89,18 @@ nes_waixing_e_device::nes_waixing_e_device(const machine_config &mconfig, const { } -nes_waixing_f_device::nes_waixing_f_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : nes_waixing_a_device(mconfig, NES_WAIXING_F, tag, owner, clock) +nes_waixing_f_device::nes_waixing_f_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : nes_txrom_device(mconfig, type, tag, owner, clock) +{ +} + +nes_waixing_f_device::nes_waixing_f_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_waixing_f_device(mconfig, NES_WAIXING_F, tag, owner, clock) +{ +} + +nes_waixing_f1_device::nes_waixing_f1_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_waixing_f_device(mconfig, NES_WAIXING_F1, tag, owner, clock) { } @@ -178,19 +189,6 @@ void nes_waixing_a_device::pcb_reset() std::fill(std::begin(mapper_ram), std::end(mapper_ram), 0x00); } -void nes_waixing_f_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - mmc3_common_initialize(0xff, 0xff, 0); - - std::fill(std::begin(mapper_ram), std::end(mapper_ram), 0x00); - m_mmc_prg_bank[0] = 0x00; - m_mmc_prg_bank[1] = 0x01; - m_mmc_prg_bank[2] = 0x4e; - m_mmc_prg_bank[3] = 0x4f; - set_prg(m_prg_base, m_prg_mask); -} - void nes_waixing_g_device::pcb_reset() { m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; @@ -500,77 +498,49 @@ void nes_waixing_e_device::chr_cb(int start, int bank, int source) chr1_x(start, bank, chr_src); } - /*------------------------------------------------- - Waixing Board Type F + Waixing Board Type F, F1 - Games: Tenchi wo Kurau II (C) + Games: Tenchi wo Kurau II translations (mapper 198), + and (mapper 199) Chengjisihan, Tangmu Lixian Ji, + Fengse Huanxiang, Datang Fengyun VI Dai - MMC3 clone. + MMC3 clone with an extra 4K WRAM at 0x5000-0x5fff. + Mapper 198 banks its 8K CHR RAM and 199 does not. - iNES: mapper 198 + iNES: mappers 198, 199 - In MESS: Preliminary support. + In MAME: Supported. + + TODO: Sort out G board games which were assigned + to mapper 199 previously. -------------------------------------------------*/ -void nes_waixing_f_device::chr_cb(int start, int bank, int source) +u8 nes_waixing_f_device::read_l(offs_t offset) { - chr1_x(start, bank, CHRRAM); -} +// LOG_MMC(("waixing_f read_l, offset: %04x\n", offset)); -void nes_waixing_f_device::prg_cb(int start, int bank) -{ -// if (bank > 0x3f) -// bank = 0x40 | (bank & 0xf); - prg8_x(start, bank); + offset += 0x100; + if (!m_prgram.empty() && offset >= 0x1000) + return m_prgram[offset & 0x0fff & (m_prgram.size() - 1)]; + + return get_open_bus(); } -void nes_waixing_f_device::set_prg( int prg_base, int prg_mask ) +void nes_waixing_f_device::write_l(offs_t offset, u8 data) { - uint8_t prg_flip = (m_latch & 0x40) ? 2 : 0; +// LOG_MMC(("waixing_f write_l, offset: %04x, data: %02x\n", offset, data)); - prg_cb(0, m_mmc_prg_bank[0 ^ prg_flip]); - prg_cb(1, m_mmc_prg_bank[1]); - prg_cb(2, m_mmc_prg_bank[2 ^ prg_flip]); - prg_cb(3, m_mmc_prg_bank[3]); + offset += 0x100; + if (!m_prgram.empty() && offset >= 0x1000) + m_prgram[offset & 0x0fff & (m_prgram.size() - 1)] = data; } -void nes_waixing_f_device::write_h(offs_t offset, uint8_t data) +void nes_waixing_f1_device::set_chr(u8 chr, int chr_base, int chr_mask) { - uint8_t cmd; - LOG_MMC(("waixing_f write_h, offset: %04x, data: %02x\n", offset, data)); - - switch (offset & 0x6001) - { - case 0x0001: - cmd = m_latch & 0x07; - switch (cmd) - { - case 0: case 1: // these do not need to be separated: we take care of them in set_chr! - case 2: case 3: case 4: case 5: - m_mmc_vrom_bank[cmd] = data; - set_chr(m_chr_source, m_chr_base, m_chr_mask); - break; - case 6: - case 7: - case 8: - case 9: - m_mmc_prg_bank[cmd - 6] = data; - //printf("prg bank %d value %x\n", cmd - 6, data); - set_prg(m_prg_base, m_prg_mask); - break; - } - break; - - case 0x2001: - break; - - default: - waixing_write(offset, data); - break; - } +// ignore CHR banking as all F1 games use 8K unbanked CHR RAM } /*------------------------------------------------- diff --git a/src/devices/bus/nes/waixing.h b/src/devices/bus/nes/waixing.h index c3e99e3f23c..27efd66f107 100644 --- a/src/devices/bus/nes/waixing.h +++ b/src/devices/bus/nes/waixing.h @@ -56,7 +56,6 @@ public: // construction/destruction nes_waixing_b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides virtual void chr_cb(int start, int bank, int source) override; }; @@ -69,7 +68,6 @@ public: // construction/destruction nes_waixing_c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides virtual void chr_cb(int start, int bank, int source) override; }; @@ -82,7 +80,6 @@ public: // construction/destruction nes_waixing_d_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides virtual void chr_cb(int start, int bank, int source) override; }; @@ -95,28 +92,37 @@ public: // construction/destruction nes_waixing_e_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides virtual void chr_cb(int start, int bank, int source) override; }; // ======================> nes_waixing_f_device -class nes_waixing_f_device : public nes_waixing_a_device +class nes_waixing_f_device : public nes_txrom_device { public: // construction/destruction - nes_waixing_f_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_waixing_f_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - // device-level overrides - virtual void write_h(offs_t offset, uint8_t data) override; - virtual void prg_cb(int start, int bank) override; - virtual void chr_cb(int start, int bank, int source) override; + virtual u8 read_l(offs_t offset) override; + virtual void write_l(offs_t offset, u8 data) override; - virtual void pcb_reset() override; +protected: + // construction/destruction + nes_waixing_f_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); +}; -private: - virtual void set_prg(int prg_base, int prg_mask) override; + +// ======================> nes_waixing_f1_device + +class nes_waixing_f1_device : public nes_waixing_f_device +{ +public: + // construction/destruction + nes_waixing_f1_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + virtual void set_chr(uint8_t chr, int chr_base, int chr_mask) override; }; @@ -128,7 +134,6 @@ public: // construction/destruction nes_waixing_g_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides virtual void write_h(offs_t offset, uint8_t data) override; virtual void chr_cb(int start, int bank, int source) override; @@ -147,15 +152,13 @@ public: // construction/destruction nes_waixing_h_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 chr_cb(int start, int bank, int source) override; // This PCB does not have 1K of internal RAM, so it's not derived from nes_waixing_a_device!! protected: nes_waixing_h_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); - - // device-level overrides - virtual void write_h(offs_t offset, uint8_t data) override; }; @@ -167,7 +170,6 @@ public: // construction/destruction nes_waixing_h1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides virtual void write_h(offs_t offset, uint8_t data) override; // This variant does not ignore the wram protect! @@ -215,14 +217,15 @@ public: // construction/destruction nes_waixing_sh2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides - virtual void device_start() override; virtual uint8_t chr_r(offs_t offset) override; virtual void chr_cb(int start, int bank, int source) override; virtual void pcb_reset() override; protected: + // device-level overrides + virtual void device_start() override; + uint8_t m_reg[2]; }; @@ -355,6 +358,7 @@ DECLARE_DEVICE_TYPE(NES_WAIXING_C, nes_waixing_c_device) DECLARE_DEVICE_TYPE(NES_WAIXING_D, nes_waixing_d_device) DECLARE_DEVICE_TYPE(NES_WAIXING_E, nes_waixing_e_device) DECLARE_DEVICE_TYPE(NES_WAIXING_F, nes_waixing_f_device) +DECLARE_DEVICE_TYPE(NES_WAIXING_F1, nes_waixing_f1_device) DECLARE_DEVICE_TYPE(NES_WAIXING_G, nes_waixing_g_device) DECLARE_DEVICE_TYPE(NES_WAIXING_H, nes_waixing_h_device) DECLARE_DEVICE_TYPE(NES_WAIXING_H1, nes_waixing_h1_device) -- cgit v1.2.3