diff options
Diffstat (limited to 'src/mame/drivers/mugsmash.c')
-rw-r--r-- | src/mame/drivers/mugsmash.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/mame/drivers/mugsmash.c b/src/mame/drivers/mugsmash.c index dc14c2677ec..879b9926dbf 100644 --- a/src/mame/drivers/mugsmash.c +++ b/src/mame/drivers/mugsmash.c @@ -46,18 +46,17 @@ behavior we use . #include "sound/okim6295.h" #include "includes/mugsmash.h" -static WRITE16_HANDLER( mugsmash_reg2_w ) +WRITE16_MEMBER(mugsmash_state::mugsmash_reg2_w) { - mugsmash_state *state = space->machine().driver_data<mugsmash_state>(); - state->m_regs2[offset] = data; - //popmessage ("Regs2 %04x, %04x, %04x, %04x", state->m_regs2[0], state->m_regs2[1], state->m_regs2[2], state->m_regs2[3]); + m_regs2[offset] = data; + //popmessage ("Regs2 %04x, %04x, %04x, %04x", m_regs2[0], m_regs2[1], m_regs2[2], m_regs2[3]); switch (offset) { case 1: soundlatch_w(space, 1, data & 0xff); - device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, PULSE_LINE ); + device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE ); break; default: @@ -148,23 +147,23 @@ static WRITE16_HANDLER( mugsmash_reg2_w ) #define USE_FAKE_INPUT_PORTS 0 #if USE_FAKE_INPUT_PORTS -static READ16_HANDLER ( mugsmash_input_ports_r ) +READ16_MEMBER(mugsmash_state::mugsmash_input_ports_r) { UINT16 data = 0xffff; switch (offset) { case 0 : - data = (input_port_read(space->machine(), "P1") & 0xff) | ((input_port_read(space->machine(), "DSW1") & 0xc0) << 6) | ((input_port_read(space->machine(), "IN0") & 0x03) << 8); + data = (input_port_read(machine(), "P1") & 0xff) | ((input_port_read(machine(), "DSW1") & 0xc0) << 6) | ((input_port_read(machine(), "IN0") & 0x03) << 8); break; case 1 : - data = (input_port_read(space->machine(), "P2") & 0xff) | ((input_port_read(space->machine(), "DSW1") & 0x3f) << 8); + data = (input_port_read(machine(), "P2") & 0xff) | ((input_port_read(machine(), "DSW1") & 0x3f) << 8); break; case 2 : - data = ((input_port_read(space->machine(), "DSW2") & 0x3f) << 8); + data = ((input_port_read(machine(), "DSW2") & 0x3f) << 8); break; case 3 : - data = ((input_port_read(space->machine(), "DSW2") & 0xc0) << 2); + data = ((input_port_read(machine(), "DSW2") & 0xc0) << 2); break; } @@ -178,12 +177,12 @@ static ADDRESS_MAP_START( mugsmash_map, AS_PROGRAM, 16, mugsmash_state ) AM_RANGE(0x082000, 0x082fff) AM_RAM_WRITE_LEGACY(mugsmash_videoram2_w) AM_BASE(m_videoram2) AM_RANGE(0x0c0000, 0x0c0007) AM_WRITE_LEGACY(mugsmash_reg_w) AM_BASE(m_regs1) /* video registers*/ AM_RANGE(0x100000, 0x1005ff) AM_RAM_WRITE_LEGACY(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE_GENERIC(paletteram) - AM_RANGE(0x140000, 0x140007) AM_WRITE_LEGACY(mugsmash_reg2_w) AM_BASE(m_regs2) /* sound + ? */ + AM_RANGE(0x140000, 0x140007) AM_WRITE(mugsmash_reg2_w) AM_BASE(m_regs2) /* sound + ? */ AM_RANGE(0x1c0000, 0x1c3fff) AM_RAM /* main ram? */ AM_RANGE(0x1c4000, 0x1cffff) AM_RAM AM_RANGE(0x200000, 0x203fff) AM_RAM AM_BASE(m_spriteram) /* sprite ram */ #if USE_FAKE_INPUT_PORTS - AM_RANGE(0x180000, 0x180007) AM_READ_LEGACY(mugsmash_input_ports_r) + AM_RANGE(0x180000, 0x180007) AM_READ(mugsmash_input_ports_r) #else AM_RANGE(0x180000, 0x180001) AM_READ_PORT("IN0") AM_RANGE(0x180002, 0x180003) AM_READ_PORT("IN1") |