diff --git a/src/emu/sound/discrete.h b/src/emu/sound/discrete.h index dc6d1e0f4d4..475a8dedddb 100644 --- a/src/emu/sound/discrete.h +++ b/src/emu/sound/discrete.h @@ -3781,6 +3781,8 @@ enum { #error "DISCRETE_MAX_NODE_OUTPUTS != 8" #endif +#define NODE_RELATIVE(_x, _y) (NODE(NODE_INDEX(_x) + (_y))) + #define NODE_NC NODE_00 #define NODE_SPECIAL NODE(DISCRETE_MAX_NODES) diff --git a/src/mame/audio/asteroid.c b/src/mame/audio/asteroid.c index 9192c527777..15701cb15b9 100644 --- a/src/mame/audio/asteroid.c +++ b/src/mame/audio/asteroid.c @@ -308,7 +308,7 @@ WRITE8_HANDLER( asteroid_thump_w ) WRITE8_HANDLER( asteroid_sounds_w ) { - discrete_sound_w(machine, ASTEROID_SAUCER_SND_EN + offset, data & 0x80); + discrete_sound_w(machine, NODE_RELATIVE(ASTEROID_SAUCER_SND_EN, offset), data & 0x80); } WRITE8_HANDLER( astdelux_sounds_w ) diff --git a/src/mame/audio/canyon.c b/src/mame/audio/canyon.c index 14087be0d32..1dbb4f4cfb8 100644 --- a/src/mame/audio/canyon.c +++ b/src/mame/audio/canyon.c @@ -16,7 +16,7 @@ WRITE8_HANDLER( canyon_motor_w ) { - discrete_sound_w(machine, CANYON_MOTOR1_DATA + (offset & 0x01), data & 0x0f); + discrete_sound_w(machine, NODE_RELATIVE(CANYON_MOTOR1_DATA, (offset & 0x01)), data & 0x0f); } @@ -28,13 +28,13 @@ WRITE8_HANDLER( canyon_explode_w ) WRITE8_HANDLER( canyon_attract_w ) { - discrete_sound_w(machine, CANYON_ATTRACT1_EN + (offset & 0x01), offset & 0x02); + discrete_sound_w(machine, NODE_RELATIVE(CANYON_ATTRACT1_EN, (offset & 0x01)), offset & 0x02); } WRITE8_HANDLER( canyon_whistle_w ) { - discrete_sound_w(machine, CANYON_WHISTLE1_EN + (offset & 0x01), offset & 0x02); + discrete_sound_w(machine, NODE_RELATIVE(CANYON_WHISTLE1_EN, (offset & 0x01)), offset & 0x02); } diff --git a/src/mame/drivers/skydiver.c b/src/mame/drivers/skydiver.c index 60116e24e90..3d78a164e7d 100644 --- a/src/mame/drivers/skydiver.c +++ b/src/mame/drivers/skydiver.c @@ -170,7 +170,7 @@ static WRITE8_HANDLER( skydiver_sound_enable_w ) static WRITE8_HANDLER( skydiver_whistle_w ) { - discrete_sound_w(machine, SKYDIVER_WHISTLE1_EN + (offset >> 1), offset & 0x01); + discrete_sound_w(machine, NODE_RELATIVE(SKYDIVER_WHISTLE1_EN, (offset >> 1)), offset & 0x01); } diff --git a/src/mame/drivers/tank8.c b/src/mame/drivers/tank8.c index ba69ffe971a..498a4679f62 100644 --- a/src/mame/drivers/tank8.c +++ b/src/mame/drivers/tank8.c @@ -90,7 +90,7 @@ static WRITE8_HANDLER( tank8_attract_w ) static WRITE8_HANDLER( tank8_motor_w ) { - discrete_sound_w(machine, TANK8_MOTOR1_EN+offset, data); + discrete_sound_w(machine, NODE_RELATIVE(TANK8_MOTOR1_EN, offset), data); } static ADDRESS_MAP_START( tank8_cpu_map, ADDRESS_SPACE_PROGRAM, 8 )