Fix for Mantis 01699: asteroid, asteroi1, asteroib, asterock, meteor, meteorts: Abnormal discrete sounds

* added NODE_RELATIVE(NODE, offset) macro to discrete.h
* fix asteroid.c, canyon.c, skydiver.c and tank8.c to use this macro instead of adding directly to the node
This commit is contained in:
Couriersud 2008-05-29 21:11:10 +00:00
parent 6736fbc2a5
commit c1a1cab523
5 changed files with 8 additions and 6 deletions

View File

@ -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)

View File

@ -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 )

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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 )