Previous 199869 Revisions Next

r20675 Saturday 2nd February, 2013 at 19:25:25 UTC by Andrew Gardner
Modernized digitalker, x1_010, tiaintf, and n63701x sound devices. [Andrew Gardner]
[src/emu/sound]digitalk.c digitalk.h n63701x.c n63701x.h tiaintf.c tiaintf.h x1_010.c x1_010.h
[src/mame/drivers]champbwl.c galaxian.c namcos86.c seta.c seta2.c tourtabl.c
[src/mame/video]seta.c tia.c
[src/mess/drivers]a2600.c a7800.c
[src/mess/machine]a7800.c

trunk/src/emu/sound/x1_010.c
r20674r20675
5151#include "emu.h"
5252#include "x1_010.h"
5353
54
5554#define VERBOSE_SOUND 0
5655#define VERBOSE_REGISTER_WRITE 0
5756#define VERBOSE_REGISTER_READ 0
r20674r20675
6059#define LOG_REGISTER_WRITE(x) do { if (VERBOSE_REGISTER_WRITE) logerror x; } while (0)
6160#define LOG_REGISTER_READ(x) do { if (VERBOSE_REGISTER_READ) logerror x; } while (0)
6261
63#define SETA_NUM_CHANNELS 16
64
6562#define FREQ_BASE_BITS        8                 // Frequency fixed decimal shift bits
6663#define ENV_BASE_BITS        16                 // wave form envelope fixed decimal shift bits
67#define VOL_BASE    (2*32*256/30)                   // Volume base
64#define VOL_BASE    (2*32*256/30)               // Volume base
6865
6966/* this structure defines the parameters for a channel */
7067struct X1_010_CHANNEL {
r20674r20675
7774   unsigned char   reserve[2];
7875};
7976
80struct x1_010_state
77/* mixer tables and internal buffers */
78//static short  *mixer_buffer = NULL;
79
80
81// device type definition
82const device_type X1_010 = &device_creator<x1_010_device>;
83
84
85//**************************************************************************
86//  LIVE DEVICE
87//**************************************************************************
88
89//-------------------------------------------------
90//  x1_010_device - constructor
91//-------------------------------------------------
92
93x1_010_device::x1_010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
94   : device_t(mconfig, X1_010, "X1-010", tag, owner, clock),
95     device_sound_interface(mconfig, *this),
96     m_rate(0),
97     m_stream(NULL),
98     m_address(0),
99     m_region(NULL),
100     m_sound_enable(0),
101     m_base_clock(0)
81102{
82   /* Variables only used here */
83   int rate;                               // Output sampling rate (Hz)
84   sound_stream *  stream;                 // Stream handle
85   int address;                            // address eor data
86   const UINT8 *region;                    // region name
87   int sound_enable;                       // sound output enable/disable
88   UINT8   reg[0x2000];                // X1-010 Register & wave form area
89   UINT8   HI_WORD_BUF[0x2000];            // X1-010 16bit access ram check avoidance work
90   UINT32  smp_offset[SETA_NUM_CHANNELS];
91   UINT32  env_offset[SETA_NUM_CHANNELS];
103}
92104
93   UINT32 base_clock;
94};
95105
96/* mixer tables and internal buffers */
97//static short  *mixer_buffer = NULL;
106//-------------------------------------------------
107//  device_start - device-specific startup
108//-------------------------------------------------
98109
99INLINE x1_010_state *get_safe_token(device_t *device)
110void x1_010_device::device_start()
100111{
101   assert(device != NULL);
102   assert(device->type() == X1_010);
103   return (x1_010_state *)downcast<x1_010_device *>(device)->token();
112   int i;
113   const x1_010_interface *intf = (const x1_010_interface *)static_config();
114
115   m_region        = *region();
116   m_base_clock    = clock();
117   m_rate          = clock() / 1024;
118   m_address       = intf->adr;
119
120   for( i = 0; i < SETA_NUM_CHANNELS; i++ ) {
121      m_smp_offset[i] = 0;
122      m_env_offset[i] = 0;
123   }
124   /* Print some more debug info */
125   LOG_SOUND(("masterclock = %d rate = %d\n", clock(), m_rate ));
126
127   /* get stream channels */
128   m_stream = stream_alloc(0, 2, m_rate);
104129}
105130
106131
107/*--------------------------------------------------------------
108 generate sound to the mix buffer
109--------------------------------------------------------------*/
110static STREAM_UPDATE( seta_update )
132//-------------------------------------------------
133//  sound_stream_update - handle a stream update
134//-------------------------------------------------
135
136void x1_010_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
111137{
112   x1_010_state *info = (x1_010_state *)param;
113138   X1_010_CHANNEL  *reg;
114139   int     ch, i, volL, volR, freq;
115140   register INT8   *start, *end, data;
116141   register UINT8  *env;
117142   register UINT32 smp_offs, smp_step, env_offs, env_step, delta;
118   const UINT8 *snd1 = info->region;
143   const UINT8 *snd1 = m_region;
119144
120145   // mixer buffer zero clear
121146   memset( outputs[0], 0, samples*sizeof(*outputs[0]) );
122147   memset( outputs[1], 0, samples*sizeof(*outputs[1]) );
123148
124//  if( info->sound_enable == 0 ) return;
149//  if( m_sound_enable == 0 ) return;
125150
126151   for( ch = 0; ch < SETA_NUM_CHANNELS; ch++ ) {
127      reg = (X1_010_CHANNEL *)&(info->reg[ch*sizeof(X1_010_CHANNEL)]);
152      reg = (X1_010_CHANNEL *)&(m_reg[ch*sizeof(X1_010_CHANNEL)]);
128153      if( (reg->status&1) != 0 ) {                            // Key On
129154         stream_sample_t *bufL = outputs[0];
130155         stream_sample_t *bufR = outputs[1];
r20674r20675
133158            end      = (INT8 *)((0x100-reg->end)*0x1000+snd1);
134159            volL     = ((reg->volume>>4)&0xf)*VOL_BASE;
135160            volR     = ((reg->volume>>0)&0xf)*VOL_BASE;
136            smp_offs = info->smp_offset[ch];
161            smp_offs = m_smp_offset[ch];
137162            freq     = reg->frequency&0x1f;
138163            // Meta Fox does not write the frequency register. Ever
139164            if( freq == 0 ) freq = 4;
140            smp_step = (UINT32)((float)info->base_clock/8192.0
141                     *freq*(1<<FREQ_BASE_BITS)/(float)info->rate);
165            smp_step = (UINT32)((float)m_base_clock/8192.0
166                     *freq*(1<<FREQ_BASE_BITS)/(float)m_rate);
142167            if( smp_offs == 0 ) {
143168               LOG_SOUND(( "Play sample %p - %p, channel %X volume %d:%d freq %X step %X offset %X\n",
144169                  start, end, ch, volL, volR, freq, smp_step, smp_offs ));
r20674r20675
155180               *bufR++ += (data*volR/256);
156181               smp_offs += smp_step;
157182            }
158            info->smp_offset[ch] = smp_offs;
183            m_smp_offset[ch] = smp_offs;
159184         } else {                                            // Wave form
160            start    = (INT8 *)&(info->reg[reg->volume*128+0x1000]);
161            smp_offs = info->smp_offset[ch];
185            start    = (INT8 *)&(m_reg[reg->volume*128+0x1000]);
186            smp_offs = m_smp_offset[ch];
162187            freq     = (reg->pitch_hi<<8)+reg->frequency;
163            smp_step = (UINT32)((float)info->base_clock/128.0/1024.0/4.0*freq*(1<<FREQ_BASE_BITS)/(float)info->rate);
188            smp_step = (UINT32)((float)m_base_clock/128.0/1024.0/4.0*freq*(1<<FREQ_BASE_BITS)/(float)m_rate);
164189
165            env      = (UINT8 *)&(info->reg[reg->end*128]);
166            env_offs = info->env_offset[ch];
167            env_step = (UINT32)((float)info->base_clock/128.0/1024.0/4.0*reg->start*(1<<ENV_BASE_BITS)/(float)info->rate);
190            env      = (UINT8 *)&(m_reg[reg->end*128]);
191            env_offs = m_env_offset[ch];
192            env_step = (UINT32)((float)m_base_clock/128.0/1024.0/4.0*reg->start*(1<<ENV_BASE_BITS)/(float)m_rate);
168193            /* Print some more debug info */
169194            if( smp_offs == 0 ) {
170195               LOG_SOUND(( "Play waveform %X, channel %X volume %X freq %4X step %X offset %X\n",
r20674r20675
187212               smp_offs += smp_step;
188213               env_offs += env_step;
189214            }
190            info->smp_offset[ch] = smp_offs;
191            info->env_offset[ch] = env_offs;
215            m_smp_offset[ch] = smp_offs;
216            m_env_offset[ch] = env_offs;
192217         }
193218      }
194219   }
195220}
196221
197222
198
199static DEVICE_START( x1_010 )
223void x1_010_device::seta_sound_enable_w(int data)
200224{
201   int i;
202   const x1_010_interface *intf = (const x1_010_interface *)device->static_config();
203   x1_010_state *info = get_safe_token(device);
204
205   info->region        = *device->region();
206   info->base_clock    = device->clock();
207   info->rate          = device->clock() / 1024;
208   info->address       = intf->adr;
209
210   for( i = 0; i < SETA_NUM_CHANNELS; i++ ) {
211      info->smp_offset[i] = 0;
212      info->env_offset[i] = 0;
213   }
214   /* Print some more debug info */
215   LOG_SOUND(("masterclock = %d rate = %d\n", device->clock(), info->rate ));
216
217   /* get stream channels */
218   info->stream = device->machine().sound().stream_alloc(*device,0,2,info->rate,info,seta_update);
225   m_sound_enable = data;
219226}
220227
221228
222void seta_sound_enable_w(device_t *device, int data)
229//
230// Use these for 8 bit CPUs
231//
232READ8_MEMBER( x1_010_device::seta_sound_r )
223233{
224   x1_010_state *info = get_safe_token(device);
225   info->sound_enable = data;
234   offset ^= m_address;
235   return m_reg[offset];
226236}
227237
228238
229
230/* Use these for 8 bit CPUs */
231
232
233READ8_DEVICE_HANDLER( seta_sound_r )
239WRITE8_MEMBER( x1_010_device::seta_sound_w )
234240{
235   x1_010_state *info = get_safe_token(device);
236   offset ^= info->address;
237   return info->reg[offset];
238}
239
240
241
242
243WRITE8_DEVICE_HANDLER( seta_sound_w )
244{
245   x1_010_state *info = get_safe_token(device);
246241   int channel, reg;
247   offset ^= info->address;
242   offset ^= m_address;
248243
249244   channel = offset/sizeof(X1_010_CHANNEL);
250245   reg     = offset%sizeof(X1_010_CHANNEL);
251246
252247   if( channel < SETA_NUM_CHANNELS && reg == 0
253      && (info->reg[offset]&1) == 0 && (data&1) != 0 ) {
254      info->smp_offset[channel] = 0;
255      info->env_offset[channel] = 0;
248      && (m_reg[offset]&1) == 0 && (data&1) != 0 ) {
249      m_smp_offset[channel] = 0;
250      m_env_offset[channel] = 0;
256251   }
257   LOG_REGISTER_WRITE(("%s: offset %6X : data %2X\n", device->machine().describe_context(), offset, data ));
258   info->reg[offset] = data;
252   LOG_REGISTER_WRITE(("%s: offset %6X : data %2X\n", machine().describe_context(), offset, data ));
253   m_reg[offset] = data;
259254}
260255
261256
262
263
264/* Use these for 16 bit CPUs */
265
266READ16_DEVICE_HANDLER( seta_sound_word_r )
257//
258// Use these for 16 bit CPUs
259//
260READ16_MEMBER( x1_010_device::seta_sound_word_r )
267261{
268   x1_010_state *info = get_safe_token(device);
269262   UINT16  ret;
270
271   ret = info->HI_WORD_BUF[offset]<<8;
272   ret += (seta_sound_r( device, space, offset )&0xff);
273   LOG_REGISTER_READ(( "%s: Read X1-010 Offset:%04X Data:%04X\n", device->machine().describe_context(), offset, ret ));
263   ret = m_HI_WORD_BUF[offset]<<8;
264   ret += (seta_sound_r( space, offset )&0xff);
265   LOG_REGISTER_READ(( "%s: Read X1-010 Offset:%04X Data:%04X\n", machine().describe_context(), offset, ret ));
274266   return ret;
275267}
276268
277WRITE16_DEVICE_HANDLER( seta_sound_word_w )
269WRITE16_MEMBER( x1_010_device::seta_sound_word_w )
278270{
279   x1_010_state *info = get_safe_token(device);
280   info->HI_WORD_BUF[offset] = (data>>8)&0xff;
281   seta_sound_w( device, space, offset, data&0xff );
282   LOG_REGISTER_WRITE(( "%s: Write X1-010 Offset:%04X Data:%04X\n", device->machine().describe_context(), offset, data ));
271   m_HI_WORD_BUF[offset] = (data>>8)&0xff;
272   seta_sound_w( space, offset, data&0xff );
273   LOG_REGISTER_WRITE(( "%s: Write X1-010 Offset:%04X Data:%04X\n", machine().describe_context(), offset, data ));
283274}
284
285
286const device_type X1_010 = &device_creator<x1_010_device>;
287
288x1_010_device::x1_010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
289   : device_t(mconfig, X1_010, "X1-010", tag, owner, clock),
290      device_sound_interface(mconfig, *this)
291{
292   m_token = global_alloc_clear(x1_010_state);
293}
294
295//-------------------------------------------------
296//  device_config_complete - perform any
297//  operations now that the configuration is
298//  complete
299//-------------------------------------------------
300
301void x1_010_device::device_config_complete()
302{
303}
304
305//-------------------------------------------------
306//  device_start - device-specific startup
307//-------------------------------------------------
308
309void x1_010_device::device_start()
310{
311   DEVICE_START_NAME( x1_010 )(this);
312}
313
314//-------------------------------------------------
315//  sound_stream_update - handle a stream update
316//-------------------------------------------------
317
318void x1_010_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
319{
320   // should never get here
321   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
322}
trunk/src/emu/sound/x1_010.h
r20674r20675
33#ifndef __X1_010_H__
44#define __X1_010_H__
55
6#include "devlegcy.h"
6#define SETA_NUM_CHANNELS 16
77
88
9//**************************************************************************
10//  INTERFACE CONFIGURATION MACROS
11//**************************************************************************
12
13#define MCFG_X1_010_ADD(_tag, _clock) \
14   MCFG_DEVICE_ADD(_tag, X1_010, _clock)
15#define MCFG_X1_010_REPLACE(_tag, _clock) \
16   MCFG_DEVICE_REPLACE(_tag, X1_010, _clock)
17
18
19//**************************************************************************
20//  TYPE DEFINITIONS
21//**************************************************************************
22
923struct x1_010_interface
1024{
1125   int adr;    /* address */
1226};
1327
1428
15DECLARE_READ8_DEVICE_HANDLER ( seta_sound_r );
16DECLARE_WRITE8_DEVICE_HANDLER( seta_sound_w );
29// ======================> x1_010_device
1730
18DECLARE_READ16_DEVICE_HANDLER ( seta_sound_word_r );
19DECLARE_WRITE16_DEVICE_HANDLER( seta_sound_word_w );
20
21void seta_sound_enable_w(device_t *device, int data);
22
2331class x1_010_device : public device_t,
24                           public device_sound_interface
32                 public device_sound_interface
2533{
2634public:
2735   x1_010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
28   ~x1_010_device() { global_free(m_token); }
36   ~x1_010_device() { }
2937
30   // access to legacy token
31   void *token() const { assert(m_token != NULL); return m_token; }
38    void seta_sound_enable_w(int data);
39
3240protected:
3341   // device-level overrides
34   virtual void device_config_complete();
3542   virtual void device_start();
3643
3744   // sound stream update overrides
3845   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
46
47public:
48   DECLARE_READ8_MEMBER( seta_sound_r );
49   DECLARE_WRITE8_MEMBER( seta_sound_w );
50
51   DECLARE_READ16_MEMBER( seta_sound_word_r );
52   DECLARE_WRITE16_MEMBER( seta_sound_word_w );
53
3954private:
40   // internal state
41   void *m_token;
55   int m_rate;                               // Output sampling rate (Hz)
56   sound_stream *m_stream;                   // Stream handle
57   int m_address;                            // address eor data
58   const UINT8 *m_region;                    // region name
59   int m_sound_enable;                       // sound output enable/disable
60   UINT8   m_reg[0x2000];                    // X1-010 Register & wave form area
61   UINT8   m_HI_WORD_BUF[0x2000];            // X1-010 16bit access ram check avoidance work
62   UINT32  m_smp_offset[SETA_NUM_CHANNELS];
63   UINT32  m_env_offset[SETA_NUM_CHANNELS];
64
65   UINT32 m_base_clock;
4266};
4367
4468extern const device_type X1_010;
trunk/src/emu/sound/n63701x.c
r20674r20675
1717#include "n63701x.h"
1818
1919
20struct voice
21{
22   int select;
23   int playing;
24   int base_addr;
25   int position;
26   int volume;
27   int silence_counter;
28};
29
30
31struct namco_63701x
32{
33   voice voices[2];
34   sound_stream * stream;      /* channel assigned by the mixer */
35   UINT8 *rom;     /* pointer to sample ROM */
36};
37
38
3920/* volume control has three resistors: 22000, 10000 and 3300 Ohm.
4021   22000 is always enabled, the other two can be turned off.
4122   Since 0x00 and 0xff samples have special meaning, the available range is
r20674r20675
4324   inside 16 bits without overflowing.
4425 */
4526static const int vol_table[4] = { 26, 84, 200, 258 };
27 
4628
29// device type definition
30const device_type NAMCO_63701X = &device_creator<namco_63701x_device>;
4731
48INLINE namco_63701x *get_safe_token(device_t *device)
32namco_63701x_device::namco_63701x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
33   : device_t(mconfig, NAMCO_63701X, "Namco 63701X", tag, owner, clock),
34     device_sound_interface(mconfig, *this),
35     m_stream(NULL),
36     m_rom(NULL)
4937{
50   assert(device != NULL);
51   assert(device->type() == NAMCO_63701X);
52   return (namco_63701x *)downcast<namco_63701x_device *>(device)->token();
5338}
5439
5540
56static STREAM_UPDATE( namco_63701x_update )
41//-------------------------------------------------
42//  device_start - device-specific startup
43//-------------------------------------------------
44
45void namco_63701x_device::device_start()
5746{
58   namco_63701x *chip = (namco_63701x *)param;
47   m_rom = *region();
48   m_stream = stream_alloc(0, 2, clock()/1000);
49}
50
51
52//-------------------------------------------------
53//  sound_stream_update - handle a stream update
54//-------------------------------------------------
55
56void namco_63701x_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
57{
5958   int ch;
6059
6160   for (ch = 0;ch < 2;ch++)
6261   {
6362      stream_sample_t *buf = outputs[ch];
64      voice *v = &chip->voices[ch];
63      voice_63701x *v = &m_voices[ch];
6564
6665      if (v->playing)
6766      {
68         UINT8 *base = chip->rom + v->base_addr;
67         UINT8 *base = m_rom + v->base_addr;
6968         int pos = v->position;
7069         int vol = vol_table[v->volume];
7170         int p;
r20674r20675
107106}
108107
109108
110static DEVICE_START( namco_63701x )
111{
112   namco_63701x *chip = get_safe_token(device);
113109
114   chip->rom = *device->region();
115
116   chip->stream = device->machine().sound().stream_alloc(*device, 0, 2, device->clock()/1000, chip, namco_63701x_update);
117}
118
119
120
121WRITE8_DEVICE_HANDLER( namco_63701x_w )
110WRITE8_MEMBER( namco_63701x_device::namco_63701x_w )
122111{
123   namco_63701x *chip = get_safe_token(device);
124112   int ch = offset / 2;
125113
126114   if (offset & 1)
127      chip->voices[ch].select = data;
115      m_voices[ch].select = data;
128116   else
129117   {
130118      /*
r20674r20675
133121        after the continue counter reaches 0. Either we shouldn't stop
134122        the sample, or genpeitd is returning to the title screen too soon.
135123       */
136      if (chip->voices[ch].select & 0x1f)
124      if (m_voices[ch].select & 0x1f)
137125      {
138126         int rom_offs;
139127
140128         /* update the streams */
141         chip->stream->update();
129         m_stream->update();
142130
143         chip->voices[ch].playing = 1;
144         chip->voices[ch].base_addr = 0x10000 * ((chip->voices[ch].select & 0xe0) >> 5);
145         rom_offs = chip->voices[ch].base_addr + 2 * ((chip->voices[ch].select & 0x1f) - 1);
146         chip->voices[ch].position = (chip->rom[rom_offs] << 8) + chip->rom[rom_offs+1];
131         m_voices[ch].playing = 1;
132         m_voices[ch].base_addr = 0x10000 * ((m_voices[ch].select & 0xe0) >> 5);
133         rom_offs = m_voices[ch].base_addr + 2 * ((m_voices[ch].select & 0x1f) - 1);
134         m_voices[ch].position = (m_rom[rom_offs] << 8) + m_rom[rom_offs+1];
147135         /* bits 6-7 = volume */
148         chip->voices[ch].volume = data >> 6;
136         m_voices[ch].volume = data >> 6;
149137         /* bits 0-5 = counter to indicate new sample start? we don't use them */
150138
151         chip->voices[ch].silence_counter = 0;
139         m_voices[ch].silence_counter = 0;
152140      }
153141   }
154142}
155143
156const device_type NAMCO_63701X = &device_creator<namco_63701x_device>;
157
158namco_63701x_device::namco_63701x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
159   : device_t(mconfig, NAMCO_63701X, "Namco 63701X", tag, owner, clock),
160      device_sound_interface(mconfig, *this)
161{
162   m_token = global_alloc_clear(namco_63701x);
163}
164
165//-------------------------------------------------
166//  device_config_complete - perform any
167//  operations now that the configuration is
168//  complete
169//-------------------------------------------------
170
171void namco_63701x_device::device_config_complete()
172{
173}
174
175//-------------------------------------------------
176//  device_start - device-specific startup
177//-------------------------------------------------
178
179void namco_63701x_device::device_start()
180{
181   DEVICE_START_NAME( namco_63701x )(this);
182}
183
184//-------------------------------------------------
185//  sound_stream_update - handle a stream update
186//-------------------------------------------------
187
188void namco_63701x_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
189{
190   // should never get here
191   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
192}
trunk/src/emu/sound/digitalk.c
r20674r20675
236236
237237*/
238238
239
240struct digitalker {
241   const UINT8 *rom;
242   device_t *device;
243   sound_stream *stream;
244
245   // Port/lines state
246   UINT8 data, cs, cms, wr, intr;
247
248   // Current decoding state
249   UINT16 bpos, apos;
250   UINT8 mode, cur_segment, cur_repeat, segments, repeats;
251   UINT8 prev_pitch, pitch, pitch_pos;
252   UINT8 stop_after, cur_dac, cur_bits;
253
254   // Zero-range size
255   UINT32 zero_count; // 0 for done
256
257   // Waveform and current index in it
258   UINT8 dac_index; // 128 for done
259   INT16 dac[128];
260
261};
262
263239// Quantized intensity values, first index is the volume, second the
264240// intensity (positive half only, real value goes -8..7)
265241static const short pcm_levels[8][8] = {
r20674r20675
277253static const int delta2[16] = { 0, -1, -2, -3, 1, 0, -1, -2, 2, 1, 0, -1, 3, 2, 1, 0 };
278254
279255// Frequency quantizations, values are in units of 128us.
280
281256static const int pitch_vals[32] = {
282257   97, 95, 92, 89, 87, 84, 82, 80, 77, 75, 73, 71, 69, 67, 65, 63,
283258   61, 60, 58, 56, 55, 53, 52, 50, 49, 48, 46, 45, 43, 42, 41, 40
284259};
285260
286261
287INLINE digitalker *get_safe_token(device_t *device)
262const device_type DIGITALKER = &device_creator<digitalker_device>;
263
264digitalker_device::digitalker_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
265   : device_t(mconfig, DIGITALKER, "Digitalker", tag, owner, clock),
266     device_sound_interface(mconfig, *this),
267     m_rom(NULL),
268     m_stream(NULL),
269     m_data(0),
270     m_cs(0),
271     m_cms(0),
272     m_wr(0),
273     m_intr(0),
274     m_bpos(0),
275     m_apos(0),
276     m_mode(0),
277     m_cur_segment(0),
278     m_cur_repeat(0),
279     m_segments(0),
280     m_repeats(0),
281     m_prev_pitch(0),
282     m_pitch(0),
283     m_pitch_pos(0),
284     m_stop_after(0),
285     m_cur_dac(0),
286     m_cur_bits(0),
287     m_zero_count(0),
288     m_dac_index(0)
288289{
289   assert(device != NULL);
290   assert(device->type() == DIGITALKER);
291   return (digitalker *)downcast<digitalker_device *>(device)->token();
292290}
293291
294292
295static void digitalker_write(digitalker *dg, UINT8 *adr, UINT8 vol, INT8 dac)
293void digitalker_device::digitalker_write(UINT8 *adr, UINT8 vol, INT8 dac)
296294{
297295   INT16 v;
298296   dac &= 15;
r20674r20675
302300      v = pcm_levels[vol][dac-1];
303301   else
304302      v = 0;
305   dg->dac[(*adr)++] = v;
303   m_dac[(*adr)++] = v;
306304}
307305
308static UINT8 digitalker_pitch_next(UINT8 val, UINT8 prev, int step)
306UINT8 digitalker_device::digitalker_pitch_next(UINT8 val, UINT8 prev, int step)
309307{
310308   int delta, nv;
311309
r20674r20675
323321   return nv;
324322}
325323
326static void digitalker_set_intr(digitalker *dg, UINT8 intr)
324void digitalker_device::digitalker_set_intr(UINT8 intr)
327325{
328   dg->intr = intr;
326   m_intr = intr;
329327}
330328
331static void digitalker_start_command(digitalker *dg, UINT8 cmd)
329void digitalker_device::digitalker_start_command(UINT8 cmd)
332330{
333   dg->bpos = ((dg->rom[cmd*2] << 8) | dg->rom[cmd*2+1]) & 0x3fff;
334   dg->cur_segment = dg->segments = dg->cur_repeat = dg->repeats = 0;
335   dg->dac_index = 128;
336   dg->zero_count = 0;
337   digitalker_set_intr(dg, 0);
331   m_bpos = ((m_rom[cmd*2] << 8) | m_rom[cmd*2+1]) & 0x3fff;
332   m_cur_segment = m_segments = m_cur_repeat = m_repeats = 0;
333   m_dac_index = 128;
334   m_zero_count = 0;
335   digitalker_set_intr(0);
338336}
339337
340static void digitalker_step_mode_0(digitalker *dg)
338void digitalker_device::digitalker_step_mode_0()
341339{
342340   INT8 dac = 0;
343341   int i, k, l;
344342   UINT8 wpos = 0;
345   UINT8 h = dg->rom[dg->apos];
343   UINT8 h = m_rom[m_apos];
346344   UINT16 bits = 0x80;
347345   UINT8 vol = h >> 5;
348   UINT8 pitch_id = dg->cur_segment ? digitalker_pitch_next(h, dg->prev_pitch, dg->cur_repeat) : h & 0x1f;
346   UINT8 pitch_id = m_cur_segment ? digitalker_pitch_next(h, m_prev_pitch, m_cur_repeat) : h & 0x1f;
349347
350   dg->pitch = pitch_vals[pitch_id];
348   m_pitch = pitch_vals[pitch_id];
351349
352350   for(i=0; i<32; i++)
353      dg->dac[wpos++] = 0;
351      m_dac[wpos++] = 0;
354352
355353   for(k=1; k != 9; k++) {
356      bits |= dg->rom[dg->apos+k] << 8;
354      bits |= m_rom[m_apos+k] << 8;
357355      for(l=0; l<4; l++) {
358356         dac += delta1[(bits >> (6+2*l)) & 15];
359         digitalker_write(dg, &wpos, vol, dac);
357         digitalker_write(&wpos, vol, dac);
360358      }
361359      bits >>= 8;
362360   }
363361
364   digitalker_write(dg, &wpos, vol, dac);
362   digitalker_write(&wpos, vol, dac);
365363
366364   for(k=7; k >= 0; k--) {
367      bits = (bits << 8) | (k ? dg->rom[dg->apos+k] : 0x80);
365      bits = (bits << 8) | (k ? m_rom[m_apos+k] : 0x80);
368366      for(l=3; l>=0; l--) {
369367         dac -= delta1[(bits >> (6+2*l)) & 15];
370         digitalker_write(dg, &wpos, vol, dac);
368         digitalker_write(&wpos, vol, dac);
371369      }
372370   }
373371
374372   for(i=0; i<31; i++)
375      dg->dac[wpos++] = 0;
373      m_dac[wpos++] = 0;
376374
377   dg->cur_repeat++;
378   if(dg->cur_repeat == dg->repeats) {
379      dg->apos += 9;
380      dg->prev_pitch = pitch_id;
381      dg->cur_repeat = 0;
382      dg->cur_segment++;
375   m_cur_repeat++;
376   if(m_cur_repeat == m_repeats) {
377      m_apos += 9;
378      m_prev_pitch = pitch_id;
379      m_cur_repeat = 0;
380      m_cur_segment++;
383381   }
384382}
385383
386static void digitalker_step_mode_1(digitalker *dg)
384void digitalker_device::digitalker_step_mode_1()
387385{
388386   logerror("Digitalker mode 1 unsupported");
389   dg->zero_count = 1;
390   dg->cur_segment = dg->segments;
387   m_zero_count = 1;
388   m_cur_segment = m_segments;
391389}
392390
393static void digitalker_step_mode_2(digitalker *dg)
391void digitalker_device::digitalker_step_mode_2()
394392{
395393   INT8 dac = 0;
396394   int k, l;
397395   UINT8 wpos=0;
398   UINT8 h = dg->rom[dg->apos];
396   UINT8 h = m_rom[m_apos];
399397   UINT16 bits = 0x80;
400398   UINT8 vol = h >> 5;
401   UINT8 pitch_id = dg->cur_segment ? digitalker_pitch_next(h, dg->prev_pitch, dg->cur_repeat) : h & 0x1f;
399   UINT8 pitch_id = m_cur_segment ? digitalker_pitch_next(h, m_prev_pitch, m_cur_repeat) : h & 0x1f;
402400
403   dg->pitch = pitch_vals[pitch_id];
401   m_pitch = pitch_vals[pitch_id];
404402
405403   for(k=1; k != 9; k++) {
406      bits |= dg->rom[dg->apos+k] << 8;
404      bits |= m_rom[m_apos+k] << 8;
407405      for(l=0; l<4; l++) {
408406         dac += delta1[(bits >> (6+2*l)) & 15];
409         digitalker_write(dg, &wpos, vol, dac);
407         digitalker_write(&wpos, vol, dac);
410408      }
411409      bits >>= 8;
412410   }
413411
414   digitalker_write(dg, &wpos, vol, dac);
412   digitalker_write(&wpos, vol, dac);
415413
416414   for(k=7; k >= 0; k--) {
417415      int limit = k ? 0 : 1;
418      bits = (bits << 8) | (k ? dg->rom[dg->apos+k] : 0x80);
416      bits = (bits << 8) | (k ? m_rom[m_apos+k] : 0x80);
419417      for(l=3; l>=limit; l--) {
420418         dac -= delta1[(bits >> (6+2*l)) & 15];
421         digitalker_write(dg, &wpos, vol, dac);
419         digitalker_write(&wpos, vol, dac);
422420      }
423421   }
424422
425   digitalker_write(dg, &wpos, vol, dac);
423   digitalker_write(&wpos, vol, dac);
426424
427425   for(k=1; k != 9; k++) {
428426      int start = k == 1 ? 1 : 0;
429      bits |= dg->rom[dg->apos+k] << 8;
427      bits |= m_rom[m_apos+k] << 8;
430428      for(l=start; l<4; l++) {
431429         dac += delta1[(bits >> (6+2*l)) & 15];
432         digitalker_write(dg, &wpos, vol, dac);
430         digitalker_write(&wpos, vol, dac);
433431      }
434432      bits >>= 8;
435433   }
436434
437   digitalker_write(dg, &wpos, vol, dac);
435   digitalker_write(&wpos, vol, dac);
438436
439437   for(k=7; k >= 0; k--) {
440438      int limit = k ? 0 : 1;
441      bits = (bits << 8) | (k ? dg->rom[dg->apos+k] : 0x80);
439      bits = (bits << 8) | (k ? m_rom[m_apos+k] : 0x80);
442440      for(l=3; l>=limit; l--) {
443441         dac -= delta1[(bits >> (6+2*l)) & 15];
444         digitalker_write(dg, &wpos, vol, dac);
442         digitalker_write(&wpos, vol, dac);
445443      }
446444   }
447445
448   dg->cur_repeat++;
449   if(dg->cur_repeat == dg->repeats) {
450      dg->apos += 9;
451      dg->prev_pitch = pitch_id;
452      dg->cur_repeat = 0;
453      dg->cur_segment++;
446   m_cur_repeat++;
447   if(m_cur_repeat == m_repeats) {
448      m_apos += 9;
449      m_prev_pitch = pitch_id;
450      m_cur_repeat = 0;
451      m_cur_segment++;
454452   }
455453}
456454
457static void digitalker_step_mode_3(digitalker *dg)
455void digitalker_device::digitalker_step_mode_3()
458456{
459   UINT8 h = dg->rom[dg->apos];
457   UINT8 h = m_rom[m_apos];
460458   UINT8 vol = h >> 5;
461459   UINT16 bits;
462460   UINT8 dac, apos, wpos;
463461   int k, l;
464462
465   dg->pitch = pitch_vals[h & 0x1f];
466   if(dg->cur_segment == 0 && dg->cur_repeat == 0) {
467      dg->cur_bits = 0x40;
468      dg->cur_dac = 0;
463   m_pitch = pitch_vals[h & 0x1f];
464   if(m_cur_segment == 0 && m_cur_repeat == 0) {
465      m_cur_bits = 0x40;
466      m_cur_dac = 0;
469467   }
470   bits = dg->cur_bits;
468   bits = m_cur_bits;
471469   dac = 0;
472470
473   apos = dg->apos + 1 + 32*dg->cur_segment;
471   apos = m_apos + 1 + 32*m_cur_segment;
474472   wpos = 0;
475473   for(k=0; k != 32; k++) {
476      bits |= dg->rom[apos++] << 8;
474      bits |= m_rom[apos++] << 8;
477475      for(l=0; l<4; l++) {
478476         dac += delta2[(bits >> (6+2*l)) & 15];
479         digitalker_write(dg, &wpos, vol, dac);
477         digitalker_write(&wpos, vol, dac);
480478      }
481479      bits >>= 8;
482480   }
483481
484   dg->cur_bits = bits;
485   dg->cur_dac = dac;
482   m_cur_bits = bits;
483   m_cur_dac = dac;
486484
487   dg->cur_segment++;
488   if(dg->cur_segment == dg->segments) {
489      dg->cur_segment = 0;
490      dg->cur_repeat++;
485   m_cur_segment++;
486   if(m_cur_segment == m_segments) {
487      m_cur_segment = 0;
488      m_cur_repeat++;
491489   }
492490}
493491
494static void digitalker_step(digitalker *dg)
492void digitalker_device::digitalker_step()
495493{
496   if(dg->cur_segment == dg->segments || dg->cur_repeat == dg->repeats) {
497      if(dg->stop_after == 0 && dg->bpos == 0xffff)
494   if(m_cur_segment == m_segments || m_cur_repeat == m_repeats) {
495      if(m_stop_after == 0 && m_bpos == 0xffff)
498496         return;
499      if(dg->stop_after == 0) {
500         UINT8 v1 = dg->rom[dg->bpos++];
501         UINT8 v2 = dg->rom[dg->bpos++];
502         UINT8 v3 = dg->rom[dg->bpos++];
503         dg->apos = v2 | ((v3 << 8) & 0x3f00);
504         dg->segments = (v1 & 15) + 1;
505         dg->repeats = ((v1 >> 4) & 7) + 1;
506         dg->mode = (v3 >> 6) & 3;
507         dg->stop_after = (v1 & 0x80) != 0;
497      if(m_stop_after == 0) {
498         UINT8 v1 = m_rom[m_bpos++];
499         UINT8 v2 = m_rom[m_bpos++];
500         UINT8 v3 = m_rom[m_bpos++];
501         m_apos = v2 | ((v3 << 8) & 0x3f00);
502         m_segments = (v1 & 15) + 1;
503         m_repeats = ((v1 >> 4) & 7) + 1;
504         m_mode = (v3 >> 6) & 3;
505         m_stop_after = (v1 & 0x80) != 0;
508506
509         dg->cur_segment = 0;
510         dg->cur_repeat = 0;
507         m_cur_segment = 0;
508         m_cur_repeat = 0;
511509
512         if(!dg->apos) {
513            dg->zero_count = 40*128*dg->segments*dg->repeats;
514            dg->segments = 0;
515            dg->repeats = 0;
510         if(!m_apos) {
511            m_zero_count = 40*128*m_segments*m_repeats;
512            m_segments = 0;
513            m_repeats = 0;
516514            return;
517515         }
518      } else if(dg->stop_after == 1) {
519         dg->bpos = 0xffff;
520         dg->zero_count = 81920;
521         dg->stop_after = 2;
522         dg->cur_segment = 0;
523         dg->cur_repeat = 0;
524         dg->segments = 0;
525         dg->repeats = 0;
516      } else if(m_stop_after == 1) {
517         m_bpos = 0xffff;
518         m_zero_count = 81920;
519         m_stop_after = 2;
520         m_cur_segment = 0;
521         m_cur_repeat = 0;
522         m_segments = 0;
523         m_repeats = 0;
526524      } else {
527         dg->stop_after = 0;
528         digitalker_set_intr(dg, 1);
525         m_stop_after = 0;
526         digitalker_set_intr(1);
529527      }
530528   }
531529
532   switch(dg->mode) {
533   case 0: digitalker_step_mode_0(dg); break;
534   case 1: digitalker_step_mode_1(dg); break;
535   case 2: digitalker_step_mode_2(dg); break;
536   case 3: digitalker_step_mode_3(dg); break;
530   switch(m_mode) {
531   case 0: digitalker_step_mode_0(); break;
532   case 1: digitalker_step_mode_1(); break;
533   case 2: digitalker_step_mode_2(); break;
534   case 3: digitalker_step_mode_3(); break;
537535   }
538   if(!dg->zero_count)
539      dg->dac_index = 0;
536   if(!m_zero_count)
537      m_dac_index = 0;
540538}
541539
542static STREAM_UPDATE(digitalker_update)
540
541//-------------------------------------------------
542//  sound_stream_update - handle a stream update
543//-------------------------------------------------
544
545void digitalker_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
543546{
544   digitalker *dg = (digitalker *)param;
545547   stream_sample_t *sout = outputs[0];
546548   int cpos = 0;
547549   while(cpos != samples) {
548      if(dg->zero_count == 0 && dg->dac_index == 128)
549         digitalker_step(dg);
550      if(m_zero_count == 0 && m_dac_index == 128)
551         digitalker_step();
550552
551      if(dg->zero_count) {
553      if(m_zero_count) {
552554         int n = samples - cpos;
553555         int i;
554         if(n > dg->zero_count)
555            n = dg->zero_count;
556         if(n > m_zero_count)
557            n = m_zero_count;
556558         for(i=0; i != n; i++)
557559            sout[cpos++] = 0;
558         dg->zero_count -= n;
560         m_zero_count -= n;
559561
560      } else if(dg->dac_index != 128) {
561         while(cpos != samples && dg->dac_index != 128) {
562            short v = dg->dac[dg->dac_index];
563            int pp = dg->pitch_pos;
564            while(cpos != samples && pp != dg->pitch) {
562      } else if(m_dac_index != 128) {
563         while(cpos != samples && m_dac_index != 128) {
564            short v = m_dac[m_dac_index];
565            int pp = m_pitch_pos;
566            while(cpos != samples && pp != m_pitch) {
565567               sout[cpos++] = v;
566568               pp++;
567569            }
568            if(pp == dg->pitch) {
570            if(pp == m_pitch) {
569571               pp = 0;
570               dg->dac_index++;
572               m_dac_index++;
571573            }
572            dg->pitch_pos = pp;
574            m_pitch_pos = pp;
573575         }
574576
575577      } else {
r20674r20675
579581   }
580582}
581583
582static void digitalker_cs_w(digitalker *dg, int line)
584void digitalker_device::digitalker_cs_w(int line)
583585{
584586   UINT8 cs = line == ASSERT_LINE ? 1 : 0;
585   if(cs == dg->cs)
587   if(cs == m_cs)
586588      return;
587   dg->cs = cs;
589   m_cs = cs;
588590   if(cs)
589591      return;
590   if(!dg->wr) {
591      if(dg->cms)
592         digitalker_set_intr(dg, 1);
592   if(!m_wr) {
593      if(m_cms)
594         digitalker_set_intr(1);
593595      else
594         digitalker_start_command(dg, dg->data);
596         digitalker_start_command(m_data);
595597   }
596598}
597599
598static void digitalker_cms_w(digitalker *dg, int line)
600void digitalker_device::digitalker_cms_w(int line)
599601{
600   dg->cms = line == ASSERT_LINE ? 1 : 0;
602   m_cms = line == ASSERT_LINE ? 1 : 0;
601603}
602604
603static void digitalker_wr_w(digitalker *dg, int line)
605void digitalker_device::digitalker_wr_w(int line)
604606{
605607   UINT8 wr = line == ASSERT_LINE ? 1 : 0;
606   if(wr == dg->wr)
608   if(wr == m_wr)
607609      return;
608   dg->wr = wr;
609   if(wr || dg->cs)
610   m_wr = wr;
611   if(wr || m_cs)
610612      return;
611   if(dg->cms)
612      digitalker_set_intr(dg, 1);
613   if(m_cms)
614      digitalker_set_intr(1);
613615   else
614      digitalker_start_command(dg, dg->data);
616      digitalker_start_command(m_data);
615617}
616618
617static int digitalker_intr_r(digitalker *dg)
619int digitalker_device::digitalker_intr_r()
618620{
619   return dg->intr ? ASSERT_LINE : CLEAR_LINE;
621   return m_intr ? ASSERT_LINE : CLEAR_LINE;
620622}
621623
622static void digitalker_register_for_save(digitalker *dg)
624void digitalker_device::digitalker_register_for_save()
623625{
624   dg->device->save_item(NAME(dg->data));
625   dg->device->save_item(NAME(dg->cs));
626   dg->device->save_item(NAME(dg->cms));
627   dg->device->save_item(NAME(dg->wr));
628   dg->device->save_item(NAME(dg->intr));
629   dg->device->save_item(NAME(dg->bpos));
630   dg->device->save_item(NAME(dg->apos));
631   dg->device->save_item(NAME(dg->mode));
632   dg->device->save_item(NAME(dg->cur_segment));
633   dg->device->save_item(NAME(dg->cur_repeat));
634   dg->device->save_item(NAME(dg->segments));
635   dg->device->save_item(NAME(dg->repeats));
636   dg->device->save_item(NAME(dg->prev_pitch));
637   dg->device->save_item(NAME(dg->pitch));
638   dg->device->save_item(NAME(dg->pitch_pos));
639   dg->device->save_item(NAME(dg->stop_after));
640   dg->device->save_item(NAME(dg->cur_dac));
641   dg->device->save_item(NAME(dg->cur_bits));
642   dg->device->save_item(NAME(dg->zero_count));
643   dg->device->save_item(NAME(dg->dac_index));
644   dg->device->save_item(NAME(dg->dac));
626   save_item(NAME(m_data));
627   save_item(NAME(m_cs));
628   save_item(NAME(m_cms));
629   save_item(NAME(m_wr));
630   save_item(NAME(m_intr));
631   save_item(NAME(m_bpos));
632   save_item(NAME(m_apos));
633   save_item(NAME(m_mode));
634   save_item(NAME(m_cur_segment));
635   save_item(NAME(m_cur_repeat));
636   save_item(NAME(m_segments));
637   save_item(NAME(m_repeats));
638   save_item(NAME(m_prev_pitch));
639   save_item(NAME(m_pitch));
640   save_item(NAME(m_pitch_pos));
641   save_item(NAME(m_stop_after));
642   save_item(NAME(m_cur_dac));
643   save_item(NAME(m_cur_bits));
644   save_item(NAME(m_zero_count));
645   save_item(NAME(m_dac_index));
646   save_item(NAME(m_dac));
645647}
646648
647static DEVICE_START(digitalker)
648{
649   digitalker *dg = get_safe_token(device);
650   dg->device = device;
651   dg->rom = device->machine().root_device().memregion(device->tag())->base();
652   dg->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock()/4, dg, digitalker_update);
653   dg->dac_index = 128;
654   dg->data = 0xff;
655   dg->cs = dg->cms = dg->wr = 1;
656   dg->bpos = 0xffff;
657   digitalker_set_intr(dg, 1);
658649
659   digitalker_register_for_save(dg);
660}
650//-------------------------------------------------
651//  device_start - device-specific startup
652//-------------------------------------------------
661653
662void digitalker_0_cs_w(device_t *device, int line)
654void digitalker_device::device_start()
663655{
664   digitalker *dg = get_safe_token(device);
665   digitalker_cs_w(dg, line);
666}
656   m_rom = machine().root_device().memregion(tag())->base();
657   m_stream = stream_alloc(0, 1, clock()/4);
658   m_dac_index = 128;
659   m_data = 0xff;
660   m_cs = m_cms = m_wr = 1;
661   m_bpos = 0xffff;
662   digitalker_set_intr(1);
667663
668void digitalker_0_cms_w(device_t *device, int line)
669{
670   digitalker *dg = get_safe_token(device);
671   digitalker_cms_w(dg, line);
664   digitalker_register_for_save();
672665}
673666
674void digitalker_0_wr_w(device_t *device, int line)
667void digitalker_device::digitalker_0_cs_w(int line)
675668{
676   digitalker *dg = get_safe_token(device);
677   digitalker_wr_w(dg, line);
669   digitalker_cs_w(line);
678670}
679671
680int digitalker_0_intr_r(device_t *device)
672void digitalker_device::digitalker_0_cms_w(int line)
681673{
682   digitalker *dg = get_safe_token(device);
683   return digitalker_intr_r(dg);
674   digitalker_cms_w(line);
684675}
685676
686WRITE8_DEVICE_HANDLER( digitalker_data_w )
677void digitalker_device::digitalker_0_wr_w(int line)
687678{
688   digitalker *dg = get_safe_token(device);
689   dg->data = data;
679   digitalker_wr_w(line);
690680}
691681
692
693const device_type DIGITALKER = &device_creator<digitalker_device>;
694
695digitalker_device::digitalker_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
696   : device_t(mconfig, DIGITALKER, "Digitalker", tag, owner, clock),
697      device_sound_interface(mconfig, *this)
682int digitalker_device::digitalker_0_intr_r()
698683{
699   m_token = global_alloc_clear(digitalker);
684   return digitalker_intr_r();
700685}
701686
702//-------------------------------------------------
703//  device_config_complete - perform any
704//  operations now that the configuration is
705//  complete
706//-------------------------------------------------
707
708void digitalker_device::device_config_complete()
687WRITE8_MEMBER( digitalker_device::digitalker_data_w )
709688{
689   m_data = data;
710690}
711691
712//-------------------------------------------------
713//  device_start - device-specific startup
714//-------------------------------------------------
715
716void digitalker_device::device_start()
717{
718   DEVICE_START_NAME( digitalker )(this);
719}
720
721//-------------------------------------------------
722//  sound_stream_update - handle a stream update
723//-------------------------------------------------
724
725void digitalker_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
726{
727   // should never get here
728   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
729}
trunk/src/emu/sound/n63701x.h
r20674r20675
33#ifndef __N63701X_H__
44#define __N63701X_H__
55
6#include "devlegcy.h"
6//**************************************************************************
7//  INTERFACE CONFIGURATION MACROS
8//**************************************************************************
79
8DECLARE_WRITE8_DEVICE_HANDLER( namco_63701x_w );
10#define MCFG_NAMCO_63701X_ADD(_tag, _clock) \
11   MCFG_DEVICE_ADD(_tag, NAMCO_63701X, _clock)
12#define MCFG_NAMCO_63701X_REPLACE(_tag, _clock) \
13   MCFG_DEVICE_REPLACE(_tag, NAMCO_63701X, _clock)
914
15
16//**************************************************************************
17//  TYPE DEFINITIONS
18//**************************************************************************
19
20struct voice_63701x
21{
22   int select;
23   int playing;
24   int base_addr;
25   int position;
26   int volume;
27   int silence_counter;
28};
29
30
31// ======================> namco_63701x_device
32
1033class namco_63701x_device : public device_t,
11                           public device_sound_interface
34                     public device_sound_interface
1235{
1336public:
1437   namco_63701x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
15   ~namco_63701x_device() { global_free(m_token); }
38   ~namco_63701x_device() { }
1639
17   // access to legacy token
18   void *token() const { assert(m_token != NULL); return m_token; }
1940protected:
2041   // device-level overrides
21   virtual void device_config_complete();
2242   virtual void device_start();
2343
2444   // sound stream update overrides
2545   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
46
47public:
48   DECLARE_WRITE8_MEMBER(namco_63701x_w);
49
2650private:
27   // internal state
28   void *m_token;
51   voice_63701x m_voices[2];
52   sound_stream *m_stream; /* channel assigned by the mixer */
53   UINT8 *m_rom;         /* pointer to sample ROM */
2954};
3055
3156extern const device_type NAMCO_63701X;
trunk/src/emu/sound/digitalk.h
r20674r20675
11#ifndef _DIGITALKER_H_
22#define _DIGITALKER_H_
33
4#include "devlegcy.h"
54
6void digitalker_0_cs_w(device_t *device, int line);
7void digitalker_0_cms_w(device_t *device, int line);
8void digitalker_0_wr_w(device_t *device, int line);
9int digitalker_0_intr_r(device_t *device);
10DECLARE_WRITE8_DEVICE_HANDLER(digitalker_data_w);
5//**************************************************************************
6//  INTERFACE CONFIGURATION MACROS
7//**************************************************************************
118
9#define MCFG_DIGITALKER_ADD(_tag, _clock) \
10   MCFG_DEVICE_ADD(_tag, DIGITALKER, _clock)
11#define MCFG_DIGITALKER_REPLACE(_tag, _clock) \
12   MCFG_DEVICE_REPLACE(_tag, DIGITALKER, _clock)
13
14
15//**************************************************************************
16//  TYPE DEFINITIONS
17//**************************************************************************
18
19// ======================> digitalker_device
20
1221class digitalker_device : public device_t,
13                           public device_sound_interface
22                    public device_sound_interface
1423{
1524public:
1625   digitalker_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
17   ~digitalker_device() { global_free(m_token); }
26   ~digitalker_device() { }
1827
19   // access to legacy token
20   void *token() const { assert(m_token != NULL); return m_token; }
28   void digitalker_0_cs_w(int line);
29   void digitalker_0_cms_w(int line);
30   void digitalker_0_wr_w(int line);
31   int digitalker_0_intr_r();
32
2133protected:
2234   // device-level overrides
23   virtual void device_config_complete();
2435   virtual void device_start();
2536
2637   // sound stream update overrides
2738   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
39
40public:
41   DECLARE_WRITE8_MEMBER(digitalker_data_w);
42
2843private:
29   // internal state
30   void *m_token;
44   void digitalker_write(UINT8 *adr, UINT8 vol, INT8 dac);
45   UINT8 digitalker_pitch_next(UINT8 val, UINT8 prev, int step);
46   void digitalker_set_intr(UINT8 intr);
47   void digitalker_start_command(UINT8 cmd);
48   void digitalker_step_mode_0();
49   void digitalker_step_mode_1();
50   void digitalker_step_mode_2();
51   void digitalker_step_mode_3();
52   void digitalker_step();
53   void digitalker_cs_w(int line);
54   void digitalker_cms_w(int line);
55   void digitalker_wr_w(int line);
56   int digitalker_intr_r();
57   void digitalker_register_for_save();
58
59private:
60   const UINT8 *m_rom;
61   sound_stream *m_stream;
62
63   // Port/lines state
64   UINT8 m_data;
65   UINT8 m_cs;
66   UINT8 m_cms;
67   UINT8 m_wr;
68   UINT8 m_intr;
69
70   // Current decoding state
71   UINT16 m_bpos;
72   UINT16 m_apos;
73
74   UINT8 m_mode;
75   UINT8 m_cur_segment;
76   UINT8 m_cur_repeat;
77   UINT8 m_segments;
78   UINT8 m_repeats;
79
80   UINT8 m_prev_pitch;
81   UINT8 m_pitch;
82   UINT8 m_pitch_pos;
83
84   UINT8 m_stop_after;
85   UINT8 m_cur_dac;
86   UINT8 m_cur_bits;
87
88   // Zero-range size
89   UINT32 m_zero_count; // 0 for done
90
91   // Waveform and current index in it
92   UINT8 m_dac_index; // 128 for done
93   INT16 m_dac[128];
3194};
3295
3396extern const device_type DIGITALKER;
trunk/src/emu/sound/tiaintf.c
r20674r20675
22#include "tiaintf.h"
33#include "tiasound.h"
44
5struct tia_state
6{
7   sound_stream * channel;
8   void *chip;
9};
5// device type definition
6const device_type TIA = &device_creator<tia_device>;
107
11INLINE tia_state *get_safe_token(device_t *device)
12{
13   assert(device != NULL);
14   assert(device->type() == TIA);
15   return (tia_state *)downcast<tia_device *>(device)->token();
16}
178
9//**************************************************************************
10//  LIVE DEVICE
11//**************************************************************************
1812
19static STREAM_UPDATE( tia_update )
20{
21   tia_state *info = (tia_state *)param;
22   tia_process(info->chip, outputs[0], samples);
23}
13//-------------------------------------------------
14//  tia_device - constructor
15//-------------------------------------------------
2416
25
26static DEVICE_START( tia )
27{
28   tia_state *info = get_safe_token(device);
29
30   info->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->clock(), info, tia_update);
31
32   info->chip = tia_sound_init(device->clock(), device->clock(), 16);
33   assert_always(info->chip != NULL, "Error creating TIA chip");
34}
35
36static DEVICE_STOP( tia )
37{
38   tia_state *info = get_safe_token(device);
39   tia_sound_free(info->chip);
40}
41
42WRITE8_DEVICE_HANDLER( tia_sound_w )
43{
44   tia_state *info = get_safe_token(device);
45   info->channel->update();
46   tia_write(info->chip, offset, data);
47}
48
49const device_type TIA = &device_creator<tia_device>;
50
5117tia_device::tia_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5218   : device_t(mconfig, TIA, "TIA", tag, owner, clock),
53      device_sound_interface(mconfig, *this)
19     device_sound_interface(mconfig, *this),
20     m_channel(NULL),
21     m_chip(NULL)
5422{
55   m_token = global_alloc_clear(tia_state);
5623}
5724
58//-------------------------------------------------
59//  device_config_complete - perform any
60//  operations now that the configuration is
61//  complete
62//-------------------------------------------------
6325
64void tia_device::device_config_complete()
65{
66}
67
6826//-------------------------------------------------
6927//  device_start - device-specific startup
7028//-------------------------------------------------
7129
7230void tia_device::device_start()
7331{
74   DEVICE_START_NAME( tia )(this);
32   m_channel = stream_alloc(0, 1, clock());
33   m_chip = tia_sound_init(clock(), clock(), 16);
34   assert_always(m_chip != NULL, "Error creating TIA chip");
7535}
7636
37
7738//-------------------------------------------------
7839//  device_stop - device-specific stop
7940//-------------------------------------------------
8041
8142void tia_device::device_stop()
8243{
83   DEVICE_STOP_NAME( tia )(this);
44   tia_sound_free(m_chip);
8445}
8546
47
8648//-------------------------------------------------
8749//  sound_stream_update - handle a stream update
8850//-------------------------------------------------
8951
9052void tia_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
9153{
92   // should never get here
93   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
54   tia_process(m_chip, outputs[0], samples);
9455}
56
57
58WRITE8_MEMBER( tia_device::tia_sound_w )
59{
60   m_channel->update();
61   tia_write(m_chip, offset, data);
62}
trunk/src/emu/sound/tiaintf.h
r20674r20675
33#ifndef __TIAINTF_H__
44#define __TIAINTF_H__
55
6#include "devlegcy.h"
6//**************************************************************************
7//  INTERFACE CONFIGURATION MACROS
8//**************************************************************************
79
8DECLARE_WRITE8_DEVICE_HANDLER( tia_sound_w );
10#define MCFG_SOUND_TIA_ADD(_tag, _clock) \
11   MCFG_DEVICE_ADD(_tag, TIA, _clock)
12#define MCFG_SOUND_TIA_REPLACE(_tag, _clock) \
13   MCFG_DEVICE_REPLACE(_tag, TIA, _clock)
914
15
16//**************************************************************************
17//  TYPE DEFINITIONS
18//**************************************************************************
19
20// ======================> tia_device
21
1022class tia_device : public device_t,
11                           public device_sound_interface
23               public device_sound_interface
1224{
1325public:
1426   tia_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
15   ~tia_device() { global_free(m_token); }
27   ~tia_device() { }
1628
17   // access to legacy token
18   void *token() const { assert(m_token != NULL); return m_token; }
1929protected:
2030   // device-level overrides
21   virtual void device_config_complete();
2231   virtual void device_start();
2332   virtual void device_stop();
2433
2534   // sound stream update overrides
2635   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
36
37public:
38    DECLARE_WRITE8_MEMBER( tia_sound_w );
39
2740private:
28   // internal state
29   void *m_token;
41   sound_stream *m_channel;
42   void *m_chip;
3043};
3144
3245extern const device_type TIA;
trunk/src/mess/drivers/a2600.c
r20674r20675
19511951
19521952   /* sound hardware */
19531953   MCFG_SPEAKER_STANDARD_MONO("mono")
1954   MCFG_SOUND_ADD("tia", TIA, MASTER_CLOCK_NTSC/114)
1954   MCFG_SOUND_TIA_ADD("tia", MASTER_CLOCK_NTSC/114)
19551955   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
19561956   MCFG_SOUND_WAVE_ADD(WAVE_TAG, CASSETTE_TAG)
19571957   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
r20674r20675
19881988
19891989   /* sound hardware */
19901990   MCFG_SPEAKER_STANDARD_MONO("mono")
1991   MCFG_SOUND_ADD("tia", TIA, MASTER_CLOCK_PAL/114)
1991   MCFG_SOUND_TIA_ADD("tia", MASTER_CLOCK_PAL/114)
19921992   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
19931993   MCFG_SOUND_WAVE_ADD(WAVE_TAG, CASSETTE_TAG)
19941994   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
trunk/src/mess/drivers/a7800.c
r20674r20675
291291
292292   /* sound hardware */
293293   MCFG_SPEAKER_STANDARD_MONO("mono")
294   MCFG_SOUND_ADD("tia", TIA, 31400)
294   MCFG_SOUND_TIA_ADD("tia", 31400)
295295   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
296296   MCFG_POKEY_ADD("pokey", A7800_NTSC_Y1/8)
297297   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
trunk/src/mess/machine/a7800.c
r20674r20675
524524      }
525525      break;
526526   }
527   tia_sound_w(machine().device("tia"), space, offset, data);
527   machine().device<tia_device>("tia")->tia_sound_w(space, offset, data);
528528   m_ROM[offset] = data;
529529}
trunk/src/mame/drivers/seta2.c
r20674r20675
161161   AM_RANGE(0x700004, 0x700005) AM_READ_PORT("SYSTEM")             // Coins
162162   AM_RANGE(0x70000c, 0x70000d) AM_READ(watchdog_reset16_r)        // Watchdog
163163   AM_RANGE(0x800000, 0x800001) AM_WRITE(grdians_lockout_w)
164   AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
164   AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
165165   AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_SHARE("spriteram")       // Sprites
166166   AM_RANGE(0xc40000, 0xc4ffff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram")    // Palette
167167   AM_RANGE(0xc50000, 0xc5ffff) AM_RAM                             // cleared
r20674r20675
203203   AM_RANGE(0x70000a, 0x70000b) AM_READ_PORT("IN1")                // P2
204204   AM_RANGE(0x70000c, 0x70000d) AM_WRITE(watchdog_reset16_w)
205205   AM_RANGE(0x800000, 0x800001) AM_WRITE(grdians_lockout_w)
206   AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
206   AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
207207   AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_SHARE("spriteram")   // Sprites
208208   AM_RANGE(0xc40000, 0xc4ffff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram")    // Palette
209209   AM_RANGE(0xc50000, 0xc5ffff) AM_RAM                             // cleared
r20674r20675
262262   AM_RANGE(0x600300, 0x600301) AM_READ_PORT("DSW1")               // DSW 1
263263   AM_RANGE(0x600302, 0x600303) AM_READ_PORT("DSW2")               // DSW 2
264264   AM_RANGE(0x600300, 0x60030f) AM_WRITE(seta2_sound_bank_w)       // Samples Banks
265   AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
265   AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
266266   AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_SHARE("spriteram")   // Sprites
267267   AM_RANGE(0xc40000, 0xc4ffff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram")    // Palette
268268   AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(seta2_vregs_w) AM_SHARE("vregs")  // Video Registers
r20674r20675
285285   AM_RANGE(0x700300, 0x700301) AM_READ_PORT("DSW1")               // DSW 1
286286   AM_RANGE(0x700302, 0x700303) AM_READ_PORT("DSW2")               // DSW 2
287287   AM_RANGE(0x700310, 0x70031f) AM_WRITE(seta2_sound_bank_w)       // Samples Banks
288   AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
288   AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
289289   AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_SHARE("spriteram")       // Sprites
290290   AM_RANGE(0xc40000, 0xc4ffff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram")    // Palette
291291   AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(seta2_vregs_w) AM_SHARE("vregs")              // Video Registers
r20674r20675
308308   AM_RANGE(0x600300, 0x600301) AM_READ_PORT("DSW1")               // DSW 1
309309   AM_RANGE(0x600302, 0x600303) AM_READ_PORT("DSW2")               // DSW 2
310310   AM_RANGE(0x600300, 0x60030f) AM_WRITE(seta2_sound_bank_w)       // Samples Banks
311   AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
311   AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
312312   AM_RANGE(0xd00000, 0xd3ffff) AM_RAM AM_SHARE("spriteram")       // Sprites
313313   AM_RANGE(0xd40000, 0xd4ffff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram")    // Palette
314314   AM_RANGE(0xd60000, 0xd6003f) AM_WRITE(seta2_vregs_w) AM_SHARE("vregs")          // Video Registers
r20674r20675
356356   AM_RANGE(0x800000, 0x83ffff) AM_RAM AM_SHARE("spriteram")       // Sprites
357357   AM_RANGE(0x840000, 0x84ffff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram")    // Palette
358358   AM_RANGE(0x860000, 0x86003f) AM_WRITE(seta2_vregs_w) AM_SHARE("vregs")              // Video Registers
359   AM_RANGE(0x900000, 0x903fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
359   AM_RANGE(0x900000, 0x903fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
360360   AM_RANGE(0xfffc00, 0xffffff) AM_READWRITE_LEGACY(tmp68301_regs_r, tmp68301_regs_w)      // TMP68301 Registers
361361ADDRESS_MAP_END
362362
r20674r20675
382382   AM_RANGE(0xb00000, 0xb3ffff) AM_RAM AM_SHARE("spriteram")       // Sprites
383383   AM_RANGE(0xb40000, 0xb4ffff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram")    // Palette
384384   AM_RANGE(0xb60000, 0xb6003f) AM_WRITE(seta2_vregs_w) AM_SHARE("vregs")
385   AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
385   AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
386386   AM_RANGE(0xfffc00, 0xffffff) AM_READWRITE_LEGACY(tmp68301_regs_r, tmp68301_regs_w)      // TMP68301 Registers
387387ADDRESS_MAP_END
388388
r20674r20675
437437   AM_RANGE(0x400300, 0x400301) AM_READ_PORT("DSW1")               // DSW 1
438438   AM_RANGE(0x400302, 0x400303) AM_READ_PORT("DSW2")               // DSW 2
439439   AM_RANGE(0x400300, 0x40030f) AM_WRITE(seta2_sound_bank_w)       // Samples Banks
440   AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
440   AM_RANGE(0xb00000, 0xb03fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
441441   AM_RANGE(0xc00000, 0xc3ffff) AM_RAM AM_SHARE("spriteram")       // Sprites
442442   AM_RANGE(0xc40000, 0xc4ffff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram")    // Palette
443443   AM_RANGE(0xc60000, 0xc6003f) AM_WRITE(seta2_vregs_w) AM_SHARE("vregs")              // Video Registers
r20674r20675
499499   AM_RANGE( 0x840000, 0x84ffff ) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram")  // Palette
500500   AM_RANGE( 0x860000, 0x86003f ) AM_WRITE(seta2_vregs_w) AM_SHARE("vregs")    // Video Registers
501501
502   AM_RANGE( 0x900000, 0x903fff ) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r, seta_sound_word_w )   // Sound
502   AM_RANGE( 0x900000, 0x903fff ) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w )   // Sound
503503
504504   AM_RANGE( 0xfffd0a, 0xfffd0b ) AM_READ_PORT("DSW2")             // parallel data register (DSW 2)
505505   AM_RANGE( 0xfffc00, 0xffffff ) AM_READWRITE_LEGACY(tmp68301_regs_r, tmp68301_regs_w)    // TMP68301 Registers
r20674r20675
20422042   // sound hardware
20432043   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
20442044
2045   MCFG_SOUND_ADD("x1snd", X1_010, XTAL_50MHz/3)   // clock?
2045   MCFG_X1_010_ADD("x1snd", XTAL_50MHz/3)   // clock?
20462046   MCFG_SOUND_CONFIG(x1_010_sound_intf)
20472047   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
20482048   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
trunk/src/mame/drivers/galaxian.c
r20674r20675
10311031
10321032READ8_MEMBER(galaxian_state::scorpion_digitalker_intr_r)
10331033{
1034   device_t *digitalker = machine().device("digitalker");
1035   return digitalker_0_intr_r(digitalker);
1034   digitalker_device *digitalker = machine().device<digitalker_device>("digitalker");
1035   return digitalker->digitalker_0_intr_r();
10361036}
10371037
10381038WRITE8_MEMBER(galaxian_state::scorpion_digitalker_control_w)
10391039{
1040   device_t *device = machine().device("digitalker");
1041   digitalker_0_cs_w(device, data & 1 ? ASSERT_LINE : CLEAR_LINE);
1042   digitalker_0_cms_w(device, data & 2 ? ASSERT_LINE : CLEAR_LINE);
1043   digitalker_0_wr_w(device, data & 4 ? ASSERT_LINE : CLEAR_LINE);
1040   digitalker_device *device = machine().device<digitalker_device>("digitalker");
1041   device->digitalker_0_cs_w(data & 1 ? ASSERT_LINE : CLEAR_LINE);
1042   device->digitalker_0_cms_w(data & 2 ? ASSERT_LINE : CLEAR_LINE);
1043   device->digitalker_0_wr_w(data & 4 ? ASSERT_LINE : CLEAR_LINE);
10441044}
10451045
10461046static I8255A_INTERFACE( scorpion_ppi8255_1_intf )
r20674r20675
20042004   AY8910_DEFAULT_LOADS,
20052005   DEVCB_NULL,
20062006   DEVCB_NULL,
2007   DEVCB_DEVICE_HANDLER("digitalker", digitalker_data_w),
2007   DEVCB_DEVICE_MEMBER("digitalker", digitalker_device, digitalker_data_w),
20082008   DEVCB_DRIVER_MEMBER(galaxian_state,scorpion_digitalker_control_w)
20092009};
20102010
r20674r20675
24162416   MCFG_SOUND_CONFIG(scorpion_ay8910_interface)
24172417   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
24182418
2419   MCFG_SOUND_ADD("digitalker", DIGITALKER, 4000000)
2419   MCFG_DIGITALKER_ADD("digitalker", 4000000)
24202420   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.16)
24212421MACHINE_CONFIG_END
24222422
trunk/src/mame/drivers/seta.c
r20674r20675
16541654
16551655static ADDRESS_MAP_START( downtown_map, AS_PROGRAM, 16, seta_state )
16561656   AM_RANGE(0x000000, 0x09ffff) AM_ROM                             // ROM
1657   AM_RANGE(0x100000, 0x103fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
1657   AM_RANGE(0x100000, 0x103fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
16581658   AM_RANGE(0x200000, 0x200001) AM_NOP                             // watchdog? (twineagl)
16591659   AM_RANGE(0x300000, 0x300001) AM_WRITENOP                        // IRQ enable/acknowledge?
16601660   AM_RANGE(0x400000, 0x400007) AM_WRITE(twineagl_tilebank_w)      // special tile banking to animate water in twineagl
r20674r20675
18231823static ADDRESS_MAP_START( atehate_map, AS_PROGRAM, 16, seta_state )
18241824   AM_RANGE(0x000000, 0x0fffff) AM_ROM                             // ROM
18251825   AM_RANGE(0x900000, 0x9fffff) AM_RAM                             // RAM
1826   AM_RANGE(0x100000, 0x103fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
1826   AM_RANGE(0x100000, 0x103fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
18271827   AM_RANGE(0x200000, 0x200001) AM_WRITENOP                        // ? watchdog ?
18281828   AM_RANGE(0x300000, 0x300001) AM_WRITENOP                        // ? 0 (irq ack lev 2?)
18291829   AM_RANGE(0x500000, 0x500001) AM_WRITENOP                        // ? (end of lev 1: bit 4 goes 1,0,1)
r20674r20675
18661866   AM_RANGE(0xb04000, 0xb0ffff) AM_RAM                             // (jjsquawk)
18671867   AM_RANGE(0xb80000, 0xb83fff) AM_RAM_WRITE(seta_vram_2_w) AM_SHARE("vram_2") // VRAM 2&3
18681868   AM_RANGE(0xb84000, 0xb8ffff) AM_RAM                             // (jjsquawk)
1869   AM_RANGE(0xc00000, 0xc03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
1869   AM_RANGE(0xc00000, 0xc03fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
18701870   AM_RANGE(0xd00000, 0xd00007) AM_WRITENOP                        // ?
18711871   AM_RANGE(0xe00000, 0xe00001) AM_WRITENOP                        // ? VBlank IRQ Ack
18721872   AM_RANGE(0xf00000, 0xf00001) AM_WRITENOP                        // ? Sound  IRQ Ack
r20674r20675
19011901   AM_RANGE(0xa00600, 0xa00607) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritectrl_r16, spritectrl_w16)
19021902/**/AM_RANGE(0xa80000, 0xa80001) AM_RAM                             // ? 0x4000
19031903   AM_RANGE(0xb00000, 0xb03fff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecode_r16, spritecode_w16)     // Sprites Code + X + Attr
1904   AM_RANGE(0xc00000, 0xc03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
1904   AM_RANGE(0xc00000, 0xc03fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
19051905   AM_RANGE(0xd00000, 0xd00007) AM_WRITENOP                        // ?
19061906   AM_RANGE(0xe00000, 0xe00001) AM_WRITENOP                        // ? VBlank IRQ Ack
19071907   AM_RANGE(0xf00000, 0xf00001) AM_WRITENOP                        // ? Sound  IRQ Ack
r20674r20675
19811981   AM_RANGE(0xa00600, 0xa00607) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritectrl_r16, spritectrl_w16)
19821982/**/AM_RANGE(0xa80000, 0xa80001) AM_RAM                             // ? 0x4000
19831983   AM_RANGE(0xb00000, 0xb03fff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecode_r16, spritecode_w16)     // Sprites Code + X + Attr
1984   AM_RANGE(0xc00000, 0xc03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
1984   AM_RANGE(0xc00000, 0xc03fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
19851985#if __uPD71054_TIMER
19861986   AM_RANGE(0xd00000, 0xd00007) AM_WRITE(timer_regs_w)             // ?
19871987#else
r20674r20675
20572057   AM_RANGE(0xa0a600, 0xa0a607) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritectrl_r16, spritectrl_w16)
20582058// AM_RANGE(0xa80000, 0xa80001) AM_RAM                              // ? 0x4000
20592059   AM_RANGE(0xb0c000, 0xb0ffff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecode_r16, spritecode_w16)     // RZ: Sprites Code + X + Attr
2060   AM_RANGE(0xc00000, 0xc03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
2060   AM_RANGE(0xc00000, 0xc03fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
20612061#if __uPD71054_TIMER
20622062   AM_RANGE(0xd00000, 0xd00007) AM_WRITE(timer_regs_w)             // ?
20632063#else
r20674r20675
20842084   //AM_RANGE(0x600000, 0x60000f) AM_READ(krzybowl_input_r     )   // P1
20852085   AM_RANGE(0x8000f0, 0x8000f1) AM_RAM                             // NVRAM
20862086   AM_RANGE(0x800100, 0x8001ff) AM_RAM                             // NVRAM
2087   AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
2087   AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
20882088   AM_RANGE(0xb00000, 0xb003ff) AM_RAM AM_SHARE("paletteram")  // Palette
20892089   AM_RANGE(0xc00000, 0xc03fff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecode_r16, spritecode_w16)     // Sprites Code + X + Attr
20902090/**/AM_RANGE(0xd00000, 0xd00001) AM_RAM                             // ? 0x4000
r20674r20675
21652165   AM_RANGE(0x800100, 0x8001ff) AM_RAM                             // NVRAM
21662166   AM_RANGE(0x900000, 0x900001) AM_WRITENOP                        // ?
21672167   AM_RANGE(0x900002, 0x900003) AM_WRITE(keroppi_prize_w)          //
2168   AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
2168   AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
21692169   AM_RANGE(0xb00000, 0xb003ff) AM_RAM AM_SHARE("paletteram")  // Palette
21702170   AM_RANGE(0xc00000, 0xc03fff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecode_r16, spritecode_w16)     // Sprites Code + X + Attr
21712171/**/AM_RANGE(0xd00000, 0xd00001) AM_RAM                             // ? 0x4000
r20674r20675
21962196   AM_RANGE(0x500000, 0x500001) AM_READ_PORT("P1")                 // P1
21972197   AM_RANGE(0x500002, 0x500003) AM_READ_PORT("P2")                 // P2
21982198   AM_RANGE(0x500004, 0x500005) AM_READ_PORT("COINS")              // Coins
2199   AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
2199   AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
22002200   AM_RANGE(0xb00000, 0xb003ff) AM_RAM AM_SHARE("paletteram")  // Palette
22012201   AM_RANGE(0xc00000, 0xc03fff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecode_r16, spritecode_w16) // Sprites Code + X + Attr
22022202/**/AM_RANGE(0xd00000, 0xd00001) AM_RAM // ? 0x4000
r20674r20675
22332233   AM_RANGE(0xa80000, 0xa80001) AM_RAM // ? 0x4000
22342234   AM_RANGE(0xb00000, 0xb03fff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecode_r16, spritecode_w16) // Sprites Code + X + Attr
22352235   AM_RANGE(0xb04000, 0xb13fff) AM_RAM
2236   AM_RANGE(0xc00000, 0xc03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
2236   AM_RANGE(0xc00000, 0xc03fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
22372237   AM_RANGE(0xe00000, 0xe00001) AM_WRITENOP    //
22382238ADDRESS_MAP_END
22392239
r20674r20675
22462246   AM_RANGE(0x000000, 0x0bffff) AM_ROM                             // ROM
22472247   AM_RANGE(0xf00000, 0xf0ffff) AM_RAM                             // RAM (qzkklogy)
22482248   AM_RANGE(0xffc000, 0xffffff) AM_RAM                             // RAM (drgnunit,stg)
2249   AM_RANGE(0x100000, 0x103fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
2249   AM_RANGE(0x100000, 0x103fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
22502250   AM_RANGE(0x200000, 0x200001) AM_WRITENOP                        // Watchdog
22512251   AM_RANGE(0x300000, 0x300001) AM_WRITENOP                        // ? IRQ Ack
22522252   AM_RANGE(0x500000, 0x500001) AM_RAM_WRITE(seta_vregs_w) AM_SHARE("vregs")   // Coin Lockout + Video Registers
r20674r20675
23642364/**/AM_RANGE(0xa80000, 0xa80001) AM_RAM                             // ? 0x4000
23652365   AM_RANGE(0xb00000, 0xb03fff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecode_r16, spritecode_w16)     // Sprites Code + X + Attr
23662366   AM_RANGE(0xb04000, 0xb13fff) AM_RAM                             //
2367   AM_RANGE(0xe00000, 0xe03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
2367   AM_RANGE(0xe00000, 0xe03fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
23682368ADDRESS_MAP_END
23692369
23702370
r20674r20675
24012401#else
24022402   AM_RANGE(0xc00000, 0xc00007) AM_WRITENOP                        // ?
24032403#endif
2404   AM_RANGE(0xd00000, 0xd03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
2404   AM_RANGE(0xd00000, 0xd03fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
24052405ADDRESS_MAP_END
24062406
24072407/* almost identical to kamenrid */
r20674r20675
24302430#else
24312431   AM_RANGE(0xc00000, 0xc00007) AM_WRITENOP                        // ?
24322432#endif
2433   AM_RANGE(0xd00000, 0xd03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
2433   AM_RANGE(0xd00000, 0xd03fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
24342434ADDRESS_MAP_END
24352435
24362436
r20674r20675
24772477#else
24782478   AM_RANGE(0xc00000, 0xc00007) AM_WRITENOP                        // ?
24792479#endif
2480   AM_RANGE(0xd00000, 0xd03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
2480   AM_RANGE(0xd00000, 0xd03fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
24812481ADDRESS_MAP_END
24822482
24832483
r20674r20675
25222522   AM_RANGE(0x600000, 0x60000f) AM_READ(krzybowl_input_r)          // P1
25232523   AM_RANGE(0x8000f0, 0x8000f1) AM_RAM                             // NVRAM
25242524   AM_RANGE(0x800100, 0x8001ff) AM_RAM                             // NVRAM
2525   AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
2525   AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
25262526   AM_RANGE(0xb00000, 0xb003ff) AM_RAM AM_SHARE("paletteram")  // Palette
25272527   AM_RANGE(0xc00000, 0xc03fff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecode_r16, spritecode_w16)     // Sprites Code + X + Attr
25282528/**/AM_RANGE(0xd00000, 0xd00001) AM_RAM                             // ? 0x4000
r20674r20675
25682568   AM_RANGE(0xa80000, 0xa83fff) AM_RAM_WRITE(seta_vram_2_w) AM_SHARE("vram_2") // VRAM 2&3
25692569   AM_RANGE(0xb00000, 0xb00005) AM_RAM AM_SHARE("vctrl_0")     // VRAM 0&1 Ctrl
25702570   AM_RANGE(0xb80000, 0xb80005) AM_RAM AM_SHARE("vctrl_2")     // VRAM 2&3 Ctrl
2571   AM_RANGE(0xc00000, 0xc03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
2571   AM_RANGE(0xc00000, 0xc03fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
25722572#if __uPD71054_TIMER
25732573   AM_RANGE(0xd00000, 0xd00007) AM_WRITE(timer_regs_w) // ?
25742574#else
r20674r20675
25922592   AM_RANGE(0x400004, 0x400005) AM_READ_PORT("COINS")              // Coins
25932593   AM_RANGE(0x400000, 0x400001) AM_WRITENOP                        // ? IRQ Ack
25942594   AM_RANGE(0x500000, 0x500005) AM_RAM_WRITE(seta_vregs_w) AM_SHARE("vregs")   // Coin Lockout + Video Registers
2595   AM_RANGE(0x700000, 0x703fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
2595   AM_RANGE(0x700000, 0x703fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
25962596   AM_RANGE(0x800000, 0x803fff) AM_RAM_WRITE(seta_vram_0_w) AM_SHARE("vram_0") // VRAM 0&1
25972597   AM_RANGE(0x880000, 0x883fff) AM_RAM_WRITE(seta_vram_2_w) AM_SHARE("vram_2") // VRAM 2&3
25982598/**/AM_RANGE(0x900000, 0x900005) AM_RAM AM_SHARE("vctrl_0")     // VRAM 0&1 Ctrl
r20674r20675
26832683/**/AM_RANGE(0xa00000, 0xa005ff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spriteylow_r16, spriteylow_w16)     // Sprites Y
26842684   AM_RANGE(0xa00600, 0xa00607) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritectrl_r16, spritectrl_w16)
26852685   AM_RANGE(0xb00000, 0xb003ff) AM_RAM AM_SHARE("paletteram")  // Palette
2686   AM_RANGE(0xc00000, 0xc03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
2686   AM_RANGE(0xc00000, 0xc03fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
26872687   AM_RANGE(0xd00000, 0xd00009) AM_READ(kiwame_input_r)            // mahjong panel
26882688   AM_RANGE(0xe00000, 0xe00003) AM_READ(seta_dsw_r)                // DSW
26892689ADDRESS_MAP_END
r20674r20675
27082708static ADDRESS_MAP_START( thunderl_map, AS_PROGRAM, 16, seta_state )
27092709   AM_RANGE(0x000000, 0x00ffff) AM_ROM                             // ROM
27102710   AM_RANGE(0xffc000, 0xffffff) AM_RAM                             // RAM
2711   AM_RANGE(0x100000, 0x103fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
2711   AM_RANGE(0x100000, 0x103fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
27122712   AM_RANGE(0x200000, 0x200001) AM_WRITENOP                        // ?
27132713   AM_RANGE(0x300000, 0x300001) AM_WRITENOP                        // ?
27142714   AM_RANGE(0x400000, 0x40ffff) AM_WRITE(thunderl_protection_w)    // Protection (not in wits)
r20674r20675
27322732static ADDRESS_MAP_START( thunderlbl_map, AS_PROGRAM, 16, seta_state )
27332733   AM_RANGE(0x000000, 0x00ffff) AM_ROM                             // ROM
27342734   AM_RANGE(0xffc000, 0xffffff) AM_RAM                             // RAM
2735//  AM_RANGE(0x100000, 0x103fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)  // Sound
2735//  AM_RANGE(0x100000, 0x103fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)  // Sound
27362736   AM_RANGE(0x200000, 0x200001) AM_WRITENOP                        // ?
27372737   AM_RANGE(0x300000, 0x300001) AM_WRITENOP                        // ?
27382738//  AM_RANGE(0x400000, 0x40ffff) AM_WRITE(thunderl_protection_w)    // Protection (not in wits)
r20674r20675
28182818   AM_RANGE(0xa00600, 0xa00607) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritectrl_r16, spritectrl_w16)
28192819/**/AM_RANGE(0xa80000, 0xa80001) AM_RAM                             // ? 0x4000
28202820   AM_RANGE(0xb00000, 0xb03fff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecode_r16, spritecode_w16)     // Sprites Code + X + Attr
2821   AM_RANGE(0xc00000, 0xc03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
2821   AM_RANGE(0xc00000, 0xc03fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
28222822ADDRESS_MAP_END
28232823
28242824
r20674r20675
28862886   AM_RANGE(0x500002, 0x500003) AM_READ_PORT("P2")                 // P2
28872887   AM_RANGE(0x500004, 0x500005) AM_READ_PORT("COINS")              // Coins
28882888   AM_RANGE(0x900000, 0x9001ff) AM_READWRITE(pairlove_prot_r,pairlove_prot_w)
2889   AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r,seta_sound_word_w)   // Sound
2889   AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)   // Sound
28902890   AM_RANGE(0xb00000, 0xb00fff) AM_RAM AM_SHARE("paletteram")  // Palette
28912891   AM_RANGE(0xc00000, 0xc03fff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecode_r16, spritecode_w16)     // Sprites Code + X + Attr
28922892   AM_RANGE(0xd00000, 0xd00001) AM_RAM                             // ? 0x4000
r20674r20675
29762976
29772977   AM_RANGE(0x800000, 0x80001f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write, 0x00ff)
29782978
2979   AM_RANGE(0x900000, 0x903fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r, seta_sound_word_w       )   // Sound
2979   AM_RANGE(0x900000, 0x903fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w       )   // Sound
29802980
29812981   AM_RANGE(0xa00000, 0xa00005) AM_WRITEONLY AM_SHARE("vctrl_0")   // VRAM 0&1 Ctrl
29822982   AM_RANGE(0xb00000, 0xb03fff) AM_RAM_WRITE(seta_vram_0_w) AM_SHARE("vram_0") // VRAM 0&1
r20674r20675
30383038
30393039   AM_RANGE(0x800000, 0x80001f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write, 0x00ff)
30403040
3041   AM_RANGE(0x900000, 0x903fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_word_r, seta_sound_word_w)  // Sound
3041   AM_RANGE(0x900000, 0x903fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_word_r, seta_sound_word_w)  // Sound
30423042
30433043   AM_RANGE(0xa00000, 0xa00005) AM_WRITEONLY AM_SHARE("vctrl_0")   // VRAM 0&1 Ctrl
30443044   AM_RANGE(0xb00000, 0xb03fff) AM_RAM_WRITE(seta_vram_0_w) AM_SHARE("vram_0") // VRAM 0&1
r20674r20675
31773177}
31783178
31793179static ADDRESS_MAP_START( calibr50_sub_map, AS_PROGRAM, 8, seta_state )
3180   AM_RANGE(0x0000, 0x1fff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_r,seta_sound_w) // Sound
3180   AM_RANGE(0x0000, 0x1fff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_r, seta_sound_w) // Sound
31813181   AM_RANGE(0x4000, 0x4000) AM_READ(soundlatch_byte_r)             // From Main CPU
31823182   AM_RANGE(0x4000, 0x4000) AM_WRITE(sub_bankswitch_w)         // Bankswitching
31833183   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")                        // Banked ROM
r20674r20675
32133213static ADDRESS_MAP_START( utoukond_sound_map, AS_PROGRAM, 8, seta_state )
32143214   AM_RANGE(0x0000, 0xdfff) AM_ROM
32153215   AM_RANGE(0xe000, 0xefff) AM_RAM
3216   AM_RANGE(0xf000, 0xffff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_r,seta_sound_w)
3216   AM_RANGE(0xf000, 0xffff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_r, seta_sound_w)
32173217ADDRESS_MAP_END
32183218
32193219static ADDRESS_MAP_START( utoukond_sound_io_map, AS_IO, 8, seta_state )
r20674r20675
75447544   /* sound hardware */
75457545   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
75467546
7547   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
7547   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
75487548   MCFG_SOUND_CONFIG(seta_sound_intf)
75497549   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
75507550   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
75857585
75867586   /* sound hardware */
75877587   MCFG_SPEAKER_STANDARD_MONO("mono")
7588   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
7588   MCFG_X1_010_ADD("x1snd",  16000000)   /* 16 MHz */
75897589   MCFG_SOUND_CONFIG(seta_sound_intf)
75907590   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
75917591MACHINE_CONFIG_END
r20674r20675
76457645   /* sound hardware */
76467646   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
76477647
7648   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
7648   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
76497649   MCFG_SOUND_CONFIG(seta_sound_intf2)
76507650   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
76517651   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
76927692
76937693   /* sound hardware */
76947694   MCFG_SPEAKER_STANDARD_MONO("mono")
7695   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
7695   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
76967696   MCFG_SOUND_CONFIG(seta_sound_intf2)
76977697   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
76987698MACHINE_CONFIG_END
r20674r20675
77337733   /* sound hardware */
77347734   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
77357735
7736   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
7736   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
77377737   MCFG_SOUND_CONFIG(seta_sound_intf)
77387738   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
77397739   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
77697769   /* sound hardware */
77707770   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
77717771
7772   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
7772   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
77737773   MCFG_SOUND_CONFIG(seta_sound_intf)
77747774   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
77757775   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
78137813   /* sound hardware */
78147814   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
78157815
7816   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
7816   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
78177817   MCFG_SOUND_CONFIG(seta_sound_intf)
78187818   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
78197819   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
78467846   /* sound hardware */
78477847   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
78487848
7849   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
7849   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
78507850   MCFG_SOUND_CONFIG(seta_sound_intf)
78517851   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
78527852   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
78827882   /* sound hardware */
78837883   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
78847884
7885   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
7885   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
78867886   MCFG_SOUND_CONFIG(seta_sound_intf)
78877887   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
78887888   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
79187918   /* sound hardware */
79197919   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
79207920
7921   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
7921   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
79227922   MCFG_SOUND_CONFIG(seta_sound_intf)
79237923   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
79247924   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
79607960   /* sound hardware */
79617961   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
79627962
7963   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
7963   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
79647964   MCFG_SOUND_CONFIG(seta_sound_intf)
79657965   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
79667966   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
79957995   /* sound hardware */
79967996   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
79977997
7998   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
7998   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
79997999   MCFG_SOUND_CONFIG(seta_sound_intf)
80008000   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
80018001   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
80468046   /* sound hardware */
80478047   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
80488048
8049   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
8049   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
80508050   MCFG_SOUND_CONFIG(seta_sound_intf)
80518051   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
80528052   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
80828082   /* sound hardware */
80838083   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
80848084
8085   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
8085   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
80868086   MCFG_SOUND_CONFIG(seta_sound_intf)
80878087   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
80888088   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
81248124   /* sound hardware */
81258125   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
81268126
8127   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
8127   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
81288128   MCFG_SOUND_CONFIG(seta_sound_intf)
81298129   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
81308130   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
81858185   /* sound hardware */
81868186   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
81878187
8188   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
8188   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
81898189   MCFG_SOUND_CONFIG(seta_sound_intf)
81908190   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
81918191   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
82268226   /* sound hardware */
82278227   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
82288228
8229   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
8229   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
82308230   MCFG_SOUND_CONFIG(seta_sound_intf)
82318231   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
82328232   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
82588258   /* sound hardware */
82598259   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
82608260
8261   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
8261   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
82628262   MCFG_SOUND_CONFIG(seta_sound_intf)
82638263   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
82648264   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
82988298   /* sound hardware */
82998299   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
83008300
8301   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
8301   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
83028302   MCFG_SOUND_CONFIG(seta_sound_intf)
83038303   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
83048304   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
83358335   /* sound hardware */
83368336   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
83378337
8338   MCFG_SOUND_ADD("x1snd", X1_010, 14318180)   /* 14.318180 MHz */
8338   MCFG_X1_010_ADD("x1snd", 14318180)   /* 14.318180 MHz */
83398339   MCFG_SOUND_CONFIG(seta_sound_intf)
83408340   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
83418341   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
83738373   /* sound hardware */
83748374   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
83758375
8376   MCFG_SOUND_ADD("x1snd", X1_010, 14318180)   /* 14.318180 MHz */
8376   MCFG_X1_010_ADD("x1snd", 14318180)   /* 14.318180 MHz */
83778377   MCFG_SOUND_CONFIG(seta_sound_intf)
83788378   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
83798379   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
84098409   /* sound hardware */
84108410   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
84118411
8412   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
8412   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
84138413   MCFG_SOUND_CONFIG(seta_sound_intf)
84148414   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
84158415   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
84528452   /* sound hardware */
84538453   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
84548454
8455   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
8455   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
84568456   MCFG_SOUND_CONFIG(seta_sound_intf)
84578457   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
84588458   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
84928492   /* sound hardware */
84938493   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
84948494
8495   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
8495   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
84968496   MCFG_SOUND_CONFIG(seta_sound_intf)
84978497   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
84988498   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
85398539   /* sound hardware */
85408540   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
85418541
8542   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
8542   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
85438543   MCFG_SOUND_CONFIG(seta_sound_intf)
85448544   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
85458545   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
85768576   /* sound hardware */
85778577   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
85788578
8579   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
8579   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
85808580   MCFG_SOUND_CONFIG(seta_sound_intf)
85818581   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
85828582   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
86488648   /* sound hardware */
86498649   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
86508650
8651   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
8651   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
86528652   MCFG_SOUND_CONFIG(seta_sound_intf)
86538653   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
86548654   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
86878687   /* sound hardware */
86888688   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
86898689
8690   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
8690   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
86918691   MCFG_SOUND_CONFIG(seta_sound_intf)
86928692   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
86938693   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
87268726   /* sound hardware */
87278727   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
87288728
8729   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
8729   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
87308730   MCFG_SOUND_CONFIG(seta_sound_intf)
87318731   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
87328732   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
88318831   /* sound hardware */
88328832   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
88338833
8834   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
8834   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
88358835   MCFG_SOUND_CONFIG(seta_sound_intf)
88368836   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
88378837   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
88678867   /* sound hardware */
88688868   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
88698869
8870   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
8870   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
88718871   MCFG_SOUND_CONFIG(seta_sound_intf)
88728872   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
88738873   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
89078907   /* sound hardware */
89088908   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
89098909
8910   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)
8910   MCFG_X1_010_ADD("x1snd", 16000000)
89118911   MCFG_SOUND_CONFIG(seta_sound_intf)
89128912   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
89138913   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
89568956   /* sound hardware */
89578957   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
89588958
8959   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
8959   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
89608960   MCFG_SOUND_CONFIG(seta_sound_intf)
89618961   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
89628962   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
90009000   /* sound hardware */
90019001   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
90029002
9003   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
9003   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
90049004   MCFG_SOUND_CONFIG(seta_sound_intf)
90059005   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
90069006   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
90529052   /* sound hardware */
90539053   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
90549054
9055   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)   /* 16 MHz */
9055   MCFG_X1_010_ADD("x1snd", 16000000)   /* 16 MHz */
90569056   MCFG_SOUND_CONFIG(seta_sound_intf)
90579057   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
90589058   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
91969196   /* sound hardware */
91979197   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
91989198
9199   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)
9199   MCFG_X1_010_ADD("x1snd", 16000000)
92009200   MCFG_SOUND_CONFIG(seta_sound_intf)
92019201   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
92029202   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
trunk/src/mame/drivers/namcos86.c
r20674r20675
306306      case 1:
307307      case 2:
308308      case 3:
309         namco_63701x_w(machine().device("namco2"), space, (offset & 0x1e00) >> 9,data);
309         machine().device<namco_63701x_device>("namco2")->namco_63701x_w(space, (offset & 0x1e00) >> 9,data);
310310         break;
311311
312312      case 4:
r20674r20675
10641064   MCFG_CPU_PROGRAM_MAP(genpeitd_mcu_map)
10651065
10661066   /* sound hardware */
1067   MCFG_SOUND_ADD("namco2", NAMCO_63701X, 6000000)
1067   MCFG_NAMCO_63701X_ADD("namco2", 6000000)
10681068   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
10691069MACHINE_CONFIG_END
10701070
r20674r20675
10791079   MCFG_CPU_PROGRAM_MAP(rthunder_mcu_map)
10801080
10811081   /* sound hardware */
1082   MCFG_SOUND_ADD("namco2", NAMCO_63701X, 6000000)
1082   MCFG_NAMCO_63701X_ADD("namco2", 6000000)
10831083   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
10841084MACHINE_CONFIG_END
10851085
r20674r20675
10941094   MCFG_CPU_PROGRAM_MAP(wndrmomo_mcu_map)
10951095
10961096   /* sound hardware */
1097   MCFG_SOUND_ADD("namco2", NAMCO_63701X, 6000000)
1097   MCFG_NAMCO_63701X_ADD("namco2", 6000000)
10981098   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
10991099MACHINE_CONFIG_END
11001100
trunk/src/mame/drivers/champbwl.c
r20674r20675
210210   AM_RANGE(0x8000, 0x87ff) AM_RAM AM_SHARE("nvram")
211211   AM_RANGE(0xa000, 0xafff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecodelow_r8, spritecodelow_w8)
212212   AM_RANGE(0xb000, 0xbfff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecodehigh_r8, spritecodehigh_w8)
213   AM_RANGE(0xc000, 0xdfff) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_r, seta_sound_w)
213   AM_RANGE(0xc000, 0xdfff) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_r, seta_sound_w)
214214   AM_RANGE(0xe000, 0xe2ff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spriteylow_r8, spriteylow_w8)
215215   AM_RANGE(0xe300, 0xe303) AM_MIRROR(0xfc) AM_DEVWRITE_LEGACY("spritegen", spritectrl_w8) /* control registers (0x80 mirror used by Arkanoid 2) */
216216   AM_RANGE(0xe800, 0xe800) AM_DEVWRITE_LEGACY("spritegen", spritebgflag_w8)   /* enable / disable background transparency */
r20674r20675
249249   AM_RANGE(0x8000, 0x87ff) AM_RAM AM_SHARE("nvram")
250250   AM_RANGE(0xa000, 0xafff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecodelow_r8, spritecodelow_w8)
251251   AM_RANGE(0xb000, 0xbfff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spritecodehigh_r8, spritecodehigh_w8)
252   AM_RANGE(0xc000, 0xc07f) AM_DEVREADWRITE_LEGACY("x1snd", seta_sound_r,seta_sound_w) // Sound
252   AM_RANGE(0xc000, 0xc07f) AM_DEVREADWRITE("x1snd", x1_010_device, seta_sound_r, seta_sound_w) // Sound
253253   AM_RANGE(0xe000, 0xe2ff) AM_RAM AM_DEVREADWRITE_LEGACY("spritegen", spriteylow_r8, spriteylow_w8)
254254   AM_RANGE(0xe300, 0xe303) AM_DEVWRITE_LEGACY("spritegen", spritectrl_w8)
255255   AM_RANGE(0xe800, 0xe800) AM_DEVWRITE_LEGACY("spritegen", spritebgflag_w8)   /* enable / disable background transparency */
r20674r20675
505505   /* sound hardware */
506506   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
507507
508   MCFG_SOUND_ADD("x1snd", X1_010, 16000000)
508   MCFG_X1_010_ADD("x1snd", 16000000)
509509   MCFG_SOUND_CONFIG(champbwl_sound_intf)
510510   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
511511   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r20674r20675
567567
568568   /* sound hardware */
569569   MCFG_SPEAKER_STANDARD_MONO("mono")
570   MCFG_SOUND_ADD("x1snd", X1_010, XTAL_14_31818MHz)
570   MCFG_X1_010_ADD("x1snd", XTAL_14_31818MHz)
571571   MCFG_SOUND_CONFIG(champbwl_sound_intf)
572572   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
573573MACHINE_CONFIG_END
trunk/src/mame/drivers/tourtabl.c
r20674r20675
191191   /* sound hardware */
192192   MCFG_SPEAKER_STANDARD_MONO("mono")
193193
194   MCFG_SOUND_ADD("tia", TIA, MASTER_CLOCK/114)
194   MCFG_SOUND_TIA_ADD("tia", MASTER_CLOCK/114)
195195   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
196196MACHINE_CONFIG_END
197197
trunk/src/mame/video/seta.c
r20674r20675
266266        ---- ---- ---- ---0     Coin #0 Counter     */
267267         if (ACCESSING_BITS_0_7)
268268         {
269            device_t *x1_010 = machine().device("x1snd");
269            x1_010_device *x1_010 = machine().device<x1_010_device>("x1snd");
270270            seta_coin_lockout_w (machine(), data & 0x0f);
271271            if (x1_010 != NULL)
272               seta_sound_enable_w (x1_010, data & 0x20);
272               x1_010->seta_sound_enable_w (data & 0x20);
273273            coin_counter_w(machine(), 0,data & 0x01);
274274            coin_counter_w(machine(), 1,data & 0x02);
275275         }
trunk/src/mame/video/tia.c
r20674r20675
18041804   case 0x18: /* AUDF1 */
18051805   case 0x19: /* AUDV0 */
18061806   case 0x1A: /* AUDV1 */
1807      tia_sound_w(machine().device("tia"), space, offset, data);
1807      machine().device<tia_device>("tia")->tia_sound_w(space, offset, data);
18081808      break;
18091809
18101810   case 0x1B:

Previous 199869 Revisions Next


© 1997-2024 The MAME Team