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.cpp340
1 files changed, 135 insertions, 205 deletions
diff --git a/src/devices/bus/nes/pirate.cpp b/src/devices/bus/nes/pirate.cpp
index 7e935b28901..44b7c8acf8d 100644
--- a/src/devices/bus/nes/pirate.cpp
+++ b/src/devices/bus/nes/pirate.cpp
@@ -18,16 +18,14 @@
#include "pirate.h"
#include "video/ppu2c0x.h" // this has to be included so that IRQ functions can access ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE
-#include "screen.h"
#ifdef NES_PCB_DEBUG
-#define VERBOSE 1
+#define VERBOSE (LOG_GENERAL)
#else
-#define VERBOSE 0
+#define VERBOSE (0)
#endif
-
-#define LOG_MMC(x) do { if (VERBOSE) logerror x; } while (0)
+#include "logmacro.h"
//-------------------------------------------------
@@ -43,17 +41,17 @@ DEFINE_DEVICE_TYPE(NES_DAOU306, nes_daou306_device, "nes_daou306", "
DEFINE_DEVICE_TYPE(NES_CC21, nes_cc21_device, "nes_cc21", "NES Cart CC-21 PCB")
DEFINE_DEVICE_TYPE(NES_XIAOZY, nes_xiaozy_device, "nes_xiaozy", "NES Cart Xiao Zhuan Yuan PCB")
DEFINE_DEVICE_TYPE(NES_EDU2K, nes_edu2k_device, "nes_edu2k", "NES Cart Educational Computer 2000 PCB")
-DEFINE_DEVICE_TYPE(NES_MK2, nes_mk2_device, "nes_mk2", "NES Cart Mortal Kombat 2 PCB")
+DEFINE_DEVICE_TYPE(NES_JY830623C, nes_jy830623c_device, "nes_jy830623c", "NES Cart JY830623C PCB")
DEFINE_DEVICE_TYPE(NES_43272, nes_43272_device, "nes_43272", "NES Cart UNL-43272 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)
+nes_agci_device::nes_agci_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_AGCI_50282, tag, owner, clock)
{
}
-nes_dreamtech_device::nes_dreamtech_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+nes_dreamtech_device::nes_dreamtech_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_DREAMTECH01, tag, owner, clock)
{
}
@@ -63,17 +61,17 @@ nes_fukutake_device::nes_fukutake_device(const machine_config &mconfig, const ch
{
}
-nes_futuremedia_device::nes_futuremedia_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_FUTUREMEDIA, tag, owner, clock), m_irq_count(0), m_irq_count_latch(0), m_irq_clear(0), m_irq_enable(0)
+nes_futuremedia_device::nes_futuremedia_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : nes_nrom_device(mconfig, NES_FUTUREMEDIA, tag, owner, clock), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0)
{
}
-nes_magseries_device::nes_magseries_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+nes_magseries_device::nes_magseries_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_MAGSERIES, tag, owner, clock)
{
}
-nes_daou306_device::nes_daou306_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+nes_daou306_device::nes_daou306_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_DAOU306, tag, owner, clock)
{
}
@@ -93,8 +91,8 @@ nes_edu2k_device::nes_edu2k_device(const machine_config &mconfig, const char *ta
{
}
-nes_mk2_device::nes_mk2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_MK2, tag, owner, clock), m_irq_count(0), m_irq_count_latch(0), m_irq_clear(0), m_irq_enable(0)
+nes_jy830623c_device::nes_jy830623c_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : nes_nrom_device(mconfig, NES_JY830623C, tag, owner, clock), m_latch(0), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0)
{
}
@@ -111,29 +109,10 @@ nes_eh8813a_device::nes_eh8813a_device(const machine_config &mconfig, const char
-void nes_agci_device::device_start()
-{
- common_start();
-}
-
-void nes_agci_device::pcb_reset()
-{
- m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
- prg32(0);
- chr8(0, m_chr_source);
-}
-
-void nes_dreamtech_device::device_start()
-{
- common_start();
-}
-
void nes_dreamtech_device::pcb_reset()
{
- m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
prg16_89ab(0);
prg16_cdef(8);
- chr8(0, m_chr_source);
}
void nes_fukutake_device::device_start()
@@ -147,7 +126,6 @@ void nes_fukutake_device::device_start()
void nes_fukutake_device::pcb_reset()
{
- m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
prg16_89ab(0);
prg16_cdef(0);
chr8(0, m_chr_source);
@@ -158,7 +136,6 @@ void nes_fukutake_device::pcb_reset()
void nes_futuremedia_device::device_start()
{
common_start();
- save_item(NAME(m_irq_clear));
save_item(NAME(m_irq_enable));
save_item(NAME(m_irq_count));
save_item(NAME(m_irq_count_latch));
@@ -166,28 +143,14 @@ void nes_futuremedia_device::device_start()
void nes_futuremedia_device::pcb_reset()
{
- m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
prg16_89ab(0);
prg16_cdef(m_prg_chunks - 1);
- chr8(0, m_chr_source);
+ chr8(0, CHRROM);
- m_irq_clear = 0;
m_irq_enable = 0;
m_irq_count = m_irq_count_latch = 0;
}
-void nes_magseries_device::device_start()
-{
- common_start();
-}
-
-void nes_magseries_device::pcb_reset()
-{
- m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
- prg32(0);
- chr8(0, m_chr_source);
-}
-
void nes_daou306_device::device_start()
{
common_start();
@@ -196,23 +159,24 @@ void nes_daou306_device::device_start()
void nes_daou306_device::pcb_reset()
{
- m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
prg16_89ab(m_prg_chunks - 2);
prg16_cdef(m_prg_chunks - 1);
chr8(0, m_chr_source);
set_nt_mirroring(PPU_MIRROR_LOW);
- memset(m_reg, 0, sizeof(m_reg));
+ std::fill(std::begin(m_reg), std::end(m_reg), 0x00);
}
-void nes_xiaozy_device::device_start()
+void nes_cc21_device::pcb_reset()
{
- common_start();
+ prg32(0);
+ chr4_0(0, CHRROM);
+ chr4_4(0, CHRROM);
+ set_nt_mirroring(PPU_MIRROR_LOW);
}
void nes_xiaozy_device::pcb_reset()
{
- m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
prg32((m_prg_chunks - 1) >> 1);
chr8(0, m_chr_source);
}
@@ -225,31 +189,29 @@ void nes_edu2k_device::device_start()
void nes_edu2k_device::pcb_reset()
{
- m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
prg32(0);
chr8(0, m_chr_source);
m_latch = 0;
}
-void nes_mk2_device::device_start()
+void nes_jy830623c_device::device_start()
{
common_start();
- save_item(NAME(m_irq_clear));
+ save_item(NAME(m_latch));
+ save_item(NAME(m_reg));
save_item(NAME(m_irq_enable));
save_item(NAME(m_irq_count));
save_item(NAME(m_irq_count_latch));
}
-void nes_mk2_device::pcb_reset()
+void nes_jy830623c_device::pcb_reset()
{
- m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
- prg16_89ab(m_prg_chunks - 1);
- prg16_cdef(m_prg_chunks - 1);
- chr8(0, m_chr_source);
+ m_latch = 0;
+ std::fill(std::begin(m_reg), std::end(m_reg), 0x00);
+ update_banks();
set_nt_mirroring(PPU_MIRROR_VERT);
- m_irq_clear = 0;
m_irq_enable = 0;
m_irq_count = m_irq_count_latch = 0;
}
@@ -262,7 +224,6 @@ void nes_43272_device::device_start()
void nes_43272_device::pcb_reset()
{
- m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
prg32((m_prg_chunks - 1) >> 1);
chr8(0, m_chr_source);
@@ -301,17 +262,17 @@ void nes_eh8813a_device::pcb_reset()
iNES: mapper 144
- In MESS: Supported.
+ In MAME: Supported.
-------------------------------------------------*/
-void nes_agci_device::write_h(offs_t offset, uint8_t data)
+void nes_agci_device::write_h(offs_t offset, u8 data)
{
- LOG_MMC(("agci write_h, offset: %04x, data: %02x\n", offset, data));
+ LOG("agci write_h, offset: %04x, data: %02x\n", offset, data);
// this pcb is subject to bus conflict
- uint8_t temp = account_bus_conflict(offset, 0xff);
- data = (data & temp) | (temp & 1);
+ // bit 0 is always determined by the ROM value at the offset due to a resistor on the board
+ data = account_bus_conflict(offset, data | 1);
chr8(data >> 4, CHRROM);
prg32(data);
@@ -329,12 +290,12 @@ void nes_agci_device::write_h(offs_t offset, uint8_t data)
-------------------------------------------------*/
-void nes_dreamtech_device::write_l(offs_t offset, uint8_t data)
+void nes_dreamtech_device::write_l(offs_t offset, u8 data)
{
- LOG_MMC(("dreamtech write_l, offset: %04x, data: %02x\n", offset, data));
- offset += 0x100;
+ LOG("dreamtech write_l, offset: %04x, data: %02x\n", offset, data);
- if (offset == 0x1020) /* 0x5020 */
+ offset += 0x100;
+ if (offset >= 0x1000)
prg16_89ab(data);
}
@@ -352,7 +313,7 @@ void nes_dreamtech_device::write_l(offs_t offset, uint8_t data)
void nes_fukutake_device::write_l(offs_t offset, uint8_t data)
{
- LOG_MMC(("fukutake write_l, offset: %04x, data: %02x\n", offset, data));
+ LOG("fukutake write_l, offset: %04x, data: %02x\n", offset, data);
offset += 0x100;
if (offset >= 0x200 && offset < 0x400)
@@ -368,7 +329,7 @@ void nes_fukutake_device::write_l(offs_t offset, uint8_t data)
uint8_t nes_fukutake_device::read_l(offs_t offset)
{
- LOG_MMC(("fukutake read_l, offset: %04x\n", offset));
+ LOG("fukutake read_l, offset: %04x\n", offset);
offset += 0x100;
if (offset >= 0x200 && offset < 0x400)
@@ -388,13 +349,13 @@ uint8_t nes_fukutake_device::read_l(offs_t offset)
void nes_fukutake_device::write_m(offs_t offset, uint8_t data)
{
- LOG_MMC(("fukutake write_m, offset: %04x, data: %02x\n", offset, data));
+ LOG("fukutake write_m, offset: %04x, data: %02x\n", offset, data);
m_prgram[((m_latch * 0x2000) + offset) & (m_prgram.size() - 1)] = data;
}
uint8_t nes_fukutake_device::read_m(offs_t offset)
{
- LOG_MMC(("fukutake read_m, offset: %04x\n", offset));
+ LOG("fukutake read_m, offset: %04x\n", offset);
return m_prgram[((m_latch * 0x2000) + offset) & (m_prgram.size() - 1)];
}
@@ -406,11 +367,11 @@ uint8_t nes_fukutake_device::read_m(offs_t offset)
iNES: mapper 117
- In MESS: Unsupported.
+ In MAME: Partially supported.
-------------------------------------------------*/
-void nes_futuremedia_device::hblank_irq(int scanline, int vblank, int blanked)
+void nes_futuremedia_device::hblank_irq(int scanline, bool vblank, bool blanked)
{
// if (scanline < ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE)
{
@@ -418,28 +379,22 @@ void nes_futuremedia_device::hblank_irq(int scanline, int vblank, int blanked)
{
m_irq_count--;
if (!m_irq_count)
- hold_irq_line();
+ set_irq_line(ASSERT_LINE);
}
}
}
-void nes_futuremedia_device::write_h(offs_t offset, uint8_t data)
+void nes_futuremedia_device::write_h(offs_t offset, u8 data)
{
- LOG_MMC(("futuremedia write_h, offset: %04x, data: %02x\n", offset, data));
+ LOG("futuremedia write_h, offset: %04x, data: %02x\n", offset, data);
switch (offset)
{
case 0x0000:
- prg8_89(data);
- break;
case 0x0001:
- prg8_ab(data);
- break;
case 0x0002:
- prg8_cd(data);
- break;
case 0x0003:
- prg8_ef(data);
+ prg8_x(offset & 0x03, data);
break;
case 0x2000:
case 0x2001:
@@ -451,22 +406,21 @@ void nes_futuremedia_device::write_h(offs_t offset, uint8_t data)
case 0x2007:
chr1_x(offset & 0x07, data, CHRROM);
break;
-
- case 0x5000:
- set_nt_mirroring(BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
- break;
-
case 0x4001:
m_irq_count_latch = data;
break;
case 0x4002:
- // IRQ cleared
+ set_irq_line(CLEAR_LINE);
break;
case 0x4003:
m_irq_count = m_irq_count_latch;
break;
+ case 0x5000:
+ set_nt_mirroring(BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ break;
case 0x6000:
m_irq_enable = data & 0x01;
+ set_irq_line(CLEAR_LINE);
break;
}
}
@@ -482,13 +436,13 @@ void nes_futuremedia_device::write_h(offs_t offset, uint8_t data)
iNES: mapper 107
- In MESS: Supported.
+ In MAME: Supported.
-------------------------------------------------*/
-void nes_magseries_device::write_h(offs_t offset, uint8_t data)
+void nes_magseries_device::write_h(offs_t offset, u8 data)
{
- LOG_MMC(("magseries write_h, offset: %04x, data: %02x\n", offset, data));
+ LOG("magseries write_h, offset: %04x, data: %02x\n", offset, data);
prg32(data >> 1);
chr8(data, CHRROM);
@@ -502,70 +456,28 @@ void nes_magseries_device::write_h(offs_t offset, uint8_t data)
iNES: mapper 156
- In MESS: Supported.
+ In MAME: Supported.
Notes: Metal Force and Buzz & Waldog only use the first 4
regs and no mirroring. Janggun ui Adeul uses all features
-------------------------------------------------*/
-void nes_daou306_device::write_h(offs_t offset, uint8_t data)
+void nes_daou306_device::write_h(offs_t offset, u8 data)
{
- LOG_MMC(("daou306 write_h, offset: %04x, data: %02x\n", offset, data));
- int reg = BIT(offset, 2) ? 8 : 0;
+ LOG("daou306 write_h, offset: %04x, data: %02x\n", offset, data);
- switch (offset)
+ if (offset >= 0x4000 && offset < 0x4010)
{
- case 0x4000:
- case 0x4004:
- m_reg[reg + 0] = data;
- chr1_0(m_reg[0] | (m_reg[8] << 8), CHRROM);
- break;
- case 0x4001:
- case 0x4005:
- m_reg[reg + 1] = data;
- chr1_1(m_reg[1] | (m_reg[9] << 8), CHRROM);
- break;
- case 0x4002:
- case 0x4006:
- m_reg[reg + 2] = data;
- chr1_2(m_reg[2] | (m_reg[10] << 8), CHRROM);
- break;
- case 0x4003:
- case 0x4007:
- m_reg[reg + 3] = data;
- chr1_3(m_reg[3] | (m_reg[11] << 8), CHRROM);
- break;
- case 0x4008:
- case 0x400c:
- m_reg[reg + 4] = data;
- chr1_4(m_reg[4] | (m_reg[12] << 8), CHRROM);
- break;
- case 0x4009:
- case 0x400d:
- m_reg[reg + 5] = data;
- chr1_5(m_reg[5] | (m_reg[13] << 8), CHRROM);
- break;
- case 0x400a:
- case 0x400e:
- m_reg[reg + 6] = data;
- chr1_6(m_reg[6] | (m_reg[14] << 8), CHRROM);
- break;
- case 0x400b:
- case 0x400f:
- m_reg[reg + 7] = data;
- chr1_7(m_reg[7] | (m_reg[15] << 8), CHRROM);
- break;
- case 0x4010:
- prg16_89ab(data);
- break;
- case 0x4014:
- if (data & 1)
- set_nt_mirroring(PPU_MIRROR_HORZ);
- else
- set_nt_mirroring(PPU_MIRROR_VERT);
- break;
+ int reg = bitswap<4>(offset, 2, 3, 1, 0);
+ m_reg[reg] = data;
+ reg &= 0x07;
+ chr1_x(reg, m_reg[reg] | (m_reg[reg | 8] << 8), CHRROM);
}
+ else if (offset == 0x4010)
+ prg16_89ab(data);
+ else if (offset == 0x4014)
+ set_nt_mirroring(data & 1 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
}
/*-------------------------------------------------
@@ -582,7 +494,7 @@ void nes_daou306_device::write_h(offs_t offset, uint8_t data)
void nes_cc21_device::write_h(offs_t offset, u8 data)
{
- LOG_MMC(("cc21 write_h, offset: %04x, data: %02x\n", offset, data));
+ LOG("cc21 write_h, offset: %04x, data: %02x\n", offset, data);
set_nt_mirroring(BIT(offset, 0) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
chr4_0(BIT(offset, 0), CHRROM);
@@ -600,13 +512,13 @@ void nes_cc21_device::write_h(offs_t offset, u8 data)
iNES: mapper 176
- In MESS: Supported.
+ In MAME: Supported.
-------------------------------------------------*/
void nes_xiaozy_device::write_l(offs_t offset, uint8_t data)
{
- LOG_MMC(("xiaozy write_l, offset: %04x, data: %02x\n", offset, data));
+ LOG("xiaozy write_l, offset: %04x, data: %02x\n", offset, data);
switch (offset)
{
@@ -627,87 +539,106 @@ void nes_xiaozy_device::write_l(offs_t offset, uint8_t data)
void nes_edu2k_device::write_h(offs_t offset, uint8_t data)
{
- LOG_MMC(("edu2k write_h, offset: %04x, data: %02x\n", offset, data));
+ LOG("edu2k write_h, offset: %04x, data: %02x\n", offset, data);
prg32(data & 0x1f);
- m_latch = (data & 0xc0) >> 6;
+ m_latch = BIT(data, 6, 2);
}
void nes_edu2k_device::write_m(offs_t offset, uint8_t data)
{
- LOG_MMC(("edu2k write_m, offset: %04x, data: %02x\n", offset, data));
+ LOG("edu2k write_m, offset: %04x, data: %02x\n", offset, data);
m_prgram[((m_latch * 0x2000) + offset) & (m_prgram.size() - 1)] = data;
}
uint8_t nes_edu2k_device::read_m(offs_t offset)
{
- LOG_MMC(("edu2k read_m, offset: %04x\n", offset));
+ LOG("edu2k read_m, offset: %04x\n", offset);
return m_prgram[((m_latch * 0x2000) + offset) & (m_prgram.size() - 1)];
}
/*-------------------------------------------------
- Bootleg Board for MK2
+ Bootleg Board JY830623C
Games: Mortal Kombat II, Street Fighter III, Super Mario
Kart Rider
- This board uses an IRQ system very similar to MMC3. We indeed
- use mapper4_irq, but there is some small glitch!
-
iNES: mapper 91
- In MESS: Supported.
+ In MAME: Partially supported.
+
+ FIXME: IRQ is fixed length but not every 7 scanlines
+ as done here. Rather it triggers once every 64 rises
+ of PPU A12. Various games have very obvious raster-
+ split issues from this bug. Also note there is
+ another submapper with cycle-based IRQ.
-------------------------------------------------*/
-// Same IRQ as MMC3
-void nes_mk2_device::hblank_irq( int scanline, int vblank, int blanked )
+void nes_jy830623c_device::hblank_irq(int scanline, bool vblank, bool blanked)
{
if (scanline < ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE)
{
int prior_count = m_irq_count;
- if ((m_irq_count == 0) || m_irq_clear)
- m_irq_count = m_irq_count_latch;
- else
+ if (m_irq_count)
m_irq_count--;
+ else
+ m_irq_count = m_irq_count_latch;
- if (m_irq_enable && !blanked && (m_irq_count == 0) && (prior_count || m_irq_clear))
+ if (m_irq_enable && !blanked && !m_irq_count && prior_count)
{
- LOG_MMC(("irq fired, scanline: %d\n", scanline));
- hold_irq_line();
+ LOG("irq fired, scanline: %d\n", scanline);
+ set_irq_line(ASSERT_LINE);
}
}
- m_irq_clear = 0;
}
-void nes_mk2_device::write_m(offs_t offset, uint8_t data)
+void nes_jy830623c_device::update_banks()
{
- LOG_MMC(("mk2 write_m, offset: %04x, data: %02x\n", offset, data));
+ prg8_89((m_latch & 0x06) << 3 | m_reg[4]);
+ prg8_ab((m_latch & 0x06) << 3 | m_reg[5]);
+ prg16_cdef((m_latch & 0x06) << 2 | 0x07);
- switch (offset & 0x1000)
+ for (int i = 0; i < 4; i++)
+ chr2_x(2 * i, (m_latch & 1) << 8 | m_reg[i], CHRROM);
+}
+
+void nes_jy830623c_device::write_m(offs_t offset, u8 data)
+{
+ LOG("jy830623c write_m, offset: %04x, data: %02x\n", offset, data);
+
+ switch (offset & 0x1003)
{
case 0x0000:
- switch (offset & 0x03)
- {
- 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;
- }
- break;
+ case 0x0001:
+ case 0x0002:
+ case 0x0003:
case 0x1000:
- switch (offset & 0x03)
- {
- case 0x00: prg8_89(data); break;
- case 0x01: prg8_ab(data); break;
- case 0x02: m_irq_enable = 0; m_irq_count = 0; break;
- case 0x03: m_irq_enable = 1; m_irq_count = 7; break;
- }
+ case 0x1001:
+ m_reg[bitswap<3>(offset, 12, 1, 0)] = data;
+ update_banks();
break;
- default:
- logerror("mk2 write_m, uncaught addr: %04x value: %02x\n", offset + 0x6000, data);
+ case 0x1002:
+ m_irq_enable = 0;
+ m_irq_count = 0;
+ set_irq_line(CLEAR_LINE);
break;
+ case 0x1003:
+ m_irq_enable = 1;
+ m_irq_count = 7;
+ break;
+ }
+}
+
+void nes_jy830623c_device::write_h(offs_t offset, u8 data)
+{
+ LOG("jy830623c write_h, offset: %04x, data: %02x\n", offset, data);
+
+ if (offset < 0x2000)
+ {
+ m_latch = offset;
+ update_banks();
}
}
@@ -717,16 +648,16 @@ void nes_mk2_device::write_m(offs_t offset, uint8_t data)
Games: Gaau Hok Gwong Cheung
- In MESS: Preliminary Supported
+ In MAME: Preliminary Supported
-------------------------------------------------*/
void nes_43272_device::write_h(offs_t offset, uint8_t data)
{
- LOG_MMC(("unl_43272 write_h, offset: %04x, data: %02x\n", offset, data));
+ LOG("unl_43272 write_h, offset: %04x, data: %02x\n", offset, data);
if ((m_latch & 0x81) == 0x81)
- prg32((m_latch & 0x38) >> 3);
+ prg32(BIT(m_latch, 3, 3));
m_latch = offset & 0xffff;
}
@@ -735,7 +666,7 @@ void nes_43272_device::write_h(offs_t offset, uint8_t data)
uint8_t nes_43272_device::read_h(offs_t offset)
{
uint8_t mask = (m_latch & 0x400) ? 0xfe : 0xff;
- LOG_MMC(("unl_43272 read_h, offset: %04x\n", offset));
+ LOG("unl_43272 read_h, offset: %04x\n", offset);
return hi_access_rom(offset & mask);
}
@@ -755,7 +686,7 @@ uint8_t nes_43272_device::read_h(offs_t offset)
void nes_eh8813a_device::write_h(offs_t offset, u8 data)
{
- LOG_MMC(("unl_eh8813a write_h, offset: %04x, data: %02x\n", offset, data));
+ LOG("unl_eh8813a write_h, offset: %04x, data: %02x\n", offset, data);
if (!BIT(m_latch, 8))
{
@@ -775,7 +706,7 @@ void nes_eh8813a_device::write_h(offs_t offset, u8 data)
u8 nes_eh8813a_device::read_h(offs_t offset)
{
- LOG_MMC(("unl_eh8813a read_h, offset: %04x\n", offset));
+ LOG("unl_eh8813a read_h, offset: %04x\n", offset);
if (BIT(m_latch, 6))
offset = (offset & ~0x0f) | m_jumper; // TODO: jumper setting that controls which menu appears is 0 for now
@@ -801,7 +732,6 @@ void nes_fujiya_device::device_start()
void nes_fujiya_device::pcb_reset()
{
- m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
prg16_89ab(0);
prg16_cdef(0);
chr8(0, m_chr_source);
@@ -811,7 +741,7 @@ void nes_fujiya_device::pcb_reset()
void nes_fujiya_device::write_m(offs_t offset, uint8_t data)
{
- LOG_MMC(("fujiya write_m, offset: %04x, data: %02x\n", offset, data));
+ LOG("fujiya write_m, offset: %04x, data: %02x\n", offset, data);
offset += 0x6000;
if (offset == 0x6502 || offset == 0x7000)
@@ -820,12 +750,12 @@ void nes_fujiya_device::write_m(offs_t offset, uint8_t data)
uint8_t nes_fujiya_device::read_m(offs_t offset)
{
- LOG_MMC(("fujiya read_m, offset: %04x\n", offset));
+ LOG("fujiya read_m, offset: %04x\n", offset);
offset += 0x6000;
if (offset == 0x7001 || offset == 0x7777)
- return m_latch | ((offset >> 8) & 0x7f);
+ return m_latch | (BIT(offset, 8, 7));
- return get_open_bus(); // open bus
+ return get_open_bus();
}
#endif