diff options
Diffstat (limited to 'src/mame/drivers/tecmo.c')
-rw-r--r-- | src/mame/drivers/tecmo.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/src/mame/drivers/tecmo.c b/src/mame/drivers/tecmo.c index 448957d0135..98c1520f4cb 100644 --- a/src/mame/drivers/tecmo.c +++ b/src/mame/drivers/tecmo.c @@ -84,27 +84,27 @@ static WRITE8_HANDLER( tecmo_sound_command_w ) cpu_set_input_line(space->machine->cpu[1],INPUT_LINE_NMI,PULSE_LINE); } -static WRITE8_HANDLER( tecmo_adpcm_start_w ) +static WRITE8_DEVICE_HANDLER( tecmo_adpcm_start_w ) { adpcm_pos = data << 8; - msm5205_reset_w(0,0); + msm5205_reset_w(device,0); } static WRITE8_HANDLER( tecmo_adpcm_end_w ) { adpcm_end = (data + 1) << 8; } -static WRITE8_HANDLER( tecmo_adpcm_vol_w ) +static WRITE8_DEVICE_HANDLER( tecmo_adpcm_vol_w ) { - msm5205_set_volume(0,(data & 0x0f) * 100 / 15); + msm5205_set_volume(device,(data & 0x0f) * 100 / 15); } static void tecmo_adpcm_int(const device_config *device) { if (adpcm_pos >= adpcm_end || adpcm_pos >= memory_region_length(device->machine, "adpcm")) - msm5205_reset_w(0,1); + msm5205_reset_w(device,1); else if (adpcm_data != -1) { - msm5205_data_w(0,adpcm_data & 0x0f); + msm5205_data_w(device,adpcm_data & 0x0f); adpcm_data = -1; } else @@ -112,7 +112,7 @@ static void tecmo_adpcm_int(const device_config *device) UINT8 *ROM = memory_region(device->machine, "adpcm"); adpcm_data = ROM[adpcm_pos++]; - msm5205_data_w(0,adpcm_data >> 4); + msm5205_data_w(device,adpcm_data >> 4); } } @@ -196,11 +196,10 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( rygar_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM) AM_RANGE(0x4000, 0x47ff) AM_WRITE(SMH_RAM) - AM_RANGE(0x8000, 0x8000) AM_WRITE(ym3812_control_port_0_w) - AM_RANGE(0x8001, 0x8001) AM_WRITE(ym3812_write_port_0_w) - AM_RANGE(0xc000, 0xc000) AM_WRITE(tecmo_adpcm_start_w) + AM_RANGE(0x8000, 0x8001) AM_DEVWRITE(SOUND, "ym", ym3812_w) + AM_RANGE(0xc000, 0xc000) AM_DEVWRITE(SOUND, "msm", tecmo_adpcm_start_w) AM_RANGE(0xd000, 0xd000) AM_WRITE(tecmo_adpcm_end_w) - AM_RANGE(0xe000, 0xe000) AM_WRITE(tecmo_adpcm_vol_w) + AM_RANGE(0xe000, 0xe000) AM_DEVWRITE(SOUND, "msm", tecmo_adpcm_vol_w) AM_RANGE(0xf000, 0xf000) AM_WRITE(SMH_NOP) /* NMI acknowledge */ ADDRESS_MAP_END @@ -215,11 +214,10 @@ static ADDRESS_MAP_START( tecmo_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 ) /* writes code to this area */ AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM) AM_RANGE(0x8000, 0x87ff) AM_WRITE(SMH_RAM) - AM_RANGE(0xa000, 0xa000) AM_WRITE(ym3812_control_port_0_w) - AM_RANGE(0xa001, 0xa001) AM_WRITE(ym3812_write_port_0_w) - AM_RANGE(0xc000, 0xc000) AM_WRITE(tecmo_adpcm_start_w) + AM_RANGE(0xa000, 0xa001) AM_DEVWRITE(SOUND, "ym", ym3812_w) + AM_RANGE(0xc000, 0xc000) AM_DEVWRITE(SOUND, "msm", tecmo_adpcm_start_w) AM_RANGE(0xc400, 0xc400) AM_WRITE(tecmo_adpcm_end_w) - AM_RANGE(0xc800, 0xc800) AM_WRITE(tecmo_adpcm_vol_w) + AM_RANGE(0xc800, 0xc800) AM_DEVWRITE(SOUND, "msm", tecmo_adpcm_vol_w) AM_RANGE(0xcc00, 0xcc00) AM_WRITE(SMH_NOP) /* NMI acknowledge */ ADDRESS_MAP_END @@ -542,12 +540,12 @@ GFXDECODE_END -static void irqhandler(running_machine *machine, int linestate) +static void irqhandler(const device_config *device, int linestate) { - cpu_set_input_line(machine->cpu[1],0,linestate); + cpu_set_input_line(device->machine->cpu[1],0,linestate); } -static const ym3526_interface ym3526_config = +static const ym3812_interface ym3812_config = { irqhandler }; @@ -596,7 +594,7 @@ static MACHINE_DRIVER_START( rygar ) MDRV_SPEAKER_STANDARD_MONO("mono") MDRV_SOUND_ADD("ym", YM3812, XTAL_4MHz) /* verified on pcb */ - MDRV_SOUND_CONFIG(ym3526_config) + MDRV_SOUND_CONFIG(ym3812_config) MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MDRV_SOUND_ADD("msm", MSM5205, XTAL_400kHz) /* verified on pcb, even if schematics shows a 384khz resonator */ |