summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/nes/jaleco.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/nes/jaleco.cpp')
-rw-r--r--src/devices/bus/nes/jaleco.cpp422
1 files changed, 133 insertions, 289 deletions
diff --git a/src/devices/bus/nes/jaleco.cpp b/src/devices/bus/nes/jaleco.cpp
index 740c3c799b8..2ce809a4eea 100644
--- a/src/devices/bus/nes/jaleco.cpp
+++ b/src/devices/bus/nes/jaleco.cpp
@@ -21,17 +21,16 @@
#include "emu.h"
#include "jaleco.h"
-#include "sound/samples.h"
#include "speaker.h"
+#define LOG_UNHANDLED (1U << 1)
#ifdef NES_PCB_DEBUG
-#define VERBOSE 1
+#define VERBOSE (LOG_UNHANDLED | LOG_GENERAL)
#else
-#define VERBOSE 0
+#define VERBOSE (LOG_UNHANDLED)
#endif
-
-#define LOG_MMC(x) do { if (VERBOSE) logerror x; } while (0)
+#include "logmacro.h"
//-------------------------------------------------
@@ -52,130 +51,95 @@ DEFINE_DEVICE_TYPE(NES_JF29, nes_jf29_device, "nes_jf29", "NES C
DEFINE_DEVICE_TYPE(NES_JF33, nes_jf33_device, "nes_jf33", "NES Cart Jaleco JF-33 (Moe Pro! Saikyou-hen) PCB")
-nes_jf11_device::nes_jf11_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+nes_jf11_device::nes_jf11_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_JF11, tag, owner, clock)
{
}
-nes_jf13_device::nes_jf13_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+nes_jf13_device::nes_jf13_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_JF13, tag, owner, clock)
, m_samples(*this, "samples")
{
}
-nes_jf16_device::nes_jf16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+nes_jf16_device::nes_jf16_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_JF16, tag, owner, clock)
{
}
-nes_jf17_device::nes_jf17_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_jf17_device::nes_jf17_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_jf17_device(mconfig, NES_JF17, tag, owner, clock)
-{
-}
-
-nes_jf17_adpcm_device::nes_jf17_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_jf17_device(mconfig, NES_JF17_ADPCM, tag, owner, clock)
- , m_samples(*this, "samples")
-{
-}
-
-nes_jf19_device::nes_jf19_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+nes_jf17_device::nes_jf17_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, bool prg_flip)
: nes_nrom_device(mconfig, type, tag, owner, clock)
-{
-}
-
-nes_jf19_device::nes_jf19_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_jf19_device(mconfig, NES_JF19, tag, owner, clock)
-{
-}
-
-nes_jf19_adpcm_device::nes_jf19_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_jf19_device(mconfig, NES_JF19_ADPCM, tag, owner, clock)
, m_samples(*this, "samples")
+ , m_latch(0)
+ , m_prg_flip(prg_flip)
{
}
-nes_ss88006_device::nes_ss88006_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_irq_count(0), m_irq_count_latch(0), m_irq_mode(0), m_irq_enable(0), irq_timer(nullptr), m_latch(0)
+nes_jf17_device::nes_jf17_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : nes_jf17_device(mconfig, NES_JF17, tag, owner, clock, false)
{
}
-nes_ss88006_device::nes_ss88006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_ss88006_device(mconfig, NES_SS88006, tag, owner, clock)
+nes_jf17_adpcm_device::nes_jf17_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : nes_jf17_device(mconfig, NES_JF17_ADPCM, tag, owner, clock, false)
{
}
-nes_ss88006_adpcm_device::nes_ss88006_adpcm_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
- : nes_ss88006_device(mconfig, type, tag, owner, clock)
+nes_jf19_device::nes_jf19_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : nes_jf17_device(mconfig, NES_JF19, tag, owner, clock, true)
{
}
-nes_jf23_device::nes_jf23_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_ss88006_adpcm_device(mconfig, NES_JF23, tag, owner, clock)
- , m_samples(*this, "samples")
+nes_jf19_adpcm_device::nes_jf19_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : nes_jf17_device(mconfig, NES_JF19_ADPCM, tag, owner, clock, true)
{
}
-nes_jf24_device::nes_jf24_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_ss88006_adpcm_device(mconfig, NES_JF24, tag, owner, clock)
+nes_ss88006_device::nes_ss88006_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock)
+ : nes_nrom_device(mconfig, type, tag, owner, clock)
, m_samples(*this, "samples")
+ , m_irq_count(0)
+ , m_irq_count_latch(0)
+ , m_irq_mode(0)
+ , m_irq_enable(0)
+ , irq_timer(nullptr)
+ , m_wram_protect(0)
{
}
-nes_jf29_device::nes_jf29_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_ss88006_adpcm_device(mconfig, NES_JF29, tag, owner, clock)
- , m_samples(*this, "samples")
+nes_ss88006_device::nes_ss88006_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : nes_ss88006_device(mconfig, NES_SS88006, tag, owner, clock)
{
}
-nes_jf33_device::nes_jf33_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_ss88006_adpcm_device(mconfig, NES_JF33, tag, owner, clock)
- , m_samples(*this, "samples")
+nes_jf23_device::nes_jf23_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : nes_ss88006_device(mconfig, NES_JF23, tag, owner, clock)
{
}
-
-
-void nes_jf11_device::device_start()
+nes_jf24_device::nes_jf24_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : nes_ss88006_device(mconfig, NES_JF24, tag, owner, clock)
{
- common_start();
}
-void nes_jf11_device::pcb_reset()
+nes_jf29_device::nes_jf29_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : nes_ss88006_device(mconfig, NES_JF29, tag, owner, clock)
{
- m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
- prg32(0);
- chr8(0, m_chr_source);
}
-void nes_jf13_device::device_start()
+nes_jf33_device::nes_jf33_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : nes_ss88006_device(mconfig, NES_JF33, tag, owner, clock)
{
- common_start();
}
-void nes_jf13_device::pcb_reset()
-{
- m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
- prg32(0);
- chr8(0, m_chr_source);
-}
-void nes_jf16_device::device_start()
-{
- common_start();
-}
void nes_jf16_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);
+ set_nt_mirroring(PPU_MIRROR_LOW);
}
void nes_jf17_device::device_start()
@@ -186,29 +150,16 @@ void nes_jf17_device::device_start()
void nes_jf17_device::pcb_reset()
{
- m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
prg16_89ab(0);
- prg16_cdef(m_prg_chunks - 1);
+ prg16_cdef(m_prg_flip ? 0 : m_prg_chunks - 1);
chr8(0, m_chr_source);
m_latch = 0;
}
-void nes_jf19_device::device_start()
-{
- common_start();
-}
-
-void nes_jf19_device::pcb_reset()
-{
- m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
- prg32(0);
- chr8(0, m_chr_source);
-}
-
void nes_ss88006_device::device_start()
{
common_start();
- irq_timer = timer_alloc(TIMER_IRQ);
+ irq_timer = timer_alloc(FUNC(nes_ss88006_device::irq_timer_tick), this);
irq_timer->adjust(attotime::zero, 0, clocks_to_attotime(1));
save_item(NAME(m_mmc_prg_bank));
@@ -217,23 +168,22 @@ void nes_ss88006_device::device_start()
save_item(NAME(m_irq_count));
save_item(NAME(m_irq_count_latch));
save_item(NAME(m_irq_mode));
- save_item(NAME(m_latch));
+ save_item(NAME(m_wram_protect));
}
void nes_ss88006_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);
- memset(m_mmc_prg_bank, 0, sizeof(m_mmc_prg_bank));
- memset(m_mmc_vrom_bank, 0, sizeof(m_mmc_vrom_bank));
+ std::fill(std::begin(m_mmc_prg_bank), std::end(m_mmc_prg_bank), 0x00);
+ std::fill(std::begin(m_mmc_vrom_bank), std::end(m_mmc_vrom_bank), 0x00);
m_irq_enable = 0;
m_irq_mode = 0;
m_irq_count = 0;
m_irq_count_latch = 0;
- m_latch = 0;
+ m_wram_protect = 0;
}
@@ -245,17 +195,18 @@ void nes_ss88006_device::pcb_reset()
Jaleco JF-11, JF-12 & JF-14 boards emulation
- Games: Bio Senshi Dan, Mississippi Satsujin Jiken
+ Games: Bio Senshi Dan, Mississippi Satsujin Jiken,
+ Yousai Club
iNES: mapper 140
- In MESS: Supported.
+ In MAME: Supported.
-------------------------------------------------*/
-void nes_jf11_device::write_m(offs_t offset, uint8_t data)
+void nes_jf11_device::write_m(offs_t offset, u8 data)
{
- LOG_MMC(("jf11 write_m, offset: %04x, data: %02x\n", offset, data));
+ LOG("jf11 write_m, offset: %04x, data: %02x\n", offset, data);
chr8(data, CHRROM);
prg32(data >> 4);
}
@@ -270,40 +221,36 @@ void nes_jf11_device::write_m(offs_t offset, uint8_t data)
iNES: mapper 86
- In MESS: Supported.
+ In MAME: Supported.
-------------------------------------------------*/
-void nes_jf13_device::write_m(offs_t offset, uint8_t data)
+void nes_jf13_device::write_m(offs_t offset, u8 data)
{
- LOG_MMC(("jf13 write_m, offset: %04x, data: %02x\n", offset, data));
+ LOG("jf13 write_m, offset: %04x, data: %02x\n", offset, data);
if (offset < 0x1000)
{
- prg32((data >> 4) & 0x03);
- chr8(((data >> 4) & 0x04) | (data & 0x03), CHRROM);
- }
- else
- {
-// printf("sample write: offset: %04x, data: %02x\n", offset, data);
- if (data & 0x20)
- m_samples->start(data & 0x0f, data & 0x0f);
- else
- m_samples->stop_all();
+ prg32(BIT(data, 4, 2));
+ chr8(bitswap<3>(data, 6, 1, 0), CHRROM);
}
+ else if ((data & 0x30) == 0x20)
+ m_samples->start(data & 0x0f, data & 0x0f);
}
/*-------------------------------------------------
Jaleco JF-16 board emulation
+ Games: Uchuusen Cosmo Carrier
+
iNES: mapper 78 (shared with a diff Irem board)
-------------------------------------------------*/
-void nes_jf16_device::write_h(offs_t offset, uint8_t data)
+void nes_jf16_device::write_h(offs_t offset, u8 data)
{
- LOG_MMC(("jf16 write_h, offset: %04x, data: %02x\n", offset, data));
+ LOG("jf16 write_h, offset: %04x, data: %02x\n", offset, data);
// this pcb is subject to bus conflict
data = account_bus_conflict(offset, data);
@@ -316,224 +263,141 @@ void nes_jf16_device::write_h(offs_t offset, uint8_t data)
/*-------------------------------------------------
- Jaleco JF-17 boards emulation
+ Jaleco JF-17 & JF-19 boards emulation
Note: we don't emulate the additional sound hardware
for Moero!! Pro Tennis
Games: Moero!! Juudou Warriors, Moero!! Pro Tennis, Pinball
- Quest Jpn
+ Quest Jpn, Moero Pro Soccer, Moero Pro Yakyuu '88
- iNES: mapper 72
+ iNES: mapper 72 & 92
- In MESS: Supported, see below for the Moero Pro Tennis
+ In MAME: Supported, see below for the games with samples
-------------------------------------------------*/
-void nes_jf17_device::write_h(offs_t offset, uint8_t data)
-{
- LOG_MMC(("jf17 write_h, offset: %04x, data: %02x\n", offset, data));
-
- // this pcb is subject to bus conflict
- data = account_bus_conflict(offset, data);
-
- if (BIT(m_latch, 7) && !BIT(data, 7))
- prg16_89ab(m_latch & 0x07);
- if (BIT(m_latch, 6) && !BIT(data, 6))
- chr8(m_latch & 0x0f, CHRROM);
-
- m_latch = data;
-}
-
-void nes_jf17_adpcm_device::write_h(offs_t offset, uint8_t data)
+void nes_jf17_device::write_h(offs_t offset, u8 data)
{
- LOG_MMC(("jf17 + ADPCM write_h, offset: %04x, data: %02x\n", offset, data));
+ LOG("jf17 write_h, offset: %04x, data: %02x\n", offset, data);
// this pcb is subject to bus conflict
data = account_bus_conflict(offset, data);
- if (BIT(m_latch, 7) && !BIT(data, 7))
- prg16_89ab(m_latch & 0x07);
- if (BIT(m_latch, 6) && !BIT(data, 6))
- chr8(m_latch & 0x0f, CHRROM);
- if (BIT(data, 5) && !BIT(data,4))
+ if (BIT(data, 7) && !BIT(m_latch, 7)) // 74174 clocks on 0 -> 1
{
-// printf("sample write: offset: %04x, data: %02x\n", offset, data);
- m_samples->start(offset & 0x1f, offset & 0x1f);
+ if (m_prg_flip)
+ prg16_cdef(data & 0x0f);
+ else
+ prg16_89ab(data & 0x07);
}
+ if (BIT(data, 6) && !BIT(m_latch, 6)) // 74174 clocks on 0 -> 1
+ chr8(data & 0x0f, CHRROM);
m_latch = data;
+
+ if (m_samples)
+ if ((data & 0x30) == 0x20)
+ m_samples->start(offset & 0x1f, offset & 0x1f);
}
/*-------------------------------------------------
- Jaleco JF-19 boards emulation
-
- Note: we don't emulate the additional sound hardware.
+ Jaleco SS88006 board emulation, aka JF-27, JF-29, JF-30, ...,
+ JF-38, JF-40, JF-41
- Games: Moero Pro Soccer, Moero Pro Yakyuu '88
+ Games: Lord of King, Magic John, Moe Pro '90, Ninja Jajamaru,
+ Pizza Pop, Plasma Ball
- iNES: mapper 92
+ iNES: mapper 18
- In MESS: Supported, see below for the Moero Pro Yakyuu '88
+ In MAME: Supported, see below for the games with samples
-------------------------------------------------*/
-void nes_jf19_device::write_h(offs_t offset, uint8_t data)
+TIMER_CALLBACK_MEMBER(nes_ss88006_device::irq_timer_tick)
{
- LOG_MMC(("jf19 write_h, offset: %04x, data: %02x\n", offset, data));
-
- // this pcb is subject to bus conflict
- data = account_bus_conflict(offset, data);
-
- if (BIT(data, 7))
- prg16_cdef(data & 0x0f);
- if (BIT(data, 6))
- chr8(data & 0x0f, CHRROM);
-}
+ if (m_irq_enable)
+ {
+ u16 mask = 0xffff; // 16-bit counter (default)
-void nes_jf19_adpcm_device::write_h(offs_t offset, uint8_t data)
-{
- LOG_MMC(("jf19 + ADPCM write_h, offset: %04x, data: %02x\n", offset, data));
+ if (BIT(m_irq_mode, 3)) // 4-bit counter
+ mask = 0x000f;
+ else if (BIT(m_irq_mode, 2)) // 8-bit counter
+ mask = 0x00ff;
+ else if (BIT(m_irq_mode, 1)) // 12-bit counter
+ mask = 0x0fff;
- // this pcb is subject to bus conflict
- data = account_bus_conflict(offset, data);
+ m_irq_count = (m_irq_count & ~mask) | ((m_irq_count - 1) & mask);
- if (BIT(data, 7))
- prg16_cdef(data & 0x0f);
- if (BIT(data, 6))
- chr8(data & 0x0f, CHRROM);
- if (BIT(data, 5) && !BIT(data,4))
- {
-// printf("sample write: offset: %04x, data: %02x\n", offset, data);
- m_samples->start(offset & 0x1f, offset & 0x1f);
+ if ((m_irq_count & mask) == mask)
+ set_irq_line(ASSERT_LINE);
}
}
-/*-------------------------------------------------
-
- Jaleco SS88006 board emulation, aka JF-27, JF-29, JF-30, ...,
- JF-38, JF-40, JF-41
-
- Games: Lord of King, Magic John, Moe Pro '90, Ninja Jajamaru,
- Pizza Pop, Plasma Ball
-
- iNES: mapper 18
+u8 nes_ss88006_device::read_m(offs_t offset)
+{
+ LOG("ss88006 read_m, offset: %04x\n", offset);
- In MESS: Supported, see below for the games with samples
+ if (m_wram_protect & 1) // RAM enabled
+ return device_nes_cart_interface::read_m(offset);
- -------------------------------------------------*/
+ return get_open_bus();
+}
-void nes_ss88006_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+void nes_ss88006_device::write_m(offs_t offset, u8 data)
{
- if (id == TIMER_IRQ)
- {
- if (m_irq_enable)
- {
- if (m_irq_mode & 0x08) // 4bits counter
- {
- if (!(m_irq_count & 0x000f))
- {
- set_irq_line(ASSERT_LINE);
- m_irq_count = (m_irq_count & 0xfff0) | 0x000f;
- }
- else
- m_irq_count = (m_irq_count & 0xfff0) | ((m_irq_count & 0x000f) - 1);
- }
- else if (m_irq_mode & 0x04) // 8bits counter
- {
- if (!(m_irq_count & 0x00ff))
- {
- set_irq_line(ASSERT_LINE);
- m_irq_count = (m_irq_count & 0xff00) | 0x00ff;
- }
- else
- m_irq_count = (m_irq_count & 0xff00) | ((m_irq_count & 0x00ff) - 1);
- }
- else if (m_irq_mode & 0x02) // 12bits counter
- {
- if (!(m_irq_count & 0x0fff))
- {
- set_irq_line(ASSERT_LINE);
- m_irq_count = (m_irq_count & 0xf000) | 0x0fff;
- }
- else
- m_irq_count = (m_irq_count & 0xf000) | ((m_irq_count & 0x0fff) - 1);
- }
- else // 16bits counter
- {
- if (!m_irq_count)
- {
- set_irq_line(ASSERT_LINE);
- m_irq_count = 0xffff;
- }
- else
- m_irq_count = m_irq_count - 1;
- }
- }
- }
+ LOG("ss88006 write_m, offset: %04x, data: %02x\n", offset, data);
+
+ if (m_wram_protect == 0x03) // RAM enabled and writable
+ device_nes_cart_interface::write_m(offset, data);
}
-void nes_ss88006_device::ss88006_write(offs_t offset, uint8_t data)
+void nes_ss88006_device::write_h(offs_t offset, u8 data)
{
- uint8_t bank;
- LOG_MMC(("ss88006 write_h, offset: %04x, data: %02x\n", offset, data));
+ LOG("ss88006 write_h, offset: %04x, data: %02x\n", offset, data);
+
+ int bank, shift;
switch (offset & 0x7003)
{
case 0x0000:
- m_mmc_prg_bank[0] = (m_mmc_prg_bank[0] & 0xf0) | (data & 0x0f);
- prg8_89(m_mmc_prg_bank[0]);
- break;
case 0x0001:
- m_mmc_prg_bank[0] = (m_mmc_prg_bank[0] & 0x0f) | (data << 4);
- prg8_89(m_mmc_prg_bank[0]);
- break;
case 0x0002:
- m_mmc_prg_bank[1] = (m_mmc_prg_bank[1] & 0xf0) | (data & 0x0f);
- prg8_ab(m_mmc_prg_bank[1]);
- break;
case 0x0003:
- m_mmc_prg_bank[1] = (m_mmc_prg_bank[1] & 0x0f) | (data << 4);
- prg8_ab(m_mmc_prg_bank[1]);
- break;
case 0x1000:
- m_mmc_prg_bank[2] = (m_mmc_prg_bank[2] & 0xf0) | (data & 0x0f);
- prg8_cd(m_mmc_prg_bank[2]);
- break;
case 0x1001:
- m_mmc_prg_bank[2] = (m_mmc_prg_bank[2] & 0x0f) | (data << 4);
- prg8_cd(m_mmc_prg_bank[2]);
+ bank = bitswap<2>(offset, 12, 1);
+ shift = (offset & 1) << 2;
+ m_mmc_prg_bank[bank] &= ~(0x0f << shift);
+ m_mmc_prg_bank[bank] |= (data & 0x0f) << shift;
+ prg8_x(bank, m_mmc_prg_bank[bank]);
break;
- /* $9002, 3 (1002, 3) uncaught = Jaleco Baseball writes 0 */
- /* believe it's related to battery-backed ram enable/disable */
+ case 0x1002:
+ m_wram_protect = data & 0x03;
+ break;
case 0x2000: case 0x2001: case 0x2002: case 0x2003:
case 0x3000: case 0x3001: case 0x3002: case 0x3003:
case 0x4000: case 0x4001: case 0x4002: case 0x4003:
case 0x5000: case 0x5001: case 0x5002: case 0x5003:
- bank = ((offset & 0x7000) - 0x2000) / 0x0800 + ((offset & 0x0002) >> 1);
- if (offset & 0x0001)
- m_mmc_vrom_bank[bank] = (m_mmc_vrom_bank[bank] & 0x0f) | ((data & 0x0f)<< 4);
- else
- m_mmc_vrom_bank[bank] = (m_mmc_vrom_bank[bank] & 0xf0) | (data & 0x0f);
-
+ bank = 2 * (BIT(offset, 12, 3) - 2) + BIT(offset, 1);
+ shift = (offset & 1) << 2;
+ m_mmc_vrom_bank[bank] &= ~(0x0f << shift);
+ m_mmc_vrom_bank[bank] |= (data & 0x0f) << shift;
chr1_x(bank, m_mmc_vrom_bank[bank], CHRROM);
break;
case 0x6000:
- m_irq_count_latch = (m_irq_count_latch & 0xfff0) | (data & 0x0f);
- break;
case 0x6001:
- m_irq_count_latch = (m_irq_count_latch & 0xff0f) | ((data & 0x0f) << 4);
- break;
case 0x6002:
- m_irq_count_latch = (m_irq_count_latch & 0xf0ff) | ((data & 0x0f) << 8);
- break;
case 0x6003:
- m_irq_count_latch = (m_irq_count_latch & 0x0fff) | ((data & 0x0f) << 12);
+ shift = 4 * (offset & 0x03);
+ m_irq_count_latch &= ~(0x000f << shift);
+ m_irq_count_latch |= (data & 0x0f) << shift;
break;
+
case 0x7000:
m_irq_count = m_irq_count_latch;
set_irq_line(CLEAR_LINE);
@@ -554,34 +418,14 @@ void nes_ss88006_device::ss88006_write(offs_t offset, uint8_t data)
}
break;
- default:
- logerror("Jaleco SS88006 uncaught write, addr: %04x, value: %02x\n", offset + 0x8000, data);
- break;
- }
-}
-
-
-// bits2-bits6 are sample number, bit1 is setup/enable/disable
-// program first write sample # + bit1 set to 'init' the sample
-// then it writes sample # + bit1 clear to 'start' the sample
-void nes_ss88006_adpcm_device::ss88006_adpcm_write(offs_t offset, uint8_t data, samples_device &dev)
-{
- LOG_MMC(("ss88006 write_h, offset: %04x, data: %02x\n", offset, data));
-
- switch (offset & 0x7003)
- {
case 0x7003:
- if ((m_latch & 0x7c) == (data & 0x7c))
- {
-// printf("sample write: data: %02x\n", data);
- if ((m_latch & 2) && !(data & 2))
- dev.start((data >> 2) & 0x1f, (data >> 2) & 0x1f);
- }
- m_latch = data;
+ if (m_samples)
+ if ((data & 0x03) == 0x02)
+ m_samples->start(BIT(data, 2, 5), BIT(data, 2, 5));
break;
default:
- ss88006_write(offset, data);
+ LOGMASKED(LOG_UNHANDLED, "Jaleco SS88006 uncaught write, addr: %04x, value: %02x\n", offset + 0x8000, data);
break;
}
}
@@ -612,13 +456,13 @@ static const char *const jf13_sample_names[] =
"04", // safe
"05", // foul
"06", // (catcher obtains the ball)
- "07", // you're out
+ "07", // batter out
"08", // play ball
"09", // ball four
"10", // home run
"11", // new pitcher
"12", // ouch (pitcher hits batter)
- "13", // ??
+ "13", // aho (idiot)
"14", // (bat hits the ball)
"15", // (crowd)
nullptr