diff options
Diffstat (limited to 'src/mame/drivers/toypop.c')
-rw-r--r-- | src/mame/drivers/toypop.c | 97 |
1 files changed, 44 insertions, 53 deletions
diff --git a/src/mame/drivers/toypop.c b/src/mame/drivers/toypop.c index 952ae93ef19..4e33d00f51c 100644 --- a/src/mame/drivers/toypop.c +++ b/src/mame/drivers/toypop.c @@ -37,53 +37,46 @@ TODO: #include "includes/toypop.h" -static READ16_HANDLER( toypop_m68000_sharedram_r ) +READ16_MEMBER(toypop_state::toypop_m68000_sharedram_r) { - toypop_state *state = space->machine().driver_data<toypop_state>(); - return state->m_m68000_sharedram[offset]; + return m_m68000_sharedram[offset]; } -static WRITE16_HANDLER( toypop_m68000_sharedram_w ) +WRITE16_MEMBER(toypop_state::toypop_m68000_sharedram_w) { if (ACCESSING_BITS_0_7) { - toypop_state *state = space->machine().driver_data<toypop_state>(); - state->m_m68000_sharedram[offset] = data & 0xff; + m_m68000_sharedram[offset] = data & 0xff; } } -static READ8_HANDLER( toypop_main_interrupt_enable_r ) +READ8_MEMBER(toypop_state::toypop_main_interrupt_enable_r) { - toypop_state *state = space->machine().driver_data<toypop_state>(); - state->m_main_irq_mask = 1; + m_main_irq_mask = 1; return 0; } -static WRITE8_HANDLER( toypop_main_interrupt_enable_w ) +WRITE8_MEMBER(toypop_state::toypop_main_interrupt_enable_w) { - toypop_state *state = space->machine().driver_data<toypop_state>(); - state->m_main_irq_mask = 1; + m_main_irq_mask = 1; } -static WRITE8_HANDLER( toypop_main_interrupt_disable_w ) +WRITE8_MEMBER(toypop_state::toypop_main_interrupt_disable_w) { - toypop_state *state = space->machine().driver_data<toypop_state>(); - state->m_main_irq_mask = 0; -// cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE); + m_main_irq_mask = 0; +// cputag_set_input_line(machine(), "maincpu", 0, CLEAR_LINE); } -static WRITE8_HANDLER( toypop_sound_interrupt_enable_acknowledge_w ) +WRITE8_MEMBER(toypop_state::toypop_sound_interrupt_enable_acknowledge_w) { - toypop_state *state = space->machine().driver_data<toypop_state>(); - state->m_sound_irq_mask = 1; -// cputag_set_input_line(space->machine(), "audiocpu", 0, CLEAR_LINE); + m_sound_irq_mask = 1; +// cputag_set_input_line(machine(), "audiocpu", 0, CLEAR_LINE); } -static WRITE8_HANDLER( toypop_sound_interrupt_disable_w ) +WRITE8_MEMBER(toypop_state::toypop_sound_interrupt_disable_w) { - toypop_state *state = space->machine().driver_data<toypop_state>(); - state->m_sound_irq_mask = 0; + m_sound_irq_mask = 0; } static TIMER_CALLBACK( namcoio_run ) @@ -135,24 +128,24 @@ static INTERRUPT_GEN( toypop_sound_timer_irq ) device_set_input_line(device, 0, HOLD_LINE); } -static WRITE8_HANDLER( toypop_sound_clear_w ) +WRITE8_MEMBER(toypop_state::toypop_sound_clear_w) { - cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, CLEAR_LINE); + cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_RESET, CLEAR_LINE); } -static WRITE8_HANDLER( toypop_sound_assert_w ) +WRITE8_MEMBER(toypop_state::toypop_sound_assert_w) { - cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, ASSERT_LINE); + cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_RESET, ASSERT_LINE); } -static WRITE8_HANDLER( toypop_m68000_clear_w ) +WRITE8_MEMBER(toypop_state::toypop_m68000_clear_w) { - cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, CLEAR_LINE); + cputag_set_input_line(machine(), "sub", INPUT_LINE_RESET, CLEAR_LINE); } -static WRITE8_HANDLER( toypop_m68000_assert_w ) +WRITE8_MEMBER(toypop_state::toypop_m68000_assert_w) { - cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, ASSERT_LINE); + cputag_set_input_line(machine(), "sub", INPUT_LINE_RESET, ASSERT_LINE); } static MACHINE_RESET( toypop ) @@ -175,16 +168,14 @@ static INTERRUPT_GEN( toypop_m68000_interrupt ) device_set_input_line(device, 6, HOLD_LINE); } -static WRITE16_HANDLER( toypop_m68000_interrupt_enable_w ) +WRITE16_MEMBER(toypop_state::toypop_m68000_interrupt_enable_w) { - toypop_state *state = space->machine().driver_data<toypop_state>(); - state->m_interrupt_enable_68k = 1; + m_interrupt_enable_68k = 1; } -static WRITE16_HANDLER( toypop_m68000_interrupt_disable_w ) +WRITE16_MEMBER(toypop_state::toypop_m68000_interrupt_disable_w) { - toypop_state *state = space->machine().driver_data<toypop_state>(); - state->m_interrupt_enable_68k = 0; + m_interrupt_enable_68k = 0; } @@ -203,12 +194,12 @@ static ADDRESS_MAP_START( liblrabl_map, AS_PROGRAM, 8, toypop_state ) AM_RANGE(0x6800, 0x680f) AM_DEVREADWRITE_LEGACY("58xx", namcoio_r, namcoio_w) /* custom I/O */ AM_RANGE(0x6810, 0x681f) AM_DEVREADWRITE_LEGACY("56xx_1", namcoio_r, namcoio_w) /* custom I/O */ AM_RANGE(0x6820, 0x682f) AM_DEVREADWRITE_LEGACY("56xx_2", namcoio_r, namcoio_w) /* custom I/O */ - AM_RANGE(0x7000, 0x7000) AM_WRITE_LEGACY(toypop_main_interrupt_enable_w) /* enable interrupt */ - AM_RANGE(0x7800, 0x7800) AM_READWRITE_LEGACY(watchdog_reset_r, toypop_main_interrupt_disable_w) /* disable interrupt */ - AM_RANGE(0x8000, 0x8000) AM_WRITE_LEGACY(toypop_m68000_clear_w) /* reset 68000 */ - AM_RANGE(0x8800, 0x8800) AM_WRITE_LEGACY(toypop_m68000_assert_w) /* reset 68000 */ - AM_RANGE(0x9000, 0x9000) AM_WRITE_LEGACY(toypop_sound_clear_w) /* sound CPU reset */ - AM_RANGE(0x9800, 0x9800) AM_WRITE_LEGACY(toypop_sound_assert_w) /* sound CPU reset */ + AM_RANGE(0x7000, 0x7000) AM_WRITE(toypop_main_interrupt_enable_w) /* enable interrupt */ + AM_RANGE(0x7800, 0x7800) AM_READ_LEGACY(watchdog_reset_r) AM_WRITE(toypop_main_interrupt_disable_w) /* disable interrupt */ + AM_RANGE(0x8000, 0x8000) AM_WRITE(toypop_m68000_clear_w) /* reset 68000 */ + AM_RANGE(0x8800, 0x8800) AM_WRITE(toypop_m68000_assert_w) /* reset 68000 */ + AM_RANGE(0x9000, 0x9000) AM_WRITE(toypop_sound_clear_w) /* sound CPU reset */ + AM_RANGE(0x9800, 0x9800) AM_WRITE(toypop_sound_assert_w) /* sound CPU reset */ AM_RANGE(0xa000, 0xa001) AM_WRITE_LEGACY(toypop_palettebank_w) /* background image palette */ AM_RANGE(0x8000, 0xffff) AM_ROM /* ROM code */ ADDRESS_MAP_END @@ -221,11 +212,11 @@ static ADDRESS_MAP_START( toypop_map, AS_PROGRAM, 8, toypop_state ) AM_RANGE(0x6010, 0x601f) AM_DEVREADWRITE_LEGACY("56xx_1", namcoio_r, namcoio_w) /* custom I/O */ AM_RANGE(0x6020, 0x602f) AM_DEVREADWRITE_LEGACY("56xx_2", namcoio_r, namcoio_w) /* custom I/O */ AM_RANGE(0x6800, 0x6bff) AM_DEVREADWRITE_LEGACY("namco", namco_snd_sharedram_r, namco_snd_sharedram_w) /* shared RAM with sound CPU */ - AM_RANGE(0x7000, 0x7000) AM_READWRITE_LEGACY(toypop_main_interrupt_enable_r, toypop_main_interrupt_disable_w) /* disable interrupt */ - AM_RANGE(0x8000, 0x8000) AM_WRITE_LEGACY(toypop_m68000_clear_w) /* reset 68000 */ - AM_RANGE(0x8800, 0x8800) AM_WRITE_LEGACY(toypop_m68000_assert_w) /* reset 68000 */ - AM_RANGE(0x9000, 0x9000) AM_WRITE_LEGACY(toypop_sound_clear_w) /* sound CPU reset */ - AM_RANGE(0x9800, 0x9800) AM_WRITE_LEGACY(toypop_sound_assert_w) /* sound CPU reset */ + AM_RANGE(0x7000, 0x7000) AM_READWRITE(toypop_main_interrupt_enable_r, toypop_main_interrupt_disable_w) /* disable interrupt */ + AM_RANGE(0x8000, 0x8000) AM_WRITE(toypop_m68000_clear_w) /* reset 68000 */ + AM_RANGE(0x8800, 0x8800) AM_WRITE(toypop_m68000_assert_w) /* reset 68000 */ + AM_RANGE(0x9000, 0x9000) AM_WRITE(toypop_sound_clear_w) /* sound CPU reset */ + AM_RANGE(0x9800, 0x9800) AM_WRITE(toypop_sound_assert_w) /* sound CPU reset */ AM_RANGE(0xa000, 0xa001) AM_WRITE_LEGACY(toypop_palettebank_w) /* background image palette */ AM_RANGE(0x8000, 0xffff) AM_ROM /* ROM code */ ADDRESS_MAP_END @@ -239,8 +230,8 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, toypop_state ) AM_RANGE(0x0000, 0x03ff) AM_DEVREADWRITE_LEGACY("namco", namco_snd_sharedram_r, namco_snd_sharedram_w) /* shared RAM with the main CPU + sound registers */ - AM_RANGE(0x2000, 0x2000) AM_WRITE_LEGACY(toypop_sound_interrupt_disable_w) /* ??? toypop doesn't write here */ - AM_RANGE(0x4000, 0x4000) AM_WRITE_LEGACY(toypop_sound_interrupt_enable_acknowledge_w) + AM_RANGE(0x2000, 0x2000) AM_WRITE(toypop_sound_interrupt_disable_w) /* ??? toypop doesn't write here */ + AM_RANGE(0x4000, 0x4000) AM_WRITE(toypop_sound_interrupt_enable_acknowledge_w) AM_RANGE(0x6000, 0x6000) AM_WRITE_LEGACY(watchdog_reset_w) AM_RANGE(0xe000, 0xffff) AM_ROM ADDRESS_MAP_END @@ -256,12 +247,12 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( m68k_map, AS_PROGRAM, 16, toypop_state ) AM_RANGE(0x000000, 0x007fff) AM_ROM /* ROM code */ AM_RANGE(0x080000, 0x0bffff) AM_RAM /* RAM */ - AM_RANGE(0x100000, 0x100fff) AM_READWRITE_LEGACY(toypop_m68000_sharedram_r, toypop_m68000_sharedram_w) /* shared RAM with the main CPU */ + AM_RANGE(0x100000, 0x100fff) AM_READWRITE(toypop_m68000_sharedram_r, toypop_m68000_sharedram_w) /* shared RAM with the main CPU */ AM_RANGE(0x180000, 0x187fff) AM_READWRITE_LEGACY(toypop_merged_background_r, toypop_merged_background_w) /* RAM that has to be merged with the background image */ AM_RANGE(0x18fffc, 0x18ffff) AM_WRITE_LEGACY(toypop_flipscreen_w) /* flip mode */ AM_RANGE(0x190000, 0x1dffff) AM_RAM AM_BASE(m_bg_image) /* RAM containing the background image */ - AM_RANGE(0x300000, 0x300001) AM_WRITE_LEGACY(toypop_m68000_interrupt_enable_w) /* interrupt enable */ - AM_RANGE(0x380000, 0x380001) AM_WRITE_LEGACY(toypop_m68000_interrupt_disable_w)/* interrupt disable */ + AM_RANGE(0x300000, 0x300001) AM_WRITE(toypop_m68000_interrupt_enable_w) /* interrupt enable */ + AM_RANGE(0x380000, 0x380001) AM_WRITE(toypop_m68000_interrupt_disable_w)/* interrupt disable */ ADDRESS_MAP_END |