Previous 199869 Revisions Next

r23307 Friday 31st May, 2013 at 05:59:35 UTC by Fabio Priuli
modernized the MB14241 and MathBox devices. [Osso]
[src/emu/machine]mb14241.c mb14241.h upd4701.h
[src/mame/audio]redbaron.c redbaron.h*
[src/mame/drivers]8080bw.c bzone.c fgoal.c mw8080bw.c tempest.c
[src/mame/includes]bzone.h fgoal.h mw8080bw.h
[src/mame/machine]mathbox.c mathbox.h mw8080bw.c

trunk/src/emu/machine/upd4701.h
r23306r23307
99#ifndef __UPD4701_H__
1010#define __UPD4701_H__
1111
12#include "devlegcy.h"
13
1412/***************************************************************************
1513    MACROS / CONSTANTS
1614***************************************************************************/
trunk/src/emu/machine/mb14241.c
r23306r23307
77#include "emu.h"
88#include "machine/mb14241.h"
99
10struct mb14241_state
11{
12   UINT16 shift_data;  /* 15 bits only */
13   UINT8 shift_count;  /* 3 bits */
14};
1510
16/*****************************************************************************
17    INLINE FUNCTIONS
18*****************************************************************************/
11//-------------------------------------------------
12//  mb14241_device - constructor
13//-------------------------------------------------
1914
20INLINE mb14241_state *get_safe_token( device_t *device )
21{
22   assert(device != NULL);
23   assert(device->type() == MB14241);
2415
25   return (mb14241_state *)downcast<mb14241_device *>(device)->token();
26}
27
28/*****************************************************************************
29    IMPLEMENTATION
30*****************************************************************************/
31
32WRITE8_DEVICE_HANDLER( mb14241_shift_count_w )
33{
34   mb14241_state *mb14241 = get_safe_token(device);
35   mb14241->shift_count = ~data & 0x07;
36}
37
38WRITE8_DEVICE_HANDLER( mb14241_shift_data_w )
39{
40   mb14241_state *mb14241 = get_safe_token(device);
41   mb14241->shift_data = (mb14241->shift_data >> 8) | ((UINT16)data << 7);
42}
43
44READ8_DEVICE_HANDLER( mb14241_shift_result_r )
45{
46   mb14241_state *mb14241 = get_safe_token(device);
47   return mb14241->shift_data >> mb14241->shift_count;
48}
49
50/*****************************************************************************
51    DEVICE INTERFACE
52*****************************************************************************/
53
54static DEVICE_START( mb14241 )
55{
56   mb14241_state *mb14241 = get_safe_token(device);
57
58   device->save_item(NAME(mb14241->shift_data));
59   device->save_item(NAME(mb14241->shift_count));
60}
61
62static DEVICE_RESET( mb14241 )
63{
64   mb14241_state *mb14241 = get_safe_token(device);
65
66   mb14241->shift_data = 0;
67   mb14241->shift_count = 0;
68}
69
7016const device_type MB14241 = &device_creator<mb14241_device>;
7117
7218mb14241_device::mb14241_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
7319   : device_t(mconfig, MB14241, "MB14241", tag, owner, clock)
7420{
75   m_token = global_alloc_clear(mb14241_state);
7621}
7722
7823//-------------------------------------------------
r23306r23307
9136
9237void mb14241_device::device_start()
9338{
94   DEVICE_START_NAME( mb14241 )(this);
39   save_item(NAME(m_shift_data));
40   save_item(NAME(m_shift_count));
9541}
9642
9743//-------------------------------------------------
r23306r23307
10046
10147void mb14241_device::device_reset()
10248{
103   DEVICE_RESET_NAME( mb14241 )(this);
49   m_shift_data = 0;
50   m_shift_count = 0;
10451}
52
53
54/*****************************************************************************
55    IMPLEMENTATION
56*****************************************************************************/
57
58WRITE8_MEMBER( mb14241_device::shift_count_w )
59{
60   m_shift_count = ~data & 0x07;
61}
62
63WRITE8_MEMBER( mb14241_device::shift_data_w )
64{
65   m_shift_data = (m_shift_data >> 8) | ((UINT16)data << 7);
66}
67
68READ8_MEMBER( mb14241_device::shift_result_r )
69{
70   return m_shift_data >> m_shift_count;
71}
trunk/src/emu/machine/mb14241.h
r23306r23307
77#ifndef __MB14241_H__
88#define __MB14241_H__
99
10#include "devlegcy.h"
1110
12
1311class mb14241_device : public device_t
1412{
1513public:
1614   mb14241_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
17   ~mb14241_device() { global_free(m_token); }
15   
16   DECLARE_WRITE8_MEMBER ( shift_count_w );
17   DECLARE_WRITE8_MEMBER ( shift_data_w );
18   DECLARE_READ8_MEMBER( shift_result_r );
1819
19   // access to legacy token
20   void *token() const { assert(m_token != NULL); return m_token; }
2120protected:
2221   // device-level overrides
2322   virtual void device_config_complete();
2423   virtual void device_start();
2524   virtual void device_reset();
25
2626private:
2727   // internal state
28   void *m_token;
28   
29   UINT16 m_shift_data;  /* 15 bits only */
30   UINT8 m_shift_count;  /* 3 bits */
2931};
3032
3133extern const device_type MB14241;
r23306r23307
3840#define MCFG_MB14241_ADD(_tag) \
3941   MCFG_DEVICE_ADD(_tag, MB14241, 0)
4042
41
42/***************************************************************************
43    DEVICE I/O FUNCTIONS
44***************************************************************************/
45
46DECLARE_WRITE8_DEVICE_HANDLER ( mb14241_shift_count_w );
47DECLARE_WRITE8_DEVICE_HANDLER ( mb14241_shift_data_w );
48DECLARE_READ8_DEVICE_HANDLER( mb14241_shift_result_r );
49
50
5143#endif /* __MB14241_H__ */
trunk/src/mame/audio/redbaron.c
r23306r23307
214214}
215215
216216
217WRITE8_MEMBER( redbaron_sound_device::redbaron_sounds_w )
217WRITE8_MEMBER( redbaron_sound_device::sounds_w )
218218{
219219   /* If sound is off, don't bother playing samples */
220220   if( data == m_latch )
r23306r23307
226226
227227
228228#ifdef UNUSED_FUNCTION
229WRITE8_MEMBER( redbaron_sound_device::redbaron_pokey_w )
229WRITE8_MEMBER( redbaron_sound_device::pokey_w )
230230{
231231   if( m_latch & 0x20 )
232232      pokey_w(device, offset, data);
trunk/src/mame/audio/redbaron.h
r0r23307
1//**************************************************************************
2//  TYPE DEFINITIONS
3//**************************************************************************
4
5// ======================> redbaron_sound_device
6
7class redbaron_sound_device : public device_t,
8                        public device_sound_interface
9{
10public:
11   redbaron_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
12   
13   DECLARE_WRITE8_MEMBER( sounds_w );
14   
15protected:
16   // device-level overrides
17   virtual void device_start();
18
19   // sound stream update overrides
20   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
21
22private:
23   INT16 *m_vol_lookup;
24
25   INT16 m_vol_crash[16];
26
27   sound_stream *m_channel;
28   int m_latch;
29   int m_poly_counter;
30   int m_poly_shift;
31
32   int m_filter_counter;
33
34   int m_crash_amp;
35   int m_shot_amp;
36   int m_shot_amp_counter;
37
38   int m_squeal_amp;
39   int m_squeal_amp_counter;
40   int m_squeal_off_counter;
41   int m_squeal_on_counter;
42   int m_squeal_out;
43};
44
45extern const device_type REDBARON;
Property changes on: trunk/src/mame/audio/redbaron.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/mame/machine/mw8080bw.c
r23306r23307
9898   m_sn = machine().device("snsnd");
9999   m_sn1 = machine().device("sn1");
100100   m_sn2 = machine().device("sn2");
101   m_mb14241 = machine().device("mb14241");
102101}
103102
104103
trunk/src/mame/machine/mathbox.c
r23306r23307
88#include "emu.h"
99#include "mathbox.h"
1010
11#define REG0 mb->reg [0x00]
12#define REG1 mb->reg [0x01]
13#define REG2 mb->reg [0x02]
14#define REG3 mb->reg [0x03]
15#define REG4 mb->reg [0x04]
16#define REG5 mb->reg [0x05]
17#define REG6 mb->reg [0x06]
18#define REG7 mb->reg [0x07]
19#define REG8 mb->reg [0x08]
20#define REG9 mb->reg [0x09]
21#define REGa mb->reg [0x0a]
22#define REGb mb->reg [0x0b]
23#define REGc mb->reg [0x0c]
24#define REGd mb->reg [0x0d]
25#define REGe mb->reg [0x0e]
26#define REGf mb->reg [0x0f]
2711
12#define REG0 m_reg [0x00]
13#define REG1 m_reg [0x01]
14#define REG2 m_reg [0x02]
15#define REG3 m_reg [0x03]
16#define REG4 m_reg [0x04]
17#define REG5 m_reg [0x05]
18#define REG6 m_reg [0x06]
19#define REG7 m_reg [0x07]
20#define REG8 m_reg [0x08]
21#define REG9 m_reg [0x09]
22#define REGa m_reg [0x0a]
23#define REGb m_reg [0x0b]
24#define REGc m_reg [0x0c]
25#define REGd m_reg [0x0d]
26#define REGe m_reg [0x0e]
27#define REGf m_reg [0x0f]
2828
29
2930#define MB_TEST 0
3031#define LOG(x) do { if (MB_TEST) logerror x; } while (0)
3132
32struct mathbox_state
33{
34   device_t *device;
35   /* math box scratch registers */
36   INT16 reg[16];
3733
38   /* math box result */
39   INT16 result;
40};
34//-------------------------------------------------
35//  mathbox_device - constructor
36//-------------------------------------------------
4137
38const device_type MATHBOX = &device_creator<mathbox_device>;
4239
40mathbox_device::mathbox_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
41   : device_t(mconfig, MATHBOX, "MATHBOX", tag, owner, clock)
42{
43}
4344
44/***************************************************************************
45    INLINE FUNCTIONS
46***************************************************************************/
45//-------------------------------------------------
46//  device_config_complete - perform any
47//  operations now that the configuration is
48//  complete
49//-------------------------------------------------
4750
48/*-------------------------------------------------
49    get_safe_token - convert a device's token
50    into a mathbox_state
51-------------------------------------------------*/
52
53INLINE mathbox_state *get_safe_token(device_t *device)
51void mathbox_device::device_config_complete()
5452{
55   assert(device != NULL);
56   assert(device->type() == MATHBOX);
57   return (mathbox_state *)downcast<mathbox_device *>(device)->token();
5853}
5954
55//-------------------------------------------------
56//  device_start - device-specific startup
57//-------------------------------------------------
6058
59void mathbox_device::device_start()
60{
61   /* register for save states */
62   save_item(NAME(m_result));
63   save_item(NAME(m_reg));
64}
6165
66//-------------------------------------------------
67//  device_reset - device-specific reset
68//-------------------------------------------------
6269
63WRITE8_DEVICE_HANDLER( mathbox_go_w )
70void mathbox_device::device_reset()
6471{
65   mathbox_state *mb = get_safe_token(device);
72   m_result = 0;
73   memset(m_reg, 0, sizeof(INT16)*16);
74}
6675
76
77WRITE8_MEMBER( mathbox_device::go_w )
78{
6779   INT32 mb_temp;  /* temp 32-bit multiply results */
6880   INT16 mb_q;     /* temp used in division */
6981   int msb;
r23306r23307
7284
7385   switch (offset)
7486   {
75   case 0x00: mb->result = REG0 = (REG0 & 0xff00) | data;        break;
76   case 0x01: mb->result = REG0 = (REG0 & 0x00ff) | (data << 8); break;
77   case 0x02: mb->result = REG1 = (REG1 & 0xff00) | data;        break;
78   case 0x03: mb->result = REG1 = (REG1 & 0x00ff) | (data << 8); break;
79   case 0x04: mb->result = REG2 = (REG2 & 0xff00) | data;        break;
80   case 0x05: mb->result = REG2 = (REG2 & 0x00ff) | (data << 8); break;
81   case 0x06: mb->result = REG3 = (REG3 & 0xff00) | data;        break;
82   case 0x07: mb->result = REG3 = (REG3 & 0x00ff) | (data << 8); break;
83   case 0x08: mb->result = REG4 = (REG4 & 0xff00) | data;        break;
84   case 0x09: mb->result = REG4 = (REG4 & 0x00ff) | (data << 8); break;
87   case 0x00: m_result = REG0 = (REG0 & 0xff00) | data;        break;
88   case 0x01: m_result = REG0 = (REG0 & 0x00ff) | (data << 8); break;
89   case 0x02: m_result = REG1 = (REG1 & 0xff00) | data;        break;
90   case 0x03: m_result = REG1 = (REG1 & 0x00ff) | (data << 8); break;
91   case 0x04: m_result = REG2 = (REG2 & 0xff00) | data;        break;
92   case 0x05: m_result = REG2 = (REG2 & 0x00ff) | (data << 8); break;
93   case 0x06: m_result = REG3 = (REG3 & 0xff00) | data;        break;
94   case 0x07: m_result = REG3 = (REG3 & 0x00ff) | (data << 8); break;
95   case 0x08: m_result = REG4 = (REG4 & 0xff00) | data;        break;
96   case 0x09: m_result = REG4 = (REG4 & 0x00ff) | (data << 8); break;
8597
86   case 0x0a: mb->result = REG5 = (REG5 & 0xff00) | data;        break;
98   case 0x0a: m_result = REG5 = (REG5 & 0xff00) | data;        break;
8799      /* note: no function loads low part of REG5 without performing a computation */
88100
89   case 0x0c: mb->result = REG6 = data; break;
101   case 0x0c: m_result = REG6 = data; break;
90102      /* note: no function loads high part of REG6 */
91103
92   case 0x15: mb->result = REG7 = (REG7 & 0xff00) | data;        break;
93   case 0x16: mb->result = REG7 = (REG7 & 0x00ff) | (data << 8); break;
104   case 0x15: m_result = REG7 = (REG7 & 0xff00) | data;        break;
105   case 0x16: m_result = REG7 = (REG7 & 0x00ff) | (data << 8); break;
94106
95   case 0x1a: mb->result = REG8 = (REG8 & 0xff00) | data;        break;
96   case 0x1b: mb->result = REG8 = (REG8 & 0x00ff) | (data << 8); break;
107   case 0x1a: m_result = REG8 = (REG8 & 0xff00) | data;        break;
108   case 0x1b: m_result = REG8 = (REG8 & 0x00ff) | (data << 8); break;
97109
98   case 0x0d: mb->result = REGa = (REGa & 0xff00) | data;        break;
99   case 0x0e: mb->result = REGa = (REGa & 0x00ff) | (data << 8); break;
100   case 0x0f: mb->result = REGb = (REGb & 0xff00) | data;        break;
101   case 0x10: mb->result = REGb = (REGb & 0x00ff) | (data << 8); break;
110   case 0x0d: m_result = REGa = (REGa & 0xff00) | data;        break;
111   case 0x0e: m_result = REGa = (REGa & 0x00ff) | (data << 8); break;
112   case 0x0f: m_result = REGb = (REGb & 0xff00) | data;        break;
113   case 0x10: m_result = REGb = (REGb & 0x00ff) | (data << 8); break;
102114
103   case 0x17: mb->result = REG7; break;
104   case 0x19: mb->result = REG8; break;
105   case 0x18: mb->result = REG9; break;
115   case 0x17: m_result = REG7; break;
116   case 0x19: m_result = REG8; break;
117   case 0x18: m_result = REG9; break;
106118
107119   case 0x0b:
108120
r23306r23307
129141      REGc = (mb_q >> 1) & 0x7fff;
130142      mb_q = REGc + REGe;
131143      if (mb_q < 0)
132   REG7++;
144         REG7++;
133145
134      mb->result = REG7;
146      m_result = REG7;
135147
136148      if (REGf < 0)
137   break;
149         break;
138150
139151      REG7 += REG2;
140152
r23306r23307
157169      REGc = (mb_q >> 1) & 0x7fff;
158170      REG9 += REGc;
159171      if (REG9 < 0)
160   REG8++;
172         REG8++;
161173      REG9 <<= 1;  /* why? only to get the desired load address? */
162174
163      mb->result = REG8;
175      m_result = REG8;
164176
165177      if (REGf < 0)
166   break;
178         break;
167179
168180      REG8 += REG3;
169181
r23306r23307
186198      REGe = REG7 ^ mb_q;  /* save sign of result */
187199      REGd = mb_q;
188200      if (mb_q >= 0)
189   mb_q = REGc;
201         mb_q = REGc;
190202      else
191   {
192      REGd = - mb_q - 1;
193      mb_q = - REGc - 1;
194      if ((mb_q < 0) && ((mb_q + 1) < 0))
195      REGd++;
196      mb_q++;
197   }
203      {
204         REGd = - mb_q - 1;
205         mb_q = - REGc - 1;
206         if ((mb_q < 0) && ((mb_q + 1) < 0))
207            REGd++;
208         mb_q++;
209      }
198210
199211   /* step 0c9: */
200212      /* REGc = abs (REG7) */
201213      if (REG7 >= 0)
202   REGc = REG7;
214         REGc = REG7;
203215      else
204      REGc = -REG7;
216         REGc = -REG7;
205217
206218      REGf = REG6;  /* step counter */
207219
208220      do
209   {
210      REGd -= REGc;
211      msb = ((mb_q & 0x8000) != 0);
212      mb_q <<= 1;
213      if (REGd >= 0)
214      mb_q++;
215      else
216      REGd += REGc;
217      REGd <<= 1;
218      REGd += msb;
219   }
221      {
222         REGd -= REGc;
223         msb = ((mb_q & 0x8000) != 0);
224         mb_q <<= 1;
225         if (REGd >= 0)
226            mb_q++;
227         else
228            REGd += REGc;
229         REGd <<= 1;
230         REGd += msb;
231      }
220232      while (--REGf >= 0);
221233
222234      if (REGe >= 0)
223   mb->result = mb_q;
235         m_result = mb_q;
224236      else
225   mb->result = - mb_q;
237         m_result = - mb_q;
226238      break;
227239
228240   case 0x11:
r23306r23307
235247      /* window test? */
236248      REG5 = (REG5 & 0x00ff) | (data << 8);
237249      do
238   {
239      REGe = (REG4 + REG7) >> 1;
240      REGf = (REG5 + REG8) >> 1;
241      if ((REGb < REGe) && (REGf < REGe) && ((REGe + REGf) >= 0))
242      { REG7 = REGe; REG8 = REGf; }
243      else
244      { REG4 = REGe; REG5 = REGf; }
245   }
250      {
251         REGe = (REG4 + REG7) >> 1;
252         REGf = (REG5 + REG8) >> 1;
253         if ((REGb < REGe) && (REGf < REGe) && ((REGe + REGf) >= 0))
254         { REG7 = REGe; REG8 = REGf; }
255         else
256         { REG4 = REGe; REG5 = REGf; }
257      }
246258      while (--REG6 >= 0);
247259
248      mb->result = REG8;
260      m_result = REG8;
249261      break;
250262
251263   case 0x1d:
r23306r23307
253265
254266      REG2 -= REG0;
255267      if (REG2 < 0)
256   REG2 = -REG2;
268         REG2 = -REG2;
257269
258270      REG3 -= REG1;
259271      if (REG3 < 0)
260   REG3 = -REG3;
272         REG3 = -REG3;
261273
262274      /* fall into command 1e */
263275
r23306r23307
266278      if (REG3 >= REG2)
267279      { REGc = REG2; REGd = REG3; }
268280      else
269   { REGd = REG2; REGc = REG3; }
281      { REGd = REG2; REGc = REG3; }
270282      REGc >>= 2;
271283      REGd += REGc;
272284      REGc >>= 1;
273      mb->result = REGd = (REGc + REGd);
285      m_result = REGd = (REGc + REGd);
274286      break;
275287
276288   case 0x1f:
r23306r23307
279291      break;
280292   }
281293
282   LOG(("  result %04x\n", mb->result & 0xffff));
294   LOG(("  result %04x\n", m_result & 0xffff));
283295}
284296
285READ8_DEVICE_HANDLER( mathbox_status_r )
297READ8_MEMBER( mathbox_device::status_r )
286298{
287299   return 0x00; /* always done! */
288300}
289301
290READ8_DEVICE_HANDLER( mathbox_lo_r )
302READ8_MEMBER( mathbox_device::lo_r )
291303{
292   mathbox_state *mb = get_safe_token(device);
293
294   return mb->result & 0xff;
304   return m_result & 0xff;
295305}
296306
297READ8_DEVICE_HANDLER( mathbox_hi_r )
307READ8_MEMBER( mathbox_device::hi_r )
298308{
299   mathbox_state *mb = get_safe_token(device);
300
301   return (mb->result >> 8) & 0xff;
309   return (m_result >> 8) & 0xff;
302310}
303
304
305
306/***************************************************************************
307    DEVICE INTERFACE
308***************************************************************************/
309
310/*-------------------------------------------------
311    mathbox_portb_r - return port B output
312    value
313-------------------------------------------------*/
314
315static DEVICE_START( mathbox )
316{
317   mathbox_state *mb = get_safe_token(device);
318
319   /* validate arguments */
320   assert(device != NULL);
321
322   /* set static values */
323   mb->device = device;
324
325   /* register for save states */
326   device->save_item(NAME(mb->result));
327   device->save_item(NAME(mb->reg));
328}
329
330
331static DEVICE_RESET( mathbox )
332{
333   mathbox_state *mb = get_safe_token(device);
334
335   mb->result = 0;
336   memset(mb->reg, 0, sizeof(INT16)*16);
337}
338
339
340const device_type MATHBOX = &device_creator<mathbox_device>;
341
342mathbox_device::mathbox_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
343   : device_t(mconfig, MATHBOX, "MATHBOX", tag, owner, clock)
344{
345   m_token = global_alloc_clear(mathbox_state);
346}
347
348//-------------------------------------------------
349//  device_config_complete - perform any
350//  operations now that the configuration is
351//  complete
352//-------------------------------------------------
353
354void mathbox_device::device_config_complete()
355{
356}
357
358//-------------------------------------------------
359//  device_start - device-specific startup
360//-------------------------------------------------
361
362void mathbox_device::device_start()
363{
364   DEVICE_START_NAME( mathbox )(this);
365}
366
367//-------------------------------------------------
368//  device_reset - device-specific reset
369//-------------------------------------------------
370
371void mathbox_device::device_reset()
372{
373   DEVICE_RESET_NAME( mathbox )(this);
374}
trunk/src/mame/machine/mathbox.h
r23306r23307
55 *
66 */
77
8#include "devlegcy.h"
9
108/***************************************************************************
119    DEVICE CONFIGURATION MACROS
1210***************************************************************************/
1311
1412#define MCFG_MATHBOX_ADD(_tag) \
1513   MCFG_DEVICE_ADD(_tag, MATHBOX, 0)
14   
1615
17
18
19/***************************************************************************
20    FUNCTION PROTOTYPES
21***************************************************************************/
22
23DECLARE_WRITE8_DEVICE_HANDLER( mathbox_go_w );
24DECLARE_READ8_DEVICE_HANDLER( mathbox_status_r );
25DECLARE_READ8_DEVICE_HANDLER( mathbox_lo_r );
26DECLARE_READ8_DEVICE_HANDLER( mathbox_hi_r );
27
2816/* ----- device interface ----- */
2917class mathbox_device : public device_t
3018{
3119public:
3220   mathbox_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
33   ~mathbox_device() { global_free(m_token); }
21   
22   DECLARE_WRITE8_MEMBER( go_w );
23   DECLARE_READ8_MEMBER( status_r );
24   DECLARE_READ8_MEMBER( lo_r );
25   DECLARE_READ8_MEMBER( hi_r );
3426
35   // access to legacy token
36   void *token() const { assert(m_token != NULL); return m_token; }
3727protected:
3828   // device-level overrides
3929   virtual void device_config_complete();
4030   virtual void device_start();
4131   virtual void device_reset();
42private:
32
33   private:
4334   // internal state
44   void *m_token;
35
36   /* math box scratch registers */
37   INT16 m_reg[16];
38
39   /* math box result */
40   INT16 m_result;
4541};
4642
4743extern const device_type MATHBOX;
trunk/src/mame/includes/fgoal.h
r23306r23307
1#include "machine/mb14241.h"
12
2
33class fgoal_state : public driver_device
44{
55public:
r23306r23307
1111   fgoal_state(const machine_config &mconfig, device_type type, const char *tag)
1212      : driver_device(mconfig, type, tag),
1313      m_video_ram(*this, "video_ram"),
14      m_maincpu(*this, "maincpu"){ }
14      m_maincpu(*this, "maincpu"),
15      m_mb14241(*this, "mb14241")
16      { }
1517
1618   /* memory pointers */
1719   required_shared_ptr<UINT8> m_video_ram;
r23306r23307
3133
3234   /* devices */
3335   required_device<cpu_device> m_maincpu;
34   device_t *m_mb14241;
36   required_device<mb14241_device> m_mb14241;
3537   DECLARE_READ8_MEMBER(fgoal_analog_r);
3638   DECLARE_READ8_MEMBER(fgoal_nmi_reset_r);
3739   DECLARE_READ8_MEMBER(fgoal_irq_reset_r);
trunk/src/mame/includes/bzone.h
r23306r23307
44
55*************************************************************************/
66
7#include "audio/redbaron.h"
8#include "machine/mathbox.h"
79#include "sound/discrete.h"
810
911#define BZONE_MASTER_CLOCK (XTAL_12_096MHz)
r23306r23307
1416public:
1517   bzone_state(const machine_config &mconfig, device_type type, const char *tag)
1618      : driver_device(mconfig, type, tag),
17         m_discrete(*this, "discrete") ,
18      m_maincpu(*this, "maincpu") { }
19
19      m_maincpu(*this, "maincpu"),
20      m_mathbox(*this, "mathbox"),
21      m_discrete(*this, "discrete"),
22      m_redbaronsound(*this, "custom")
23      { }
24   
25   required_device<cpu_device> m_maincpu;
26   required_device<mathbox_device> m_mathbox;
2027   optional_device<discrete_device> m_discrete;
28   optional_device<redbaron_sound_device> m_redbaronsound;
2129
2230   UINT8 m_analog_data;
2331   UINT8 m_rb_input_select;
r23306r23307
3240   DECLARE_MACHINE_START(redbaron);
3341   INTERRUPT_GEN_MEMBER(bzone_interrupt);
3442   DECLARE_WRITE8_MEMBER(bzone_sounds_w);
35   required_device<cpu_device> m_maincpu;
3643};
3744
3845
r23306r23307
4047MACHINE_CONFIG_EXTERN( bzone_audio );
4148
4249
43/*----------- defined in audio/redbaron.c -----------*/
4450
45//**************************************************************************
46//  TYPE DEFINITIONS
47//**************************************************************************
4851
49// ======================> redbaron_sound_device
50
51class redbaron_sound_device : public device_t,
52                        public device_sound_interface
53{
54public:
55   redbaron_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
56   ~redbaron_sound_device() { }
57
58protected:
59   // device-level overrides
60   virtual void device_start();
61
62   // sound stream update overrides
63   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
64
65public:
66   DECLARE_WRITE8_MEMBER( redbaron_sounds_w );
67
68private:
69   INT16 *m_vol_lookup;
70
71   INT16 m_vol_crash[16];
72
73   sound_stream *m_channel;
74   int m_latch;
75   int m_poly_counter;
76   int m_poly_shift;
77
78   int m_filter_counter;
79
80   int m_crash_amp;
81   int m_shot_amp;
82   int m_shot_amp_counter;
83
84   int m_squeal_amp;
85   int m_squeal_amp_counter;
86   int m_squeal_off_counter;
87   int m_squeal_on_counter;
88   int m_squeal_out;
89};
90
91extern const device_type REDBARON;
trunk/src/mame/includes/mw8080bw.h
r23306r23307
44
55****************************************************************************/
66
7#include "machine/mb14241.h"
78#include "sound/discrete.h"
89#include "sound/sn76477.h"
910#include "sound/samples.h"
r23306r23307
3738   mw8080bw_state(const machine_config &mconfig, device_type type, const char *tag)
3839      : driver_device(mconfig, type, tag),
3940      m_maincpu(*this,"maincpu"),
41      m_mb14241(*this,"mb14241"),
4042      m_main_ram(*this, "main_ram"),
4143      m_colorram(*this, "colorram"),
4244      m_discrete(*this, "discrete"),
r23306r23307
4749
4850   /* device/memory pointers */
4951   required_device<cpu_device> m_maincpu;
52   optional_device<mb14241_device> m_mb14241;
5053   required_shared_ptr<UINT8> m_main_ram;
5154   optional_shared_ptr<UINT8> m_colorram;
5255   optional_device<discrete_device> m_discrete;
r23306r23307
7578   emu_timer   *m_interrupt_timer;
7679
7780   /* other devices */
78   device_t *m_mb14241;
7981   optional_device<samples_device> m_samples;
8082   optional_device<samples_device> m_samples1;
8183   optional_device<samples_device> m_samples2;
trunk/src/mame/drivers/mw8080bw.c
r23306r23307
148148#include "emu.h"
149149#include "cpu/i8085/i8085.h"
150150#include "machine/rescap.h"
151#include "machine/mb14241.h"
152151#include "includes/mw8080bw.h"
153152
154153#include "280zzzap.lh"
r23306r23307
173172
174173READ8_MEMBER(mw8080bw_state::mw8080bw_shift_result_rev_r)
175174{
176   UINT8 ret = mb14241_shift_result_r(m_mb14241, space, 0);
175   UINT8 ret = m_mb14241->shift_result_r(space, 0);
177176
178177   return BITSWAP8(ret,0,1,2,3,4,5,6,7);
179178}
r23306r23307
189188   }
190189   else
191190   {
192      ret = mb14241_shift_result_r(m_mb14241, space, 0);
191      ret = m_mb14241->shift_result_r(space, 0);
193192   }
194193
195194   return ret;
r23306r23307
197196
198197WRITE8_MEMBER(mw8080bw_state::mw8080bw_reversable_shift_count_w)
199198{
200   mb14241_shift_count_w(m_mb14241, space, offset, data);
199   m_mb14241->shift_count_w(space, offset, data);
201200
202201   m_rev_shift_res = data & 0x08;
203202}
r23306r23307
331330   AM_RANGE(0x00, 0x00) AM_MIRROR(0x04) AM_READ(mw8080bw_shift_result_rev_r)
332331   AM_RANGE(0x01, 0x01) AM_MIRROR(0x04) AM_READ_PORT("IN0")
333332   AM_RANGE(0x02, 0x02) AM_MIRROR(0x04) AM_READ_PORT("IN1")
334   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r)
333   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD("mb14241", mb14241_device, shift_result_r)
335334
336335   AM_RANGE(0x01, 0x01) AM_WRITE(seawolf_explosion_lamp_w)
337336   AM_RANGE(0x02, 0x02) AM_WRITE(seawolf_periscope_lamp_w)
338   AM_RANGE(0x03, 0x03) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
339   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
337   AM_RANGE(0x03, 0x03) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
338   AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
340339   AM_RANGE(0x05, 0x05) AM_WRITE(seawolf_audio_w)
341340ADDRESS_MAP_END
342341
r23306r23307
430429      gunfight_audio_w(space, 0, data);
431430
432431   if (offset & 0x02)
433      mb14241_shift_count_w(m_mb14241, space, 0, data);
432      m_mb14241->shift_count_w(space, 0, data);
434433
435434   if (offset & 0x04)
436      mb14241_shift_data_w(m_mb14241, space, 0, data);
435      m_mb14241->shift_data_w(space, 0, data);
437436
438437}
439438
r23306r23307
443442   AM_RANGE(0x00, 0x00) AM_MIRROR(0x04) AM_READ_PORT("IN0")
444443   AM_RANGE(0x01, 0x01) AM_MIRROR(0x04) AM_READ_PORT("IN1")
445444   AM_RANGE(0x02, 0x02) AM_MIRROR(0x04) AM_READ_PORT("IN2")
446   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r)
445   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD("mb14241", mb14241_device, shift_result_r)
447446
448447   /* no decoder, just 3 AND gates */
449448   AM_RANGE(0x00, 0x07) AM_WRITE(gunfight_io_w)
r23306r23307
625624      tornbase_audio_w(space, 0, data);
626625
627626   if (offset & 0x02)
628      mb14241_shift_count_w(m_mb14241, space, 0, data);
627      m_mb14241->shift_count_w(space, 0, data);
629628
630629   if (offset & 0x04)
631      mb14241_shift_data_w(m_mb14241, space, 0, data);
630      m_mb14241->shift_data_w(space, 0, data);
632631}
633632
634633
r23306r23307
637636   AM_RANGE(0x00, 0x00) AM_MIRROR(0x04) AM_READ_PORT("IN0")
638637   AM_RANGE(0x01, 0x01) AM_MIRROR(0x04) AM_READ_PORT("IN1")
639638   AM_RANGE(0x02, 0x02) AM_MIRROR(0x04) AM_READ_PORT("IN2")
640   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r)
639   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD("mb14241", mb14241_device, shift_result_r)
641640
642641   /* no decoder, just 3 AND gates */
643642   AM_RANGE(0x00, 0x07) AM_WRITE(tornbase_io_w)
r23306r23307
757756   AM_RANGE(0x00, 0x00) AM_MIRROR(0x04) AM_READ_PORT("IN0")
758757   AM_RANGE(0x01, 0x01) AM_MIRROR(0x04) AM_READ_PORT("IN1")
759758   AM_RANGE(0x02, 0x02) AM_MIRROR(0x04) AM_READ_PORT("IN2")
760   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r)
759   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD("mb14241", mb14241_device, shift_result_r)
761760
762761   AM_RANGE(0x02, 0x02) AM_WRITE(zzzap_audio_1_w)
763   AM_RANGE(0x03, 0x03) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
764   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
762   AM_RANGE(0x03, 0x03) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
763   AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
765764   AM_RANGE(0x05, 0x05) AM_WRITE(zzzap_audio_2_w)
766765   AM_RANGE(0x07, 0x07) AM_WRITE(watchdog_reset_w)
767766ADDRESS_MAP_END
r23306r23307
983982   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_READ(mw8080bw_reversable_shift_result_r)
984983
985984   AM_RANGE(0x01, 0x01) AM_WRITE(mw8080bw_reversable_shift_count_w)
986   AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
985   AM_RANGE(0x02, 0x02) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
987986   AM_RANGE(0x03, 0x03) AM_WRITE(boothill_audio_w)
988987   AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
989988   AM_RANGE(0x05, 0x05) AM_WRITE(midway_tone_generator_lo_w)
r23306r23307
12041203   AM_RANGE(0x00, 0x00) AM_MIRROR(0x04) AM_READ(mw8080bw_shift_result_rev_r)
12051204   AM_RANGE(0x01, 0x01) AM_MIRROR(0x04) AM_READ_PORT("IN0")
12061205   AM_RANGE(0x02, 0x02) AM_MIRROR(0x04) AM_READ_PORT("IN1")
1207   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r)
1206   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD("mb14241", mb14241_device, shift_result_r)
12081207
1209   AM_RANGE(0x01, 0x01) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
1210   AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
1208   AM_RANGE(0x01, 0x01) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
1209   AM_RANGE(0x02, 0x02) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
12111210   AM_RANGE(0x03, 0x03) AM_WRITE(desertgu_audio_1_w)
12121211   AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
12131212   AM_RANGE(0x05, 0x05) AM_WRITE(midway_tone_generator_lo_w)
r23306r23307
13261325   AM_RANGE(0x00, 0x00) AM_MIRROR(0x04) AM_READ_PORT("IN0")
13271326   AM_RANGE(0x01, 0x01) AM_MIRROR(0x04) AM_READ_PORT("IN1")
13281327   AM_RANGE(0x02, 0x02) AM_MIRROR(0x04) AM_READ_PORT("IN2")
1329   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r)
1328   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD("mb14241", mb14241_device, shift_result_r)
13301329
1331   AM_RANGE(0x01, 0x01) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
1332   AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
1330   AM_RANGE(0x01, 0x01) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
1331   AM_RANGE(0x02, 0x02) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
13331332   AM_RANGE(0x03, 0x03) AM_WRITE(dplay_audio_w)
13341333   AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
13351334   AM_RANGE(0x05, 0x05) AM_WRITE(midway_tone_generator_lo_w)
r23306r23307
15051504   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_READ(mw8080bw_reversable_shift_result_r)
15061505
15071506   AM_RANGE(0x01, 0x01) AM_WRITE(mw8080bw_reversable_shift_count_w)
1508   AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
1507   AM_RANGE(0x02, 0x02) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
15091508   AM_RANGE(0x03, 0x03) AM_WRITE(gmissile_audio_1_w)
15101509   AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
15111510   AM_RANGE(0x05, 0x05) AM_WRITE(gmissile_audio_2_w)
r23306r23307
15991598   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_READ(mw8080bw_reversable_shift_result_r)
16001599
16011600   AM_RANGE(0x01, 0x01) AM_WRITE(mw8080bw_reversable_shift_count_w)
1602   AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
1601   AM_RANGE(0x02, 0x02) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
16031602   AM_RANGE(0x03, 0x03) AM_WRITE(m4_audio_1_w)
16041603   AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
16051604   AM_RANGE(0x05, 0x05) AM_WRITE(m4_audio_2_w)
r23306r23307
17091708   AM_RANGE(0x00, 0x00) AM_MIRROR(0x04) AM_READ_PORT("IN0")
17101709   AM_RANGE(0x01, 0x01) AM_MIRROR(0x04) AM_READ_PORT("IN1")
17111710   AM_RANGE(0x02, 0x02) AM_MIRROR(0x04) AM_READ_PORT("IN2")
1712   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r)
1711   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD("mb14241", mb14241_device, shift_result_r)
17131712
1714   AM_RANGE(0x01, 0x01) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
1715   AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
1713   AM_RANGE(0x01, 0x01) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
1714   AM_RANGE(0x02, 0x02) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
17161715   AM_RANGE(0x03, 0x03) AM_WRITE(clowns_audio_1_w)
17171716   AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
17181717   AM_RANGE(0x05, 0x05) AM_WRITE(midway_tone_generator_lo_w)
r23306r23307
18471846   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
18481847   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
18491848   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2")
1850   AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r)
1849   AM_RANGE(0x03, 0x03) AM_DEVREAD("mb14241", mb14241_device, shift_result_r)
18511850
1852   AM_RANGE(0x01, 0x01) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
1853   AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
1851   AM_RANGE(0x01, 0x01) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
1852   AM_RANGE(0x02, 0x02) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
18541853   AM_RANGE(0x03, 0x03) AM_WRITE(spacwalk_audio_1_w)
18551854   AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
18561855   AM_RANGE(0x05, 0x05) AM_WRITE(midway_tone_generator_lo_w)
r23306r23307
19371936
19381937static ADDRESS_MAP_START( shuffle_io_map, AS_IO, 8, mw8080bw_state )
19391938   ADDRESS_MAP_GLOBAL_MASK(0xf)    /* yes, 4, and no mirroring on the read handlers */
1940   AM_RANGE(0x01, 0x01) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r)
1939   AM_RANGE(0x01, 0x01) AM_DEVREAD("mb14241", mb14241_device, shift_result_r)
19411940   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN0")
19421941   AM_RANGE(0x03, 0x03) AM_READ(mw8080bw_shift_result_rev_r)
19431942   AM_RANGE(0x04, 0x04) AM_READ_PORT("IN1")
19441943   AM_RANGE(0x05, 0x05) AM_READ_PORT("IN2")
19451944   AM_RANGE(0x06, 0x06) AM_READ_PORT("IN3")
19461945
1947   AM_RANGE(0x01, 0x01) AM_MIRROR(0x08) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
1948   AM_RANGE(0x02, 0x02) AM_MIRROR(0x08) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
1946   AM_RANGE(0x01, 0x01) AM_MIRROR(0x08) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
1947   AM_RANGE(0x02, 0x02) AM_MIRROR(0x08) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
19491948   AM_RANGE(0x04, 0x04) AM_MIRROR(0x08) AM_WRITE(watchdog_reset_w)
19501949   AM_RANGE(0x05, 0x05) AM_MIRROR(0x08) AM_WRITE(shuffle_audio_1_w)
19511950   AM_RANGE(0x06, 0x06) AM_MIRROR(0x08) AM_WRITE(shuffle_audio_2_w)
r23306r23307
20202019   AM_RANGE(0x00, 0x00) AM_MIRROR(0x04) AM_READ_PORT("IN0")
20212020   AM_RANGE(0x01, 0x01) AM_MIRROR(0x04) AM_READ_PORT("IN1")
20222021   AM_RANGE(0x02, 0x02) AM_MIRROR(0x04) AM_READ_PORT("IN2")
2023   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r)
2022   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD("mb14241", mb14241_device, shift_result_r)
20242023
2025   AM_RANGE(0x01, 0x01) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
2026   AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
2024   AM_RANGE(0x01, 0x01) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
2025   AM_RANGE(0x02, 0x02) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
20272026   AM_RANGE(0x03, 0x03) AM_WRITE(dogpatch_audio_w)
20282027   AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
20292028   AM_RANGE(0x05, 0x05) AM_WRITE(midway_tone_generator_lo_w)
r23306r23307
22812280   AM_RANGE(0x00, 0x00) AM_MIRROR(0x04) AM_READ(mw8080bw_shift_result_rev_r)
22822281   AM_RANGE(0x01, 0x01) AM_MIRROR(0x04) AM_READ_PORT("IN0")
22832282   AM_RANGE(0x02, 0x02) AM_MIRROR(0x04) AM_READ_PORT("IN1")
2284   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r)
2283   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD("mb14241", mb14241_device, shift_result_r)
22852284
2286   AM_RANGE(0x01, 0x01) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
2287   AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
2285   AM_RANGE(0x01, 0x01) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
2286   AM_RANGE(0x02, 0x02) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
22882287   AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
22892288   AM_RANGE(0x05, 0x05) AM_WRITE(phantom2_audio_1_w)
22902289   AM_RANGE(0x06, 0x06) AM_WRITE(phantom2_audio_2_w)
r23306r23307
23622361      anything unusual on the schematics that would cause
23632362      the bits to flip */
23642363
2365   return ~mb14241_shift_result_r(m_mb14241, space, 0);
2364   return ~m_mb14241->shift_result_r(space, 0);
23662365}
23672366
23682367WRITE8_MEMBER(mw8080bw_state::bowler_lights_1_w)
r23306r23307
24102409   AM_RANGE(0x05, 0x05) AM_READ_PORT("IN2")
24112410   AM_RANGE(0x06, 0x06) AM_READ_PORT("IN3")
24122411
2413   AM_RANGE(0x01, 0x01) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
2414   AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
2412   AM_RANGE(0x01, 0x01) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
2413   AM_RANGE(0x02, 0x02) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
24152414   AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
24162415   AM_RANGE(0x05, 0x05) AM_WRITE(bowler_audio_1_w)
24172416   AM_RANGE(0x06, 0x06) AM_WRITE(bowler_audio_2_w)
r23306r23307
25902589   AM_RANGE(0x00, 0x00) AM_MIRROR(0x04) AM_READ_PORT("IN0")
25912590   AM_RANGE(0x01, 0x01) AM_MIRROR(0x04) AM_READ_PORT("IN1")
25922591   AM_RANGE(0x02, 0x02) AM_MIRROR(0x04) AM_READ_PORT("IN2")
2593   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r)
2592   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD("mb14241", mb14241_device, shift_result_r)
25942593
2595   AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
2594   AM_RANGE(0x02, 0x02) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
25962595   AM_RANGE(0x03, 0x03) AM_WRITE(invaders_audio_1_w)
2597   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
2596   AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
25982597   AM_RANGE(0x05, 0x05) AM_WRITE(invaders_audio_2_w)
25992598   AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
26002599ADDRESS_MAP_END
r23306r23307
27212720   AM_RANGE(0x00, 0x00) AM_MIRROR(0x04) AM_READ(mw8080bw_shift_result_rev_r)
27222721   AM_RANGE(0x01, 0x01) AM_MIRROR(0x04) AM_READ_PORT("IN0")
27232722   AM_RANGE(0x02, 0x02) AM_MIRROR(0x04) AM_READ_PORT("IN1")
2724   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r)
2723   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD("mb14241", mb14241_device, shift_result_r)
27252724
2726   AM_RANGE(0x01, 0x01) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
2727   AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
2725   AM_RANGE(0x01, 0x01) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
2726   AM_RANGE(0x02, 0x02) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
27282727   AM_RANGE(0x03, 0x03) AM_WRITE(blueshrk_audio_w)
27292728   AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
27302729ADDRESS_MAP_END
r23306r23307
28012800   AM_RANGE(0x00, 0x00) AM_MIRROR(0x04) AM_READ_PORT("IN0")
28022801   AM_RANGE(0x01, 0x01) AM_MIRROR(0x04) AM_READ_PORT("IN1")
28032802   AM_RANGE(0x02, 0x02) AM_MIRROR(0x04) AM_READ_PORT("IN2")
2804   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r)
2803   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD("mb14241", mb14241_device, shift_result_r)
28052804
28062805   AM_RANGE(0x01, 0x01) AM_WRITE(invad2ct_audio_3_w)
2807   AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
2806   AM_RANGE(0x02, 0x02) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
28082807   AM_RANGE(0x03, 0x03) AM_WRITE(invad2ct_audio_1_w)
2809   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
2808   AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
28102809   AM_RANGE(0x05, 0x05) AM_WRITE(invad2ct_audio_2_w)
28112810   AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
28122811   AM_RANGE(0x07, 0x07) AM_WRITE(invad2ct_audio_4_w)
trunk/src/mame/drivers/tempest.c
r23306r23307
287287public:
288288   tempest_state(const machine_config &mconfig, device_type type, const char *tag)
289289      : driver_device(mconfig, type, tag),
290      m_maincpu(*this, "maincpu") { }
290      m_maincpu(*this, "maincpu"),
291      m_mathbox(*this, "mathbox")   { }
291292
293   required_device<cpu_device> m_maincpu;
294   required_device<mathbox_device> m_mathbox;
295   
292296   UINT8 m_player_select;
293297   DECLARE_WRITE8_MEMBER(wdclr_w);
294298   DECLARE_WRITE8_MEMBER(tempest_led_w);
r23306r23307
299303   DECLARE_READ8_MEMBER(input_port_1_bit_r);
300304   DECLARE_READ8_MEMBER(input_port_2_bit_r);
301305   virtual void machine_start();
302   required_device<cpu_device> m_maincpu;
303306};
304307
305308
r23306r23307
412415   AM_RANGE(0x5000, 0x5000) AM_WRITE(wdclr_w)
413416   AM_RANGE(0x5800, 0x5800) AM_WRITE_LEGACY(avgdvg_reset_w)
414417   AM_RANGE(0x6000, 0x603f) AM_DEVWRITE("earom", atari_vg_earom_device, write)
415   AM_RANGE(0x6040, 0x6040) AM_DEVREAD_LEGACY("mathbox", mathbox_status_r) AM_DEVWRITE("earom", atari_vg_earom_device, ctrl_w)
418   AM_RANGE(0x6040, 0x6040) AM_DEVREAD("mathbox", mathbox_device, status_r) AM_DEVWRITE("earom", atari_vg_earom_device, ctrl_w)
416419   AM_RANGE(0x6050, 0x6050) AM_DEVREAD("earom", atari_vg_earom_device, read)
417   AM_RANGE(0x6060, 0x6060) AM_DEVREAD_LEGACY("mathbox", mathbox_lo_r)
418   AM_RANGE(0x6070, 0x6070) AM_DEVREAD_LEGACY("mathbox", mathbox_hi_r)
419   AM_RANGE(0x6080, 0x609f) AM_DEVWRITE_LEGACY("mathbox", mathbox_go_w)
420   AM_RANGE(0x6060, 0x6060) AM_DEVREAD("mathbox", mathbox_device, lo_r)
421   AM_RANGE(0x6070, 0x6070) AM_DEVREAD("mathbox", mathbox_device, hi_r)
422   AM_RANGE(0x6080, 0x609f) AM_DEVWRITE("mathbox", mathbox_device, go_w)
420423   AM_RANGE(0x60c0, 0x60cf) AM_DEVREADWRITE("pokey1", pokey_device, read, write)
421424   AM_RANGE(0x60d0, 0x60df) AM_DEVREADWRITE("pokey2", pokey_device, read, write)
422425   AM_RANGE(0x60e0, 0x60e0) AM_WRITE(tempest_led_w)
trunk/src/mame/drivers/bzone.c
r23306r23307
208208#include "cpu/m6502/m6502.h"
209209#include "video/vector.h"
210210#include "video/avgdvg.h"
211#include "machine/mathbox.h"
212211#include "machine/atari_vg.h"
213212#include "includes/bzone.h"
214213#include "sound/pokey.h"
r23306r23307
283282
284283WRITE8_MEMBER(bzone_state::redbaron_joysound_w)
285284{
286   redbaron_sound_device *device = machine().device<redbaron_sound_device>("custom");
287285   m_rb_input_select = data & 1;
288   device->redbaron_sounds_w(space, offset, data);
286   m_redbaronsound->sounds_w(space, offset, data);
289287}
290288
291289
r23306r23307
306304   AM_RANGE(0x1200, 0x1200) AM_WRITE_LEGACY(avgdvg_go_w)
307305   AM_RANGE(0x1400, 0x1400) AM_WRITE(watchdog_reset_w)
308306   AM_RANGE(0x1600, 0x1600) AM_WRITE_LEGACY(avgdvg_reset_w)
309   AM_RANGE(0x1800, 0x1800) AM_DEVREAD_LEGACY("mathbox", mathbox_status_r)
310   AM_RANGE(0x1810, 0x1810) AM_DEVREAD_LEGACY("mathbox", mathbox_lo_r)
311   AM_RANGE(0x1818, 0x1818) AM_DEVREAD_LEGACY("mathbox", mathbox_hi_r)
307   AM_RANGE(0x1800, 0x1800) AM_DEVREAD("mathbox", mathbox_device, status_r)
308   AM_RANGE(0x1810, 0x1810) AM_DEVREAD("mathbox", mathbox_device, lo_r)
309   AM_RANGE(0x1818, 0x1818) AM_DEVREAD("mathbox", mathbox_device, hi_r)
312310   AM_RANGE(0x1820, 0x182f) AM_DEVREADWRITE("pokey", pokey_device, read, write)
313311   AM_RANGE(0x1840, 0x1840) AM_WRITE(bzone_sounds_w)
314   AM_RANGE(0x1860, 0x187f) AM_DEVWRITE_LEGACY("mathbox", mathbox_go_w)
312   AM_RANGE(0x1860, 0x187f) AM_DEVWRITE("mathbox", mathbox_device, go_w)
315313   AM_RANGE(0x2000, 0x2fff) AM_RAM AM_SHARE("vectorram") AM_REGION("maincpu", 0x2000)
316314   AM_RANGE(0x3000, 0x7fff) AM_ROM
317315ADDRESS_MAP_END
r23306r23307
326324   AM_RANGE(0x1200, 0x1200) AM_WRITE_LEGACY(avgdvg_go_w)
327325   AM_RANGE(0x1400, 0x1400) AM_WRITE(watchdog_reset_w)
328326   AM_RANGE(0x1600, 0x1600) AM_WRITE_LEGACY(avgdvg_reset_w)
329   AM_RANGE(0x1800, 0x1800) AM_DEVREAD_LEGACY("mathbox", mathbox_status_r)
327   AM_RANGE(0x1800, 0x1800) AM_DEVREAD("mathbox", mathbox_device, status_r)
330328   AM_RANGE(0x1802, 0x1802) AM_READ_PORT("IN4")
331   AM_RANGE(0x1804, 0x1804) AM_DEVREAD_LEGACY("mathbox", mathbox_lo_r)
332   AM_RANGE(0x1806, 0x1806) AM_DEVREAD_LEGACY("mathbox", mathbox_hi_r)
329   AM_RANGE(0x1804, 0x1804) AM_DEVREAD("mathbox", mathbox_device, lo_r)
330   AM_RANGE(0x1806, 0x1806) AM_DEVREAD("mathbox", mathbox_device, hi_r)
333331   AM_RANGE(0x1808, 0x1808) AM_WRITE(redbaron_joysound_w)  /* and select joystick pot also */
334332   AM_RANGE(0x180a, 0x180a) AM_WRITENOP                /* sound reset, yet todo */
335333   AM_RANGE(0x180c, 0x180c) AM_DEVWRITE("earom", atari_vg_earom_device, ctrl_w)
336334   AM_RANGE(0x1810, 0x181f) AM_DEVREADWRITE("pokey", pokey_device, read, write)
337335   AM_RANGE(0x1820, 0x185f) AM_DEVREADWRITE("earom", atari_vg_earom_device, read, write)
338   AM_RANGE(0x1860, 0x187f) AM_DEVWRITE_LEGACY("mathbox", mathbox_go_w)
336   AM_RANGE(0x1860, 0x187f) AM_DEVWRITE("mathbox", mathbox_device, go_w)
339337   AM_RANGE(0x2000, 0x2fff) AM_RAM AM_SHARE("vectorram") AM_REGION("maincpu", 0x2000)
340338   AM_RANGE(0x3000, 0x7fff) AM_ROM
341339ADDRESS_MAP_END
trunk/src/mame/drivers/fgoal.c
r23306r23307
1818
1919#include "emu.h"
2020#include "cpu/m6800/m6800.h"
21#include "machine/mb14241.h"
2221#include "includes/fgoal.h"
2322
2423
r23306r23307
147146WRITE8_MEMBER(fgoal_state::fgoal_row_w)
148147{
149148   m_row = data;
150   mb14241_shift_data_w(m_mb14241, space, 0, 0);
149   m_mb14241->shift_data_w(space, 0, 0);
151150}
152151
153152WRITE8_MEMBER(fgoal_state::fgoal_col_w)
154153{
155154   m_col = data;
156   mb14241_shift_count_w(m_mb14241, space, 0, data);
155   m_mb14241->shift_count_w(space, 0, data);
157156}
158157
159158READ8_MEMBER(fgoal_state::fgoal_address_hi_r)
r23306r23307
168167
169168READ8_MEMBER(fgoal_state::fgoal_shifter_r)
170169{
171   UINT8 v = mb14241_shift_result_r(m_mb14241, space, 0);
170   UINT8 v = m_mb14241->shift_result_r(space, 0);
172171
173172   return BITSWAP8(v, 7, 6, 5, 4, 3, 2, 1, 0);
174173}
175174
176175READ8_MEMBER(fgoal_state::fgoal_shifter_reverse_r)
177176{
178   UINT8 v = mb14241_shift_result_r(m_mb14241, space, 0);
177   UINT8 v = m_mb14241->shift_result_r(space, 0);
179178
180179   return BITSWAP8(v, 0, 1, 2, 3, 4, 5, 6, 7);
181180}
r23306r23307
225224   AM_RANGE(0x00f1, 0x00f1) AM_WRITE(fgoal_col_w)
226225   AM_RANGE(0x00f2, 0x00f2) AM_WRITE(fgoal_row_w)
227226   AM_RANGE(0x00f3, 0x00f3) AM_WRITE(fgoal_col_w)
228   AM_RANGE(0x00f4, 0x00f7) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
227   AM_RANGE(0x00f4, 0x00f7) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
229228   AM_RANGE(0x00f8, 0x00fb) AM_WRITE(fgoal_sound1_w)
230229   AM_RANGE(0x00fc, 0x00ff) AM_WRITE(fgoal_sound2_w)
231230
r23306r23307
339338
340339void fgoal_state::machine_start()
341340{
342   m_mb14241 = machine().device("mb14241");
343
344341   save_item(NAME(m_xpos));
345342   save_item(NAME(m_ypos));
346343   save_item(NAME(m_current_color));
trunk/src/mame/drivers/8080bw.c
r23306r23307
175175#include "emu.h"
176176#include "cpu/m6800/m6800.h"
177177#include "cpu/i8085/i8085.h"
178#include "machine/mb14241.h"
179178#include "machine/eeprom.h"
180179#include "sound/ay8910.h"
181180#include "sound/speaker.h"
r23306r23307
350349static ADDRESS_MAP_START( invadpt2_io_map, AS_IO, 8, _8080bw_state )
351350   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
352351   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
353   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
354   AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE(invadpt2_sh_port_1_w)
355   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
352   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
353   AM_RANGE(0x03, 0x03) AM_DEVREAD("mb14241", mb14241_device, shift_result_r) AM_WRITE(invadpt2_sh_port_1_w)
354   AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
356355   AM_RANGE(0x05, 0x05) AM_WRITE(invadpt2_sh_port_2_w)
357356   AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
358357ADDRESS_MAP_END
r23306r23307
416415static ADDRESS_MAP_START( spacerng_io_map, AS_IO, 8, _8080bw_state )
417416   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
418417   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
419   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
420   AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE(invadpt2_sh_port_1_w)
421   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
418   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
419   AM_RANGE(0x03, 0x03) AM_DEVREAD("mb14241", mb14241_device, shift_result_r) AM_WRITE(invadpt2_sh_port_1_w)
420   AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
422421   AM_RANGE(0x05, 0x05) AM_WRITE(spacerng_sh_port_2_w)
423422   AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
424423ADDRESS_MAP_END
r23306r23307
441440static ADDRESS_MAP_START( spcewars_io_map, AS_IO, 8, _8080bw_state )
442441   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
443442   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
444   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
445   AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE(spcewars_sh_port_w)
446   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
443   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
444   AM_RANGE(0x03, 0x03) AM_DEVREAD("mb14241", mb14241_device, shift_result_r) AM_WRITE(spcewars_sh_port_w)
445   AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
447446   AM_RANGE(0x05, 0x05) AM_WRITE(invadpt2_sh_port_2_w)
448447ADDRESS_MAP_END
449448
r23306r23307
794793static ADDRESS_MAP_START( invrvnge_io_map, AS_IO, 8, _8080bw_state )
795794   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
796795   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
797   AM_RANGE(0x02, 0x02) AM_READ(invrvnge_02_r) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
798   AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE(invrvnge_sh_port_1_w)
799   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
796   AM_RANGE(0x02, 0x02) AM_READ(invrvnge_02_r) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
797   AM_RANGE(0x03, 0x03) AM_DEVREAD("mb14241", mb14241_device, shift_result_r) AM_WRITE(invrvnge_sh_port_1_w)
798   AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
800799   AM_RANGE(0x05, 0x05) AM_WRITE(invrvnge_sh_port_2_w)
801800   AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
802801ADDRESS_MAP_END
r23306r23307
10031002static ADDRESS_MAP_START( lrescue_io_map, AS_IO, 8, _8080bw_state )
10041003   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
10051004   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
1006   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
1007   AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE(lrescue_sh_port_1_w)
1008   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
1005   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
1006   AM_RANGE(0x03, 0x03) AM_DEVREAD("mb14241", mb14241_device, shift_result_r) AM_WRITE(lrescue_sh_port_1_w)
1007   AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
10091008   AM_RANGE(0x05, 0x05) AM_WRITE(lrescue_sh_port_2_w)
10101009ADDRESS_MAP_END
10111010
r23306r23307
11011100   AM_RANGE(0x00, 0x00) AM_MIRROR(0x04) AM_READ_PORT("IN0")
11021101   AM_RANGE(0x01, 0x01) AM_MIRROR(0x04) AM_READ_PORT("IN1")
11031102   AM_RANGE(0x02, 0x02) AM_MIRROR(0x04) AM_READ(invrvnge_02_r)
1104   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r)
1103   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_DEVREAD("mb14241", mb14241_device, shift_result_r)
11051104
1106   AM_RANGE(0x02, 0x02) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
1105   AM_RANGE(0x02, 0x02) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
11071106   AM_RANGE(0x03, 0x03) AM_WRITE(invaders_audio_1_w)
1108   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
1107   AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
11091108   AM_RANGE(0x05, 0x05) AM_WRITE(cosmicmo_05_w)
11101109   AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
11111110ADDRESS_MAP_END
r23306r23307
12071206static ADDRESS_MAP_START( rollingc_io_map, AS_IO, 8, _8080bw_state )
12081207   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_WRITE(rollingc_sh_port_w)
12091208   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
1210   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
1211   AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE(invadpt2_sh_port_1_w)
1212   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
1209   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
1210   AM_RANGE(0x03, 0x03) AM_DEVREAD("mb14241", mb14241_device, shift_result_r) AM_WRITE(invadpt2_sh_port_1_w)
1211   AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
12131212   AM_RANGE(0x05, 0x05) AM_WRITE(invadpt2_sh_port_2_w)
12141213ADDRESS_MAP_END
12151214
r23306r23307
12661265static ADDRESS_MAP_START( schaser_io_map, AS_IO, 8, _8080bw_state )
12671266   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
12681267   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
1269   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
1270   AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE(schaser_sh_port_1_w)
1271   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
1268   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
1269   AM_RANGE(0x03, 0x03) AM_DEVREAD("mb14241", mb14241_device, shift_result_r) AM_WRITE(schaser_sh_port_1_w)
1270   AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
12721271   AM_RANGE(0x05, 0x05) AM_WRITE(schaser_sh_port_2_w)
12731272   AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
12741273ADDRESS_MAP_END
r23306r23307
13901389static ADDRESS_MAP_START( schasercv_io_map, AS_IO, 8, _8080bw_state )
13911390   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
13921391   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
1393   AM_RANGE(0x02, 0x02) AM_READ(schasercv_02_r) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
1394   AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE(schasercv_sh_port_1_w)
1395   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
1392   AM_RANGE(0x02, 0x02) AM_READ(schasercv_02_r) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
1393   AM_RANGE(0x03, 0x03) AM_DEVREAD("mb14241", mb14241_device, shift_result_r) AM_WRITE(schasercv_sh_port_1_w)
1394   AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
13961395   AM_RANGE(0x05, 0x05) AM_WRITE(schasercv_sh_port_2_w)
13971396ADDRESS_MAP_END
13981397
r23306r23307
14751474   AM_RANGE(0x0000, 0x1fff) AM_RAM
14761475   AM_RANGE(0x4000, 0x5fff) AM_RAM AM_SHARE("main_ram")
14771476   AM_RANGE(0x8008, 0x8008) AM_READ_PORT("PADDLE")
1478   AM_RANGE(0x8009, 0x8009) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r)
1477   AM_RANGE(0x8009, 0x8009) AM_DEVREAD("mb14241", mb14241_device, shift_result_r)
14791478   AM_RANGE(0x800a, 0x800a) AM_READ_PORT("IN2")
14801479   AM_RANGE(0x800b, 0x800b) AM_READ_PORT("IN0")
1481   AM_RANGE(0x8018, 0x8018) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
1482   AM_RANGE(0x8019, 0x8019) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
1480   AM_RANGE(0x8018, 0x8018) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
1481   AM_RANGE(0x8019, 0x8019) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
14831482   AM_RANGE(0x801a, 0x801a) AM_WRITENOP
14841483   AM_RANGE(0x801c, 0x801c) AM_WRITENOP
14851484   AM_RANGE(0x801d, 0x801d) AM_WRITENOP
r23306r23307
15551554static ADDRESS_MAP_START( lupin3_io_map, AS_IO, 8, _8080bw_state )
15561555   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_WRITE(lupin3_00_w)
15571556   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
1558   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
1559   AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE(lupin3_sh_port_1_w)
1560   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
1557   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
1558   AM_RANGE(0x03, 0x03) AM_DEVREAD("mb14241", mb14241_device, shift_result_r) AM_WRITE(lupin3_sh_port_1_w)
1559   AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
15611560   AM_RANGE(0x05, 0x05) AM_WRITE(lupin3_sh_port_2_w)
15621561   AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
15631562ADDRESS_MAP_END
r23306r23307
17171716// It sounds better then the actual circuit used.
17181717// Probably an unfinished feature.
17191718static ADDRESS_MAP_START( polaris_io_map, AS_IO, 8, _8080bw_state )
1720   AM_RANGE(0x00, 0x00) AM_READ(polaris_port00_r) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
1719   AM_RANGE(0x00, 0x00) AM_READ(polaris_port00_r) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
17211720   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
17221721   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_WRITE(polaris_sh_port_1_w)
1723   AM_RANGE(0x03, 0x03) AM_DEVREADWRITE_LEGACY("mb14241", mb14241_shift_result_r, mb14241_shift_data_w)
1722   AM_RANGE(0x03, 0x03) AM_DEVREADWRITE("mb14241", mb14241_device, shift_result_r, shift_data_w)
17241723   AM_RANGE(0x04, 0x04) AM_WRITE(polaris_sh_port_2_w)
17251724   AM_RANGE(0x05, 0x05) AM_WRITE(watchdog_reset_w)
17261725   AM_RANGE(0x06, 0x06) AM_WRITE(polaris_sh_port_3_w)
r23306r23307
18901889static ADDRESS_MAP_START( ballbomb_io_map, AS_IO, 8, _8080bw_state )
18911890   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
18921891   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") AM_WRITE(ballbomb_01_w)
1893   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
1894   AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE(ballbomb_sh_port_1_w)
1895   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
1892   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
1893   AM_RANGE(0x03, 0x03) AM_DEVREAD("mb14241", mb14241_device, shift_result_r) AM_WRITE(ballbomb_sh_port_1_w)
1894   AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
18961895   AM_RANGE(0x05, 0x05) AM_WRITE(ballbomb_sh_port_2_w)
18971896ADDRESS_MAP_END
18981897
r23306r23307
21292128static ADDRESS_MAP_START( indianbt_io_map, AS_IO, 8, _8080bw_state )
21302129   AM_RANGE(0x00, 0x00) AM_READ(indianbt_r)
21312130   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
2132   AM_RANGE(0x02, 0x02) AM_READ(invrvnge_02_r) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
2133   AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE(indianbt_sh_port_1_w)
2134   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
2131   AM_RANGE(0x02, 0x02) AM_READ(invrvnge_02_r) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
2132   AM_RANGE(0x03, 0x03) AM_DEVREAD("mb14241", mb14241_device, shift_result_r) AM_WRITE(indianbt_sh_port_1_w)
2133   AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
21352134   AM_RANGE(0x05, 0x05) AM_WRITE(indianbt_sh_port_2_w)
21362135   AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
21372136   AM_RANGE(0x07, 0x07) AM_WRITE(indianbt_sh_port_3_w)
r23306r23307
21402139static ADDRESS_MAP_START( indianbtbr_io_map, AS_IO, 8, _8080bw_state )
21412140   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
21422141   AM_RANGE(0x01, 0x01) AM_READ(indianbtbr_01_r)
2143   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
2144   AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE(indianbtbr_sh_port_1_w)
2145   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
2142   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
2143   AM_RANGE(0x03, 0x03) AM_DEVREAD("mb14241", mb14241_device, shift_result_r) AM_WRITE(indianbtbr_sh_port_1_w)
2144   AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
21462145   AM_RANGE(0x05, 0x05) AM_WRITE(indianbtbr_sh_port_2_w)
21472146   AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
21482147   AM_RANGE(0x07, 0x07) AM_WRITENOP
r23306r23307
22052204
22062205static ADDRESS_MAP_START( steelwkr_io_map, AS_IO, 8, _8080bw_state )
22072206   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
2208   AM_RANGE(0x02, 0x02) AM_READ(invrvnge_02_r) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
2209   AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE(invadpt2_sh_port_1_w)
2210   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
2207   AM_RANGE(0x02, 0x02) AM_READ(invrvnge_02_r) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
2208   AM_RANGE(0x03, 0x03) AM_DEVREAD("mb14241", mb14241_device, shift_result_r) AM_WRITE(invadpt2_sh_port_1_w)
2209   AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
22112210   AM_RANGE(0x05, 0x05) AM_WRITE(invadpt2_sh_port_2_w)
22122211   AM_RANGE(0x06, 0x06) AM_WRITE(steelwkr_sh_port_3_w)
22132212ADDRESS_MAP_END
r23306r23307
25752574   AM_RANGE(0x02, 0x02) AM_MIRROR(0x04) AM_READ_PORT("IN0")
25762575   AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_READ_PORT("IN1")
25772576   AM_RANGE(0x00, 0x00) AM_MIRROR(0x04) AM_READ_PORT("IN2")
2578   AM_RANGE(0x01, 0x01) AM_MIRROR(0x04) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r)
2577   AM_RANGE(0x01, 0x01) AM_MIRROR(0x04) AM_DEVREAD("mb14241", mb14241_device, shift_result_r)
25792578
2580   AM_RANGE(0x00, 0x00) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
2579   AM_RANGE(0x00, 0x00) AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
25812580   AM_RANGE(0x01, 0x01) AM_WRITE(invaders_audio_1_w)
2582   AM_RANGE(0x06, 0x06) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
2581   AM_RANGE(0x06, 0x06) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
25832582   AM_RANGE(0x07, 0x07) AM_WRITE(invaders_audio_2_w)
25842583   AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
25852584ADDRESS_MAP_END
r23306r23307
28582857
28592858static ADDRESS_MAP_START( claybust_io_map, AS_IO, 8, _8080bw_state )
28602859   //AM_RANGE(0x00, 0x00) AM_WRITENOP // ?
2861   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
2862   AM_RANGE(0x02, 0x02) AM_READ(claybust_gun_lo_r) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
2863   AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) //AM_WRITENOP // port3 write looks sound-related
2860   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
2861   AM_RANGE(0x02, 0x02) AM_READ(claybust_gun_lo_r) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
2862   AM_RANGE(0x03, 0x03) AM_DEVREAD("mb14241", mb14241_device, shift_result_r) //AM_WRITENOP // port3 write looks sound-related
28642863   AM_RANGE(0x04, 0x04) AM_WRITE(watchdog_reset_w)
28652864   //AM_RANGE(0x05, 0x05) AM_WRITENOP // ?
28662865   AM_RANGE(0x06, 0x06) AM_READ(claybust_gun_hi_r)
r23306r23307
29502949static ADDRESS_MAP_START( galactic_io_map, AS_IO, 8, _8080bw_state )
29512950   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
29522951   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
2953   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_count_w)
2954   AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY("mb14241", mb14241_shift_result_r) AM_WRITE(galactic_sh_port_1_w)
2955   AM_RANGE(0x04, 0x04) AM_DEVWRITE_LEGACY("mb14241", mb14241_shift_data_w)
2952   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_DEVWRITE("mb14241", mb14241_device, shift_count_w)
2953   AM_RANGE(0x03, 0x03) AM_DEVREAD("mb14241", mb14241_device, shift_result_r) AM_WRITE(galactic_sh_port_1_w)
2954   AM_RANGE(0x04, 0x04) AM_DEVWRITE("mb14241", mb14241_device, shift_data_w)
29562955   AM_RANGE(0x05, 0x05) AM_WRITE(galactic_sh_port_2_w)
29572956   AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w)
29582957   AM_RANGE(0x07, 0x07) AM_WRITE(galactic_07_w)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team