Previous 15994 Revisions Next

r11557 Monday 16th May, 2011 at 10:30:13 UTC by Miodrag Milanović
Sync with MAME r12542 (no whatsnew)
[src/emu]emu.mak
[src/emu/cpu]cpu.mak
[src/emu/cpu/i386]i386dasm.c
[src/emu/cpu/nec]necdasm.c
[src/emu/cpu/psx]dma.c irq.c* irq.h* mdec.c psx.c psx.h rcnt.c* rcnt.h* sio.c* sio.h*
[src/emu/debug]debugcmd.c
[src/emu/machine]k053252.c* k053252.h*
[src/mame]mame.lst
[src/mame/drivers]cps1.c cps3.c dbz.c hexion.c konamigx.c midtunit.c midwunit.c midyunit.c moo.c mystwarr.c namcos12.c overdriv.c qdrmfgp.c rollerg.c rungun.c tx1.c vendetta.c xexex.c
[src/mame/includes]psx.h tx1.h
[src/mame/machine]psx.c
[src/mame/video]galivan.c konicdev.c konicdev.h tx1.c

src/mame/mame.lst
r11556r11557
33883388fgtlayer      // 1998.12 Fighting Layer (Japan, FTL0/VER.A)
33893389            // 1999.01 Bust A Move (Metro)
33903390ptblank2      // 1999.?? Point Blank 2 (GNB5/VER.A)
3391gunbarl         // 1999.?? Gunbarl (Japan, GNB4/VER.A)
33913392sws99         // 1999.05 Super World Stadium '99 (Japan, SS91/VER.A3)
33923393ghlpanic      // 1999.?? Ghoul Panic (Asia, OB2/VER.A)
33933394            // 1999.07 Oh Bakyuun (Japan, OB1)
src/mame/machine/psx.c
r11556r11557
22
33  machine/psx.c
44
5  Thanks to Olivier Galibert for IDCT information
6
75***************************************************************************/
86
97#include "emu.h"
r11556r11557
4341
4442/* IRQ */
4543
46static void psx_irq_update( psx_machine *p_psx )
47{
48   if( ( p_psx->n_irqdata & p_psx->n_irqmask ) != 0 )
49   {
50      verboselog( p_psx, 2, "psx irq assert\n" );
51      cputag_set_input_line( p_psx->machine(), "maincpu", PSXCPU_IRQ0, ASSERT_LINE );
52   }
53   else
54   {
55      verboselog( p_psx, 2, "psx irq clear\n" );
56      cputag_set_input_line( p_psx->machine(), "maincpu", PSXCPU_IRQ0, CLEAR_LINE );
57   }
58}
59
60WRITE32_HANDLER( psx_irq_w )
61{
62   psx_machine *p_psx = space->machine().driver_data<psx_state>()->m_p_psx;
63
64   switch( offset )
65   {
66   case 0x00:
67      verboselog( p_psx, 2, "psx irq data ( %08x, %08x ) %08x -> %08x\n", data, mem_mask, p_psx->n_irqdata, ( p_psx->n_irqdata & ~mem_mask ) | ( p_psx->n_irqdata & p_psx->n_irqmask & data ) );
68      p_psx->n_irqdata = ( p_psx->n_irqdata & ~mem_mask ) | ( p_psx->n_irqdata & p_psx->n_irqmask & data );
69      psx_irq_update(p_psx);
70      break;
71   case 0x01:
72      verboselog( p_psx, 2, "psx irq mask ( %08x, %08x ) %08x -> %08x\n", data, mem_mask, p_psx->n_irqmask, ( p_psx->n_irqmask & ~mem_mask ) | data );
73      p_psx->n_irqmask = ( p_psx->n_irqmask & ~mem_mask ) | data;
74      if( ( p_psx->n_irqmask &~ PSX_IRQ_MASK ) != 0 )
75      {
76         verboselog( p_psx, 0, "psx_irq_w( %08x, %08x, %08x ) unknown irq\n", offset, data, mem_mask );
77      }
78      psx_irq_update(p_psx);
79      break;
80   default:
81      verboselog( p_psx, 0, "psx_irq_w( %08x, %08x, %08x ) unknown register\n", offset, data, mem_mask );
82      break;
83   }
84}
85
86READ32_HANDLER( psx_irq_r )
87{
88   psx_machine *p_psx = space->machine().driver_data<psx_state>()->m_p_psx;
89
90   switch( offset )
91   {
92   case 0x00:
93      verboselog( p_psx, 1, "psx_irq_r irq data %08x\n", p_psx->n_irqdata );
94      return p_psx->n_irqdata;
95   case 0x01:
96      verboselog( p_psx, 1, "psx_irq_r irq mask %08x\n", p_psx->n_irqmask );
97      return p_psx->n_irqmask;
98   default:
99      verboselog( p_psx, 0, "psx_irq_r unknown register %d\n", offset );
100      break;
101   }
102   return 0;
103}
104
10544void psx_irq_set( running_machine &machine, UINT32 data )
10645{
107   psx_machine *p_psx = machine.driver_data<psx_state>()->m_p_psx;
108
109   verboselog( p_psx, 2, "psx_irq_set %08x\n", data );
110   p_psx->n_irqdata |= data;
111   psx_irq_update(p_psx);
46   psxcpu_device::irq_set( *machine.device("maincpu"), "maincpu", data );
11247}
11348
11449/* DMA */
r11556r11557
12358   psxcpu_device::install_dma_write_handler( *machine.device("maincpu"), "maincpu", n_channel, p_fn_dma_write );
12459}
12560
126/* Root Counters */
127
128static UINT64 psxcpu_gettotalcycles( psx_machine *p_psx )
61void psx_sio_install_handler( running_machine &machine, int n_port, psx_sio_handler p_f_sio_handler )
12962{
130   /* TODO: should return the start of the current tick. */
131   return p_psx->machine().firstcpu->total_cycles() * 2;
63   psxcpu_device::install_sio_handler( *machine.device("maincpu"), "maincpu", n_port, p_f_sio_handler );
13264}
13365
134static int root_divider( psx_machine *p_psx, int n_counter )
135{
136   psx_root *root = &p_psx->root[ n_counter ];
137
138   if( n_counter == 0 && ( root->n_mode & PSX_RC_CLC ) != 0 )
139   {
140      /* TODO: pixel clock, probably based on resolution */
141      return 5;
142   }
143   else if( n_counter == 1 && ( root->n_mode & PSX_RC_CLC ) != 0 )
144   {
145      return 2150;
146   }
147   else if( n_counter == 2 && ( root->n_mode & PSX_RC_DIV ) != 0 )
148   {
149      return 8;
150   }
151   return 1;
152}
153
154static UINT16 root_current( psx_machine *p_psx, int n_counter )
155{
156   psx_root *root = &p_psx->root[ n_counter ];
157
158   if( ( root->n_mode & PSX_RC_STOP ) != 0 )
159   {
160      return root->n_count;
161   }
162   else
163   {
164      UINT64 n_current;
165      n_current = psxcpu_gettotalcycles(p_psx) - root->n_start;
166      n_current /= root_divider( p_psx, n_counter );
167      n_current += root->n_count;
168      if( n_current > 0xffff )
169      {
170         /* TODO: use timer for wrap on 0x10000. */
171         root->n_count = n_current;
172         root->n_start = psxcpu_gettotalcycles(p_psx);
173      }
174      return n_current;
175   }
176}
177
178static int root_target( psx_machine *p_psx, int n_counter )
179{
180   psx_root *root = &p_psx->root[ n_counter ];
181
182   if( ( root->n_mode & PSX_RC_COUNTTARGET ) != 0 ||
183      ( root->n_mode & PSX_RC_IRQTARGET ) != 0 )
184   {
185      return root->n_target;
186   }
187   return 0x10000;
188}
189
190static void root_timer_adjust( psx_machine *p_psx, int n_counter )
191{
192   psx_root *root = &p_psx->root[ n_counter ];
193
194   if( ( root->n_mode & PSX_RC_STOP ) != 0 )
195   {
196      root->timer->adjust( attotime::never, n_counter);
197   }
198   else
199   {
200      int n_duration;
201
202      n_duration = root_target( p_psx, n_counter ) - root_current( p_psx, n_counter );
203      if( n_duration < 1 )
204      {
205         n_duration += 0x10000;
206      }
207
208      n_duration *= root_divider( p_psx, n_counter );
209
210      root->timer->adjust( attotime::from_hz(33868800) * n_duration, n_counter);
211   }
212}
213
214static TIMER_CALLBACK( root_finished )
215{
216   psx_machine *p_psx = machine.driver_data<psx_state>()->m_p_psx;
217   int n_counter = param;
218   psx_root *root = &p_psx->root[ n_counter ];
219
220   verboselog( p_psx, 2, "root_finished( %d ) %04x\n", n_counter, root_current( p_psx, n_counter ) );
221   //if( ( root->n_mode & PSX_RC_COUNTTARGET ) != 0 )
222   {
223      /* TODO: wrap should be handled differently as PSX_RC_COUNTTARGET & PSX_RC_IRQTARGET don't have to be the same. */
224      root->n_count = 0;
225      root->n_start = psxcpu_gettotalcycles(p_psx);
226   }
227   if( ( root->n_mode & PSX_RC_REPEAT ) != 0 )
228   {
229      root_timer_adjust( p_psx, n_counter );
230   }
231   if( ( root->n_mode & PSX_RC_IRQOVERFLOW ) != 0 ||
232      ( root->n_mode & PSX_RC_IRQTARGET ) != 0 )
233   {
234      psx_irq_set( machine, PSX_IRQ_ROOTCOUNTER0 << n_counter );
235   }
236}
237
238WRITE32_HANDLER( psx_counter_w )
239{
240   psx_machine *p_psx = space->machine().driver_data<psx_state>()->m_p_psx;
241   int n_counter = offset / 4;
242   psx_root *root = &p_psx->root[ n_counter ];
243
244   verboselog( p_psx, 1, "psx_counter_w ( %08x, %08x, %08x )\n", offset, data, mem_mask );
245
246   switch( offset % 4 )
247   {
248   case 0:
249      root->n_count = data;
250      root->n_start = psxcpu_gettotalcycles(p_psx);
251      break;
252   case 1:
253      root->n_count = root_current( p_psx, n_counter );
254      root->n_start = psxcpu_gettotalcycles(p_psx);
255
256      if( ( data & PSX_RC_RESET ) != 0 )
257      {
258         data &= ~( PSX_RC_RESET | PSX_RC_STOP );
259         root->n_count = 0;
260      }
261
262      root->n_mode = data;
263
264#if 0
265      if( ( data & 0xfca6 ) != 0 ||
266         ( ( data & 0x0100 ) != 0 && n_counter != 0 && n_counter != 1 ) ||
267         ( ( data & 0x0200 ) != 0 && n_counter != 2 ) )
268      {
269         mame_printf_debug( "mode %d 0x%04x\n", n_counter, data & 0xfca6 );
270      }
271#endif
272      break;
273   case 2:
274      root->n_target = data;
275      break;
276   default:
277      verboselog( p_psx, 0, "psx_counter_w( %08x, %08x, %08x ) unknown register\n", offset, mem_mask, data );
278      return;
279   }
280
281   root_timer_adjust( p_psx, n_counter );
282}
283
284READ32_HANDLER( psx_counter_r )
285{
286   psx_machine *p_psx = space->machine().driver_data<psx_state>()->m_p_psx;
287   int n_counter = offset / 4;
288   psx_root *root = &p_psx->root[ n_counter ];
289   UINT32 data;
290
291   switch( offset % 4 )
292   {
293   case 0:
294      data = root_current( p_psx, n_counter );
295      break;
296   case 1:
297      data = root->n_mode;
298      break;
299   case 2:
300      data = root->n_target;
301      break;
302   default:
303      verboselog( p_psx, 0, "psx_counter_r( %08x, %08x ) unknown register\n", offset, mem_mask );
304      return 0;
305   }
306   verboselog( p_psx, 1, "psx_counter_r ( %08x, %08x ) %08x\n", offset, mem_mask, data );
307   return data;
308}
309
310/* SIO */
311
312static void sio_interrupt( psx_machine *p_psx, int n_port )
313{
314   psx_sio *sio = &p_psx->sio[ n_port ];
315
316   verboselog( p_psx, 1, "sio_interrupt( %d )\n", n_port );
317   sio->n_status |= SIO_STATUS_IRQ;
318   if( n_port == 0 )
319   {
320      psx_irq_set( p_psx->machine(), PSX_IRQ_SIO0 );
321   }
322   else
323   {
324      psx_irq_set( p_psx->machine(), PSX_IRQ_SIO1 );
325   }
326}
327
328static void sio_timer_adjust( psx_machine *p_psx, int n_port )
329{
330   psx_sio *sio = &p_psx->sio[ n_port ];
331   attotime n_time;
332
333   if( ( sio->n_status & SIO_STATUS_TX_EMPTY ) == 0 || sio->n_tx_bits != 0 )
334   {
335      int n_prescaler;
336
337      switch( sio->n_mode & 3 )
338      {
339      case 1:
340         n_prescaler = 1;
341         break;
342      case 2:
343         n_prescaler = 16;
344         break;
345      case 3:
346         n_prescaler = 64;
347         break;
348      default:
349         n_prescaler = 0;
350         break;
351      }
352
353      if( sio->n_baud != 0 && n_prescaler != 0 )
354      {
355         n_time = attotime::from_hz(33868800) * (n_prescaler * sio->n_baud);
356         verboselog( p_psx, 2, "sio_timer_adjust( %d ) = %s ( %d x %d )\n", n_port, n_time.as_string(), n_prescaler, sio->n_baud );
357      }
358      else
359      {
360         n_time = attotime::never;
361         verboselog( p_psx, 0, "sio_timer_adjust( %d ) invalid baud rate ( %d x %d )\n", n_port, n_prescaler, sio->n_baud );
362      }
363   }
364   else
365   {
366      n_time = attotime::never;
367      verboselog( p_psx, 2, "sio_timer_adjust( %d ) finished\n", n_port );
368   }
369   sio->timer->adjust( n_time, n_port);
370}
371
372static TIMER_CALLBACK( sio_clock )
373{
374   psx_machine *p_psx = machine.driver_data<psx_state>()->m_p_psx;
375   int n_port = param;
376   psx_sio *sio = &p_psx->sio[ n_port ];
377   verboselog( p_psx, 2, "sio tick\n" );
378
379   if( sio->n_tx_bits == 0 &&
380      ( sio->n_control & SIO_CONTROL_TX_ENA ) != 0 &&
381      ( sio->n_status & SIO_STATUS_TX_EMPTY ) == 0 )
382   {
383      sio->n_tx_bits = 8;
384      sio->n_tx_shift = sio->n_tx_data;
385      if( n_port == 0 )
386      {
387         sio->n_rx_bits = 8;
388         sio->n_rx_shift = 0;
389      }
390      sio->n_status |= SIO_STATUS_TX_EMPTY;
391      sio->n_status |= SIO_STATUS_TX_RDY;
392   }
393
394   if( sio->n_tx_bits != 0 )
395   {
396      sio->n_tx = ( sio->n_tx & ~PSX_SIO_OUT_DATA ) | ( ( sio->n_tx_shift & 1 ) * PSX_SIO_OUT_DATA );
397      sio->n_tx_shift >>= 1;
398      sio->n_tx_bits--;
399
400      if( sio->fn_handler != NULL )
401      {
402         if( n_port == 0 )
403         {
404            sio->n_tx &= ~PSX_SIO_OUT_CLOCK;
405            (*sio->fn_handler)( machine, sio->n_tx );
406            sio->n_tx |= PSX_SIO_OUT_CLOCK;
407         }
408         (*sio->fn_handler)( machine, sio->n_tx );
409      }
410
411      if( sio->n_tx_bits == 0 &&
412         ( sio->n_control & SIO_CONTROL_TX_IENA ) != 0 )
413      {
414         sio_interrupt( p_psx, n_port );
415      }
416   }
417
418   if( sio->n_rx_bits != 0 )
419   {
420      sio->n_rx_shift = ( sio->n_rx_shift >> 1 ) | ( ( ( sio->n_rx & PSX_SIO_IN_DATA ) / PSX_SIO_IN_DATA ) << 7 );
421      sio->n_rx_bits--;
422
423      if( sio->n_rx_bits == 0 )
424      {
425         if( ( sio->n_status & SIO_STATUS_RX_RDY ) != 0 )
426         {
427            sio->n_status |= SIO_STATUS_OVERRUN;
428         }
429         else
430         {
431            sio->n_rx_data = sio->n_rx_shift;
432            sio->n_status |= SIO_STATUS_RX_RDY;
433         }
434         if( ( sio->n_control & SIO_CONTROL_RX_IENA ) != 0 )
435         {
436            sio_interrupt( p_psx, n_port );
437         }
438      }
439   }
440
441   sio_timer_adjust( p_psx, n_port );
442}
443
44466void psx_sio_input( running_machine &machine, int n_port, int n_mask, int n_data )
44567{
446   psx_machine *p_psx = machine.driver_data<psx_state>()->m_p_psx;
447   psx_sio *sio = &p_psx->sio[ n_port ];
448   verboselog( p_psx, 1, "psx_sio_input( %d, %02x, %02x )\n", n_port, n_mask, n_data );
449   sio->n_rx = ( sio->n_rx & ~n_mask ) | ( n_data & n_mask );
450
451   if( ( sio->n_rx & PSX_SIO_IN_DSR ) != 0 )
452   {
453      sio->n_status |= SIO_STATUS_DSR;
454      if( ( sio->n_rx_prev & PSX_SIO_IN_DSR ) == 0 &&
455         ( sio->n_control & SIO_CONTROL_DSR_IENA ) != 0 )
456      {
457         sio_interrupt( p_psx, n_port );
458      }
459   }
460   else
461   {
462      sio->n_status &= ~SIO_STATUS_DSR;
463   }
464   sio->n_rx_prev = sio->n_rx;
68   psxcpu_device::sio_input( *machine.device("maincpu"), "maincpu", n_port, n_mask, n_data );
46569}
46670
467WRITE32_HANDLER( psx_sio_w )
468{
469   psx_machine *p_psx = space->machine().driver_data<psx_state>()->m_p_psx;
470   int n_port = offset / 4;
471   psx_sio *sio = &p_psx->sio[ n_port ];
472
473   switch( offset % 4 )
474   {
475   case 0:
476      verboselog( p_psx, 1, "psx_sio_w %d data %02x (%08x)\n", n_port, data, mem_mask );
477      sio->n_tx_data = data;
478      sio->n_status &= ~( SIO_STATUS_TX_RDY );
479      sio->n_status &= ~( SIO_STATUS_TX_EMPTY );
480      sio_timer_adjust( p_psx, n_port );
481      break;
482   case 1:
483      verboselog( p_psx, 0, "psx_sio_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
484      break;
485   case 2:
486      if( ACCESSING_BITS_0_15 )
487      {
488         sio->n_mode = data & 0xffff;
489         verboselog( p_psx, 1, "psx_sio_w %d mode %04x\n", n_port, data & 0xffff );
490      }
491      if( ACCESSING_BITS_16_31 )
492      {
493         verboselog( p_psx, 1, "psx_sio_w %d control %04x\n", n_port, data >> 16 );
494         sio->n_control = data >> 16;
495
496         if( ( sio->n_control & SIO_CONTROL_RESET ) != 0 )
497         {
498            verboselog( p_psx, 1, "psx_sio_w reset\n" );
499            sio->n_status |= SIO_STATUS_TX_EMPTY | SIO_STATUS_TX_RDY;
500            sio->n_status &= ~( SIO_STATUS_RX_RDY | SIO_STATUS_OVERRUN | SIO_STATUS_IRQ );
501         }
502         if( ( sio->n_control & SIO_CONTROL_IACK ) != 0 )
503         {
504            verboselog( p_psx, 1, "psx_sio_w iack\n" );
505            sio->n_status &= ~( SIO_STATUS_IRQ );
506            sio->n_control &= ~( SIO_CONTROL_IACK );
507         }
508         if( ( sio->n_control & SIO_CONTROL_DTR ) != 0 )
509         {
510            sio->n_tx |= PSX_SIO_OUT_DTR;
511         }
512         else
513         {
514            sio->n_tx &= ~PSX_SIO_OUT_DTR;
515         }
516
517         if( ( ( sio->n_tx ^ sio->n_tx_prev ) & PSX_SIO_OUT_DTR ) != 0 )
518         {
519            if( sio->fn_handler != NULL )
520            {
521               (*sio->fn_handler)( space->machine(), sio->n_tx );
522            }
523         }
524         sio->n_tx_prev = sio->n_tx;
525
526      }
527      break;
528   case 3:
529      if( ACCESSING_BITS_0_15 )
530      {
531         verboselog( p_psx, 0, "psx_sio_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
532      }
533      if( ACCESSING_BITS_16_31 )
534      {
535         sio->n_baud = data >> 16;
536         verboselog( p_psx, 1, "psx_sio_w %d baud %04x\n", n_port, data >> 16 );
537      }
538      break;
539   default:
540      verboselog( p_psx, 0, "psx_sio_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
541      break;
542   }
543}
544
545READ32_HANDLER( psx_sio_r )
546{
547   psx_machine *p_psx = space->machine().driver_data<psx_state>()->m_p_psx;
548   int n_port = offset / 4;
549   psx_sio *sio = &p_psx->sio[ n_port ];
550   UINT32 data;
551
552   switch( offset % 4 )
553   {
554   case 0:
555      data = sio->n_rx_data;
556      sio->n_status &= ~( SIO_STATUS_RX_RDY );
557      sio->n_rx_data = 0xff;
558      verboselog( p_psx, 1, "psx_sio_r %d data %02x (%08x)\n", n_port, data, mem_mask );
559      break;
560   case 1:
561      data = sio->n_status;
562      if( ACCESSING_BITS_0_15 )
563      {
564         verboselog( p_psx, 1, "psx_sio_r %d status %04x\n", n_port, data & 0xffff );
565      }
566      if( ACCESSING_BITS_16_31 )
567      {
568         verboselog( p_psx, 0, "psx_sio_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
569      }
570      break;
571   case 2:
572      data = ( sio->n_control << 16 ) | sio->n_mode;
573      if( ACCESSING_BITS_0_15 )
574      {
575         verboselog( p_psx, 1, "psx_sio_r %d mode %04x\n", n_port, data & 0xffff );
576      }
577      if( ACCESSING_BITS_16_31 )
578      {
579         verboselog( p_psx, 1, "psx_sio_r %d control %04x\n", n_port, data >> 16 );
580      }
581      break;
582   case 3:
583      data = sio->n_baud << 16;
584      if( ACCESSING_BITS_0_15 )
585      {
586         verboselog( p_psx, 0, "psx_sio_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
587      }
588      if( ACCESSING_BITS_16_31 )
589      {
590         verboselog( p_psx, 1, "psx_sio_r %d baud %04x\n", n_port, data >> 16 );
591      }
592      break;
593   default:
594      data = 0;
595      verboselog( p_psx, 0, "psx_sio_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
596      break;
597   }
598   return data;
599}
600
601void psx_sio_install_handler( running_machine &machine, int n_port, psx_sio_handler p_f_sio_handler )
602{
603   psx_machine *p_psx = machine.driver_data<psx_state>()->m_p_psx;
604
605   p_psx->sio[ n_port ].fn_handler = p_f_sio_handler;
606}
607
60871static void gpu_read( psx_state *state, UINT32 n_address, INT32 n_size )
60972{
61073   psx_machine *p_psx = state->m_p_psx;
r11556r11557
62386
62487void psx_machine_init( running_machine &machine )
62588{
626   psx_machine *p_psx = machine.driver_data<psx_state>()->m_p_psx;
627   int n;
628
629   /* irq */
630   p_psx->n_irqdata = 0;
631   p_psx->n_irqmask = 0;
632
633   for( n = 0; n < 2; n++ )
634   {
635      p_psx->sio[ n ].n_status = SIO_STATUS_TX_EMPTY | SIO_STATUS_TX_RDY;
636      p_psx->sio[ n ].n_mode = 0;
637      p_psx->sio[ n ].n_control = 0;
638      p_psx->sio[ n ].n_baud = 0;
639      p_psx->sio[ n ].n_tx = 0;
640      p_psx->sio[ n ].n_rx = 0;
641      p_psx->sio[ n ].n_tx_prev = 0;
642      p_psx->sio[ n ].n_rx_prev = 0;
643      p_psx->sio[ n ].n_rx_data = 0;
644      p_psx->sio[ n ].n_tx_data = 0;
645      p_psx->sio[ n ].n_rx_shift = 0;
646      p_psx->sio[ n ].n_tx_shift = 0;
647      p_psx->sio[ n ].n_rx_bits = 0;
648      p_psx->sio[ n ].n_tx_bits = 0;
649   }
650
65189   psx_gpu_reset(machine);
65290}
65391
654static void psx_postload(psx_machine *p_psx)
655{
656   int n;
657
658   psx_irq_update(p_psx);
659
660   for( n = 0; n < 3; n++ )
661   {
662      root_timer_adjust( p_psx, n );
663   }
664
665   for( n = 0; n < 2; n++ )
666   {
667      sio_timer_adjust( p_psx, n );
668   }
669}
670
67192void psx_driver_init( running_machine &machine )
67293{
67394   psx_state *state = machine.driver_data<psx_state>();
67495   psx_machine *p_psx = auto_alloc_clear(machine, psx_machine);
675   int n;
67696
67797   state->m_p_psx = p_psx;
67898   state->m_p_n_psxram = (UINT32 *)memory_get_shared(machine, "share1", state->m_n_psxramsize);
r11556r11557
681101   p_psx->p_n_psxram = state->m_p_n_psxram;
682102   p_psx->n_psxramsize = state->m_n_psxramsize;
683103
684   for( n = 0; n < 3; n++ )
685   {
686      p_psx->root[ n ].timer = machine.scheduler().timer_alloc( FUNC(root_finished ));
687   }
688
689   for( n = 0; n < 2; n++ )
690   {
691      p_psx->sio[ n ].timer = machine.scheduler().timer_alloc( FUNC(sio_clock ));
692      p_psx->sio[ n ].fn_handler = NULL;
693   }
694
695104   psx_dma_install_read_handler( machine, 2, psx_dma_read_delegate( FUNC( gpu_read ), state ) );
696105   psx_dma_install_write_handler( machine, 2, psx_dma_write_delegate( FUNC( gpu_write ), state ) );
697
698   state_save_register_global( machine, p_psx->n_irqdata );
699   state_save_register_global( machine, p_psx->n_irqmask );
700   for ( n = 0; n < 3; n++ )
701   {
702      state_save_register_item( machine, "psxroot", NULL, n, p_psx->root[n].n_count );
703      state_save_register_item( machine, "psxroot", NULL, n, p_psx->root[n].n_mode );
704      state_save_register_item( machine, "psxroot", NULL, n, p_psx->root[n].n_target );
705      state_save_register_item( machine, "psxroot", NULL, n, p_psx->root[n].n_start );
706   }
707   for( n = 0; n < 2; n++ )
708   {
709      state_save_register_item( machine, "psxsio", NULL, n, p_psx->sio[n].n_status );
710      state_save_register_item( machine, "psxsio", NULL, n, p_psx->sio[n].n_mode );
711      state_save_register_item( machine, "psxsio", NULL, n, p_psx->sio[n].n_control );
712      state_save_register_item( machine, "psxsio", NULL, n, p_psx->sio[n].n_baud );
713      state_save_register_item( machine, "psxsio", NULL, n, p_psx->sio[n].n_tx );
714      state_save_register_item( machine, "psxsio", NULL, n, p_psx->sio[n].n_rx );
715      state_save_register_item( machine, "psxsio", NULL, n, p_psx->sio[n].n_tx_prev );
716      state_save_register_item( machine, "psxsio", NULL, n, p_psx->sio[n].n_rx_prev );
717      state_save_register_item( machine, "psxsio", NULL, n, p_psx->sio[n].n_rx_data );
718      state_save_register_item( machine, "psxsio", NULL, n, p_psx->sio[n].n_tx_data );
719      state_save_register_item( machine, "psxsio", NULL, n, p_psx->sio[n].n_rx_shift );
720      state_save_register_item( machine, "psxsio", NULL, n, p_psx->sio[n].n_tx_shift );
721      state_save_register_item( machine, "psxsio", NULL, n, p_psx->sio[n].n_rx_bits );
722      state_save_register_item( machine, "psxsio", NULL, n, p_psx->sio[n].n_tx_bits );
723   }
724
725   machine.save().register_postload( save_prepost_delegate(FUNC(psx_postload), p_psx ));
726106}
src/mame/includes/psx.h
r11556r11557
77#if !defined( PSX_H )
88
99#include "cpu/psx/dma.h"
10#include "cpu/psx/irq.h"
11#include "cpu/psx/sio.h"
1012
11#define PSX_RC_STOP ( 0x01 )
12#define PSX_RC_RESET ( 0x04 ) /* guess */
13#define PSX_RC_COUNTTARGET ( 0x08 )
14#define PSX_RC_IRQTARGET ( 0x10 )
15#define PSX_RC_IRQOVERFLOW ( 0x20 )
16#define PSX_RC_REPEAT ( 0x40 )
17#define PSX_RC_CLC ( 0x100 )
18#define PSX_RC_DIV ( 0x200 )
19
20#define PSX_IRQ_ROOTCOUNTER3   0x0001
21#define PSX_IRQ_CDROM         0x0004
22#define PSX_IRQ_DMA            0x0008
23#define PSX_IRQ_ROOTCOUNTER0   0x0010
24#define PSX_IRQ_ROOTCOUNTER1   0x0020
25#define PSX_IRQ_ROOTCOUNTER2   0x0040
26#define PSX_IRQ_SIO0         0x0080
27#define PSX_IRQ_SIO1         0x0100
28#define PSX_IRQ_SPU            0x0200
29#define PSX_IRQ_EXTCD         0x0400
30#define PSX_IRQ_MASK         (PSX_IRQ_ROOTCOUNTER3 | PSX_IRQ_CDROM | PSX_IRQ_DMA | PSX_IRQ_ROOTCOUNTER2 | PSX_IRQ_ROOTCOUNTER1 | PSX_IRQ_ROOTCOUNTER0 | PSX_IRQ_SIO0 | PSX_IRQ_SIO1 | PSX_IRQ_SPU | PSX_IRQ_EXTCD)
31
32#define PSX_SIO_OUT_DATA ( 1 )   /* COMMAND */
33#define PSX_SIO_OUT_DTR ( 2 )   /* ATT */
34#define PSX_SIO_OUT_RTS ( 4 )
35#define PSX_SIO_OUT_CLOCK ( 8 )   /* CLOCK */
36#define PSX_SIO_IN_DATA ( 1 )   /* DATA */
37#define PSX_SIO_IN_DSR ( 2 )   /* ACK */
38#define PSX_SIO_IN_CTS ( 4 )
39
40typedef void ( *psx_sio_handler )( running_machine &, int );
41
42#define SIO_BUF_SIZE ( 8 )
43
44#define SIO_STATUS_TX_RDY ( 1 << 0 )
45#define SIO_STATUS_RX_RDY ( 1 << 1 )
46#define SIO_STATUS_TX_EMPTY ( 1 << 2 )
47#define SIO_STATUS_OVERRUN ( 1 << 4 )
48#define SIO_STATUS_DSR ( 1 << 7 )
49#define SIO_STATUS_IRQ ( 1 << 9 )
50
51#define SIO_CONTROL_TX_ENA ( 1 << 0 )
52#define SIO_CONTROL_IACK ( 1 << 4 )
53#define SIO_CONTROL_RESET ( 1 << 6 )
54#define SIO_CONTROL_TX_IENA ( 1 << 10 )
55#define SIO_CONTROL_RX_IENA ( 1 << 11 )
56#define SIO_CONTROL_DSR_IENA ( 1 << 12 )
57#define SIO_CONTROL_DTR ( 1 << 13 )
58
59typedef struct _psx_root psx_root;
60struct _psx_root
61{
62   emu_timer *timer;
63   UINT16 n_count;
64   UINT16 n_mode;
65   UINT16 n_target;
66   UINT64 n_start;
67};
68
69typedef struct _psx_sio psx_sio;
70struct _psx_sio
71{
72   UINT32 n_status;
73   UINT32 n_mode;
74   UINT32 n_control;
75   UINT32 n_baud;
76   UINT32 n_tx;
77   UINT32 n_rx;
78   UINT32 n_tx_prev;
79   UINT32 n_rx_prev;
80   UINT32 n_tx_data;
81   UINT32 n_rx_data;
82   UINT32 n_tx_shift;
83   UINT32 n_rx_shift;
84   UINT32 n_tx_bits;
85   UINT32 n_rx_bits;
86
87   emu_timer *timer;
88   psx_sio_handler fn_handler;
89};
90
9113typedef struct _psx_machine psx_machine;
9214struct _psx_machine
9315{
r11556r11557
9820   size_t n_psxramsize;
9921
10022   UINT32 n_com_delay;
101   UINT32 n_irqdata;
102   UINT32 n_irqmask;
103
104   psx_root root[3];
105
106   psx_sio sio[2];
10723};
10824
10925typedef struct _psx_gpu psx_gpu;
r11556r11557
14056
14157WRITE32_HANDLER( psx_com_delay_w );
14258READ32_HANDLER( psx_com_delay_r );
143WRITE32_HANDLER( psx_irq_w );
144READ32_HANDLER( psx_irq_r );
14559extern void psx_irq_set( running_machine &, UINT32 );
14660extern void psx_dma_install_read_handler( running_machine &, int, psx_dma_read_delegate );
14761extern void psx_dma_install_write_handler( running_machine &, int, psx_dma_read_delegate );
14862WRITE32_HANDLER( psx_counter_w );
14963READ32_HANDLER( psx_counter_r );
150WRITE32_HANDLER( psx_sio_w );
151READ32_HANDLER( psx_sio_r );
15264extern void psx_sio_install_handler( running_machine &, int, psx_sio_handler );
15365extern void psx_sio_input( running_machine &, int, int, int );
15466
src/mame/includes/tx1.h
r11556r11557
178178SCREEN_UPDATE( buggybjr );
179179WRITE16_HANDLER( buggyboy_gas_w );
180180WRITE16_HANDLER( buggyboy_sky_w );
181WRITE16_HANDLER( buggyboy_scolst_w );
src/mame/video/galivan.c
r11556r11557
349349{
350350   galivan_state *state = screen->machine().driver_data<galivan_state>();
351351   tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_galivan_scrollx[0] + 256 * (state->m_galivan_scrollx[1] & 0x07));
352   tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_galivan_scrolly[0] + 256 * (state->m_galivan_scrollx[1] & 0x07));
352   tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_galivan_scrolly[0] + 256 * (state->m_galivan_scrolly[1] & 0x07));
353353
354354   if (state->m_layers & 0x40)
355355      bitmap_fill(bitmap, cliprect, 0);
src/mame/video/tx1.c
r11556r11557
29132913   vregs.gas = data;
29142914}
29152915
2916
29172916WRITE16_HANDLER( buggyboy_sky_w )
29182917{
29192918   tx1_state *state = space->machine().driver_data<tx1_state>();
29202919   state->m_vregs.sky = data;
29212920}
29222921
2922WRITE16_HANDLER( buggyboy_scolst_w )
2923{
2924   tx1_state *state = space->machine().driver_data<tx1_state>();
2925   state->m_vregs.scol = data;
2926}
29232927
2928
29242929/*************************************
29252930 *
29262931 *  Core Functions
src/mame/video/konicdev.c
r11556r11557
89818981}
89828982
89838983
8984/***************************************************************************/
8985/*                                                                         */
8986/*                                 053252                                  */
8987/*                                                                         */
8988/***************************************************************************/
89898984
8990/*
89918985
8992left res = current in game, right res = computed
89938986
8994hexion:    02 FF 00 4D 00 73 00 00 01 1F 05 0E B7 7C 00 00 512x256 ~ 512x256 <- writes to e and f regs, in an irq ack fashion
8995overdriv:  01 7F 00 22 00 0D 00 03 01 07 10 0F 73 00 00 00 304x256 ~ 305x224
8996esckids:   01 7F 00 12 00 0D 00 01 01 07 08 07 73 00 00 00 304x224 ~ 321x240
8997rollerg:   01 7F 00 23 00 1D 02 00 01 07 10 0F 73 00 02 00 288x224 ~ 288x224 <- writes to 6 and e regs, in an irq ack fashion
8998gaiapols:  01 FB 00 19 00 37 00 00 01 06 10 0E 75 00 D1 00 376x224 ~ 380x224
8999mmaulers:  01 7F 00 19 00 27 00 00 01 07 10 0F 73 00 00 00 288x224 ~ 288x224
9000mystwarr:  01 7F 00 12 00 2E 00 00 01 07 11 0E 73 00 00 00 288x224 ~ 288x224
9001metamrph:  01 7F 00 11 00 27 01 00 01 07 10 0F 74 00 00 00 288x224 ~ 288x224
9002viostorm:  01 FF 00 16 00 39 00 00 01 07 11 0E 75 00 00 00 384x224 ~ 385x224
9003mtlchamp:  01 FF 00 21 00 37 00 00 01 07 11 0E 74 00 00 00 384x224 ~ 384x224
9004dbz:       01 FF 00 21 00 37 00 00 01 20 0C 0E 54 00 00 00 384x256 ~ 384x256
9005dbz2:      01 FF 00 21 00 37 00 00 01 20 0C 0E 54 00 00 00 384x256 ~ 384x256
9006xexex:     01 FF 00 21 00 37 01 00 00 20 0C 0E 54 00 00 00 384x256 ~ 384x256 (*)
9007(all konamigx, cowboys of moo mesa, run & gun, dj main)
90088987
9009(*) hblank duration 512 (0x200), hdisp 384 (0x180), vblank duration 288 (0x120), vdisp 256 (0x100)
9010
9011    Definitions from GX, look similar, all values big-endian, write-only:
9012
9013   0-1: bits 9-0: HC        - Total hblank duration (-1)     Hres ~ (HC+1) - HFP - HBP - 8*(HSW+1)
9014   2-3: bits 8-0: HFP       - HBlank front porch
9015   4-5: bits 8-0: HBP       - HBlank back porch
9016   6  : bits 7-0: INT1EN
9017   7  : bits 7-0: INT2EN
9018   8-9: bits 8-0: VC        - Total vblank duration
9019   a  : bits 7-0: VFP       - VBlank front porch             Vres ~ VC - VFP - VBP - (VSW+1)
9020   b  : bits 7-0: VBP       - VBlank back porch
9021   c  : bits 7-4: VSW       - V-Sync Width
9022   c  : bits 3-0: HSW       - H-Sync Width
9023   d  : bits 7-0: INT-TIME
9024   e  : bits 7-0: INT1ACK
9025   f  : bits 7-0: INT2ACK
9026
9027    Read-only:
9028   e-f: bits 8-0: VCT
9029
9030TODO:
9031- xexex sets up 0x20 as the VC?
9032*/
9033
9034typedef struct _k053252_state k053252_state;
9035struct _k053252_state
9036{
9037   UINT8   regs[16];
9038   UINT16  hc,hfp,hbp;
9039   UINT16  vc,vfp,vbp;
9040   UINT8   vsw,hsw;
9041};
9042
9043/*****************************************************************************
9044    INLINE FUNCTIONS
9045*****************************************************************************/
9046
9047INLINE k053252_state *k053252_get_safe_token( device_t *device )
9048{
9049   assert(device != NULL);
9050   assert(device->type() == K053252);
9051
9052   return (k053252_state *)downcast<legacy_device_base *>(device)->token();
9053}
9054
9055/*****************************************************************************
9056    DEVICE HANDLERS
9057*****************************************************************************/
9058
9059READ8_DEVICE_HANDLER( k053252_r )
9060{
9061   k053252_state *k053252 = k053252_get_safe_token(device);
9062   return k053252->regs[offset];
9063}
9064
9065WRITE8_DEVICE_HANDLER( k053252_w )
9066{
9067   k053252_state *k053252 = k053252_get_safe_token(device);
9068
9069   k053252->regs[offset] = data;
9070
9071   //printf("%04x %02x\n",offset,data);
9072
9073   switch(offset)
9074   {
9075      case 0x00:
9076      case 0x01:
9077         k053252->hc  = (k053252->regs[1]&0xff);
9078         k053252->hc |= ((k053252->regs[0]&0x03)<<8);
9079         k053252->hc ++;
9080         logerror("%d (%04x) HC set\n",k053252->hc,k053252->hc);
9081         break;
9082      case 0x02:
9083      case 0x03:
9084         k053252->hfp  = (k053252->regs[3]&0xff);
9085         k053252->hfp |= ((k053252->regs[2]&0x01)<<8);
9086         logerror("%d (%04x) HFP set\n",k053252->hfp,k053252->hfp);
9087         break;
9088      case 0x04:
9089      case 0x05:
9090         k053252->hbp  = (k053252->regs[5]&0xff);
9091         k053252->hbp |= ((k053252->regs[4]&0x01)<<8);
9092         logerror("%d (%04x) HBP set\n",k053252->hbp,k053252->hbp);
9093         break;
9094      case 0x08:
9095      case 0x09:
9096         k053252->vc  = (k053252->regs[9]&0xff);
9097         k053252->vc |= ((k053252->regs[8]&0x01)<<8);
9098         k053252->vc ++;
9099         logerror("%d (%04x) VC set\n",k053252->vc,k053252->vc);
9100         break;
9101      case 0x0a:
9102         k053252->vfp  = (k053252->regs[0x0a]&0xff);
9103         logerror("%d (%04x) VFP set\n",k053252->vfp,k053252->vfp);
9104         break;
9105      case 0x0b:
9106         k053252->vbp  = (k053252->regs[0x0b]&0xff);
9107         logerror("%d (%04x) VBP set\n",k053252->vbp,k053252->vbp);
9108         break;
9109      case 0x0c:
9110         k053252->vsw  = ((k053252->regs[0x0c]&0xf0) >> 4) + 1;
9111         k053252->hsw  = ((k053252->regs[0x0c]&0x0f) >> 0) + 1;
9112         logerror("%02x VSW / %02x HSW set\n",k053252->vsw,k053252->hsw);
9113         break;
9114   }
9115}
9116
9117
9118
9119/*****************************************************************************
9120    DEVICE INTERFACE
9121*****************************************************************************/
9122
9123static DEVICE_START( k053252 )
9124{
9125   k053252_state *k053252 = k053252_get_safe_token(device);
9126
9127   device->save_item(NAME(k053252->regs));
9128}
9129
9130static DEVICE_RESET( k053252 )
9131{
9132   k053252_state *k053252 = k053252_get_safe_token(device);
9133   int i;
9134
9135   for (i = 0; i < 16; i++)
9136      k053252->regs[i] = 0;
9137}
9138
9139
91408988// Newer Konami devices
91418989
91428990// from video/gticlub.c
r11556r11557
1134711195   }
1134811196}
1134911197
11350DEVICE_GET_INFO( k053252 )
11351{
11352   switch (state)
11353   {
11354      /* --- the following bits of info are returned as 64-bit signed integers --- */
11355      case DEVINFO_INT_TOKEN_BYTES:         info->i = sizeof(k053252_state);               break;
1135611198
11357      /* --- the following bits of info are returned as pointers to data or functions --- */
11358      case DEVINFO_FCT_START:               info->start = DEVICE_START_NAME(k053252);      break;
11359      case DEVINFO_FCT_STOP:               /* Nothing */                           break;
11360      case DEVINFO_FCT_RESET:               info->reset = DEVICE_RESET_NAME(k053252);      break;
11361
11362      /* --- the following bits of info are returned as NULL-terminated strings --- */
11363      case DEVINFO_STR_NAME:               strcpy(info->s, "Konami 053252");            break;
11364      case DEVINFO_STR_FAMILY:            strcpy(info->s, "Konami Video IC");               break;
11365      case DEVINFO_STR_VERSION:            strcpy(info->s, "1.0");                     break;
11366      case DEVINFO_STR_SOURCE_FILE:         strcpy(info->s, __FILE__);                  break;
11367      case DEVINFO_STR_CREDITS:            strcpy(info->s, "Copyright MAME Team");         break;
11368   }
11369}
11370
1137111199DEVICE_GET_INFO( k001006 )
1137211200{
1137311201   switch (state)
r11556r11557
1147311301DEFINE_LEGACY_DEVICE(K055555, k055555);
1147411302DEFINE_LEGACY_DEVICE(K054338, k054338);
1147511303DEFINE_LEGACY_DEVICE(K053250, k053250);
11476DEFINE_LEGACY_DEVICE(K053252, k053252);
1147711304DEFINE_LEGACY_DEVICE(K001006, k001006);
1147811305DEFINE_LEGACY_DEVICE(K001005, k001005);
1147911306DEFINE_LEGACY_DEVICE(K001604, k001604);
src/mame/video/konicdev.h
r11556r11557
185185DECLARE_LEGACY_DEVICE(K055555, k055555);
186186DECLARE_LEGACY_DEVICE(K054338, k054338);
187187DECLARE_LEGACY_DEVICE(K053250, k053250);
188DECLARE_LEGACY_DEVICE(K053252, k053252);
189188DECLARE_LEGACY_DEVICE(K001006, k001006);
190189DECLARE_LEGACY_DEVICE(K001005, k001005);
191190DECLARE_LEGACY_DEVICE(K001604, k001604);
r11556r11557
267266   MCFG_DEVICE_ADD(_tag, K053250, 0) \
268267   MCFG_DEVICE_CONFIG(_interface)
269268
270#define MCFG_K053252_ADD(_tag) \
271   MCFG_DEVICE_ADD(_tag, K053252, 0)
272269
273
274270#define MCFG_K001006_ADD(_tag, _interface) \
275271   MCFG_DEVICE_ADD(_tag, K001006, 0) \
276272   MCFG_DEVICE_CONFIG(_interface)
r11556r11557
746742void k053250_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int colorbase, int flags, int pri);
747743void k053250_dma(device_t *device, int limiter);
748744
749
750/**  Konami 053252  **/
751/* CRT and interrupt control unit */
752READ8_DEVICE_HANDLER( k053252_r );   // CCU registers
753WRITE8_DEVICE_HANDLER( k053252_w );
754
755
756745/**  Konami 001006  **/
757746UINT32 k001006_get_palette(device_t *device, int index);
758747
src/mame/drivers/namcos12.c
r11556r11557
3838Paca Paca Passion Special (PSP1/VER.A)   (C) Produce/Namco,1999  COH-700     SYSTEM12 MOTHER(C)  SYSTEM12 M5F2    KC052
3939Paca Paca Passion 2 (PKS1/VER.A)         (C) Produce/Namco,1999  COH-700     SYSTEM12 MOTHER(B)  SYSTEM12 M5F2    KC046
4040Point Blank 2 (GNB5/VER.A)               (C) Namco,        1999  COH-700     SYSTEM12 MOTHER(B)  SYSTEM12 M4F0    KC042
41Gunbarl (GNB4/VER.A)                     (C) Namco,        1999  COH-700     SYSTEM12 MOTHER(B)  SYSTEM12 M4F0    KC042
4142Soul Calibur (SOC11/VER.A2)              (C) Namco,        1998  COH-700     SYSTEM12 MOTHER(B)  SYSTEM12 M5F2    KC020
4243Soul Calibur (SOC11/VER.B)               (C) Namco,        1998  COH-700     SYSTEM12 MOTHER(B)  SYSTEM12 M5F2    KC020
4344Soul Calibur (SOC11/VER.C)               (C) Namco,        1998  COH-700     SYSTEM12 MOTHER(B)  SYSTEM12 M5F4    KC020
r11556r11557
362363                           (i.e no FlashROMs)                                      (note these ROMs contains the same data as)
363364                                                                                   (the ones used on System 11 Point Blank 2)
364365
366Gunbarl       GNB4/VER.A   Same PCB but sticker says....                  KC042    GNB1 WAVEB.IC2
367                           'SYSTEM 12 M4F0 PCB 8661962000'                         GNB1 PRG0U.IC11, GNB1 PRG0L.IC12
368                           (i.e no FlashROMs)                                      (note these ROMs contains the same data as)
369                                                                                   (the ones used on System 11 Point Blank 2)
370
365371Super World   SS81/VER.A   SYSTEM 12 M4F6 PCB 8661960901 (8661970901)     KC025    SS81 WAVE0, SS81 WAVE1
366372Stadium '98                                                                        SS81 FL1U, SS81 FL1L, SS81 FL2U
367373                                                                                   SS81 FL2L, SS81 FL3U, SS81 FL3L
r11556r11557
13841390      strcmp( machine.system().name, "tenkomor" ) == 0 ||
13851391      strcmp( machine.system().name, "tenkomorja" ) == 0 ||
13861392      strcmp( machine.system().name, "ptblank2" ) == 0 ||
1393      strcmp( machine.system().name, "gunbarl" ) == 0 ||
13871394      strcmp( machine.system().name, "sws2000" ) == 0 ||
13881395      strcmp( machine.system().name, "sws2001" ) == 0 ||
13891396      strcmp( machine.system().name, "truckk" ) == 0 ||
r11556r11557
21232130   ROM_LOAD16_WORD_SWAP( "gnb5vera.11s", 0x000000, 0x080000, CRC(d45a53eb) SHA1(01eb4f659b29671d417c5d3684f15a5876f76009) )
21242131
21252132   ROM_REGION( 0x1000000, "c352", 0 ) /* samples */
2126   ROM_LOAD( "gnb1wave.ic2",  0x0000000, 0x400000, CRC(4e19d9d6) SHA1(0a92c987536999a789663a30c787950ab6995128) )
2133   ROM_LOAD( "gnb1waveb.ic2",  0x0000000, 0x400000, CRC(4e19d9d6) SHA1(0a92c987536999a789663a30c787950ab6995128) )
21272134   ROM_RELOAD( 0x800000, 0x400000 )
21282135ROM_END
21292136
2137ROM_START( gunbarl )
2138   ROM_REGION32_LE( 0x00400000, "user1", 0 ) /* main prg */
2139   ROM_LOAD16_BYTE( "gnb4vera.2l",  0x0000000, 0x200000, CRC(88c05cde) SHA1(80d210b06c8eda19e37430fb34492885d9eec671) )
2140   ROM_LOAD16_BYTE( "gnb4vera.2p",  0x0000001, 0x200000, CRC(7d57437a) SHA1(b4fc960b11e7dc9d3bde567f534635f264276e53) )
2141
2142   ROM_REGION32_LE( 0x1000000, "user2", 0 ) /* main data */
2143   ROM_LOAD16_BYTE( "gnb1prg0l.ic12", 0x000000, 0x800000, CRC(78746037) SHA1(d130ca1153a730e3c967945248f00662f9fab304) )
2144   ROM_LOAD16_BYTE( "gnb1prg0u.ic11", 0x000001, 0x800000, CRC(697d3279) SHA1(40302780f7494d9413888b2d1da38bd14a9a444f) )
2145
2146   ROM_REGION( 0x0080000, "sub", 0 ) /* sound prg */
2147   ROM_LOAD16_WORD_SWAP( "gnb5vera.11s", 0x000000, 0x080000, CRC(d45a53eb) SHA1(01eb4f659b29671d417c5d3684f15a5876f76009) )
2148
2149   ROM_REGION( 0x1000000, "c352", 0 ) /* samples */
2150   ROM_LOAD( "gnb1waveb.ic2",  0x0000000, 0x400000, CRC(4e19d9d6) SHA1(0a92c987536999a789663a30c787950ab6995128) )
2151   ROM_RELOAD( 0x800000, 0x400000 )
2152ROM_END
2153
21302154ROM_START( soulclbr )
21312155   ROM_REGION32_LE( 0x00400000, "user1", 0 ) /* main prg */
21322156   ROM_LOAD16_BYTE( "soc14verc.2e", 0x0000000, 0x200000, CRC(c40e9614) SHA1(dc20469f0d657423e472fdf5897852ab9fb8bb73) )
r11556r11557
27092733GAME( 1998, fgtlayer,  0,        coh700,   namcos12, namcos12, ROT0, "Arika / Namco",   "Fighting Layer (Japan, FTL1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC037 */
27102734GAME( 1999, pacapp,    0,        coh700,   namcos12, namcos12, ROT0, "Produce / Namco", "Paca Paca Passion (Japan, PPP1/VER.A2)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC038 */
27112735GAME( 1999, ptblank2,  0,        coh700,   ptblank2, ptblank2, ROT0, "Namco",           "Point Blank 2 (GNB5/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC042 */
2736GAME( 1999, gunbarl,   ptblank2, coh700,   ptblank2, ptblank2, ROT0, "Namco",           "Gunbarl (Japan, GNB4/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC042 */
27122737GAME( 1999, sws99,     0,        coh700,   namcos12, namcos12, ROT0, "Namco",           "Super World Stadium '99 (Japan, SS91/VER.A3)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC043 */
27132738GAME( 1999, tektagt,   0,        coh700,   namcos12, namcos12, ROT0, "Namco",           "Tekken Tag Tournament (US, TEG3/VER.C1)", GAME_IMPERFECT_SOUND ) /* KC044 */
27142739GAME( 1999, tektagtac, tektagt,  coh700,   namcos12, namcos12, ROT0, "Namco",           "Tekken Tag Tournament (Asia, TEG2/VER.C1)", GAME_IMPERFECT_SOUND ) /* KC044 */
src/mame/drivers/midwunit.c
r11556r11557
132132   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
133133   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
134134   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
135   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
136   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
137   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
135   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 High Punch") PORT_PLAYER(1)
136   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Block") PORT_PLAYER(1)
137   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 High Kick") PORT_PLAYER(1)
138138   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
139139   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
140140   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
141141   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
142142   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
143   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
144   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
145   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
143   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 High Punch") PORT_PLAYER(2)
144   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 Block") PORT_PLAYER(2)
145   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 High Kick") PORT_PLAYER(2)
146146   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
147147
148148   PORT_START("IN1")
149   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
150   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
151   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1)
149   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 Low Punch") PORT_PLAYER(1)
150   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 Low Kick") PORT_PLAYER(1)
151   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P1 Run") PORT_PLAYER(1)
152152   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
153   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
154   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
155   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
153   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P2 Low Punch") PORT_PLAYER(2)
154   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P2 Low Kick") PORT_PLAYER(2)
155   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P2 Run") PORT_PLAYER(2)
156156   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
157157   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
158158
r11556r11557
231231   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
232232   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
233233   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
234   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
235   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
236   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
234   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Shoot / Block") PORT_PLAYER(1)
235   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 Pass / Steal") PORT_PLAYER(1)
236   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Turbo") PORT_PLAYER(1)
237237   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
238238   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
239239   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
240240   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
241241   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
242   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
243   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
244   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
242   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 Shoot / Block") PORT_PLAYER(2)
243   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 Pass / Steal") PORT_PLAYER(2)
244   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 Turbo") PORT_PLAYER(2)
245245   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
246246
247247   PORT_START("IN1")
r11556r11557
249249   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
250250   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
251251   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
252   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
253   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
254   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
252   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P3 Shoot / Block") PORT_PLAYER(3)
253   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P3 Pass / Steal") PORT_PLAYER(3)
254   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P3 Turbo") PORT_PLAYER(3)
255255   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
256256   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4)
257257   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4)
258258   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
259259   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
260   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
261   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4)
262   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
260   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P4 Shoot / Block") PORT_PLAYER(4)
261   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P4 Pass / Steal")PORT_PLAYER(4)
262   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P4 Turbo")PORT_PLAYER(4)
263263   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
264264
265265   PORT_START("DSW")
r11556r11557
340340   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
341341   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
342342   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
343   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
344   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
345   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
343   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Shoot / Block") PORT_PLAYER(1)
344   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 Pass / Steal") PORT_PLAYER(1)
345   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Turbo") PORT_PLAYER(1)
346346   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
347347   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
348348   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
349349   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
350350   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
351   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
352   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
353   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
351   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 Shoot / Block") PORT_PLAYER(2)
352   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 Pass / Steal") PORT_PLAYER(2)
353   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 Turbo") PORT_PLAYER(2)
354354   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
355355
356356   PORT_START("IN1")
r11556r11557
358358   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
359359   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
360360   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
361   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
362   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
363   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
361   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P3 Shoot / Block") PORT_PLAYER(3)
362   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P3 Pass / Steal") PORT_PLAYER(3)
363   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P3 Turbo") PORT_PLAYER(3)
364364   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
365365   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4)
366366   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4)
367367   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
368368   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
369   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
370   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4)
371   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
369   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P4 Shoot / Block") PORT_PLAYER(4)
370   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P4 Pass / Steal") PORT_PLAYER(4)
371   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P4 Turbo") PORT_PLAYER(4)
372372   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
373373
374374   PORT_START("DSW")
r11556r11557
433433   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
434434   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
435435   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
436   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
437   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
438   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
436   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Punch") PORT_PLAYER(1)
437   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 Kick") PORT_PLAYER(1)
438   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Jump") PORT_PLAYER(1)
439439   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
440440   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
441441   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
442442   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
443443   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
444   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
445   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
446   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
444   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 Punch") PORT_PLAYER(2)
445   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 Kick") PORT_PLAYER(2)
446   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 Jump") PORT_PLAYER(2)
447447   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
448448
449449   PORT_START("IN1")
r11556r11557
451451   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
452452   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
453453   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
454   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
455   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
456   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
454   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P3 Punch") PORT_PLAYER(3)
455   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P3 Kick") PORT_PLAYER(3)
456   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P3 Jump") PORT_PLAYER(3)
457457   PORT_BIT( 0xff80, IP_ACTIVE_LOW, IPT_UNUSED )
458458
459459   PORT_START("DSW")
r11556r11557
526526   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
527527   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
528528   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
529   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
530   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
531   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
529   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Punch") PORT_PLAYER(1)
530   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Defense") PORT_PLAYER(1)
531   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 Power Punch") PORT_PLAYER(1)
532532   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
533533   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
534534   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
535535   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
536536   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
537   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
538   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
539   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
537   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 Punch") PORT_PLAYER(2)
538   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 Defense") PORT_PLAYER(2)
539   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 Power Punch") PORT_PLAYER(2)
540540   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
541541
542542   PORT_START("IN1")
543   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
544   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
543   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 Kick") PORT_PLAYER(1)
544   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 Power Kick") PORT_PLAYER(1)
545545   PORT_BIT( 0x000c, IP_ACTIVE_LOW, IPT_UNUSED )
546   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
547   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
546   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P2 Kick") PORT_PLAYER(2)
547   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P2 Power Kick") PORT_PLAYER(2)
548548   PORT_BIT( 0x00c0, IP_ACTIVE_LOW, IPT_UNUSED )
549549   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
550550
src/mame/drivers/moo.c
r11556r11557
4646#include "sound/okim6295.h"
4747#include "sound/k054539.h"
4848#include "video/konicdev.h"
49#include "machine/k053252.h"
4950#include "includes/konamipt.h"
5051#include "includes/moo.h"
5152
r11556r11557
267268   AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVWRITE("k054338", k054338_word_w)      /* K054338 alpha blending engine */
268269   AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVWRITE("k053251", k053251_lsb_w)
269270   AM_RANGE(0x0ce000, 0x0ce01f) AM_WRITE(moo_prot_w)
270   AM_RANGE(0x0d0000, 0x0d001f) AM_WRITEONLY               /* CCU regs (ignored) */
271   AM_RANGE(0x0d0000, 0x0d001f) AM_DEVREADWRITE8("k053252",k053252_r,k053252_w,0x00ff)               /* CCU regs (ignored) */
271272   AM_RANGE(0x0d4000, 0x0d4001) AM_WRITE(sound_irq_w)
272273   AM_RANGE(0x0d600c, 0x0d600d) AM_WRITE(sound_cmd1_w)
273274   AM_RANGE(0x0d600e, 0x0d600f) AM_WRITE(sound_cmd2_w)
r11556r11557
291292   AM_RANGE(0x0c2000, 0x0c2007) AM_DEVREAD("k053246", k053246_reg_word_r)
292293   AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVREAD("k054338", k054338_word_r)
293294   AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVREAD("k053251", k053251_lsb_r)
294   AM_RANGE(0x0d0000, 0x0d001f) AM_RAM
295295   AM_RANGE(0x0d8000, 0x0d8007) AM_DEVREAD("k056832", k056832_b_word_r)
296296#endif
297297ADDRESS_MAP_END
r11556r11557
333333   AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVWRITE("k054338", k054338_word_w)      /* K054338 alpha blending engine */
334334   AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVWRITE("k053251", k053251_lsb_w)
335335   AM_RANGE(0x0ce000, 0x0ce01f) AM_WRITE(moo_prot_w)
336   AM_RANGE(0x0d0000, 0x0d001f) AM_WRITEONLY               /* CCU regs (ignored) */
336   AM_RANGE(0x0d0000, 0x0d001f) AM_DEVREADWRITE8("k053252",k053252_r,k053252_w,0x00ff)               /* CCU regs (ignored) */
337337   AM_RANGE(0x0d2000, 0x0d20ff) AM_DEVREADWRITE("k054000", k054000_lsb_r, k054000_lsb_w)
338338   AM_RANGE(0x0d4000, 0x0d4001) AM_WRITE(sound_irq_w)
339339   AM_RANGE(0x0d600c, 0x0d600d) AM_WRITE(sound_cmd1_w)
r11556r11557
357357   AM_RANGE(0x0c2000, 0x0c2007) AM_DEVREAD("k053246", k053246_reg_word_r)
358358   AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVREAD("k054338", k054338_word_r)
359359   AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVREAD("k053251", k053251_lsb_r)
360   AM_RANGE(0x0d0000, 0x0d001f) AM_RAM
361360   AM_RANGE(0x0d8000, 0x0d8007) AM_DEVREAD("k056832", k056832_b_word_r)
362361#endif
363362ADDRESS_MAP_END
r11556r11557
506505   "none"
507506};
508507
508static const k053252_interface moo_k053252_intf =
509{
510   "screen",
511   DEVCB_NULL,
512   DEVCB_NULL,
513   DEVCB_NULL,
514   DEVCB_NULL,
515   40, 16
516};
509517
510518static MACHINE_CONFIG_START( moo, moo_state )
511519
r11556r11557
522530
523531   MCFG_EEPROM_ADD("eeprom", eeprom_intf)
524532
533   MCFG_K053252_ADD("k053252", 16000000/2, moo_k053252_intf)
534
525535   /* video hardware */
526536   MCFG_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS | VIDEO_HAS_HIGHLIGHTS | VIDEO_UPDATE_AFTER_VBLANK)
527537
src/mame/drivers/rungun.c
r11556r11557
4343#include "emu.h"
4444
4545#include "video/konicdev.h"
46#include "machine/k053252.h"
4647#include "cpu/m68000/m68000.h"
4748#include "cpu/z80/z80.h"
4849#include "machine/eeprom.h"
r11556r11557
358359   rng_sprite_callback
359360};
360361
362static const k053252_interface rng_k053252_intf =
363{
364   "screen",
365   DEVCB_NULL,
366   DEVCB_NULL,
367   DEVCB_NULL,
368   DEVCB_NULL,
369   9*8, 24
370};
361371
362372static MACHINE_START( rng )
363373{
r11556r11557
430440
431441   MCFG_K053936_ADD("k053936", rng_k053936_intf)
432442   MCFG_K055673_ADD("k055673", rng_k055673_intf)
433   MCFG_K053252_ADD("k053252")
443   MCFG_K053252_ADD("k053252", 16000000/2, rng_k053252_intf)
434444
435445   /* sound hardware */
436446   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
src/mame/drivers/midyunit.c
r11556r11557
213213   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
214214   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
215215   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
216   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
217   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
218   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
219   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
216   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 Crouch") PORT_PLAYER(1)
217   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Fire") PORT_PLAYER(1)
218   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Jump") PORT_PLAYER(1)
219   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 Rocket Bomb") PORT_PLAYER(1)
220220   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
221221   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
222222   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
223223   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
224   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
225   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
226   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
227   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
224   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P2 Crouch") PORT_PLAYER(2)
225   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 Fire") PORT_PLAYER(2)
226   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 Jump") PORT_PLAYER(2)
227   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 Rocket Bomb") PORT_PLAYER(2)
228228
229229   PORT_START("IN1")
230230   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
r11556r11557
273273   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
274274   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
275275   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
276   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
276   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Punch") PORT_PLAYER(1)
277277   PORT_BIT( 0x00e0, IP_ACTIVE_LOW, IPT_UNUSED )
278278   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
279279   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
280280   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
281281   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
282   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
282   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 Punch") PORT_PLAYER(2)
283283   PORT_BIT( 0xe000, IP_ACTIVE_LOW, IPT_UNUSED )
284284
285285   PORT_START("IN1")
r11556r11557
298298   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
299299   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
300300   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
301   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
301   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P3 Punch") PORT_PLAYER(3)
302302
303303   PORT_START("IN2")
304304   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4)
305305   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4)
306306   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
307307   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
308   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
308   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P4 Punch") PORT_PLAYER(4)
309309   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_COIN3 )
310310   PORT_BIT( 0xffc0, IP_ACTIVE_LOW, IPT_UNUSED )
311311
r11556r11557
365365
366366static INPUT_PORTS_START( smashtv )
367367   PORT_START("IN0")
368   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_PLAYER(1)
369   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_PLAYER(1)
370   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_PLAYER(1)
371   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_PLAYER(1)
372   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_PLAYER(1)
373   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_PLAYER(1)
374   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_PLAYER(1)
375   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_PLAYER(1)
376   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_PLAYER(2)
377   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_PLAYER(2)
378   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_PLAYER(2)
379   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_PLAYER(2)
380   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_PLAYER(2)
381   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_PLAYER(2)
382   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_PLAYER(2)
383   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_PLAYER(2)
368   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_NAME("P1 Move Up") PORT_PLAYER(1)
369   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_NAME("P1 Move Down") PORT_PLAYER(1)
370   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_NAME("P1 Move Left") PORT_PLAYER(1)
371   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_NAME("P1 Move Right") PORT_PLAYER(1)
372   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_NAME("P1 Fire Up") PORT_PLAYER(1)
373   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_NAME("P1 Fire Down") PORT_PLAYER(1)
374   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_NAME("P1 Fire Left")PORT_PLAYER(1)
375   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_NAME("P1 Fire Right") PORT_PLAYER(1)
376   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_NAME("P2 Move Up") PORT_PLAYER(2)
377   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_NAME("P2 Move Down") PORT_PLAYER(2)
378   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_NAME("P2 Move Left") PORT_PLAYER(2)
379   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_NAME("P2 Move Right") PORT_PLAYER(2)
380   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_NAME("P2 Fire Up") PORT_PLAYER(2)
381   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_NAME("P2 Fire Down") PORT_PLAYER(2)
382   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_NAME("P2 Fire Left") PORT_PLAYER(2)
383   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_NAME("P2 Fire Right") PORT_PLAYER(2)
384384
385
385386   PORT_START("IN1")
386387   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
387388   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
r11556r11557
465466   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
466467   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
467468   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
468   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
469   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
470   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
469   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Fire") PORT_PLAYER(1)
470   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 Weapon") PORT_PLAYER(1)
471   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Weapon Select") PORT_PLAYER(1)
471472   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
472473   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
473474   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
474475   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
475476   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
476   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
477   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
478   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
477   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 Fire") PORT_PLAYER(2)
478   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 Weapon") PORT_PLAYER(2)
479   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Weapon Select") PORT_PLAYER(2)
479480   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
480481
481482   PORT_START("IN1")
482483   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
483484   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
484   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
485   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("P1 Start / Transform")
485486   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
486487   PORT_SERVICE( 0x0010, IP_ACTIVE_LOW )
487   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
488   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("P2 Start / Transform")
488489   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
489490   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN3 )
490491   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED )
r11556r11557
562563   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
563564   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
564565   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
565   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
566   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
567   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
566   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 High Punch") PORT_PLAYER(1)
567   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Block") PORT_PLAYER(1)
568   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 High Kick") PORT_PLAYER(1)
568569   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
569570   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
570571   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
571572   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
572573   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
573   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
574   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
575   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
574   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 High Punch") PORT_PLAYER(2)
575   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Block") PORT_PLAYER(2)
576   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 High Kick") PORT_PLAYER(2)
576577   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
577578
578579   PORT_START("IN1")
r11556r11557
585586   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
586587   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BILL1 )
587588   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN3 )
588   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
589   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
590   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
591   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
592   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
589   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P2 Low Punch") PORT_PLAYER(2)
590   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P2 Low Kick") PORT_PLAYER(2)
591   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P2 Block 2") PORT_PLAYER(2)
592   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 Low Punch") PORT_PLAYER(1)
593   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 Low Kick") PORT_PLAYER(1)
593594   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(adpcm_irq_state_r, NULL)
594   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1)
595   //There should be an additional block button for player 2, but I coudn't find it.
595   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P1 Block 2") PORT_PLAYER(1)
596596
597597   PORT_START("IN2")
598598   PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN )
r11556r11557
655655   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
656656   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
657657   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
658   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
659   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
660   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
658   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 High Punch") PORT_PLAYER(1)
659   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Block") PORT_PLAYER(1)
660   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 High Kick") PORT_PLAYER(1)
661661   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
662662   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
663663   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
664664   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
665665   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
666   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
667   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
668   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
666   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 High Punch") PORT_PLAYER(2)
667   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 Block") PORT_PLAYER(2)
668   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 High Kick") PORT_PLAYER(2)
669669   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
670670
671671   PORT_START("IN1")
r11556r11557
678678   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
679679   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BILL1 )
680680   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN3 )
681   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
682   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
683   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
684   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
685   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
681   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P2 Low Punch") PORT_PLAYER(2)
682   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P2 Low Kick") PORT_PLAYER(2)
683   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P2 Block 2") PORT_PLAYER(2)
684   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 Low Punch") PORT_PLAYER(1)
685   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 Low Kick") PORT_PLAYER(1)
686686   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(adpcm_irq_state_r, NULL)
687   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1)
688   //There should be an additional block button for player 2, but I coudn't find it.
687   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P1 Block 2") PORT_PLAYER(1)
689688
690689   PORT_START("IN2")
691690   PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN )
r11556r11557
748747static INPUT_PORTS_START( term2 )
749748   PORT_START("IN0")
750749   PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED )
751   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
752   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
750   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Trigger") PORT_PLAYER(1)
751   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Bomb") PORT_PLAYER(1)
753752   PORT_BIT( 0x00c0, IP_ACTIVE_LOW, IPT_UNUSED )
754753   PORT_BIT( 0x0f00, IP_ACTIVE_LOW, IPT_UNUSED )
755   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
756   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
754   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 Trigger") PORT_PLAYER(2)
755   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 Bomb") PORT_PLAYER(2)
757756   PORT_BIT( 0xc000, IP_ACTIVE_LOW, IPT_UNUSED )
758757
759758   PORT_START("IN1")
r11556r11557
846845
847846static INPUT_PORTS_START( totcarn )
848847   PORT_START("IN0")
849   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_PLAYER(1)
850   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_PLAYER(1)
851   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_PLAYER(1)
852   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_PLAYER(1)
853   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_PLAYER(1)
854   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_PLAYER(1)
855   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_PLAYER(1)
856   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_PLAYER(1)
857   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_PLAYER(2)
858   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_PLAYER(2)
859   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_PLAYER(2)
860   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_PLAYER(2)
861   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_PLAYER(2)
862   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_PLAYER(2)
863   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_PLAYER(2)
864   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_PLAYER(2)
848   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_NAME("P1 Move Up") PORT_PLAYER(1)
849   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_NAME("P1 Move Down") PORT_PLAYER(1)
850   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_NAME("P1 Move Left") PORT_PLAYER(1)
851   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_NAME("P1 Move Right") PORT_PLAYER(1)
852   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_NAME("P1 Fire Up") PORT_PLAYER(1)
853   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_NAME("P1 Fire Down") PORT_PLAYER(1)
854   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_NAME("P1 Fire Left") PORT_PLAYER(1)
855   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_NAME("P1 Fire Right") PORT_PLAYER(1)
856   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_NAME("P2 Move Up") PORT_PLAYER(2)
857   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_NAME("P2 Move Down") PORT_PLAYER(2)
858   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_NAME("P2 Move Left") PORT_PLAYER(2)
859   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_NAME("P2 Move Right") PORT_PLAYER(2)
860   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_NAME("P2 Fire Up") PORT_PLAYER(2)
861   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_NAME("P2 Fire Down") PORT_PLAYER(2)
862   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_NAME("P2 Fire Left") PORT_PLAYER(2)
863   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_NAME("P2 Fire Right") PORT_PLAYER(2)
865864
866865   PORT_START("IN1")
867866   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
868867   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
869   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
868   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("P1 Start / Bomb")
870869   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
871870   PORT_SERVICE( 0x0010, IP_ACTIVE_LOW )
872   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
871   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("P2 Start / Bomb")
873872   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
874873   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BILL1 )
875874   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED ) /* video freeze */
src/mame/drivers/hexion.c
r11556r11557
8484#include "sound/k051649.h"
8585#include "includes/konamipt.h"
8686#include "includes/hexion.h"
87#include "video/konicdev.h"
87#include "machine/k053252.h"
8888
8989
9090static WRITE8_HANDLER( coincntr_w )
r11556r11557
102102if ((data & 0xdc) != 0x10) popmessage("coincntr %02x",data);
103103}
104104
105/* probably not? */
106static WRITE8_HANDLER( hexion_irq_ack_w )
105static WRITE_LINE_DEVICE_HANDLER( hexion_irq_ack_w )
107106{
108   cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
107   cputag_set_input_line(device->machine(), "maincpu", 0, CLEAR_LINE);
109108}
110109
111static WRITE8_HANDLER( hexion_nmi_ack_w )
110static WRITE_LINE_DEVICE_HANDLER( hexion_nmi_ack_w )
112111{
113   cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
112   cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
114113}
115114
116115static ADDRESS_MAP_START( hexion_map, AS_PROGRAM, 8 )
r11556r11557
123122   AM_RANGE(0xe880, 0xe889) AM_DEVWRITE("konami", k051649_frequency_w)
124123   AM_RANGE(0xe88a, 0xe88e) AM_DEVWRITE("konami", k051649_volume_w)
125124   AM_RANGE(0xe88f, 0xe88f) AM_DEVWRITE("konami", k051649_keyonoff_w)
126   AM_RANGE(0xf000, 0xf00d) AM_DEVREADWRITE("k053252",k053252_r,k053252_w)   /* 053252? f00e = IRQ ack, f00f = NMI ack */
127   AM_RANGE(0xf00e, 0xf00e) AM_WRITE(hexion_irq_ack_w) // - TODO: move these two into the above hook-up
128   AM_RANGE(0xf00f, 0xf00f) AM_WRITE(hexion_nmi_ack_w) // /
125   AM_RANGE(0xf000, 0xf00f) AM_DEVREADWRITE("k053252",k053252_r,k053252_w)
129126   AM_RANGE(0xf200, 0xf200) AM_DEVWRITE_MODERN("oki", okim6295_device, write)
130127   AM_RANGE(0xf400, 0xf400) AM_READ_PORT("DSW1")
131128   AM_RANGE(0xf401, 0xf401) AM_READ_PORT("DSW2")
r11556r11557
229226      cputag_set_input_line(timer.machine(), "maincpu", INPUT_LINE_NMI, ASSERT_LINE);
230227}
231228
229static const k053252_interface hexion_k053252_intf =
230{
231   "screen",
232   DEVCB_NULL,
233   DEVCB_NULL,
234   DEVCB_LINE(hexion_irq_ack_w),
235   DEVCB_LINE(hexion_nmi_ack_w)
236};
237
232238static MACHINE_CONFIG_START( hexion, hexion_state )
233239
234240   /* basic machine hardware */
r11556r11557
236242   MCFG_CPU_PROGRAM_MAP(hexion_map)
237243   MCFG_TIMER_ADD_SCANLINE("scantimer", hexion_scanline, "screen", 0, 1)
238244
239   MCFG_K053252_ADD("k053252")
245   MCFG_K053252_ADD("k053252", 24000000/2, hexion_k053252_intf)
240246
241247   /* video hardware */
242248   MCFG_SCREEN_ADD("screen", RASTER)
src/mame/drivers/midtunit.c
r11556r11557
279279   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
280280   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
281281   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
282   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Punch") PORT_PLAYER(1)
283   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 Jump") PORT_PLAYER(1)
282   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Jump") PORT_PLAYER(1)
283   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 Punch") PORT_PLAYER(1)
284284   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Kick") PORT_PLAYER(1)
285285   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 Crouch") PORT_PLAYER(1)
286286   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
287287   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
288288   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
289289   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
290   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 Punch") PORT_PLAYER(2)
291   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 Jump") PORT_PLAYER(2)
290   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 Jump") PORT_PLAYER(2)
291   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 Punch") PORT_PLAYER(2)
292292   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 Kick") PORT_PLAYER(2)
293293   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P2 Crouch") PORT_PLAYER(2)
294294
r11556r11557
313313   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
314314   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
315315   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
316   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P3 Punch") PORT_PLAYER(3)
317   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P3 Jump") PORT_PLAYER(3)
316   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P3 Jump") PORT_PLAYER(3)
317   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P3 Punch") PORT_PLAYER(3)
318318   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P3 Kick") PORT_PLAYER(3)
319319   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P3 Crouch") PORT_PLAYER(3)
320320   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
src/mame/drivers/dbz.c
r11556r11557
5757#include "sound/okim6295.h"
5858#include "includes/dbz.h"
5959#include "video/konicdev.h"
60#include "machine/k053252.h"
6061
6162
6263
r11556r11557
6667   int scanline = param;
6768
6869   if(scanline == 256) // vblank-out irq
69      cputag_set_input_line(timer.machine(), "maincpu", M68K_IRQ_2, HOLD_LINE);
70      cputag_set_input_line(timer.machine(), "maincpu", M68K_IRQ_2, ASSERT_LINE);
7071
7172   if(scanline == 0 && k053246_is_irq_enabled(state->m_k053246)) // vblank-in irq
72      cputag_set_input_line(timer.machine(), "maincpu", M68K_IRQ_4, HOLD_LINE);
73      cputag_set_input_line(timer.machine(), "maincpu", M68K_IRQ_4, HOLD_LINE); //auto-acks apparently
7374}
7475
7576#if 0
r11556r11557
326327   1, -46, -16
327328};
328329
330static WRITE_LINE_DEVICE_HANDLER( dbz_irq2_ack_w )
331{
332   cputag_set_input_line(device->machine(), "maincpu", M68K_IRQ_2, CLEAR_LINE);
333}
329334
335
336static const k053252_interface dbz_k053252_intf =
337{
338   "screen",
339   DEVCB_NULL,
340   DEVCB_NULL,
341   DEVCB_LINE(dbz_irq2_ack_w),
342   DEVCB_NULL,
343   0, 0
344};
345
330346static MACHINE_START( dbz )
331347{
332348   dbz_state *state = machine.driver_data<dbz_state>();
r11556r11557
395411   MCFG_K053251_ADD("k053251")
396412   MCFG_K053936_ADD("k053936_1", dbz_k053936_intf)
397413   MCFG_K053936_ADD("k053936_2", dbz_k053936_intf)
398   MCFG_K053252_ADD("k053252")
414   MCFG_K053252_ADD("k053252", 16000000/2, dbz_k053252_intf)
399415
400416   /* sound hardware */
401417   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
src/mame/drivers/qdrmfgp.c
r11556r11557
2525#include "machine/idectrl.h"
2626#include "sound/k054539.h"
2727#include "video/konicdev.h"
28#include "machine/k053252.h"
2829#include "machine/nvram.h"
2930#include "includes/qdrmfgp.h"
3031
r11556r11557
280281      case 1:
281282         /* trigger V-blank interrupt */
282283         if (state->m_control & 0x0004)
283            device_set_input_line(device, 3, HOLD_LINE);
284            device_set_input_line(device, 3, ASSERT_LINE);
284285         break;
285286   }
286287}
r11556r11557
303304{
304305   qdrmfgp_state *state = machine.driver_data<qdrmfgp_state>();
305306   if (state->m_control & 0x0004)
306      cputag_set_input_line(machine, "maincpu", 3, HOLD_LINE);
307      cputag_set_input_line(machine, "maincpu", 3, ASSERT_LINE);
307308}
308309
309310static INTERRUPT_GEN(qdrmfgp2_interrupt)
r11556r11557
311312   qdrmfgp_state *state = device->machine().driver_data<qdrmfgp_state>();
312313   /* trigger V-blank interrupt */
313314   if (state->m_control & 0x0008)
314      device_set_input_line(device, 4, HOLD_LINE);
315      device_set_input_line(device, 4, ASSERT_LINE);
315316}
316317
317318static void gp2_ide_interrupt(device_t *device, int state)
r11556r11557
369370   AM_RANGE(0x180000, 0x183fff) AM_RAM AM_SHARE("nvram")   /* backup ram */
370371   AM_RANGE(0x280000, 0x280fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE_GENERIC(paletteram)
371372   AM_RANGE(0x300000, 0x30003f) AM_DEVWRITE("k056832", k056832_word_w)                              /* video reg */
372   AM_RANGE(0x320000, 0x32001f) AM_DEVREADWRITE8("k053252", k053252_r, k053252_w,0x00ff)               /* ccu */
373   AM_RANGE(0x320000, 0x32001f) AM_DEVREADWRITE8("k053252", k053252_r, k053252_w,0xff00)               /* ccu */
373374   AM_RANGE(0x330000, 0x330001) AM_READ_PORT("SENSOR")                                 /* battery power & service */
374375   AM_RANGE(0x340000, 0x340001) AM_READ_PORT("340000")                                 /* inputport */
375376   AM_RANGE(0x350000, 0x350001) AM_WRITENOP                                       /* unknown */
r11556r11557
611612   qdrmfgp2_tile_callback, "none"
612613};
613614
615static WRITE_LINE_DEVICE_HANDLER( qdrmfgp_irq3_ack_w )
616{
617   cputag_set_input_line(device->machine(), "maincpu", M68K_IRQ_3, CLEAR_LINE);
618}
619
620static WRITE_LINE_DEVICE_HANDLER( qdrmfgp_irq4_ack_w )
621{
622   cputag_set_input_line(device->machine(), "maincpu", M68K_IRQ_4, CLEAR_LINE);
623}
624
625static const k053252_interface qdrmfgp_k053252_intf =
626{
627   "screen",
628   DEVCB_NULL,
629   DEVCB_NULL,
630   DEVCB_LINE(qdrmfgp_irq3_ack_w),
631   DEVCB_NULL,
632   40, 16
633};
634
635static const k053252_interface qdrmfgp2_k053252_intf =
636{
637   "screen",
638   DEVCB_NULL,
639   DEVCB_NULL,
640   DEVCB_LINE(qdrmfgp_irq4_ack_w),
641   DEVCB_LINE(qdrmfgp_irq3_ack_w),
642   40, 16
643};
644
614645static MACHINE_START( qdrmfgp )
615646{
616647   qdrmfgp_state *state = machine.driver_data<qdrmfgp_state>();
r11556r11557
671702   MCFG_VIDEO_START(qdrmfgp)
672703
673704   MCFG_K056832_ADD("k056832", qdrmfgp_k056832_intf)
674   MCFG_K053252_ADD("k053252")
705   MCFG_K053252_ADD("k053252", 32000000/4, qdrmfgp_k053252_intf)
675706
676707   /* sound hardware */
677708   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
r11556r11557
709740   MCFG_VIDEO_START(qdrmfgp2)
710741
711742   MCFG_K056832_ADD("k056832", qdrmfgp2_k056832_intf)
712   MCFG_K053252_ADD("k053252")
743   MCFG_K053252_ADD("k053252", 32000000/4, qdrmfgp2_k053252_intf)
713744
714745   /* sound hardware */
715746   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
src/mame/drivers/cps1.c
r11556r11557
778778   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START4 )
779779INPUT_PORTS_END
780780
781/* CPS1 games with 2 players and 6 buttons each */
782static INPUT_PORTS_START( cps1_6b)
783   PORT_INCLUDE( cps1_3b)
784   
785   PORT_MODIFY("IN1")
786   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Jab Punch") PORT_PLAYER(1)
787   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Strong Punch") PORT_PLAYER(1)
788   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 Fierce Punch") PORT_PLAYER(1)
789   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 Jab Punch") PORT_PLAYER(2)
790   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 Strong Punch") PORT_PLAYER(2)
791   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 Fierce Punch") PORT_PLAYER(2)
792   
793   PORT_START("IN2")      /* Extra buttons */
794   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 Short Kick") PORT_PLAYER(1)
795   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 Forward Kick") PORT_PLAYER(1)
796   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P1 Roundhouse Kick") PORT_PLAYER(1)
797   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
798   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P2 Short Kick") PORT_PLAYER(2)
799   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P2 Forward Kick") PORT_PLAYER(2)
800   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P2 Roundhouse Kick") PORT_PLAYER(2)
801   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
802INPUT_PORTS_END
803
781804/* CPS1 quiz games */
782805static INPUT_PORTS_START( cps1_quiz )
783806   PORT_INCLUDE( cps1_3b )
r11556r11557
17081731INPUT_PORTS_END
17091732
17101733static INPUT_PORTS_START( sf2 )
1711   PORT_INCLUDE( cps1_3b )
1734   PORT_INCLUDE( cps1_6b )
17121735
17131736   PORT_MODIFY("IN0")
17141737   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
r11556r11557
17491772   PORT_DIPNAME( 0x80, 0x80, "Game Mode")                     PORT_DIPLOCATION("SW(C):8")
17501773   PORT_DIPSETTING(    0x80, "Game" )
17511774   PORT_DIPSETTING(    0x00, DEF_STR( Test ) )
1752
1753   PORT_START("IN2")      /* Extra buttons */
1754   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
1755   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
1756   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1)
1757   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1758   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
1759   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
1760   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
1761   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1775   
17621776INPUT_PORTS_END
17631777
17641778/* Needs further checking */
r11556r11557
17761790
17771791   PORT_MODIFY("IN2")      /* Extra buttons */
17781792   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
1779   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
1780   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
1781   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1)
1793   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 Short Kick") PORT_PLAYER(1)
1794   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 Forward Kick") PORT_PLAYER(1)
1795   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P1 Roundhouse Kick") PORT_PLAYER(1)
17821796   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1783   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
1784   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
1785   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
1797   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P2 Short Kick") PORT_PLAYER(2)
1798   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P2 Forward Kick") PORT_PLAYER(2)
1799   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P2 Roundhouse Kick") PORT_PLAYER(2)
17861800   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
17871801INPUT_PORTS_END
17881802
src/mame/drivers/xexex.c
r11556r11557
6161#include "cpu/m68000/m68000.h"
6262#include "deprecat.h"
6363#include "video/konicdev.h"
64#include "machine/k053252.h"
6465#include "cpu/z80/z80.h"
6566#include "machine/eeprom.h"
6667#include "sound/k054539.h"
r11556r11557
338339   AM_RANGE(0x0c8000, 0x0c800f) AM_DEVREADWRITE("k053250", k053250_r, k053250_w)
339340   AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVWRITE("k054338", k054338_word_w)            // CLTC
340341   AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVWRITE("k053251", k053251_lsb_w)            // priority encoder
341   AM_RANGE(0x0d0000, 0x0d001f) AM_DEVREADWRITE8("k053252", k053252_r,k053252_w,0x00ff)            // CCU
342//   AM_RANGE(0x0d0000, 0x0d001f) AM_DEVREADWRITE8("k053252", k053252_r,k053252_w,0x00ff)            // CCU
342343   AM_RANGE(0x0d4000, 0x0d4001) AM_WRITE(sound_irq_w)
343344   AM_RANGE(0x0d600c, 0x0d600d) AM_WRITE(sound_cmd1_w)
344345   AM_RANGE(0x0d600e, 0x0d600f) AM_WRITE(sound_cmd2_w)
r11556r11557
362363   AM_RANGE(0x0c2000, 0x0c2007) AM_DEVREAD("k053246", k053246_reg_word_r)
363364   AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVREAD("k054338", k054338_word_r)
364365   AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVREAD("k053251", k053251_lsb_r)
365   AM_RANGE(0x0d0000, 0x0d001f) AM_DEVREAD("k053252", k053252_word_r)
366366   AM_RANGE(0x0d8000, 0x0d8007) AM_DEVREAD("k056832", k056832_b_word_r)
367367#endif
368368
r11556r11557
455455   xexex_sprite_callback
456456};
457457
458static const k053252_interface xexex_k053252_intf =
459{
460   "screen",
461   DEVCB_NULL,
462   DEVCB_NULL,
463   DEVCB_NULL,
464   DEVCB_NULL,
465   0, 0
466};
467
458468static void xexex_postload(running_machine &machine)
459469{
460470   parse_control2(machine);
r11556r11557
522532static MACHINE_CONFIG_START( xexex, xexex_state )
523533
524534   /* basic machine hardware */
525   MCFG_CPU_ADD("maincpu", M68000, 16000000)   // 16MHz (32MHz xtal)
535   MCFG_CPU_ADD("maincpu", M68000, 32000000/2)   // 16MHz (32MHz xtal)
526536   MCFG_CPU_PROGRAM_MAP(main_map)
527537   MCFG_CPU_VBLANK_INT_HACK(xexex_interrupt,2)
528538
r11556r11557
558568   MCFG_K053246_ADD("k053246", xexex_k053246_intf)
559569   MCFG_K053250_ADD("k053250", xexex_k053250_intf)
560570   MCFG_K053251_ADD("k053251")
561   MCFG_K053252_ADD("k053252")
571   MCFG_K053252_ADD("k053252", 32000000/4, xexex_k053252_intf)
562572   MCFG_K054338_ADD("k054338", xexex_k054338_intf)
563573
564574   /* sound hardware */
src/mame/drivers/cps3.c
r11556r11557
22392239   AM_RANGE(0xc0000000, 0xc00003ff) AM_RAM_WRITE( cps3_0xc0000000_ram_w ) AM_BASE_MEMBER(cps3_state, m_0xc0000000_ram) /* Executes code from here */
22402240ADDRESS_MAP_END
22412241
2242
2243
2244
22452242static INPUT_PORTS_START( cps3 )
22462243   PORT_START("INPUTS")
22472244   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
22482245   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
22492246   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
22502247   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
2251   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
2252   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
2253   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
2248   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Jab Punch") PORT_PLAYER(1)
2249   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Strong Punch") PORT_PLAYER(1)
2250   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 Fierce Punch") PORT_PLAYER(1)
22542251   PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNUSED ) // nothing here?
22552252   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
22562253   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
22572254   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
22582255   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
2259   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
2260   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
2261   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
2256   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 Jab Punch") PORT_PLAYER(2)
2257   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 Strong Punch") PORT_PLAYER(2)
2258   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 Fierce Punch") PORT_PLAYER(2)
22622259   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNUSED ) // nothing here?
22632260   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_SERVICE1 )
22642261   PORT_SERVICE_NO_TOGGLE( 0x00020000, IP_ACTIVE_LOW )
22652262   PORT_BIT( 0x00fc0000, IP_ACTIVE_LOW, IPT_UNUSED ) // nothing here?
22662263   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_COIN1 )
22672264   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_COIN2 )
2268   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
2265   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P2 Roundhouse Kick") PORT_PLAYER(2)
22692266   PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_UNUSED ) // nothing here?
22702267   PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_START1 )
22712268   PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_START2 )
r11556r11557
22732270
22742271   PORT_START("EXTRA")
22752272   PORT_BIT( 0x0001ffff, IP_ACTIVE_LOW, IPT_UNUSED ) // nothing here?
2276   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1)
2277   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
2278   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
2279   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
2280   PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
2273   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P1 Roundhouse Kick") PORT_PLAYER(1)
2274   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 Forward Kick") PORT_PLAYER(1)
2275   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 Short Kick") PORT_PLAYER(1)
2276   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P2 Short Kick") PORT_PLAYER(2)
2277   PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P2 Forward Kick") PORT_PLAYER(2)
22812278   PORT_BIT( 0xffc00000, IP_ACTIVE_LOW, IPT_UNUSED ) // nothing here?
22822279INPUT_PORTS_END
22832280
2281/* Red Earth game inputs */
2282static INPUT_PORTS_START ( cps3_re )
2283   PORT_INCLUDE ( cps3 )
2284   
2285   PORT_MODIFY("INPUTS")
2286   PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("P1 Start / Change Orb")
2287   PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("P2 Start / Change Orb")
2288INPUT_PORTS_END
2289
2290/* Jojo game inputs */
2291static INPUT_PORTS_START( cps3_jojo)
2292   PORT_INCLUDE( cps3 )
2293   
2294   PORT_MODIFY("INPUTS")
2295   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Light") PORT_PLAYER(1)
2296   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Medium") PORT_PLAYER(1)
2297   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 Strong") PORT_PLAYER(1)
2298   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 Light") PORT_PLAYER(2)
2299   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 Medium") PORT_PLAYER(2)
2300   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 Strong") PORT_PLAYER(2)
2301   PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_PLAYER(2)
2302   
2303   PORT_MODIFY("EXTRA")
2304   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_PLAYER(1)
2305   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_PLAYER(1)
2306   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 Stand") PORT_PLAYER(1)
2307   PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P2 Stand") PORT_PLAYER(2)
2308   PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_PLAYER(2)
2309INPUT_PORTS_END
2310
22842311static INTERRUPT_GEN(cps3_vbl_interrupt)
22852312{
22862313   device_set_input_line(device,12, ASSERT_LINE);
r11556r11557
32793306
32803307/* todo: use BIOS for the bios roms, having clones only for CD / NO CD */
32813308
3282GAME( 1996, redearth, 0,        redearth, cps3, redearth, ROT0, "Capcom", "Red Earth (Euro 961121)", GAME_IMPERFECT_GRAPHICS )
3283GAME( 1996, redeartha,redearth, redearth, cps3, redearth, ROT0, "Capcom", "Red Earth (Euro 961023)", GAME_IMPERFECT_GRAPHICS )
3284GAME( 1996, warzard,  redearth, redearth, cps3, redearth, ROT0, "Capcom", "Warzard (Japan 961121)", GAME_IMPERFECT_GRAPHICS )
3285GAME( 1996, warzarda, redearth, redearth, cps3, redearth, ROT0, "Capcom", "Warzard (Japan 961023)", GAME_IMPERFECT_GRAPHICS )
3286GAME( 1997, sfiii,    0,        sfiii,    cps3, sfiii,    ROT0, "Capcom", "Street Fighter III: New Generation (USA 970204)", GAME_IMPERFECT_GRAPHICS )
3287GAME( 1997, sfiiij,   sfiii,    sfiii,    cps3, sfiii,    ROT0, "Capcom", "Street Fighter III: New Generation (Japan 970204)", GAME_IMPERFECT_GRAPHICS )
3288GAME( 1997, sfiiih,   sfiii,    sfiii,    cps3, sfiii,    ROT0, "Capcom", "Street Fighter III: New Generation (Hispanic 970204)", GAME_IMPERFECT_GRAPHICS )
3289GAME( 1997, sfiii2,   0,        sfiii2,   cps3, sfiii2,   ROT0, "Capcom", "Street Fighter III 2nd Impact: Giant Attack (USA 970930)", GAME_IMPERFECT_GRAPHICS )
3290GAME( 1997, sfiii2j,  sfiii2,   sfiii2,   cps3, sfiii2,   ROT0, "Capcom", "Street Fighter III 2nd Impact: Giant Attack (Japan 970930)", GAME_IMPERFECT_GRAPHICS )
3291GAME( 1998, jojo,     0,        jojo,     cps3, jojo,     ROT0, "Capcom", "JoJo's Venture (USA 990108)", GAME_IMPERFECT_GRAPHICS )
3292GAME( 1998, jojoa,    jojo,     jojo,     cps3, jojo,     ROT0, "Capcom", "JoJo's Venture (USA 981202)", GAME_IMPERFECT_GRAPHICS )
3293GAME( 1998, jojoj,    jojo,     jojo,     cps3, jojo,     ROT0, "Capcom", "JoJo no Kimyouna Bouken (Japan 990108)", GAME_IMPERFECT_GRAPHICS )
3294GAME( 1998, jojoaj,   jojo,     jojo,     cps3, jojo,     ROT0, "Capcom", "JoJo no Kimyouna Bouken (Japan 981202)", GAME_IMPERFECT_GRAPHICS )
3295GAME( 1999, sfiii3,   0,        sfiii3,   cps3, sfiii3,   ROT0, "Capcom", "Street Fighter III 3rd Strike: Fight for the Future (USA 990608)", GAME_IMPERFECT_GRAPHICS )
3296GAME( 1999, sfiii3a,  sfiii3,   sfiii3,   cps3, sfiii3,   ROT0, "Capcom", "Street Fighter III 3rd Strike: Fight for the Future (USA 990512)", GAME_IMPERFECT_GRAPHICS )
3297GAME( 1999, jojoba,   0,        jojoba,   cps3, jojoba,   ROT0, "Capcom", "JoJo no Kimyouna Bouken: Miraie no Isan (Japan 990913)", GAME_IMPERFECT_GRAPHICS )
3309GAME( 1996, redearth, 0,        redearth, cps3_re,   redearth, ROT0, "Capcom", "Red Earth (Euro 961121)", GAME_IMPERFECT_GRAPHICS )
3310GAME( 1996, redeartha,redearth, redearth, cps3_re,   redearth, ROT0, "Capcom", "Red Earth (Euro 961023)", GAME_IMPERFECT_GRAPHICS )
3311GAME( 1996, warzard,  redearth, redearth, cps3_re,   redearth, ROT0, "Capcom", "Warzard (Japan 961121)", GAME_IMPERFECT_GRAPHICS )
3312GAME( 1996, warzarda, redearth, redearth, cps3_re,   redearth, ROT0, "Capcom", "Warzard (Japan 961023)", GAME_IMPERFECT_GRAPHICS )
3313GAME( 1997, sfiii,    0,        sfiii,    cps3,      sfiii,    ROT0, "Capcom", "Street Fighter III: New Generation (USA 970204)", GAME_IMPERFECT_GRAPHICS )
3314GAME( 1997, sfiiij,   sfiii,    sfiii,    cps3,      sfiii,    ROT0, "Capcom", "Street Fighter III: New Generation (Japan 970204)", GAME_IMPERFECT_GRAPHICS )
3315GAME( 1997, sfiiih,   sfiii,    sfiii,    cps3,      sfiii,    ROT0, "Capcom", "Street Fighter III: New Generation (Hispanic 970204)", GAME_IMPERFECT_GRAPHICS )
3316GAME( 1997, sfiii2,   0,        sfiii2,   cps3,      sfiii2,   ROT0, "Capcom", "Street Fighter III 2nd Impact: Giant Attack (USA 970930)", GAME_IMPERFECT_GRAPHICS )
3317GAME( 1997, sfiii2j,  sfiii2,   sfiii2,   cps3,      sfiii2,   ROT0, "Capcom", "Street Fighter III 2nd Impact: Giant Attack (Japan 970930)", GAME_IMPERFECT_GRAPHICS )
3318GAME( 1998, jojo,     0,        jojo,     cps3_jojo, jojo,     ROT0, "Capcom", "JoJo's Venture (USA 990108)", GAME_IMPERFECT_GRAPHICS )
3319GAME( 1998, jojoa,    jojo,     jojo,     cps3_jojo, jojo,     ROT0, "Capcom", "JoJo's Venture (USA 981202)", GAME_IMPERFECT_GRAPHICS )
3320GAME( 1998, jojoj,    jojo,     jojo,     cps3_jojo, jojo,     ROT0, "Capcom", "JoJo no Kimyouna Bouken (Japan 990108)", GAME_IMPERFECT_GRAPHICS )
3321GAME( 1998, jojoaj,   jojo,     jojo,     cps3_jojo, jojo,     ROT0, "Capcom", "JoJo no Kimyouna Bouken (Japan 981202)", GAME_IMPERFECT_GRAPHICS )
3322GAME( 1999, sfiii3,   0,        sfiii3,   cps3,      sfiii3,   ROT0, "Capcom", "Street Fighter III 3rd Strike: Fight for the Future (USA 990608)", GAME_IMPERFECT_GRAPHICS )
3323GAME( 1999, sfiii3a,  sfiii3,   sfiii3,   cps3,      sfiii3,   ROT0, "Capcom", "Street Fighter III 3rd Strike: Fight for the Future (USA 990512)", GAME_IMPERFECT_GRAPHICS )
3324GAME( 1999, jojoba,   0,        jojoba,   cps3_jojo, jojoba,   ROT0, "Capcom", "JoJo no Kimyouna Bouken: Miraie no Isan (Japan 990913)", GAME_IMPERFECT_GRAPHICS )
32983325
32993326/* NO CD sets */
33003327
3301GAME( 1997, sfiiin,   sfiii,    sfiii,    cps3, sfiii,    ROT0, "Capcom", "Street Fighter III: New Generation (Asia 970204, NO CD)", GAME_IMPERFECT_GRAPHICS )
3302GAME( 1997, sfiii2n,  sfiii2,   sfiii2,   cps3, sfiii2,   ROT0, "Capcom", "Street Fighter III 2nd Impact: Giant Attack (Asia 970930, NO CD)", GAME_IMPERFECT_GRAPHICS )
3303GAME( 1998, jojon,    jojo,     jojo,     cps3, jojo,     ROT0, "Capcom", "JoJo's Venture (Asia 990108, NO CD)", GAME_IMPERFECT_GRAPHICS )
3304GAME( 1998, jojoan,   jojo,     jojo,     cps3, jojo,     ROT0, "Capcom", "JoJo's Venture (Asia 981202, NO CD)", GAME_IMPERFECT_GRAPHICS )
3305GAME( 1999, sfiii3n,  sfiii3,   sfiii3,   cps3, sfiii3,   ROT0, "Capcom", "Street Fighter III 3rd Strike: Fight for the Future (Japan 990608, NO CD)", GAME_IMPERFECT_GRAPHICS )
3306GAME( 1999, sfiii3an, sfiii3,   sfiii3,   cps3, sfiii3,   ROT0, "Capcom", "Street Fighter III 3rd Strike: Fight for the Future (Japan 990512, NO CD)", GAME_IMPERFECT_GRAPHICS )
3307GAME( 1999, jojoban,  jojoba,   jojoba,   cps3, jojoba,   ROT0, "Capcom", "JoJo no Kimyouna Bouken: Miraie no Isan (Japan 990913, NO CD)", GAME_IMPERFECT_GRAPHICS )
3308GAME( 1999, jojobane, jojoba,   jojoba,   cps3, jojoba,   ROT0, "Capcom", "JoJo's Bizarre Adventure (Euro 990913, NO CD)", GAME_IMPERFECT_GRAPHICS )
3328GAME( 1997, sfiiin,   sfiii,    sfiii,    cps3,      sfiii,    ROT0, "Capcom", "Street Fighter III: New Generation (Asia 970204, NO CD)", GAME_IMPERFECT_GRAPHICS )
3329GAME( 1997, sfiii2n,  sfiii2,   sfiii2,   cps3,      sfiii2,   ROT0, "Capcom", "Street Fighter III 2nd Impact: Giant Attack (Asia 970930, NO CD)", GAME_IMPERFECT_GRAPHICS )
3330GAME( 1998, jojon,    jojo,     jojo,     cps3_jojo, jojo,     ROT0, "Capcom", "JoJo's Venture (Asia 990108, NO CD)", GAME_IMPERFECT_GRAPHICS )
3331GAME( 1998, jojoan,   jojo,     jojo,     cps3_jojo, jojo,     ROT0, "Capcom", "JoJo's Venture (Asia 981202, NO CD)", GAME_IMPERFECT_GRAPHICS )
3332GAME( 1999, sfiii3n,  sfiii3,   sfiii3,   cps3,      sfiii3,   ROT0, "Capcom", "Street Fighter III 3rd Strike: Fight for the Future (Japan 990608, NO CD)", GAME_IMPERFECT_GRAPHICS )
3333GAME( 1999, sfiii3an, sfiii3,   sfiii3,   cps3,      sfiii3,   ROT0, "Capcom", "Street Fighter III 3rd Strike: Fight for the Future (Japan 990512, NO CD)", GAME_IMPERFECT_GRAPHICS )
3334GAME( 1999, jojoban,  jojoba,   jojoba,   cps3_jojo, jojoba,   ROT0, "Capcom", "JoJo no Kimyouna Bouken: Miraie no Isan (Japan 990913, NO CD)", GAME_IMPERFECT_GRAPHICS )
3335GAME( 1999, jojobane, jojoba,   jojoba,   cps3_jojo, jojoba,   ROT0, "Capcom", "JoJo's Bizarre Adventure (Euro 990913, NO CD)", GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/tx1.c
r11556r11557
558558   AM_RANGE(0x08000, 0x09fff) AM_RAM AM_BASE_MEMBER(tx1_state, m_vram)
559559   AM_RANGE(0x0a000, 0x0afff) AM_RAM AM_SHARE("share1") AM_BASE_MEMBER(tx1_state, m_rcram)
560560   AM_RANGE(0x0b000, 0x0b001) AM_READWRITE(dipswitches_r, z80_busreq_w)
561   AM_RANGE(0x0c000, 0x0c001) AM_WRITE(tx1_scolst_w)
561   AM_RANGE(0x0c000, 0x0c001) AM_WRITE(buggyboy_scolst_w)
562562   AM_RANGE(0x0d000, 0x0d003) AM_WRITE(tx1_slincs_w)
563563   AM_RANGE(0x0e000, 0x0e001) AM_WRITE(buggyboy_sky_w)
564564   AM_RANGE(0x0f000, 0x0f003) AM_READWRITE(watchdog_reset16_r, resume_math_w)
r11556r11557
573573   AM_RANGE(0x08000, 0x08fff) AM_RAM AM_BASE_MEMBER(tx1_state, m_vram)
574574   AM_RANGE(0x0a000, 0x0afff) AM_RAM AM_SHARE("share1") AM_BASE_MEMBER(tx1_state, m_rcram)
575575   AM_RANGE(0x0b000, 0x0b001) AM_READWRITE(dipswitches_r, z80_busreq_w)
576   AM_RANGE(0x0c000, 0x0c001) AM_WRITE(tx1_scolst_w)
576   AM_RANGE(0x0c000, 0x0c001) AM_WRITE(buggyboy_scolst_w)
577577   AM_RANGE(0x0d000, 0x0d003) AM_WRITE(tx1_slincs_w)
578578   AM_RANGE(0x0e000, 0x0e001) AM_WRITE(buggyboy_sky_w)
579579   AM_RANGE(0x0f000, 0x0f003) AM_READWRITE(watchdog_reset16_r, resume_math_w)
src/mame/drivers/overdriv.c
r11556r11557
2222#include "emu.h"
2323#include "cpu/m68000/m68000.h"
2424#include "video/konicdev.h"
25#include "machine/k053252.h"
2526#include "machine/eeprom.h"
2627#include "cpu/m6809/m6809.h"
2728#include "sound/2151intf.h"
r11556r11557
345346   0, 0 //TODO
346347};
347348
349static const k053252_interface overdriv_k053252_intf =
350{
351   "screen",
352   DEVCB_NULL,
353   DEVCB_NULL,
354   DEVCB_NULL,
355   DEVCB_NULL,
356   13*8, 2*8
357};
358
359
348360static MACHINE_CONFIG_START( overdriv, overdriv_state )
349361
350362   /* basic machine hardware */
r11556r11557
390402   MCFG_K053251_ADD("k053251")
391403   MCFG_K053250_ADD("k053250_1", overdriv_k053250_intf_1)
392404   MCFG_K053250_ADD("k053250_2", overdriv_k053250_intf_2)
393   MCFG_K053252_ADD("k053252")
405   MCFG_K053252_ADD("k053252", 24000000/4, overdriv_k053252_intf)
394406
395407   /* sound hardware */
396408   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
src/mame/drivers/mystwarr.c
r11556r11557
2525#include "deprecat.h"
2626
2727#include "video/konamiic.h"
28#include "machine/k053252.h"
2829#include "includes/konamigx.h"
2930#include "cpu/m68000/m68000.h"
3031#include "cpu/z80/z80.h"
r11556r11557
280281   AM_RANGE(0x498014, 0x498015) AM_READ(sound_status_r)
281282   AM_RANGE(0x498000, 0x49801f) AM_RAM
282283   AM_RANGE(0x49a000, 0x49a001) AM_WRITE(sound_irq_w)
283   AM_RANGE(0x49c000, 0x49c01f) AM_WRITE(K053252_word_w)
284   AM_RANGE(0x49c000, 0x49c01f) AM_DEVREADWRITE8("k053252",k053252_r,k053252_w,0x00ff)
284285   AM_RANGE(0x49e000, 0x49e007) AM_WRITE(irq_ack_w)   // VSCCS (custom)
285286   AM_RANGE(0x600000, 0x601fff) AM_READWRITE(K056832_ram_word_r,K056832_ram_word_w)
286287   AM_RANGE(0x602000, 0x603fff) AM_READWRITE(K056832_ram_word_r,K056832_ram_word_w)   // tilemap RAM mirror read(essential)
r11556r11557
292293   AM_RANGE(0x484000, 0x484007) AM_READ(K053246_reg_word_r)
293294   AM_RANGE(0x48a000, 0x48a01f) AM_READ(K054338_word_r)
294295   AM_RANGE(0x48c000, 0x48c03f) AM_READ(K056832_word_r)
295   AM_RANGE(0x49c000, 0x49c01f) AM_READ(K053252_word_r)
296296#endif
297297ADDRESS_MAP_END
298298
r11556r11557
309309   AM_RANGE(0x250000, 0x25000f) AM_READWRITE(K053250_0_r,K053250_0_w)
310310   AM_RANGE(0x254000, 0x25401f) AM_WRITE(K054338_word_w)
311311   AM_RANGE(0x258000, 0x2580ff) AM_WRITE(K055555_word_w)
312   AM_RANGE(0x260000, 0x26001f) AM_WRITE(K053252_word_w)
312   AM_RANGE(0x260000, 0x26001f) AM_DEVREADWRITE8("k053252",k053252_r,k053252_w,0x00ff)
313313   AM_RANGE(0x264000, 0x264001) AM_WRITE(sound_irq_w)
314314   AM_RANGE(0x26800c, 0x26800d) AM_WRITE(sound_cmd1_w)
315315   AM_RANGE(0x26800e, 0x26800f) AM_WRITE(sound_cmd2_w)
r11556r11557
333333   AM_RANGE(0x244010, 0x24401f) AM_READ(K053247_reg_word_r)
334334   AM_RANGE(0x254000, 0x25401f) AM_READ(K054338_word_r)
335335   AM_RANGE(0x258000, 0x2580ff) AM_READ(K055555_word_r)
336   AM_RANGE(0x260000, 0x26001f) AM_READ(K053252_word_r)
337336   AM_RANGE(0x26C000, 0x26C007) AM_READ(K056832_b_word_r)
338337   AM_RANGE(0x270000, 0x27003f) AM_READ(K056832_word_r)
339338#endif
r11556r11557
353352   AM_RANGE(0x254000, 0x25401f) AM_WRITE(K054338_word_w)
354353   AM_RANGE(0x258000, 0x2580ff) AM_WRITE(K055555_word_w)
355354   AM_RANGE(0x25c000, 0x25c03f) AM_READWRITE(K055550_word_r,K055550_word_w)
356   AM_RANGE(0x260000, 0x26001f) AM_WRITE(K053252_word_w)
355   AM_RANGE(0x260000, 0x26001f) AM_DEVREADWRITE8("k053252",k053252_r,k053252_w,0x00ff)
357356   AM_RANGE(0x264000, 0x264001) AM_WRITE(sound_irq_w)
358357   AM_RANGE(0x26800c, 0x26800d) AM_WRITE(sound_cmd1_w)
359358   AM_RANGE(0x26800e, 0x26800f) AM_WRITE(sound_cmd2_w)
r11556r11557
377376   AM_RANGE(0x244010, 0x24401f) AM_READ(K053247_reg_word_r)
378377   AM_RANGE(0x254000, 0x25401f) AM_READ(K054338_word_r)
379378   AM_RANGE(0x258000, 0x2580ff) AM_READ(K055555_word_r)
380   AM_RANGE(0x260000, 0x26001f) AM_READ(K053252_word_r)
381379   AM_RANGE(0x26C000, 0x26C007) AM_READ(K056832_b_word_r)
382380   AM_RANGE(0x270000, 0x27003f) AM_READ(K056832_word_r)
383381#endif
r11556r11557
460458   AM_RANGE(0x41800e, 0x41800f) AM_WRITE(sound_cmd2_w)
461459   AM_RANGE(0x418000, 0x41801f) AM_RAM                           // sound regs fall through
462460   AM_RANGE(0x41a000, 0x41a001) AM_WRITE(sound_irq_w)
463   AM_RANGE(0x41c000, 0x41c01f) AM_WRITE(K053252_word_w)            // CCU
461   AM_RANGE(0x41c000, 0x41c01f) AM_DEVREADWRITE8("k053252",k053252_r,k053252_w,0x00ff)            // CCU
464462   AM_RANGE(0x41e000, 0x41e007) AM_WRITE(K056832_b_word_w)            // VSCCS
465463   AM_RANGE(0x480000, 0x483fff) AM_READWRITE(K053247_martchmp_word_r,K053247_martchmp_word_w) AM_BASE_MEMBER(mystwarr_state, m_spriteram)   // sprite RAM
466464   AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram16_xrgb_word_be_w) AM_BASE_GENERIC(paletteram)                  // palette RAM
r11556r11557
494492   AM_RANGE(0x480000, 0x48003f) AM_WRITE(K056832_word_w)      // VACSET
495493   AM_RANGE(0x482000, 0x482007) AM_WRITE(K056832_b_word_w)   // VSCCS
496494   AM_RANGE(0x484000, 0x484003) AM_WRITE(ddd_053936_clip_w)
497   AM_RANGE(0x486000, 0x48601f) AM_WRITE(K053252_word_w)
495   AM_RANGE(0x486000, 0x48601f) AM_DEVREADWRITE8("k053252",k053252_r,k053252_w,0x00ff)
498496   AM_RANGE(0x488000, 0x4880ff) AM_WRITE(K055555_word_w)
499497   AM_RANGE(0x48a00c, 0x48a00d) AM_WRITE(sound_cmd1_msb_w)
500498   AM_RANGE(0x48a00e, 0x48a00f) AM_WRITE(sound_cmd2_msb_w)
r11556r11557
517515   AM_RANGE(0x450010, 0x45001f) AM_READ(K053247_reg_word_r)
518516   AM_RANGE(0x480000, 0x48003f) AM_READ(K056832_word_r)
519517   AM_RANGE(0x482000, 0x482007) AM_READ(K056832_b_word_r)
520   AM_RANGE(0x486000, 0x48601f) AM_READ(K053252_word_r)
521518   AM_RANGE(0x488000, 0x4880ff) AM_READ(K055555_word_r)
522519   AM_RANGE(0x48c000, 0x48c01f) AM_READ(K054338_word_r)
523520#endif
r11556r11557
542539   AM_RANGE(0x480000, 0x48003f) AM_WRITE(K056832_word_w)         // VACSET
543540   AM_RANGE(0x482000, 0x482007) AM_WRITE(K056832_b_word_w)         // VSCCS
544541   AM_RANGE(0x484000, 0x484003) AM_WRITE(ddd_053936_clip_w)
545   AM_RANGE(0x486000, 0x48601f) AM_WRITE(K053252_word_w)
542   AM_RANGE(0x486000, 0x48601f) AM_DEVREADWRITE8("k053252",k053252_r,k053252_w,0x00ff)
546543   AM_RANGE(0x488000, 0x4880ff) AM_WRITE(K055555_word_w)
547544   AM_RANGE(0x48a00c, 0x48a00d) AM_WRITE(sound_cmd1_msb_w)
548545   AM_RANGE(0x48a00e, 0x48a00f) AM_WRITE(sound_cmd2_msb_w)
r11556r11557
565562   AM_RANGE(0x450010, 0x45001f) AM_READ(K053247_reg_word_r)
566563   AM_RANGE(0x480000, 0x48003f) AM_READ(K056832_word_r)
567564   AM_RANGE(0x482000, 0x482007) AM_READ(K056832_b_word_r)
568   AM_RANGE(0x486000, 0x48601f) AM_READ(K053252_word_r)
569565   AM_RANGE(0x488000, 0x4880ff) AM_READ(K055555_word_r)
570566   AM_RANGE(0x48c000, 0x48c01f) AM_READ(K054338_word_r)
571567#endif
r11556r11557
943939   for (i=5; i<=7; i++) k054539_set_gain(k054539_1, i, 2.0);
944940}
945941
942static const k053252_interface mystwarr_k053252_intf =
943{
944   "screen",
945   DEVCB_NULL,
946   DEVCB_NULL,
947   DEVCB_NULL,
948   DEVCB_NULL,
949   24, 16
950};
951
952static const k053252_interface viostorm_k053252_intf =
953{
954   "screen",
955   DEVCB_NULL,
956   DEVCB_NULL,
957   DEVCB_NULL,
958   DEVCB_NULL,
959   40, 16
960};
961
962static const k053252_interface metamrph_k053252_intf =
963{
964   "screen",
965   DEVCB_NULL,
966   DEVCB_NULL,
967   DEVCB_NULL,
968   DEVCB_NULL,
969   24, 24
970};
971
972static const k053252_interface martchmp_k053252_intf =
973{
974   "screen",
975   DEVCB_NULL,
976   DEVCB_NULL,
977   DEVCB_NULL,
978   DEVCB_NULL,
979   32, 24-1
980};
981
982static const k053252_interface dadandrm_k053252_intf =
983{
984   "screen",
985   DEVCB_NULL,
986   DEVCB_NULL,
987   DEVCB_NULL,
988   DEVCB_NULL,
989   24, 16+1
990};
991
992static const k053252_interface gaiapols_k053252_intf =
993{
994   "screen",
995   DEVCB_NULL,
996   DEVCB_NULL,
997   DEVCB_NULL,
998   DEVCB_NULL,
999   40, 16
1000};
1001
9461002static MACHINE_CONFIG_START( mystwarr, mystwarr_state )
9471003
9481004   /* basic machine hardware */
r11556r11557
9571013   MCFG_QUANTUM_TIME(attotime::from_hz(1920))
9581014
9591015   MCFG_EEPROM_ADD("eeprom", eeprom_intf)
1016   MCFG_K053252_ADD("k053252", 6000000, mystwarr_k053252_intf) // 6 MHz?
9601017
9611018   MCFG_MACHINE_START(mystwarr)
9621019   MCFG_MACHINE_RESET(mystwarr)
r11556r11557
9951052
9961053   MCFG_MACHINE_RESET(viostorm)
9971054
1055   MCFG_DEVICE_REMOVE("k053252")
1056   MCFG_K053252_ADD("k053252", 16000000/2, viostorm_k053252_intf)
1057
9981058   /* basic machine hardware */
9991059   MCFG_CPU_MODIFY("maincpu")
10001060   MCFG_CPU_PROGRAM_MAP(viostorm_map)
r11556r11557
10201080   MCFG_CPU_PROGRAM_MAP(metamrph_map)
10211081   MCFG_CPU_VBLANK_INT_HACK(metamrph_interrupt, 40)
10221082
1083   MCFG_DEVICE_REMOVE("k053252")
1084   MCFG_K053252_ADD("k053252", 6000000, metamrph_k053252_intf) // 6 MHz?
1085
10231086   /* video hardware */
10241087   MCFG_VIDEO_START(metamrph)
10251088   MCFG_SCREEN_MODIFY("screen")
r11556r11557
10401103   MCFG_CPU_PROGRAM_MAP(dadandrn_map)
10411104   MCFG_CPU_VBLANK_INT("screen", ddd_interrupt)
10421105
1106   MCFG_DEVICE_REMOVE("k053252")
1107   MCFG_K053252_ADD("k053252", 6000000, dadandrm_k053252_intf) // 6 MHz?
1108
10431109   MCFG_GFXDECODE(dadandrn)
10441110
10451111   /* video hardware */
r11556r11557
10621128   MCFG_CPU_PROGRAM_MAP(gaiapols_map)
10631129   MCFG_CPU_VBLANK_INT("screen", ddd_interrupt)
10641130
1131   MCFG_DEVICE_REMOVE("k053252")
1132   MCFG_K053252_ADD("k053252", 6000000, gaiapols_k053252_intf) // 6 MHz?
1133
10651134   MCFG_GFXDECODE(gaiapols)
10661135
10671136   MCFG_DEVICE_REMOVE("eeprom")
r11556r11557
10881157   MCFG_CPU_PROGRAM_MAP(martchmp_map)
10891158   MCFG_CPU_VBLANK_INT_HACK(mchamp_interrupt, 2)
10901159
1160   MCFG_DEVICE_REMOVE("k053252")
1161   MCFG_K053252_ADD("k053252", 16000000/2, martchmp_k053252_intf)
1162
10911163   MCFG_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS | VIDEO_HAS_HIGHLIGHTS | VIDEO_UPDATE_BEFORE_VBLANK)
10921164
10931165   MCFG_VIDEO_START(martchmp)
src/mame/drivers/konamigx.c
r11556r11557
14711471   PORT_INCLUDE( konamigx )
14721472
14731473   PORT_START("ADC-WRPORT")
1474   PORT_BIT( 0x1000000, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("adc0834", adc083x_clk_write)
1475   PORT_BIT( 0x2000000, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("adc0834", adc083x_di_write)
1476   PORT_BIT( 0x4000000, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("adc0834", adc083x_cs_write)
1474   PORT_BIT( 0x1000000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("adc0834", adc083x_clk_write)
1475   PORT_BIT( 0x2000000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("adc0834", adc083x_di_write)
1476   PORT_BIT( 0x4000000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("adc0834", adc083x_cs_write)
14771477
14781478   PORT_START("ADC-RDPORT")
14791479   PORT_BIT( 0x1000000, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("adc0834", adc083x_do_read)
14801480
14811481   PORT_START("AN0")   /* mask default type                     sens delta min max */
1482   PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x38,0xc8) PORT_SENSITIVITY(35) PORT_KEYDELTA(5) PORT_REVERSE
1482   PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x38,0xc8) PORT_SENSITIVITY(35) PORT_KEYDELTA(35) PORT_REVERSE
14831483
14841484   PORT_START("AN1")
1485   PORT_BIT( 0xff, 0xf0, IPT_PEDAL ) PORT_MINMAX(0x90,0xff) PORT_SENSITIVITY(35) PORT_KEYDELTA(5) PORT_CODE_INC(KEYCODE_LCONTROL) PORT_REVERSE
1485   PORT_BIT( 0xff, 0xf0, IPT_PEDAL ) PORT_MINMAX(0x90,0xff) PORT_SENSITIVITY(35) PORT_KEYDELTA(35) PORT_CODE_INC(KEYCODE_LCONTROL) PORT_REVERSE
14861486INPUT_PORTS_END
14871487
14881488static INPUT_PORTS_START( le2 )
src/mame/drivers/vendetta.c
r11556r11557
8989#include "emu.h"
9090#include "cpu/z80/z80.h"
9191#include "video/konicdev.h"
92#include "machine/k053252.h"
9293#include "cpu/konami/konami.h" /* for the callback and the firq irq definition */
9394#include "machine/eeprom.h"
9495#include "sound/2151intf.h"
r11556r11557
452453   vendetta_sprite_callback
453454};
454455
456static const k053252_interface esckids_k053252_intf =
457{
458   "screen",
459   DEVCB_NULL,
460   DEVCB_NULL,
461   DEVCB_NULL,
462   DEVCB_NULL,
463   12*8, 1*8
464};
465
455466static MACHINE_START( vendetta )
456467{
457468   vendetta_state *state = machine.driver_data<vendetta_state>();
r11556r11557
560571   MCFG_K052109_ADD("k052109", esckids_k052109_intf)
561572   MCFG_DEVICE_REMOVE("k053246")
562573   MCFG_K053246_ADD("k053246", esckids_k053246_intf)
563   MCFG_K053252_ADD("k053252")
574   MCFG_K053252_ADD("k053252", 6000000, esckids_k053252_intf)
564575MACHINE_CONFIG_END
565576
566577
src/mame/drivers/rollerg.c
r11556r11557
1313#include "emu.h"
1414#include "cpu/z80/z80.h"
1515#include "video/konicdev.h"
16#include "machine/k053252.h"
1617#include "cpu/konami/konami.h" /* for the callback and the firq irq definition */
1718#include "sound/3812intf.h"
1819#include "sound/k053260.h"
r11556r11557
234235   rollerg_zoom_callback
235236};
236237
238static WRITE_LINE_DEVICE_HANDLER( rollerg_irq_ack_w )
239{
240   cputag_set_input_line(device->machine(), "maincpu", 0, CLEAR_LINE);
241}
242
243static const k053252_interface rollerg_k053252_intf =
244{
245   "screen",
246   DEVCB_NULL,
247   DEVCB_NULL,
248   DEVCB_LINE(rollerg_irq_ack_w),
249   DEVCB_NULL,
250   14*8, 2*8
251};
252
237253static MACHINE_START( rollerg )
238254{
239255   rollerg_state *state = machine.driver_data<rollerg_state>();
r11556r11557
266282   /* basic machine hardware */
267283   MCFG_CPU_ADD("maincpu", KONAMI, 3000000)      /* ? */
268284   MCFG_CPU_PROGRAM_MAP(rollerg_map)
269   MCFG_CPU_VBLANK_INT("screen", irq0_line_hold)
285   MCFG_CPU_VBLANK_INT("screen", irq0_line_assert)
270286
271287   MCFG_CPU_ADD("audiocpu", Z80, 3579545)
272288   MCFG_CPU_PROGRAM_MAP(rollerg_sound_map)
r11556r11557
291307
292308   MCFG_K053244_ADD("k053244", rollerg_k05324x_intf)
293309   MCFG_K051316_ADD("k051316", rollerg_k051316_intf)
294   MCFG_K053252_ADD("k053252")
310   MCFG_K053252_ADD("k053252", 3000000*2, rollerg_k053252_intf)
295311
296312   /* sound hardware */
297313   MCFG_SPEAKER_STANDARD_MONO("mono")
src/emu/debug/debugcmd.c
r11556r11557
16831683            if (debug_cpu_translate(space, TRANSLATE_READ_DEBUG, &curaddr))
16841684            {
16851685               UINT8 byte = debug_read_byte(space, i + j, TRUE);
1686               outdex += sprintf(&output[outdex], "%c", (byte >= 32 && byte < 128) ? byte : '.');
1686               outdex += sprintf(&output[outdex], "%c", (byte >= 32 && byte < 127) ? byte : '.');
16871687            }
16881688            else
16891689               outdex += sprintf(&output[outdex], " ");
src/emu/cpu/cpu.mak
r11556r11557
885885
886886ifneq ($(filter PSX,$(CPUS)),)
887887OBJDIRS += $(CPUOBJ)/psx
888CPUOBJS += $(CPUOBJ)/psx/psx.o $(CPUOBJ)/psx/gte.o $(CPUOBJ)/psx/dma.o $(CPUOBJ)/psx/mdec.o
888CPUOBJS += $(CPUOBJ)/psx/psx.o $(CPUOBJ)/psx/gte.o $(CPUOBJ)/psx/dma.o $(CPUOBJ)/psx/irq.o $(CPUOBJ)/psx/mdec.o $(CPUOBJ)/psx/rcnt.o $(CPUOBJ)/psx/sio.o
889889DASMOBJS += $(CPUOBJ)/psx/psxdasm.o
890890endif
891891
r11556r11557
895895         $(CPUSRC)/psx/gte.h \
896896         $(CPUSRC)/psx/mdec.h \
897897
898$(CPUOBJ)/psx/dma.o:   $(CPUSRC)/psx/dma.c \
899         $(CPUSRC)/psx/dma.h
900
898901$(CPUOBJ)/psx/gte.o:   $(CPUSRC)/psx/gte.c \
899902         $(CPUSRC)/psx/gte.h
900903
901$(CPUOBJ)/psx/dma.o:   $(CPUSRC)/psx/dma.c \
902         $(CPUSRC)/psx/dma.h
903
904904$(CPUOBJ)/psx/mdec.o:   $(CPUSRC)/psx/mdec.c \
905905         $(CPUSRC)/psx/mdec.h
906906
907$(CPUOBJ)/psx/sio.o:   $(CPUSRC)/psx/sio.c \
908         $(CPUSRC)/psx/sio.h
907909
908910
909911#-------------------------------------------------
src/emu/cpu/i386/i386dasm.c
r11556r11557
15651565         }
15661566
15671567         if( address_size ) {
1568            d32 = FETCHD32();
1569            s += sprintf( s, "[%s]", hexstring(d32, 0) );
1568            i32 = FETCHD32();
1569            s += sprintf( s, "[%s]", hexstring(i32, 0) );
15701570         } else {
1571            d32 = FETCHD16();
1572            s += sprintf( s, "[%s]", hexstring(d32, 0) );
1571            i16 = FETCHD16();
1572            s += sprintf( s, "[%s]", hexstring(i16, 0) );
15731573         }
15741574         break;
15751575
src/emu/cpu/psx/sio.h
r0r11557
1/*
2 * PlayStation Serial I/O emulator
3 *
4 * Copyright 2003-2011 smf
5 *
6 */
7
8#pragma once
9
10#ifndef __PSXSIO_H__
11#define __PSXSIO_H__
12
13#include "emu.h"
14
15extern const device_type PSX_SIO;
16
17typedef void ( *psx_sio_handler )( running_machine &, int );
18
19#define PSX_SIO_OUT_DATA ( 1 )   /* COMMAND */
20#define PSX_SIO_OUT_DTR ( 2 )   /* ATT */
21#define PSX_SIO_OUT_RTS ( 4 )
22#define PSX_SIO_OUT_CLOCK ( 8 )   /* CLOCK */
23#define PSX_SIO_IN_DATA ( 1 )   /* DATA */
24#define PSX_SIO_IN_DSR ( 2 )   /* ACK */
25#define PSX_SIO_IN_CTS ( 4 )
26
27#define SIO_BUF_SIZE ( 8 )
28
29#define SIO_STATUS_TX_RDY ( 1 << 0 )
30#define SIO_STATUS_RX_RDY ( 1 << 1 )
31#define SIO_STATUS_TX_EMPTY ( 1 << 2 )
32#define SIO_STATUS_OVERRUN ( 1 << 4 )
33#define SIO_STATUS_DSR ( 1 << 7 )
34#define SIO_STATUS_IRQ ( 1 << 9 )
35
36#define SIO_CONTROL_TX_ENA ( 1 << 0 )
37#define SIO_CONTROL_IACK ( 1 << 4 )
38#define SIO_CONTROL_RESET ( 1 << 6 )
39#define SIO_CONTROL_TX_IENA ( 1 << 10 )
40#define SIO_CONTROL_RX_IENA ( 1 << 11 )
41#define SIO_CONTROL_DSR_IENA ( 1 << 12 )
42#define SIO_CONTROL_DTR ( 1 << 13 )
43
44typedef struct _psx_sio psx_sio;
45struct _psx_sio
46{
47   UINT32 n_status;
48   UINT32 n_mode;
49   UINT32 n_control;
50   UINT32 n_baud;
51   UINT32 n_tx;
52   UINT32 n_rx;
53   UINT32 n_tx_prev;
54   UINT32 n_rx_prev;
55   UINT32 n_tx_data;
56   UINT32 n_rx_data;
57   UINT32 n_tx_shift;
58   UINT32 n_rx_shift;
59   UINT32 n_tx_bits;
60   UINT32 n_rx_bits;
61
62   emu_timer *timer;
63   psx_sio_handler fn_handler;
64};
65
66class psxsio_device : public device_t
67{
68public:
69   psxsio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
70
71   void install_handler( int n_port, psx_sio_handler p_f_sio_handler );
72
73   WRITE32_MEMBER( write );
74   READ32_MEMBER( read );
75
76   void input( int n_port, int n_mask, int n_data );
77
78protected:
79   virtual void device_start();
80   virtual void device_reset();
81   virtual void device_post_load();
82
83private:
84   void sio_interrupt( int n_port );
85   void sio_timer_adjust( int n_port );
86   void sio_clock(void *ptr, int param);
87
88   psx_sio port[2];
89};
90
91WRITE32_HANDLER( psx_sio_w );
92READ32_HANDLER( psx_sio_r );
93
94#endif
src/emu/cpu/psx/irq.h
r0r11557
1/*
2 * PlayStation IRQ emulator
3 *
4 * Copyright 2003-2011 smf
5 *
6 */
7
8#pragma once
9
10#ifndef __PSXIRQ_H__
11#define __PSXIRQ_H__
12
13#include "emu.h"
14
15#define PSX_IRQ_VBLANK         0x0001
16#define PSX_IRQ_CDROM         0x0004
17#define PSX_IRQ_DMA            0x0008
18#define PSX_IRQ_ROOTCOUNTER0   0x0010
19#define PSX_IRQ_ROOTCOUNTER1   0x0020
20#define PSX_IRQ_ROOTCOUNTER2   0x0040
21#define PSX_IRQ_SIO0         0x0080
22#define PSX_IRQ_SIO1         0x0100
23#define PSX_IRQ_SPU            0x0200
24#define PSX_IRQ_EXTCD         0x0400
25#define PSX_IRQ_MASK         (PSX_IRQ_VBLANK | PSX_IRQ_CDROM | PSX_IRQ_DMA | PSX_IRQ_ROOTCOUNTER2 | PSX_IRQ_ROOTCOUNTER1 | PSX_IRQ_ROOTCOUNTER0 | PSX_IRQ_SIO0 | PSX_IRQ_SIO1 | PSX_IRQ_SPU | PSX_IRQ_EXTCD)
26
27extern const device_type PSX_IRQ;
28
29class psxirq_device : public device_t
30{
31public:
32   psxirq_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
33
34   READ32_MEMBER( read );
35   WRITE32_MEMBER( write );
36
37   void set( UINT32 bitmask );
38
39protected:
40   virtual void device_start();
41   virtual void device_reset();
42   virtual void device_post_load();
43
44private:
45   void psx_irq_update( void );
46
47   UINT32 n_irqdata;
48   UINT32 n_irqmask;
49};
50
51#endif
src/emu/cpu/psx/dma.c
r11556r11557
6767   {
6868      psx_dma_channel *dma = &channel[ index ];
6969
70      dma->timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(psxdma_device::dma_finished_callback), this));
70      dma->timer = machine().scheduler().timer_alloc( timer_expired_delegate( FUNC( psxdma_device::dma_finished_callback ), this) );
7171
72      machine().save().save_item( "psxdma", tag(), index, NAME(dma->n_base) );
73      machine().save().save_item( "psxdma", tag(), index, NAME(dma->n_blockcontrol) );
74      machine().save().save_item( "psxdma", tag(), index, NAME(dma->n_channelcontrol) );
75      machine().save().save_item( "psxdma", tag(), index, NAME(dma->n_ticks) );
76      machine().save().save_item( "psxdma", tag(), index, NAME(dma->b_running) );
72      machine().save().save_item( "psxdma", tag(), index, NAME( dma->n_base ) );
73      machine().save().save_item( "psxdma", tag(), index, NAME( dma->n_blockcontrol ) );
74      machine().save().save_item( "psxdma", tag(), index, NAME( dma->n_channelcontrol ) );
75      machine().save().save_item( "psxdma", tag(), index, NAME( dma->n_ticks ) );
76      machine().save().save_item( "psxdma", tag(), index, NAME( dma->b_running ) );
7777   }
7878
7979   save_item( NAME(n_dpcp) );
src/emu/cpu/psx/rcnt.c
r0r11557
1/*
2 * PlayStation Root Counter emulator
3 *
4 * Copyright 2003-2011 smf
5 *
6 */
7
8#include "rcnt.h"
9#include "includes/psx.h"
10
11#define VERBOSE_LEVEL ( 0 )
12
13INLINE void ATTR_PRINTF(3,4) verboselog( running_machine& machine, int n_level, const char *s_fmt, ... )
14{
15   if( VERBOSE_LEVEL >= n_level )
16   {
17      va_list v;
18      char buf[ 32768 ];
19      va_start( v, s_fmt );
20      vsprintf( buf, s_fmt, v );
21      va_end( v );
22      logerror( "%s: %s", machine.describe_context(), buf );
23   }
24}
25
26const device_type PSX_RCNT = &device_creator<psxrcnt_device>;
27
28psxrcnt_device::psxrcnt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
29   : device_t(mconfig, PSX_RCNT, "PSX RCNT", tag, owner, clock)
30{
31}
32
33void psxrcnt_device::device_reset()
34{
35}
36
37void psxrcnt_device::device_post_load()
38{
39   int n;
40   for( n = 0; n < 3; n++ )
41   {
42      root_timer_adjust( n );
43   }
44}
45
46void psxrcnt_device::device_start()
47{
48   int n;
49
50   for( n = 0; n < 3; n++ )
51   {
52      root_counter[ n ].timer = machine().scheduler().timer_alloc( timer_expired_delegate( FUNC( psxrcnt_device::root_finished ), this ) );
53      state_save_register_item( machine(), "psxroot", NULL, n, root_counter[ n ].n_count );
54      state_save_register_item( machine(), "psxroot", NULL, n, root_counter[ n ].n_mode );
55      state_save_register_item( machine(), "psxroot", NULL, n, root_counter[ n ].n_target );
56      state_save_register_item( machine(), "psxroot", NULL, n, root_counter[ n ].n_start );
57   }
58}
59
60WRITE32_MEMBER( psxrcnt_device::write )
61{
62   int n_counter = offset / 4;
63   psx_root *root = &root_counter[ n_counter ];
64
65   verboselog( machine(), 1, "psx_counter_w ( %08x, %08x, %08x )\n", offset, data, mem_mask );
66
67   switch( offset % 4 )
68   {
69   case 0:
70      root->n_count = data;
71      root->n_start = gettotalcycles();
72      break;
73   case 1:
74      root->n_count = root_current( n_counter );
75      root->n_start = gettotalcycles();
76
77      if( ( data & PSX_RC_RESET ) != 0 )
78      {
79         data &= ~( PSX_RC_RESET | PSX_RC_STOP );
80         root->n_count = 0;
81      }
82
83      root->n_mode = data;
84
85#if 0
86      if( ( data & 0xfca6 ) != 0 ||
87         ( ( data & 0x0100 ) != 0 && n_counter != 0 && n_counter != 1 ) ||
88         ( ( data & 0x0200 ) != 0 && n_counter != 2 ) )
89      {
90         mame_printf_debug( "mode %d 0x%04x\n", n_counter, data & 0xfca6 );
91      }
92#endif
93      break;
94   case 2:
95      root->n_target = data;
96      break;
97   default:
98      verboselog( machine(), 0, "psx_counter_w( %08x, %08x, %08x ) unknown register\n", offset, mem_mask, data );
99      return;
100   }
101
102   root_timer_adjust( n_counter );
103}
104
105READ32_MEMBER( psxrcnt_device::read )
106{
107   int n_counter = offset / 4;
108   psx_root *root = &root_counter[ n_counter ];
109   UINT32 data;
110
111   switch( offset % 4 )
112   {
113   case 0:
114      data = root_current( n_counter );
115      break;
116   case 1:
117      data = root->n_mode;
118      break;
119   case 2:
120      data = root->n_target;
121      break;
122   default:
123      verboselog( machine(), 0, "psx_counter_r( %08x, %08x ) unknown register\n", offset, mem_mask );
124      return 0;
125   }
126   verboselog( machine(), 1, "psx_counter_r ( %08x, %08x ) %08x\n", offset, mem_mask, data );
127   return data;
128}
129
130UINT64 psxrcnt_device::gettotalcycles( void )
131{
132   /* TODO: should return the start of the current tick. */
133   return machine().firstcpu->total_cycles() * 2;
134}
135
136int psxrcnt_device::root_divider( int n_counter )
137{
138   psx_root *root = &root_counter[ n_counter ];
139
140   if( n_counter == 0 && ( root->n_mode & PSX_RC_CLC ) != 0 )
141   {
142      /* TODO: pixel clock, probably based on resolution */
143      return 5;
144   }
145   else if( n_counter == 1 && ( root->n_mode & PSX_RC_CLC ) != 0 )
146   {
147      return 2150;
148   }
149   else if( n_counter == 2 && ( root->n_mode & PSX_RC_DIV ) != 0 )
150   {
151      return 8;
152   }
153   return 1;
154}
155
156UINT16 psxrcnt_device::root_current( int n_counter )
157{
158   psx_root *root = &root_counter[ n_counter ];
159
160   if( ( root->n_mode & PSX_RC_STOP ) != 0 )
161   {
162      return root->n_count;
163   }
164   else
165   {
166      UINT64 n_current;
167      n_current = gettotalcycles() - root->n_start;
168      n_current /= root_divider( n_counter );
169      n_current += root->n_count;
170      if( n_current > 0xffff )
171      {
172         /* TODO: use timer for wrap on 0x10000. */
173         root->n_count = n_current;
174         root->n_start = gettotalcycles();
175      }
176      return n_current;
177   }
178}
179
180int psxrcnt_device::root_target( int n_counter )
181{
182   psx_root *root = &root_counter[ n_counter ];
183
184   if( ( root->n_mode & PSX_RC_COUNTTARGET ) != 0 ||
185      ( root->n_mode & PSX_RC_IRQTARGET ) != 0 )
186   {
187      return root->n_target;
188   }
189   return 0x10000;
190}
191
192void psxrcnt_device::root_timer_adjust( int n_counter )
193{
194   psx_root *root = &root_counter[ n_counter ];
195
196   if( ( root->n_mode & PSX_RC_STOP ) != 0 )
197   {
198      root->timer->adjust( attotime::never, n_counter);
199   }
200   else
201   {
202      int n_duration;
203
204      n_duration = root_target( n_counter ) - root_current( n_counter );
205      if( n_duration < 1 )
206      {
207         n_duration += 0x10000;
208      }
209
210      n_duration *= root_divider( n_counter );
211
212      root->timer->adjust( attotime::from_hz(33868800) * n_duration, n_counter);
213   }
214}
215
216void psxrcnt_device::root_finished( void *ptr, int param )
217{
218   int n_counter = param;
219   psx_root *root = &root_counter[ n_counter ];
220
221   verboselog( machine(), 2, "root_finished( %d ) %04x\n", n_counter, root_current( n_counter ) );
222   //if( ( root->n_mode & PSX_RC_COUNTTARGET ) != 0 )
223   {
224      /* TODO: wrap should be handled differently as PSX_RC_COUNTTARGET & PSX_RC_IRQTARGET don't have to be the same. */
225      root->n_count = 0;
226      root->n_start = gettotalcycles();
227   }
228   if( ( root->n_mode & PSX_RC_REPEAT ) != 0 )
229   {
230      root_timer_adjust( n_counter );
231   }
232   if( ( root->n_mode & PSX_RC_IRQOVERFLOW ) != 0 ||
233      ( root->n_mode & PSX_RC_IRQTARGET ) != 0 )
234   {
235      psx_irq_set( machine(), PSX_IRQ_ROOTCOUNTER0 << n_counter );
236   }
237}
src/emu/cpu/psx/mdec.c
r11556r11557
33 *
44 * Copyright 2003-2011 smf
55 *
6 * Thanks to Oliver Galibert for help figuring out IDCT
7 *
68 */
79 
810#include "emu.h"
r11556r11557
6971      p_n_b5[ n + 512 ] = ( 255 >> 3 ) << 10;
7072   }
7173 
72   state_save_register_global( machine(), n_0_command );
73   state_save_register_global( machine(), n_0_address );
74   state_save_register_global( machine(), n_0_size );
75   state_save_register_global( machine(), n_1_command );
76   state_save_register_global( machine(), n_1_status );
77   state_save_register_global_array( machine(), p_n_quantize_y );
78   state_save_register_global_array( machine(), p_n_quantize_uv );
79   state_save_register_global_array( machine(), p_n_cos );
74   save_item( NAME( n_0_command ) );
75   save_item( NAME( n_0_address ) );
76   save_item( NAME( n_0_size ) );
77   save_item( NAME( n_1_command ) );
78   save_item( NAME( n_1_status ) );
79   save_item( NAME( p_n_quantize_y ) );
80   save_item( NAME( p_n_quantize_uv ) );
81   save_item( NAME( p_n_cos ) );
8082}
8183 
8284#ifdef UNUSED_FUNCTION
src/emu/cpu/psx/psx.c
r11556r11557
6666#include "debugger.h"
6767#include "psx.h"
6868#include "dma.h"
69#include "irq.h"
6970#include "mdec.h"
71#include "rcnt.h"
72#include "sio.h"
7073#include "includes/psx.h"
7174#include "sound/spu.h"
7275
r11556r11557
15261529   AM_RANGE(0x1f800000, 0x1f8003ff) AM_NOP /* scratchpad */
15271530   AM_RANGE(0x1f800400, 0x1f800fff) AM_READWRITE( berr_r, berr_w )
15281531   AM_RANGE(0x1f801004, 0x1f80101f) AM_RAM
1532   /* 1f801014 spu delay */
1533   /* 1f801018 dv delay */
15291534   AM_RANGE(0x1f801020, 0x1f801023) AM_READWRITE_LEGACY( psx_com_delay_r, psx_com_delay_w )
15301535   AM_RANGE(0x1f801024, 0x1f80102f) AM_RAM
1531   AM_RANGE(0x1f801040, 0x1f80105f) AM_READWRITE_LEGACY( psx_sio_r, psx_sio_w )
1536   AM_RANGE(0x1f801040, 0x1f80105f) AM_DEVREADWRITE( "sio", psxsio_device, read, write )
1537   /* 1f801060 ram config */
15321538   AM_RANGE(0x1f801060, 0x1f80106f) AM_RAM
1533   AM_RANGE(0x1f801070, 0x1f801077) AM_READWRITE_LEGACY( psx_irq_r, psx_irq_w )
1539   AM_RANGE(0x1f801070, 0x1f801077) AM_DEVREADWRITE( "irq", psxirq_device, read, write )
15341540   AM_RANGE(0x1f801080, 0x1f8010ff) AM_DEVREADWRITE( "dma", psxdma_device, read, write )
1535   AM_RANGE(0x1f801100, 0x1f80112f) AM_READWRITE_LEGACY( psx_counter_r, psx_counter_w )
1541   AM_RANGE(0x1f801100, 0x1f80112f) AM_DEVREADWRITE( "rcnt", psxrcnt_device, read, write )
1542   /* 1f801800-1f801803 cd */
15361543   AM_RANGE(0x1f801810, 0x1f801817) AM_READWRITE_LEGACY( psx_gpu_r, psx_gpu_w )
15371544   AM_RANGE(0x1f801820, 0x1f801827) AM_DEVREADWRITE( "mdec", psxmdec_device, read, write )
15381545   AM_RANGE(0x1f801c00, 0x1f801dff) AM_READWRITE16_LEGACY( spu_r, spu_w, 0xffffffff )
15391546   AM_RANGE(0x1f802020, 0x1f802033) AM_RAM /* ?? */
1547   /* 1f802030 int 2000 */
1548   /* 1f802040 dip switches */
15401549   AM_RANGE(0x1f802040, 0x1f802043) AM_WRITENOP
15411550   AM_RANGE(0x20000000, 0x7fffffff) AM_READWRITE( berr_r, berr_w )
15421551   AM_RANGE(0x80800000, 0x9effffff) AM_READWRITE( berr_r, berr_w )
r11556r11557
15521561   AM_RANGE(0x1f801004, 0x1f80101f) AM_RAM
15531562   AM_RANGE(0x1f801020, 0x1f801023) AM_READWRITE_LEGACY( psx_com_delay_r, psx_com_delay_w )
15541563   AM_RANGE(0x1f801024, 0x1f80102f) AM_RAM
1555   AM_RANGE(0x1f801040, 0x1f80105f) AM_READWRITE_LEGACY( psx_sio_r, psx_sio_w )
1564   AM_RANGE(0x1f801040, 0x1f80105f) AM_DEVREADWRITE( "sio", psxsio_device, read, write )
15561565   AM_RANGE(0x1f801060, 0x1f80106f) AM_RAM
1557   AM_RANGE(0x1f801070, 0x1f801077) AM_READWRITE_LEGACY( psx_irq_r, psx_irq_w )
1566   AM_RANGE(0x1f801070, 0x1f801077) AM_DEVREADWRITE( "irq", psxirq_device, read, write )
15581567   AM_RANGE(0x1f801080, 0x1f8010ff) AM_DEVREADWRITE( "dma", psxdma_device, read, write )
1559   AM_RANGE(0x1f801100, 0x1f80112f) AM_READWRITE_LEGACY( psx_counter_r, psx_counter_w )
1568   AM_RANGE(0x1f801100, 0x1f80112f) AM_DEVREADWRITE( "rcnt", psxrcnt_device, read, write )
15601569   AM_RANGE(0x1f801810, 0x1f801817) AM_READWRITE_LEGACY( psx_gpu_r, psx_gpu_w )
15611570   AM_RANGE(0x1f801820, 0x1f801827) AM_DEVREADWRITE( "mdec", psxmdec_device, read, write )
15621571   AM_RANGE(0x1f801c00, 0x1f801dff) AM_READWRITE16_LEGACY( spu_r, spu_w, 0xffffffff )
r11556r11557
31573166   return downcast<psxcpu_device *>( device.siblingdevice( cputag ) );
31583167}
31593168
3169void psxcpu_device::irq_set( device_t &device, const char *cputag, UINT32 bitmask )
3170{
3171   psxirq_device *irq = downcast<psxirq_device *>( getcpu( device, cputag )->subdevice("irq") );
3172   irq->set( bitmask );
3173}
3174
31603175void psxcpu_device::install_dma_read_handler( device_t &device, const char *cputag, int channel, psx_dma_read_delegate handler )
31613176{
31623177   psxdma_device *dma = downcast<psxdma_device *>( getcpu( device, cputag )->subdevice("dma") );
r11556r11557
31693184   dma->install_write_handler( channel, handler );
31703185}
31713186
3187void psxcpu_device::install_sio_handler( device_t &device, const char *cputag, int n_port, psx_sio_handler p_f_sio_handler )
3188{
3189   psxsio_device *sio = downcast<psxsio_device *>( getcpu( device, cputag )->subdevice("sio") );
3190   sio->install_handler( n_port, p_f_sio_handler );
3191}
3192
3193void psxcpu_device::sio_input( device_t &device, const char *cputag, int n_port, int n_mask, int n_data )
3194{
3195   psxsio_device *sio = downcast<psxsio_device *>( getcpu( device, cputag )->subdevice("sio") );
3196   sio->input( n_port, n_mask, n_data );
3197}
3198
31723199static MACHINE_CONFIG_FRAGMENT( psx )
3200   MCFG_DEVICE_ADD("irq", PSX_IRQ, 0)
31733201   MCFG_DEVICE_ADD("dma", PSX_DMA, 0)
31743202
31753203   MCFG_DEVICE_ADD("mdec", PSX_MDEC, 0)
31763204   MCFG_PSX_DMA_CHANNEL_WRITE( DEVICE_SELF, 0, psx_dma_write_delegate( FUNC( psxmdec_device::dma_write ), (psxmdec_device *) device ) )
31773205   MCFG_PSX_DMA_CHANNEL_READ( DEVICE_SELF, 1, psx_dma_read_delegate( FUNC( psxmdec_device::dma_read ), (psxmdec_device *) device ) )
3206
3207   MCFG_DEVICE_ADD("rcnt", PSX_RCNT, 0)
3208   MCFG_DEVICE_ADD("sio", PSX_SIO, 0)
31783209MACHINE_CONFIG_END
31793210
31803211//-------------------------------------------------
src/emu/cpu/psx/rcnt.h
r0r11557
1/*
2 * PlayStation Root Counter emulator
3 *
4 * Copyright 2003-2011 smf
5 *
6 */
7
8#pragma once
9
10#ifndef __PSXRCNT_H__
11#define __PSXRCNT_H__
12
13#include "emu.h"
14
15extern const device_type PSX_RCNT;
16
17#define PSX_RC_STOP ( 0x01 )
18#define PSX_RC_RESET ( 0x04 ) /* guess */
19#define PSX_RC_COUNTTARGET ( 0x08 )
20#define PSX_RC_IRQTARGET ( 0x10 )
21#define PSX_RC_IRQOVERFLOW ( 0x20 )
22#define PSX_RC_REPEAT ( 0x40 )
23#define PSX_RC_CLC ( 0x100 )
24#define PSX_RC_DIV ( 0x200 )
25
26typedef struct _psx_root psx_root;
27struct _psx_root
28{
29   emu_timer *timer;
30   UINT16 n_count;
31   UINT16 n_mode;
32   UINT16 n_target;
33   UINT64 n_start;
34};
35
36class psxrcnt_device : public device_t
37{
38public:
39   psxrcnt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
40
41   WRITE32_MEMBER( write );
42   READ32_MEMBER( read );
43
44protected:
45   virtual void device_start();
46   virtual void device_reset();
47   virtual void device_post_load();
48
49private:
50   psx_root root_counter[ 3 ];
51
52   UINT64 gettotalcycles( void );
53   int root_divider( int n_counter );
54   UINT16 root_current( int n_counter );
55   int root_target( int n_counter );
56   void root_timer_adjust( int n_counter );
57   void root_finished( void *ptr, int param );
58};
59
60#endif
src/emu/cpu/psx/psx.h
r11556r11557
1010#ifndef __PSXCPU_H__
1111#define __PSXCPU_H__
1212
13#include "includes/psx.h"
1413#include "gte.h"
1514#include "dma.h"
15#include "sio.h"
16#include "includes/psx.h"
1617
1718//**************************************************************************
1819//  CONSTANTS
r11556r11557
131132
132133   static void install_dma_read_handler( device_t &device, const char *cputag, int channel, psx_dma_read_delegate handler );
133134   static void install_dma_write_handler( device_t &device, const char *cputag, int channel, psx_dma_write_delegate handler );
135   static void install_sio_handler( device_t &device, const char *cputag, int n_port, psx_sio_handler p_f_sio_handler );
136   static void sio_input( device_t &device, const char *cputag, int n_port, int n_mask, int n_data );
137   static void irq_set( device_t &device, const char *cputag, UINT32 bitmask );
134138
135139protected:
136140   psxcpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, address_map_constructor internal_map);
r11556r11557
162166   virtual UINT32 disasm_max_opcode_bytes() const { return 4; }
163167   virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
164168
165
166
167169   // CPU registers
168170   UINT32 m_pc;
169171   UINT32 m_r[ 32 ];
src/emu/cpu/psx/sio.c
r0r11557
1/*
2 * PlayStation Serial I/O emulator
3 *
4 * Copyright 2003-2011 smf
5 *
6 */
7
8#include "sio.h"
9#include "includes/psx.h"
10
11#define VERBOSE_LEVEL ( 0 )
12
13INLINE void ATTR_PRINTF(3,4) verboselog( running_machine& machine, int n_level, const char *s_fmt, ... )
14{
15   if( VERBOSE_LEVEL >= n_level )
16   {
17      va_list v;
18      char buf[ 32768 ];
19      va_start( v, s_fmt );
20      vsprintf( buf, s_fmt, v );
21      va_end( v );
22      logerror( "%s: %s", machine.describe_context(), buf );
23   }
24}
25
26const device_type PSX_SIO = &device_creator<psxsio_device>;
27
28psxsio_device::psxsio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
29   : device_t(mconfig, PSX_SIO, "PSX SIO", tag, owner, clock)
30{
31   int n;
32
33   for( n = 0; n < 2; n++ )
34   {
35      port[ n ].fn_handler = NULL;
36   }
37}
38
39void psxsio_device::device_reset()
40{
41}
42
43void psxsio_device::device_post_load()
44{
45   int n;
46
47   for( n = 0; n < 2; n++ )
48   {
49      sio_timer_adjust( n );
50   }
51}
52
53void psxsio_device::device_start()
54{
55   int n;
56
57   for( n = 0; n < 2; n++ )
58   {
59      port[ n ].timer = machine().scheduler().timer_alloc( timer_expired_delegate( FUNC( psxsio_device::sio_clock ), this ) );
60      port[ n ].n_status = SIO_STATUS_TX_EMPTY | SIO_STATUS_TX_RDY;
61      port[ n ].n_mode = 0;
62      port[ n ].n_control = 0;
63      port[ n ].n_baud = 0;
64      port[ n ].n_tx = 0;
65      port[ n ].n_rx = 0;
66      port[ n ].n_tx_prev = 0;
67      port[ n ].n_rx_prev = 0;
68      port[ n ].n_rx_data = 0;
69      port[ n ].n_tx_data = 0;
70      port[ n ].n_rx_shift = 0;
71      port[ n ].n_tx_shift = 0;
72      port[ n ].n_rx_bits = 0;
73      port[ n ].n_tx_bits = 0;
74   }
75
76   for( n = 0; n < 2; n++ )
77   {
78      state_save_register_item( machine(), "psxsio", NULL, n, port[n].n_status );
79      state_save_register_item( machine(), "psxsio", NULL, n, port[n].n_mode );
80      state_save_register_item( machine(), "psxsio", NULL, n, port[n].n_control );
81      state_save_register_item( machine(), "psxsio", NULL, n, port[n].n_baud );
82      state_save_register_item( machine(), "psxsio", NULL, n, port[n].n_tx );
83      state_save_register_item( machine(), "psxsio", NULL, n, port[n].n_rx );
84      state_save_register_item( machine(), "psxsio", NULL, n, port[n].n_tx_prev );
85      state_save_register_item( machine(), "psxsio", NULL, n, port[n].n_rx_prev );
86      state_save_register_item( machine(), "psxsio", NULL, n, port[n].n_rx_data );
87      state_save_register_item( machine(), "psxsio", NULL, n, port[n].n_tx_data );
88      state_save_register_item( machine(), "psxsio", NULL, n, port[n].n_rx_shift );
89      state_save_register_item( machine(), "psxsio", NULL, n, port[n].n_tx_shift );
90      state_save_register_item( machine(), "psxsio", NULL, n, port[n].n_rx_bits );
91      state_save_register_item( machine(), "psxsio", NULL, n, port[n].n_tx_bits );
92   }
93}
94
95void psxsio_device::install_handler( int n_port, psx_sio_handler p_f_sio_handler )
96{
97   port[ n_port ].fn_handler = p_f_sio_handler;
98}
99
100void psxsio_device::sio_interrupt( int n_port )
101{
102   psx_sio *sio = &port[ n_port ];
103
104   verboselog( machine(), 1, "sio_interrupt( %d )\n", n_port );
105   sio->n_status |= SIO_STATUS_IRQ;
106   if( n_port == 0 )
107   {
108      psx_irq_set( machine(), PSX_IRQ_SIO0 );
109   }
110   else
111   {
112      psx_irq_set( machine(), PSX_IRQ_SIO1 );
113   }
114}
115
116void psxsio_device::sio_timer_adjust( int n_port )
117{
118   psx_sio *sio = &port[ n_port ];
119   attotime n_time;
120
121   if( ( sio->n_status & SIO_STATUS_TX_EMPTY ) == 0 || sio->n_tx_bits != 0 )
122   {
123      int n_prescaler;
124
125      switch( sio->n_mode & 3 )
126      {
127      case 1:
128         n_prescaler = 1;
129         break;
130      case 2:
131         n_prescaler = 16;
132         break;
133      case 3:
134         n_prescaler = 64;
135         break;
136      default:
137         n_prescaler = 0;
138         break;
139      }
140
141      if( sio->n_baud != 0 && n_prescaler != 0 )
142      {
143         n_time = attotime::from_hz(33868800) * (n_prescaler * sio->n_baud);
144         verboselog( machine(), 2, "sio_timer_adjust( %d ) = %s ( %d x %d )\n", n_port, n_time.as_string(), n_prescaler, sio->n_baud );
145      }
146      else
147      {
148         n_time = attotime::never;
149         verboselog( machine(), 0, "sio_timer_adjust( %d ) invalid baud rate ( %d x %d )\n", n_port, n_prescaler, sio->n_baud );
150      }
151   }
152   else
153   {
154      n_time = attotime::never;
155      verboselog( machine(), 2, "sio_timer_adjust( %d ) finished\n", n_port );
156   }
157   sio->timer->adjust( n_time, n_port);
158}
159
160void psxsio_device::sio_clock(void *ptr, int param)
161{
162   int n_port = param;
163   psx_sio *sio = &port[ n_port ];
164   verboselog( machine(), 2, "sio tick\n" );
165
166   if( sio->n_tx_bits == 0 &&
167      ( sio->n_control & SIO_CONTROL_TX_ENA ) != 0 &&
168      ( sio->n_status & SIO_STATUS_TX_EMPTY ) == 0 )
169   {
170      sio->n_tx_bits = 8;
171      sio->n_tx_shift = sio->n_tx_data;
172      if( n_port == 0 )
173      {
174         sio->n_rx_bits = 8;
175         sio->n_rx_shift = 0;
176      }
177      sio->n_status |= SIO_STATUS_TX_EMPTY;
178      sio->n_status |= SIO_STATUS_TX_RDY;
179   }
180
181   if( sio->n_tx_bits != 0 )
182   {
183      sio->n_tx = ( sio->n_tx & ~PSX_SIO_OUT_DATA ) | ( ( sio->n_tx_shift & 1 ) * PSX_SIO_OUT_DATA );
184      sio->n_tx_shift >>= 1;
185      sio->n_tx_bits--;
186
187      if( sio->fn_handler != NULL )
188      {
189         if( n_port == 0 )
190         {
191            sio->n_tx &= ~PSX_SIO_OUT_CLOCK;
192            (*sio->fn_handler)( machine(), sio->n_tx );
193            sio->n_tx |= PSX_SIO_OUT_CLOCK;
194         }
195         (*sio->fn_handler)( machine(), sio->n_tx );
196      }
197
198      if( sio->n_tx_bits == 0 &&
199         ( sio->n_control & SIO_CONTROL_TX_IENA ) != 0 )
200      {
201         sio_interrupt( n_port );
202      }
203   }
204
205   if( sio->n_rx_bits != 0 )
206   {
207      sio->n_rx_shift = ( sio->n_rx_shift >> 1 ) | ( ( ( sio->n_rx & PSX_SIO_IN_DATA ) / PSX_SIO_IN_DATA ) << 7 );
208      sio->n_rx_bits--;
209
210      if( sio->n_rx_bits == 0 )
211      {
212         if( ( sio->n_status & SIO_STATUS_RX_RDY ) != 0 )
213         {
214            sio->n_status |= SIO_STATUS_OVERRUN;
215         }
216         else
217         {
218            sio->n_rx_data = sio->n_rx_shift;
219            sio->n_status |= SIO_STATUS_RX_RDY;
220         }
221         if( ( sio->n_control & SIO_CONTROL_RX_IENA ) != 0 )
222         {
223            sio_interrupt( n_port );
224         }
225      }
226   }
227
228   sio_timer_adjust( n_port );
229}
230
231WRITE32_MEMBER( psxsio_device::write )
232{
233   int n_port = offset / 4;
234   psx_sio *sio = &port[ n_port ];
235
236   switch( offset % 4 )
237   {
238   case 0:
239      verboselog( machine(), 1, "psx_sio_w %d data %02x (%08x)\n", n_port, data, mem_mask );
240      sio->n_tx_data = data;
241      sio->n_status &= ~( SIO_STATUS_TX_RDY );
242      sio->n_status &= ~( SIO_STATUS_TX_EMPTY );
243      sio_timer_adjust( n_port );
244      break;
245   case 1:
246      verboselog( machine(), 0, "psx_sio_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
247      break;
248   case 2:
249      if( ACCESSING_BITS_0_15 )
250      {
251         sio->n_mode = data & 0xffff;
252         verboselog( machine(), 1, "psx_sio_w %d mode %04x\n", n_port, data & 0xffff );
253      }
254      if( ACCESSING_BITS_16_31 )
255      {
256         verboselog( machine(), 1, "psx_sio_w %d control %04x\n", n_port, data >> 16 );
257         sio->n_control = data >> 16;
258
259         if( ( sio->n_control & SIO_CONTROL_RESET ) != 0 )
260         {
261            verboselog( machine(), 1, "psx_sio_w reset\n" );
262            sio->n_status |= SIO_STATUS_TX_EMPTY | SIO_STATUS_TX_RDY;
263            sio->n_status &= ~( SIO_STATUS_RX_RDY | SIO_STATUS_OVERRUN | SIO_STATUS_IRQ );
264         }
265         if( ( sio->n_control & SIO_CONTROL_IACK ) != 0 )
266         {
267            verboselog( machine(), 1, "psx_sio_w iack\n" );
268            sio->n_status &= ~( SIO_STATUS_IRQ );
269            sio->n_control &= ~( SIO_CONTROL_IACK );
270         }
271         if( ( sio->n_control & SIO_CONTROL_DTR ) != 0 )
272         {
273            sio->n_tx |= PSX_SIO_OUT_DTR;
274         }
275         else
276         {
277            sio->n_tx &= ~PSX_SIO_OUT_DTR;
278         }
279
280         if( ( ( sio->n_tx ^ sio->n_tx_prev ) & PSX_SIO_OUT_DTR ) != 0 )
281         {
282            if( sio->fn_handler != NULL )
283            {
284               (*sio->fn_handler)( machine(), sio->n_tx );
285            }
286         }
287         sio->n_tx_prev = sio->n_tx;
288
289      }
290      break;
291   case 3:
292      if( ACCESSING_BITS_0_15 )
293      {
294         verboselog( machine(), 0, "psx_sio_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
295      }
296      if( ACCESSING_BITS_16_31 )
297      {
298         sio->n_baud = data >> 16;
299         verboselog( machine(), 1, "psx_sio_w %d baud %04x\n", n_port, data >> 16 );
300      }
301      break;
302   default:
303      verboselog( machine(), 0, "psx_sio_w( %08x, %08x, %08x )\n", offset, data, mem_mask );
304      break;
305   }
306}
307
308READ32_MEMBER( psxsio_device::read )
309{
310   int n_port = offset / 4;
311   psx_sio *sio = &port[ n_port ];
312   UINT32 data;
313
314   switch( offset % 4 )
315   {
316   case 0:
317      data = sio->n_rx_data;
318      sio->n_status &= ~( SIO_STATUS_RX_RDY );
319      sio->n_rx_data = 0xff;
320      verboselog( machine(), 1, "psx_sio_r %d data %02x (%08x)\n", n_port, data, mem_mask );
321      break;
322   case 1:
323      data = sio->n_status;
324      if( ACCESSING_BITS_0_15 )
325      {
326         verboselog( machine(), 1, "psx_sio_r %d status %04x\n", n_port, data & 0xffff );
327      }
328      if( ACCESSING_BITS_16_31 )
329      {
330         verboselog( machine(), 0, "psx_sio_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
331      }
332      break;
333   case 2:
334      data = ( sio->n_control << 16 ) | sio->n_mode;
335      if( ACCESSING_BITS_0_15 )
336      {
337         verboselog( machine(), 1, "psx_sio_r %d mode %04x\n", n_port, data & 0xffff );
338      }
339      if( ACCESSING_BITS_16_31 )
340      {
341         verboselog( machine(), 1, "psx_sio_r %d control %04x\n", n_port, data >> 16 );
342      }
343      break;
344   case 3:
345      data = sio->n_baud << 16;
346      if( ACCESSING_BITS_0_15 )
347      {
348         verboselog( machine(), 0, "psx_sio_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
349      }
350      if( ACCESSING_BITS_16_31 )
351      {
352         verboselog( machine(), 1, "psx_sio_r %d baud %04x\n", n_port, data >> 16 );
353      }
354      break;
355   default:
356      data = 0;
357      verboselog( machine(), 0, "psx_sio_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
358      break;
359   }
360   return data;
361}
362
363void psxsio_device::input( int n_port, int n_mask, int n_data )
364{
365   psx_sio *sio = &port[ n_port ];
366   verboselog( machine(), 1, "psx_sio_input( %d, %02x, %02x )\n", n_port, n_mask, n_data );
367   sio->n_rx = ( sio->n_rx & ~n_mask ) | ( n_data & n_mask );
368
369   if( ( sio->n_rx & PSX_SIO_IN_DSR ) != 0 )
370   {
371      sio->n_status |= SIO_STATUS_DSR;
372      if( ( sio->n_rx_prev & PSX_SIO_IN_DSR ) == 0 &&
373         ( sio->n_control & SIO_CONTROL_DSR_IENA ) != 0 )
374      {
375         sio_interrupt( n_port );
376      }
377   }
378   else
379   {
380      sio->n_status &= ~SIO_STATUS_DSR;
381   }
382   sio->n_rx_prev = sio->n_rx;
383}
src/emu/cpu/psx/irq.c
r0r11557
1/*
2 * PlayStation IRQ emulator
3 *
4 * Copyright 2003-2011 smf
5 *
6 */
7
8#include "psx.h"
9#include "irq.h"
10
11#define VERBOSE_LEVEL ( 0 )
12
13INLINE void ATTR_PRINTF(3,4) verboselog( running_machine& machine, int n_level, const char *s_fmt, ... )
14{
15   if( VERBOSE_LEVEL >= n_level )
16   {
17      va_list v;
18      char buf[ 32768 ];
19      va_start( v, s_fmt );
20      vsprintf( buf, s_fmt, v );
21      va_end( v );
22      logerror( "%s: %s", machine.describe_context(), buf );
23   }
24}
25
26const device_type PSX_IRQ = &device_creator<psxirq_device>;
27
28psxirq_device::psxirq_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
29   : device_t(mconfig, PSX_IRQ, "PSX IRQ", tag, owner, clock)
30{
31}
32
33void psxirq_device::device_reset()
34{
35   n_irqdata = 0;
36   n_irqmask = 0;
37
38   psx_irq_update();
39}
40
41void psxirq_device::device_post_load()
42{
43   psx_irq_update();
44}
45
46void psxirq_device::device_start()
47{
48   save_item( NAME( n_irqdata ) );
49   save_item( NAME( n_irqmask ) );
50}
51
52void psxirq_device::set( UINT32 bitmask )
53{
54   verboselog( machine(), 2, "psx_irq_set %08x\n", bitmask );
55   n_irqdata |= bitmask;
56   psx_irq_update();
57}
58
59void psxirq_device::psx_irq_update( void )
60{
61   if( ( n_irqdata & n_irqmask ) != 0 )
62   {
63      verboselog( machine(), 2, "psx irq assert\n" );
64      cputag_set_input_line( machine(), "maincpu", PSXCPU_IRQ0, ASSERT_LINE );
65   }
66   else
67   {
68      verboselog( machine(), 2, "psx irq clear\n" );
69      cputag_set_input_line( machine(), "maincpu", PSXCPU_IRQ0, CLEAR_LINE );
70   }
71}
72
73WRITE32_MEMBER( psxirq_device::write )
74{
75   switch( offset )
76   {
77   case 0x00:
78      verboselog( machine(), 2, "psx irq data ( %08x, %08x ) %08x -> %08x\n", data, mem_mask, n_irqdata, ( n_irqdata & ~mem_mask ) | ( n_irqdata & n_irqmask & data ) );
79      n_irqdata = ( n_irqdata & ~mem_mask ) | ( n_irqdata & n_irqmask & data );
80      psx_irq_update();
81      break;
82   case 0x01:
83      verboselog( machine(), 2, "psx irq mask ( %08x, %08x ) %08x -> %08x\n", data, mem_mask, n_irqmask, ( n_irqmask & ~mem_mask ) | data );
84      n_irqmask = ( n_irqmask & ~mem_mask ) | data;
85      if( ( n_irqmask &~ PSX_IRQ_MASK ) != 0 )
86      {
87         verboselog( machine(), 0, "psx_irq_w( %08x, %08x, %08x ) unknown irq\n", offset, data, mem_mask );
88      }
89      psx_irq_update();
90      break;
91   default:
92      verboselog( machine(), 0, "psx_irq_w( %08x, %08x, %08x ) unknown register\n", offset, data, mem_mask );
93      break;
94   }
95}
96
97READ32_MEMBER( psxirq_device::read )
98{
99   switch( offset )
100   {
101   case 0x00:
102      verboselog( machine(), 1, "psx_irq_r irq data %08x\n", n_irqdata );
103      return n_irqdata;
104   case 0x01:
105      verboselog( machine(), 1, "psx_irq_r irq mask %08x\n", n_irqmask );
106      return n_irqmask;
107   default:
108      verboselog( machine(), 0, "psx_irq_r unknown register %d\n", offset );
109      break;
110   }
111   return 0;
112}
src/emu/cpu/nec/necdasm.c
r11556r11557
818818
819819
820820static const char *const nec_reg[8] = { "aw",  "cw",  "dw",  "bw",  "sp",  "bp",  "ix",  "iy" };
821static const char *const neg_reg8[8] = { "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh" };
821static const char *const nec_reg8[8] = { "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh" };
822822static const char *const nec_sreg[8] = { "ds1", "ps", "ss", "ds0", "???", "???", "???", "???" };
823823static const char *const nec_sfreg[256] =
824824{
r11556r11557
10061006   switch(param)
10071007   {
10081008      case PARAM_REG8:
1009         s += sprintf( s, "%s", neg_reg8[MODRM_REG1] );
1009         s += sprintf( s, "%s", nec_reg8[MODRM_REG1] );
10101010         break;
10111011
10121012      case PARAM_REG16:
r11556r11557
10141014         break;
10151015
10161016      case PARAM_REG2_8:
1017         s += sprintf( s, "%s", neg_reg8[MODRM_REG2] );
1017         s += sprintf( s, "%s", nec_reg8[MODRM_REG2] );
10181018         break;
10191019
10201020      case PARAM_REG2_16:
r11556r11557
10231023
10241024      case PARAM_RM8:
10251025         if( modrm >= 0xc0 ) {
1026            s += sprintf( s, "%s", neg_reg8[MODRM_REG2] );
1026            s += sprintf( s, "%s", nec_reg8[MODRM_REG2] );
10271027         } else {
10281028            s += sprintf( s, "byte ptr " );
10291029            s += sprintf( s, "%s", modrm_string );
r11556r11557
10961096            case SEG_SS: s += sprintf( s, "ss:" ); break;
10971097         }
10981098
1099         d16 = FETCHD16();
1100         s += sprintf( s, "[%s]", hexstring(d16, 0) );
1099         i16 = FETCHD16();
1100         s += sprintf( s, "[%s]", hexstring(i16, 0) );
11011101         break;
11021102
11031103      case PARAM_SREG:
src/emu/emu.mak
r11556r11557
187187   $(EMUMACHINE)/jvsdev.o      \
188188   $(EMUMACHINE)/jvshost.o      \
189189   $(EMUMACHINE)/k033906.o      \
190   $(EMUMACHINE)/k053252.o    \
190191   $(EMUMACHINE)/k056230.o      \
191192   $(EMUMACHINE)/latch8.o      \
192193   $(EMUMACHINE)/ldcore.o      \
src/emu/machine/k053252.c
r0r11557
1/***************************************************************************************************************************
2
3    Konami 053252 chip emulation, codenamed "CCU"
4
5   device emulation by Angelo Salese, based off notes by Olivier Galibert
6
7============================================================================================================================
8
9left res = current in game, right res = computed
10
11hexion:    02 FF 00 4D 00 73 00 00 01 1F 05 0E B7 7C 00 00 512x256 ~ 512x256 <- writes to e and f regs, in an irq ack fashion
12overdriv:  01 7F 00 22 00 0D 00 03 01 07 10 0F 73 00 00 00 304x256 ~ 305x224
13esckids:   01 7F 00 12 00 0D 00 01 01 07 08 07 73 00 00 00 304x224 ~ 321x240
14rollerg:   01 7F 00 23 00 1D 02 00 01 07 10 0F 73 00 02 00 288x224 ~ 288x224 <- writes to 6 and e regs, in an irq ack fashion
15gaiapols:  01 FB 00 19 00 37 00 00 01 06 10 0E 75 00 D1 00 376x224 ~ 380x224
16mmaulers:  01 7F 00 19 00 27 00 00 01 07 10 0F 73 00 00 00 288x224 ~ 288x224
17mystwarr:  01 7F 00 12 00 2E 00 00 01 07 11 0E 73 00 00 00 288x224 ~ 288x224
18metamrph:  01 7F 00 11 00 27 01 00 01 07 10 0F 74 00 00 00 288x224 ~ 288x224
19viostorm:  01 FF 00 16 00 39 00 00 01 07 11 0E 75 00 00 00 384x224 ~ 385x224
20mtlchamp:  01 FF 00 21 00 37 00 00 01 07 11 0E 74 00 00 00 384x224 ~ 384x224
21dbz:       01 FF 00 21 00 37 00 00 01 20 0C 0E 54 00 00 00 384x256 ~ 384x256
22dbz2:      01 FF 00 21 00 37 00 00 01 20 0C 0E 54 00 00 00 384x256 ~ 384x256
23xexex:     01 FF 00 21 00 37 01 00 00 20 0C 0E 54 00 00 00 384x256 ~ 384x256 (*)
24(all konamigx, cowboys of moo mesa, run & gun, dj main)
25
26(*) hblank duration 512 (0x200), hdisp 384 (0x180), vblank duration 288 (0x120), vdisp 256 (0x100)
27
28    Definitions from GX, look similar, all values big-endian, write-only:
29
30   0-1: bits 9-0: HC        - Total hblank duration (-1)     Hres ~ (HC+1) - HFP - HBP - 8*(HSW+1)
31   2-3: bits 8-0: HFP       - HBlank front porch
32   4-5: bits 8-0: HBP       - HBlank back porch
33   6  : bits 7-0: INT1EN
34   7  : bits 7-0: INT2EN
35   8-9: bits 8-0: VC        - Total vblank duration
36   a  : bits 7-0: VFP       - VBlank front porch             Vres ~ VC - VFP - VBP - (VSW+1)
37   b  : bits 7-0: VBP       - VBlank back porch
38   c  : bits 7-4: VSW       - V-Sync Width
39   c  : bits 3-0: HSW       - H-Sync Width
40   d  : bits 7-0: INT-TIME
41   e  : bits 7-0: INT1ACK
42   f  : bits 7-0: INT2ACK
43
44    Read-only:
45   e-f: bits 8-0: VCT
46
47TODO:
48- xexex sets up 0x20 as the VC? default value?
49- xexex layers are offsetted if you try to use the CCU
50- understand how to interpret the back / front porch values, and remove the offset x/y hack
51
52***************************************************************************************************************************/
53
54
55#include "emu.h"
56#include "k053252.h"
57
58typedef struct _k053252_state k053252_state;
59struct _k053252_state
60{
61   UINT8   regs[16];
62   UINT16  hc,hfp,hbp;
63   UINT16  vc,vfp,vbp;
64   UINT8   vsw,hsw;
65
66   screen_device *screen;
67   devcb_resolved_write_line int1_en;
68   devcb_resolved_write_line int2_en;
69   devcb_resolved_write_line int1_ack;
70   devcb_resolved_write_line int2_ack;
71   //devcb_resolved_write8     int_time;
72   int offsx,offsy;
73};
74
75
76/*****************************************************************************
77    INLINE FUNCTIONS
78*****************************************************************************/
79
80INLINE k053252_state *k053252_get_safe_token( device_t *device )
81{
82   assert(device != NULL);
83   assert(device->type() == K053252);
84
85   return (k053252_state *)downcast<legacy_device_base *>(device)->token();
86}
87
88INLINE const k053252_interface *k053252_get_interface( device_t *device )
89{
90   assert(device != NULL);
91   assert(device->type() == K053252);
92
93   return (const k053252_interface *) device->static_config();
94}
95
96/*****************************************************************************
97    DEVICE HANDLERS
98*****************************************************************************/
99
100READ8_DEVICE_HANDLER( k053252_r )
101{
102   k053252_state *k053252 = k053252_get_safe_token(device);
103
104   //TODO: debugger_access()
105   popmessage("Warning: k053252 read %02x, contact MAMEdev",offset);
106
107   return k053252->regs[offset];
108}
109
110static void k053252_res_change( device_t *device )
111{
112   k053252_state *k053252 = k053252_get_safe_token(device);
113
114   if(k053252->screen != NULL)
115   {
116      if(k053252->hc && k053252->vc &&
117         k053252->hbp && k053252->hfp &&
118         k053252->vbp && k053252->vfp &&
119         k053252->hsw && k053252->vsw) //safety checks
120      {
121         rectangle visarea;
122         //(HC+1) - HFP - HBP - 8*(HSW+1)
123         //VC - VFP - VBP - (VSW+1)
124         attoseconds_t refresh = HZ_TO_ATTOSECONDS(device->clock()) * (k053252->hc) * k053252->vc;
125
126         //printf("H %d %d %d %d\n",k053252->hc,k053252->hfp,k053252->hbp,k053252->hsw);
127         //printf("V %d %d %d %d\n",k053252->vc,k053252->vfp,k053252->vbp,k053252->vsw);
128
129         visarea.min_x = k053252->offsx;
130         visarea.min_y = k053252->offsy;
131         visarea.max_x = k053252->offsx + k053252->hc - k053252->hfp - k053252->hbp - 8*(k053252->hsw) - 1;
132         visarea.max_y = k053252->offsy + k053252->vc - k053252->vfp - k053252->vbp - (k053252->vsw) - 1;
133
134         k053252->screen->configure(k053252->hc, k053252->vc, visarea, refresh);
135      }
136   }
137}
138
139WRITE8_DEVICE_HANDLER( k053252_w )
140{
141   k053252_state *k053252 = k053252_get_safe_token(device);
142
143   k053252->regs[offset] = data;
144
145   switch(offset)
146   {
147      case 0x00:
148      case 0x01:
149         k053252->hc  = (k053252->regs[1]&0xff);
150         k053252->hc |= ((k053252->regs[0]&0x03)<<8);
151         k053252->hc ++;
152         logerror("%d (%04x) HC set\n",k053252->hc,k053252->hc);
153         k053252_res_change(device);
154         break;
155      case 0x02:
156      case 0x03:
157         k053252->hfp  = (k053252->regs[3]&0xff);
158         k053252->hfp |= ((k053252->regs[2]&0x01)<<8);
159         logerror("%d (%04x) HFP set\n",k053252->hfp,k053252->hfp);
160         k053252_res_change(device);
161         break;
162      case 0x04:
163      case 0x05:
164         k053252->hbp  = (k053252->regs[5]&0xff);
165         k053252->hbp |= ((k053252->regs[4]&0x01)<<8);
166         logerror("%d (%04x) HBP set\n",k053252->hbp,k053252->hbp);
167         k053252_res_change(device);
168         break;
169      case 0x06: k053252->int1_en(data); break;
170      case 0x07: k053252->int2_en(data); break;
171      case 0x08:
172      case 0x09:
173         k053252->vc  = (k053252->regs[9]&0xff);
174         k053252->vc |= ((k053252->regs[8]&0x01)<<8);
175         logerror("%d (%04x) VC set\n",k053252->vc,k053252->vc);
176         k053252_res_change(device);
177         break;
178      case 0x0a:
179         k053252->vfp  = (k053252->regs[0x0a]&0xff);
180         logerror("%d (%04x) VFP set\n",k053252->vfp,k053252->vfp);
181         k053252_res_change(device);
182         break;
183      case 0x0b:
184         k053252->vbp  = (k053252->regs[0x0b]&0xff);
185         logerror("%d (%04x) VBP set\n",k053252->vbp,k053252->vbp);
186         k053252_res_change(device);
187         break;
188      case 0x0c:
189         k053252->vsw  = ((k053252->regs[0x0c]&0xf0) >> 4) + 1;
190         k053252->hsw  = ((k053252->regs[0x0c]&0x0f) >> 0) + 1;
191         logerror("%02x VSW / %02x HSW set\n",k053252->vsw,k053252->hsw);
192         k053252_res_change(device);
193         break;
194      //case 0x0d: k053252->int_time(data); break;
195      case 0x0e: k053252->int1_ack(1); break;
196      case 0x0f: k053252->int2_ack(1); break;
197   }
198}
199
200
201
202/*****************************************************************************
203    DEVICE INTERFACE
204*****************************************************************************/
205
206static DEVICE_START( k053252 )
207{
208   k053252_state *k053252 = k053252_get_safe_token(device);
209   const k053252_interface *intf = k053252_get_interface(device);
210
211   device->save_item(NAME(k053252->regs));
212   k053252->screen = device->machine().device<screen_device>(intf->screen);
213   k053252->int1_en.resolve(intf->int1_en, *device);
214   k053252->int2_en.resolve(intf->int2_en, *device);
215   k053252->int1_ack.resolve(intf->int1_ack, *device);
216   k053252->int2_ack.resolve(intf->int2_ack, *device);
217   //k053252->int_time.resolve(intf->int_time, *device);
218   k053252->offsx = intf->offsx;
219   k053252->offsy = intf->offsy;
220}
221
222static DEVICE_RESET( k053252 )
223{
224   k053252_state *k053252 = k053252_get_safe_token(device);
225   int i;
226
227   for (i = 0; i < 16; i++)
228      k053252->regs[i] = 0;
229
230   k053252->regs[0x08] = 1; // Xexex apparently does a wrong assignment for VC (sets up the INT enable register instead)
231}
232
233
234DEVICE_GET_INFO( k053252 )
235{
236   switch (state)
237   {
238      /* --- the following bits of info are returned as 64-bit signed integers --- */
239      case DEVINFO_INT_TOKEN_BYTES:         info->i = sizeof(k053252_state);               break;
240
241      /* --- the following bits of info are returned as pointers to data or functions --- */
242      case DEVINFO_FCT_START:               info->start = DEVICE_START_NAME(k053252);      break;
243      case DEVINFO_FCT_STOP:               /* Nothing */                           break;
244      case DEVINFO_FCT_RESET:               info->reset = DEVICE_RESET_NAME(k053252);      break;
245
246      /* --- the following bits of info are returned as NULL-terminated strings --- */
247      case DEVINFO_STR_NAME:               strcpy(info->s, "Konami 053252");            break;
248      case DEVINFO_STR_FAMILY:            strcpy(info->s, "Konami Video IC");               break;
249      case DEVINFO_STR_VERSION:            strcpy(info->s, "1.0");                     break;
250      case DEVINFO_STR_SOURCE_FILE:         strcpy(info->s, __FILE__);                  break;
251      case DEVINFO_STR_CREDITS:            strcpy(info->s, "Copyright MAME Team");         break;
252   }
253}
254
255DEFINE_LEGACY_DEVICE(K053252, k053252);
256
src/emu/machine/k053252.h
r0r11557
1/**  Konami 053252  **/
2/* CRT and interrupt control unit */
3#pragma once
4
5#ifndef __K053252_H__
6#define __K053252_H__
7
8#include "devlegcy.h"
9
10DECLARE_LEGACY_DEVICE(K053252, k053252);
11
12
13
14typedef struct _k053252_interface k053252_interface;
15struct _k053252_interface
16{
17   const char         *screen;
18   devcb_write_line   int1_en;
19   devcb_write_line   int2_en;
20   devcb_write_line   int1_ack;
21   devcb_write_line   int2_ack;
22//   devcb_write8       int_time;
23   int                offsx;
24   int                offsy;
25};
26
27
28#define MCFG_K053252_ADD(_tag, _clock, _interface) \
29   MCFG_DEVICE_ADD(_tag, K053252, _clock) \
30   MCFG_DEVICE_CONFIG(_interface)
31
32/**  Konami 053252  **/
33/* CRT and interrupt control unit */
34READ8_DEVICE_HANDLER( k053252_r );   // CCU registers
35WRITE8_DEVICE_HANDLER( k053252_w );
36
37
38
39#endif   /* __K033906_H__ */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team