summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/nes/pirate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/nes/pirate.cpp')
-rw-r--r--src/devices/bus/nes/pirate.cpp174
1 files changed, 171 insertions, 3 deletions
diff --git a/src/devices/bus/nes/pirate.cpp b/src/devices/bus/nes/pirate.cpp
index 667e5329ef6..f1d825322d5 100644
--- a/src/devices/bus/nes/pirate.cpp
+++ b/src/devices/bus/nes/pirate.cpp
@@ -49,6 +49,8 @@ DEFINE_DEVICE_TYPE(NES_WHERO, nes_whero_device, "nes_whero", "
DEFINE_DEVICE_TYPE(NES_43272, nes_43272_device, "nes_43272", "NES Cart UNL-43272 PCB")
DEFINE_DEVICE_TYPE(NES_TF1201, nes_tf1201_device, "nes_tf1201", "NES Cart UNL-TF1201 PCB")
DEFINE_DEVICE_TYPE(NES_CITYFIGHT, nes_cityfight_device, "nes_cityfight", "NES Cart City Fighter PCB")
+DEFINE_DEVICE_TYPE(NES_NINJARYU, nes_ninjaryu_device, "nes_ninjaryu", "NES Cart Ninja Ryukenden Chinese PCB")
+DEFINE_DEVICE_TYPE(NES_EH8813A, nes_eh8813a_device, "nes_eh8813a", "NES Cart UNL-EH8813A PCB")
nes_agci_device::nes_agci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
@@ -126,6 +128,16 @@ nes_cityfight_device::nes_cityfight_device(const machine_config &mconfig, const
{
}
+nes_ninjaryu_device::nes_ninjaryu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : nes_nrom_device(mconfig, NES_NINJARYU, tag, owner, clock)
+{
+}
+
+nes_eh8813a_device::nes_eh8813a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : nes_nrom_device(mconfig, NES_EH8813A, tag, owner, clock), m_dipsetting(0), m_latch(0)
+{
+}
+
@@ -405,6 +417,41 @@ void nes_cityfight_device::pcb_reset()
m_irq_count = 0;
}
+void nes_ninjaryu_device::device_start()
+{
+ common_start();
+ save_item(NAME(m_reg));
+}
+
+void nes_ninjaryu_device::pcb_reset()
+{
+ m_reg[0] = 0x0f;
+ m_reg[1] = m_reg[2] = m_reg[3] = 0;
+
+ set_nt_mirroring(PPU_MIRROR_HORZ);
+ update_prg();
+ update_chr();
+}
+
+void nes_eh8813a_device::device_start()
+{
+ common_start();
+ save_item(NAME(m_dipsetting));
+ save_item(NAME(m_latch));
+}
+
+void nes_eh8813a_device::pcb_reset()
+{
+ m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
+ prg16_89ab(0);
+ prg16_89ab(m_prg_chunks - 1);
+ chr8(0, m_chr_source);
+ set_nt_mirroring(PPU_MIRROR_VERT);
+
+ m_dipsetting = 0; // no means to adjust cart DIPs - unimplemented
+ m_latch = 0;
+}
+
/*-------------------------------------------------
@@ -571,7 +618,7 @@ void nes_futuremedia_device::write_h(offs_t offset, uint8_t data)
break;
case 0x5000:
- set_nt_mirroring(BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x4001:
@@ -903,7 +950,7 @@ void nes_mk2_device::write_m(offs_t offset, uint8_t data)
/*-------------------------------------------------
- UNL-WOLRDHERO board emulation
+ UNL-WORLDHERO board emulation
iNES:
@@ -1069,7 +1116,7 @@ void nes_tf1201_device::write_h(offs_t offset, uint8_t data)
update_prg();
break;
case 0x1000:
- set_nt_mirroring(BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x1001:
m_swap = data & 0x03;
@@ -1219,6 +1266,127 @@ void nes_cityfight_device::write_h(offs_t offset, uint8_t data)
}
+/*-------------------------------------------------
+
+ UNL-NINJARYU
+
+ Games: Ninja Ryukenden Chinese
+
+ This board is mentioned on the NesDev page describing
+ mapper 111, which used to be assigned to this. It has
+ registers similar to MMC1 but without the need to write to
+ them serially. The one existing game has 256K CHR, so this
+ must have at least 1 more bit for CHR banking. Other differences?
+
+ In MAME: Preliminary supported.
+
+ -------------------------------------------------*/
+
+void nes_ninjaryu_device::update_prg()
+{
+ if (!BIT(m_reg[0], 3))
+ prg32((m_reg[3] >> 1) & 0x07); // 32K mode
+ else if (BIT(m_reg[0], 2))
+ {
+ prg16_89ab(m_reg[3] & 0x0f);
+ prg16_cdef(m_prg_chunks - 1); // 16K mode fixed last bank
+ }
+ else
+ {
+ prg16_89ab(0); // 16K mode fixed first bank
+ prg16_cdef(m_reg[3] & 0x0f);
+ }
+}
+
+void nes_ninjaryu_device::update_chr()
+{
+ if (BIT(m_reg[0], 4))
+ {
+ chr4_0(m_reg[1], CHRROM);
+ chr4_4(m_reg[2], CHRROM);
+ }
+ else
+ chr8(m_reg[1] >> 1, CHRROM);
+}
+
+void nes_ninjaryu_device::write_h(offs_t offset, uint8_t data)
+{
+ LOG_MMC(("unl_ninjaryu write_h, offset: %04x, data: %02x\n", offset, data));
+
+ m_reg[(offset >> 13) & 0x03] = data & 0x3f;
+
+ switch (offset & 0x6000)
+ {
+ case 0x0000:
+ switch (data & 0x03)
+ {
+ case 0x00: set_nt_mirroring(PPU_MIRROR_LOW); break;
+ case 0x01: set_nt_mirroring(PPU_MIRROR_HIGH); break;
+ case 0x02: set_nt_mirroring(PPU_MIRROR_VERT); break;
+ case 0x03: set_nt_mirroring(PPU_MIRROR_HORZ); break;
+ }
+ update_prg();
+ update_chr();
+ break;
+ case 0x2000:
+ case 0x4000:
+ update_chr();
+ break;
+ case 0x6000:
+ update_prg();
+ break;
+ }
+}
+
+
+/*-------------------------------------------------
+
+ UNL-EH8813A
+
+ Games: Dr. Mario II
+
+ Board is used in multicarts other than this? "BY ES"
+ in pause menu suggests this may be by Waixing. Title
+ menus change with DIP settings (currently unimplemented),
+ but it is unclear if PCB has switch or solder pads or...?
+
+ NES 2.0: mapper 519
+
+ In MAME: Preliminary supported.
+
+ -------------------------------------------------*/
+
+void nes_eh8813a_device::write_h(offs_t offset, uint8_t data)
+{
+ LOG_MMC(("unl_eh8813a write_h, offset: %04x, data: %02x\n", offset, data));
+
+ if (BIT(offset, 8))
+ return;
+
+ chr8(data & 0x7f, m_chr_source);
+ set_nt_mirroring(BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+
+ uint8_t bank = offset & 0x3f;
+ if (BIT(offset, 7))
+ {
+ prg16_89ab(bank);
+ prg16_cdef(bank);
+ }
+ else
+ prg32(bank >> 1);
+
+ m_latch = BIT(offset, 6);
+}
+
+uint8_t nes_eh8813a_device::read_h(offs_t offset)
+{
+ LOG_MMC(("unl_eh8813a read_h, offset: %04x\n", offset));
+ if (m_latch)
+ offset = (offset & 0xfff0) | m_dipsetting;
+ return hi_access_rom(offset);
+}
+
+
#ifdef UNUSED_FUNCTION
/*-------------------------------------------------