From a23771ab39bfaced20e82640b9122fe78c7fd273 Mon Sep 17 00:00:00 2001 From: cam900 Date: Fri, 23 Nov 2018 02:40:33 +0900 Subject: cave.cpp : Cleanups (#4020) * cave.cpp : Remove unnecessary palette init, Add notes, Fix spacings, Remove some MCFGs, Cleanup namings, Remove register_postload cave.h : Use private: * cave,cpp : Fix save * cave.cpp : Fix spacing * cave.cpp : Cleanup some ACCESSING_BITs, Write handlers, Inputs, gfxdecodes, Correct namings, Fix tilemap update --- src/mame/drivers/cave.cpp | 1218 +++++++++++++++++++++------------------------ src/mame/includes/cave.h | 298 +++++------ src/mame/video/cave.cpp | 97 ++-- 3 files changed, 756 insertions(+), 857 deletions(-) diff --git a/src/mame/drivers/cave.cpp b/src/mame/drivers/cave.cpp index df20177d6a7..4a8ac61a708 100644 --- a/src/mame/drivers/cave.cpp +++ b/src/mame/drivers/cave.cpp @@ -112,7 +112,7 @@ void cave_state::update_irq_state() m_maincpu->set_input_line(m_irq_level, CLEAR_LINE); } -TIMER_CALLBACK_MEMBER(cave_state::cave_vblank_end) +TIMER_CALLBACK_MEMBER(cave_state::vblank_end) { if (m_kludge == 3) /* mazinger metmqstr */ { @@ -122,29 +122,29 @@ TIMER_CALLBACK_MEMBER(cave_state::cave_vblank_end) m_agallet_vblank_irq = 0; } -TIMER_DEVICE_CALLBACK_MEMBER(cave_state::cave_vblank_start) +TIMER_DEVICE_CALLBACK_MEMBER(cave_state::vblank_start) { m_vblank_irq = 1; update_irq_state(); - cave_get_sprite_info(0); + get_sprite_info(0); m_agallet_vblank_irq = 1; m_vblank_end_timer->adjust(attotime::from_usec(2000)); } -TIMER_DEVICE_CALLBACK_MEMBER(cave_state::cave_vblank_start_left) +TIMER_DEVICE_CALLBACK_MEMBER(cave_state::vblank_start_left) { - cave_get_sprite_info(1); + get_sprite_info(1); } -TIMER_DEVICE_CALLBACK_MEMBER(cave_state::cave_vblank_start_right) +TIMER_DEVICE_CALLBACK_MEMBER(cave_state::vblank_start_right) { - cave_get_sprite_info(2); + get_sprite_info(2); } /* Called once/frame to generate the VBLANK interrupt */ -INTERRUPT_GEN_MEMBER(cave_state::cave_interrupt) +INTERRUPT_GEN_MEMBER(cave_state::interrupt) { m_int_timer->adjust(attotime::from_usec(17376 - m_time_vblank_irq)); } -INTERRUPT_GEN_MEMBER(cave_state::cave_interrupt_ppsatan) +INTERRUPT_GEN_MEMBER(cave_state::interrupt_ppsatan) { m_int_timer->adjust (attotime::from_usec(17376 - m_time_vblank_irq)); m_int_timer_left->adjust (attotime::from_usec(17376 - m_time_vblank_irq)); @@ -175,7 +175,7 @@ WRITE_LINE_MEMBER(cave_state::sound_irq_gen) /* Reads the cause of the interrupt and clears the state */ -READ16_MEMBER(cave_state::cave_irq_cause_r) +u16 cave_state::irq_cause_r(offs_t offset) { int result = 0x0003; @@ -217,12 +217,12 @@ READ16_MEMBER(cave_state::cave_irq_cause_r) /* We need a FIFO buffer for sailormn, where the inter-CPUs communication is *really* tight */ -READ8_MEMBER(cave_state::soundflags_r) +u8 cave_state::soundflags_r() { // bit 2 is low: can read command (lo) // bit 3 is low: can read command (hi) -// return (m_sound_flag1 ? 0 : 4) | -// (m_sound_flag2 ? 0 : 8) ; +// return (m_sound_flag[0] ? 0 : 4) | +// (m_sound_flag[1] ? 0 : 8) ; return 0; } @@ -230,8 +230,8 @@ READ16_MEMBER(cave_state::soundflags_ack_r) { // bit 0 is low: can write command // bit 1 is low: can read answer -// return ((m_sound_flag1 | m_sound_flag2) ? 1 : 0) | -// ((m_soundbuf_wptr != m_soundbuf_rptr) ? 0 : 2) ; +// return ((m_sound_flag[0] | m_sound_flag[1]) ? 1 : 0) | +// (m_soundbuf_empty ? 0 : 2) ; return m_soundbuf_empty ? 2 : 0; } @@ -239,8 +239,8 @@ READ16_MEMBER(cave_state::soundflags_ack_r) /* Main CPU: write a 16 bit sound latch and generate a NMI on the sound CPU */ WRITE16_MEMBER(cave_state::sound_cmd_w) { -// m_sound_flag1 = 1; -// m_sound_flag2 = 1; +// m_sound_flag[0] = 1; +// m_sound_flag[1] = 1; m_soundlatch->write(space, offset, data, mem_mask); m_maincpu->spin_until_time(attotime::from_usec(50)); // Allow the other cpu to reply } @@ -248,14 +248,14 @@ WRITE16_MEMBER(cave_state::sound_cmd_w) /* Sound CPU: read the low 8 bits of the 16 bit sound latch */ READ8_MEMBER(cave_state::soundlatch_lo_r) { -// m_sound_flag1 = 0; +// m_sound_flag[0] = 0; return m_soundlatch->read(space, offset, 0x00ff) & 0xff; } /* Sound CPU: read the high 8 bits of the 16 bit sound latch */ READ8_MEMBER(cave_state::soundlatch_hi_r) { -// m_sound_flag2 = 0; +// m_sound_flag[1] = 0; return m_soundlatch->read(space, offset, 0xff00) >> 8; } @@ -300,51 +300,45 @@ WRITE8_MEMBER(cave_state::soundlatch_ack_w) ***************************************************************************/ -WRITE16_MEMBER(cave_state::cave_eeprom_msb_w) +void cave_state::eeprom_w(u8 data) { - if (data & ~0xfe00) + if (data & ~0xfe) logerror("%s: Unknown EEPROM bit written %04X\n", machine().describe_context(), data); - if (ACCESSING_BITS_8_15) // even address - { - machine().bookkeeping().coin_lockout_w(1,~data & 0x8000); - machine().bookkeeping().coin_lockout_w(0,~data & 0x4000); - machine().bookkeeping().coin_counter_w(1, data & 0x2000); - machine().bookkeeping().coin_counter_w(0, data & 0x1000); + machine().bookkeeping().coin_lockout_w(1, BIT(~data, 7)); + machine().bookkeeping().coin_lockout_w(0, BIT(~data, 6)); + machine().bookkeeping().coin_counter_w(1, BIT( data, 5)); + machine().bookkeeping().coin_counter_w(0, BIT( data, 4)); - // latch the bit - m_eeprom->di_write((data & 0x0800) >> 11); + // latch the bit + m_eeprom->di_write(BIT(data, 3)); - // reset line asserted: reset. - m_eeprom->cs_write((data & 0x0200) ? ASSERT_LINE : CLEAR_LINE); + // reset line asserted: reset. + m_eeprom->cs_write(BIT(data, 1) ? ASSERT_LINE : CLEAR_LINE); - // clock line asserted: write latch or select next bit to read - m_eeprom->clk_write((data & 0x0400) ? ASSERT_LINE : CLEAR_LINE); - } + // clock line asserted: write latch or select next bit to read + m_eeprom->clk_write(BIT(data, 2) ? ASSERT_LINE : CLEAR_LINE); } -WRITE16_MEMBER(cave_state::sailormn_eeprom_msb_w) +void cave_state::sailormn_eeprom_w(u8 data) { - sailormn_tilebank_w(data & 0x0100); - cave_eeprom_msb_w(space, offset, data & ~0x0100, mem_mask); + sailormn_tilebank_w(BIT(data, 0)); + eeprom_w(data & ~0x01); } -WRITE16_MEMBER(cave_state::hotdogst_eeprom_msb_w) +void cave_state::hotdogst_eeprom_w(u8 data) { - if (ACCESSING_BITS_8_15) // even address - { - // latch the bit - m_eeprom->di_write((data & 0x0800) >> 11); + // latch the bit + m_eeprom->di_write(BIT(data, 3)); - // reset line asserted: reset. - m_eeprom->cs_write((data & 0x0200) ? ASSERT_LINE : CLEAR_LINE); + // reset line asserted: reset. + m_eeprom->cs_write(BIT(data, 1) ? ASSERT_LINE : CLEAR_LINE); - // clock line asserted: write latch or select next bit to read - m_eeprom->clk_write((data & 0x0400) ? ASSERT_LINE : CLEAR_LINE); - } + // clock line asserted: write latch or select next bit to read + m_eeprom->clk_write(BIT(data, 2) ? ASSERT_LINE : CLEAR_LINE); } -WRITE16_MEMBER(cave_state::ppsatan_eeprom_msb_w) +void cave_state::ppsatan_eeprom_w(offs_t offset, u16 data, u16 mem_mask) { if (data & ~0x000f) logerror("%s: Unknown EEPROM bit written %04X\n",machine().describe_context(),data); @@ -365,62 +359,50 @@ WRITE16_MEMBER(cave_state::ppsatan_eeprom_msb_w) } -WRITE16_MEMBER(cave_state::cave_eeprom_lsb_w) +void cave_state::guwange_eeprom_w(u8 data) { - if (data & ~0x00ef) + if (data & ~0xef) logerror("%s: Unknown EEPROM bit written %04X\n",machine().describe_context(),data); - if (ACCESSING_BITS_0_7) // odd address - { - machine().bookkeeping().coin_lockout_w(1, ~data & 0x0008); - machine().bookkeeping().coin_lockout_w(0, ~data & 0x0004); - machine().bookkeeping().coin_counter_w(1, data & 0x0002); - machine().bookkeeping().coin_counter_w(0, data & 0x0001); + machine().bookkeeping().coin_lockout_w(1, BIT(~data, 3)); + machine().bookkeeping().coin_lockout_w(0, BIT(~data, 2)); + machine().bookkeeping().coin_counter_w(1, BIT( data, 1)); + machine().bookkeeping().coin_counter_w(0, BIT( data, 0)); - // latch the bit - m_eeprom->di_write((data & 0x80) >> 7); + // latch the bit + m_eeprom->di_write(BIT(data, 7)); - // reset line asserted: reset. - m_eeprom->cs_write((data & 0x20) ? ASSERT_LINE : CLEAR_LINE); + // reset line asserted: reset. + m_eeprom->cs_write(BIT(data, 5) ? ASSERT_LINE : CLEAR_LINE); - // clock line asserted: write latch or select next bit to read - m_eeprom->clk_write((data & 0x40) ? ASSERT_LINE : CLEAR_LINE); - } + // clock line asserted: write latch or select next bit to read + m_eeprom->clk_write(BIT(data, 6) ? ASSERT_LINE : CLEAR_LINE); } /* - No eeprom or lockouts */ -WRITE16_MEMBER(cave_state::gaia_coin_lsb_w) +void cave_state::gaia_coin_w(u8 data) { - if (ACCESSING_BITS_0_7) // odd address - { - machine().bookkeeping().coin_counter_w(1, data & 0x0002); - machine().bookkeeping().coin_counter_w(0, data & 0x0001); - } + machine().bookkeeping().coin_counter_w(1, BIT(data, 1)); + machine().bookkeeping().coin_counter_w(0, BIT(data, 0)); } /* - No coin lockouts - - Writing 0xcf00 shouldn't send a 1 bit to the EEPROM */ -WRITE16_MEMBER(cave_state::metmqstr_eeprom_msb_w) + - Writing 0xcf shouldn't send a 1 bit to the EEPROM */ +void cave_state::metmqstr_eeprom_w(u8 data) { - if (data & ~0xff00) - logerror("%s: Unknown EEPROM bit written %04X\n", machine().describe_context(), data); + machine().bookkeeping().coin_counter_w(1, BIT(data, 5)); + machine().bookkeeping().coin_counter_w(0, BIT(data, 4)); - if (ACCESSING_BITS_8_15) // even address + if (BIT(~data, 0)) { - machine().bookkeeping().coin_counter_w(1, data & 0x2000); - machine().bookkeeping().coin_counter_w(0, data & 0x1000); - - if (~data & 0x0100) - { - // latch the bit - m_eeprom->di_write((data & 0x0800) >> 11); + // latch the bit + m_eeprom->di_write(BIT(data, 3)); - // reset line asserted: reset. - m_eeprom->cs_write((data & 0x0200) ? ASSERT_LINE : CLEAR_LINE); + // reset line asserted: reset. + m_eeprom->cs_write(BIT(data, 1) ? ASSERT_LINE : CLEAR_LINE); - // clock line asserted: write latch or select next bit to read - m_eeprom->clk_write((data & 0x0400) ? ASSERT_LINE : CLEAR_LINE); - } + // clock line asserted: write latch or select next bit to read + m_eeprom->clk_write(BIT(data, 2) ? ASSERT_LINE : CLEAR_LINE); } } @@ -436,6 +418,7 @@ template WRITE16_MEMBER(cave_state::vram_w) { uint16_t *VRAM = m_vram[Chip]; + int TDIM = m_tiledim[Chip]; tilemap_t *TILEMAP = m_tilemap[Chip]; if ((VRAM[offset] & mem_mask) == (data & mem_mask)) @@ -443,7 +426,7 @@ WRITE16_MEMBER(cave_state::vram_w) COMBINE_DATA(&VRAM[offset]); offset /= 2; - if (offset < 0x1000 / 4) // 16x16 tilemap + if ((offset < 0x1000 / 4) && (TDIM)) // 16x16 tilemap { offset = (offset % (512 / 16)) * 2 + (offset / (512 / 16)) * (512 / 8) * 2; TILEMAP->mark_tile_dirty(offset + 0); @@ -451,7 +434,7 @@ WRITE16_MEMBER(cave_state::vram_w) TILEMAP->mark_tile_dirty(offset + 0 + 512 / 8); TILEMAP->mark_tile_dirty(offset + 1 + 512 / 8); } - else if (offset >= 0x4000 / 4) // 8x8 tilemap + else if ((offset >= 0x4000 / 4) && (!TDIM)) // 8x8 tilemap TILEMAP->mark_tile_dirty(offset - 0x4000 / 4); } @@ -493,22 +476,22 @@ WRITE16_MEMBER(cave_state::vram_8x8_w) void cave_state::dfeveron_map(address_map &map) { - map(0x000000, 0x0fffff).rom(); // ROM - map(0x100000, 0x10ffff).ram(); // RAM - map(0x300000, 0x300003).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)).umask16(0x00ff); // YMZ280 - map(0x400000, 0x40ffff).ram().share("spriteram.0"); // Sprites - map(0x500000, 0x507fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0 - map(0x600000, 0x607fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer 1 - map(0x708000, 0x708fff).ram().share("paletteram.0"); // Palette - map(0x710000, 0x710bff).readonly(); // ? - map(0x710c00, 0x710fff).ram(); // ? - map(0x800000, 0x80007f).writeonly().share("videoregs.0"); // Video Regs - map(0x800000, 0x800007).r(FUNC(cave_state::cave_irq_cause_r)); // IRQ Cause - map(0x900000, 0x900005).ram().share("vctrl.0"); // Layer 0 Control - map(0xa00000, 0xa00005).ram().share("vctrl.1"); // Layer 1 Control - map(0xb00000, 0xb00001).portr("IN0"); // Inputs - map(0xb00002, 0xb00003).portr("IN1"); // Inputs + EEPROM - map(0xc00000, 0xc00001).w(FUNC(cave_state::cave_eeprom_msb_w)); // EEPROM + map(0x000000, 0x0fffff).rom(); // ROM + map(0x100000, 0x10ffff).ram(); // RAM + map(0x300000, 0x300003).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)).umask16(0x00ff); // YMZ280 + map(0x400000, 0x40ffff).ram().share("spriteram.0"); // Sprites + map(0x500000, 0x507fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0 + map(0x600000, 0x607fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer 1 + map(0x708000, 0x708fff).ram().share("paletteram.0"); // Palette + map(0x710000, 0x710bff).readonly(); // ? + map(0x710c00, 0x710fff).ram(); // ? + map(0x800000, 0x80007f).writeonly().share("videoregs.0"); // Video Regs + map(0x800000, 0x800007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause + map(0x900000, 0x900005).ram().share("vctrl.0"); // Layer 0 Control + map(0xa00000, 0xa00005).ram().share("vctrl.1"); // Layer 1 Control + map(0xb00000, 0xb00001).portr("IN0"); // Inputs + map(0xb00002, 0xb00003).portr("IN1"); // Inputs + EEPROM + map(0xc00000, 0xc00000).w(FUNC(cave_state::eeprom_w)); // EEPROM } @@ -518,22 +501,22 @@ void cave_state::dfeveron_map(address_map &map) void cave_state::ddonpach_map(address_map &map) { - map(0x000000, 0x0fffff).rom(); // ROM - map(0x100000, 0x10ffff).ram(); // RAM - map(0x300000, 0x300003).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)).umask16(0x00ff); // YMZ280 - map(0x400000, 0x40ffff).ram().share("spriteram.0"); // Sprites - map(0x500000, 0x507fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0 - map(0x600000, 0x607fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer 1 - map(0x700000, 0x70ffff).ram().w(FUNC(cave_state::vram_8x8_w<2>)).share("vram.2"); // Layer 2 - map(0x800000, 0x80007f).writeonly().share("videoregs.0"); // Video Regs - map(0x800000, 0x800007).r(FUNC(cave_state::cave_irq_cause_r)); // IRQ Cause - map(0x900000, 0x900005).ram().share("vctrl.0"); // Layer 0 Control - map(0xa00000, 0xa00005).ram().share("vctrl.1"); // Layer 1 Control - map(0xb00000, 0xb00005).ram().share("vctrl.2"); // Layer 2 Control - map(0xc00000, 0xc0ffff).ram().share("paletteram.0"); // Palette - map(0xd00000, 0xd00001).portr("IN0"); // Inputs - map(0xd00002, 0xd00003).portr("IN1"); // Inputs + EEPROM - map(0xe00000, 0xe00001).w(FUNC(cave_state::cave_eeprom_msb_w)); // EEPROM + map(0x000000, 0x0fffff).rom(); // ROM + map(0x100000, 0x10ffff).ram(); // RAM + map(0x300000, 0x300003).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)).umask16(0x00ff); // YMZ280 + map(0x400000, 0x40ffff).ram().share("spriteram.0"); // Sprites + map(0x500000, 0x507fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0 + map(0x600000, 0x607fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer 1 + map(0x700000, 0x70ffff).ram().w(FUNC(cave_state::vram_8x8_w<2>)).share("vram.2"); // Layer 2 + map(0x800000, 0x80007f).writeonly().share("videoregs.0"); // Video Regs + map(0x800000, 0x800007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause + map(0x900000, 0x900005).ram().share("vctrl.0"); // Layer 0 Control + map(0xa00000, 0xa00005).ram().share("vctrl.1"); // Layer 1 Control + map(0xb00000, 0xb00005).ram().share("vctrl.2"); // Layer 2 Control + map(0xc00000, 0xc0ffff).ram().share("paletteram.0"); // Palette + map(0xd00000, 0xd00001).portr("IN0"); // Inputs + map(0xd00002, 0xd00003).portr("IN1"); // Inputs + EEPROM + map(0xe00000, 0xe00000).w(FUNC(cave_state::eeprom_w)); // EEPROM } @@ -548,7 +531,7 @@ READ16_MEMBER(cave_state::donpachi_videoregs_r) case 0: case 1: case 2: - case 3: return cave_irq_cause_r(space, offset, 0xffff); + case 3: return irq_cause_r(offset); default: return 0x0000; } @@ -556,23 +539,23 @@ READ16_MEMBER(cave_state::donpachi_videoregs_r) void cave_state::donpachi_map(address_map &map) { - map(0x000000, 0x07ffff).rom(); // ROM - map(0x100000, 0x10ffff).ram(); // RAM - map(0x200000, 0x207fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer 1 - map(0x300000, 0x307fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0 - map(0x400000, 0x407fff).ram().w(FUNC(cave_state::vram_8x8_w<2>)).share("vram.2"); // Layer 2 - map(0x500000, 0x50ffff).ram().share("spriteram.0"); // Sprites - map(0x600000, 0x600005).ram().share("vctrl.1"); // Layer 1 Control - map(0x700000, 0x700005).ram().share("vctrl.0"); // Layer 0 Control - map(0x800000, 0x800005).ram().share("vctrl.2"); // Layer 2 Control - map(0x900000, 0x90007f).ram().r(FUNC(cave_state::donpachi_videoregs_r)).share("videoregs.0"); // Video Regs - map(0xa08000, 0xa08fff).ram().share("paletteram.0"); // Palette - map(0xb00000, 0xb00003).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff); // M6295 - map(0xb00010, 0xb00013).rw("oki2", FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff); // - map(0xb00020, 0xb0002f).w("nmk112", FUNC(nmk112_device::okibank_w)).umask16(0x00ff); // - map(0xc00000, 0xc00001).portr("IN0"); // Inputs - map(0xc00002, 0xc00003).portr("IN1"); // Inputs + EEPROM - map(0xd00000, 0xd00001).w(FUNC(cave_state::cave_eeprom_msb_w)); // EEPROM + map(0x000000, 0x07ffff).rom(); // ROM + map(0x100000, 0x10ffff).ram(); // RAM + map(0x200000, 0x207fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer 1 + map(0x300000, 0x307fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0 + map(0x400000, 0x407fff).ram().w(FUNC(cave_state::vram_8x8_w<2>)).share("vram.2"); // Layer 2 + map(0x500000, 0x50ffff).ram().share("spriteram.0"); // Sprites + map(0x600000, 0x600005).ram().share("vctrl.1"); // Layer 1 Control + map(0x700000, 0x700005).ram().share("vctrl.0"); // Layer 0 Control + map(0x800000, 0x800005).ram().share("vctrl.2"); // Layer 2 Control + map(0x900000, 0x90007f).ram().r(FUNC(cave_state::donpachi_videoregs_r)).share("videoregs.0"); // Video Regs + map(0xa08000, 0xa08fff).ram().share("paletteram.0"); // Palette + map(0xb00000, 0xb00003).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff); // M6295 + map(0xb00010, 0xb00013).rw("oki2", FUNC(okim6295_device::read), FUNC(okim6295_device::write)).umask16(0x00ff); // + map(0xb00020, 0xb0002f).w("nmk112", FUNC(nmk112_device::okibank_w)).umask16(0x00ff); // + map(0xc00000, 0xc00001).portr("IN0"); // Inputs + map(0xc00002, 0xc00003).portr("IN1"); // Inputs + EEPROM + map(0xd00000, 0xd00000).w(FUNC(cave_state::eeprom_w)); // EEPROM } @@ -582,22 +565,22 @@ void cave_state::donpachi_map(address_map &map) void cave_state::esprade_map(address_map &map) { - map(0x000000, 0x0fffff).rom(); // ROM - map(0x100000, 0x10ffff).ram(); // RAM - map(0x300000, 0x300003).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)).umask16(0x00ff); // YMZ280 - map(0x400000, 0x40ffff).ram().share("spriteram.0"); // Sprites - map(0x500000, 0x507fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0 - map(0x600000, 0x607fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer 1 - map(0x700000, 0x707fff).ram().w(FUNC(cave_state::vram_w<2>)).share("vram.2"); // Layer 2 - map(0x800000, 0x80007f).writeonly().share("videoregs.0"); // Video Regs - map(0x800000, 0x800007).r(FUNC(cave_state::cave_irq_cause_r)); // IRQ Cause - map(0x900000, 0x900005).ram().share("vctrl.0"); // Layer 0 Control - map(0xa00000, 0xa00005).ram().share("vctrl.1"); // Layer 1 Control - map(0xb00000, 0xb00005).ram().share("vctrl.2"); // Layer 2 Control - map(0xc00000, 0xc0ffff).ram().share("paletteram.0"); // Palette - map(0xd00000, 0xd00001).portr("IN0"); // Inputs - map(0xd00002, 0xd00003).portr("IN1"); // Inputs + EEPROM - map(0xe00000, 0xe00001).w(FUNC(cave_state::cave_eeprom_msb_w)); // EEPROM + map(0x000000, 0x0fffff).rom(); // ROM + map(0x100000, 0x10ffff).ram(); // RAM + map(0x300000, 0x300003).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)).umask16(0x00ff); // YMZ280 + map(0x400000, 0x40ffff).ram().share("spriteram.0"); // Sprites + map(0x500000, 0x507fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0 + map(0x600000, 0x607fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer 1 + map(0x700000, 0x707fff).ram().w(FUNC(cave_state::vram_w<2>)).share("vram.2"); // Layer 2 + map(0x800000, 0x80007f).writeonly().share("videoregs.0"); // Video Regs + map(0x800000, 0x800007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause + map(0x900000, 0x900005).ram().share("vctrl.0"); // Layer 0 Control + map(0xa00000, 0xa00005).ram().share("vctrl.1"); // Layer 1 Control + map(0xb00000, 0xb00005).ram().share("vctrl.2"); // Layer 2 Control + map(0xc00000, 0xc0ffff).ram().share("paletteram.0"); // Palette + map(0xd00000, 0xd00001).portr("IN0"); // Inputs + map(0xd00002, 0xd00003).portr("IN1"); // Inputs + EEPROM + map(0xe00000, 0xe00000).w(FUNC(cave_state::eeprom_w)); // EEPROM } @@ -607,27 +590,27 @@ void cave_state::esprade_map(address_map &map) void cave_state::gaia_map(address_map &map) { - map(0x000000, 0x0fffff).rom(); // ROM - map(0x100000, 0x10ffff).ram(); // RAM - map(0x300000, 0x300003).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)).umask16(0x00ff); // YMZ280 - map(0x400000, 0x40ffff).ram().share("spriteram.0"); // Sprite - map(0x500000, 0x507fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0 - map(0x508000, 0x50ffff).ram(); // More Layer 0, Tested but not used? - map(0x600000, 0x607fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer 1 - map(0x608000, 0x60ffff).ram(); // More Layer 1, Tested but not used? - map(0x700000, 0x707fff).ram().w(FUNC(cave_state::vram_w<2>)).share("vram.2"); // Layer 2 - map(0x708000, 0x70ffff).ram(); // More Layer 2, Tested but not used? - map(0x800000, 0x80007f).writeonly().share("videoregs.0"); // Video Regs - map(0x800000, 0x800007).r(FUNC(cave_state::cave_irq_cause_r)); // IRQ Cause - map(0x900000, 0x900005).ram().share("vctrl.0"); // Layer 0 Control - map(0xa00000, 0xa00005).ram().share("vctrl.1"); // Layer 1 Control - map(0xb00000, 0xb00005).ram().share("vctrl.2"); // Layer 2 Control - map(0xc00000, 0xc0ffff).ram().share("paletteram.0"); // Palette - map(0xd00010, 0xd00011).portr("IN0"); // Inputs - map(0xd00010, 0xd00011).w(FUNC(cave_state::gaia_coin_lsb_w)); // Coin counter only - map(0xd00012, 0xd00013).portr("IN1"); // Inputs - map(0xd00014, 0xd00015).portr("DSW"); // Dips - map(0xd00014, 0xd00015).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); // Watchdog? + map(0x000000, 0x0fffff).rom(); // ROM + map(0x100000, 0x10ffff).ram(); // RAM + map(0x300000, 0x300003).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)).umask16(0x00ff); // YMZ280 + map(0x400000, 0x40ffff).ram().share("spriteram.0"); // Sprite + map(0x500000, 0x507fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0 + map(0x508000, 0x50ffff).ram(); // More Layer 0, Tested but not used? + map(0x600000, 0x607fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer 1 + map(0x608000, 0x60ffff).ram(); // More Layer 1, Tested but not used? + map(0x700000, 0x707fff).ram().w(FUNC(cave_state::vram_w<2>)).share("vram.2"); // Layer 2 + map(0x708000, 0x70ffff).ram(); // More Layer 2, Tested but not used? + map(0x800000, 0x80007f).writeonly().share("videoregs.0"); // Video Regs + map(0x800000, 0x800007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause + map(0x900000, 0x900005).ram().share("vctrl.0"); // Layer 0 Control + map(0xa00000, 0xa00005).ram().share("vctrl.1"); // Layer 1 Control + map(0xb00000, 0xb00005).ram().share("vctrl.2"); // Layer 2 Control + map(0xc00000, 0xc0ffff).ram().share("paletteram.0"); // Palette + map(0xd00010, 0xd00011).portr("IN0"); // Inputs + map(0xd00011, 0xd00011).w(FUNC(cave_state::gaia_coin_w)); // Coin counter only + map(0xd00012, 0xd00013).portr("IN1"); // Inputs + map(0xd00014, 0xd00015).portr("DSW"); // Dips + map(0xd00014, 0xd00015).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); // Watchdog? } @@ -637,24 +620,24 @@ void cave_state::gaia_map(address_map &map) void cave_state::guwange_map(address_map &map) { - map(0x000000, 0x0fffff).rom(); // ROM - map(0x200000, 0x20ffff).ram(); // RAM - map(0x300000, 0x30007f).writeonly().share("videoregs.0"); // Video Regs - map(0x300000, 0x300007).r(FUNC(cave_state::cave_irq_cause_r)); // IRQ Cause - map(0x400000, 0x40ffff).ram().share("spriteram.0"); // Sprites - map(0x500000, 0x507fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0 - map(0x600000, 0x607fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer 1 - map(0x700000, 0x707fff).ram().w(FUNC(cave_state::vram_w<2>)).share("vram.2"); // Layer 2 - map(0x800000, 0x800003).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)).umask16(0x00ff); // YMZ280 - map(0x900000, 0x900005).ram().share("vctrl.0"); // Layer 0 Control - map(0xa00000, 0xa00005).ram().share("vctrl.1"); // Layer 1 Control - map(0xb00000, 0xb00005).ram().share("vctrl.2"); // Layer 2 Control -/**/map(0xc00000, 0xc0ffff).ram().share("paletteram.0"); // Palette - map(0xd00010, 0xd00011).portr("IN0"); // Inputs - map(0xd00010, 0xd00011).w(FUNC(cave_state::cave_eeprom_lsb_w)); // EEPROM - map(0xd00012, 0xd00013).portr("IN1"); // Inputs + EEPROM -// AM_RANGE(0xd00012, 0xd00013) AM_WRITENOP // ? -// AM_RANGE(0xd00014, 0xd00015) AM_WRITENOP // ? $800068 in dfeveron ? probably Watchdog + map(0x000000, 0x0fffff).rom(); // ROM + map(0x200000, 0x20ffff).ram(); // RAM + map(0x300000, 0x30007f).writeonly().share("videoregs.0"); // Video Regs + map(0x300000, 0x300007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause + map(0x400000, 0x40ffff).ram().share("spriteram.0"); // Sprites + map(0x500000, 0x507fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0 + map(0x600000, 0x607fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer 1 + map(0x700000, 0x707fff).ram().w(FUNC(cave_state::vram_w<2>)).share("vram.2"); // Layer 2 + map(0x800000, 0x800003).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)).umask16(0x00ff); // YMZ280 + map(0x900000, 0x900005).ram().share("vctrl.0"); // Layer 0 Control + map(0xa00000, 0xa00005).ram().share("vctrl.1"); // Layer 1 Control + map(0xb00000, 0xb00005).ram().share("vctrl.2"); // Layer 2 Control +/**/map(0xc00000, 0xc0ffff).ram().share("paletteram.0"); // Palette + map(0xd00010, 0xd00011).portr("IN0"); // Inputs + map(0xd00011, 0xd00011).w(FUNC(cave_state::guwange_eeprom_w)); // EEPROM + map(0xd00012, 0xd00013).portr("IN1"); // Inputs + EEPROM +// map(0xd00012, 0xd00013).nopw(); // ? +// map(0xd00014, 0xd00015).nopw(); // ? $800068 in dfeveron ? probably Watchdog } @@ -671,15 +654,15 @@ void cave_state::hotdogst_map(address_map &map) map(0x900000, 0x907fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer 1 map(0x980000, 0x987fff).ram().w(FUNC(cave_state::vram_w<2>)).share("vram.2"); // Layer 2 map(0xa80000, 0xa8007f).writeonly().share("videoregs.0"); // Video Regs - map(0xa80000, 0xa80007).r(FUNC(cave_state::cave_irq_cause_r)); // IRQ Cause -// AM_RANGE(0xa8006e, 0xa8006f) AM_READ(soundlatch_ack_r) // From Sound CPU + map(0xa80000, 0xa80007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause +// map(0xa8006e, 0xa8006f).r(FUNC(cave_state::soundlatch_ack_r)); // From Sound CPU map(0xa8006e, 0xa8006f).w(FUNC(cave_state::sound_cmd_w)); // To Sound CPU map(0xb00000, 0xb00005).ram().share("vctrl.0"); // Layer 0 Control map(0xb80000, 0xb80005).ram().share("vctrl.1"); // Layer 1 Control map(0xc00000, 0xc00005).ram().share("vctrl.2"); // Layer 2 Control map(0xc80000, 0xc80001).portr("IN0"); // Inputs map(0xc80002, 0xc80003).portr("IN1"); // Inputs + EEPROM - map(0xd00000, 0xd00001).w(FUNC(cave_state::hotdogst_eeprom_msb_w)); // EEPROM + map(0xd00000, 0xd00000).w(FUNC(cave_state::hotdogst_eeprom_w)); // EEPROM map(0xd00002, 0xd00003).nopw(); // ??? map(0xf00000, 0xf0ffff).ram().share("spriteram.0"); // Sprites } @@ -720,7 +703,7 @@ WRITE16_MEMBER(cave_state::korokoro_leds_w) } -WRITE16_MEMBER(cave_state::korokoro_eeprom_msb_w) +void cave_state::korokoro_eeprom_w(offs_t offset, u16 data, u16 mem_mask) { if (data & ~0x7000) { @@ -757,14 +740,14 @@ void cave_state::korokoro_map(address_map &map) map(0x140000, 0x140005).writeonly().share("vctrl.0"); // Layer 0 Control map(0x180000, 0x187fff).writeonly().share("spriteram.0"); // Sprites map(0x1c0000, 0x1c007f).writeonly().share("videoregs.0"); // Video Regs - map(0x1c0000, 0x1c0007).r(FUNC(cave_state::cave_irq_cause_r)); // IRQ Cause + map(0x1c0000, 0x1c0007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause map(0x200000, 0x207fff).writeonly().share("paletteram.0"); // Palette -// AM_RANGE(0x240000, 0x240003) AM_DEVREAD8("ymz", ymz280b_device, read, 0x00ff) // YMZ280 +// map(0x240000, 0x240003).r("ymz", FUNC(ymz280b_device::read)).umask16(0x00ff); // YMZ280 map(0x240000, 0x240003).w("ymz", FUNC(ymz280b_device::write)).umask16(0x00ff); // YMZ280 map(0x280000, 0x280001).portr("IN0"); // Inputs + ??? map(0x280002, 0x280003).portr("IN1"); // Inputs + EEPROM map(0x280008, 0x280009).w(FUNC(cave_state::korokoro_leds_w)); // Leds - map(0x28000a, 0x28000b).w(FUNC(cave_state::korokoro_eeprom_msb_w)); // EEPROM + map(0x28000a, 0x28000b).w(FUNC(cave_state::korokoro_eeprom_w)); // EEPROM map(0x28000c, 0x28000d).nopw(); // 0 (watchdog?) map(0x300000, 0x30ffff).ram(); // RAM } @@ -780,10 +763,10 @@ void cave_state::crusherm_map(address_map &map) map(0x280000, 0x280001).portr("IN0"); // Inputs + ??? map(0x280002, 0x280003).portr("IN1"); // Inputs + EEPROM map(0x280008, 0x280009).w(FUNC(cave_state::korokoro_leds_w)); // Leds - map(0x28000a, 0x28000b).w(FUNC(cave_state::korokoro_eeprom_msb_w)); // EEPROM + map(0x28000a, 0x28000b).w(FUNC(cave_state::korokoro_eeprom_w)); // EEPROM map(0x28000c, 0x28000d).nopw(); // 0 (watchdog?) map(0x300000, 0x30007f).writeonly().share("videoregs.0"); // Video Regs - map(0x300000, 0x300007).r(FUNC(cave_state::cave_irq_cause_r)); // IRQ Cause + map(0x300000, 0x300007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause map(0x340000, 0x34ffff).ram(); // RAM } @@ -797,7 +780,7 @@ void cave_state::mazinger_map(address_map &map) map(0x100000, 0x10ffff).ram(); // RAM map(0x200000, 0x20ffff).ram().share("spriteram.0"); // Sprites map(0x300000, 0x30007f).writeonly().share("videoregs.0"); // Video Regs - map(0x300000, 0x300007).r(FUNC(cave_state::cave_irq_cause_r)); // IRQ Cause + map(0x300000, 0x300007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause map(0x300068, 0x300069).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); // Watchdog map(0x30006e, 0x30006f).rw(FUNC(cave_state::soundlatch_ack_r), FUNC(cave_state::sound_cmd_w)); // From Sound CPU map(0x400000, 0x407fff).ram().w(FUNC(cave_state::vram_8x8_w<1>)).share("vram.1"); // Layer 1 @@ -806,7 +789,7 @@ void cave_state::mazinger_map(address_map &map) map(0x700000, 0x700005).ram().share("vctrl.0"); // Layer 0 Control map(0x800000, 0x800001).portr("IN0"); // Inputs map(0x800002, 0x800003).portr("IN1"); // Inputs + EEPROM - map(0x900000, 0x900001).w(FUNC(cave_state::cave_eeprom_msb_w)); // EEPROM + map(0x900000, 0x900000).w(FUNC(cave_state::eeprom_w)); // EEPROM map(0xc08000, 0xc0ffff).ram().share("paletteram.0"); // Palette map(0xd00000, 0xd7ffff).rom().region("user1", 0); // extra data ROM } @@ -830,7 +813,7 @@ void cave_state::metmqstr_map(address_map &map) map(0x980000, 0x987fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0 map(0x988000, 0x98ffff).ram(); // map(0xa80000, 0xa8007f).writeonly().share("videoregs.0"); // Video Regs - map(0xa80000, 0xa80007).r(FUNC(cave_state::cave_irq_cause_r)); // IRQ Cause + map(0xa80000, 0xa80007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause map(0xa80068, 0xa80069).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); // Watchdog? map(0xa8006c, 0xa8006d).r(FUNC(cave_state::soundflags_ack_r)).nopw(); // Communication map(0xa8006e, 0xa8006f).rw(FUNC(cave_state::soundlatch_ack_r), FUNC(cave_state::sound_cmd_w)); // From Sound CPU @@ -839,7 +822,7 @@ void cave_state::metmqstr_map(address_map &map) map(0xc00000, 0xc00005).ram().share("vctrl.0"); // Layer 0 Control map(0xc80000, 0xc80001).portr("IN0"); // Inputs map(0xc80002, 0xc80003).portr("IN1"); // Inputs + EEPROM - map(0xd00000, 0xd00001).w(FUNC(cave_state::metmqstr_eeprom_msb_w)); // EEPROM + map(0xd00000, 0xd00000).w(FUNC(cave_state::metmqstr_eeprom_w)); // EEPROM map(0xf00000, 0xf0ffff).ram().share("spriteram.0"); // Sprites } @@ -927,44 +910,44 @@ WRITE16_MEMBER(cave_state::ppsatan_out_w) void cave_state::ppsatan_map(address_map &map) { - map(0x000000, 0x03ffff).rom(); // ROM - map(0x040000, 0x04ffff).ram(); // RAM + map(0x000000, 0x03ffff).rom(); // ROM + map(0x040000, 0x04ffff).ram(); // RAM // Left Screen (Player 2) - map(0x080000, 0x080005).ram().share("vctrl.1"); // Layer Control - map(0x100000, 0x107fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer -// AM_RANGE(0x180000, 0x1803ff) AM_RAM // Palette (Tilemaps) -// AM_RANGE(0x187800, 0x188fff) AM_RAM AM_SHARE("paletteram.1") // Palette (Sprites) - map(0x180000, 0x188fff).ram().share("paletteram.1"); // Palette - map(0x1c0000, 0x1c7fff).ram().share("spriteram.1"); // Sprites - map(0x200000, 0x200001).portr("SYSTEM"); // DSW + (unused) EEPROM - map(0x200000, 0x200001).w(FUNC(cave_state::ppsatan_out_w)); // Outputs + OKI banking - map(0x200002, 0x200003).rw(FUNC(cave_state::ppsatan_touch2_r), FUNC(cave_state::ppsatan_eeprom_msb_w)); // Touch Screen + (unused) EEPROM + map(0x080000, 0x080005).ram().share("vctrl.1"); // Layer Control + map(0x100000, 0x107fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer +// map(0x180000, 0x1803ff).ram() // Palette (Tilemaps) +// map(0x187800, 0x188fff).ram().share("paletteram.1"); // Palette (Sprites) + map(0x180000, 0x188fff).ram().share("paletteram.1"); // Palette + map(0x1c0000, 0x1c7fff).ram().share("spriteram.1"); // Sprites + map(0x200000, 0x200001).portr("SYSTEM"); // DSW + (unused) EEPROM + map(0x200000, 0x200001).w(FUNC(cave_state::ppsatan_out_w)); // Outputs + OKI banking + map(0x200002, 0x200003).rw(FUNC(cave_state::ppsatan_touch2_r), FUNC(cave_state::ppsatan_eeprom_w)); // Touch Screen + (unused) EEPROM map(0x200004, 0x200005).rw(FUNC(cave_state::ppsatan_touch1_r), FUNC(cave_state::ppsatan_io_mux_w)); // Touch Screen - map(0x200006, 0x200007).nopw(); // Lev. 2 IRQ Ack? - map(0x2c0000, 0x2c007f).writeonly().share("videoregs.1"); // Video Regs - map(0x2c0000, 0x2c0007).r(FUNC(cave_state::cave_irq_cause_r)); // IRQ Cause - map(0x2c0068, 0x2c0069).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); // Watchdog + map(0x200006, 0x200007).nopw(); // Lev. 2 IRQ Ack? + map(0x2c0000, 0x2c007f).writeonly().share("videoregs.1"); // Video Regs + map(0x2c0000, 0x2c0007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause + map(0x2c0068, 0x2c0069).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); // Watchdog - map(0x300001, 0x300001).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // M6295 + map(0x300001, 0x300001).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // M6295 // Right Screen (Player 1) - map(0x480000, 0x480005).ram().share("vctrl.2"); // Layer Control - map(0x500000, 0x507fff).ram().w(FUNC(cave_state::vram_w<2>)).share("vram.2"); // Layer -// AM_RANGE(0x580000, 0x5803ff) AM_RAM // Palette (Tilemaps) -// AM_RANGE(0x587800, 0x588fff) AM_RAM //AM_SHARE("paletteram.2") // Palette (Sprites) - map(0x580000, 0x588fff).ram().share("paletteram.2"); // Palette - map(0x5c0000, 0x5c7fff).ram().share("spriteram.2"); // Sprites - map(0x6c0000, 0x6c007f).writeonly().share("videoregs.2"); // Video Regs + map(0x480000, 0x480005).ram().share("vctrl.2"); // Layer Control + map(0x500000, 0x507fff).ram().w(FUNC(cave_state::vram_w<2>)).share("vram.2"); // Layer +// map(0x580000, 0x5803ff).ram() // Palette (Tilemaps) +// map(0x587800, 0x588fff).ram().share("paletteram.2"); // Palette (Sprites) + map(0x580000, 0x588fff).ram().share("paletteram.2"); // Palette + map(0x5c0000, 0x5c7fff).ram().share("spriteram.2"); // Sprites + map(0x6c0000, 0x6c007f).writeonly().share("videoregs.2"); // Video Regs // Top Screen - map(0x880000, 0x880005).ram().share("vctrl.0"); // Layer Control - map(0x900000, 0x907fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer -// AM_RANGE(0x980000, 0x9803ff) AM_RAM // Palette (Tilemaps) -// AM_RANGE(0x987800, 0x988fff) AM_RAM AM_SHARE("paletteram.0") // Palette (Sprites) - map(0x980000, 0x988fff).ram().share("paletteram.0"); // Palette - map(0x9c0000, 0x9c7fff).ram().share("spriteram.0"); // Sprites - map(0xac0000, 0xac007f).writeonly().share("videoregs.0"); // Video Regs + map(0x880000, 0x880005).ram().share("vctrl.0"); // Layer Control + map(0x900000, 0x907fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer +// map(0x980000, 0x9803ff).ram(); // Palette (Tilemaps) +// map(0x987800, 0x988fff).ram().share("paletteram.0"); // Palette (Sprites) + map(0x980000, 0x988fff).ram().share("paletteram.0"); // Palette + map(0x9c0000, 0x9c7fff).ram().share("spriteram.0"); // Sprites + map(0xac0000, 0xac007f).writeonly().share("videoregs.0"); // Video Regs } @@ -997,26 +980,26 @@ WRITE16_MEMBER(cave_state::pwrinst2_vctrl_w) void cave_state::pwrinst2_map(address_map &map) { - map(0x000000, 0x1fffff).rom(); // ROM - map(0x400000, 0x40ffff).ram(); // RAM - map(0x500000, 0x500001).portr("IN0"); // Inputs - map(0x500002, 0x500003).portr("IN1"); // - map(0x600000, 0x6fffff).rom().region("user1", 0); // extra data ROM space - map(0x700000, 0x700001).w(FUNC(cave_state::cave_eeprom_msb_w)); // EEPROM - map(0x800000, 0x807fff).ram().w(FUNC(cave_state::vram_w<2>)).share("vram.2"); // Layer 2 - map(0x880000, 0x887fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0 - map(0x900000, 0x907fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer 1 - map(0x980000, 0x987fff).ram().w(FUNC(cave_state::vram_8x8_w<3>)).share("vram.3"); // Layer 3 - map(0xa00000, 0xa0ffff).ram().share("spriteram.0"); // Sprites - map(0xa10000, 0xa1ffff).ram(); // Sprites? - map(0xa80000, 0xa8007f).ram().r(FUNC(cave_state::donpachi_videoregs_r)).share("videoregs.0"); // Video Regs + map(0x000000, 0x1fffff).rom(); // ROM + map(0x400000, 0x40ffff).ram(); // RAM + map(0x500000, 0x500001).portr("IN0"); // Inputs + map(0x500002, 0x500003).portr("IN1"); // + map(0x600000, 0x6fffff).rom().region("user1", 0); // extra data ROM space + map(0x700000, 0x700000).w(FUNC(cave_state::eeprom_w)); // EEPROM + map(0x800000, 0x807fff).ram().w(FUNC(cave_state::vram_w<2>)).share("vram.2"); // Layer 2 + map(0x880000, 0x887fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0 + map(0x900000, 0x907fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer 1 + map(0x980000, 0x987fff).ram().w(FUNC(cave_state::vram_8x8_w<3>)).share("vram.3"); // Layer 3 + map(0xa00000, 0xa0ffff).ram().share("spriteram.0"); // Sprites + map(0xa10000, 0xa1ffff).ram(); // Sprites? + map(0xa80000, 0xa8007f).ram().r(FUNC(cave_state::donpachi_videoregs_r)).share("videoregs.0"); // Video Regs map(0xb00000, 0xb00005).ram().w(FUNC(cave_state::pwrinst2_vctrl_w<2>)).share("vctrl.2"); // Layer 2 Control map(0xb80000, 0xb80005).ram().w(FUNC(cave_state::pwrinst2_vctrl_w<0>)).share("vctrl.0"); // Layer 0 Control map(0xc00000, 0xc00005).ram().w(FUNC(cave_state::pwrinst2_vctrl_w<1>)).share("vctrl.1"); // Layer 1 Control map(0xc80000, 0xc80005).ram().w(FUNC(cave_state::pwrinst2_vctrl_w<3>)).share("vctrl.3"); // Layer 3 Control - map(0xd80000, 0xd80001).r(FUNC(cave_state::soundlatch_ack_r)); // ? From Sound CPU - map(0xe00000, 0xe00001).w(FUNC(cave_state::sound_cmd_w)); // To Sound CPU - map(0xe80000, 0xe80001).r(FUNC(cave_state::pwrinst2_eeprom_r)); // EEPROM + map(0xd80000, 0xd80001).r(FUNC(cave_state::soundlatch_ack_r)); // ? From Sound CPU + map(0xe00000, 0xe00001).w(FUNC(cave_state::sound_cmd_w)); // To Sound CPU + map(0xe80000, 0xe80001).r(FUNC(cave_state::pwrinst2_eeprom_r)); // EEPROM map(0xf00000, 0xf04fff).ram().share("paletteram.0"); // Palette } @@ -1033,31 +1016,31 @@ READ16_MEMBER(cave_state::sailormn_input0_r) void cave_state::sailormn_map(address_map &map) { - map(0x000000, 0x07ffff).rom(); // ROM - map(0x100000, 0x10ffff).ram(); // RAM - map(0x110000, 0x110001).ram(); // (agallet) - map(0x200000, 0x3fffff).rom(); // ROM - map(0x400000, 0x407fff).ram(); // (agallet) - map(0x408000, 0x40bfff).ram().share("paletteram.0"); // Palette - map(0x40c000, 0x40ffff).ram(); // (agallet) - map(0x410000, 0x410001).ram(); // (agallet) - map(0x500000, 0x50ffff).ram().share("spriteram.0"); // Sprites - map(0x510000, 0x510001).ram(); // (agallet) - map(0x600000, 0x600001).r(FUNC(cave_state::sailormn_input0_r)); // Inputs + Watchdog! - map(0x600002, 0x600003).portr("IN1"); // Inputs + EEPROM - map(0x700000, 0x700001).w(FUNC(cave_state::sailormn_eeprom_msb_w)); // EEPROM + map(0x000000, 0x07ffff).rom(); // ROM + map(0x100000, 0x10ffff).ram(); // RAM + map(0x110000, 0x110001).ram(); // (agallet) + map(0x200000, 0x3fffff).rom(); // ROM + map(0x400000, 0x407fff).ram(); // (agallet) + map(0x408000, 0x40bfff).ram().share("paletteram.0"); // Palette + map(0x40c000, 0x40ffff).ram(); // (agallet) + map(0x410000, 0x410001).ram(); // (agallet) + map(0x500000, 0x50ffff).ram().share("spriteram.0"); // Sprites + map(0x510000, 0x510001).ram(); // (agallet) + map(0x600000, 0x600001).r(FUNC(cave_state::sailormn_input0_r)); // Inputs + Watchdog! + map(0x600002, 0x600003).portr("IN1"); // Inputs + EEPROM + map(0x700000, 0x700000).w(FUNC(cave_state::sailormn_eeprom_w)); // EEPROM map(0x800000, 0x807fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0 map(0x880000, 0x887fff).ram().w(FUNC(cave_state::vram_w<1>)).share("vram.1"); // Layer 1 map(0x900000, 0x907fff).ram().w(FUNC(cave_state::vram_w<2>)).share("vram.2"); // Layer 2 - map(0x908000, 0x908001).ram(); // (agallet) - map(0xa00000, 0xa00005).ram().share("vctrl.0"); // Layer 0 Control - map(0xa80000, 0xa80005).ram().share("vctrl.1"); // Layer 1 Control - map(0xb00000, 0xb00005).ram().share("vctrl.2"); // Layer 2 Control - map(0xb80000, 0xb8007f).writeonly().share("videoregs.0"); // Video Regs - map(0xb80000, 0xb80007).r(FUNC(cave_state::cave_irq_cause_r)); // IRQ Cause (bit 2 tested!) - map(0xb8006c, 0xb8006d).r(FUNC(cave_state::soundflags_ack_r)); // Communication - map(0xb8006e, 0xb8006f).r(FUNC(cave_state::soundlatch_ack_r)); // From Sound CPU - map(0xb8006e, 0xb8006f).w(FUNC(cave_state::sound_cmd_w)); // To Sound CPU + map(0x908000, 0x908001).ram(); // (agallet) + map(0xa00000, 0xa00005).ram().share("vctrl.0"); // Layer 0 Control + map(0xa80000, 0xa80005).ram().share("vctrl.1"); // Layer 1 Control + map(0xb00000, 0xb00005).ram().share("vctrl.2"); // Layer 2 Control + map(0xb80000, 0xb8007f).writeonly().share("videoregs.0"); // Video Regs + map(0xb80000, 0xb80007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause (bit 2 tested!) + map(0xb8006c, 0xb8006d).r(FUNC(cave_state::soundflags_ack_r)); // Communication + map(0xb8006e, 0xb8006f).r(FUNC(cave_state::soundlatch_ack_r)); // From Sound CPU + map(0xb8006e, 0xb8006f).w(FUNC(cave_state::sound_cmd_w)); // To Sound CPU } @@ -1067,20 +1050,20 @@ void cave_state::sailormn_map(address_map &map) void cave_state::tekkencw_map(address_map &map) { - map(0x000000, 0x07ffff).rom(); // ROM - map(0x100000, 0x10ffff).ram().share("nvram"); // RAM (battery) - map(0x200000, 0x20ffff).ram().share("spriteram.0"); // Sprites - map(0x300000, 0x307fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0 - map(0x400000, 0x400001).portr("IN0"); // Inputs + EEPROM + Hopper - map(0x400002, 0x400003).portr("IN1"); // Inputs - map(0x500000, 0x500005).writeonly().share("vctrl.0"); // Layer 0 Control - map(0x600000, 0x60ffff).ram().share("paletteram.0"); // Palette - map(0x700000, 0x70007f).writeonly().share("videoregs.0"); // Video Regs - map(0x700000, 0x700007).r(FUNC(cave_state::cave_irq_cause_r)); // IRQ Cause - map(0x700068, 0x700069).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); // Watchdog + map(0x000000, 0x07ffff).rom(); // ROM + map(0x100000, 0x10ffff).ram().share("nvram"); // RAM (battery) + map(0x200000, 0x20ffff).ram().share("spriteram.0"); // Sprites + map(0x300000, 0x307fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0 + map(0x400000, 0x400001).portr("IN0"); // Inputs + EEPROM + Hopper + map(0x400002, 0x400003).portr("IN1"); // Inputs + map(0x500000, 0x500005).writeonly().share("vctrl.0"); // Layer 0 Control + map(0x600000, 0x60ffff).ram().share("paletteram.0"); // Palette + map(0x700000, 0x70007f).writeonly().share("videoregs.0"); // Video Regs + map(0x700000, 0x700007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause + map(0x700068, 0x700069).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); // Watchdog map(0x800001, 0x800001).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // M6295 - map(0xc00000, 0xc00001).w(FUNC(cave_state::tjumpman_leds_w)); // Leds + Hopper - map(0xe00000, 0xe00001).w(FUNC(cave_state::tjumpman_eeprom_lsb_w)); // EEPROM + map(0xc00001, 0xc00001).w(FUNC(cave_state::tjumpman_leds_w)); // Leds + Hopper + map(0xe00001, 0xe00001).w(FUNC(cave_state::tjumpman_eeprom_w)); // EEPROM } @@ -1090,20 +1073,20 @@ void cave_state::tekkencw_map(address_map &map) void cave_state::tekkenbs_map(address_map &map) { - map(0x000000, 0x07ffff).rom(); // ROM - map(0x100000, 0x10ffff).ram().share("nvram"); // RAM (battery) - map(0x200000, 0x20ffff).ram().share("spriteram.0"); // Sprites - map(0x300000, 0x307fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0 - map(0x400000, 0x40ffff).ram().share("paletteram.0"); // Palette - map(0x500000, 0x500005).writeonly().share("vctrl.0"); // Layer 0 Control - map(0x600000, 0x600001).portr("IN0"); // Inputs + EEPROM + Hopper - map(0x600002, 0x600003).portr("IN1"); // Inputs - map(0x700000, 0x70007f).writeonly().share("videoregs.0"); // Video Regs - map(0x700000, 0x700007).r(FUNC(cave_state::cave_irq_cause_r)); // IRQ Cause - map(0x700068, 0x700069).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); // Watchdog + map(0x000000, 0x07ffff).rom(); // ROM + map(0x100000, 0x10ffff).ram().share("nvram"); // RAM (battery) + map(0x200000, 0x20ffff).ram().share("spriteram.0"); // Sprites + map(0x300000, 0x307fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0 + map(0x400000, 0x40ffff).ram().share("paletteram.0"); // Palette + map(0x500000, 0x500005).writeonly().share("vctrl.0"); // Layer 0 Control + map(0x600000, 0x600001).portr("IN0"); // Inputs + EEPROM + Hopper + map(0x600002, 0x600003).portr("IN1"); // Inputs + map(0x700000, 0x70007f).writeonly().share("videoregs.0"); // Video Regs + map(0x700000, 0x700007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause + map(0x700068, 0x700069).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); // Watchdog map(0x800001, 0x800001).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // M6295 - map(0xc00000, 0xc00001).w(FUNC(cave_state::tjumpman_leds_w)); // Leds + Hopper - map(0xe00000, 0xe00001).w(FUNC(cave_state::tjumpman_eeprom_lsb_w)); // EEPROM + map(0xc00001, 0xc00001).w(FUNC(cave_state::tjumpman_leds_w)); // Leds + Hopper + map(0xe00001, 0xe00001).w(FUNC(cave_state::tjumpman_eeprom_w)); // EEPROM } @@ -1111,37 +1094,31 @@ void cave_state::tekkenbs_map(address_map &map) Tobikose! Jumpman ***************************************************************************/ -WRITE16_MEMBER(cave_state::tjumpman_eeprom_lsb_w) +void cave_state::tjumpman_eeprom_w(u8 data) { - if (data & ~0x0038) + if (data & ~0x38) logerror("%s: Unknown EEPROM bit written %04X\n",machine().describe_context(),data); - if (ACCESSING_BITS_0_7) // odd address - { - // latch the bit - m_eeprom->di_write((data & 0x0020) >> 5); + // latch the bit + m_eeprom->di_write(BIT(data, 5)); - // reset line asserted: reset. - m_eeprom->cs_write((data & 0x0008) ? ASSERT_LINE : CLEAR_LINE); + // reset line asserted: reset. + m_eeprom->cs_write(BIT(data, 3) ? ASSERT_LINE : CLEAR_LINE); - // clock line asserted: write latch or select next bit to read - m_eeprom->clk_write((data & 0x0010) ? ASSERT_LINE : CLEAR_LINE); - } + // clock line asserted: write latch or select next bit to read + m_eeprom->clk_write(BIT(data, 4) ? ASSERT_LINE : CLEAR_LINE); } -WRITE16_MEMBER(cave_state::tjumpman_leds_w) +void cave_state::tjumpman_leds_w(u8 data) { - if (ACCESSING_BITS_0_7) - { - m_led_outputs[0] = BIT(data, 0); // suru - m_led_outputs[1] = BIT(data, 1); // shinai - m_led_outputs[2] = BIT(data, 2); // payout - m_led_outputs[3] = BIT(data, 3); // go - m_led_outputs[4] = BIT(data, 4); // 1 bet - m_led_outputs[5] = BIT(data, 5); // medal - m_hopper = BIT(data, 6); // hopper - m_led_outputs[6] = BIT(data, 7); // 3 bet - } + m_led_outputs[0] = BIT(data, 0); // suru + m_led_outputs[1] = BIT(data, 1); // shinai + m_led_outputs[2] = BIT(data, 2); // payout + m_led_outputs[3] = BIT(data, 3); // go + m_led_outputs[4] = BIT(data, 4); // 1 bet + m_led_outputs[5] = BIT(data, 5); // medal + m_hopper = BIT(data, 6); // hopper + m_led_outputs[6] = BIT(data, 7); // 3 bet // popmessage("led %04X", data); } @@ -1154,20 +1131,20 @@ CUSTOM_INPUT_MEMBER(cave_state::tjumpman_hopper_r) void cave_state::tjumpman_map(address_map &map) { map(0x000000, 0x07ffff).rom(); // ROM - map(0x100000, 0x10ffff).ram().share("nvram"); // RAM (battery) - map(0x200000, 0x20ffff).ram().share("spriteram.0"); // Sprites - map(0x300000, 0x307fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0 - map(0x304000, 0x307fff).w(FUNC(cave_state::vram_w<0>)); // Layer 0 - 16x16 tiles mapped here - map(0x400000, 0x400005).writeonly().share("vctrl.0"); // Layer 0 Control - map(0x500000, 0x50ffff).ram().share("paletteram.0"); // Palette - map(0x600000, 0x600001).portr("IN0"); // Inputs + EEPROM + Hopper - map(0x600002, 0x600003).portr("IN1"); // Inputs - map(0x700000, 0x70007f).writeonly().share("videoregs.0"); // Video Regs - map(0x700000, 0x700007).r(FUNC(cave_state::cave_irq_cause_r)); // IRQ Cause - map(0x700068, 0x700069).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); // Watchdog + map(0x100000, 0x10ffff).ram().share("nvram"); // RAM (battery) + map(0x200000, 0x20ffff).ram().share("spriteram.0"); // Sprites + map(0x300000, 0x307fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0 + map(0x304000, 0x307fff).w(FUNC(cave_state::vram_w<0>)); // Layer 0 - 16x16 tiles mapped here + map(0x400000, 0x400005).writeonly().share("vctrl.0"); // Layer 0 Control + map(0x500000, 0x50ffff).ram().share("paletteram.0"); // Palette + map(0x600000, 0x600001).portr("IN0"); // Inputs + EEPROM + Hopper + map(0x600002, 0x600003).portr("IN1"); // Inputs + map(0x700000, 0x70007f).writeonly().share("videoregs.0"); // Video Regs + map(0x700000, 0x700007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause + map(0x700068, 0x700069).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); // Watchdog map(0x800001, 0x800001).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // M6295 - map(0xc00000, 0xc00001).w(FUNC(cave_state::tjumpman_leds_w)); // Leds + Hopper - map(0xe00000, 0xe00001).w(FUNC(cave_state::tjumpman_eeprom_lsb_w)); // EEPROM + map(0xc00001, 0xc00001).w(FUNC(cave_state::tjumpman_leds_w)); // Leds + Hopper + map(0xe00001, 0xe00001).w(FUNC(cave_state::tjumpman_eeprom_w)); // EEPROM } @@ -1175,18 +1152,15 @@ void cave_state::tjumpman_map(address_map &map) Pac-Slot ***************************************************************************/ -WRITE16_MEMBER(cave_state::pacslot_leds_w) +void cave_state::pacslot_leds_w(u8 data) { - if (ACCESSING_BITS_0_7) - { - m_led_outputs[0] = data & 0x0001; // pac-man - m_led_outputs[1] = data & 0x0002; // ms. pac-man - m_led_outputs[2] = data & 0x0004; // payout - m_led_outputs[3] = data & 0x0008; // start - m_led_outputs[4] = data & 0x0010; // bet - m_led_outputs[5] = data & 0x0020; // medal - m_hopper = data & 0x0040; // hopper - } + m_led_outputs[0] = data & 0x0001; // pac-man + m_led_outputs[1] = data & 0x0002; // ms. pac-man + m_led_outputs[2] = data & 0x0004; // payout + m_led_outputs[3] = data & 0x0008; // start + m_led_outputs[4] = data & 0x0010; // bet + m_led_outputs[5] = data & 0x0020; // medal + m_hopper = data & 0x0040; // hopper // popmessage("led %04X", data); } @@ -1194,19 +1168,19 @@ WRITE16_MEMBER(cave_state::pacslot_leds_w) void cave_state::pacslot_map(address_map &map) { map(0x000000, 0x07ffff).rom(); // ROM - map(0x100000, 0x10ffff).ram().share("nvram"); // RAM (battery) - map(0x200000, 0x20ffff).ram().share("spriteram.0"); // Sprites - map(0x300000, 0x307fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0 - map(0x400000, 0x40007f).writeonly().share("videoregs.0"); // Video Regs - map(0x400000, 0x400007).r(FUNC(cave_state::cave_irq_cause_r)); // IRQ Cause - map(0x400068, 0x400069).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); // Watchdog - map(0x500000, 0x500005).writeonly().share("vctrl.0"); // Layer 0 Control - map(0x600000, 0x60ffff).ram().share("paletteram.0"); // Palette - map(0x700000, 0x700001).portr("IN0"); // Inputs + EEPROM + Hopper - map(0x700002, 0x700003).portr("IN1"); // Inputs + map(0x100000, 0x10ffff).ram().share("nvram"); // RAM (battery) + map(0x200000, 0x20ffff).ram().share("spriteram.0"); // Sprites + map(0x300000, 0x307fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0 + map(0x400000, 0x40007f).writeonly().share("videoregs.0"); // Video Regs + map(0x400000, 0x400007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause + map(0x400068, 0x400069).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); // Watchdog + map(0x500000, 0x500005).writeonly().share("vctrl.0"); // Layer 0 Control + map(0x600000, 0x60ffff).ram().share("paletteram.0"); // Palette + map(0x700000, 0x700001).portr("IN0"); // Inputs + EEPROM + Hopper + map(0x700002, 0x700003).portr("IN1"); // Inputs map(0x800001, 0x800001).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // M6295 - map(0xc00000, 0xc00001).w(FUNC(cave_state::pacslot_leds_w)); // Leds + Hopper - map(0xe00000, 0xe00001).w(FUNC(cave_state::tjumpman_eeprom_lsb_w)); // EEPROM + map(0xc00001, 0xc00001).w(FUNC(cave_state::pacslot_leds_w)); // Leds + Hopper + map(0xe00001, 0xe00001).w(FUNC(cave_state::tjumpman_eeprom_w)); // EEPROM } @@ -1219,19 +1193,19 @@ void cave_state::pacslot_map(address_map &map) void cave_state::paceight_map(address_map &map) { map(0x000000, 0x07ffff).rom(); // ROM - map(0x100000, 0x10ffff).ram().share("nvram"); // RAM (battery) - map(0x200000, 0x20ffff).ram().share("spriteram.0"); // Sprites - map(0x300000, 0x307fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0 - map(0x400000, 0x40ffff).ram().share("paletteram.0"); // Palette - map(0x500000, 0x500001).portr("IN0"); // Inputs + EEPROM + Hopper - map(0x500002, 0x500003).portr("IN1"); // Inputs - map(0x600000, 0x600005).writeonly().share("vctrl.0"); // Layer 0 Control - map(0x700000, 0x70007f).writeonly().share("videoregs.0"); // Video Regs - map(0x700000, 0x700007).r(FUNC(cave_state::cave_irq_cause_r)); // IRQ Cause - map(0x700068, 0x700069).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); // Watchdog + map(0x100000, 0x10ffff).ram().share("nvram"); // RAM (battery) + map(0x200000, 0x20ffff).ram().share("spriteram.0"); // Sprites + map(0x300000, 0x307fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0 + map(0x400000, 0x40ffff).ram().share("paletteram.0"); // Palette + map(0x500000, 0x500001).portr("IN0"); // Inputs + EEPROM + Hopper + map(0x500002, 0x500003).portr("IN1"); // Inputs + map(0x600000, 0x600005).writeonly().share("vctrl.0"); // Layer 0 Control + map(0x700000, 0x70007f).writeonly().share("videoregs.0"); // Video Regs + map(0x700000, 0x700007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause + map(0x700068, 0x700069).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); // Watchdog map(0x800001, 0x800001).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // M6295 - map(0xc00000, 0xc00001).w(FUNC(cave_state::pacslot_leds_w)); // Leds + Hopper - map(0xe00000, 0xe00001).w(FUNC(cave_state::tjumpman_eeprom_lsb_w)); // EEPROM + map(0xc00000, 0xc00001).w(FUNC(cave_state::pacslot_leds_w)); // Leds + Hopper + map(0xe00001, 0xe00001).w(FUNC(cave_state::tjumpman_eeprom_w)); // EEPROM } /*************************************************************************** @@ -1240,18 +1214,18 @@ void cave_state::paceight_map(address_map &map) void cave_state::uopoko_map(address_map &map) { - map(0x000000, 0x0fffff).rom(); // ROM - map(0x100000, 0x10ffff).ram(); // RAM - map(0x300000, 0x300003).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)).umask16(0x00ff); // YMZ280 - map(0x400000, 0x40ffff).ram().share("spriteram.0"); // Sprites - map(0x500000, 0x507fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0 - map(0x600000, 0x60007f).writeonly().share("videoregs.0"); // Video Regs - map(0x600000, 0x600007).r(FUNC(cave_state::cave_irq_cause_r)); // IRQ Cause - map(0x700000, 0x700005).ram().share("vctrl.0"); // Layer 0 Control - map(0x800000, 0x80ffff).ram().share("paletteram.0"); // Palette - map(0x900000, 0x900001).portr("IN0"); // Inputs - map(0x900002, 0x900003).portr("IN1"); // Inputs + EEPROM - map(0xa00000, 0xa00001).w(FUNC(cave_state::cave_eeprom_msb_w)); // EEPROM + map(0x000000, 0x0fffff).rom(); // ROM + map(0x100000, 0x10ffff).ram(); // RAM + map(0x300000, 0x300003).rw("ymz", FUNC(ymz280b_device::read), FUNC(ymz280b_device::write)).umask16(0x00ff); // YMZ280 + map(0x400000, 0x40ffff).ram().share("spriteram.0"); // Sprites + map(0x500000, 0x507fff).ram().w(FUNC(cave_state::vram_w<0>)).share("vram.0"); // Layer 0 + map(0x600000, 0x60007f).writeonly().share("videoregs.0"); // Video Regs + map(0x600000, 0x600007).r(FUNC(cave_state::irq_cause_r)); // IRQ Cause + map(0x700000, 0x700005).ram().share("vctrl.0"); // Layer 0 Control + map(0x800000, 0x80ffff).ram().share("paletteram.0"); // Palette + map(0x900000, 0x900001).portr("IN0"); // Inputs + map(0x900002, 0x900003).portr("IN1"); // Inputs + EEPROM + map(0xa00000, 0xa00000).w(FUNC(cave_state::eeprom_w)); // EEPROM } @@ -1265,7 +1239,7 @@ void cave_state::uopoko_map(address_map &map) ***************************************************************************/ template -WRITE8_MEMBER(cave_state::z80_rombank_w) +void cave_state::z80_rombank_w(u8 data) { if (data & ~Mask) logerror("CPU #1 - PC %04X: Bank %02X\n", m_audiocpu->pc(), data); @@ -1274,7 +1248,7 @@ WRITE8_MEMBER(cave_state::z80_rombank_w) } template -WRITE8_MEMBER(cave_state::oki1_bank_w) +void cave_state::oki1_bank_w(u8 data) { int bank1 = (data >> 0) & Mask; int bank2 = (data >> 4) & Mask; @@ -1283,7 +1257,7 @@ WRITE8_MEMBER(cave_state::oki1_bank_w) } template -WRITE8_MEMBER(cave_state::oki2_bank_w) +void cave_state::oki2_bank_w(u8 data) { int bank1 = (data >> 0) & Mask; int bank2 = (data >> 4) & Mask; @@ -1311,20 +1285,20 @@ void cave_state::oki2_map(address_map &map) void cave_state::hotdogst_sound_map(address_map &map) { - map(0x0000, 0x3fff).rom(); // ROM + map(0x0000, 0x3fff).rom(); // ROM map(0x4000, 0x7fff).bankr("z80bank"); // ROM (Banked) - map(0xe000, 0xffff).ram(); // RAM + map(0xe000, 0xffff).ram(); // RAM } void cave_state::hotdogst_sound_portmap(address_map &map) { map.global_mask(0xff); - map(0x00, 0x00).w(FUNC(cave_state::z80_rombank_w<0x0f>)); // ROM bank - map(0x30, 0x30).r(FUNC(cave_state::soundlatch_lo_r)); // From Main CPU - map(0x40, 0x40).r(FUNC(cave_state::soundlatch_hi_r)); // - map(0x50, 0x51).rw("ymsnd", FUNC(ym2203_device::read), FUNC(ym2203_device::write)); // + map(0x00, 0x00).w(FUNC(cave_state::z80_rombank_w<0x0f>)); // ROM bank + map(0x30, 0x30).r(FUNC(cave_state::soundlatch_lo_r)); // From Main CPU + map(0x40, 0x40).r(FUNC(cave_state::soundlatch_hi_r)); // + map(0x50, 0x51).rw("ymsnd", FUNC(ym2203_device::read), FUNC(ym2203_device::write)); // map(0x60, 0x60).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // M6295 - map(0x70, 0x70).w(FUNC(cave_state::oki1_bank_w<0x3>)); // Samples bank + map(0x70, 0x70).w(FUNC(cave_state::oki1_bank_w<0x3>)); // Samples bank } @@ -1334,22 +1308,22 @@ void cave_state::hotdogst_sound_portmap(address_map &map) void cave_state::mazinger_sound_map(address_map &map) { - map(0x0000, 0x3fff).rom(); // ROM + map(0x0000, 0x3fff).rom(); // ROM map(0x4000, 0x7fff).bankr("z80bank"); // ROM (Banked) - map(0xc000, 0xc7ff).ram(); // RAM - map(0xf800, 0xffff).ram(); // RAM + map(0xc000, 0xc7ff).ram(); // RAM + map(0xf800, 0xffff).ram(); // RAM } void cave_state::mazinger_sound_portmap(address_map &map) { map.global_mask(0xff); map(0x00, 0x00).w(FUNC(cave_state::z80_rombank_w<0x07>)); // ROM bank - map(0x10, 0x10).w(FUNC(cave_state::soundlatch_ack_w)); // To Main CPU + map(0x10, 0x10).w(FUNC(cave_state::soundlatch_ack_w)); // To Main CPU map(0x30, 0x30).r(FUNC(cave_state::soundlatch_lo_r)); // From Main CPU - map(0x50, 0x51).w("ymsnd", FUNC(ym2203_device::write)); // YM2203 - map(0x52, 0x53).r("ymsnd", FUNC(ym2203_device::read)); // YM2203 - map(0x70, 0x70).w("oki1", FUNC(okim6295_device::write)); // M6295 - map(0x74, 0x74).w(FUNC(cave_state::oki1_bank_w<0x3>)); // Samples bank + map(0x50, 0x51).w("ymsnd", FUNC(ym2203_device::write)); // YM2203 + map(0x52, 0x53).r("ymsnd", FUNC(ym2203_device::read)); // YM2203 + map(0x70, 0x70).w("oki1", FUNC(okim6295_device::write)); // M6295 + map(0x74, 0x74).w(FUNC(cave_state::oki1_bank_w<0x3>)); // Samples bank } @@ -1359,23 +1333,23 @@ void cave_state::mazinger_sound_portmap(address_map &map) void cave_state::metmqstr_sound_map(address_map &map) { - map(0x0000, 0x3fff).rom(); // ROM + map(0x0000, 0x3fff).rom(); // ROM map(0x4000, 0x7fff).bankr("z80bank"); // ROM (Banked) - map(0xe000, 0xffff).ram(); // RAM + map(0xe000, 0xffff).ram(); // RAM } void cave_state::metmqstr_sound_portmap(address_map &map) { map.global_mask(0xff); - map(0x00, 0x00).w(FUNC(cave_state::z80_rombank_w<0x0f>)); // Rom Bank - map(0x20, 0x20).r(FUNC(cave_state::soundflags_r)); // Communication - map(0x30, 0x30).r(FUNC(cave_state::soundlatch_lo_r)); // From Main CPU - map(0x40, 0x40).r(FUNC(cave_state::soundlatch_hi_r)); // + map(0x00, 0x00).w(FUNC(cave_state::z80_rombank_w<0x0f>)); // Rom Bank + map(0x20, 0x20).r(FUNC(cave_state::soundflags_r)); // Communication + map(0x30, 0x30).r(FUNC(cave_state::soundlatch_lo_r)); // From Main CPU + map(0x40, 0x40).r(FUNC(cave_state::soundlatch_hi_r)); // map(0x50, 0x51).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); // YM2151 - map(0x60, 0x60).w("oki1", FUNC(okim6295_device::write)); // M6295 #0 - map(0x70, 0x70).w(FUNC(cave_state::oki1_bank_w<0x7>)); // Samples Bank #0 - map(0x80, 0x80).w("oki2", FUNC(okim6295_device::write)); // M6295 #1 - map(0x90, 0x90).w(FUNC(cave_state::oki2_bank_w<0x7>)); // Samples Bank #1 + map(0x60, 0x60).w("oki1", FUNC(okim6295_device::write)); // M6295 #0 + map(0x70, 0x70).w(FUNC(cave_state::oki1_bank_w<0x7>)); // Samples Bank #0 + map(0x80, 0x80).w("oki2", FUNC(okim6295_device::write)); // M6295 #1 + map(0x90, 0x90).w(FUNC(cave_state::oki2_bank_w<0x7>)); // Samples Bank #1 } @@ -1385,9 +1359,9 @@ void cave_state::metmqstr_sound_portmap(address_map &map) void cave_state::pwrinst2_sound_map(address_map &map) { - map(0x0000, 0x7fff).rom(); // ROM + map(0x0000, 0x7fff).rom(); // ROM map(0x8000, 0xbfff).bankr("z80bank"); // ROM (Banked) - map(0xe000, 0xffff).ram(); // RAM + map(0xe000, 0xffff).ram(); // RAM } void cave_state::pwrinst2_sound_portmap(address_map &map) @@ -1395,13 +1369,13 @@ void cave_state::pwrinst2_sound_portmap(address_map &map) map.global_mask(0xff); map(0x00, 0x00).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // M6295 map(0x08, 0x08).rw("oki2", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // - map(0x10, 0x17).w("nmk112", FUNC(nmk112_device::okibank_w)); // Samples bank - map(0x40, 0x41).rw("ymsnd", FUNC(ym2203_device::read), FUNC(ym2203_device::write)); // - map(0x50, 0x50).w(FUNC(cave_state::soundlatch_ack_w)); // To Main CPU -// AM_RANGE(0x51, 0x51) AM_WRITENOP // ?? volume - map(0x80, 0x80).w(FUNC(cave_state::z80_rombank_w<0x07>)); // ROM bank - map(0x60, 0x60).r(FUNC(cave_state::soundlatch_hi_r)); // From Main CPU - map(0x70, 0x70).r(FUNC(cave_state::soundlatch_lo_r)); // + map(0x10, 0x17).w("nmk112", FUNC(nmk112_device::okibank_w)); // Samples bank + map(0x40, 0x41).rw("ymsnd", FUNC(ym2203_device::read), FUNC(ym2203_device::write)); // + map(0x50, 0x50).w(FUNC(cave_state::soundlatch_ack_w)); // To Main CPU +// map(0x51, 0x51).nopw(); // ?? volume + map(0x60, 0x60).r(FUNC(cave_state::soundlatch_hi_r)); // From Main CPU + map(0x70, 0x70).r(FUNC(cave_state::soundlatch_lo_r)); // + map(0x80, 0x80).w(FUNC(cave_state::z80_rombank_w<0x07>)); // ROM bank } @@ -1411,24 +1385,24 @@ void cave_state::pwrinst2_sound_portmap(address_map &map) void cave_state::sailormn_sound_map(address_map &map) { - map(0x0000, 0x3fff).rom(); // ROM + map(0x0000, 0x3fff).rom(); // ROM map(0x4000, 0x7fff).bankr("z80bank"); // ROM (Banked) - map(0xc000, 0xdfff).mirror(0x2000).ram(); // RAM (8KB, mirrored) + map(0xc000, 0xdfff).mirror(0x2000).ram(); // RAM (8KB, mirrored) } void cave_state::sailormn_sound_portmap(address_map &map) { map.global_mask(0xff); - map(0x00, 0x00).w(FUNC(cave_state::z80_rombank_w<0x1f>)); // Rom Bank - map(0x10, 0x10).w(FUNC(cave_state::soundlatch_ack_w)); // To Main CPU - map(0x20, 0x20).r(FUNC(cave_state::soundflags_r)); // Communication - map(0x30, 0x30).r(FUNC(cave_state::soundlatch_lo_r)); // From Main CPU - map(0x40, 0x40).r(FUNC(cave_state::soundlatch_hi_r)); // - map(0x50, 0x51).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); // YM2151 + map(0x00, 0x00).w(FUNC(cave_state::z80_rombank_w<0x1f>)); // Rom Bank + map(0x10, 0x10).w(FUNC(cave_state::soundlatch_ack_w)); // To Main CPU + map(0x20, 0x20).r(FUNC(cave_state::soundflags_r)); // Communication + map(0x30, 0x30).r(FUNC(cave_state::soundlatch_lo_r)); // From Main CPU + map(0x40, 0x40).r(FUNC(cave_state::soundlatch_hi_r)); // + map(0x50, 0x51).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); // YM2151 map(0x60, 0x60).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // M6295 #0 - map(0x70, 0x70).w(FUNC(cave_state::oki1_bank_w<0xf>)); // Samples Bank #0 + map(0x70, 0x70).w(FUNC(cave_state::oki1_bank_w<0xf>)); // Samples Bank #0 map(0x80, 0x80).rw("oki2", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // M6295 #1 - map(0xc0, 0xc0).w(FUNC(cave_state::oki2_bank_w<0xf>)); // Samples Bank #1 + map(0xc0, 0xc0).w(FUNC(cave_state::oki2_bank_w<0xf>)); // Samples Bank #1 } @@ -1462,10 +1436,7 @@ static INPUT_PORTS_START( cave ) PORT_SERVICE_NO_TOGGLE( 0x0200, IP_ACTIVE_LOW ) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) // sw? exit service mode PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) // sw? enter & exit service mode - PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("IN1") // Player 2 PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) @@ -1478,12 +1449,8 @@ static INPUT_PORTS_START( cave ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(6) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_SERVICE1 ) - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read) - PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0xf400, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END /* Gaia Crusaders, no EEPROM. Has DIPS */ @@ -1508,11 +1475,7 @@ static INPUT_PORTS_START( gaia ) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 ) - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0fc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("DSW") PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:1") @@ -1629,18 +1592,8 @@ static INPUT_PORTS_START( guwange ) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(6) PORT_SERVICE_NO_TOGGLE( 0x0004, IP_ACTIVE_LOW ) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE1 ) - PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read) - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0xff70, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END @@ -1651,35 +1604,15 @@ static INPUT_PORTS_START( korokoro ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_IMPULSE(10) // bit 0x0080 of leds PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON1 ) // round button (choose) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) // square button (select in service mode / medal out in game) - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0fe0, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE2 ) // service medal out? PORT_SERVICE( 0x2000, IP_ACTIVE_LOW ) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SERVICE1 ) // service coin PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cave_state,korokoro_hopper_r, nullptr) // motor / hopper status ??? PORT_START("IN1") - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read) - PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0xefff, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END @@ -1695,16 +1628,13 @@ static INPUT_PORTS_START( tekkencw ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cave_state,tjumpman_hopper_r, nullptr) PORT_START("IN1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONFNAME( 0x08, 0x08, "Self Test" ) PORT_CONFSETTING( 0x08, DEF_STR( Off ) ) PORT_CONFSETTING( 0x00, DEF_STR( On ) ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME( DEF_STR( No ) ) PORT_CODE(KEYCODE_N) // shinai ("not") PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME( "Action" ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(10) // medal (impulse needed to coin up reliably) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x87, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END @@ -1720,24 +1650,20 @@ static INPUT_PORTS_START( tekkenbs ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cave_state,tjumpman_hopper_r, nullptr) PORT_START("IN1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONFNAME( 0x08, 0x08, "Self Test" ) PORT_CONFSETTING( 0x08, DEF_STR( Off ) ) PORT_CONFSETTING( 0x00, DEF_STR( On ) ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME( "Start" ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(10) // medal (impulse needed to coin up reliably) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x87, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END static INPUT_PORTS_START( tjumpman ) PORT_START("IN0") PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x06, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME( DEF_STR( Yes ) ) PORT_CODE(KEYCODE_Y) // suru ("do") PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) @@ -1745,9 +1671,7 @@ static INPUT_PORTS_START( tjumpman ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cave_state,tjumpman_hopper_r, nullptr) PORT_START("IN1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONFNAME( 0x08, 0x08, "Self Test" ) PORT_CONFSETTING( 0x08, DEF_STR( Off ) ) PORT_CONFSETTING( 0x00, DEF_STR( On ) ) @@ -1770,16 +1694,13 @@ static INPUT_PORTS_START( pacslot ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cave_state, tjumpman_hopper_r, nullptr) PORT_START("IN1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONFNAME( 0x08, 0x08, "Self Test" ) PORT_CONFSETTING( 0x08, DEF_STR( Off ) ) PORT_CONFSETTING( 0x00, DEF_STR( On ) ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME( "Ms. Pac-Man" ) PORT_CODE(KEYCODE_N) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(10) // medal (impulse needed to coin up reliably) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x87, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END static INPUT_PORTS_START( paceight ) @@ -1796,12 +1717,9 @@ INPUT_PORTS_END static INPUT_PORTS_START( ppsatan ) PORT_START("SYSTEM") // $200000 PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) // service coin PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE2 ) // advance in service mode - PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0072, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read) PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2") @@ -1861,9 +1779,9 @@ static const gfx_layout layout_8x8x6 = 8,8, RGN_FRAC(1,1), 6, - {8,9, 0,1,2,3}, + {STEP2(8,1),STEP4(0,1)}, {0*4,1*4,4*4,5*4,8*4,9*4,12*4,13*4}, - {0*64,1*64,2*64,3*64,4*64,5*64,6*64,7*64}, + {STEP8(0,8*8)}, 8*8*8 }; @@ -1886,9 +1804,9 @@ static const gfx_layout layout_8x8x8 = 8,8, RGN_FRAC(1,1), 8, - {8,9,10,11, 0,1,2,3}, + {STEP4(8,1),STEP4(0,1)}, {0*4,1*4,4*4,5*4,8*4,9*4,12*4,13*4}, - {0*64,1*64,2*64,3*64,4*64,5*64,6*64,7*64}, + {STEP8(0,8*8)}, 8*8*8 }; @@ -1933,8 +1851,8 @@ static GFXDECODE_START( gfx_ddonpach ) color code and the 4000-7fff range in the color table. */ // "sprites" - GFXDECODE_ENTRY( "layer0", 0, layout_8x8x4, 0x8000, 0x40 ) // [0] Layer 0 - GFXDECODE_ENTRY( "layer1", 0, layout_8x8x4, 0x8000, 0x40 ) // [1] Layer 1 + GFXDECODE_ENTRY( "layer0", 0, layout_8x8x4, 0x4000, 0x40 ) // [0] Layer 0 + GFXDECODE_ENTRY( "layer1", 0, layout_8x8x4, 0x4000, 0x40 ) // [1] Layer 1 GFXDECODE_ENTRY( "layer2", 0, layout_8x8x8, 0x4000, 0x40 ) // [2] Layer 2 GFXDECODE_END @@ -2065,7 +1983,7 @@ GFXDECODE_END void cave_state::machine_start() { m_led_outputs.resolve(); - m_vblank_end_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cave_state::cave_vblank_end), this)); + m_vblank_end_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cave_state::vblank_end), this)); save_item(NAME(m_soundbuf_wptr)); save_item(NAME(m_soundbuf_rptr)); @@ -2078,7 +1996,7 @@ void cave_state::machine_start() save_item(NAME(m_agallet_vblank_irq)); } -MACHINE_RESET_MEMBER(cave_state,cave) +void cave_state::machine_reset() { std::fill(std::begin(m_soundbuf_data), std::end(m_soundbuf_data), 0); m_soundbuf_wptr = 0; @@ -2100,12 +2018,11 @@ MACHINE_CONFIG_START(cave_state::dfeveron) /* basic machine hardware */ MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL) MCFG_DEVICE_PROGRAM_MAP(dfeveron_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, cave_interrupt) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) - MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave) - EEPROM_93C46_16BIT(config, "eeprom"); + EEPROM_93C46_16BIT(config, m_eeprom); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start) + MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -2113,11 +2030,12 @@ MACHINE_CONFIG_START(cave_state::dfeveron) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(320, 240) MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update_cave) + MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_dfeveron); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_dfeveron) - MCFG_PALETTE_ADD("palette", 0x8000) /* $8000 palette entries for consistency with the other games */ - MCFG_PALETTE_INIT_OWNER(cave_state,dfeveron) + PALETTE(config, m_palette, 0x8000); /* $8000 palette entries for consistency with the other games */ + m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_dfeveron), this)); MCFG_VIDEO_START_OVERRIDE(cave_state,cave_2_layers) @@ -2140,12 +2058,11 @@ MACHINE_CONFIG_START(cave_state::ddonpach) /* basic machine hardware */ MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL) MCFG_DEVICE_PROGRAM_MAP(ddonpach_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, cave_interrupt) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) - MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave) - EEPROM_93C46_16BIT(config, "eeprom"); + EEPROM_93C46_16BIT(config, m_eeprom); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start) + MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -2153,11 +2070,12 @@ MACHINE_CONFIG_START(cave_state::ddonpach) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(320, 240) MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update_cave) + MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_ddonpach); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_ddonpach) - MCFG_PALETTE_ADD("palette", 0x8000 + 0x40*16) // $400 extra entries for layers 1&2 - MCFG_PALETTE_INIT_OWNER(cave_state,ddonpach) + PALETTE(config, m_palette, 0x8000); + m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_cave), this)); MCFG_VIDEO_START_OVERRIDE(cave_state,cave_3_layers) @@ -2179,12 +2097,11 @@ MACHINE_CONFIG_START(cave_state::donpachi) /* basic machine hardware */ MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL) MCFG_DEVICE_PROGRAM_MAP(donpachi_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, cave_interrupt) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) - MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave) - EEPROM_93C46_16BIT(config, "eeprom"); + EEPROM_93C46_16BIT(config, m_eeprom); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start) + MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -2192,11 +2109,12 @@ MACHINE_CONFIG_START(cave_state::donpachi) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(320, 240) MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update_cave) + MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_donpachi) - MCFG_PALETTE_ADD("palette", 0x8000) /* $8000 palette entries for consistency with the other games */ - MCFG_PALETTE_INIT_OWNER(cave_state,dfeveron) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_donpachi); + + PALETTE(config, m_palette, 0x8000); /* $8000 palette entries for consistency with the other games */ + m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_dfeveron), this)); MCFG_VIDEO_START_OVERRIDE(cave_state,cave_3_layers) @@ -2225,12 +2143,11 @@ MACHINE_CONFIG_START(cave_state::esprade) /* basic machine hardware */ MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL) MCFG_DEVICE_PROGRAM_MAP(esprade_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, cave_interrupt) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) - MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave) - EEPROM_93C46_16BIT(config, "eeprom"); + EEPROM_93C46_16BIT(config, m_eeprom); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start) + MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -2238,11 +2155,12 @@ MACHINE_CONFIG_START(cave_state::esprade) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(320, 240) MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update_cave) + MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_esprade); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_esprade) - MCFG_PALETTE_ADD("palette", 0x8000) - MCFG_PALETTE_INIT_OWNER(cave_state,cave) + PALETTE(config, m_palette, 0x8000); + m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_cave), this)); MCFG_VIDEO_START_OVERRIDE(cave_state,cave_3_layers) @@ -2264,11 +2182,9 @@ MACHINE_CONFIG_START(cave_state::gaia) /* basic machine hardware */ MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL) MCFG_DEVICE_PROGRAM_MAP(gaia_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, cave_interrupt) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) - MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave) - - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start) + MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) WATCHDOG_TIMER(config, "watchdog"); @@ -2278,11 +2194,12 @@ MACHINE_CONFIG_START(cave_state::gaia) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(320, 240) MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 224-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update_cave) + MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_esprade); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_esprade) - MCFG_PALETTE_ADD("palette", 0x8000) - MCFG_PALETTE_INIT_OWNER(cave_state,cave) + PALETTE(config, m_palette, 0x8000); + m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_cave), this)); MCFG_VIDEO_START_OVERRIDE(cave_state,cave_3_layers) @@ -2304,12 +2221,11 @@ MACHINE_CONFIG_START(cave_state::guwange) /* basic machine hardware */ MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL) MCFG_DEVICE_PROGRAM_MAP(guwange_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, cave_interrupt) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) - MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave) - EEPROM_93C46_16BIT(config, "eeprom"); + EEPROM_93C46_16BIT(config, m_eeprom); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start) + MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -2317,11 +2233,12 @@ MACHINE_CONFIG_START(cave_state::guwange) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(320, 240) MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update_cave) + MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_esprade) - MCFG_PALETTE_ADD("palette", 0x8000) - MCFG_PALETTE_INIT_OWNER(cave_state,cave) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_esprade); + + PALETTE(config, m_palette, 0x8000); + m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_cave), this)); MCFG_VIDEO_START_OVERRIDE(cave_state,cave_3_layers) @@ -2342,16 +2259,15 @@ MACHINE_CONFIG_START(cave_state::hotdogst) /* basic machine hardware */ MCFG_DEVICE_ADD("maincpu", M68000, 32_MHz_XTAL/2) MCFG_DEVICE_PROGRAM_MAP(hotdogst_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, cave_interrupt) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) MCFG_DEVICE_ADD("audiocpu", Z80, 32_MHz_XTAL/8) MCFG_DEVICE_PROGRAM_MAP(hotdogst_sound_map) MCFG_DEVICE_IO_MAP(hotdogst_sound_portmap) - MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave) - EEPROM_93C46_16BIT(config, "eeprom"); + EEPROM_93C46_16BIT(config, m_eeprom); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start) + MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -2359,11 +2275,12 @@ MACHINE_CONFIG_START(cave_state::hotdogst) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(384, 240) MCFG_SCREEN_VISIBLE_AREA(0, 384-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update_cave) + MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_hotdogst); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_hotdogst) - MCFG_PALETTE_ADD("palette", 0x8000) /* $8000 palette entries for consistency with the other games */ - MCFG_PALETTE_INIT_OWNER(cave_state,dfeveron) + PALETTE(config, m_palette, 0x8000); /* $8000 palette entries for consistency with the other games */ + m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_dfeveron), this)); MCFG_VIDEO_START_OVERRIDE(cave_state,cave_3_layers) @@ -2395,12 +2312,11 @@ MACHINE_CONFIG_START(cave_state::korokoro) /* basic machine hardware */ MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL) MCFG_DEVICE_PROGRAM_MAP(korokoro_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, cave_interrupt) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) - MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave) - EEPROM_93C46_16BIT(config, "eeprom"); + EEPROM_93C46_16BIT(config, m_eeprom); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start) + MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -2408,11 +2324,12 @@ MACHINE_CONFIG_START(cave_state::korokoro) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(320, 240) MCFG_SCREEN_VISIBLE_AREA(0, 320-1-2, 0, 240-1-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update_cave) + MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_korokoro); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_korokoro) - MCFG_PALETTE_ADD("palette", 0x8000) /* $8000 palette entries for consistency with the other games */ - MCFG_PALETTE_INIT_OWNER(cave_state,korokoro) + PALETTE(config, m_palette, 0x8000); /* $8000 palette entries for consistency with the other games */ + m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_korokoro), this)); MCFG_VIDEO_START_OVERRIDE(cave_state,cave_1_layer) @@ -2440,7 +2357,7 @@ MACHINE_CONFIG_START(cave_state::mazinger) /* basic machine hardware */ MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL) MCFG_DEVICE_PROGRAM_MAP(mazinger_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, cave_interrupt) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) MCFG_DEVICE_ADD("audiocpu", Z80, 4_MHz_XTAL) // Bidirectional communication MCFG_DEVICE_PROGRAM_MAP(mazinger_sound_map) @@ -2448,10 +2365,9 @@ MACHINE_CONFIG_START(cave_state::mazinger) WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_seconds(3)); /* a guess, and certainly wrong */ - MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave) - EEPROM_93C46_16BIT(config, "eeprom"); + EEPROM_93C46_16BIT(config, m_eeprom); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start) + MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -2459,11 +2375,12 @@ MACHINE_CONFIG_START(cave_state::mazinger) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(384, 240) MCFG_SCREEN_VISIBLE_AREA(0, 384-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update_cave) + MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_mazinger) - MCFG_PALETTE_ADD("palette", 0x8000) /* $8000 palette entries for consistency with the other games */ - MCFG_PALETTE_INIT_OWNER(cave_state,mazinger) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_mazinger); + + PALETTE(config, m_palette, 0x8000); /* $8000 palette entries for consistency with the other games */ + m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_mazinger), this)); MCFG_VIDEO_START_OVERRIDE(cave_state,cave_2_layers) @@ -2495,7 +2412,7 @@ MACHINE_CONFIG_START(cave_state::metmqstr) /* basic machine hardware */ MCFG_DEVICE_ADD("maincpu", M68000, 32_MHz_XTAL / 2) MCFG_DEVICE_PROGRAM_MAP(metmqstr_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, cave_interrupt) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) MCFG_DEVICE_ADD("audiocpu", Z80, 32_MHz_XTAL / 4) MCFG_DEVICE_PROGRAM_MAP(metmqstr_sound_map) @@ -2503,10 +2420,9 @@ MACHINE_CONFIG_START(cave_state::metmqstr) WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_seconds(3)); /* a guess, and certainly wrong */ - MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave) /* start with the watchdog armed */ - EEPROM_93C46_16BIT(config, "eeprom"); + EEPROM_93C46_16BIT(config, m_eeprom); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start) + MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -2514,11 +2430,12 @@ MACHINE_CONFIG_START(cave_state::metmqstr) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(0x200, 240) MCFG_SCREEN_VISIBLE_AREA(0x7d, 0x7d + 0x180-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update_cave) + MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_donpachi); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_donpachi) - MCFG_PALETTE_ADD("palette", 0x8000) /* $8000 palette entries for consistency with the other games */ - MCFG_PALETTE_INIT_OWNER(cave_state,dfeveron) + PALETTE(config, m_palette, 0x8000); /* $8000 palette entries for consistency with the other games */ + m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_dfeveron), this)); MCFG_VIDEO_START_OVERRIDE(cave_state,cave_3_layers) @@ -2553,15 +2470,13 @@ MACHINE_CONFIG_START(cave_state::pacslot) /* basic machine hardware */ MCFG_DEVICE_ADD("maincpu", M68000, 28_MHz_XTAL / 2) MCFG_DEVICE_PROGRAM_MAP(pacslot_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, cave_interrupt) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_seconds(3)); /* a guess, and certainly wrong */ - MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave) + EEPROM_93C46_16BIT(config, m_eeprom, eeprom_serial_streaming::ENABLE); - EEPROM_93C46_16BIT(config, "eeprom", eeprom_serial_streaming::ENABLE); - - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start) + MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -2569,11 +2484,12 @@ MACHINE_CONFIG_START(cave_state::pacslot) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(0x200, 240) MCFG_SCREEN_VISIBLE_AREA(0x80, 0x80 + 0x140-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update_cave) + MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_uopoko); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_uopoko) - MCFG_PALETTE_ADD("palette", 0x8000) - MCFG_PALETTE_INIT_OWNER(cave_state,cave) + PALETTE(config, m_palette, 0x8000); + m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_cave), this)); MCFG_VIDEO_START_OVERRIDE(cave_state,cave_1_layer) @@ -2610,12 +2526,11 @@ MACHINE_CONFIG_START(cave_state::ppsatan) /* basic machine hardware */ MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL) MCFG_DEVICE_PROGRAM_MAP(ppsatan_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, cave_interrupt_ppsatan) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt_ppsatan) WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_seconds(1)); /* a guess, and certainly wrong */ - MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave) - EEPROM_93C46_16BIT(config, "eeprom"); + EEPROM_93C46_16BIT(config, m_eeprom); MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_lev2", cave_state, timer_lev2_cb, attotime::from_hz(60)) @@ -2626,7 +2541,7 @@ MACHINE_CONFIG_START(cave_state::ppsatan) MCFG_SCREEN_SIZE(320, 240) MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 224-1) MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update_ppsatan_top) - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start) + MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) MCFG_SCREEN_ADD("screen_left", RASTER) MCFG_SCREEN_REFRESH_RATE(15625/271.5) @@ -2634,7 +2549,7 @@ MACHINE_CONFIG_START(cave_state::ppsatan) MCFG_SCREEN_SIZE(320, 240) MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 224-1) MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update_ppsatan_left) - MCFG_TIMER_DRIVER_ADD("int_timer_left", cave_state, cave_vblank_start_left) + MCFG_TIMER_DRIVER_ADD("int_timer_left", cave_state, vblank_start_left) MCFG_SCREEN_ADD("screen_right", RASTER) MCFG_SCREEN_REFRESH_RATE(15625/271.5) @@ -2642,11 +2557,13 @@ MACHINE_CONFIG_START(cave_state::ppsatan) MCFG_SCREEN_SIZE(320, 240) MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 224-1) MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update_ppsatan_right) - MCFG_TIMER_DRIVER_ADD("int_timer_right", cave_state, cave_vblank_start_right) + MCFG_TIMER_DRIVER_ADD("int_timer_right", cave_state, vblank_start_right) + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_ppsatan); + + PALETTE(config, m_palette, 0x8000); + m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_ppsatan), this)); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_ppsatan) - MCFG_PALETTE_ADD("palette", 0x8000) - MCFG_PALETTE_INIT_OWNER(cave_state,ppsatan) config.set_default_layout(layout_ppsatan); MCFG_VIDEO_START_OVERRIDE(cave_state,cave_3_layers) @@ -2672,16 +2589,15 @@ MACHINE_CONFIG_START(cave_state::pwrinst2) /* basic machine hardware */ MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL) /* 16 MHz */ MCFG_DEVICE_PROGRAM_MAP(pwrinst2_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, cave_interrupt) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) MCFG_DEVICE_ADD("audiocpu", Z80, 16_MHz_XTAL / 2) /* 8 MHz */ MCFG_DEVICE_PROGRAM_MAP(pwrinst2_sound_map) MCFG_DEVICE_IO_MAP(pwrinst2_sound_portmap) - MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave) - EEPROM_93C46_16BIT(config, "eeprom"); + EEPROM_93C46_16BIT(config, m_eeprom); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start) + MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -2689,11 +2605,12 @@ MACHINE_CONFIG_START(cave_state::pwrinst2) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(0x200, 240) MCFG_SCREEN_VISIBLE_AREA(0x70, 0x70 + 0x140-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update_cave) + MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_pwrinst2); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_pwrinst2) - MCFG_PALETTE_ADD("palette", 0x8000+0x2800) - MCFG_PALETTE_INIT_OWNER(cave_state,pwrinst2) + PALETTE(config, m_palette, 0x8000+0x2800); + m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_pwrinst2), this)); MCFG_VIDEO_START_OVERRIDE(cave_state,cave_4_layers) @@ -2733,8 +2650,8 @@ TIMER_DEVICE_CALLBACK_MEMBER( cave_state::sailormn_startup ) MACHINE_RESET_MEMBER(cave_state,sailormn) { + machine_reset(); m_startup->adjust(attotime::from_usec(1000), 0, attotime::zero); - MACHINE_RESET_CALL_MEMBER(cave); } MACHINE_CONFIG_START(cave_state::sailormn) @@ -2742,7 +2659,7 @@ MACHINE_CONFIG_START(cave_state::sailormn) /* basic machine hardware */ MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL) MCFG_DEVICE_PROGRAM_MAP(sailormn_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, cave_interrupt) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) // could be a wachdog, but if it is then our watchdog address is incorrect as there are periods where the game doesn't write it. MCFG_TIMER_DRIVER_ADD(m_startup, cave_state, sailormn_startup) @@ -2754,9 +2671,9 @@ MACHINE_CONFIG_START(cave_state::sailormn) // MCFG_QUANTUM_TIME(attotime::from_hz(600)) MCFG_MACHINE_RESET_OVERRIDE(cave_state,sailormn) - EEPROM_93C46_16BIT(config, "eeprom"); + EEPROM_93C46_16BIT(config, m_eeprom); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start) + MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -2764,11 +2681,12 @@ MACHINE_CONFIG_START(cave_state::sailormn) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(320+1, 240) MCFG_SCREEN_VISIBLE_AREA(0+1, 320+1-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update_cave) + MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_sailormn) - MCFG_PALETTE_ADD("palette", 0x8000) /* $8000 palette entries for consistency with the other games */ - MCFG_PALETTE_INIT_OWNER(cave_state,sailormn) // 4 bit sprites, 6 bit tiles + GFXDECODE(config, m_gfxdecode, m_palette, gfx_sailormn); + + PALETTE(config, m_palette, 0x8000); /* $8000 palette entries for consistency with the other games */ + m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_sailormn), this)); // 4 bit sprites, 6 bit tiles MCFG_VIDEO_START_OVERRIDE(cave_state,sailormn_3_layers) /* Layer 2 has 1 banked ROM */ @@ -2805,15 +2723,13 @@ MACHINE_CONFIG_START(cave_state::tekkencw) /* basic machine hardware */ MCFG_DEVICE_ADD("maincpu", M68000, 28_MHz_XTAL / 2) MCFG_DEVICE_PROGRAM_MAP(tekkencw_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, cave_interrupt) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_seconds(3)); /* a guess, and certainly wrong */ - MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave) - - EEPROM_93C46_16BIT(config, "eeprom", eeprom_serial_streaming::ENABLE); + EEPROM_93C46_16BIT(config, m_eeprom, eeprom_serial_streaming::ENABLE); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start) + MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -2821,11 +2737,12 @@ MACHINE_CONFIG_START(cave_state::tekkencw) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(0x200, 240) MCFG_SCREEN_VISIBLE_AREA(0x80, 0x80 + 0x140-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update_cave) + MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_uopoko) - MCFG_PALETTE_ADD("palette", 0x8000) - MCFG_PALETTE_INIT_OWNER(cave_state,cave) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_uopoko); + + PALETTE(config, m_palette, 0x8000); + m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_cave), this)); MCFG_VIDEO_START_OVERRIDE(cave_state,cave_1_layer) @@ -2858,15 +2775,13 @@ MACHINE_CONFIG_START(cave_state::tjumpman) /* basic machine hardware */ MCFG_DEVICE_ADD("maincpu", M68000, 28_MHz_XTAL / 2) MCFG_DEVICE_PROGRAM_MAP(tjumpman_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, cave_interrupt) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) WATCHDOG_TIMER(config, "watchdog").set_time(attotime::from_seconds(3)); /* a guess, and certainly wrong */ - MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave) - - EEPROM_93C46_16BIT(config, "eeprom", eeprom_serial_streaming::ENABLE); + EEPROM_93C46_16BIT(config, m_eeprom, eeprom_serial_streaming::ENABLE); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start) + MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -2874,11 +2789,12 @@ MACHINE_CONFIG_START(cave_state::tjumpman) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(0x200, 240) MCFG_SCREEN_VISIBLE_AREA(0x80, 0x80 + 0x140-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update_cave) + MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_uopoko) - MCFG_PALETTE_ADD("palette", 0x8000) - MCFG_PALETTE_INIT_OWNER(cave_state,cave) + GFXDECODE(config, m_gfxdecode, m_palette, gfx_uopoko); + + PALETTE(config, m_palette, 0x8000); + m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_cave), this)); MCFG_VIDEO_START_OVERRIDE(cave_state,cave_1_layer) @@ -2903,11 +2819,11 @@ MACHINE_CONFIG_START(cave_state::uopoko) /* basic machine hardware */ MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL) MCFG_DEVICE_PROGRAM_MAP(uopoko_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, cave_interrupt) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", cave_state, interrupt) - EEPROM_93C46_16BIT(config, "eeprom"); + EEPROM_93C46_16BIT(config, m_eeprom); - MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start) + MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, vblank_start) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -2915,12 +2831,13 @@ MACHINE_CONFIG_START(cave_state::uopoko) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(320, 240) MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1) - MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update_cave) + MCFG_SCREEN_UPDATE_DRIVER(cave_state, screen_update) + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_uopoko); - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_uopoko) - MCFG_PALETTE_ADD("palette", 0x8000) + PALETTE(config, m_palette, 0x8000); + m_palette->set_init(palette_init_delegate(FUNC(cave_state::palette_init_cave), this)); - MCFG_PALETTE_INIT_OWNER(cave_state,cave) MCFG_VIDEO_START_OVERRIDE(cave_state,cave_1_layer) /* sound hardware */ @@ -4665,7 +4582,6 @@ BPSM.U77 23C16000 GFX ***************************************************************************/ - #define ROMS_SAILORMN \ ROM_REGION( 0x400000, "maincpu", 0 ) \ ROM_LOAD16_WORD_SWAP( "bpsm945a.u45", 0x000000, 0x080000, CRC(898c9515) SHA1(0fe8d7f13f5cfe2f6e79a0a21b2e8e7e70e65c4b) ) \ @@ -5090,10 +5006,6 @@ ROM_START( uopokoj ) ROM_END - - - - /*************************************************************************** @@ -5147,7 +5059,6 @@ void cave_state::init_oki_bank(int chip) m_okibank_hi[chip]->configure_entries(0, max, &ROM[0x00000], 0x20000); } - void cave_state::init_agallet() { init_cave(); @@ -5184,6 +5095,10 @@ void cave_state::init_ddonpach() ddp_unpack_sprites(0); m_spritetype[0] = 1; // "different" sprites (no zooming?) m_time_vblank_irq = 90; + + /* 4bpp but Only first 16 colors are used in palette index for Layer 0, 1. */ + m_gfxdecode->gfx(0)->set_granularity(256); + m_gfxdecode->gfx(1)->set_granularity(256); } void cave_state::init_donpachi() @@ -5195,7 +5110,6 @@ void cave_state::init_donpachi() m_time_vblank_irq = 90; } - void cave_state::init_esprade() { init_cave(); diff --git a/src/mame/includes/cave.h b/src/mame/includes/cave.h index 9a92d23ad64..9e8f7f0856a 100644 --- a/src/mame/includes/cave.h +++ b/src/mame/includes/cave.h @@ -22,28 +22,6 @@ class cave_state : public driver_device { public: - enum - { - MAX_PRIORITY = 4, - MAX_SPRITE_NUM = 0x400 - }; - - struct sprite_cave - { - sprite_cave() { } - - int priority = 0, flags = 0; - - const uint8_t *pen_data = nullptr; /* points to top left corner of tile data */ - int line_offset = 0; - - pen_t base_pen = 0; - int tile_width = 0, tile_height = 0; - int total_width = 0, total_height = 0; /* in screen coordinates */ - int x = 0, y = 0, xcount0 = 0, ycount0 = 0; - int zoomx_re = 0, zoomy_re = 0; - }; - cave_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_videoregs(*this, "videoregs.%u", 0) @@ -73,105 +51,119 @@ public: , m_led_outputs(*this, "led%u", 0U) { } - struct - { - int clip_left, clip_right, clip_top, clip_bottom; - uint8_t *baseaddr; - int line_offset; - uint8_t *baseaddr_zbuf; - int line_offset_zbuf; - } m_blit; + DECLARE_CUSTOM_INPUT_MEMBER(korokoro_hopper_r); + DECLARE_CUSTOM_INPUT_MEMBER(tjumpman_hopper_r); + void init_uopoko(); + void init_donpachi(); + void init_mazinger(); + void init_gaia(); + void init_pwrinst2(); + void init_ddonpach(); + void init_agallet(); + void init_hotdogst(); + void init_tjumpman(); + void init_korokoro(); + void init_esprade(); + void init_pwrinst2j(); + void init_guwange(); + void init_feversos(); + void init_sailormn(); + void init_dfeveron(); + void init_metmqstr(); + void init_ppsatan(); + void uopoko(machine_config &config); + void sailormn(machine_config &config); + void paceight(machine_config &config); + void pacslot(machine_config &config); + void hotdogst(machine_config &config); + void crusherm(machine_config &config); + void donpachi(machine_config &config); + void tekkencw(machine_config &config); + void korokoro(machine_config &config); + void esprade(machine_config &config); + void mazinger(machine_config &config); + void tjumpman(machine_config &config); + void tekkenbs(machine_config &config); + void gaia(machine_config &config); + void metmqstr(machine_config &config); + void ppsatan(machine_config &config); + void guwange(machine_config &config); + void dfeveron(machine_config &config); + void ddonpach(machine_config &config); + void pwrinst2(machine_config &config); + +protected: + virtual void device_post_load() override; + +private: void (cave_state::*m_get_sprite_info)(int chip); void (cave_state::*m_sprite_draw)(int chip, int priority); - DECLARE_READ16_MEMBER(cave_irq_cause_r); - DECLARE_READ8_MEMBER(soundflags_r); + u16 irq_cause_r(offs_t offset); + u8 soundflags_r(); DECLARE_READ16_MEMBER(soundflags_ack_r); DECLARE_WRITE16_MEMBER(sound_cmd_w); DECLARE_READ8_MEMBER(soundlatch_lo_r); DECLARE_READ8_MEMBER(soundlatch_hi_r); DECLARE_READ16_MEMBER(soundlatch_ack_r); DECLARE_WRITE8_MEMBER(soundlatch_ack_w); - DECLARE_WRITE16_MEMBER(gaia_coin_lsb_w); + void gaia_coin_w(u8 data); DECLARE_READ16_MEMBER(donpachi_videoregs_r); DECLARE_WRITE16_MEMBER(korokoro_leds_w); template DECLARE_WRITE16_MEMBER(pwrinst2_vctrl_w); DECLARE_READ16_MEMBER(sailormn_input0_r); - DECLARE_WRITE16_MEMBER(tjumpman_leds_w); - DECLARE_WRITE16_MEMBER(pacslot_leds_w); - template DECLARE_WRITE8_MEMBER(z80_rombank_w); - template DECLARE_WRITE8_MEMBER(oki1_bank_w); - template DECLARE_WRITE8_MEMBER(oki2_bank_w); + void tjumpman_leds_w(u8 data); + void pacslot_leds_w(u8 data); + template void z80_rombank_w(u8 data); + template void oki1_bank_w(u8 data); + template void oki2_bank_w(u8 data); template DECLARE_WRITE16_MEMBER(vram_w); template DECLARE_WRITE16_MEMBER(vram_8x8_w); - DECLARE_CUSTOM_INPUT_MEMBER(korokoro_hopper_r); - DECLARE_CUSTOM_INPUT_MEMBER(tjumpman_hopper_r); - DECLARE_WRITE16_MEMBER(cave_eeprom_msb_w); - DECLARE_WRITE16_MEMBER(sailormn_eeprom_msb_w); - DECLARE_WRITE16_MEMBER(hotdogst_eeprom_msb_w); - DECLARE_WRITE16_MEMBER(cave_eeprom_lsb_w); - DECLARE_WRITE16_MEMBER(metmqstr_eeprom_msb_w); - DECLARE_WRITE16_MEMBER(korokoro_eeprom_msb_w); + void eeprom_w(u8 data); + void sailormn_eeprom_w(u8 data); + void hotdogst_eeprom_w(u8 data); + void guwange_eeprom_w(u8 data); + void metmqstr_eeprom_w(u8 data); + void korokoro_eeprom_w(offs_t offset, uint16_t data, uint16_t mem_mask); DECLARE_READ16_MEMBER(pwrinst2_eeprom_r); - DECLARE_WRITE16_MEMBER(tjumpman_eeprom_lsb_w); - DECLARE_WRITE16_MEMBER(ppsatan_eeprom_msb_w); + void tjumpman_eeprom_w(u8 data); + void ppsatan_eeprom_w(offs_t offset, uint16_t data, uint16_t mem_mask); DECLARE_WRITE16_MEMBER(ppsatan_io_mux_w); DECLARE_READ16_MEMBER(ppsatan_touch1_r); DECLARE_READ16_MEMBER(ppsatan_touch2_r); DECLARE_WRITE16_MEMBER(ppsatan_out_w); uint16_t ppsatan_touch_r(int player); - void init_uopoko(); - void init_donpachi(); - void init_mazinger(); - void init_gaia(); - void init_pwrinst2(); - void init_ddonpach(); - void init_agallet(); - void init_hotdogst(); - void init_tjumpman(); - void init_korokoro(); - void init_esprade(); - void init_pwrinst2j(); - void init_guwange(); - void init_feversos(); - void init_sailormn(); - void init_dfeveron(); - void init_metmqstr(); - void init_ppsatan(); TILE_GET_INFO_MEMBER(sailormn_get_tile_info_2); template TILE_GET_INFO_MEMBER(get_tile_info); - DECLARE_MACHINE_RESET(cave); DECLARE_MACHINE_RESET(sailormn); + DECLARE_VIDEO_START(cave_1_layer); DECLARE_VIDEO_START(cave_2_layers); - DECLARE_PALETTE_INIT(dfeveron); DECLARE_VIDEO_START(cave_3_layers); - DECLARE_PALETTE_INIT(ddonpach); - DECLARE_PALETTE_INIT(cave); - DECLARE_VIDEO_START(cave_1_layer); - DECLARE_PALETTE_INIT(korokoro); - DECLARE_PALETTE_INIT(mazinger); DECLARE_VIDEO_START(cave_4_layers); - DECLARE_PALETTE_INIT(pwrinst2); DECLARE_VIDEO_START(sailormn_3_layers); - DECLARE_PALETTE_INIT(sailormn); - DECLARE_PALETTE_INIT(ppsatan); - uint32_t screen_update_cave(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + void palette_init_cave(palette_device &palette); + void palette_init_dfeveron(palette_device &palette); + void palette_init_korokoro(palette_device &palette); + void palette_init_mazinger(palette_device &palette); + void palette_init_pwrinst2(palette_device &palette); + void palette_init_sailormn(palette_device &palette); + void palette_init_ppsatan(palette_device &palette); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); uint32_t screen_update_ppsatan_core (screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int chip); uint32_t screen_update_ppsatan_top (screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); uint32_t screen_update_ppsatan_left (screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); uint32_t screen_update_ppsatan_right(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(cave_interrupt); - INTERRUPT_GEN_MEMBER(cave_interrupt_ppsatan); - TIMER_CALLBACK_MEMBER(cave_vblank_end); - TIMER_DEVICE_CALLBACK_MEMBER(cave_vblank_start); - TIMER_DEVICE_CALLBACK_MEMBER(cave_vblank_start_left); - TIMER_DEVICE_CALLBACK_MEMBER(cave_vblank_start_right); + INTERRUPT_GEN_MEMBER(interrupt); + INTERRUPT_GEN_MEMBER(interrupt_ppsatan); + TIMER_CALLBACK_MEMBER(vblank_end); + TIMER_DEVICE_CALLBACK_MEMBER(vblank_start); + TIMER_DEVICE_CALLBACK_MEMBER(vblank_start_left); + TIMER_DEVICE_CALLBACK_MEMBER(vblank_start_right); TIMER_DEVICE_CALLBACK_MEMBER(timer_lev2_cb); TIMER_DEVICE_CALLBACK_MEMBER(sailormn_startup); - void cave_get_sprite_info(int chip); - void cave_get_sprite_info_all(); + void get_sprite_info(int chip); void sailormn_tilebank_w(int bank); DECLARE_WRITE_LINE_MEMBER(sound_irq_gen); void update_irq_state(); @@ -180,60 +172,8 @@ public: void esprade_unpack_sprites(int chip); void sailormn_unpack_tiles(int chip); - void uopoko(machine_config &config); - void sailormn(machine_config &config); - void paceight(machine_config &config); - void pacslot(machine_config &config); - void hotdogst(machine_config &config); - void crusherm(machine_config &config); - void donpachi(machine_config &config); - void tekkencw(machine_config &config); - void korokoro(machine_config &config); - void esprade(machine_config &config); - void mazinger(machine_config &config); - void tjumpman(machine_config &config); - void tekkenbs(machine_config &config); - void gaia(machine_config &config); - void metmqstr(machine_config &config); - void ppsatan(machine_config &config); - void guwange(machine_config &config); - void dfeveron(machine_config &config); - void ddonpach(machine_config &config); - void pwrinst2(machine_config &config); - void crusherm_map(address_map &map); - void ddonpach_map(address_map &map); - void dfeveron_map(address_map &map); - void donpachi_map(address_map &map); - void esprade_map(address_map &map); - void gaia_map(address_map &map); - void guwange_map(address_map &map); - void hotdogst_map(address_map &map); - void hotdogst_sound_map(address_map &map); - void hotdogst_sound_portmap(address_map &map); - void korokoro_map(address_map &map); - void mazinger_map(address_map &map); - void mazinger_sound_map(address_map &map); - void mazinger_sound_portmap(address_map &map); - void metmqstr_map(address_map &map); - void metmqstr_sound_map(address_map &map); - void metmqstr_sound_portmap(address_map &map); - void oki2_map(address_map &map); - void oki_map(address_map &map); - void paceight_map(address_map &map); - void pacslot_map(address_map &map); - void ppsatan_map(address_map &map); - void pwrinst2_map(address_map &map); - void pwrinst2_sound_map(address_map &map); - void pwrinst2_sound_portmap(address_map &map); - void sailormn_map(address_map &map); - void sailormn_sound_map(address_map &map); - void sailormn_sound_portmap(address_map &map); - void tekkenbs_map(address_map &map); - void tekkencw_map(address_map &map); - void tjumpman_map(address_map &map); - void uopoko_map(address_map &map); -protected: virtual void machine_start() override; + virtual void machine_reset() override; /* memory pointers */ optional_shared_ptr_array m_videoregs; @@ -252,6 +192,37 @@ protected: optional_memory_bank_array<2> m_okibank_hi; /* video-related */ + enum + { + MAX_PRIORITY = 4, + MAX_SPRITE_NUM = 0x400 + }; + + struct sprite_cave + { + sprite_cave() { } + + int priority = 0, flags = 0; + + const uint8_t *pen_data = nullptr; /* points to top left corner of tile data */ + int line_offset = 0; + + pen_t base_pen = 0; + int tile_width = 0, tile_height = 0; + int total_width = 0, total_height = 0; /* in screen coordinates */ + int x = 0, y = 0, xcount0 = 0, ycount0 = 0; + int zoomx_re = 0, zoomy_re = 0; + }; + + struct + { + int clip_left, clip_right, clip_top, clip_bottom; + uint8_t *baseaddr; + int line_offset; + uint8_t *baseaddr_zbuf; + int line_offset_zbuf; + } m_blit; + std::unique_ptr m_sprite[4]; sprite_cave *m_sprite_table[4][MAX_PRIORITY][MAX_SPRITE_NUM + 1]; @@ -293,8 +264,7 @@ protected: int m_soundbuf_rptr; uint8_t m_soundbuf_data[32]; bool m_soundbuf_empty; - //uint8_t m_sound_flag1; - //uint8_t m_sound_flag2; + //uint8_t m_sound_flag[2]; /* game specific */ // sailormn @@ -323,18 +293,17 @@ protected: int m_rasflag; int m_old_rasflag; -private: inline void tilemap_draw( int chip, screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, uint32_t flags, uint32_t priority, uint32_t priority2, int GFX ); void set_pens(int chip); - void cave_vh_start( int num ); + void vh_start( int num ); void get_sprite_info_cave(int chip); void get_sprite_info_donpachi(int chip); - void sprite_init_cave(); - void cave_sprite_check(int chip, screen_device &screen, const rectangle &clip); - void do_blit_zoom32_cave( int chip, const sprite_cave *sprite ); - void do_blit_zoom32_cave_zb( int chip, const sprite_cave *sprite ); - void do_blit_32_cave( int chip, const sprite_cave *sprite ); - void do_blit_32_cave_zb( int chip, const sprite_cave *sprite ); + void sprite_init(); + void sprite_check(int chip, screen_device &screen, const rectangle &clip); + void do_blit_zoom32( int chip, const sprite_cave *sprite ); + void do_blit_zoom32_zb( int chip, const sprite_cave *sprite ); + void do_blit_32( int chip, const sprite_cave *sprite ); + void do_blit_32_zb( int chip, const sprite_cave *sprite ); void sprite_draw_cave( int chip, int priority ); void sprite_draw_cave_zbuf( int chip, int priority ); void sprite_draw_donpachi( int chip, int priority ); @@ -343,6 +312,39 @@ private: void init_z80_bank(); void init_oki_bank(int chip); void show_leds(); + + void crusherm_map(address_map &map); + void ddonpach_map(address_map &map); + void dfeveron_map(address_map &map); + void donpachi_map(address_map &map); + void esprade_map(address_map &map); + void gaia_map(address_map &map); + void guwange_map(address_map &map); + void hotdogst_map(address_map &map); + void hotdogst_sound_map(address_map &map); + void hotdogst_sound_portmap(address_map &map); + void korokoro_map(address_map &map); + void mazinger_map(address_map &map); + void mazinger_sound_map(address_map &map); + void mazinger_sound_portmap(address_map &map); + void metmqstr_map(address_map &map); + void metmqstr_sound_map(address_map &map); + void metmqstr_sound_portmap(address_map &map); + void oki2_map(address_map &map); + void oki_map(address_map &map); + void paceight_map(address_map &map); + void pacslot_map(address_map &map); + void ppsatan_map(address_map &map); + void pwrinst2_map(address_map &map); + void pwrinst2_sound_map(address_map &map); + void pwrinst2_sound_portmap(address_map &map); + void sailormn_map(address_map &map); + void sailormn_sound_map(address_map &map); + void sailormn_sound_portmap(address_map &map); + void tekkenbs_map(address_map &map); + void tekkencw_map(address_map &map); + void tjumpman_map(address_map &map); + void uopoko_map(address_map &map); }; #endif // MAME_INCLUDES_CAVE_H diff --git a/src/mame/video/cave.cpp b/src/mame/video/cave.cpp index 4850caf1e1b..a0273c9a098 100644 --- a/src/mame/video/cave.cpp +++ b/src/mame/video/cave.cpp @@ -68,7 +68,7 @@ Note: if MAME_DEBUG is defined, pressing: ***************************************************************************/ -PALETTE_INIT_MEMBER(cave_state,cave) +void cave_state::palette_init_cave(palette_device &palette) { for (int chip = 0; chip < 4; chip++) { @@ -84,7 +84,7 @@ PALETTE_INIT_MEMBER(cave_state,cave) } } -PALETTE_INIT_MEMBER(cave_state,dfeveron) +void cave_state::palette_init_dfeveron(palette_device &palette) { int color, pen; @@ -93,34 +93,18 @@ PALETTE_INIT_MEMBER(cave_state,dfeveron) multiplies the color code by $100 (for consistency). That's why we need this function. */ - PALETTE_INIT_NAME(cave)(palette); + palette_init_cave(palette); for (color = 0; color < 0x40; color++) for (pen = 0; pen < 0x10; pen++) m_palette_map[0][(color << 8) | pen] = (color << 4) | pen; } -PALETTE_INIT_MEMBER(cave_state,ddonpach) +void cave_state::palette_init_mazinger(palette_device &palette) { int color, pen; - /* Fill the 8000-83ff range ($40 color codes * $10 pens) for - layers 0 & 1 which are 4 bits deep rather than 8 bits deep - like layer 2, but use the first 16 color of every 256 for - any given color code. */ - - PALETTE_INIT_NAME(cave)(palette); - - for (color = 0; color < 0x40; color++) - for (pen = 0; pen < 0x10; pen++) - m_palette_map[0][0x8000 | (color << 4) | pen] = 0x4000 | (color << 8) | pen; -} - -PALETTE_INIT_MEMBER(cave_state,mazinger) -{ - int color, pen; - - PALETTE_INIT_NAME(cave)(palette); + palette_init_cave(palette); /* sprites (encrypted) are 4 bit deep */ for (color = 0; color < 0x40; color++) @@ -134,11 +118,11 @@ PALETTE_INIT_MEMBER(cave_state,mazinger) m_palette_map[0][0x4400 + ((color << 6) | pen)] = 0x400 | ((color & 0x0f) << 6) | pen; } -PALETTE_INIT_MEMBER(cave_state,sailormn) +void cave_state::palette_init_sailormn(palette_device &palette) { int color, pen; - PALETTE_INIT_NAME(cave)(palette); + palette_init_cave(palette); /* sprites (encrypted) are 4 bit deep */ for (color = 0; color < 0x40; color++) @@ -152,11 +136,11 @@ PALETTE_INIT_MEMBER(cave_state,sailormn) m_palette_map[0][0x4c00 + ((color << 6) | pen)] = 0xc00 | ((color & 0x0f) << 6) | pen; } -PALETTE_INIT_MEMBER(cave_state,pwrinst2) +void cave_state::palette_init_pwrinst2(palette_device &palette) { int color, pen; - PALETTE_INIT_NAME(cave)(palette); + palette_init_cave(palette); for (color = 0; color < 0x80; color++) for (pen = 0; pen < 0x10; pen++) @@ -166,11 +150,11 @@ PALETTE_INIT_MEMBER(cave_state,pwrinst2) m_palette_map[0][pen] = pen - 0x8000; } -PALETTE_INIT_MEMBER(cave_state,korokoro) +void cave_state::palette_init_korokoro(palette_device &palette) { int color, pen; - PALETTE_INIT_NAME(cave)(palette); + palette_init_cave(palette); for (color = 0; color < 0x40; color++) for (pen = 0; pen < 0x10; pen++) @@ -302,7 +286,7 @@ TILE_GET_INFO_MEMBER(cave_state::sailormn_get_tile_info_2) ***************************************************************************/ -void cave_state::cave_vh_start( int num ) +void cave_state::vh_start( int num ) { assert(m_palette_map != nullptr); @@ -360,7 +344,7 @@ void cave_state::cave_vh_start( int num ) break; } - sprite_init_cave(); + sprite_init(); m_layers_offs_x = 0x13; m_layers_offs_y = -0x12; @@ -388,15 +372,15 @@ void cave_state::cave_vh_start( int num ) } } -VIDEO_START_MEMBER(cave_state,cave_1_layer){ cave_vh_start(1); } -VIDEO_START_MEMBER(cave_state,cave_2_layers){ cave_vh_start(2); } -VIDEO_START_MEMBER(cave_state,cave_3_layers){ cave_vh_start(3); } -VIDEO_START_MEMBER(cave_state,cave_4_layers){ cave_vh_start(4); } +VIDEO_START_MEMBER(cave_state,cave_1_layer){ vh_start(1); } +VIDEO_START_MEMBER(cave_state,cave_2_layers){ vh_start(2); } +VIDEO_START_MEMBER(cave_state,cave_3_layers){ vh_start(3); } +VIDEO_START_MEMBER(cave_state,cave_4_layers){ vh_start(4); } VIDEO_START_MEMBER(cave_state,sailormn_3_layers) { - cave_vh_start(2); + vh_start(2); /* Layer 2 (8x8) needs to be handled differently */ m_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(cave_state::sailormn_get_tile_info_2),this), TILEMAP_SCAN_ROWS, 8, 8, 512 / 8, 512 / 8 ); @@ -646,7 +630,7 @@ void cave_state::get_sprite_info_donpachi(int chip) } -void cave_state::sprite_init_cave() +void cave_state::sprite_init() { if (m_spritetype[0] == 0 || m_spritetype[0] == 2) // most of the games { @@ -684,11 +668,9 @@ void cave_state::sprite_init_cave() save_item(NAME(m_blit.clip_right)); save_item(NAME(m_blit.clip_top)); save_item(NAME(m_blit.clip_bottom)); - - machine().save().register_postload(save_prepost_delegate(FUNC(cave_state::cave_get_sprite_info_all), this)); } -void cave_state::cave_sprite_check(int chip, screen_device &screen, const rectangle &clip) +void cave_state::sprite_check(int chip, screen_device &screen, const rectangle &clip) { { /* set clip */ int left = clip.min_x; @@ -764,7 +746,7 @@ void cave_state::cave_sprite_check(int chip, screen_device &screen, const rectan } } -void cave_state::do_blit_zoom32_cave( int chip, const sprite_cave *sprite ) +void cave_state::do_blit_zoom32( int chip, const sprite_cave *sprite ) { /* assumes SPRITE_LIST_RAW_DATA flag is set */ int x1, x2, y1, y2, dx, dy; @@ -896,7 +878,7 @@ void cave_state::do_blit_zoom32_cave( int chip, const sprite_cave *sprite ) } -void cave_state::do_blit_zoom32_cave_zb( int chip, const sprite_cave *sprite ) +void cave_state::do_blit_zoom32_zb( int chip, const sprite_cave *sprite ) { /* assumes SPRITE_LIST_RAW_DATA flag is set */ int x1, x2, y1, y2, dx, dy; @@ -1031,7 +1013,7 @@ void cave_state::do_blit_zoom32_cave_zb( int chip, const sprite_cave *sprite ) } } -void cave_state::do_blit_32_cave( int chip, const sprite_cave *sprite ) +void cave_state::do_blit_32( int chip, const sprite_cave *sprite ) { /* assumes SPRITE_LIST_RAW_DATA flag is set */ int x1, x2, y1, y2, dx, dy; @@ -1126,7 +1108,7 @@ void cave_state::do_blit_32_cave( int chip, const sprite_cave *sprite ) } -void cave_state::do_blit_32_cave_zb( int chip, const sprite_cave *sprite ) +void cave_state::do_blit_32_zb( int chip, const sprite_cave *sprite ) { /* assumes SPRITE_LIST_RAW_DATA flag is set */ int x1, x2, y1, y2, dx, dy; @@ -1236,9 +1218,9 @@ void cave_state::sprite_draw_cave( int chip, int priority ) { const sprite_cave *sprite = m_sprite_table[chip][priority][i++]; if ((sprite->tile_width == sprite->total_width) && (sprite->tile_height == sprite->total_height)) - do_blit_32_cave(chip, sprite); + do_blit_32(chip, sprite); else - do_blit_zoom32_cave(chip, sprite); + do_blit_zoom32(chip, sprite); } } @@ -1249,9 +1231,9 @@ void cave_state::sprite_draw_cave_zbuf( int chip, int priority ) { const sprite_cave *sprite = m_sprite_table[chip][priority][i++]; if ((sprite->tile_width == sprite->total_width) && (sprite->tile_height == sprite->total_height)) - do_blit_32_cave_zb(chip, sprite); + do_blit_32_zb(chip, sprite); else - do_blit_zoom32_cave_zb(chip, sprite); + do_blit_zoom32_zb(chip, sprite); } } @@ -1259,14 +1241,14 @@ void cave_state::sprite_draw_donpachi( int chip, int priority ) { int i = 0; while (m_sprite_table[chip][priority][i]) - do_blit_32_cave(chip, m_sprite_table[chip][priority][i++]); + do_blit_32(chip, m_sprite_table[chip][priority][i++]); } void cave_state::sprite_draw_donpachi_zbuf( int chip, int priority ) { int i = 0; while (m_sprite_table[chip][priority][i]) - do_blit_32_cave_zb(chip, m_sprite_table[chip][priority][i++]); + do_blit_32_zb(chip, m_sprite_table[chip][priority][i++]); } @@ -1448,7 +1430,7 @@ inline void cave_state::tilemap_draw( int chip, } -uint32_t cave_state::screen_update_cave(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t cave_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int pri, pri2, GFX; int layers_ctrl = -1; @@ -1528,7 +1510,7 @@ uint32_t cave_state::screen_update_cave(screen_device &screen, bitmap_rgb32 &bit } #endif - cave_sprite_check(0, screen, cliprect); + sprite_check(0, screen, cliprect); bitmap.fill(m_palette->pen_color(m_background_pen), cliprect); @@ -1563,12 +1545,13 @@ uint32_t cave_state::screen_update_cave(screen_device &screen, bitmap_rgb32 &bit /**************************************************************/ -void cave_state::cave_get_sprite_info(int chip) +void cave_state::get_sprite_info(int chip) { - int spriteram_bankmax = m_spriteram[chip].bytes() / 0x4000; if (m_videoregs[chip] == nullptr) return; + int spriteram_bankmax = m_spriteram[chip].bytes() / 0x4000; + if (m_kludge == 3) /* mazinger metmqstr */ { if (machine().video().skip_this_frame() == 0) @@ -1587,20 +1570,20 @@ void cave_state::cave_get_sprite_info(int chip) } } } -void cave_state::cave_get_sprite_info_all() +void cave_state::device_post_load() { for (int chip = 0; chip < 4; chip++) - cave_get_sprite_info(chip); + get_sprite_info(chip); } // Poka Poka Satan: 3 screens * (1 Sprite chip + 1 Tilemap chip) -PALETTE_INIT_MEMBER(cave_state,ppsatan) +void cave_state::palette_init_ppsatan(palette_device &palette) { int color, pen; - PALETTE_INIT_NAME(cave)(palette); + palette_init_cave(palette); for (int chip = 0; chip < 3; chip++) { @@ -1630,7 +1613,7 @@ uint32_t cave_state::screen_update_ppsatan_core(screen_device &screen, bitmap_rg m_tilemap[chip]->mark_all_dirty(); m_old_tiledim[chip] = m_tiledim[chip]; - cave_sprite_check(chip, screen, cliprect); + sprite_check(chip, screen, cliprect); bitmap.fill(m_palette->pen_color(m_background_pen), cliprect); -- cgit v1.2.3