From dad9d8782b31552a7a6124f4f4dc6a60d82942be Mon Sep 17 00:00:00 2001 From: Derrick Renaud Date: Mon, 12 Oct 2009 17:45:59 +0000 Subject: [PATCH] Draw Poker Hi-Lo - added discrete sound --- src/mame/audio/norautp.c | 84 +++++++++++++++++++++++-------------- src/mame/drivers/norautp.c | 2 +- src/mame/includes/norautp.h | 1 + 3 files changed, 55 insertions(+), 32 deletions(-) diff --git a/src/mame/audio/norautp.c b/src/mame/audio/norautp.c index c417d657393..ee0ab21a641 100644 --- a/src/mame/audio/norautp.c +++ b/src/mame/audio/norautp.c @@ -10,6 +10,44 @@ /* Discrete Sound Input Nodes */ /* defined in norautp.h */ + +static const discrete_555_desc desc_norautp_555 = +{ + DISC_555_OUT_ENERGY | DISC_555_OUT_AC, + 5, // B+ voltage of 555 + DEFAULT_555_VALUES +}; + + +#define NORAUTP_SOUND_CIRCUIT(_name, _r1, _r2, _c1, _c2, _c3, _c4) \ +static const discrete_comp_adder_table desc_##_name##_caps = \ +{ \ + DISC_COMP_P_CAPACITOR, _c4, 3, \ + { \ + _c3, _c2, _c1 \ + } \ +}; \ + \ +DISCRETE_SOUND_START( _name ) \ + /************************************************ \ + * Input register mapping \ + ************************************************/ \ + DISCRETE_INPUT_LOGIC(NORAUTP_SND_EN) \ + DISCRETE_INPUT_DATA (NORAUTP_FREQ_DATA) \ + \ + /************************************************ \ + * Tone Generator \ + ************************************************/ \ + DISCRETE_COMP_ADDER(NODE_20, NORAUTP_FREQ_DATA, &desc_##_name##_caps) \ + DISCRETE_555_ASTABLE(NODE_21, \ + NORAUTP_SND_EN, /* RESET */ \ + _r2, _r1, NODE_20, &desc_norautp_555) \ + \ + DISCRETE_OUTPUT(NODE_21, 65000.0/3.8) \ +DISCRETE_SOUND_END + + +/* Noraut Poker */ /* Parts List - Resistors */ #define NORAUTP_R1 RES_K(120) #define NORAUTP_R2 RES_K(2.2) @@ -20,38 +58,22 @@ #define NORAUTP_C3 CAP_U(.047) #define NORAUTP_C4 CAP_U(.01) - -static const discrete_555_desc desc_norautp_555 = -{ - DISC_555_OUT_ENERGY | DISC_555_OUT_AC, - 5, // B+ voltage of 555 - DEFAULT_555_VALUES -}; - -static const discrete_comp_adder_table desc_norautp_caps = -{ - DISC_COMP_P_CAPACITOR, NORAUTP_C4, 3, - { - NORAUTP_C3, NORAUTP_C2, NORAUTP_C1 - } -}; +NORAUTP_SOUND_CIRCUIT(norautp, + NORAUTP_R1, NORAUTP_R2, + NORAUTP_C1, NORAUTP_C2, NORAUTP_C3, NORAUTP_C4) -DISCRETE_SOUND_START( norautp ) - /************************************************ - * Input register mapping - ************************************************/ - DISCRETE_INPUT_LOGIC(NORAUTP_SND_EN) - DISCRETE_INPUT_DATA (NORAUTP_FREQ_DATA) +/* Noraut old Draw Poker Hi-Lo */ +/* Parts List - Resistors */ +#define DPHL_R1 RES_K(120) +#define DPHL_R2 RES_K(1) - /************************************************ - * Tone Generator - ************************************************/ - DISCRETE_COMP_ADDER(NODE_20, NORAUTP_FREQ_DATA, &desc_norautp_caps) - DISCRETE_555_ASTABLE(NODE_21, - NORAUTP_SND_EN, /* RESET */ - NORAUTP_R2, NORAUTP_R1, NODE_20, &desc_norautp_555) +/* Parts List - Capacitors */ +#define DPHL_C1 CAP_U(.01) +#define DPHL_C2 CAP_U(.022) +#define DPHL_C3 CAP_U(.05) +#define DPHL_C4 CAP_U(.01) - DISCRETE_OUTPUT(NODE_21, 65000.0/3.8) - -DISCRETE_SOUND_END +NORAUTP_SOUND_CIRCUIT(dphl, + DPHL_R1, DPHL_R2, + DPHL_C1, DPHL_C2, DPHL_C3, DPHL_C4) diff --git a/src/mame/drivers/norautp.c b/src/mame/drivers/norautp.c index f4c6f38ab75..d9cb33db761 100644 --- a/src/mame/drivers/norautp.c +++ b/src/mame/drivers/norautp.c @@ -1578,7 +1578,7 @@ static MACHINE_DRIVER_START( dphl ) /* sound hardware */ MDRV_SPEAKER_STANDARD_MONO("mono") MDRV_SOUND_ADD("discrete", DISCRETE, 0) - MDRV_SOUND_CONFIG_DISCRETE(norautp) + MDRV_SOUND_CONFIG_DISCRETE(dphl) MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MACHINE_DRIVER_END diff --git a/src/mame/includes/norautp.h b/src/mame/includes/norautp.h index 748dbedb808..39b1ee8616e 100644 --- a/src/mame/includes/norautp.h +++ b/src/mame/includes/norautp.h @@ -9,3 +9,4 @@ /*----------- defined in audio/norautp.c -----------*/ DISCRETE_SOUND_EXTERN( norautp ); +DISCRETE_SOUND_EXTERN( dphl );