1
/*****************************************************************************
3
Texas Instruments SN76477 emulator
5
SN76477 pin layout. There is a corresponding interface variable with the
6
same name. The only exception is noise_clock which must be programmatically
7
set. The other pins have programmatic equivalents as well.
8
The name of the function is SN76477_<pinname>_w.
9
All capacitor functions can also specify a fixed voltage on the cap.
10
The name of this function is SN76477_<pinname>_voltage_w
13
envelope_1 | 1 | | 28| envelope_2
15
noise_clock | 3 26| mixer_a
16
noise_clock_res | 4 25| mixer_b
17
noise_filter_res | 5 24| one_shot_res
18
noise_filter_cap | 6 23| one_shot_cap
20
attack_decay_cap | 8 21| slf_cap
21
enable o| 9 20| slf_res
22
attack_res |10 19| pitch_voltage
23
amplitude_res |11 18| vco_res
24
feedback_res |12 17| vco_cap
25
|13 OUTPUT 16| vco_voltage
29
All resistor values in Ohms
30
All capacitor values in Farads
31
Use RES_K, RES_M and CAP_U, CAP_N, CAP_P macros in rescap.h to convert
32
magnitudes, eg. 220k = RES_K(220), 47nF = CAP_N(47)
34
*****************************************************************************/
42
#include "machine/rescap.h"
46
/*****************************************************************************
48
* Interface definition
50
*****************************************************************************/
52
typedef struct _sn76477_interface sn76477_interface;
53
struct _sn76477_interface
55
double noise_clock_res;
56
double noise_filter_res;
57
double noise_filter_cap;
59
double attack_decay_cap;
82
/*****************************************************************************
84
* Functions to set a pin's value
86
*****************************************************************************/
88
/* these functions take 0 or 1 as a logic input */
89
void sn76477_enable_w(device_t *device, UINT32 data); /* active LO, 0 = enabled, 1 = disabled */
90
void sn76477_mixer_a_w(device_t *device, UINT32 data);
91
void sn76477_mixer_b_w(device_t *device, UINT32 data);
92
void sn76477_mixer_c_w(device_t *device, UINT32 data);
93
void sn76477_envelope_1_w(device_t *device, UINT32 data);
94
void sn76477_envelope_2_w(device_t *device, UINT32 data);
95
void sn76477_vco_w(device_t *device, UINT32 data); /* 0 = external, 1 = controlled by SLF */
96
void sn76477_noise_clock_w(device_t *device, UINT32 data); /* noise clock write, if noise_clock_res = 0 */
98
/* these functions take a resistor value in Ohms */
99
void sn76477_one_shot_res_w(device_t *device, double data);
100
void sn76477_slf_res_w(device_t *device, double data);
101
void sn76477_vco_res_w(device_t *device, double data);
102
void sn76477_noise_clock_res_w(device_t *device, double data); /* = 0 if the noise gen is clocked via noise_clock */
103
void sn76477_noise_filter_res_w(device_t *device, double data);
104
void sn76477_decay_res_w(device_t *device, double data);
105
void sn76477_attack_res_w(device_t *device, double data);
106
void sn76477_amplitude_res_w(device_t *device, double data);
107
void sn76477_feedback_res_w(device_t *device, double data);
109
/* these functions take a capacitor value in Farads or the voltage on it in Volts */
110
#define SN76477_EXTERNAL_VOLTAGE_DISCONNECT (-1.0) /* indicates that the voltage is internally computed,
111
can be used in all the functions that take a
112
voltage on a capacitor */
113
void sn76477_one_shot_cap_w(device_t *device, double data);
114
void sn76477_one_shot_cap_voltage_w(device_t *device, double data);
115
void sn76477_slf_cap_w(device_t *device, double data);
116
void sn76477_slf_cap_voltage_w(device_t *device, double data);
117
void sn76477_vco_cap_w(device_t *device, double data);
118
void sn76477_vco_cap_voltage_w(device_t *device, double data);
119
void sn76477_noise_filter_cap_w(device_t *device, double data);
120
void sn76477_noise_filter_cap_voltage_w(device_t *device, double data);
121
void sn76477_attack_decay_cap_w(device_t *device, double data);
122
void sn76477_attack_decay_cap_voltage_w(device_t *device, double data);
124
/* these functions take a voltage value in Volts */
125
void sn76477_vco_voltage_w(device_t *device, double data);
126
void sn76477_pitch_voltage_w(device_t *device, double data);
128
DECLARE_LEGACY_SOUND_DEVICE(SN76477, sn76477);
130
#endif/* __SN76477_H__ */