From e241a3ad92dc8747aa496213899d39a8b2672d00 Mon Sep 17 00:00:00 2001 From: 0kmg <9137159+0kmg@users.noreply.github.com> Date: Thu, 21 Oct 2021 05:04:23 -0800 Subject: bus/nes: Added support for a Somari board variant. (#8728) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New working software list additions (nes.xml) ----------------------------------- AV Jiūjí Májiàng II (Asia, alt) [MLX] --- hash/nes.xml | 24 +++++++++++++++++++++--- src/devices/bus/nes/nes_carts.cpp | 1 + src/devices/bus/nes/nes_ines.hxx | 10 ++++++++++ src/devices/bus/nes/nes_pcb.hxx | 1 + src/devices/bus/nes/nes_slot.h | 2 +- src/devices/bus/nes/somari.cpp | 28 ++++++++++++++++++++++++---- src/devices/bus/nes/somari.h | 15 +++++++++++++++ 7 files changed, 73 insertions(+), 8 deletions(-) diff --git a/hash/nes.xml b/hash/nes.xml index bc5ee8c8bd5..baab0b17511 100644 --- a/hash/nes.xml +++ b/hash/nes.xml @@ -62609,10 +62609,11 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx - AV Jiu Ji Ma Jiang II (Asia) + AV Jiūjí Májiàng II (Asia) 19?? - <unknown> - + Kasheng + + @@ -62625,6 +62626,23 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx + + AV Jiūjí Májiàng II (Asia, alt) + 1995? + Ge De Industry + + + + + + + + + + + + + AV Měi Shàonǚ Zhànshì Girl Fighting (Asia) 1994 diff --git a/src/devices/bus/nes/nes_carts.cpp b/src/devices/bus/nes/nes_carts.cpp index cd4a09cf180..893e4d53f86 100644 --- a/src/devices/bus/nes/nes_carts.cpp +++ b/src/devices/bus/nes/nes_carts.cpp @@ -341,6 +341,7 @@ void nes_cart(device_slot_interface &device) device.option_add_internal("dbz5", NES_REX_DBZ5); device.option_add_internal("sl1632", NES_REX_SL1632); device.option_add_internal("somari", NES_SOMARI); // mapper 116 + device.option_add_internal("huang2", NES_HUANG2); // mapper 116 also device.option_add_internal("nitra", NES_NITRA); device.option_add_internal("fs6", NES_FS6); // mapper 196 alt? (for Street Fighter VI / Fight Street VI); device.option_add_internal("sbros11", NES_SBROS11); diff --git a/src/devices/bus/nes/nes_ines.hxx b/src/devices/bus/nes/nes_ines.hxx index 5ef4994b593..f0be44ed5eb 100644 --- a/src/devices/bus/nes/nes_ines.hxx +++ b/src/devices/bus/nes/nes_ines.hxx @@ -736,6 +736,11 @@ void nes_cart_slot_device::call_load_ines() else if (submapper == 3) pcb_id = IREM_HOLYDIVR; } + // iNES Mapper 116 + else if (mapper == 116 && submapper == 2) + { + pcb_id = SOMARI_HUANG2; // Mapper 116 is used for 2 diff boards + } // iNES Mapper 185 else if (mapper == 185) { @@ -1237,6 +1242,11 @@ const char * nes_cart_slot_device::get_default_card_ines(get_default_card_softwa else if (submapper == 3) pcb_id = IREM_HOLYDIVR; } + // iNES Mapper 116 + else if (mapper == 116 && submapper == 2) + { + pcb_id = SOMARI_HUANG2; // Mapper 116 is used for 2 diff boards + } } // solve mapper conflicts diff --git a/src/devices/bus/nes/nes_pcb.hxx b/src/devices/bus/nes/nes_pcb.hxx index 34bbc008cf7..f7a0526fc75 100644 --- a/src/devices/bus/nes/nes_pcb.hxx +++ b/src/devices/bus/nes/nes_pcb.hxx @@ -227,6 +227,7 @@ static const nes_pcb pcb_list[] = { "dbz5", REXSOFT_DBZ5 }, { "sl1632", REXSOFT_SL1632 }, { "somari", SOMARI_SL12 }, // mapper 116 + { "huang2", SOMARI_HUANG2 }, // mapper 116 also { "nitra", NITRA_TDA }, { "fs6", UNL_FS6 }, // mapper 196 alt? (for Street Fighter VI / Fight Street VI }, { "sbros11", BTL_SBROS11 }, diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h index 64345ca3e60..74d474bff43 100644 --- a/src/devices/bus/nes/nes_slot.h +++ b/src/devices/bus/nes/nes_slot.h @@ -133,7 +133,7 @@ enum UNL_LH31, UNL_LH32, UNL_LH42, 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, + MAGICSERIES_MD, KASING_BOARD, FUTUREMEDIA_BOARD, FUKUTAKE_BOARD, SOMARI_SL12, SOMARI_HUANG2, HENGG_SRICH, HENGG_XHZS, HENGG_SHJY3, SUBOR_TYPE0, SUBOR_TYPE1, SUBOR_TYPE2, CNE_DECATHLON, CNE_FSB, CNE_SHLZ, COCOMA_BOARD, CONY_BOARD, YOKO_BOARD, RCM_GS2015, RCM_GS2004, RCM_GS2013, RCM_TF9IN1, RCM_3DBLOCK, diff --git a/src/devices/bus/nes/somari.cpp b/src/devices/bus/nes/somari.cpp index cc0dc35f7c4..cacbae4bd3b 100644 --- a/src/devices/bus/nes/somari.cpp +++ b/src/devices/bus/nes/somari.cpp @@ -34,10 +34,21 @@ //------------------------------------------------- DEFINE_DEVICE_TYPE(NES_SOMARI, nes_somari_device, "nes_somari", "NES Cart Team Somari PCB") +DEFINE_DEVICE_TYPE(NES_HUANG2, nes_huang2_device, "nes_huang2", "NES Cart Huang-2 PCB") +nes_somari_device::nes_somari_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : nes_txrom_device(mconfig, type, tag, owner, clock), m_board_mode(0), m_mmc1_count(0), m_mmc1_latch(0), m_mmc1_prg_shift(type == NES_HUANG2), m_vrc_mirror(0) +{ +} + nes_somari_device::nes_somari_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : nes_txrom_device(mconfig, NES_SOMARI, tag, owner, clock), m_board_mode(0), m_mmc1_count(0), m_mmc1_latch(0), m_vrc_mirror(0) + : nes_somari_device(mconfig, NES_SOMARI, tag, owner, clock) +{ +} + +nes_huang2_device::nes_huang2_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_somari_device(mconfig, NES_HUANG2, tag, owner, clock) { } @@ -91,6 +102,15 @@ void nes_somari_device::pcb_reset() SOMERI TEAM + Games: Somari, Kart Fighter, Garou Densetsu Special, + AV Bishoujo Senshi, AV Kyuukyoku Mahjong 2 + + Like Rex Soft's SL-1632 these boards use Huang chips + which simulate the behavior of MMC1, MMC3, and VRC2. + There is a second revision, Huang-2, that appears to + only have been used for AV Kyuukyoku Mahjong 2. Its + MMC1 mode has nonstandard PRG banking. + iNES: mapper 116 @@ -184,11 +204,11 @@ void nes_somari_device::update_prg() break; case 2: prg16_89ab(0); - prg16_cdef(m_mmc1_reg[3]); + prg16_cdef(m_mmc1_reg[3] >> m_mmc1_prg_shift); break; case 3: - prg16_89ab(m_mmc1_reg[3]); - prg16_cdef(0x0f); + prg16_89ab(m_mmc1_reg[3] >> m_mmc1_prg_shift); + prg16_cdef(0x0f >> m_mmc1_prg_shift); break; } break; diff --git a/src/devices/bus/nes/somari.h b/src/devices/bus/nes/somari.h index 5976f83e5ef..3786bedcf28 100644 --- a/src/devices/bus/nes/somari.h +++ b/src/devices/bus/nes/somari.h @@ -23,6 +23,9 @@ public: virtual void pcb_reset() override; protected: + // construction/destruction + nes_somari_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); + // device-level overrides virtual void device_start() override; @@ -41,6 +44,7 @@ private: u8 m_mmc1_count; u8 m_mmc1_latch; u8 m_mmc1_reg[4]; + u8 m_mmc1_prg_shift; // VRC2 u8 m_vrc_prg_bank[2]; @@ -49,7 +53,18 @@ private: }; +// ======================> nes_huang2_device + +class nes_huang2_device : public nes_somari_device +{ +public: + // construction/destruction + nes_huang2_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + + // device type definition DECLARE_DEVICE_TYPE(NES_SOMARI, nes_somari_device) +DECLARE_DEVICE_TYPE(NES_HUANG2, nes_huang2_device) #endif // MAME_BUS_NES_SOMARI_H -- cgit v1.2.3