Previous 199869 Revisions Next

r21255 Thursday 21st February, 2013 at 05:30:51 UTC by Andrew Gardner
Modernized polepos, redbaron, cps3, tiamc1, and gridlee sound devices. [Andrew
Gardner]

Out of whatsnew.txt:
There are now exactly 100 files that include devlegcy.h.  Getting closer...
[src/emu/sound]filter.h
[src/mame/audio]cps3.c gridlee.c polepos.c redbaron.c tiamc1.c
[src/mame/drivers]bzone.c cps3.c gridlee.c polepos.c tiamc1.c
[src/mame/includes]bzone.h cps3.h gridlee.h polepos.h tiamc1.h

trunk/src/emu/sound/filter.h
r21254r21255
6565
6666struct filter2_context
6767{
68    filter2_context() :
69      x0(0.0),
70      x1(0.0),
71      x2(0.0),
72      y0(0.0),
73      y1(0.0),
74      y2(0.0),
75      a1(0.0),
76      a2(0.0),
77      b0(0.0),
78      b1(0.0),
79      b2(0.0)
80    {}
81   
6882   double x0, x1, x2;  /* x[k], x[k-1], x[k-2], current and previous 2 input values */
6983   double y0, y1, y2;  /* y[k], y[k-1], y[k-2], current and previous 2 output values */
7084   double a1, a2;      /* digital filter coefficients, denominator */
trunk/src/mame/drivers/polepos.c
r21254r21255
303303         polepos_sound_enable(machine().device("namco"),bit);
304304         if (!bit)
305305         {
306            polepos_engine_sound_lsb_w(machine().device("polepos"), space, 0, 0);
307            polepos_engine_sound_msb_w(machine().device("polepos"), space, 0, 0);
306            machine().device<polepos_sound_device>("polepos")->polepos_engine_sound_lsb_w(space, 0, 0);
307            machine().device<polepos_sound_device>("polepos")->polepos_engine_sound_msb_w(space, 0, 0);
308308         }
309309         break;
310310
r21254r21255
496496   AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x0cff) AM_READ(polepos_ready_r)                 /* READY */
497497   AM_RANGE(0xa000, 0xa007) AM_MIRROR(0x0cf8) AM_WRITE(polepos_latch_w)                /* misc latches */
498498   AM_RANGE(0xa100, 0xa100) AM_MIRROR(0x0cff) AM_WRITE(watchdog_reset_w)               /* Watchdog */
499   AM_RANGE(0xa200, 0xa200) AM_MIRROR(0x0cff) AM_DEVWRITE_LEGACY("polepos", polepos_engine_sound_lsb_w)    /* Car Sound ( Lower Nibble ) */
500   AM_RANGE(0xa300, 0xa300) AM_MIRROR(0x0cff) AM_DEVWRITE_LEGACY("polepos", polepos_engine_sound_msb_w)    /* Car Sound ( Upper Nibble ) */
499   AM_RANGE(0xa200, 0xa200) AM_MIRROR(0x0cff) AM_DEVWRITE("polepos", polepos_sound_device, polepos_engine_sound_lsb_w)    /* Car Sound ( Lower Nibble ) */
500   AM_RANGE(0xa300, 0xa300) AM_MIRROR(0x0cff) AM_DEVWRITE("polepos", polepos_sound_device, polepos_engine_sound_msb_w)    /* Car Sound ( Upper Nibble ) */
501501ADDRESS_MAP_END
502502
503503static ADDRESS_MAP_START( z80_io, AS_IO, 8, polepos_state )
trunk/src/mame/drivers/bzone.c
r21254r21255
283283
284284WRITE8_MEMBER(bzone_state::redbaron_joysound_w)
285285{
286   device_t *device = machine().device("custom");
286   redbaron_sound_device *device = machine().device<redbaron_sound_device>("custom");
287287   m_rb_input_select = data & 1;
288   redbaron_sounds_w(device, space, offset, data);
288   device->redbaron_sounds_w(space, offset, data);
289289}
290290
291291
trunk/src/mame/drivers/tiamc1.c
r21254r21255
148148   AM_RANGE(0xbd, 0xbd) AM_WRITE(tiamc1_bg_vshift_w)/* background V scroll */
149149   AM_RANGE(0xbe, 0xbe) AM_WRITE(tiamc1_bankswitch_w) /* VRAM selector */
150150   AM_RANGE(0xbf, 0xbf) AM_WRITENOP                 /* charset control */
151   AM_RANGE(0xc0, 0xc3) AM_DEVWRITE_LEGACY("2x8253", tiamc1_timer0_w)   /* timer 0 */
151   AM_RANGE(0xc0, 0xc3) AM_DEVWRITE("2x8253", tiamc1_sound_device, tiamc1_timer0_w)   /* timer 0 */
152152   AM_RANGE(0xd0, 0xd0) AM_READ_PORT("IN0")
153153   AM_RANGE(0xd1, 0xd1) AM_READ_PORT("IN1")
154154   AM_RANGE(0xd2, 0xd2) AM_READ_PORT("IN2")
155155   AM_RANGE(0xd2, 0xd2) AM_WRITE(tiamc1_control_w)  /* coin counter and lockout */
156156   AM_RANGE(0xd3, 0xd3) AM_WRITENOP                 /* 8255 ctrl. Used for i/o ports */
157   AM_RANGE(0xd4, 0xd7) AM_DEVWRITE_LEGACY("2x8253", tiamc1_timer1_w)   /* timer 1 */
158   AM_RANGE(0xda, 0xda) AM_DEVWRITE_LEGACY("2x8253", tiamc1_timer1_gate_w) /* timer 1 gate control */
157   AM_RANGE(0xd4, 0xd7) AM_DEVWRITE("2x8253", tiamc1_sound_device, tiamc1_timer1_w)   /* timer 1 */
158   AM_RANGE(0xda, 0xda) AM_DEVWRITE("2x8253", tiamc1_sound_device, tiamc1_timer1_gate_w) /* timer 1 gate control */
159159ADDRESS_MAP_END
160160
161161static INPUT_PORTS_START( tiamc1 )
trunk/src/mame/drivers/cps3.c
r21254r21255
21272127   AM_RANGE(0x040C0084, 0x040C0087) AM_WRITE(cram_bank_w)
21282128   AM_RANGE(0x040C0088, 0x040C008b) AM_WRITE(cram_gfxflash_bank_w)
21292129
2130   AM_RANGE(0x040e0000, 0x040e02ff) AM_DEVREADWRITE_LEGACY("cps3", cps3_sound_r, cps3_sound_w)
2130   AM_RANGE(0x040e0000, 0x040e02ff) AM_DEVREADWRITE("cps3", cps3_sound_device, cps3_sound_r, cps3_sound_w)
21312131
21322132   AM_RANGE(0x04100000, 0x041fffff) AM_READWRITE(cram_data_r, cram_data_w)
21332133   AM_RANGE(0x04200000, 0x043fffff) AM_READWRITE(cps3_gfxflash_r, cps3_gfxflash_w) // GFX Flash ROMS
trunk/src/mame/drivers/gridlee.c
r21254r21255
311311   AM_RANGE(0x9600, 0x9600) AM_READ_PORT("DSW")
312312   AM_RANGE(0x9700, 0x9700) AM_READ_PORT("IN2") AM_WRITENOP
313313   AM_RANGE(0x9820, 0x9820) AM_READ(random_num_r)
314   AM_RANGE(0x9828, 0x993f) AM_DEVWRITE_LEGACY("gridlee", gridlee_sound_w)
314   AM_RANGE(0x9828, 0x993f) AM_DEVWRITE("gridlee", gridlee_sound_device, gridlee_sound_w)
315315   AM_RANGE(0x9c00, 0x9cff) AM_RAM AM_SHARE("nvram")
316316   AM_RANGE(0xa000, 0xffff) AM_ROM
317317ADDRESS_MAP_END
trunk/src/mame/audio/polepos.c
r21254r21255
33    Sound handler
44****************************************************************************/
55#include "emu.h"
6#include "sound/filter.h"
76#include "machine/rescap.h"
87#include "namco52.h"
98#include "namco54.h"
r21254r21255
1413#define POLEPOS_R166        1000.0
1514#define POLEPOS_R167        2200.0
1615#define POLEPOS_R168        4700.0
16
1717/* resistor values when shorted by 4066 running at 5V */
1818#define POLEPOS_R166_SHUNT  1.0/(1.0/POLEPOS_R166 + 1.0/250)
1919#define POLEPOS_R167_SHUNT  1.0/(1.0/POLEPOS_R166 + 1.0/250)
2020#define POLEPOS_R168_SHUNT  1.0/(1.0/POLEPOS_R166 + 1.0/250)
2121
22struct polepos_sound_state
23{
24   UINT32 m_current_position;
25   int m_sample_msb;
26   int m_sample_lsb;
27   int m_sample_enable;
28   sound_stream *m_stream;
29   filter2_context m_filter_engine[3];
30};
31
32
3322static const double volume_table[8] =
3423{
3524   (POLEPOS_R168_SHUNT + POLEPOS_R167_SHUNT + POLEPOS_R166_SHUNT + 2200) / 10000,
r21254r21255
4534static const double r_filt_out[3] = {RES_K(4.7), RES_K(7.5), RES_K(10)};
4635static const double r_filt_total = 1.0 / (1.0/RES_K(4.7) + 1.0/RES_K(7.5) + 1.0/RES_K(10));
4736
48INLINE polepos_sound_state *get_safe_token( device_t *device )
37
38
39
40// device type definition
41const device_type POLEPOS = &device_creator<polepos_sound_device>;
42
43
44//**************************************************************************
45//  LIVE DEVICE
46//**************************************************************************
47
48//-------------------------------------------------
49//  polepos_sound_device - constructor
50//-------------------------------------------------
51
52polepos_sound_device::polepos_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
53   : device_t(mconfig, POLEPOS, "Pole Position Custom", tag, owner, clock),
54     device_sound_interface(mconfig, *this),
55     m_current_position(0),
56     m_sample_msb(0),
57     m_sample_lsb(0),
58     m_sample_enable(0),
59     m_stream(NULL)
4960{
50   assert(device != NULL);
51   assert(device->type() == POLEPOS);
61}
5262
53   return (polepos_sound_state *)downcast<polepos_sound_device *>(device)->token();
63
64//-------------------------------------------------
65//  device_start - device-specific startup
66//-------------------------------------------------
67
68void polepos_sound_device::device_start()
69{
70   m_stream = stream_alloc(0, 1, OUTPUT_RATE);
71   m_sample_msb = m_sample_lsb = 0;
72   m_sample_enable = 0;
73
74   /* setup the filters */
75   filter_opamp_m_bandpass_setup(this, RES_K(220), RES_K(33), RES_K(390), CAP_U(.01),  CAP_U(.01),
76                           &m_filter_engine[0]);
77   filter_opamp_m_bandpass_setup(this, RES_K(150), RES_K(22), RES_K(330), CAP_U(.0047),  CAP_U(.0047),
78                           &m_filter_engine[1]);
79   /* Filter 3 is a little different.  Because of the input capacitor, it is
80    * a high pass filter. */
81   filter2_setup(this, FILTER_HIGHPASS, 950, Q_TO_DAMP(.707), 1, &m_filter_engine[2]);
5482}
5583
56/************************************/
57/* Stream updater                   */
58/************************************/
59static STREAM_UPDATE( engine_sound_update )
84
85//-------------------------------------------------
86//  device_reset - device-specific reset
87//-------------------------------------------------
88
89void polepos_sound_device::device_reset()
6090{
61   polepos_sound_state *state = get_safe_token(device);
91   int loop;
92   for (loop = 0; loop < 3; loop++)
93      filter2_reset(&m_filter_engine[loop]);
94}
95
96
97//-------------------------------------------------
98//  sound_stream_update - handle a stream update
99//-------------------------------------------------
100
101void polepos_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
102{
62103   UINT32 step, clock, slot;
63104   UINT8 *base;
64105   double volume, i_total;
r21254r21255
66107   int loop;
67108
68109   /* if we're not enabled, just fill with 0 */
69   if (!state->m_sample_enable)
110   if (!m_sample_enable)
70111   {
71112      memset(buffer, 0, samples * sizeof(*buffer));
72113      return;
73114   }
74115
75116   /* determine the effective clock rate */
76   clock = (device->machine().device("maincpu")->unscaled_clock() / 16) * ((state->m_sample_msb + 1) * 64 + state->m_sample_lsb + 1) / (64*64);
117   clock = (machine().device("maincpu")->unscaled_clock() / 16) * ((m_sample_msb + 1) * 64 + m_sample_lsb + 1) / (64*64);
77118   step = (clock << 12) / OUTPUT_RATE;
78119
79120   /* determine the volume */
80   slot = (state->m_sample_msb >> 3) & 7;
121   slot = (m_sample_msb >> 3) & 7;
81122   volume = volume_table[slot];
82   base = &device->machine().root_device().memregion("engine")->base()[slot * 0x800];
123   base = &machine().root_device().memregion("engine")->base()[slot * 0x800];
83124
84125   /* fill in the sample */
85126   while (samples--)
86127   {
87      state->m_filter_engine[0].x0 = (3.4 / 255 * base[(state->m_current_position >> 12) & 0x7ff] - 2) * volume;
88      state->m_filter_engine[1].x0 = state->m_filter_engine[0].x0;
89      state->m_filter_engine[2].x0 = state->m_filter_engine[0].x0;
128      m_filter_engine[0].x0 = (3.4 / 255 * base[(m_current_position >> 12) & 0x7ff] - 2) * volume;
129      m_filter_engine[1].x0 = m_filter_engine[0].x0;
130      m_filter_engine[2].x0 = m_filter_engine[0].x0;
90131
91132      i_total = 0;
92133      for (loop = 0; loop < 3; loop++)
93134      {
94         filter2_step(&state->m_filter_engine[loop]);
135         filter2_step(&m_filter_engine[loop]);
95136         /* The op-amp powered @ 5V will clip to 0V & 3.5V.
96137          * Adjusted to vRef of 2V, we will clip as follows: */
97         if (state->m_filter_engine[loop].y0 > 1.5) state->m_filter_engine[loop].y0 = 1.5;
98         if (state->m_filter_engine[loop].y0 < -2)  state->m_filter_engine[loop].y0 = -2;
138         if (m_filter_engine[loop].y0 > 1.5) m_filter_engine[loop].y0 = 1.5;
139         if (m_filter_engine[loop].y0 < -2)  m_filter_engine[loop].y0 = -2;
99140
100         i_total += state->m_filter_engine[loop].y0 / r_filt_out[loop];
141         i_total += m_filter_engine[loop].y0 / r_filt_out[loop];
101142      }
102143      i_total *= r_filt_total * 32000/2;  /* now contains voltage adjusted by final gain */
103144
104145      *buffer++ = (int)i_total;
105      state->m_current_position += step;
146      m_current_position += step;
106147   }
107148}
108149
109/************************************/
110/* Sound handler start              */
111/************************************/
112static DEVICE_START( polepos_sound )
113{
114   polepos_sound_state *state = get_safe_token(device);
115   state->m_stream = device->machine().sound().stream_alloc(*device, 0, 1, OUTPUT_RATE, NULL, engine_sound_update);
116   state->m_sample_msb = state->m_sample_lsb = 0;
117   state->m_sample_enable = 0;
118150
119   /* setup the filters */
120   filter_opamp_m_bandpass_setup(device, RES_K(220), RES_K(33), RES_K(390), CAP_U(.01),  CAP_U(.01),
121                           &state->m_filter_engine[0]);
122   filter_opamp_m_bandpass_setup(device, RES_K(150), RES_K(22), RES_K(330), CAP_U(.0047),  CAP_U(.0047),
123                           &state->m_filter_engine[1]);
124   /* Filter 3 is a little different.  Because of the input capacitor, it is
125    * a high pass filter. */
126   filter2_setup(device, FILTER_HIGHPASS, 950, Q_TO_DAMP(.707), 1,
127                           &state->m_filter_engine[2]);
128}
129
130151/************************************/
131/* Sound handler reset              */
132/************************************/
133static DEVICE_RESET( polepos_sound )
134{
135   polepos_sound_state *state = get_safe_token(device);
136   int loop;
137   for (loop = 0; loop < 3; loop++)
138      filter2_reset(&state->m_filter_engine[loop]);
139}
140
141/************************************/
142152/* Write LSB of engine sound        */
143153/************************************/
144WRITE8_DEVICE_HANDLER( polepos_engine_sound_lsb_w )
154WRITE8_MEMBER( polepos_sound_device::polepos_engine_sound_lsb_w )
145155{
146   polepos_sound_state *state = get_safe_token(device);
147156   /* Update stream first so all samples at old frequency are updated. */
148   state->m_stream->update();
149   state->m_sample_lsb = data & 62;
150   state->m_sample_enable = data & 1;
157   m_stream->update();
158   m_sample_lsb = data & 62;
159   m_sample_enable = data & 1;
151160}
152161
153162/************************************/
154163/* Write MSB of engine sound        */
155164/************************************/
156WRITE8_DEVICE_HANDLER( polepos_engine_sound_msb_w )
165WRITE8_MEMBER( polepos_sound_device::polepos_engine_sound_msb_w )
157166{
158   polepos_sound_state *state = get_safe_token(device);
159   state->m_stream->update();
160   state->m_sample_msb = data & 63;
167   m_stream->update();
168   m_sample_msb = data & 63;
161169}
162170
163171
r21254r21255
178186#define POLEPOS_54XX_DAC_R (1.0 / (1.0 / RES_K(47) + 1.0 / RES_K(22) + 1.0 / RES_K(10) + 1.0 / RES_K(4.7)))
179187static const discrete_dac_r1_ladder polepos_54xx_dac =
180188{
181   4,              /* number of DAC bits */
182               /* 54XX_0   54XX_1  54XX_2 */
183   { RES_K(47),    /* R124,    R136,   R152 */
184      RES_K(22),  /* R120,    R132,   R142 */
185      RES_K(10),  /* R119,    R131,   R138 */
186      RES_K(4.7)},    /* R118,    R126,   R103 */
187   0, 0, 0, 0      /* nothing extra */
189   4,               /* number of DAC bits */
190                /* 54XX_0   54XX_1  54XX_2 */
191   { RES_K(47),     /* R124,    R136,   R152 */
192      RES_K(22),   /* R120,    R132,   R142 */
193      RES_K(10),   /* R119,    R131,   R138 */
194      RES_K(4.7)}, /* R118,    R126,   R103 */
195   0, 0, 0, 0       /* nothing extra */
188196};
189197
190198#define POLEPOS_52XX_DAC_R (1.0 / (1.0 / RES_K(100) + 1.0 / RES_K(47) + 1.0 / RES_K(22) + 1.0 / RES_K(10)))
r21254r21255
246254   0                   /* vN */
247255};
248256
257
249258DISCRETE_SOUND_START(polepos)
250259
251260   /************************************************
r21254r21255
350359DISCRETE_SOUND_END
351360
352361
353const device_type POLEPOS = &device_creator<polepos_sound_device>;
354
355polepos_sound_device::polepos_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
356   : device_t(mconfig, POLEPOS, "Pole Position Custom", tag, owner, clock),
357      device_sound_interface(mconfig, *this)
358{
359   m_token = global_alloc_clear(polepos_sound_state);
360}
361
362//-------------------------------------------------
363//  device_config_complete - perform any
364//  operations now that the configuration is
365//  complete
366//-------------------------------------------------
367
368void polepos_sound_device::device_config_complete()
369{
370}
371
372//-------------------------------------------------
373//  device_start - device-specific startup
374//-------------------------------------------------
375
376void polepos_sound_device::device_start()
377{
378   DEVICE_START_NAME( polepos_sound )(this);
379}
380
381//-------------------------------------------------
382//  device_reset - device-specific reset
383//-------------------------------------------------
384
385void polepos_sound_device::device_reset()
386{
387   DEVICE_RESET_NAME( polepos_sound )(this);
388}
389
390//-------------------------------------------------
391//  sound_stream_update - handle a stream update
392//-------------------------------------------------
393
394void polepos_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
395{
396   // should never get here
397   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
398}
trunk/src/mame/audio/gridlee.c
r21254r21255
66
77#include "emu.h"
88#include "includes/gridlee.h"
9#include "sound/samples.h"
109
1110
12/*************************************
13 *
14 *  Structures
15 *
16 *************************************/
11// device type definition
12const device_type GRIDLEE = &device_creator<gridlee_sound_device>;
1713
18struct gridlee_sound_state
19{
20   /* tone variables */
21   UINT32 m_tone_step;
22   UINT32 m_tone_fraction;
23   UINT8 m_tone_volume;
2414
25   /* sound streaming variables */
26   sound_stream *m_stream;
27   samples_device *m_samples;
28   double m_freq_to_step;
29   UINT8 m_sound_data[24];
30};
15//**************************************************************************
16//  LIVE DEVICE
17//**************************************************************************
3118
19//-------------------------------------------------
20//  gridlee_sound_device - constructor
21//-------------------------------------------------
3222
33/*************************************
34 *
35 *  Core sound generation
36 *
37 *************************************/
23gridlee_sound_device::gridlee_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
24   : device_t(mconfig, GRIDLEE, "Gridlee Custom", tag, owner, clock),
25     device_sound_interface(mconfig, *this),
26       m_tone_step(0),
27       m_tone_fraction(0),
28       m_tone_volume(0),
29       m_stream(NULL),
30       m_samples(NULL),
31     m_freq_to_step(0.0)
32{
33    memset(m_sound_data, 0, sizeof(UINT8)*24);
34}
3835
39INLINE gridlee_sound_state *get_safe_token( device_t *device )
36
37//-------------------------------------------------
38//  device_start - device-specific startup
39//-------------------------------------------------
40
41void gridlee_sound_device::device_start()
4042{
41   assert(device != NULL);
42   assert(device->type() == GRIDLEE);
43   /* allocate the stream */
44   m_stream = stream_alloc(0, 1, machine().sample_rate());
4345
44   return (gridlee_sound_state *)downcast<gridlee_sound_device *>(device)->token();
46   m_samples = machine().device<samples_device>("samples");
47
48   m_freq_to_step = (double)(1 << 24) / (double)machine().sample_rate();
4549}
4650
47static STREAM_UPDATE( gridlee_stream_update )
51
52//-------------------------------------------------
53//  sound_stream_update - handle a stream update
54//-------------------------------------------------
55
56void gridlee_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
4857{
49   gridlee_sound_state *state = get_safe_token(device);
5058   stream_sample_t *buffer = outputs[0];
5159
5260   /* loop over samples */
5361   while (samples--)
5462   {
5563      /* tone channel */
56      state->m_tone_fraction += state->m_tone_step;
57      *buffer++ = (state->m_tone_fraction & 0x0800000) ? (state->m_tone_volume << 6) : 0;
64      m_tone_fraction += m_tone_step;
65      *buffer++ = (m_tone_fraction & 0x0800000) ? (m_tone_volume << 6) : 0;
5866   }
5967}
6068
6169
6270
63/*************************************
64 *
65 *  Sound startup routines
66 *
67 *************************************/
68
69static DEVICE_START( gridlee_sound )
71WRITE8_MEMBER( gridlee_sound_device::gridlee_sound_w )
7072{
71   gridlee_sound_state *state = get_safe_token(device);
72   running_machine &machine = device->machine();
73   UINT8 *sound_data = m_sound_data;
74   samples_device *samples = m_samples;
7375
74   /* allocate the stream */
75   state->m_stream = device->machine().sound().stream_alloc(*device, 0, 1, machine.sample_rate(), NULL, gridlee_stream_update);
76   m_stream->update();
7677
77   state->m_samples = device->machine().device<samples_device>("samples");
78
79   state->m_freq_to_step = (double)(1 << 24) / (double)machine.sample_rate();
80}
81
82
83WRITE8_DEVICE_HANDLER( gridlee_sound_w )
84{
85   gridlee_sound_state *state = get_safe_token(device);
86   UINT8 *sound_data = state->m_sound_data;
87   samples_device *samples = state->m_samples;
88
89   state->m_stream->update();
90
9178   switch (offset)
9279   {
9380      case 0x04:
r21254r21255
113100
114101      case 0x08+0x08:
115102         if (data)
116            state->m_tone_step = state->m_freq_to_step * (double)(data * 5);
103            m_tone_step = m_freq_to_step * (double)(data * 5);
117104         else
118            state->m_tone_step = 0;
105            m_tone_step = 0;
119106         break;
120107
121108      case 0x09+0x08:
122         state->m_tone_volume = data;
109         m_tone_volume = data;
123110         break;
124111
125112      case 0x0b+0x08:
r21254r21255
177164}
178165#endif
179166}
180
181
182const device_type GRIDLEE = &device_creator<gridlee_sound_device>;
183
184gridlee_sound_device::gridlee_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
185   : device_t(mconfig, GRIDLEE, "Gridlee Custom", tag, owner, clock),
186      device_sound_interface(mconfig, *this)
187{
188   m_token = global_alloc_clear(gridlee_sound_state);
189}
190
191//-------------------------------------------------
192//  device_config_complete - perform any
193//  operations now that the configuration is
194//  complete
195//-------------------------------------------------
196
197void gridlee_sound_device::device_config_complete()
198{
199}
200
201//-------------------------------------------------
202//  device_start - device-specific startup
203//-------------------------------------------------
204
205void gridlee_sound_device::device_start()
206{
207   DEVICE_START_NAME( gridlee_sound )(this);
208}
209
210//-------------------------------------------------
211//  sound_stream_update - handle a stream update
212//-------------------------------------------------
213
214void gridlee_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
215{
216   // should never get here
217   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
218}
trunk/src/mame/audio/tiamc1.c
r21254r21255
3737#define CLOCK_DIVIDER 16
3838#define BUF_LEN 100000
3939
40struct timer8253chan {
41   UINT16 count;
42   UINT16 cnval;
43   UINT8 bcdMode;
44   UINT8 cntMode;
45   UINT8 valMode;
46   UINT8 gate;
47   UINT8 output;
48   UINT8 loadCnt;
49   UINT8 enable;
50};
40#define T8253_CHAN0     0
41#define T8253_CHAN1     1
42#define T8253_CHAN2     2
43#define T8253_CWORD     3
5144
52struct timer8253struct {
53   struct timer8253chan channel[3];
54};
5545
56struct tiamc1_sound_state
46// device type definition
47const device_type TIAMC1 = &device_creator<tiamc1_sound_device>;
48
49
50//**************************************************************************
51//  LIVE DEVICE
52//**************************************************************************
53
54//-------------------------------------------------
55//  tiamc1_sound_device - constructor
56//-------------------------------------------------
57
58tiamc1_sound_device::tiamc1_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
59   : device_t(mconfig, TIAMC1, "TIA-MC1 Custom", tag, owner, clock),
60     device_sound_interface(mconfig, *this),
61     m_channel(NULL),
62     m_timer1_divider(0)
5763{
58   sound_stream *m_channel;
59   int m_timer1_divider;
64}
6065
61   struct timer8253struct m_timer0;
62   struct timer8253struct m_timer1;
63};
6466
67//-------------------------------------------------
68//  device_start - device-specific startup
69//-------------------------------------------------
6570
66#define T8253_CHAN0     0
67#define T8253_CHAN1     1
68#define T8253_CHAN2     2
69#define T8253_CWORD     3
71void tiamc1_sound_device::device_start()
72{
73   int i, j;
7074
75   timer8253_reset(&m_timer0);
76   timer8253_reset(&m_timer1);
7177
72INLINE tiamc1_sound_state *get_safe_token(device_t *device)
78   m_channel = stream_alloc(0, 1, clock() / CLOCK_DIVIDER);
79
80   m_timer1_divider = 0;
81
82   for (i = 0; i < 2; i++)
83    {
84      struct timer8253struct *t = (i ? &m_timer1 : &m_timer0);
85
86      for (j = 0; j < 3; j++)
87        {
88         state_save_register_item(machine(), "channel", NULL, i * 3 + j, t->channel[j].count);
89         state_save_register_item(machine(), "channel", NULL, i * 3 + j, t->channel[j].cnval);
90         state_save_register_item(machine(), "channel", NULL, i * 3 + j, t->channel[j].bcdMode);
91         state_save_register_item(machine(), "channel", NULL, i * 3 + j, t->channel[j].cntMode);
92         state_save_register_item(machine(), "channel", NULL, i * 3 + j, t->channel[j].valMode);
93         state_save_register_item(machine(), "channel", NULL, i * 3 + j, t->channel[j].gate);
94         state_save_register_item(machine(), "channel", NULL, i * 3 + j, t->channel[j].output);
95         state_save_register_item(machine(), "channel", NULL, i * 3 + j, t->channel[j].loadCnt);
96         state_save_register_item(machine(), "channel", NULL, i * 3 + j, t->channel[j].enable);
97      }
98   }
99
100   save_item(NAME(m_timer1_divider));
101}
102
103
104//-------------------------------------------------
105//  sound_stream_update - handle a stream update
106//-------------------------------------------------
107
108void tiamc1_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
73109{
74   assert(device != NULL);
75   assert(device->type() == TIAMC1);
110   int count, o0, o1, o2, len, orval = 0;
76111
77   return (tiamc1_sound_state *)downcast<tiamc1_sound_device *>(device)->token();
112   len = samples * CLOCK_DIVIDER;
113
114   for (count = 0; count < len; count++)
115    {
116      m_timer1_divider++;
117      if (m_timer1_divider == 228)
118        {
119         m_timer1_divider = 0;
120         timer8253_tick(&m_timer1, 0);
121         timer8253_tick(&m_timer1, 1);
122         timer8253_tick(&m_timer1, 2);
123
124         timer8253_set_gate(&m_timer0, 0, timer8253_get_output(&m_timer1, 0));
125         timer8253_set_gate(&m_timer0, 1, timer8253_get_output(&m_timer1, 1));
126         timer8253_set_gate(&m_timer0, 2, timer8253_get_output(&m_timer1, 2));
127      }
128
129      timer8253_tick(&m_timer0, 0);
130      timer8253_tick(&m_timer0, 1);
131      timer8253_tick(&m_timer0, 2);
132
133      o0 = timer8253_get_output(&m_timer0, 0) ? 1 : 0;
134      o1 = timer8253_get_output(&m_timer0, 1) ? 1 : 0;
135      o2 = timer8253_get_output(&m_timer0, 2) ? 1 : 0;
136
137      orval = (orval << 1) | (((o0 | o1) ^ 0xff) & o2);
138
139      if ((count + 1) % CLOCK_DIVIDER == 0)
140        {
141         outputs[0][count / CLOCK_DIVIDER] = orval ? 0x2828 : 0;
142         orval = 0;
143      }
144   }
78145}
79146
80147
81static void timer8253_reset(struct timer8253struct *t) {
82   memset(t,0,sizeof(struct timer8253struct));
148void tiamc1_sound_device::timer8253_reset(struct timer8253struct *t)
149{
150    memset(t,0,sizeof(struct timer8253struct));
83151}
84152
85153
86static void timer8253_tick(struct timer8253struct *t,int chn) {
87   if (t->channel[chn].enable && t->channel[chn].gate) {
88      switch (t->channel[chn].cntMode) {
154void tiamc1_sound_device::timer8253_tick(struct timer8253struct *t, int chn)
155{
156    if (t->channel[chn].enable && t->channel[chn].gate)
157    {     
158        switch (t->channel[chn].cntMode)
159        {
89160      case 0:
90161         t->channel[chn].count--;
91162         if (t->channel[chn].count == 0xffff)
r21254r21255
109180         if(t->channel[chn].count==0)
110181            t->channel[chn].output = 1;
111182
112         if(t->channel[chn].count == 0xffff) {
183         if(t->channel[chn].count == 0xffff)
184            {
113185            t->channel[chn].enable = 0;
114186            t->channel[chn].output = 1;
115187         }
r21254r21255
120192
121193
122194
123static void timer8253_wr(struct timer8253struct *t, int reg, UINT8 val)
195void tiamc1_sound_device::timer8253_wr(struct timer8253struct *t, int reg, UINT8 val)
124196{
125197   int chn;
126198
127   switch (reg) {
199   switch (reg)
200    {
128201   case T8253_CWORD:
129202      chn = val >> 6;
130      if (chn < 3) {
203      if (chn < 3)
204        {
131205         t->channel[chn].bcdMode = (val & 1) ? 1 : 0;
132206         t->channel[chn].cntMode = (val >> 1) & 0x07;
133207         t->channel[chn].valMode = (val >> 4) & 0x03;
134208
135         switch (t->channel[chn].valMode) {
209         switch (t->channel[chn].valMode)
210            {
136211         case 1:
137212         case 2:
138213            t->channel[chn].loadCnt = 1;
r21254r21255
146221            mame_printf_debug("unhandled val mode %i\n", t->channel[chn].valMode);
147222         }
148223
149         switch (t->channel[chn].cntMode) {
224         switch (t->channel[chn].cntMode)
225            {
150226         case 0:
151227            t->channel[chn].output = 0;
152228            t->channel[chn].enable = 0;
r21254r21255
170246   default:
171247      chn = reg;
172248
173      switch (t->channel[chn].valMode) {
249      switch (t->channel[chn].valMode)
250        {
174251      case 1:
175252         t->channel[chn].cnval = (t->channel[chn].cnval & 0xff00) | val;
176253         break;
r21254r21255
184261         mame_printf_debug("unhandled val mode %i\n", t->channel[chn].valMode);
185262      }
186263
187      if (t->channel[chn].cntMode==0) {
264      if (t->channel[chn].cntMode==0)
265        {
188266         t->channel[chn].enable = 0;
189267      }
190268
191269      t->channel[chn].loadCnt--;
192270
193      if (t->channel[chn].loadCnt == 0) {
194         switch (t->channel[chn].valMode) {
271      if (t->channel[chn].loadCnt == 0)
272        {
273         switch (t->channel[chn].valMode)
274            {
195275         case 1:
196276         case 2:
197277            t->channel[chn].loadCnt = 1;
r21254r21255
205285            mame_printf_debug("unhandled val mode %i\n", t->channel[chn].valMode);
206286         }
207287
208         switch (t->channel[chn].cntMode) {
288         switch (t->channel[chn].cntMode)
289            {
209290         case 3:
210291            t->channel[chn].count = t->channel[chn].cnval;
211292            t->channel[chn].enable = 1;
r21254r21255
224305   }
225306}
226307
227static void timer8253_set_gate(struct timer8253struct *t, int chn, UINT8 gate)
308void tiamc1_sound_device::timer8253_set_gate(struct timer8253struct *t, int chn, UINT8 gate)
228309{
229310   t->channel[chn].gate = gate;
230311}
231312
232313
233314
234static char timer8253_get_output(struct timer8253struct *t, int chn)
315char tiamc1_sound_device::timer8253_get_output(struct timer8253struct *t, int chn)
235316{
236317   return t->channel[chn].output;
237318}
238319
239320
240321
241WRITE8_DEVICE_HANDLER( tiamc1_timer0_w )
322WRITE8_MEMBER( tiamc1_sound_device::tiamc1_timer0_w )
242323{
243   tiamc1_sound_state *state = get_safe_token(device);
244   timer8253_wr(&state->m_timer0, offset, data);
324   timer8253_wr(&m_timer0, offset, data);
245325}
246326
247WRITE8_DEVICE_HANDLER( tiamc1_timer1_w )
327WRITE8_MEMBER( tiamc1_sound_device::tiamc1_timer1_w )
248328{
249   tiamc1_sound_state *state = get_safe_token(device);
250   timer8253_wr(&state->m_timer1, offset, data);
329   timer8253_wr(&m_timer1, offset, data);
251330}
252331
253WRITE8_DEVICE_HANDLER( tiamc1_timer1_gate_w )
332WRITE8_MEMBER( tiamc1_sound_device::tiamc1_timer1_gate_w )
254333{
255   tiamc1_sound_state *state = get_safe_token(device);
256   timer8253_set_gate(&state->m_timer1, 0, (data & 1) ? 1 : 0);
257   timer8253_set_gate(&state->m_timer1, 1, (data & 2) ? 1 : 0);
258   timer8253_set_gate(&state->m_timer1, 2, (data & 4) ? 1 : 0);
334   timer8253_set_gate(&m_timer1, 0, (data & 1) ? 1 : 0);
335   timer8253_set_gate(&m_timer1, 1, (data & 2) ? 1 : 0);
336   timer8253_set_gate(&m_timer1, 2, (data & 4) ? 1 : 0);
259337}
260
261
262static STREAM_UPDATE( tiamc1_sound_update )
263{
264   tiamc1_sound_state *state = get_safe_token(device);
265   int count, o0, o1, o2, len, orval = 0;
266
267   len = samples * CLOCK_DIVIDER;
268
269   for (count = 0; count < len; count++) {
270      state->m_timer1_divider++;
271      if (state->m_timer1_divider == 228) {
272         state->m_timer1_divider = 0;
273         timer8253_tick(&state->m_timer1, 0);
274         timer8253_tick(&state->m_timer1, 1);
275         timer8253_tick(&state->m_timer1, 2);
276
277         timer8253_set_gate(&state->m_timer0, 0, timer8253_get_output(&state->m_timer1, 0));
278         timer8253_set_gate(&state->m_timer0, 1, timer8253_get_output(&state->m_timer1, 1));
279         timer8253_set_gate(&state->m_timer0, 2, timer8253_get_output(&state->m_timer1, 2));
280      }
281
282      timer8253_tick(&state->m_timer0, 0);
283      timer8253_tick(&state->m_timer0, 1);
284      timer8253_tick(&state->m_timer0, 2);
285
286      o0 = timer8253_get_output(&state->m_timer0, 0) ? 1 : 0;
287      o1 = timer8253_get_output(&state->m_timer0, 1) ? 1 : 0;
288      o2 = timer8253_get_output(&state->m_timer0, 2) ? 1 : 0;
289
290      orval = (orval << 1) | (((o0 | o1) ^ 0xff) & o2);
291
292      if ((count + 1) % CLOCK_DIVIDER == 0) {
293         outputs[0][count / CLOCK_DIVIDER] = orval ? 0x2828 : 0;
294         orval = 0;
295      }
296   }
297}
298
299static DEVICE_START( tiamc1_sound )
300{
301   tiamc1_sound_state *state = get_safe_token(device);
302   running_machine &machine = device->machine();
303   int i, j;
304
305   timer8253_reset(&state->m_timer0);
306   timer8253_reset(&state->m_timer1);
307
308   state->m_channel = device->machine().sound().stream_alloc(*device, 0, 1, device->clock() / CLOCK_DIVIDER, 0, tiamc1_sound_update);
309
310   state->m_timer1_divider = 0;
311
312   for (i = 0; i < 2; i++) {
313      struct timer8253struct *t = (i ? &state->m_timer1 : &state->m_timer0);
314
315      for (j = 0; j < 3; j++) {
316         state_save_register_item(machine, "channel", NULL, i * 3 + j, t->channel[j].count);
317         state_save_register_item(machine, "channel", NULL, i * 3 + j, t->channel[j].cnval);
318         state_save_register_item(machine, "channel", NULL, i * 3 + j, t->channel[j].bcdMode);
319         state_save_register_item(machine, "channel", NULL, i * 3 + j, t->channel[j].cntMode);
320         state_save_register_item(machine, "channel", NULL, i * 3 + j, t->channel[j].valMode);
321         state_save_register_item(machine, "channel", NULL, i * 3 + j, t->channel[j].gate);
322         state_save_register_item(machine, "channel", NULL, i * 3 + j, t->channel[j].output);
323         state_save_register_item(machine, "channel", NULL, i * 3 + j, t->channel[j].loadCnt);
324         state_save_register_item(machine, "channel", NULL, i * 3 + j, t->channel[j].enable);
325      }
326   }
327
328   device->save_item(NAME(state->m_timer1_divider));
329}
330
331
332const device_type TIAMC1 = &device_creator<tiamc1_sound_device>;
333
334tiamc1_sound_device::tiamc1_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
335   : device_t(mconfig, TIAMC1, "TIA-MC1 Custom", tag, owner, clock),
336      device_sound_interface(mconfig, *this)
337{
338   m_token = global_alloc_clear(tiamc1_sound_state);
339}
340
341//-------------------------------------------------
342//  device_config_complete - perform any
343//  operations now that the configuration is
344//  complete
345//-------------------------------------------------
346
347void tiamc1_sound_device::device_config_complete()
348{
349}
350
351//-------------------------------------------------
352//  device_start - device-specific startup
353//-------------------------------------------------
354
355void tiamc1_sound_device::device_start()
356{
357   DEVICE_START_NAME( tiamc1_sound )(this);
358}
359
360//-------------------------------------------------
361//  sound_stream_update - handle a stream update
362//-------------------------------------------------
363
364void tiamc1_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
365{
366   // should never get here
367   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
368}
trunk/src/mame/audio/cps3.c
r21254r21255
66#include "emu.h"
77#include "includes/cps3.h"
88
9#define CPS3_VOICES     16
109
11struct cps3_voice
12{
13   UINT32 regs[8];
14   UINT32 pos;
15   UINT16 frac;
16};
10// device type definition
11const device_type CPS3 = &device_creator<cps3_sound_device>;
1712
18struct cps3_sound_state
19{
20   sound_stream *m_stream;
21   cps3_voice m_voice[CPS3_VOICES];
22   UINT16     m_key;
23   INT8*      m_base;
24};
2513
26INLINE cps3_sound_state *get_safe_token(device_t *device)
14//**************************************************************************
15//  LIVE DEVICE
16//**************************************************************************
17
18//-------------------------------------------------
19//  cps3_sound_device - constructor
20//-------------------------------------------------
21
22cps3_sound_device::cps3_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
23   : device_t(mconfig, CPS3, "CPS3 Custom", tag, owner, clock),
24     device_sound_interface(mconfig, *this),
25     m_stream(NULL),
26     m_key(0),
27     m_base(NULL)
2728{
28   assert(device != NULL);
29   assert(device->type() == CPS3);
29}
3030
31   return (cps3_sound_state *)downcast<cps3_sound_device *>(device)->token();
31
32//-------------------------------------------------
33//  device_start - device-specific startup
34//-------------------------------------------------
35
36void cps3_sound_device::device_start()
37{
38   /* Allocate the stream */
39   m_stream = stream_alloc(0, 2, clock() / 384);
3240}
3341
34static STREAM_UPDATE( cps3_stream_update )
42
43//-------------------------------------------------
44//  sound_stream_update - handle a stream update
45//-------------------------------------------------
46
47void cps3_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
3548{
36   cps3_sound_state *state = get_safe_token(device);
3749   int i;
3850
3951   // the actual 'user5' region only exists on the nocd sets, on the others it's allocated in the initialization.
4052   // it's a shared gfx/sound region, so can't be allocated as part of the sound device.
41   state->m_base = (INT8*)device->machine().driver_data<cps3_state>()->m_user5region;
53   m_base = (INT8*)machine().driver_data<cps3_state>()->m_user5region;
4254
4355   /* Clear the buffers */
4456   memset(outputs[0], 0, samples*sizeof(*outputs[0]));
r21254r21255
4658
4759   for (i = 0; i < CPS3_VOICES; i ++)
4860   {
49      if (state->m_key & (1 << i))
61      if (m_key & (1 << i))
5062      {
5163         int j;
5264
5365         /* TODO */
5466         #define SWAP(a) ((a >> 16) | ((a & 0xffff) << 16))
5567
56         cps3_voice *vptr = &state->m_voice[i];
68         cps3_voice *vptr = &m_voice[i];
5769
5870         UINT32 start = vptr->regs[1];
5971         UINT32 end   = vptr->regs[5];
r21254r21255
88100               }
89101               else
90102               {
91                  state->m_key &= ~(1 << i);
103                  m_key &= ~(1 << i);
92104                  break;
93105               }
94106            }
95107
96            sample = state->m_base[BYTE4_XOR_LE(start + pos)];
108            sample = m_base[BYTE4_XOR_LE(start + pos)];
97109            frac += step;
98110
99111            outputs[0][j] += (sample * (vol_l >> 8));
r21254r21255
104116         vptr->frac = frac;
105117      }
106118   }
107
108119}
109120
110static DEVICE_START( cps3_sound )
111{
112   cps3_sound_state *state = get_safe_token(device);
113121
114   /* Allocate the stream */
115   state->m_stream = device->machine().sound().stream_alloc(*device, 0, 2, device->clock() / 384, NULL, cps3_stream_update);
116}
117
118WRITE32_DEVICE_HANDLER( cps3_sound_w )
122WRITE32_MEMBER( cps3_sound_device::cps3_sound_w )
119123{
120   cps3_sound_state *state = get_safe_token(device);
124   m_stream->update();
121125
122   state->m_stream->update();
123
124126   if (offset < 0x80)
125127   {
126      COMBINE_DATA(&state->m_voice[offset / 8].regs[offset & 7]);
128      COMBINE_DATA(&m_voice[offset / 8].regs[offset & 7]);
127129   }
128130   else if (offset == 0x80)
129131   {
r21254r21255
133135      for (i = 0; i < CPS3_VOICES; i++)
134136      {
135137         // Key off -> Key on
136         if ((key & (1 << i)) && !(state->m_key & (1 << i)))
138         if ((key & (1 << i)) && !(m_key & (1 << i)))
137139         {
138            state->m_voice[i].frac = 0;
139            state->m_voice[i].pos = 0;
140            m_voice[i].frac = 0;
141            m_voice[i].pos = 0;
140142         }
141143      }
142      state->m_key = key;
144      m_key = key;
143145   }
144146   else
145147   {
r21254r21255
148150   }
149151}
150152
151READ32_DEVICE_HANDLER( cps3_sound_r )
153
154READ32_MEMBER( cps3_sound_device::cps3_sound_r )
152155{
153   cps3_sound_state *state = get_safe_token(device);
154   state->m_stream->update();
156   m_stream->update();
155157
156158   if (offset < 0x80)
157159   {
158      return state->m_voice[offset / 8].regs[offset & 7] & mem_mask;
160      return m_voice[offset / 8].regs[offset & 7] & mem_mask;
159161   }
160162   else if (offset == 0x80)
161163   {
162      return state->m_key << 16;
164      return m_key << 16;
163165   }
164166   else
165167   {
r21254r21255
167169      return 0;
168170   }
169171}
170
171
172const device_type CPS3 = &device_creator<cps3_sound_device>;
173
174cps3_sound_device::cps3_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
175   : device_t(mconfig, CPS3, "CPS3 Custom", tag, owner, clock),
176      device_sound_interface(mconfig, *this)
177{
178   m_token = global_alloc_clear(cps3_sound_state);
179}
180
181//-------------------------------------------------
182//  device_config_complete - perform any
183//  operations now that the configuration is
184//  complete
185//-------------------------------------------------
186
187void cps3_sound_device::device_config_complete()
188{
189}
190
191//-------------------------------------------------
192//  device_start - device-specific startup
193//-------------------------------------------------
194
195void cps3_sound_device::device_start()
196{
197   DEVICE_START_NAME( cps3_sound )(this);
198}
199
200//-------------------------------------------------
201//  sound_stream_update - handle a stream update
202//-------------------------------------------------
203
204void cps3_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
205{
206   // should never get here
207   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
208}
trunk/src/mame/audio/redbaron.c
r21254r21255
11/*************************************************************************
22
3    Atari Red Baron hardware
3    Atari Red Baron sound hardware
44
55*************************************************************************/
66/*
r21254r21255
2020
2121#define OUTPUT_RATE     (48000)
2222
23struct redbaron_sound_state
24{
25   INT16 *m_vol_lookup;
2623
27   INT16 m_vol_crash[16];
24// device type definition
25const device_type REDBARON = &device_creator<redbaron_sound_device>;
2826
29   sound_stream *m_channel;
30   int m_latch;
31   int m_poly_counter;
32   int m_poly_shift;
3327
34   int m_filter_counter;
28//**************************************************************************
29//  LIVE DEVICE
30//**************************************************************************
3531
36   int m_crash_amp;
37   int m_shot_amp;
38   int m_shot_amp_counter;
32//-------------------------------------------------
33//  redbaron_sound_device - constructor
34//-------------------------------------------------
3935
40   int m_squeal_amp;
41   int m_squeal_amp_counter;
42   int m_squeal_off_counter;
43   int m_squeal_on_counter;
44   int m_squeal_out;
45};
46
47INLINE redbaron_sound_state *get_safe_token(device_t *device)
36redbaron_sound_device::redbaron_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
37   : device_t(mconfig, REDBARON, "Red Baron Custom", tag, owner, clock),
38     device_sound_interface(mconfig, *this),
39     m_vol_lookup(NULL),
40     m_channel(NULL),
41     m_latch(0),
42     m_poly_counter(0),
43     m_poly_shift(0),
44     m_filter_counter(0),
45     m_crash_amp(0),
46     m_shot_amp(0),
47     m_shot_amp_counter(0),
48     m_squeal_amp(0),
49     m_squeal_amp_counter(0),
50     m_squeal_off_counter(0),
51     m_squeal_on_counter(0),
52     m_squeal_out(0)
4853{
49   assert(device != NULL);
50   assert(device->type() == REDBARON);
51
52   return (redbaron_sound_state *)downcast<redbaron_sound_device *>(device)->token();
54     memset(m_vol_crash, 0, sizeof(INT16)*16);
5355}
5456
5557
56WRITE8_DEVICE_HANDLER( redbaron_sounds_w )
58//-------------------------------------------------
59//  device_start - device-specific startup
60//-------------------------------------------------
61
62void redbaron_sound_device::device_start()
5763{
58   redbaron_sound_state *state = get_safe_token(device);
64   int i;
5965
60   /* If sound is off, don't bother playing samples */
61   if( data == state->m_latch )
62      return;
66   m_vol_lookup = auto_alloc_array(machine(), INT16, 32768);
67   for( i = 0; i < 0x8000; i++ )
68      m_vol_lookup[0x7fff-i] = (INT16) (0x7fff/exp(1.0*i/4096));
6369
64   state->m_channel->update();
65   state->m_latch = data;
66}
70   for( i = 0; i < 16; i++ )
71   {
72      /* r0 = R18 and R24, r1 = open */
73      double r0 = 1.0/(5600 + 680), r1 = 1/6e12;
6774
68#ifdef UNUSED_FUNCTION
69WRITE8_DEVICE_HANDLER( redbaron_pokey_w )
70{
71   redbaron_sound_state *state = get_safe_token(device);
75      /* R14 */
76      if( i & 1 )
77         r1 += 1.0/8200;
78      else
79         r0 += 1.0/8200;
80      /* R15 */
81      if( i & 2 )
82         r1 += 1.0/3900;
83      else
84         r0 += 1.0/3900;
85      /* R16 */
86      if( i & 4 )
87         r1 += 1.0/2200;
88      else
89         r0 += 1.0/2200;
90      /* R17 */
91      if( i & 8 )
92         r1 += 1.0/1000;
93      else
94         r0 += 1.0/1000;
95      r0 = 1.0/r0;
96      r1 = 1.0/r1;
97      m_vol_crash[i] = 32767 * r0 / (r0 + r1);
98   }
7299
73   if( state->m_latch & 0x20 )
74      pokey_w(device, offset, data);
100   m_channel = stream_alloc(0, 1, OUTPUT_RATE);
75101}
76#endif
77102
78static STREAM_UPDATE( redbaron_sound_update )
103
104
105//-------------------------------------------------
106//  sound_stream_update - handle a stream update
107//-------------------------------------------------
108
109void redbaron_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
79110{
80   redbaron_sound_state *state = get_safe_token(device);
81111   stream_sample_t *buffer = outputs[0];
82112   while( samples-- )
83113   {
84114      int sum = 0;
85115
86116      /* polynome shifter E5 and F4 (LS164) clocked with 12kHz */
87      state->m_poly_counter -= 12000;
88      while( state->m_poly_counter <= 0 )
117      m_poly_counter -= 12000;
118      while( m_poly_counter <= 0 )
89119      {
90         state->m_poly_counter += OUTPUT_RATE;
91         if( ((state->m_poly_shift & 0x0001) == 0) == ((state->m_poly_shift & 0x4000) == 0) )
92            state->m_poly_shift = (state->m_poly_shift << 1) | 1;
120         m_poly_counter += OUTPUT_RATE;
121         if( ((m_poly_shift & 0x0001) == 0) == ((m_poly_shift & 0x4000) == 0) )
122            m_poly_shift = (m_poly_shift << 1) | 1;
93123         else
94            state->m_poly_shift <<= 1;
124            m_poly_shift <<= 1;
95125      }
96126
97127      /* What is the exact low pass filter frequency? */
98      state->m_filter_counter -= 330;
99      while( state->m_filter_counter <= 0 )
128      m_filter_counter -= 330;
129      while( m_filter_counter <= 0 )
100130      {
101         state->m_filter_counter += OUTPUT_RATE;
102         state->m_crash_amp = (state->m_poly_shift & 1) ? state->m_latch >> 4 : 0;
131         m_filter_counter += OUTPUT_RATE;
132         m_crash_amp = (m_poly_shift & 1) ? m_latch >> 4 : 0;
103133      }
104134      /* mix crash sound at 35% */
105      sum += state->m_vol_crash[state->m_crash_amp] * 35 / 100;
135      sum += m_vol_crash[m_crash_amp] * 35 / 100;
106136
107137      /* shot not active: charge C32 (0.1u) */
108      if( (state->m_latch & 0x04) == 0 )
109         state->m_shot_amp = 32767;
138      if( (m_latch & 0x04) == 0 )
139         m_shot_amp = 32767;
110140      else
111      if( (state->m_poly_shift & 0x8000) == 0 )
141      if( (m_poly_shift & 0x8000) == 0 )
112142      {
113         if( state->m_shot_amp > 0 )
143         if( m_shot_amp > 0 )
114144         {
115145            /* discharge C32 (0.1u) through R26 (33k) + R27 (15k)
116146             * 0.68 * C32 * (R26 + R27) = 3264us
r21254r21255
118148//              #define C32_DISCHARGE_TIME (int)(32767 / 0.003264);
119149            /* I think this is to short. Is C32 really 1u? */
120150            #define C32_DISCHARGE_TIME (int)(32767 / 0.03264);
121            state->m_shot_amp_counter -= C32_DISCHARGE_TIME;
122            while( state->m_shot_amp_counter <= 0 )
151            m_shot_amp_counter -= C32_DISCHARGE_TIME;
152            while( m_shot_amp_counter <= 0 )
123153            {
124               state->m_shot_amp_counter += OUTPUT_RATE;
125               if( --state->m_shot_amp == 0 )
154               m_shot_amp_counter += OUTPUT_RATE;
155               if( --m_shot_amp == 0 )
126156                  break;
127157            }
128158            /* mix shot sound at 35% */
129            sum += state->m_vol_lookup[state->m_shot_amp] * 35 / 100;
159            sum += m_vol_lookup[m_shot_amp] * 35 / 100;
130160         }
131161      }
132162
133163
134      if( (state->m_latch & 0x02) == 0 )
135         state->m_squeal_amp = 0;
164      if( (m_latch & 0x02) == 0 )
165         m_squeal_amp = 0;
136166      else
137167      {
138         if( state->m_squeal_amp < 32767 )
168         if( m_squeal_amp < 32767 )
139169         {
140170            /* charge C5 (22u) over R3 (68k) and CR1 (1N914)
141171             * time = 0.68 * C5 * R3 = 1017280us
142172             */
143173            #define C5_CHARGE_TIME (int)(32767 / 1.01728);
144            state->m_squeal_amp_counter -= C5_CHARGE_TIME;
145            while( state->m_squeal_amp_counter <= 0 )
174            m_squeal_amp_counter -= C5_CHARGE_TIME;
175            while( m_squeal_amp_counter <= 0 )
146176            {
147               state->m_squeal_amp_counter += OUTPUT_RATE;
148               if( ++state->m_squeal_amp == 32767 )
177               m_squeal_amp_counter += OUTPUT_RATE;
178               if( ++m_squeal_amp == 32767 )
149179                  break;
150180            }
151181         }
152182
153         if( state->m_squeal_out )
183         if( m_squeal_out )
154184         {
155185            /* NE555 setup as pulse position modulator
156186             * C = 0.01u, Ra = 33k, Rb = 47k
157187             * frequency = 1.44 / ((33k + 2*47k) * 0.01u) = 1134Hz
158188             * modulated by squeal_amp
159189             */
160            state->m_squeal_off_counter -= (1134 + 1134 * state->m_squeal_amp / 32767) / 3;
161            while( state->m_squeal_off_counter <= 0 )
190            m_squeal_off_counter -= (1134 + 1134 * m_squeal_amp / 32767) / 3;
191            while( m_squeal_off_counter <= 0 )
162192            {
163               state->m_squeal_off_counter += OUTPUT_RATE;
164               state->m_squeal_out = 0;
193               m_squeal_off_counter += OUTPUT_RATE;
194               m_squeal_out = 0;
165195            }
166196         }
167197         else
168198         {
169            state->m_squeal_on_counter -= 1134;
170            while( state->m_squeal_on_counter <= 0 )
199            m_squeal_on_counter -= 1134;
200            while( m_squeal_on_counter <= 0 )
171201            {
172               state->m_squeal_on_counter += OUTPUT_RATE;
173               state->m_squeal_out = 1;
202               m_squeal_on_counter += OUTPUT_RATE;
203               m_squeal_out = 1;
174204            }
175205         }
176206      }
177207
178208      /* mix sequal sound at 40% */
179      if( state->m_squeal_out )
209      if( m_squeal_out )
180210         sum += 32767 * 40 / 100;
181211
182212      *buffer++ = sum;
183213   }
184214}
185215
186static DEVICE_START( redbaron_sound )
187{
188   redbaron_sound_state *state = get_safe_token(device);
189   int i;
190216
191   state->m_vol_lookup = auto_alloc_array(device->machine(), INT16, 32768);
192   for( i = 0; i < 0x8000; i++ )
193      state->m_vol_lookup[0x7fff-i] = (INT16) (0x7fff/exp(1.0*i/4096));
194
195   for( i = 0; i < 16; i++ )
196   {
197      /* r0 = R18 and R24, r1 = open */
198      double r0 = 1.0/(5600 + 680), r1 = 1/6e12;
199
200      /* R14 */
201      if( i & 1 )
202         r1 += 1.0/8200;
203      else
204         r0 += 1.0/8200;
205      /* R15 */
206      if( i & 2 )
207         r1 += 1.0/3900;
208      else
209         r0 += 1.0/3900;
210      /* R16 */
211      if( i & 4 )
212         r1 += 1.0/2200;
213      else
214         r0 += 1.0/2200;
215      /* R17 */
216      if( i & 8 )
217         r1 += 1.0/1000;
218      else
219         r0 += 1.0/1000;
220      r0 = 1.0/r0;
221      r1 = 1.0/r1;
222      state->m_vol_crash[i] = 32767 * r0 / (r0 + r1);
223   }
224
225   state->m_channel = device->machine().sound().stream_alloc(*device, 0, 1, OUTPUT_RATE, 0, redbaron_sound_update);
226}
227
228const device_type REDBARON = &device_creator<redbaron_sound_device>;
229
230redbaron_sound_device::redbaron_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
231   : device_t(mconfig, REDBARON, "Red Baron Custom", tag, owner, clock),
232      device_sound_interface(mconfig, *this)
217WRITE8_MEMBER( redbaron_sound_device::redbaron_sounds_w )
233218{
234   m_token = global_alloc_clear(redbaron_sound_state);
235}
219   /* If sound is off, don't bother playing samples */
220   if( data == m_latch )
221      return;
236222
237//-------------------------------------------------
238//  device_config_complete - perform any
239//  operations now that the configuration is
240//  complete
241//-------------------------------------------------
242
243void redbaron_sound_device::device_config_complete()
244{
223   m_channel->update();
224   m_latch = data;
245225}
246226
247//-------------------------------------------------
248//  device_start - device-specific startup
249//-------------------------------------------------
250227
251void redbaron_sound_device::device_start()
228#ifdef UNUSED_FUNCTION
229WRITE8_MEMBER( redbaron_sound_device::redbaron_pokey_w )
252230{
253   DEVICE_START_NAME( redbaron_sound )(this);
231   if( m_latch & 0x20 )
232      pokey_w(device, offset, data);
254233}
255
256//-------------------------------------------------
257//  sound_stream_update - handle a stream update
258//-------------------------------------------------
259
260void redbaron_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
261{
262   // should never get here
263   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
264}
234#endif
trunk/src/mame/includes/cps3.h
r21254r21255
44
55****************************************************************************/
66
7#include "devlegcy.h"
87#include "machine/intelfsh.h"
98
109class cps3_state : public driver_device
r21254r21255
123122   void cps3_do_alt_char_dma( UINT32 src, UINT32 real_dest, UINT32 real_length );
124123   void cps3_process_character_dma(UINT32 address);
125124   void copy_from_nvram();
126   inline void cps3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle &clip,gfx_element *gfx,
127      unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy,
128      int transparency,int transparent_color,
129      int scalex, int scaley,bitmap_ind8 *pri_buffer,UINT32 pri_mask);
125   inline void cps3_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangle &clip, gfx_element *gfx,
126                         unsigned int code, unsigned int color, int flipx, int flipy, int sx, int sy,
127                         int transparency, int transparent_color,
128                         int scalex, int scaley, bitmap_ind8 *pri_buffer, UINT32 pri_mask);
130129
131130};
132131
133132
134133/*----------- defined in audio/cps3.c -----------*/
135134
135#define CPS3_VOICES (16)
136
137//**************************************************************************
138//  TYPE DEFINITIONS
139//**************************************************************************
140
141struct cps3_voice
142{
143    cps3_voice() :
144      pos(0),
145      frac(0)
146    {
147        memset(regs, 0, sizeof(UINT32)*8);
148    }
149   
150   UINT32 regs[8];
151   UINT32 pos;
152   UINT16 frac;
153};
154
155// ======================> cps3_sound_device
156
136157class cps3_sound_device : public device_t,
137                           public device_sound_interface
158                    public device_sound_interface
138159{
139160public:
140161   cps3_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
141   ~cps3_sound_device() { global_free(m_token); }
162   ~cps3_sound_device() { }
142163
143   // access to legacy token
144   void *token() const { assert(m_token != NULL); return m_token; }
145164protected:
146165   // device-level overrides
147   virtual void device_config_complete();
148166   virtual void device_start();
149167
150168   // sound stream update overrides
151169   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
170
171public:
172    DECLARE_WRITE32_MEMBER( cps3_sound_w );
173    DECLARE_READ32_MEMBER( cps3_sound_r );
174
152175private:
153   // internal state
154   void *m_token;
176   sound_stream *m_stream;
177   cps3_voice m_voice[CPS3_VOICES];
178   UINT16     m_key;
179   INT8*      m_base;
155180};
156181
157182extern const device_type CPS3;
158
159
160DECLARE_WRITE32_DEVICE_HANDLER( cps3_sound_w );
161DECLARE_READ32_DEVICE_HANDLER( cps3_sound_r );
trunk/src/mame/includes/polepos.h
r21254r21255
44
55*************************************************************************/
66
7#include "devlegcy.h"
7#include "sound/filter.h"
8#include "sound/tms5220.h"
89#include "sound/discrete.h"
9#include "sound/tms5220.h"
1010
1111
1212class polepos_state : public driver_device
r21254r21255
9393/*----------- defined in audio/polepos.c -----------*/
9494
9595class polepos_sound_device : public device_t,
96                           public device_sound_interface
96                      public device_sound_interface
9797{
9898public:
9999   polepos_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
100   ~polepos_sound_device() { global_free(m_token); }
100   ~polepos_sound_device() { }
101101
102   // access to legacy token
103   void *token() const { assert(m_token != NULL); return m_token; }
104102protected:
105103   // device-level overrides
106   virtual void device_config_complete();
107104   virtual void device_start();
108105   virtual void device_reset();
109106
110107   // sound stream update overrides
111108   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
109
110public:
111    DECLARE_WRITE8_MEMBER( polepos_engine_sound_lsb_w );
112    DECLARE_WRITE8_MEMBER( polepos_engine_sound_msb_w );
113
112114private:
113   // internal state
114   void *m_token;
115   UINT32 m_current_position;
116   int m_sample_msb;
117   int m_sample_lsb;
118   int m_sample_enable;
119   sound_stream *m_stream;
120   filter2_context m_filter_engine[3];
115121};
116122
117123extern const device_type POLEPOS;
118124
119DECLARE_WRITE8_DEVICE_HANDLER( polepos_engine_sound_lsb_w );
120DECLARE_WRITE8_DEVICE_HANDLER( polepos_engine_sound_msb_w );
121
122125DISCRETE_SOUND_EXTERN( polepos );
trunk/src/mame/includes/tiamc1.h
r21254r21255
1#include "devlegcy.h"
21
32class tiamc1_state : public driver_device
43{
r21254r21255
4039
4140/*----------- defined in audio/tiamc1.c -----------*/
4241
42//**************************************************************************
43//  TYPE DEFINITIONS
44//**************************************************************************
45
46struct timer8253chan
47{
48    timer8253chan() :
49     count(0),
50     cnval(0),
51     bcdMode(0),
52     cntMode(0),
53     valMode(0),
54     gate(0),
55     output(0),
56     loadCnt(0),
57     enable(0)
58    {}
59           
60   UINT16 count;
61   UINT16 cnval;
62   UINT8 bcdMode;
63   UINT8 cntMode;
64   UINT8 valMode;
65   UINT8 gate;
66   UINT8 output;
67   UINT8 loadCnt;
68   UINT8 enable;
69};
70
71struct timer8253struct
72{
73    struct timer8253chan channel[3];
74};
75
76
77// ======================> qsound_device
78
4379class tiamc1_sound_device : public device_t,
44                           public device_sound_interface
80                     public device_sound_interface
4581{
4682public:
4783   tiamc1_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
48   ~tiamc1_sound_device() { global_free(m_token); }
84   ~tiamc1_sound_device() { }
4985
50   // access to legacy token
51   void *token() const { assert(m_token != NULL); return m_token; }
5286protected:
5387   // device-level overrides
54   virtual void device_config_complete();
5588   virtual void device_start();
5689
5790   // sound stream update overrides
5891   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
92
93public:
94    DECLARE_WRITE8_MEMBER( tiamc1_timer0_w );
95    DECLARE_WRITE8_MEMBER( tiamc1_timer1_w );
96    DECLARE_WRITE8_MEMBER( tiamc1_timer1_gate_w );
97
5998private:
60   // internal state
61   void *m_token;
99    void timer8253_reset(struct timer8253struct *t);
100    void timer8253_tick(struct timer8253struct *t,int chn);
101    void timer8253_wr(struct timer8253struct *t, int reg, UINT8 val);
102    char timer8253_get_output(struct timer8253struct *t, int chn);
103    void timer8253_set_gate(struct timer8253struct *t, int chn, UINT8 gate);
104
105private:
106   sound_stream *m_channel;
107   int m_timer1_divider;
108
109   timer8253struct m_timer0;
110   timer8253struct m_timer1;
62111};
63112
64113extern const device_type TIAMC1;
65
66
67DECLARE_WRITE8_DEVICE_HANDLER( tiamc1_timer0_w );
68DECLARE_WRITE8_DEVICE_HANDLER( tiamc1_timer1_w );
69DECLARE_WRITE8_DEVICE_HANDLER( tiamc1_timer1_gate_w );
trunk/src/mame/includes/gridlee.h
r21254r21255
66
77***************************************************************************/
88
9#include "devlegcy.h"
9#include "sound/samples.h"
1010
1111
1212#define GRIDLEE_MASTER_CLOCK    (20000000)
r21254r21255
6767
6868/*----------- defined in audio/gridlee.c -----------*/
6969
70DECLARE_WRITE8_DEVICE_HANDLER( gridlee_sound_w );
71
7270class gridlee_sound_device : public device_t,
73                           public device_sound_interface
71                      public device_sound_interface
7472{
7573public:
7674   gridlee_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
77   ~gridlee_sound_device() { global_free(m_token); }
75   ~gridlee_sound_device() { }
7876
79   // access to legacy token
80   void *token() const { assert(m_token != NULL); return m_token; }
8177protected:
8278   // device-level overrides
83   virtual void device_config_complete();
8479   virtual void device_start();
8580
8681   // sound stream update overrides
8782   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
83
84public:
85    DECLARE_WRITE8_MEMBER( gridlee_sound_w );
86
8887private:
89   // internal state
90   void *m_token;
88   /* tone variables */
89   UINT32 m_tone_step;
90   UINT32 m_tone_fraction;
91   UINT8 m_tone_volume;
92
93   /* sound streaming variables */
94   sound_stream *m_stream;
95   samples_device *m_samples;
96   double m_freq_to_step;
97   UINT8 m_sound_data[24];
9198};
9299
93100extern const device_type GRIDLEE;
trunk/src/mame/includes/bzone.h
r21254r21255
44
55*************************************************************************/
66
7#include "devlegcy.h"
87#include "sound/discrete.h"
98
109#define BZONE_MASTER_CLOCK (XTAL_12_096MHz)
r21254r21255
3837/*----------- defined in audio/bzone.c -----------*/
3938MACHINE_CONFIG_EXTERN( bzone_audio );
4039
40
4141/*----------- defined in audio/redbaron.c -----------*/
4242
43DECLARE_WRITE8_DEVICE_HANDLER( redbaron_sounds_w );
43//**************************************************************************
44//  TYPE DEFINITIONS
45//**************************************************************************
4446
47// ======================> redbaron_sound_device
48
4549class redbaron_sound_device : public device_t,
46                           public device_sound_interface
50                       public device_sound_interface
4751{
4852public:
4953   redbaron_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
50   ~redbaron_sound_device() { global_free(m_token); }
54   ~redbaron_sound_device() { }
5155
52   // access to legacy token
53   void *token() const { assert(m_token != NULL); return m_token; }
5456protected:
5557   // device-level overrides
56   virtual void device_config_complete();
5758   virtual void device_start();
5859
5960   // sound stream update overrides
6061   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
62
63public:
64    DECLARE_WRITE8_MEMBER( redbaron_sounds_w );
65
6166private:
62   // internal state
63   void *m_token;
67   INT16 *m_vol_lookup;
68
69   INT16 m_vol_crash[16];
70
71   sound_stream *m_channel;
72   int m_latch;
73   int m_poly_counter;
74   int m_poly_shift;
75
76   int m_filter_counter;
77
78   int m_crash_amp;
79   int m_shot_amp;
80   int m_shot_amp_counter;
81
82   int m_squeal_amp;
83   int m_squeal_amp_counter;
84   int m_squeal_off_counter;
85   int m_squeal_on_counter;
86   int m_squeal_out;
6487};
6588
6689extern const device_type REDBARON;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team