diff options
author | 0kmg <9137159+0kmg@users.noreply.github.com> | 2021-09-20 10:31:28 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-21 04:31:28 +1000 |
commit | cdf1780074bf2af028f5aaaddcdf28e8ad5e382d (patch) | |
tree | f822c6bc4612deac0f0ed6ddd007b639a7400217 /src/devices/bus/nes | |
parent | 501c949c257dcd6b4db084ea8f293f6a319d2ad0 (diff) |
bus/nes: Added support for several Shenzhen Jncota RPGs. (#8500)
* Also corrected metadata for lots of items.
Software list items promoted to working (nes.xml)
---------------------------------------
Jīng Kē Xīnzhuàn (China, Shenzhen Jncota)
Shènghuǒ Lièzhuàn (China)
Xiákè Chuánqí (China)
Zhànguó Fēngyún (China)
Diffstat (limited to 'src/devices/bus/nes')
-rw-r--r-- | src/devices/bus/nes/jncota.cpp | 110 | ||||
-rw-r--r-- | src/devices/bus/nes/jncota.h | 35 | ||||
-rw-r--r-- | src/devices/bus/nes/nes_carts.cpp | 2 | ||||
-rw-r--r-- | src/devices/bus/nes/nes_ines.hxx | 2 | ||||
-rw-r--r-- | src/devices/bus/nes/nes_pcb.hxx | 1 | ||||
-rw-r--r-- | src/devices/bus/nes/nes_slot.h | 2 |
6 files changed, 151 insertions, 1 deletions
diff --git a/src/devices/bus/nes/jncota.cpp b/src/devices/bus/nes/jncota.cpp new file mode 100644 index 00000000000..a3fa79877f8 --- /dev/null +++ b/src/devices/bus/nes/jncota.cpp @@ -0,0 +1,110 @@ +// license:BSD-3-Clause +// copyright-holders: kmg, Fabio Priuli +/*********************************************************************************************************** + + + NES/Famicom cartridge emulation for Shenzhen Jncota PCBs + + + Here we emulate the following PCBs + + * Jncota KT-1001 [mapper 551] + + ***********************************************************************************************************/ + + +#include "emu.h" +#include "jncota.h" + + +#ifdef NES_PCB_DEBUG +#define VERBOSE 1 +#else +#define VERBOSE 0 +#endif + +#define LOG_MMC(x) do { if (VERBOSE) logerror x; } while (0) + + +//------------------------------------------------- +// constructor +//------------------------------------------------- + +DEFINE_DEVICE_TYPE(NES_JNCOTA_KT1001, nes_jncota_kt1001_device, "nes_jncota_kt1001", "NES Cart Shenzhen Jncota KT-1001 PCB") + + +nes_jncota_kt1001_device::nes_jncota_kt1001_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_nrom_device(mconfig, NES_JNCOTA_KT1001, tag, owner, clock) +{ +} + + + +void nes_jncota_kt1001_device::device_start() +{ + common_start(); + save_item(NAME(m_reg)); +} + +void nes_jncota_kt1001_device::pcb_reset() +{ + prg32(0); + chr8(0, CHRROM); + set_nt_mirroring(PPU_MIRROR_HORZ); + + m_reg[0] = m_reg[1] = m_reg[2] = 0; +} + + +/*------------------------------------------------- + mapper specific handlers + -------------------------------------------------*/ + +/*------------------------------------------------- + + Shenzhen Jncota board KT-1001 (this is the serial + on the cart, PCB is likely KT-00X for some X) + + Games: Jing Ke Xin Zhuan, Sheng Huo Lie Zhuan, + Zhan Guo Feng Yun, Xia Ke Chuan Qi + + This board is very similar to mapper 178 but with + bankable CHRROM instead of PRGRAM and without + selectable mirroring. + + NES 2.0: mapper 551 + + In MAME: Supported. + + -------------------------------------------------*/ + +void nes_jncota_kt1001_device::write_l(offs_t offset, u8 data) +{ + LOG_MMC(("jncota_kt1001 write_h, offset: %04x, data: %02x\n", offset, data)); + + offset += 0x100; + switch (offset & 0x1803) + { + case 0x0800: case 0x0801: case 0x0802: + { + m_reg[offset & 3] = data; + + u16 bank = m_reg[2] << 3 | (m_reg[1] & 0x7); + u16 mode = !BIT(m_reg[0], 2); + if (BIT(m_reg[0], 1)) // UNROM mode + { + prg16_89ab(bank); + prg16_cdef(bank | mode | 0x06); + } + else // NROM mode + { + prg16_89ab(bank & ~mode); + prg16_cdef(bank | mode); + } + break; + } + case 0x0803: + chr8(data, CHRROM); + break; + } +} diff --git a/src/devices/bus/nes/jncota.h b/src/devices/bus/nes/jncota.h new file mode 100644 index 00000000000..33d91c0f6be --- /dev/null +++ b/src/devices/bus/nes/jncota.h @@ -0,0 +1,35 @@ +// license:BSD-3-Clause +// copyright-holders: kmg, Fabio Priuli +#ifndef MAME_BUS_NES_JNCOTA_H +#define MAME_BUS_NES_JNCOTA_H + +#pragma once + +#include "nxrom.h" + + +// ======================> nes_jncota_kt1001_device + +class nes_jncota_kt1001_device : public nes_nrom_device +{ +public: + // construction/destruction + nes_jncota_kt1001_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + virtual void write_l(offs_t offset, u8 data) override; + + virtual void pcb_reset() override; + +protected: + // device-level overrides + virtual void device_start() override; + +private: + u8 m_reg[3]; +}; + + +// device type definition +DECLARE_DEVICE_TYPE(NES_JNCOTA_KT1001, nes_jncota_kt1001_device) + +#endif // MAME_BUS_NES_JNCOTA_H diff --git a/src/devices/bus/nes/nes_carts.cpp b/src/devices/bus/nes/nes_carts.cpp index eb35338a381..bbdaa3261da 100644 --- a/src/devices/bus/nes/nes_carts.cpp +++ b/src/devices/bus/nes/nes_carts.cpp @@ -42,6 +42,7 @@ #include "ggenie.h" #include "hes.h" #include "henggedianzi.h" +#include "jncota.h" #include "jy.h" #include "kaiser.h" #include "legacy.h" @@ -199,6 +200,7 @@ void nes_cart(device_slot_interface &device) 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 + device.option_add_internal("jncota_kt1001", NES_JNCOTA_KT1001); // mapper 551 device.option_add_internal("jyc_a", NES_JY_TYPEA); // mapper 90 device.option_add_internal("jyc_b", NES_JY_TYPEB); // mapper 211 device.option_add_internal("jyc_c", NES_JY_TYPEC); // mapper 209 diff --git a/src/devices/bus/nes/nes_ines.hxx b/src/devices/bus/nes/nes_ines.hxx index 2ad980aee7d..9e0a603d3db 100644 --- a/src/devices/bus/nes/nes_ines.hxx +++ b/src/devices/bus/nes/nes_ines.hxx @@ -513,7 +513,7 @@ static const nes_mmc mmc_list[] = // { 548, BTL_CTC15 }, // Almana no Kiseki alt FDS conversion (dump available?) { 549, KAISER_KS7016B }, // Meikyuu Jiin Dababa alt FDS conversion { 550, BMC_JY820845C }, - // 551 variant of mapper 178, likely shenghuo, jingkzx, xiaokecq, zgfyun in nes.xml + { 551, JNCOTA_KT1001 }, // 552 TAITO_X1_017, this is a correction of mapper 82. We should drop 82 and only support the accurate dumps of 552? { 553, SACHEN_3013 }, // Dong Dong Nao 1 { 554, KAISER_KS7010 }, // Akumajo Dracula FDS conversion diff --git a/src/devices/bus/nes/nes_pcb.hxx b/src/devices/bus/nes/nes_pcb.hxx index c6982660d52..b4e5dad9afa 100644 --- a/src/devices/bus/nes/nes_pcb.hxx +++ b/src/devices/bus/nes/nes_pcb.hxx @@ -331,6 +331,7 @@ static const nes_pcb pcb_list[] = { "bmc_reset4", BMC_4IN1RESET }, { "bmc_reset42", BMC_42IN1RESET }, { "bmc_lc160", BMC_LITTLECOM160 }, + { "jncota_kt1001", JNCOTA_KT1001 }, { "jyc_a", JYCOMPANY_A }, { "jyc_b", JYCOMPANY_B }, { "jyc_c", JYCOMPANY_C }, diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h index fb2d481c119..ec8c08b49e5 100644 --- a/src/devices/bus/nes/nes_slot.h +++ b/src/devices/bus/nes/nes_slot.h @@ -119,6 +119,8 @@ enum BTL_CONTRAJ, BTL_DRAGONNINJA, BTL_MARIOBABY, BTL_PALTHENA, BTL_PIKACHUY2K, BTL_SBROS11, BTL_SMB2JA, BTL_SMB2JB, BTL_SMB3, BTL_SHUIGUAN, BTL_TOBIDASE, BTL_YUNG08, + // Shenzhen Jncota + JNCOTA_KT1001, // Kaiser KAISER_KS106C, KAISER_KS202, KAISER_KS7010, KAISER_KS7012, KAISER_KS7013B, KAISER_KS7016, KAISER_KS7016B, KAISER_KS7017, |