diff options
Diffstat (limited to 'src/mame/drivers/vendetta.c')
-rw-r--r-- | src/mame/drivers/vendetta.c | 65 |
1 files changed, 29 insertions, 36 deletions
diff --git a/src/mame/drivers/vendetta.c b/src/mame/drivers/vendetta.c index b5d38c0826f..14e193a69d8 100644 --- a/src/mame/drivers/vendetta.c +++ b/src/mame/drivers/vendetta.c @@ -118,7 +118,7 @@ static const eeprom_interface eeprom_intf = "0100110000000" /* unlock command */ }; -static WRITE8_HANDLER( vendetta_eeprom_w ) +WRITE8_MEMBER(vendetta_state::vendetta_eeprom_w) { /* bit 0 - VOC0 - Video banking related */ /* bit 1 - VOC1 - Video banking related */ @@ -129,38 +129,35 @@ static WRITE8_HANDLER( vendetta_eeprom_w ) /* bit 6 - IRQ enable */ /* bit 7 - Unused */ - vendetta_state *state = space->machine().driver_data<vendetta_state>(); if (data == 0xff ) /* this is a bug in the eeprom write code */ return; /* EEPROM */ - input_port_write(space->machine(), "EEPROMOUT", data, 0xff); + input_port_write(machine(), "EEPROMOUT", data, 0xff); - state->m_irq_enabled = (data >> 6) & 1; + m_irq_enabled = (data >> 6) & 1; - vendetta_video_banking(space->machine(), data & 1); + vendetta_video_banking(machine(), data & 1); } /********************************************/ -static READ8_HANDLER( vendetta_K052109_r ) +READ8_MEMBER(vendetta_state::vendetta_K052109_r) { - vendetta_state *state = space->machine().driver_data<vendetta_state>(); - return k052109_r(state->m_k052109, offset + 0x2000); + return k052109_r(m_k052109, offset + 0x2000); } -static WRITE8_HANDLER( vendetta_K052109_w ) +WRITE8_MEMBER(vendetta_state::vendetta_K052109_w) { - vendetta_state *state = space->machine().driver_data<vendetta_state>(); // ************************************************************************************* // * Escape Kids uses 052109's mirrored Tilemap ROM bank selector, but only during * // * Tilemap MASK-ROM Test (0x1d80<->0x3d80, 0x1e00<->0x3e00, 0x1f00<->0x3f00) * // ************************************************************************************* if ((offset == 0x1d80) || (offset == 0x1e00) || (offset == 0x1f00)) - k052109_w(state->m_k052109, offset, data); - k052109_w(state->m_k052109, offset + 0x2000, data); + k052109_w(m_k052109, offset, data); + k052109_w(m_k052109, offset + 0x2000, data); } @@ -178,28 +175,27 @@ static void vendetta_video_banking( running_machine &machine, int select ) } else { - space->install_legacy_readwrite_handler(state->m_video_banking_base + 0x2000, state->m_video_banking_base + 0x2fff, FUNC(vendetta_K052109_r), FUNC(vendetta_K052109_w) ); + space->install_readwrite_handler(state->m_video_banking_base + 0x2000, state->m_video_banking_base + 0x2fff, read8_delegate(FUNC(vendetta_state::vendetta_K052109_r),state), write8_delegate(FUNC(vendetta_state::vendetta_K052109_w),state) ); space->install_legacy_readwrite_handler(*state->m_k052109, state->m_video_banking_base + 0x0000, state->m_video_banking_base + 0x0fff, FUNC(k052109_r), FUNC(k052109_w) ); } } -static WRITE8_HANDLER( vendetta_5fe0_w ) +WRITE8_MEMBER(vendetta_state::vendetta_5fe0_w) { - vendetta_state *state = space->machine().driver_data<vendetta_state>(); /* bit 0,1 coin counters */ - coin_counter_w(space->machine(), 0, data & 0x01); - coin_counter_w(space->machine(), 1, data & 0x02); + coin_counter_w(machine(), 0, data & 0x01); + coin_counter_w(machine(), 1, data & 0x02); /* bit 2 = BRAMBK ?? */ /* bit 3 = enable char ROM reading through the video RAM */ - k052109_set_rmrd_line(state->m_k052109, (data & 0x08) ? ASSERT_LINE : CLEAR_LINE); + k052109_set_rmrd_line(m_k052109, (data & 0x08) ? ASSERT_LINE : CLEAR_LINE); /* bit 4 = INIT ?? */ /* bit 5 = enable sprite ROM reading */ - k053246_set_objcha_line(state->m_k053246, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); + k053246_set_objcha_line(m_k053246, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); } static TIMER_CALLBACK( z80_nmi_callback ) @@ -208,24 +204,21 @@ static TIMER_CALLBACK( z80_nmi_callback ) device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, ASSERT_LINE); } -static WRITE8_HANDLER( z80_arm_nmi_w ) +WRITE8_MEMBER(vendetta_state::z80_arm_nmi_w) { - vendetta_state *state = space->machine().driver_data<vendetta_state>(); - device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, CLEAR_LINE); + device_set_input_line(m_audiocpu, INPUT_LINE_NMI, CLEAR_LINE); - space->machine().scheduler().timer_set(attotime::from_usec(25), FUNC(z80_nmi_callback)); + machine().scheduler().timer_set(attotime::from_usec(25), FUNC(z80_nmi_callback)); } -static WRITE8_HANDLER( z80_irq_w ) +WRITE8_MEMBER(vendetta_state::z80_irq_w) { - vendetta_state *state = space->machine().driver_data<vendetta_state>(); - device_set_input_line_and_vector(state->m_audiocpu, 0, HOLD_LINE, 0xff); + device_set_input_line_and_vector(m_audiocpu, 0, HOLD_LINE, 0xff); } -static READ8_HANDLER( vendetta_sound_interrupt_r ) +READ8_MEMBER(vendetta_state::vendetta_sound_interrupt_r) { - vendetta_state *state = space->machine().driver_data<vendetta_state>(); - device_set_input_line_and_vector(state->m_audiocpu, 0, HOLD_LINE, 0xff); + device_set_input_line_and_vector(m_audiocpu, 0, HOLD_LINE, 0xff); return 0x00; } @@ -248,9 +241,9 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, vendetta_state ) AM_RANGE(0x5fc3, 0x5fc3) AM_READ_PORT("P4") AM_RANGE(0x5fd0, 0x5fd0) AM_READ_PORT("EEPROM") AM_RANGE(0x5fd1, 0x5fd1) AM_READ_PORT("SERVICE") - AM_RANGE(0x5fe0, 0x5fe0) AM_WRITE_LEGACY(vendetta_5fe0_w) - AM_RANGE(0x5fe2, 0x5fe2) AM_WRITE_LEGACY(vendetta_eeprom_w) - AM_RANGE(0x5fe4, 0x5fe4) AM_READWRITE_LEGACY(vendetta_sound_interrupt_r, z80_irq_w) + AM_RANGE(0x5fe0, 0x5fe0) AM_WRITE(vendetta_5fe0_w) + AM_RANGE(0x5fe2, 0x5fe2) AM_WRITE(vendetta_eeprom_w) + AM_RANGE(0x5fe4, 0x5fe4) AM_READWRITE(vendetta_sound_interrupt_r, z80_irq_w) AM_RANGE(0x5fe6, 0x5fe7) AM_DEVREADWRITE_LEGACY("k053260", vendetta_sound_r, k053260_w) AM_RANGE(0x5fe8, 0x5fe9) AM_DEVREAD_LEGACY("k053246", k053246_r) AM_RANGE(0x5fea, 0x5fea) AM_READ_LEGACY(watchdog_reset_r) @@ -272,9 +265,9 @@ static ADDRESS_MAP_START( esckids_map, AS_PROGRAM, 8, vendetta_state ) AM_RANGE(0x3fa0, 0x3fa7) AM_DEVWRITE_LEGACY("k053246", k053246_w) // 053246 (Sprite) AM_RANGE(0x3fb0, 0x3fbf) AM_DEVWRITE_LEGACY("k053251", k053251_w) // 053251 (Priority Encoder) AM_RANGE(0x3fc0, 0x3fcf) AM_DEVREADWRITE_LEGACY("k053252",k053252_r,k053252_w) // Not Emulated (053252 ???) - AM_RANGE(0x3fd0, 0x3fd0) AM_WRITE_LEGACY(vendetta_5fe0_w) // Coin Counter, 052109 RMRD, 053246 OBJCHA - AM_RANGE(0x3fd2, 0x3fd2) AM_WRITE_LEGACY(vendetta_eeprom_w) // EEPROM, Video banking - AM_RANGE(0x3fd4, 0x3fd4) AM_READWRITE_LEGACY(vendetta_sound_interrupt_r, z80_irq_w) // Sound + AM_RANGE(0x3fd0, 0x3fd0) AM_WRITE(vendetta_5fe0_w) // Coin Counter, 052109 RMRD, 053246 OBJCHA + AM_RANGE(0x3fd2, 0x3fd2) AM_WRITE(vendetta_eeprom_w) // EEPROM, Video banking + AM_RANGE(0x3fd4, 0x3fd4) AM_READWRITE(vendetta_sound_interrupt_r, z80_irq_w) // Sound AM_RANGE(0x3fd6, 0x3fd7) AM_DEVREADWRITE_LEGACY("k053260", vendetta_sound_r, k053260_w) // Sound AM_RANGE(0x3fd8, 0x3fd9) AM_DEVREAD_LEGACY("k053246", k053246_r) // 053246 (Sprite) AM_RANGE(0x3fda, 0x3fda) AM_WRITENOP // Not Emulated (Watchdog ???) @@ -291,7 +284,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, vendetta_state ) AM_RANGE(0x0000, 0xefff) AM_ROM AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_RANGE(0xf800, 0xf801) AM_DEVREADWRITE_LEGACY("ymsnd", ym2151_r, ym2151_w) - AM_RANGE(0xfa00, 0xfa00) AM_WRITE_LEGACY(z80_arm_nmi_w) + AM_RANGE(0xfa00, 0xfa00) AM_WRITE(z80_arm_nmi_w) AM_RANGE(0xfc00, 0xfc2f) AM_DEVREADWRITE_LEGACY("k053260", k053260_r, k053260_w) ADDRESS_MAP_END |