From 62c1b80bfbf193cbc789a687f0e4d9d4fb13718a Mon Sep 17 00:00:00 2001 From: 0kmg <9137159+0kmg@users.noreply.github.com> Date: Sun, 12 Sep 2021 18:51:58 -0800 Subject: [PATCH] bus/nes: Simplified Zemina board + some minor comment clean ups. --- hash/nes.xml | 1 + src/devices/bus/nes/namcot.cpp | 2 +- src/devices/bus/nes/nes_carts.cpp | 16 +++---- src/devices/bus/nes/nes_pcb.hxx | 2 +- src/devices/bus/nes/nes_unif.hxx | 6 +-- src/devices/bus/nes/sunsoft.cpp | 3 +- src/devices/bus/nes/zemina.cpp | 72 +++++++++---------------------- src/devices/bus/nes/zemina.h | 9 ++-- 8 files changed, 39 insertions(+), 72 deletions(-) diff --git a/hash/nes.xml b/hash/nes.xml index fb535a90300..5542ce0a04a 100644 --- a/hash/nes.xml +++ b/hash/nes.xml @@ -22801,6 +22801,7 @@ license:CC0 + diff --git a/src/devices/bus/nes/namcot.cpp b/src/devices/bus/nes/namcot.cpp index 21f49636727..8124ee86669 100644 --- a/src/devices/bus/nes/namcot.cpp +++ b/src/devices/bus/nes/namcot.cpp @@ -8,7 +8,7 @@ Here we emulate the following PCBs - * Namcot 3433 & 3443 (aka DxROM) [mapper 88, 204, 154] + * Namcot 3433 & 3443 (aka DxROM) [mapper 88, 206, 154] * Namcot 3446 [mapper 76] * Namcot 3425 [mapper 95] * Namcot 163 [mapper 19] diff --git a/src/devices/bus/nes/nes_carts.cpp b/src/devices/bus/nes/nes_carts.cpp index 56b3e5dbd87..817a3ad79b9 100644 --- a/src/devices/bus/nes/nes_carts.cpp +++ b/src/devices/bus/nes/nes_carts.cpp @@ -314,16 +314,16 @@ void nes_cart(device_slot_interface &device) device.option_add_internal("tobidase", NES_TOBIDASE); // mapper 120 device.option_add_internal("mmalee2", NES_MMALEE); // mapper 55 device.option_add_internal("unl_2708", NES_2708); // mapper 103 - device.option_add_internal("unl_dh08", NES_DH08); // used in Bubble Bobble alt (FDS Conversion); - device.option_add_internal("unl_le05", NES_LE05); // used in ProWres (FDS Conversion); - device.option_add_internal("unl_lg25", NES_LG25); // used in Moero TwinBee (FDS Conversion); - device.option_add_internal("unl_lh10", NES_LH10); // used in Fuuun Shaolin Kyo (FDS Conversion); + device.option_add_internal("unl_dh08", NES_DH08); // used in Bubble Bobble alt (FDS Conversion) + device.option_add_internal("unl_le05", NES_LE05); // used in ProWres (FDS Conversion) + device.option_add_internal("unl_lg25", NES_LG25); // used in Moero TwinBee (FDS Conversion) + device.option_add_internal("unl_lh10", NES_LH10); // used in Fuuun Shaolin Kyo (FDS Conversion) 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_lh42", NES_LH42); // used by Highway Star Whirlwind Manu bootleg 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_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 device.option_add_internal("rt01", NES_RT01); @@ -344,7 +344,7 @@ void nes_cart(device_slot_interface &device) device.option_add_internal("kasing", NES_KASING); device.option_add_internal("kay", NES_KAY); device.option_add_internal("h2288", NES_H2288); - device.option_add_internal("unl_6035052", NES_6035052); // mapper 238? + device.option_add_internal("unl_6035052", NES_6035052); // mapper 238 device.option_add_internal("txc_tw", NES_TXC_TW); device.option_add_internal("kof97", NES_KOF97); device.option_add_internal("kof96", NES_KOF96); @@ -405,14 +405,14 @@ void nes_cart(device_slot_interface &device) device.option_add_internal("bmc_35in1", NES_BMC_35IN1); device.option_add_internal("bmc_36in1", NES_BMC_36IN1); device.option_add_internal("bmc_64in1", NES_BMC_64IN1); - device.option_add_internal("bmc_70in1", NES_BMC_70IN1); // mapper 236? + device.option_add_internal("bmc_70in1", NES_BMC_70IN1); // mapper 236 device.option_add_internal("bmc_72in1", NES_BMC_72IN1); device.option_add_internal("bmc_76in1", NES_BMC_76IN1); device.option_add_internal("bmc_s42in1", NES_BMC_76IN1); device.option_add_internal("bmc_150in1", NES_BMC_150IN1); device.option_add_internal("bmc_190in1", NES_BMC_190IN1); device.option_add_internal("bmc_500in1", NES_BMC_500IN1); - device.option_add_internal("bmc_800in1", NES_BMC_800IN1); // mapper 236? + device.option_add_internal("bmc_800in1", NES_BMC_800IN1); // mapper 236 device.option_add_internal("bmc_1200in1", NES_BMC_1200IN1); device.option_add_internal("bmc_gold150", NES_BMC_GOLD150); // mapper 235 with 2M PRG device.option_add_internal("bmc_gold260", NES_BMC_GOLD260); // mapper 235 with 4M PRG diff --git a/src/devices/bus/nes/nes_pcb.hxx b/src/devices/bus/nes/nes_pcb.hxx index ffd20633b9c..75438bb5735 100644 --- a/src/devices/bus/nes/nes_pcb.hxx +++ b/src/devices/bus/nes/nes_pcb.hxx @@ -233,7 +233,7 @@ static const nes_pcb pcb_list[] = { "kasing", KASING_BOARD }, { "kay", KAY_BOARD }, { "h2288", UNL_H2288 }, - { "unl_6035052", UNL_603_5052 }, // mapper 238? + { "unl_6035052", UNL_603_5052 }, // mapper 238 { "txc_tw", TXC_TW }, { "kof97", UNL_KOF97 }, { "kof96", UNL_KOF96 }, diff --git a/src/devices/bus/nes/nes_unif.hxx b/src/devices/bus/nes/nes_unif.hxx index 29d51b94d8d..f0ebdfe63e2 100644 --- a/src/devices/bus/nes/nes_unif.hxx +++ b/src/devices/bus/nes/nes_unif.hxx @@ -107,7 +107,7 @@ static const unif unif_list[] = { "UNL-TEK90", 0, 0, CHRRAM_0, JYCOMPANY_A}, // JY Company A (is TEK90 the real PCB name?) { "UNL-KS7017", 0, 0, CHRRAM_0, KAISER_KS7017}, { "UNL-KS7032", 0, 0, CHRRAM_0, KAISER_KS7032}, // mapper 142 - { "UNL-603-5052", 0, 0, CHRRAM_0, UNL_603_5052}, // mapper 238? + { "UNL-603-5052", 0, 0, CHRRAM_0, UNL_603_5052}, // mapper 238 { "UNL-EDU2000", 0, 32, CHRRAM_8, UNL_EDU2K}, { "UNL-H2288", 0, 0, CHRRAM_0, UNL_H2288}, // mapper 123 { "UNL-SHERO", 0, 0, CHRRAM_8, SACHEN_SHERO}, @@ -135,8 +135,8 @@ static const unif unif_list[] = { "UNL-TF1201", 0, 0, CHRRAM_0, UNL_TF1201}, { "UNL-DANCE2000", 0, 8, CHRRAM_8, SUBOR_TYPE2}, // similar to some Subor carts { "BMC-12-IN-1", 0, 0, CHRRAM_0, UNSUPPORTED_BOARD}, - { "BMC-70IN1", 0, 0, CHRRAM_0, UNSUPPORTED_BOARD}, // mapper 236? - { "BMC-70IN1B", 0, 0, CHRRAM_0, UNSUPPORTED_BOARD}, // mapper 236? + { "BMC-70IN1", 0, 0, CHRRAM_0, UNSUPPORTED_BOARD}, // mapper 236 + { "BMC-70IN1B", 0, 0, CHRRAM_0, UNSUPPORTED_BOARD}, // mapper 236 { "BMC-42IN1RESETSWITCH", 0, 0, CHRRAM_0, UNSUPPORTED_BOARD}, // mapper 60? { "BMC-F-15", 0, 0, CHRRAM_0, UNSUPPORTED_BOARD}, // 150-in-1 Unchained Melody { "BMC-HP898F", 0, 0, CHRRAM_0, UNSUPPORTED_BOARD}, // Primasoft 9999999-in-1 diff --git a/src/devices/bus/nes/sunsoft.cpp b/src/devices/bus/nes/sunsoft.cpp index c5baffe74ea..069bac103bf 100644 --- a/src/devices/bus/nes/sunsoft.cpp +++ b/src/devices/bus/nes/sunsoft.cpp @@ -435,8 +435,7 @@ uint8_t nes_sunsoft_4_device::read_m(offs_t offset) JxROM & Sunsoft 5A / 5B / FME7 board emulation - Notice that Sunsoft-5B = FME7 + sound chip (the latter being - currently unemulated in MESS) + Notice that Sunsoft-5B = FME7 + sound chip iNES: mapper 69 diff --git a/src/devices/bus/nes/zemina.cpp b/src/devices/bus/nes/zemina.cpp index 22741967572..b46da0e7561 100644 --- a/src/devices/bus/nes/zemina.cpp +++ b/src/devices/bus/nes/zemina.cpp @@ -28,38 +28,28 @@ DEFINE_DEVICE_TYPE(NES_ZEMINA, nes_zemina_device, "nes_zemina", "NES Cart Zemina //************************************************************************** //------------------------------------------------- -// nes_zemina_device - constructor +// constructor //------------------------------------------------- -nes_zemina_device::nes_zemina_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_zemina_device::nes_zemina_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_ZEMINA, tag, owner, clock) { } -/*------------------------------------------------- - device_start --------------------------------------------------*/ -void nes_zemina_device::device_start() -{ - common_start(); -} -/*------------------------------------------------- - pcb_reset --------------------------------------------------*/ void nes_zemina_device::pcb_reset() { - set_nt_mirroring(PPU_MIRROR_VERT); - chr2_0(0, CHRROM); - chr2_2(0, CHRROM); - chr2_4(0, CHRROM); - chr2_6(0, CHRROM); prg16_89ab(0); - prg16_cdef(0); + prg16_cdef(0); // fixed bank + + for (int i = 0; i < 4; i++) + chr2_x(i << 1, 0, CHRROM); } + + /*------------------------------------------------- mapper specific handlers -------------------------------------------------*/ @@ -68,46 +58,26 @@ void nes_zemina_device::pcb_reset() Zemina board emulation - Currently, this board is only known to be used - by one game: Magic Kid GooGoo. + Games: Magic Kid GooGoo - Info from kevtris at NESDev, who dumped the game: - wiki.nesdev.com/w/index.php/INES_Mapper_190 + iNES: mapper 190 + + In MAME: Supported. -------------------------------------------------*/ -/*------------------------------------------------- - write --------------------------------------------------*/ - -void nes_zemina_device::write_h(offs_t offset, uint8_t data) +void nes_zemina_device::write_h(offs_t offset, u8 data) { LOG_MMC("zemina write_h, offset: %04x, data: %02x\n", offset, data); - if (offset >= 0x0000 && offset <= 0x1FFF) + switch (offset & 0x6000) { - prg16_89ab(data & 0x07); - } - else if (offset >= 0x4000 && offset <= 0x5FFF) - { - prg16_89ab((data & 0x07) | 0x08); - } - else if ((offset & 0x2000) == 0x2000) // 2K CHR banks - { - switch (offset & 0x03) // only A0, A1, A13, A14, and A15 are used to select the CHR bank - { - case 0x00: - chr2_0(data, CHRROM); - break; - case 0x01: - chr2_2(data, CHRROM); - break; - case 0x02: - chr2_4(data, CHRROM); - break; - case 0x03: - chr2_6(data, CHRROM); - break; - } + case 0x0000: + case 0x4000: + prg16_89ab(BIT(offset, 14) << 3 | (data & 0x07)); + break; + case 0x2000: + chr2_x((offset & 0x03) << 1, data, CHRROM); + break; } } diff --git a/src/devices/bus/nes/zemina.h b/src/devices/bus/nes/zemina.h index 752c7f1382d..992ecdb2c13 100644 --- a/src/devices/bus/nes/zemina.h +++ b/src/devices/bus/nes/zemina.h @@ -11,16 +11,13 @@ // ======================> nes_zemina_device -class nes_zemina_device : - public nes_nrom_device +class nes_zemina_device : public nes_nrom_device { public: // construction/destruction - nes_zemina_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_zemina_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - // device-level overrides - virtual void device_start() override; - virtual void write_h(offs_t offset, uint8_t data) override; + virtual void write_h(offs_t offset, u8 data) override; virtual void pcb_reset() override; };