1 /***************************************************************************** 2 SN76477 pins and assigned interface variables/functions 3 4 SN76477_envelope_w() 5 / \ 6 [ 1] ENV SEL 1 ENV SEL 2 [28] 7 [ 2] GND MIXER C [27] \ 8 SN76477_noise_w() [ 3] NOISE EXT OSC MIXER A [26] > SN76477_mixer_w() 9 noise_res [ 4] RES NOISE OSC MIXER B [25] / 10 filter_res [ 5] NOISE FILTER RES O/S RES [24] oneshot_res 11 filter_cap [ 6] NOISE FILTER CAP O/S CAP [23] oneshot_cap 12 decay_res [ 7] DECAY RES VCO SEL [22] SN76477_vco_w() 13 attack_decay_cap [ 8] A/D CAP SLF CAP [21] slf_cap 14 SN76477_enable_w() [ 9] ENABLE SLF RES [20] slf_res 15 attack_res [10] ATTACK RES PITCH [19] pitch_voltage 16 amplitude_res [11] AMP VCO RES [18] vco_res 17 feedback_res [12] FEEDBACK VCO CAP [17] vco_cap 18 [13] OUTPUT VCO EXT CONT [16] vco_voltage 19 [14] Vcc +5V REG OUT [15] 20 21 All resistor values in Ohms. 22 All capacitor values in Farads. 23 Use RES_K, RES_M and CAP_U, CAP_N, CAP_P macros to convert 24 magnitudes, eg. 220k = RES_K(220), 47nF = CAP_N(47) 25 26 *****************************************************************************/ 27 28 #define MAX_SN76477 4 29 30 #include "rescap.h" 31 32 /* Noise clock write, useful only if noise_res is zero */ 33 void SN76477_noise_clock_w(INT32 chip, INT32 data); 34 35 /* Enable (one input line: 0 enabled, 1 inhibited) - resets one shot */ 36 void SN76477_enable_w(INT32 chip, INT32 data); 37 38 /* Mixer select (three input lines, data 0 to 7) */ 39 void SN76477_mixer_w(INT32 chip, INT32 data); 40 void SN76477_set_mixer_params(INT32 chip, INT32 a, INT32 b, INT32 c); 41 42 /* Alternatively write the single input lines */ 43 void SN76477_mixer_a_w(INT32 chip, INT32 data); 44 void SN76477_mixer_b_w(INT32 chip, INT32 data); 45 void SN76477_mixer_c_w(INT32 chip, INT32 data); 46 47 /* Select envelope (two input lines, data 0 to 3) */ 48 void SN76477_envelope_w(INT32 chip, INT32 data); 49 void SN76477_set_envelope_params(INT32 chip, INT32 one, INT32 two); // both! 50 51 /* Alternatively use the single input lines */ 52 void SN76477_envelope_1_w(INT32 chip, INT32 data); 53 void SN76477_envelope_2_w(INT32 chip, INT32 data); 54 55 /* VCO select (one input line: 0 external control, 1: SLF control) */ 56 void SN76477_vco_w(INT32 chip, INT32 data); 57 void SN76477_set_vco_mode(INT32 chip, INT32 data); 58 59 void SN76477_set_noise_params(INT32 chip, double res, double filtres, double cap); 60 void SN76477_set_noise_res(INT32 chip, double res); 61 void SN76477_set_filter_res(INT32 chip, double res); 62 void SN76477_set_filter_cap(INT32 chip, double cap); 63 void SN76477_set_decay_res(INT32 chip, double res); 64 void SN76477_set_attack_params(INT32 chip, double cap, double res); 65 void SN76477_set_attack_decay_cap(INT32 chip, double cap); 66 void SN76477_set_attack_res(INT32 chip, double res); 67 void SN76477_set_amplitude_res(INT32 chip, double res); 68 void SN76477_set_feedback_res(INT32 chip, double res); 69 void SN76477_set_slf_params(INT32 chip, double cap, double res); 70 void SN76477_set_slf_res(INT32 chip, double res); 71 void SN76477_set_slf_cap(INT32 chip, double cap); 72 void SN76477_set_oneshot_params(INT32 chip, double cap, double res); 73 void SN76477_set_oneshot_res(INT32 chip, double res); 74 void SN76477_set_oneshot_cap(INT32 chip, double cap); 75 void SN76477_set_vco_params(INT32 chip, double voltage, double cap, double res); 76 void SN76477_set_vco_res(INT32 chip, double res); 77 void SN76477_set_vco_cap(INT32 chip, double cap); 78 void SN76477_set_pitch_voltage(INT32 chip, double voltage); 79 void SN76477_set_vco_voltage(INT32 chip, double voltage); 80 void SN76477_set_mastervol(INT32 chip, double vol); 81 void SN76477_sound_update(INT32 param, INT16 *buffer, INT32 length); 82 void SN76477_set_enable(INT32 chip, INT32 enable); 83 84 void SN76477_init(INT32 num); 85 void SN76477_reset(INT32 num); 86 void SN76477_exit(INT32 num); 87