diff options
Diffstat (limited to 'src/mame/drivers/madalien.c')
-rw-r--r-- | src/mame/drivers/madalien.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/src/mame/drivers/madalien.c b/src/mame/drivers/madalien.c index 6790f6ec366..be2168df367 100644 --- a/src/mame/drivers/madalien.c +++ b/src/mame/drivers/madalien.c @@ -30,40 +30,38 @@ INLINE UINT8 shift_common(running_machine &machine, UINT8 hi, UINT8 lo) return table[((hi & 0x07) << 8) | lo]; } -static READ8_HANDLER( shift_r ) +READ8_MEMBER(madalien_state::shift_r) { - madalien_state *state = space->machine().driver_data<madalien_state>(); - return shift_common(space->machine(), *state->m_shift_hi, *state->m_shift_lo); + return shift_common(machine(), *m_shift_hi, *m_shift_lo); } -static READ8_HANDLER( shift_rev_r ) +READ8_MEMBER(madalien_state::shift_rev_r) { - madalien_state *state = space->machine().driver_data<madalien_state>(); - UINT8 hi = *state->m_shift_hi ^ 0x07; - UINT8 lo = BITSWAP8(*state->m_shift_lo,0,1,2,3,4,5,6,7); + UINT8 hi = *m_shift_hi ^ 0x07; + UINT8 lo = BITSWAP8(*m_shift_lo,0,1,2,3,4,5,6,7); - UINT8 ret = shift_common(space->machine(), hi, lo); + UINT8 ret = shift_common(machine(), hi, lo); return BITSWAP8(ret,7,0,1,2,3,4,5,6) & 0x7f; } -static WRITE8_HANDLER( madalien_output_w ) +WRITE8_MEMBER(madalien_state::madalien_output_w) { /* output latch, eight output bits, none connected */ } -static WRITE8_HANDLER( madalien_sound_command_w ) +WRITE8_MEMBER(madalien_state::madalien_sound_command_w) { - cputag_set_input_line(space->machine(), "audiocpu", 0, ASSERT_LINE); + cputag_set_input_line(machine(), "audiocpu", 0, ASSERT_LINE); soundlatch_w(space, offset, data); } -static READ8_HANDLER(madalien_sound_command_r ) +READ8_MEMBER(madalien_state::madalien_sound_command_r) { - cputag_set_input_line(space->machine(), "audiocpu", 0, CLEAR_LINE); + cputag_set_input_line(machine(), "audiocpu", 0, CLEAR_LINE); return soundlatch_r(space, offset); } @@ -88,10 +86,10 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, madalien_state ) AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x0ff0) AM_DEVWRITE("crtc", mc6845_device, address_w) AM_RANGE(0x8001, 0x8001) AM_MIRROR(0x0ff0) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w) AM_RANGE(0x8004, 0x8004) AM_MIRROR(0x0ff0) AM_WRITEONLY AM_BASE(m_video_control) - AM_RANGE(0x8005, 0x8005) AM_MIRROR(0x0ff0) AM_WRITE_LEGACY(madalien_output_w) - AM_RANGE(0x8006, 0x8006) AM_MIRROR(0x0ff0) AM_READWRITE_LEGACY(soundlatch2_r, madalien_sound_command_w) - AM_RANGE(0x8008, 0x8008) AM_MIRROR(0x07f0) AM_RAM_READ_LEGACY(shift_r) AM_BASE(m_shift_hi) - AM_RANGE(0x8009, 0x8009) AM_MIRROR(0x07f0) AM_RAM_READ_LEGACY(shift_rev_r) AM_BASE(m_shift_lo) + AM_RANGE(0x8005, 0x8005) AM_MIRROR(0x0ff0) AM_WRITE(madalien_output_w) + AM_RANGE(0x8006, 0x8006) AM_MIRROR(0x0ff0) AM_READ_LEGACY(soundlatch2_r) AM_WRITE(madalien_sound_command_w) + AM_RANGE(0x8008, 0x8008) AM_MIRROR(0x07f0) AM_RAM_READ(shift_r) AM_BASE(m_shift_hi) + AM_RANGE(0x8009, 0x8009) AM_MIRROR(0x07f0) AM_RAM_READ(shift_rev_r) AM_BASE(m_shift_lo) AM_RANGE(0x800b, 0x800b) AM_MIRROR(0x07f0) AM_WRITEONLY AM_BASE(m_video_flags) AM_RANGE(0x800c, 0x800c) AM_MIRROR(0x07f0) AM_WRITEONLY AM_BASE(m_headlight_pos) AM_RANGE(0x800d, 0x800d) AM_MIRROR(0x07f0) AM_WRITEONLY AM_BASE(m_edge1_pos) @@ -109,7 +107,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, madalien_state ) AM_RANGE(0x0000, 0x03ff) AM_MIRROR(0x1c00) AM_RAM AM_RANGE(0x6000, 0x6003) AM_MIRROR(0x1ffc) AM_RAM /* unknown device in an epoxy block, might be tilt detection */ - AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x1ffc) AM_READ_LEGACY(madalien_sound_command_r) + AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x1ffc) AM_READ(madalien_sound_command_r) AM_RANGE(0x8000, 0x8001) AM_MIRROR(0x1ffc) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w) AM_RANGE(0x8002, 0x8002) AM_MIRROR(0x1ffc) AM_WRITE_LEGACY(soundlatch2_w) AM_RANGE(0xf800, 0xffff) AM_ROM |