From 8796124eb42e771e8bbf62f70dbb8973a7369c3b Mon Sep 17 00:00:00 2001
From: 0kmg <9137159+0kmg@users.noreply.github.com>
Date: Fri, 25 Jun 2021 13:39:09 -0800
Subject: add mapper 29 and preliminary mapper 30 support (#8225)
New working software list additions
-----------------------------------
2A03Puritans [rainwarrior]
E.T. [KHAN]
Glider [anonymous]
* mapper 29: support should be complete but there are few if any other homebrew roms to test against
* mapper 30: only supports the most basic board that doesn't use flashable memory - tested on a dozen or so roms, all working
* add a game each for mappers 29 (Glider), 30 (E.T.), and 31 (2A03Puritans) so there is something in the software lists to actually test against. Glider is discontinued by manufacture, the other two are freely available from their authors.
* various naming clean ups, like BTL- prefixes for things that are not bootlegs
---
hash/nes.xml | 67 ++++++++++++++++++--
scripts/src/bus.lua | 2 +
src/devices/bus/nes/2a03pur.cpp | 2 +-
src/devices/bus/nes/2a03pur.h | 2 +-
src/devices/bus/nes/nes_carts.cpp | 7 ++-
src/devices/bus/nes/nes_ines.hxx | 32 ++++++++--
src/devices/bus/nes/nes_pcb.hxx | 6 +-
src/devices/bus/nes/nes_slot.h | 4 +-
src/devices/bus/nes/sealie.cpp | 124 ++++++++++++++++++++++++++++++++++++++
src/devices/bus/nes/sealie.h | 43 +++++++++++++
src/mame/machine/nes.cpp | 2 +-
11 files changed, 271 insertions(+), 20 deletions(-)
create mode 100644 src/devices/bus/nes/sealie.cpp
create mode 100644 src/devices/bus/nes/sealie.h
diff --git a/hash/nes.xml b/hash/nes.xml
index 02c2ae4b87b..43551a3342f 100644
--- a/hash/nes.xml
+++ b/hash/nes.xml
@@ -77050,6 +77050,61 @@ be better to redump them properly. -->
+
+
+
+ 2A03Puritans
+ 2013
+ Infinite NES Lives
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ E.T.
+ 2014
+ <homebrew>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Glider
+ 2008
+ RetroZone
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -77057,9 +77112,9 @@ be better to redump them properly. -->
2013
Infinite NES Lives
-
+
-
+
@@ -77072,9 +77127,9 @@ be better to redump them properly. -->
2014
Infinite NES Lives
-
+
-
+
@@ -77087,9 +77142,9 @@ be better to redump them properly. -->
2018
Infinite NES Lives
-
+
-
+
diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua
index ae7ff3bfba9..5d4df6e5730 100644
--- a/scripts/src/bus.lua
+++ b/scripts/src/bus.lua
@@ -2833,6 +2833,8 @@ if (BUSES["NES"]~=null) then
MAME_DIR .. "src/devices/bus/nes/rexsoft.h",
MAME_DIR .. "src/devices/bus/nes/sachen.cpp",
MAME_DIR .. "src/devices/bus/nes/sachen.h",
+ MAME_DIR .. "src/devices/bus/nes/sealie.cpp",
+ MAME_DIR .. "src/devices/bus/nes/sealie.h",
MAME_DIR .. "src/devices/bus/nes/somari.cpp",
MAME_DIR .. "src/devices/bus/nes/somari.h",
MAME_DIR .. "src/devices/bus/nes/subor.cpp",
diff --git a/src/devices/bus/nes/2a03pur.cpp b/src/devices/bus/nes/2a03pur.cpp
index 87e364b1638..62dbc5ee753 100644
--- a/src/devices/bus/nes/2a03pur.cpp
+++ b/src/devices/bus/nes/2a03pur.cpp
@@ -7,7 +7,7 @@
Here we emulate the PCB designed by infiniteneslives and
- rainwarrior for this homebew multicart [mapper 31]
+ rainwarrior for this homebrew multicart [mapper 31]
The main difference of this PCB compared to others is that it
uses 4k PRG banks!
diff --git a/src/devices/bus/nes/2a03pur.h b/src/devices/bus/nes/2a03pur.h
index 970898ff128..fe7d50d5804 100644
--- a/src/devices/bus/nes/2a03pur.h
+++ b/src/devices/bus/nes/2a03pur.h
@@ -8,7 +8,7 @@
#include "nxrom.h"
-// ======================> nes_racermate_device
+// ======================> nes_2a03pur_device
class nes_2a03pur_device : public nes_nrom_device
{
diff --git a/src/devices/bus/nes/nes_carts.cpp b/src/devices/bus/nes/nes_carts.cpp
index a4a3950b98d..e34ed926145 100644
--- a/src/devices/bus/nes/nes_carts.cpp
+++ b/src/devices/bus/nes/nes_carts.cpp
@@ -51,6 +51,7 @@
#include "rcm.h"
#include "rexsoft.h"
#include "sachen.h"
+#include "sealie.h"
#include "somari.h"
#include "subor.h"
#include "tengen.h"
@@ -397,8 +398,10 @@ void nes_cart(device_slot_interface &device)
device.option_add_internal("bmc_830118c", NES_BMC_830118C);
device.option_add_internal("pjoy84", NES_PJOY84);
device.option_add_internal("nocash_nochr", NES_NOCHR);
- device.option_add_internal("nes_action53", NES_ACTION53);
- device.option_add_internal("nes_2a03pur", NES_2A03PURITANS);
+ device.option_add_internal("action53", NES_ACTION53);
+ device.option_add_internal("cufrom", NES_CUFROM);
+ 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
diff --git a/src/devices/bus/nes/nes_ines.hxx b/src/devices/bus/nes/nes_ines.hxx
index 6239f4e1849..c8690d3c3c2 100644
--- a/src/devices/bus/nes/nes_ines.hxx
+++ b/src/devices/bus/nes/nes_ines.hxx
@@ -59,10 +59,10 @@ static const nes_mmc mmc_list[] =
{ 25, KONAMI_VRC4 },
{ 26, KONAMI_VRC6 },
{ 27, UNL_WORLDHERO }, // 27 World Hero board - Unsupported
- { 28, BTL_ACTION53 }, // 28 - Multi-discrete PCB designed by Tepples for Action 53
- // 29 Unused
- // 30 UNROM 512 + Flash, currently unsupported
- { 31, BTL_2A03_PURITANS }, // 31 - PCB designed by infinitelives & rainwarrior for 2A03 Puritans Album
+ { 28, UNL_ACTION53 }, // 28 - Multi-discrete PCB designed by Tepples for Action 53
+ { 29, UNL_CUFROM }, // 29 - homebrew PCB used by Glider
+ { 30, UNL_UNROM512 }, // 30 - UNROM 512 + Flash
+ { 31, UNL_2A03PURITANS }, // 31 - PCB designed by infinitelives & rainwarrior for 2A03 Puritans Album
{ 32, IREM_G101 },
{ 33, TAITO_TC0190FMC },
{ 34, STD_BXROM },
@@ -134,7 +134,7 @@ static const nes_mmc mmc_list[] =
// 100 images hacked to work with nesticle?
// 101 Unused (Urusei Yatsura had been assigned to this mapper, but it's Mapper 87)
// 102 Unused
- { 103, UNL_2708 }, // 103 Bootleg cart 2708 (Doki Doki Panic - FDS Conversion) - Unsupported
+ { 103, UNL_2708 }, // 103 Bootleg cart 2708 (Doki Doki Panic - FDS Conversion)
{ 104, CAMERICA_GOLDENFIVE },
{ 105, STD_EVENT },
{ 106, BTL_SMB3 },
@@ -564,6 +564,28 @@ void nes_cart_slot_device::call_load_ines()
}
break;
+ case UNL_UNROM512:
+ // this mapper also uses mirroring flags differently
+ m_cart->set_four_screen_vram(false);
+ switch (local_options & 0x09)
+ {
+ case 0x00:
+ m_cart->set_mirroring(PPU_MIRROR_HORZ);
+ break;
+ case 0x01:
+ m_cart->set_mirroring(PPU_MIRROR_VERT);
+ break;
+ case 0x08:
+ m_cart->set_mirroring(PPU_MIRROR_LOW);
+ m_cart->set_pcb_ctrl_mirror(true);
+ break;
+ case 0x09:
+ m_cart->set_mirroring(PPU_MIRROR_4SCREEN);
+ m_cart->set_four_screen_vram(true);
+ break;
+ }
+ break;
+
case STD_CNROM:
if (mapper == 185 && !submapper)
{
diff --git a/src/devices/bus/nes/nes_pcb.hxx b/src/devices/bus/nes/nes_pcb.hxx
index b70340e6479..6c893ce105f 100644
--- a/src/devices/bus/nes/nes_pcb.hxx
+++ b/src/devices/bus/nes/nes_pcb.hxx
@@ -309,8 +309,10 @@ static const nes_pcb pcb_list[] =
{ "tf1201", UNL_TF1201 },
{ "unl_cfight", UNL_CITYFIGHT },
{ "nocash_nochr", NOCASH_NOCHR },
- { "nes_action53", BTL_ACTION53 },
- { "nes_2a03pur", BTL_2A03_PURITANS },
+ { "action53", UNL_ACTION53 },
+ { "cufrom", UNL_CUFROM },
+ { "unrom512", UNL_UNROM512 },
+ { "2a03pur", UNL_2A03PURITANS },
{ "ffe3", FFE3_BOARD },
{ "ffe4", FFE4_BOARD },
{ "ffe8", FFE8_BOARD },
diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h
index a207a26e869..5f810e3c6fe 100644
--- a/src/devices/bus/nes/nes_slot.h
+++ b/src/devices/bus/nes/nes_slot.h
@@ -129,8 +129,8 @@ enum
KAY_BOARD, HOSENKAN_BOARD, NITRA_TDA, GOUDER_37017, NANJING_BOARD,
WHIRLWIND_2706, ZEMINA_BOARD,
NOCASH_NOCHR, // homebrew PCB design which uses NTRAM for CHRRAM
- BTL_ACTION53, // homebrew PCB for homebrew multicarts
- BTL_2A03_PURITANS, // homebrew PCB
+ UNL_ACTION53, // homebrew PCB for homebrew multicarts
+ UNL_CUFROM, UNL_UNROM512, UNL_2A03PURITANS, // homebrew PCBs
/* FFE boards, for mappers 6, 8, 17 */
FFE3_BOARD, FFE4_BOARD, FFE8_BOARD, TEST_BOARD,
/* Unsupported (for place-holder boards, with no working emulation) & no-board (at init) */
diff --git a/src/devices/bus/nes/sealie.cpp b/src/devices/bus/nes/sealie.cpp
new file mode 100644
index 00000000000..1e6761486ac
--- /dev/null
+++ b/src/devices/bus/nes/sealie.cpp
@@ -0,0 +1,124 @@
+// license:BSD-3-Clause
+// copyright-holders: kmg, Fabio Priuli
+/***********************************************************************************************************
+
+
+ NES/Famicom cartridge emulation for Sealie Computing and related PCBs
+
+
+ Here we emulate the following homebrew PCBs
+
+ * SEALIE RET-CUFROM [mapper 29]
+ * SEALIE UNROM 512 [mapper 30]
+
+ ***********************************************************************************************************/
+
+
+#include "emu.h"
+#include "sealie.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_CUFROM, nes_cufrom_device, "nes_cufrom", "NES Cart Sealie RET-CUFROM PCB")
+DEFINE_DEVICE_TYPE(NES_UNROM512, nes_unrom512_device, "nes_unrom512", "NES Cart Sealie UNROM 512 PCB")
+
+
+nes_cufrom_device::nes_cufrom_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : nes_nrom_device(mconfig, NES_CUFROM, tag, owner, clock)
+{
+}
+
+nes_unrom512_device::nes_unrom512_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : nes_nrom_device(mconfig, NES_UNROM512, tag, owner, clock)
+{
+}
+
+
+
+void nes_cufrom_device::pcb_reset()
+{
+ prg16_89ab(0);
+ prg16_cdef(m_prg_chunks - 1);
+ chr8(0, CHRRAM);
+}
+
+void nes_unrom512_device::pcb_reset()
+{
+ prg16_89ab(0);
+ prg16_cdef(m_prg_chunks - 1);
+ chr8(0, CHRRAM);
+ if (m_pcb_ctrl_mirror)
+ set_nt_mirroring(PPU_MIRROR_LOW);
+}
+
+
+/*-------------------------------------------------
+ mapper specific handlers
+ -------------------------------------------------*/
+
+/*-------------------------------------------------
+
+ Sealie RET-CUFROM board
+
+ Games: Glider (only?)
+
+ This homebrew mapper supports 8x16k PRG banks at 0x8000,
+ 8k WRAM at 0x6000, and 4x8k VRAM banks. PRG is stored on
+ flash ROM, though unlike mapper 30 it doesn't appear to
+ be self-flashable, only through an external tool.
+
+ iNES: mapper 29
+
+ In MAME: Supported.
+
+ -------------------------------------------------*/
+
+void nes_cufrom_device::write_h(offs_t offset, u8 data)
+{
+ LOG_MMC(("cufrom write_h, offset: %04x, data: %02x\n", offset, data));
+
+ prg16_89ab((data >> 2) & 0x07);
+ chr8(data & 0x03, CHRRAM);
+}
+
+/*-------------------------------------------------
+
+ Sealie UNROM 512 board
+
+ Games: Battle Kid 1 & 2, E.T., many more
+
+ This board has several variations and jumper configurations.
+ Currently we only support the Sealie nonflashable config
+ with 32x16k PRG banks at 0x8000, 4x8k VRAM, and three
+ mirroring configs (H, V, or PCB selected 1-screen modes).
+
+ iNES: mapper 30
+
+ In MAME: Preliminary partial support.
+
+ -------------------------------------------------*/
+
+void nes_unrom512_device::write_h(offs_t offset, u8 data)
+{
+ LOG_MMC(("unrom512 write_h, offset: %04x, data: %02x\n", offset, data));
+
+ // this pcb is subject to bus conflict in its nonflashable configuration
+ data = account_bus_conflict(offset, data);
+
+ if (m_pcb_ctrl_mirror)
+ set_nt_mirroring(BIT(data, 7) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
+ prg16_89ab(data & 0x1f);
+ chr8((data >> 5) & 0x03, CHRRAM);
+}
diff --git a/src/devices/bus/nes/sealie.h b/src/devices/bus/nes/sealie.h
new file mode 100644
index 00000000000..1892bf45ff2
--- /dev/null
+++ b/src/devices/bus/nes/sealie.h
@@ -0,0 +1,43 @@
+// license:BSD-3-Clause
+// copyright-holders: kmg, Fabio Priuli
+#ifndef MAME_BUS_NES_SEALIE_H
+#define MAME_BUS_NES_SEALIE_H
+
+#pragma once
+
+#include "nxrom.h"
+
+
+// ======================> nes_cufrom_device
+
+class nes_cufrom_device : public nes_nrom_device
+{
+public:
+ // construction/destruction
+ nes_cufrom_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+
+ virtual void write_h(offs_t offset, u8 data) override;
+
+ virtual void pcb_reset() override;
+};
+
+
+// ======================> nes_unrom512_device
+
+class nes_unrom512_device : public nes_nrom_device
+{
+public:
+ // construction/destruction
+ nes_unrom512_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+
+ virtual void write_h(offs_t offset, u8 data) override;
+
+ virtual void pcb_reset() override;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(NES_CUFROM, nes_cufrom_device)
+DECLARE_DEVICE_TYPE(NES_UNROM512, nes_unrom512_device)
+
+#endif // MAME_BUS_NES_SEALIE_H
diff --git a/src/mame/machine/nes.cpp b/src/mame/machine/nes.cpp
index 9dd876039e6..43f55e607d0 100644
--- a/src/mame/machine/nes.cpp
+++ b/src/mame/machine/nes.cpp
@@ -72,7 +72,7 @@ void nes_state::machine_start()
// install additional handlers (read_h, read_ex, write_ex)
if (m_cartslot->get_pcb_id() == STD_EXROM || m_cartslot->get_pcb_id() == STD_NROM368 || m_cartslot->get_pcb_id() == STD_DISKSYS
|| m_cartslot->get_pcb_id() == GG_NROM || m_cartslot->get_pcb_id() == CAMERICA_ALADDIN || m_cartslot->get_pcb_id() == SUNSOFT_DCS
- || m_cartslot->get_pcb_id() == BANDAI_DATACH || m_cartslot->get_pcb_id() == BANDAI_KARAOKE || m_cartslot->get_pcb_id() == BTL_2A03_PURITANS || m_cartslot->get_pcb_id() == AVE_MAXI15
+ || 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() == KAISER_KS7022 || m_cartslot->get_pcb_id() == KAISER_KS7031 || m_cartslot->get_pcb_id() == KAISER_KS7037 || 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
--
cgit v1.2.3