diff options
Diffstat (limited to 'src/mame/drivers/nightgal.c')
-rw-r--r-- | src/mame/drivers/nightgal.c | 56 |
1 files changed, 27 insertions, 29 deletions
diff --git a/src/mame/drivers/nightgal.c b/src/mame/drivers/nightgal.c index beb5c3e76cf..6fa824bd676 100644 --- a/src/mame/drivers/nightgal.c +++ b/src/mame/drivers/nightgal.c @@ -313,46 +313,46 @@ static WRITE8_HANDLER( mux_w ) // printf("%02x\n",mux_data); } -static READ8_HANDLER( input_1p_r ) +static READ8_DEVICE_HANDLER( input_1p_r ) { static UINT8 cr_clear; - cr_clear = input_port_read(space->machine, "CR_CLEAR"); + cr_clear = input_port_read(device->machine, "CR_CLEAR"); switch(mux_data) { - case 0x01: return input_port_read(space->machine, "PL1_1") | cr_clear; - case 0x02: return input_port_read(space->machine, "PL1_2") | cr_clear; - case 0x04: return input_port_read(space->machine, "PL1_3") | cr_clear; - case 0x08: return input_port_read(space->machine, "PL1_4") | cr_clear; - case 0x10: return input_port_read(space->machine, "PL1_5") | cr_clear; - case 0x20: return input_port_read(space->machine, "PL1_6") | cr_clear; + case 0x01: return input_port_read(device->machine, "PL1_1") | cr_clear; + case 0x02: return input_port_read(device->machine, "PL1_2") | cr_clear; + case 0x04: return input_port_read(device->machine, "PL1_3") | cr_clear; + case 0x08: return input_port_read(device->machine, "PL1_4") | cr_clear; + case 0x10: return input_port_read(device->machine, "PL1_5") | cr_clear; + case 0x20: return input_port_read(device->machine, "PL1_6") | cr_clear; } // printf("%04x\n",mux_data); - return (input_port_read(space->machine, "PL1_1") & input_port_read(space->machine, "PL1_2") & input_port_read(space->machine, "PL1_3") & - input_port_read(space->machine, "PL1_4") & input_port_read(space->machine, "PL1_5") & input_port_read(space->machine, "PL1_6")) | cr_clear;//input_port_read(space->machine, "PL1_0") && ; + return (input_port_read(device->machine, "PL1_1") & input_port_read(device->machine, "PL1_2") & input_port_read(device->machine, "PL1_3") & + input_port_read(device->machine, "PL1_4") & input_port_read(device->machine, "PL1_5") & input_port_read(device->machine, "PL1_6")) | cr_clear;//input_port_read(device->machine, "PL1_0") && ; } -static READ8_HANDLER( input_2p_r ) +static READ8_DEVICE_HANDLER( input_2p_r ) { static UINT8 coin_port; - coin_port = input_port_read(space->machine, "COINS"); + coin_port = input_port_read(device->machine, "COINS"); switch(mux_data) { - case 0x01: return input_port_read(space->machine, "PL2_1") | coin_port; - case 0x02: return input_port_read(space->machine, "PL2_2") | coin_port; - case 0x04: return input_port_read(space->machine, "PL2_3") | coin_port; - case 0x08: return input_port_read(space->machine, "PL2_4") | coin_port; - case 0x10: return input_port_read(space->machine, "PL2_5") | coin_port; - case 0x20: return input_port_read(space->machine, "PL2_6") | coin_port; + case 0x01: return input_port_read(device->machine, "PL2_1") | coin_port; + case 0x02: return input_port_read(device->machine, "PL2_2") | coin_port; + case 0x04: return input_port_read(device->machine, "PL2_3") | coin_port; + case 0x08: return input_port_read(device->machine, "PL2_4") | coin_port; + case 0x10: return input_port_read(device->machine, "PL2_5") | coin_port; + case 0x20: return input_port_read(device->machine, "PL2_6") | coin_port; } // printf("%04x\n",mux_data); - return (input_port_read(space->machine, "PL2_1") & input_port_read(space->machine, "PL2_2") & input_port_read(space->machine, "PL2_3") & - input_port_read(space->machine, "PL2_4") & input_port_read(space->machine, "PL2_5") & input_port_read(space->machine, "PL2_6")) | coin_port;//input_port_read(space->machine, "PL1_0") && ; + return (input_port_read(device->machine, "PL2_1") & input_port_read(device->machine, "PL2_2") & input_port_read(device->machine, "PL2_3") & + input_port_read(device->machine, "PL2_4") & input_port_read(device->machine, "PL2_5") & input_port_read(device->machine, "PL2_6")) | coin_port;//input_port_read(device->machine, "PL1_0") && ; } @@ -376,9 +376,8 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( nightgal_io, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x01,0x01) AM_READ(ay8910_read_port_0_r) //ay read port - AM_RANGE(0x02,0x02) AM_WRITE(ay8910_write_port_0_w) - AM_RANGE(0x03,0x03) AM_WRITE(ay8910_control_port_0_w) + AM_RANGE(0x01,0x01) AM_DEVREAD(SOUND, "ay", ay8910_r) //ay read port + AM_RANGE(0x02,0x03) AM_DEVWRITE(SOUND, "ay", ay8910_data_address_w) // AM_RANGE(0x10,0x10) AM_WRITE(output_w) AM_RANGE(0x10,0x10) AM_READ_PORT("DSWC") AM_RANGE(0x11,0x11) AM_READ_PORT("SYSA") @@ -417,8 +416,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( sexygal_io, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x00,0x00) AM_READWRITE(ym2203_status_port_0_r, ym2203_control_port_0_w) - AM_RANGE(0x01,0x01) AM_READWRITE(ym2203_read_port_0_r, ym2203_write_port_0_w) + AM_RANGE(0x00,0x01) AM_DEVREADWRITE(SOUND, "ym", ym2203_r, ym2203_w) // AM_RANGE(0x10,0x10) AM_WRITE(output_w) AM_RANGE(0x10,0x10) AM_READ_PORT("DSWC") AM_RANGE(0x11,0x11) AM_READ_PORT("SYSA") @@ -672,10 +670,10 @@ static const ay8910_interface ay8910_config = { AY8910_LEGACY_OUTPUT, AY8910_DEFAULT_LOADS, - input_1p_r, - input_2p_r, - NULL, - NULL + DEVCB_HANDLER(input_1p_r), + DEVCB_HANDLER(input_2p_r), + DEVCB_NULL, + DEVCB_NULL }; static MACHINE_DRIVER_START( nightgal ) |