summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices
diff options
context:
space:
mode:
author 0kmg <9137159+0kmg@users.noreply.github.com>2021-10-14 06:57:26 -0800
committer GitHub <noreply@github.com>2021-10-14 10:57:26 -0400
commite63b7a9ab9080b01d8480f2e1f59ed2ec3c91056 (patch)
tree4e2c8d57de49be3558f087e346e5c9be1e008f5e /src/devices
parent0c7a624ce90aa426813f4a5ff5cc2cfe4d91e924 (diff)
bus/nes: Added a couple bootleg games using VRC2 clone hardware. (#8699)
- Also convert 900218 board from VRC4 clone to VRC2 clone. New working software list additions (nes.xml) ----------------------------------- Batman - The Video Game (Brazil, pirate) [Fisher] Fudou Myouou Den (pirate) [anonymous]
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/bus/nes/konami.cpp7
-rw-r--r--src/devices/bus/nes/konami.h3
-rw-r--r--src/devices/bus/nes/nes_carts.cpp2
-rw-r--r--src/devices/bus/nes/nes_ines.hxx6
-rw-r--r--src/devices/bus/nes/nes_pcb.hxx2
-rw-r--r--src/devices/bus/nes/nes_slot.h6
-rw-r--r--src/devices/bus/nes/vrc_clones.cpp148
-rw-r--r--src/devices/bus/nes/vrc_clones.h56
8 files changed, 218 insertions, 12 deletions
diff --git a/src/devices/bus/nes/konami.cpp b/src/devices/bus/nes/konami.cpp
index e91e4318132..e10b7e9ce7a 100644
--- a/src/devices/bus/nes/konami.cpp
+++ b/src/devices/bus/nes/konami.cpp
@@ -55,8 +55,13 @@ nes_konami_vrc1_device::nes_konami_vrc1_device(const machine_config &mconfig, co
{
}
+nes_konami_vrc2_device::nes_konami_vrc2_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_nrom_device(mconfig, type, tag, owner, clock), m_latch(0)
+{
+}
+
nes_konami_vrc2_device::nes_konami_vrc2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_VRC2, tag, owner, clock), m_latch(0)
+ : nes_konami_vrc2_device(mconfig, NES_VRC2, tag, owner, clock)
{
}
diff --git a/src/devices/bus/nes/konami.h b/src/devices/bus/nes/konami.h
index 5c3383b58ee..03c44948e7e 100644
--- a/src/devices/bus/nes/konami.h
+++ b/src/devices/bus/nes/konami.h
@@ -46,6 +46,9 @@ public:
virtual void pcb_reset() override;
protected:
+ // construction/destruction
+ nes_konami_vrc2_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
// device-level overrides
virtual void device_start() override;
diff --git a/src/devices/bus/nes/nes_carts.cpp b/src/devices/bus/nes/nes_carts.cpp
index c11cedcc338..604cb66a90d 100644
--- a/src/devices/bus/nes/nes_carts.cpp
+++ b/src/devices/bus/nes/nes_carts.cpp
@@ -296,11 +296,13 @@ void nes_cart(device_slot_interface &device)
device.option_add_internal("mk2", NES_MK2);
device.option_add_internal("unl_43272", NES_43272); // used in Gaau Hok Gwong Cheung
device.option_add_internal("tf1201", NES_TF1201);
+ device.option_add_internal("th21311", NES_TH21311);
device.option_add_internal("unl_cfight", NES_CITYFIGHT); // used by City Fighter IV
device.option_add_internal("ninjaryu", NES_NINJARYU); // used by Ninja Ryukenden Chinese
device.option_add_internal("unl_eh8813a", NES_EH8813A); // used by Dr. Mario II
device.option_add_internal("zemina", NES_ZEMINA); // mapper 190 - Magic Kid GooGoo
// misc bootleg boards
+ device.option_add_internal("ax40g", NES_AX40G);
device.option_add_internal("ax5705", NES_AX5705);
device.option_add_internal("sc127", NES_SC127);
device.option_add_internal("mariobaby", NES_MARIOBABY);
diff --git a/src/devices/bus/nes/nes_ines.hxx b/src/devices/bus/nes/nes_ines.hxx
index 31e4e58c304..b6fed4d957a 100644
--- a/src/devices/bus/nes/nes_ines.hxx
+++ b/src/devices/bus/nes/nes_ines.hxx
@@ -343,7 +343,7 @@ static const nes_mmc mmc_list[] =
{ 305, KAISER_KS7031 }, // Dracula II FDS conversion
{ 306, KAISER_KS7016 }, // Exciting Basket FDS conversion
{ 307, KAISER_KS7037 }, // Metroid FDS conversion
- // 308 Batman (Sunsoft) pirate on VRC2 clone hardware
+ { 308, UNL_TH21311 }, // Batman (Sunsoft) pirate on VRC2 clone hardware
{ 309, UNL_LH51 }, // Ai Senshi Nicol alt FDS conversion
// 310 variant of mapper 125?
// 311 Unused (previously assigned in error to a bad SMB2 pirate dump)
@@ -490,9 +490,9 @@ static const nes_mmc mmc_list[] =
{ 524, BTL_900218 }, // Lord of King pirate
{ 525, KAISER_KS7021A }, // GetsuFumaDen pirate (and maybe a Contra?)
// 526 sangochu clone not yet in nes.xml?
- // 527 demnswrd/fudomyod clone not yet in nes.xml
+ { 527, UNL_AX40G }, // Fudou Myouou Den pirate
// 528 1995 New Series Super 2-in-1 multicart not in nes.xml
- // 529 Datach Dragon Ball Z bootleg?
+ { 529, UNL_T230 }, // Datach Dragon Ball Z IV bootleg
{ 530, UNL_AX5705 }, // Super Mario Bros Pocker Mali
// 531 Used by Asder PC-95 Famicom clone built into a keyboard
// 532 Emulator only mapper for Chinese version of sangoht2?
diff --git a/src/devices/bus/nes/nes_pcb.hxx b/src/devices/bus/nes/nes_pcb.hxx
index a3fe7f9140d..4af5d15e90b 100644
--- a/src/devices/bus/nes/nes_pcb.hxx
+++ b/src/devices/bus/nes/nes_pcb.hxx
@@ -204,6 +204,7 @@ static const nes_pcb pcb_list[] =
{ "mk2", UNL_MK2 },
{ "zemina", ZEMINA_BOARD },
// misc bootleg boards
+ { "ax40g", UNL_AX40G },
{ "ax5705", UNL_AX5705 },
{ "sc127", UNL_SC127 },
{ "mariobaby", BTL_MARIOBABY },
@@ -367,6 +368,7 @@ static const nes_pcb pcb_list[] =
{ "rt01", UNL_RT01 }, // Russian Test Cart
{ "unl_43272", UNL_43272 },
{ "tf1201", UNL_TF1201 },
+ { "th21311", UNL_TH21311 },
{ "unl_cfight", UNL_CITYFIGHT },
{ "ninjaryu", UNL_NINJARYU },
{ "unl_eh8813a", UNL_EH8813A }, // Dr. Mario II
diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h
index 27a7a337169..6ac74ca1f63 100644
--- a/src/devices/bus/nes/nes_slot.h
+++ b/src/devices/bus/nes/nes_slot.h
@@ -109,12 +109,12 @@ enum
BMC_K1029, BMC_K3006, BMC_K3033, BMC_K3036, BMC_K3046, BMC_SA005A, BMC_TJ03,
BMC_RESETSXROM, BMC_RESETTXROM, BMC_TECHLINE9IN1,
// Unlicensed
- UNL_8237, UNL_8237A, UNL_CC21, UNL_AX5705, UNL_KN42, UNL_KOF97,
- UNL_N625092, UNL_SC127, UNL_SMB2J, UNL_T230, UNL_MMALEE,
+ UNL_8237, UNL_8237A, UNL_CC21, UNL_AX40G, UNL_AX5705, UNL_KN42,
+ UNL_KOF97, UNL_N625092, UNL_SC127, UNL_SMB2J, UNL_T230, UNL_MMALEE,
UNL_UXROM, UNL_MK2, UNL_XIAOZY, UNL_KOF96, UNL_FS6,
UNL_SF3, UNL_RACERMATE, UNL_EDU2K,
UNL_STUDYNGAME, UNL_603_5052, UNL_H2288, UNL_158B, UNL_2708,
- UNL_MALISB, UNL_AC08, UNL_A9746, UNL_43272, UNL_TF1201,
+ UNL_MALISB, UNL_AC08, UNL_A9746, UNL_43272, UNL_TF1201, UNL_TH21311,
UNL_CITYFIGHT, UNL_NINJARYU, UNL_EH8813A, UNL_RT01,
// Bootleg boards
BTL_0353, BTL_09034A, BTL_900218, BTL_AISENSHINICOL, BTL_BATMANFS,
diff --git a/src/devices/bus/nes/vrc_clones.cpp b/src/devices/bus/nes/vrc_clones.cpp
index 5d6c06f9238..5b373db74b5 100644
--- a/src/devices/bus/nes/vrc_clones.cpp
+++ b/src/devices/bus/nes/vrc_clones.cpp
@@ -29,14 +29,21 @@
//-------------------------------------------------
DEFINE_DEVICE_TYPE(NES_900218, nes_900218_device, "nes_900218", "NES Cart 900218 PCB")
+DEFINE_DEVICE_TYPE(NES_AX40G, nes_ax40g_device, "nes_ax40g", "NES Cart UNL-AX-40G PCB")
DEFINE_DEVICE_TYPE(NES_AX5705, nes_ax5705_device, "nes_ax5705", "NES Cart AX5705 PCB")
DEFINE_DEVICE_TYPE(NES_CITYFIGHT, nes_cityfight_device, "nes_cityfight", "NES Cart City Fighter PCB")
DEFINE_DEVICE_TYPE(NES_SHUIGUAN, nes_shuiguan_device, "nes_shuiguan", "NES Cart Shui Guan Pipe Pirate PCB")
DEFINE_DEVICE_TYPE(NES_TF1201, nes_tf1201_device, "nes_tf1201", "NES Cart UNL-TF1201 PCB")
+DEFINE_DEVICE_TYPE(NES_TH21311, nes_th21311_device, "nes_th21311", "NES Cart UNL-TH2131-1 PCB")
nes_900218_device::nes_900218_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
- : nes_konami_vrc4_device(mconfig, NES_900218, tag, owner, clock)
+ : nes_konami_vrc2_device(mconfig, NES_900218, tag, owner, clock), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr)
+{
+}
+
+nes_ax40g_device::nes_ax40g_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : nes_konami_vrc2_device(mconfig, NES_AX40G, tag, owner, clock)
{
}
@@ -60,13 +67,39 @@ nes_tf1201_device::nes_tf1201_device(const machine_config &mconfig, const char *
{
}
+nes_th21311_device::nes_th21311_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : nes_konami_vrc2_device(mconfig, NES_TH21311, tag, owner, clock), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr)
+{
+}
+
void nes_900218_device::device_start()
{
- nes_konami_vrc4_device::device_start();
+ nes_konami_vrc2_device::device_start();
+ irq_timer = timer_alloc(TIMER_IRQ);
+ irq_timer->adjust(attotime::zero, 0, clocks_to_attotime(1));
- // VRC4 pins 3 and 4
+ save_item(NAME(m_irq_enable));
+ save_item(NAME(m_irq_count));
+
+ // VRC2 pins 3 and 4
+ m_vrc_ls_prg_a = 1; // A1
+ m_vrc_ls_prg_b = 0; // A0
+}
+
+void nes_900218_device::pcb_reset()
+{
+ nes_konami_vrc2_device::pcb_reset();
+ m_irq_enable = 0;
+ m_irq_count = 0;
+}
+
+void nes_ax40g_device::device_start()
+{
+ nes_konami_vrc2_device::device_start();
+
+ // VRC2 pins 3 and 4
m_vrc_ls_prg_a = 1; // A1
m_vrc_ls_prg_b = 0; // A0
}
@@ -114,6 +147,29 @@ void nes_tf1201_device::device_start()
m_vrc_ls_prg_b = 1; // A1
}
+void nes_th21311_device::device_start()
+{
+ nes_konami_vrc2_device::device_start();
+ irq_timer = timer_alloc(TIMER_IRQ);
+ irq_timer->adjust(attotime::zero, 0, clocks_to_attotime(1));
+
+ save_item(NAME(m_irq_enable));
+ save_item(NAME(m_irq_count));
+ save_item(NAME(m_irq_latch));
+
+ // VRC2 pins 3 and 4
+ m_vrc_ls_prg_a = 1; // A1
+ m_vrc_ls_prg_b = 0; // A0
+}
+
+void nes_th21311_device::pcb_reset()
+{
+ nes_konami_vrc2_device::pcb_reset();
+ m_irq_enable = 0;
+ m_irq_count = 0;
+ m_irq_latch = 0;
+}
+
/*-------------------------------------------------
@@ -166,7 +222,35 @@ void nes_900218_device::write_h(offs_t offset, u8 data)
}
}
else
- nes_konami_vrc4_device::write_h(offset, data);
+ nes_konami_vrc2_device::write_h(offset, data);
+}
+
+/*-------------------------------------------------
+
+ Board UNL-AX-40G
+
+ Games: Fudou Myouou Den pirate
+
+ VRC2 clone that supports extra single screen mirroring
+ modes seen in the original Taito X1-005 board.
+
+ NES 2.0: mapper 527
+
+ In MAME: Supported.
+
+ -------------------------------------------------*/
+
+void nes_ax40g_device::write_h(offs_t offset, u8 data)
+{
+ LOG_MMC(("ax40g write_h, offset: %04x, data: %02x\n", offset, data));
+
+ nes_konami_vrc2_device::write_h(offset, data);
+
+ if ((offset & 0x7001) == 0x3001)
+ {
+ set_nt_page(offset & 0x02, CIRAM, BIT(data, 3), 1);
+ set_nt_page((offset & 0x02) + 1, CIRAM, BIT(data, 3), 1);
+ }
}
/*-------------------------------------------------
@@ -317,6 +401,62 @@ void nes_tf1201_device::write_h(offs_t offset, u8 data)
nes_konami_vrc4_device::write_h(offset, data);
}
+/*-------------------------------------------------
+
+ Board UNL-TH2131-1
+
+ Games: Batman pirate (Dynacon)
+
+ VRC2 clone with an added IRQ timer. A selectable 4-bit
+ latch controls the duration as it is decremented
+ relative to another internal 12-bit counter.
+
+ NES 2.0: mapper 308
+
+ In MAME: Supported.
+
+ -------------------------------------------------*/
+
+void nes_th21311_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+{
+ if (id == TIMER_IRQ)
+ {
+ if (m_irq_enable)
+ {
+ m_irq_count = (m_irq_count + 1) & 0xfff; // 12-bit counter
+ if (m_irq_count == 0x800)
+ m_irq_latch--;
+ if (!m_irq_latch && m_irq_count < 0x800)
+ set_irq_line(ASSERT_LINE);
+ }
+ }
+}
+
+void nes_th21311_device::write_h(offs_t offset, u8 data)
+{
+ LOG_MMC(("th21311 write_h, offset: %04x, data: %02x\n", offset, data));
+
+ if ((offset & 0x7000) == 0x7000)
+ {
+ switch (offset & 3)
+ {
+ case 0:
+ m_irq_enable = 0;
+ m_irq_count = 0;
+ set_irq_line(CLEAR_LINE);
+ break;
+ case 1:
+ m_irq_enable = 1;
+ break;
+ case 3:
+ m_irq_latch = data >> 4;
+ break;
+ }
+ }
+ else
+ nes_konami_vrc2_device::write_h(offset, data);
+}
+
/*-------------------------------------------------
diff --git a/src/devices/bus/nes/vrc_clones.h b/src/devices/bus/nes/vrc_clones.h
index 8ad84e629ca..1e479139f9f 100644
--- a/src/devices/bus/nes/vrc_clones.h
+++ b/src/devices/bus/nes/vrc_clones.h
@@ -10,7 +10,7 @@
// ======================> nes_900218_device
-class nes_900218_device : public nes_konami_vrc4_device
+class nes_900218_device : public nes_konami_vrc2_device
{
public:
// construction/destruction
@@ -18,10 +18,35 @@ public:
virtual void write_h(offs_t offset, u8 data) override;
+ virtual void pcb_reset() override;
+
protected:
// device-level overrides
virtual void device_start() override;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
+private:
+ u16 m_irq_count;
+ int m_irq_enable;
+
+ static const device_timer_id TIMER_IRQ = 0;
+ emu_timer *irq_timer;
+};
+
+
+// ======================> nes_ax40g_device
+
+class nes_ax40g_device : public nes_konami_vrc2_device
+{
+public:
+ // construction/destruction
+ nes_ax40g_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+
+ virtual void write_h(offs_t offset, u8 data) override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -96,11 +121,40 @@ protected:
};
+// ======================> nes_th21311_device
+
+class nes_th21311_device : public nes_konami_vrc2_device
+{
+public:
+ // construction/destruction
+ nes_th21311_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;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
+private:
+ u16 m_irq_count;
+ u8 m_irq_latch;
+ int m_irq_enable;
+
+ static const device_timer_id TIMER_IRQ = 0;
+ emu_timer *irq_timer;
+};
+
+
// device type definition
DECLARE_DEVICE_TYPE(NES_900218, nes_900218_device)
+DECLARE_DEVICE_TYPE(NES_AX40G, nes_ax40g_device)
DECLARE_DEVICE_TYPE(NES_AX5705, nes_ax5705_device)
DECLARE_DEVICE_TYPE(NES_CITYFIGHT, nes_cityfight_device)
DECLARE_DEVICE_TYPE(NES_SHUIGUAN, nes_shuiguan_device)
DECLARE_DEVICE_TYPE(NES_TF1201, nes_tf1201_device)
+DECLARE_DEVICE_TYPE(NES_TH21311, nes_th21311_device)
#endif // MAME_BUS_NES_VRC_CLONES_H