summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author 0kmg <9137159+0kmg@users.noreply.github.com>2021-07-19 22:49:56 -0800
committer GitHub <noreply@github.com>2021-07-20 16:49:56 +1000
commitd9b14f720c03c31c1851e988ad0528ead9bad55b (patch)
tree610deedd0075fa64ecf7b61fa72a718a99ca5f8d
parentde881afb9e9384dd7d0e3e3523f4c1c02df1a074 (diff)
bus/nes: Added support for a Batman bootleg. (#8316)
New working software list additions (nes.xml) ----------------------------------- Batman - The Video Game (pirate)
-rw-r--r--hash/nes.xml16
-rw-r--r--src/devices/bus/nes/bootleg.cpp76
-rw-r--r--src/devices/bus/nes/bootleg.h26
-rw-r--r--src/devices/bus/nes/nes_carts.cpp1
-rw-r--r--src/devices/bus/nes/nes_ines.hxx2
-rw-r--r--src/devices/bus/nes/nes_pcb.hxx1
-rw-r--r--src/devices/bus/nes/nes_slot.h4
7 files changed, 122 insertions, 4 deletions
diff --git a/hash/nes.xml b/hash/nes.xml
index abb56824c85..2e583a5b4bd 100644
--- a/hash/nes.xml
+++ b/hash/nes.xml
@@ -61818,6 +61818,22 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx
</part>
</software>
+ <software name="batmanfs" cloneof="batman">
+ <description>Batman - The Video Game (pirate)</description>
+ <year>199?</year>
+ <publisher>&lt;pirate&gt;</publisher>
+ <info name="usage" value="Built-in level select at title screen. Press in sequence: A, B, B, followed by A 1 to 5 times for stages 1-1, 2-1, 3-1, 4-1, and 5-1, respectively."/>
+ <part name="cart" interface="nes_cart">
+ <feature name="slot" value="batmanfs" />
+ <dataarea name="prg" size="131072">
+ <rom name="batmanfs.prg" size="131072" crc="9b6c71d5" sha1="29dddb0bb280f742cecc062d382b20eb22e74b5d" status="baddump" />
+ </dataarea>
+ <dataarea name="chr" size="131072">
+ <rom name="batmanfs.chr" size="131072" crc="f3b41c18" sha1="04c7ccb51c0a2b211c84289650ebba448d6f5413" status="baddump" />
+ </dataarea>
+ </part>
+ </software>
+
<software name="beatnbox">
<description>Beat n Box (Kor)</description>
<year>19??</year>
diff --git a/src/devices/bus/nes/bootleg.cpp b/src/devices/bus/nes/bootleg.cpp
index f9c8340a635..4b23fdab6c3 100644
--- a/src/devices/bus/nes/bootleg.cpp
+++ b/src/devices/bus/nes/bootleg.cpp
@@ -48,6 +48,7 @@ DEFINE_DEVICE_TYPE(NES_SMB2JA, nes_smb2ja_device, "nes_smb2ja", "N
DEFINE_DEVICE_TYPE(NES_SMB2JB, nes_smb2jb_device, "nes_smb2jb", "NES Cart Super Mario Bros. 2 Jpn (Alt 2) PCB")
DEFINE_DEVICE_TYPE(NES_0353, nes_0353_device, "nes_0353", "NES Cart 0353 PCB")
DEFINE_DEVICE_TYPE(NES_09034A, nes_09034a_device, "nes_09034a", "NES Cart 09-034A PCB")
+DEFINE_DEVICE_TYPE(NES_BATMANFS, nes_batmanfs_device, "nes_batmanfs", "NES Cart Batman Pirate PCB")
DEFINE_DEVICE_TYPE(NES_PALTHENA, nes_palthena_device, "nes_palthena", "NES Cart Palthena no Kagami Pirate PCB")
DEFINE_DEVICE_TYPE(NES_TOBIDASE, nes_tobidase_device, "nes_tobidase", "NES Cart Tobidase Daisakusen Pirate PCB")
DEFINE_DEVICE_TYPE(NES_DH08, nes_dh08_device, "nes_dh08", "NES Cart DH-08 Pirate PCB")
@@ -120,6 +121,11 @@ nes_09034a_device::nes_09034a_device(const machine_config &mconfig, const char *
{
}
+nes_batmanfs_device::nes_batmanfs_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : nes_nrom_device(mconfig, NES_BATMANFS, tag, owner, clock), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr)
+{
+}
+
nes_palthena_device::nes_palthena_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_PALTHENA, tag, owner, clock), m_reg(0)
{
@@ -301,6 +307,25 @@ void nes_smb3p_device::pcb_reset()
m_irq_count = 0;
}
+void nes_batmanfs_device::device_start()
+{
+ common_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));
+}
+
+void nes_batmanfs_device::pcb_reset()
+{
+ prg32((m_prg_chunks >> 1) - 1); // Last 8K bank is fixed, the rest are swappable
+ chr8(0, CHRROM);
+
+ m_irq_enable = 0;
+ m_irq_count = 0;
+}
+
void nes_btl_dn_device::device_start()
{
common_start();
@@ -844,7 +869,6 @@ uint8_t nes_asn_device::read_m(offs_t offset)
return m_prg[((m_latch * 0x2000) + (offset & 0x1fff)) & (m_prg_size - 1)];
}
-
/*-------------------------------------------------
BTL-SMB3
@@ -1300,6 +1324,56 @@ uint8_t nes_09034a_device::read_m(offs_t offset)
/*-------------------------------------------------
+ BTL-BATMANFS
+
+ Games: Batman "Fine Studio" pirate
+
+ NES 2.0: mapper 417
+
+ In MAME: Supported.
+
+ -------------------------------------------------*/
+
+void nes_batmanfs_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+{
+ if (id == TIMER_IRQ)
+ {
+ // 10-bit counter does not stop when interrupts are disabled
+ m_irq_count = (m_irq_count + 1) & 0x3ff;
+ if (m_irq_enable && !m_irq_count)
+ set_irq_line(ASSERT_LINE);
+ }
+}
+
+void nes_batmanfs_device::write_h(offs_t offset, u8 data)
+{
+ LOG_MMC(("batmanfs write_h, offset: %04x, data: %02x\n", offset, data));
+ switch (offset & 0x70)
+ {
+ case 0x00:
+ if ((offset & 0x03) != 0x03)
+ prg8_x(offset & 0x03, data & 0x0f);
+ break;
+ case 0x10:
+ case 0x20:
+ chr1_x((offset & 0x03) + 4 * BIT(offset, 5), data, CHRROM);
+ break;
+ case 0x30:
+ m_irq_enable = 1;
+ m_irq_count = 0;
+ break;
+ case 0x40:
+ m_irq_enable = 0;
+ set_irq_line(CLEAR_LINE);
+ break;
+ case 0x50:
+ set_nt_page(offset & 0x03, CIRAM, data & 1, 1);
+ break;
+ }
+}
+
+/*-------------------------------------------------
+
BTL-PALTHENA
Games: Palthena no Kagami (FDS conversion)
diff --git a/src/devices/bus/nes/bootleg.h b/src/devices/bus/nes/bootleg.h
index 1e09064b04a..8d2e9c54ac2 100644
--- a/src/devices/bus/nes/bootleg.h
+++ b/src/devices/bus/nes/bootleg.h
@@ -275,6 +275,31 @@ private:
};
+// ======================> nes_batmanfs_device
+
+class nes_batmanfs_device : public nes_nrom_device
+{
+public:
+ // construction/destruction
+ nes_batmanfs_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;
+ int m_irq_enable;
+
+ static const device_timer_id TIMER_IRQ = 0;
+ emu_timer *irq_timer;
+};
+
+
// ======================> nes_palthena_device
class nes_palthena_device : public nes_nrom_device
@@ -610,6 +635,7 @@ DECLARE_DEVICE_TYPE(NES_SMB2JA, nes_smb2ja_device)
DECLARE_DEVICE_TYPE(NES_SMB2JB, nes_smb2jb_device)
DECLARE_DEVICE_TYPE(NES_0353, nes_0353_device)
DECLARE_DEVICE_TYPE(NES_09034A, nes_09034a_device)
+DECLARE_DEVICE_TYPE(NES_BATMANFS, nes_batmanfs_device)
DECLARE_DEVICE_TYPE(NES_PALTHENA, nes_palthena_device)
DECLARE_DEVICE_TYPE(NES_TOBIDASE, nes_tobidase_device)
DECLARE_DEVICE_TYPE(NES_DH08, nes_dh08_device)
diff --git a/src/devices/bus/nes/nes_carts.cpp b/src/devices/bus/nes/nes_carts.cpp
index 8754db26256..cb4291f67ca 100644
--- a/src/devices/bus/nes/nes_carts.cpp
+++ b/src/devices/bus/nes/nes_carts.cpp
@@ -303,6 +303,7 @@ void nes_cart(device_slot_interface &device)
device.option_add_internal("smb2jb", NES_SMB2JB);
device.option_add_internal("btl_0353", NES_0353); // used by Lucky (Roger) Rabbit FDS conversion
device.option_add_internal("09034a", NES_09034A);
+ device.option_add_internal("batmanfs", NES_BATMANFS);
device.option_add_internal("palthena", NES_PALTHENA); // used by Palthena no Kagami FDS conversion
device.option_add_internal("tobidase", NES_TOBIDASE); // mapper 120
device.option_add_internal("mmalee2", NES_MMALEE); // mapper 55
diff --git a/src/devices/bus/nes/nes_ines.hxx b/src/devices/bus/nes/nes_ines.hxx
index 751afedf2a2..559333d81e3 100644
--- a/src/devices/bus/nes/nes_ines.hxx
+++ b/src/devices/bus/nes/nes_ines.hxx
@@ -451,7 +451,7 @@ static const nes_mmc mmc_list[] =
// 414 9999999-in-1 multicart
{ 415, BTL_0353 }, // Lucky (Roger) Rabbit FDS conversion
// 416 4-in-1 that includes mapper 50 SMB2j pirate
- // 417 "Fine Studio" Batman bootleg
+ { 417, BTL_BATMANFS }, // "Fine Studio" Batman bootleg
// { 418, UNL_LH42 } // Highway Star alt FDS conversion
// 419 VT03 PnPs
// 420 Kasheng A971210 board
diff --git a/src/devices/bus/nes/nes_pcb.hxx b/src/devices/bus/nes/nes_pcb.hxx
index b4f84f8bd2d..a2ad31b2118 100644
--- a/src/devices/bus/nes/nes_pcb.hxx
+++ b/src/devices/bus/nes/nes_pcb.hxx
@@ -209,6 +209,7 @@ static const nes_pcb pcb_list[] =
{ "smb2jb", BTL_SMB2JB },
{ "btl_0353", BTL_0353 },
{ "09034a", BTL_09034A },
+ { "batmanfs", BTL_BATMANFS },
{ "palthena", BTL_PALTHENA },
{ "tobidase", BTL_TOBIDASE }, // mapper 120
{ "dbz5", REXSOFT_DBZ5 },
diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h
index 10f0f131ff3..a2ce8b2da4e 100644
--- a/src/devices/bus/nes/nes_slot.h
+++ b/src/devices/bus/nes/nes_slot.h
@@ -108,10 +108,10 @@ enum
UNL_STUDYNGAME, UNL_603_5052, UNL_H2288, UNL_2708,
UNL_MALISB, UNL_AC08, UNL_A9746, UNL_WORLDHERO,
UNL_43272, UNL_TF1201, UNL_CITYFIGHT, UNL_NINJARYU, UNL_EH8813A, UNL_RT01,
- /* Bootleg boards */
+ // Bootleg boards
BTL_SMB2JA, BTL_MARIOBABY, BTL_AISENSHINICOL, BTL_TOBIDASE,
BTL_SMB2JB, BTL_09034A, BTL_SMB3, BTL_SBROS11, BTL_DRAGONNINJA,
- BTL_PIKACHUY2K, BTL_SHUIGUAN, BTL_0353, BTL_PALTHENA,
+ BTL_PIKACHUY2K, BTL_SHUIGUAN, BTL_0353, BTL_BATMANFS, BTL_PALTHENA,
// Kaiser
KAISER_KS202, KAISER_KS7010, KAISER_KS7012, KAISER_KS7013B,
KAISER_KS7016, KAISER_KS7016B, KAISER_KS7017, KAISER_KS7021A,