Previous 15994 Revisions Next

r1038 Wednesday 26th September, 2007 at 18:25:33 UTC by Nathan Woods
Updated to MAME 0.119u1 core
[ROOT]makefile
[docs]messnew.txt
[src/emu]mame.c uimenu.c
[src/emu/cpu]cpu.mak x64drc.c* x64drc.h* x86drc.c x86emit.h
[src/emu/cpu/dsp56k]dsp56dsm.c dsp56ops.c
[src/emu/cpu/e132xs]e132xs.c
[src/emu/cpu/h83002]h83002.c
[src/emu/cpu/i386]i386.c i386.h i386dasm.c
[src/emu/cpu/i86]i86.c i86mem.c
[src/emu/cpu/i960]i960.c
[src/emu/cpu/m6800]6800ops.c 6800tbl.c
[src/emu/cpu/mb86233]mb86233.c mb86233d.c
[src/emu/cpu/mips]{mdrc64.c}
[src/emu/cpu/nec]nec.c
[src/emu/cpu/powerpc]drc_ops.c ppc.c ppc403.c ppc602.c ppc603.c ppc_mem.c ppc_ops.c ppcdrc.c
[src/emu/cpu/sh4]sh4.c
[src/emu/cpu/sharc]sharcdsm.c
[src/emu/cpu/tms32025]tms32025.c
[src/emu/cpu/tms34010]tms34010.c
[src/emu/cpu/v60]am1.c am2.c am3.c optable.c v60.c
[src/emu/cpu/z180]z180.c z180op.c z180ops.h
[src/emu/debug]debugvw.c
[src/emu/sound]2610intf.c scsp.c
[src/lib/util]avcomp.c avcomp.h aviio.c aviio.h huffman.c huffman.h options.h pool.c pool.h
[src/mame]mame.mak mamedriv.c
[src/mame/drivers]20pacgal.c 40love.c armedf.c backfire.c battlera.c bfm_sc2.c bigevglf.c bublbobl.c cliffhgr.c comebaby.c couple.c cowrace.c crgolf.c dblewing.c ddenlovr.c dunhuang.c firebeat.c funworld.c gaelco2.c galaga.c galaxian.c galpanic.c gcpinbal.c gdrawpkr.c genesis.c hng64.c hshavoc.c igs_blit.c jalmah.c jcross.c konamigx.c konamim2.c laserbat.c legionna.c lgp.c* liberate.c lockon.c m72.c mario.c mediagx.c megadriv.c megaplay.c megatech.c micro3d.c model2.c mpu4.c mw8080bw.c namcoic.c namcona1.c namcos2.c namcos21.c opwolf.c othunder.c pokechmp.c progolf.c raiden2.c royalmah.c seattle.c segae.c segae.h* segas16a.c seta2.c sfkick.c skylncr.c sprint4.c srmp5.c* srmp6.c ssv.c st0016.c stv.c stvinit.c system16.c system18.c taito_l.c taito_z.c topshoot.c trvmadns.c ttchamp.c tumbleb.c tumblep.c vegas.c videopin.c viper.c
[src/mame/includes]genesis.h namcos2.h namcos21.h srmp6.h*
[src/mame/layout]videopin.lay*
[src/mame/machine]53c810.c fd1094.c irem_cpu.c namcos2.c neoboot.c pc16552d.c snesdsp1.c spisprit.c
[src/mame/video]afega.c deco_mlc.c funworld.c gdrawpkr.c* genesis.c hng64.c model2.c model3.c namcos21.c pacman.c segasyse.c seibuspi.c srmp6.c* taito_f3.c vooddefs.h voodoo.c voodoo.h
[src/osd/windows]debugwin.c drawd3d.c input.c window.c window.h
[src/tools]regrep.c

src/mame/machine/irem_cpu.c
r1037r1038
301301
302302const UINT8 gussun_decryption_table[256] = {
303303   0xcd,xxxx,xxxx,0x36,xxxx,0x52,0xb1,0x5b, 0x68,0xcd,xxxx,xxxx,xxxx,0xa8,xxxx,xxxx, /* 00 */
304//      !!!!                                     ^^^^ !!!!                ????
305   xxxx,xxxx,0x75,0x24,0x01,0x83,0x32,0xe9, xxxx,0x79,xxxx,xxxx,0x22,xxxx,0xac,xxxx, /* 10 */
306//                     !!!! ????      ^^^^            ????           !!!!      ^^^^
307   0x5d,0xa5,0x01,0x51,0x0a,xxxx,xxxx,xxxx ,0xf8,0x40,0x91,0x48,0x19,0x01,0x03,0x5f, /* 20 */
308//                ????      !!!!      ????       ^^^^ ???? ^^^^ ???? ???? ????
309   0x26,xxxx,xxxx,0x8b,xxxx,0x02,xxxx,xxxx, 0x8e,0xab,xxxx,xxxx,0xbc,0xf1,0xb3,xxxx, /* 30 */
304//      !!!!                                     ^^^^ !!!!                !!!!
305   xxxx,xxxx,0x75,0x24,0x09,0x83,0x32,0xe9, xxxx,0x79,xxxx,0x01,0x22,xxxx,0xac,xxxx, /* 10 */
306//                     !!!! ????      ^^^^            ????      ???? !!!!      ^^^^
307   0x5d,0xa5,0x1a,0x51,0x0a,xxxx,0x19,xxxx ,0xf8,0x48,0x91,0x40,0x28,0x19,0x03,0x5f, /* 20 */
308//                ????      !!!!      ????       ^^^^ ???? ^^^^ gggg gggg ????
309   0x26,xxxx,xxxx,0x8b,0x2f,0x02,xxxx,xxxx, 0x8e,0xab,xxxx,xxxx,0xbc,0xf1,0xb3,xxxx, /* 30 */
310310//
311   xxxx,0xfd,0xc6,xxxx,0x8c,0x3a,0xb3,xxxx, xxxx,0x74,0x61,xxxx,0x33,xxxx,xxxx,xxxx, /* 40 */
312//           ????           ????      ????                 !!!!
313   xxxx,0x53,0xa0,0xc0,0xc3,0x41,0xfc,0xe7, xxxx,0x01,xxxx,0x2b,xxxx,xxxx,0xba,0x2a, /* 50 */
314//                !!!! ^^^^      ^^^^                 ????      !!!!                !!!!
315   0xb0,xxxx,xxxx,0xb5,xxxx,xxxx,0xcd,0x07, 0xb9,xxxx,0x48,0x46,0xf9,xxxx,xxxx,xxxx, /* 60 */
316//                     ????           ????                 ???? ^^^^
311   xxxx,xxxx,0xc6,xxxx,0x8c,0x3a,0x19,xxxx, xxxx,0x74,0x61,xxxx,0x33,xxxx,0x19,xxxx, /* 40 */
312//           ????           ????      ????                 !!!!                ????
313   xxxx,0x53,0xa0,0xc0,0xc3,0x41,0xfc,0xe7, xxxx,0x1c,0x76,0x2b,xxxx,xxxx,0xba,0x2a, /* 50 */
314//                !!!! ^^^^      ^^^^                 ???? ???? !!!!                !!!!
315   0xb0,xxxx,xxxx,0x7c,xxxx,xxxx,0xb5,0x07, 0xb9,xxxx,0x27,0x46,0xf9,xxxx,xxxx,xxxx, /* 60 */
316//                     ????                                !!!! ^^^^
317317   xxxx,0xea,0x72,0x73,0xad,0xd1,0x3b,0x5e, 0xe5,0x57,xxxx,0x0d,xxxx,xxxx,xxxx,0x3c, /* 70 */
318//                     ???? ^^^^
319   xxxx,0x86,xxxx,xxxx,0x40,0x25,0x2d,xxxx, 0x9a,0xeb,0x04,0x0b,0xa2,0xb8,0xf6,xxxx, /* 80 */
320//                          ????                           ^^^^      !!!!      !!!!
321   xxxx,xxxx,0x9d,xxxx,0xbb,xxxx,xxxx,0xcb, 0xa9,0xcf,xxxx,0x60,0x43,0x56,xxxx,xxxx, /* 90 */
318//                          ^^^^
319   xxxx,0x86,xxxx,0x19,0x28,0x25,0x2d,xxxx, 0x9a,0xeb,0x04,0x0b,0xa2,0xb8,0xf6,xxxx, /* 80 */
320//                     ???? ????                           ^^^^      !!!!      !!!!
321   xxxx,xxxx,0x9d,xxxx,0xbb,xxxx,xxxx,0xcb, 0xa9,0xcf,xxxx,0x60,0x43,0x56,xxxx,0x19, /* 90 */
322322//                ^^^^                     ^^^^  !!!! ^^^^      !!!!                ????
323   xxxx,0xa3,xxxx,xxxx,xxxx,xxxx,0xfa,0xb4, xxxx,0x81,0xe6,xxxx,0x80,0x0c,0xd4,xxxx, /* a0 */
324//                                         ????                           ???? !!!!
325   xxxx,xxxx,xxxx,xxxx,0x7d,0x3d,0x3e,xxxx, xxxx,xxxx,0x40,xxxx,xxxx,xxxx,xxxx,xxxx, /* b0 */
326//           ????           ^^^^                           ????
327   xxxx,0xff,0x47,xxxx,0x55,0x1e,xxxx,0x59, 0x93,xxxx,xxxx,xxxx,0x88,0xc1,0x01,0xb2, /* c0 */
323   xxxx,0xa3,xxxx,xxxx,xxxx,xxxx,0xfa,0xb4, xxxx,0x81,0xe6,xxxx,0x80,0x8c,0xd4,xxxx, /* a0 */
324//                                         gggg                           gggg !!!!
325   xxxx,0x19,0x19,xxxx,0x7d,0x3d,0x3e,xxxx, xxxx,xxxx,0x4b,xxxx,xxxx,xxxx,xxxx,xxxx, /* b0 */
326//           ???? ???? ???? ^^^^                           ????
327   xxxx,0xff,0x47,xxxx,0x55,0x1e,xxxx,0x59, 0x93,xxxx,xxxx,xxxx,0x88,0xc1,0x11,0xb2, /* c0 */
328328//                ^^^^                           ^^^^                     ^^^^ ????
329329   xxxx,0x2e,0x06,0xc7,0x05,xxxx,0x8a,0x5a, 0x58,0xbe,xxxx,xxxx,xxxx,0x1f,0x23,xxxx, /* d0 */
330330//           ^^^^
331   0xe8,xxxx,0x89,0xa1,0xd0,xxxx,0x42,0xe2, 0x38,0xfe,0x50,0x9c,xxxx,xxxx,xxxx,0x49, /* e0 */
331   0xe8,xxxx,0x89,0xa1,0xd0,xxxx,0x19,0xe2, 0x38,0xfe,0x50,0x9c,xxxx,xxxx,xxxx,0x49, /* e0 */
332332//                                    ????                      ^^^^                !!!!
333   0xfb,xxxx,0xf3,xxxx,xxxx,0x0f,xxxx,xxxx, xxxx,xxxx,0xf7,0xbd,0x39,0x01,0xbf,xxxx, /* f0 */
333   0xfb,xxxx,0xf3,xxxx,xxxx,0x0f,xxxx,xxxx, xxxx,xxxx,0xf7,0xbd,0x39,0x7d,0xbf,xxxx, /* f0 */
334334//      !!!!                                                    !!!!      ????
335335};
336336/*
337337missing opcode:
3380d -> a8? (10174 - routine from 1016e to 10176) -> probably a8 (test)
33914 -> ??
34019 -> ??  (2282f - routine from 2281f to 22871) (78, 79, 7a, 7b)
34122 -> ??  (      - routine from 1df1d to
34226 -> ??
34329 -> ??  (1df22 - routine from 1df1d to
3442b -> ??  (1d4d2 - routine from 1d4b2 to 1d4de) (40, 48 ????)
3452c -> ??  (20333 - routine from 2032a to
3462d -> ??  (1df1d - routine from 1df1d to
34734 -> ??
34841 -> ??
34946 -> ??  (1461b
3504e -> ??  (208ac -
35159 -> ??  (220cf - routine from 2202f to
35263 -> b5? (1df7f, 1df8c, 1df95 - routine from 1df1d to ) - two bytes
35366 -> ??  (1daaf - routine from 1da61 to 1daca) - two bytes
3546a -> ??  (20371 - routine from 20368 to
35573 -> 73? (
35683 -> ??  (
35784 -> ??  (1d8f1 -
3589f -> ??  (
359ad -> ??  (1d559, 1d8d4
360a7 -> b4? (2029a - routine from 20290 to
361b1 -> ??
362b2 -> ??  (20a8c - 20acd
363ba -> ??  (1094d, 10b28
364ce -> 01? (10236 - routine from 1017e to 10254) (01, 09, 11, 19, 21, 29, 31)
365e6 -> ??  (1d8f7 -
366fd -> ??  (1d659 - routine from 1d63c to 1d65e)
367338
339***14 -> ??  (2097b - 20980 (01 09 11 31
340+++19 -> 78? (2282f - routine from 2281f to 22871) (78, 79, 7a, 7b)
341+++1b -> 01? (1d8f9 - routine from 1d8c7 to 1d8fc) - three bytes (09,11,21,29,31 - 01,19)
342+++22 -> 00? (1deff - routine from 1dee8 to 1df26) (01,09,10,11,18,19,1a,1b,20,21,28,29,30,31 - 00,08,13 - 12
343+++26 -> ??  (14ed_ , 198e_
344*+*29 -> 48? (1df22 - routine from 1df1d to
345+++2d -> 1a? (1df1d - routine from 1dee8 to 1df26) (00,01,10,11,12,13,20,21,28,29,30,31 - 08,09,18,19
346---41 -> ??
347///46 -> ??  (1461b
348---4e -> ??  (208ac -
349///5a -> ??  (222fc - routine from 222ed to ) (7x j...)
350///63 -> ??  (1df7f, 1df8c, 1df95,21f08 - routine from 1df1d to ) - two bytes j..
351---83 -> ??  (
352***84 -> 18? (1d8f1 - routine from 1d8c7 to 1d8fc) - three bytes (00,08,10,18,20,28,30)
353---9f -> ??  (
354---b1 -> ??
355---b2 -> ??  (20a8c - 20acd
356///b3 -> ??  (216b6 - 216cf
357///ba -> ??  (1094d, 10b28 - routine from 10948 to 10b73) one byte (4b
358+++ce -> 21? (10236 - routine from 1017e to 10254) (01, 09, 11, 19, 21, 29, 31)
359---e6 -> ??  (1d8f7 -
360+++fd -> 79? (1d659 - routine from 1d63c to 1d65e) (78,7a - 79,7b - 7d)
361
362rz guess:
3632b -> 40 (1d4d2 1db81 1dba9 - routine from 1d4b2 to 1d4de) (ok 40,48,96) -> 40
364         (no 0e,16,17,27,2f,37,3f,41,42,44,45,4a,4b,4c,4d,4e,4f,54,5c,6c,6d,92,94,95,97)
3652c -> 28 (20333 - routine from 2032a to 20366)
36659 -> 1c (220cf - 2037f - routine from 2202f to ) 2bytes (1c,
367a7 -> b4 (2029a - routine from 20290 to
368ad -> 8c (1d559, 1d8d4 - routine from 1d547 - ; routine from 1d8b8 to 1d8fc)
369     (00,01,08,09,0c,10,11,12,13,14,18,19,1a,1b,1c,20,21,28,29,2c,30,31,34,87,b4,b6,b7)
370
368371missing V35+ core:
36937200    -> 63    not supported (229e2 - routine from 229da to 229ec) (for now we use cd instruction + hack)
3703730f 92 -> of 92 not supported (1011d before of STI instruction) (for now no effects)
r1037r1038
3913940x21 -> a5 (used in "Service Mode" / "CHARACTER menu")
392395
393396checked against "hasamu" code: hasamu and gussun share code (i.e. you can compare gussun from 2002a and hasamu from 54a0)
3940x09 -> cd (22a17 - routine from 229ed to 22a1a) - two bytes
3970x09 -> cd (22a17 - routine from 229ed to 22a1a) - two bytes
3953980x13 -> 24 (interrupt routine)
3963990x1c -> 22 (interrupt routine)
4000x34 -> 2f (20381 - routine from 2037b to 20391) - used to handle number of lives and game over
3974010x4a -> 61 (interrupt routine)
4020x66 -> b5 (1daaf - routine from 1da61 to 1daca) - two bytes (colors effect)
4030x6a -> 27 (20368 - routine from 20368 to 2037a) - used to limit the max lives number
4040x73 -> 73 (1d4f7 - routine from 1d4df to 1d539) -> (no 70,71,72,74,75,76,77,78,79,7a,7b,7c,7d,7e,7f) - ok 73
3984050x8c -> a2 (interrupt routine)
3994060x8e -> f6 (interrupt routine)
4004070x9b -> 60 (interrupt routine)
src/mame/machine/neoboot.c
r1037r1038
820820   mem16[0xa110/2] = 0x9750;
821821}
822822
823#ifdef UNUSED_FUNCTION
823824static UINT16 mv0_bank_ram[ 0x10/2 ];
824825
825826static READ16_HANDLER( mv0_bankswitch_r )
r1037r1038
833834   COMBINE_DATA( &mv0_bank_ram[ offset ] );
834835    neogeo_set_main_cpu_bank_address( bankaddress );
835836}
837#endif
836838
837839/* I think the code for the kof2003 bootlegs is wrong, they don't work */
838840
src/mame/machine/pc16552d.c
r1037r1038
167167   mame_timer_adjust(duart[chip].ch[channel].tx_fifo_timer, period, (chip * 2) + channel, time_zero);
168168}
169169
170#ifdef UNUSED_FUNCTION
170171static UINT8 duart_pop_tx_fifo(int chip, int channel, UINT8 data)
171172{
172173   return 0;
173174}
175#endif
174176
175177
176178static UINT8 duart_r(int chip, int reg)
src/mame/machine/53c810.c
r1037r1038
6868   return r;
6969}
7070
71#ifdef UNUSED_FUNCTION
7172static UINT32 sign_extend24(UINT32 val)
7273{
7374   if (val & 0x00800000)
r1037r1038
7677      val &= ~0xFF000000;
7778   return val;
7879}
80#endif
7981
8082static void dmaop_invalid(void)
8183{
src/mame/machine/namcos2.c
r1037r1038
1414#include "cpu/m6805/m6805.h"
1515#include "namcos2.h"
1616
17extern void namcos21_kickstart(int);
18
1719int namcos2_gametype;
1820
1921static unsigned mFinalLapProtCount;
r1037r1038
6668/* Perform basic machine initialisation                      */
6769/*************************************************************/
6870
71#define namcos2_eeprom_size 0x2000
72static UINT8 *namcos2_eeprom;
73
74static void
75ResetAllSubCPUs( int state )
76{
77   cpunum_set_input_line(CPU_SLAVE, INPUT_LINE_RESET, state);
78   cpunum_set_input_line(CPU_MCU, INPUT_LINE_RESET, state);
79   switch( namcos2_gametype )
80   {
81   case NAMCOS21_SOLVALOU:
82   case NAMCOS21_STARBLADE:
83   case NAMCOS21_AIRCOMBAT:
84   case NAMCOS21_CYBERSLED:
85      cpunum_set_input_line(4,INPUT_LINE_RESET,state); /* MASTER DSP */
86      cpunum_set_input_line(5,INPUT_LINE_RESET,state); /* SLAVE DSP */
87      break;
88
89//  case NAMCOS21_WINRUN91:
90//  case NAMCOS21_DRIVERS_EYES:
91   default:
92      break;
93   }
94}
95
6996MACHINE_RESET( namcos2 ){
7097   int loop;
71
7298   mFinalLapProtCount = 0;
7399
74100   /* Initialise the bank select in the sound CPU */
75101   namcos2_sound_bankselect_w(0,0); /* Page in bank 0 */
76102
103   cpunum_set_input_line(CPU_SOUND, INPUT_LINE_RESET, ASSERT_LINE );
104
77105   /* Place CPU2 & CPU3 into the reset condition */
78   cpunum_set_input_line(CPU_SOUND, INPUT_LINE_RESET, ASSERT_LINE);
79   cpunum_set_input_line(CPU_SLAVE, INPUT_LINE_RESET, ASSERT_LINE);
80   cpunum_set_input_line(CPU_MCU, INPUT_LINE_RESET, ASSERT_LINE);
106   ResetAllSubCPUs( ASSERT_LINE );
81107
82108   /* Initialise interrupt handlers */
83   for(loop=0;loop<20;loop++)
109   for(loop=0;loop<0x20;loop++)
84110   {
85111      namcos2_68k_master_C148[loop]=0;
86112      namcos2_68k_slave_C148[loop]=0;
113      namcos2_68k_gpu_C148[loop]=0;
87114   }
88115}
89116
r1037r1038
91118/* EEPROM Load/Save and read/write handling                  */
92119/*************************************************************/
93120
94UINT16 *namcos2_eeprom;
95size_t namcos2_eeprom_size;
96
97121NVRAM_HANDLER( namcos2 )
98122{
123   if( !namcos2_eeprom )
124   {
125      if( !namcos2_eeprom )
126      {
127         namcos2_eeprom = auto_malloc(namcos2_eeprom_size);
128      }
129   }
99130   if( read_or_write )
100131   {
101132      mame_fwrite( file, namcos2_eeprom, namcos2_eeprom_size );
r1037r1038
119150}
120151
121152WRITE16_HANDLER( namcos2_68k_eeprom_w ){
122   COMBINE_DATA( &namcos2_eeprom[offset] );
153   if( ACCESSING_LSB )
154   {
155      namcos2_eeprom[offset] = data;
156   }
123157}
124158
125159READ16_HANDLER( namcos2_68k_eeprom_r ){
r1037r1038
411445
412446UINT16  namcos2_68k_master_C148[0x20];
413447UINT16  namcos2_68k_slave_C148[0x20];
448UINT16  namcos2_68k_gpu_C148[0x20];
414449
415450static UINT16
416451ReadWriteC148( int cpu, offs_t offset, UINT16 data, int bWrite )
417452{
418453   offs_t addr = ((offset*2)+0x1c0000)&0x1fe000;
419   UINT16 *pC148Reg   = (cpu==CPU_MASTER)?namcos2_68k_master_C148:namcos2_68k_slave_C148;
420   UINT16 *pC148RegAlt = (cpu==CPU_SLAVE)?namcos2_68k_master_C148:namcos2_68k_slave_C148;
421   UINT16 result = pC148Reg[(addr>>13)&0x1f];
422   int altCPU = (cpu==CPU_MASTER)?CPU_SLAVE:CPU_MASTER;
454   UINT16 *pC148Reg = NULL;
455   UINT16 *pC148RegAlt = NULL;
456   UINT16 result = 0;
457   int altCPU = 0;
423458
459   switch( cpu )
460   {
461   case CPU_MASTER:
462      pC148Reg = namcos2_68k_master_C148;
463      altCPU = CPU_SLAVE;
464      pC148RegAlt = namcos2_68k_slave_C148;
465      break;
466
467   case CPU_SLAVE:
468      pC148Reg = namcos2_68k_slave_C148;
469      altCPU = CPU_MASTER;
470      pC148RegAlt = namcos2_68k_master_C148;
471      break;
472
473   case CPU_GPU:
474      pC148Reg = namcos2_68k_gpu_C148;
475      altCPU = CPU_MASTER;
476      pC148RegAlt = namcos2_68k_master_C148;
477      break;
478   }
479
424480   if( bWrite )
425481   {
426482      pC148Reg[(addr>>13)&0x1f] = data&0x0007;
r1037r1038
439495
440496   case 0x1d0000:
441497      if( bWrite )
442      { /* DSP "render display list now" trigger */
443      }
444      cpunum_set_input_line(cpu, pC148Reg[NAMCOS2_C148_0], CLEAR_LINE);
498      {
499         cpunum_set_input_line(altCPU, pC148RegAlt[NAMCOS2_C148_CPUIRQ], ASSERT_LINE);
500      }      cpunum_set_input_line(cpu, pC148Reg[NAMCOS2_C148_0], CLEAR_LINE);
445501      break;
446502
447503   case 0x1d2000:
448      if( bWrite )
449      {
450      //  mame_printf_debug( "cpu(%d) RAM[0x%06x] = 0x%x\n", cpu, addr, data );
451      }
452504      cpunum_set_input_line(cpu, pC148Reg[NAMCOS2_C148_1], CLEAR_LINE);
453505      break;
454506
r1037r1038
514566            /* Suspend execution */
515567            cpunum_set_input_line(CPU_SOUND, INPUT_LINE_RESET, ASSERT_LINE);
516568         }
569         if( data&4 )
570         {
571            namcos21_kickstart(1);
572         }
517573      }
518574      break;
519575
r1037r1038
521577      if( cpu == CPU_MASTER ) /* ? */
522578      {
523579         if( data&0x01 )
524         {
525            /* Resume execution */
526            cpunum_set_input_line(altCPU, INPUT_LINE_RESET, CLEAR_LINE);
527            cpunum_set_input_line(CPU_MCU, INPUT_LINE_RESET, CLEAR_LINE);
580         { /* Resume execution */
581            ResetAllSubCPUs( CLEAR_LINE );
528582            /* Give the new CPU an immediate slice of the action */
529583            cpu_yield();
530584         }
531585         else
532         {
533            /* Suspend execution */
534            cpunum_set_input_line(altCPU, INPUT_LINE_RESET, ASSERT_LINE);
535            cpunum_set_input_line(CPU_MCU, INPUT_LINE_RESET, ASSERT_LINE);
586         { /* Suspend execution */
587            ResetAllSubCPUs( ASSERT_LINE );
536588         }
537589      }
538590      break;
r1037r1038
567619   return ReadWriteC148( CPU_SLAVE, offset, 0, 0 );
568620}
569621
622WRITE16_HANDLER( namcos2_68k_gpu_C148_w )
623{
624   (void)ReadWriteC148( CPU_GPU, offset, data, 1 );
625}
626
627READ16_HANDLER( namcos2_68k_gpu_C148_r )
628{
629   return ReadWriteC148( CPU_GPU, offset, 0, 0 );
630}
631
570632static TIMER_CALLBACK( namcos2_68k_master_posirq )
571633{
572634   video_screen_update_partial(0, param);
573635   cpunum_set_input_line(CPU_MASTER , namcos2_68k_master_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE);
574636}
575637
576static int
577GetPosIRQScanline( void )
638static int IsSystem21( void )
578639{
579640   switch( namcos2_gametype )
580641   {
581      case NAMCOS21_AIRCOMBAT:
582      case NAMCOS21_STARBLADE:
583      case NAMCOS21_CYBERSLED:
584      case NAMCOS21_SOLVALOU:
585      case NAMCOS21_WINRUN91:
586      case NAMCOS21_DRIVERS_EYES:
587      return 16; /* ? */
588
589      default:
590      return namcos2_GetPosIrqScanline();
642   case NAMCOS21_AIRCOMBAT:
643   case NAMCOS21_STARBLADE:
644   case NAMCOS21_CYBERSLED:
645   case NAMCOS21_SOLVALOU:
646   case NAMCOS21_WINRUN91:
647   case NAMCOS21_DRIVERS_EYES:
648      return 1;
649   default:
650      return 0;
591651   }
592652}
593653
654static int
655GetPosIRQScanline( void )
656{
657   if( IsSystem21() ) return 0;
658   return namcos2_GetPosIrqScanline();
659}
660
594661INTERRUPT_GEN( namcos2_68k_master_vblank )
595662{
596   if( namcos2_68k_master_C148[NAMCOS2_C148_POSIRQ] )
663   if( IsSystem21()==0 && namcos2_68k_master_C148[NAMCOS2_C148_POSIRQ] )
597664   {
598665      int scanline = GetPosIRQScanline();
599666      mame_timer_set(video_screen_get_time_until_pos(0, scanline, 0), scanline, namcos2_68k_master_posirq );
r1037r1038
609676
610677INTERRUPT_GEN( namcos2_68k_slave_vblank )
611678{
612   if( namcos2_68k_slave_C148[NAMCOS2_C148_POSIRQ] )
679   if( IsSystem21()==0 && namcos2_68k_slave_C148[NAMCOS2_C148_POSIRQ] )
613680   {
614681      int scanline = GetPosIRQScanline();
615682      mame_timer_set(video_screen_get_time_until_pos(0, scanline, 0), scanline, namcos2_68k_slave_posirq );
r1037r1038
617684   cpunum_set_input_line( CPU_SLAVE, namcos2_68k_slave_C148[NAMCOS2_C148_VBLANKIRQ], HOLD_LINE);
618685}
619686
687static TIMER_CALLBACK( namcos2_68k_gpu_posirq )
688{
689   video_screen_update_partial(0, param);
690   cpunum_set_input_line(CPU_GPU, namcos2_68k_gpu_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE);
691}
692
693INTERRUPT_GEN( namcos2_68k_gpu_vblank )
694{
695   if( namcos2_68k_gpu_C148[NAMCOS2_C148_POSIRQ] )
696   {
697      int scanline = 137;//GetPosIRQScanline();
698      mame_timer_set(video_screen_get_time_until_pos(0, scanline, 0), scanline, namcos2_68k_gpu_posirq );
699   }
700   cpunum_set_input_line( CPU_GPU, namcos2_68k_gpu_C148[NAMCOS2_C148_VBLANKIRQ], HOLD_LINE);
701}
702
620703/**************************************************************/
621704/*  Sound sub-system                                          */
622705/**************************************************************/
src/mame/machine/spisprit.c
r1037r1038
4040   return res;
4141}
4242
43static int partial_carry_sum32(int add1,int add2,int carry_mask)
44{
45   return partial_carry_sum(add1,add2,carry_mask,32);
46}
47
48static int partial_carry_sum24(int add1,int add2,int carry_mask)
49{
50   return partial_carry_sum(add1,add2,carry_mask,24);
51}
52
53static int partial_carry_sum16(int add1,int add2,int carry_mask)
54{
55   return partial_carry_sum(add1,add2,carry_mask,16);
56}
57
58static int partial_carry_sum8(int add1,int add2,int carry_mask)
59{
60   return partial_carry_sum(add1,add2,carry_mask,8);
61}
62
63
64
6543/*
6644This is the main key as written by the game.
6745There are 256 values; the one to use is key_table[(address >> 8) & 0xff].
r1037r1038
277255            (key( 8,addr) << 30) |
278256            (key( 0,addr) << 31);
279257
280      s1 = partial_carry_sum16( s1, add1, 0x3a59 ) ^ 0x843a;
281      s2 = partial_carry_sum32( s2, add2, 0x28d49cac ) ^ 0xc8e29f84;
258      s1 = partial_carry_sum( s1, add1, 0x3a59, 16 ) ^ 0x843a;
259      s2 = partial_carry_sum( s2, add2, 0x28d49cac, 32 ) ^ 0xc8e29f84;
282260
283261
284262      // reorder the bits in the order MAME expects to decode the graphics
src/mame/machine/fd1094.c
r1037r1038
1931930068      20 80 06 10  880610  altbeaj3 1988  88/06/10
1941940070      59 80 08 06  880806  passshtj 1988  88/08/06
1951950074      47 80 08 06  880806  passshta 1988  88/08/06
1960071      20 80 08 09  880809  passsht  1988  88/08/09
1961970079      98 80 09 05  880906  exctleag 1988  88/09/05-88/09/06 (atypical)
1971980080      96 80 08 26  880826  passsht  1988  88/08/26
1981990058-02C  FF 80 10 07  881007  sspirtfc 1988  88/10/07
src/mame/machine/snesdsp1.c
r1037r1038
286286// Input    byte(20H) integer(Multiplicand) integer(Multiplier)
287287// Output   integer(Product)
288288
289#ifdef UNUSED_FUNCTION
289290static void DSP1_Multiply1(INT16 Multiplicand, INT16 Multiplier, INT16 *Product)
290291{
291292   *Product = (Multiplicand * Multiplier >> 15) + 1;
292293}
294#endif
293295
294296// 10H - Inverse Calculation (Bit Perfect)
295297// Input    byte(10H) integer(Coefficient) integer(Exponent)
r1037r1038
376378// Input    byte(38H) integer(X) integer(Y) integer(Z) integer(Radius)
377379// Output   integer(Range)
378380
381#ifdef UNUSED_FUNCTION
379382static void DSP1_Range1(INT16 X, INT16 Y, INT16 Z, INT16 Radius, INT16 *Range)
380383{
381384   *Range = ((X * X + Y * Y + Z * Z - Radius * Radius) >> 15) + 1;
382385}
386#endif
383387
384388// 28H - Vector Absolute Value Calculation (Bit Perfect)
385389// Input    byte(28H) integer(X) integer(Y) integer(Z)
r1037r1038
424428// Input    byte(1CH) integer(Az) integer(Ay) integer(Ax) integer(X) integer(Y) integer(Z)
425429// Output   integer(X) integer(Y) integer(Z)
426430
431#ifdef UNUSED_FUNCTION
427432static void DSP1_Polar(INT16 Az, INT16 Ay, INT16 Ax, INT16 X1, INT16 Y1, INT16 Z1, INT16 *X2, INT16 *Y2, INT16 *Z2)
428433{
429434   INT16 X, Y, Z;
r1037r1038
443448   Z = (Z1 * DSP1_Cos(Ax) >> 15) - (Y1 * DSP1_Sin(Ax) >> 15);
444449   *Y2 = Y; *Z2 = Z;
445450}
451#endif
446452
447453// 02H - Projection Parameter Setting (Bit Perfect)
448454// Input    byte(02H) integer(Fx) integer(Fy) integer(Fz) integer(Lfe) integer(Les) integer(Aas) integer(Azs)
r1037r1038
749755
750756static INT16 MatrixC[3][3];
751757
758#ifdef UNUSED_FUNCTION
752759static void DSP1_Attitude_C(INT16 M, INT16 Az, INT16 Ay, INT16 Ax)
753760{
754761   INT16 SinAz = DSP1_Sin(Az);
r1037r1038
772779   MatrixC[2][1] = ((M * CosAz >> 15) * SinAx >> 15) + (((M * SinAz >> 15) * CosAx >> 15) * SinAy >> 15);
773780   MatrixC[2][2] = (M * CosAx >> 15) * CosAy >> 15;
774781}
782#endif
775783
776784// 0DH - Convert from Global to Object Coordinates A (Bit Perfect)
777785// Input    byte(0DH) integer(X) integer(Y) integer(Z)
src/mame/mamedriv.c
r1037r1038
240240   DRIVER( scramble )   /* GX387 (c) 1981 Konami */
241241   DRIVER( scrambls )   /* GX387 (c) 1981 Stern */
242242   DRIVER( scramblb )   /* bootleg */
243   DRIVER( scramb2 )   /* bootleg */
243244   DRIVER( explorer )   /* bootleg */
244245   DRIVER( strfbomb )   /* bootleg */
245246   DRIVER( atlantis )   /* (c) 1981 Comsoft */
r1037r1038
823824   DRIVER( aircombj )   /* (c) 1992 (Japan) */
824825   DRIVER( aircombu )   /* (c) 1992 (US) */
825826   DRIVER( cybsled )   /* (c) 1993 */
827   DRIVER( cybsledj )   /* (c) 1993 */
826828
827829   /* Namco System 22 games */
828830   DRIVER( ridgerac )   /* (c) 1993 */
r1037r1038
933935   DRIVER( dkong3j )   /* (c) 1983 Nintendo */
934936   DRIVER( dkong3b )   /* bootleg */
935937   DRIVER( mario )      /* (c) 1983 Nintendo of America */
936   DRIVER( mariojp )   /* (c) 1983 Nintendo */
938   DRIVER( marioo )   /* (c) 1983 Nintendo of America */
939   DRIVER( marioj )   /* (c) 1983 Nintendo */
937940   DRIVER( masao )      /* bootleg */
938941   DRIVER( pestplce )   /* bootleg on donkey kong hw */
939942   DRIVER( spclforc )   /* (c) 1985 Senko Industries (Magic Eletronics Inc. licence) */
r1037r1038
13921395   DRIVER( dkgensan )   /* (c) 1990 (Japan) */
13931396   DRIVER( dkgenm72 )   /* (c) 1990 (Japan) */
13941397   DRIVER( poundfor )   /* (c) 1990 (World) */
1398   DRIVER( poundfoj )   /* (c) 1990 (Japan) */
13951399   DRIVER( poundfou )   /* (c) 1990 Irem America (US) */
13961400   DRIVER( airduel )   /* (c) 1990 (Japan) */
13971401   DRIVER( cosmccop )   /* (c) 1991 (World) */
r1037r1038
15531557   DRIVER( fightrol )   /* (c) 1983 Taito */
15541558   DRIVER( rollace )   /* (c) 1983 Williams */
15551559   DRIVER( rollace2 )   /* (c) 1983 Williams */
1560   DRIVER( lgp )      /* (c) 1983 Taito */
15561561   DRIVER( vsgongf )   /* (c) 1984 Kaneko */
15571562   DRIVER( ringfgt )   /* (c) 1984 Taito */
15581563   DRIVER( ringfgt2 )   /* (c) 1984 Taito */
r1037r1038
15721577   DRIVER( buggycht )   /* A22 (c) 1984 Taito Corporation + Tefri license */
15731578   DRIVER( ssrj )      /* A40 (c) 1985 Taito Corporation */
15741579   DRIVER( bigevglf )   /* A67 (c) 1986 Taito America Corporation (US) */
1580   DRIVER( bigevglj )   /* A67 (c) 1986 Taito Corporation (Japan) */
15751581   DRIVER( flstory )   /* A45 (c) 1985 Taito Corporation */
15761582   DRIVER( flstoryj )   /* A45 (c) 1985 Taito Corporation (Japan) */
15771583   DRIVER( onna34ro )   /* A52 (c) 1985 Taito Corporation (Japan) */
r1037r1038
17481754   DRIVER( champwrj )   /* C01 (c) 1989 Taito Corporation (Japan) */
17491755   DRIVER( puzznic )   /* C20 (c) 1989 Taito Corporation (Japan) */
17501756   DRIVER( puzznicj )   /* C20 (c) 1989 Taito Corporation (Japan) */
1757   DRIVER( puzznici )   /* C20 (c) 1989 Taito Corporation (Japan) */
17511758   DRIVER( horshoes )   /* C47 (c) 1990 Taito America Corporation (US) */
17521759   DRIVER( palamed )   /* C63 (c) 1990 Taito Corporation (Japan) */
17531760   DRIVER( cachat )   /* ??? (c) 1993 Taito Corporation (Japan) */
r1037r1038
18021809   DRIVER( nightstr )   /* B91 (c) 1989 Taito America Corporation (US) */
18031810   DRIVER( sci )      /* C09 (c) 1989 Taito Corporation Japan (World) */
18041811   DRIVER( scia )      /* C09 (c) 1989 Taito Corporation Japan (World) */
1812   DRIVER( scij )      /* C09 (c) 1989 Taito Corporation Japan (World) */
18051813   DRIVER( sciu )      /* C09 (c) 1989 Taito America Corporation (US) */
18061814   DRIVER( bshark )   /* C34 (c) 1989 Taito America Corporation (US) */
18071815   DRIVER( bsharkj )   /* C34 (c) 1989 Taito Corporation (Japan) */
r1037r1038
33413349   DRIVER( tetris3 )   /* (c) 1988 (FD1094, decrypted) S16A */
33423350   DRIVER( timesca1 )   /* (c) 1987 (FD1089B, decrypted) */
33433351   DRIVER( wb31 )      /* (c) 1988 Sega / Westone (FD1094, decrypted) */
3352   DRIVER( pshot16a )   /* (c) 1988 */
33443353
33453354   /* System 16B */
33463355   DRIVER( aceattac )   /* (c) 1988 (protected) */
r1037r1038
34223431   DRIVER( fpointbl )   /* (c) 1989 (Datsu bootleg) */
34233432   DRIVER( fpointbj )   /* (c) 1989 (Datsu bootleg, Japan) */
34243433   DRIVER( goldnabl )   /* BOOTLEG  */
3434   DRIVER( goldnab2 )   /* BOOTLEG  */
34253435   DRIVER( passht4b )   /* bootleg */
34263436   DRIVER( passshtb )   /* bootleg */
34273437   DRIVER( shinobl )   /* (c) 1987 (but bootleg) */
r1037r1038
34573467
34583468   /* System18 Bootlegs */
34593469   DRIVER( astormbl )   /* BOOTLEG */
3470   DRIVER( astormb2 )   /* BOOTLEG */
34603471   DRIVER( shdancbl )   /* BOOTLEG */
34613472   DRIVER( mwalkbl )   /* BOOTLEG */
34623473
r1037r1038
40204031   DRIVER( prosoccr )   /* (c) 1983 */
40214032   DRIVER( prosport )   /* (c) 1983 */
40224033   DRIVER( boomrang )   /* (c) 1983 */
4034   DRIVER( boomrana )   /* (c) 1983 */
40234035   DRIVER( kamikcab )   /* (c) 1984 */
40244036   DRIVER( yellowcb )   /* bootleg */
40254037   DRIVER( liberate )   /* (c) 1984  Data East Corporation */
r1037r1038
40674079   DRIVER( spool3i )   /* (c) 1990 Data East Corporation + I-Vics license */
40684080   DRIVER( battlera )   /* (c) 1988 Data East Corporation (World) */
40694081   DRIVER( bldwolf )   /* (c) 1988 Data East USA (US) */
4082   DRIVER( bldwolfj )   /* (c) 1988 Data East Corporation (Japan) */
40704083   DRIVER( actfancr )   /* (c) 1989 Data East Corporation (World) */
40714084   DRIVER( actfanc1 )   /* (c) 1989 Data East Corporation (World) */
40724085   DRIVER( actfancj )   /* (c) 1989 Data East Corporation (Japan) */
r1037r1038
61016114   DRIVER( zeroteam )   /* (c) 1993 Seibu Kaihatsu */
61026115   DRIVER( zeroteaa )   /* (c) 1993 Seibu Kaihatsu */
61036116   DRIVER( zeroteab )   /* (c) 1993 Seibu Kaihatsu */
6117   DRIVER( zerotsel )   /* (c) 1993 Seibu Kaihatsu */
61046118   DRIVER( nzerotea )   /* (c) 1993 Seibu Kaihatsu */
61056119
61066120   /* Seibu SPI System games */
r1037r1038
65756589   DRIVER( myangel2 )   /* (c) 1997 Namco */
65766590   DRIVER( pzlbowl )   /* (c) 1999 Nihon System / Moss */
65776591   DRIVER( penbros )   /* (c) 2000 Subsino */
6592   DRIVER( deerhunt )   /* (c) 2000 Sammy USA Corporation */
6593   DRIVER( deerhuna )   /* (c) 2000 Sammy USA Corporation */
6594   DRIVER( deerhunb )   /* (c) 2000 Sammy USA Corporation */
6595   DRIVER( turkhunt )   /* (c) 2001 Sammy USA Corporation */
6596   DRIVER( wschamp )   /* (c) 2001 Sammy USA Corporation */
6597   DRIVER( wschampa )   /* (c) 2001 Sammy USA Corporation */
6598   DRIVER( trophyh )   /* (c) 2002 Sammy USA Corporation */
65786599
65796600   /* SSV System (Seta, Sammy, Visco) games */
65806601   DRIVER( srmp4 )      /* (c) 1993 Seta */
r1037r1038
69096930   DRIVER( tangtang )   /* (c) 2000 ESD */
69106931
69116932   /* Dyna Electronics / Dynax / Nakanihon games */
6912   DRIVER( royalmah )   /* (c) 1982 Falcon */
6933   DRIVER( royalmj )   /* (c) 1982 Nichibutsu */
6934   DRIVER( openmj )   /* (c) 1982 Nichibutsu */
6935   DRIVER( royalmah )   /* Falcon bootleg */
69136936   DRIVER( suzume )   /*  ??  (c) 1986 Dyna Electronics */
69146937   DRIVER( hnayayoi )   /* "02" (c) 1987 Dyna Electronics */
69156938   DRIVER( dondenmj )   /* "03" (c) 1986 Dyna Electronics */
6939   DRIVER( ippatsu )   /*  ??  (c) 1986 Dyna Electronics */
69166940   DRIVER( hnfubuki )   /* "06" (c) 1987 Dynax */
69176941   DRIVER( mjdiplob )   /* "07" (c) 1987 Dynax */
69186942   DRIVER( untoucha )   /* "08" (c) 1987 Dynax */
r1037r1038
69286952   DRIVER( jantouki )   /* "27" Jantouki 1989 Dynax */
69296953   DRIVER( mjifb )      /* "29" 1990 Dynax */
69306954   DRIVER( cafetime )   /* 1992 Dynax */
6955   DRIVER( cafedoll )   /* 1993 Dynax */
69316956   DRIVER( janptr96 )   /* 1996 Dynax */
69326957   DRIVER( sprtmtch )   /* "31" (c) 1989 Dynax + Fabtek license */
69336958   DRIVER( maya )      /* (c) 1994 Promat */
r1037r1038
69666991   DRIVER( mjtensin )   /* "100" 1995 Dynax */
69676992   DRIVER( nettoqc )   /* "103" (c) 1995 Nakanihon */
69686993   DRIVER( majrjhdx )   /* "105" 1996 Dynax */
6994   DRIVER( ddenlvrj )   /* "113" (c) 1996 Dynax */
69696995   DRIVER( ddenlovr )   /* "113" (c) 1996 Dynax */
6996   DRIVER( ddenlovb )   /* bootleg */
69706997   DRIVER( hanakanz )   /* "507" 1996 Dynax */
6998   DRIVER( akamaru )   /* "501" 1996 Dynax */
69716999   DRIVER( hkagerou )   /* "510" Hana Kagerou 1996 Nakanihon */
69727000   DRIVER( realbrk )   /* "600" Billiard Academy Real Break 1998 (Europe)*/
69737001   DRIVER( realbrkk )   /* "600" Billiard Academy Real Break 1998 (Korea)*/
r1037r1038
74697497   DRIVER( crgolfa )   /* (c) 1984 Nasco Japan */
74707498   DRIVER( crgolfb )   /* (c) 1984 Nasco Japan */
74717499   DRIVER( crgolfc )   /* (c) 1984 Nasco Japan */
7500   DRIVER( crgolfbt )   /* bootleg */
74727501   DRIVER( crgolfhi )   /* (c) 1984 Nasco Japan */
74737502   DRIVER( truco )      /* (c) 198? Playtronic SRL */
74747503   DRIVER( thedeep )   /* (c) 1987 Woodplace */
r1037r1038
76327661   DRIVER( monglfir )   /* 199? bootleg */
76337662   DRIVER( soccernw )   /* 199? bootleg */
76347663   DRIVER( snookr10 )   /* (c) 1998 Sandiy */
7664   DRIVER( saloon )   /* 199? unknown */
76357665   DRIVER( vroulet )   /* (c) 1989 World Game */
76367666   DRIVER( rcasino )   /* (c) 1984 Dyna Electronics */
76377667   DRIVER( cmv801 )   /* (c) 198? Corsica */
src/mame/includes/namcos21.h
r1037r1038
55#define NAMCOS21_POLY_FRAME_WIDTH 496
66#define NAMCOS21_POLY_FRAME_HEIGHT 480
77
8/*----------- defined in drivers/namcos21.c -----------*/
8extern void namcos21_ClearPolyFrameBuffer( void );
9extern void namcos21_DrawQuad( int sx[4], int sy[4], int zcode[4], int color );
910
10extern UINT16 *namcos21_dspram16;
11extern READ16_HANDLER(winrun_gpu_color_r);
12extern WRITE16_HANDLER(winrun_gpu_color_w);
1113
12/*----------- defined in video/namcos21.c -----------*/
14extern READ16_HANDLER(winrun_gpu_videoram_r);
15extern WRITE16_HANDLER(winrun_gpu_videoram_w);
1316
14extern void namcos21_ClearPolyFrameBuffer( void );
15extern void namcos21_DrawQuad( int sx[4], int sy[4], int zcode[4], int color );
17extern READ16_HANDLER(winrun_gpu_register_r);
18extern WRITE16_HANDLER(winrun_gpu_register_w);
1619
17VIDEO_START( namcos21 );
18VIDEO_UPDATE( namcos21_default );
19VIDEO_UPDATE( namcos21_winrun );
20
20extern VIDEO_START( namcos21 ) ;
21extern VIDEO_UPDATE( namcos21 );
src/mame/includes/namcos2.h
r1037r1038
1212#define CPU_SLAVE   1
1313#define CPU_SOUND   2
1414#define CPU_MCU    3
15#define CPU_GPU    4
15#define CPU_GPU    5
1616
1717
1818/*********************************************/
r1037r1038
149149NVRAM_HANDLER( namcos2 );
150150WRITE16_HANDLER( namcos2_68k_eeprom_w );
151151READ16_HANDLER( namcos2_68k_eeprom_r );
152extern UINT16 *namcos2_eeprom;
153extern size_t namcos2_eeprom_size;
154152
155153/**************************************************************/
156154/*  Shared data ROM memory handlerhandlers                    */
r1037r1038
189187
190188extern UINT16 namcos2_68k_master_C148[];
191189extern UINT16 namcos2_68k_slave_C148[];
190extern UINT16 namcos2_68k_gpu_C148[];
192191
193192WRITE16_HANDLER( namcos2_68k_master_C148_w );
194193READ16_HANDLER( namcos2_68k_master_C148_r );
r1037r1038
198197READ16_HANDLER( namcos2_68k_slave_C148_r );
199198INTERRUPT_GEN( namcos2_68k_slave_vblank );
200199
200WRITE16_HANDLER( namcos2_68k_gpu_C148_w );
201READ16_HANDLER( namcos2_68k_gpu_C148_r );
202INTERRUPT_GEN( namcos2_68k_gpu_vblank );
203
201204/**************************************************************/
202205/* MASTER CPU RAM MEMORY                                      */
203206/**************************************************************/
src/mame/includes/srmp6.h
r0r1038
1
2
3
4/* vidhrdw/srmp6.c */
5
6extern UINT16 *sprite_ram;   // Sprite RAM 0x400000-0x47dfff
7extern UINT16 *dec_regs;   //Graphic decode register
8
9extern UINT16 *video_regs;
10extern gfx_layout srmp6_layout_8x8;
11
12READ16_HANDLER( video_regs_r );
13WRITE16_HANDLER( video_regs_w );
14
15WRITE16_HANDLER( gfx_decode_w );
16
17READ16_HANDLER( srmp6_sprite_r );
18WRITE16_HANDLER( srmp6_sprite_w );
19
20VIDEO_START(srmp6);
21VIDEO_UPDATE(srmp6);
src/mame/includes/genesis.h
r1037r1038
3333extern READ8_HANDLER ( genesis_z80_bank_r );
3434extern WRITE8_HANDLER ( genesis_z80_w );
3535extern WRITE16_HANDLER(genesis_ctrl_w);
36extern WRITE16_HANDLER ( megaplay_68k_to_z80_w );
36extern WRITE16_HANDLER ( genesis_68k_to_z80_w );
3737extern READ16_HANDLER ( genesis_io_r );
3838extern READ16_HANDLER ( genesis_68k_to_z80_r );
3939extern INTERRUPT_GEN( genesis_vblank_interrupt );
src/mame/mame.mak
r1037r1038
11891189   $(DRIVERS)/segas16b.o $(VIDEO)/segas16b.o \
11901190   $(DRIVERS)/segas18.o $(VIDEO)/segas18.o \
11911191   $(DRIVERS)/segas32.o $(MACHINE)/segas32.o $(VIDEO)/segas32.o \
1192   $(DRIVERS)/segae.o $(DRIVERS)/segasyse.o $(VIDEO)/segasyse.o \
1192   $(DRIVERS)/segae.o $(VIDEO)/segasyse.o \
11931193   $(DRIVERS)/segaxbd.o $(VIDEO)/segaxbd.o \
11941194   $(DRIVERS)/segaybd.o $(VIDEO)/segaybd.o \
11951195   $(DRIVERS)/ssf2md.o \
r1037r1038
12491249   $(DRIVERS)/speglsht.o \
12501250   $(DRIVERS)/speedatk.o $(VIDEO)/speedatk.o \
12511251   $(DRIVERS)/srmp2.o $(VIDEO)/srmp2.o \
1252   $(DRIVERS)/srmp6.o \
1252   $(DRIVERS)/srmp5.o \
1253   $(DRIVERS)/srmp6.o $(VIDEO)/srmp6.o \
12531254   $(DRIVERS)/ssv.o $(VIDEO)/ssv.o \
12541255   $(DRIVERS)/st0016.o $(VIDEO)/st0016.o \
12551256
r1037r1038
13331334   $(DRIVERS)/halleys.o \
13341335   $(DRIVERS)/jollyjgr.o \
13351336   $(DRIVERS)/ksayakyu.o $(VIDEO)/ksayakyu.o \
1337   $(DRIVERS)/lgp.o \
13361338   $(DRIVERS)/lkage.o $(MACHINE)/lkage.o $(VIDEO)/lkage.o \
13371339   $(DRIVERS)/lsasquad.o $(MACHINE)/lsasquad.o $(VIDEO)/lsasquad.o \
13381340   $(DRIVERS)/marinedt.o \
r1037r1038
15641566   $(DRIVERS)/fortecar.o \
15651567   $(DRIVERS)/freekick.o $(VIDEO)/freekick.o \
15661568   $(DRIVERS)/funworld.o $(VIDEO)/funworld.o \
1567   $(DRIVERS)/gdrawpkr.o \
1569   $(DRIVERS)/gdrawpkr.o $(VIDEO)/gdrawpkr.o \
15681570   $(DRIVERS)/go2000.o \
15691571   $(DRIVERS)/good.o \
15701572   $(DRIVERS)/gotcha.o $(VIDEO)/gotcha.o \
r1037r1038
17281730                  $(LAYOUT)/subroc3d.lh \
17291731                  $(LAYOUT)/buckrog.lh
17301732
1733$(DRIVERS)/videopin.o:   $(LAYOUT)/videopin.lh
1734
17311735$(DRIVERS)/warpwarp.o:   $(LAYOUT)/geebee.lh \
17321736                  $(LAYOUT)/sos.lh
17331737
src/mame/video/deco_mlc.c
r1037r1038
3333   mlc_buffered_spriteram = auto_malloc(0x3000);
3434}
3535
36#ifdef UNUSED_FUNCTION
3637static void blitRaster(mame_bitmap *bitmap, int rasterMode)
3738{
38#if 0
3939   int x,y;
4040   for (y=0; y<256; y++) //todo
4141   {
r1037r1038
5959         //  xptr+=0x10000 + (mlc_raster_table[0][y]<<5);
6060      }
6161   }
62}
6263#endif
63}
6464
6565static void mlc_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
6666      UINT32 code1,UINT32 code2, UINT32 color,int flipx,int flipy,int sx,int sy,
src/mame/video/voodoo.c
r1037r1038
404404 *
405405 *************************************/
406406
407void voodoo_update(int which, mame_bitmap *bitmap, const rectangle *cliprect)
407int voodoo_update(int which, mame_bitmap *bitmap, const rectangle *cliprect)
408408{
409409   voodoo_state *v = voodoo[which];
410   int changed = v->fbi.video_changed;
410411   int drawbuf = v->fbi.frontbuf;
411412   int statskey;
412413   int x, y;
413414
415   /* reset the video changed flag */
416   v->fbi.video_changed = FALSE;
417
414418   /* if we are blank, just fill with black */
415419   if (v->type <= VOODOO_2 && FBIINIT1_SOFTWARE_BLANK(v->reg[fbiInit1].u))
416420   {
417421      fillbitmap(bitmap, 0, cliprect);
418      return;
422      return changed;
419423   }
420424
421425   /* if the CLUT is dirty, recompute the pens array */
r1037r1038
487491
488492      /* no longer dirty */
489493      v->fbi.clut_dirty = FALSE;
494      changed = TRUE;
490495   }
491496
492497   /* debugging! */
r1037r1038
496501   /* copy from the current front buffer */
497502   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
498503   {
499      UINT16 *src = v->fbi.rgb[drawbuf] + y * v->fbi.rowpixels;
504      UINT16 *src = v->fbi.rgb[drawbuf] + (y - v->fbi.yoffs) * v->fbi.rowpixels - v->fbi.xoffs;
500505      UINT32 *dst = BITMAP_ADDR32(bitmap, y, 0);
501506      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
502507         dst[x] = v->fbi.pen[src[x]];
r1037r1038
518523   {
519524      for (y = cliprect->min_y; y <= cliprect->max_y; y++)
520525      {
521         UINT16 *src = v->fbi.aux + y * v->fbi.rowpixels;
526         UINT16 *src = v->fbi.aux + (y - v->fbi.yoffs) * v->fbi.rowpixels - v->fbi.xoffs;
522527         UINT32 *dst = BITMAP_ADDR32(bitmap, y, 0);
523528         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
524529            dst[x] = ((src[x] << 8) & 0xff0000) | ((src[x] >> 0) & 0xff00) | ((src[x] >> 8) & 0xff);
525530      }
526531   }
532   return changed;
527533}
528534
529535
r1037r1038
869875
870876   /* force a partial update */
871877   video_screen_update_partial(v->scrnum, video_screen_get_vpos(v->scrnum));
878   v->fbi.video_changed = TRUE;
872879
873880   /* keep a history of swap intervals */
874881   count = v->fbi.vblank_count;
r1037r1038
974981
975982static void adjust_vblank_timer(voodoo_state *v)
976983{
977   mame_time vblank_period = video_screen_get_time_until_pos(v->scrnum, v->fbi.height, 0);
984   mame_time vblank_period = video_screen_get_time_until_pos(v->scrnum, v->fbi.vsyncscan, 0);
978985
979986   /* if zero, adjust to next frame, otherwise we may get stuck in an infinite loop */
980987   if (compare_mame_times(vblank_period, time_zero) == 0)
r1037r1038
24742481         }
24752482         break;
24762483
2477      /* video dimensions -- Voodoo/Voodoo2 only */
2478      case videoDimensions:
2479         if (v->type <= VOODOO_2 && (chips & 1))
2480         {
2481            rectangle visarea;
2482            if (data & 0x3ff)
2483               v->fbi.width = data & 0x3ff;
2484            if (data & 0x3ff0000)
2485               v->fbi.height = (data >> 16) & 0x3ff;
2486            visarea.min_x = visarea.min_y = 0;
2487            visarea.max_x = v->fbi.width - 1;
2488            visarea.max_y = v->fbi.height - 1;
2489            video_screen_configure(v->scrnum, v->fbi.width, v->fbi.height, &visarea, Machine->screen[v->scrnum].refresh);
2490            adjust_vblank_timer(v);
2491            recompute_video_memory(v);
2492         }
2493         break;
2494
24952484      /* vertical sync rate -- Voodoo/Voodoo2 only */
24962485      case hSync:
24972486      case vSync:
2487      case backPorch:
2488      case videoDimensions:
24982489         if (v->type <= VOODOO_2 && (chips & 1))
24992490         {
25002491            v->reg[regnum].u = data;
2501            if (v->reg[hSync].u != 0 && v->reg[vSync].u != 0)
2492            if (v->reg[hSync].u != 0 && v->reg[vSync].u != 0 && v->reg[videoDimensions].u != 0)
25022493            {
2503               int vtotal = (v->reg[vSync].u >> 16) + (v->reg[vSync].u & 0xffff);
2504               subseconds_t stdperiod = HZ_TO_SUBSECONDS(15750) * vtotal, stddiff = stdperiod - Machine->screen[0].refresh;
2505               subseconds_t medperiod = HZ_TO_SUBSECONDS(25000) * vtotal, meddiff = medperiod - Machine->screen[0].refresh;
2506               subseconds_t vgaperiod = HZ_TO_SUBSECONDS(31500) * vtotal, vgadiff = vgaperiod - Machine->screen[0].refresh;
2507               screen_state *state = &Machine->screen[0];
2494               int htotal = ((v->reg[hSync].u >> 16) & 0x3ff) + 1 + (v->reg[hSync].u & 0xff) + 1;
2495               int vtotal = ((v->reg[vSync].u >> 16) & 0xfff) + (v->reg[vSync].u & 0xfff);
2496               int hvis = v->reg[videoDimensions].u & 0x3ff;
2497               int vvis = (v->reg[videoDimensions].u >> 16) & 0x3ff;
2498               int hbp = (v->reg[backPorch].u & 0xff) + 2;
2499               int vbp = (v->reg[backPorch].u >> 16) & 0xff;
2500               screen_state *state = &Machine->screen[v->scrnum];
2501               subseconds_t stdperiod, medperiod, vgaperiod;
2502               subseconds_t stddiff, meddiff, vgadiff;
2503               rectangle visarea;
25082504
2505               /* create a new visarea */
2506               visarea.min_x = hbp;
2507               visarea.max_x = hbp + hvis - 1;
2508               visarea.min_y = vbp;
2509               visarea.max_y = vbp + vvis - 1;
2510
2511               /* keep within bounds */
2512               visarea.max_x = MIN(visarea.max_x, htotal - 1);
2513               visarea.max_y = MIN(visarea.max_y, vtotal - 1);
2514
2515               /* compute the new period for standard res, medium res, and VGA res */
2516               stdperiod = HZ_TO_SUBSECONDS(15750) * vtotal;
2517               medperiod = HZ_TO_SUBSECONDS(25000) * vtotal;
2518               vgaperiod = HZ_TO_SUBSECONDS(31500) * vtotal;
2519
2520               /* compute a diff against the current refresh period */
2521               stddiff = stdperiod - state->refresh;
25092522               if (stddiff < 0) stddiff = -stddiff;
2523               meddiff = medperiod - state->refresh;
25102524               if (meddiff < 0) meddiff = -meddiff;
2525               vgadiff = vgaperiod - state->refresh;
25112526               if (vgadiff < 0) vgadiff = -vgadiff;
25122527
2528               mame_printf_debug("hSync=%08X  vSync=%08X  backPorch=%08X  videoDimensions=%08X\n",
2529                  v->reg[hSync].u, v->reg[vSync].u, v->reg[backPorch].u, v->reg[videoDimensions].u);
2530               mame_printf_debug("Horiz: %d-%d (%d total)  Vert: %d-%d (%d total) -- ", visarea.min_x, visarea.max_x, htotal, visarea.min_y, visarea.max_y, vtotal);
2531
2532               /* configure the screen based on which one matches the closest */
25132533               if (stddiff < meddiff && stddiff < vgadiff)
2514                  video_screen_configure(v->scrnum, state->width, state->height, &state->visarea, stdperiod);
2534               {
2535                  video_screen_configure(v->scrnum, htotal, vtotal, &visarea, stdperiod);
2536                  mame_printf_debug("Standard resolution, %f Hz\n", SUBSECONDS_TO_HZ(stdperiod));
2537               }
25152538               else if (meddiff < vgadiff)
2516                  video_screen_configure(v->scrnum, state->width, state->height, &state->visarea, medperiod);
2539               {
2540                  video_screen_configure(v->scrnum, htotal, vtotal, &visarea, medperiod);
2541                  mame_printf_debug("Medium resolution, %f Hz\n", SUBSECONDS_TO_HZ(medperiod));
2542               }
25172543               else
2518                  video_screen_configure(v->scrnum, state->width, state->height, &state->visarea, vgaperiod);
2544               {
2545                  video_screen_configure(v->scrnum, htotal, vtotal, &visarea, vgaperiod);
2546                  mame_printf_debug("VGA resolution, %f Hz\n", SUBSECONDS_TO_HZ(vgaperiod));
2547               }
2548
2549               /* configure the new framebuffer info */
2550               v->fbi.width = hvis;
2551               v->fbi.height = vvis;
2552               v->fbi.xoffs = hbp;
2553               v->fbi.yoffs = vbp;
2554               v->fbi.vsyncscan = (v->reg[vSync].u >> 16) & 0xfff;
2555
2556               /* recompute the time of VBLANK */
2557               adjust_vblank_timer(v);
2558
2559               /* if changing dimensions, update video memory layout */
2560               if (regnum == videoDimensions)
2561                  recompute_video_memory(v);
25192562            }
25202563         }
25212564         break;
r1037r1038
25492592         {
25502593            v->reg[regnum].u = data;
25512594            recompute_video_memory(v);
2595            v->fbi.video_changed = TRUE;
25522596         }
25532597         break;
25542598
r1037r1038
29873031      case 0:         /* front buffer */
29883032         dest = v->fbi.rgb[v->fbi.frontbuf];
29893033         destmax = v->fbi.rgbmax[v->fbi.frontbuf];
3034         v->fbi.video_changed = TRUE;
29903035         break;
29913036
29923037      case 1:         /* back buffer */
r1037r1038
45274572   {
45284573      case 0:      /* front buffer */
45294574         drawbuf = v->fbi.rgb[v->fbi.frontbuf];
4575         v->fbi.video_changed = TRUE;
45304576         break;
45314577
45324578      case 1:      /* back buffer */
src/mame/video/voodoo.h
r1037r1038
1818};
1919
2020void voodoo_start(int which, int scrnum, int type, int fbmem_in_mb, int tmem0_in_mb, int tmem1_in_mb);
21void voodoo_update(int which, mame_bitmap *bitmap, const rectangle *cliprect);
21int voodoo_update(int which, mame_bitmap *bitmap, const rectangle *cliprect);
2222void voodoo_reset(int which);
2323int voodoo_get_type(int which);
2424int voodoo_is_stalled(int which);
src/mame/video/seibuspi.c
r1037r1038
536536   }
537537}
538538
539#ifdef UNUSED_FUNCTION
539540static void set_rowscroll(tilemap *layer, int scroll, INT16* rows)
540541{
541542   int i;
r1037r1038
555556   tilemap_set_scrollx(layer, 0, x);
556557   tilemap_set_scrolly(layer, 0, y);
557558}
559#endif
558560
559561
560562static void combine_tilemap(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, tilemap *tile, int x, int y, int opaque, INT16 *rowscroll)
src/mame/video/gdrawpkr.c
r0r1038
1/**********************************************************************************
2
3    GAMING DRAW POKER (CEI)
4    Driver by Roberto Fresca.
5
6    Video Hardware
7
8***********************************************************************************/
9
10#include "driver.h"
11static tilemap *bg_tilemap;
12
13WRITE8_HANDLER( gdrawpkr_videoram_w )
14{
15   videoram[offset] = data;
16   tilemap_mark_tile_dirty(bg_tilemap, offset);
17}
18
19WRITE8_HANDLER( gdrawpkr_colorram_w )
20{
21   colorram[offset] = data;
22   tilemap_mark_tile_dirty(bg_tilemap, offset);
23}
24
25static TILE_GET_INFO( get_bg_tile_info )
26{
27/*  - bits -
28    7654 3210
29    --xx xx--   tiles color.
30    ---- --x-   tiles bank.
31    xx-- ---x   seems unused. */
32
33   int attr = colorram[tile_index];
34   int code = videoram[tile_index];
35   int bank = (attr & 0x02) >> 1;   /* bit 1 switch the gfx banks */
36   int color = (attr & 0x3c);   /* bits 2-3-4-5 for color */
37
38   if (attr == 0x3a)   /* Is the palette wrong? */
39      color = 0x3b;   /* 0x3b is the best match */
40
41   SET_TILE_INFO(bank, code, color, 0);
42}
43
44VIDEO_START( gdrawpkr )
45{
46   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
47      TILEMAP_TYPE_PEN, 8, 8, 32, 31);
48}
49
50VIDEO_UPDATE( gdrawpkr )
51{
52   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
53   return 0;
54}
55
56PALETTE_INIT( gdrawpkr )
57{
58/*  prom bits
59    7654 3210
60    ---- ---x   red component.
61    ---- --x-   green component.
62    ---- -x--   blue component.
63    ---- x---   unknown, aparently unused.
64    xxxx ----   unused.
65*/
66   int i;
67
68   /* 00000BGR */
69   if (color_prom == 0) return;
70
71   for (i = 0;i < machine->drv->total_colors;i++)
72   {
73      int bit0, bit1, bit2, r, g, b;
74
75      /* red component */
76      bit0 = (color_prom[i] >> 0) & 0x01;
77      r = bit0 * 0xff;
78
79      /* green component */
80      bit1 = (color_prom[i] >> 1) & 0x01;
81      g = bit1 * 0xff;
82
83      /* blue component */
84      bit2 = (color_prom[i] >> 2) & 0x01;
85      b = bit2 * 0xff;
86
87
88      palette_set_color(machine, i, MAKE_RGB(r, g, b));
89   }
90}
src/mame/video/model2.c
r1037r1038
2020   float z;
2121   int luminance;
2222   UINT16 r, g, b;
23   UINT16 transfer_map;
23   UINT16 luma_select;
2424   UINT16 tex_x, tex_y, tex_width, tex_height;
2525   UINT32 flags;
2626} TRIANGLE;
r1037r1038
4949#define TRI_FLAG_WRAP_Y               0x100
5050
5151
52static UINT32 geo_mode;
5253
5354
54
5555static void parse_display_list(void);
5656static void render_triangles(mame_bitmap *bitmap, const rectangle *cliprect);
5757
r1037r1038
8282
8383static TEXTURE_PARAMETER texture_parameter[32];
8484
85static bitmap_t *sys24_bitmap = NULL;
86
87static void model2_exit(running_machine *machine)
88{
89   if ( sys24_bitmap != NULL )
90   {
91      bitmap_free( sys24_bitmap );
92      sys24_bitmap = NULL;
93   }
94}
95
8596VIDEO_START(model2)
8697{
98   int   width = machine->screen[0].visarea.max_x - machine->screen[0].visarea.min_x;
99   int   height = machine->screen[0].visarea.max_y - machine->screen[0].visarea.min_y;
100
87101   sys24_tile_vh_start(machine, 0x3fff);
88102
103   sys24_bitmap = bitmap_alloc(width, height+4, BITMAP_FORMAT_INDEXED16);
104
105   add_exit_callback(machine, model2_exit);
106
89107   tribuffer = auto_malloc(TRIBUFFER_SIZE * sizeof(TRIANGLE));
90108
91109   polygon_rom = (UINT32*)memory_region(REGION_USER2);
r1037r1038
95113   texture_ram = auto_malloc(0x10000 * sizeof(UINT16));
96114}
97115
116static void convert_bitmap( running_machine *machine, bitmap_t *dst, bitmap_t *src, const rectangle *rect )
117{
118   int   x, y;
119
120   for( y = rect->min_y; y < rect->max_y; y++ )
121   {
122      UINT32 *d = BITMAP_ADDR32( dst, y, 0 );
123      UINT16 *s = BITMAP_ADDR16( src, y, 0 );
124
125      for( x = rect->min_x; x < rect->max_x; x++ )
126      {
127         if ( s[x] )
128            d[x] = machine->pens[s[x]];
129      }
130   }
131}
132
98133VIDEO_UPDATE(model2)
99134{
100135   sys24_tile_update(machine);
101136   fillbitmap(bitmap, machine->pens[0], &machine->screen[0].visarea);
137   fillbitmap(sys24_bitmap, 0, &machine->screen[0].visarea);
102138
103   sys24_tile_draw(machine, bitmap, cliprect, 7, 0, 0);
104   sys24_tile_draw(machine, bitmap, cliprect, 6, 0, 0);
105   sys24_tile_draw(machine, bitmap, cliprect, 5, 0, 0);
106   sys24_tile_draw(machine, bitmap, cliprect, 4, 0, 0);
139   sys24_tile_draw(machine, sys24_bitmap, cliprect, 7, 0, 0);
140   sys24_tile_draw(machine, sys24_bitmap, cliprect, 6, 0, 0);
141   sys24_tile_draw(machine, sys24_bitmap, cliprect, 5, 0, 0);
142   sys24_tile_draw(machine, sys24_bitmap, cliprect, 4, 0, 0);
107143
144   convert_bitmap(machine, bitmap, sys24_bitmap, cliprect);
145
108146   tribuffer_pos = 0;
109147   parse_display_list();
110148   render_triangles(bitmap, cliprect);
111149
112   sys24_tile_draw(machine, bitmap, cliprect, 3, 0, 0);
113   sys24_tile_draw(machine, bitmap, cliprect, 2, 0, 0);
114   sys24_tile_draw(machine, bitmap, cliprect, 1, 0, 0);
115   sys24_tile_draw(machine, bitmap, cliprect, 0, 0, 0);
150   fillbitmap(sys24_bitmap, 0, &machine->screen[0].visarea);
151   sys24_tile_draw(machine, sys24_bitmap, cliprect, 3, 0, 0);
152   sys24_tile_draw(machine, sys24_bitmap, cliprect, 2, 0, 0);
153   sys24_tile_draw(machine, sys24_bitmap, cliprect, 1, 0, 0);
154   sys24_tile_draw(machine, sys24_bitmap, cliprect, 0, 0, 0);
116155
117   /*{
118        int i;
119        FILE *file = fopen("buffer.bin", "wb");
120        for (i=0; i < 0x20000/4; i++)
121        {
122            fputc((model2_bufferram[i] >> 24) & 0xff, file);
123            fputc((model2_bufferram[i] >> 16) & 0xff, file);
124            fputc((model2_bufferram[i] >>  8) & 0xff, file);
125            fputc((model2_bufferram[i] >>  0) & 0xff, file);
126        }
127        fclose(file);
128    }*/
156   convert_bitmap(machine, bitmap, sys24_bitmap, cliprect);
157
129158   return 0;
130159}
131160
r1037r1038
135164   struct poly_vertex vert[3];
136165   const struct poly_scanline_data *scans;
137166   int r, g, b;
138   int luminance;
139   UINT16 color;
167   UINT32 luminance, tr, tg, tb, ri, gi, bi;
168   UINT32 color, loffset;
140169
141//  UINT16 *colortable_r = (UINT16*)&model2_colorxlat[0x0000/4];
142//  UINT16 *colortable_g = (UINT16*)&model2_colorxlat[0x4000/4];
143//  UINT16 *colortable_b = (UINT16*)&model2_colorxlat[0x8000/4];
170   UINT32 *colortable_r = &model2_colorxlat[0x0000/4];
171   UINT32 *colortable_g = &model2_colorxlat[0x4000/4];
172   UINT32 *colortable_b = &model2_colorxlat[0x8000/4];
144173
145174   vert[0].x = tri->v[0].x;   vert[0].y = tri->v[0].y;
146175   vert[1].x = tri->v[1].x;   vert[1].y = tri->v[1].y;
r1037r1038
153182   b = tri->b;
154183   luminance = tri->luminance;
155184
156   r = ((r * luminance) >> 6) & 0x1f;
157   g = ((g * luminance) >> 6) & 0x1f;
158   b = ((b * luminance) >> 6) & 0x1f;
159   color = (r << 10) | (g << 5) | (b);
185   /* apply luma to texel */
186   loffset = (tri->luma_select << 8) + (0x0f << 4) + ((luminance >> 4) & 0x0f);
160187
188   luminance = model2_lumaram[loffset >> 2];
189
190   if ( loffset & 2 )
191      luminance >>= 16;
192
193   luminance &= 0xff;
194
195   ri = (r<<9) + (luminance<<1);
196   gi = (g<<9) + (luminance<<1);
197   bi = (b<<9) + (luminance<<1);
198
199   tr = colortable_r[ri>>2];
200   tg = colortable_g[gi>>2];
201   tb = colortable_b[bi>>2];
202
203   if ( ri & 2 ) tr >>= 16;
204   if ( gi & 2 ) tg >>= 16;
205   if ( bi & 2 ) tb >>= 16;
206
207   tr &= 0xff;
208   tg &= 0xff;
209   tb &= 0xff;
210
211   color = (tr << 16) | (tg << 8) | (tb);
212
161213   if(scans)
162214   {
163215      for(y = scans->sy; y <= scans->ey; y++)
164216      {
165217         int x1, x2;
166218         const struct poly_scanline *scan = &scans->scanline[y - scans->sy];
167         UINT16 *p = BITMAP_ADDR16(bitmap, y, 0);
219         UINT32 *p = BITMAP_ADDR32(bitmap, y, 0);
168220
169221         x1 = scan->sx;
170222         x2 = scan->ex;
171223
172224         for(x = x1; x <= x2; x++)
173225         {
174            /*
175                int tr = colortable_r[(r << 8) | luminance];
176                int tg = colortable_g[(g << 8) | luminance];
177                int tb = colortable_b[(b << 8) | luminance];
226            if ( tri->flags & TRI_FLAG_CHECKER )
227            {
228               UINT32   br, bg, bb;
178229
179                p[x] = (((tr >> 3) << 10) & 0x7c00) | (((tg >> 3) << 5) & 0x03e0) | (((tb >> 3) << 0) & 0x001f);
180                */
230               /* blend */
231               br = (tr + ( ( p[x] >> 16 ) & 0xff ) / 2 );
232               bg = (tg + ( ( p[x] >>  8 ) & 0xff ) / 2 );
233               bb = (tb + ( ( p[x] >>  0 ) & 0xff ) / 2 );
181234
235               color = (br << 16) | (bg << 8) | (bb);
236            }
237
182238            p[x] = color;
183239         }
184240      }
185241   }
186242}
187243
244INLINE int get_texel( UINT32 base_x, UINT32 base_y, int x, int y, UINT32 *sheet )
245{
246   UINT32   baseoffs = ((base_y/2)*512)+(base_x/2);
247   UINT32   texeloffs = ((y/2)*512)+(x/2);
248   UINT32   offset = baseoffs + texeloffs;
249   UINT32   texel = sheet[offset>>1];
250
251   if ( offset & 1 )
252      texel >>= 16;
253
254   if ( (y & 1) == 0 )
255      texel >>= 8;
256
257   if ( (x & 1) == 0 )
258      texel >>= 4;
259
260   return (texel & 0x0f);
261}
262
188263static void draw_textured_triangle(mame_bitmap *bitmap, const rectangle *rect, TRIANGLE *tri)
189264{
190   const int texel_x[4] = {0, 8, 4, 12};
191
192265   int x, y;
193266   struct poly_vertex vert[3];
194267   const struct poly_scanline_data *scans;
r1037r1038
200273   UINT32 tex_height   = 32 << tri->tex_height;
201274   UINT32 tex_x_mask   = tex_width - 1;
202275   UINT32 tex_y_mask   = tex_height - 1;
203   UINT16 *sheet   = (tri->flags & TRI_FLAG_EVEN_BANK)
204               ? ((UINT16*)model2_textureram1) : ((UINT16*)model2_textureram0);
276   UINT32 *sheet   = (tri->flags & TRI_FLAG_EVEN_BANK)   ? (model2_textureram1) : (model2_textureram0);
205277
206   //mame_printf_debug("Tex X: %d, Tex Y: %d, Tex Width: %d, Tex Height: %d\n", tex_x, tex_y, tex_width, tex_height);
207   //mame_printf_debug("U0: %d, V0: %d, U1: %d, V1: %d, U2: %d, V2: %d\n", tri->v[0].u, tri->v[0].v, tri->v[1].u, tri->v[1].v, tri->v[2].u, tri->v[2].v);
278   UINT32 *colortable_r = &model2_colorxlat[0x0000/4];
279   UINT32 *colortable_g = &model2_colorxlat[0x4000/4];
280   UINT32 *colortable_b = &model2_colorxlat[0x8000/4];
208281
209//  UINT16 *colortable_r = (UINT16*)&model2_colorxlat[0x0000/4];
210//  UINT16 *colortable_g = (UINT16*)&model2_colorxlat[0x4000/4];
211//  UINT16 *colortable_b = (UINT16*)&model2_colorxlat[0x8000/4];
282//  mame_printf_debug("Tex X: %d, Tex Y: %d, Tex Width: %d, Tex Height: %d - Bank = %d\n", tex_x, tex_y, tex_width, tex_height, (tri->flags & TRI_FLAG_EVEN_BANK) ? 1 : 0 );
283//  mame_printf_debug("U0: %d, V0: %d, U1: %d, V1: %d, U2: %d, V2: %d\n", tri->v[0].u, tri->v[0].v, tri->v[1].u, tri->v[1].v, tri->v[2].u, tri->v[2].v);
212284
213285   vert[0].x = tri->v[0].x;   vert[0].y = tri->v[0].y;   vert[0].p[0] = tri->v[0].u;      vert[0].p[1] = tri->v[0].v;
214286   vert[1].x = tri->v[1].x;   vert[1].y = tri->v[1].y;   vert[1].p[0] = tri->v[1].u;      vert[1].p[1] = tri->v[1].v;
r1037r1038
231303      {
232304         INT64 u, v;
233305         int x1, x2;
306         UINT16 loffset;
234307         const struct poly_scanline *scan = &scans->scanline[y - scans->sy];
235         UINT16 *p = BITMAP_ADDR16(bitmap, y, 0);
308         UINT32 *p = BITMAP_ADDR32(bitmap, y, 0);
236309
237310         x1 = scan->sx;
238311         x2 = scan->ex;
r1037r1038
242315
243316         for(x = x1; x <= x2; x++)
244317         {
245            int tr, tg, tb;
318            UINT32 tr, tg, tb, luma, ri, gi, bi;
319            UINT16 t;
246320            int u2 = (int)(u >> (16+3)) & tex_x_mask;
247321            int v2 = (int)(v >> (16+3)) & tex_y_mask;
248            UINT16 t = sheet[(((tex_y + v2) * 1024) + (tex_x + u2)) / 4];
249            t = (t >> (texel_x[u2&3])) & 0xf;
250322
251            t = ((u2 + v2) & 1) ? 0xf : 0;
323            if ( tri->flags & TRI_FLAG_MIRROR_X )
324               u2 = ( tex_width - 1 ) - u2;
252325
253            tr = ((t * r) >> 4) & 0x1f;
254            tg = ((t * g) >> 4) & 0x1f;
255            tb = ((t * b) >> 4) & 0x1f;
326            if ( tri->flags & TRI_FLAG_MIRROR_Y )
327               v2 = ( tex_height - 1 ) - v2;
256328
257            p[x] = (tr << 10) | (tg << 5) | (tb);
329            t = get_texel( tex_x, tex_y, u2, v2, sheet );
330
331            if ( !(t == 0x0f && ( tri->flags & TRI_FLAG_TEXTURE_TRANS ) ) )
332            {
333               loffset = (tri->luma_select << 8) + (t << 4) + ((luminance >> 4) & 0x0f);
334
335               luma = model2_lumaram[loffset >> 2];
336
337               if ( loffset & 2 )
338                  luma >>= 16;
339
340               luma &= 0xff;
341
342               ri = (r<<9) + (luma<<1);
343               gi = (g<<9) + (luma<<1);
344               bi = (b<<9) + (luma<<1);
345
346               tr = colortable_r[ri>>2];
347               tg = colortable_g[gi>>2];
348               tb = colortable_b[bi>>2];
349
350               if ( ri & 2 ) tr >>= 16;
351               if ( gi & 2 ) tg >>= 16;
352               if ( bi & 2 ) tb >>= 16;
353
354               tr &= 0xff;
355               tg &= 0xff;
356               tb &= 0xff;
357
358               if ( tri->flags & TRI_FLAG_CHECKER )
359               {
360                  /* blend */
361                  tr = ( tr + ( ( p[x] >> 16 ) & 0xff ) ) / 2;
362                  tg = ( tg + ( ( p[x] >>  8 ) & 0xff ) ) / 2;
363                  tb = ( tb + ( ( p[x] >>  0 ) & 0xff ) ) / 2;
364               }
365
366               p[x] = (tr << 16) | (tg << 8) | (tb);
367            }
368
258369            u += du;
259370            v += dv;
260371         }
r1037r1038
274385
275386static void render_triangles(mame_bitmap *bitmap, const rectangle *cliprect)
276387{
277   int i;//, j;
388   int i;
278389
279390   qsort(tribuffer, tribuffer_pos, sizeof(TRIANGLE), zsort);
280391
r1037r1038
297408
298409      if (tribuffer[i].flags & TRI_FLAG_TEXTURE)
299410      {
300         //draw_textured_triangle(bitmap, &rect, &tribuffer[i]);
301         draw_solid_triangle(bitmap, &rect, &tribuffer[i]);
411         draw_textured_triangle(bitmap, &rect, &tribuffer[i]);
412         //draw_solid_triangle(bitmap, &rect, &tribuffer[i]);
302413      }
303414      else
304415      {
305416         draw_solid_triangle(bitmap, &rect, &tribuffer[i]);
306417      }
307418   }
419
420#if 0
421   {
422
423#define   TEX_BASE_X   512
424#define   TEX_BASE_Y   640
425#define   TEX_WIDTH   128
426#define   TEX_HEIGHT   128
427#define   TEX_BANK   1
428
429      int x,y;
430
431      for( y = 0; y < TEX_HEIGHT; y++ )
432      {
433         UINT32 *y0 = BITMAP_ADDR32(bitmap, y, 0);
434
435         for( x = 0; x < TEX_WIDTH; x++ )
436         {
437            UINT32   lup[0x10] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
438                             0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff };
439
440            UINT32 *tb = (TEX_BANK) ? model2_textureram1 : model2_textureram0;
441
442            UINT16   tv = get_texel( TEX_BASE_X, TEX_BASE_Y, x, y, tb );
443
444            if ( x >= cliprect->min_x && x < cliprect->max_x && y >= cliprect->min_y && y < cliprect->max_y )
445            {
446               y0[x] = lup[tv] | ((lup[tv])<<8) | ((lup[tv])<<16);
447            }
448         }
449      }
450   }
451#endif
308452}
309453
310454INLINE int is_point_inside(float x, float y, float z, PLANE cp)
r1037r1038
377521   return clip_verts;
378522}
379523
524INLINE void project_point( VERTEX *v )
525{
526   float ooz = 1.0f / -v->z;
527   v->x = -((v->x * ooz) * focus_x) + (float)(window.x + (window.width / 2));
528   v->y = ((v->y * ooz) * focus_y) + (float)(window.y + (window.height / 2));
529}
530
380531static void push_triangle(TRIANGLE *tri)
381532{
382   int i, j;
533   int i;
383534   int clipped_verts;
384535   VERTEX verts[10];
385536   PLANE clip_plane = { 0.0f, 0.0f, 1.0f, -1.0f };
386537   clipped_verts = clip_polygon(tri->v, 3, clip_plane, verts);
387538
539   project_point( &verts[0] );
540   project_point( &verts[1] );
388541   for (i=2; i < clipped_verts; i++)
389542   {
390543      TRIANGLE *dt = &tribuffer[tribuffer_pos];
391544
545      project_point( &verts[i] );
546
392547      memcpy(dt, tri, sizeof(TRIANGLE));
393548
394549      memcpy(&dt->v[0], &verts[0], sizeof(VERTEX));
r1037r1038
396551      memcpy(&dt->v[2], &verts[i], sizeof(VERTEX));
397552      memcpy(&dt->window, &window, sizeof(WINDOW));
398553
399      for (j=0; j < 3; j++)
400      {
401         float ooz = 1.0f / -dt->v[j].z;
402         dt->v[j].x = -((dt->v[j].x * ooz) * focus_x) + (float)(window.x + (window.width / 2));
403         dt->v[j].y = ((dt->v[j].y * ooz) * focus_y) + (float)(window.y + (window.height / 2));
404      }
405
406554      tribuffer_pos++;
407555      if (tribuffer_pos >= TRIBUFFER_SIZE)
408556      {
r1037r1038
419567   memcpy(&dt->window, &window, sizeof(WINDOW));
420568}
421569
422
423
424570static void draw_object(UINT32 address, UINT32 num_polys, UINT32 tex_point_addr, UINT32 tex_hdr_addr)
425571{
426572   int i;
427   int end = 0;
428   int polynum = 0;
429573   VERTEX prev_p1 = { 0 }, prev_p2 = { 0 };
430574
431575   UINT16 *thdr;
432576   UINT16 *tpoint;
433577   UINT32 *object;
434   UINT16 *lumatable = (UINT16*)model2_lumaram;
435578
436579   int th_addr = 0;
437580   int tp_addr = 0;
438   float previous_zvalue = 0.0f;
581   float previous_zvalue = -12345.0f;
439582
583   (void)num_polys;
584
440585   if (address < 0x800000)
441586   {
442587      object = polygon_ram;
443      address = address - 4;
588      address &= 0x7fff;
444589   }
445590   else
446591   {
447592      object = polygon_rom;
448      address = (address & 0x7fffff) - 4;
593      address = address - 0x800000;
449594   }
450595
451596   if (tex_hdr_addr < 0x800000)
r1037r1038
456601   else
457602   {
458603      thdr = texture_ram;
459      th_addr = tex_hdr_addr & 0x7fffff;
604      th_addr = tex_hdr_addr & 0xffff;
460605   }
461606
462607   if (tex_point_addr < 0x800000)
r1037r1038
467612   else
468613   {
469614      tpoint = texture_ram;
470      tp_addr = tex_point_addr & 0x7fffff;
615      tp_addr = tex_point_addr & 0xffff;
471616   }
472617
473   while (!end && polynum < num_polys)
618   prev_p1.x = u2f(object[address++]);
619   prev_p1.y = u2f(object[address++]);
620   prev_p1.z = u2f(object[address++]);
621
622   prev_p2.x = u2f(object[address++]);
623   prev_p2.y = u2f(object[address++]);
624   prev_p2.z = u2f(object[address++]);
625
626   while ( 1 )
474627   {
475628      TEXTURE_PARAMETER *texparam;
476629      VERTEX v[4], p1, p2;
r1037r1038
481634      UINT16 s[4], t[4];
482635      int polytype, linktype, tex_hdr_offset, zsort_type, texture_code;
483636
484      s[3] = t[3] = 0;   // fix compiler "used uninitialized" warning
485
486637      attr = object[address++];
487638      polytype = attr & 0x3;
488639
489      if (polytype == 0)
490      {
491         return;
492      }
640      if ( polytype == 0 )
641         break;
493642
494643      linktype = (attr >> 8) & 0x3;
495644      if (linktype != ((attr >> 23) & 0x3))
496645      {
497646         //return;
498647         //fatalerror("Linktype not matching, attribute = %08X at %08X\n", attr, address*4);
648         linktype = (attr >> 23) & 0x3;
499649      }
500650
501      tex_hdr_offset = (attr >> 12) & 0x1f;
502      if (tex_hdr_offset & 0x10)   tex_hdr_offset |= -16;
503
504651      zsort_type = (attr >> 10) & 0x3;
505652      texture_code = (attr >> 12) & 0x1f;
506653
507654      texparam = &texture_parameter[texture_code];
508655
509
510
511656      // load vertex data and polygon normal
512      nx = *(float*)(&object[address++]);
513      ny = *(float*)(&object[address++]);
514      nz = *(float*)(&object[address++]);
515      p1.x = *(float*)(&object[address++]);
516      p1.y = *(float*)(&object[address++]);
517      p1.z = *(float*)(&object[address++]);
518      p2.x = *(float*)(&object[address++]);
519      p2.y = *(float*)(&object[address++]);
520      p2.z = *(float*)(&object[address++]);
657      nx = -(u2f(object[address++]));
658      ny = -(u2f(object[address++]));
659      nz = -(u2f(object[address++]));
660      p1.x = u2f(object[address++]);
661      p1.y = u2f(object[address++]);
662      p1.z = u2f(object[address++]);
663      p2.x = u2f(object[address++]);
664      p2.y = u2f(object[address++]);
665      p2.z = u2f(object[address++]);
521666
522667
523
524668      // load texture parameters
525669      tex_header[0] = thdr[th_addr+0];
526670      tex_header[1] = thdr[th_addr+1];
527671      tex_header[2] = thdr[th_addr+2];
528672      tex_header[3] = thdr[th_addr+3];
529673
530      if (tex_header[0] & 0x4000)
674      color = (tex_header[3] >> 6) & 0x3ff;
675
676      // lookup color in palette ram
677      // we need the original 15 bit color, not the remapped 32 bit version
531678      {
532         color = (tex_header[3] >> 6) & 0x3ff;
533         rgb = Machine->remapped_colortable[4096+color];
679         UINT32   pval = paletteram32[(0x2000/4)+(color >> 1)];
680
681         if ( color & 1 )
682            rgb = (pval >> 16);
683         else
684            rgb = pval;
534685      }
535      else
536      {
537         rgb = 0x7fff;
538      }
539686
540      th_addr += tex_hdr_offset * 4;
687      rgb &= 0x7fff;
541688
689      tex_hdr_offset = (attr >> 12) & 0x1f;
542690
691      if (tex_hdr_offset & 0x10)
692         tex_hdr_offset |= -16;
543693
694      th_addr += tex_hdr_offset * 4;
695
544696      // load texture coordinates
545697      if (polytype == 2)
546698      {
547         s[0] = tpoint[tp_addr+0];
548         t[0] = tpoint[tp_addr+1];
549         s[1] = tpoint[tp_addr+2];
550         t[1] = tpoint[tp_addr+3];
551         s[2] = tpoint[tp_addr+4];
552         t[2] = tpoint[tp_addr+5];
699         t[0] = tpoint[tp_addr+0];
700         s[0] = tpoint[tp_addr+1];
701         t[1] = tpoint[tp_addr+2];
702         s[1] = tpoint[tp_addr+3];
703         t[2] = tpoint[tp_addr+4];
704         s[2] = tpoint[tp_addr+5];
705         t[3] = 0; /* unused */
706         s[3] = 0; /* unused */
553707         tp_addr += 6;
554708      }
555709      else
556710      {
557         s[0] = tpoint[tp_addr+0];
558         t[0] = tpoint[tp_addr+1];
559         s[1] = tpoint[tp_addr+2];
560         t[1] = tpoint[tp_addr+3];
561         s[2] = tpoint[tp_addr+4];
562         t[2] = tpoint[tp_addr+5];
563         s[3] = tpoint[tp_addr+6];
564         t[3] = tpoint[tp_addr+7];
711         t[0] = tpoint[tp_addr+0];
712         s[0] = tpoint[tp_addr+1];
713         t[1] = tpoint[tp_addr+2];
714         s[1] = tpoint[tp_addr+3];
715         t[2] = tpoint[tp_addr+4];
716         s[2] = tpoint[tp_addr+5];
717         t[3] = tpoint[tp_addr+6];
718         s[3] = tpoint[tp_addr+7];
565719         tp_addr += 8;
566720      }
567721
722      // transform and normalize the normal
723      {
724         float tx =   (nx * matrix[0]) + (ny * matrix[3]) + (nz * matrix[6]) + (matrix[9]);
725         float ty =   (nx * matrix[1]) + (ny * matrix[4]) + (nz * matrix[7]) + (matrix[10]);
726         float tz =   (nx * matrix[2]) + (ny * matrix[5]) + (nz * matrix[8]) + (matrix[11]);
727         float norm = sqrt( tx*tx + ty*ty + tz*tz );
728         if ( norm )
729         {
730            tx /= norm;
731            ty /= norm;
732            tz /= norm;
733         }
734         nx = tx;
735         ny = ty;
736         nz = tz;
737      }
568738
569
570739      // transform and push the polygon to render buffer
571      if (linktype != 0)
572740      {
573741
574742         float dot, intensity;
575743         float zvalue;
576744         TRIANGLE tri1, tri2;
577         v[0].x = p1.x;         v[0].y = p1.y;         v[0].z = p1.z;         v[0].u = s[0];   v[0].v = t[0];
578         v[1].x = p2.x;         v[1].y = p2.y;         v[1].z = p2.z;         v[1].u = s[1];   v[1].v = t[1];
579         v[2].x = prev_p1.x;      v[2].y = prev_p1.y;      v[2].z = prev_p1.z;      v[2].u = s[2];   v[2].v = t[2];
580         v[3].x = prev_p2.x;      v[3].y = prev_p2.y;      v[3].z = prev_p2.z;      v[3].u = s[3];   v[3].v = t[3];
745         v[0].x = prev_p2.x;      v[0].y = prev_p2.y;      v[0].z = prev_p2.z;      v[0].u = s[0];   v[0].v = t[0];
746         v[1].x = prev_p1.x;      v[1].y = prev_p1.y;      v[1].z = prev_p1.z;      v[1].u = s[1];   v[1].v = t[1];
747         v[2].x = p1.x;         v[2].y = p1.y;         v[2].z = p1.z;         v[2].u = s[2];   v[2].v = t[2];
748         v[3].x = p2.x;         v[3].y = p2.y;         v[3].z = p2.z;         v[3].u = s[3];   v[3].v = t[3];
581749
582750         // transform with the current matrix
583         for (i=0; i < 4; i++)
751         for ( i = 0; i < 4; i++)
584752         {
585753            float tx =   (v[i].x * matrix[0]) + (v[i].y * matrix[3]) + (v[i].z * matrix[6]) + (matrix[9]);
586754            float ty =   (v[i].x * matrix[1]) + (v[i].y * matrix[4]) + (v[i].z * matrix[7]) + (matrix[10]);
r1037r1038
590758            v[i].z = tz;
591759         }
592760
593         dot = (-light_vector[0] * nx) + (-light_vector[1] * ny) + (-light_vector[2] * nz);
761         dot = -( (light_vector[0] * nx) + (light_vector[1] * ny) + (light_vector[2] * nz) );
762
594763         if (dot < 0.0f)
595764            dot = 0.0f;
596765         if (dot > 1.0f)
r1037r1038
607776         memcpy(&tri1.v[0], &v[0], sizeof(VERTEX));
608777         memcpy(&tri1.v[1], &v[1], sizeof(VERTEX));
609778         memcpy(&tri1.v[2], &v[2], sizeof(VERTEX));
610         memcpy(&tri2.v[0], &v[1], sizeof(VERTEX));
611         memcpy(&tri2.v[1], &v[2], sizeof(VERTEX));
612         memcpy(&tri2.v[2], &v[3], sizeof(VERTEX));
613779
780         memcpy(&tri2.v[0], &v[2], sizeof(VERTEX));
781         memcpy(&tri2.v[1], &v[3], sizeof(VERTEX));
782         memcpy(&tri2.v[2], &v[0], sizeof(VERTEX));
783
614784         switch (zsort_type)
615785         {
616786            case 0:         // Previous value
r1037r1038
635805               break;
636806            }
637807            default:   mame_printf_error("draw_object: unknown zsort mode %d!\n", zsort_type);
638               zvalue = previous_zvalue;   /* complete hack */
808               zvalue = /* previous_zvalue */0.0;   /* complete hack */
639809               break;
640810         }
641811
642812         previous_zvalue = zvalue;
643813
644         tri1.flags = 0;
645         if (tex_header[0] & 0x8000)      tri1.flags |= TRI_FLAG_CHECKER;
646         if (tex_header[0] & 0x4000)      tri1.flags |= TRI_FLAG_TEXTURE;
647         if (tex_header[0] & 0x2000)      tri1.flags |= TRI_FLAG_TEXTURE_TRANS;
648         if (tex_header[0] & 0x1000)      tri1.flags |= TRI_FLAG_MICROTEX;
649         if (tex_header[0] & 0x0200)      tri1.flags |= TRI_FLAG_MIRROR_X;
650         if (tex_header[0] & 0x0100)      tri1.flags |= TRI_FLAG_MIRROR_Y;
651         if (tex_header[0] & 0x0080)      tri1.flags |= TRI_FLAG_WRAP_X;
652         if (tex_header[0] & 0x0040)      tri1.flags |= TRI_FLAG_WRAP_Y;
653         if (tex_header[2] & 0x1000)      tri1.flags |= TRI_FLAG_EVEN_BANK;
654         tri2.flags = tri1.flags;
814         if (linktype != 0)
815         {
816            tri1.flags = 0;
817            if (tex_header[0] & 0x8000)      tri1.flags |= TRI_FLAG_CHECKER;
818            if (tex_header[0] & 0x4000)      tri1.flags |= TRI_FLAG_TEXTURE;
819            if (tex_header[0] & 0x2000)      tri1.flags |= TRI_FLAG_TEXTURE_TRANS;
820            if (tex_header[0] & 0x1000)      tri1.flags |= TRI_FLAG_MICROTEX;
821            if (tex_header[0] & 0x0200)      tri1.flags |= TRI_FLAG_MIRROR_X;
822            if (tex_header[0] & 0x0100)      tri1.flags |= TRI_FLAG_MIRROR_Y;
823            if (tex_header[0] & 0x0080)      tri1.flags |= TRI_FLAG_WRAP_X;
824            if (tex_header[0] & 0x0040)      tri1.flags |= TRI_FLAG_WRAP_Y;
825            if (tex_header[2] & 0x1000)      tri1.flags |= TRI_FLAG_EVEN_BANK;
826            tri2.flags = tri1.flags;
655827
656         tri1.tex_x = tri2.tex_x            = (tex_header[2] >> 6) & 0x3f;
657         tri1.tex_y = tri2.tex_y            = (tex_header[2] >> 0) & 0x3f;
658         tri1.tex_width = tri2.tex_width      = (tex_header[0] >> 3) & 0x7;
659         tri1.tex_height = tri2.tex_height   = (tex_header[0] >> 0) & 0x7;
660         tri1.transfer_map = tri2.transfer_map = tex_header[1] & 0xff;
828            tri1.tex_x = tri2.tex_x            = (tex_header[2] >> 0) & 0x1f;
829            tri1.tex_y = tri2.tex_y            = (tex_header[2] >> 6) & 0x1f;
661830
662         tri1.z = tri2.z = zvalue;
663         tri1.r = tri2.r = (rgb >> 10) & 0x1f;
664         tri1.g = tri2.g = (rgb >>  5) & 0x1f;
665         tri1.b = tri2.b = (rgb >>  0) & 0x1f;
666         tri1.luminance = tri2.luminance = lumatable[(int)(intensity)];
831            if ( tex_header[2] & 0x20 )
832            {
833               tri1.tex_y += 0x20;
834               tri2.tex_y += 0x20;
835            }
667836
668         //if (polytype == 1)
669         {
670            push_triangle(&tri1);
671            push_triangle(&tri2);
837            tri1.tex_width = tri2.tex_width      = (tex_header[0] >> 0) & 0x7;
838            tri1.tex_height = tri2.tex_height   = (tex_header[0] >> 3) & 0x7;
839            tri1.luma_select = tri2.luma_select = tex_header[1] & 0xff;
840
841            tri1.z = tri2.z = zvalue;
842            tri1.r = tri2.r = (rgb >>  0) & 0x1f;
843            tri1.g = tri2.g = (rgb >>  5) & 0x1f;
844            tri1.b = tri2.b = (rgb >> 10) & 0x1f;
845            tri1.luminance = tri2.luminance = (int)intensity;
846
847            if (polytype == 1)
848            {
849               push_triangle(&tri2);
850               push_triangle(&tri1);
851            }
852            else
853            {
854               push_triangle(&tri1);
855            }
672856         }
673         //else
674         //{
675         //  push_triangle(&tri1);
676         //}
677857      }
678858
679859      switch (linktype)
r1037r1038
713893
714894   texture_point_address   = mem[offset++];
715895   texture_header_address   = mem[offset++];
716   prev_p1.x = *(float*)(&mem[offset++]);
717   prev_p1.y = *(float*)(&mem[offset++]);
718   prev_p1.z = *(float*)(&mem[offset++]);
719   prev_p2.x = *(float*)(&mem[offset++]);
720   prev_p2.y = *(float*)(&mem[offset++]);
721   prev_p2.z = *(float*)(&mem[offset++]);
896   prev_p1.x = u2f(mem[offset++]);
897   prev_p1.y = u2f(mem[offset++]);
898   prev_p1.z = u2f(mem[offset++]);
899   prev_p2.x = u2f(mem[offset++]);
900   prev_p2.y = u2f(mem[offset++]);
901   prev_p2.z = u2f(mem[offset++]);
722902
723903   while (!end)
724904   {
r1037r1038
744924      }
745925
746926      luminance_data = mem[offset++];
747      d      = *(float*)(&mem[offset++]);
748      p1.x   = *(float*)(&mem[offset++]);
749      p1.y   = *(float*)(&mem[offset++]);
750      p1.z   = *(float*)(&mem[offset++]);
751      p2.x   = *(float*)(&mem[offset++]);
752      p2.y   = *(float*)(&mem[offset++]);
753      p2.z   = *(float*)(&mem[offset++]);
927      d      = u2f(mem[offset++]);
928      p1.x   = u2f(mem[offset++]);
929      p1.y   = u2f(mem[offset++]);
930      p1.z   = u2f(mem[offset++]);
931      p2.x   = u2f(mem[offset++]);
932      p2.y   = u2f(mem[offset++]);
933      p2.z   = u2f(mem[offset++]);
754934
755935      if (linktype != 0)
756936      {
r1037r1038
8531033            }
8541034            case 0x01:      // Object Data
8551035            {
856               tex_point_addr   = model2_bufferram[dlptr+0];
857               tex_hdr_addr   = model2_bufferram[dlptr+1];
1036               tex_point_addr   = model2_bufferram[dlptr+0] & 0xffffff;
1037               tex_hdr_addr   = model2_bufferram[dlptr+1] & 0xffffff;
8581038               address         = model2_bufferram[dlptr+2];
8591039               length         = model2_bufferram[dlptr+3];
8601040
861               draw_object(address, length, tex_point_addr, tex_hdr_addr);
1041               if ( tex_point_addr != 0 || tex_hdr_addr != 0 || address != 0 || length != 0 )
1042               {
1043                  draw_object(address, length, tex_point_addr, tex_hdr_addr);
1044               }
8621045
8631046               dlptr += 4;
8641047               break;
r1037r1038
8771060               int y2 = (INT16)(model2_bufferram[dlptr+1] >>  0);
8781061
8791062               window.x = x1;
880               window.y = 474 - y2;
1063               window.y = 0;
8811064               window.width = x2 - x1;
882               window.height = (474 - y1) - window.y;
1065               window.height = y2 - y1;
8831066
8841067               dlptr += 6;
8851068               break;
r1037r1038
9381121                  texture_parameter[i].diffuse   = (data >>  0) & 0xff;
9391122                  texture_parameter[i].ambient   = (data >>  8) & 0xff;
9401123                  texture_parameter[i].reflection   = (data >> 16) & 0xff;
941                  texture_parameter[i].c = *(float*)&model2_bufferram[dlptr++];
1124                  texture_parameter[i].c = u2f(model2_bufferram[dlptr++]);
9421125               }
9431126               break;
9441127            }
9451128            case 0x07:      // Operation Mode
9461129            {
1130               geo_mode = model2_bufferram[dlptr];
9471131               dlptr++;
9481132               break;
9491133            }
r1037r1038
9541138            }
9551139            case 0x09:      // Focal Distance
9561140            {
957               focus_x = *(float*)&model2_bufferram[dlptr+0];
958               focus_y = *(float*)&model2_bufferram[dlptr+1];
1141               focus_x = u2f(model2_bufferram[dlptr+0]);
1142               focus_y = u2f(model2_bufferram[dlptr+1]);
9591143               dlptr += 2;
9601144               break;
9611145            }
9621146            case 0x0a:      // Light Source Vector
9631147            {
964               light_vector[0] = *(float*)&model2_bufferram[dlptr++];
965               light_vector[1] = *(float*)&model2_bufferram[dlptr++];
966               light_vector[2] = *(float*)&model2_bufferram[dlptr++];
1148               float norm;
1149
1150               light_vector[0] = u2f(model2_bufferram[dlptr++]);
1151               light_vector[1] = u2f(model2_bufferram[dlptr++]);
1152               light_vector[2] = u2f(model2_bufferram[dlptr++]);
1153
1154               norm = sqrt( light_vector[0]*light_vector[0] + light_vector[1]*light_vector[1] + light_vector[2]*light_vector[2] );
1155               if ( norm )
1156               {
1157                  light_vector[0] /= norm;
1158                  light_vector[1] /= norm;
1159                  light_vector[2] /= norm;
1160               }
1161
9671162               break;
9681163            }
9691164            case 0x0b:      // Matrix
9701165            {
971               matrix[ 0] = *(float*)&model2_bufferram[dlptr++];
972               matrix[ 1] = *(float*)&model2_bufferram[dlptr++];
973               matrix[ 2] = *(float*)&model2_bufferram[dlptr++];
974               matrix[ 3] = *(float*)&model2_bufferram[dlptr++];
975               matrix[ 4] = *(float*)&model2_bufferram[dlptr++];
976               matrix[ 5] = *(float*)&model2_bufferram[dlptr++];
977               matrix[ 6] = *(float*)&model2_bufferram[dlptr++];
978               matrix[ 7] = *(float*)&model2_bufferram[dlptr++];
979               matrix[ 8] = *(float*)&model2_bufferram[dlptr++];
980               matrix[ 9] = *(float*)&model2_bufferram[dlptr++];
981               matrix[10] = *(float*)&model2_bufferram[dlptr++];
982               matrix[11] = *(float*)&model2_bufferram[dlptr++];
1166               matrix[ 0] = u2f(model2_bufferram[dlptr++]);
1167               matrix[ 1] = u2f(model2_bufferram[dlptr++]);
1168               matrix[ 2] = u2f(model2_bufferram[dlptr++]);
1169               matrix[ 3] = u2f(model2_bufferram[dlptr++]);
1170               matrix[ 4] = u2f(model2_bufferram[dlptr++]);
1171               matrix[ 5] = u2f(model2_bufferram[dlptr++]);
1172               matrix[ 6] = u2f(model2_bufferram[dlptr++]);
1173               matrix[ 7] = u2f(model2_bufferram[dlptr++]);
1174               matrix[ 8] = u2f(model2_bufferram[dlptr++]);
1175               matrix[ 9] = u2f(model2_bufferram[dlptr++]);
1176               matrix[10] = u2f(model2_bufferram[dlptr++]);
1177               matrix[11] = u2f(model2_bufferram[dlptr++]);
9831178               break;
9841179            }
9851180            case 0x0c:      // Parallel Transfer Vector
9861181            {
987               matrix[ 9] = *(float*)&model2_bufferram[dlptr++];
988               matrix[10] = *(float*)&model2_bufferram[dlptr++];
989               matrix[11] = *(float*)&model2_bufferram[dlptr++];
1182               matrix[ 9] = u2f(model2_bufferram[dlptr++]);
1183               matrix[10] = u2f(model2_bufferram[dlptr++]);
1184               matrix[11] = u2f(model2_bufferram[dlptr++]);
9901185               break;
9911186            }
9921187            case 0x0e:      // TGP Test
src/mame/video/namcos21.c
r1037r1038
66- 3d graphics are managed by DSP processors
77
88TODO: use fixed point arithmetic while rendering quads
9
10TODO: incorporate proper per-pixel transparency, instead of overloading the zbuffer
11
12TODO: add depth cueing support (palette bank selection using most significant bits of zcode), if this
13      is determined to be a feature of real hardware.
9TODO: need proper depth cueing tables
1410*/
1511
1612#include "driver.h"
r1037r1038
2824static UINT16 *mpPolyFrameBufferPens2;
2925static INT16 *mpPolyFrameBufferZ2;
3026
27static UINT16 winrun_color;
28static UINT16 winrun_gpu_register[0x10/2];
29
30READ16_HANDLER(winrun_gpu_color_r)
31{
32   return winrun_color;
33}
34
35WRITE16_HANDLER(winrun_gpu_color_w)
36{
37   COMBINE_DATA( &winrun_color );
38}
39
40READ16_HANDLER(winrun_gpu_register_r)
41{
42   return winrun_gpu_register[offset];
43}
44
45WRITE16_HANDLER(winrun_gpu_register_w)
46{
47   COMBINE_DATA( &winrun_gpu_register[offset] );
48}
49
50WRITE16_HANDLER( winrun_gpu_videoram_w)
51{
52   int color = data>>8;
53   int mask  = data&0xff;
54   int i;
55   for( i=0; i<8; i++ )
56   {
57      if( mask&(0x01<<i) )
58      {
59         videoram[(offset+i)&0x7ffff] = color;
60      }
61   }
62} /* winrun_gpu_videoram_w */
63
64READ16_HANDLER( winrun_gpu_videoram_r )
65{
66   return videoram[offset]<<8;
67} /* winrun_gpu_videoram_r */
68
3169static void
3270AllocatePolyFrameBuffer( void )
3371{
3472   mpPolyFrameBufferZ     = auto_malloc( FRAMEBUFFER_SIZE_IN_BYTES );
3573   mpPolyFrameBufferPens  = auto_malloc( FRAMEBUFFER_SIZE_IN_BYTES );
74
3675   mpPolyFrameBufferZ2    = auto_malloc( FRAMEBUFFER_SIZE_IN_BYTES );
3776   mpPolyFrameBufferPens2 = auto_malloc( FRAMEBUFFER_SIZE_IN_BYTES );
3877
39      namcos21_ClearPolyFrameBuffer();
40      namcos21_ClearPolyFrameBuffer();
78   namcos21_ClearPolyFrameBuffer();
79   namcos21_ClearPolyFrameBuffer();
4180} /* AllocatePolyFrameBuffer */
4281
4382void
r1037r1038
70109   for( sy=clip->min_y; sy<=clip->max_y; sy++ )
71110   {
72111      UINT16 *dest = BITMAP_ADDR16(bitmap, sy, 0);
73      const INT16 *pZ   = mpPolyFrameBufferZ2 + NAMCOS21_POLY_FRAME_WIDTH*sy;
74      const UINT16 *pPen = mpPolyFrameBufferPens2 + NAMCOS21_POLY_FRAME_WIDTH*sy;
112      const UINT16 *pPen = mpPolyFrameBufferPens2+NAMCOS21_POLY_FRAME_WIDTH*sy;
113      const INT16 *pZ = mpPolyFrameBufferZ2+NAMCOS21_POLY_FRAME_WIDTH*sy;
75114      int sx;
76115      for( sx=clip->min_x; sx<=clip->max_x; sx++ )
77116      {
78117         if( pZ[sx]!=0x7fff )
79         { /* for now, assume pixels with max zcode are transparent */
118         {
80119            dest[sx] = pPen[sx];
81120         }
82121      }
r1037r1038
90129
91130VIDEO_START( namcos21 )
92131{
132   if( namcos2_gametype == NAMCOS21_WINRUN91 )
133   {
134      videoram = auto_malloc(0x80000);
135   }
93136   AllocatePolyFrameBuffer();
94137   namco_obj_init(
95138      0,      /* gfx bank */
r1037r1038
134177   }
135178} /* update_palette */
136179
137VIDEO_UPDATE( namcos21_default )
180VIDEO_UPDATE( namcos21 )
138181{
139182   int pivot = 3;
140183   int pri;
141
142184   update_palette();
143
144   /* paint background */
145   fillbitmap( bitmap, get_black_pen(machine), cliprect );
146
147   /* draw low priority 2d sprites */
148   for( pri=0; pri<pivot; pri++ )
149   {
150      namco_obj_draw(machine, bitmap, cliprect, pri );
185   fillbitmap( bitmap, 0xff, cliprect );
186   if( namcos2_gametype != NAMCOS21_WINRUN91 )
187   { /* draw low priority 2d sprites */
188      for( pri=0; pri<pivot; pri++ )
189      {
190         namco_obj_draw( machine, bitmap, cliprect, pri );
191      }
151192   }
152
153193   CopyVisiblePolyFrameBuffer( bitmap, cliprect );
154
155   /* draw high priority 2d sprites */
156   for( pri=pivot; pri<8; pri++ )
157   {
158      namco_obj_draw(machine, bitmap, cliprect, pri );
194   if( namcos2_gametype != NAMCOS21_WINRUN91 )
195   { /* draw high priority 2d sprites */
196      for( pri=pivot; pri<8; pri++ )
197      {
198         namco_obj_draw( machine, bitmap, cliprect, pri );
199      }
159200   }
160   return 0;
161}
162
163VIDEO_UPDATE( namcos21_winrun )
164{
165   /* NOT WORKING!
166     *
167     * videoram16 points to a framebuffer used by Winning Run '91 hardware, probably a linear
168     * pixel map used as a predecessor to the newer hardware's sprite system.
169     */
170   int sx,sy;
171   for( sy=0; sy<512; sy++ )
172   {
173      UINT16 *pDest = BITMAP_ADDR16(bitmap, sy, 0);
174      for( sx=0; sx<512; sx++ )
201   else
202   { /* winrun bitmap layer */
203      int dy = (INT16)winrun_gpu_register[0x2/2];
204      int base = 0x1000+0x100*(winrun_color&0xf);
205      int sx,sy;
206      for( sy=cliprect->min_y; sy<=cliprect->max_y; sy++ )
175207      {
176         int color = 0;
177         int offs = sy*0x400 + (sx/8)*0x10;
178         if( videoram16[offs/2]&(1<<(sx&7)) )
208         const UINT8 *pSource = &videoram[((sy+dy)&0x3ff)*0x200];
209         UINT16 *pDest = BITMAP_ADDR16(bitmap, sy, 0);
210         for( sx=cliprect->min_x; sx<=cliprect->max_x; sx++ )
179211         {
180            color = 1;
212            int pen = pSource[sx];
213            if( pen!=0xff )
214            {
215               pDest[sx] = base|pen;
216            }
181217         }
182         pDest[sx] = color;
183218      }
184   }
185   namcos21_dspram16[0x100/2] = 0x0001;
219   } /* winrun bitmap layer */
220
221
222//  if( input_code_pressed( KEYCODE_Q ) ) namco_obj_draw( machine, bitmap, cliprect, 0 ); // boot, mountains
223//  if( input_code_pressed( KEYCODE_W ) ) namco_obj_draw( machine, bitmap, cliprect, 1 );
224//  if( input_code_pressed( KEYCODE_E ) ) namco_obj_draw( machine, bitmap, cliprect, 2 ); // hs backdrop
225//  if( input_code_pressed( KEYCODE_R ) ) namco_obj_draw( machine, bitmap, cliprect, 3 ); // warn, starship
226//  if( input_code_pressed( KEYCODE_T ) ) namco_obj_draw( machine, bitmap, cliprect, 4 );
227//  if( input_code_pressed( KEYCODE_Y ) ) namco_obj_draw( machine, bitmap, cliprect, 5 );
228//  if( input_code_pressed( KEYCODE_U ) ) namco_obj_draw( machine, bitmap, cliprect, 6 );
229//  if( input_code_pressed( KEYCODE_I ) ) namco_obj_draw( machine, bitmap, cliprect, 7 );
230
186231   return 0;
187}
232} /* VIDEO_UPDATE( namcos21 ) */
188233
189234/*********************************************************************************************/
190235
r1037r1038
203248#define SWAP(A,B) { const void *temp = A; A = B; B = temp; }
204249
205250static void
206renderscanline_flat( const edge *e1, const edge *e2, int sy, unsigned color )
251renderscanline_flat( const edge *e1, const edge *e2, int sy, unsigned color, int depthcueenable )
207252{
208253   if( e1->x > e2->x )
209254   {
r1037r1038
213258   {
214259      UINT16 *pDest = mpPolyFrameBufferPens + sy*NAMCOS21_POLY_FRAME_WIDTH;
215260      INT16 *pZBuf = mpPolyFrameBufferZ     + sy*NAMCOS21_POLY_FRAME_WIDTH;
216
217261      int x0 = (int)e1->x;
218262      int x1 = (int)e2->x;
219263      int w = x1-x0;
r1037r1038
238282            INT16 zz = (INT16)z;
239283            if( zz<pZBuf[x] )
240284            {
241               pDest[x] = color;
285               int pen = color;
286               if( depthcueenable && zz>0 )
287               {
288                  int depth = 0;
289                  if( namcos2_gametype == NAMCOS21_WINRUN91 )
290                  {
291                     depth = (zz>>1)&0xff00;
292                     if( depth>0x1f00 ) depth = 0x1f00;
293                     pen += depth;
294                  }
295                  else
296                  {
297                     depth = (zz>>0)&0xfe00;
298                     if( depth>0x1e00 ) depth = 0x1e00;
299                     pen -= depth;
300                  }
301               }
302               pDest[x] = pen;
242303               pZBuf[x] = zz;
243304            }
244305            z += dz;
r1037r1038
252313      const vertex *v0,
253314      const vertex *v1,
254315      const vertex *v2,
255      unsigned color )
316      unsigned color,
317      int depthcueenable )
256318{
257319   int dy,ystart,yend,crop;
258320
r1037r1038
290352
291353      e2.x = v0->x;
292354      e2.z = v0->z;
293      crop = - ystart;
355      crop = -ystart;
294356      if( crop>0 )
295357      {
296358         e2.x += dx2dy*crop;
r1037r1038
308370         dx1dy = (v1->x - v0->x)/dy;
309371         dz1dy = (v1->z - v0->z)/dy;
310372
311         crop = - ystart;
373         crop = -ystart;
312374         if( crop>0 )
313375         {
314376            e1.x += dx1dy*crop;
r1037r1038
319381
320382         for( y=ystart; y<yend; y++ )
321383         {
322            renderscanline_flat( &e1, &e2, y, color );
384            renderscanline_flat( &e1, &e2, y, color, depthcueenable );
323385
324386            e2.x += dx2dy;
325387            e2.z += dz2dy;
r1037r1038
340402         dx1dy = (v2->x - v1->x)/dy;
341403         dz1dy = (v2->z - v1->z)/dy;
342404
343         crop = 0 - ystart;
405         crop = -ystart;
344406         if( crop>0 )
345407         {
346408            e1.x += dx1dy*crop;
347409            e1.z += dz1dy*crop;
348410            ystart = 0;
349411         }
350         if( yend>NAMCOS21_POLY_FRAME_HEIGHT-1 ) yend = NAMCOS21_POLY_FRAME_HEIGHT-1;
351
412         if( yend>NAMCOS21_POLY_FRAME_HEIGHT-1 )
413         {
414            yend = NAMCOS21_POLY_FRAME_HEIGHT-1;
415         }
352416         for( y=ystart; y<yend; y++ )
353417         {
354            renderscanline_flat( &e1, &e2, y, color );
418            renderscanline_flat( &e1, &e2, y, color, depthcueenable );
355419
356420            e2.x += dx2dy;
357421            e2.z += dz2dy;
r1037r1038
367431namcos21_DrawQuad( int sx[4], int sy[4], int zcode[4], int color )
368432{
369433   vertex a,b,c,d;
370
371   color &= 0x7fff;
372
373//      0x0000..0x1fff  sprite palettes (0x10 sets of 0x100 colors)
374//      0x2000..0x3fff  polygon palette bank0 (0x10 sets of 0x200 colors)
375//      0x4000..0x5fff  polygon palette bank1 (0x10 sets of 0x200 colors)
376//      0x6000..0x7fff  polygon palette bank2 (0x10 sets of 0x200 colors)
377
378   /* map color code to hardware pen */
379   switch( color>>8 )
434   int depthcueenable = 1;
435   /*
436        0x0000..0x1fff  sprite palettes (0x20 sets of 0x100 colors)
437        0x2000..0x3fff  polygon palette bank0 (0x10 sets of 0x200 colors or 0x20 sets of 0x100 colors)
438        0x4000..0x5fff  polygon palette bank1 (0x10 sets of 0x200 colors or 0x20 sets of 0x100 colors)
439        0x6000..0x7fff  polygon palette bank2 (0x10 sets of 0x200 colors or 0x20 sets of 0x100 colors)
440    */
441   if( namcos2_gametype == NAMCOS21_WINRUN91 ||
442       namcos2_gametype == NAMCOS21_DRIVERS_EYES )
380443   {
381   case 0:
382      color = 0x4000 - 0x400 + (color&0xff) + 0x100;
383      break;
384
385   case 2:
386      color = 0x4000 - 0x400 + (color&0xff) + 0x000;
387      break;
388
389   default:
390      /* unused? */
391      mame_printf_debug ( "unk col=0x%04x\n", color );
392      break;
444      color = 0x4000|(color&0xff);
393445   }
394
446   else
447   { /* map color code to hardware pen */
448      int code = color>>8;
449      if( code&0x80 )
450      {
451         color = color&0xff;
452         color = 0x3e00|color;
453      }
454      else
455      {
456         color&=0xff;
457         color = 0x3e00|color;
458         if( (code&0x02)==0 )
459         {
460            color|=0x100;
461         }
462      }
463   }
395464   a.x = sx[0];
396465   a.y = sy[0];
397466   a.z = zcode[0];
r1037r1038
408477   d.y = sy[3];
409478   d.z = zcode[3];
410479
411   rendertri( &a, &b, &c, color );
412   rendertri( &c, &d, &a, color );
480   rendertri( &a, &b, &c, color, depthcueenable );
481   rendertri( &c, &d, &a, color, depthcueenable );
413482} /* namcos21_DrawQuad */
src/mame/video/model3.c
r1037r1038
335335   }
336336}
337337
338#ifdef UNUSED_FUNCTION
338339static void copy_screen(mame_bitmap *bitmap, const rectangle *cliprect)
339340{
340341   int x,y;
r1037r1038
349350      }
350351   }
351352}
353#endif
352354
353355static int tick = 0;
354356static int debug_layer_disable = 0;
src/mame/video/vooddefs.h
r1037r1038
14731473   UINT8      frontbuf;            /* front buffer index */
14741474   UINT8      backbuf;            /* back buffer index */
14751475   UINT8      swaps_pending;         /* number of pending swaps */
1476   UINT8      video_changed;         /* did the frontbuffer video change? */
14761477
14771478   UINT32      yorigin;            /* Y origin subtract value */
14781479   UINT32      lfb_base;            /* base of LFB in memory */
r1037r1038
14801481
14811482   UINT32      width;               /* width of current frame buffer */
14821483   UINT32      height;               /* height of current frame buffer */
1484   UINT32      xoffs;               /* horizontal offset (back porch) */
1485   UINT32      yoffs;               /* vertical offset (back porch) */
1486   UINT32      vsyncscan;            /* vertical sync scanline */
14831487   UINT32      rowpixels;            /* pixels per row */
14841488   UINT32      tile_width;            /* width of video tiles */
14851489   UINT32      tile_height;         /* height of video tiles */
src/mame/video/afega.c
r1037r1038
186186
187187VIDEO_START( twinactn )
188188{
189   tilemap_0 = tilemap_create(   get_tile_info_0, afega_tilemap_scan_pages,
189   tilemap_0 = tilemap_create(   get_tile_info_0, twinactn_tilemap_scan_pages,
190190                        TILEMAP_TYPE_PEN,
191191                        16,16,
192192                        TWINACTN_TILES_PER_PAGE_X*TWINACTN_PAGES_PER_TMAP_X,TWINACTN_TILES_PER_PAGE_Y*TWINACTN_PAGES_PER_TMAP_Y);
src/mame/video/funworld.c
r1037r1038
1313    * Jolly Card (Austria),                     TAB-Austria,        1985.
1414    * Jolly Card (Austria, encrypted),          TAB-Austria,        1985.
1515    * Jolly Card (Croatia),                     Soft Design,        1993.
16    * Jolly Card (Italia, encrypted GFXs),      bootleg,            199?.
16    * Jolly Card (Italia, encrypted),           bootleg,            199?.
1717    * Jolly Card (Austria, Fun World, bootleg), Inter Games,        1995.
1818    * Big Deal (Hungary, set 1),                Fun World,          1990.
1919    * Big Deal (Hungary, set 2),                Fun World,          1990.
r1037r1038
2121    * Cuore 1 (Italia),                         C.M.C.,             1996.
2222    * Elephant Family (Italia, new),            C.M.C.,             1997.
2323    * Elephant Family (Italia, old),            C.M.C.,             1996.
24    * Pool 10 (Italia, set 1),                  C.M.C.,             1996.
25    * Pool 10 (Italia, set 2),                  C.M.C.,             1996.
26    * Tortuga Family (Italia),                  C.M.C.,             1997.
2427    * Royal Card (Austria, set 1),              TAB-Austria,        1991.
2528    * Royal Card (Austria, set 2),              TAB-Austria,        1991.
2629    * Royal Card (Slovakia, encrypted),         Evona Electronic,   1991.
2730    * Magic Card II (Bulgaria, bootleg),        Impera,             1996.
2831    * Joker Card (Ver.A267BC, encrypted),       Vesely Svet,        1993.
32    * Mongolfier New (Italia),                  bootleg,            199?.
33    * Soccer New (Italia),                      bootleg,            199?.
34    * Snooker 10 (Ver 1.11),                    Sandiy,             1998.
35    * Saloon (France, encrypted),               unknown,            199?.
2936
3037
3138***********************************************************************************/
src/mame/video/hng64.c
r1037r1038
2525
2626static void  matmul4( float *product, const float *a, const float *b ) ;
2727static void  vecmatmul4( float *product, const float *a, const float *b) ;
28static float vecDotProduct( const float *a, const float *b) ;
29static void normalize(float* x) ;
28//static float vecDotProduct( const float *a, const float *b) ;
29//static void normalize(float* x) ;
3030
3131// 3d helpers
3232static float uToF(UINT16 input) ;
3333static void SetIdentity(float *matrix) ;
3434
3535
36static void plot(INT32 x, INT32 y, INT32 color, mame_bitmap *bitmap) ;
37static void drawline2d(INT32 x0, INT32 y0, INT32 x1, INT32 y1, INT32 color, mame_bitmap *bitmap) ;
36//static void plot(INT32 x, INT32 y, INT32 color, mame_bitmap *bitmap) ;
37//static void drawline2d(INT32 x0, INT32 y0, INT32 x1, INT32 y1, INT32 color, mame_bitmap *bitmap) ;
3838
3939static float *depthBuffer ;
4040static struct polygon *polys ;
r1037r1038
356356
357357static void PerformFrustumClip(struct polygon *p) ;
358358
359static void DrawWireframe(struct polygon *p, mame_bitmap *bitmap) ;
359//static void DrawWireframe(struct polygon *p, mame_bitmap *bitmap) ;
360360static void DrawShaded(running_machine *machine, struct polygon *p, mame_bitmap *bitmap) ;
361361
362362
r1037r1038
13491349   product[3] = bi0 * a[3] + bi1 * a[7] + bi2 * a[11] + bi3 * a[15];
13501350}
13511351
1352#ifdef UNUSED_FUNCTION
13521353static float vecDotProduct( const float *a, const float *b)
13531354{
13541355   return ((a[0]*b[0]) + (a[1]*b[1]) + (a[2]*b[2])) ;
13551356}
1357#endif
13561358
13571359static void SetIdentity(float *matrix)
13581360{
r1037r1038
13821384   return retVal ;
13831385}
13841386
1387#ifdef UNUSED_FUNCTION
13851388static void normalize(float* x)
13861389{
13871390   double l2 = (x[0]*x[0]) + (x[1]*x[1]) + (x[2]*x[2]);
r1037r1038
13911394   x[1] = (float)(x[1] / l) ;
13921395   x[2] = (float)(x[2] / l) ;
13931396}
1397#endif
13941398
13951399
13961400
r1037r1038
15641568// wireframe rendering //
15651569/////////////////////////
15661570
1571#ifdef UNUSED_FUNCTION
15671572static void plot(INT32 x, INT32 y, INT32 color, mame_bitmap *bitmap)
15681573{
15691574   *BITMAP_ADDR32(bitmap, y, x) = MAKE_ARGB((UINT8)255, (UINT8)color, (UINT8)color, (UINT8)color) ;
r1037r1038
16471652    }
16481653    */
16491654}
1655#endif
16501656
16511657
16521658///////////////////////
src/mame/video/taito_f3.c
r1037r1038
207207#include "taito_f3.h"
208208#include "ui.h"
209209
210#define VERBOSE 0
210211#define DARIUSG_KLUDGE
211212//#define DEBUG_F3 1
212213
r1037r1038
33143315   /* Draw final framebuffer */
33153316   scanline_draw(machine, bitmap,cliprect);
33163317
3317//  print_debug_info(bitmap);
3318   if (VERBOSE)
3319      print_debug_info(bitmap);
33183320   return 0;
33193321}
src/mame/video/segasyse.c
r1037r1038
33********************************************************************************
44 driver by David Haywood
55
6 see (drivers/segasyse.c) for additional notes
6 this is currently only used by megaplay, and will soon be obsolete.
77
8 todo:
9
10 clean up megatech code, covert to rgb_direct? might be needed for megatech
11 some megatech games are also sms based so we'll need a way of supporting that
12 for now support has been quickly added while the menu system is worked out
13 megaplay has an sms vdp too
14
158*******************************************************************************/
169
1710#include "driver.h"
r1037r1038
3730
3831static int palette_base; // needed for megatech for now..
3932
40/*- in (drivers/segasyse.c) -*/
33UINT8 segae_vintpending;
34UINT8 segae_hintpending;
4135
42extern UINT8 segae_vintpending;
43extern UINT8 segae_hintpending;
44
4536/*-- Prototypes --*/
4637
4738static void vdp_start(running_machine *machine, UINT8 chip );
r1037r1038
6152 vhstart, vhstop and vhrefresh functions
6253*******************************************************************************/
6354
64VIDEO_START( segae )
65{
66   UINT8 temp;
67
68   palette_base = 0;
69
70   for (temp=0;temp<CHIPS;temp++)
71      vdp_start(machine, temp);
72
73   cache_bitmap = auto_malloc( (16+256+16) * 192); /* 16 pixels either side to simplify drawing */
74   memset(cache_bitmap, 0, (16+256+16) * 192);
75}
76
77VIDEO_UPDATE( segae )
78{
79   int i;
80
81   /*- Draw from cache_bitmap to screen -*/
82
83   for (i = 0;i < 192;i++)
84      draw_scanline8(bitmap,0,i,256,&cache_bitmap[i * (16+256+16) +16],&machine->pens[palette_base],15);
85   return 0;
86}
87
88/* these are used by megatech */
89
9055/* starts vdp for bios screen only */
91void megatech_start_video_normal(running_machine *machine)
56void megaplay_start_video_normal(running_machine *machine)
9257{
9358   palette_base = 0x40;
9459
r1037r1038
9762   cache_bitmap = auto_malloc( (16+256+16) * 192); /* 16 pixels either side to simplify drawing */
9863}
9964
100void megatech_update_video_normal(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect )
101{
102   int maxy = (cliprect->max_y > 192-1) ? 192-1 : cliprect->max_y;
103   int i;
104
105   /*- Draw from cache_bitmap to screen -*/
106
107   for (i = cliprect->min_y; i <= maxy;i++)
108      segae_drawscanline(i,0,0);
109
110   for (i = cliprect->min_y; i <= maxy;i++)
111      draw_scanline8(bitmap,0,i,256,&cache_bitmap[i * (16+256+16) +16],&machine->pens[palette_base],-1);
112}
113
11465void megaplay_update_video_normal(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect )
11566{
11667   int miny = (cliprect->min_y < 16) ? 16 : cliprect->min_y;
src/mame/video/pacman.c
r1037r1038
247247               spriteram[offs] & 1,spriteram[offs] & 2,
248248               sx,sy,
249249               &spriteclip,TRANSPARENCY_PENS,
250               colortable_get_transpen_mask(pacman_colortable, machine->gfx[1], color, 0));
250               colortable_get_transpen_mask(pacman_colortable, machine->gfx[1], color & 0x3f, 0));
251251
252252         /* also plot the sprite with wraparound (tunnel in Crush Roller) */
253253         drawgfx(bitmap,machine->gfx[1],
r1037r1038
256256               spriteram[offs] & 1,spriteram[offs] & 2,
257257               sx - 256,sy,
258258               &spriteclip,TRANSPARENCY_PENS,
259               colortable_get_transpen_mask(pacman_colortable, machine->gfx[1], color, 0));
259               colortable_get_transpen_mask(pacman_colortable, machine->gfx[1], color & 0x3f, 0));
260260      }
261261      /* In the Pac Man based games (NOT Pengo) the first two sprites must be offset */
262262      /* one pixel to the left to get a more correct placement */
r1037r1038
275275               spriteram[offs] & 1,spriteram[offs] & 2,
276276               sx,sy + xoffsethack,
277277               &spriteclip,TRANSPARENCY_PENS,
278               colortable_get_transpen_mask(pacman_colortable, machine->gfx[1], color, 0));
278               colortable_get_transpen_mask(pacman_colortable, machine->gfx[1], color & 0x3f, 0));
279279
280280         /* also plot the sprite with wraparound (tunnel in Crush Roller) */
281281         drawgfx(bitmap,machine->gfx[1],
r1037r1038
284284               spriteram[offs] & 2,spriteram[offs] & 1,
285285               sx - 256,sy + xoffsethack,
286286               &spriteclip,TRANSPARENCY_PENS,
287               colortable_get_transpen_mask(pacman_colortable, machine->gfx[1], color, 0));
287               colortable_get_transpen_mask(pacman_colortable, machine->gfx[1], color & 0x3f, 0));
288288      }
289289   }
290290
r1037r1038
570570
571571WRITE8_HANDLER( jrpacman_videoram_w )
572572{
573   if (videoram[offset] != data)
574   {
575      videoram[offset] = data;
576      jrpacman_mark_tile_dirty(offset);
577   }
573   videoram[offset] = data;
574   jrpacman_mark_tile_dirty(offset);
578575}
579576
580577WRITE8_HANDLER( jrpacman_charbank_w )
src/mame/video/srmp6.c
r0r1038
1/*
2    Super Real Mahjong P6 (JPN Ver.)
3    (c)1996 Seta
4
5WIP driver by Sebastien Volpe
6
7according prg ROM (offset $0fff80):
8
9    S12 SYSTEM
10    SUPER REAL MAJAN P6
11    SETA CO.,LTD
12    19960410
13    V1.00
14
15TODO:
16 - gfx decoding / emulation
17 - sound emulation (appears to be really close to st0016)
18
19Are there other games on this 'System S12' hardware ???
20
21---------------- dump infos ----------------
22
23[Jun/15/2000]
24
25Super Real Mahjong P6 (JPN Ver.)
26(c)1996 Seta
27
28SX011
29E47-REV01B
30
31CPU:    68000-16
32Sound:  NiLe
33OSC:    16.0000MHz
34        42.9545MHz
35        56.0000MHz
36
37Chips:  ST-0026 NiLe (video, sound)
38        ST-0017
39
40
41SX011-01.22  chr, samples (?)
42SX011-02.21
43SX011-03.20
44SX011-04.19
45SX011-05.18
46SX011-06.17
47SX011-07.16
48SX011-08.15
49
50SX011-09.10  68000 data
51
52SX011-10.4   68000 prg.
53SX011-11.5
54
55
56Dumped 06/15/2000
57*/
58
59#include "driver.h"
60#include "srmp6.h"
61
62/***************************************************************************
63    vidhrdw - VERY preliminary
64***************************************************************************/
65
66/* sprite RAM format: 8 words, 1st word = 0x8000 means end of list
67
68Offset:         Format:                     Value:
69
700000.w
71                    f--- ---- ---- ----     End of list
72                    -??? ???? ???? ???-
73                    ---- ---- ---- ---0     Sprite visible?
74
750002.w                                      Code
760004.w                                      X Position
770006.w                                      Y Position
78
790008.w                                      attributes/color?
80000a.w                                      attributes/color?
81
82000c.l                                      used ?
83
84cpu #0 (PC=00011B2A): unmapped program memory word write to 00400490 = 0001 & FFFF - sprite visible ?
85cpu #0 (PC=00011B2E): unmapped program memory word write to 00400492 = 0233 & FFFF - code
86cpu #0 (PC=00011B32): unmapped program memory word write to 00400494 = 00D8 & FFFF - x
87cpu #0 (PC=00011B36): unmapped program memory word write to 00400496 = 0080 & FFFF - y
88cpu #0 (PC=00011B3A): unmapped program memory word write to 00400498 = E000 & FFFF - attributes/color?
89cpu #0 (PC=00011B3E): unmapped program memory word write to 0040049A = 0000 & FFFF - attributes/color?
90cpu #0 (PC=00011B40): unmapped program memory word write to 0040049C = 0000 & FFFF -\
91cpu #0 (PC=00011B40): unmapped program memory word write to 0040049E = 0000 & FFFF -/ used ?
92
93cpu #0 (PC=00011B4E): unmapped program memory word write to 004004B0 = 8000 & FFFF - end of list
94*/
95
96/* tile RAM format: where's color ?
97
98cpu #0 (PC=000118E8): unmapped program memory word write to 00412002 = 0005 & FFFF - kind of init, interleaved with 'meaningful' words
99cpu #0 (PC=000118EE): unmapped program memory word write to 00412008 = 0000 & FFFF
100cpu #0 (PC=000118F4): unmapped program memory word write to 0041200A = 0000 & FFFF
101...
102cpu #0 (PC=000118E8): unmapped program memory word write to 00416EB2 = 0005 & FFFF
103cpu #0 (PC=000118EE): unmapped program memory word write to 00416EB8 = 0000 & FFFF
104cpu #0 (PC=000118F4): unmapped program memory word write to 00416EBA = 0000 & FFFF
105
106
107cpu #0 (PC=0001170A): unmapped program memory word write to 00412000 = 4004 & FFFF
108cpu #0 (PC=00011712): unmapped program memory word write to 00412004 = 0000 & FFFF
109cpu #0 (PC=0001171A): unmapped program memory word write to 00412006 = 0000 & FFFF
110...
111cpu #0 (PC=0001170A): unmapped program memory word write to 004133A0 = 4004 & FFFF - tile code [*]
112cpu #0 (PC=00011712): unmapped program memory word write to 004133A4 = 0140 & FFFF - x (00..140, step 16d) -> res = 320d
113cpu #0 (PC=0001171A): unmapped program memory word write to 004133A6 = 00E0 & FFFF - y (00..F0, step 16d)  -> res = 240d
114
115[*] tile code is 'incremented by 4', suggesting there are 4 8x8 tiles arranged to make a 16x16 one ???
116*/
117
118UINT16 *sprite_ram; // Sprite RAM 0x400000-0x47dfff
119UINT16 *sprite_ram_old; // Sprite RAM(previous frame)
120UINT16 *dec_regs;   //graphics decode register
121UINT16 *video_regs, *sound_regs;
122
123int brightness;       //fade in/out
124
125/***************************************************************************
126    Graphics definitions
127***************************************************************************/
128
129gfx_layout srmp6_layout_8x8 =
130{
131    8,8,
132    0x8000 / 4,
133    8,
134    { STEP8(0,1)},
135    { STEP8(0,8)},
136    { STEP8(0,8*8)},
137    8*8*8
138};
139
140//fade in/out
141void update_palette(void)
142{
143   char r, g ,b;
144   int brg = brightness - 0x60;
145   int i;
146
147   for(i = 0; i < 0x800; i++)
148   {
149      r = paletteram16[i] >>  0 & 0x1F;
150      g = paletteram16[i] >>  5 & 0x1F;
151      b = paletteram16[i] >> 10 & 0x1F;
152
153      if(brg < 0) {
154         r += (r * brg) >> 5;
155         if(r < 0) r = 0;
156         g += (g * brg) >> 5;
157         if(g < 0) g = 0;
158         b += (b * brg) >> 5;
159         if(b < 0) b = 0;
160      }
161      else if(brg > 0) {
162         r += ((0x1F - r) * brg) >> 5;
163         if(r > 0x1F) r = 0x1F;
164         g += ((0x1F - g) * brg) >> 5;
165         if(g > 0x1F) g = 0x1F;
166         b += ((0x1F - b) * brg) >> 5;
167         if(b > 0x1F) b = 0x1F;
168      }
169      palette_set_color(Machine, i, MAKE_RGB(r << 3, g << 3, b << 3));
170   }
171}
172
173VIDEO_START(srmp6)
174{
175   int i;
176
177   sprite_ram_old = auto_malloc(0x7E000);
178   memset(sprite_ram_old, 0x00, 0x7E000);
179
180   brightness = 0x60;
181
182   for(i=0;i<4;i++)
183   {
184      if(Machine->gfx[i])
185         freegfx(Machine->gfx[i]);
186      Machine->gfx[i] = allocgfx(&srmp6_layout_8x8);
187      if (!Machine->gfx[i])
188         return;
189      decodegfx(Machine->gfx[i], memory_region(REGION_GFX1) + (i << 19), 0, Machine->gfx[i]->total_elements);
190      Machine->gfx[i]->color_base = 0;
191      Machine->gfx[i]->total_colors = 0x800;
192   }
193}
194
195VIDEO_UPDATE(srmp6)
196{
197   int trans = TRANSPARENCY_PEN;
198   UINT16 *sprite_list = sprite_ram_old;
199   UINT16 *finish = sprite_list+0x1000;
200
201   fillbitmap(bitmap, get_black_pen(machine), cliprect);
202
203   // parse sprite list
204   while( sprite_list < finish && sprite_list[0] != 0x8000)
205   {
206      UINT16 *char_list = sprite_ram_old + sprite_list[1] * 0x8;
207      short char_count = sprite_list[0];
208      short xpos = sprite_list[2];
209      short ypos = sprite_list[3];
210      int color = sprite_list[4]&0x07;
211
212      if((sprite_list[5] & 0x700) == 0x700)
213      {
214         trans = TRANSPARENCY_ALPHA;
215         alpha_set_level((sprite_list[5] & 0x1F) << 3);
216      }
217      else
218      {
219         trans = TRANSPARENCY_PEN;
220         alpha_set_level(255);
221      }
222
223      while(char_count > 0)
224      {
225         int char_code, size_x, size_y, ax, ay;
226         int x_offset, y_offset, flipx, flipy;
227
228         char_code =  char_list[0];
229         size_x = 1 << (char_list[1] & 0x03);
230         size_y = 1 << (char_list[1] >> 2 & 0x03);
231         flipx = (char_list[1] >> 8) & 1;
232         flipy = (char_list[1] >> 9) & 1;
233
234         x_offset = char_list[2];
235         y_offset = char_list[3]-size_y*8;
236         for(ax=0;ax<size_x;ax++) {
237            for(ay=0;ay<size_y;ay++) {
238               int bx,by;
239
240               if(!flipx)
241                  bx = xpos + ax*8 + x_offset;
242               else
243                  bx = xpos + (size_x-ax-1)*8 + x_offset;
244               if(!flipy)
245                  by = ypos + ay*8 + y_offset;
246               else
247                  by = ypos + (size_y-ay-1)*8 + y_offset;
248
249               drawgfx(
250                  bitmap,
251                  Machine->gfx[char_code >> 13],
252                  char_code & 0x1fff,
253                  color,
254                  flipx,flipy,
255                  bx,by,
256                  cliprect,
257                  trans,0
258               );
259               char_code++;
260            }
261         }
262         char_list += 8;
263         char_count--;
264      }
265      sprite_list += 0x8;
266   }
267
268   memcpy(sprite_ram_old, sprite_ram, 0x7E000);
269   return 0;
270}
271
272WRITE16_HANDLER( video_regs_w )
273{
274   switch(offset)
275   {
276      case 0x5e/2: // bank switch, used by ROM check
277         logerror("Bankswitch %02X\n", data&0x0f);
278         memory_set_bankptr(1,(UINT16 *)(memory_region(REGION_USER2) + (data & 0x0f)*0x200000));
279         break;
280
281
282      // set by IT4
283      case 0x5c/2: // either 0x40 explicitely in many places, or according $2083b0 (IT4)
284         //fade in/out (0x40(dark)-0x60(normal)-0x7e?(bright) reset by 0x00?
285         data = (!data)?0x60:(data == 0x5e)?0x60:data;
286         if(brightness != data) {
287            brightness = data;
288            update_palette();
289         }
290         break;
291      /* unknown registers - there are others */
292
293      // set by IT4 (jsr $b3c), according flip screen dsw
294      case 0x48/2: //     0 /  0xb0 if flipscreen
295      case 0x52/2: //     0 / 0x2ef if flipscreen
296      case 0x54/2: // 0x152 / 0x15e if flipscreen
297
298      // set by IT4 ($82e-$846)
299      case 0x56/2: // written 8,9,8,9 successively
300         break;
301      case 0x5a/2:
302         // graphics decode register write enable/disable flag?
303         /* disable by 0x00, enable by 0x01 */
304         /* the game program writes 0x02 to 0x4c000c */
305         /* to disable register write while decoding*/
306         /* currently it's meaningless as we decode frame by frame */
307         video_regs[0x0c/2] = data <<1;
308         break;
309      default:
310//          logerror("video_regs_w (PC=%06X): %04x = %04x & %04x\n", activecpu_get_previouspc(), offset*2, data, mem_mask);
311         break;
312   }
313   COMBINE_DATA(&video_regs[offset]);
314}
315
316READ16_HANDLER( video_regs_r )
317{
318   return video_regs[offset];
319}
320
321//decode the graphic data
322void decode_gfx( UINT32 table_address, UINT32 data_address, UINT32 gfx_size, UINT32 mem_offset)
323{
324   UINT8  *src   = memory_region(REGION_USER3) , *dst = memory_region(REGION_GFX1) + mem_offset;
325   UINT16 *table = (UINT16 *)(src + table_address);
326   UINT8  *data  = src + data_address;
327   UINT8  *end   = dst + gfx_size;
328
329   UINT8 loop_count, block_size, block_count, block[0x10];
330   UINT32 pal, prev_pal=~0, table_flag, pal_flag=0;
331
332   while(1)
333   {
334      block_size=0;
335
336      table_flag = *(data++) | 0x100;
337      while(!(table_flag & 0x10000)) {
338         if(table_flag & 0x80) {
339            *((UINT16 *)&block[block_size]) = table[*(data++)];
340            block_size+=2;
341         }
342         else {
343            block[block_size++]= *(data++);
344         }
345         table_flag<<=1;
346      }
347
348      block_count = 0;
349      while(block_count != block_size) {
350         pal = block[block_count++];
351         if(pal_flag) {
352            loop_count = pal + 1;
353            pal = prev_pal;
354            while(loop_count) {
355               *(dst++) = pal; loop_count--;
356               if(dst == end) return;
357            }
358            pal_flag = 0;
359         }
360         else {
361            *(dst++) = pal;
362            if(dst == end) return;
363            if(pal == prev_pal) {
364               if(block_count < block_size) {
365                  loop_count = block[block_count++] + 1;
366                  while(loop_count) {
367                     *(dst++) = pal; loop_count--;
368                     if(dst == end) return;
369                  }
370               }
371               else
372                  pal_flag=1;
373            }
374            prev_pal = pal;
375         }
376      }
377   }
378}
379
380WRITE16_HANDLER( gfx_decode_w )
381{
382   int i;
383   int table_address, table_size, data_address, gfx_size, page_index;
384   COMBINE_DATA(&dec_regs[offset]);
385
386   // check if write protection of graphic decode memory is disabled
387   if(offset == 0x0d && video_regs[0x5a/2] == 0x0001) {
388      table_size    = dec_regs[0] + 1;
389      table_address = ((dec_regs[5] << 16) | dec_regs[4]) << 1;
390      gfx_size      = (((dec_regs[7] & 3) << 16) | (dec_regs[6]+1)) << 2;
391      page_index    = dec_regs[9] >> 1;
392      data_address  = ((dec_regs[11] << 16) | dec_regs[10]) << 1;
393
394      if(( table_address >= 0xc00000 && table_address < 0x2000000) &&
395         ( data_address  >= 0xc00000 && data_address  < 0x2000000) &&
396         ( table_size    >  0x000000 && table_size    < 0x81))
397      {
398/*
399            logerror("number of word table?@?@?@?@?@?@%08X\n",   table_size);
400            logerror("word table address?@?@?@%08X\n",   table_address);
401            logerror("decode data size?@?@?@?@%08X\n",   gfx_size);
402            logerror("decode page index?@%08X\n",   page_index);
403            logerror("decode data address?@?@?@%08X\n\n", data_address);
404*/
405         decode_gfx( table_address - 0xc00000, data_address - 0xc00000, gfx_size, page_index << 19);
406
407         for(i=0; gfx_size >= 0; gfx_size -= 0x80000, i++)
408         {
409            freegfx(Machine->gfx[page_index+i]);
410            Machine->gfx[page_index+i] = allocgfx(&srmp6_layout_8x8);
411            if (!Machine->gfx[page_index+i])
412               return;
413            decodegfx(Machine->gfx[page_index+i], memory_region(REGION_GFX1) + ((page_index+i) << 19), 0, Machine->gfx[page_index+i]->total_elements);
414            Machine->gfx[page_index+i]->color_base = 0;
415            Machine->gfx[page_index+i]->total_colors = 0x800;
416         }
417      }
418   }
419}
420
421READ16_HANDLER( srmp6_sprite_r )
422{
423   return sprite_ram[offset];
424}
425
426WRITE16_HANDLER( srmp6_sprite_w )
427{
428   COMBINE_DATA(&sprite_ram[offset]);
429}
430
431WRITE16_HANDLER(paletteram_w)
432{
433   char r, g, b;
434   int brg = brightness - 0x60;
435
436   paletteram16_xBBBBBGGGGGRRRRR_word_w(offset, data, mem_mask);
437
438   if(brg)
439   {
440      r = data >>  0 & 0x1F;
441      g = data >>  5 & 0x1F;
442      b = data >> 10 & 0x1F;
443
444      if(brg < 0) {
445         r += (r * brg) >> 5;
446         if(r < 0) r = 0;
447         g += (g * brg) >> 5;
448         if(g < 0) g = 0;
449         b += (b * brg) >> 5;
450         if(b < 0) b = 0;
451      }
452      else if(brg > 0) {
453         r += ((0x1F - r) * brg) >> 5;
454         if(r > 0x1F) r = 0x1F;
455         g += ((0x1F - g) * brg) >> 5;
456         if(g > 0x1F) g = 0x1F;
457         b += ((0x1F - b) * brg) >> 5;
458         if(b > 0x1F) b = 0x1F;
459      }
460
461      palette_set_color(Machine, offset, MAKE_RGB(r << 3, g << 3, b << 3));
462   }
463}
464
src/mame/video/genesis.c
r1037r1038
1111#include "genesis.h"
1212
1313/* in video/segasyse.c */
14void megatech_start_video_normal(running_machine *machine);
15void megatech_update_video_normal(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect );
14void megaplay_start_video_normal(running_machine *machine);
1615void megaplay_update_video_normal(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect );
1716
1817int genesis_screen_number;
r1037r1038
219218}
220219
221220
222VIDEO_START( megatech )
223{
224   start_genesis_vdp(1);
225221
226   megatech_start_video_normal(machine);
227}
228222
229223
230VIDEO_START( megaplay )
231{
232   start_genesis_vdp(0);
233224
234   megatech_start_video_normal(machine);
235}
236
237
238225void start_system18_vdp(void)
239226{
240227   start_genesis_vdp(0);
r1037r1038
290277}
291278
292279
293VIDEO_UPDATE( megatech )
294{
295   int y;
296280
297   if (screen ==1)
298   {
299      /* generate the final screen */
300      for (y = 0; y <= cliprect->max_y; y++)
301         drawline(BITMAP_ADDR16(bitmap, y, 0), y, 0);
302   }
303   else if (screen==0)
304   {
305      megatech_update_video_normal(machine, bitmap, cliprect);
306   }
307   return 0;
308}
309281
310282/* megaplay, draws either Genesis or SMS (single screen display) */
311283
r1037r1038
11371109******************************************************************************/
11381110
11391111/* draw a non-horizontally-flipped section of a sprite */
1140INLINE void draw8pixs(UINT16 *bmap, int patno, int priority, int colbase, int patline)
1112INLINE void draw8pixs(UINT16 *bmap, int sxpos, int patno, int priority, int colbase, int patline)
11411113{
11421114   UINT32 tile = *(UINT32 *)&VDP_VRAM_BYTE(patno * 32 + 4 * patline);
11431115   int col;
r1037r1038
11491121   /* non-transparent */
11501122   if ((colbase & 0x30) != 0x30 || !(genesis_vdp_regs[12] & 0x08))
11511123   {
1152      col = EXTRACT_PIXEL(tile, 0); if (col) bmap[0] = colbase + col;
1153      col = EXTRACT_PIXEL(tile, 1); if (col) bmap[1] = colbase + col;
1154      col = EXTRACT_PIXEL(tile, 2); if (col) bmap[2] = colbase + col;
1155      col = EXTRACT_PIXEL(tile, 3); if (col) bmap[3] = colbase + col;
1156      col = EXTRACT_PIXEL(tile, 4); if (col) bmap[4] = colbase + col;
1157      col = EXTRACT_PIXEL(tile, 5); if (col) bmap[5] = colbase + col;
1158      col = EXTRACT_PIXEL(tile, 6); if (col) bmap[6] = colbase + col;
1159      col = EXTRACT_PIXEL(tile, 7); if (col) bmap[7] = colbase + col;
1124      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 0); if (col) bmap[sxpos] = colbase + col; } sxpos++;
1125      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 1); if (col) bmap[sxpos] = colbase + col; } sxpos++;
1126      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 2); if (col) bmap[sxpos] = colbase + col; } sxpos++;
1127      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 3); if (col) bmap[sxpos] = colbase + col; } sxpos++;
1128      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 4); if (col) bmap[sxpos] = colbase + col; } sxpos++;
1129      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 5); if (col) bmap[sxpos] = colbase + col; } sxpos++;
1130      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 6); if (col) bmap[sxpos] = colbase + col; } sxpos++;
1131      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 7); if (col) bmap[sxpos] = colbase + col; } sxpos++;
11601132   }
11611133
11621134   /* transparent */
11631135   else
11641136   {
1165      col = EXTRACT_PIXEL(tile, 0);
1166      if (col)
1167      {
1168         if (col < 0x0e) bmap[0] = colbase + col;
1169         else bmap[0] = transparent_lookup[((col & 1) << 11) | (bmap[0] & 0x7ff)];
1170      }
1171      col = EXTRACT_PIXEL(tile, 1);
1172      if (col)
1173      {
1174         if (col < 0x0e) bmap[1] = colbase + col;
1175         else bmap[1] = transparent_lookup[((col & 1) << 11) | (bmap[1] & 0x7ff)];
1176      }
1177      col = EXTRACT_PIXEL(tile, 2);
1178      if (col)
1179      {
1180         if (col < 0x0e) bmap[2] = colbase + col;
1181         else bmap[2] = transparent_lookup[((col & 1) << 11) | (bmap[2] & 0x7ff)];
1182      }
1183      col = EXTRACT_PIXEL(tile, 3);
1184      if (col)
1185      {
1186         if (col < 0x0e) bmap[3] = colbase + col;
1187         else bmap[3] = transparent_lookup[((col & 1) << 11) | (bmap[3] & 0x7ff)];
1188      }
1189      col = EXTRACT_PIXEL(tile, 4);
1190      if (col)
1191      {
1192         if (col < 0x0e) bmap[4] = colbase + col;
1193         else bmap[4] = transparent_lookup[((col & 1) << 11) | (bmap[4] & 0x7ff)];
1194      }
1195      col = EXTRACT_PIXEL(tile, 5);
1196      if (col)
1197      {
1198         if (col < 0x0e) bmap[5] = colbase + col;
1199         else bmap[5] = transparent_lookup[((col & 1) << 11) | (bmap[5] & 0x7ff)];
1200      }
1201      col = EXTRACT_PIXEL(tile, 6);
1202      if (col)
1203      {
1204         if (col < 0x0e) bmap[6] = colbase + col;
1205         else bmap[6] = transparent_lookup[((col & 1) << 11) | (bmap[6] & 0x7ff)];
1206      }
1207      col = EXTRACT_PIXEL(tile, 7);
1208      if (col)
1209      {
1210         if (col < 0x0e) bmap[7] = colbase + col;
1211         else bmap[7] = transparent_lookup[((col & 1) << 11) | (bmap[7] & 0x7ff)];
1212      }
1137      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 0); if (col) { if (col < 0x0e) bmap[sxpos] = colbase + col; else bmap[sxpos] = transparent_lookup[((col & 1) << 11) | (bmap[sxpos] & 0x7ff)]; }} sxpos++;
1138      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 1); if (col) { if (col < 0x0e) bmap[sxpos] = colbase + col; else bmap[sxpos] = transparent_lookup[((col & 1) << 11) | (bmap[sxpos] & 0x7ff)]; }} sxpos++;
1139      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 2); if (col) { if (col < 0x0e) bmap[sxpos] = colbase + col; else bmap[sxpos] = transparent_lookup[((col & 1) << 11) | (bmap[sxpos] & 0x7ff)]; }} sxpos++;
1140      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 3); if (col) { if (col < 0x0e) bmap[sxpos] = colbase + col; else bmap[sxpos] = transparent_lookup[((col & 1) << 11) | (bmap[sxpos] & 0x7ff)]; }} sxpos++;
1141      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 4); if (col) { if (col < 0x0e) bmap[sxpos] = colbase + col; else bmap[sxpos] = transparent_lookup[((col & 1) << 11) | (bmap[sxpos] & 0x7ff)]; }} sxpos++;
1142      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 5); if (col) { if (col < 0x0e) bmap[sxpos] = colbase + col; else bmap[sxpos] = transparent_lookup[((col & 1) << 11) | (bmap[sxpos] & 0x7ff)]; }} sxpos++;
1143      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 6); if (col) { if (col < 0x0e) bmap[sxpos] = colbase + col; else bmap[sxpos] = transparent_lookup[((col & 1) << 11) | (bmap[sxpos] & 0x7ff)]; }} sxpos++;
1144      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 7); if (col) { if (col < 0x0e) bmap[sxpos] = colbase + col; else bmap[sxpos] = transparent_lookup[((col & 1) << 11) | (bmap[sxpos] & 0x7ff)]; }} sxpos++;
12131145   }
12141146}
12151147
12161148
12171149/* draw a horizontally-flipped section of a sprite */
1218INLINE void draw8pixs_hflip(UINT16 *bmap, int patno, int priority, int colbase, int patline)
1150INLINE void draw8pixs_hflip(UINT16 *bmap, int sxpos, int patno, int priority, int colbase, int patline)
12191151{
12201152   UINT32 tile = *(UINT32 *)&VDP_VRAM_BYTE(patno * 32 + 4 * patline);
12211153   int col;
r1037r1038
12271159   /* non-transparent */
12281160   if ((colbase & 0x30) != 0x30 || !(genesis_vdp_regs[12] & 0x08))
12291161   {
1230      col = EXTRACT_PIXEL(tile, 7); if (col) bmap[0] = colbase + col;
1231      col = EXTRACT_PIXEL(tile, 6); if (col) bmap[1] = colbase + col;
1232      col = EXTRACT_PIXEL(tile, 5); if (col) bmap[2] = colbase + col;
1233      col = EXTRACT_PIXEL(tile, 4); if (col) bmap[3] = colbase + col;
1234      col = EXTRACT_PIXEL(tile, 3); if (col) bmap[4] = colbase + col;
1235      col = EXTRACT_PIXEL(tile, 2); if (col) bmap[5] = colbase + col;
1236      col = EXTRACT_PIXEL(tile, 1); if (col) bmap[6] = colbase + col;
1237      col = EXTRACT_PIXEL(tile, 0); if (col) bmap[7] = colbase + col;
1162      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 7); if (col) bmap[sxpos] = colbase + col; } sxpos++;
1163      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 6); if (col) bmap[sxpos] = colbase + col; } sxpos++;
1164      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 5); if (col) bmap[sxpos] = colbase + col; } sxpos++;
1165      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 4); if (col) bmap[sxpos] = colbase + col; } sxpos++;
1166      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 3); if (col) bmap[sxpos] = colbase + col; } sxpos++;
1167      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 2); if (col) bmap[sxpos] = colbase + col; } sxpos++;
1168      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 1); if (col) bmap[sxpos] = colbase + col; } sxpos++;
1169      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 0); if (col) bmap[sxpos] = colbase + col; } sxpos++;
12381170   }
12391171
12401172   /* transparent */
12411173   else
12421174   {
1243      col = EXTRACT_PIXEL(tile, 7);
1244      if (col)
1245      {
1246         if (col < 0x0e) bmap[0] = colbase + col;
1247         else bmap[0] = transparent_lookup[((col & 1) << 11) | (bmap[0] & 0x7ff)];
1248      }
1249      col = EXTRACT_PIXEL(tile, 6);
1250      if (col)
1251      {
1252         if (col < 0x0e) bmap[1] = colbase + col;
1253         else bmap[1] = transparent_lookup[((col & 1) << 11) | (bmap[1] & 0x7ff)];
1254      }
1255      col = EXTRACT_PIXEL(tile, 5);
1256      if (col)
1257      {
1258         if (col < 0x0e) bmap[2] = colbase + col;
1259         else bmap[2] = transparent_lookup[((col & 1) << 11) | (bmap[2] & 0x7ff)];
1260      }
1261      col = EXTRACT_PIXEL(tile, 4);
1262      if (col)
1263      {
1264         if (col < 0x0e) bmap[3] = colbase + col;
1265         else bmap[3] = transparent_lookup[((col & 1) << 11) | (bmap[3] & 0x7ff)];
1266      }
1267      col = EXTRACT_PIXEL(tile, 3);
1268      if (col)
1269      {
1270         if (col < 0x0e) bmap[4] = colbase + col;
1271         else bmap[4] = transparent_lookup[((col & 1) << 11) | (bmap[4] & 0x7ff)];
1272      }
1273      col = EXTRACT_PIXEL(tile, 2);
1274      if (col)
1275      {
1276         if (col < 0x0e) bmap[5] = colbase + col;
1277         else bmap[5] = transparent_lookup[((col & 1) << 11) | (bmap[5] & 0x7ff)];
1278      }
1279      col = EXTRACT_PIXEL(tile, 1);
1280      if (col)
1281      {
1282         if (col < 0x0e) bmap[6] = colbase + col;
1283         else bmap[6] = transparent_lookup[((col & 1) << 11) | (bmap[6] & 0x7ff)];
1284      }
1285      col = EXTRACT_PIXEL(tile, 0);
1286      if (col)
1287      {
1288         if (col < 0x0e) bmap[7] = colbase + col;
1289         else bmap[7] = transparent_lookup[((col & 1) << 11) | (bmap[7] & 0x7ff)];
1290      }
1175      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 7); if (col) { if (col < 0x0e) bmap[sxpos] = colbase + col; else bmap[sxpos] = transparent_lookup[((col & 1) << 11) | (bmap[sxpos] & 0x7ff)]; }} sxpos++;
1176      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 6); if (col) { if (col < 0x0e) bmap[sxpos] = colbase + col; else bmap[sxpos] = transparent_lookup[((col & 1) << 11) | (bmap[sxpos] & 0x7ff)]; }} sxpos++;
1177      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 5); if (col) { if (col < 0x0e) bmap[sxpos] = colbase + col; else bmap[sxpos] = transparent_lookup[((col & 1) << 11) | (bmap[sxpos] & 0x7ff)]; }} sxpos++;
1178      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 4); if (col) { if (col < 0x0e) bmap[sxpos] = colbase + col; else bmap[sxpos] = transparent_lookup[((col & 1) << 11) | (bmap[sxpos] & 0x7ff)]; }} sxpos++;
1179      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 3); if (col) { if (col < 0x0e) bmap[sxpos] = colbase + col; else bmap[sxpos] = transparent_lookup[((col & 1) << 11) | (bmap[sxpos] & 0x7ff)]; }} sxpos++;
1180      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 2); if (col) { if (col < 0x0e) bmap[sxpos] = colbase + col; else bmap[sxpos] = transparent_lookup[((col & 1) << 11) | (bmap[sxpos] & 0x7ff)]; }} sxpos++;
1181      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 1); if (col) { if (col < 0x0e) bmap[sxpos] = colbase + col; else bmap[sxpos] = transparent_lookup[((col & 1) << 11) | (bmap[sxpos] & 0x7ff)]; }} sxpos++;
1182      if (sxpos>=0 && sxpos<BITMAP_WIDTH) { col = EXTRACT_PIXEL(tile, 0); if (col) { if (col < 0x0e) bmap[sxpos] = colbase + col; else bmap[sxpos] = transparent_lookup[((col & 1) << 11) | (bmap[sxpos] & 0x7ff)]; }} sxpos++;
12911183   }
12921184}
12931185
r1037r1038
13201212   spriteheight >>= 3;
13211213
13221214   /* switch off the flip mode */
1323   bmap += spritexpos;
13241215   switch (patflip)
13251216   {
13261217      case 0x00: /* No Flip */
1327         for (x = 0; x < spritewidth; x++, bmap += 8)
1218         for (x = 0; x < spritewidth; x++)
13281219         {
13291220            if (spritexpos >= -7 && spritexpos < BITMAP_WIDTH)
1330               draw8pixs(bmap, patno, priority, colbase, patline);
1221               draw8pixs(bmap, spritexpos, patno, priority, colbase, patline);
13311222            spritexpos += 8;
13321223            patno += spriteheight;
13331224         }
r1037r1038
13351226
13361227      case 0x01: /* Horizontal Flip */
13371228         patno += spriteheight * (spritewidth - 1);
1338         for (x = 0; x < spritewidth; x++, bmap += 8)
1229         for (x = 0; x < spritewidth; x++)
13391230         {
13401231            if (spritexpos >= -7 && spritexpos < BITMAP_WIDTH)
1341               draw8pixs_hflip(bmap, patno, priority, colbase, patline);
1232               draw8pixs_hflip(bmap, spritexpos, patno, priority, colbase, patline);
13421233            spritexpos += 8;
13431234            patno -= spriteheight;
13441235         }
r1037r1038
13461237
13471238      case 0x02: /* Vertical Flip */
13481239         patline = 8 * spriteheight - patline - 1;
1349         for (x = 0; x < spritewidth; x++, bmap += 8)
1240         for (x = 0; x < spritewidth; x++)
13501241         {
13511242            if (spritexpos >= -7 && spritexpos < BITMAP_WIDTH)
1352               draw8pixs(bmap, patno, priority, colbase, patline);
1243               draw8pixs(bmap, spritexpos, patno, priority, colbase, patline);
13531244            spritexpos += 8;
13541245            patno += spriteheight;
13551246         }
r1037r1038
13581249      case 0x03: /* Both Flip */
13591250         patno += spriteheight * (spritewidth - 1);
13601251         patline = 8 * spriteheight - patline - 1;
1361         for (x = 0; x < spritewidth; x++, bmap += 8)
1252         for (x = 0; x < spritewidth; x++)
13621253         {
13631254            if (spritexpos >= -7 && spritexpos < BITMAP_WIDTH)
1364               draw8pixs_hflip(bmap, patno, priority, colbase, patline);
1255               draw8pixs_hflip(bmap, spritexpos, patno, priority, colbase, patline);
13651256            spritexpos += 8;
13661257            patno -= spriteheight;
13671258         }
src/mame/layout/videopin.lay
r0r1038
1<mamelayout version="2">
2   <element name="lamp" defstate="0">
3      <disk state="1">
4         <color red="1.0" green="0.125" blue="0.125" />
5      </disk>
6   </element>
7   <view name="LEDs">
8      <screen index="0">
9         <bounds x="0" y="0" width="300" height="400" />
10      </screen>
11      <backdrop name="LED01" element="lamp">
12                  <bounds x="34" y="36" width="7" height="7" />
13      </backdrop>
14      <backdrop name="LED02" element="lamp">
15                  <bounds x="15" y="43" width="7" height="7" />
16      </backdrop>
17      <backdrop name="LED03" element="lamp">
18                  <bounds x="12" y="65" width="7" height="7" />
19      </backdrop>
20      <backdrop name="LED04" element="lamp">
21                  <bounds x="50" y="73" width="7" height="7" />
22      </backdrop>
23      <backdrop name="LED05" element="lamp">
24                  <bounds x="103" y="48" width="7" height="7" />
25      </backdrop>
26      <backdrop name="LED06" element="lamp">
27                  <bounds x="131" y="33" width="7" height="7" />
28      </backdrop>
29      <backdrop name="LED07" element="lamp">
30                  <bounds x="158" y="47" width="7" height="7" />
31      </backdrop>
32      <backdrop name="LED08" element="lamp">
33                  <bounds x="222" y="102" width="7" height="7" />
34      </backdrop>
35      <backdrop name="LED09" element="lamp">
36                  <bounds x="18" y="117" width="7" height="7" />
37      </backdrop>
38      <backdrop name="LED10" element="lamp">
39                  <bounds x="7" y="140" width="7" height="7" />
40      </backdrop>
41      <backdrop name="LED11" element="lamp">
42                  <bounds x="21" y="163" width="7" height="7" />
43      </backdrop>
44      <backdrop name="LED12" element="lamp">
45                  <bounds x="126" y="132" width="7" height="7" />
46      </backdrop>
47      <backdrop name="LED13" element="lamp">
48                  <bounds x="190" y="133" width="7" height="7" />
49      </backdrop>
50      <backdrop name="LED14" element="lamp">
51                  <bounds x="8" y="252" width="7" height="7" />
52      </backdrop>
53      <backdrop name="LED15" element="lamp">
54                  <bounds x="38" y="251" width="7" height="7" />
55      </backdrop>
56      <backdrop name="LED16" element="lamp">
57                  <bounds x="67" y="229" width="7" height="7" />
58      </backdrop>
59      <backdrop name="LED17" element="lamp">
60                  <bounds x="125" y="246" width="7" height="7" />
61      </backdrop>
62      <backdrop name="LED18" element="lamp">
63                  <bounds x="125" y="256" width="7" height="7" />
64      </backdrop>
65      <backdrop name="LED19" element="lamp">
66                  <bounds x="125" y="265" width="7" height="7" />
67      </backdrop>
68      <backdrop name="LED20" element="lamp">
69                  <bounds x="125" y="275" width="7" height="7" />
70      </backdrop>
71      <backdrop name="LED21" element="lamp">
72                  <bounds x="125" y="285" width="7" height="7" />
73      </backdrop>
74      <backdrop name="LED22" element="lamp">
75                  <bounds x="125" y="295" width="7" height="7" />
76      </backdrop>
77      <backdrop name="LED23" element="lamp">
78                  <bounds x="125" y="304" width="7" height="7" />
79      </backdrop>
80      <backdrop name="LED24" element="lamp">
81                  <bounds x="125" y="314" width="7" height="7" />
82      </backdrop>
83      <backdrop name="LED25" element="lamp">
84                  <bounds x="125" y="324" width="7" height="7" />
85      </backdrop>
86      <backdrop name="LED26" element="lamp">
87                  <bounds x="125" y="334" width="7" height="7" />
88      </backdrop>
89      <backdrop name="LED27" element="lamp">
90                  <bounds x="186" y="229" width="7" height="7" />
91      </backdrop>
92      <backdrop name="LED28" element="lamp">
93                  <bounds x="197" y="288" width="7" height="7" />
94      </backdrop>
95      <backdrop name="LED29" element="lamp">
96                  <bounds x="141" y="366" width="7" height="7" />
97      </backdrop>
98   </view>
99</mamelayout>
src/mame/drivers/bublbobl.c
r1037r1038
10111011
10121012   ROM_REGION( 0x0100, REGION_PROMS, 0 )
10131013   ROM_LOAD( "a71-25.41",    0x0000, 0x0100, CRC(2d0f8545) SHA1(089c31e2f614145ef2743164f7b52ae35bc06808) )   /* video timing */
1014
1015    /* Located on CPU/Sound Board */
1016   ROM_REGION( 0x0003, REGION_PLDS, ROMREGION_DISPOSE )
1017   ROM_LOAD( "pal16l8.bin",  0x0000, 0x0001, NO_DUMP ) /* Located at IC49 */
1018    ROM_LOAD( "pal16l8.bin",  0x0000, 0x0001, NO_DUMP ) /* Located at IC43 */
1019    ROM_LOAD( "pal16r4.bin",  0x0000, 0x0001, NO_DUMP ) /* Located at IC12 */
10141020ROM_END
10151021
10161022/*
r1037r1038
10541060
10551061   ROM_REGION( 0x0100, REGION_PROMS, 0 )
10561062   ROM_LOAD( "a71-25.41",    0x0000, 0x0100, CRC(2d0f8545) SHA1(089c31e2f614145ef2743164f7b52ae35bc06808) )   /* video timing */
1063
1064    /* Located on CPU/Sound Board */
1065   ROM_REGION( 0x0003, REGION_PLDS, ROMREGION_DISPOSE )
1066   ROM_LOAD( "pal16l8.bin",  0x0000, 0x0001, NO_DUMP ) /* Located at IC49 */
1067    ROM_LOAD( "pal16l8.bin",  0x0000, 0x0001, NO_DUMP ) /* Located at IC43 */
1068    ROM_LOAD( "pal16r4.bin",  0x0000, 0x0001, NO_DUMP ) /* Located at IC12 */
10571069ROM_END
10581070
10591071/*
r1037r1038
10971109
10981110   ROM_REGION( 0x0100, REGION_PROMS, 0 )
10991111   ROM_LOAD( "a71-25.41",    0x0000, 0x0100, CRC(2d0f8545) SHA1(089c31e2f614145ef2743164f7b52ae35bc06808) )   /* video timing */
1112
1113    /* Located on CPU/Sound Board */
1114   ROM_REGION( 0x0003, REGION_PLDS, ROMREGION_DISPOSE )
1115   ROM_LOAD( "pal16l8.bin",  0x0000, 0x0001, NO_DUMP ) /* Located at IC49 */
1116    ROM_LOAD( "pal16l8.bin",  0x0000, 0x0001, NO_DUMP ) /* Located at IC43 */
1117    ROM_LOAD( "pal16r4.bin",  0x0000, 0x0001, NO_DUMP ) /* Located at IC12 */
11001118ROM_END
11011119
11021120/*
r1037r1038
11401158
11411159   ROM_REGION( 0x0100, REGION_PROMS, 0 )
11421160   ROM_LOAD( "a71-25.41",    0x0000, 0x0100, CRC(2d0f8545) SHA1(089c31e2f614145ef2743164f7b52ae35bc06808) )   /* video timing */
1161
1162    /* Located on CPU/Sound Board */
1163   ROM_REGION( 0x0003, REGION_PLDS, ROMREGION_DISPOSE )
1164   ROM_LOAD( "pal16l8.bin",  0x0000, 0x0001, NO_DUMP ) /* Located at IC49 */
1165    ROM_LOAD( "pal16l8.bin",  0x0000, 0x0001, NO_DUMP ) /* Located at IC43 */
1166    ROM_LOAD( "pal16r4.bin",  0x0000, 0x0001, NO_DUMP ) /* Located at IC12 */
11431167ROM_END
11441168
11451169ROM_START( boblbobl )
src/mame/drivers/lgp.c
r0r1038
1/*
2Taito Laser Grand Prix laserdisc hardware
3Driver by Andrew Gardner with help from Daphne Source
4
5Notes:
6    Engrish abounds.
7
8Todo:
9    Sound.
10    Figure out palette.
11    Figure out when NMI fires & hook it up.
12    Convert to tilemaps - hook up control_ram properly.
13    Plenty of missing writes.
14    Figure out inputs:
15        High score reset switch.
16        Score display + time display + today's ranking (on LED panel).
17        1 wheel + "pulse cam" (analog)
18        1 accelerator pedal = pot (analog)
19        1 break pedal = switch
20        1 shifter (two settings - two switches)
21        "VR-1" pot that says it "adjusts the video synchronisation"
22
23Dumping Notes:
24    Dumped by italiandoh on January, 27th, 2005.
25
26    CPU PCB | J10 00041B, K10 00202B, M4200366B
27    1 x Z80-A CPU
28    1 x 8 MHz xtal
29    2 x 6116
30    4 x 2114-2
31    2 x RCA CDP1855CDX 201
32    3 x 8 dip switches bank
33    1 x 1 kohm trimmer
34
35    Chip    Label
36    2764    A02_01, A02_02, A02_03, A02_04, A02_41
37    2732    A02_05
38    27128   A02_06, A02_07, A02_08, A02_09, A02_10, A02_11, A02_12, A02_13, A02_14, A02_15, A02_16, A02_17
39    82S129  A02_31, A02_33, A02_34, A02_32
40
41    --------------------------------
42
43    OBJ PCB | J10 00042B, K10 00203B
44    10 x TMS4416-15NL
45    1 x 20 MHz xtal
46
47    Chip    Label
48    2764    A02_18
49    27128   A02_19, A02_20, A02_21, A02_22, A02_23, A02_24, A02_25, A02_26, A02_27, A02_28
50    82S123  A02_37
51    82S129  A02_35, A02_36, A02_38, A02_39, A02_40
52
53    --------------------------------
54
55    SOUND PCB | J20 00002B, K20 00032B
56    1 x Z80-A CPU
57    1 x 6 MHx xtal
58    2 x 2114-2
59    3 x GI SOUND AY-3-8910
60
61    Chip    Label
62    2764    A02_29, A02_30
63*/
64
65
66#include "driver.h"
67#include "render.h"
68#include "machine/laserdsc.h"
69
70/* From italiandoh's notes */
71#define CPU_PCB_CLOCK (8000000)
72#define SOUND_PCB_CLOCK (6000000)
73
74/* Misc variables */
75static laserdisc_info *discinfo;
76
77static UINT8 *tile_ram;
78static UINT8 *tile_control_ram;
79
80
81/* VIDEO GOODS */
82VIDEO_UPDATE( lgp )
83{
84   int charx, chary;
85
86   /* clear */
87   fillbitmap(bitmap, 0, cliprect);
88
89   /* display disc information */
90   if (discinfo != NULL)
91      popmessage("%s", laserdisc_describe_state(discinfo));
92
93   /* Draw tiles */
94   for (charx = 0; charx < 32; charx++)
95   {
96      for (chary = 0; chary < 32; chary++)
97      {
98         int current_screen_character = (chary*32) + charx;
99
100         /* Somewhere there's a flag that offsets the tilemap by 0x100*x */
101         /* Palette is likely set somewhere as well (tile_control_ram?) */
102         drawgfx(bitmap, machine->gfx[0],
103               tile_ram[current_screen_character],
104               0,
105               0, 0, charx*8, chary*8, cliprect, TRANSPARENCY_PEN, 0);
106      }
107   }
108
109   return 0;
110}
111
112
113/* MEMORY HANDLERS */
114/* Main Z80 R/W */
115READ8_HANDLER(ldp_read)
116{
117   return laserdisc_data_r(discinfo);
118}
119
120WRITE8_HANDLER(ldp_write)
121{
122   laserdisc_data_w(discinfo,data);
123}
124
125
126/* Sound Z80 R/W */
127
128
129/* PROGRAM MAPS */
130static ADDRESS_MAP_START( main_program_map, ADDRESS_SPACE_PROGRAM, 8 )
131   AM_RANGE(0x0000,0x7fff) AM_ROM
132   AM_RANGE(0xe000,0xe3ff) AM_RAM AM_BASE(&tile_ram)
133   AM_RANGE(0xe400,0xe7ff) AM_RAM AM_BASE(&tile_control_ram)
134
135//  AM_RANGE(0xef00,0xef00) AM_READ_PORT("IN_TEST")
136   AM_RANGE(0xef80,0xef80) AM_READWRITE(ldp_read,ldp_write)
137   AM_RANGE(0xefb8,0xefb8) AM_READ(ldp_read)      /* Likely not right, calms it down though */
138   AM_RANGE(0xefc0,0xefc0) AM_READ_PORT("DSWA")   /* Not tested */
139   AM_RANGE(0xefc8,0xefc8) AM_READ_PORT("DSWB")
140   AM_RANGE(0xefd0,0xefd0) AM_READ_PORT("DSWC")
141   AM_RANGE(0xefd8,0xefd8) AM_READ_PORT("IN0")
142   AM_RANGE(0xefe0,0xefe0) AM_READ_PORT("IN1")
143   AM_RANGE(0xf000,0xffff) AM_RAM
144ADDRESS_MAP_END
145
146static ADDRESS_MAP_START( sound_program_map, ADDRESS_SPACE_PROGRAM, 8 )
147   AM_RANGE(0x0000,0x3fff) AM_ROM
148   AM_RANGE(0x8000,0x83ff) AM_RAM
149   AM_RANGE(0x8400,0x8407) AM_RAM      /* Needs handler!  Communications? */
150   AM_RANGE(0x8800,0x8803) AM_RAM      /* Needs handler!  Communications? */
151ADDRESS_MAP_END
152
153
154/* IO MAPS */
155static ADDRESS_MAP_START( main_io_map, ADDRESS_SPACE_IO, 8 )
156   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
157//  AM_RANGE(0xfd,0xfd) AM_READ_PORT("IN_TEST")
158//  AM_RANGE(0xfe,0xfe) AM_READ_PORT("IN_TEST")
159ADDRESS_MAP_END
160
161static ADDRESS_MAP_START( sound_io_map, ADDRESS_SPACE_IO, 8 )
162   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
163ADDRESS_MAP_END
164
165
166/* PORTS */
167/*  (DIPLOCATION diplay inverted) */
168INPUT_PORTS_START( lgp )
169   PORT_START_TAG("DSWA")
170   PORT_DIPNAME( 0x03, 0x03, "1st Round" ) PORT_DIPLOCATION("SWA:2,1")
171   PORT_DIPSETTING(    0x03, "68 Seconds" )
172   PORT_DIPSETTING(    0x02, "66 Seconds" )
173   PORT_DIPSETTING(    0x01, "64 Seconds" )
174   PORT_DIPSETTING(    0x00, "62 Seconds" )
175   PORT_DIPNAME( 0x0c, 0x0c, "2nd Round" ) PORT_DIPLOCATION("SWA:4,3")
176   PORT_DIPSETTING(    0x0c, "62 Seconds" )
177   PORT_DIPSETTING(    0x08, "60 Seconds" )
178   PORT_DIPSETTING(    0x04, "58 Seconds" )
179   PORT_DIPSETTING(    0x00, "56 Seconds" )
180   PORT_DIPNAME( 0x30, 0x30, "3rd & 4th Rounds" ) PORT_DIPLOCATION("SWA:6,5")
181   PORT_DIPSETTING(    0x30, "60 Seconds" )
182   PORT_DIPSETTING(    0x20, "58 Seconds" )
183   PORT_DIPSETTING(    0x10, "56 Seconds" )
184   PORT_DIPSETTING(    0x00, "54 Seconds" )
185   PORT_DIPNAME( 0xc0, 0xc0, "Spark Race" ) PORT_DIPLOCATION("SWA:8,7")
186   PORT_DIPSETTING(    0xc0, "44 Seconds" )
187   PORT_DIPSETTING(    0x80, "42 Seconds" )
188   PORT_DIPSETTING(    0x40, "40 Seconds" )
189   PORT_DIPSETTING(    0x00, "38 Seconds" )
190
191   PORT_START_TAG("DSWB")
192   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWB:4,3,2,1")
193   PORT_DIPSETTING(    0x00, DEF_STR( 9C_1C ) )
194   PORT_DIPSETTING(    0x01, DEF_STR( 8C_1C ) )
195   PORT_DIPSETTING(    0x02, DEF_STR( 7C_1C ) )
196   PORT_DIPSETTING(    0x03, DEF_STR( 6C_1C ) )
197   PORT_DIPSETTING(    0x04, DEF_STR( 5C_1C ) )
198   PORT_DIPSETTING(    0x05, DEF_STR( 4C_1C ) )
199   PORT_DIPSETTING(    0x06, DEF_STR( 3C_1C ) )
200   PORT_DIPSETTING(    0x07, DEF_STR( 2C_1C ) )
201   PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
202   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
203   PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
204   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
205   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
206   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
207   PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) )
208   PORT_DIPSETTING(    0x08, DEF_STR( 1C_8C ) )
209   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SWB:8,7,6,5")
210   PORT_DIPSETTING(    0x00, DEF_STR( 9C_1C ) )
211   PORT_DIPSETTING(    0x10, DEF_STR( 8C_1C ) )
212   PORT_DIPSETTING(    0x20, DEF_STR( 7C_1C ) )
213   PORT_DIPSETTING(    0x30, DEF_STR( 6C_1C ) )
214   PORT_DIPSETTING(    0x40, DEF_STR( 5C_1C ) )
215   PORT_DIPSETTING(    0x50, DEF_STR( 4C_1C ) )
216   PORT_DIPSETTING(    0x60, DEF_STR( 3C_1C ) )
217   PORT_DIPSETTING(    0x70, DEF_STR( 2C_1C ) )
218   PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
219   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
220   PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
221   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
222   PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
223   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
224   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
225   PORT_DIPSETTING(    0x80, DEF_STR( 1C_8C ) )
226
227   PORT_START_TAG("DSWC")
228   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SWC:1")
229   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
230   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
231   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SWC:2")
232   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
233   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
234   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SWC:3")
235   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
236   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
237   PORT_DIPNAME( 0x08, 0x00, "Coinage Display" ) PORT_DIPLOCATION("SWC:4")
238   PORT_DIPSETTING(    0x00, "With" )
239   PORT_DIPSETTING(    0x08, "Without" )
240   PORT_DIPNAME( 0x10, 0x00, "Year Display" ) PORT_DIPLOCATION("SWC:5")
241   PORT_DIPSETTING(    0x00, "With" )
242   PORT_DIPSETTING(    0x10, "Without" )
243   PORT_DIPNAME( 0x20, 0x00, "Hit Detection" ) PORT_DIPLOCATION("SWC:6")
244   PORT_DIPSETTING(    0x00, "Normal Game" )
245   PORT_DIPSETTING(    0x20, "No Hit" )
246   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SWC:7")
247   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
248   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
249   PORT_DIPNAME( 0x80, 0x00, "Coin Slot" ) PORT_DIPLOCATION("SWC:8")
250   PORT_DIPSETTING(    0x00, "1-Way" )
251   PORT_DIPSETTING(    0x80, "2-Ways" )
252
253
254   PORT_START_TAG("IN0")
255   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE )   /* Manual says service switch simply increases credit count. */
256   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_TILT )
257   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
258   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
259   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
260   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
261   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
262   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
263
264   PORT_START_TAG("IN1")
265   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
266   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
267   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 )
268   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2 )
269   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON3 )
270   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON4 )
271   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON5 )
272   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON6 )
273
274/*
275    PORT_START_TAG("IN_TEST")
276    PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 )
277    PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 )
278    PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 )
279    PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON4 )
280    PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON5 )
281    PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON6 )
282    PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON7 )
283    PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON8 )
284*/
285INPUT_PORTS_END
286
287static const gfx_layout lgp_gfx_layout =
288{
289   8,8,
290   0x4000/8,
291   4,
292   { 0, 0x4000*8, 0x8000*8, 0xc000*8 },
293   { 0,1,2,3,4,5,6,7 },
294   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
295   8*8
296};
297
298/* Silly, but it's here to show off the oddball a02_18 */
299static const gfx_layout lgp_gfx_layout_16x32 =
300{
301   16,32,
302   0x2000/0x200,
303   8,
304   { 0,1,2,3,4,5,6,7 },
305   { 0*8,1*8,2*8,3*8,4*8,5*8,6*8,7*8,8*8,9*8,10*8,11*8,12*8,13*8,14*8,15*8 },
306   { 0*128, 1*128, 2*128, 3*128, 4*128, 5*128, 6*128, 7*128,
307     8*128, 9*128,10*128,11*128,12*128,13*128,14*128,15*128,
308    16*128,17*128,18*128,19*128,20*128,21*128,22*128,23*128,
309    24*128,25*128,26*128,27*128,28*128,29*128,30*128,31*128},
310   32*128
311};
312
313static const gfx_decode gfxdecodeinfo[] =
314{
315   { REGION_GFX1, 0, &lgp_gfx_layout, 0x0, 0x100 },
316   { REGION_GFX4, 0, &lgp_gfx_layout_16x32, 0x0, 0x100},
317   { -1 }
318};
319
320static MACHINE_START( lgp )
321{
322   discinfo = laserdisc_init(LASERDISC_TYPE_LDV1000, get_disk_handle(0), 0);
323   return;
324}
325
326static TIMER_CALLBACK( irq_stop )
327{
328   cpunum_set_input_line(0, 0, CLEAR_LINE);
329}
330
331static INTERRUPT_GEN( vblank_callback_lgp )
332{
333   // NMI
334   //cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
335
336   // IRQ
337   cpunum_set_input_line(0, 0, ASSERT_LINE);
338   mame_timer_set(MAME_TIME_IN_USEC(50), 0, irq_stop);
339
340   laserdisc_vsync(discinfo);
341}
342
343
344/* DRIVER */
345static MACHINE_DRIVER_START( lgp )
346/*  main cpu */
347   MDRV_CPU_ADD(Z80, CPU_PCB_CLOCK)
348   MDRV_CPU_PROGRAM_MAP(main_program_map,0)
349   MDRV_CPU_IO_MAP(main_io_map,0)
350   MDRV_CPU_VBLANK_INT(vblank_callback_lgp, 1)
351
352/*  sound cpu */
353   MDRV_CPU_ADD(Z80, SOUND_PCB_CLOCK)
354   MDRV_CPU_PROGRAM_MAP(sound_program_map,0)
355   MDRV_CPU_IO_MAP(sound_io_map,0)
356
357
358   MDRV_MACHINE_START(lgp)
359
360/*  video */
361   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
362
363   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
364   MDRV_SCREEN_REFRESH_RATE(60)
365   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
366   MDRV_SCREEN_SIZE(32*8, 32*8)
367   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
368
369   MDRV_PALETTE_LENGTH(256)
370   /* MDRV_PALETTE_INIT(lgp) */
371
372   MDRV_GFXDECODE(gfxdecodeinfo)
373   MDRV_VIDEO_UPDATE(lgp)
374
375/*  sound */
376MACHINE_DRIVER_END
377
378
379ROM_START( lgp )
380   /* CPU PCB */
381   /* Main program */
382   ROM_REGION( 0x8000, REGION_CPU1, 0 )
383   ROM_LOAD( "a02_01.63", 0x0000, 0x2000, CRC(088ca6e1) SHA1(b3f0869b0c333d991363ac46a1c53daa3f6c85e9) )
384   ROM_LOAD( "a02_02.62", 0x2000, 0x2000, CRC(8e1be578) SHA1(cfad7cb72c7d13b2b614680bccc6f807521f3bf4) )
385   ROM_LOAD( "a02_03.61", 0x4000, 0x2000, CRC(4978953a) SHA1(eec6596430238ffffb0d173852bdd7f11c60e9b2) )
386   ROM_LOAD( "a02_04.60", 0x6000, 0x2000, CRC(903d0ae2) SHA1(bd04182dd77eb5a4ef28d7127f631689b6695e17) )
387
388   /* Tiles */
389   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
390   ROM_LOAD( "a02_14.13", 0x0000, 0x4000, CRC(28996b3c) SHA1(664aa4d2582784bb7c56cfb8883294578fe18dd9) )
391   ROM_LOAD( "a02_15.12", 0x4000, 0x4000, CRC(6b7abbb2) SHA1(890777d99b646147359d09e42692a272e570113c) )
392   ROM_LOAD( "a02_16.11", 0x8000, 0x4000, CRC(aad4fb3c) SHA1(2cd4a331a8e0f010d60b594655361776fa24255f) )
393   ROM_LOAD( "a02_17.10", 0xc000, 0x4000, CRC(db8b9723) SHA1(1319a3f35dffdcf65fe7496cfabaf5787989d0bc) )
394
395   /* ??? */
396   ROM_REGION( 0x10000, REGION_GFX2, 0 )
397   ROM_LOAD( "a02_06.53", 0x0000, 0x4000, CRC(c724f96c) SHA1(6531bd57c87118479700e5f8708060deb6b21d91) )
398   ROM_LOAD( "a02_07.52", 0x4000, 0x4000, CRC(4b81eb3b) SHA1(76f5c0b2b4d450fd633199ac4aba66ed5a8a530b) )
399   ROM_LOAD( "a02_08.51", 0x8000, 0x4000, CRC(deb7e494) SHA1(cc5b2f9c622ec3b599fe6752233d44a820951a98) )
400   ROM_LOAD( "a02_09.50", 0xc000, 0x4000, CRC(6d077a30) SHA1(00888e0f54a5b4d647921caf37f7b3e4a7934a1f) )
401
402   /* ??? */
403   ROM_REGION( 0x10000, REGION_GFX3, 0 )
404   ROM_LOAD( "a02_10.49", 0x0000, 0x4000, CRC(56bbe961) SHA1(97ebaeb3bc3948724e19a7279e13314a3470e5ef) )
405   ROM_LOAD( "a02_11.48", 0x4000, 0x4000, CRC(5d0aebb2) SHA1(4cdfb82fa459c9d168a79b5a643fdde45906872b) )
406   ROM_LOAD( "a02_12.47", 0x8000, 0x4000, CRC(1b7c578c) SHA1(6bf2d6e908176e5ef83649b34df9976a55319176) )
407   ROM_LOAD( "a02_13.46", 0xc000, 0x4000, CRC(d7fccfb1) SHA1(9b8a2813b98eb00c2adc347a902a40e7a462070d) )
408
409   /* Lame lookup table? */
410   ROM_REGION( 0x1000, REGION_USER1, 0 )
411   ROM_LOAD( "a02_05.54", 0x0000, 0x1000, CRC(f5e06a8b) SHA1(d2659bc185ecb66f9ac8e015a60259efd13ba84a) )
412
413   /* Color ROMs? */
414   ROM_REGION( 0x400, REGION_USER2, 0 )
415   ROM_LOAD( "a02_31.106", 0x000, 0x100, CRC(ff586bfd) SHA1(61631bae9ba87f2ced142fb8907b313e5424374f) )
416   ROM_LOAD( "a02_32.111", 0x100, 0x100, CRC(8e00230e) SHA1(5dc1d01c0c3e34cdfcde81227c48a7293115d257) )
417   ROM_LOAD( "a02_33.116", 0x200, 0x100, CRC(507fb884) SHA1(7bae761d69dfb035b71b4650f226df4b3d0df67d) )
418   ROM_LOAD( "a02_34.122", 0x300, 0x100, CRC(fb2e6898) SHA1(a78e45b015edbe91912f8bf915761daf683126a7) )
419
420   /* Nearly-unused ROM */
421   ROM_REGION( 0x2000, REGION_USER3, 0 )
422   ROM_LOAD( "a02_41.59", 0x0000, 0x2000, CRC(2c55a3c0) SHA1(7e25217ed8e65549eb0043a5d2dc83e0ffea1177) )
423
424
425   /* SOUND PCB */
426   /* Sound CPU - on Sound PCB */
427   ROM_REGION( 0x4000, REGION_CPU2, 0 )
428   ROM_LOAD( "a02_29.ic11", 0x0000, 0x2000, CRC(c44026db) SHA1(93a6e8f272ca826c05a7be59e14a1a0c848fbaa0) )
429   ROM_LOAD( "a02_30.ic17", 0x2000, 0x2000, CRC(8c324556) SHA1(9e1f6f00d4023d9cfd414d3cc02af55be49dde2c) )   /* Sound data? */
430
431
432   /* OBJ PCB */
433   /* Zig-Zag bitmaps? */
434   ROM_REGION( 0x2000, REGION_GFX4, ROMREGION_DISPOSE )
435   ROM_LOAD( "a02_18.143", 0x0000, 0x2000, CRC(1b4e1980) SHA1(9dffb6a047427290ad63e3d7df7c5942c2b2dfc1) )
436
437   /* Misc bitmaps? */
438   ROM_REGION( 0x28000, REGION_GFX5, 0 )
439   ROM_LOAD( "a02_19.140", 0x00000, 0x4000, CRC(eedd3167) SHA1(a17976425b2e208485bcb189ef2e69dd709a9957) )
440   ROM_LOAD( "a02_20.139", 0x04000, 0x4000, CRC(5182f87b) SHA1(13d466c18fe5cc5da8e931130ee7defd3a9ebf12) )
441   ROM_LOAD( "a02_21.138", 0x08000, 0x4000, CRC(ca16a6e3) SHA1(a82396ea51fa6a320e501d86a23e1e1ebe8d29d5) )
442   ROM_LOAD( "a02_22.137", 0x0c000, 0x4000, CRC(479b3d95) SHA1(b082d4a5e11040daa1f1a687233776fe95a2c77d) )
443   ROM_LOAD( "a02_23.136", 0x10000, 0x4000, CRC(59ee0aa6) SHA1(cac307ef417d97f13ba3051d886eadf5ea10fb0d) )
444   ROM_LOAD( "a02_24.118", 0x14000, 0x4000, CRC(04564330) SHA1(579a0e964fd4ca83f05bd20534fa6f1a91b9c355) )
445   ROM_LOAD( "a02_25.117", 0x18000, 0x4000, CRC(57c2377a) SHA1(70442b4811fa319cb97fb9d8f35ebc5603cf4942) )
446   ROM_LOAD( "a02_26.116", 0x1c000, 0x4000, CRC(e2dc72fc) SHA1(4168f8df8124d9c83bec0abf72955df76c000ed8) )
447   ROM_LOAD( "a02_27.115", 0x20000, 0x4000, CRC(9a9e6b3f) SHA1(c9a1a24d7a93929379a0c5d4d2f5df1da0136348) )
448   ROM_LOAD( "a02_28.114", 0x24000, 0x4000, CRC(cd69ed20) SHA1(d60782637085491527814889856eb3553950ab55) )
449
450   /* Small ROM dumping ground - color? */
451   ROM_REGION( 0x520, REGION_USER4, 0 )
452   ROM_LOAD( "a02_35.23",  0x00000, 0x100, CRC(7b9d44f1) SHA1(bbd7c35a03ca6de116a01f6dcfa2ecd13a7ddb53) )
453   ROM_LOAD( "a02_36.24",  0x00100, 0x100, CRC(169c4216) SHA1(23921e9ef61a68fdd8afceb3b95bbac48190cf1a) )
454   ROM_LOAD( "a02_37.43",  0x00200, 0x20,  CRC(925ba961) SHA1(6715d80f2346374a0e880cf44cadc36e4a5316ed) )
455   ROM_LOAD( "a02_38.44",  0x00220, 0x100, CRC(6f37212a) SHA1(32b891dc9b97637620b2f1f9d9d76509c333cb2d) )
456   ROM_LOAD( "a02_39.109", 0x00320, 0x100, CRC(88363809) SHA1(b22a7bd8ce6b28bf7cfa64c3a08e4cf7f9b4cd20) )
457   ROM_LOAD( "a02_40.110", 0x00420, 0x100, CRC(fdfc7aac) SHA1(2413f7f9ad11c91d2adc0aab37bf70ff5c68ab6f) )
458ROM_END
459
460
461static DRIVER_INIT( lgp )
462{
463}
464
465/*    YEAR  NAME PARENT   MACHINE INPUT INIT MONITOR  COMPANY   FULLNAME             FLAGS) */
466GAME( 1983, lgp, 0,       lgp,    lgp,  lgp, ROT0,    "Taito",  "Laser Grand Prix",  GAME_NOT_WORKING|GAME_NO_SOUND)
src/mame/drivers/cliffhgr.c
r1037r1038
208208   discrete_sound_w(CLIFF_ENABLE_SND_2, (sound>>1)&1);
209209}
210210
211#ifdef UNUSED_FUNCTION
211212static WRITE8_HANDLER( cliff_irqack_w )
212213{
213214   phillips_code = 0;
214215}
216#endif
215217
216218static WRITE8_HANDLER( cliff_ldwire_w )
217219{
src/mame/drivers/dblewing.c
r1037r1038
327327ADDRESS_MAP_END
328328
329329
330#ifdef UNUSED_FUNCTION
330331static WRITE8_HANDLER( YM2151_w )
331332{
332333   switch (offset) {
r1037r1038
338339      break;
339340   }
340341}
342#endif
341343
342344
343345static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
src/mame/drivers/mediagx.c
r1037r1038
447447   }
448448}
449449
450#ifdef UNUSED_FUNCTION
450451static WRITE32_HANDLER(bios_ram_w)
451452{
452453
453454}
455#endif
454456
455457static UINT8 mediagx_config_reg_r(void)
456458{
src/mame/drivers/bfm_sc2.c
r1037r1038
521521
522522///////////////////////////////////////////////////////////////////////////
523523
524#ifdef UNUSED_FUNCTION
524525static WRITE8_HANDLER( reel12_w )
525526{
526527   reel12_latch = data;
r1037r1038
533534   if ( Stepper_optic_state(1) ) optic_pattern |=  0x02;
534535   else                          optic_pattern &= ~0x02;
535536}
537#endif
536538
537539///////////////////////////////////////////////////////////////////////////
538540
r1037r1038
792794
793795///////////////////////////////////////////////////////////////////////////
794796
797#ifdef UNUSED_FUNCTION
795798static READ8_HANDLER( vfd_status_r )
796799{
797800   // b7 = NEC busy
r1037r1038
804807
805808   return result;
806809}
810#endif
807811
808812///////////////////////////////////////////////////////////////////////////
809813
r1037r1038
945949
946950///////////////////////////////////////////////////////////////////////////
947951
952#ifdef UNUSED_FUNCTION
948953static READ8_HANDLER( direct_input_r )
949954{
950955   return 0;
951956}
957#endif
952958
953959///////////////////////////////////////////////////////////////////////////
954960
src/mame/drivers/seta2.c
r1037r1038
2828P0-136A ; KL (Namco)    1997    Kosodate Quiz My Angel 2                Namco
2929P0-142A                 1999    Puzzle De Bowling                       Nihon System / Moss
3030P0-142A + extra parts   2000    Penguin Brothers                        Subsino
31B0-003B                 2000    Deer Hunting USA                        Sammy
32B0-003B                 2001    Turkey Hunting USA                      Sammy
33B0-003B?                2001    Wing Shooting Championship              Sammy
34B0-003B?                2002    Trophy Hunting - Bear & Moose           Sammy
3135-------------------------------------------------------------------------------------------
3236
3337TODO:
r1037r1038
6468  and ignore the individual color codes in the tiles data. Zooming is also
6569  used briefly in pengbros.
6670
71deerhunt,wschamp:
72- offset tilemap sprite during demo
73
74trophyh:
75- mame hangs for around 15 seconds every now and then, at scene changes.
76  This is probably due to a couple of frames with an odd or corrupt sprites list,
77  taking a long time to render.
78
6779***************************************************************************/
6880
6981/***************************************************************************
r1037r1038
165177
166178***************************************************************************/
167179
180/***************************************************************************
181
182Sammy USA Outdoor Shooting Series PCB
183
184Deer Hunting USA (c) 2000 Sammy USA
185Turkey Hunting USA (c) 2001 Sammy USA
186
187Wing Shooting Championship (c) 2001 Sammy USA*
188Trophy Hunting - Bear & Moose (c) 2002 Sammy USA*
189
190* Slightly different PCB then listed below.  Two Player input / connection ports
191
192   CPU: Toshiba TMP68301AF-16 (100 Pin PQFP)
193 Video: NEC DX-101 (240 Pin PQFP)
194        NEC DX-102 (52 Pin PQFP x3)
195 Sound: X1-010 (Mitsubishi M60016 Gate Array, 80 Pin PQFP)
196EEPROM: 93LC46BX (1K Low-power 64 x 16-bit organization serial EEPROM)
197   OSC: 50MHz & 28MHz
198 Other: 8 Position Dipswitch x 2
199        Lattice ispLSI2032
200        Lattice isp1016E
201
202PCB Number: B0-003B
203+-----------------------------------------------------------+
204|             VOL                          +------+         |
205|                                          |X1-010|     M1  |
206|   +---+ +---+                            |M60016|         |
207|   |   | |   |  M    M                    |CALRUA|  +---+  |
208+-+ | U | | U |  2    1                    +------+  |   |  |
209  | | 0 | | 0 |                                      |   |  |
210+-+ | 7 | | 6 |  M    M                              | U |  |
211|   |   | |   |  2    1                              | 1 |  |
212|   +---+ +---+                                      | 8 |  |
213|                                          Lattice   |   |  |
214|   D +---+  C                            ispLSI2032 |   |  |
215|   S |DX |  N   BAT1           +-------+            +---+  |
216|   W |102|  5                  |Toshiba|  D                |
217|   1 +---+                     |  TMP  |  S EEPROM       C |
218|            C                  | 68301 |  W              N |
219|            N  Lattice         +-------+  2              2 |
220|            6  isp1016E                                    |
221|                               +----------+    50MHz       |
222|     +---+                     |          |                |
223|     |DX |  SW1                |   NEC    |    M   M       |
224|     |102|                     |  DX-101  |    3   3       |
225|     +---+         M  M        |          |                |
226|                   1  1        |          |                |
227|                               +----------+                |
228|                                                           |
229|                             +---+      +---++---++---+    |
230|                             |   |      |   ||   ||   |    |
231|     +---+        28MHz      |   |      |   ||   ||   |    |
232+-+   |DX |                   | U |      | U || U || U |    |
233  |   |102|                   | 4 |      | 4 || 3 || 3 |    |
234+-+   +---+                   | 0 |      | 1 || 8 || 9 |    |
235|                             |   |      |   ||   ||   |    |
236|                             |   |      |   ||   ||   |    |
237|                             +---+      +---++---++---+    |
238+-----------------------------------------------------------+
239
240Ram M1 are Toshiba TC55257DFL-70L
241Ram M2 are NEC D43001GU-70L
242Ram M3 are ISSI IS62C1024L-70Q
243
244U06 Program rom ST27C801 (even)
245U07 Program rom ST27C801 (odd)
246
247U18 Mask rom (Samples 23C32000 32Mbit (read as 27C322))
248
249U38 - U40 Mask roms (Graphics 23c64020 64Mbit) - 23C64020 read as 27C322 with pin11 +5v & 27C322 with pin11 GND
250
251***************************************************************************/
252
168253#include "driver.h"
169254#include "machine/tmp68301.h"
170255#include "machine/eeprom.h"
r1037r1038
522607ADDRESS_MAP_END
523608
524609
610/***************************************************************************
611                            Sammy Outdoor Shooting
612***************************************************************************/
525613
614static READ16_HANDLER( samshoot_lightgun1_r )
615{
616//  popmessage("%02x %02x",readinputport(3),readinputport(2));
617   return (readinputport(2) << 8) | readinputport(3);
618}
619static READ16_HANDLER( samshoot_lightgun2_r )
620{
621   return (readinputport(4) << 8) | readinputport(5);
622}
623
624static WRITE16_HANDLER( samshoot_coin_w )
625{
626   if (ACCESSING_LSB)
627   {
628      coin_counter_w(0, data & 0x10);
629      coin_counter_w(1, data & 0x20);
630      // Are these connected? They are set in I/O test
631      coin_lockout_w(0,~data & 0x40);
632      coin_lockout_w(1,~data & 0x80);
633   }
634//  popmessage("%04x",data);
635}
636
637static ADDRESS_MAP_START( samshoot_map, ADDRESS_SPACE_PROGRAM, 16 )
638   AM_RANGE( 0x000000, 0x1fffff ) AM_ROM
639   AM_RANGE( 0x200000, 0x20ffff ) AM_RAM
640   AM_RANGE( 0x300000, 0x30ffff ) AM_RAM AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size)
641
642   AM_RANGE( 0x400000, 0x400001 ) AM_READ( input_port_0_word_r )   // DSW 1
643   AM_RANGE( 0x400002, 0x400003 ) AM_READ( input_port_9_word_r )   // Buttons
644
645   AM_RANGE( 0x400300, 0x40030f ) AM_WRITE( seta2_sound_bank_w )   // Samples Banks
646
647   AM_RANGE( 0x500000, 0x500001 ) AM_READ( samshoot_lightgun1_r )   // P1
648   AM_RANGE( 0x580000, 0x580001 ) AM_READ( samshoot_lightgun2_r )   // P2
649
650   AM_RANGE( 0x700000, 0x700001 ) AM_READ( input_port_6_word_r )   // Trigger
651   AM_RANGE( 0x700002, 0x700003 ) AM_READ( input_port_7_word_r )   // Pump
652   AM_RANGE( 0x700004, 0x700005 ) AM_READWRITE( input_port_8_word_r, samshoot_coin_w )   // Coins
653   AM_RANGE( 0x700006, 0x700007 ) AM_READ( watchdog_reset16_r )   // Watchdog?
654
655   AM_RANGE( 0x800000, 0x83ffff ) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)   // Sprites
656   AM_RANGE( 0x840000, 0x84ffff ) AM_READWRITE(MRA16_RAM, paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)   // Palette
657   AM_RANGE( 0x860000, 0x86003f ) AM_WRITE(seta2_vregs_w) AM_BASE(&seta2_vregs)   // Video Registers
658
659   AM_RANGE( 0x900000, 0x903fff ) AM_READWRITE( seta_sound_word_r, seta_sound_word_w   )   // Sound
660
661   AM_RANGE( 0xfffd0a, 0xfffd0b ) AM_READ( input_port_1_word_r )   // parallel data register (DSW 2)
662   AM_RANGE( 0xfffc00, 0xffffff ) AM_READWRITE( MRA16_RAM, tmp68301_regs_w) AM_BASE(&tmp68301_regs )   // TMP68301 Registers
663ADDRESS_MAP_END
664
665
666
526667/***************************************************************************
527668
528669                                Input Ports
r1037r1038
12591400
12601401
12611402/***************************************************************************
1403                            Sammy Outdoor Shooting
1404***************************************************************************/
12621405
1406INPUT_PORTS_START( deerhunt )
1407   PORT_START_TAG("DSW1") // IN0 - $400000.w
1408   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3")
1409   PORT_DIPSETTING(      0x0005, DEF_STR( 4C_1C ) )
1410   PORT_DIPSETTING(      0x0006, DEF_STR( 2C_1C ) )
1411   PORT_DIPSETTING(      0x0007, DEF_STR( 1C_1C ) )
1412   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_2C ) )
1413   PORT_DIPSETTING(      0x0003, DEF_STR( 1C_3C ) )
1414   PORT_DIPSETTING(      0x0002, DEF_STR( 1C_4C ) )
1415   PORT_DIPSETTING(      0x0001, DEF_STR( 1C_5C ) )
1416   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )
1417   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:4,5,6")
1418   PORT_DIPSETTING(      0x0028, DEF_STR( 4C_1C ) )
1419   PORT_DIPSETTING(      0x0030, DEF_STR( 2C_1C ) )
1420   PORT_DIPSETTING(      0x0038, DEF_STR( 1C_1C ) )
1421   PORT_DIPSETTING(      0x0020, DEF_STR( 1C_2C ) )
1422   PORT_DIPSETTING(      0x0018, DEF_STR( 1C_3C ) )
1423   PORT_DIPSETTING(      0x0010, DEF_STR( 1C_4C ) )
1424   PORT_DIPSETTING(      0x0008, DEF_STR( 1C_5C ) )
1425   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_6C ) )
1426   PORT_DIPNAME( 0x0040, 0x0040, "Discount To Continue" ) PORT_DIPLOCATION("SW1:7")
1427   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
1428   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1429   PORT_SERVICE_DIPLOC(  0x0080, IP_ACTIVE_LOW, "SW1:8" )
1430   PORT_BIT(     0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
12631431
1432   PORT_START_TAG("DSW2") // IN1 - fffd0a.w
1433   PORT_DIPNAME( 0x0001, 0x0001, "Vert. Flip Screen" ) PORT_DIPLOCATION("SW2:1")
1434   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
1435   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1436   PORT_DIPNAME( 0x0002, 0x0002, "Horiz. Flip Screen" ) PORT_DIPLOCATION("SW2:2")
1437   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
1438   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1439   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:3")
1440   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
1441   PORT_DIPSETTING(      0x0004, DEF_STR( On ) )
1442   PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:4,5")
1443   PORT_DIPSETTING(      0x0010, DEF_STR( Easy ) )
1444   PORT_DIPSETTING(      0x0018, DEF_STR( Normal ) )
1445   PORT_DIPSETTING(      0x0008, DEF_STR( Hard ) )
1446   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
1447   PORT_DIPNAME( 0x0020, 0x0020, "Blood Color" ) PORT_DIPLOCATION("SW2:6")
1448   PORT_DIPSETTING(      0x0020, "Red" )
1449   PORT_DIPSETTING(      0x0000, "Yellow" )
1450   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:7")
1451   PORT_DIPSETTING(      0x0040, "3" )
1452   PORT_DIPSETTING(      0x0000, "4" )
1453   PORT_DIPNAME( 0x0080, 0x0080, "Gun Type" ) PORT_DIPLOCATION("SW2:8")
1454   PORT_DIPSETTING(      0x0080, "Pump Action" )
1455   PORT_DIPSETTING(      0x0000, "Hand Gun" )
1456   PORT_BIT(     0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
1457
1458   PORT_START_TAG("GUN1Y") // IN2 - $500000.b
1459   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1, 0, 0) PORT_MINMAX(0x08,0xf8) PORT_SENSITIVITY(35) PORT_KEYDELTA(10) PORT_PLAYER(1)
1460
1461   PORT_START_TAG("GUN1X")   // IN3 - $500001.b
1462   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1, 0, 0) PORT_MINMAX(0x25,0xc5) PORT_SENSITIVITY(35) PORT_KEYDELTA(10) PORT_PLAYER(1)
1463
1464   PORT_START_TAG("GUN2Y")   // IN4 - $580000.b
1465   PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN )   // P2 gun, read but not used
1466
1467   PORT_START_TAG("GUN2X")   // IN5 - $580001.b
1468   PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN )   // P2 gun, read but not used
1469
1470   PORT_START_TAG("TRIGGER")   // IN6 - $700000
1471   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SPECIAL )   // trigger
1472   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1  )
1473   PORT_BIT( 0xff3f, IP_ACTIVE_LOW, IPT_UNKNOWN )
1474
1475   PORT_START_TAG("PUMP")   // IN7 - $700003.b
1476   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SPECIAL )   // pump
1477   PORT_BIT( 0xffbf, IP_ACTIVE_LOW, IPT_UNKNOWN )
1478
1479   PORT_START_TAG("COIN")   // IN8 - $700005.b
1480   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
1481   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
1482   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
1483   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE2 )
1484   PORT_BIT( 0xfff0, IP_ACTIVE_LOW, IPT_UNKNOWN )
1485
1486   PORT_START_TAG("BUTTONS")   // IN9 - $400002
1487   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 )   // trigger
1488   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 )   // pump
1489   PORT_BIT( 0xfffc, IP_ACTIVE_LOW, IPT_UNKNOWN )
1490INPUT_PORTS_END
1491
1492
1493INPUT_PORTS_START( turkhunt )
1494   PORT_INCLUDE(deerhunt)
1495
1496   PORT_MODIFY("DSW2") // IN1 - fffd0a.w
1497   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:7")
1498   PORT_DIPSETTING(      0x0040, "2" )
1499   PORT_DIPSETTING(      0x0000, "3" )
1500INPUT_PORTS_END
1501
1502
1503INPUT_PORTS_START( wschamp )
1504   PORT_INCLUDE(deerhunt)
1505
1506   PORT_MODIFY("DSW1")   // IN0 - $400000.w
1507   PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3,4")
1508   PORT_DIPSETTING(      0x0009, "4 Coins Start, 4 Coins Continue" )
1509   PORT_DIPSETTING(      0x0008, "4 Coins Start, 3 Coins Continue" )
1510   PORT_DIPSETTING(      0x0007, "4 Coins Start, 2 Coins Continue" )
1511   PORT_DIPSETTING(      0x0006, "4 Coins Start, 1 Coin Continue" )
1512   PORT_DIPSETTING(      0x000c, "3 Coins Start, 3 Coins Continue" )
1513   PORT_DIPSETTING(      0x000b, "3 Coins Start, 2 Coins Continue" )
1514   PORT_DIPSETTING(      0x000a, "3 Coins Start, 1 Coin Continue" )
1515   PORT_DIPSETTING(      0x000e, "2 Coins Start, 2 Coins Continue" )
1516   PORT_DIPSETTING(      0x000d, "2 Coins Start, 1 Coin Continue" )
1517   PORT_DIPSETTING(      0x000f, "1 Coin Start, 1 Coin Continue" )
1518   PORT_DIPSETTING(      0x0005, "1 Coin 2 Credits, 1 Credit Start & Continue" )
1519   PORT_DIPSETTING(      0x0004, "1 Coin 3 Credits, 1 Credit Start & Continue" )
1520   PORT_DIPSETTING(      0x0003, "1 Coin 4 Credits, 1 Credit Start & Continue" )
1521   PORT_DIPSETTING(      0x0002, "1 Coin 5 Credits, 1 Credit Start & Continue" )
1522   PORT_DIPSETTING(      0x0001, "1 Coin 6 Credits, 1 Credit Start & Continue" )
1523   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
1524   PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW1:5" )
1525   PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW1:6" )
1526   PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW1:7" )
1527   PORT_SERVICE_DIPLOC(  0x0080, IP_ACTIVE_LOW, "SW1:8" )
1528   PORT_BIT(     0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
1529
1530   PORT_MODIFY("DSW2") // IN1 - fffd0a.w
1531   PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW2:6" )
1532   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:7")
1533   PORT_DIPSETTING(      0x0040, "2" )
1534   PORT_DIPSETTING(      0x0000, "3" )
1535
1536   PORT_MODIFY("GUN2Y") // IN4 - $580000.b
1537   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1, 0, 0) PORT_MINMAX(0x08,0xf8) PORT_SENSITIVITY(35) PORT_KEYDELTA(10) PORT_PLAYER(2)
1538
1539   PORT_MODIFY("GUN2X")   // IN5 - $580001.b
1540   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1, 0, 0) PORT_MINMAX(0x25,0xc5) PORT_SENSITIVITY(35) PORT_KEYDELTA(10) PORT_PLAYER(2)
1541
1542   PORT_MODIFY("TRIGGER")   // IN6 - $700000
1543   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL )   // trigger P2
1544   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SPECIAL )   // trigger P1
1545   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1  )
1546   PORT_BIT( 0xff1f, IP_ACTIVE_LOW, IPT_UNKNOWN )
1547
1548   PORT_MODIFY("PUMP")   // IN7 - $700003.b
1549   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL )   // pump P2
1550   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SPECIAL )   // pump P1
1551   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2  )
1552   PORT_BIT( 0xff1f, IP_ACTIVE_LOW, IPT_UNKNOWN )
1553
1554   PORT_MODIFY("COIN")   // IN8 - $700005.b
1555   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
1556   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
1557   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
1558   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE2 )
1559   PORT_BIT( 0xfff0, IP_ACTIVE_LOW, IPT_UNKNOWN )
1560
1561   PORT_MODIFY("BUTTONS")   // IN9 - $400002
1562   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 )   // trigger P1
1563   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 )   // pump P1
1564   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 )   PORT_PLAYER(2)   // trigger P2
1565   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 )   PORT_PLAYER(2)   // pump P2
1566   PORT_BIT( 0xffcc, IP_ACTIVE_LOW, IPT_UNKNOWN )
1567INPUT_PORTS_END
1568
1569INPUT_PORTS_START( trophyh )
1570   PORT_INCLUDE(wschamp)
1571
1572   PORT_MODIFY("DSW2") // IN1 - fffd0a.w
1573   PORT_DIPNAME( 0x0020, 0x0020, "Blood Color" ) PORT_DIPLOCATION("SW2:6") /* WSChamp doesn't use Blood Color, so add it back in */
1574   PORT_DIPSETTING(      0x0020, "Red" )
1575   PORT_DIPSETTING(      0x0000, "Yellow" )
1576INPUT_PORTS_END
1577
1578
1579/***************************************************************************
1580
1581
12641582                            Graphics Layouts
12651583
12661584
r1037r1038
13721690   }
13731691}
13741692
1693static INTERRUPT_GEN( samshoot_interrupt )
1694{
1695   switch ( cpu_getiloops() )
1696   {
1697      case 0:
1698         tmp68301_external_interrupt_0();   // vblank
1699         break;
1700      case 1:
1701         tmp68301_external_interrupt_2();   // to do: hook up x1-10 interrupts
1702         break;
1703   }
1704}
1705
13751706static struct x1_010_interface x1_010_sound_intf =
13761707{
13771708   0x0000,      /* address */
r1037r1038
14871818   MDRV_SCREEN_VISIBLE_AREA(0, 0x140-1, 0x80, 0x160-1)
14881819MACHINE_DRIVER_END
14891820
1821static MACHINE_DRIVER_START( samshoot )
14901822
1823   /* basic machine hardware */
1824   MDRV_IMPORT_FROM(mj4simai)
1825   MDRV_CPU_MODIFY("main")
1826   MDRV_CPU_PROGRAM_MAP(samshoot_map,0)
1827   MDRV_CPU_VBLANK_INT(samshoot_interrupt,2)
1828
1829   MDRV_NVRAM_HANDLER(generic_0fill)
1830
1831   /* video hardware */
1832   MDRV_SCREEN_VISIBLE_AREA(0x40, 0x180-1, 0x40, 0x130-1)
1833MACHINE_DRIVER_END
1834
1835
14911836/***************************************************************************
14921837
14931838                                ROMs Loading
r1037r1038
16451990   ROM_LOAD( "u18.bin", 0x100000, 0x200000, CRC(de4e65e2) SHA1(82d4e590c714b3e9bf0ffaf1500deb24fd315595) )
16461991ROM_END
16471992
1648GAME( 1994, gundamex, 0, gundamex, gundamex, 0, ROT0, "Banpresto",           "Mobile Suit Gundam EX Revue", 0 )
1649GAME( 1995, grdians,  0, grdians,  grdians,  0, ROT0, "Banpresto",           "Guardians / Denjin Makai II", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )   // Displays (c) Winky Soft at game's end.
1650GAME( 1996, mj4simai, 0, mj4simai, mj4simai, 0, ROT0, "Maboroshi Ware",      "Wakakusamonogatari Mahjong Yonshimai (Japan)", GAME_NO_COCKTAIL )
1651GAME( 1996, myangel,  0, myangel,  myangel,  0, ROT0, "Namco",               "Kosodate Quiz My Angel (Japan)", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
1652GAME( 1997, myangel2, 0, myangel2, myangel2, 0, ROT0, "Namco",               "Kosodate Quiz My Angel 2 (Japan)", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
1653GAME( 1999, pzlbowl,  0, pzlbowl,  pzlbowl,  0, ROT0, "Nihon System / Moss", "Puzzle De Bowling (Japan)", GAME_NO_COCKTAIL )
1654GAME( 2000, penbros,  0, penbros,  penbros,  0, ROT0, "Subsino",             "Penguin Brothers (Japan)", GAME_NO_COCKTAIL )
1993ROM_START( deerhunt ) /* Deer Hunting USA V4.3 (11/1/2000) */
1994   ROM_REGION( 0x200000, REGION_CPU1, 0 )      /* TMP68301 Code */
1995   ROM_LOAD16_BYTE( "as0906e01-v4_3.u06", 0x000000, 0x100000, CRC(20c81f17) SHA1(d41d93d6ee88738cec55f7bf3ce6be1dbec68e09) )
1996   ROM_LOAD16_BYTE( "as0907e01-v4_3.u07", 0x000001, 0x100000, CRC(1731aa2a) SHA1(cffae7a99a7f960a62ef0c4454884df17a93c1a6) )
16551997
1998   ROM_REGION( 0x2000000, REGION_GFX1, ROMREGION_DISPOSE )   /* Sprites */
1999   ROM_LOAD( "as0901m01.u38", 0x0000000, 0x800000, CRC(1d6acf8f) SHA1(6f61fe21bebb7c87e8e6c3ef3ba73b8cf327dde9) )
2000   ROM_LOAD( "as0902m01.u39", 0x0800000, 0x800000, CRC(c7ca2128) SHA1(86be3a3ec2f86f61acfa3d4d261faea3c27dc378) )
2001   ROM_LOAD( "as0903m01.u40", 0x1000000, 0x800000, CRC(e8ef81b3) SHA1(97666942ca6cca5b8ea6451314a2aaabad9e06ba) )
2002   ROM_LOAD( "as0904m01.u41", 0x1800000, 0x800000, CRC(d0f97fdc) SHA1(776c9d42d03a9f61155521212305e1ed696eaf47) )
2003
2004   ROM_REGION( 0x500000, REGION_SOUND1, 0 )   /* Samples */
2005   /* Leave 1MB empty (addressable by the chip) */
2006   ROM_LOAD( "as0905m01.u18", 0x100000, 0x400000, CRC(8d8165bb) SHA1(aca7051613d260734ee787b4c3db552c336bd600) )
2007ROM_END
2008
2009ROM_START( deerhuna ) /* Deer Hunting USA V4.2 (xx/x/2000) */
2010   ROM_REGION( 0x200000, REGION_CPU1, 0 )      /* TMP68301 Code */
2011   ROM_LOAD16_BYTE( "as0906e01-v4_2.u06", 0x000000, 0x100000, CRC(bb3af36f) SHA1(f04071347e8ad361bf666fcb6c0136e522f19d47) )
2012   ROM_LOAD16_BYTE( "as0907e01-v4_2.u07", 0x000001, 0x100000, CRC(83f02117) SHA1(70fc2291bc93af3902aae88688be6a8078f7a07e) )
2013
2014   ROM_REGION( 0x2000000, REGION_GFX1, ROMREGION_DISPOSE )   /* Sprites */
2015   ROM_LOAD( "as0901m01.u38", 0x0000000, 0x800000, CRC(1d6acf8f) SHA1(6f61fe21bebb7c87e8e6c3ef3ba73b8cf327dde9) )
2016   ROM_LOAD( "as0902m01.u39", 0x0800000, 0x800000, CRC(c7ca2128) SHA1(86be3a3ec2f86f61acfa3d4d261faea3c27dc378) )
2017   ROM_LOAD( "as0903m01.u40", 0x1000000, 0x800000, CRC(e8ef81b3) SHA1(97666942ca6cca5b8ea6451314a2aaabad9e06ba) )
2018   ROM_LOAD( "as0904m01.u41", 0x1800000, 0x800000, CRC(d0f97fdc) SHA1(776c9d42d03a9f61155521212305e1ed696eaf47) )
2019
2020   ROM_REGION( 0x500000, REGION_SOUND1, 0 )   /* Samples */
2021   /* Leave 1MB empty (addressable by the chip) */
2022   ROM_LOAD( "as0905m01.u18", 0x100000, 0x400000, CRC(8d8165bb) SHA1(aca7051613d260734ee787b4c3db552c336bd600) )
2023ROM_END
2024
2025ROM_START( deerhunb ) /* Deer Hunting USA V4.0 (6/15/2000) */
2026   ROM_REGION( 0x200000, REGION_CPU1, 0 )      /* TMP68301 Code */
2027   ROM_LOAD16_BYTE( "as0906e01-v4.u06", 0x000000, 0x100000, CRC(07d9b64a) SHA1(f9aac644aab920bbac84b14836ee589ccd51f6db) )
2028   ROM_LOAD16_BYTE( "as0907e01-v4.u07", 0x000001, 0x100000, CRC(19973d08) SHA1(da1cc02ce480a62ccaf94d0af1246a340f054b43) )
2029
2030   ROM_REGION( 0x2000000, REGION_GFX1, ROMREGION_DISPOSE )   /* Sprites */
2031   ROM_LOAD( "as0901m01.u38", 0x0000000, 0x800000, CRC(1d6acf8f) SHA1(6f61fe21bebb7c87e8e6c3ef3ba73b8cf327dde9) )
2032   ROM_LOAD( "as0902m01.u39", 0x0800000, 0x800000, CRC(c7ca2128) SHA1(86be3a3ec2f86f61acfa3d4d261faea3c27dc378) )
2033   ROM_LOAD( "as0903m01.u40", 0x1000000, 0x800000, CRC(e8ef81b3) SHA1(97666942ca6cca5b8ea6451314a2aaabad9e06ba) )
2034   ROM_LOAD( "as0904m01.u41", 0x1800000, 0x800000, CRC(d0f97fdc) SHA1(776c9d42d03a9f61155521212305e1ed696eaf47) )
2035
2036   ROM_REGION( 0x500000, REGION_SOUND1, 0 )   /* Samples */
2037   /* Leave 1MB empty (addressable by the chip) */
2038   ROM_LOAD( "as0905m01.u18", 0x100000, 0x400000, CRC(8d8165bb) SHA1(aca7051613d260734ee787b4c3db552c336bd600) )
2039ROM_END
2040
2041ROM_START( turkhunt ) /* V1.0 is currently the only known version */
2042   ROM_REGION( 0x200000, REGION_CPU1, 0 )      /* TMP68301 Code */
2043   ROM_LOAD16_BYTE( "asx906e01.u06", 0x000000, 0x100000, CRC(c96266e1) SHA1(0ca462b3b0f27198e36384eee6ea5c5d4e7e1293) )
2044   ROM_LOAD16_BYTE( "asx907e01.u07", 0x000001, 0x100000, CRC(7c67b502) SHA1(6a0e8883a115dac4095d86897e7eca2a007a1c71) )
2045
2046   ROM_REGION( 0x2000000, REGION_GFX1, ROMREGION_DISPOSE )   /* Sprites */
2047   ROM_LOAD( "asx901m01.u38", 0x0000000, 0x800000, BAD_DUMP CRC(23125c93) SHA1(c8735ac43bc67c52cb78ad5bca74fa2082dda040) )
2048   ROM_LOAD( "asx902m01.u39", 0x0800000, 0x800000, BAD_DUMP CRC(6e7330dd) SHA1(4a8590e9b8fe4767f7a25760bfe499792948a7ae) )
2049   ROM_LOAD( "asx903m01.u40", 0x1000000, 0x800000, BAD_DUMP CRC(5f86c322) SHA1(5a72adb99eea176199f172384cb051e2b045ab94) )
2050   ROM_LOAD( "asx904m01.u41", 0x1800000, 0x800000, BAD_DUMP CRC(6177f644) SHA1(120fe32518d133f03176db68f18c8175c1a81b27) )
2051
2052   ROM_REGION( 0x500000, REGION_SOUND1, 0 )   /* Samples */
2053   /* Leave 1MB empty (addressable by the chip) */
2054   ROM_LOAD( "asx905m01.u18", 0x100000, 0x400000, CRC(8d9dd9a9) SHA1(1fc2f3688d2c24c720dca7357bca6bf5f4016c53) )
2055ROM_END
2056
2057ROM_START( wschamp ) /* V2.0 */
2058   ROM_REGION( 0x200000, REGION_CPU1, 0 )      /* TMP68301 Code */
2059   ROM_LOAD16_BYTE( "as1006e02.u06", 0x000000, 0x100000, CRC(0ad01677) SHA1(63e09b9f7cc8b781af1756f86caa0cc0962ae584) )
2060   ROM_LOAD16_BYTE( "as1007e02.u07", 0x000001, 0x100000, CRC(572624f0) SHA1(0c2f67daa22f4edd66a2be990dc6cd999faff0fa) )
2061
2062   ROM_REGION( 0x2000000, REGION_GFX1, ROMREGION_DISPOSE )   /* Sprites */
2063   ROM_LOAD( "as1001m01.u38", 0x0000000, 0x800000, CRC(92595579) SHA1(75a7131aedb18b7103677340c3cca7c91aaca2bf) )
2064   ROM_LOAD( "as1002m01.u39", 0x0800000, 0x800000, CRC(16c2bb08) SHA1(63926464c8bd8db7d05905a953765e645942beb4) )
2065   ROM_LOAD( "as1003m01.u40", 0x1000000, 0x800000, CRC(89618858) SHA1(a8bd07f233482e8f5a256af7ff9577648eb58ef4) )
2066   ROM_LOAD( "as1004m01.u41", 0x1800000, 0x800000, CRC(500c0909) SHA1(73ff27d46b9285f34a50a81c21c54437f21e1939) )
2067
2068   ROM_REGION( 0x500000, REGION_SOUND1, 0 )   /* Samples */
2069   /* Leave 1MB empty (addressable by the chip) */
2070   ROM_LOAD( "as1005m01.u18", 0x100000, 0x400000, CRC(e4b137b8) SHA1(4d8d15073c51f7d383282cc5755ae5b2eab6226c) )
2071ROM_END
2072
2073ROM_START( wschampa ) /* V1.01 */
2074   ROM_REGION( 0x200000, REGION_CPU1, 0 )      /* TMP68301 Code */
2075   ROM_LOAD16_BYTE( "as1006e01.u06", 0x000000, 0x100000, CRC(d3d3b2b5) SHA1(2d036d795b40a4ed78bb9f7751f875cfc76276a9) )
2076   ROM_LOAD16_BYTE( "as1007e01.u07", 0x000001, 0x100000, CRC(78ede6d9) SHA1(e6d10f52cd4c6bf97288df44911f23bb64fc012c) )
2077
2078   ROM_REGION( 0x2000000, REGION_GFX1, ROMREGION_DISPOSE )   /* Sprites */
2079   ROM_LOAD( "as1001m01.u38", 0x0000000, 0x800000, CRC(92595579) SHA1(75a7131aedb18b7103677340c3cca7c91aaca2bf) )
2080   ROM_LOAD( "as1002m01.u39", 0x0800000, 0x800000, CRC(16c2bb08) SHA1(63926464c8bd8db7d05905a953765e645942beb4) )
2081   ROM_LOAD( "as1003m01.u40", 0x1000000, 0x800000, CRC(89618858) SHA1(a8bd07f233482e8f5a256af7ff9577648eb58ef4) )
2082   ROM_LOAD( "as1004m01.u41", 0x1800000, 0x800000, CRC(500c0909) SHA1(73ff27d46b9285f34a50a81c21c54437f21e1939) )
2083
2084   ROM_REGION( 0x500000, REGION_SOUND1, 0 )   /* Samples */
2085   /* Leave 1MB empty (addressable by the chip) */
2086   ROM_LOAD( "as1005m01.u18", 0x100000, 0x400000, CRC(e4b137b8) SHA1(4d8d15073c51f7d383282cc5755ae5b2eab6226c) )
2087ROM_END
2088
2089ROM_START( trophyh ) /* V1.0 is currently the only known version */
2090   ROM_REGION( 0x200000, REGION_CPU1, 0 )      /* TMP68301 Code */
2091   ROM_LOAD16_BYTE( "as1106e01.u06", 0x000000, 0x100000, CRC(b4950882) SHA1(2749f7ffc5b543c9f39815f0913a1d1e385b63f4) )
2092   ROM_LOAD16_BYTE( "as1107e01.u07", 0x000001, 0x100000, CRC(19ee67cb) SHA1(e75ce66d3ff5aad46ba997c09d6514260e617f55) )
2093
2094   ROM_REGION( 0x2000000, REGION_GFX1, ROMREGION_DISPOSE )   /* Sprites */
2095   ROM_LOAD( "as1101m01.u38", 0x0000000, 0x800000, CRC(855ed675) SHA1(84ce229a9feb6331413253a5aed10b362e8102e5) )
2096   ROM_LOAD( "as1102m01.u39", 0x0800000, 0x800000, CRC(d186d271) SHA1(3c54438b35adfab8be91df0a633270d6db49beef) )
2097   ROM_LOAD( "as1103m01.u40", 0x1000000, 0x800000, CRC(adf8a54e) SHA1(bb28bf219d18082246f7964851a5c49b9c0ba7f5) )
2098   ROM_LOAD( "as1104m01.u41", 0x1800000, 0x800000, CRC(387882e9) SHA1(0fdd0c77dabd1066c6f3bd64e357236a76f524ab) )
2099
2100   ROM_REGION( 0x500000, REGION_SOUND1, 0 )   /* Samples */
2101   /* Leave 1MB empty (addressable by the chip) */
2102   ROM_LOAD( "as1105m01.u18", 0x100000, 0x400000, CRC(633d0df8) SHA1(3401c424f5c207ef438a9269e0c0e7d482771fed) )
2103ROM_END
2104
2105GAME( 1994, gundamex, 0,        gundamex, gundamex, 0, ROT0, "Banpresto",             "Mobile Suit Gundam EX Revue",                  0 )
2106GAME( 1995, grdians,  0,        grdians,  grdians,  0, ROT0, "Banpresto",             "Guardians / Denjin Makai II",                  GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )   // Displays (c) Winky Soft at game's end.
2107GAME( 1996, mj4simai, 0,        mj4simai, mj4simai, 0, ROT0, "Maboroshi Ware",        "Wakakusamonogatari Mahjong Yonshimai (Japan)", GAME_NO_COCKTAIL )
2108GAME( 1996, myangel,  0,        myangel,  myangel,  0, ROT0, "Namco",                 "Kosodate Quiz My Angel (Japan)",               GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
2109GAME( 1997, myangel2, 0,        myangel2, myangel2, 0, ROT0, "Namco",                 "Kosodate Quiz My Angel 2 (Japan)",             GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
2110GAME( 1999, pzlbowl,  0,        pzlbowl,  pzlbowl,  0, ROT0, "Nihon System / Moss",   "Puzzle De Bowling (Japan)",                    GAME_NO_COCKTAIL )
2111GAME( 2000, penbros,  0,        penbros,  penbros,  0, ROT0, "Subsino",               "Penguin Brothers (Japan)",                     GAME_NO_COCKTAIL )
2112GAME( 2000, deerhunt, 0,        samshoot, deerhunt, 0, ROT0, "Sammy USA Corporation", "Deer Hunting USA V4.3",                        GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
2113GAME( 2000, deerhuna, deerhunt, samshoot, deerhunt, 0, ROT0, "Sammy USA Corporation", "Deer Hunting USA V4.2",                        GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
2114GAME( 2000, deerhunb, deerhunt, samshoot, deerhunt, 0, ROT0, "Sammy USA Corporation", "Deer Hunting USA V4.0",                        GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
2115GAME( 2001, turkhunt, 0,        samshoot, turkhunt, 0, ROT0, "Sammy USA Corporation", "Turkey Hunting USA V1.0",                      GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
2116GAME( 2001, wschamp,  0,        samshoot, wschamp,  0, ROT0, "Sammy USA Corporation", "Wing Shooting Championship V2.0",              GAME_IMPERFECT_GRAPHICS )
2117GAME( 2001, wschampa, wschamp,  samshoot, wschamp,  0, ROT0, "Sammy USA Corporation", "Wing Shooting Championship V1.01",             GAME_IMPERFECT_GRAPHICS )
2118GAME( 2002, trophyh,  0,        samshoot, trophyh,  0, ROT0, "Sammy USA Corporation", "Trophy Hunting - Bear & Moose V1.0",           0 )
src/mame/drivers/megadriv.c
r1037r1038
9595//mame_timer* vblankirq_off_timer;
9696
9797
98#ifdef UNUSED_FUNCTION
9899/* taken from segaic16.c */
99100/* doesn't seem to meet my needs, not used */
100101static UINT16 read_next_instruction(void)
r1037r1038
120121   recurse = 0;
121122   return result;
122123}
124#endif
123125
124126
125127
r1037r1038
45484550   MDRV_CPU_PROGRAM_MAP(z80_readmem,z80_writemem)
45494551   /* IRQ handled via the timers */
45504552
4551   MDRV_SCREEN_REFRESH_RATE(60)
4552   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) // Vblank handled manually.
45534553   MDRV_MACHINE_RESET(megadriv)
45544554
45554555   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
4556
4557   MDRV_SCREEN_ADD("megadriv", 0x000)
45564558   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
4557
4559   MDRV_SCREEN_REFRESH_RATE(60)
4560   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) // Vblank handled manually.
45584561   MDRV_SCREEN_SIZE(64*8, 64*8)
45594562   MDRV_SCREEN_VISIBLE_AREA(0, 32*8-1, 0, 28*8-1)
45604563
src/mame/drivers/vegas.c
r1037r1038
512512static VIDEO_START( vegas_voodoo2 )
513513{
514514   voodoo_start(0, 0, VOODOO_2, 2, 4, 4);
515
516515   voodoo_set_vblank_callback(0, vblank_assert);
517516}
518517
r1037r1038
520519static VIDEO_START( vegas_voodoo_banshee )
521520{
522521   voodoo_start(0, 0, VOODOO_BANSHEE, 16, 16, 0);
523
524522   voodoo_set_vblank_callback(0, vblank_assert);
525523}
526524
r1037r1038
528526static VIDEO_START( vegas_voodoo3 )
529527{
530528   voodoo_start(0, 0, VOODOO_3, 16, 16, 16);
531
532529   voodoo_set_vblank_callback(0, vblank_assert);
533530}
534531
535532
536533static VIDEO_UPDATE( vegas )
537534{
538   voodoo_update(0, bitmap, cliprect);
539   return 0;
535   return voodoo_update(0, bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED;
540536}
541537
542538
src/mame/drivers/galpanic.c
r1037r1038
181181   }
182182}
183183
184#ifdef UNUSED_FUNCTION
184185static WRITE16_HANDLER( galpania_misc_w )
185186{
186187   if (ACCESSING_LSB)
r1037r1038
190191
191192   // other bits unknown !
192193}
194#endif
193195
194196static WRITE16_HANDLER( galpanic_coin_w )
195197{
src/mame/drivers/cowrace.c
r1037r1038
4545   return 0;
4646}
4747
48#ifdef UNUSED_FUNCTION
4849static WRITE8_HANDLER( cowrace_soundlatch_w )
4950{
5051   soundlatch_w(0, data);
5152   cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE);
5253}
54#endif
5355
5456static READ8_HANDLER( ret_ff )
5557{
src/mame/drivers/namcona1.c
r1037r1038
601601   }
602602} /* simulate_mcu */
603603
604#ifdef UNUSED_FUNCTION
604605static READ16_HANDLER( namcona1_mcu_r )
605606{
606607   return mcu_ram[offset];
607608}
609#endif
608610
609611static WRITE16_HANDLER( namcona1_mcu_w )
610612{
src/mame/drivers/armedf.c
r1037r1038
231231      soundlatch_w(0,((data & 0x7f) << 1) | 1);
232232}
233233
234#ifdef UNUSED_FUNCTION
234235static WRITE16_HANDLER( legion_command_c )
235236{
236237   COMBINE_DATA(&legion_cmd[offset]);
237238   //logerror("Legion CMD %04x=%04x", offset, data);
238239}
240#endif
239241
240242
241243
src/mame/drivers/sprint4.c
r1037r1038
192192}
193193
194194
195#ifdef UNUSED_FUNCTION
195196static WRITE8_HANDLER( sprint4_lockout_w )
196197{
197198   coin_lockout_global_w(~offset & 1);
198199}
200#endif
199201
200202
201203static WRITE8_HANDLER( sprint4_screech_1_w )
src/mame/drivers/ddenlovr.c
r1037r1038
232394 Rong Rong                                Z80              YM2413 + M6295     NAKANIHON NL-002
242495 Mahjong Dai Chuuka Ken   D11107218L1     Z80     AY8910 + YM2413 + M6295     70C160F009
252595 Nettoh Quiz Champion                     68000   AY8910 + YM2413 + M6295
2696 Don Den Lover Vol 1      D11309208L1     68000   AY8910 + YM2413 + M6295     NAKANIHON NL-005
2695 Don Den Lover Vol 1 (J)  D1120901L8      68000   YMZ284 + YM2413 + M6295     NAKANIHON NL-005
2796 Don Den Lover Vol 1 (HK) D11309208L1     68000   YMZ284 + YM2413 + M6295     NAKANIHON NL-005
2896 Panel & Variety Akamaru                  68000   YMZ284 + YM2413 + M6295     NAKANIHON NL-005
272996 Hana Kanzashi                            Z80              YM2413 + M6295     70C160F011?
283097 Hana Kagerou                             Z80              YM2413 + M6295     70C160F011
293198 Mahjong Chuukanejyo      D11107218L1     Z80     AY8910 + YM2413 + M6295     70C160F009
r1037r1038
7981
8082- quiz365 protection
8183
84- ddenlvrj, akamaru: the elapsed time text in the "game information" screen
85  is all wrong (RTC/interrupts related).
86
8287- NVRAM
8388
8489***************************************************************************/
r1037r1038
281286
282287INLINE int fetch_bit(UINT8 *src_data,int src_len,int *bit_addr)
283288{
284   int baddr = (*bit_addr)++;
289   int baddr = *bit_addr;
285290
291   *bit_addr = ((*bit_addr) + 1) & 0x7ffffff;
292
286293   if (baddr/8 >= src_len)
287294   {
288295#ifdef MAME_DEBUG
r1037r1038
328335{
329336   UINT8 *src_data = memory_region(REGION_GFX1);
330337   int src_len = memory_region_length(REGION_GFX1);
331   int bit_addr = src * 8;   /* convert to bit address */
338   int bit_addr = (src & 0xffffff) * 8;   /* convert to bit address */
332339   int pen_size, arg_size, cmd;
333340   int x;
334341   int xinc = (dynax_blit_flip & 1) ? -1 : 1;
r1037r1038
399406            log_draw_error(src,cmd);
400407         // fall through
401408         case 7:   // STOP
402            return (bit_addr + 7) / 8;
409            return ((bit_addr + 7) / 8) & 0xffffff;
403410      }
404411   }
405412}
r1037r1038
638645
639646INLINE void log_blit(int data)
640647{
648#if 1
641649   logerror("%06x: blit src %06x x %03x y %03x flags %02x layer %02x pen %02x penmode %02x w %03x h %03x linelen %03x clip: ctrl %x xy %03x %03x wh %03x %03x\n",
642650         activecpu_get_pc(),
643651         dynax_blit_address,dynax_blit_x,dynax_blit_y,data,
644652         dynax_dest_layer,dynax_blit_pen,dynax_blit_pen_mode,dynax_rect_width,dynax_rect_height,dynax_line_length,
645653         dynax_clip_ctrl,dynax_clip_x,dynax_clip_y, dynax_clip_width,dynax_clip_height      );
654#endif
646655}
647656
648657static void blitter_w(int blitter, offs_t offset,UINT8 data,int irq_vector)
r1037r1038
708717         break;
709718
710719      case 0x0d:
711         dynax_blit_address = (dynax_blit_address & ~0x0000ff) | (data <<0);
720         dynax_blit_address = (dynax_blit_address & 0xffff00) | (data <<0);
712721         break;
713722      case 0x0e:
714         dynax_blit_address = (dynax_blit_address & ~0x00ff00) | (data <<8);
723         dynax_blit_address = (dynax_blit_address & 0xff00ff) | (data <<8);
715724         break;
716725      case 0x0f:
717         dynax_blit_address = (dynax_blit_address & ~0xff0000) | (data<<16);
726         dynax_blit_address = (dynax_blit_address & 0x00ffff) | (data<<16);
718727         break;
719728
720729      case 0x14:
r1037r1038
873882         break;
874883
875884      case 0x0d:
876         dynax_blit_address = (dynax_blit_address & ~0x0000ff) | (data <<0);
885         dynax_blit_address = (dynax_blit_address & 0xffff00) | (data <<0);
877886         break;
878887      case 0x0e:
879         dynax_blit_address = (dynax_blit_address & ~0x00ff00) | (data <<8);
888         dynax_blit_address = (dynax_blit_address & 0xff00ff) | (data <<8);
880889         break;
881890      case 0x0f:
882         dynax_blit_address = (dynax_blit_address & ~0xff0000) | (data<<16);
891         dynax_blit_address = (dynax_blit_address & 0x00ffff) | (data<<16);
883892         break;
884893
885894      case 0x14:
r1037r1038
10271036         break;
10281037
10291038      case 0x34:
1030         dynax_blit_address = (dynax_blit_address & ~0x0000ff) | (data <<0);
1039         dynax_blit_address = (dynax_blit_address & 0xffff00) | (data <<0);
10311040         break;
10321041      case 0x38:
1033         dynax_blit_address = (dynax_blit_address & ~0x00ff00) | (data <<8);
1042         dynax_blit_address = (dynax_blit_address & 0xff00ff) | (data <<8);
10341043         break;
10351044      case 0x3c:
1036         dynax_blit_address = (dynax_blit_address & ~0xff0000) | (data<<16);
1045         dynax_blit_address = (dynax_blit_address & 0x00ffff) | (data<<16);
10371046         break;
10381047
10391048      case 0x50:
r1037r1038
11951204static READ8_HANDLER( rongrong_gfxrom_r )
11961205{
11971206   UINT8 *rom   =   memory_region( REGION_GFX1 );
1198   size_t size      =   memory_region_length( REGION_GFX1 );
1207   size_t size   =   memory_region_length( REGION_GFX1 );
11991208   int address   =   dynax_blit_address;
12001209
12011210   if (address >= size)
r1037r1038
12041213      address %= size;
12051214   }
12061215
1207   dynax_blit_address++;
1216   dynax_blit_address = (dynax_blit_address + 1) & 0xffffff;
12081217
12091218   return rom[address];
12101219}
r1037r1038
16711680ADDRESS_MAP_END
16721681
16731682
1683static UINT16 *ddenlvrj_dsw_sel;
1684
1685static READ16_HANDLER( ddenlvrj_dsw_r )
1686{
1687   UINT16 dsw = 0;
1688   if ((~*ddenlvrj_dsw_sel) & 0x01)   dsw |= readinputport(3);   // dsw 1
1689   if ((~*ddenlvrj_dsw_sel) & 0x02)   dsw |= readinputport(4);   // dsw 2
1690   if ((~*ddenlvrj_dsw_sel) & 0x04)   dsw |= readinputport(5);   // ?
1691   return dsw;
1692}
1693
1694static WRITE16_HANDLER( ddenlvrj_coincounter_w )
1695{
1696   if (ACCESSING_LSB)
1697   {
1698      coin_counter_w(0, data & 0x01);
1699      coin_counter_w(1, data & 0x04);
1700      //                data & 0x80 ?
1701   }
1702}
1703
1704static READ16_HANDLER( ddenlvrj_blitter_r )
1705{
1706   return readinputport(2) | (dynax_blitter_irq_flag ? 0x60 : 0x00 );   // bit 4 = 1 -> blitter busy
1707}
1708
1709static ADDRESS_MAP_START( ddenlvrj_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1710   AM_RANGE(0x000000, 0x07ffff) AM_READ(MRA16_ROM               )   // ROM
1711   AM_RANGE(0x300070, 0x300071) AM_READ(unk16_r               )   // ? must be 78 on startup (not necessary in ddlover)
1712   AM_RANGE(0x300086, 0x300087) AM_READ(ddenlovr_gfxrom_r         )   // Video Chip
1713   AM_RANGE(0x300100, 0x30011f) AM_READ(msm6242_lsb_r            )   // 6242RTC
1714   AM_RANGE(0x300180, 0x300181) AM_READ(input_port_0_word_r      )   // P1
1715   AM_RANGE(0x300182, 0x300183) AM_READ(input_port_1_word_r      )   // P2
1716   AM_RANGE(0x300184, 0x300185) AM_READ(ddenlvrj_blitter_r         )   // Coins + ?
1717   AM_RANGE(0x300186, 0x300187) AM_READ(ddenlvrj_dsw_r            )   // DSW
1718   AM_RANGE(0x300240, 0x300241) AM_READ(OKIM6295_status_0_lsb_r   )   // Sound
1719   AM_RANGE(0xff0000, 0xffffff) AM_READ(MRA16_RAM               )   // RAM
1720ADDRESS_MAP_END
1721
1722static ADDRESS_MAP_START( ddenlvrj_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1723   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(MWA16_ROM                  )   // ROM
1724   AM_RANGE(0x200000, 0x2003ff) AM_WRITE(ddenlovr_palette_w         )   // Palette
1725//  AM_RANGE(0x201000, 0x2017ff) AM_WRITE(MWA16_RAM                     )   // ? B0 on startup, then 00
1726   AM_RANGE(0x300040, 0x300047) AM_WRITE(ddenlovr_palette_base_w      )
1727   AM_RANGE(0x300048, 0x30004f) AM_WRITE(ddenlovr_palette_mask_w      )
1728   AM_RANGE(0x300050, 0x300057) AM_WRITE(ddenlovr_transparency_pen_w   )
1729   AM_RANGE(0x300058, 0x30005f) AM_WRITE(ddenlovr_transparency_mask_w   )
1730   AM_RANGE(0x300068, 0x300069) AM_WRITE(ddenlovr_bgcolor_w         )
1731   AM_RANGE(0x30006a, 0x30006b) AM_WRITE(ddenlovr_priority_w         )
1732   AM_RANGE(0x30006c, 0x30006d) AM_WRITE(ddenlovr_layer_enable_w      )
1733   AM_RANGE(0x300080, 0x300083) AM_WRITE(ddenlovr_blitter_w         )
1734   AM_RANGE(0x3000c0, 0x3000c1) AM_WRITE(YM2413_register_port_0_lsb_w   )
1735   AM_RANGE(0x3000c2, 0x3000c3) AM_WRITE(YM2413_data_port_0_lsb_w      )
1736   AM_RANGE(0x300100, 0x30011f) AM_WRITE(msm6242_lsb_w               )   // 6242RTC
1737   AM_RANGE(0x300140, 0x300141) AM_WRITE(AY8910_control_port_0_lsb_w   )
1738   AM_RANGE(0x300142, 0x300143) AM_WRITE(AY8910_write_port_0_lsb_w      )
1739   AM_RANGE(0x300188, 0x300189) AM_WRITE(ddenlvrj_coincounter_w      )   // Coin Counters
1740   AM_RANGE(0x30018a, 0x30018b) AM_WRITE(MWA16_RAM                  ) AM_BASE( &ddenlvrj_dsw_sel )   // DSW select
1741   AM_RANGE(0x30018c, 0x30018d) AM_WRITE(ddenlovr_oki_bank_w         )
1742   AM_RANGE(0x3001ca, 0x3001cb) AM_WRITE(ddenlovr_blitter_irq_ack_w   )   // Blitter irq acknowledge
1743   AM_RANGE(0x300240, 0x300241) AM_WRITE(OKIM6295_data_0_lsb_w       )
1744   AM_RANGE(0xff0000, 0xffffff) AM_WRITE(MWA16_RAM                  )   // RAM
1745ADDRESS_MAP_END
1746
1747
16741748static ADDRESS_MAP_START( ddenlovr_readmem, ADDRESS_SPACE_PROGRAM, 16 )
16751749   AM_RANGE(0x000000, 0x07ffff) AM_READ(MRA16_ROM               )   // ROM
16761750   AM_RANGE(0xe00086, 0xe00087) AM_READ(ddenlovr_gfxrom_r         )   // Video Chip
r1037r1038
23062380      romdata[0] = rom[address + 0];
23072381      romdata[1] = rom[address + 1];
23082382
2309      dynax_blit_address++;
2383      dynax_blit_address = (dynax_blit_address + 1) & 0xffffff;
23102384
23112385      return romdata[0];
23122386   }
r1037r1038
29473021ADDRESS_MAP_END
29483022
29493023
3024/***************************************************************************
3025                  Panel & Variety Akamaru Q Jousyou Dont-R
3026***************************************************************************/
29503027
3028static UINT16 akamaru_protection1;
3029static READ16_HANDLER( akamaru_protection1_r )
3030{
3031   return (akamaru_protection1 & 0x0008) ? 0x0001 : 0x0000;
3032}
3033static WRITE16_HANDLER( akamaru_protection1_w )
3034{
3035   int bank;
3036   COMBINE_DATA( &akamaru_protection1 );
3037   // BCD number?
3038   bank = (((akamaru_protection1>>4)&0xf)%10) * 10 + ((akamaru_protection1&0xf)%10);
3039   OKIM6295_set_bank_base(0, bank * 0x40000);
29513040
3041//  popmessage("bank $%0x (%d)",akamaru_protection1, bank);
3042}
3043
3044
3045static UINT16 *akamaru_protection2;
3046static READ16_HANDLER( akamaru_protection2_r )
3047{
3048   return 0x55;
3049}
3050
3051static UINT16 *akamaru_dsw_sel;
3052static READ16_HANDLER( akamaru_dsw_r )
3053{
3054   UINT16 dsw = 0;
3055   if (akamaru_dsw_sel[1] == 0xff)   dsw |= readinputport(3);
3056   if (akamaru_dsw_sel[0] == 0xff)   dsw |= readinputport(4);
3057   return dsw;
3058}
3059
3060static READ16_HANDLER( akamaru_blitter_r )
3061{
3062   return dynax_blitter_irq_flag << 6;   // bit 7 = 1 -> blitter busy
3063}
3064
3065static READ16_HANDLER( akamaru_e0010d_r )
3066{
3067   return 0xffff;   // read but not used, it seems
3068}
3069
3070static ADDRESS_MAP_START( akamaru_readmem, ADDRESS_SPACE_PROGRAM, 16 )
3071   AM_RANGE(0x000000, 0x1fffff) AM_READ(MRA16_ROM               )   // ROM
3072   AM_RANGE(0x624680, 0x624681) AM_READ(akamaru_protection1_r )
3073   AM_RANGE(0xe00086, 0xe00087) AM_READ(ddenlovr_gfxrom_r         )   // Video Chip
3074   AM_RANGE(0xe00070, 0xe00071) AM_READ(unk16_r               )   // ? must be 78 on startup (not necessary in ddlover)
3075   AM_RANGE(0xe00100, 0xe00101) AM_READ(input_port_0_word_r      )   // P1?
3076   AM_RANGE(0xe00102, 0xe00103) AM_READ(input_port_1_word_r      )   // P2?
3077   AM_RANGE(0xe00104, 0xe00105) AM_READ(input_port_2_word_r      )   // Coins
3078   AM_RANGE(0xe00106, 0xe00107) AM_READ(akamaru_protection2_r      )
3079   AM_RANGE(0xe0010c, 0xe0010d) AM_READ(akamaru_e0010d_r         )
3080   AM_RANGE(0xe00200, 0xe00201) AM_READ(akamaru_dsw_r            )   // DSW
3081   AM_RANGE(0xe00204, 0xe00205) AM_READ(akamaru_blitter_r         )   // Blitter Busy & IRQ
3082   AM_RANGE(0xe00500, 0xe0051f) AM_READ(msm6242_lsb_r            )   // 6242RTC
3083   AM_RANGE(0xe00604, 0xe00605) AM_READ(AY8910_read_port_0_lsb_r   )
3084   AM_RANGE(0xe00700, 0xe00701) AM_READ(OKIM6295_status_0_lsb_r   )   // Sound
3085   AM_RANGE(0xff0000, 0xffffff) AM_READ(MRA16_RAM               )   // RAM
3086ADDRESS_MAP_END
3087
3088static ADDRESS_MAP_START( akamaru_writemem, ADDRESS_SPACE_PROGRAM, 16 )
3089   AM_RANGE(0x000000, 0x1fffff) AM_WRITE(MWA16_ROM                  )   // ROM
3090   AM_RANGE(0x213570, 0x213571) AM_WRITE(akamaru_protection1_w         )   // OKI bank
3091   AM_RANGE(0xd00000, 0xd003ff) AM_WRITE(ddenlovr_palette_w         )   // Palette
3092//  AM_RANGE(0xd01000, 0xd017ff) AM_WRITE(MWA16_RAM                     )   // 0
3093   AM_RANGE(0xe00040, 0xe00047) AM_WRITE(ddenlovr_palette_base_w      )
3094   AM_RANGE(0xe00048, 0xe0004f) AM_WRITE(ddenlovr_palette_mask_w      )
3095   AM_RANGE(0xe00050, 0xe00057) AM_WRITE(ddenlovr_transparency_pen_w   )
3096   AM_RANGE(0xe00058, 0xe0005f) AM_WRITE(ddenlovr_transparency_mask_w   )
3097   AM_RANGE(0xe00068, 0xe00069) AM_WRITE(ddenlovr_bgcolor_w         )
3098   AM_RANGE(0xe0006a, 0xe0006b) AM_WRITE(ddenlovr_priority_w         )
3099   AM_RANGE(0xe0006c, 0xe0006d) AM_WRITE(ddenlovr_layer_enable_w      )
3100   AM_RANGE(0xe00080, 0xe00083) AM_WRITE(ddenlovr_blitter_w         )
3101   AM_RANGE(0xe00108, 0xe0010b) AM_WRITE(MWA16_RAM                  ) AM_BASE( &akamaru_protection2 )
3102   AM_RANGE(0xe00302, 0xe00303) AM_WRITE(ddenlovr_blitter_irq_ack_w   )   // Blitter irq acknowledge
3103   AM_RANGE(0xe00304, 0xe00307) AM_WRITE(MWA16_RAM                  ) AM_BASE( &akamaru_dsw_sel )   // DSW select
3104   AM_RANGE(0xe00308, 0xe00309) AM_WRITE(ddenlovr_coincounter_0_w      )   // Coin Counters
3105   AM_RANGE(0xe0030c, 0xe0030d) AM_WRITE(ddenlovr_coincounter_1_w      )   //
3106   AM_RANGE(0xe00400, 0xe00401) AM_WRITE(YM2413_register_port_0_lsb_w   )
3107   AM_RANGE(0xe00402, 0xe00403) AM_WRITE(YM2413_data_port_0_lsb_w      )
3108   AM_RANGE(0xe00500, 0xe0051f) AM_WRITE(msm6242_lsb_w               )   // 6242RTC
3109   AM_RANGE(0xe00600, 0xe00601) AM_WRITE(AY8910_control_port_0_lsb_w   )
3110   AM_RANGE(0xe00602, 0xe00603) AM_WRITE(AY8910_write_port_0_lsb_w      )
3111   AM_RANGE(0xe00700, 0xe00701) AM_WRITE(OKIM6295_data_0_lsb_w       )
3112   AM_RANGE(0xff0000, 0xffffff) AM_WRITE(MWA16_RAM                  )   // RAM
3113ADDRESS_MAP_END
3114
3115
3116INPUT_PORTS_START( ddenlvrj )
3117   PORT_START   // IN0 - Player 1
3118   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
3119   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
3120   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
3121   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
3122   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
3123   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
3124   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
3125   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
3126
3127   PORT_START   // IN1 - Player 2
3128   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START2 )
3129   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
3130   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
3131   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
3132   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
3133   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
3134   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
3135   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
3136
3137   PORT_START   // IN2 - Coins + ?
3138   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1    )
3139   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_COIN2    )
3140   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_SERVICE1 )
3141   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_SERVICE  ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1)   /* Test */
3142   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL  )   // blitter busy flag
3143   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL  )   // blitter irq flag?
3144   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL  )   // RTC
3145   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL  )
3146
3147   PORT_START   // IN3 - DSW1
3148   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
3149   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
3150   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
3151   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
3152   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
3153   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )
3154   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
3155   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
3156   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
3157   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
3158   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Demo_Sounds ) )
3159   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3160   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
3161   PORT_DIPNAME( 0x20, 0x20, "Helps" )
3162   PORT_DIPSETTING(    0x20, "1" )
3163   PORT_DIPSETTING(    0x00, "2" )
3164   PORT_DIPNAME( 0x40, 0x40, "Unknown 1-6" )
3165   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
3166   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3167   PORT_DIPNAME( 0x80, 0x80, "Unknown 1-7" )
3168   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
3169   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3170
3171   PORT_START   // IN4 - DSW2
3172   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) )
3173   PORT_DIPSETTING(    0x06, "1 (Easy)" )
3174   PORT_DIPSETTING(    0x05, "2" )
3175   PORT_DIPSETTING(    0x04, "3" )
3176   PORT_DIPSETTING(    0x07, "4 (Normal)" )
3177   PORT_DIPSETTING(    0x03, "5" )
3178   PORT_DIPSETTING(    0x02, "6" )
3179   PORT_DIPSETTING(    0x01, "7" )
3180   PORT_DIPSETTING(    0x00, "8 (Hard)" )
3181   PORT_DIPNAME( 0x18, 0x18, "Timer Speed" )
3182   PORT_DIPSETTING(    0x10, "Slow" )
3183   PORT_DIPSETTING(    0x18, DEF_STR( Normal ) )
3184   PORT_DIPSETTING(    0x08, "Fast" )
3185   PORT_DIPSETTING(    0x00, "Fastest" )
3186   PORT_DIPNAME( 0x20, 0x20, "Unknown 2-5" )
3187   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
3188   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3189   PORT_DIPNAME( 0x40, 0x40, "Unknown 2-6" )
3190   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
3191   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3192   PORT_DIPNAME( 0x80, 0x80, "Unknown 2-7" )
3193   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
3194   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3195
3196   PORT_START   // IN5 - DSW1 & 2 top bits
3197   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
3198   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
3199   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3200   PORT_SERVICE( 0x02, IP_ACTIVE_LOW )
3201   PORT_DIPNAME( 0x04, 0x04, "Unknown 2-8" )
3202   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
3203   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3204   PORT_DIPNAME( 0x08, 0x08, "Unknown 2-9" )
3205   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
3206   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3207   PORT_DIPNAME( 0x10, 0x10, "Unknown 3-4" )
3208   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
3209   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3210   PORT_DIPNAME( 0x20, 0x20, "Unknown 3-5" )
3211   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
3212   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3213   PORT_DIPNAME( 0x40, 0x40, "Unknown 3-6" )
3214   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
3215   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3216   PORT_DIPNAME( 0x80, 0x00, "Force Test Mode?" )   // shows all dsw's as off
3217   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
3218   PORT_DIPSETTING(    0x80, DEF_STR( Yes ) )
3219INPUT_PORTS_END
3220
3221
29523222INPUT_PORTS_START( ddenlovr )
29533223   PORT_START   // IN0 - Player 1
29543224   PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_START1 )
r1037r1038
29583228   PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
29593229   PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
29603230   PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
2961   PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
3231   PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
29623232
29633233   PORT_START   // IN1 - Player 2
29643234   PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_START2 )
r1037r1038
29683238   PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
29693239   PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
29703240   PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
2971   PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
3241   PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
29723242
29733243   PORT_START   // IN2 - Coins + ?
29743244   PORT_BIT(  0x01, IP_ACTIVE_LOW,  IPT_COIN1    )
r1037r1038
29803250   PORT_BIT(  0x40, IP_ACTIVE_HIGH, IPT_SPECIAL  )   // blitter irq flag
29813251   PORT_BIT(  0x80, IP_ACTIVE_HIGH, IPT_SPECIAL  )   // blitter busy flag
29823252
2983   /* one of the dips selects the nudity level */
29843253   PORT_START   // IN3 - DSW
29853254   PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
29863255   PORT_DIPNAME( 0x02, 0x02, "Unknown 1-1" )
r1037r1038
29953264   PORT_DIPNAME( 0x10, 0x10, "Unknown 1-4" )
29963265   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
29973266   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2998   PORT_DIPNAME( 0x20, 0x20, "Unknown 1-5*" )
2999   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
3000   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3001   PORT_DIPNAME( 0x40, 0x40, "Unknown 1-6*" )   // 6&7
3002   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
3003   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3004   PORT_DIPNAME( 0x80, 0x80, "Unknown 1-7*" )
3005   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
3006   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3267   PORT_DIPNAME( 0x20, 0x20, "Comments / Help" )
3268   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
3269   PORT_DIPSETTING(    0x20, DEF_STR( Yes ) )
3270   PORT_DIPNAME( 0xc0, 0xc0, "Show Girl" )
3271   PORT_DIPSETTING(    0x80, DEF_STR( No ) )
3272   PORT_DIPSETTING(    0x40, "Yes, Clothed" )
3273   PORT_DIPSETTING(    0xc0, "Yes, Bikini" )
3274   PORT_DIPSETTING(    0x00, "Yes, Topless" )
30073275INPUT_PORTS_END
30083276
30093277
r1037r1038
53745642   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
53755643INPUT_PORTS_END
53765644
5645INPUT_PORTS_START( akamaru )
5646   PORT_START   // IN0 - Player 1
5647   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
5648   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
5649   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
5650   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
5651   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
5652   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
5653   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
5654   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
53775655
5656   PORT_START   // IN1 - Player 2
5657   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START2 )
5658   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
5659   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
5660   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
5661   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
5662   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
5663   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
5664   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
5665
5666   PORT_START   // IN2 - Coins + ?
5667   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1    )
5668   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_COIN2    )
5669   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_SERVICE1 )
5670   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_SERVICE  ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1)   /* Test */
5671   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
5672   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_SPECIAL  )
5673   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL  )   // blitter irq flag
5674   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL  )   // blitter busy flag
5675
5676   PORT_START   // IN3 - DSW1
5677   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
5678   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
5679   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
5680   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
5681   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
5682   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )
5683   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
5684   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
5685   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
5686   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
5687   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Demo_Sounds ) )
5688   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
5689   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
5690   PORT_DIPNAME( 0x20, 0x20, "Unknown 1-5" )
5691   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
5692   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5693   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
5694   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
5695   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5696   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
5697
5698   PORT_START   // IN4 - DSW2
5699   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
5700   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
5701   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
5702   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
5703   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
5704   PORT_DIPNAME( 0x04, 0x04, "Unknown 2-2" )
5705   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
5706   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5707   PORT_DIPNAME( 0x08, 0x08, "Unknown 2-3" )
5708   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
5709   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5710   PORT_DIPNAME( 0x10, 0x10, "Unknown 2-4" )
5711   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
5712   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5713   PORT_DIPNAME( 0x20, 0x20, "Unknown 2-5" )
5714   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
5715   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5716   PORT_DIPNAME( 0x40, 0x40, "Unknown 2-6" )
5717   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
5718   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5719   PORT_DIPNAME( 0x80, 0x80, "Unknown 2-7" )
5720   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
5721   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5722INPUT_PORTS_END
5723
5724
53785725/***************************************************************************
53795726                            Don Den Lover Vol.1
53805727***************************************************************************/
r1037r1038
54145761   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
54155762MACHINE_DRIVER_END
54165763
5764static MACHINE_DRIVER_START( ddenlvrj )
5765
5766   /* basic machine hardware */
5767   MDRV_IMPORT_FROM(ddenlovr)
5768   MDRV_CPU_MODIFY("main")
5769   MDRV_CPU_PROGRAM_MAP(ddenlvrj_readmem,ddenlvrj_writemem)
5770MACHINE_DRIVER_END
5771
5772static MACHINE_DRIVER_START( akamaru )
5773
5774   /* basic machine hardware */
5775   MDRV_IMPORT_FROM(ddenlovr)
5776   MDRV_CPU_MODIFY("main")
5777   MDRV_CPU_PROGRAM_MAP(akamaru_readmem,akamaru_writemem)
5778MACHINE_DRIVER_END
5779
5780
54175781static struct AY8910interface quiz365_ay8910_interface =
54185782{
54195783   quiz365_input_r,
r1037r1038
61456509
61466510/***************************************************************************
61476511
6512Don Den Lover Vol.1 -Shiro Kuro Tsukeyo!-
6513(c)1995 Dynax
6514D1120901L8
6515
6516CPU: 68000(surface scratched)
6517Sound: YM2413(OPLL)
6518       YMZ284-D(AY-3-8910 without I/O ports)
6519       M6295
6520OSC: 2x ?MHz (surface-scratched)
6521Video: HD46505SP-2(HD68B45SP)
6522Others: Battery, RTC 62421B
6523All custom chips, PALs, GALs are surface-scratched.
6524
6525ROMs:
65261121.2N      [e2b8359e] \
65271122.2M      [e8619d66] -- Samples
6528
65291123.2H      [d41cbed0] \
65301124.2D      [6a9ec557] -- Programs
6531
65321125.2B      [0181f53c] \
65331126.2A      [17ff2df4] |
65341127.3D      [9c136914] |- Blitter data
65351128.3C      [757c9941] |
65361129.3B      [957bc57e] /
6537
6538***************************************************************************/
6539
6540ROM_START( ddenlvrj )
6541   ROM_REGION( 0x080000, REGION_CPU1, 0 )      /* 68000 Code */
6542   ROM_LOAD16_BYTE( "1124.2d", 0x000000, 0x040000, CRC(6a9ec557) SHA1(e1512601910a9d06e16a20e10ab7acc96a0819bd) )
6543   ROM_LOAD16_BYTE( "1123.2h", 0x000001, 0x040000, CRC(d41cbed0) SHA1(5c80f6a6cf15518120f664a0446355e80eeb2a0f) )
6544
6545   ROM_REGION( 0xe80000, REGION_GFX1, 0 )   /* blitter data */
6546   /* 000000-bfffff empty */
6547   ROM_LOAD( "1125.2b", 0xc00000, 0x080000, CRC(0181f53c) SHA1(64a6a2f00f81f7181700b83912033a6ee8bbf73a) )
6548   ROM_LOAD( "1126.2a", 0xc80000, 0x080000, CRC(17ff2df4) SHA1(7b6723e0a0f471698735a31aa19dc4ebabe35e8c) )
6549   ROM_LOAD( "1127.3d", 0xd00000, 0x080000, CRC(9c136914) SHA1(ff1f9a90814523cafdaa2ed36926482b1078aa89) )
6550   ROM_LOAD( "1128.3c", 0xd80000, 0x080000, CRC(757c9941) SHA1(31206112d4b20369b6584cae75dbe3b3e0ca9825) )
6551   ROM_LOAD( "1129.3b", 0xe00000, 0x080000, CRC(957bc57e) SHA1(801f5cc4e9da8b46dcd9488741585a5c8c88b51a) )
6552
6553   ROM_REGION( 0x200000, REGION_SOUND1, 0 )   /* Samples */
6554   ROM_LOAD( "1122.2m", 0x080000, 0x080000, CRC(e8619d66) SHA1(b40db5db1bd0a12cd66eb5192e53ddc5b85bd1cf) )   // bank 4, 5
6555   ROM_LOAD( "1121.2n", 0x100000, 0x080000, CRC(e2b8359e) SHA1(d882635370405610a1707d9e39a0d8e025ad6e22) )   // bank 2, 3
6556ROM_END
6557
6558
6559/***************************************************************************
6560
61486561Don Den Lover Vol 1
61496562(C) Dynax Inc 1995
61506563
r1037r1038
61816594   ROM_LOAD( "1132h.1e", 0x100000, 0x080000, CRC(2de6363d) SHA1(2000328e41bc0261f19e02323434e9dfdc61013a) )   // bank 4, 5
61826595ROM_END
61836596
6597/* Korean bootleg board */
6598ROM_START( ddenlovb )
6599   ROM_REGION( 0x080000, REGION_CPU1, 0 )      /* 68000 Code */
6600   ROM_LOAD16_BYTE( "rom2", 0x000000, 0x040000, CRC(cabdf78f) SHA1(789d4754c7b84964ee317b8a618f26a417f50bcc) )
6601   ROM_LOAD16_BYTE( "rom3", 0x000001, 0x040000, CRC(36f8d05e) SHA1(78f75175541ebf377f5375ea30d80ea91f380971) )
61846602
6603   ROM_REGION( 0x480000, REGION_GFX1, 0 )   /* blitter data */
6604   ROM_LOAD( "rom4", 0x000000, 0x080000, CRC(ee143d8e) SHA1(61a36c64d450209071e996b418adf416dfa68fd9) )
6605   ROM_LOAD( "rom5", 0x080000, 0x080000, CRC(58a662be) SHA1(3e2fc167bdee74ebfa63c3b1b0d822e3d898c30c) )
6606   ROM_LOAD( "rom6", 0x100000, 0x080000, CRC(f96e0708) SHA1(e910970a4203b9b1943c853e3d869dd43cdfbc2d) )
6607   ROM_LOAD( "rom7", 0x180000, 0x080000, CRC(b47e27ec) SHA1(5a36e68eb7c868ce8ca9d11bd9bcaa7f101ee64f) )
6608   ROM_LOAD( "rom8", 0x200000, 0x080000, CRC(7c7beef6) SHA1(f8631aaec7cc01cc6478f3fc95fdac51c5b5d226) )
6609
6610   ROM_REGION( 0x200000, REGION_SOUND1, 0 )   /* Samples */
6611   ROM_LOAD( "rom1", 0x100000, 0x080000, CRC(ba4723e8) SHA1(fd32b33bd43773fed083990b59a3994f4a631b04) )
6612ROM_END
6613
61856614static DRIVER_INIT( rongrong )
61866615{
61876616   /* Rong Rong seems to have a protection that works this way:
r1037r1038
68207249   ROM_LOAD( "1.1e", 0x00000, 0x20000, CRC(09b7a9b2) SHA1(64d9ccbb726bb6c5b362afc92bca2e3db87fd454) )
68217250ROM_END
68227251
6823GAME( 1992, mmpanic,  0,       mmpanic,  mmpanic,  0,        ROT0, "Nakanihon + East Technology (Taito license)", "Monkey Mole Panic (USA)",                    GAME_NO_COCKTAIL )
6824GAME( 1993, funkyfig, 0,       funkyfig, funkyfig, 0,        ROT0, "Nakanihon + East Technology (Taito license)", "The First Funky Fighter",                    GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )   // scrolling, priority?
6825GAME( 1993, quizchq,  0,       quizchq,  quizchq,  0,        ROT0, "Nakanihon",                                   "Quiz Channel Question (Ver 1.00) (Japan)",   GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
6826GAME( 1993, quizchql, quizchq, quizchq,  quizchq,  0,        ROT0, "Nakanihon (Laxan license)",                   "Quiz Channel Question (Ver 1.23) (Taiwan?)", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
6827GAME( 1993, animaljr, 0,       mmpanic,  animaljr, 0,        ROT0, "Nakanihon + East Technology (Taito license)", "Animalandia Jr.",                            GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND )
6828GAME( 1994, hginga,   0,       hginga,   hginga,   0,        ROT0, "Dynax",                                       "Hanafuda Hana Ginga",                        GAME_NO_COCKTAIL )
6829GAME( 1994, mjmyster, 0,       mjmyster, mjmyster, 0,        ROT0, "Dynax",                                       "Mahjong The Mysterious World",               GAME_NO_COCKTAIL )
6830GAME( 1994, mjmywrld, mjmyster,mjmywrld, mjmyster, 0,        ROT0, "Dynax",                                       "Mahjong The Mysterious World (set 2)",       GAME_NO_COCKTAIL )
6831GAME( 1994, mjmyornt, 0,       mjmyornt, mjmyornt, 0,        ROT0, "Dynax",                                       "Mahjong The Mysterious Orient",              GAME_NO_COCKTAIL )
6832GAME( 1994, mjmyuniv, 0,       mjmyuniv, mjmyster, 0,        ROT0, "Dynax",                                       "Mahjong The Mysterious Universe",            GAME_NO_COCKTAIL )
6833GAME( 1994, quiz365,  0,       quiz365,  quiz365,  0,        ROT0, "Nakanihon",                                   "Quiz 365 (Japan)",                           GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
6834GAME( 1994, quiz365t, quiz365, quiz365,  quiz365,  0,        ROT0, "Nakanihon + Taito",                           "Quiz 365 (Hong Kong & Taiwan)",              GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
6835GAME( 1994, rongrong, 0,       rongrong, rongrong, rongrong, ROT0, "Nakanihon",                                   "Rong Rong (Europe)",                         GAME_NO_COCKTAIL | GAME_IMPERFECT_COLORS )
6836GAME( 1994, rongrngg, rongrong,rongrong, rongrong, rongrong, ROT0, "Nakanihon",                                   "Rong Rong (Germany)",                        GAME_NO_COCKTAIL | GAME_IMPERFECT_COLORS )
6837GAME( 1995, mjdchuka, 0,       mjchuuka, mjchuuka, 0,        ROT0, "Dynax",                                       "Mahjong The Dai Chuuka Ken (China, v. D111)",GAME_NO_COCKTAIL )
6838GAME( 1995, nettoqc,  0,       nettoqc,  nettoqc,  0,        ROT0, "Nakanihon",                                   "Nettoh Quiz Champion (Japan)",               GAME_NO_COCKTAIL | GAME_IMPERFECT_COLORS )
6839GAME( 1996, ddenlovr, 0,       ddenlovr, ddenlovr, 0,        ROT0, "Dynax",                                       "Don Den Lover Vol. 1 (Hong Kong)",           GAME_NO_COCKTAIL )
6840GAME( 1996, hanakanz, 0,       hanakanz, hanakanz, 0,        ROT0, "Dynax",                                       "Hana Kanzashi (Japan)",                      GAME_NO_COCKTAIL )
6841GAME( 1997, hkagerou, 0,       hkagerou, hkagerou, 0,        ROT0, "Nakanihon + Dynax",                           "Hana Kagerou [BET] (Japan)",                 GAME_NO_COCKTAIL )
6842GAME( 1998, mjchuuka, 0,       mjchuuka, mjchuuka, 0,        ROT0, "Dynax",                                       "Mahjong Chuukanejyo (China)",                GAME_NO_COCKTAIL )
6843GAME( 1998, mjreach1, 0,       mjreach1, mjreach1, 0,        ROT0, "Nihon System",                                "Mahjong Reach Ippatsu (Japan)",              GAME_NO_COCKTAIL )
7252/***************************************************************************
7253
7254Panel & Variety Akamaru Q Jousyou Dont-R
7255(c)1996 Dynax (distributed by B&F)
7256
7257CPU: TMP68HC000N-12
7258Sound: YM2413, YMZ284-D, M6295 (VRx2, 1 for BGM, 1 for Voice)
7259OSC: 24.00000MHz (near CPU), 28.63636MHz (near sound section)
7260RTC: 62421B
7261Custom: NAKANIHON NL-005
7262PLD: Actel A1010B (printed NM500)
7263
7264ROMs (on subboard):
726550101.1H (TMS 27C040)
726650102.1G (TMS 27C040)
726750103.1F (TMS 27C040)
726850104.1E (TMS 27C040)
726950105.1D (TMS 27C040)
727050106.1C (TMS 27C040)
727150107.1B (TMS 27C040)
727250108.1A (TMS 27C040)
727350109.2H (TC538000)
727450110.3H (TC538000)
727550111.4H (TMS 27C040)
727650112.2D (TC538000)
727750113.3D (TMS 27C040)
727850114.4D (TMS 27C040)
7279
7280***************************************************************************/
7281
7282ROM_START( akamaru )
7283   ROM_REGION( 0x200000, REGION_CPU1, 0 )      /* 68000 Code */
7284   ROM_LOAD16_BYTE( "50107.1b", 0x000000, 0x080000, CRC(8364d627) SHA1(ed445561b3a35e6445d1074000621554a6f26fc4) )
7285   ROM_LOAD16_BYTE( "50105.1d", 0x000001, 0x080000, CRC(42ff4bec) SHA1(4bab20706542056d39dfcd91314523bf0f7fff07) )
7286   ROM_LOAD16_BYTE( "50108.1a", 0x100000, 0x080000, CRC(1520ecad) SHA1(eaf44511148252eac0c7a7aab9bd689f87e5a40f) )
7287   ROM_LOAD16_BYTE( "50106.1c", 0x100001, 0x080000, CRC(8e081747) SHA1(ef7fb469455671ca7982c2455e8cb113c2750e30) )
7288
7289   ROM_REGION( 0x480000, REGION_GFX1, 0 )   /* blitter data */
7290   ROM_LOAD( "50109.2h", 0x000000, 0x100000, CRC(cdff154d) SHA1(d9cdf159cd55fef0dd1abe07c2f19f05f63b2d1e) )
7291   ROM_LOAD( "50112.2d", 0x100000, 0x100000, CRC(7fdd9853) SHA1(d4ada01fa49b2932d02df5eb3d3e7eaad535df0b) )
7292   ROM_LOAD( "50110.3h", 0x200000, 0x100000, CRC(06ca4d87) SHA1(c80708df3613d36950ba5cc98d36336533ee7699) )
7293   ROM_LOAD( "50113.3d", 0x300000, 0x080000, CRC(c9a571cd) SHA1(6493d458a8adc0774d6c0ff67ba272a8f6e9ce07) )
7294   ROM_LOAD( "50111.4h", 0x380000, 0x080000, CRC(b2de7a3c) SHA1(12b3e59f09dbad35a7a98e55ba64041cdb341488) )
7295   ROM_LOAD( "50114.4d", 0x400000, 0x080000, CRC(2af39dfd) SHA1(61cfced3807a80be3233d1df3eedad25b796a9cf) )
7296
7297   ROM_REGION( 0x300000, REGION_SOUND1, 0 )   /* Samples */
7298   // bank 0, 1
7299   ROM_LOAD( "50101.1h", 0x080000, 0x080000, CRC(6bef6cab) SHA1(bd1c7e06ac4fc9de368ad90f0a9fc602024eda35) )   // bank 2, 3
7300   ROM_LOAD( "50102.1g", 0x100000, 0x080000, CRC(056ac348) SHA1(26c34692dc858928268299743857c69e00eb969d) )   // bank 4, 5
7301   // bank 6, 7
7302   ROM_LOAD( "50104.1e", 0x200000, 0x080000, CRC(790f18c1) SHA1(72c1c6f711267e1b57dedad04bac44e3e0829725) )   // bank 8, 9
7303   ROM_LOAD( "50103.1f", 0x280000, 0x080000, CRC(aff3a753) SHA1(1ee4464107531d90a1decb85c5a0fb937dd6706b) )   // bank 10, 11
7304ROM_END
7305
7306
7307GAME( 1992, mmpanic,  0,        mmpanic,  mmpanic,  0,        ROT0, "Nakanihon + East Technology (Taito license)", "Monkey Mole Panic (USA)",                            GAME_NO_COCKTAIL )
7308GAME( 1993, funkyfig, 0,        funkyfig, funkyfig, 0,        ROT0, "Nakanihon + East Technology (Taito license)", "The First Funky Fighter",                            GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )   // scrolling, priority?
7309GAME( 1993, quizchq,  0,        quizchq,  quizchq,  0,        ROT0, "Nakanihon",                                   "Quiz Channel Question (Ver 1.00) (Japan)",           GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
7310GAME( 1993, quizchql, quizchq,  quizchq,  quizchq,  0,        ROT0, "Nakanihon (Laxan license)",                   "Quiz Channel Question (Ver 1.23) (Taiwan?)",         GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
7311GAME( 1993, animaljr, 0,        mmpanic,  animaljr, 0,        ROT0, "Nakanihon + East Technology (Taito license)", "Animalandia Jr.",                                    GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND )
7312GAME( 1994, hginga,   0,        hginga,   hginga,   0,        ROT0, "Dynax",                                       "Hanafuda Hana Ginga",                                GAME_NO_COCKTAIL )
7313GAME( 1994, mjmyster, 0,        mjmyster, mjmyster, 0,        ROT0, "Dynax",                                       "Mahjong The Mysterious World",                       GAME_NO_COCKTAIL )
7314GAME( 1994, mjmywrld, mjmyster, mjmywrld, mjmyster, 0,        ROT0, "Dynax",                                       "Mahjong The Mysterious World (set 2)",               GAME_NO_COCKTAIL )
7315GAME( 1994, mjmyornt, 0,        mjmyornt, mjmyornt, 0,        ROT0, "Dynax",                                       "Mahjong The Mysterious Orient",                      GAME_NO_COCKTAIL )
7316GAME( 1994, mjmyuniv, 0,        mjmyuniv, mjmyster, 0,        ROT0, "Dynax",                                       "Mahjong The Mysterious Universe",                    GAME_NO_COCKTAIL )
7317GAME( 1994, quiz365,  0,        quiz365,  quiz365,  0,        ROT0, "Nakanihon",                                   "Quiz 365 (Japan)",                                   GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
7318GAME( 1994, quiz365t, quiz365,  quiz365,  quiz365,  0,        ROT0, "Nakanihon + Taito",                           "Quiz 365 (Hong Kong & Taiwan)",                      GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
7319GAME( 1994, rongrong, 0,        rongrong, rongrong, rongrong, ROT0, "Nakanihon",                                   "Rong Rong (Europe)",                                 GAME_NO_COCKTAIL | GAME_IMPERFECT_COLORS )
7320GAME( 1994, rongrngg, rongrong, rongrong, rongrong, rongrong, ROT0, "Nakanihon",                                   "Rong Rong (Germany)",                                GAME_NO_COCKTAIL | GAME_IMPERFECT_COLORS )
7321GAME( 1995, mjdchuka, 0,        mjchuuka, mjchuuka, 0,        ROT0, "Dynax",                                       "Mahjong The Dai Chuuka Ken (China, v. D111)",        GAME_NO_COCKTAIL )
7322GAME( 1995, nettoqc,  0,        nettoqc,  nettoqc,  0,        ROT0, "Nakanihon",                                   "Nettoh Quiz Champion (Japan)",                       GAME_NO_COCKTAIL | GAME_IMPERFECT_COLORS )
7323GAME( 1995, ddenlvrj, 0,        ddenlvrj, ddenlvrj, 0,        ROT0, "Dynax",                                       "Don Den Lover Vol. 1 - Shiro Kuro Tsukeyo! (Japan)", GAME_NO_COCKTAIL )
7324GAME( 1996, ddenlovr, ddenlvrj, ddenlovr, ddenlovr, 0,        ROT0, "Dynax",                                       "Don Den Lover Vol. 1 (Hong Kong)",                   GAME_NO_COCKTAIL )
7325GAME( 1996, ddenlovb, ddenlvrj, ddenlovr, ddenlovr, 0,        ROT0, "[Dynax] (bootleg)",                           "Don Den Lover Vol. 1 (Korea, bootleg)",              GAME_NO_COCKTAIL )
7326GAME( 1996, hanakanz, 0,        hanakanz, hanakanz, 0,        ROT0, "Dynax",                                       "Hana Kanzashi (Japan)",                              GAME_NO_COCKTAIL )
7327GAME( 1996, akamaru,  0,        akamaru,  akamaru,  0,        ROT0, "Dynax (Nakanihon licence)",                   "Panel & Variety Akamaru Q Jousyou Dont-R",           GAME_NO_COCKTAIL )
7328GAME( 1997, hkagerou, 0,        hkagerou, hkagerou, 0,        ROT0, "Nakanihon + Dynax",                           "Hana Kagerou [BET] (Japan)",                         GAME_NO_COCKTAIL )
7329GAME( 1998, mjchuuka, 0,        mjchuuka, mjchuuka, 0,        ROT0, "Dynax",                                       "Mahjong Chuukanejyo (China)",                        GAME_NO_COCKTAIL )
7330GAME( 1998, mjreach1, 0,        mjreach1, mjreach1, 0,        ROT0, "Nihon System",                                "Mahjong Reach Ippatsu (Japan)",                      GAME_NO_COCKTAIL )
src/mame/drivers/mpu4.c
r1037r1038
27142714   return 0;
27152715}
27162716
2717#ifdef UNUSED_FUNCTION
27172718static WRITE8_HANDLER( dealem_pal_w )
27182719{
27192720   switch (data)
r1037r1038
27252726      }
27262727   }
27272728}
2729#endif
27282730
27292731static ADDRESS_MAP_START( dealem_memmap, ADDRESS_SPACE_PROGRAM, 8 )
27302732
src/mame/drivers/skylncr.c
r1037r1038
9494   return 0xff;
9595}
9696
97#ifdef UNUSED_FUNCTION
9798static READ8_HANDLER( ret_00 )
9899{
99100   return 0x00;
100101}
102#endif
101103
102104static UINT8 skylncr_nmi_enable;
103105
src/mame/drivers/20pacgal.c
r1037r1038
2424TODO:
2525- Starfield.
2626
27- Sound seems to be AWOL in Galaga?
28
2927- Convert to tilemaps & optimize video rendering, I was just too lazy to do it for now.
3028
3129- Check the ASCI interface, there probably is fully working debug code.
r1037r1038
144142
145143static ADDRESS_MAP_START( 20pacgal_port, ADDRESS_SPACE_IO, 8 )
146144   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
147   AM_RANGE(0x3f, 0x3f) AM_NOP   /* Z180 internal registers */
145   AM_RANGE(0x00, 0x3f) AM_NOP /* Z180 internal registers */
148146   AM_RANGE(0x40, 0x7f) AM_NOP   /* Z180 internal registers */
149147   AM_RANGE(0x80, 0x80) AM_READ(input_port_0_r)
150148   AM_RANGE(0x81, 0x81) AM_READ(input_port_1_r)
r1037r1038
228226   { -1 }
229227};
230228
231
232
233INTERRUPT_GEN(_20pacgal_kludge)
234{
235   cpunum_set_input_line( 0, Z180_INT_PRT0, PULSE_LINE );
236}
237
238
239229static struct namco_interface namco_interface =
240230{
241231   3,   /* number of voices */
r1037r1038
249239   MDRV_CPU_PROGRAM_MAP(20pacgal_map,0)
250240   MDRV_CPU_IO_MAP(20pacgal_port,0)
251241   MDRV_CPU_VBLANK_INT(irq0_line_assert,1)
252   MDRV_CPU_PERIODIC_INT(_20pacgal_kludge, 8000)   /* 8000 Hz??? */
253242
254243   MDRV_SCREEN_REFRESH_RATE(60)
255244   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
src/mame/drivers/system16.c
r1037r1038
24732473   ROM_LOAD( "fpointbj_gal20v8.bin", 0x0400, 0x019d, NO_DUMP ) /* Protected */
24742474ROM_END
24752475
2476/* This is a frankenset, it has original and bootleg roms of different sizes and names mixed together, it's
2477   highly unlikely that the original bootleg PCB was like this */
24762478ROM_START( goldnabl )
24772479   ROM_REGION( 0x0c0000, REGION_CPU1, 0 ) /* 68000 code */
24782480// protected code
r1037r1038
25122514   ROM_LOAD( "mpr12384.a11", 0x10000, 0x20000, CRC(6218d8e7) SHA1(5a745c750efb4a61716f99befb7ed14cc84e9973) )
25132515ROM_END
25142516
2517/* Golden Axe (bootleg) made in Italy?
2518   PCB: GENSYS-1/I
2519
2520 CPUs
2521
2522 1x SCN68000CAN64-KGQ7551-8931KE (main - upper board)(IC40)
2523 1x oscillator 20.000MHz (upper board - near main CPU)(XL2)
2524 1x STZ8400BB1-Z80BCPU-28911 (sound - upper board)(IC44)
2525 2x YAMAHA YM2203C (sound - upper board)IC27, IC28)
2526 1x OKI M5205 (sound - upper board)(IC16)
2527 2x YAMAHA Y3014B (DAC - sound - upper board)(IC19, IC20)
2528 1x crystal resonator CSB398P (upper board - near sound CPUs)(XL1)
2529 1x oscillator 24MHz (lower board near connectors to upper board)(XL1)
2530
2531 ROMs
2532 8x TMS27C512-20JL (from 1 to 8 - upper board) (CPU)
2533 26x ST M27512FI (from 9 to 34 - upper board) (Sound + Tilemap)
2534 6x ST M27512FI (from 35 to 40 - lower board) (Sprites)
2535
2536*/
2537
2538
2539ROM_START( goldnab2 )
2540   ROM_REGION( 0x0c0000, REGION_CPU1, 0 ) /* 68000 code */
2541   ROM_LOAD16_BYTE( "ic39.1", 0x00000, 0x10000, CRC(71489c9a) SHA1(ec25463a2c63027d2635f0e27f5a971d68938fe3) )
2542   ROM_LOAD16_BYTE( "ic53.5", 0x00001, 0x10000, CRC(7a98512d) SHA1(f022a047d23051211e2de761b6c2289438b8f3cc) )
2543   ROM_LOAD16_BYTE( "ic38.2", 0x20000, 0x10000, CRC(8c8c95b1) SHA1(2b3897b8af587e6397dca0f3409a803432be07aa) )
2544   ROM_LOAD16_BYTE( "ic52.6", 0x20001, 0x10000, CRC(4f58f15b) SHA1(4dcd7e8cfd8fe5fe9f9259abf53fd0d4c64b5abd) )
2545   /* emtpy 0x40000 - 0x80000 */
2546   ROM_LOAD16_BYTE( "ic37.3", 0x80000, 0x10000, CRC(056879fd) SHA1(fc0a910c1dc4cf535ad589f482f57379798b5524) )
2547   ROM_LOAD16_BYTE( "ic51.7", 0x80001, 0x10000, CRC(8c77d958) SHA1(f7c5abfec2a9d1724c83b1de2cd994bb4c42857c) )
2548   ROM_LOAD16_BYTE( "ic36.4", 0xa0000, 0x10000, CRC(b69ab892) SHA1(9b426058a80abb8dd3d6c0c55574fdc841889a72) )
2549   ROM_LOAD16_BYTE( "ic50.8", 0xa0001, 0x10000, CRC(3cf2f725) SHA1(1f620fcebe8533cba50736ae1d97c095abf1bc25) )
2550
2551   ROM_REGION( 0x60000, REGION_GFX1, ROMREGION_DISPOSE | ROMREGION_INVERT ) /* tiles */
2552   ROM_LOAD( "ic4.35",  0x00000, 0x10000, CRC(84587263) SHA1(3a88c8578a477a487a0a214a367042b9739f39eb) )
2553   ROM_LOAD( "ic18.38", 0x10000, 0x10000, CRC(63d72388) SHA1(ba0a582b1daf3a1e316237efbad17fcc0381643f) )
2554   ROM_LOAD( "ic3.36",  0x20000, 0x10000, CRC(f8b6ae4f) SHA1(55132c98955107e4b247992f7917a6ce588460a7) )
2555   ROM_LOAD( "ic17.39", 0x30000, 0x10000, CRC(e29baf4f) SHA1(3761cb2217599fe3f2f860f9395930b96ec52f47) )
2556   ROM_LOAD( "ic2.37",  0x40000, 0x10000, CRC(22f0667e) SHA1(2d11b2ce105a3db9c914942cace85aff17deded9) )
2557   ROM_LOAD( "ic16.40", 0x50000, 0x10000, CRC(afb1a7e4) SHA1(726fded9db72a881128b43f449d2baf450131f63) )
2558
2559   ROM_REGION( 0x1c0000, REGION_GFX2, 0 ) /* sprites */
2560   ROM_LOAD16_BYTE( "ic73.34",       0x000001, 0x10000, CRC(28ba70c8) SHA1(a6f33e1404928b6d1006943494646d6cfbd60a4b) ) // mpr12378.b1  [1/4]      IDENTICAL
2561   ROM_LOAD16_BYTE( "ic74.33",       0x020001, 0x10000, CRC(2ed96a26) SHA1(edcf915243e6f92d31cdfc53965438f6b6bff51d) ) // mpr12378.b1  [2/4]      IDENTICAL
2562   ROM_LOAD16_BYTE( "ic79.28",       0x100001, 0x10000, CRC(84dccc5b) SHA1(10263d98d663f1170c3203066f391075a1d64ff5) ) // mpr12378.b1  [3/4]      IDENTICAL
2563   ROM_LOAD16_BYTE( "ic80.27",        0x120001, 0x10000, CRC(3d41b995) SHA1(913d2a0c9a2ac6d36589966d7eb5537120ea6ff0) ) // mpr12378.b1  [4/4]      IDENTICAL
2564   ROM_LOAD16_BYTE( "ic58.22",       0x000000, 0x10000, CRC(ede51fe0) SHA1(c05a2b51095a322bac5a67ee8886aecc186cbdfe) ) // mpr12379.b4  [1/4]      IDENTICAL
2565   ROM_LOAD16_BYTE( "ic59.21",       0x020000, 0x10000, CRC(30989141) SHA1(f6e7ae258deedec11b1f80c19575c884aac26c56) ) // mpr12379.b4  [2/4]      IDENTICAL
2566   ROM_LOAD16_BYTE( "ic64.16",       0x100000, 0x10000, CRC(38e4c92a) SHA1(8b8a596da0726bc02c412a68e5163770fe3e62e4) ) // mpr12379.b4  [3/4]      IDENTICAL
2567   ROM_LOAD16_BYTE( "ic65.15",        0x120000, 0x10000, CRC(9fb1f9b6) SHA1(a193ff48f2bfbb4afbc322ae33cdf360afcb681e) ) // mpr12379.b4  [4/4]      IDENTICAL
2568    ROM_LOAD16_BYTE( "ic75.32",       0x040001, 0x10000, CRC(101d2fff) SHA1(1de1390c5f55f192491053c8aac31be3389aab2b) ) // mpr12380.b2  [1/4]      IDENTICAL
2569   ROM_LOAD16_BYTE( "ic76.31",       0x060001, 0x10000, CRC(677e64a6) SHA1(e3d0d31097017c6cb1a7f41292783f18ce13b41c) ) // mpr12380.b2  [2/4]      IDENTICAL
2570   ROM_LOAD16_BYTE( "ic81.26",       0x140001, 0x10000, CRC(a34e84d1) SHA1(5aa8836ef1bdf97e399899c911967840e9873bfb) ) // mpr12380.b2  [3/4]      99.992371%
2571   ROM_LOAD16_BYTE( "ic82.25",       0x160001, 0x10000, CRC(ad1c1c90) SHA1(155f17593cfab1a117bb755b1edd0c473d455f91) ) // mpr12380.b2  [4/4]      IDENTICAL
2572     ROM_LOAD16_BYTE( "ic60.20",       0x040000, 0x10000, CRC(5853000d) SHA1(db7adf1de74c66f667ea7ccc41702576de081ff5) ) // mpr12381.b5  [1/4]      IDENTICAL
2573   ROM_LOAD16_BYTE( "ic61.19",       0x060000, 0x10000, CRC(697b3276) SHA1(a8aeb2cfaca9368d5bfa14a67de36dbadd4a0585) ) // mpr12381.b5  [2/4]      IDENTICAL
2574   ROM_LOAD16_BYTE( "ic66.14",       0x140000, 0x10000, CRC(753b01e8) SHA1(0180cf893d63e60e14e2fb0f5836b302f08f0228) ) // mpr12381.b5  [3/4]      IDENTICAL
2575   ROM_LOAD16_BYTE( "ic67.13",       0x160000, 0x10000, CRC(5dd6d8db) SHA1(270886aebf4549c5cf456b1e90927b759a53e2e1) ) // mpr12381.b5  [4/4]      IDENTICAL
2576     ROM_LOAD16_BYTE( "ic77.30",       0x080001, 0x10000, CRC(a9519afe) SHA1(0550f596ef080db25241d88242d57edb3c7fb685) ) // mpr12382.b3  [1/4]      IDENTICAL
2577   ROM_LOAD16_BYTE( "ic78.29",       0x0a0001, 0x10000, CRC(74df9232) SHA1(61286c83eb6f31983c0ed24ca2151c58a95238f1) ) // mpr12382.b3  [2/4]      IDENTICAL
2578   ROM_LOAD16_BYTE( "ic83.24",       0x180001, 0x10000, CRC(a8c8c784) SHA1(8e998019b4dbf509179d41eb2b446647db3d00a6) ) // mpr12382.b3  [3/4]      IDENTICAL
2579   ROM_LOAD16_BYTE( "ic84.23",       0x1a0001, 0x10000, CRC(cc3a922c) SHA1(3c96459d95961d463909b6b0e8c77916c3a018e3) ) // mpr12382.b3  [4/4]      IDENTICAL
2580      ROM_LOAD16_BYTE( "ic62.18",       0x080000, 0x10000, CRC(ac6ad195) SHA1(3c3fe38047698e28cae9193438fe0b85941476c5) ) // mpr12383.b6  [1/4]      IDENTICAL
2581   ROM_LOAD16_BYTE( "ic63.17",       0x0a0000, 0x10000, CRC(03a905c4) SHA1(c526a744021a392c860ded37afd54a78e9f47778) ) // mpr12383.b6  [2/4]      IDENTICAL
2582   ROM_LOAD16_BYTE( "ic68.12",       0x180000, 0x10000, CRC(cba013c7) SHA1(a0658aaf7893bc9fb8f0435cab9f77ceb1fb4e1d) ) // mpr12383.b6  [3/4]      IDENTICAL
2583   ROM_LOAD16_BYTE( "ic69.11",       0x1a0000, 0x10000, CRC(bea4d237) SHA1(46e51e89b4ee1e2701da1004758d7da547a2e4c2) ) // mpr12383.b6  [4/4]      IDENTICAL
2584
2585   ROM_REGION( 0x20000, REGION_CPU2, 0 ) /* sound CPU + samples */
2586   ROM_LOAD( "ic45.10", 0x00000, 0x10000, CRC(804dfba8) SHA1(650ca61f78eb4d0aa256b554fb1570330166cc24) )
2587   ROM_LOAD( "ic46.9",  0x10000, 0x10000, CRC(634dd54e) SHA1(ac4ab0ad9c1ac634ff4dfb83232b0fa5cfb26fdd) )
2588ROM_END
2589
2590
25152591// pre16
25162592ROM_START( mjleague )
25172593   ROM_REGION( 0x030000, REGION_CPU1, 0 ) /* 68000 code */
r1037r1038
27442820GAME( 1989, fpointbl, fpoint,   fpointbl, fpoint,   fpointbl, ROT0,   "bootleg", "Flash Point (World, bootleg)", 0 )
27452821GAME( 1989, fpointbj, fpoint,   fpointbl, fpointbj, fpointbl, ROT0,   "bootleg", "Flash Point (Japan, bootleg)", 0 )
27462822
2747GAME( 1989, goldnabl, goldnaxe, goldnaxe, goldnaxe, goldnabl, ROT0,   "bootleg", "Golden Axe (bootleg)", GAME_NOT_WORKING )
2823GAME( 1989, goldnabl, goldnaxe, goldnaxe, goldnaxe, goldnabl, ROT0,   "bootleg", "Golden Axe (bootleg, encrypted)", GAME_NOT_WORKING )
2824GAME( 1989, goldnab2, goldnaxe, goldnaxe, goldnaxe, goldnabl, ROT0,   "bootleg", "Golden Axe (bootleg)", GAME_NOT_WORKING )
27482825
27492826GAME( 1988, passshtb, passsht,  passsht,  passsht,  passsht,  ROT270, "bootleg", "Passing Shot (2 Players) (bootleg)", GAME_IMPERFECT_SOUND )
27502827GAME( 1988, passht4b, passsht,  passht4b, passht4b, passht4b, ROT270, "bootleg", "Passing Shot (4 Players) (bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND | GAME_NOT_WORKING )
src/mame/drivers/viper.c
r1037r1038
4747
4848VIDEO_UPDATE(viper)
4949{
50   voodoo_update(0, bitmap, cliprect);
51   return 0;
50   return voodoo_update(0, bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED;
5251}
5352
5453
src/mame/drivers/mw8080bw.c
r1037r1038
27542754#define INVAD2CT_COIN_INPUT_PORT_TAG   ("COIN")
27552755
27562756
2757#ifdef UNUSED_FUNCTION
27572758static UINT32 invad2ct_coin_input_r(void *param)
27582759{
27592760   UINT32 ret = readinputportbytag(INVAD2CT_COIN_INPUT_PORT_TAG);
r1037r1038
27622763
27632764   return ret;
27642765}
2766#endif
27652767
27662768
27672769static ADDRESS_MAP_START( invad2ct_io_map, ADDRESS_SPACE_IO, 8 )
src/mame/drivers/gdrawpkr.c
r1037r1038
22
33
44    GAMING DRAW POKER (CEI)
5
65    Driver by Roberto Fresca.
7    Based on a preliminary work of Curt Coder.
86
97
108    --- Technical Notes ---
r1037r1038
5957
6058    Flyer: http://www.arcadeflyers.com/?page=thumbs&db=videodb&id=4542
6159
62    The code never write to offsets 0x840/0x841, so I assume that the AY8912 is connected to PIAs output.
60    The AY8912 is mapped to 0x840/0x841 but the game lacks of credits and bet sounds.
61    The rest of sounds are ok. Maybe the missing ones are generated by discrete circuitry.
62
6363    Inputs are multiplexed and selected through PIA1, portB.
64
6465    There aren't meter and stats modes. Only for amusement, so... no payout.
6566    To clear credits press F2.
6667    To enter to TEST MODE press F2 twice. Press "Hold 1" + "Hold 2" + "Hold 3" to exit.
r1037r1038
138139    $0841 - $0841   AY-8912 (W)     ; Write.
139140    $0880 - $0880   CRTC6845 (A)    ; MC6845 adressing.
140141    $0881 - $0881   CRTC6845 (R/W)  ; MC6845 Read/Write.
141    $08C4 - $08C7   PIA0            ; I/O Ports 0 & 1.
142    $08C8 - $08CB   PIA1            ; I/O Ports 2 & 3.
142    $08C4 - $08C7   PIA0            ; I/O Ports 0, 1, 2, 3.
143    $08C8 - $08CB   PIA1            ; I/O Port  4.
143144
144145    $1000 - $13FF   VideoRAM
145146    $1400 - $17FF   ColorRAM
146147
147    $D800 - $FFFF   ROM
148    $D800 - $FFFF   ROM             (gdrawpkr)
148149
150        -----
149151
152    $2000 - $3FFF   ROM             (elgrande)
153    $F800 - $FFFF   ROM             (elgrande)
150154
155
156
151157    *** MC6545 Initialization ***
152158
153159    ----------------------------------------------------------------------------------------------------------------------
r1037r1038
157163
158164
159165
160    *** MC6545 conditional change for elgrande if 0x8c4 (PIA) has bit7 activated ***
166    *** MC6545 conditional change for elgrande if 0x8c4 (PIA0) has bit7 activated ***
161167
162168    ---------------------------------------------------------
163169    register:  R00   R01   R02   R03   R04   R05   R06   R07
r1037r1038
169175***********************************************************************************
170176
171177
178    UPDATES
179    -------
180
181
182    [2007-09-15]
183
184    - Added sound support to "El Grande - 5 Card Draw".
185    - All crystals documented via #defines.
186    - All CPU and sound clocks derived from #defined crystal values.
187    - Splitted the driver to driver/video.
188    - Some minor input cleanups.
189    - Updated technical notes.
190
191
172192    [2007-08-13]
173193
174194    - Added "El Grande - 5 Card Draw" (new).
r1037r1038
206226
207227    TODO:
208228
209    - Add sound support to elgrande.
210229    - Fix lamps.
211    - Clean up the driver.
212230
213231
214232***********************************************************************************/
215233
216234
235#define MASTER_CLOCK   10000000
236
217237#include "driver.h"
218238#include "sound/ay8910.h"
219239#include "video/crtc6845.h"
220240#include "machine/6821pia.h"
221241
222static tilemap *bg_tilemap;
242/* from video */
243extern WRITE8_HANDLER( gdrawpkr_videoram_w );
244extern WRITE8_HANDLER( gdrawpkr_colorram_w );
245extern PALETTE_INIT( gdrawpkr );
246extern VIDEO_START( gdrawpkr );
247extern VIDEO_UPDATE( gdrawpkr );
223248
224249
225250/*************************
226*     Video Hardware     *
227*************************/
228
229WRITE8_HANDLER( gdrawpkr_videoram_w )
230{
231   videoram[offset] = data;
232   tilemap_mark_tile_dirty(bg_tilemap, offset);
233}
234
235WRITE8_HANDLER( gdrawpkr_colorram_w )
236{
237   colorram[offset] = data;
238   tilemap_mark_tile_dirty(bg_tilemap, offset);
239}
240
241static TILE_GET_INFO( get_bg_tile_info )
242{
243/*  - bits -
244    7654 3210
245    --xx xx--   tiles color.
246    ---- --x-   tiles bank.
247    xx-- ---x   seems unused. */
248
249   int attr = colorram[tile_index];
250   int code = videoram[tile_index];
251   int bank = (attr & 0x02) >> 1;   /* bit 1 switch the gfx banks */
252   int color = (attr & 0x3c);   /* bits 2-3-4-5 for color */
253
254   if (attr == 0x3a)   /* Is the palette wrong? */
255      color = 0x3b;   /* 0x3b is the best match */
256
257   SET_TILE_INFO(bank, code, color, 0);
258}
259
260VIDEO_START( gdrawpkr )
261{
262   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
263      TILEMAP_TYPE_PEN, 8, 8, 32, 31);
264}
265
266VIDEO_UPDATE( gdrawpkr )
267{
268   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
269   return 0;
270}
271
272PALETTE_INIT( gdrawpkr )
273{
274/*  prom bits
275    7654 3210
276    ---- ---x   red component.
277    ---- --x-   green component.
278    ---- -x--   blue component.
279    ---- x---   unknown, aparently unused.
280    xxxx ----   unused.
281*/
282   int i;
283
284   /* 00000BGR */
285   if (color_prom == 0) return;
286
287   for (i = 0;i < machine->drv->total_colors;i++)
288   {
289      int bit0, bit1, bit2, r, g, b;
290
291      /* red component */
292      bit0 = (color_prom[i] >> 0) & 0x01;
293      r = bit0 * 0xff;
294
295      /* green component */
296      bit1 = (color_prom[i] >> 1) & 0x01;
297      g = bit1 * 0xff;
298
299      /* blue component */
300      bit2 = (color_prom[i] >> 2) & 0x01;
301      b = bit2 * 0xff;
302
303
304      palette_set_color(machine, i, MAKE_RGB(r, g, b));
305   }
306}
307
308
309/*************************
310251* Memory map information *
311252*************************/
312253
r1037r1038
325266
326267static ADDRESS_MAP_START( elgrande_map, ADDRESS_SPACE_PROGRAM, 8 )
327268   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
269   AM_RANGE(0x0840, 0x0840) AM_WRITE(AY8910_control_port_0_w)
270   AM_RANGE(0x0841, 0x0841) AM_WRITE(AY8910_write_port_0_w)
328271   AM_RANGE(0x0880, 0x0880) AM_WRITE(crtc6845_address_w)
329272   AM_RANGE(0x0881, 0x0881) AM_READWRITE(crtc6845_register_r, crtc6845_register_w)
330273   AM_RANGE(0x08c4, 0x08c7) AM_READWRITE(pia_0_r, pia_0_w)
r1037r1038
346289   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Manual Collect") PORT_CODE(KEYCODE_7)
347290   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Double Up") PORT_CODE(KEYCODE_3)
348291   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Deal/Draw") PORT_CODE(KEYCODE_2)
349   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Cancel Discards") PORT_CODE(KEYCODE_N)
350   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Stand") PORT_CODE(KEYCODE_E)
292   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Cancel Discards") PORT_CODE(KEYCODE_N)
293   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON13 ) PORT_NAME("Stand") PORT_CODE(KEYCODE_E)
351294   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
352295   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
353296
r1037r1038
416359   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
417360   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Double Up") PORT_CODE(KEYCODE_3)
418361   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Deal/Draw") PORT_CODE(KEYCODE_2)
419   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Cancel Holds") PORT_CODE(KEYCODE_N)
362   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Cancel Holds") PORT_CODE(KEYCODE_N)
420363   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
421364   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
422365   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
r1037r1038
446389   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Bet") PORT_CODE(KEYCODE_1)
447390   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Take") PORT_CODE(KEYCODE_4)
448391   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Odd") PORT_CODE(KEYCODE_A)
449   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Even") PORT_CODE(KEYCODE_S)
392   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Even") PORT_CODE(KEYCODE_S)
450393   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
451394   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
452395   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
r1037r1038
621564
622565static MACHINE_DRIVER_START( gdrawpkr )
623566   // basic machine hardware
624   MDRV_CPU_ADD_TAG("main", M6502, 10000000/12)   /* guessing... */
567   MDRV_CPU_ADD_TAG("main", M6502, MASTER_CLOCK/12)   /* guessing... */
625568   MDRV_CPU_PROGRAM_MAP(gdrawpkr_map, 0)
626569   MDRV_CPU_VBLANK_INT(irq0_line_hold, 1)
627570
r1037r1038
646589
647590   // sound hardware
648591   MDRV_SPEAKER_STANDARD_MONO("mono")
649   MDRV_SOUND_ADD(AY8910, 10000000/12)   /* guessing again... */
592   MDRV_SOUND_ADD(AY8912, MASTER_CLOCK/12)      /* guessing again... */
650593   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
651594
652595MACHINE_DRIVER_END
r1037r1038
756699
757700/*    YEAR  NAME      PARENT  MACHINE   INPUT     INIT      ROT    COMPANY                                 FULLNAME                         FLAGS   */
758701GAME( 1981, gdrawpkr, 0,      gdrawpkr, gdrawpkr, gdrawpkr, ROT0, "Cal Omega / Casino Electronics Inc.",   "Gaming Draw Poker",             0 )
759GAME( 1982, elgrande, 0,      elgrande, elgrande, elgrande, ROT0, "Tuni Electro Service / E.T. Marketing", "El Grande - 5 Card Draw (New)", GAME_NO_SOUND )
702GAME( 1982, elgrande, 0,      elgrande, elgrande, elgrande, ROT0, "Tuni Electro Service / E.T. Marketing", "El Grande - 5 Card Draw (New)", 0 )
src/mame/drivers/galaxian.c
r1037r1038
619619ADDRESS_MAP_END
620620
621621
622
623READ8_HANDLER( scramb2_protection_r ) { return 0x25; }
624READ8_HANDLER( scramb2_port0_r ) { return (readinputport(0)>>offset)&0x1; }
625READ8_HANDLER( scramb2_port1_r ) { return (readinputport(1)>>offset)&0x1; }
626READ8_HANDLER( scramb2_port2_r ) { return (readinputport(2)>>offset)&0x1; }
627
628static ADDRESS_MAP_START( scramb2_readmem, ADDRESS_SPACE_PROGRAM, 8 )
629   AM_RANGE(0x0000, 0x3fff) AM_READ(MRA8_ROM)
630   AM_RANGE(0x4000, 0x4bff) AM_READ(MRA8_RAM)
631   AM_RANGE(0x5000, 0x50ff) AM_READ(MRA8_RAM)
632   AM_RANGE(0x5800, 0x5fff) AM_READ(scramb2_protection_r) // must return 0x25
633   AM_RANGE(0x6000, 0x6007) AM_READ(scramb2_port0_r) // reads from 8 addresses, 1 bit per address
634   AM_RANGE(0x6800, 0x6807) AM_READ(scramb2_port1_r) // reads from 8 addresses, 1 bit per address
635   AM_RANGE(0x7000, 0x7007) AM_READ(watchdog_reset_r)
636   AM_RANGE(0x7800, 0x7807) AM_READ(scramb2_port2_r) // reads from 8 addresses, 1 bit per address
637ADDRESS_MAP_END
638
639static ADDRESS_MAP_START( scramb2_writemem, ADDRESS_SPACE_PROGRAM, 8 )
640   AM_RANGE(0x0000, 0x3fff) AM_WRITE(MWA8_ROM)
641   AM_RANGE(0x4000, 0x47ff) AM_WRITE(MWA8_RAM)
642   AM_RANGE(0x4800, 0x4bff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
643   AM_RANGE(0x4c00, 0x4fff) AM_WRITE(galaxian_videoram_w) // mirror
644   AM_RANGE(0x5000, 0x503f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
645   AM_RANGE(0x5040, 0x505f) AM_WRITE(MWA8_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
646   AM_RANGE(0x5060, 0x507f) AM_WRITE(MWA8_RAM) AM_BASE(&galaxian_bulletsram) AM_SIZE(&galaxian_bulletsram_size)
647   AM_RANGE(0x5080, 0x50ff) AM_WRITE(MWA8_RAM)
648   AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxian_nmi_enable_w)
649   AM_RANGE(0x6802, 0x6802) AM_WRITE(galaxian_coin_counter_w)
650   AM_RANGE(0x6804, 0x6804) AM_WRITE(galaxian_stars_enable_w)
651   AM_RANGE(0x6806, 0x6806) AM_WRITE(galaxian_flip_screen_x_w)
652   AM_RANGE(0x6807, 0x6807) AM_WRITE(galaxian_flip_screen_y_w)
653   AM_RANGE(0x7006, 0x7006) AM_WRITE(MWA8_NOP)
654   AM_RANGE(0x7007, 0x7007) AM_WRITE(MWA8_NOP)
655   AM_RANGE(0x7800, 0x7800) AM_WRITE(galaxian_pitch_w)
656ADDRESS_MAP_END
657
658
659
622660static ADDRESS_MAP_START( jumpbug_readmem, ADDRESS_SPACE_PROGRAM, 8 )
623661   AM_RANGE(0x0000, 0x3fff) AM_READ(MRA8_ROM)
624662   AM_RANGE(0x4000, 0x4bff) AM_READ(MRA8_RAM)
r1037r1038
19581996   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
19591997INPUT_PORTS_END
19601998
1999
2000/* the cocktail controls only seem to be used in upright mode, is the flip flag wrong for this bootleg? */
2001INPUT_PORTS_START( scramb2 )
2002   PORT_START_TAG("IN0")
2003   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
2004   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
2005    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
2006   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
2007   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
2008   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
2009    PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
2010    PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
2011    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2012    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
2013
2014   PORT_START_TAG("IN1")
2015   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
2016   PORT_DIPSETTING(    0x00, "3" )
2017   PORT_DIPSETTING(    0x01, "4" )
2018   PORT_DIPSETTING(    0x02, "5" )
2019   PORT_DIPSETTING(    0x03, "255 (Cheat)")
2020   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
2021   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
2022   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
2023   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
2024   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
2025   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
2026
2027   PORT_START_TAG("IN2")
2028   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
2029   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
2030   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
2031   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
2032   PORT_DIPSETTING(    0x04, DEF_STR( 1C_3C ) )
2033   PORT_DIPSETTING(    0x06, DEF_STR( 1C_4C ) )
2034   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
2035   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
2036   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
2037   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
2038    PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
2039    PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
2040    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2041   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
2042    PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
2043    PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
2044    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
2045INPUT_PORTS_END
2046
2047
19612048INPUT_PORTS_START( jumpbug )
19622049   PORT_START_TAG("IN0")
19632050   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
r1037r1038
39334020   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
39344021   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
39354022   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
3936   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
4023   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
39374024   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
3938   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
4025   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
39394026
39404027   PORT_START_TAG("IN1")
39414028   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) // button 1 and start 1
r1037r1038
43634450   MDRV_VIDEO_START(scramble)
43644451MACHINE_DRIVER_END
43654452
4453static MACHINE_DRIVER_START( scramb2 )
43664454
4455   /* basic machine hardware */
4456   MDRV_IMPORT_FROM(galaxian)
4457   MDRV_CPU_MODIFY("main")
4458   MDRV_CPU_PROGRAM_MAP(scramb2_readmem,scramb2_writemem)
4459
4460   /* video hardware */
4461   MDRV_PALETTE_LENGTH(32+2+64+1)   /* 32 for the characters, 2 for the bullets, 64 for the stars, 1 for background */
4462
4463   MDRV_PALETTE_INIT(scramble)
4464   MDRV_VIDEO_START(scramble)
4465MACHINE_DRIVER_END
4466
4467
4468
43674469static MACHINE_DRIVER_START( zigzag )
43684470
43694471   /* basic machine hardware */
r1037r1038
55095611   ROM_LOAD( "82s123.6e",    0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
55105612ROM_END
55115613
5614
5615ROM_START( scramb2 )
5616   ROM_REGION( 0x10000, REGION_CPU1, 0 )
5617   ROM_LOAD( "r1.7f1",  0x0000, 0x0800, CRC(4a43148c) SHA1(ea27fd3acf661101296a58a7a50fb8e4d5292760) )
5618   ROM_LOAD( "r1.7f2",  0x0800, 0x0800, CRC(215a3b86) SHA1(bfddfea9f74064123629d89556240c7a59f7bea2) )
5619   ROM_LOAD( "r2.7h1",  0x1000, 0x0800, CRC(28779444) SHA1(0abd3a89c8cdd5af2ac06afd38bcd2dcd6010bee) )
5620   ROM_LOAD( "r2.7h2",  0x1800, 0x0800, CRC(5b4b300b) SHA1(6d69dbdab66bc8f4a16c3d9d3b4581799e4bbfab) )
5621   ROM_LOAD( "r3.7k1",  0x2000, 0x0800, CRC(b478aa53) SHA1(68cf134482092534ef0a3ceee3aa842f86660065) )
5622   ROM_LOAD( "r3.7k2",  0x2800, 0x0800, CRC(c33f072e) SHA1(28d61e35f3d5c971e070d7e0cc20b831fe8d52c5) )
5623   ROM_LOAD( "r4.7l1",  0x3000, 0x0800, CRC(88ac07a0) SHA1(c57061db5984b472039356bf84a050b5b66e3813) )
5624   ROM_LOAD( "r4.7l2",  0x3800, 0x0800, CRC(321fd003) SHA1(61f33c2709913da4cb20f311501df707d755917e) )
5625   /* Also exists in the following Rom config */
5626//  ROM_LOAD( "r1.7f",  0x0000, 0x1000, CRC(75208a74) SHA1(e77afe4b906d08d6763f31dd70d7cb772be97102) )
5627//  ROM_LOAD( "r2.7h",  0x1000, 0x1000, CRC(f2179cf5) SHA1(5c38aa9bd1d5ebdccf16d2e50acc56f0b3f042d0) )
5628//  ROM_LOAD( "r3.7k",  0x2000, 0x1000, CRC(941c804e) SHA1(f1eedf719a234cf98071e6a46120765e231f0730) )
5629//  ROM_LOAD( "r4.7l",  0x3000, 0x1000, CRC(f1506edc) SHA1(66689bb3d7570848e4d020a5f44d6de03b4bff99) )
5630
5631   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
5632   ROM_LOAD( "r6.1j",         0x0000, 0x0800, CRC(4708845b) SHA1(a8b1ad19a95a9d35050a2ab7194cc96fc5afcdc9) )
5633   ROM_LOAD( "r5.1l",         0x0800, 0x0800, CRC(11fd2887) SHA1(69844e48bb4d372cac7ae83c953df573c7ecbb7f) )
5634
5635   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5636   ROM_LOAD( "82s123.6e",    0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
5637ROM_END
5638
5639
55125640ROM_START( jumpbug )
55135641   ROM_REGION( 0x10000, REGION_CPU1, 0 )
55145642   ROM_LOAD( "jb1",          0x0000, 0x1000, CRC(415aa1b7) SHA1(4f9edd7e9720acf085dd8910849c2f2fac5cb547) )
r1037r1038
68877015GAME( 1982, zigzag,   0,        zigzag,   zigzag,   zigzag,   ROT90,  "LAX", "Zig Zag (Galaxian hardware, set 1)", GAME_SUPPORTS_SAVE )
68887016GAME( 1982, zigzag2,  zigzag,   zigzag,   zigzag,   zigzag,   ROT90,  "LAX", "Zig Zag (Galaxian hardware, set 2)", GAME_SUPPORTS_SAVE )
68897017GAME( 1981, scramblb, scramble, scramblb, scramblb, 0,        ROT90,  "bootleg", "Scramble (Galaxian hardware)", GAME_SUPPORTS_SAVE )
7018GAME( 1981, scramb2,  scramble, scramb2,  scramb2,  0,        ROT90,  "bootleg", "Scramble (bootleg)", GAME_SUPPORTS_SAVE )
68907019GAME( 1981, jumpbug,  0,        jumpbug,  jumpbug,  0,        ROT90,  "Rock-ola", "Jump Bug", GAME_SUPPORTS_SAVE )
68917020GAME( 1981, jumpbugb, jumpbug,  jumpbug,  jumpbug,  0,        ROT90,  "bootleg", "Jump Bug (bootleg)", GAME_SUPPORTS_SAVE )
68927021GAME( 1983, levers,   0,        jumpbug,  levers,   0,        ROT90,  "Rock-ola", "Levers", GAME_SUPPORTS_SAVE )
r1037r1038
69497078GAME( 19??, chewing,  0,        galaxian, luctoday, 0,        ROT90,  "unknown", "Chewing Gum", GAME_SUPPORTS_SAVE )
69507079GAME( 1982, catacomb, 0,        galaxian, catacomb, 0,        ROT90,  "MTM Games", "Catacomb", GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
69517080GAME( 1981, ckongg,   0,        ckongg,   ckongg,   0,        ROT90,  "bootleg", "Crazy Kong (bootleg on Galaxian hardware, set 1)", GAME_SUPPORTS_SAVE )
6952GAME( 1981, kkgalax,  ckongg,   kkgalax,  kkgalax,  0,        ROT90,  "bootleg", "Crazy Kong (bootleg on Galaxian hardware, set 2)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
7081GAME( 1981, kkgalax,  ckongg,   kkgalax,  kkgalax,  0,        ROT90,  "bootleg", "Crazy Kong (bootleg on Galaxian hardware, set 2)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) // set was marked as 'King Kong on Galaxian'
69537082GAME( 19??, porter,   0,        mooncrst, porter,   0,        ROT90,  "[Nova Games Ltd.] (bootleg)", "Port Man (bootleg on Moon Cresta hardware)", GAME_IMPERFECT_GRAPHICS ) // missing GFX bank switch!
src/mame/drivers/sfkick.c
r1037r1038
2929   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)
3030ADDRESS_MAP_END
3131
32#ifdef UNUSED_FUNCTION
3233static ADDRESS_MAP_START( readmem2, ADDRESS_SPACE_PROGRAM, 8 )
3334   AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM)
3435ADDRESS_MAP_END
r1037r1038
3637static ADDRESS_MAP_START( writemem2, ADDRESS_SPACE_PROGRAM, 8 )
3738   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)
3839ADDRESS_MAP_END
40#endif
3941
4042INPUT_PORTS_START( sfkick )
4143    PORT_START
src/mame/drivers/model2.c
r1037r1038
170170
171171   if (copro_fifoout_num == 0)
172172   {
173      // Reading from empty FIFO causes the i960 to enter wait state
173      /* Reading from empty FIFO causes the i960 to enter wait state */
174174      i960_stall();
175
176      /* spin the main cpu and let the TGP catch up */
177      cpu_spinuntil_time(MAME_TIME_IN_USEC(100));
178
175179      return 0;
176180   }
177181
r1037r1038
739743      return geo_read_start_address;
740744   }
741745
742   fatalerror("geo_r: %08X, %08X\n", address, mem_mask);
746//  fatalerror("geo_r: %08X, %08X\n", address, mem_mask);
747   mame_printf_debug("geo_r: PC:%08x - %08X\n", safe_activecpu_get_pc(), address);
748
749   return 0;
743750}
744751
745752static WRITE32_HANDLER( geo_w )
r1037r1038
11491156   }
11501157}
11511158
1159#ifdef UNUSED_FUNCTION
11521160static WRITE32_HANDLER( copro_w )
11531161{
11541162   int address = offset * 4;
r1037r1038
11661174
11671175   //mame_printf_debug("COPRO: %08X = %08X\n", offset, data);
11681176}
1177#endif
11691178
11701179static WRITE32_HANDLER(mode_w)
11711180{
11721181   mame_printf_debug("Mode = %08X\n", data);
11731182}
11741183
1184static WRITE32_HANDLER(model2o_tex_w0)
1185{
1186   if ( (offset & 1) == 0 )
1187   {
1188      model2_textureram0[offset>>1] &= 0xffff0000;
1189      model2_textureram0[offset>>1] |= data & 0xffff;
1190   }
1191   else
1192   {
1193      model2_textureram0[offset>>1] &= 0x0000ffff;
1194      model2_textureram0[offset>>1] |= (data & 0xffff) << 16;
1195   }
1196}
1197
1198static WRITE32_HANDLER(model2o_tex_w1)
1199{
1200   if ( (offset & 1) == 0 )
1201   {
1202      model2_textureram1[offset>>1] &= 0xffff0000;
1203      model2_textureram1[offset>>1] |= data & 0xffff;
1204   }
1205   else
1206   {
1207      model2_textureram1[offset>>1] &= 0x0000ffff;
1208      model2_textureram1[offset>>1] |= (data & 0xffff) << 16;
1209   }
1210}
1211
1212static WRITE32_HANDLER(model2o_luma_w)
1213{
1214   if ( (offset & 1) == 0 )
1215   {
1216      model2_lumaram[offset>>1] &= 0xffff0000;
1217      model2_lumaram[offset>>1] |= data & 0xffff;
1218   }
1219   else
1220   {
1221      model2_lumaram[offset>>1] &= 0x0000ffff;
1222      model2_lumaram[offset>>1] |= (data & 0xffff) << 16;
1223   }
1224}
1225
11751226/* common map for all Model 2 versions */
11761227static ADDRESS_MAP_START( model2_base_mem, ADDRESS_SPACE_PROGRAM, 32 )
11771228   AM_RANGE(0x00000000, 0x001fffff) AM_ROM AM_WRITENOP
r1037r1038
12151266
12161267   AM_RANGE(0x10000000, 0x101fffff) AM_WRITE(mode_w)
12171268
1218   AM_RANGE(0x11000000, 0x111fffff) AM_RAM   AM_BASE(&model2_textureram0)   // texture RAM 0 (2b/2c)
1219   AM_RANGE(0x11200000, 0x113fffff) AM_RAM   AM_BASE(&model2_textureram1)   // texture RAM 1 (2b/2c)
1220   AM_RANGE(0x11400000, 0x1140ffff) AM_RAM   AM_BASE(&model2_lumaram)      // polygon "luma" RAM (2b/2c)
1221
12221269   AM_RANGE(0x11600000, 0x1167ffff) AM_RAM   AM_SHARE(1) // framebuffer (last bronx)
12231270   AM_RANGE(0x11680000, 0x116fffff) AM_RAM   AM_SHARE(1) // FB mirror
1224
1225   AM_RANGE(0x12000000, 0x12ffffff) AM_WRITENOP   // texture RAM for model 2/2a?
12261271ADDRESS_MAP_END
12271272
12281273/* original Model 2 overrides */
r1037r1038
12401285   AM_RANGE(0x00980008, 0x0098000b) AM_WRITE( geo_ctl1_w )
12411286   AM_RANGE(0x009c0000, 0x009cffff) AM_READWRITE( model2_serial_r, model2o_serial_w )
12421287
1288   AM_RANGE(0x12000000, 0x121fffff) AM_READWRITE(MRA32_RAM, model2o_tex_w0) AM_MIRROR(0x200000) AM_BASE(&model2_textureram0)   // texture RAM 0
1289   AM_RANGE(0x12400000, 0x125fffff) AM_READWRITE(MRA32_RAM, model2o_tex_w1) AM_MIRROR(0x200000) AM_BASE(&model2_textureram1)   // texture RAM 1
1290   AM_RANGE(0x12800000, 0x1281ffff) AM_READWRITE(MRA32_RAM, model2o_luma_w) AM_BASE(&model2_lumaram) // polygon "luma" RAM
1291
12431292   AM_RANGE(0x01c00000, 0x01c00007) AM_READ(analog_r)
12441293   AM_RANGE(0x01c00010, 0x01c00013) AM_READ(ctrl10_r)
12451294   AM_RANGE(0x01c00014, 0x01c00017) AM_READ(ctrl14_r)
r1037r1038
12631312   AM_RANGE(0x00980008, 0x0098000b) AM_WRITE( geo_ctl1_w )
12641313   AM_RANGE(0x009c0000, 0x009cffff) AM_READWRITE( model2_serial_r, model2_serial_w )
12651314
1315   AM_RANGE(0x12000000, 0x121fffff) AM_READWRITE(MRA32_RAM, model2o_tex_w0) AM_MIRROR(0x200000) AM_BASE(&model2_textureram0)   // texture RAM 0
1316   AM_RANGE(0x12400000, 0x125fffff) AM_READWRITE(MRA32_RAM, model2o_tex_w1) AM_MIRROR(0x200000) AM_BASE(&model2_textureram1)   // texture RAM 1
1317   AM_RANGE(0x12800000, 0x1281ffff) AM_READWRITE(MRA32_RAM, model2o_luma_w) AM_BASE(&model2_lumaram) // polygon "luma" RAM
1318
12661319   AM_RANGE(0x01c00000, 0x01c00003) AM_READWRITE(ctrl0_r, ctrl0_w)
12671320   AM_RANGE(0x01c00004, 0x01c00007) AM_READ(ctrl1_r)
12681321   AM_RANGE(0x01c00010, 0x01c00013) AM_READ(ctrl10_r)
r1037r1038
12921345
12931346   AM_RANGE(0x009c0000, 0x009cffff) AM_READWRITE( model2_serial_r, model2_serial_w )
12941347
1348   AM_RANGE(0x11000000, 0x111fffff) AM_RAM   AM_BASE(&model2_textureram0)   // texture RAM 0 (2b/2c)
1349   AM_RANGE(0x11200000, 0x113fffff) AM_RAM   AM_BASE(&model2_textureram1)   // texture RAM 1 (2b/2c)
1350   AM_RANGE(0x11400000, 0x1140ffff) AM_RAM   AM_BASE(&model2_lumaram)      // polygon "luma" RAM (2b/2c)
1351
1352
12951353   AM_RANGE(0x01c00000, 0x01c00003) AM_READWRITE(ctrl0_r, ctrl0_w)
12961354   AM_RANGE(0x01c00004, 0x01c00007) AM_READ(ctrl1_r)
12971355   AM_RANGE(0x01c00010, 0x01c00013) AM_READ(ctrl10_r)
r1037r1038
13121370   AM_RANGE(0x00980008, 0x0098000b) AM_WRITE( geo_ctl1_w )
13131371   AM_RANGE(0x009c0000, 0x009cffff) AM_READWRITE( model2_serial_r, model2_serial_w )
13141372
1373   AM_RANGE(0x11000000, 0x111fffff) AM_RAM   AM_BASE(&model2_textureram0)   // texture RAM 0 (2b/2c)
1374   AM_RANGE(0x11200000, 0x113fffff) AM_RAM   AM_BASE(&model2_textureram1)   // texture RAM 1 (2b/2c)
1375   AM_RANGE(0x11400000, 0x1140ffff) AM_RAM   AM_BASE(&model2_lumaram)      // polygon "luma" RAM (2b/2c)
1376
13151377   AM_RANGE(0x01c00000, 0x01c00003) AM_READWRITE(ctrl0_r, ctrl0_w)
13161378   AM_RANGE(0x01c00004, 0x01c00007) AM_READ(ctrl1_r)
13171379   AM_RANGE(0x01c00010, 0x01c00013) AM_READ(ctrl10_r)
r1037r1038
16771739#endif
16781740
16791741/*****************************************************************************/
1680// TGP memory maps
1742/* TGP memory maps */
16811743
1744static READ32_HANDLER(copro_tgp_buffer_r)
1745{
1746   return model2_bufferram[offset & 0x7fff];
1747}
1748
1749static WRITE32_HANDLER(copro_tgp_buffer_w)
1750{
1751   model2_bufferram[offset&0x7fff] = data;
1752}
1753
16821754static ADDRESS_MAP_START( copro_tgp_map, ADDRESS_SPACE_PROGRAM, 32 )
16831755   AM_RANGE(0x00000000, 0x00007fff) AM_RAM AM_BASE(&tgp_program)
1756   AM_RANGE(0x00400000, 0x00407fff) AM_READWRITE(copro_tgp_buffer_r, copro_tgp_buffer_w)
16841757   AM_RANGE(0xff800000, 0xff9fffff) AM_ROM AM_REGION(REGION_CPU3, 0)
16851758ADDRESS_MAP_END
16861759
r1037r1038
17141787   MDRV_NVRAM_HANDLER( model2 )
17151788
17161789   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_AFTER_VBLANK )
1717   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
1790   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
17181791   MDRV_SCREEN_SIZE(62*8, 48*8)
17191792   MDRV_SCREEN_VISIBLE_AREA(0*8, 62*8-1, 0*8, 48*8-1)
17201793   MDRV_PALETTE_LENGTH(8192)
r1037r1038
17591832   MDRV_NVRAM_HANDLER( model2 )
17601833
17611834   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_AFTER_VBLANK )
1762   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
1835   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
17631836   MDRV_SCREEN_SIZE(62*8, 48*8)
17641837   MDRV_SCREEN_VISIBLE_AREA(0*8, 62*8-1, 0*8, 48*8-1)
17651838   MDRV_PALETTE_LENGTH(8192)
r1037r1038
18071880   MDRV_NVRAM_HANDLER( model2 )
18081881
18091882   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_AFTER_VBLANK )
1810   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
1883   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
18111884   MDRV_SCREEN_SIZE(62*8, 48*8)
18121885   MDRV_SCREEN_VISIBLE_AREA(0*8, 62*8-1, 0*8, 48*8-1)
18131886   MDRV_PALETTE_LENGTH(8192)
r1037r1038
18391912   MDRV_NVRAM_HANDLER( model2 )
18401913
18411914   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_AFTER_VBLANK )
1842   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
1915   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
18431916   MDRV_SCREEN_SIZE(62*8, 48*8)
18441917   MDRV_SCREEN_VISIBLE_AREA(0*8, 62*8-1, 0*8, 48*8-1)
18451918
r1037r1038
21732246
21742247   ROM_REGION( 0x2000000, REGION_USER2, 0 ) // Models
21752248   ROM_LOAD32_WORD( "mpr-17748.bin", 0x000000, 0x200000, CRC(3148a2b2) SHA1(283cc49bfb6c6381a7ead9273fd097dca5b981b6) )
2176   ROM_LOAD32_WORD( "mpr-17749.bin", 0x000002, 0x200000, CRC(0838d184) SHA1(704175c8b29e4c989afcb7be42e7e0e096740eaf) )
2177   ROM_LOAD32_WORD( "mpr-17750.bin", 0x400000, 0x200000, CRC(232aec29) SHA1(4d470e71df61298282c356814e2d151fda323fb6) )
2249   ROM_LOAD32_WORD( "mpr-17750.bin", 0x000002, 0x200000, CRC(232aec29) SHA1(4d470e71df61298282c356814e2d151fda323fb6) )
2250   ROM_LOAD32_WORD( "mpr-17749.bin", 0x400000, 0x200000, CRC(0838d184) SHA1(704175c8b29e4c989afcb7be42e7e0e096740eaf) )
21782251   ROM_LOAD32_WORD( "mpr-17751.bin", 0x400002, 0x200000, CRC(ed87ac62) SHA1(601542149d33ca52a47536b4b0af47bf1fd87eb2) )
21792252
21802253   ROM_REGION( 0x1000000, REGION_USER3, 0 ) // Textures
2181   ROM_LOAD32_WORD( "mpr-17752.bin", 0x000000, 0x200000, CRC(d6aa86ce) SHA1(1d342f87d1af1e5438d1ae818b1b14268e765897) )
2182   ROM_LOAD32_WORD( "mpr-17753.bin", 0x000002, 0x200000, CRC(6db0eb36) SHA1(dd5fd3c9592360d3e95623ac2491e6faabe9dbcb) )
2254   ROM_LOAD32_WORD( "mpr-17753.bin", 0x000000, 0x200000, CRC(6db0eb36) SHA1(dd5fd3c9592360d3e95623ac2491e6faabe9dbcb) )
2255   ROM_LOAD32_WORD( "mpr-17752.bin", 0x000002, 0x200000, CRC(d6aa86ce) SHA1(1d342f87d1af1e5438d1ae818b1b14268e765897) )
21832256
2257
21842258   ROM_REGION( 0x20000, REGION_CPU5, 0) // Communication program
21852259   ROM_LOAD( "epr-16726.bin", 0x000000, 0x020000, CRC(c179b8c7) SHA1(86d3e65c77fb53b1d380b629348f4ab5b3d39228) )
21862260
r1037r1038
35003574   ROM_LOAD32_WORD("mpr-16537.ic28", 0x000000, 0x200000, CRC(36b7c35a) SHA1(b32fd1d3fc8983fb5f2a7b236b665a8c9b52769f) )
35013575   ROM_LOAD32_WORD("mpr-16536.ic29", 0x000002, 0x200000, CRC(6d6afed9) SHA1(2018468d7d849854b3d0cfbcd217317e2fc93555) )
35023576
3503   ROM_REGION( 0x1000000, REGION_USER2, 0 ) // Models
3577   ROM_REGION32_LE( 0x1000000, REGION_USER2, 0 ) // Models
35043578   ROM_LOAD32_WORD("mpr-16523.ic16", 0x000000, 0x200000, CRC(2f484d42) SHA1(0b83a3fc92b7d913a14cfb01d688c63555c17c41) )
35053579   ROM_LOAD32_WORD("mpr-16518.ic20", 0x000002, 0x200000, CRC(df683bf7) SHA1(16afe5029591f3536b5b75d9cf50a34d0ea72c3d) )
35063580   ROM_LOAD32_WORD("mpr-16524.ic17", 0x400000, 0x200000, CRC(34658bd7) SHA1(71b47626ffe5b26d1140afe1b830a9a2be86c88f) )
r1037r1038
35103584   ROM_LOAD32_WORD("mpr-16772.ic19", 0xc00000, 0x200000, CRC(770ed912) SHA1(1789f35dd403f73f8be18495a0fe4ad1e6841417) )
35113585   ROM_LOAD32_WORD("mpr-16771.ic23", 0xc00002, 0x200000, CRC(a2205124) SHA1(257a3675e4ef6adbf61285a5daa5954223c28cb2) )
35123586
3513   ROM_REGION( 0x1000000, REGION_USER3, 0 ) // Textures
3514   ROM_LOAD32_WORD("mpr-16521.24", 0x000000, 0x200000, CRC(af1934fb) SHA1(a6a21a23cd34d0de6d3e6a5c3c2687f905d0dc2a) )
3515   ROM_LOAD32_WORD("mpr-16522.25", 0x000002, 0x200000, CRC(55d39a57) SHA1(abf7b0fc0f111f90da42463d600db9fa32e95efe) )
3516   ROM_LOAD32_WORD("mpr-16769.26", 0x400000, 0x200000, CRC(e57429e9) SHA1(8c712ab09e61ef510741a55f29b3c4e497471372) )
3517   ROM_LOAD32_WORD("mpr-16770.27", 0x400002, 0x200000, CRC(f9fa7bfb) SHA1(8aa933b74d4e05dc49987238705e50b00e5dae73) )
3587   ROM_REGION16_LE( 0x1000000, REGION_USER3, 0 ) // Textures
3588   ROM_LOAD32_WORD("mpr-16522.25", 0x000000, 0x200000, CRC(55d39a57) SHA1(abf7b0fc0f111f90da42463d600db9fa32e95efe) )
3589   ROM_LOAD32_WORD("mpr-16521.24", 0x000002, 0x200000, CRC(af1934fb) SHA1(a6a21a23cd34d0de6d3e6a5c3c2687f905d0dc2a) )
3590   ROM_LOAD32_WORD("mpr-16770.27", 0x800000, 0x200000, CRC(f9fa7bfb) SHA1(8aa933b74d4e05dc49987238705e50b00e5dae73) )
3591   ROM_LOAD32_WORD("mpr-16769.26", 0x800002, 0x200000, CRC(e57429e9) SHA1(8c712ab09e61ef510741a55f29b3c4e497471372) )
35183592
35193593   ROM_REGION( 0x20000, REGION_CPU4, 0) // Communication program
35203594   ROM_LOAD( "epr-16726.bin", 0x000000, 0x020000, CRC(c179b8c7) SHA1(86d3e65c77fb53b1d380b629348f4ab5b3d39228) )
r1037r1038
35743648   ROM_LOAD32_WORD("mpr-16771.ic23", 0xc00002, 0x200000, CRC(a2205124) SHA1(257a3675e4ef6adbf61285a5daa5954223c28cb2) )
35753649
35763650   ROM_REGION( 0x1000000, REGION_USER3, 0 ) // Textures
3577   ROM_LOAD32_WORD("mpr-16521.24", 0x000000, 0x200000, CRC(af1934fb) SHA1(a6a21a23cd34d0de6d3e6a5c3c2687f905d0dc2a) )
3578   ROM_LOAD32_WORD("mpr-16522.25", 0x000002, 0x200000, CRC(55d39a57) SHA1(abf7b0fc0f111f90da42463d600db9fa32e95efe) )
3579   ROM_LOAD32_WORD("mpr-16769.26", 0x400000, 0x200000, CRC(e57429e9) SHA1(8c712ab09e61ef510741a55f29b3c4e497471372) )
3580   ROM_LOAD32_WORD("mpr-16770.27", 0x400002, 0x200000, CRC(f9fa7bfb) SHA1(8aa933b74d4e05dc49987238705e50b00e5dae73) )
3651   ROM_LOAD32_WORD("mpr-16522.25", 0x000000, 0x200000, CRC(55d39a57) SHA1(abf7b0fc0f111f90da42463d600db9fa32e95efe) )
3652   ROM_LOAD32_WORD("mpr-16521.24", 0x000002, 0x200000, CRC(af1934fb) SHA1(a6a21a23cd34d0de6d3e6a5c3c2687f905d0dc2a) )
3653   ROM_LOAD32_WORD("mpr-16770.27", 0x800000, 0x200000, CRC(f9fa7bfb) SHA1(8aa933b74d4e05dc49987238705e50b00e5dae73) )
3654   ROM_LOAD32_WORD("mpr-16769.26", 0x800002, 0x200000, CRC(e57429e9) SHA1(8c712ab09e61ef510741a55f29b3c4e497471372) )
35813655
35823656   ROM_REGION( 0x20000, REGION_CPU4, 0) // Communication program
35833657   ROM_LOAD( "epr-16726.bin", 0x000000, 0x020000, CRC(c179b8c7) SHA1(86d3e65c77fb53b1d380b629348f4ab5b3d39228) )
r1037r1038
36353709   ROM_LOAD32_WORD("mpr-16771.ic23", 0xc00002, 0x200000, CRC(a2205124) SHA1(257a3675e4ef6adbf61285a5daa5954223c28cb2) )
36363710
36373711   ROM_REGION( 0x1000000, REGION_USER3, 0 ) // Textures
3638   ROM_LOAD32_WORD("mpr-16521.24", 0x000000, 0x200000, CRC(af1934fb) SHA1(a6a21a23cd34d0de6d3e6a5c3c2687f905d0dc2a) )
3639   ROM_LOAD32_WORD("mpr-16522.25", 0x000002, 0x200000, CRC(55d39a57) SHA1(abf7b0fc0f111f90da42463d600db9fa32e95efe) )
3640   ROM_LOAD32_WORD("mpr-16769.26", 0x400000, 0x200000, CRC(e57429e9) SHA1(8c712ab09e61ef510741a55f29b3c4e497471372) )
3641   ROM_LOAD32_WORD("mpr-16770.27", 0x400002, 0x200000, CRC(f9fa7bfb) SHA1(8aa933b74d4e05dc49987238705e50b00e5dae73) )
3712   ROM_LOAD32_WORD("mpr-16522.25", 0x000000, 0x200000, CRC(55d39a57) SHA1(abf7b0fc0f111f90da42463d600db9fa32e95efe) )
3713   ROM_LOAD32_WORD("mpr-16521.24", 0x000002, 0x200000, CRC(af1934fb) SHA1(a6a21a23cd34d0de6d3e6a5c3c2687f905d0dc2a) )
3714   ROM_LOAD32_WORD("mpr-16770.27", 0x800000, 0x200000, CRC(f9fa7bfb) SHA1(8aa933b74d4e05dc49987238705e50b00e5dae73) )
3715   ROM_LOAD32_WORD("mpr-16769.26", 0x800002, 0x200000, CRC(e57429e9) SHA1(8c712ab09e61ef510741a55f29b3c4e497471372) )
36423716
36433717   ROM_REGION( 0x20000, REGION_CPU4, 0) // Communication program
36443718   ROM_LOAD( "epr-16726.bin", 0x000000, 0x020000, CRC(c179b8c7) SHA1(86d3e65c77fb53b1d380b629348f4ab5b3d39228) )
r1037r1038
36973771   ROM_LOAD32_WORD("mpr-16771.ic23", 0xc00002, 0x200000, CRC(a2205124) SHA1(257a3675e4ef6adbf61285a5daa5954223c28cb2) )
36983772
36993773   ROM_REGION( 0x1000000, REGION_USER3, 0 ) // Textures
3700   ROM_LOAD32_WORD("mpr-16521.24", 0x000000, 0x200000, CRC(af1934fb) SHA1(a6a21a23cd34d0de6d3e6a5c3c2687f905d0dc2a) )
3701   ROM_LOAD32_WORD("mpr-16522.25", 0x000002, 0x200000, CRC(55d39a57) SHA1(abf7b0fc0f111f90da42463d600db9fa32e95efe) )
3702   ROM_LOAD32_WORD("mpr-16769.26", 0x400000, 0x200000, CRC(e57429e9) SHA1(8c712ab09e61ef510741a55f29b3c4e497471372) )
3703   ROM_LOAD32_WORD("mpr-16770.27", 0x400002, 0x200000, CRC(f9fa7bfb) SHA1(8aa933b74d4e05dc49987238705e50b00e5dae73) )
3774   ROM_LOAD32_WORD("mpr-16522.25", 0x000000, 0x200000, CRC(55d39a57) SHA1(abf7b0fc0f111f90da42463d600db9fa32e95efe) )
3775   ROM_LOAD32_WORD("mpr-16521.24", 0x000002, 0x200000, CRC(af1934fb) SHA1(a6a21a23cd34d0de6d3e6a5c3c2687f905d0dc2a) )
3776   ROM_LOAD32_WORD("mpr-16770.27", 0x800000, 0x200000, CRC(f9fa7bfb) SHA1(8aa933b74d4e05dc49987238705e50b00e5dae73) )
3777   ROM_LOAD32_WORD("mpr-16769.26", 0x800002, 0x200000, CRC(e57429e9) SHA1(8c712ab09e61ef510741a55f29b3c4e497471372) )
37043778
37053779   ROM_REGION( 0x20000, REGION_CPU4, 0) // Communication program
37063780   ROM_LOAD( "epr-16726.bin", 0x000000, 0x020000, CRC(c179b8c7) SHA1(86d3e65c77fb53b1d380b629348f4ab5b3d39228) )
r1037r1038
37453819   ROM_LOAD32_WORD( "mpr-17156.020", 0x000002, 0x200000, CRC(c4f4aabf) SHA1(8814cd329609cc8a188fedd770230bb9a5d00361) )
37463820
37473821   ROM_REGION( 0x1000000, REGION_USER3, 0 ) // Textures
3748   ROM_LOAD32_WORD( "mpr-17157.024", 0x000000, 0x200000, CRC(cf31e33d) SHA1(0cb62d4f28b5ad8a7e4c82b0ca8aea3037b05455) )
3749   ROM_LOAD32_WORD( "mpr-17158.025", 0x000002, 0x200000, CRC(1108d1ec) SHA1(e95d4166bd4b26c5f21b85821b410f53045f4309) )
3822   ROM_LOAD32_WORD( "mpr-17158.025", 0x000000, 0x200000, CRC(1108d1ec) SHA1(e95d4166bd4b26c5f21b85821b410f53045f4309) )
3823   ROM_LOAD32_WORD( "mpr-17157.024", 0x000002, 0x200000, CRC(cf31e33d) SHA1(0cb62d4f28b5ad8a7e4c82b0ca8aea3037b05455) )
37503824
37513825   ROM_REGION( 0x20000, REGION_CPU5, 0) // Communication program
37523826   ROM_LOAD32_WORD( "epr-17181.006", 0x000000, 0x010000, CRC(1add2b82) SHA1(81892251d466f630a96af25bde652c20e47d7ede) )
r1037r1038
37873861
37883862   ROM_REGION( 0x1000000, REGION_USER2, 0 ) // Models
37893863   ROM_LOAD32_WORD("mpr-16968.16", 0x000000, 0x200000, CRC(4a16f465) SHA1(411214ed65ce966040d4299b50bfaa40f7f5f266) )
3790   ROM_LOAD32_WORD("mpr-16965.20", 0x000002, 0x200000, CRC(9ba7645f) SHA1(c04f369961f908bac16fad8e32b863202390c205) )
3864   ROM_LOAD32_WORD("mpr-16964.21", 0x000002, 0x200000, CRC(d4a769b6) SHA1(845c34f95a49e06e3996b0c67aa73b4886fa8996) )
37913865   ROM_LOAD32_WORD("mpr-16969.17", 0x400000, 0x200000, CRC(887380ac) SHA1(03a9f601764d06cb0b2daaadf4f8433f327abd4a) )
3792   ROM_LOAD32_WORD("mpr-16964.21", 0x400002, 0x200000, CRC(d4a769b6) SHA1(845c34f95a49e06e3996b0c67aa73b4886fa8996) )
3866   ROM_LOAD32_WORD("mpr-16965.20", 0x400002, 0x200000, CRC(9ba7645f) SHA1(c04f369961f908bac16fad8e32b863202390c205) )
37933867
37943868   ROM_REGION( 0x1000000, REGION_USER3, 0 ) // Textures
3795   ROM_LOAD32_WORD("mpr-16966.24", 0x000000, 0x200000, CRC(7484efe9) SHA1(33e72139ad6c2990428e3fa041dbcdf39aca1c7a) )
3796   ROM_LOAD32_WORD("mpr-16967.25", 0x000002, 0x200000, CRC(b8b84c9d) SHA1(00ef320988609e98c8af383b68d845e3be8d0a03) )
3869   ROM_LOAD32_WORD("mpr-16967.25", 0x000000, 0x200000, CRC(b8b84c9d) SHA1(00ef320988609e98c8af383b68d845e3be8d0a03) )
3870   ROM_LOAD32_WORD("mpr-16966.24", 0x000002, 0x200000, CRC(7484efe9) SHA1(33e72139ad6c2990428e3fa041dbcdf39aca1c7a) )
37973871
37983872   ROM_REGION( 0x20000, REGION_CPU5, ROMREGION_ERASE00 ) // Communication program
37993873
r1037r1038
38413915   ROM[0x700/4] = 0x08000004;
38423916}
38433917
3844static DRIVER_INIT( daytona )
3845{
3846   UINT32 *ROM = (UINT32 *)memory_region(REGION_CPU1);
3847
3848   // kill TGP busywait
3849   ROM[0x11c7c/4] = 0x08000004;
3850}
3851
38523918static DRIVER_INIT( daytonam )
38533919{
38543920   memory_install_read32_handler(0, ADDRESS_SPACE_PROGRAM, 0x240000, 0x24ffff, 0, 0, maxx_r );
r1037r1038
38793945}
38803946
38813947// Model 2 (TGPs, Model 1 sound board)
3882GAME( 1993, daytona,         0, model2o, daytona, daytona, ROT0, "Sega", "Daytona USA (Japan)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
3883GAME( 1993, daytonas,  daytona, model2o, daytona, daytona, ROT0, "Sega", "Daytona USA (With Saturn Adverts)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
3948GAME( 1993, daytona,         0, model2o, daytona, 0, ROT0, "Sega", "Daytona USA (Japan)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
3949GAME( 1993, daytonas,  daytona, model2o, daytona, 0, ROT0, "Sega", "Daytona USA (With Saturn Adverts)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
38843950GAME( 1993, daytonat,  daytona, model2o, daytona, 0, ROT0, "Sega", "Daytona USA (Japan, Turbo hack)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
38853951GAME( 1993, daytonam,  daytona, model2o, daytona, daytonam, ROT0, "Sega", "Daytona USA (Japan, To The MAXX)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
38863952GAME( 1994, desert,          0, model2o, desert, 0, ROT0, "Sega/Martin Marietta", "Desert Tank", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/raiden2.c
r1037r1038
826826      logerror("w1x %05x, %04x & %04x (%05x)\n", offset*2+0x10000, data, mem_mask ^ 0xffff, activecpu_get_pc());
827827}
828828
829#ifdef UNUSED_FUNCTION
829830static void r2_dt(UINT16 sc, UINT16 cc, UINT16 ent, UINT16 tm, UINT16 x, UINT16 y)
830831{
831832   int bank = mainram[0x704/2];
r1037r1038
884885          cc, v1, v2);
885886   //  cpu_setbank(2, memory_region(REGION_USER1)+0x20000*bank);
886887}
888#endif
887889
888890static MACHINE_RESET(raiden2)
889891{
r1037r1038
18501852   ROM_LOAD32_BYTE("2.6l",   0x000001, 0x40000, CRC(54f3d359) SHA1(869744185746d55c60d2f48eabe384a8499e00fd) )
18511853   ROM_LOAD32_BYTE("4.5l",   0x000003, 0x40000, CRC(a017b8d0) SHA1(4a93ff1ab18f4b61c7ef580995f64840c19ce6b9) )
18521854
1855   ROM_REGION( 0x40000, REGION_USER2, 0 )   /* COPDX */
1856   ROM_LOAD( "copx-d2",   0x00000, 0x40000, CRC(a6732ff9) SHA1(c4856ec77869d9098da24b1bb3d7d58bb74b4cda) )
1857
18531858   ROM_REGION( 0x20000, REGION_CPU2, 0 ) /* 64k code for sound Z80 */
18541859   ROM_LOAD( "sound",  0x000000, 0x10000, CRC(7ec1fbc3) SHA1(48299d6530f641b18764cc49e283c347d0918a47) ) // 5.5c
18551860
r1037r1038
18581863   ROM_LOAD16_BYTE( "8.5r",   0x000001,   0x010000,   CRC(68f7dddc) SHA1(6938fa974c6ef028751982fdabd6a3820b0d30a8) )
18591864
18601865   ROM_REGION( 0x400000, REGION_GFX2, ROMREGION_DISPOSE ) /* background gfx */
1861   /* not dumped for this set */
1862//  ROM_LOAD( "back-1",   0x000000, 0x100000, CRC(8b7f9219) SHA1(3412b6f8a4fe245e521ddcf185a53f2f4520eb57) )
1863//  ROM_LOAD( "back-2",   0x100000, 0x080000, CRC(ce61c952) SHA1(52a843c8ba428b121fab933dd3b313b2894d80ac) )
1866   ROM_LOAD( "back-1",   0x000000, 0x100000, CRC(8b7f9219) SHA1(3412b6f8a4fe245e521ddcf185a53f2f4520eb57) )
1867   ROM_LOAD( "back-2",   0x100000, 0x080000, CRC(ce61c952) SHA1(52a843c8ba428b121fab933dd3b313b2894d80ac) )
18641868
18651869   ROM_REGION( 0x800000, REGION_GFX3, ROMREGION_DISPOSE ) /* sprite gfx (encrypted) (diff encrypt to raiden2? ) */
1866   /* not dumped for this set */
1867//  ROM_LOAD32_WORD( "obj-1",  0x000000, 0x200000, CRC(45be8029) SHA1(adc164f9dede9a86b96a4d709e9cba7d2ad0e564) )
1868//  ROM_LOAD32_WORD( "obj-2",  0x000002, 0x200000, CRC(cb61c19d) SHA1(151a2ce9c32f3321a974819e9b165dddc31c8153) )
1870   ROM_LOAD32_WORD( "obj-1",  0x000000, 0x200000, CRC(45be8029) SHA1(adc164f9dede9a86b96a4d709e9cba7d2ad0e564) )
1871   ROM_LOAD32_WORD( "obj-2",  0x000002, 0x200000, CRC(cb61c19d) SHA1(151a2ce9c32f3321a974819e9b165dddc31c8153) )
18691872
18701873   ROM_REGION( 0x100000, REGION_SOUND1, 0 )   /* ADPCM samples */
1871   ROM_LOAD( "pcm", 0x00000, 0x40000,  CRC(48be32b1) SHA1(969d2191a3c46871ee8bf93088b3cecce3eccf0c) ) // 6.4a
1874   ROM_LOAD( "6.pcm", 0x00000, 0x40000,  CRC(48be32b1) SHA1(969d2191a3c46871ee8bf93088b3cecce3eccf0c) ) // 6.4a
18721875ROM_END
18731876
18741877ROM_START( zeroteaa )
r1037r1038
18781881   ROM_LOAD32_BYTE("2.bin",   0x000001, 0x40000, CRC(0580b7e8) SHA1(d4416264aa5acdaa781ebcf51f128b3e665cc903) )
18791882   ROM_LOAD32_BYTE("4.bin",   0x000003, 0x40000, CRC(cc666385) SHA1(23a8878315b6009dcc1f27e49572e5be29f6a1a6) )
18801883
1884   ROM_REGION( 0x40000, REGION_USER2, 0 )   /* COPDX */
1885   ROM_LOAD( "copx-d2",   0x00000, 0x40000, CRC(a6732ff9) SHA1(c4856ec77869d9098da24b1bb3d7d58bb74b4cda) )
1886
18811887   ROM_REGION( 0x20000, REGION_CPU2, 0 ) /* 64k code for sound Z80 */
18821888   ROM_LOAD( "5.bin",  0x000000, 0x10000, CRC(efc484ca) SHA1(c34b8e3e7f4c2967bc6414348993478ed637d338) )
18831889
r1037r1038
18861892   ROM_LOAD16_BYTE( "8.bin",   0x000001,   0x010000, CRC(a0b2a09a) SHA1(9b1f6c732000b84b1ad635f332ebead5d65cc491) )
18871893
18881894   ROM_REGION( 0x400000, REGION_GFX2, ROMREGION_DISPOSE ) /* background gfx */
1889   /* not dumped for this set */
1890//  ROM_LOAD( "back-1",   0x000000, 0x100000, CRC(8b7f9219) SHA1(3412b6f8a4fe245e521ddcf185a53f2f4520eb57) )
1891//  ROM_LOAD( "back-2",   0x100000, 0x080000, CRC(ce61c952) SHA1(52a843c8ba428b121fab933dd3b313b2894d80ac) )
1895   ROM_LOAD( "back-1",   0x000000, 0x100000, CRC(8b7f9219) SHA1(3412b6f8a4fe245e521ddcf185a53f2f4520eb57) )
1896   ROM_LOAD( "back-2",   0x100000, 0x080000, CRC(ce61c952) SHA1(52a843c8ba428b121fab933dd3b313b2894d80ac) )
18921897
18931898   ROM_REGION( 0x800000, REGION_GFX3, ROMREGION_DISPOSE ) /* sprite gfx (encrypted) (diff encrypt to raiden2? ) */
1894   /* not dumped for this set */
1895//  ROM_LOAD32_WORD( "obj-1",  0x000000, 0x200000, CRC(45be8029) SHA1(adc164f9dede9a86b96a4d709e9cba7d2ad0e564) )
1896//  ROM_LOAD32_WORD( "obj-2",  0x000002, 0x200000, CRC(cb61c19d) SHA1(151a2ce9c32f3321a974819e9b165dddc31c8153) )
1899   ROM_LOAD32_WORD( "obj-1",  0x000000, 0x200000, CRC(45be8029) SHA1(adc164f9dede9a86b96a4d709e9cba7d2ad0e564) )
1900   ROM_LOAD32_WORD( "obj-2",  0x000002, 0x200000, CRC(cb61c19d) SHA1(151a2ce9c32f3321a974819e9b165dddc31c8153) )
18971901
18981902   ROM_REGION( 0x100000, REGION_SOUND1, 0 )   /* ADPCM samples */
1899   ROM_LOAD( "pcm", 0x00000, 0x40000,  CRC(48be32b1) SHA1(969d2191a3c46871ee8bf93088b3cecce3eccf0c) ) // 6.bin
1903   ROM_LOAD( "6.pcm", 0x00000, 0x40000,  CRC(48be32b1) SHA1(969d2191a3c46871ee8bf93088b3cecce3eccf0c) ) // 6.bin
19001904ROM_END
19011905
1906ROM_START( zerotsel )
1907   ROM_REGION( 0x200000, REGION_USER1, 0 ) /* v30 main cpu */
1908   ROM_LOAD32_BYTE("1_sel.bin",   0x000000, 0x40000, CRC(d99d6273) SHA1(21dccd5d71c720b8364406835812b3c9defaff6c) )
1909   ROM_LOAD32_BYTE("3_sel.bin",   0x000002, 0x40000, CRC(0a9fe0b1) SHA1(3588fe19788f77d07e9b5ab8182b94362ffd0024) )
1910   ROM_LOAD32_BYTE("2_sel.bin",   0x000001, 0x40000, CRC(4e114e74) SHA1(fcccbb68c6b7ffe8d109ed3a1ec9120d338398f9) )
1911   ROM_LOAD32_BYTE("4_sel.bin",   0x000003, 0x40000, CRC(0df8ba94) SHA1(e07dce6cf3c3cfe1ea3b7f01e18833c1da5ed1dc) )
1912
1913   ROM_REGION( 0x40000, REGION_USER2, 0 )   /* COPDX */
1914   ROM_LOAD( "copx-d2",   0x00000, 0x40000, CRC(a6732ff9) SHA1(c4856ec77869d9098da24b1bb3d7d58bb74b4cda) )
1915
1916   ROM_REGION( 0x20000, REGION_CPU2, 0 ) /* 64k code for sound Z80 */
1917   ROM_LOAD( "5_sel.bin",  0x000000, 0x10000, CRC(ed91046c) SHA1(de815c999aeeb814d3f091d5a9ac34ea9a388ddb) )
1918
1919   ROM_REGION( 0x020000, REGION_GFX1, ROMREGION_DISPOSE ) /* chars */
1920   ROM_LOAD16_BYTE( "7.5s",   0x000000,   0x010000,   CRC(9f6aa0f0) SHA1(1caad7092c07723d12a07aa363ae2aa69cb6be0d) )
1921   ROM_LOAD16_BYTE( "8.5r",   0x000001,   0x010000,   CRC(68f7dddc) SHA1(6938fa974c6ef028751982fdabd6a3820b0d30a8) )
1922
1923   ROM_REGION( 0x400000, REGION_GFX2, ROMREGION_DISPOSE ) /* background gfx */
1924   ROM_LOAD( "back-1",   0x000000, 0x100000, CRC(8b7f9219) SHA1(3412b6f8a4fe245e521ddcf185a53f2f4520eb57) )
1925   ROM_LOAD( "back-2",   0x100000, 0x080000, CRC(ce61c952) SHA1(52a843c8ba428b121fab933dd3b313b2894d80ac) )
1926
1927   ROM_REGION( 0x800000, REGION_GFX3, ROMREGION_DISPOSE ) /* sprite gfx (encrypted) (diff encrypt to raiden2? ) */
1928   ROM_LOAD32_WORD( "obj-1",  0x000000, 0x200000, CRC(45be8029) SHA1(adc164f9dede9a86b96a4d709e9cba7d2ad0e564) )
1929   ROM_LOAD32_WORD( "obj-2",  0x000002, 0x200000, CRC(cb61c19d) SHA1(151a2ce9c32f3321a974819e9b165dddc31c8153) )
1930
1931   ROM_REGION( 0x100000, REGION_SOUND1, 0 )   /* ADPCM samples */
1932   ROM_LOAD( "6.pcm", 0x00000, 0x40000,  CRC(48be32b1) SHA1(969d2191a3c46871ee8bf93088b3cecce3eccf0c) ) // 6.bin
1933ROM_END
1934
19021935/* set contained only program roms, was marked as 'non-encrytped' but program isn't encrypted anyway?! */
19031936ROM_START( zeroteab )
19041937   ROM_REGION( 0x200000, REGION_USER1, 0 ) /* v30 main cpu */
r1037r1038
19071940   ROM_LOAD32_BYTE("z2",   0x000001, 0x40000, CRC(21d68f62) SHA1(8aa85b38e8f36057ef6c7dce5a2878958ce93ce8) )
19081941   ROM_LOAD32_BYTE("z4",   0x000003, 0x40000, CRC(ce8fe6c2) SHA1(69627867c7866e43e771ab85014553117044d18d) )
19091942
1943   ROM_REGION( 0x40000, REGION_USER2, 0 )   /* COPDX */
1944   ROM_LOAD( "copx-d2",   0x00000, 0x40000, CRC(a6732ff9) SHA1(c4856ec77869d9098da24b1bb3d7d58bb74b4cda) )
1945
19101946   ROM_REGION( 0x20000, REGION_CPU2, 0 ) /* 64k code for sound Z80 */
19111947   ROM_LOAD( "sound",  0x000000, 0x10000, CRC(7ec1fbc3) SHA1(48299d6530f641b18764cc49e283c347d0918a47) ) // 5.5c
19121948
r1037r1038
19151951   ROM_LOAD16_BYTE( "8.5r",   0x000001,   0x010000,   CRC(68f7dddc) SHA1(6938fa974c6ef028751982fdabd6a3820b0d30a8) )
19161952
19171953   ROM_REGION( 0x400000, REGION_GFX2, ROMREGION_DISPOSE ) /* background gfx */
1918   /* not dumped for this set */
1919//  ROM_LOAD( "back-1",   0x000000, 0x100000, CRC(8b7f9219) SHA1(3412b6f8a4fe245e521ddcf185a53f2f4520eb57) )
1920//  ROM_LOAD( "back-2",   0x100000, 0x080000, CRC(ce61c952) SHA1(52a843c8ba428b121fab933dd3b313b2894d80ac) )
1954   ROM_LOAD( "back-1",   0x000000, 0x100000, CRC(8b7f9219) SHA1(3412b6f8a4fe245e521ddcf185a53f2f4520eb57) )
1955   ROM_LOAD( "back-2",   0x100000, 0x080000, CRC(ce61c952) SHA1(52a843c8ba428b121fab933dd3b313b2894d80ac) )
19211956
19221957   ROM_REGION( 0x800000, REGION_GFX3, ROMREGION_DISPOSE ) /* sprite gfx (encrypted) (diff encrypt to raiden2? ) */
1923   /* not dumped for this set */
1924//  ROM_LOAD32_WORD( "obj-1",  0x000000, 0x200000, CRC(45be8029) SHA1(adc164f9dede9a86b96a4d709e9cba7d2ad0e564) )
1925//  ROM_LOAD32_WORD( "obj-2",  0x000002, 0x200000, CRC(cb61c19d) SHA1(151a2ce9c32f3321a974819e9b165dddc31c8153) )
1958   ROM_LOAD32_WORD( "obj-1",  0x000000, 0x200000, CRC(45be8029) SHA1(adc164f9dede9a86b96a4d709e9cba7d2ad0e564) )
1959   ROM_LOAD32_WORD( "obj-2",  0x000002, 0x200000, CRC(cb61c19d) SHA1(151a2ce9c32f3321a974819e9b165dddc31c8153) )
19261960
19271961   ROM_REGION( 0x100000, REGION_SOUND1, 0 )   /* ADPCM samples */
1928   ROM_LOAD( "pcm", 0x00000, 0x40000,  CRC(48be32b1) SHA1(969d2191a3c46871ee8bf93088b3cecce3eccf0c) ) // 6.4a
1962   ROM_LOAD( "6.pcm", 0x00000, 0x40000,  CRC(48be32b1) SHA1(969d2191a3c46871ee8bf93088b3cecce3eccf0c) ) // 6.4a
19291963ROM_END
19301964
1965/* Different hardware, COP-D3? */
19311966ROM_START( nzerotea )
19321967   ROM_REGION( 0x200000, REGION_USER1, 0 ) /* v30 main cpu */
19331968   ROM_LOAD16_BYTE("prg1",   0x000000, 0x80000, CRC(3c7d9410) SHA1(25f2121b6c2be73f11263934266901ed5d64d2ee) )
r1037r1038
19491984   ROM_LOAD32_WORD( "obj-2",  0x000002, 0x200000, CRC(cb61c19d) SHA1(151a2ce9c32f3321a974819e9b165dddc31c8153) )
19501985
19511986   ROM_REGION( 0x100000, REGION_SOUND1, 0 )   /* ADPCM samples */
1952   ROM_LOAD( "pcm", 0x00000, 0x40000,  CRC(48be32b1) SHA1(969d2191a3c46871ee8bf93088b3cecce3eccf0c) )
1987   ROM_LOAD( "6.pcm", 0x00000, 0x40000,  CRC(48be32b1) SHA1(969d2191a3c46871ee8bf93088b3cecce3eccf0c) )
19531988ROM_END
19541989
19551990/* INIT */
r1037r1038
22672302GAME( 1993, zeroteam, 0,       raiden2,  raiden2,  raiden2,  ROT0,   "Seibu Kaihatsu", "Zero Team (set 1)", GAME_NOT_WORKING|GAME_NO_SOUND)
22682303GAME( 1993, zeroteaa, zeroteam,raiden2,  raiden2,  raiden2,  ROT0,   "Seibu Kaihatsu", "Zero Team (set 2)", GAME_NOT_WORKING|GAME_NO_SOUND)
22692304GAME( 1993, zeroteab, zeroteam,raiden2,  raiden2,  raiden2,  ROT0,   "Seibu Kaihatsu", "Zero Team (set 3)", GAME_NOT_WORKING|GAME_NO_SOUND)
2305GAME( 1993, zerotsel, zeroteam,raiden2,  raiden2,  raiden2,  ROT0,   "Seibu Kaihatsu", "Zero Team Selection", GAME_NOT_WORKING|GAME_NO_SOUND)
22702306GAME( 1993, nzerotea, zeroteam,raiden2,  raiden2,  raiden2,  ROT0,   "Seibu Kaihatsu", "New Zero Team", GAME_NOT_WORKING|GAME_NO_SOUND)
22712307
src/mame/drivers/system18.c
r1037r1038
13751375   ROM_LOAD( "epr13078.bin", 0xb0000, 0x40000, CRC(15684dc5) SHA1(595051006de24f791dae937584e502ff2fa31d9c) )
13761376ROM_END
13771377
1378/*
1379
1380CPUs:
1381on main board:
1382
13831x MC68000P10 (main)
13841x Z8400BB1-Z80BCPU (sound)
13851x OKI M6295 (sound)
13861x oscillator 24.000MHz (close to main)
13871x oscillator 8.000MHz (close to sound)
1388
1389ROMs
1390on main board:
1391
13929x M27C512 (1,2,3,4,5,6,7,8,10)
13931x TMS27C256 (9)
139421x NM27C010Q (11-31)
1395
1396----------------------
1397
1398on roms board:
13996x NM27C010Q (32-37)
14002x N82S123N
1401
1402*/
1403
1404ROM_START( astormb2 )
1405   ROM_REGION( 0x080000, REGION_CPU1, 0 ) /* 68000 code */
1406   ROM_LOAD16_BYTE( "1.a4", 0x000000, 0x10000, CRC(cca0d0af) SHA1(26fdbbeb8444d05f0ca2056a7c7fb81b0f1f2b5a) )
1407   ROM_LOAD16_BYTE( "2.a3", 0x020000, 0x10000, CRC(f95eb883) SHA1(b25d9c0fd46a534e7612f4a3ffa708b73654ae2b) )
1408   ROM_LOAD16_BYTE( "3.a2", 0x040000, 0x10000, CRC(4206ecd4) SHA1(45c65d7727cfaf215a7081159f6931185e92b39a) ) // epr13182.bin [3/4]      IDENTICAL
1409   ROM_LOAD16_BYTE( "4.a1", 0x060000, 0x10000, CRC(23247c95) SHA1(e4d78c453d2cb77946dd1b5266de823968eade77) ) // epr13182.bin [4/4]      98.648071%
1410   ROM_LOAD16_BYTE( "5.a9", 0x000001, 0x10000, CRC(6143039e) SHA1(8a5143c1e2c637149e988c423fa30b31e29a1193) )
1411   ROM_LOAD16_BYTE( "6.a8", 0x020001, 0x10000, CRC(0fd17bec) SHA1(e9a5dd93394fdf1561a925e4111dfce51b717b14) )
1412   ROM_LOAD16_BYTE( "7.a7", 0x040001, 0x10000, CRC(c901e228) SHA1(f459ba819a4e5f5174ff1b3957fb648c93beed53) ) // epr13181.bin [3/4]      IDENTICAL
1413   ROM_LOAD16_BYTE( "8.a6", 0x060001, 0x10000, CRC(bfb9d607) SHA1(8c3e10c1397fa0807d8df4715c9eb1945c774924) ) // epr13181.bin [4/4]      98.587036%
1414
1415   ROM_REGION( 0xc0000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
1416   ROM_LOAD( "32.01",  0x00000, 0x20000, CRC(d2aeb4ab) SHA1(9338ec5dc48f5d2b20511628a281236fe4646ef4) ) // epr13073.bin [1/2]      IDENTICAL
1417   ROM_LOAD( "33.011", 0x20000, 0x20000, CRC(2193f0ae) SHA1(84070f74693699c1ffc1a47517a97b5d058d08ec) ) // epr13073.bin [2/2]      IDENTICAL
1418   ROM_LOAD( "34.02",  0x40000, 0x20000, CRC(849aa725) SHA1(0f949dfe8a6c5796edc86a05339da80a158a95ae) ) // epr13074.bin [1/2]      IDENTICAL
1419   ROM_LOAD( "35.021", 0x60000, 0x20000, CRC(3f190347) SHA1(131953ccefb95eeef1ea90499ce521c3749f95c1) ) // epr13074.bin [2/2]      IDENTICAL
1420   ROM_LOAD( "36.03",  0x80000, 0x20000, CRC(c0f9628d) SHA1(aeacf5e409adfa0b9c28c90d4e89eb1f56cd5f4d) ) // epr13075.bin [1/2]      IDENTICAL
1421   ROM_LOAD( "37.031", 0xa0000, 0x20000, CRC(95af904e) SHA1(6574fa874c355c368109b417aab7d0b05c9d215d) ) // epr13075.bin [2/2]      IDENTICAL
1422
1423   ROM_REGION( 0x200000, REGION_GFX2, 0 ) /* sprites */
1424   ROM_LOAD16_BYTE( "17.042", 0x000001, 0x20000, CRC(db08beb5) SHA1(c154d22c69b77637d6a9d0f2bffcfb47e6901ec8) ) // mpr13082.bin [1/2]      IDENTICAL
1425   ROM_LOAD16_BYTE( "16.043", 0x040001, 0x20000, CRC(41f78977) SHA1(9cf9fcf96722d148c4b2cf7aa33425b6efcd0379) ) // mpr13082.bin [2/2]      IDENTICAL
1426   ROM_LOAD16_BYTE( "29.012", 0x000000, 0x20000, CRC(22acf675) SHA1(80fd0d96017bf36d964a79f7e13e73fee7ed370a) ) // mpr13089.bin [1/2]      99.941254%
1427   ROM_LOAD16_BYTE( "28.013", 0x040000, 0x20000, CRC(32b37a3a) SHA1(70f268aa99a17739fd9d832b5f1d9e37247747e6) ) // mpr13089.bin [2/2]      IDENTICAL
1428    ROM_LOAD16_BYTE( "19.040", 0x080001, 0x20000, CRC(10c359ac) SHA1(9087cb824242ce5fc8eba45b61cca8b329c576e5) ) // mpr13081.bin [1/2]      IDENTICAL
1429   ROM_LOAD16_BYTE( "18.041", 0x0c0001, 0x20000, CRC(47146c1d) SHA1(cd5d92136f86128a9f304c4f8850f1efd652dd5c) ) // mpr13081.bin [2/2]      IDENTICAL
1430   ROM_LOAD16_BYTE( "31.010", 0x080000, 0x20000, CRC(e88fc39c) SHA1(f19c55c49771625a76e65b639a3b23969db8031d) ) // mpr13088.bin [1/2]      IDENTICAL
1431   ROM_LOAD16_BYTE( "30.011", 0x0c0000, 0x20000, CRC(6fe7e2a2) SHA1(94e5852377f72fd00daae302db4a5f93301213e4) ) // mpr13088.bin [2/2]      IDENTICAL
1432   ROM_LOAD16_BYTE( "21.032", 0x100001, 0x20000, CRC(c9e5a258) SHA1(809a3a3f88efe9c7a9dd9f6439ccb48fffb84df0) ) // mpr13080.bin [1/2]      IDENTICAL
1433   ROM_LOAD16_BYTE( "20.033", 0x140001, 0x20000, CRC(ddf8d00e) SHA1(0a9031063921bb03e7fd57eea369a1ddcfa85431) ) // mpr13080.bin [2/2]      IDENTICAL
1434   ROM_LOAD16_BYTE( "25.022", 0x100000, 0x20000, CRC(af8f3700) SHA1(3787f732eee5c6c9b6550bd4ce5387aff2c4072e) ) // mpr13087.bin [1/2]      IDENTICAL
1435   ROM_LOAD16_BYTE( "24.023", 0x140000, 0x20000, CRC(a092ecb6) SHA1(d7cc85eaea70c7947c497bc1d9743ab12a6fb43e) ) // mpr13087.bin [2/2]      IDENTICAL
1436   ROM_LOAD16_BYTE( "23.030", 0x180001, 0x20000, CRC(adc1b625) SHA1(496a1e92a833dbde37a0426165ff4250848b6ef4) ) // epr13079.bin [1/2]      IDENTICAL
1437   ROM_LOAD16_BYTE( "22.031", 0x1c0001, 0x20000, CRC(27c27f38) SHA1(439502250da4e376d2aa4bd9122455c6991e334d) ) // epr13079.bin [2/2]      IDENTICAL
1438   ROM_LOAD16_BYTE( "27.020", 0x180000, 0x20000, CRC(6c5312aa) SHA1(94b74c78f318fcc1881a2926cebc98033a7e535d) ) // epr13086.bin [1/2]      IDENTICAL
1439   ROM_LOAD16_BYTE( "26.021", 0x1c0000, 0x20000, CRC(c67fc986) SHA1(5fac826f9dde45201e3b93582dbe29c584a10229) ) // epr13086.bin [2/2]      99.987030%
1440
1441   /* Sound HW is very different to the originals */
1442   ROM_REGION( 0x210000, REGION_CPU2, ROMREGION_ERASEFF ) /* Z80 sound CPU */
1443   ROM_LOAD( "9.a5", 0x10000, 0x08000, CRC(0a4638e9) SHA1(0470e03a194464ff53c7583637193b585f5fd79f) )
1444
1445   ROM_REGION( 0x40000, REGION_SOUND1, ROMREGION_ERASEFF ) /* Oki6295 Samples - fixed? samples */
1446   ROM_LOAD( "11.a10", 0x00000, 0x20000, CRC(7e0f752c) SHA1(a4070c3fa4848b5be223f9b927de4b6926dbb4e6) ) // contains sample table
1447   ROM_LOAD( "10.a11", 0x20000, 0x10000, CRC(722e5969) SHA1(9cf891c6533b2e2a5c4741aa4e405038a7bf4e97) )
1448   /* 0x30000- 0x3ffff banked? (guess) */
1449
1450   ROM_REGION( 0xc0000, REGION_SOUND2, ROMREGION_ERASEFF ) /* Oki6295 Samples - banked? samples*/
1451   ROM_LOAD( "12.a15", 0x00000, 0x20000, CRC(cb4517db) SHA1(4c93376c2b3e70001bbc283d4485bb55514f6ef9) )
1452   ROM_LOAD( "13.a14", 0x20000, 0x20000, CRC(c60d6f18) SHA1(c9610729f19ae8414efd785948a1e6fb079bfe8d) )
1453   ROM_LOAD( "14.a13", 0x40000, 0x20000, CRC(07e6b3a5) SHA1(32da2a9aeb840b76e6f0117ac342ff5d612762b4) )
1454   ROM_LOAD( "15.a12", 0x60000, 0x20000, CRC(dffde929) SHA1(037b32470747d155385e532ee574b1234b3c2b26) )
1455
1456   ROM_REGION( 0x0120, REGION_PROMS, 0 )
1457   ROM_LOAD( "n82s129n.129",  0x0000, 0x0100, CRC(a7c22d96) SHA1(160deae8053b09c09328325246598b3518c7e20b) )
1458   ROM_LOAD( "n82s123n.123",  0x0100, 0x0020, CRC(58bcf8bd) SHA1(e4d3d179b08c0f3424a6bec0f15058fb1b56f8d8) )
1459ROM_END
1460
1461
13781462ROM_START( mwalkbl )
13791463   ROM_REGION( 0x080000, REGION_CPU1, 0 ) /* 68000 code */
13801464   ROM_LOAD16_BYTE( "mwalkbl.01", 0x000000, 0x10000, CRC(f49cdb16) SHA1(34b7e98d31c3b9db2f0f055d7b249b0e5e5cb746) )
r1037r1038
14891573
14901574/*****************************************************************************/
14911575
1492GAME( 1990, astormbl, astorm,   astormbl, astormbl, astormbl, ROT0, "bootleg", "Alien Storm (bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1576GAME( 1990, astormbl, astorm,   astormbl, astormbl, astormbl, ROT0, "bootleg", "Alien Storm (bootleg, set 1)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1577GAME( 1990, astormb2, astorm,   astormbl, astormbl, astormbl, ROT0, "bootleg", "Alien Storm (bootleg, set 2)", GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND )
14931578
14941579GAME( 1990, mwalkbl,  mwalk,    mwalkbl,  mwalkbl,  mwalkbl,  ROT0, "bootleg", "Michael Jackson's Moonwalker (bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
14951580
src/mame/drivers/namcos21.c
r1037r1038
11/**
22Namco System 21
33
4    There are at least three hardware variations, all of which are based on
5    Namco System2:
4todo:
5- confirm that halt dsp works
6- fix machine/namcos2 to halt only relevant cpu subsets
7- manual "kickstart" needed (press "N" any time after title screen)
68
7    1. Winning Run was a mass-produced prototype; it uses 3 68k CPUs; all others use 2 68k CPUs.
9Winning Run
10    polygon glitches/flicker
11    missing posirq handling
812
9    2. Cyber Sled uses 4xTMS320C25
13Air Combat
14    timing innacuracies cause DSP to lock up in-game
1015
11    3. Starblade uses 5xTMS320C20
16Starblade
17    high score colors wrong
1218
19Cybersled
20    occasional transparent floor due to z-buffer overloading
21
22Solvaou
23    sprite mixing wrong; needs to use zbuffer
24
25Driver's Eyes
26    not yet working
27
28    Questions? pstroffo@yahoo.com (Phil Stroffolino)
29
30    There are at least four hardware variations, all of which are based on Namco System2:
31
32                          | Winning Run | Driver's Eyes | Starblade | Cyber Sled
33--------------------------+-------------+---------------+-----------+------------
34GPU+bitmap layer          | yes         | no            | no        | no
35Namco System NB1 Sprites  | no          | yes           | yes       | yes
36Number of DSPs            | 1           | 1             | 5         | 4
37
1338The main 68k CPUs populate a chunk of shared RAM with an display list describing a scene to be rendered.
1439The main CPUs also specify attributes for a master camera which provides additional global transformations.
1540The display list contains references to specific 3d objects and their position/orientation in 3d space.
1641
1742The master DSP parses the display list and applies high level geometry, emitting matrices and object
18references.
43references.  Object references are expanded into meshes (decoded from point ROMs) and passed to the slave
44DSP, interleaved with local transforms.
1945
20An intermediate device (*) expands object references to the primitive data from point ROMs interleaved with
21local transforms, making this data available as input to the slave DSP.
46A collection of slave DSPs transforms, projects, and clips each primitive's vertices.  Each slave DSP outputs
47a stream of quad descriptors.
2248
23The slave DSP applies the view transform to each primitive's vertices, projection, and clipping,
24and outputs quad descriptors.  Each quad has a reference color (shared across vertices),
25and for each vertex the tuple: (screenx,screeny,z-code).  The z-code scalar accounts for depth bias.
26A zbuffer is used while rendering quads.
49Each quad has a reference color (shared across vertices), and for each vertex the tuple: (screenx,screeny,z-code).
50The z-code scalar accounts for depth bias.  A zbuffer is used while rendering quads, and depth cueing is used to
51shade pixels according to their depth.
2752
2853---------------------------------------------------------------------------
2954
3055STATUS:
31    Starblade:
32        missing background objects on stage#1 (starships)
33        - missing 'upload' data (dsp to 68k)?; check for unmapped ram use?
34        - find object code for starship (compare to PSX port)
35
3656    Solvaou:
37        no polys; why?
38
39    CyberSled:
40        graphics cropped
41        three uploads?
42
4357    Air Combat:
44        unemulated ram
58        no polys - why?
4559
4660    Winning Run
47        ?
61    Winning Run 91
62        working
63          - some minor polygon glitches
64          - posirq handling broken
4865
49    Winning Run 92
50        ?
51
5266    Driver's Eyes
53        ?
67        crashes
5468
55TODO:   Unify memory maps.
69TODO:   (*) Extract DSP BIOS
5670
57TODO:   Fix emulation to support other games (likely caused by dspram16_r hacks).
58
59TODO:   Determine purpose of additional (unemulated) DSPs.  I believe they are additional slave DSPs that
60        run in parallel, but it is difficult to know for sure without having access to the DSP bios code.
61        The single slave DSP isn't powerful enough to update the polygon layer at 60fps.
62
63TODO:   (*) Extract master DSP's BIOS (via trojan if possible).
64        Certain tasks currently implemented in C (see TransferDspData) are quite likely done explicitly
65        by the master DSP.
66
67TODO:   Determine how "point ram" (tested by main 68k cpu on boot) is actually used.
68
6971TODO:   namcoic.c: in StarBlade, the sprite list is stored at a different location during startup tests.
70        Is there a register that controls this?
72        What register controls this?
7173
72TODO:   Starblade has some missing background graphics (i.e. the spaceport runway at
73    beginning of stage#1, various large startship cruisers drifting in space, etc.
74        Even with (mostly complete) DSP emulation, it is a complete mystery why this isn't working.
75    The main CPU doesn't write descriptors for these objects in its display list, nor does it
76    write any obvious "high level commands" to control background graphics sequencing.
77
78TODO:   CyberSled appears to use the "POSIRQ" feature seen in various Namco System 2 games for
79        split screen effects.  This IRQ is triggered at a designated scanline.  Confirm that this
80        works as expected.
81
8274TODO:   Map lamps/vibration outputs as used by StarBlade (and possibly other titles).
8375        These likely involve the MCU.
8476
8577---------------------------------------------------------------------------
8678
8779DSP RAM is shared with the 68000 CPUs and master DSP.
88This memory map reflects DSP RAM as seen by the 68000 CPUs.
80The memory map below reflects DSP RAM as seen by the 68000 CPUs.
8981
90    0x200000..0x2000ff  populated with ASCII Text during self-tests:
91        ROM:
92        RAM:
93        PTR:
94        SMU:
95        IDC:
96        CPU:ABORT
97        DSP:
98        CRC:OK  from cpu
99        CRC:    from dsp
100        ID:
101        B-M:    P-M:    S-M:    SET UP
82   0x200000: ROM:
83    0x200010: RAM:
84    0x200020: PTR:
85    0x200024: <checksum>
86    0x200028: <checksum>
87    0x200030: SMU: // "NO RESPONS" (DSP)
88    0x200040: IDC: // "NO RESPONS" (DSP)
89    0x200050: CPU: BOOTING..COMPLETE
90    0x200060: DSP:
91    0x200070: CRC: OK from cpu
92    0x200080: CRC:    from dsp
93    0x200090: ID:
94    0x2000a0: B-M:
95    0x2000b0: P-M:
96    0x2000c0: S-M:
97   0x200100    status: 2=upload needed, 4=error (abort)
98   0x200102    status
99   0x200104    0x0002
100   0x200106    addr written by main cpu
101   0x20010a    point rom checksum (starblade expects 0xed53)
102   0x20010c    point rom checksum (starblade expects 0xd5df)
103   0x20010e    1 : upload-code-to-dsp request trigger
104   0x200110    status
105   0x200112    status
106   0x200114    master dsp code size
107   0x200116    slave dsp code size
108   0x200120    upload source1 addr hi
109   0x200122    upload source1 addr lo
110   0x200124    upload source2 addr hi
111   0x200126    upload source2 addr lo
112   0x200200    enable
113   0x200202    status
114   0x200206    work page select
115    0x200208   0xa2c2 (air combat)
116   0x208000..0x2080ff  camera attributes for page#0
117   0x208200..0x208fff  3d object attribute display list for page#0
118   0x20c000..0x20c0ff  camera attributes for page#1
119   0x20c200..0x20cfff  3d object attribute display list for page#1
102120
103    0x200100    status: 2=upload needed, 4=error (abort)
104    0x200102    status
105    0x200104    0x0002
106    0x200106    addr written by main cpu
107    0x20010a    checksum (starblade expects 0xed53)
108    0x20010c    checksum (starblade expects 0xd5df)
109    0x20010e    1 : upload-code-to-dsp request trigger
110    0x200110    status
111    0x200112    status
112    0x200114    master dsp code size
113    0x200116    slave dsp code size
114    0x200120    upload source1 addr hi
115    0x200122    upload source1 addr lo
116    0x200124    upload source2 addr hi
117    0x200126    upload source2 addr lo
121       Starblade Cybersled AirCombat22 Solvalou
122[400]:= 00 0000   00 0000   00 0000   00 0000
123[402]:= 00 0011   00 0011   00 0011   00 0011
124[404]:= 00 0000   00 0000    00 0000   00 0000
125[406]:= 00 0000   00 0000    00 0000   00 0000
126[408]:= 10 1002   10 1000    10 1000   10 1000
127[40a]:= 02 0000   00 0000    00 0000   00 ffff
128[40c]:= 00 1040   00 023a    00 1000   ff ffff
129[40e]:= 00 0000   00 0000    00 0000   ff ffff
130[410]:= 10 1034   02 0258    10 1000      ff ffff
131[412]:= 40 0000   3a 0000    00 0000   ff ffff
132[414]:= 00 1030   00 027a    00 1000      ff ffff
133[416]:= 00 0000   00 0000    00 0000      ff ffff
134[418]:= 10 1030   02 02a2    10 1000      ff ffff
135[41a]:= 34 0000   58 0000    00 0000      ff ffff
136[41c]:= 00 1030   00 02c2    00 1000      ff ffff
137[41e]:= 00 0000   00 0000    00 0000      ff ffff
138[420]:= 10 1030   02 02e6    10 1000      ff ffff
118139
119    0x200200    enable
120    0x200202    status
121    0x200206    work page select
122
123    0x208000..0x2080ff  camera attributes for page#0
124    0x208200..0x208fff  3d object attribute display list for page#0
125
126    0x20c000..0x20c0ff  camera attributes for page#1
127    0x20c200..0x20cfff  3d object attribute display list for page#1
128
129140---------------------------------------------------------------------------
130141
131142Thanks to Aaron Giles for originally making sense of the Point ROM data.
132143
133144Point data in ROMS (signed 24 bit words) encodes the 3d primitives.
134145
135The first part of the Point ROMs is an address table.  The first entry serves
136a special (unknown) purpose.
146The first part of the Point ROMs is an address table.
137147
138148Given an object index, this table provides an address into the second part of
139149the ROM.
r1037r1038
148158The rest of the data in each entry is organized as follows:
149159
150160length (1 word)
151unknown value (1 word) - this increments with each entry
161quad index (1 word) - this increments with each entry
152162vertex count (1 word) - the number of vertices encoded
153163unknown value (1 word) - almost always 0; depth bias
154164vertex list (n x 3 words)
155165quad count (1 word) - the number of quads to draw
156quad primitives (n x 5 words) - indices of four verticies plus color code
166quad primitives (n x 5 words) - color code and four vertex indices
157167
158168-----------------------------------------------------------------------
159169Board 1 : DSP Board - 1st PCB. (Uppermost)
r1037r1038
286296#include "sound/c140.h"
287297#include "namcos21.h"
288298
289static UINT16 *master_dsp_rom;
290static UINT16 *master_dsp_ram;
291static UINT16 *slave_dsp_rom;
292static UINT16 *slave_dsp_ram;
293
299#define PTRAM_SIZE 0x20000
300#define CPU_DSP_MASTER_REGION   REGION_CPU5
294301#define CPU_DSP_SLAVE_REGION   REGION_CPU6
295302
303static UINT16 *winrun_dspbios;
304static UINT16 *winrun_dspcomram;
305#define WINRUN_MAX_POLY_PARAM (1+256*3)
306static UINT16 winrun_poly_buf[WINRUN_MAX_POLY_PARAM];
307static int winrun_poly_index;
308static UINT32 winrun_pointrom_addr;
309static UINT16 *winrun_polydata;
310static int winrun_dsp_alive;
311static UINT16 *winrun_gpucomram;
312static UINT16 winrun_dspcomram_control[8];
313static UINT16 namcos21_video_enable;
314
315static UINT8 *pointram;
316static int pointram_idx;
317
318UINT16 *namcos21_dspram16;
319UINT16 *namcos21_spritepos;
320
321/* private data */
322static UINT16 *mpDataROM;
323static UINT16 *mpSharedRAM1;
324static UINT8   *mpDualPortRAM;
325static UINT16 pointram_control;
326
327
328
296329#define DSP_BUF_MAX (4096*8)
297330static struct
298331{
299332   unsigned masterSourceAddr;
300333   UINT16 slaveInputBuffer[DSP_BUF_MAX];
301   size_t slaveInputSize;
302   unsigned slaveSourceAddr;
303
334   unsigned slaveBytesAvailable;
335   unsigned slaveBytesAdvertised;
336   unsigned slaveInputStart;
304337   UINT16 slaveOutputBuffer[DSP_BUF_MAX];
305338   unsigned slaveOutputSize;
306
307339   UINT16 masterDirectDrawBuffer[256];
308340   unsigned masterDirectDrawSize;
341   int masterFinished;
342   int slaveActive;
309343} *mpDspState;
310344
311/*static*/ void
312UpdatePolyFrameBufferAndResetDSPs( void )
345static INT32
346ReadPointROMData( unsigned offset )
313347{
314   memset( mpDspState, 0, sizeof(*mpDspState) );
315   cpunum_set_input_line(4, INPUT_LINE_RESET, PULSE_LINE); /* DSP: master */
316   cpunum_set_input_line(5, INPUT_LINE_RESET, PULSE_LINE); /* DSP: slave */
317   namcos21_ClearPolyFrameBuffer();
348   const INT32 *pPointData = (INT32 *)memory_region( REGION_USER2 );
349   INT32 result = pPointData[offset];
350   return result;
318351}
319352
320/* globals (shared by videohrdw/namcos21.c) */
321UINT16 *namcos21_dspram16;
322UINT16 *namcos21_spritepos;
353static READ16_HANDLER(namcos21_video_enable_r)
354{
355   return namcos21_video_enable;
356}
323357
324/* private data */
325static UINT16   *mpDataROM;
326static UINT16   *mpSharedRAM1;
327static UINT8   *mpDualPortRAM;
328static UINT16 namcos21_dsp_control[1];
358static WRITE16_HANDLER(namcos21_video_enable_w)
359{
360   COMBINE_DATA( &namcos21_video_enable ); /* 0x40 = enable */
361   if( namcos21_video_enable!=0 && namcos21_video_enable!=0x40 )
362   {
363      printf( "unexpected namcos21_video_enable_w=0x%x\n", namcos21_video_enable );
364   }
365}
329366
330/* memory handlers for shared DSP RAM (used to pass 3d parameters) */
331367
332static READ16_HANDLER( uploadhack_r )
333{ /* used for memory reads from fake adddress 0xfffffe */
334   return 0;
368/***********************************************************/
369static WRITE16_HANDLER(dspcuskey_w)
370{ /* TODO: proper cuskey emulation */
335371}
336372
337void namcos21_enabledsps( void )
373static READ16_HANDLER(dspcuskey_r)
338374{
339   master_dsp_rom[1] = 0x0100;
340   slave_dsp_rom[1] = 0x0100;
341}
342
343static READ16_HANDLER( dspram16_r )
344{
345   if( namcos21_dspram16[0] == 0x524f ) // "RO"(M)
346   { /* the check above is done so we don't interfere with the DSPRAM test */
347      namcos21_dspram16[0x100/2] = 2; /* status to fake working DSP */
348      namcos21_dspram16[0x102/2] = 2; /* status to fake working DSP */
349      namcos21_dspram16[0x110/2] = 2; /* status to fake working DSP */
350      namcos21_dspram16[0x112/2] = 0; /* status to fake working DSP */
351
352      if( namcos2_gametype == NAMCOS21_SOLVALOU )
375   UINT16 result = 0;
376   if( namcos2_gametype == NAMCOS21_SOLVALOU )
377   {
378      switch( activecpu_get_pc() )
353379      {
354         if( input_code_pressed(KEYCODE_A) ) namcos21_dspram16[0x94] = 0; // solvalou patch
380      case 0x805e: result = 0x0000; break;
381      case 0x805f: result = 0xfeba; break;
382      case 0x8067: result = 0xffff; break;
383      case 0x806e: result = 0x0145; break;
384      default:
385         printf( "unk cuskey_r; pc=0x%x\n", activecpu_get_pc() );
386         break;
355387      }
356
357      /* The DSPs provide the 68k CPUs with a list of memory chunks to copy.
358         * This is done at boot time, and doesn't appear to actually do anything
359         * important.  For now, we pass artifically constructed parameters that
360         * cause no memory copies to take place.
361         */
362      namcos21_dspram16[0x120/2] = 0xfffffe>>16;
363      namcos21_dspram16[0x122/2] = 0xfffffe&0xffff;
364      namcos21_dspram16[0x124/2] = 0xfffffe>>16;
365      namcos21_dspram16[0x126/2] = 0xfffffe&0xffff;
366
367      if( namcos21_dspram16[0x128/2] == 1 )
368      { /* ??? */
369         namcos21_dspram16[0x102/2] = 1;
370//          namcos21_dspram16[0x128/2] = 0; /* ? */
371      }
372
373      switch( offset )
388   }
389   else if( namcos2_gametype == NAMCOS21_CYBERSLED )
390   {
391      switch( activecpu_get_pc() )
374392      {
375      case 0x010a/2:
376      case 0x010c/2:
377         logerror( "crc read: %d:0x%08x\n", cpu_getactivecpu(), activecpu_get_pc() );
378         break;
393      case 0x8061: result = 0xfe95; break;
394      case 0x8069: result = 0xffff; break;
395      case 0x8070: result = 0x016A; break;
379396      default:
380397         break;
381398      }
382
383      /* The 68k CPUs perform some sort of checksum on the DSPs. The expected values are game-specific. */
384      switch( namcos2_gametype )
399   }
400   else if( namcos2_gametype == NAMCOS21_AIRCOMBAT )
401   {
402      switch( activecpu_get_pc() )
385403      {
386      case NAMCOS21_CYBERSLED:
387         namcos21_dspram16[0x10a/2] = 0x4f4b;
388         namcos21_dspram16[0x10c/2] = 0x759c;
389         break;
390
391      case NAMCOS21_STARBLADE:
392         namcos21_dspram16[0x10a/2] = 0xed53;
393         namcos21_dspram16[0x10c/2] = 0xd5df;
394         break;
395
396      case NAMCOS21_SOLVALOU:
397         namcos21_dspram16[0x10a/2] = 0x05b2;
398         namcos21_dspram16[0x10c/2] = 0x606e;
399         break;
400
401      case NAMCOS21_AIRCOMBAT:
402         break;
403
404      case 0x8062: result = 0xfeb9; break;
405      case 0x806a: result = 0xffff; break;
406      case 0x8071: result = 0x0146; break;
404407      default:
405         /* TODO: add 'checksum' values for other games */
406408         break;
407409      }
410   }
411   return result;
412}
408413
409      if( namcos21_dspram16[0x10e/2] == 0x0001 )
414static void
415TransmitWordToSlave( UINT16 data )
416{
417   unsigned offs = mpDspState->slaveInputStart+mpDspState->slaveBytesAvailable++;
418   mpDspState->slaveInputBuffer[offs%DSP_BUF_MAX] = data;
419   logerror( "+%04x(#%04x)\n", data, mpDspState->slaveBytesAvailable );
420   //printf( "+%04x(#%04x)\n", data, mpDspState->slaveBytesAvailable );
421   mpDspState->slaveActive = 1;
422   if( mpDspState->slaveBytesAvailable >= DSP_BUF_MAX )
423   {
424      printf( "IDC overflow\n" );
425      exit(1);
426   }
427} /* TransmitWordToSlave */
428
429static void
430TransferDspData( void )
431{
432   UINT16 addr = mpDspState->masterSourceAddr;
433   int mode = addr&0x8000;
434   addr&=0x7fff;
435   if( addr )
436   {
437      for(;;)
410438      {
411439         int i;
412         unsigned len;
413         static int count;
414
415         /* This signals that a large chunk of code/data has been written by the main CPU.
416             * The 68k CPU waits for this flag to be cleared.
417             */
418         logerror( "%d:0x%x upload %d\n",
419            cpu_getactivecpu(),
420            activecpu_get_pc(),
421            count++ );
422
423         namcos21_dspram16[0x10e/2] = 0; /* ack */
424
425         /* upload to master dsp */
426         len = namcos21_dspram16[0x114/2];
427         if( len )
440         UINT16 old = addr;
441         UINT16 code = namcos21_dspram16[addr++];
442         if( code == 0xffff )
428443         {
429            logerror( "upload master\n" );
430            for( i=0; i<len; i++ )
444            if( mode )
431445            {
432               master_dsp_ram[i] = namcos21_dspram16[0x2000/2+i];
446               addr = namcos21_dspram16[addr];
447               mpDspState->masterSourceAddr = addr;
448               logerror( "LOOP:0x%04x\n", addr );
449               addr&=0x7fff;
450               if( old==addr )
451               {
452                  return;
453               }
433454            }
434            master_dsp_rom[1] = 0x0100;
455            else
456            {
457               mpDspState->masterSourceAddr = 0;
458               return;
459            }
435460         }
436
437         /* upload to slave dsp(s) */
438         len = namcos21_dspram16[0x116/2];
439         if( len )
461         else if( mode==0 )
462         { /* direct data transfer */
463            logerror( "DATA TFR(0x%x)\n", code );
464            TransmitWordToSlave( code );
465            for( i=0; i<code; i++ )
466            {
467               UINT16 data = namcos21_dspram16[addr++];
468               TransmitWordToSlave( data );
469            }
470         }
471         else if( code==0x18 || code==0x1a )
440472         {
441            logerror( "upload slave\n" );
442            for( i=0; i<len; i++ )
473            logerror( "HEADER TFR(0x%x)\n", code );
474            TransmitWordToSlave( code+1 );
475            for( i=0; i<code; i++ )
443476            {
444               slave_dsp_ram[i] = namcos21_dspram16[0xa000/2+i];
477               UINT16 data = namcos21_dspram16[addr++];
478               TransmitWordToSlave( data );
445479            }
446            slave_dsp_rom[1] = 0x0100;
447480         }
481         else
482         {
483            INT32 masterAddr = ReadPointROMData(code);
484            logerror( "OBJ TFR(0x%x)\n", code );
485            {
486               UINT16 len = namcos21_dspram16[addr++];
487               for(;;)
488               {
489                  int subAddr = ReadPointROMData(masterAddr++);
490                  if( subAddr==0xffffff )
491                  {
492                     break;
493                  }
494                  else
495                  {
496                     int primWords = (UINT16)ReadPointROMData(subAddr++);
497                     if( primWords>2 )
498                     {
499                        TransmitWordToSlave( 0 ); /* pad1 */
500                        TransmitWordToSlave( len+1 );
501                        for( i=0; i<len; i++ )
502                        { /* transform */
503                           TransmitWordToSlave( namcos21_dspram16[addr+i] );
504                        }
505                        TransmitWordToSlave( 0 ); /* pad2 */
506                        TransmitWordToSlave( primWords+1 );
507                        for( i=0; i<primWords; i++ )
508                        {
509                           TransmitWordToSlave( (UINT16)ReadPointROMData(subAddr+i) );
510                        }
511                     }
512                     else
513                     {
514                        logerror( "TFR NOP?\n" );
515                     }
516                  }
517               } /* for(;;) */
518               addr+=len;
519            }
520         }
521      } /* for(;;) */
522   }
523} /* TransferDspData */
524
525static int mbNeedsKickstart;
526
527void
528namcos21_kickstart( int internal )
529{
530   if( internal )
531   {
532      if( mbNeedsKickstart==0 ) return;
533      mbNeedsKickstart--;
534      if( mbNeedsKickstart ) return;
535      printf("KICK\n" );
536   }
537   namcos21_ClearPolyFrameBuffer();
538   mpDspState->masterSourceAddr = 0;
539   mpDspState->slaveOutputSize = 0;
540   mpDspState->masterFinished = 0;
541   mpDspState->slaveActive = 0;
542   cpunum_set_input_line(4, 0, HOLD_LINE); /* DSP: master */
543   cpunum_set_input_line(5, INPUT_LINE_RESET, PULSE_LINE); /* DSP: slave */
544}
545
546static UINT16
547ReadWordFromSlaveInput( void )
548{
549   UINT16 data = 0;
550   if( mpDspState->slaveBytesAvailable>0 )
551   {
552      data = mpDspState->slaveInputBuffer[mpDspState->slaveInputStart++];
553      mpDspState->slaveInputStart %= DSP_BUF_MAX;
554      mpDspState->slaveBytesAvailable--;
555      if( mpDspState->slaveBytesAdvertised>0 )
556      {
557         mpDspState->slaveBytesAdvertised--;
448558      }
559      logerror( "-%04x(0x%04x) %x\n", data, mpDspState->slaveBytesAvailable, activecpu_get_pc() );
449560   }
561   return data;
562} /* ReadWordFromSlaveInput */
563
564static size_t
565GetInputBytesAdvertisedForSlave( void )
566{
567   if( mpDspState->slaveBytesAdvertised < mpDspState->slaveBytesAvailable )
568   {
569      mpDspState->slaveBytesAdvertised++;
570   }
571   else if( mpDspState->slaveActive && mpDspState->masterFinished && mpDspState->masterSourceAddr )
572   {
573      namcos21_kickstart(0);
574   }
575   return mpDspState->slaveBytesAdvertised;
576} /* GetInputBytesAdvertisedForSlave */
577
578static READ16_HANDLER( dspram16_r )
579{
450580   return namcos21_dspram16[offset];
451}
581} /* dspram16_r */
452582
453583static WRITE16_HANDLER( dspram16_w )
454584{
455585   COMBINE_DATA( &namcos21_dspram16[offset] );
456   if( offset == 0x103 )
586
587   if( namcos2_gametype != NAMCOS21_WINRUN91 )
457588   {
458      cpu_yield(); /* hack; synchronization for solvalou */
589      if( mpDspState->masterSourceAddr &&
590         offset == 1+(mpDspState->masterSourceAddr&0x7fff) )
591      {
592         logerror( "IDC-CONTINUE\n" );
593         TransferDspData();
594      }
595      else if( namcos2_gametype == NAMCOS21_SOLVALOU &&
596               offset == 0x103 &&
597               cpu_getactivecpu()==0 )
598      { /* hack; synchronization for solvalou */
599         cpu_yield();
600      }
459601   }
460602} /* dspram16_w */
461603
462604/************************************************************************************/
463605
464static void
606static int
465607InitDSP( void )
466608{
467   UINT16 *pMem;
468   UINT16 pc, loop;
609   UINT16 *pMem = (UINT16 *)memory_region(CPU_DSP_MASTER_REGION);
610   /**
611     * DSP BIOS tests "CPU ID" on startup
612     * "JAPAN (C)1990 NAMCO LTD. by H.F "
613     */
614   memcpy( &pMem[0xbff0], &pMem[0x0008], 0x20 );
615   pMem[0x8000] = 0xFF80;
616   pMem[0x8001] = 0x0000;
469617
618   mpDspState = auto_malloc( sizeof(*mpDspState) );
470619   memset( mpDspState, 0, sizeof(*mpDspState) );
471620
472   pMem = master_dsp_rom;
473   pc = 0;
474   pMem[pc++] = 0xff80; /* b */
475   pMem[pc++] = 0; /* 0x0100; */
476   pc = 2; /* IRQ0 */
477   pMem[pc++] = 0xCE26; /* ret */
478   pc = 4; /* IRQ1 */
479   pMem[pc++] = 0xCE26; /* ret */
480   pc = 6; /* IRQ2 */
481   pMem[pc++] = 0xCE26; /* ret */
482   pc = 0x18; /* timer IRQ */
483   pMem[pc++] = 0xCE26; /* ret */
484   pc = 0x1a; /* serial receive IRQ */
485   pMem[pc++] = 0xCE26; /* ret */
486   pc = 0x1b; /* serial send IRQ */
487   pMem[pc++] = 0xCE26; /* ret */
488   pc = 0x100;
489   pMem[pc] = 0xc804;pc++; /* ldpk 004h */
490   pMem[pc] = 0xca00;pc++; /* zac */
491   pMem[pc] = 0x6000;pc++; /* sacl $00,0 */
492   pMem[pc] = 0xca01;pc++; /* lack 01h */
493   pMem[pc] = 0x6001;pc++; /* sacl $01,0 */
494   loop = pc;
495   pMem[pc++] = 0xfe80; /* call */
496   pMem[pc++] = 0x8002;
497   pMem[pc++] = 0xff80; /* b */
498   pMem[pc++] = loop;
499
500   pMem = slave_dsp_rom;
501   pc = 0;
502   pMem[pc++] = 0xff80; /* b */
503   pMem[pc++] = 0;
504   pMem[pc++] = 0xff80; /* b */
505   pMem[pc++] = 0; /* 0x0100; */
506   pc = 2; /* IRQ0 */
507   pMem[pc++] = 0xCE26; /* ret */
508   pc = 4; /* IRQ1 */
509   pMem[pc++] = 0xCE26; /* ret */
510   pc = 6; /* IRQ2 */
511   pMem[pc++] = 0xCE26; /* ret */
512   pc = 0x18; /* timer IRQ */
513   pMem[pc++] = 0xCE26; /* ret */
514   pc = 0x1a; /* serial receive IRQ */
515   pMem[pc++] = 0xCE26; /* ret */
516   pc = 0x1b; /* serial send IRQ */
517   pMem[pc++] = 0xCE26; /* ret */
518   pc = 0x100;
519   pMem[pc] = 0xc804;pc++; /* ldpk 004h */
520   pMem[pc] = 0xca00;pc++; /* zac */
521   pMem[pc] = 0x6000;pc++; /* sacl $00,0 */
522   pMem[pc] = 0xca01;pc++; /* lack 01h */
523   pMem[pc] = 0x6001;pc++; /* sacl $01,0 */
524   loop = pc;
525   pMem[pc++] = 0xfe80; /* call */
526   pMem[pc++] = 0x8010;
527   pMem[pc++] = 0xff80; /* b */
528   pMem[pc++] = loop;
621   return 0;
529622}
530623
531624/***********************************************************/
532625
626static UINT32 pointrom_idx;
627
628static UINT8 mPointRomMSB;
629static int mbPointRomDataAvailable;
630
631static READ16_HANDLER( dsp_port0_r )
632{
633   INT32 data = ReadPointROMData(pointrom_idx++);
634   mPointRomMSB = (UINT8)(data>>16);
635   mbPointRomDataAvailable = 1;
636   return (UINT16)data;
637} /* dsp_port0_r */
638
639static WRITE16_HANDLER( dsp_port0_w )
640{ /* unused? */
641   logerror( "PTRAM_LO(0x%04x)\n", data );
642} /* dsp_port0_w */
643
533644static READ16_HANDLER( dsp_port1_r )
534{ /* PDP status */
535   return 0x8000;
536}
645{
646   if( mbPointRomDataAvailable )
647   {
648      mbPointRomDataAvailable = 0;
649      return mPointRomMSB;
650   }
651   return 0x8000; /* IDC ack? */
652} /* dsp_port1_r */
653
654static WRITE16_HANDLER( dsp_port1_w )
655{ /* unused? */
656   logerror( "PTRAM_HI(0x%04x)\n", data );
657} /* dsp_port1_w */
658
537659static READ16_HANDLER( dsp_port2_r )
538{ /* PDP kick */
660{ /* IDC TRANSMIT ENABLE? */
539661   return 0;
540}
662} /* dsp_port2_r */
541663
542664static WRITE16_HANDLER( dsp_port2_w )
543{ /* PDP addr set */
665{
666   logerror( "IDC ADDR INIT(0x%04x)\n", data );
544667   mpDspState->masterSourceAddr = data;
545   logerror( "port2_w(PDP ADDR): 0x%04x\n", data );
546}
547static READ16_HANDLER( dsp_port3_r )
548{ /* trigger; XF-related? */
549   logerror( "port3_r(PDP trigger)\n" );
668   TransferDspData();
669} /* dsp_port2_w */
670
671static READ16_HANDLER( dsp_port3_idc_rcv_enable_r )
672{ /* IDC RECEIVE ENABLE? */
550673   return 0;
551}
674} /* dsp_port3_idc_rcv_enable_r */
675
676static WRITE16_HANDLER( dsp_port3_w )
677{ /* same address space as pointram? */
678   pointrom_idx<<=16;
679   pointrom_idx|=data;
680} /* dsp_port3_w */
681
552682static WRITE16_HANDLER( dsp_port4_w )
553{ /* PDP mode */
554   logerror( "port4_w(0x%04x)\n", data );
555}
683{ /* receives $0B<<4 prior to IDC setup */
684} /* dsp_port4_w */
685
556686static READ16_HANDLER( dsp_port8_r )
557{ /* slave status? */
558   return 0x0001;
559}
687{ /* SMU status */
688   return 1;
689} /* dsp_port8_r */
690
691int namcos21_irq_enable;
692
693static WRITE16_HANDLER( dsp_port8_w )
694{ /* IRQ-enable? */
695   logerror( "port8_w(%d)\n", data );
696   if( data )
697   {
698      mpDspState->masterFinished = 1;
699   }
700   namcos21_irq_enable = data;
701} /* dsp_port8_w */
702
560703static READ16_HANDLER( dsp_port9_r )
561{ /* unk status; pre-transmit */
562   return 0x0000;
563}
704{ /* render-device-busy; used for direct-draw */
705   return 0;
706} /* dsp_port9_r */
707
708static READ16_HANDLER(dsp_porta_r)
709{ /* config */
710   return 0;
711} /* dsp_porta_r */
712
564713static WRITE16_HANDLER(dsp_porta_w)
565{ /* unk enable; 0 or 1 */
566   logerror( "porta_w(0x%04x)\n", data );
567}
714{
715   /* boot: 1 */
716   /* IRQ0 end: 0 */
717   /* INT2 begin: 1 */
718   /* direct-draw begin: 0 */
719   /* INT1 begin: 1 */
720//  logerror( "dsp_porta_w(0x%04x)\n", data );
721} /* dsp_porta_w */
722
723static READ16_HANDLER(dsp_portb_r)
724{ /* config */
725   return 1;
726} /* dsp_portb_r */
727
568728static WRITE16_HANDLER(dsp_portb_w)
569{
570   logerror( "portb_w(0x%04x)\n", data );
571   if( data!=1 )
729{ /* render-device trigger */
730   if( data==0 )
572731   { /* only 0->1 transition triggers */
573732      return;
574733   }
r1037r1038
582741         sx[i] = NAMCOS21_POLY_FRAME_WIDTH/2 + (INT16)mpDspState->masterDirectDrawBuffer[i*3+1];
583742         sy[i] = NAMCOS21_POLY_FRAME_HEIGHT/2 + (INT16)mpDspState->masterDirectDrawBuffer[i*3+2];
584743         zcode[i] = mpDspState->masterDirectDrawBuffer[i*3+3];
585         logerror( "#%d:{%4d,%4d,0x%04x},color=0x%x\n", i,sx[i],sy[i],zcode[i],color );
586744      }
587745      if( color&0x8000 )
588746      {
r1037r1038
590748      }
591749      else
592750      {
593         logerror( "indirection used w/ direct draw?\n" );
751         printf( "indirection used w/ direct draw?\n" );
594752      }
595753   }
754   else if( mpDspState->masterDirectDrawSize )
755   {
756      printf( "unexpected masterDirectDrawSize=%d!\n",mpDspState->masterDirectDrawSize );
757   }
596758   mpDspState->masterDirectDrawSize = 0;
597}
759} /* dsp_portb_w */
760
598761static WRITE16_HANDLER(dsp_portc_w)
599762{ /* enqueue data for direct-drawn poly */
600   logerror( "portc_w(0x%04x)\n", data );
601763   if( mpDspState->masterDirectDrawSize < DSP_BUF_MAX )
602764   {
603765      mpDspState->masterDirectDrawBuffer[mpDspState->masterDirectDrawSize++] = data;
604766   }
605767   else
606768   {
607      logerror( "portc overflow\n" );
769      printf( "portc overflow\n" );
608770   }
609771} /* dsp_portc_w */
610772
773static READ16_HANDLER( dsp_portf_r )
774{ /* informs BIOS that this is Master DSP */
775   return 0;
776} /* dsp_portf_r */
611777
612/***********************************************************/
613
614static UINT16 mCusKeyState;
615
616static WRITE16_HANDLER(dspcuskey_w)
778static WRITE16_HANDLER( dsp_xf_w )
617779{
618   logerror( "0x%08x:cuskey_w(%d)\n", activecpu_get_pc(), data );
619
620   if( namcos2_gametype == NAMCOS21_SOLVALOU )
621   {
622      if( data == 0x8000 )
623      {
624         mCusKeyState = 0xffff;
625      }
626      else if( data == 0x0000 )
627      {
628         mCusKeyState = 0x0145;
629      }
630   }
780   logerror("xf(%d)\n",data);
631781}
632static READ16_HANDLER(dspcuskey_r)
633{
634   UINT16 result = 0;
635782
636   if( namcos2_gametype == NAMCOS21_SOLVALOU )
637   {
638      switch( offset )
639      {
640      case 0:
641         result = mCusKeyState;
642         break;
643      case 2:
644         mCusKeyState = 0xfeba;
645         break;
646      }
647   }
648   logerror( "0x%08x:cuskey_r()==0x%04x\n", activecpu_get_pc(), result );
649   return result;
650}
651
652783static ADDRESS_MAP_START( master_dsp_program, ADDRESS_SPACE_PROGRAM, 16 )
653   AM_RANGE(0x0000, 0x01ff) AM_READ(MRA16_ROM) AM_BASE(&master_dsp_rom) /* internal ROM */
654   AM_RANGE(0x8000, 0x8fff) AM_READ(MRA16_ROM) AM_BASE(&master_dsp_ram) /* uploaded code */
784   AM_RANGE(0x0000, 0x0fff) AM_READ(MRA16_ROM) /* BIOS */
785   AM_RANGE(0x8000, 0xbfff) AM_READ(MRA16_RAM) AM_WRITE(MWA16_RAM)
655786ADDRESS_MAP_END
656787
657788static ADDRESS_MAP_START( master_dsp_data, ADDRESS_SPACE_DATA, 16 )
r1037r1038
660791ADDRESS_MAP_END
661792
662793static ADDRESS_MAP_START( master_dsp_io, ADDRESS_SPACE_IO, 16 )
663   AM_RANGE(0x01,0x01) AM_READ(dsp_port1_r)
794   AM_RANGE(0x00,0x00) AM_READ(dsp_port0_r) AM_WRITE(dsp_port0_w)
795   AM_RANGE(0x01,0x01 )AM_READ(dsp_port1_r) AM_WRITE(dsp_port1_w)
664796   AM_RANGE(0x02,0x02) AM_READ(dsp_port2_r) AM_WRITE(dsp_port2_w)
665   AM_RANGE(0x03,0x03) AM_READ(dsp_port3_r)
797   AM_RANGE(0x03,0x03) AM_READ(dsp_port3_idc_rcv_enable_r) AM_WRITE(dsp_port3_w)
666798   AM_RANGE(0x04,0x04) AM_WRITE(dsp_port4_w)
667   AM_RANGE(0x08,0x08) AM_READ(dsp_port8_r)
799   AM_RANGE(0x08,0x08) AM_READ(dsp_port8_r) AM_WRITE(dsp_port8_w)
668800   AM_RANGE(0x09,0x09) AM_READ(dsp_port9_r)
669   AM_RANGE(0x0a,0x0a) AM_WRITE(dsp_porta_w)
670   AM_RANGE(0x0b,0x0b) AM_WRITE(dsp_portb_w)
801   AM_RANGE(0x0a,0x0a) AM_READ(dsp_porta_r) AM_WRITE(dsp_porta_w)
802   AM_RANGE(0x0b,0x0b) AM_READ(dsp_portb_r) AM_WRITE(dsp_portb_w)
671803   AM_RANGE(0x0c,0x0c) AM_WRITE(dsp_portc_w)
804   AM_RANGE(0x0f,0x0f) AM_READ(dsp_portf_r)
672805   AM_RANGE(TMS32025_HOLD,  TMS32025_HOLD)  AM_READ( MRA16_NOP )
673806   AM_RANGE(TMS32025_HOLDA, TMS32025_HOLDA) AM_WRITE( MWA16_NOP )
674   AM_RANGE(TMS32025_XF,    TMS32025_XF)    AM_WRITE( MWA16_NOP )
807   AM_RANGE(TMS32025_XF,    TMS32025_XF)    AM_WRITE( dsp_xf_w )
675808ADDRESS_MAP_END
676809
677810/************************************************************************************/
678811
679812static void
680TransmitWordToSlave( UINT16 data )
681{
682   if( mpDspState->slaveInputSize < DSP_BUF_MAX )
683   {
684      mpDspState->slaveInputBuffer[mpDspState->slaveInputSize++] = data;
685   }
686   else
687   {
688      logerror( "slave input buffer overflow\n" );
689   }
690}
691
692/**
693 * On real hardware, the behavior below is almost certainly implemented
694 * in DSP bios code, triggered from timer interrupts.
695 */
696static void
697TransferDspData( void )
698{
699   if( mpDspState->masterSourceAddr >= 0x8000 &&
700      mpDspState->masterSourceAddr &&
701      mpDspState->slaveSourceAddr >= mpDspState->slaveInputSize )
702   {
703      const INT32 *pPointData = (INT32 *)memory_region( REGION_USER2 );
704      const UINT16 *pSource = &namcos21_dspram16[mpDspState->masterSourceAddr - 0x8000];
705
706      mpDspState->slaveInputSize = 0;
707      mpDspState->slaveSourceAddr = 0;
708
709      for(;;)
710      {
711         int i;
712         UINT16 code = *pSource++;
713         if( code == 0xffff )
714         {
715            UINT16 addr = *pSource++;
716            mpDspState->masterSourceAddr = addr;
717            return;
718         }
719         else if( code == 1 )
720         {
721            logerror( "PDP NOP?\n" );
722            pSource += code;
723         }
724         else if( code == 0x18 )
725         {
726            TransmitWordToSlave( code );
727            for( i=0; i<code; i++ )
728            {
729               TransmitWordToSlave( pSource[i] );
730            }
731            pSource += code;
732         }
733         else
734         {
735            UINT16 len = *pSource++;
736            INT32 masterAddr = pPointData[code];
737            for(;;)
738            {
739               INT32 subAddr = pPointData[masterAddr++];
740               if( subAddr==0xffffff )
741               {
742                  break;
743               }
744               else
745               {
746                  int primWords = (UINT16)(pPointData[subAddr++]);
747                  TransmitWordToSlave( len );
748
749                  for( i=0; i<len; i++ )
750                  {
751                     TransmitWordToSlave( pSource[i] );
752                  }
753
754                  TransmitWordToSlave( primWords );
755                  for( i=0; i<primWords; i++ )
756                  {
757                     TransmitWordToSlave( (UINT16)pPointData[subAddr+i] );
758                  }
759               }
760            } /* for(;;) */
761            pSource += len;
762         } /* if( code ... ) */
763      } /* for(;;) */
764   }
765} /* TransferDspData */
766
767static const INT32 *
768FindPrimitiveDataBySurfaceID( int surfID )
769{
770   const INT32 *pPointData = (INT32 *)memory_region( REGION_USER2 );
771   INT32 last = pPointData[0];
772   int i;
773   for( i=1; i<last; i++ )
774   {
775      INT32 masterAddr = pPointData[i];
776      for(;;)
777      {
778         INT32 subAddr = pPointData[masterAddr++];
779         if( subAddr == 0xffffff )
780         {
781            break;
782         }
783         else
784         {
785            UINT16 len = pPointData[subAddr+0];
786            if( len>2 )
787            {
788               int id = pPointData[subAddr+1];
789               UINT16 vertexCount = pPointData[subAddr+2];
790               if( id == surfID )
791               {
792                  unsigned offs = subAddr + 4 + vertexCount*3;
793                  return &pPointData[offs];
794               }
795            }
796         }
797      }
798   }
799   return NULL;
800} /* FindPrimitiveDataBySurfaceID */
801
802static void
803813RenderSlaveOutput( UINT16 data )
804814{
805815   if( mpDspState->slaveOutputSize >= 4096 )
806816   {
807      logerror( "FATAL ERROR: SLAVE OVERFLOW\n" );
817      printf( "FATAL ERROR: SLAVE OVERFLOW (0x%x)\n",mpDspState->slaveOutputBuffer[0]  );
818      exit(1);
808819      return;
809820   }
821
822   /* append word to slave output buffer */
810823   mpDspState->slaveOutputBuffer[mpDspState->slaveOutputSize++] = data;
811   if(1)
824
812825   {
813826      UINT16 *pSource = mpDspState->slaveOutputBuffer;
814827      UINT16 count = *pSource++;
815828      if( count && mpDspState->slaveOutputSize > count )
816829      {
817         UINT16 surfaceID = *pSource++;
818         UINT16 *pVertexList = pSource;
830         UINT16 color = *pSource++;
819831         int sx[4], sy[4],zcode[4];
820832         int j;
821         if( surfaceID&0x8000 )
833         if( color&0x8000 )
822834         {
835            if( count!=13 ) printf( "?!direct-draw(%d)\n", count );
823836            for( j=0; j<4; j++ )
824837            {
825               sx[j] = NAMCOS21_POLY_FRAME_WIDTH/2 + (INT16)pVertexList[3*j+0];
826               sy[j] = NAMCOS21_POLY_FRAME_HEIGHT/2 + (INT16)pVertexList[3*j+1];
827               zcode[j] = pVertexList[3*j+3];
838               sx[j] = NAMCOS21_POLY_FRAME_WIDTH/2 + (INT16)pSource[3*j+0];
839               sy[j] = NAMCOS21_POLY_FRAME_HEIGHT/2 + (INT16)pSource[3*j+1];
840               zcode[j] = pSource[3*j+2];
828841            }
829            namcos21_DrawQuad( sx, sy, zcode, surfaceID&0x7fff );
842            namcos21_DrawQuad( sx, sy, zcode, color&0x7fff );
830843         }
831         else if( surfaceID )
844         else
832845         {
833            const INT32 *pSurf = FindPrimitiveDataBySurfaceID( surfaceID );
834            if( pSurf )
846            int quad_idx = color*6;
847            for(;;)
835848            {
836               UINT16 surfCount = *pSurf++;
837               while( surfCount-- )
849               UINT8 code = pointram[quad_idx++];
850               color = pointram[quad_idx++]|(code<<8);
851               for( j=0; j<4; j++ )
838852               {
839                  UINT16 color;
840                  for( j=0; j<4; j++ )
841                  {
842                     UINT16 vi = *pSurf++;
843                     sx[j] = NAMCOS21_POLY_FRAME_WIDTH/2  + (INT16)pVertexList[3*vi+0];
844                     sy[j] = NAMCOS21_POLY_FRAME_HEIGHT/2 + (INT16)pVertexList[3*vi+1];
845                     zcode[j] = pVertexList[3*vi+2];
846                  }
847                  color = *pSurf++;
848                  namcos21_DrawQuad( sx, sy, zcode, color );
849               } /* while( surfCount) */
850            } /* if( pSurf ) */
851         } /* if( surfaceID ) */
853                  UINT8 vi = pointram[quad_idx++];
854                  sx[j] = NAMCOS21_POLY_FRAME_WIDTH/2  + (INT16)pSource[vi*3+0];
855                  sy[j] = NAMCOS21_POLY_FRAME_HEIGHT/2 + (INT16)pSource[vi*3+1];
856                  zcode[j] = pSource[vi*3+2];
857               }
858               namcos21_DrawQuad( sx, sy, zcode, color&0x7fff );
859               if( code&0x80 )
860               { /* end-of-quadlist marker */
861                  break;
862               }
863            }
864         }
852865         mpDspState->slaveOutputSize = 0;
853866      }
867      else if( count==0 )
868      {
869         printf( "RenderSlaveOutput\n" );
870         exit(1);
871      }
854872   }
855873} /* RenderSlaveOutput */
856874
857static size_t
858GetInputBytesAvailableForSlave( void )
875static READ16_HANDLER(slave_port0_r)
859876{
860   return mpDspState->slaveInputSize - mpDspState->slaveSourceAddr;
861} /* GetInputBytesAvailableForSlave */
877   return ReadWordFromSlaveInput();
878} /* slave_port0_r */
862879
880static WRITE16_HANDLER(slave_port0_w)
881{
882   RenderSlaveOutput( data );
883}
884
863885static READ16_HANDLER(slave_port2_r)
864886{
865   UINT16 result;
866   TransferDspData();
867   result = GetInputBytesAvailableForSlave();
868   if( result )
869   {
870      logerror( "%x : slave port2_r : 0x%04x\n", activecpu_get_pc(), result );
871   }
872   return result;
887   return GetInputBytesAdvertisedForSlave();
873888} /* slave_port2_r */
874889
875static READ16_HANDLER(slave_port0_r)
876{ /* read data */
877   UINT16 result;
878   TransferDspData();
879   if( GetInputBytesAvailableForSlave()>0 )
880   { /* data is available */
881      result = mpDspState->slaveInputBuffer[mpDspState->slaveSourceAddr++];
882   }
883   else
884   {
885      result =0;
886   }
887   logerror( "%x : slave port0_r : 0x%04x\n", activecpu_get_pc(), result );
888   return result;
889} /* slave_port0_r */
890
891890static READ16_HANDLER(slave_port3_r)
892{ /* number of bytes in output buffer (slave blocks if too large) */
893   UINT16 result = 0;
894   return result;
891{ /* render-device queue size */
892   /* up to 0x1fe bytes?
893     * slave blocks until free space exists
894     */
895   return 0;
895896}
896897
897static WRITE16_HANDLER(slave_port0_w)
898{
899   logerror( "%x : slave port0_w : 0x%04x\n", activecpu_get_pc(), data );
900   RenderSlaveOutput( data );
901}
902
903898static WRITE16_HANDLER(slave_port3_w)
904{ /* ack? */
905   logerror( "%x : slave port3_w : 0x%04x\n", activecpu_get_pc(), data );
899{ /* 0=busy, 1=ready? */
906900} /* slave_port3_w */
907901
908902static WRITE16_HANDLER( slave_XF_output_w )
909903{
910   /* Trigger update of framebuffer and reset slave/master.
911     * This is probably NOT how real hardware works.
912     */
913   if( data==0 )
914   {
915      UpdatePolyFrameBufferAndResetDSPs();
916   }
904   logerror( "0x%x:slaveXF(%d)\n", activecpu_get_pc(), data );
917905} /* slave_XF_output_w */
918906
907static READ16_HANDLER( slave_portf_r )
908{ /* informs BIOS that this is Slave DSP */
909   return 1;
910}
911
919912static ADDRESS_MAP_START( slave_dsp_program, ADDRESS_SPACE_PROGRAM, 16 )
920   AM_RANGE(0x0000, 0x01ff) AM_READ(MRA16_ROM) AM_BASE(&slave_dsp_rom) /* internal ROM */
921   AM_RANGE(0x8000, 0x8fff) AM_READ(MRA16_ROM) AM_BASE(&slave_dsp_ram) /* uploaded code */
913   AM_RANGE(0x0000, 0x0fff) AM_READ(MRA16_ROM) /* BIOS */
914   AM_RANGE(0x8000, 0x8fff) AM_READ(MRA16_RAM) AM_WRITE(MWA16_RAM)
922915ADDRESS_MAP_END
923916
924917static ADDRESS_MAP_START( slave_dsp_data, ADDRESS_SPACE_DATA, 16 )
918   /* no external data memory */
925919ADDRESS_MAP_END
926920
927921static ADDRESS_MAP_START( slave_dsp_io, ADDRESS_SPACE_IO, 16 )
928922   AM_RANGE(0x00,0x00) AM_READ(slave_port0_r) AM_WRITE(slave_port0_w)
929923   AM_RANGE(0x02,0x02) AM_READ(slave_port2_r)
930924   AM_RANGE(0x03,0x03) AM_READ(slave_port3_r) AM_WRITE(slave_port3_w)
925   AM_RANGE(0x0f,0x0f) AM_READ(slave_portf_r)
931926   AM_RANGE(TMS32025_HOLD,  TMS32025_HOLD)  AM_READ(MRA16_NOP)
932927   AM_RANGE(TMS32025_HOLDA, TMS32025_HOLDA) AM_WRITE(MWA16_NOP)
933928   AM_RANGE(TMS32025_XF,    TMS32025_XF)    AM_WRITE(slave_XF_output_w)
r1037r1038
935930
936931/************************************************************************************/
937932
938static WRITE16_HANDLER( namcos21_dsp_control_w )
939{ /* serial output; used to pump bits and possibly to trigger IRQs on master DSP */
940   static int code;
941   static int prev;
942   int cur;
943   COMBINE_DATA( &namcos21_dsp_control[offset] );
944   cur = namcos21_dsp_control[offset];
945   if( (prev^cur)&4 )
933/**
934 * 801f->800f : prepare for master access to point ram
935 * 801f       : done
936 *
937 * #bits  data  line
938 *   8     1a0    4
939 *   7     0f8    4
940 *   7     0ff    4
941 *   1     001    4
942 *   7     00a    2
943 *   a     0fe    8
944 *
945 * line   #bits  data
946 * 0003   000A   000004FE
947 * 0001   0007   0000000A
948 * 0002   001A   03FFF1A0
949 */
950static WRITE16_HANDLER( pointram_control_w )
951{
952//  UINT16 prev = pointram_control;
953   COMBINE_DATA( &pointram_control );
954
955   /* pointram_control&0x20 : bank for depthcue data */
956/*
957    logerror( "dsp_control_w:%x:%x[%x]:=%04x ",
958            cpu_getactivecpu(),
959            activecpu_get_pc(),
960            offset,
961            pointram_control );
962
963    UINT16 delta = (prev^pointram_control)&pointram_control;
964    if( delta&0x10 )
965    {
966        logerror( " [reset]" );
967    }
968    if( delta&2 )
969    {
970        logerror( " send(A)%x", pointram_control&1 );
971    }
972    if( delta&4 )
973    {
974        logerror( " send(B)%x", pointram_control&1 );
975    }
976    if( delta&8 )
977    {
978        logerror( " send(C)%x", pointram_control&1 );
979    }
980    logerror( "\n" );
981*/
982   pointram_idx = 0; /* HACK */
983} /* pointram_control_w */
984
985static READ16_HANDLER( pointram_data_r )
986{
987   return pointram[pointram_idx];
988} /* pointram_data_r */
989
990static WRITE16_HANDLER( pointram_data_w )
991{
992   if( ACCESSING_LSB )
946993   {
947      code<<=1;
948      code |= cur&1;
949      code &= 0x1ff;
994//      if( (pointram_idx%6)==0 ) logerror("\n" );
995//      logerror( " %02x", data );
996      pointram[pointram_idx++] = data;
997      pointram_idx &= (PTRAM_SIZE-1);
950998   }
951}
999} /* pointram_data_w */
9521000
953static READ16_HANDLER( namcos21_dsp_control_r )
954{
955/*  logerror( "dsp control_r%x:%x[%x]==%04x\n",
956        cpu_getactivecpu(),
957        activecpu_get_pc(),
958        offset,
959        namcos21_dsp_control[offset] ); */
960   return namcos21_dsp_control[offset];
961}
1001static UINT8 namcos21_depthcue[2][0x400]; /* 0x800 nybbles */
9621002
963#define PTRAM_SIZE 0x20000
964static UINT8 *ptram;
965static UINT32 ptram_addr;
966
967static WRITE16_HANDLER( namcos21_dsp_data_w )
1003static READ16_HANDLER( namcos21_depthcue_r )
9681004{
969   ptram[ptram_addr++] = data;
970   ptram_addr &= (PTRAM_SIZE-1);
1005   int bank = (pointram_control&0x20)?1:0;
1006   return namcos21_depthcue[bank][offset];
9711007}
972
973static READ16_HANDLER( namcos21_dsp_data_r )
1008static WRITE16_HANDLER( namcos21_depthcue_w )
9741009{
975/*  logerror( "dsp data_r%x:%x[%x]==%04x\n",
976        cpu_getactivecpu(),
977        activecpu_get_pc(),
978        offset,
979        ptram[ptram_addr] ); */
980   return ptram[ptram_addr];
1010   if( ACCESSING_LSB )
1011   {
1012      int bank = (pointram_control&0x20)?1:0;
1013      namcos21_depthcue[bank][offset] = data;
1014//      if( (offset&0xf)==0 ) logerror( "\n depthcue: " );
1015//      logerror( " %02x", data );
1016   }
9811017}
9821018
9831019/* dual port ram memory handlers */
r1037r1038
10191055
10201056/* some games have read-only areas where more ROMs are mapped */
10211057
1022static READ16_HANDLER( data_r )
1058static READ16_HANDLER( datarom_r )
10231059{
10241060   return mpDataROM[offset];
10251061}
r1037r1038
10491085static READ16_HANDLER( NAMCO_C139_SCI_register_r ){ return 0; }
10501086/******************************************************************************/
10511087
1052static WRITE16_HANDLER( unk_48000X_w )
1053{
1054   /* 0x400 bytes - gamma table? */
1055}
1056static UINT16 namcos21_unk_reg;
1057WRITE16_HANDLER( namcos21_unk_reg_w )
1058{
1059   /* 0x40 or 0x00 */
1060   COMBINE_DATA( &namcos21_unk_reg );
1061}
1062static READ16_HANDLER( namcos21_unk_reg_r )
1063{
1064   /* 0x40 or 0x00 */
1065   return namcos21_unk_reg;
1066}
1067
10681088/*************************************************************/
10691089/* MASTER 68000 CPU Memory declarations                      */
10701090/*************************************************************/
10711091static ADDRESS_MAP_START( namcos21_68k_master, ADDRESS_SPACE_PROGRAM, 16 )
10721092   AM_RANGE(0x000000, 0x0fffff) AM_READ(MRA16_ROM) AM_WRITE(MWA16_ROM)
10731093   AM_RANGE(0x100000, 0x10ffff) AM_READ(MRA16_RAM) AM_WRITE(MWA16_RAM) /* private work RAM */
1074   AM_RANGE(0x180000, 0x183fff) AM_READ(NAMCOS2_68K_EEPROM_R) AM_WRITE(NAMCOS2_68K_EEPROM_W) AM_BASE(&namcos2_eeprom) AM_SIZE(&namcos2_eeprom_size)
1094   AM_RANGE(0x180000, 0x183fff) AM_READ(NAMCOS2_68K_EEPROM_R) AM_WRITE(NAMCOS2_68K_EEPROM_W)// AM_BASE(&namcos2_eeprom) AM_SIZE(&namcos2_eeprom_size)
10751095   AM_RANGE(0x1c0000, 0x1fffff) AM_READ(namcos2_68k_master_C148_r) AM_WRITE(namcos2_68k_master_C148_w)
10761096ADDRESS_MAP_END
10771097
10781098static ADDRESS_MAP_START( namcos21_68k_slave, ADDRESS_SPACE_PROGRAM, 16 )
1079   AM_RANGE(0x000000, 0x0fffff) AM_READ(MRA16_ROM) AM_WRITE(MWA16_ROM)
1099   AM_RANGE(0x000000, 0x07ffff) AM_READ(MRA16_ROM) AM_WRITE(MWA16_ROM)
10801100   AM_RANGE(0x100000, 0x13ffff) AM_READ(MRA16_RAM) AM_WRITE(MWA16_RAM) /* private work RAM */
10811101   AM_RANGE(0x1c0000, 0x1fffff) AM_READ(namcos2_68k_slave_C148_r) AM_WRITE(namcos2_68k_slave_C148_w)
10821102ADDRESS_MAP_END
r1037r1038
10841104static ADDRESS_MAP_START( namcos21_68k_common, ADDRESS_SPACE_PROGRAM, 16 )
10851105   AM_RANGE(0x200000, 0x20ffff) AM_READ(dspram16_r) AM_WRITE(dspram16_w) AM_BASE(&namcos21_dspram16)
10861106   AM_RANGE(0x280000, 0x280001) AM_WRITE(MWA16_NOP) /* written once on startup */
1087   AM_RANGE(0x400000, 0x400001) AM_READ(namcos21_dsp_control_r) AM_WRITE(namcos21_dsp_control_w)
1088   AM_RANGE(0x440000, 0x440001) AM_READ(namcos21_dsp_data_r) AM_WRITE(namcos21_dsp_data_w)
1089//  AM_RANGE(0x440002, 0x44ffff) AM_WRITE(MWA16_NOP) /* (?) aircombj */
1090//  AM_RANGE(0x480000, 0x4807ff) AM_WRITE(unk_48000X_w)
1107   AM_RANGE(0x400000, 0x400001) AM_WRITE(pointram_control_w)
1108   AM_RANGE(0x440000, 0x440001) AM_READ(pointram_data_r) AM_WRITE(pointram_data_w)
1109   AM_RANGE(0x440002, 0x47ffff) AM_WRITE(MWA16_NOP) /* (?) Air Combat */
1110   AM_RANGE(0x480000, 0x4807ff) AM_WRITE(namcos21_depthcue_w) AM_READ(namcos21_depthcue_r) /* Air Combat */
10911111   AM_RANGE(0x700000, 0x71ffff) AM_READ(namco_obj16_r) AM_WRITE(namco_obj16_w)
10921112   AM_RANGE(0x720000, 0x720007) AM_READ(namco_spritepos16_r) AM_WRITE(namco_spritepos16_w)
10931113   AM_RANGE(0x740000, 0x75ffff) AM_READ(paletteram16_r ) AM_WRITE(paletteram16_w) AM_BASE(&paletteram16)
1094   AM_RANGE(0x760000, 0x760001) AM_READ(namcos21_unk_reg_r) AM_WRITE(namcos21_unk_reg_w)
1095   AM_RANGE(0x800000, 0x8fffff) AM_READ(data_r)
1114   AM_RANGE(0x760000, 0x760001) AM_READ(namcos21_video_enable_r) AM_WRITE(namcos21_video_enable_w)
1115   AM_RANGE(0x800000, 0x8fffff) AM_READ(datarom_r)
10961116   AM_RANGE(0x900000, 0x90ffff) AM_READ(shareram1_r) AM_WRITE(shareram1_w) AM_BASE(&mpSharedRAM1)
10971117   AM_RANGE(0xa00000, 0xa00fff) AM_READ(namcos2_68k_dualportram_word_r) AM_WRITE(namcos2_68k_dualportram_word_w)
10981118   AM_RANGE(0xb00000, 0xb03fff) AM_READ(NAMCO_C139_SCI_buffer_r) AM_WRITE(NAMCO_C139_SCI_buffer_w)
10991119   AM_RANGE(0xb80000, 0xb8000f) AM_READ(NAMCO_C139_SCI_register_r) AM_WRITE(NAMCO_C139_SCI_register_w)
11001120   AM_RANGE(0xc00000, 0xcfffff) AM_READ(data2_r) /* Cyber Sled */
11011121   AM_RANGE(0xd00000, 0xdfffff) AM_READ(data2_r)
1102   AM_RANGE(0xfffffe, 0xffffff) AM_READ(uploadhack_r)
11031122ADDRESS_MAP_END
11041123
11051124/*************************************************************
1106 * Winning Run is prototype "System21" hardware that shares
1107 * very little with the final design.
1125 * Winning Run is prototype "System21" hardware.
11081126 *************************************************************/
1127static READ16_HANDLER( winrun_dspcomram_r )
1128{
1129   int bank = 1-(winrun_dspcomram_control[0x4/2]&1);
1130   UINT16 *mem = &winrun_dspcomram[0x1000*bank];
1131   return mem[offset];
1132}
1133static WRITE16_HANDLER( winrun_dspcomram_w )
1134{
1135   int bank = 1-(winrun_dspcomram_control[0x4/2]&1);
1136   UINT16 *mem = &winrun_dspcomram[0x1000*bank];
1137   COMBINE_DATA( &mem[offset] );
1138}
11091139
1110/* TBA: add support for more than two CPUs to C148 emulation */
1111static UINT16 gpu_vblank_irq_level;
1112
1113static READ16_HANDLER( gpu_c148_r )
1140static READ16_HANDLER( winrun_cuskey_r )
11141141{
1115   offs_t addr = ((offset*2)+0x1c0000)&0x1fe000;
1116   switch( addr )
1142   int pc = activecpu_get_pc();
1143   switch( pc )
11171144   {
1145   case 0x0064: /* winrun91 */
1146      return 0xFEBB;
1147   case 0x006c: /* winrun91 */
1148      return 0xFFFF;
1149   case 0x0073: /* winrun91 */
1150      return 0x0144;
1151
1152   case 0x0075: /* winrun */
1153      return 0x24;
1154
11181155   default:
11191156      break;
11201157   }
11211158   return 0;
1159} /* winrun_cuskey_r */
1160
1161static WRITE16_HANDLER( winrun_cuskey_w )
1162{
1163} /* winrun_cuskey_w */
1164
1165static void
1166winrun_flushpoly( void )
1167{
1168   if( winrun_poly_index>0 )
1169   {
1170      const UINT16 *pSource = winrun_poly_buf;
1171      UINT16 color;
1172      int sx[4], sy[4], zcode[4];
1173      int j;
1174      color = *pSource++;
1175      if( color&0x8000 )
1176      { /* direct-draw */
1177         for( j=0; j<4; j++ )
1178         {
1179            sx[j] = NAMCOS21_POLY_FRAME_WIDTH/2  + (INT16)*pSource++;
1180            sy[j] = NAMCOS21_POLY_FRAME_HEIGHT/2 + (INT16)*pSource++;
1181            zcode[j] = *pSource++;
1182         }
1183         namcos21_DrawQuad( sx, sy, zcode, color&0x7fff );
1184      }
1185      else
1186      {
1187         int quad_idx = color*6;
1188         for(;;)
1189         {
1190            UINT8 code = pointram[quad_idx++];
1191            color = pointram[quad_idx++];
1192            for( j=0; j<4; j++ )
1193            {
1194               UINT8 vi = pointram[quad_idx++];
1195               sx[j] = NAMCOS21_POLY_FRAME_WIDTH/2  + (INT16)pSource[vi*3+0];
1196               sy[j] = NAMCOS21_POLY_FRAME_HEIGHT/2 + (INT16)pSource[vi*3+1];
1197               zcode[j] = pSource[vi*3+2];
1198            }
1199            namcos21_DrawQuad( sx, sy, zcode, color&0x7fff );
1200            if( code&0x80 )
1201            { /* end-of-quadlist marker */
1202               break;
1203            }
1204         }
1205      }
1206      winrun_poly_index = 0;
1207   }
1208} /* winrun_flushpoly */
1209
1210static READ16_HANDLER( winrun_poly_reset_r )
1211{
1212   winrun_flushpoly();
1213   return 0;
11221214}
11231215
1124static WRITE16_HANDLER( gpu_c148_w )
1216static WRITE16_HANDLER( winrun_dsp_render_w )
11251217{
1126   offs_t addr = ((offset*2)+0x1c0000)&0x1fe000;
1127   switch( addr )
1218   if( winrun_poly_index<WINRUN_MAX_POLY_PARAM )
11281219   {
1129   case 0x1ca000:
1130      /* NAMCOS2_C148_POSIRQ level?*/
1131      break;
1220      winrun_poly_buf[winrun_poly_index++] = data;
1221   }
1222   else
1223   {
1224      printf( "WINRUN_POLY_OVERFLOW\n" );
1225   }
1226} /* winrun_dsp_render_w */
11321227
1133   case 0x1ce000:
1134      COMBINE_DATA( &gpu_vblank_irq_level );
1135      break;
1228static WRITE16_HANDLER( winrun_dsp_pointrom_addr_w )
1229{
1230   if( offset==0 )
1231   { /* port 8 */
1232      winrun_pointrom_addr = data;
1233   }
1234   else
1235   { /* port 9 */
1236      winrun_pointrom_addr |= (data<<16);
1237   }
1238}
11361239
1137   case 0x1e2000:
1138      break;
1240static READ16_HANDLER( winrun_dsp_pointrom_data_r )
1241{
1242   UINT16 *ptrom = (UINT16 *)memory_region(REGION_USER2);
1243   return ptrom[winrun_pointrom_addr++];
1244} /* winrun_dsp_pointrom_data_r */
11391245
1140   default:
1141      break;
1246static WRITE16_HANDLER( winrun_dsp_complete_w )
1247{
1248   if( data )
1249   {
1250      winrun_flushpoly();
1251      cpunum_set_input_line(4, INPUT_LINE_RESET, PULSE_LINE);
1252      namcos21_ClearPolyFrameBuffer();
11421253   }
11431254}
11441255
1145static INTERRUPT_GEN( namcos2_gpu_vblank )
1256static READ16_HANDLER( winrun_table_r )
11461257{
1147   cpunum_set_input_line(CPU_GPU, gpu_vblank_irq_level, HOLD_LINE);
1258   return winrun_polydata[offset];
11481259}
11491260
1261static ADDRESS_MAP_START( winrun_dsp_program, ADDRESS_SPACE_PROGRAM, 16 )
1262   AM_RANGE(0x0000, 0x0fff) AM_READ(MRA16_ROM)
1263ADDRESS_MAP_END
1264
1265static ADDRESS_MAP_START( winrun_dsp_data, ADDRESS_SPACE_DATA, 16 )
1266   AM_RANGE( 0x2000, 0x200f ) AM_READ(winrun_cuskey_r) AM_WRITE(winrun_cuskey_w)
1267   AM_RANGE( 0x4000, 0x4fff ) AM_READ(winrun_dspcomram_r) AM_WRITE(winrun_dspcomram_w)
1268   AM_RANGE( 0x8000, 0xffff ) AM_READ(winrun_table_r )
1269ADDRESS_MAP_END
1270
1271static ADDRESS_MAP_START( winrun_dsp_io, ADDRESS_SPACE_IO, 16 )
1272   AM_RANGE(0x08,0x09) AM_WRITE(winrun_dsp_pointrom_addr_w) AM_READ(winrun_dsp_pointrom_data_r)
1273   AM_RANGE(0x0a,0x0a) AM_WRITE(winrun_dsp_render_w)
1274   AM_RANGE(0x0b,0x0b) AM_WRITE(MWA16_NOP)
1275   AM_RANGE(0x0c,0x0c) AM_WRITE(winrun_dsp_complete_w)
1276   AM_RANGE(TMS32025_BIO,   TMS32025_BIO)   AM_READ( winrun_poly_reset_r )
1277   AM_RANGE(TMS32025_HOLD,  TMS32025_HOLD)  AM_READ( MRA16_NOP )
1278   AM_RANGE(TMS32025_HOLDA, TMS32025_HOLDA) AM_WRITE( MWA16_NOP )
1279   AM_RANGE(TMS32025_XF,    TMS32025_XF)    AM_WRITE( MWA16_NOP )
1280ADDRESS_MAP_END
1281
11501282static READ16_HANDLER( gpu_data_r )
11511283{
11521284   const UINT16 *pSrc = (UINT16 *)memory_region( REGION_USER3 );
11531285   return pSrc[offset];
11541286}
11551287
1156static ADDRESS_MAP_START( readmem_gpu_winrun, ADDRESS_SPACE_PROGRAM, 16 )
1157   AM_RANGE(0x000000, 0x07ffff) AM_READ(MRA16_ROM)
1158   AM_RANGE(0x100000, 0x100001) AM_READ(MRA16_RAM) /* shareram? */
1159   AM_RANGE(0x180000, 0x19ffff) AM_READ(MRA16_RAM) /* private work RAM */
1160   AM_RANGE(0x1c0000, 0x1fffff) AM_READ(gpu_c148_r)
1161   AM_RANGE(0x200000, 0x20ffff) AM_READ(MRA16_RAM)
1162   AM_RANGE(00400000, 0x40ffff) AM_READ(MRA16_RAM)
1163   AM_RANGE(0x410000, 0x41ffff) AM_READ(MRA16_RAM)
1164   AM_RANGE(0x600000, 0x6fffff) AM_READ(gpu_data_r)
1165   AM_RANGE(0xc00000, 0xcfffff) AM_READ(MRA16_RAM) /* frame buffer */
1166   AM_RANGE(0xd00000, 0xd0000f) AM_READ(MRA16_RAM) /* ? */
1167ADDRESS_MAP_END
1288static READ16_HANDLER( winrun_gpucomram_r )
1289{
1290   return winrun_gpucomram[offset];
1291}
1292static WRITE16_HANDLER( winrun_gpucomram_w )
1293{
1294   COMBINE_DATA( &winrun_gpucomram[offset] );
1295}
11681296
1169static ADDRESS_MAP_START( writemem_gpu_winrun, ADDRESS_SPACE_PROGRAM, 16 )
1170   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(MWA16_ROM)
1171   AM_RANGE(0x100000, 0x100001) AM_WRITE(MWA16_RAM) /* shareram? */
1172   AM_RANGE(0x180000, 0x19ffff) AM_WRITE(MWA16_RAM) /* private work RAM */
1173   AM_RANGE(0x1c0000, 0x1fffff) AM_WRITE(gpu_c148_w)
1174   AM_RANGE(0x200000, 0x20ffff) AM_WRITE(MWA16_RAM) AM_BASE(&namcos21_dspram16)
1175   AM_RANGE(00400000, 0x40ffff) AM_WRITE(MWA16_RAM)
1176   AM_RANGE(0x410000, 0x41ffff) AM_WRITE(MWA16_RAM)
1177   AM_RANGE(0xc00000, 0xcfffff) AM_WRITE(MWA16_RAM) AM_BASE(&videoram16)
1178   AM_RANGE(0xd00000, 0xd0000f) AM_WRITE(MWA16_RAM) /* ? */
1179   AM_RANGE(0xe0000c, 0xe0000d) AM_WRITE(MWA16_NOP) /* ? */
1180ADDRESS_MAP_END
1297static WRITE16_HANDLER( winrun_dspbios_w )
1298{
1299   COMBINE_DATA( &winrun_dspbios[offset] );
1300   if( offset==0xfff )
1301   {
1302      UINT16 *mem = (UINT16 *)memory_region(REGION_CPU5);
1303      memcpy( mem, winrun_dspbios, 0x2000 );
1304      winrun_dsp_alive = 1;
1305   }
1306} /* winrun_dspbios_w */
11811307
1182static ADDRESS_MAP_START( readmem_master_winrun, ADDRESS_SPACE_PROGRAM, 16 )
1183   AM_RANGE(0x000000, 0x03ffff) AM_READ(MRA16_ROM)
1184   AM_RANGE(0x100000, 0x10ffff) AM_READ(MRA16_RAM) /* private work RAM */
1185   AM_RANGE(0x180000, 0x183fff) AM_READ(NAMCOS2_68K_EEPROM_R)
1186   AM_RANGE(0x1c0000, 0x1fffff) AM_READ(namcos2_68k_master_C148_r)
1187   AM_RANGE(0x250000, 0x25ffff) AM_READ(MRA16_RAM) // sinetable?
1188   AM_RANGE(0x280000, 0x281fff) AM_READ(dspram16_r)
1189   AM_RANGE(0x380000, 0x38000f) AM_READ(MRA16_RAM)
1190   AM_RANGE(0x3c0000, 0x3c0fff) AM_READ(MRA16_RAM)
1191   AM_RANGE(0x400000, 0x400001) AM_READ(namcos21_dsp_control_r)
1192   AM_RANGE(0x440000, 0x440001) AM_READ(namcos21_dsp_data_r)
1193   AM_RANGE(0x600000, 0x600fff) AM_READ(MRA16_RAM)
1194   AM_RANGE(0x700000, 0x700001) AM_READ(MRA16_RAM)
1195   AM_RANGE(0x800000, 0x87ffff) AM_READ(data_r)
1196   AM_RANGE(0x900000, 0x90ffff) AM_READ(shareram1_r)
1197   AM_RANGE(0xa00000, 0xa00fff) AM_READ(namcos2_68k_dualportram_word_r)
1198   AM_RANGE(0xb00000, 0xb03fff) AM_READ(NAMCO_C139_SCI_buffer_r)
1199   AM_RANGE(0xb80000, 0xb8000f) AM_READ(NAMCO_C139_SCI_register_r)
1200ADDRESS_MAP_END
1308//380000 : read : dsp status? 1 = busy
1309//380000 : write(0x01) - done before dsp comram init
1310//380004 : dspcomram bank, as seen by 68k
1311//380008 : read : state?
12011312
1202static ADDRESS_MAP_START( writemem_master_winrun, ADDRESS_SPACE_PROGRAM, 16 )
1203   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(MWA16_ROM)
1204   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(MWA16_RAM) /* private work RAM */
1205   AM_RANGE(0x180000, 0x183fff) AM_WRITE(NAMCOS2_68K_EEPROM_W) AM_BASE(&namcos2_eeprom) AM_SIZE(&namcos2_eeprom_size)
1206   AM_RANGE(0x1c0000, 0x1fffff) AM_WRITE(namcos2_68k_master_C148_w)
1207   AM_RANGE(0x250000, 0x25ffff) AM_WRITE(MWA16_RAM)
1208   AM_RANGE(0x280000, 0x281fff) AM_WRITE(dspram16_w)
1209   AM_RANGE(0x380000, 0x38000f) AM_WRITE(MWA16_RAM)
1210   AM_RANGE(0x3c0000, 0x3c0fff) AM_WRITE(MWA16_RAM)
1211   AM_RANGE(0x400000, 0x400001) AM_WRITE(namcos21_dsp_control_w)
1212   AM_RANGE(0x440000, 0x440001) AM_WRITE(namcos21_dsp_data_w)
1213//  AM_RANGE(0x600000, 0x600fff) AM_WRITE(MWA16_RAM)
1214   AM_RANGE(0x700000, 0x700001) AM_WRITE(MWA16_RAM)
1215   AM_RANGE(0x900000, 0x90ffff) AM_WRITE(shareram1_w) AM_BASE(&mpSharedRAM1)
1216   AM_RANGE(0xa00000, 0xa00fff) AM_WRITE(namcos2_68k_dualportram_word_w)
1217   AM_RANGE(0xb00000, 0xb03fff) AM_WRITE(NAMCO_C139_SCI_buffer_w)
1218   AM_RANGE(0xb80000, 0xb8000f) AM_WRITE(NAMCO_C139_SCI_register_w)
1313static READ16_HANDLER( winrun_68k_dspcomram_r )
1314{
1315   int bank = winrun_dspcomram_control[0x4/2]&1;
1316   UINT16 *mem = &winrun_dspcomram[0x1000*bank];
1317   return mem[offset];
1318}
1319
1320static WRITE16_HANDLER( winrun_68k_dspcomram_w )
1321{
1322   int bank = winrun_dspcomram_control[0x4/2]&1;
1323   UINT16 *mem = &winrun_dspcomram[0x1000*bank];
1324   COMBINE_DATA( &mem[offset] );
1325}
1326
1327static READ16_HANDLER( winrun_dspcomram_control_r )
1328{
1329   return winrun_dspcomram_control[offset];
1330}
1331
1332static WRITE16_HANDLER( winrun_dspcomram_control_w )
1333{
1334   COMBINE_DATA( &winrun_dspcomram_control[offset] );
1335}
1336
1337static ADDRESS_MAP_START( am_master_winrun, ADDRESS_SPACE_PROGRAM, 16 )
1338   AM_RANGE(0x000000, 0x03ffff) AM_READ(MRA16_ROM) AM_WRITE(MWA16_ROM)
1339   AM_RANGE(0x100000, 0x10ffff) AM_READ(MRA16_RAM) AM_WRITE(MWA16_RAM) /* work RAM */
1340   AM_RANGE(0x180000, 0x183fff) AM_READ(NAMCOS2_68K_EEPROM_R) AM_WRITE(NAMCOS2_68K_EEPROM_W)// AM_BASE(&namcos2_eeprom) AM_SIZE(&namcos2_eeprom_size)
1341   AM_RANGE(0x1c0000, 0x1fffff) AM_READ(namcos2_68k_master_C148_r) AM_WRITE(namcos2_68k_master_C148_w)
1342   AM_RANGE(0x250000, 0x25ffff) AM_READ(MRA16_RAM) AM_WRITE(MWA16_RAM) AM_BASE( &winrun_polydata )
1343   AM_RANGE(0x260000, 0x26ffff) AM_READ(MRA16_RAM) AM_WRITE(MWA16_RAM) /* unused? */
1344   AM_RANGE(0x280000, 0x281fff) AM_WRITE(winrun_dspbios_w) AM_BASE(&winrun_dspbios)
1345   AM_RANGE(0x380000, 0x38000f) AM_READ(winrun_dspcomram_control_r) AM_WRITE(winrun_dspcomram_control_w)
1346   AM_RANGE(0x3c0000, 0x3c1fff) AM_READ(winrun_68k_dspcomram_r) AM_WRITE(winrun_68k_dspcomram_w)
1347   AM_RANGE(0x400000, 0x400001) AM_WRITE(pointram_control_w)
1348   AM_RANGE(0x440000, 0x440001) AM_READ(pointram_data_r) AM_WRITE(pointram_data_w)
1349   AM_RANGE(0x600000, 0x60ffff) AM_READ(winrun_gpucomram_r) AM_WRITE(winrun_gpucomram_w)
1350   AM_RANGE(0x800000, 0x87ffff) AM_READ(datarom_r)
1351   AM_RANGE(0x900000, 0x90ffff) AM_READ(shareram1_r) AM_WRITE(shareram1_w) AM_BASE(&mpSharedRAM1)
1352   AM_RANGE(0xa00000, 0xa00fff) AM_READ(namcos2_68k_dualportram_word_r) AM_WRITE(namcos2_68k_dualportram_word_w)
1353   AM_RANGE(0xb00000, 0xb03fff) AM_READ(NAMCO_C139_SCI_buffer_r) AM_WRITE(NAMCO_C139_SCI_buffer_w)
1354   AM_RANGE(0xb80000, 0xb8000f) AM_READ(NAMCO_C139_SCI_register_r) AM_WRITE(NAMCO_C139_SCI_register_w)
12191355ADDRESS_MAP_END
12201356
1221static ADDRESS_MAP_START( readmem_slave_winrun, ADDRESS_SPACE_PROGRAM, 16 )
1222   AM_RANGE(0x000000, 0x03ffff) AM_READ(MRA16_ROM)
1223   AM_RANGE(0x100000, 0x13ffff) AM_READ(MRA16_RAM)
1224   AM_RANGE(0x1c0000, 0x1fffff) AM_READ(namcos2_68k_slave_C148_r)
1225   AM_RANGE(0x280000, 0x281fff) AM_READ(dspram16_r)
1226   AM_RANGE(0x400000, 0x400001) AM_READ(namcos21_dsp_control_r)
1227   AM_RANGE(0x440000, 0x440001) AM_READ(namcos21_dsp_data_r)
1228//  AM_RANGE(0x600000, 0x600fff) AM_READ(MRA16_RAM)
1229   AM_RANGE(0x800000, 0x87ffff) AM_READ(data_r)
1230   AM_RANGE(0x900000, 0x90ffff) AM_READ(shareram1_r)
1231   AM_RANGE(0xa00000, 0xa00fff) AM_READ(namcos2_68k_dualportram_word_r)
1232   AM_RANGE(0xb00000, 0xb03fff) AM_READ(NAMCO_C139_SCI_buffer_r)
1233   AM_RANGE(0xb80000, 0xb8000f) AM_READ(NAMCO_C139_SCI_register_r)
1357static ADDRESS_MAP_START( am_slave_winrun, ADDRESS_SPACE_PROGRAM, 16 )
1358   AM_RANGE(0x000000, 0x03ffff) AM_READ(MRA16_ROM) AM_WRITE(MWA16_ROM)
1359   AM_RANGE(0x100000, 0x13ffff) AM_READ(MRA16_RAM) AM_WRITE(MWA16_RAM)
1360   AM_RANGE(0x1c0000, 0x1fffff) AM_READ(namcos2_68k_slave_C148_r) AM_WRITE(namcos2_68k_slave_C148_w)
1361   AM_RANGE(0x600000, 0x60ffff) AM_READ(winrun_gpucomram_r) AM_WRITE(winrun_gpucomram_w)
1362   AM_RANGE(0x800000, 0x87ffff) AM_READ(datarom_r)
1363   AM_RANGE(0x900000, 0x90ffff) AM_READ(shareram1_r) AM_WRITE(shareram1_w)
1364   AM_RANGE(0xa00000, 0xa00fff) AM_READ(namcos2_68k_dualportram_word_r) AM_WRITE(namcos2_68k_dualportram_word_w)
1365   AM_RANGE(0xb00000, 0xb03fff) AM_READ(NAMCO_C139_SCI_buffer_r) AM_WRITE(NAMCO_C139_SCI_buffer_w)
1366   AM_RANGE(0xb80000, 0xb8000f) AM_READ(NAMCO_C139_SCI_register_r) AM_WRITE(NAMCO_C139_SCI_register_w)
12341367ADDRESS_MAP_END
12351368
1236static ADDRESS_MAP_START( writemem_slave_winrun, ADDRESS_SPACE_PROGRAM, 16 )
1237   AM_RANGE(0x100000, 0x13ffff) AM_WRITE(MWA16_RAM)
1238   AM_RANGE(0x1c0000, 0x1fffff) AM_WRITE(namcos2_68k_slave_C148_w)
1239   AM_RANGE(0x280000, 0x281fff) AM_WRITE(dspram16_w)
1240   AM_RANGE(0x400000, 0x400001) AM_WRITE(namcos21_dsp_control_w)
1241   AM_RANGE(0x440000, 0x440001) AM_WRITE(namcos21_dsp_data_w)
1242//  AM_RANGE(0x600000, 0x600fff) AM_WRITE(MWA16_RAM)
1243   AM_RANGE(0x900000, 0x90ffff) AM_WRITE(shareram1_w)
1244   AM_RANGE(0xa00000, 0xa00fff) AM_WRITE(namcos2_68k_dualportram_word_w)
1245   AM_RANGE(0xb00000, 0xb03fff) AM_WRITE(NAMCO_C139_SCI_buffer_w)
1246   AM_RANGE(0xb80000, 0xb8000f) AM_WRITE(NAMCO_C139_SCI_register_w)
1369static ADDRESS_MAP_START( am_gpu_winrun, ADDRESS_SPACE_PROGRAM, 16 )
1370   AM_RANGE(0x000000, 0x07ffff) AM_READ(MRA16_ROM) AM_WRITE(MWA16_ROM)
1371   AM_RANGE(0x100000, 0x100001) AM_READ(winrun_gpu_color_r) AM_WRITE(winrun_gpu_color_w) /* ? */
1372   AM_RANGE(0x180000, 0x19ffff) AM_READ(MRA16_RAM) AM_WRITE(MWA16_RAM) /* work RAM */
1373   AM_RANGE(0x1c0000, 0x1fffff) AM_READ(namcos2_68k_gpu_C148_r) AM_WRITE(namcos2_68k_gpu_C148_w)
1374   AM_RANGE(0x200000, 0x20ffff) AM_READ(MRA16_RAM) AM_WRITE(MWA16_RAM) AM_BASE( &winrun_gpucomram )
1375   AM_RANGE(0x400000, 0x41ffff) AM_READ(paletteram16_r) AM_WRITE(paletteram16_w) AM_BASE( &paletteram16 )
1376   AM_RANGE(0x600000, 0x6fffff) AM_READ(gpu_data_r)
1377   AM_RANGE(0xc00000, 0xcfffff) AM_READ(winrun_gpu_videoram_r) AM_WRITE(winrun_gpu_videoram_w)
1378   AM_RANGE(0xd00000, 0xd0000f) AM_READ(winrun_gpu_register_r) AM_WRITE(winrun_gpu_register_w)
1379//  AM_RANGE(0xe0000c, 0xe0000d) POSIRQ
12471380ADDRESS_MAP_END
12481381
12491382/*************************************************************/
r1037r1038
12611394ADDRESS_MAP_END
12621395
12631396static ADDRESS_MAP_START( writemem_sound, ADDRESS_SPACE_PROGRAM, 8 )
1397   AM_RANGE(0x3000, 0x3003) AM_WRITE(MWA8_NOP) /* ? */
12641398   AM_RANGE(0x0000, 0x3fff) AM_WRITE(MWA8_ROM)
12651399   AM_RANGE(0x4000, 0x4000) AM_WRITE(YM2151_register_port_0_w)
12661400   AM_RANGE(0x4001, 0x4001) AM_WRITE(YM2151_data_port_0_w)
r1037r1038
13101444   AM_RANGE(0x8000, 0xffff) AM_WRITE(MWA8_ROM)
13111445ADDRESS_MAP_END
13121446
1447////////////////////////////////////////////////////////////////////////////////
1448////////////////////////////////////////////////////////////////////////////////
1449////////////////////////////////////////////////////////////////////////////////
1450////////////////////////////////////////////////////////////////////////////////
1451
1452static ADDRESS_MAP_START( driveyes_68k_master, ADDRESS_SPACE_PROGRAM, 16 )
1453   AM_RANGE(0x000000, 0x03ffff) AM_READ(MRA16_ROM) AM_WRITE(MWA16_ROM)
1454   AM_RANGE(0x100000, 0x10ffff) AM_READ(MRA16_RAM) AM_WRITE(MWA16_RAM) /* private work RAM */
1455   AM_RANGE(0x180000, 0x183fff) AM_READ(NAMCOS2_68K_EEPROM_R) AM_WRITE(NAMCOS2_68K_EEPROM_W)// AM_BASE(&namcos2_eeprom) AM_SIZE(&namcos2_eeprom_size)
1456   AM_RANGE(0x1c0000, 0x1fffff) AM_READ(namcos2_68k_master_C148_r) AM_WRITE(namcos2_68k_master_C148_w)
1457ADDRESS_MAP_END
1458
1459static ADDRESS_MAP_START( driveyes_68k_slave, ADDRESS_SPACE_PROGRAM, 16 )
1460   AM_RANGE(0x000000, 0x03ffff) AM_READ(MRA16_ROM) AM_WRITE(MWA16_ROM)
1461   AM_RANGE(0x100000, 0x10ffff) AM_READ(MRA16_RAM) AM_WRITE(MWA16_RAM) /* private work RAM */
1462   AM_RANGE(0x1c0000, 0x1fffff) AM_READ(namcos2_68k_slave_C148_r) AM_WRITE(namcos2_68k_slave_C148_w)
1463ADDRESS_MAP_END
1464
1465static ADDRESS_MAP_START( driveyes_68k_common, ADDRESS_SPACE_PROGRAM, 16 )
1466   AM_RANGE(0x250000, 0x25ffff) AM_READ(MRA16_RAM) AM_WRITE(MWA16_RAM) AM_BASE( &winrun_polydata )
1467   AM_RANGE(0x280000, 0x281fff) AM_WRITE(winrun_dspbios_w) AM_BASE(&winrun_dspbios)
1468   AM_RANGE(0x380000, 0x38000f) AM_READ(winrun_dspcomram_control_r) AM_WRITE(winrun_dspcomram_control_w)
1469   AM_RANGE(0x3c0000, 0x3c1fff) AM_READ(winrun_68k_dspcomram_r) AM_WRITE(winrun_68k_dspcomram_w)
1470   AM_RANGE(0x400000, 0x400001) AM_WRITE(pointram_control_w)
1471   AM_RANGE(0x440000, 0x440001) AM_READ(pointram_data_r) AM_WRITE(pointram_data_w)
1472   AM_RANGE(0x700000, 0x71ffff) AM_READ(namco_obj16_r) AM_WRITE(namco_obj16_w)
1473   AM_RANGE(0x720000, 0x720007) AM_READ(namco_spritepos16_r) AM_WRITE(namco_spritepos16_w)
1474   AM_RANGE(0x740000, 0x75ffff) AM_READ(paletteram16_r ) AM_WRITE(paletteram16_w) AM_BASE(&paletteram16)
1475   AM_RANGE(0x760000, 0x760001) AM_READ(namcos21_video_enable_r) AM_WRITE(namcos21_video_enable_w)
1476   AM_RANGE(0x800000, 0x8fffff) AM_READ(datarom_r)
1477   AM_RANGE(0x900000, 0x90ffff) AM_READ(shareram1_r) AM_WRITE(shareram1_w) AM_BASE(&mpSharedRAM1)
1478   AM_RANGE(0xa00000, 0xa00fff) AM_READ(namcos2_68k_dualportram_word_r) AM_WRITE(namcos2_68k_dualportram_word_w)
1479   AM_RANGE(0xb00000, 0xb03fff) AM_READ(NAMCO_C139_SCI_buffer_r) AM_WRITE(NAMCO_C139_SCI_buffer_w)
1480   AM_RANGE(0xb80000, 0xb8000f) AM_READ(NAMCO_C139_SCI_register_r) AM_WRITE(NAMCO_C139_SCI_register_w)
1481ADDRESS_MAP_END
1482
13131483static const gfx_layout tile_layout =
13141484{
13151485   16,16,
r1037r1038
13511521   REGION_SOUND1
13521522};
13531523
1354static MACHINE_RESET( namcos21 )
1355{
1356   InitDSP();
1357   machine_reset_namcos2(machine);
1358}
1359
13601524static MACHINE_DRIVER_START( s21base )
13611525   MDRV_CPU_ADD(M68000,12288000) /* Master */
13621526   MDRV_CPU_PROGRAM_MAP(namcos21_68k_master, namcos21_68k_common)
r1037r1038
13801544   MDRV_CPU_DATA_MAP(master_dsp_data,0)
13811545   MDRV_CPU_IO_MAP(master_dsp_io,0)
13821546
1383   MDRV_CPU_ADD(TMS32025,24000000) /* 24 MHz?; overclocked */
1547   MDRV_CPU_ADD(TMS32025,24000000*4) /* 24 MHz?; overclocked */
13841548   MDRV_CPU_PROGRAM_MAP(slave_dsp_program,0)
13851549   MDRV_CPU_DATA_MAP(slave_dsp_data,0)
13861550   MDRV_CPU_IO_MAP(slave_dsp_io,0)
13871551
13881552   MDRV_SCREEN_REFRESH_RATE(60)
13891553   MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION)
1390   MDRV_INTERLEAVE(10/*0*/)
1554   MDRV_INTERLEAVE(200)
13911555
1392   MDRV_MACHINE_RESET(namcos21)
1556   MDRV_MACHINE_RESET(namcos2)
13931557   MDRV_NVRAM_HANDLER(namcos2)
13941558
13951559   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
r1037r1038
14011565   MDRV_PALETTE_LENGTH(NAMCOS21_NUM_COLORS)
14021566
14031567   MDRV_VIDEO_START(namcos21)
1404   MDRV_VIDEO_UPDATE(namcos21_default)
1568   MDRV_VIDEO_UPDATE(namcos21)
14051569MACHINE_DRIVER_END
14061570
14071571static MACHINE_DRIVER_START( poly_c140_typeA )
r1037r1038
14341598   MDRV_SOUND_ROUTE(1, "right", 0.30)
14351599MACHINE_DRIVER_END
14361600
1601static MACHINE_DRIVER_START( driveyes )
1602   MDRV_CPU_ADD(M68000,12288000) /* Master */
1603   MDRV_CPU_PROGRAM_MAP(driveyes_68k_master, driveyes_68k_common)
1604   MDRV_CPU_VBLANK_INT(namcos2_68k_master_vblank,1)
1605
1606   MDRV_CPU_ADD(M68000,12288000) /* Slave */
1607   MDRV_CPU_PROGRAM_MAP(driveyes_68k_slave, driveyes_68k_common)
1608   MDRV_CPU_VBLANK_INT(namcos2_68k_slave_vblank,1)
1609
1610   MDRV_CPU_ADD(M6809,3072000) /* Sound */
1611   MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound)
1612   MDRV_CPU_VBLANK_INT(irq0_line_hold,2)
1613   MDRV_CPU_PERIODIC_INT(irq1_line_hold,120)
1614
1615   MDRV_CPU_ADD(HD63705,2048000) /* IO */
1616   MDRV_CPU_PROGRAM_MAP(readmem_mcu,writemem_mcu)
1617   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
1618
1619   MDRV_CPU_ADD(TMS32025,24000000*2) /* 24 MHz? overclocked */
1620   MDRV_CPU_PROGRAM_MAP(winrun_dsp_program,0)
1621   MDRV_CPU_DATA_MAP(winrun_dsp_data,0)
1622   MDRV_CPU_IO_MAP(winrun_dsp_io,0)
1623
1624   MDRV_SCREEN_REFRESH_RATE(60)
1625   MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION)
1626   MDRV_INTERLEAVE(100) /* 100 CPU slices per frame */
1627
1628   MDRV_MACHINE_RESET(namcos2)
1629   MDRV_NVRAM_HANDLER(namcos2)
1630
1631   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
1632   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1633   MDRV_SCREEN_SIZE(NAMCOS21_POLY_FRAME_WIDTH,NAMCOS21_POLY_FRAME_HEIGHT)
1634   MDRV_SCREEN_VISIBLE_AREA(0,495,0,479)
1635
1636   MDRV_GFXDECODE(gfxdecodeinfo)
1637   MDRV_PALETTE_LENGTH(NAMCOS21_NUM_COLORS)
1638
1639   MDRV_VIDEO_START(namcos21)
1640   MDRV_VIDEO_UPDATE(namcos21)
1641
1642   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
1643
1644   MDRV_SOUND_ADD(C140, 8000000/374)
1645   MDRV_SOUND_CONFIG(C140_interface_typeA)
1646   MDRV_SOUND_ROUTE(0, "left", 0.50)
1647   MDRV_SOUND_ROUTE(1, "right", 0.50)
1648
1649   MDRV_SOUND_ADD(YM2151, 3579580)
1650   MDRV_SOUND_ROUTE(0, "left", 0.30)
1651   MDRV_SOUND_ROUTE(1, "right", 0.30)
1652MACHINE_DRIVER_END
1653
14371654static MACHINE_DRIVER_START( winrun_c140_typeB )
14381655   MDRV_CPU_ADD(M68000,12288000) /* Master */
1439   MDRV_CPU_PROGRAM_MAP(readmem_master_winrun,writemem_master_winrun)
1656   MDRV_CPU_PROGRAM_MAP(am_master_winrun,0)
14401657   MDRV_CPU_VBLANK_INT(namcos2_68k_master_vblank,1)
14411658
14421659   MDRV_CPU_ADD(M68000,12288000) /* Slave */
1443   MDRV_CPU_PROGRAM_MAP(readmem_slave_winrun,writemem_slave_winrun)
1660   MDRV_CPU_PROGRAM_MAP(am_slave_winrun,0)
14441661   MDRV_CPU_VBLANK_INT(namcos2_68k_slave_vblank,1)
14451662
14461663   MDRV_CPU_ADD(M6809,3072000) /* Sound */
r1037r1038
14521669   MDRV_CPU_PROGRAM_MAP(readmem_mcu,writemem_mcu)
14531670   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
14541671
1672   MDRV_CPU_ADD(TMS32025,24000000) /* 24 MHz? overclocked */
1673   MDRV_CPU_PROGRAM_MAP(winrun_dsp_program,0)
1674   MDRV_CPU_DATA_MAP(winrun_dsp_data,0)
1675   MDRV_CPU_IO_MAP(winrun_dsp_io,0)
1676
14551677   MDRV_CPU_ADD(M68000,12288000) /* graphics coprocessor */
1456   MDRV_CPU_PROGRAM_MAP(readmem_gpu_winrun,writemem_gpu_winrun)
1457   MDRV_CPU_VBLANK_INT(namcos2_gpu_vblank,1)
1678   MDRV_CPU_PROGRAM_MAP(am_gpu_winrun,0)
1679   MDRV_CPU_VBLANK_INT(namcos2_68k_gpu_vblank,1)
14581680
14591681   MDRV_SCREEN_REFRESH_RATE(60)
14601682   MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION)
r1037r1038
14651687
14661688   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
14671689   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1468   MDRV_SCREEN_SIZE(512,512)
1469   MDRV_SCREEN_VISIBLE_AREA(0,511,0,511)
1690   MDRV_SCREEN_SIZE(NAMCOS21_POLY_FRAME_WIDTH,NAMCOS21_POLY_FRAME_HEIGHT)
1691   MDRV_SCREEN_VISIBLE_AREA(0,495,0,479)
14701692
14711693   MDRV_PALETTE_LENGTH(NAMCOS21_NUM_COLORS)
1694   MDRV_COLORTABLE_LENGTH(NAMCOS21_NUM_COLORS)
14721695
14731696   MDRV_VIDEO_START(namcos21)
1474   MDRV_VIDEO_UPDATE(namcos21_winrun)
1697   MDRV_VIDEO_UPDATE(namcos21)
14751698
14761699   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
14771700
r1037r1038
14901713   ROM_LOAD16_BYTE( "ac2-mpr-u.3j",  0x000000, 0x80000, CRC(a7133f85) SHA1(9f1c99dd503f1fc81096170fd272e33ae8a7de2f) )
14911714   ROM_LOAD16_BYTE( "ac2-mpr-l.1j",  0x000001, 0x80000, CRC(520a52e6) SHA1(74306e02abfe08aa1afbf325b74dbc0840c3ad3a) )
14921715
1493   ROM_REGION( 0x100000, REGION_CPU2, 0 ) /* Slave */
1716   ROM_REGION( 0x80000, REGION_CPU2, 0 ) /* Slave */
14941717   ROM_LOAD16_BYTE( "ac2-spr-u.6c",  0x000000, 0x20000, CRC(42aca956) SHA1(10ea2400bb4d5b2d805e2de43ca0e0f54597f660) )
14951718   ROM_LOAD16_BYTE( "ac2-spr-l.4c",  0x000001, 0x20000, CRC(3e15fa19) SHA1(65dbb33ab6b3c06c793613348ebb7b110b8bba0d) )
14961719
14971720   ROM_REGION( 0x030000, REGION_CPU3, 0 ) /* Sound */
1498   ROM_LOAD( "ac1-snd0.8j",   0x00c000, 0x004000, CRC(5c1fb84b) SHA1(20e4d81289dbe58ffcfc947251a6ff1cc1e36436) )
1499   ROM_CONTINUE(            0x010000, 0x01c000 )
1500   ROM_RELOAD(            0x010000, 0x020000 )
1721   ROM_LOAD( "ac1-snd0.8j", 0x00c000, 0x004000, CRC(5c1fb84b) SHA1(20e4d81289dbe58ffcfc947251a6ff1cc1e36436) )
1722   ROM_CONTINUE(            0x010000, 0x01c000 )
1723   ROM_RELOAD(              0x010000, 0x020000 )
15011724
15021725   ROM_REGION( 0x010000, REGION_CPU4, 0 ) /* I/O MCU */
15031726   ROM_LOAD( "sys2mcpu.bin",  0x000000, 0x002000, CRC(a342a97e) SHA1(2c420d34dba21e409bf78ddca710fc7de65a6642) )
15041727   ROM_LOAD( "sys2c65c.bin",  0x008000, 0x008000, CRC(a5b2a4ff) SHA1(068bdfcc71a5e83706e8b23330691973c1c214dc) )
15051728
1506   ROM_REGION( 0x12000, REGION_CPU5, ROMREGION_ERASE00 )
1507   ROM_REGION( 0x12000, REGION_CPU6, ROMREGION_ERASE00 )
1729   ROM_REGION( 0x20000, REGION_CPU5, 0 ) /* Master DSP */
1730   ROM_LOAD( "c67.bin", 0, 0x2000, CRC(6bd8988e) SHA1(c9ec18d5f88d53976b94444eedc64d5568155958) )
1731   ROM_REGION( 0x20000, REGION_CPU6, 0 ) /* Slave DSP */
1732   ROM_LOAD( "c67.bin", 0, 0x2000, CRC(6bd8988e) SHA1(c9ec18d5f88d53976b94444eedc64d5568155958) )
15081733
15091734   ROM_REGION( 0x400000, REGION_GFX1, ROMREGION_DISPOSE )
15101735   ROM_LOAD( "ac2-obj0.5s",  0x000000, 0x80000, CRC(8327ff22) SHA1(16f6022dedb7a74590898bc8ed3e8a97993c4635) )
r1037r1038
15171742   ROM_LOAD( "ac2-obj7.2x",  0x380000, 0x80000, CRC(d561fbe3) SHA1(a23976e10bddf74d4a6b292f044dfd0affbab101) )
15181743
15191744   ROM_REGION16_BE( 0x200000, REGION_USER1, 0 ) /* collision */
1520   ROM_LOAD16_BYTE( "ac1-data-u.3a",      0x000000, 0x80000, CRC(82320c71) SHA1(2be98d46853febb46e1cc728af2735c0e00ce303) )
1521   ROM_LOAD16_BYTE( "ac1-data-l.1a",    0x000001, 0x80000, CRC(fd7947d3) SHA1(2696eeae37de6d256e626cc3f3cea7b0f6eff60e) )
1522   ROM_LOAD16_BYTE( "ac2-edata-1u.3c",   0x100000, 0x80000, CRC(40c07095) SHA1(5d9beaf5bc411ac66785d70980977b08446f46e3) )
1523   ROM_LOAD16_BYTE( "ac1-edata-1l.1c",   0x100001, 0x80000, CRC(a87087dd) SHA1(cd9b83a8f07886ab44e4ded68002b44338777e8c) )
1745   ROM_LOAD16_BYTE( "ac1-data-u.3a",    0x000000, 0x80000, CRC(82320c71) SHA1(2be98d46853febb46e1cc728af2735c0e00ce303) )
1746   ROM_LOAD16_BYTE( "ac1-data-l.1a",    0x000001, 0x80000, CRC(fd7947d3) SHA1(2696eeae37de6d256e626cc3f3cea7b0f6eff60e) )
1747   ROM_LOAD16_BYTE( "ac2-edata1-u.3c",  0x100000, 0x80000, CRC(40c07095) SHA1(5d9beaf5bc411ac66785d70980977b08446f46e3) )
1748   ROM_LOAD16_BYTE( "ac1-edata1-l.1c",  0x100001, 0x80000, CRC(a87087dd) SHA1(cd9b83a8f07886ab44e4ded68002b44338777e8c) )
15241749
15251750   ROM_REGION32_BE( 0x400000, REGION_USER2, ROMREGION_ERASE )      /* 24bit signed point data */
1526   ROM_LOAD32_BYTE( "ac1-poih.2f",   0x000001, 0x80000, CRC(573bbc3b) SHA1(371be12b915db6872049f18980c1b55544cfc445) )   /* most significant */
1527   ROM_LOAD32_BYTE( "ac1-poil-u.2k", 0x000002, 0x80000, CRC(d99084b9) SHA1(c604d60a2162af7610e5ff7c1aa4195f7df82efe) )
1528   ROM_LOAD32_BYTE( "ac1-poil-l.2n", 0x000003, 0x80000, CRC(abb32307) SHA1(8e936ba99479215dd33a951d81ec2b04020dfd62) )   /* least significant */
1751   ROM_LOAD32_BYTE( "ac1-poi-h.2f",  0x000001, 0x80000, CRC(573bbc3b) SHA1(371be12b915db6872049f18980c1b55544cfc445) )   /* most significant */
1752   ROM_LOAD32_BYTE( "ac1-poi-lu.2k", 0x000002, 0x80000, CRC(d99084b9) SHA1(c604d60a2162af7610e5ff7c1aa4195f7df82efe) )
1753   ROM_LOAD32_BYTE( "ac1-poi-ll.2n", 0x000003, 0x80000, CRC(abb32307) SHA1(8e936ba99479215dd33a951d81ec2b04020dfd62) )   /* least significant */
15291754
1755
15301756   ROM_REGION( 0x200000, REGION_SOUND1, 0 ) /* sound samples */
15311757   ROM_LOAD("ac1-voi0.12b",0x000000,0x80000,CRC(f427b119) SHA1(bd45bbe41c8be26d6c997fcdc226d080b416a2cf) )
15321758   ROM_LOAD("ac1-voi1.12c",0x080000,0x80000,CRC(c9490667) SHA1(4b6fbe635c32469870a8e6f82742be6a9d4918c9) )
r1037r1038
15441770   ROM_LOAD16_BYTE( "ac1-mpr-u.3j",  0x000000, 0x80000, CRC(a4dec813) SHA1(2ee8b3492d30db4c841f695151880925a5e205e0) )
15451771   ROM_LOAD16_BYTE( "ac1-mpr-l.1j",  0x000001, 0x80000, CRC(8577b6a2) SHA1(32194e392fbd051754be88eb8c90688c65c65d85) )
15461772
1547   ROM_REGION( 0x100000, REGION_CPU2, 0 ) /* Slave */
1773   ROM_REGION( 0x080000, REGION_CPU2, 0 ) /* Slave */
15481774   ROM_LOAD16_BYTE( "ac1-spr-u.6c",  0x000000, 0x20000, CRC(5810e219) SHA1(c312ffd8324670897871b12d521779570dc0f580) )
15491775   ROM_LOAD16_BYTE( "ac1-spr-l.4c",  0x000001, 0x20000, CRC(175a7d6c) SHA1(9e31dde6646cd9b6dcdbdb3f2326177508559e56) )
15501776
15511777   ROM_REGION( 0x030000, REGION_CPU3, 0 ) /* Sound */
1552   ROM_LOAD( "ac1-snd0.8j",   0x00c000, 0x004000, CRC(5c1fb84b) SHA1(20e4d81289dbe58ffcfc947251a6ff1cc1e36436) )
1553   ROM_CONTINUE(         0x010000, 0x01c000 )
1554   ROM_RELOAD(            0x010000, 0x020000 )
1778   ROM_LOAD( "ac1-snd0.8j", 0x00c000, 0x004000, CRC(5c1fb84b) SHA1(20e4d81289dbe58ffcfc947251a6ff1cc1e36436) )
1779   ROM_CONTINUE(            0x010000, 0x01c000 )
1780   ROM_RELOAD(              0x010000, 0x020000 )
15551781
15561782   ROM_REGION( 0x010000, REGION_CPU4, 0 ) /* I/O MCU */
15571783   ROM_LOAD( "sys2mcpu.bin",  0x000000, 0x002000, CRC(a342a97e) SHA1(2c420d34dba21e409bf78ddca710fc7de65a6642) )
15581784   ROM_LOAD( "sys2c65c.bin",  0x008000, 0x008000, CRC(a5b2a4ff) SHA1(068bdfcc71a5e83706e8b23330691973c1c214dc) )
15591785
1560   ROM_REGION( 0x12000, REGION_CPU5, ROMREGION_ERASE00 )
1561   ROM_REGION( 0x12000, REGION_CPU6, ROMREGION_ERASE00 )
1786   ROM_REGION( 0x20000, REGION_CPU5, 0 ) /* Master DSP */
1787   ROM_LOAD( "c67.bin", 0, 0x2000, CRC(6bd8988e) SHA1(c9ec18d5f88d53976b94444eedc64d5568155958) )
1788   ROM_REGION( 0x20000, REGION_CPU6, 0 ) /* Slave DSP */
1789   ROM_LOAD( "c67.bin", 0, 0x2000, CRC(6bd8988e) SHA1(c9ec18d5f88d53976b94444eedc64d5568155958) )
15621790
15631791   ROM_REGION( 0x400000, REGION_GFX1, ROMREGION_DISPOSE )
15641792   ROM_LOAD( "ac1-obj0.5s",  0x000000, 0x80000, CRC(d2310c6a) SHA1(9bb8fdfc2c232574777248f4959975f9a20e3105) )
r1037r1038
15731801   ROM_REGION16_BE( 0x200000, REGION_USER1, 0 )
15741802   ROM_LOAD16_BYTE( "ac1-data-u.3a",   0x000000, 0x80000, CRC(82320c71) SHA1(2be98d46853febb46e1cc728af2735c0e00ce303) )
15751803   ROM_LOAD16_BYTE( "ac1-data-l.1a",   0x000001, 0x80000, CRC(fd7947d3) SHA1(2696eeae37de6d256e626cc3f3cea7b0f6eff60e) )
1576   ROM_LOAD16_BYTE( "ac1-edata-1u.3c",  0x100000, 0x80000, CRC(a9547509) SHA1(1bc663cec03b60ad968896bbc2546f02efda135e) )
1577   ROM_LOAD16_BYTE( "ac1-edata-1l.1c",  0x100001, 0x80000, CRC(a87087dd) SHA1(cd9b83a8f07886ab44e4ded68002b44338777e8c) )
1804   ROM_LOAD16_BYTE( "ac1-edata1-u.3c", 0x100000, 0x80000, CRC(a9547509) SHA1(1bc663cec03b60ad968896bbc2546f02efda135e) )
1805   ROM_LOAD16_BYTE( "ac1-edata1-l.1c", 0x100001, 0x80000, CRC(a87087dd) SHA1(cd9b83a8f07886ab44e4ded68002b44338777e8c) )
15781806
15791807   ROM_REGION32_BE( 0x400000, REGION_USER2, ROMREGION_ERASE )      /* 24bit signed point data */
1580   ROM_LOAD32_BYTE( "ac1-poih.2f",   0x000001, 0x80000, CRC(573bbc3b) SHA1(371be12b915db6872049f18980c1b55544cfc445) )   /* most significant */
1581   ROM_LOAD32_BYTE( "ac1-poil-u.2k", 0x000002, 0x80000, CRC(d99084b9) SHA1(c604d60a2162af7610e5ff7c1aa4195f7df82efe) )
1582   ROM_LOAD32_BYTE( "ac1-poil-l.2n", 0x000003, 0x80000, CRC(abb32307) SHA1(8e936ba99479215dd33a951d81ec2b04020dfd62) )   /* least significant */
1808   ROM_LOAD32_BYTE( "ac1-poi-h.2f",  0x000001, 0x80000, CRC(573bbc3b) SHA1(371be12b915db6872049f18980c1b55544cfc445) )   /* most significant */
1809   ROM_LOAD32_BYTE( "ac1-poi-lu.2k", 0x000002, 0x80000, CRC(d99084b9) SHA1(c604d60a2162af7610e5ff7c1aa4195f7df82efe) )
1810   ROM_LOAD32_BYTE( "ac1-poi-ll.2n", 0x000003, 0x80000, CRC(abb32307) SHA1(8e936ba99479215dd33a951d81ec2b04020dfd62) )   /* least significant */
15831811
15841812   ROM_REGION( 0x200000, REGION_SOUND1, 0 ) /* sound samples */
15851813   ROM_LOAD("ac1-voi0.12b",0x000000,0x80000,CRC(f427b119) SHA1(bd45bbe41c8be26d6c997fcdc226d080b416a2cf) )
r1037r1038
15951823
15961824ROM_START( cybsled )
15971825   ROM_REGION( 0x100000, REGION_CPU1, 0 ) /* Master */
1826   ROM_LOAD16_BYTE( "cy2-mpr-u.3j",  0x000000, 0x80000, CRC(b35a72bc) SHA1(d9bc5b8f0bc30510fca8fc57eeb67e5ca0e4c67f) )
1827   ROM_LOAD16_BYTE( "cy2-mpr-l.1j",  0x000001, 0x80000, CRC(c4a25919) SHA1(52f6947102001376e37730ace16283141b13fee7) )
1828
1829   ROM_REGION( 0x100000, REGION_CPU2, 0 ) /* Slave */
1830   ROM_LOAD16_BYTE( "cy2-spr-u.6c",  0x000000, 0x80000, CRC(575a422d) SHA1(cad97742da1e2baf47ac110fadef5544b3a30cc7) )
1831   ROM_LOAD16_BYTE( "cy2-spr-l.4c",  0x000001, 0x80000, CRC(4066291a) SHA1(6ebbc11a68f66ec1e6d2e6ee857e8c599691e289) )
1832
1833   ROM_REGION( 0x030000, REGION_CPU3, 0 ) /* Sound */
1834   ROM_LOAD( "cy1-snd0.8j", 0x00c000, 0x004000, CRC(3dddf83b) SHA1(e16119cbef176b6f8f8ace773fcbc201e987823f) )
1835   ROM_CONTINUE(            0x010000, 0x01c000 )
1836   ROM_RELOAD(              0x010000, 0x020000 )
1837
1838   ROM_REGION( 0x010000, REGION_CPU4, 0 ) /* I/O MCU */
1839   ROM_LOAD( "sys2mcpu.bin",  0x000000, 0x002000, CRC(a342a97e) SHA1(2c420d34dba21e409bf78ddca710fc7de65a6642) )
1840   ROM_LOAD( "sys2c65c.bin",  0x008000, 0x008000, CRC(a5b2a4ff) SHA1(068bdfcc71a5e83706e8b23330691973c1c214dc) )
1841
1842   ROM_REGION( 0x20000, REGION_CPU5, 0 ) /* Master DSP */
1843   ROM_LOAD( "c67.bin", 0, 0x2000, CRC(6bd8988e) SHA1(c9ec18d5f88d53976b94444eedc64d5568155958) )
1844   ROM_REGION( 0x20000, REGION_CPU6, 0 ) /* Slave DSP */
1845   ROM_LOAD( "c67.bin", 0, 0x2000, CRC(6bd8988e) SHA1(c9ec18d5f88d53976b94444eedc64d5568155958) )
1846
1847   ROM_REGION( 0x400000, REGION_GFX1, ROMREGION_DISPOSE )
1848   ROM_LOAD( "cy1-obj0.5s",  0x000000, 0x80000, CRC(5ae542d5) SHA1(99b1a3ed476da4a97cb864538909d7b831f0fd3b) )
1849   ROM_LOAD( "cy1-obj4.4s",  0x080000, 0x80000, CRC(57904076) SHA1(b1dc0d99543bc4b9584b37ffc12c6ebc59e30e3b) )
1850   ROM_LOAD( "cy1-obj1.5x",  0x100000, 0x80000, CRC(4aae3eff) SHA1(c80240bd2f4228a0261a14adb6b10560b31b5aa0) )
1851   ROM_LOAD( "cy1-obj5.4x",  0x180000, 0x80000, CRC(0e11ca47) SHA1(076a9a4cfddbee2d8aaa06110333090d8fdbefeb) )
1852   ROM_LOAD( "cy1-obj2.3s",  0x200000, 0x80000, CRC(d64ec4c3) SHA1(0bed1cafc21ed8cef3850fb81e30076977086eb0) )
1853   ROM_LOAD( "cy1-obj6.2s",  0x280000, 0x80000, CRC(7748b485) SHA1(adb4da419a6cdbefd0fef182d866a3479be379af) )
1854   ROM_LOAD( "cy1-obj3.3x",  0x300000, 0x80000, CRC(3d1f7168) SHA1(392dddcc79fe61dcc6514a91ac27b5e36825d8b7) )
1855   ROM_LOAD( "cy1-obj7.2x",  0x380000, 0x80000, CRC(b6eb6ad2) SHA1(85a660c5e44012491be7d4e783cce6ba12c135cb) )
1856
1857   ROM_REGION16_BE( 0x200000, REGION_USER1, 0 ) /* 68k */
1858   ROM_LOAD16_BYTE( "cy1-data-u.3a",   0x000000, 0x80000, CRC(570da15d) SHA1(9ebe756f10756c079a92fb522332e9e52ff715c3) )
1859   ROM_LOAD16_BYTE( "cy1-data-l.1a",   0x000001, 0x80000, CRC(9cf96f9e) SHA1(91783f48b93e03c778c6641ca8fb419c13b0d3c5) )
1860   ROM_LOAD16_BYTE( "cy1-edata0-u.3b", 0x100000, 0x80000, CRC(77452533) SHA1(48fc199bcc1beb23c714eebd9b09b153c980170b) )
1861   ROM_LOAD16_BYTE( "cy1-edata0-l.1b", 0x100001, 0x80000, CRC(e812e290) SHA1(719e0a026ae8ef63d0d0269b67669ea9b4d950dd) )
1862
1863   ROM_REGION32_BE( 0x400000, REGION_USER2, ROMREGION_ERASE )      /* 24bit signed point data */
1864   ROM_LOAD32_BYTE( "cy1-poi-h1.2f",  0x000001, 0x80000, CRC(eaf8bac3) SHA1(7a2caf6672af158b4a23ce4626342d1f17d1a4e4) )   /* most significant */
1865   ROM_LOAD32_BYTE( "cy1-poi-lu1.2k", 0x000002, 0x80000, CRC(c544a8dc) SHA1(4cce5f2ab3519b4aa7edbdd15b2d79a7fdcade3c) )
1866   ROM_LOAD32_BYTE( "cy1-poi-ll1.2n", 0x000003, 0x80000, CRC(30acb99b) SHA1(a28dcb3e5405f166644f6353a903c1143ee268f1) )   /* least significant */
1867   ROM_LOAD32_BYTE( "cy1-poi-h2.2j",  0x200001, 0x80000, CRC(4079f342) SHA1(fa36aed1abbda54a42f29b183007474580870319) )
1868   ROM_LOAD32_BYTE( "cy1-poi-lu2.2l", 0x200002, 0x80000, CRC(61d816d4) SHA1(7991957b910d32530151abc7f469fcf1de62d8f3) )
1869   ROM_LOAD32_BYTE( "cy1-poi-ll2.2p", 0x200003, 0x80000, CRC(faf09158) SHA1(b56ebed6012362b1d599c396a43e90a1e4d9dc38) )
1870
1871   ROM_REGION( 0x200000, REGION_SOUND1, 0 ) /* sound samples */
1872   ROM_LOAD("cy1-voi0.12b",0x000000,0x80000,CRC(99d7ce46) SHA1(b75f4055c3ce847daabfacda22df14e3f80c4fb9) )
1873   ROM_LOAD("cy1-voi1.12c",0x080000,0x80000,CRC(2b335f06) SHA1(2b2cd407c34388b56496f84a414daa153780b098) )
1874   ROM_LOAD("cy1-voi2.12d",0x100000,0x80000,CRC(10cd15f0) SHA1(9b721654ed97a13287373c1b2854ac9aeddc271f) )
1875   ROM_LOAD("cy1-voi3.12e",0x180000,0x80000,CRC(c902b4a4) SHA1(816357ec1a02a7ebf817ac1182e9c50ce5ca71f6) )
1876ROM_END
1877
1878ROM_START( cybsledj )
1879   ROM_REGION( 0x100000, REGION_CPU1, 0 ) /* Master */
15981880   ROM_LOAD16_BYTE( "cy1-mpr-u.3j",  0x000000, 0x80000, CRC(cc5a2e83) SHA1(b794051b2c351e9ca43351603845e4e563f6740f) )
15991881   ROM_LOAD16_BYTE( "cy1-mpr-l.1j",  0x000001, 0x80000, CRC(f7ee8b48) SHA1(6d36eb3dba9cf7f5f5e1a26c156e77a2dad3f257) )
16001882
r1037r1038
16031885   ROM_LOAD16_BYTE( "cy1-spr-l.4c",  0x000001, 0x80000, CRC(437029de) SHA1(3d275a2b0ce6909e77e657c371bd22597ea9d398) )
16041886
16051887   ROM_REGION( 0x030000, REGION_CPU3, 0 ) /* Sound */
1606   ROM_LOAD( "cy1-snd0.8j",   0x00c000, 0x004000, CRC(3dddf83b) SHA1(e16119cbef176b6f8f8ace773fcbc201e987823f) )
1607   ROM_CONTINUE(         0x010000, 0x01c000 )
1608   ROM_RELOAD(            0x010000, 0x020000 )
1888   ROM_LOAD( "cy1-snd0.8j", 0x00c000, 0x004000, CRC(3dddf83b) SHA1(e16119cbef176b6f8f8ace773fcbc201e987823f) )
1889   ROM_CONTINUE(            0x010000, 0x01c000 )
1890   ROM_RELOAD(              0x010000, 0x020000 )
16091891
16101892   ROM_REGION( 0x010000, REGION_CPU4, 0 ) /* I/O MCU */
16111893   ROM_LOAD( "sys2mcpu.bin",  0x000000, 0x002000, CRC(a342a97e) SHA1(2c420d34dba21e409bf78ddca710fc7de65a6642) )
16121894   ROM_LOAD( "sys2c65c.bin",  0x008000, 0x008000, CRC(a5b2a4ff) SHA1(068bdfcc71a5e83706e8b23330691973c1c214dc) )
16131895
1614   ROM_REGION( 0x12000, REGION_CPU5, ROMREGION_ERASE00 )
1615   ROM_REGION( 0x12000, REGION_CPU6, ROMREGION_ERASE00 )
1896   ROM_REGION( 0x20000, REGION_CPU5, 0 ) /* Master DSP */
1897   ROM_LOAD( "c67.bin", 0, 0x2000, CRC(6bd8988e) SHA1(c9ec18d5f88d53976b94444eedc64d5568155958) )
1898   ROM_REGION( 0x20000, REGION_CPU6, 0 ) /* Slave DSP */
1899   ROM_LOAD( "c67.bin", 0, 0x2000, CRC(6bd8988e) SHA1(c9ec18d5f88d53976b94444eedc64d5568155958) )
16161900
16171901   ROM_REGION( 0x400000, REGION_GFX1, ROMREGION_DISPOSE )
16181902   ROM_LOAD( "cy1-obj0.5s",  0x000000, 0x80000, CRC(5ae542d5) SHA1(99b1a3ed476da4a97cb864538909d7b831f0fd3b) )
r1037r1038
16241908   ROM_LOAD( "cy1-obj3.3x",  0x300000, 0x80000, CRC(3d1f7168) SHA1(392dddcc79fe61dcc6514a91ac27b5e36825d8b7) )
16251909   ROM_LOAD( "cy1-obj7.2x",  0x380000, 0x80000, CRC(b6eb6ad2) SHA1(85a660c5e44012491be7d4e783cce6ba12c135cb) )
16261910
1627   ROM_REGION16_BE( 0x200000, REGION_USER1, 0 )
1911   ROM_REGION16_BE( 0x200000, REGION_USER1, 0 ) /* 68k */
16281912   ROM_LOAD16_BYTE( "cy1-data-u.3a",   0x000000, 0x80000, CRC(570da15d) SHA1(9ebe756f10756c079a92fb522332e9e52ff715c3) )
16291913   ROM_LOAD16_BYTE( "cy1-data-l.1a",   0x000001, 0x80000, CRC(9cf96f9e) SHA1(91783f48b93e03c778c6641ca8fb419c13b0d3c5) )
16301914   ROM_LOAD16_BYTE( "cy1-edata0-u.3b", 0x100000, 0x80000, CRC(77452533) SHA1(48fc199bcc1beb23c714eebd9b09b153c980170b) )
16311915   ROM_LOAD16_BYTE( "cy1-edata0-l.1b", 0x100001, 0x80000, CRC(e812e290) SHA1(719e0a026ae8ef63d0d0269b67669ea9b4d950dd) )
16321916
16331917   ROM_REGION32_BE( 0x400000, REGION_USER2, ROMREGION_ERASE )      /* 24bit signed point data */
1634   ROM_LOAD32_BYTE( "cy1-poih-1.2f",  0x000001, 0x80000, CRC(eaf8bac3) SHA1(7a2caf6672af158b4a23ce4626342d1f17d1a4e4) )   /* most significant */
1635   ROM_LOAD32_BYTE( "cy1-poil-u1.2k", 0x000002, 0x80000, CRC(c544a8dc) SHA1(4cce5f2ab3519b4aa7edbdd15b2d79a7fdcade3c) )
1636   ROM_LOAD32_BYTE( "cy1-poil-l1.2n", 0x000003, 0x80000, CRC(30acb99b) SHA1(a28dcb3e5405f166644f6353a903c1143ee268f1) )   /* least significant */
1637   ROM_LOAD32_BYTE( "cy1-poih-2.2j",  0x200001, 0x80000, CRC(4079f342) SHA1(fa36aed1abbda54a42f29b183007474580870319) )
1638   ROM_LOAD32_BYTE( "cy1-poil-u2.2l", 0x200002, 0x80000, CRC(61d816d4) SHA1(7991957b910d32530151abc7f469fcf1de62d8f3) )
1639   ROM_LOAD32_BYTE( "cy1-poil-l2.2p", 0x200003, 0x80000, CRC(faf09158) SHA1(b56ebed6012362b1d599c396a43e90a1e4d9dc38) )
1918   ROM_LOAD32_BYTE( "cy1-poi-h1.2f",  0x000001, 0x80000, CRC(eaf8bac3) SHA1(7a2caf6672af158b4a23ce4626342d1f17d1a4e4) )   /* most significant */
1919   ROM_LOAD32_BYTE( "cy1-poi-lu1.2k", 0x000002, 0x80000, CRC(c544a8dc) SHA1(4cce5f2ab3519b4aa7edbdd15b2d79a7fdcade3c) )
1920   ROM_LOAD32_BYTE( "cy1-poi-ll1.2n", 0x000003, 0x80000, CRC(30acb99b) SHA1(a28dcb3e5405f166644f6353a903c1143ee268f1) )   /* least significant */
1921   ROM_LOAD32_BYTE( "cy1-poi-h2.2j",  0x200001, 0x80000, CRC(4079f342) SHA1(fa36aed1abbda54a42f29b183007474580870319) )
1922   ROM_LOAD32_BYTE( "cy1-poi-lu2.2l", 0x200002, 0x80000, CRC(61d816d4) SHA1(7991957b910d32530151abc7f469fcf1de62d8f3) )
1923   ROM_LOAD32_BYTE( "cy1-poi-ll2.2p", 0x200003, 0x80000, CRC(faf09158) SHA1(b56ebed6012362b1d599c396a43e90a1e4d9dc38) )
16401924
16411925   ROM_REGION( 0x200000, REGION_SOUND1, 0 ) /* sound samples */
16421926   ROM_LOAD("cy1-voi0.12b",0x000000,0x80000,CRC(99d7ce46) SHA1(b75f4055c3ce847daabfacda22df14e3f80c4fb9) )
r1037r1038
16461930ROM_END
16471931
16481932ROM_START( driveyes )
1649   ROM_REGION( 0x100000, REGION_CPU1, 0 ) /* 68k code */
1650   ROM_LOAD16_BYTE( "de2_mpub.3j",  0x000000, 0x20000, CRC(f9c86fb5) SHA1(b48d16e8f26e7a2cfecb30285b517c42e5585ac7) )
1651   ROM_LOAD16_BYTE( "de2_mplb.1j",  0x000001, 0x20000, CRC(11d8587a) SHA1(ecb1e8fe2ba56b6f6a71a5552d5663b597165786) )
1933   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* C68C - 68k code */
1934   ROM_LOAD16_BYTE( "de2-mp-ub.3j",  0x000000, 0x20000, CRC(f9c86fb5) SHA1(b48d16e8f26e7a2cfecb30285b517c42e5585ac7) )
1935   ROM_LOAD16_BYTE( "de2-mp-lb.1j",  0x000001, 0x20000, CRC(11d8587a) SHA1(ecb1e8fe2ba56b6f6a71a5552d5663b597165786) )
16521936
1653   ROM_REGION( 0x100000, REGION_CPU2, 0 ) /* 68k code */
1654   ROM_LOAD16_BYTE( "de1_spub.6c",  0x000000, 0x20000, CRC(231b144f) SHA1(42518614cb083455dc5fec71e699403907ca784b) )
1655   ROM_LOAD16_BYTE( "de1_splb.4c",  0x000001, 0x20000, CRC(50cb9f59) SHA1(aec7fa080854f0297d9e90e3aaeb0f332fd579bd) )
1937   ROM_REGION( 0x40000, REGION_CPU2, 0 ) /* C68 - 68k code */
1938   ROM_LOAD16_BYTE( "de1-sp-ub.6c",  0x000000, 0x20000, CRC(231b144f) SHA1(42518614cb083455dc5fec71e699403907ca784b) )
1939   ROM_LOAD16_BYTE( "de1-sp-lb.4c",  0x000001, 0x20000, CRC(50cb9f59) SHA1(aec7fa080854f0297d9e90e3aaeb0f332fd579bd) )
16561940
16571941   ROM_REGION( 0x30000, REGION_CPU3, 0 ) /* Sound */
16581942/*
r1037r1038
16611945Only "Set2" has voice roms present/dumped?
16621946We load the "r" set, then load set2's sound CPU code over it to keep the "r" rom in the set
16631947*/
1664   ROM_LOAD( "de1_snd0r.8j",  0x00c000, 0x004000, CRC(7bbeda42) SHA1(fe840cc9069758928492bbeec79acded18daafd9) ) /* Sets 1 & 3 */
1948   ROM_LOAD( "de1-snd0r.8j",  0x00c000, 0x004000, CRC(7bbeda42) SHA1(fe840cc9069758928492bbeec79acded18daafd9) ) /* Sets 1 & 3 */
16651949   ROM_CONTINUE(              0x010000, 0x01c000 )
16661950   ROM_RELOAD(                0x010000, 0x020000 )
1667   ROM_LOAD( "de1_snd0.8j",   0x00c000, 0x004000, CRC(5474f203) SHA1(e0ae2f6978deb0c934d9311a334a6e36bb402aee) ) /* Set 2 */
1951   ROM_LOAD( "de1-snd0.8j",   0x00c000, 0x004000, CRC(5474f203) SHA1(e0ae2f6978deb0c934d9311a334a6e36bb402aee) ) /* Set 2 */
16681952   ROM_CONTINUE(              0x010000, 0x01c000 )
16691953   ROM_RELOAD(                0x010000, 0x020000 )
16701954
r1037r1038
16721956   ROM_LOAD( "sys2mcpu.bin",  0x000000, 0x002000, CRC(a342a97e) SHA1(2c420d34dba21e409bf78ddca710fc7de65a6642) )
16731957   ROM_LOAD( "sys2c65c.bin",  0x008000, 0x008000, CRC(a5b2a4ff) SHA1(068bdfcc71a5e83706e8b23330691973c1c214dc) )
16741958
1675   ROM_REGION( 0x12000, REGION_CPU5, ROMREGION_ERASE00 )
1676   ROM_REGION( 0x12000, REGION_CPU6, ROMREGION_ERASE00 )
1959   ROM_REGION( 0x20000, REGION_CPU5, 0 ) /* C67 - DSP */
16771960
16781961   ROM_REGION( 0x200000, REGION_GFX1, ROMREGION_DISPOSE ) /* sprites */
1679   ROM_LOAD( "de1_obj0.5s",  0x000000, 0x40000, CRC(7438bd53) SHA1(7619c4b56d5c466e845eb45e6157dcaf2a03ad94) )
1680   ROM_LOAD( "de1_obj1.5x",  0x040000, 0x40000, CRC(45f2334e) SHA1(95f277a4e43d6662ae44d6b69a57f65c72978319) )
1681   ROM_LOAD( "de1_obj2.3s",  0x080000, 0x40000, CRC(8f1a542c) SHA1(2cb59713607d8929815a9b28bf2a384b6a6c9db8) )
1682   ROM_LOAD( "de1_obj3.3x",  0x0c0000, 0x40000, CRC(fc94544c) SHA1(6297445c64784ee253716f6438d98e5fcd4e7520) )
1683   ROM_LOAD( "de1_obj4.4s",  0x100000, 0x40000, CRC(335f0ea4) SHA1(9ec065d99ad0874b262b372334179a7e7612558e) )
1684   ROM_LOAD( "de1_obj5.4x",  0x140000, 0x40000, CRC(9e22999c) SHA1(02624186c359b5e2c96cd3f0e2cb1598ea36dff7) )
1685   ROM_LOAD( "de1_obj6.2s",  0x180000, 0x40000, CRC(346df4d5) SHA1(edbadb9db93b7f5a3b064c7f6acb77001cdacce2) )
1686   ROM_LOAD( "de1_obj7.2x",  0x1c0000, 0x40000, CRC(9ce325d7) SHA1(de4d788bec14842507ed405244974b4fd4f07515) )
1962   ROM_LOAD( "de1-obj0.5s",  0x000000, 0x40000, CRC(7438bd53) SHA1(7619c4b56d5c466e845eb45e6157dcaf2a03ad94) )
1963   ROM_LOAD( "de1-obj4.4s",  0x040000, 0x40000, CRC(335f0ea4) SHA1(9ec065d99ad0874b262b372334179a7e7612558e) )
1964   ROM_LOAD( "de1-obj1.5x",  0x080000, 0x40000, CRC(45f2334e) SHA1(95f277a4e43d6662ae44d6b69a57f65c72978319) )
1965   ROM_LOAD( "de1-obj5.4x",  0x0c0000, 0x40000, CRC(9e22999c) SHA1(02624186c359b5e2c96cd3f0e2cb1598ea36dff7) )
1966   ROM_LOAD( "de1-obj2.3s",  0x100000, 0x40000, CRC(8f1a542c) SHA1(2cb59713607d8929815a9b28bf2a384b6a6c9db8) )
1967   ROM_LOAD( "de1-obj6.2s",  0x140000, 0x40000, CRC(346df4d5) SHA1(edbadb9db93b7f5a3b064c7f6acb77001cdacce2) )
1968   ROM_LOAD( "de1-obj3.3x",  0x180000, 0x40000, CRC(fc94544c) SHA1(6297445c64784ee253716f6438d98e5fcd4e7520) )
1969   ROM_LOAD( "de1-obj7.2x",  0x1c0000, 0x40000, CRC(9ce325d7) SHA1(de4d788bec14842507ed405244974b4fd4f07515) )
16871970
1688   ROM_REGION16_BE( 0x100000, REGION_USER1, 0 )
1689   ROM_LOAD16_BYTE( "de1_du.3a",  0x00001, 0x80000, CRC(fe65d2ab) SHA1(dbe962dda7efa60357fa3a684a265aaad49df5b5) )
1690   ROM_LOAD16_BYTE( "de1_dl.1a",  0x00000, 0x80000, CRC(9bb37aca) SHA1(7f5dffc95cadcf12f53ff7944920afc25ed3cf68) )
1971   ROM_REGION16_BE( 0x100000, REGION_USER1, 0 ) /* 68k */
1972   ROM_LOAD16_BYTE( "de1-data-u.3a",  0x00000, 0x80000, CRC(fe65d2ab) SHA1(dbe962dda7efa60357fa3a684a265aaad49df5b5) )
1973   ROM_LOAD16_BYTE( "de1-data-l.1a",  0x00001, 0x80000, CRC(9bb37aca) SHA1(7f5dffc95cadcf12f53ff7944920afc25ed3cf68) )
16911974
16921975   ROM_REGION16_BE( 0xc0000, REGION_USER2, 0 ) /* 3d objects */
1693   ROM_LOAD16_BYTE( "de1pt0ub.8j", 0x00000, 0x20000, CRC(3b6b746d) SHA1(40c992ef4cf5187b30aba42c5fe7ce0f8f02bee0) )
1694   ROM_LOAD16_BYTE( "de1pt0lb.8d", 0x00001, 0x20000, CRC(9c5c477e) SHA1(c8ae8a663227d636d35bd5f432d23f05d6695942) )
1695   ROM_LOAD16_BYTE( "de1pt1u.8l",  0x40000, 0x20000, CRC(23bc72a1) SHA1(083e2955ae2f88d1ad461517b47054d64375b46e) )
1696   ROM_LOAD16_BYTE( "de1pt1l.8e",  0x40001, 0x20000, CRC(a05ee081) SHA1(1be4c61ad716abb809856e04d4bb450943706a55) )
1697   ROM_LOAD16_BYTE( "de1pt2u.5n",  0x80000, 0x20000, CRC(10e83d81) SHA1(446fedc3b1e258a39fb9467e5327c9f9a9f1ac3f) )
1698   ROM_LOAD16_BYTE( "de1pt2l.7n",  0x80001, 0x20000, CRC(3339a976) SHA1(c9eb9c04f7b3f2a85e5ab64ffb2fe4fcfb6c494b) )
1976   ROM_LOAD16_BYTE( "de1-pt0-ub.8j", 0x00000, 0x20000, CRC(3b6b746d) SHA1(40c992ef4cf5187b30aba42c5fe7ce0f8f02bee0) )
1977   ROM_LOAD16_BYTE( "de1-pt0-lb.8d", 0x00001, 0x20000, CRC(9c5c477e) SHA1(c8ae8a663227d636d35bd5f432d23f05d6695942) )
1978   ROM_LOAD16_BYTE( "de1-pt1-u.8l",  0x40000, 0x20000, CRC(23bc72a1) SHA1(083e2955ae2f88d1ad461517b47054d64375b46e) )
1979   ROM_LOAD16_BYTE( "de1-pt1-l.8e",  0x40001, 0x20000, CRC(a05ee081) SHA1(1be4c61ad716abb809856e04d4bb450943706a55) )
1980   ROM_LOAD16_BYTE( "de1-pt2-u.5n",  0x80000, 0x20000, CRC(10e83d81) SHA1(446fedc3b1e258a39fb9467e5327c9f9a9f1ac3f) )
1981   ROM_LOAD16_BYTE( "de1-pt2-l.7n",  0x80001, 0x20000, CRC(3339a976) SHA1(c9eb9c04f7b3f2a85e5ab64ffb2fe4fcfb6c494b) )
16991982
17001983   ROM_REGION( 0x100000, REGION_SOUND1, 0 ) /* sound samples */
1701   ROM_LOAD("de1_voi0.12b",  0x00000, 0x40000, CRC(fc44adbd) SHA1(4268bb1f025e47a94212351d1c1cfd0e5029221f) )
1702   ROM_LOAD("de1_voi1.12c",  0x40000, 0x40000, CRC(a71dc55a) SHA1(5e746184db9144ab4e3a97b20195b92b0f56c8cc) )
1703   ROM_LOAD("de1_voi2.12d",  0x80000, 0x40000, CRC(4d32879a) SHA1(eae65f4b98cee9efe4e5dad7298c3717cfb1e6bf) )
1704   ROM_LOAD("de1_voi3.12e",  0xc0000, 0x40000, CRC(e4832d18) SHA1(0460c79d3942aab89a765b0bd8bbddaf19a6d682) )
1984   ROM_LOAD("de1-voi0.12b",  0x00000, 0x40000, CRC(fc44adbd) SHA1(4268bb1f025e47a94212351d1c1cfd0e5029221f) )
1985   ROM_LOAD("de1-voi1.12c",  0x40000, 0x40000, CRC(a71dc55a) SHA1(5e746184db9144ab4e3a97b20195b92b0f56c8cc) )
1986   ROM_LOAD("de1-voi2.12d",  0x80000, 0x40000, CRC(4d32879a) SHA1(eae65f4b98cee9efe4e5dad7298c3717cfb1e6bf) )
1987   ROM_LOAD("de1-voi3.12e",  0xc0000, 0x40000, CRC(e4832d18) SHA1(0460c79d3942aab89a765b0bd8bbddaf19a6d682) )
17051988ROM_END
17061989
17071990ROM_START( starblad )
17081991   ROM_REGION( 0x100000, REGION_CPU1, 0 ) /* Master */
1709   ROM_LOAD16_BYTE( "st1_mpu.bin",  0x000000, 0x80000, CRC(483a311c) SHA1(dd9416b8d4b0f8b361630e312eac71c113064eae) )
1710   ROM_LOAD16_BYTE( "st1_mpl.bin",  0x000001, 0x80000, CRC(0a4dd661) SHA1(fc2b71a255a8613693c4d1c79ddd57a6d396165a) )
1992   ROM_LOAD16_BYTE( "st1-mp-u.bin",  0x000000, 0x80000, CRC(483a311c) SHA1(dd9416b8d4b0f8b361630e312eac71c113064eae) )
1993   ROM_LOAD16_BYTE( "st1-mp-l.bin",  0x000001, 0x80000, CRC(0a4dd661) SHA1(fc2b71a255a8613693c4d1c79ddd57a6d396165a) )
17111994
1712   ROM_REGION( 0x100000, REGION_CPU2, 0 ) /* Slave */
1713   ROM_LOAD16_BYTE( "st1_spu.bin",  0x000000, 0x40000, CRC(9f9a55db) SHA1(72bf5d6908cc57cc490fa2292b4993d796b2974d) )
1714   ROM_LOAD16_BYTE( "st1_spl.bin",  0x000001, 0x40000, CRC(acbe39c7) SHA1(ca48b7ea619b1caaf590eed33001826ce7ef36d8) )
1995   ROM_REGION( 0x080000, REGION_CPU2, 0 ) /* Slave */
1996   ROM_LOAD16_BYTE( "st1-sp-u.bin",  0x000000, 0x40000, CRC(9f9a55db) SHA1(72bf5d6908cc57cc490fa2292b4993d796b2974d) )
1997   ROM_LOAD16_BYTE( "st1-sp-l.bin",  0x000001, 0x40000, CRC(acbe39c7) SHA1(ca48b7ea619b1caaf590eed33001826ce7ef36d8) )
17151998
17161999   ROM_REGION( 0x030000, REGION_CPU3, 0 ) /* Sound */
1717   ROM_LOAD( "st1snd0.bin",       0x00c000, 0x004000, CRC(c0e934a3) SHA1(678ed6705c6f494d7ecb801a4ef1b123b80979a5) )
1718   ROM_CONTINUE(                0x010000, 0x01c000 )
1719   ROM_RELOAD(                 0x010000, 0x020000 )
2000   ROM_LOAD( "st1-snd0.bin", 0x00c000, 0x004000, CRC(c0e934a3) SHA1(678ed6705c6f494d7ecb801a4ef1b123b80979a5) )
2001   ROM_CONTINUE(             0x010000, 0x01c000 )
2002   ROM_RELOAD(               0x010000, 0x020000 )
17202003
17212004   ROM_REGION( 0x010000, REGION_CPU4, 0 ) /* I/O MCU */
17222005   ROM_LOAD( "sys2mcpu.bin",  0x000000, 0x002000, CRC(a342a97e) SHA1(2c420d34dba21e409bf78ddca710fc7de65a6642) )
17232006   ROM_LOAD( "sys2c65c.bin",  0x008000, 0x008000, CRC(a5b2a4ff) SHA1(068bdfcc71a5e83706e8b23330691973c1c214dc) )
17242007
1725   ROM_REGION( 0x12000, REGION_CPU5, ROMREGION_ERASE00 )
1726   ROM_REGION( 0x12000, REGION_CPU6, ROMREGION_ERASE00 )
2008   ROM_REGION( 0x20000, REGION_CPU5, 0 ) /* Master DSP */
2009   ROM_LOAD( "c67.bin", 0, 0x2000, CRC(6bd8988e) SHA1(c9ec18d5f88d53976b94444eedc64d5568155958) )
2010   ROM_REGION( 0x20000, REGION_CPU6, 0 ) /* Slave DSP */
2011   ROM_LOAD( "c67.bin", 0, 0x2000, CRC(6bd8988e) SHA1(c9ec18d5f88d53976b94444eedc64d5568155958) )
17272012
17282013   ROM_REGION( 0x200000, REGION_GFX1, ROMREGION_DISPOSE ) /* sprites */
1729   ROM_LOAD( "st1obj0.bin",  0x000000, 0x80000, CRC(5d42c71e) SHA1(f1aa2bb31bbbcdcac8e94334b1c78238cac1a0e7) )
1730   ROM_LOAD( "st1obj1.bin",  0x080000, 0x80000, CRC(c98011ad) SHA1(bc34c21428e0ef5887051c0eb0fdef5397823a82) )
1731   ROM_LOAD( "st1obj2.bin",  0x100000, 0x80000, CRC(6cf5b608) SHA1(c8537fbe97677c4c8a365b1cf86c4645db7a7d6b) )
1732   ROM_LOAD( "st1obj3.bin",  0x180000, 0x80000, CRC(cdc195bb) SHA1(91443917a6982c286b6f15381d441d061aefb138) )
2014   ROM_LOAD( "st1-obj0.bin",  0x000000, 0x80000, CRC(5d42c71e) SHA1(f1aa2bb31bbbcdcac8e94334b1c78238cac1a0e7) )
2015   ROM_LOAD( "st1-obj1.bin",  0x080000, 0x80000, CRC(c98011ad) SHA1(bc34c21428e0ef5887051c0eb0fdef5397823a82) )
2016   ROM_LOAD( "st1-obj2.bin",  0x100000, 0x80000, CRC(6cf5b608) SHA1(c8537fbe97677c4c8a365b1cf86c4645db7a7d6b) )
2017   ROM_LOAD( "st1-obj3.bin",  0x180000, 0x80000, CRC(cdc195bb) SHA1(91443917a6982c286b6f15381d441d061aefb138) )
17332018
1734   ROM_REGION16_BE( 0x100000, REGION_USER1, 0 )
1735   ROM_LOAD16_BYTE( "st1_du.bin",  0x000000, 0x20000, CRC(2433e911) SHA1(95f5f00d3bacda4996e055a443311fb9f9a5fe2f) )
1736   ROM_LOAD16_BYTE( "st1_dl.bin",  0x000001, 0x20000, CRC(4a2cc252) SHA1(d9da9992bac878f8a1f5e84cc3c6d457b4705e8f) )
2019   ROM_REGION16_BE( 0x40000, REGION_USER1, 0 )
2020   ROM_LOAD16_BYTE( "st1-data-u.bin",  0x000000, 0x20000, CRC(2433e911) SHA1(95f5f00d3bacda4996e055a443311fb9f9a5fe2f) )
2021   ROM_LOAD16_BYTE( "st1-data-l.bin",  0x000001, 0x20000, CRC(4a2cc252) SHA1(d9da9992bac878f8a1f5e84cc3c6d457b4705e8f) )
17372022
17382023   ROM_REGION32_BE( 0x400000, REGION_USER2, ROMREGION_ERASE ) /* 24bit signed point data */
1739   ROM_LOAD32_BYTE( "st1pt0h.bin", 0x000001, 0x80000, CRC(84eb355f) SHA1(89a248b8be2e0afcee29ba4c4c9cca65d5fb246a) )
1740   ROM_LOAD32_BYTE( "st1pt0u.bin", 0x000002, 0x80000, CRC(1956cd0a) SHA1(7d21b3a59f742694de472c545a1f30c3d92e3390) )
1741   ROM_LOAD32_BYTE( "st1pt0l.bin", 0x000003, 0x80000, CRC(ff577049) SHA1(1e1595174094e88d5788753d05ce296c1f7eca75) )
2024   ROM_LOAD32_BYTE( "st1-pt0-h.bin", 0x000001, 0x80000, CRC(84eb355f) SHA1(89a248b8be2e0afcee29ba4c4c9cca65d5fb246a) )
2025   ROM_LOAD32_BYTE( "st1-pt0-u.bin", 0x000002, 0x80000, CRC(1956cd0a) SHA1(7d21b3a59f742694de472c545a1f30c3d92e3390) )
2026   ROM_LOAD32_BYTE( "st1-pt0-l.bin", 0x000003, 0x80000, CRC(ff577049) SHA1(1e1595174094e88d5788753d05ce296c1f7eca75) )
2027   ROM_LOAD32_BYTE( "st1-pt1-h.bin", 0x200001, 0x80000, CRC(96b1bd7d) SHA1(55da7896dda2aa4c35501a55c8605a065b02aa17) )
2028   ROM_LOAD32_BYTE( "st1-pt1-u.bin", 0x200002, 0x80000, CRC(ecf21047) SHA1(ddb13f5a2e7d192f0662fa420b49f89e1e991e66) )
2029   ROM_LOAD32_BYTE( "st1-pt1-l.bin", 0x200003, 0x80000, CRC(01cb0407) SHA1(4b58860bbc353de8b4b8e83d12b919d9386846e8) )
17422030
1743   ROM_LOAD32_BYTE( "st1pt1h.bin", 0x200001, 0x80000, CRC(96b1bd7d) SHA1(55da7896dda2aa4c35501a55c8605a065b02aa17) ) // bad?
1744   ROM_LOAD32_BYTE( "st1pt1u.bin", 0x200002, 0x80000, CRC(ecf21047) SHA1(ddb13f5a2e7d192f0662fa420b49f89e1e991e66) )
1745   ROM_LOAD32_BYTE( "st1pt1l.bin", 0x200003, 0x80000, CRC(01cb0407) SHA1(4b58860bbc353de8b4b8e83d12b919d9386846e8) )
1746
17472031   ROM_REGION( 0x200000, REGION_SOUND1, 0 ) /* sound samples */
1748   ROM_LOAD("st1voi0.bin",0x000000,0x80000,CRC(5b3d43a9) SHA1(cdc04f19dc91dca9fa88ba0c2fca72aa195a3694) )
1749   ROM_LOAD("st1voi1.bin",0x080000,0x80000,CRC(413e6181) SHA1(e827ec11f5755606affd2635718512aeac9354da) )
1750   ROM_LOAD("st1voi2.bin",0x100000,0x80000,CRC(067d0720) SHA1(a853b2d43027a46c5e707fc677afdaae00f450c7) )
1751   ROM_LOAD("st1voi3.bin",0x180000,0x80000,CRC(8b5aa45f) SHA1(e1214e639200758ad2045bde0368a2d500c1b84a) )
2032   ROM_LOAD("st1-voi0.bin",0x000000,0x80000,CRC(5b3d43a9) SHA1(cdc04f19dc91dca9fa88ba0c2fca72aa195a3694) )
2033   ROM_LOAD("st1-voi1.bin",0x080000,0x80000,CRC(413e6181) SHA1(e827ec11f5755606affd2635718512aeac9354da) )
2034   ROM_LOAD("st1-voi2.bin",0x100000,0x80000,CRC(067d0720) SHA1(a853b2d43027a46c5e707fc677afdaae00f450c7) )
2035   ROM_LOAD("st1-voi3.bin",0x180000,0x80000,CRC(8b5aa45f) SHA1(e1214e639200758ad2045bde0368a2d500c1b84a) )
17522036ROM_END
17532037
17542038ROM_START( solvalou )
17552039   ROM_REGION( 0x100000, REGION_CPU1, 0 ) /* Master */
1756   ROM_LOAD16_BYTE( "sv1mpu.bin",  0x000000, 0x20000, CRC(b6f92762) SHA1(d177328b3da2ab0580e101478142bc8c373d6140) )
1757   ROM_LOAD16_BYTE( "sv1mpl.bin",  0x000001, 0x20000, CRC(28c54c42) SHA1(32fcca2eb4bb8ba8c2587b03d3cf59f072f7fac5) )
2040   ROM_LOAD16_BYTE( "sv1-mp-u.bin",  0x000000, 0x20000, CRC(b6f92762) SHA1(d177328b3da2ab0580e101478142bc8c373d6140) )
2041   ROM_LOAD16_BYTE( "sv1-mp-l.bin",  0x000001, 0x20000, CRC(28c54c42) SHA1(32fcca2eb4bb8ba8c2587b03d3cf59f072f7fac5) )
17582042
1759   ROM_REGION( 0x100000, REGION_CPU2, 0 ) /* Slave */
1760   ROM_LOAD16_BYTE( "sv1spu.bin",  0x000000, 0x20000, CRC(ebd4bf82) SHA1(67946360d680a675abcb3c131bac0502b2455573) )
1761   ROM_LOAD16_BYTE( "sv1spl.bin",  0x000001, 0x20000, CRC(7acab679) SHA1(764297c9601be99dbbffb75bbc6fe4a40ea38529) )
2043   ROM_REGION( 0x80000, REGION_CPU2, 0 ) /* Slave */
2044   ROM_LOAD16_BYTE( "sv1-sp-u.bin",  0x000000, 0x20000, CRC(ebd4bf82) SHA1(67946360d680a675abcb3c131bac0502b2455573) )
2045   ROM_LOAD16_BYTE( "sv1-sp-l.bin",  0x000001, 0x20000, CRC(7acab679) SHA1(764297c9601be99dbbffb75bbc6fe4a40ea38529) )
17622046
17632047   ROM_REGION( 0x030000, REGION_CPU3, 0 ) /* Sound */
1764   ROM_LOAD( "sv1snd0.bin",    0x00c000, 0x004000, CRC(5e007864) SHA1(94da2d51544c6127056beaa251353038646da15f) )
1765   ROM_CONTINUE(            0x010000, 0x01c000 )
1766   ROM_RELOAD(               0x010000, 0x020000 )
2048   ROM_LOAD( "sv1-snd0.bin", 0x00c000, 0x004000, CRC(5e007864) SHA1(94da2d51544c6127056beaa251353038646da15f) )
2049   ROM_CONTINUE(             0x010000, 0x01c000 )
2050   ROM_RELOAD(               0x010000, 0x020000 )
17672051
17682052   ROM_REGION( 0x010000, REGION_CPU4, 0 ) /* I/O MCU */
17692053   ROM_LOAD( "sys2mcpu.bin",  0x000000, 0x002000, CRC(a342a97e) SHA1(2c420d34dba21e409bf78ddca710fc7de65a6642) )
17702054   ROM_LOAD( "sys2c65c.bin",  0x008000, 0x008000, CRC(a5b2a4ff) SHA1(068bdfcc71a5e83706e8b23330691973c1c214dc) )
17712055
1772   ROM_REGION( 0x12000, REGION_CPU5, ROMREGION_ERASE00 )
1773   ROM_REGION( 0x12000, REGION_CPU6, ROMREGION_ERASE00 )
2056   ROM_REGION( 0x20000, REGION_CPU5, 0 ) /* Master DSP */
2057   ROM_LOAD( "c67.bin", 0, 0x2000, CRC(6bd8988e) SHA1(c9ec18d5f88d53976b94444eedc64d5568155958) )
2058   ROM_REGION( 0x20000, REGION_CPU6, 0 ) /* Slave DSP */
2059   ROM_LOAD( "c67.bin", 0, 0x2000, CRC(6bd8988e) SHA1(c9ec18d5f88d53976b94444eedc64d5568155958) )
17742060
17752061   ROM_REGION( 0x400000, REGION_GFX1, ROMREGION_DISPOSE )
1776   ROM_LOAD( "sv1obj0.bin",  0x000000, 0x80000, CRC(773798bb) SHA1(51ab76c95030bab834f1a74ae677b2f0afc18c52) )
1777   ROM_LOAD( "sv1obj4.bin",  0x080000, 0x80000, CRC(33a008a7) SHA1(4959a0ac24ad64f1367e2d8d63d39a0273c60f3e) )
1778   ROM_LOAD( "sv1obj1.bin",  0x100000, 0x80000, CRC(a36d9e79) SHA1(928d9995e97ee7509e23e6cc64f5e7bfb5c02d42) )
1779   ROM_LOAD( "sv1obj5.bin",  0x180000, 0x80000, CRC(31551245) SHA1(385452ea4830c466263ad5241313ac850dfef756) )
1780   ROM_LOAD( "sv1obj2.bin",  0x200000, 0x80000, CRC(c8672b8a) SHA1(8da037b27d2c2b178aab202781f162371458f788) )
1781   ROM_LOAD( "sv1obj6.bin",  0x280000, 0x80000, CRC(fe319530) SHA1(8f7e46c8f0b86c7515f6d763b795ce07d11c77bc) )
1782   ROM_LOAD( "sv1obj3.bin",  0x300000, 0x80000, CRC(293ef1c5) SHA1(f677883bfec16bbaeb0a01ac565d0e6cac679174) )
1783   ROM_LOAD( "sv1obj7.bin",  0x380000, 0x80000, CRC(95ed6dcb) SHA1(931706ce3fea630823ce0c79febec5eec0cc623d) )
2062   ROM_LOAD( "sv1-obj0.bin",  0x000000, 0x80000, CRC(773798bb) SHA1(51ab76c95030bab834f1a74ae677b2f0afc18c52) )
2063   ROM_LOAD( "sv1-obj4.bin",  0x080000, 0x80000, CRC(33a008a7) SHA1(4959a0ac24ad64f1367e2d8d63d39a0273c60f3e) )
2064   ROM_LOAD( "sv1-obj1.bin",  0x100000, 0x80000, CRC(a36d9e79) SHA1(928d9995e97ee7509e23e6cc64f5e7bfb5c02d42) )
2065   ROM_LOAD( "sv1-obj5.bin",  0x180000, 0x80000, CRC(31551245) SHA1(385452ea4830c466263ad5241313ac850dfef756) )
2066   ROM_LOAD( "sv1-obj2.bin",  0x200000, 0x80000, CRC(c8672b8a) SHA1(8da037b27d2c2b178aab202781f162371458f788) )
2067   ROM_LOAD( "sv1-obj6.bin",  0x280000, 0x80000, CRC(fe319530) SHA1(8f7e46c8f0b86c7515f6d763b795ce07d11c77bc) )
2068   ROM_LOAD( "sv1-obj3.bin",  0x300000, 0x80000, CRC(293ef1c5) SHA1(f677883bfec16bbaeb0a01ac565d0e6cac679174) )
2069   ROM_LOAD( "sv1-obj7.bin",  0x380000, 0x80000, CRC(95ed6dcb) SHA1(931706ce3fea630823ce0c79febec5eec0cc623d) )
17842070
17852071   ROM_REGION16_BE( 0x100000, REGION_USER1, 0 )
1786   ROM_LOAD16_BYTE( "sv1du.bin",  0x000000, 0x80000, CRC(2e561996) SHA1(982158481e5649f21d5c2816fdc80cb725ed1419) )
1787   ROM_LOAD16_BYTE( "sv1dl.bin",  0x000001, 0x80000, CRC(495fb8dd) SHA1(813d1da4109652008d72b3bdb03032efc5c0c2d5) )
2072   ROM_LOAD16_BYTE( "sv1-data-u.bin",  0x000000, 0x80000, CRC(2e561996) SHA1(982158481e5649f21d5c2816fdc80cb725ed1419) )
2073   ROM_LOAD16_BYTE( "sv1-data-l.bin",  0x000001, 0x80000, CRC(495fb8dd) SHA1(813d1da4109652008d72b3bdb03032efc5c0c2d5) )
17882074
17892075   ROM_REGION32_BE( 0x400000, REGION_USER2, ROMREGION_ERASE )      /* 24bit signed point data */
1790   ROM_LOAD32_BYTE( "sv1pt0h.bin", 0x000001, 0x80000, CRC(3be21115) SHA1(c9f30353c1216f64199f87cd34e787efd728e739) ) /* most significant */
1791   ROM_LOAD32_BYTE( "sv1pt0u.bin", 0x000002, 0x80000, CRC(4aacfc42) SHA1(f0e179e057183b41744ca429764f44306f0ce9bf) )
1792   ROM_LOAD32_BYTE( "sv1pt0l.bin", 0x000003, 0x80000, CRC(6a4dddff) SHA1(9ed182d21d328c6a684ee6658a9dfcf3f3dd8646) ) /* least significant */
2076   ROM_LOAD32_BYTE( "sv1-pt0-h.bin", 0x000001, 0x80000, CRC(3be21115) SHA1(c9f30353c1216f64199f87cd34e787efd728e739) ) /* most significant */
2077   ROM_LOAD32_BYTE( "sv1-pt0-u.bin", 0x000002, 0x80000, CRC(4aacfc42) SHA1(f0e179e057183b41744ca429764f44306f0ce9bf) )
2078   ROM_LOAD32_BYTE( "sv1-pt0-l.bin", 0x000003, 0x80000, CRC(6a4dddff) SHA1(9ed182d21d328c6a684ee6658a9dfcf3f3dd8646) ) /* least significant */
17932079
17942080   ROM_REGION( 0x200000, REGION_SOUND1, 0 ) /* sound samples */
1795   ROM_LOAD("sv1voi0.bin",0x000000,0x80000,CRC(7f61bbcf) SHA1(b3b7e66e24d9cb16ebd139237c1e51f5d60c1585) )
1796   ROM_LOAD("sv1voi1.bin",0x080000,0x80000,CRC(c732e66c) SHA1(14e75dd9bea4055f85eb2bcbf69cf6695a3f7ec4) )
1797   ROM_LOAD("sv1voi2.bin",0x100000,0x80000,CRC(51076298) SHA1(ec52c9ae3029118f3ea3732948d6de28f5fba561) )
1798   ROM_LOAD("sv1voi3.bin",0x180000,0x80000,CRC(33085ff3) SHA1(0a30b91618c250a5e7bd896a8ceeb3d16da178a9) )
2081   ROM_LOAD("sv1-voi0.bin",0x000000,0x80000,CRC(7f61bbcf) SHA1(b3b7e66e24d9cb16ebd139237c1e51f5d60c1585) )
2082   ROM_LOAD("sv1-voi1.bin",0x080000,0x80000,CRC(c732e66c) SHA1(14e75dd9bea4055f85eb2bcbf69cf6695a3f7ec4) )
2083   ROM_LOAD("sv1-voi2.bin",0x100000,0x80000,CRC(51076298) SHA1(ec52c9ae3029118f3ea3732948d6de28f5fba561) )
2084   ROM_LOAD("sv1-voi3.bin",0x180000,0x80000,CRC(33085ff3) SHA1(0a30b91618c250a5e7bd896a8ceeb3d16da178a9) )
17992085ROM_END
18002086
18012087ROM_START( winrun )
1802   ROM_REGION( 0x100000, REGION_CPU1, 0 ) /* 68k code */
1803   ROM_LOAD16_BYTE( "sg1mpub.3k",  0x000000, 0x20000, CRC(7f9b855a) SHA1(6d39a3a9959dbcd0047dbaab0fcd68adc81f5508) )
1804   ROM_LOAD16_BYTE( "sg1mplb.1k",  0x000001, 0x20000, CRC(a45e8543) SHA1(f9e583a988e4661026ee7873a48d078225778df3) )
2088   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68k code */
2089   ROM_LOAD16_BYTE( "sg1-mp-ub.3k",  0x000000, 0x20000, CRC(7f9b855a) SHA1(6d39a3a9959dbcd0047dbaab0fcd68adc81f5508) )
2090   ROM_LOAD16_BYTE( "sg1-mp-lb.1k",  0x000001, 0x20000, CRC(a45e8543) SHA1(f9e583a988e4661026ee7873a48d078225778df3) )
18052091
18062092   ROM_REGION( 0x40000, REGION_CPU2, 0 ) /* 68k code */
1807   ROM_LOAD16_BYTE( "sg1spu.6b",  0x000000, 0x20000, CRC(7c9c3a3f) SHA1(cacb45c9111ac66c6e60b7a0cacd8bf47fd00752) )
1808   ROM_LOAD16_BYTE( "sg1spl.4b",  0x000001, 0x20000, CRC(5068fc5d) SHA1(7f6e80f74985959509d824318a4a7ff2b11953da) )
2093   ROM_LOAD16_BYTE( "sg1-sp-u.6b",  0x000000, 0x20000, CRC(7c9c3a3f) SHA1(cacb45c9111ac66c6e60b7a0cacd8bf47fd00752) )
2094   ROM_LOAD16_BYTE( "sg1-sp-l.4b",  0x000001, 0x20000, CRC(5068fc5d) SHA1(7f6e80f74985959509d824318a4a7ff2b11953da) )
18092095
18102096   ROM_REGION( 0x30000, REGION_CPU3, 0 ) /* Sound */
1811   ROM_LOAD( "sg1snd0.7c",   0x00c000, 0x004000, CRC(de04b794) SHA1(191f4d79ac2375d7060f3d83ec753185e92f28ea) )
1812   ROM_CONTINUE(           0x010000, 0x01c000 )
1813   ROM_RELOAD(             0x010000, 0x020000 )
2097   ROM_LOAD( "sg1-snd0.7c", 0x00c000, 0x004000, CRC(de04b794) SHA1(191f4d79ac2375d7060f3d83ec753185e92f28ea) )
2098   ROM_CONTINUE(            0x010000, 0x01c000 )
2099   ROM_RELOAD(              0x010000, 0x020000 )
18142100
18152101   ROM_REGION( 0x10000, REGION_CPU4, 0 ) /* I/O MCU */
18162102   ROM_LOAD( "sys2mcpu.bin",  0x000000, 0x002000, CRC(a342a97e) SHA1(2c420d34dba21e409bf78ddca710fc7de65a6642) )
18172103   ROM_LOAD( "sys2c65c.bin",  0x008000, 0x008000, CRC(a5b2a4ff) SHA1(068bdfcc71a5e83706e8b23330691973c1c214dc) )
18182104
1819   ROM_REGION( 0x80000, REGION_CPU5, 0 ) /* 68k code */
1820   ROM_LOAD16_BYTE( "sg1gp0u.1j",  0x00000, 0x20000, CRC(475da78a) SHA1(6e69bcc6caf2e3cd28fed75796c8992e754f9323) )
1821   ROM_LOAD16_BYTE( "sg1gp0l.3j",  0x00001, 0x20000, CRC(580479bf) SHA1(ba682190cba0d3cdc49aa4937c898ba7ed2a25f5) )
1822   ROM_LOAD16_BYTE( "sg1gp1u.1l",  0x40000, 0x20000, CRC(f5f2e927) SHA1(ebf709f16f01f1a634de9121454537cda74e891b) )
1823   ROM_LOAD16_BYTE( "sg1gp1l.3l",  0x40001, 0x20000, CRC(17ed90a5) SHA1(386bdcb11dcbe400f5be1fe4a7418158b46e50ef) )
2105   ROM_REGION( 0x20000, REGION_CPU5, 0 ) /* DSP */
18242106
1825   ROM_REGION16_BE( 0x80000, REGION_USER1, 0 )
1826   ROM_LOAD16_BYTE( "sg1d0u.3a",  0x00001, 0x20000, CRC(1dde2ac2) SHA1(2d20a434561c04e48b52a2137a8c9047e17c1013) )
1827   ROM_LOAD16_BYTE( "sg1d0l.1a",  0x00000, 0x20000, CRC(2afeb77e) SHA1(ac1552f6e2788158d3477b6a0981d001d6cbdf13) )
1828   ROM_LOAD16_BYTE( "sg1d1u.3b",  0x40001, 0x20000, CRC(5664b09e) SHA1(10c1c29614eee2cffcfd69085f0450d81ba2e25f) )
1829   ROM_LOAD16_BYTE( "sg1d1l.1b",  0x40000, 0x20000, CRC(2dbc7de4) SHA1(824304c95942c7296f8e8dcf8ee7e22bf56154b1) )
2107   ROM_REGION( 0x80000, REGION_CPU6, 0 ) /* 68k code */
2108   ROM_LOAD16_BYTE( "sg1-gp0-u.1j",  0x00000, 0x20000, CRC(475da78a) SHA1(6e69bcc6caf2e3cd28fed75796c8992e754f9323) )
2109   ROM_LOAD16_BYTE( "sg1-gp0-l.3j",  0x00001, 0x20000, CRC(580479bf) SHA1(ba682190cba0d3cdc49aa4937c898ba7ed2a25f5) )
2110   ROM_LOAD16_BYTE( "sg1-gp1-u.1l",  0x40000, 0x20000, CRC(f5f2e927) SHA1(ebf709f16f01f1a634de9121454537cda74e891b) )
2111   ROM_LOAD16_BYTE( "sg1-gp1-l.3l",  0x40001, 0x20000, CRC(17ed90a5) SHA1(386bdcb11dcbe400f5be1fe4a7418158b46e50ef) )
18302112
2113   ROM_REGION16_BE( 0x80000, REGION_USER1, 0 ) /* 68k */
2114   ROM_LOAD16_BYTE( "sg1-data0-u.3a",  0x00000, 0x20000, CRC(1dde2ac2) SHA1(2d20a434561c04e48b52a2137a8c9047e17c1013) )
2115   ROM_LOAD16_BYTE( "sg1-data0-l.1a",  0x00001, 0x20000, CRC(2afeb77e) SHA1(ac1552f6e2788158d3477b6a0981d001d6cbdf13) )
2116   ROM_LOAD16_BYTE( "sg1-data1-u.3b",  0x40000, 0x20000, CRC(5664b09e) SHA1(10c1c29614eee2cffcfd69085f0450d81ba2e25f) )
2117   ROM_LOAD16_BYTE( "sg1-data1-l.1b",  0x40001, 0x20000, CRC(2dbc7de4) SHA1(824304c95942c7296f8e8dcf8ee7e22bf56154b1) )
2118
18312119   ROM_REGION16_BE( 0x80000, REGION_USER2, 0 ) /* 3d objects */
1832   ROM_LOAD16_BYTE( "sg1pt0u.8j", 0x00001, 0x20000, CRC(160c3634) SHA1(485d20d6cc459f17d77682201dee07bdf76bf343) )
1833   ROM_LOAD16_BYTE( "sg1pt0l.8d", 0x00000, 0x20000, CRC(b5a665bf) SHA1(5af6ec492f31395c0492e14590b025b120067b8d) )
1834   ROM_LOAD16_BYTE( "sg1pt1u.8l", 0x40001, 0x20000, CRC(b63d3006) SHA1(78e78619766b0fd91b1e830cfb066495d6773981) )
1835   ROM_LOAD16_BYTE( "sg1pt1l.8e", 0x40000, 0x20000, CRC(6385e325) SHA1(d50bceb2e9c0d0a38d7b0f918f99c482649e260d) )
2120   ROM_LOAD16_BYTE( "sg1-pt0-u.8j", 0x00000, 0x20000, CRC(160c3634) SHA1(485d20d6cc459f17d77682201dee07bdf76bf343) )
2121   ROM_LOAD16_BYTE( "sg1-pt0-l.8d", 0x00001, 0x20000, CRC(b5a665bf) SHA1(5af6ec492f31395c0492e14590b025b120067b8d) )
2122   ROM_LOAD16_BYTE( "sg1-pt1-u.8l", 0x40000, 0x20000, CRC(b63d3006) SHA1(78e78619766b0fd91b1e830cfb066495d6773981) )
2123   ROM_LOAD16_BYTE( "sg1-pt1-l.8e", 0x40001, 0x20000, CRC(6385e325) SHA1(d50bceb2e9c0d0a38d7b0f918f99c482649e260d) )
18362124
18372125   ROM_REGION16_BE( 0x100000, REGION_USER3, 0 ) /* bitmapped graphics */
1838   ROM_LOAD16_BYTE( "sg1gd0u.1p",  0x00001, 0x40000, CRC(7838fcde) SHA1(45e31269eed1999b73c41c2f5d2c5bfbbdaf23df) )
1839   ROM_LOAD16_BYTE( "sg1gd0l.3p",  0x00000, 0x40000, CRC(4bd02b9a) SHA1(b2fdfd1c1325864aaad87f5358ab9bbdd79ff6ae) )
1840   ROM_LOAD16_BYTE( "sg1gd1u.1s",  0x80001, 0x40000, CRC(271db29b) SHA1(8b35fcf273b9aec28d4c606c41c0626dded697e1) )
1841   ROM_LOAD16_BYTE( "sg1gd1l.3s",  0x80000, 0x40000, CRC(a6c4da96) SHA1(377dbf21a1bede01de16708c96c112abab4417ce) )
2126   ROM_LOAD16_BYTE( "sg1-gd0-u.1p",  0x00000, 0x40000, CRC(7838fcde) SHA1(45e31269eed1999b73c41c2f5d2c5bfbbdaf23df) )
2127   ROM_LOAD16_BYTE( "sg1-gd0-l.3p",  0x00001, 0x40000, CRC(4bd02b9a) SHA1(b2fdfd1c1325864aaad87f5358ab9bbdd79ff6ae) )
2128   ROM_LOAD16_BYTE( "sg1-gd1-u.1s",  0x80000, 0x40000, CRC(271db29b) SHA1(8b35fcf273b9aec28d4c606c41c0626dded697e1) )
2129   ROM_LOAD16_BYTE( "sg1-gd1-l.3s",  0x80001, 0x40000, CRC(a6c4da96) SHA1(377dbf21a1bede01de16708c96c112abab4417ce) )
18422130
18432131   ROM_REGION( 0x200000, REGION_SOUND1, 0 ) /* sound samples */
1844   ROM_LOAD("sgvoi-1.11c",0x000000,0x80000,CRC(7dcccb31) SHA1(4441b37691434b13eae5dee2d04dc12a56b04d2a) )
1845   ROM_LOAD("sgboi-3.11e",0x080000,0x80000,CRC(a198141c) SHA1(b4ca352e6aedd9d7a7e5e39e840f1d3a7145900e) )
2132   ROM_LOAD("sg-voi-1.11c",0x000000,0x80000,CRC(7dcccb31) SHA1(4441b37691434b13eae5dee2d04dc12a56b04d2a) )
2133   ROM_LOAD("sg-voi-3.11e",0x080000,0x80000,CRC(a198141c) SHA1(b4ca352e6aedd9d7a7e5e39e840f1d3a7145900e) )
18462134ROM_END
18472135
18482136ROM_START( winrun91 )
1849   ROM_REGION( 0x100000, REGION_CPU1, 0 ) /* 68k code */
2137   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68k code */
18502138   ROM_LOAD16_BYTE( "mpu.3k",  0x000000, 0x20000, CRC(80a0e5be) SHA1(6613b95e164c2032ea9043e4161130c6b3262492) )
18512139   ROM_LOAD16_BYTE( "mpl.1k",  0x000001, 0x20000, CRC(942172d8) SHA1(21d8dfd2165b5ceb0399fdb53d9d0f51f1255803) )
18522140
r1037r1038
18552143   ROM_LOAD16_BYTE( "spl.4b",  0x000001, 0x20000, CRC(288799e2) SHA1(2c4bf0cf9c71458fff4dd77e426a76685d9e1bab) )
18562144
18572145   ROM_REGION( 0x30000, REGION_CPU3, 0 ) /* Sound */
1858   ROM_LOAD( "snd0.7c",   0x00c000, 0x004000, CRC(6a321e1e) SHA1(b2e77cac4ed7609593fa5a462c9d78526451e477) )
1859   ROM_CONTINUE(         0x010000, 0x01c000 )
1860   ROM_RELOAD(            0x010000, 0x020000 )
2146   ROM_LOAD( "snd0.7c", 0x00c000, 0x004000, CRC(6a321e1e) SHA1(b2e77cac4ed7609593fa5a462c9d78526451e477) )
2147   ROM_CONTINUE(        0x010000, 0x01c000 )
2148   ROM_RELOAD(          0x010000, 0x020000 )
18612149
18622150   ROM_REGION( 0x10000, REGION_CPU4, 0 ) /* I/O MCU */
18632151   ROM_LOAD( "sys2mcpu.bin",  0x000000, 0x002000, CRC(a342a97e) SHA1(2c420d34dba21e409bf78ddca710fc7de65a6642) )
18642152   ROM_LOAD( "sys2c65c.bin",  0x008000, 0x008000, CRC(a5b2a4ff) SHA1(068bdfcc71a5e83706e8b23330691973c1c214dc) )
18652153
1866   ROM_REGION( 0x80000, REGION_CPU5, 0 ) /* 68k code */
2154   ROM_REGION( 0x20000, REGION_CPU5, 0 ) /* DSP */
2155
2156   ROM_REGION( 0x80000, REGION_CPU6, 0 ) /* 68k code */
18672157   ROM_LOAD16_BYTE( "gp0u.1j",  0x00000, 0x20000, CRC(f5469a29) SHA1(38b6ea1fbe482b69fbb0e2f44f44a0ca2a49f6bc) )
18682158   ROM_LOAD16_BYTE( "gp0l.3j",  0x00001, 0x20000, CRC(5c18f596) SHA1(215cbda62254e31b4ff6431623384df1639bfdb7) )
18692159   ROM_LOAD16_BYTE( "gp1u.1l",  0x40000, 0x20000, CRC(146ab6b8) SHA1(aefb89585bf311f8d33f18298fea326ef1f19f1e) )
18702160   ROM_LOAD16_BYTE( "gp1l.3l",  0x40001, 0x20000, CRC(96c2463c) SHA1(e43db580e7b454af04c22e894108fbb56da0eeb5) )
18712161
18722162   ROM_REGION16_BE( 0x80000, REGION_USER1, 0 )
1873   ROM_LOAD16_BYTE( "d0u.3a",  0x00001, 0x20000, CRC(dcb27da5) SHA1(ecd72397d10313fe8dcb8589bdc5d88d4298b26c) )
1874   ROM_LOAD16_BYTE( "d0l.1a",  0x00000, 0x20000, CRC(f692a8f3) SHA1(4c29f60400b18d9ef0425de149618da6cf762ca4) )
1875   ROM_LOAD16_BYTE( "d1u.3b",  0x40001, 0x20000, CRC(ac2afd1b) SHA1(510eb41931164b086c85ba0a86d6f10b88f5e534) )
1876   ROM_LOAD16_BYTE( "d1l.1b",  0x40000, 0x20000, CRC(ebb51af1) SHA1(87b7b64ee662bf652add1e1199e42391d0e2f7e8) )
2163   ROM_LOAD16_BYTE( "d0u.3a",  0x00000, 0x20000, CRC(dcb27da5) SHA1(ecd72397d10313fe8dcb8589bdc5d88d4298b26c) )
2164   ROM_LOAD16_BYTE( "d0l.1a",  0x00001, 0x20000, CRC(f692a8f3) SHA1(4c29f60400b18d9ef0425de149618da6cf762ca4) )
2165   ROM_LOAD16_BYTE( "d1u.3b",  0x40000, 0x20000, CRC(ac2afd1b) SHA1(510eb41931164b086c85ba0a86d6f10b88f5e534) )
2166   ROM_LOAD16_BYTE( "d1l.1b",  0x40001, 0x20000, CRC(ebb51af1) SHA1(87b7b64ee662bf652add1e1199e42391d0e2f7e8) )
18772167
1878   ROM_REGION16_BE( 0x80000, REGION_USER2, 0 ) /* 3d objects */
1879   ROM_LOAD16_BYTE( "pt0u.8j", 0x00001, 0x20000, CRC(abf512a6) SHA1(e86288039d6c4dedfa95b11cb7e4b87637f90c09) )
1880   ROM_LOAD16_BYTE( "pt0l.8d", 0x00000, 0x20000, CRC(ac8d468c) SHA1(d1b457a19a5d3259d0caf933f42b3a02b485867b) )
1881   ROM_LOAD16_BYTE( "pt1u.8l", 0x40001, 0x20000, CRC(7e5dab74) SHA1(5bde219d5b4305d38d17b494b2e759f05d05329f) )
1882   ROM_LOAD16_BYTE( "pt1l.8e", 0x40000, 0x20000, CRC(38a54ec5) SHA1(5c6017c98cae674868153ff2d64532027cf0ab83) )
2168   ROM_REGION16_BE( 0x80000, REGION_USER2, 0 ) /* winrun91 - 3d objects */
2169   ROM_LOAD16_BYTE( "pt0u.8j", 0x00000, 0x20000, CRC(abf512a6) SHA1(e86288039d6c4dedfa95b11cb7e4b87637f90c09) )
2170   ROM_LOAD16_BYTE( "pt0l.8d", 0x00001, 0x20000, CRC(ac8d468c) SHA1(d1b457a19a5d3259d0caf933f42b3a02b485867b) )
2171   ROM_LOAD16_BYTE( "pt1u.8l", 0x40000, 0x20000, CRC(7e5dab74) SHA1(5bde219d5b4305d38d17b494b2e759f05d05329f) )
2172   ROM_LOAD16_BYTE( "pt1l.8e", 0x40001, 0x20000, CRC(38a54ec5) SHA1(5c6017c98cae674868153ff2d64532027cf0ab83) )
18832173
18842174   ROM_REGION16_BE( 0x100000, REGION_USER3, 0 ) /* bitmapped graphics */
1885   ROM_LOAD16_BYTE( "gd0u.1p",  0x00001, 0x40000, CRC(33f5a19b) SHA1(b1dbd242168007f80e13e11c78b34abc1668883e) )
1886   ROM_LOAD16_BYTE( "gd0l.3p",  0x00000, 0x40000, CRC(9a29500e) SHA1(c605f86b138e0a4c3163ffd967482e298a15fbe7) )
1887   ROM_LOAD16_BYTE( "gd1u.1s",  0x80001, 0x40000, CRC(17e5a61c) SHA1(272ebd7daa56847f1887809535362331b5465dec) )
1888   ROM_LOAD16_BYTE( "gd1l.3s",  0x80000, 0x40000, CRC(64df59a2) SHA1(1e9d0945b94780bb0be16803e767466d2cda07e8) )
2175   ROM_LOAD16_BYTE( "gd0u.1p",  0x00000, 0x40000, CRC(33f5a19b) SHA1(b1dbd242168007f80e13e11c78b34abc1668883e) )
2176   ROM_LOAD16_BYTE( "gd0l.3p",  0x00001, 0x40000, CRC(9a29500e) SHA1(c605f86b138e0a4c3163ffd967482e298a15fbe7) )
2177   ROM_LOAD16_BYTE( "gd1u.1s",  0x80000, 0x40000, CRC(17e5a61c) SHA1(272ebd7daa56847f1887809535362331b5465dec) )
2178   ROM_LOAD16_BYTE( "gd1l.3s",  0x80001, 0x40000, CRC(64df59a2) SHA1(1e9d0945b94780bb0be16803e767466d2cda07e8) )
18892179
18902180   ROM_REGION( 0x200000, REGION_SOUND1, 0 ) /* sound samples */
18912181   ROM_LOAD("avo1.11c",0x000000,0x80000,CRC(9fb33af3) SHA1(666630a8e5766ca4c3275961963c3e713dfdda2d) )
r1037r1038
18952185static void namcos21_init( int game_type )
18962186{
18972187   namcos2_gametype = game_type;
1898   ptram = auto_malloc(PTRAM_SIZE);
2188   pointram = auto_malloc(PTRAM_SIZE);
18992189   mpDataROM = (UINT16 *)memory_region( REGION_USER1 );
1900   mpDspState = auto_malloc( sizeof(*mpDspState) );
2190   InitDSP();
2191   mbNeedsKickstart = 20;
19012192} /* namcos21_init */
19022193
19032194static DRIVER_INIT( winrun )
19042195{
1905   /* don't use the generic namcos21_init; hardware is different */
2196   UINT16 *pMem = (UINT16 *)memory_region(REGION_CPU5);
2197   int pc = 0;
2198   pMem[pc++] = 0xff80; /* b */
2199   pMem[pc++] = 0;
2200
2201   winrun_dspcomram = auto_malloc(sizeof(UINT16)*0x1000*2);
2202
19062203   namcos2_gametype = NAMCOS21_WINRUN91;
1907   ptram = auto_malloc(PTRAM_SIZE);
19082204   mpDataROM = (UINT16 *)memory_region( REGION_USER1 );
2205   pointram = auto_malloc(PTRAM_SIZE);
2206   pointram_idx = 0;
2207   mbNeedsKickstart = 0;
19092208}
19102209
19112210static DRIVER_INIT( aircombt )
19122211{
1913#if 0
1914   /* replace first four tests of aircombj to reveal special "hidden" tests */
1915   UINT16 *pMem = (UINT16 *)memory_region( REGION_CPU1 );
1916   pMem[0x2a32/2] = 0x90;
1917   pMem[0x2a34/2] = 0x94;
1918   pMem[0x2a36/2] = 0x88;
1919   pMem[0x2a38/2] = 0x8c;
1920#endif
1921
19222212   namcos21_init( NAMCOS21_AIRCOMBAT );
19232213}
19242214
r1037r1038
19352225
19362226DRIVER_INIT( solvalou )
19372227{
2228   UINT16 *mem = (UINT16 *)memory_region(REGION_CPU1);
2229   mem[0x20ce4/2+1] = 0x0000; // $200128
2230   mem[0x20cf4/2+0] = 0x4e71; // 2nd ptr_booting
2231   mem[0x20cf4/2+1] = 0x4e71;
2232   mem[0x20cf4/2+2] = 0x4e71;
2233
19382234   namcos21_init( NAMCOS21_SOLVALOU );
19392235}
19402236
19412237DRIVER_INIT( driveyes )
19422238{
1943   namcos21_init( NAMCOS21_DRIVERS_EYES );
2239   UINT16 *pMem = (UINT16 *)memory_region(REGION_CPU5);
2240   int pc = 0;
2241   pMem[pc++] = 0xff80; /* b */
2242   pMem[pc++] = 0;
2243   winrun_dspcomram = auto_malloc(sizeof(UINT16)*0x1000*2);
2244   namcos2_gametype = NAMCOS21_DRIVERS_EYES;
2245   mpDataROM = (UINT16 *)memory_region( REGION_USER1 );
2246   pointram = auto_malloc(PTRAM_SIZE);
2247   pointram_idx = 0;
2248   mbNeedsKickstart = 0;
19442249}
19452250
19462251/*************************************************************/
r1037r1038
20262331   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
20272332INPUT_PORTS_END
20282333
2334/* "SCI - ? */
2335static INPUT_PORTS_START( winrun )
2336   PORT_START      /* 63B05Z0 - PORT B */
2337   PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
2338   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) /* ? */
2339   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) /* ? */
2340   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) /* ? */
2341   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) /* ? */
2342
2343   PORT_START      /* 63B05Z0 - PORT C & SCI */
2344   /* $a00004? */
2345   PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED )
2346   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
2347   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
2348   PORT_DIPNAME( 0x40, 0x40, "Test Switch")
2349   PORT_DIPSETTING(   0x40, DEF_STR( Off ) )
2350   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
2351   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) // advances through tests
2352
2353   PORT_START      /* 63B05Z0 - 8 CHANNEL ANALOG - CHANNEL 0 */
2354   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
2355
2356   PORT_START      /* 63B05Z0 - 8 CHANNEL ANALOG - CHANNEL 1 */
2357   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(15) PORT_KEYDELTA(10) /* gas */
2358   PORT_START      /* 63B05Z0 - 8 CHANNEL ANALOG - CHANNEL 2 */
2359   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(15) PORT_KEYDELTA(10) /* steering */
2360   PORT_START      /* 63B05Z0 - 8 CHANNEL ANALOG - CHANNEL 3 */
2361   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Z ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(15) PORT_KEYDELTA(10) /* break */
2362   PORT_START      /* 63B05Z0 - 8 CHANNEL ANALOG - CHANNEL 4 */
2363   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
2364   PORT_START      /* 63B05Z0 - 8 CHANNEL ANALOG - CHANNEL 5 */
2365   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
2366   PORT_START      /* 63B05Z0 - 8 CHANNEL ANALOG - CHANNEL 6 */
2367   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
2368   PORT_START      /* 63B05Z0 - 8 CHANNEL ANALOG - CHANNEL 7 */
2369   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
2370
2371   PORT_START      /* 63B05Z0 - PORT H */
2372   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
2373   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
2374   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
2375   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) /* shift down */
2376   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
2377   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) /* shift up */
2378   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
2379
2380   PORT_START      /* 63B05Z0 - $2000 DIP SW */
2381   /* $a00026.l */
2382   PORT_DIPNAME( 0x01, 0x01, "DIP1 (Test Mode)")
2383   PORT_DIPSETTING(   0x01, DEF_STR( Off ) )
2384   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
2385   PORT_DIPNAME( 0x02, 0x02, "DIP2")
2386   PORT_DIPSETTING(   0x02, DEF_STR( Off ) )
2387   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
2388   PORT_DIPNAME( 0x04, 0x04, "DIP3")
2389   PORT_DIPSETTING(   0x04, DEF_STR( Off ) )
2390   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
2391   PORT_DIPNAME( 0x08, 0x08, "DIP4")
2392   PORT_DIPSETTING(   0x08, DEF_STR( Off ) )
2393   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
2394   PORT_DIPNAME( 0x10, 0x10, "DIP5")
2395   PORT_DIPSETTING(   0x10, DEF_STR( Off ) )
2396   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
2397   PORT_DIPNAME( 0x20, 0x20, "DIP6")
2398   PORT_DIPSETTING(   0x20, DEF_STR( Off ) )
2399   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
2400   PORT_DIPNAME( 0x40, 0x40, "DIP7")
2401   PORT_DIPSETTING(   0x40, DEF_STR( Off ) )
2402   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
2403   PORT_DIPNAME( 0x80, 0x80, "DIP8")
2404   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
2405   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
2406
2407   PORT_START      /* 63B05Z0 - $3000 */
2408   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
2409   PORT_START      /* 63B05Z0 - $3001 */
2410   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
2411   PORT_START      /* 63B05Z0 - $3002 */
2412   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
2413   PORT_START      /* 63B05Z0 - $3003 */
2414   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
2415INPUT_PORTS_END
2416
20292417static INPUT_PORTS_START( cybsled )
20302418   PORT_START      /* 63B05Z0 - PORT B */
20312419   PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
r1037r1038
20422430   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN3 )
20432431
20442432   PORT_START      /* 63B05Z0 - 8 CHANNEL ANALOG - CHANNEL 0 */
2045   PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(2) /* right joystick: vertical */
2433   PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_Y ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(2) /* right joystick: vertical */
20462434   PORT_START      /* 63B05Z0 - 8 CHANNEL ANALOG - CHANNEL 1 */
2047   PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(1) /* left joystick: vertical */
2435   PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_Y ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(1) /* left joystick: vertical */
20482436   PORT_START      /* 63B05Z0 - 8 CHANNEL ANALOG - CHANNEL 2 */
2049   PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(2) /* right joystick: horizontal */
2437   PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(2) /* right joystick: horizontal */
20502438   PORT_START      /* 63B05Z0 - 8 CHANNEL ANALOG - CHANNEL 3 */
2051   PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(1) /* left joystick: horizontal */
2439   PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(1) /* left joystick: horizontal */
20522440   PORT_START      /* 63B05Z0 - 8 CHANNEL ANALOG - CHANNEL 4 */
20532441   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
20542442   PORT_START      /* 63B05Z0 - 8 CHANNEL ANALOG - CHANNEL 5 */
r1037r1038
21222510   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
21232511
21242512   PORT_START      /* IN#3: 63B05Z0 - 8 CHANNEL ANALOG - CHANNEL 1 */
2125   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4)
2513   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(4)
21262514
21272515   PORT_START      /* IN#4: 63B05Z0 - 8 CHANNEL ANALOG - CHANNEL 2 */
2128   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4)
2516   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(4)
21292517
21302518   PORT_START      /* IN#5: 63B05Z0 - 8 CHANNEL ANALOG - CHANNEL 3 */
2131   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_PLAYER(2)
2519   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_PLAYER(2)
21322520
21332521   PORT_START      /* IN#6: 63B05Z0 - 8 CHANNEL ANALOG - CHANNEL 4 */
21342522   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
r1037r1038
21842572   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
21852573INPUT_PORTS_END
21862574
2187/*    YEAR, NAME,     PARENT,   MACHINE,           INPUT,        INIT,     MONITOR, COMPANY, FULLNAME,             FLAGS */
2188GAME( 1992, aircombj, 0,       poly_c140_typeB,   aircombt,     aircombt, ROT0,    "Namco", "Air Combat (Japan)", GAME_NOT_WORKING ) /* mostly working */
2189GAME( 1992, aircombu, aircombj,poly_c140_typeB,   aircombt,     aircombt, ROT0,    "Namco", "Air Combat (US)",     GAME_NOT_WORKING ) /* mostly working */
2190GAME( 1993, cybsled,  0,       poly_c140_typeA,   cybsled,      cybsled,  ROT0,    "Namco", "Cyber Sled",         GAME_NOT_WORKING ) /* mostly working */
2191GAME( 1987, driveyes, 0,       poly_c140_typeA,   s21default,   driveyes, ROT0,    "Namco", "Driver's Eyes",      GAME_NOT_WORKING )
2575/*    YEAR, NAME,     PARENT,  MACHINE,           INPUT,        INIT,     MONITOR,  COMPANY,   FULLNAME,                       FLAGS */
2576GAME( 1992, aircombj, 0,       poly_c140_typeB,   aircombt,     aircombt, ROT0,    "Namco", "Air Combat (Japan)",            GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
2577GAME( 1992, aircombu, aircombj,poly_c140_typeB,   aircombt,     aircombt, ROT0,    "Namco", "Air Combat (US)",                GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
2578GAME( 1993, cybsled,  0,       poly_c140_typeA,   cybsled,      cybsled,  ROT0,    "Namco", "Cyber Sled (US)",               GAME_IMPERFECT_GRAPHICS )
2579GAME( 1993, cybsledj, cybsled, poly_c140_typeA,   cybsled,      cybsled,  ROT0,    "Namco", "Cyber Sled (Japan)",            GAME_IMPERFECT_GRAPHICS )
21922580/* 1992, ShimDrive */
2193GAME( 1991, solvalou, 0,       poly_c140_typeA,   s21default,   solvalou, ROT0,    "Namco", "Solvalou (Japan)",   GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) /* working and playable */
2194GAME( 1991, starblad, 0,       poly_c140_typeA,   s21default,   starblad, ROT0,    "Namco", "Starblade",        GAME_IMPERFECT_GRAPHICS ) /* working and playable */
2195GAME( 1988, winrun,   0,       winrun_c140_typeB, s21default,   winrun,   ROT0,    "Namco", "Winning Run",        GAME_NOT_WORKING )
2196/* 1989, Winning Run Suzuka Grand Prix */
2197GAME( 1991, winrun91, 0,       winrun_c140_typeB, s21default,   winrun,   ROT0,    "Namco", "Winning Run 91",      GAME_NOT_WORKING ) /* not working */
2581GAME( 1991, solvalou, 0,       poly_c140_typeA,   s21default,   solvalou, ROT0,    "Namco", "Solvalou (Japan)",              GAME_IMPERFECT_GRAPHICS )
2582GAME( 1991, starblad, 0,       poly_c140_typeA,   s21default,   starblad, ROT0,    "Namco", "Starblade",                     GAME_IMPERFECT_GRAPHICS )
2583GAME( 1991, winrun91, 0,       winrun_c140_typeB, winrun,       winrun,   ROT0,    "Namco", "Winning Run 91",                GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
2584GAME( 1989, winrun,   0,       winrun_c140_typeB, winrun,       winrun,   ROT0,    "Namco", "Winning Run Suzuka Grand Prix", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
2585/* 1988, Winning Run */
2586GAME( 1987, driveyes, 0,       driveyes,          winrun,       driveyes, ROT0,    "Namco", "Driver's Eyes",                 GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/st0016.c
r1037r1038
55
66Todo:
77- find NMI source, and NMI enable/disable (timer ? video hw ?)
8
9Not working games :
10- Super Real Mahjong P5
118*/
129
1310#include "driver.h"
1411#include "cpu/z80/z80.h"
15#include "cpu/mips/r3000.h"
1612#include "sound/st0016.h"
1713#include "st0016.h"
1814
r1037r1038
9187
9288/*************************************
9389 *
94 *  Machine's structure ST0016 + R3000
95 *
96 *************************************/
97
98static struct r3000_config config =
99{
100   0,   /* 1 if we have an FPU, 0 otherwise */
101   4096,   /* code cache size */
102   4096   /* data cache size */
103};
104
105static ADDRESS_MAP_START( srmp5_mem, ADDRESS_SPACE_PROGRAM, 32 )
106   AM_RANGE(0x00000000, 0x001fffff) AM_RAM
107   AM_RANGE(0x002f0000, 0x002f7fff) AM_RAM
108   AM_RANGE(0x01000000, 0x01000003) AM_WRITE(MWA32_RAM)
109   AM_RANGE(0x01800000, 0x01800003) AM_WRITE(MWA32_RAM)
110   AM_RANGE(0x01800004, 0x01800007) AM_READ(MRA32_RAM)
111   AM_RANGE(0x01800008, 0x0180000b) AM_READ(MRA32_RAM)
112   AM_RANGE(0x0180000c, 0x0180000f) AM_WRITE(MWA32_RAM)
113   AM_RANGE(0x01800014, 0x01800017) AM_READ(MRA32_RAM)
114   AM_RANGE(0x0180001c, 0x0180001f) AM_WRITE(MWA32_RAM)
115   AM_RANGE(0x01800200, 0x01800203) AM_WRITE(MWA32_RAM)
116   AM_RANGE(0x01802000, 0x01802003) AM_WRITE(MWA32_RAM)
117   AM_RANGE(0x01802004, 0x01802007) AM_WRITE(MWA32_RAM)
118   AM_RANGE(0x01802008, 0x0180200b) AM_READ(MRA32_RAM)
119   AM_RANGE(0x01a00200, 0x01a00223) AM_READ(MRA32_RAM)
120   AM_RANGE(0x01c00000, 0x01c00003) AM_READ(MRA32_RAM)
121   AM_RANGE(0x0a000000, 0x0a00ffff) AM_RAM
122   AM_RANGE(0x0a100000, 0x0a105fff) AM_RAM
123   AM_RANGE(0x0a180000, 0x0a1801ff) AM_RAM
124   AM_RANGE(0x0a200000, 0x0a3fffff) AM_RAM
125   AM_RANGE(0x1eff0000, 0x1eff0013) AM_WRITE(MWA32_RAM)
126   AM_RANGE(0x1fc00000, 0x1fdfffff) AM_READ(MRA32_ROM) AM_WRITE(MWA32_ROM) AM_REGION(REGION_USER1, 0)
127ADDRESS_MAP_END
128
129/*************************************
130 *
13190 *  Machine's structure ST0016 + V810
13291 *
13392 *************************************/
r1037r1038
429388   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
430389INPUT_PORTS_END
431390
432INPUT_PORTS_START( srmp5 )
433   PORT_START_TAG("IN0")
434   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
435
436   PORT_START_TAG("IN1")
437   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
438
439   PORT_START_TAG("IN2")
440   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
441   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
442   PORT_SERVICE( 0x04, IP_ACTIVE_LOW)
443   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
444
445   PORT_START_TAG("IN3")
446   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
447
448   PORT_START_TAG("IN4")
449   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
450
451   PORT_START_TAG("IN5")
452   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
453INPUT_PORTS_END
454
455391static const gfx_decode gfxdecodeinfo[] =
456392{
457393//  { 0, 0, &charlayout,      0, 16*4  },
r1037r1038
518454   MDRV_INTERLEAVE(1)
519455MACHINE_DRIVER_END
520456
521static MACHINE_DRIVER_START( srmp5 )
522   MDRV_IMPORT_FROM(st0016)
523   MDRV_CPU_ADD(R3000LE, 16000000)
524   MDRV_CPU_CONFIG(config)
525   MDRV_CPU_PROGRAM_MAP(srmp5_mem,0)
526MACHINE_DRIVER_END
527
528457/*************************************
529458 *
530459 *  ROM definition(s)
r1037r1038
612541   ROM_COPY( REGION_CPU1,  0x10000, 0x00000, 0x08000 )
613542ROM_END
614543
615/*
616Super Real Mahjong P5
617(c)199x SETA
618544
619CPU   : R3560(custom?)
620SOUND : TC6210AF(custom?)
621OSC.  : 50.0000MHz 42.9545MHz
622
623SX008-01.BIN ; CHR ROM
624SX008-02.BIN ;  |
625SX008-03.BIN ;  |
626SX008-04.BIN ;  |
627SX008-05.BIN ;  |
628SX008-06.BIN ;  |
629SX008-07.BIN ; /
630SX008-08.BIN ; SOUND DATA
631SX008-09.BIN ; /
632SX008-11.BIN ; MAIN PRG
633SX008-12.BIN ;  |
634SX008-13.BIN ;  |
635SX008-14.BIN ; /
636
637*/
638
639ROM_START( srmp5 )
640   ROM_REGION( 0x210000, REGION_CPU1, 0 )
641   ROM_LOAD( "sx008-08.bin",   0x10000, 0x200000,   CRC(d4ac54f4) SHA1(c3dc76cd71485796a0b6a960294ea96eae8c946e) )
642   ROM_COPY( REGION_CPU1,  0x10000, 0x00000, 0x08000 )
643
644   ROM_REGION32_BE( 0x200000, REGION_USER1, 0 )
645   ROM_LOAD32_BYTE( "sx008-14.bin",   0x00000, 0x80000,   CRC(b5c55120) SHA1(0a41351c9563b2c6a00709189a917757bd6e0a24) )
646   ROM_LOAD32_BYTE( "sx008-13.bin",   0x00001, 0x80000,   CRC(0af475e8) SHA1(24cddffa0f8c81832ae8870823d772e3b7493194) )
647   ROM_LOAD32_BYTE( "sx008-12.bin",   0x00002, 0x80000,   CRC(43e9bb98) SHA1(e46dd98d2e1babfa12ddf2fa9b31377e8691d3a1) )
648   ROM_LOAD32_BYTE( "sx008-11.bin",   0x00003, 0x80000,   CRC(ca15ff45) SHA1(5ee610e0bb835568c36898210a6f8394902d5b54) )
649
650   ROM_REGION( 0x200000*8, REGION_USER2,0) /* gfx ? */
651   ROM_LOAD( "sx008-01.bin",   0x000000, 0x200000,   CRC(82dabf48) SHA1(c53e9ed0056c431eab13ab362936c25d3cc5abba) )
652   ROM_LOAD( "sx008-02.bin",   0x200000, 0x200000,   CRC(cfd2be0f) SHA1(a21f2928e08047c97443123aceba7ff4e95c6d3d) )
653   ROM_LOAD( "sx008-03.bin",   0x400000, 0x200000,   CRC(d7323b10) SHA1(94ecc17b6b8b071cf2c61bbef4aec2c6c7693c62) )
654   ROM_LOAD( "sx008-04.bin",   0x600000, 0x200000,   CRC(b10d3067) SHA1(21c36307780d4f38ec54d87cd222d65e4f8c00a5) )
655   ROM_LOAD( "sx008-05.bin",   0x800000, 0x200000,   CRC(0ff5e6f5) SHA1(ab7d021757f341d28db6d7d009c20ec9d7bd83c1) )
656   ROM_LOAD( "sx008-06.bin",   0xa00000, 0x200000,   CRC(ba6fd7c4) SHA1(f086195c5c647e07e77ce2a23e94d28e6ad9ff4f) )
657   ROM_LOAD( "sx008-07.bin",   0xc00000, 0x200000,   CRC(3564485d) SHA1(12464de4e2b6c4df1595183996d1987f0ecffb01) )
658   ROM_LOAD( "sx008-09.bin",   0xe00000, 0x200000,   CRC(5a3e6560) SHA1(92ea398f3c5e3035869f0ca5dfe7b05c90095318) )
659ROM_END
660
661545/*
662546Mayjinsen (JPN Ver.)
663547(c)1994 Seta
r1037r1038
753637   st0016_game=1;
754638}
755639
756static DRIVER_INIT(srmp5)
757{
758   st0016_game=2;
759}
760
761640static DRIVER_INIT(mayjinsn)
762641{
763642   st0016_game=4|0x80;
r1037r1038
781660GAME(  1994, mayjisn2,   0,     mayjinsn, mayjisn2, mayjisn2, ROT0, "Seta",  "Mayjinsen 2", 0)
782661GAME(  1995, koikois,    0,     st0016, koikois, renju, ROT0, "Visco",  "Koi Koi Shimasho", GAME_IMPERFECT_GRAPHICS)
783662/* Not working */
784GAME( 199?, srmp5,   0,     srmp5,    srmp5,    srmp5,    ROT0, "Seta",  "Super Real Mahjong P5",GAME_NOT_WORKING)
785663GAME( 1994, mayjinsn,   0,     mayjinsn, st0016,   mayjinsn, ROT0, "Seta",  "Mayjinsen",GAME_IMPERFECT_GRAPHICS|GAME_NOT_WORKING)
src/mame/drivers/couple.c
r1037r1038
8686   tilemap_mark_tile_dirty(bg_tilemap,offset);
8787}
8888
89#ifdef UNUSED_FUNCTION
8990static READ8_HANDLER( dummy_inputs_r )
9091{
9192   logerror("Read %02x @ %06x\n",offset,activecpu_get_pc());
9293   return 0xff;
9394}
95#endif
9496
9597/*static UINT8 unk_data;
9698
src/mame/drivers/seattle.c
r1037r1038
503503
504504static VIDEO_UPDATE( seattle )
505505{
506   voodoo_update(0, bitmap, cliprect);
507   return 0;
506   return voodoo_update(0, bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED;
508507}
509508
510509
src/mame/drivers/ssv.c
r1037r1038
5252-----------------------------------------------------------------------------------
5353
5454(1) Uses ST-0009 & ST-0020 & Light Gun
55(2) Uses NEC V810 CPU as sub cpu
55(2) Uses NEC V810 CPU as sub cpu for the AI (basically the same as the majinsen games on st0016)
5656
5757SSV Hardware Overview
5858Sammy/Seta/Visco, 1993-2001
r1037r1038
403403
404404***************************************************************************/
405405
406#ifdef UNUSED_FUNCTION
406407static READ16_HANDLER( fake_r )   {   return ssv_scroll[offset];  }
408#endif
407409
408410#define SSV_READMEM( _ROM  )                              \
409411   AM_RANGE(0x000000, 0x00ffff) AM_READ(MRA16_RAM            )   /*  RAM     */   \
r1037r1038
969971            Joryuu Syougi Kyoushitsu
970972***************************************************************************/
971973
972static ADDRESS_MAP_START( jsk_mem,ADDRESS_SPACE_PROGRAM, 32 )
974/* from st0016.c */
975
976static UINT32 latches[8];
977
978static READ32_HANDLER(latch32_r)
979{
980   if(!offset)
981      latches[2]&=~2;
982   return latches[offset];
983}
984
985static WRITE32_HANDLER(latch32_w)
986{
987   if(!offset)
988      latches[2]|=1;
989   COMBINE_DATA(&latches[offset]);
990   timer_call_after_resynch(0, NULL);
991}
992
993static READ16_HANDLER(latch16_r)
994{
995   if(!offset)
996      latches[2]&=~1;
997   return latches[offset];
998}
999
1000static WRITE16_HANDLER(latch16_w)
1001{
1002   if(!offset)
1003      latches[2]|=2;
1004   latches[offset]=data;
1005   timer_call_after_resynch(0, NULL);
1006}
1007
1008static ADDRESS_MAP_START( jsk_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1009   AM_RANGE(0x050000, 0x05ffff) AM_READ(ssv_mainram_r ) // RAM Mirror?
1010   AM_RANGE(0x400000, 0x47ffff) AM_READ(MRA16_RAM   )   // RAM?
1011   AM_RANGE(0x900000, 0x900007) AM_READ(latch16_r)
1012   SSV_READMEM( 0xf00000 )
1013ADDRESS_MAP_END
1014static ADDRESS_MAP_START( jsk_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1015   AM_RANGE(0x050000, 0x05ffff) AM_WRITE(ssv_mainram_w ) // RAM Mirror?
1016   AM_RANGE(0x210000, 0x210001) AM_WRITE(watchdog_reset16_w   )   // Watchdog
1017   AM_RANGE(0x400000, 0x47ffff) AM_WRITE(MWA16_RAM            )   // RAM?
1018   AM_RANGE(0x900000, 0x900007) AM_WRITE(latch16_w)
1019   SSV_WRITEMEM
1020ADDRESS_MAP_END
1021
1022
1023static ADDRESS_MAP_START( jsk_v810_mem,ADDRESS_SPACE_PROGRAM, 32 )
9731024   AM_RANGE(0x00000000, 0x0001ffff) AM_RAM
9741025   AM_RANGE(0x80000000, 0x8001ffff) AM_RAM
9751026   AM_RANGE(0xc0000000, 0xc001ffff) AM_RAM
976   AM_RANGE(0x40000000, 0x4000000f) AM_NOP // I/O
977   AM_RANGE(0xfff80000, 0xffffffff) AM_READ(MRA32_BANK2)
1027   AM_RANGE(0x40000000, 0x4000000f) AM_READ(latch32_r) AM_WRITE(latch32_w)
1028   AM_RANGE(0xfff80000, 0xffffffff) AM_ROM AM_REGION(REGION_CPU2, 0)
9781029ADDRESS_MAP_END
9791030
1031
9801032/***************************************************************************
9811033  Eagle Shot Golf
9821034***************************************************************************/
r1037r1038
17651817
17661818
17671819/***************************************************************************
1820                           Joryuu Syougi Kyoushitsu
1821***************************************************************************/
1822
1823INPUT_PORTS_START( jsk )
1824   PORT_START   // IN0 - $210002
1825   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coinage ) )
1826   PORT_DIPSETTING(      0x0000, DEF_STR( 5C_1C ) )
1827   PORT_DIPSETTING(      0x0001, DEF_STR( 4C_1C ) )
1828   PORT_DIPSETTING(      0x0002, DEF_STR( 3C_1C ) )
1829   PORT_DIPSETTING(      0x0003, DEF_STR( 2C_1C ) )
1830   PORT_DIPSETTING(      0x0007, DEF_STR( 1C_1C ) )
1831   PORT_DIPSETTING(      0x0006, DEF_STR( 1C_2C ) )
1832   PORT_DIPSETTING(      0x0005, DEF_STR( 1C_3C ) )
1833   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_4C ) )
1834   PORT_SERVICE( 0x0008, IP_ACTIVE_LOW )
1835   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Flip_Screen ) )
1836   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
1837   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1838   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) )
1839   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
1840   PORT_DIPSETTING(      0x0020, DEF_STR( On ) )
1841   PORT_DIPNAME( 0x00c0, 0x00c0, "Minutes" )
1842   PORT_DIPSETTING(      0x0080, "3" )
1843   PORT_DIPSETTING(      0x00c0, "4" )
1844   PORT_DIPSETTING(      0x0040, "5" )
1845   PORT_DIPSETTING(      0x0000, "6" )
1846
1847   PORT_START   // IN1 - $210004
1848   PORT_DIPNAME( 0x0007, 0x0007, "Difficulty A" )   // 8 fixed levels
1849   PORT_DIPSETTING(      0x0000, "1 (Novice)" )
1850   PORT_DIPSETTING(      0x0001, "2" )
1851   PORT_DIPSETTING(      0x0002, "3" )
1852   PORT_DIPSETTING(      0x0003, "4" )
1853   PORT_DIPSETTING(      0x0007, "5 (Medium)" )
1854   PORT_DIPSETTING(      0x0006, "6" )
1855   PORT_DIPSETTING(      0x0005, "7" )
1856   PORT_DIPSETTING(      0x0004, "8 (expert)"    )
1857   PORT_DIPNAME( 0x0008, 0x0008, "Difficulty Switch" )
1858   PORT_DIPSETTING(      0x0008, "A (8 Levels)" )
1859   PORT_DIPSETTING(      0x0000, "B (4 Levels)" )
1860   PORT_DIPNAME( 0x0030, 0x0030, "Difficulty B" )   // 4 levels, and player can select 3 levels during game
1861   PORT_DIPSETTING(      0x0020, DEF_STR( Easy )    )
1862   PORT_DIPSETTING(      0x0030, DEF_STR( Normal )  )
1863   PORT_DIPSETTING(      0x0010, DEF_STR( Hard )    )
1864   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
1865   PORT_DIPNAME( 0x0040, 0x0040, "Campaign" )
1866   PORT_DIPSETTING(      0x0040, "Available" )
1867   PORT_DIPSETTING(      0x0000, "Finished" )
1868   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
1869   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
1870   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1871
1872   PORT_START   // IN2 - $210008
1873   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 )
1874   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
1875   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON2 )
1876   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON1 )
1877   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
1878   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
1879   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
1880   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_UP   )
1881
1882   PORT_START   // IN3 - $21000a
1883   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START2 )   // start1+start2 enter sound test in service mode
1884   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
1885   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
1886   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
1887   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1888   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1889   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1890   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
1891
1892   PORT_START   // IN4 - $21000c
1893   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(10)
1894   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1895   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
1896   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1897   PORT_BIT( 0x00f0, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1898INPUT_PORTS_END
1899
1900
1901/***************************************************************************
17681902                                Keith & Lucy
17691903***************************************************************************/
17701904
r1037r1038
33653499DRIVER_INIT( vasara )      {   init_ssv();
33663500                        ssv_sprites_offsx = +0;   ssv_sprites_offsy = +0xf0;
33673501                        ssv_tilemap_offsx = +0;   ssv_tilemap_offsy = -0xf8;   }
3368DRIVER_INIT( jsk )         {   memory_set_bankptr(2, memory_region(REGION_USER2));
3369                        init_ssv();
3370                        ssv_sprites_offsx = +0;   ssv_sprites_offsy = +0xe8;
3371                        ssv_tilemap_offsx = +0;   ssv_tilemap_offsy = -0xf0;   }
3502DRIVER_INIT( jsk )         {   init_ssv();
3503                        ssv_sprites_offsx = -8;   ssv_sprites_offsy = +0xf5;
3504                        ssv_tilemap_offsx = 0;   ssv_tilemap_offsy = -0xf4;   }
33723505
33733506
33743507static MACHINE_DRIVER_START( ssv )
r1037r1038
36373770   /* basic machine hardware */
36383771   MDRV_IMPORT_FROM(ssv)
36393772   MDRV_CPU_MODIFY("main")
3640   MDRV_CPU_PROGRAM_MAP(janjans1_readmem, janjans1_writemem)
3773   MDRV_CPU_PROGRAM_MAP(jsk_readmem, jsk_writemem)
36413774
36423775   MDRV_CPU_ADD(V810,25000000)
3643   MDRV_CPU_PROGRAM_MAP(jsk_mem, 0)
3776   MDRV_CPU_PROGRAM_MAP(jsk_v810_mem, 0)
36443777
36453778   /* video hardware */
36463779   MDRV_SCREEN_VISIBLE_AREA(0, 0x150-1, 0, 0xf0-1)
r1037r1038
40834216
40844217/***************************************************************************
40854218
4086                            Joryuu Syougi Kyoushitsu
4087
4219Joryuu Syougi Kyoushitsu
40884220(c)1997 Visco, System SSV ROM board
40894221
40904222CPU : NEC JAPAN D70732GD-25 (C)NEC1991 V810 9651MK007
r1037r1038
40944226JSK-U4 .BIN [ec22fb41] - (27c1001)
40954227JSK-U24.BIN [1fa6e156]  |
40964228JSK-U38.BIN [8e5c0de3]  |
4097JSK-U52.BIN [19cc585f] /
4229JSK-U52.BIN [b11aef0c] /
40984230
4099JSK-U71.BIN [b529f331] - (27c1001)
4100JSK-U72.BIN [41ed8a9f] /
4231JSK-U71.BIN [f6774fba] - (27c040)
4232JSK-U72.BIN [db6b2554] /
41014233
41024234JSK-S0.U65  [8d1a9aeb] - (16M mask)
41034235
r1037r1038
41104242U53.BIN     [--------] - GAL16V8B
41114243U70.BIN     [--------] /
41124244
4245dumped by sayu
4246
4247Note, in the old bad dump u52 had a few different bytes:
4248
4249ROM_LOAD32_BYTE( "jsk-u52.bin", 0x00000, 0x20000, CRC(19cc585f) SHA1(b53138e93d40c0cf03aee838d7653f5665d9cf35) )
4250
4251addr   old  this
42521FF8F: FF   00
42531FF97: FF   00
42541FFB7: FF   00
42551FFCF: FF   00
42561FFD7: FF   00
42571FFF7: FF   00
4258
41134259***************************************************************************/
41144260
41154261ROM_START( jsk )
4116   ROM_REGION16_LE( 0x400000, REGION_USER1, 0 )
4117   ROM_LOAD16_WORD( "jsk-main.bin", 0x000000, 0x100000, NO_DUMP ) // missing ?
4262   ROM_REGION16_LE( 0x100000, REGION_USER1, 0 )
4263   ROM_LOAD16_BYTE( "jsk-u72.bin", 0x00000, 0x80000, CRC(db6b2554) SHA1(c4c6617461e1d3f8660a2b97fd2c38ef245f0d4a) )
4264   ROM_LOAD16_BYTE( "jsk-u71.bin", 0x00001, 0x80000, CRC(f6774fba) SHA1(3a74e5091d9d72e4f92c7c637cfe5c0dcc60bbe1) )
41184265
4119   ROM_LOAD16_BYTE( "jsk-u72.bin", 0x80000, 0x20000, CRC(41ed8a9f) SHA1(a81efc91fbf1abc70ed64f4fa9b828a8b6f554ec) )
4120   ROM_LOAD16_BYTE( "jsk-u71.bin", 0x80001, 0x20000, CRC(b529f331) SHA1(be6259f5c3a6106280a4b519f83ee008d761be4e) )
4266   ROM_REGION( 0x20000*4, REGION_CPU2, 0 )
4267   ROM_LOAD32_BYTE( "jsk-u52.bin", 0x00000, 0x20000, CRC(b11aef0c) SHA1(37c0fedd6454a05b647513600f1b0998c572c7a5) )
4268   ROM_LOAD32_BYTE( "jsk-u38.bin", 0x00001, 0x20000, CRC(8e5c0de3) SHA1(54c5dfd858086b0eb7ffa82c19fb1dfd7752d50e) )
4269   ROM_LOAD32_BYTE( "jsk-u24.bin", 0x00002, 0x20000, CRC(1fa6e156) SHA1(4daedf660d89c185c945d4a526312f6528fe7b17) )
4270   ROM_LOAD32_BYTE( "jsk-u4.bin",  0x00003, 0x20000, CRC(ec22fb41) SHA1(c0d6b0a92075214a91da78be52d273771cb9f646) )
41214271
41224272   ROM_REGION( 0x1000000, REGION_GFX1, ROMREGION_DISPOSE )   /* Sprites */
4123   ROM_LOAD( "jsk-a0.bin", 0x0000000, 0x200000, CRC(4bac3196) SHA1(e9530278f60e789074411c6b2f20695c3af87b87) )
4124   ROM_LOAD( "jsk-b0.bin", 0x0400000, 0x200000, CRC(40664e5a) SHA1(ba0c24f727d502688a37ed67dad0e3aaad33afc4) )
4125   ROM_LOAD( "jsk-c0.bin", 0x0800000, 0x200000, CRC(2a230e64) SHA1(2af8144b84703f896971a2819d7b7a1f662cec92) )
4126   ROM_LOAD( "jsk-d0.bin", 0x0c00000, 0x200000, CRC(911e53a6) SHA1(9657180b4371172babcb21ad93c6253ac5d58f86) )
4273   ROM_LOAD( "jsk-a0.bin", 0x0000000, 0x400000, CRC(18981a19) SHA1(b4bf93f38099963350b9e5e64890ce7adc1bc983) )
4274   ROM_LOAD( "jsk-b0.bin", 0x0400000, 0x400000, CRC(f6df0ff9) SHA1(d7736e4ae6e099aef320a59668d7f17590c346b9) )
4275   ROM_LOAD( "jsk-c0.bin", 0x0800000, 0x400000, CRC(b8282939) SHA1(d041fb013e5011bf6b9d9bc2c816b2f3969723b7) )
4276   ROM_LOAD( "jsk-d0.bin", 0x0c00000, 0x400000, CRC(fc733e0c) SHA1(951060f6600b8b677ad2f41f59071c375ea9d4cf) )
41274277
4128   ROM_REGION16_BE( 0x400000, REGION_SOUND1, ROMREGION_ERASE | 0 )   /* Samples */
4278   ROM_REGION16_BE( 0x400000, REGION_SOUND1, ROMREGION_ERASE )   /* Samples */
41294279   ROM_LOAD16_BYTE( "jsk-s0.u65", 0x000000, 0x200000, CRC(8d1a9aeb) SHA1(37316bd3e8cbe2a84239e1a11a56d4fe4723ae1a) )
41304280
41314281   ROM_REGION16_BE( 0x400000, REGION_SOUND2, 0 )   /* Samples */
r1037r1038
41364286
41374287   ROM_REGION16_BE( 0x400000, REGION_SOUND4, 0 ) /* Samples */
41384288   ROM_COPY( REGION_SOUND1, 0x000000, 0x000000, 0x400000 )
4139
4140   ROM_REGION32_LE( 0x20000*4, REGION_USER2, 0 )
4141   ROM_LOAD32_BYTE( "jsk-u4.bin",  0x00003, 0x20000, CRC(ec22fb41) SHA1(c0d6b0a92075214a91da78be52d273771cb9f646) )
4142   ROM_LOAD32_BYTE( "jsk-u24.bin", 0x00002, 0x20000, CRC(1fa6e156) SHA1(4daedf660d89c185c945d4a526312f6528fe7b17) )
4143   ROM_LOAD32_BYTE( "jsk-u38.bin", 0x00001, 0x20000, CRC(8e5c0de3) SHA1(54c5dfd858086b0eb7ffa82c19fb1dfd7752d50e) )
4144   ROM_LOAD32_BYTE( "jsk-u52.bin", 0x00000, 0x20000, CRC(19cc585f) SHA1(b53138e93d40c0cf03aee838d7653f5665d9cf35) )
41454289ROM_END
41464290
41474291
r1037r1038
52565400GAME( 1996?, meosism,  0,        meosism,  meosism,  meosism,  ROT0,   "Sammy",              "Meosis Magic (Japan)",                             GAME_NO_COCKTAIL )
52575401GAME( 1996,  stmblade, 0,        stmblade, stmblade, stmblade, ROT270, "Visco",              "Storm Blade (US)",                                 GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
52585402GAME( 1997,  hypreac2, 0,        hypreac2, hypreac2, hypreac2, ROT0,   "Sammy",              "Mahjong Hyper Reaction 2 (Japan)",                 GAME_NO_COCKTAIL )
5403GAME( 1997,  jsk,      0,        jsk,      jsk,      jsk,      ROT0,   "Visco",              "Joryuu Syougi Kyoushitsu (Japan)",                 GAME_NO_COCKTAIL )
52595404GAME( 1997,  koikois2, 0,        janjans1, koikois2, janjans1, ROT0,   "Visco",              "Koi Koi Shimasho 2 - Super Real Hanafuda (Japan)", GAME_NO_COCKTAIL )
52605405GAME( 1997,  mslider,  0,        mslider,  mslider,  mslider,  ROT0,   "Visco / Datt Japan", "Monster Slider (Japan)",                           GAME_NO_COCKTAIL )
52615406GAME( 1997,  srmp7,    0,        srmp7,    srmp7,    srmp7,    ROT0,   "Seta",               "Super Real Mahjong P7 (Japan)",                    GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND )
r1037r1038
52675412GAME( 2000,  vasara,   0,        ryorioh,  vasara,   vasara,   ROT270, "Visco",              "Vasara",                                           GAME_NO_COCKTAIL )
52685413GAME( 2001,  vasara2,  0,        ryorioh,  vasara2,  vasara,   ROT270, "Visco",              "Vasara 2 (set 1)",                                 GAME_NO_COCKTAIL )
52695414GAME( 2001,  vasara2a, vasara2,  ryorioh,  vasara2,  vasara,   ROT270, "Visco",              "Vasara 2 (set 2)",                                 GAME_NO_COCKTAIL )
5270
5271
5272//  Games not working properly:
5273
5274
5275//  Games not working at all:
5276
5277GAME( 1997,  jsk,      0,        jsk,      janjans1, jsk,      ROT0,   "Visco",              "Joryuu Syougi Kyoushitsu (Japan)",                 GAME_NO_COCKTAIL | GAME_NOT_WORKING )
src/mame/drivers/hshavoc.c
r1037r1038
109109   AM_RANGE(0x200000, 0x2023ff) AM_WRITE(MWA16_RAM) // tested
110110   AM_RANGE(0xa10000, 0xa1001f) AM_WRITE(genesis_io_w) AM_BASE(&genesis_io_ram)            /* Genesis Input */
111111   AM_RANGE(0xa11000, 0xa11203) AM_WRITE(genesis_ctrl_w)
112   AM_RANGE(0xa00000, 0xa0ffff) AM_WRITE(megaplay_68k_to_z80_w)
112   AM_RANGE(0xa00000, 0xa0ffff) AM_WRITE(genesis_68k_to_z80_w)
113113   AM_RANGE(0xc00000, 0xc0001f) AM_WRITE(genesis_vdp_w)            /* VDP Access */
114114   AM_RANGE(0xfe0000, 0xfeffff) AM_WRITE(MWA16_BANK4)
115115   AM_RANGE(0xff0000, 0xffffff) AM_WRITE(MWA16_RAM) AM_BASE(&genesis_68k_ram)/* Main Ram */
src/mame/drivers/opwolf.c
r1037r1038
4646  - Notice screen only if region = 0x0001
4747  - When "Language" Dip Switch is set to Japanese, you can also select your starting level;
4848    however, only the 4 first levels are available ! Correct behaviour ?
49  - There's code at 0x00e090 that tests contents of 0x03ffb2.w :
50    if it is 0x0000, the highscore isn't displayed, but value = 0x00ff
4951
522) 'opwolfa'
5053
512) 'opwolfb'
54  - Region stored at 0x03fffe.w
55  - Sets :
56      * 'opwolfa' : region = 0x0003
57  - There is only ONE byte of difference at 0x03fff5.b with 'opwolf'
58    but its effect is unknown as this adress doesn't seem to be read !
5259
603) 'opwolfb'
61
5362  - Region stored at 0x03fffe.w
5463  - Sets :
5564      * 'opwolfb' : region = 0x0003
src/mame/drivers/firebeat.c
r1037r1038
232232      u = 0;
233233      for (i=0; i < width; i++)
234234      {
235         UINT16 pix = vr[(index + (u >> 6)) ^ 1];
235         UINT16 pix = vr[((index + (u >> 6)) ^ 1) & 0xffffff];
236236
237237         if (alpha_enable)
238238         {
r1037r1038
473473
474474   fillbitmap(bitmap, 0, cliprect);
475475
476   if (layer >= 2)
476   if (mame_stricmp(machine->gamedrv->name, "popn7") == 0)
477477   {
478      gcu_exec_display_list(chip, bitmap, cliprect, 0x8000);
479      gcu_exec_display_list(chip, bitmap, cliprect, 0x0000);
480      gcu_exec_display_list(chip, bitmap, cliprect, 0x10000);
478      gcu_exec_display_list(chip, bitmap, cliprect, 0x1f80000);
481479   }
482   else if (layer == 0)
480   else
483481   {
484      gcu_exec_display_list(chip, bitmap, cliprect, 0x200000);
482      if (layer >= 2)
483      {
484         gcu_exec_display_list(chip, bitmap, cliprect, 0x8000);
485         gcu_exec_display_list(chip, bitmap, cliprect, 0x0000);
486         gcu_exec_display_list(chip, bitmap, cliprect, 0x10000);
487      }
488      else if (layer == 0)
489      {
490         gcu_exec_display_list(chip, bitmap, cliprect, 0x200000);
485491
486      //gcu_exec_display_list(chip, bitmap, cliprect, 0x186040);
487   }
488   else if (layer == 1)
489   {
490      gcu_exec_display_list(chip, bitmap, cliprect, 0x1d0800);
492         //gcu_exec_display_list(chip, bitmap, cliprect, 0x186040);
493      }
494      else if (layer == 1)
495      {
496         gcu_exec_display_list(chip, bitmap, cliprect, 0x1d0800);
491497
492      gcu_exec_display_list(chip, bitmap, cliprect, 0x1a9440);
493
494      gcu_exec_display_list(chip, bitmap, cliprect, 0x1f80000);
498         gcu_exec_display_list(chip, bitmap, cliprect, 0x1a9440);
499      }
495500   }
496501
497502   tick++;
r1037r1038
16701675
16711676/*****************************************************************************/
16721677
1678static UINT8 spu_shared_ram[0x400];
1679
1680static READ32_HANDLER(ppc_spu_share_r)
1681{
1682   UINT32 r = 0;
1683
1684   if (!(mem_mask & 0xff000000))
1685   {
1686      r |= spu_shared_ram[(offset * 4) + 0] << 24;
1687   }
1688   if (!(mem_mask & 0x00ff0000))
1689   {
1690      r |= spu_shared_ram[(offset * 4) + 1] << 16;
1691   }
1692   if (!(mem_mask & 0x0000ff0000))
1693   {
1694      r |= spu_shared_ram[(offset * 4) + 2] <<  8;
1695   }
1696   if (!(mem_mask & 0xff000000))
1697   {
1698      r |= spu_shared_ram[(offset * 4) + 3] <<  0;
1699   }
1700
1701   return r;
1702}
1703
1704static WRITE32_HANDLER(ppc_spu_share_w)
1705{
1706   if (!(mem_mask & 0xff000000))
1707   {
1708      spu_shared_ram[(offset * 4) + 0] = (data >> 24) & 0xff;
1709   }
1710   if (!(mem_mask & 0x00ff0000))
1711   {
1712      spu_shared_ram[(offset * 4) + 1] = (data >> 16) & 0xff;
1713   }
1714   if (!(mem_mask & 0x0000ff00))
1715   {
1716      spu_shared_ram[(offset * 4) + 2] = (data >>  8) & 0xff;
1717   }
1718   if (!(mem_mask & 0x000000ff))
1719   {
1720      spu_shared_ram[(offset * 4) + 3] = (data >>  0) & 0xff;
1721   }
1722}
1723
1724#ifdef UNUSED_FUNCTION
1725static READ16_HANDLER(m68k_spu_share_r)
1726{
1727   return spu_shared_ram[offset] << 8;
1728}
1729
1730static WRITE16_HANDLER(m68k_spu_share_w)
1731{
1732   spu_shared_ram[offset] = (data >> 8) & 0xff;
1733}
1734#endif
1735
1736static READ16_HANDLER(spu_unk_r)
1737{
1738   return 0xffff;
1739}
1740
1741/*****************************************************************************/
1742
16731743static ADDRESS_MAP_START( firebeat_map, ADDRESS_SPACE_PROGRAM, 32 )
16741744   AM_RANGE(0x70000000, 0x70000fff) AM_READWRITE(midi_uart_r, midi_uart_w)
16751745   AM_RANGE(0x70006000, 0x70006003) AM_WRITE(extend_board_irq_w)
16761746   AM_RANGE(0x70008000, 0x7000800f) AM_READ(keyboard_wheel_r)
16771747   AM_RANGE(0x7000a000, 0x7000a003) AM_READ(extend_board_irq_r)
1678   AM_RANGE(0x74000000, 0x740003ff) AM_RAM                           // SPU shared RAM
1748   AM_RANGE(0x74000000, 0x740003ff) AM_READWRITE(ppc_spu_share_r, ppc_spu_share_w) // SPU shared RAM
16791749   AM_RANGE(0x7d000200, 0x7d00021f) AM_READ(cabinet_r)
16801750   AM_RANGE(0x7d000340, 0x7d000347) AM_READ(sensor_r)
16811751   AM_RANGE(0x7d000400, 0x7d000403) AM_READWRITE(sound_r, sound_w)
r1037r1038
16921762   AM_RANGE(0xfff80000, 0xffffffff) AM_ROM AM_REGION(REGION_USER1, 0)      /* System BIOS */
16931763ADDRESS_MAP_END
16941764
1765static ADDRESS_MAP_START( spu_map, ADDRESS_SPACE_PROGRAM, 16 )
1766   AM_RANGE(0x000000, 0x07ffff) AM_ROM
1767   AM_RANGE(0x100000, 0x13ffff) AM_RAM
1768   AM_RANGE(0x340000, 0x34000f) AM_READ(spu_unk_r)
1769ADDRESS_MAP_END
1770
16951771/*****************************************************************************/
16961772
16971773static READ8_HANDLER( soundram_r )
r1037r1038
19962072   MDRV_SOUND_ROUTE(1, "right", 1.0)
19972073MACHINE_DRIVER_END
19982074
2075static MACHINE_DRIVER_START(firebeat_spu)
2076
2077   MDRV_IMPORT_FROM(firebeat)
2078
2079   MDRV_CPU_ADD(M68000, 16000000)
2080   MDRV_CPU_PROGRAM_MAP(spu_map, 0)
2081
2082MACHINE_DRIVER_END
2083
19992084/*****************************************************************************/
20002085/* Security dongle is a Dallas DS1411 RS232 Adapter with a DS1991 Multikey iButton */
20012086
r1037r1038
22242309/*****************************************************************************/
22252310
22262311ROM_START( ppp )
2227   // TODO: ParaParaParadise should use GQ977 BIOS
22282312   ROM_REGION32_BE(0x80000, REGION_USER1, 0)
2229   ROM_LOAD16_WORD_SWAP("974a03.e21", 0x00000, 0x80000, CRC(ef9a932d) SHA1(6299d3b9823605e519dbf1f105b59a09197df72f))
2313   ROM_LOAD16_WORD_SWAP("977jaa03.e21", 0x00000, 0x80000, CRC(7b83362a) SHA1(2857a93be58636c10a8d180dbccf2caeeaaff0e2))
22302314
22312315   ROM_REGION(0x400000, REGION_SOUND1, ROMREGION_ERASE00)
22322316
r1037r1038
22822366ROM_END
22832367
22842368ROM_START( popn7 )
2285   // TODO: incorrect bios (should be a02jaa03)
22862369   ROM_REGION32_BE(0x80000, REGION_USER1, 0)
2287   ROM_LOAD16_WORD_SWAP("974a03.e21", 0x00000, 0x80000, CRC(ef9a932d) SHA1(6299d3b9823605e519dbf1f105b59a09197df72f))
2370   ROM_LOAD16_WORD_SWAP("a02jaa03.e21", 0x00000, 0x80000, CRC(43ecc093) SHA1(637df5b546cf7409dd4752dc471674fe2a046599))
22882371
22892372   ROM_REGION(0x400000, REGION_SOUND1, ROMREGION_ERASE00)
22902373
22912374   ROM_REGION(0xc0, REGION_USER2, ROMREGION_ERASE00)   // Security dongle
22922375   ROM_LOAD("gcb00-ja", 0x00, 0xc0, BAD_DUMP CRC(cc28625a) SHA1(e7de79ae72fdbd22328c9de74dfa17b5e6ae43b6))
22932376
2377   ROM_REGION(0x80000, REGION_CPU2, 0)         // SPU 68K program
2378   ROM_LOAD16_WORD_SWAP("a02jaa04.3q", 0x00000, 0x80000, CRC(8c6000dd) SHA1(94ab2a66879839411eac6c673b25143d15836683))
2379
22942380   DISK_REGION( REGION_DISKS )
22952381   DISK_IMAGE_READONLY( "b00jab01", 0, SHA1(7462586f67b5c3b015ac581ad0afc089fcd6f537) MD5(af9a249b23783d53ff27ea7dc7e6735c) )
22962382   DISK_IMAGE_READONLY( "b00jaa02", 1, SHA1(fea9439f14304d865830fb34f8781346d95a1df7) MD5(cf4c4f7c2321fcca6d86e8c144261752) )
22972383ROM_END
22982384
22992385ROM_START( ppd )
2300   // TODO: incorrect bios (should be 977jaa03)
23012386   ROM_REGION32_BE(0x80000, REGION_USER1, 0)
2302   ROM_LOAD16_WORD_SWAP("974a03.e21", 0x00000, 0x80000, CRC(ef9a932d) SHA1(6299d3b9823605e519dbf1f105b59a09197df72f))
2387   ROM_LOAD16_WORD_SWAP("977jaa03.e21", 0x00000, 0x80000, CRC(7b83362a) SHA1(2857a93be58636c10a8d180dbccf2caeeaaff0e2))
23032388
23042389   ROM_REGION(0x400000, REGION_SOUND1, ROMREGION_ERASE00)
23052390
r1037r1038
23122397ROM_END
23132398
23142399ROM_START( ppp11 )
2315   // TODO: incorrect bios (should be 977jaa03)
23162400   ROM_REGION32_BE(0x80000, REGION_USER1, 0)
2317   ROM_LOAD16_WORD_SWAP("974a03.e21", 0x00000, 0x80000, CRC(ef9a932d) SHA1(6299d3b9823605e519dbf1f105b59a09197df72f))
2401   ROM_LOAD16_WORD_SWAP("977jaa03.e21", 0x00000, 0x80000, CRC(7b83362a) SHA1(2857a93be58636c10a8d180dbccf2caeeaaff0e2))
23182402
23192403   ROM_REGION(0x400000, REGION_SOUND1, ROMREGION_ERASE00)
23202404
r1037r1038
23282412
23292413/*****************************************************************************/
23302414
2331GAME( 2000, ppp,     0,       firebeat,  ppp,    ppp,      ROT0,   "Konami",  "ParaParaParadise", GAME_NOT_WORKING);
2332GAME( 2000, ppd,      0,       firebeat,  ppp,    ppd,      ROT0,   "Konami",  "ParaParaDancing", GAME_NOT_WORKING);
2333GAME( 2000, ppp11,     0,       firebeat,  ppp,    ppp,      ROT0,   "Konami",  "ParaParaParadise v1.1", GAME_NOT_WORKING);
2334GAMEL(2000, kbm,      0,       firebeat2, kbm,    kbm,    ROT270,   "Konami",  "Keyboardmania", GAME_NOT_WORKING, layout_firebeat);
2335GAMEL(2000, kbm2nd,   0,       firebeat2, kbm,    kbm,    ROT270,   "Konami",  "Keyboardmania 2nd Mix", GAME_NOT_WORKING, layout_firebeat);
2336GAMEL(2001, kbm3rd,   0,       firebeat2, kbm,    kbm,    ROT270,   "Konami",  "Keyboardmania 3rd Mix", GAME_NOT_WORKING, layout_firebeat);
2337GAME( 2001, popn7,    0,       firebeat,  popn,   ppp,      ROT0,   "Konami",  "Pop n' Music 7", GAME_NOT_WORKING);
2415GAME( 2000, ppp,     0,       firebeat,      ppp,    ppp,      ROT0,   "Konami",  "ParaParaParadise", GAME_NOT_WORKING);
2416GAME( 2000, ppd,      0,       firebeat,      ppp,    ppd,      ROT0,   "Konami",  "ParaParaDancing", GAME_NOT_WORKING);
2417GAME( 2000, ppp11,     0,       firebeat,      ppp,    ppp,      ROT0,   "Konami",  "ParaParaParadise v1.1", GAME_NOT_WORKING);
2418GAMEL(2000, kbm,      0,       firebeat2,     kbm,    kbm,    ROT270,   "Konami",  "Keyboardmania", GAME_NOT_WORKING, layout_firebeat);
2419GAMEL(2000, kbm2nd,   0,       firebeat2,     kbm,    kbm,    ROT270,   "Konami",  "Keyboardmania 2nd Mix", GAME_NOT_WORKING, layout_firebeat);
2420GAMEL(2001, kbm3rd,   0,       firebeat2,     kbm,    kbm,    ROT270,   "Konami",  "Keyboardmania 3rd Mix", GAME_NOT_WORKING, layout_firebeat);
2421GAME( 2001, popn7,    0,       firebeat_spu,  popn,   ppp,      ROT0,   "Konami",  "Pop n' Music 7", GAME_NOT_WORKING);
src/mame/drivers/bigevglf.c
r1037r1038
269269    PORT_DIPSETTING(    0x08, "2" )
270270    PORT_DIPSETTING(    0x04, "1" )
271271    PORT_DIPSETTING(    0x00, "4" )
272   PORT_DIPNAME( 0x10, 0x00, "Title" )
272   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Language ) ) /* Also changes the copyright on the title screen */
273   PORT_DIPSETTING(    0x00, DEF_STR( English ) )  /* (c) 1986 Taito America Corp. */
274    PORT_DIPSETTING(    0x10, DEF_STR( Japanese ) ) /* (c) Taito Corporation 1986 */
275    PORT_DIPNAME( 0xe0, 0xa0, "Full game price (credits)" )
276   PORT_DIPSETTING(    0xe0, "3" )
277   PORT_DIPSETTING(    0xc0, "4" )
278   PORT_DIPSETTING(    0xa0, "5" )
279   PORT_DIPSETTING(    0x80, "6" )
280   PORT_DIPSETTING(    0x60, "7" )
281   PORT_DIPSETTING(    0x40, "8" )
282   PORT_DIPSETTING(    0x20, "9" )
283   PORT_DIPSETTING(    0x00, "10" )
284
285   PORT_START  /* TRACKBALL X - port 02 on sub cpu */
286   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X  ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10)
287
288   PORT_START  /* TRACKBALL Y - port 03 on sub cpu */
289   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_REVERSE
290INPUT_PORTS_END
291
292INPUT_PORTS_START( bigevglj )
293
294   PORT_START   /* port 00 on sub cpu */
295   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 )
296   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN4 )
297   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
298   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
299   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
300   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
301   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_TILT )
302   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 )
303
304   PORT_START   /* port 04 on sub cpu - bit 0 and bit 1 are coin inputs */
305   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
306   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
307
308   PORT_START   /* port 05 on sub cpu */
309   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
310   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
311   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
312   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
313   PORT_DIPSETTING(    0x02, DEF_STR( Off ))
314   PORT_DIPSETTING(    0x00, DEF_STR( On ))
315   PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
316    PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )
317    PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
318   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
319   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_A ) )
320   PORT_DIPSETTING(    0x50, DEF_STR( 2C_1C ) )
321   PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
322   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )
323   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_2C ) )
324
325   PORT_START   /* port 06 on sub cpu */
326   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
327   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
328   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
329   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
330   PORT_DIPSETTING(    0x00, "Difficult" )
331   PORT_DIPNAME( 0x0c, 0x0c, "Holes" )
332   PORT_DIPSETTING(    0x0c, "3" )
333    PORT_DIPSETTING(    0x08, "2" )
334    PORT_DIPSETTING(    0x04, "1" )
335    PORT_DIPSETTING(    0x00, "4" )
336   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Language ) ) /* Doesn't change the title screen copyright like the US set */
273337   PORT_DIPSETTING(    0x00, DEF_STR( English ) )
274338    PORT_DIPSETTING(    0x10, DEF_STR( Japanese ) )
275339    PORT_DIPNAME( 0xe0, 0xa0, "Full game price (credits)" )
r1037r1038
550614   ROM_LOAD( "a67-15",   0x18000, 0x8000, CRC(1d261428) SHA1(0f3e6d83a8a462436fa414de4e1e4306db869d3e))
551615ROM_END
552616
553GAME( 1986, bigevglf,  0,        bigevglf,  bigevglf,  0, ROT270, "Taito America Corporation", "Big Event Golf", 0)
617ROM_START( bigevglj )
618   ROM_REGION( 0x90000, REGION_CPU1, 0 )
619   ROM_LOAD( "a67-02-2.10", 0x00000, 0x8000, CRC(b3edbb78) SHA1(7873b1a94cca830f1d1c143376cb49f6e48dbf0b))
620   ROM_LOAD( "a67-01-2.9",  0x08000, 0x4000, CRC(7788b5d0) SHA1(f331138352c4d7b4566d342047785ed97e7b5990))
621   ROM_LOAD( "a67-03",      0x10000, 0x8000, CRC(695b3396) SHA1(2a3738e6bc492a4c68d2e15a2e474f7654aeb94d))
622   ROM_LOAD( "a67-04",      0x18000, 0x8000, CRC(b8941902) SHA1(a03e432cbd8ea1df7223ea99ff1db220a57fc698))
623   ROM_LOAD( "a67-05",      0x20000, 0x8000, CRC(681f5f4f) SHA1(2a5d8eeaf6ac697d5d4ee15164b6c4b1b81d7a29))
624   ROM_LOAD( "a67-06",      0x28000, 0x8000, CRC(026f6fe5) SHA1(923b7d8363e587ef20b6518bee968d378166c76b))
625   ROM_LOAD( "a67-07",      0x30000, 0x8000, CRC(27706bed) SHA1(da702c5a098eb106332996ec5d0e2c014782031e))
626   ROM_LOAD( "a67-08",      0x38000, 0x8000, CRC(e922023a) SHA1(ea4c4b5e2f82ab20afb15f115e8cbc66d8471927))
627   ROM_LOAD( "a67-09",      0x40000, 0x8000, CRC(a9d4263e) SHA1(8c3f2d541583e8e4b22e0beabcd04c5765508535))
628   ROM_LOAD( "a67-10",      0x48000, 0x8000, CRC(7c35f4a3) SHA1(de60dc991c67fb7d48314bc8b2c1a27ad040bf1e))
629
630   ROM_REGION( 0x10000, REGION_CPU2, 0 )
631   ROM_LOAD( "a67-11",   0x00000, 0x4000, CRC(a2660d20) SHA1(3d8b670c071862d677d4e30655dcb6b8d830648a))
632
633    ROM_REGION( 0x10000, REGION_CPU3, 0 )
634   ROM_LOAD( "a67-16",   0x0000, 0x4000, CRC(5fb6d22e) SHA1(1701aa94b7f524187fd7213a94535bed3e8b6cc9))
635   ROM_LOAD( "a67-17",   0x4000, 0x4000, CRC(9f57deae) SHA1(dbdb3d77c3de0113ef6671aec854e4e44ee162ef))
636   ROM_LOAD( "a67-18",   0x8000, 0x4000, CRC(40d54fed) SHA1(bfa0922809bffafec15d3ef59ac8b8ad653860a1))
637
638   ROM_REGION( 0x0800, REGION_CPU4, 0 )
639   ROM_LOAD( "a67_19-1", 0x0000, 0x0800, CRC(25691658) SHA1(aabf47abac43abe2ffed18ead1cb94e587149e6e))
640
641   ROM_REGION( 0x20000, REGION_GFX1, ROMREGION_DISPOSE )
642   ROM_LOAD( "a67-12",   0x00000, 0x8000, CRC(980cc3c5) SHA1(c35c20cfff0b5cfd5b95742333ae20a2c93371b5))
643   ROM_LOAD( "a67-13",   0x08000, 0x8000, CRC(ad6e04af) SHA1(4680d789cf53c4808105ad4f3c70aedb6d8bcf36))
644   ROM_LOAD( "a67-14",   0x10000, 0x8000, CRC(d6708cce) SHA1(5b48f9dff2a3e28242dc2004469dc2ac2b5d0321))
645   ROM_LOAD( "a67-15",   0x18000, 0x8000, CRC(1d261428) SHA1(0f3e6d83a8a462436fa414de4e1e4306db869d3e))
646ROM_END
647
648GAME( 1986, bigevglf, 0,        bigevglf, bigevglf, 0, ROT270, "Taito America Corporation", "Big Event Golf (US)", 0)
649GAME( 1986, bigevglj, bigevglf, bigevglf, bigevglj, 0, ROT270, "Taito Corporation", "Big Event Golf (Japan)", 0)
src/mame/drivers/dunhuang.c
r1037r1038
383383}
384384
385385
386#ifdef UNUSED_FUNCTION
386387static WRITE8_HANDLER( dunhuang_82_w )
387388{
388389//  popmessage("82 = %02x",dunhuang_82);
389390}
391#endif
390392
391393static ADDRESS_MAP_START( dunhuang_io_map, ADDRESS_SPACE_IO, 8 )
392394   AM_RANGE( 0x0000, 0x0000 ) AM_WRITE( dunhuang_pos_x_w )
src/mame/drivers/liberate.c
r1037r1038
715715   ROM_LOAD( "82s123.5l",  0, 32,  CRC(a71e19ff) SHA1(fc7bf69f7971bf763aeeb1d9eb0861470acbf5d8) )
716716ROM_END
717717
718ROM_START( boomrana )
719   ROM_REGION(0x10000, REGION_CPU1, 0)
720   ROM_LOAD( "bp12-2",  0x8000, 0x2000,  CRC(87fc2f0b) SHA1(a5142cb3ee2c85906df2b5eccf7495486b162ae2) )
721   ROM_RELOAD(          0x0000, 0x2000 )
722   ROM_LOAD( "bp13-2",  0xa000, 0x2000,  CRC(8e864764) SHA1(8faea69cb087b19de77589ea24d6f99ca0237deb) )
723   ROM_RELOAD(          0x2000, 0x2000 )
724   ROM_LOAD( "bp14-",  0x0c000, 0x2000, CRC(0a64018a) SHA1(318124619440af5b19bd4dc74ab3075ea03a6833) )
725   ROM_LOAD( "bp15-",  0x0e000, 0x2000, CRC(d23a5c31) SHA1(e61fee651ee80b03bf5813ec0cebb022bd0285bf) )
726
727
728   ROM_REGION(0x10000, REGION_CPU2, 0) /* same content, alt layout */
729   ROM_LOAD( "bp11-",  0x0c000, 0x2000, CRC(bbafe1ff) SHA1(c786465d714d576d5bbbfea588d34850a317dd9d) )
730   ROM_RELOAD(0xe000,0x2000)
731
732   ROM_REGION(0xc000, REGION_GFX1, ROMREGION_DISPOSE ) /* same content, alt rom layout */
733   ROM_LOAD( "bp03-",  0x00000, 0x2000, CRC(33565e00) SHA1(5ddf179d222db7b3ad965ede2f25590d93dfdbf7) )
734   ROM_LOAD( "bp04-",  0x02000, 0x2000, CRC(ab3ccae2) SHA1(d81d3bf38d8b9b05792c0b74e2573c23c01eef4a) )
735   ROM_LOAD( "bp05-",  0x04000, 0x2000, CRC(8a8d25fa) SHA1(af9ae6a53f5ae2c97c8632e30d63830a82b3a2fd) )
736   ROM_LOAD( "bp06-",  0x06000, 0x2000, CRC(aa64bacd) SHA1(6a5e58abcd3753f9766376b31b4d2098a172dc8d) )
737   ROM_LOAD( "bp07-",  0x08000, 0x2000, CRC(6c7370aa) SHA1(e2c874a7f9205b6af9cd3336239839f659b93dae) )
738   ROM_LOAD( "bp08-",  0x0a000, 0x2000, CRC(348bd0cc) SHA1(a99aa9bf8c707b2f2a9539a118b0b74e20e1e923) )
739
740   ROM_REGION( 0x8000, REGION_GFX2, ROMREGION_DISPOSE ) /* same content, alt rom layout */
741   ROM_LOAD( "bp01-",  0x00000, 0x2000, CRC(b4000aff) SHA1(7706ddd4ab3ef07df0e4f41635725781f8b0c386) )
742   ROM_LOAD( "bp02-",  0x02000, 0x2000, CRC(90044512) SHA1(4c0fd9c95796e4281ec2de8639990717f8216bec) )
743   ROM_LOAD( "bp00-",  0x04000, 0x2000, CRC(e33564e5) SHA1(69563fea82716b440dbc2b5912078c70727aa560) )
744
745   ROM_REGION(0x04000, REGION_USER1, 0 ) /* same content, alt rom layout */
746   ROM_LOAD( "bp10-",  0x00000, 0x2000, CRC(cb3b0f60) SHA1(0fe8e11b1e24db7881a9f00cb700495e1e0daf84) )
747   ROM_LOAD( "bp09-",  0x02000, 0x2000, CRC(a64ac71d) SHA1(0e6525aa037a11f83ca7e23572b488c6f8ddab63) )
748
749   ROM_REGION( 32, REGION_PROMS, 0 )
750   ROM_LOAD( "ap-16.5l",  0, 32,  CRC(a71e19ff) SHA1(fc7bf69f7971bf763aeeb1d9eb0861470acbf5d8) )
751ROM_END
752
718753ROM_START( kamikcab )
719754   ROM_REGION(0x10000, REGION_CPU1, 0)
720755   ROM_LOAD( "bp11", 0x0c000, 0x4000, CRC(a69e5580) SHA1(554e45a3f5a91864b62a2439c2277cd18dbe45a7) )
r1037r1038
923958
924959GAME( 1983, prosoccr, 0,        prosoccr,  liberate, prosport, ROT270, "Data East Corporation", "Pro Soccer", GAME_NOT_WORKING )
925960GAME( 1983, prosport, 0,        prosport,  liberate, prosport, ROT270, "Data East Corporation", "Prosport", GAME_NOT_WORKING )
926GAME( 1983, boomrang, 0,        boomrang,  boomrang, prosport, ROT270, "Data East Corporation", "Boomer Rang'r / Genesis", 0 )
961GAME( 1983, boomrang, 0,        boomrang,  boomrang, prosport, ROT270, "Data East Corporation", "Boomer Rang'r / Genesis (set 1)", 0 )
962GAME( 1983, boomrana, boomrang, boomrang,  boomrang, prosport, ROT270, "Data East Corporation", "Boomer Rang'r / Genesis (set 2)", 0 )
927963GAME( 1984, kamikcab, 0,        boomrang,  kamikcab, prosport, ROT270, "Data East Corporation", "Kamikaze Cabbie", 0 )
928964GAME( 1984, yellowcb, kamikcab, boomrang,  yellowcb, yellowcb, ROT270, "bootleg",               "Yellow Cab (bootleg)", 0 )
929965GAME( 1984, liberate, 0,        liberate,  liberate, liberate, ROT270, "Data East Corporation", "Liberation", 0 )
src/mame/drivers/laserbat.c
r1037r1038
118118   // 0x80 = MPX P 1/2
119119}
120120
121#ifdef UNUSED_FUNCTION
121122static WRITE8_HANDLER( laserbat_cntmov_w )
122123{
123124   // 0x01 = AB MOVE
r1037r1038
129130   // 0x40 = SHPB
130131   // 0x80 = SHPC
131132}
133#endif
132134
133135/*
134136
src/mame/drivers/progolf.c
r1037r1038
192192};
193193
194194
195#ifdef UNUSED_FUNCTION
195196static INTERRUPT_GEN( progolf_interrupt )
196197{
197198   //if (readinputport(2) & 0xc0)
198199      cpunum_set_input_line(0, /*0*/INPUT_LINE_NMI, /*HOLD_LINE*/PULSE_LINE);
199200}
201#endif
200202
201203static MACHINE_DRIVER_START( progolf )
202204   /* basic machine hardware */
src/mame/drivers/stv.c
r1037r1038
20852085extern WRITE32_HANDLER ( stv_vdp1_framebuffer1_w );
20862086extern READ32_HANDLER ( stv_vdp1_framebuffer1_r );
20872087
2088#ifdef UNUSED_FUNCTION
20882089static READ32_HANDLER( stv_sh2_random_r )
20892090{
20902091   return 0xffffffff;
20912092}
2093#endif
20922094
20932095static ADDRESS_MAP_START( stv_mem, ADDRESS_SPACE_PROGRAM, 32 )
20942096   AM_RANGE(0x00000000, 0x0007ffff) AM_ROM   // bios
r1037r1038
24842486   //minit_w(offset,data,mem_mask);
24852487}
24862488
2487#ifdef MAME_DEBUG
2489#ifdef UNUSED_FUNCTION
24882490static void print_game_info(void);
24892491#endif
24902492
r1037r1038
25372539   for(dst_i=0;dst_i<0x100;dst_i++) \
25382540      STR[dst_i] = 0x00;
25392541
2540#ifdef MAME_DEBUG
2542#ifdef UNUSED_FUNCTION
25412543static void print_game_info(void)
25422544{
25432545   UINT8 *ROM = memory_region(REGION_USER1);
src/mame/drivers/megatech.c
r1037r1038
11/* Sega MegaTech */
22/*
3
4  changelog:
5
6  22 Sept 2007 - Started updating this to use the new Megadrive code,
7                 The Megadrive games currently run with the new code
8                  but the SMS based games still aren't hooked up (they
9                  use the Megadrive Z80 as the main CPU, and the VDP
10                  in compatibility mode)
11
12                 Controls for the menu haven't been hooked back up
13                 and the games run without any menu interaction at the
14                 moment.
15
16
17
18
319todo: cleanup, fix so that everything works properly
4      rewrite genesis emulation (so that it works perfectly with every genesis game)
5      games are marked as NOT WORKING due to a) bad genesis emulation, b) incorrect behavior at time out
6       or c) they're sms based games which aren't yet supported
20      games are marked as NOT WORKING due to
21      a) incorrect behavior at time out
22      b) they're sms based games which aren't yet supported
723
824
925About MegaTech:
r1037r1038
6177#include "driver.h"
6278#include "genesis.h"
6379#include "rendlay.h"
80#include "megadriv.h"
81#include "segae.h"
6482
6583/* Megatech BIOS specific */
6684static UINT32 bios_port_ctrl;
r1037r1038
6987#define MASTER_CLOCK      53693100
7088
7189
90/* not currently used */
7291INPUT_PORTS_START( megatech ) /* Genesis Input Ports */
73   PORT_START
7492
75
76   PORT_START   /* Player 1 Controls - part 2 */
77//  PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
78//  PORT_BIT(  0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
79//  PORT_BIT(  0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
80//  PORT_BIT(  0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
81//  PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_BUTTON2 )
82//  PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_BUTTON3 )
83//  PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_UNUSED )
84//  PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_UNUSED )
85
86   PORT_START   /* Player 1 Controls - part 1 */
87//  PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
88//  PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_START1 )
89
90
91   PORT_START   /* Player 2 Controls - part 2 */
92//  PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
93//  PORT_BIT(  0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
94//  PORT_BIT(  0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
95//  PORT_BIT(  0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT  ) PORT_PLAYER(2)
96//  PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
97//  PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
98//  PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_UNUSED )
99//  PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_UNUSED )
100
101   PORT_START   /* Player 2 Controls - part 1 */
102//  PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
103//  PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_PLAYER(2)
104
105   PORT_START   /* Temp - Fake dipswitch to turn on / off sms vdp display */
106//  PORT_DIPNAME( 0x01, 0x01, "SMS VDP Display (fake)" )
107//  PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
108//  PORT_DIPSETTING(    0x01, DEF_STR( On ) )
109
110   PORT_START
93   PORT_START // port 6
11194    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Select") PORT_CODE(KEYCODE_0)
11295    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN  ) PORT_NAME("0x6800 bit 1") PORT_CODE(KEYCODE_Y)
11396    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6800 bit 2") PORT_CODE(KEYCODE_U)
r1037r1038
117100   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6800 bit 6") PORT_CODE(KEYCODE_O)
118101   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Test mode") PORT_CODE(KEYCODE_F2)
119102
120   PORT_START
103   PORT_START // port 7
121104   PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_COIN1 )  // a few coin inputs here
122105   PORT_BIT(  0x02, IP_ACTIVE_LOW, IPT_COIN2 )
123106   PORT_BIT(  0x04, IP_ACTIVE_LOW, IPT_COIN3 )
124107   PORT_BIT(  0x08, IP_ACTIVE_LOW, IPT_COIN4 )
125   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Service coin") PORT_CODE(KEYCODE_9)
126   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_NAME("Enter") PORT_CODE(KEYCODE_MINUS)
108   PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Service coin") PORT_CODE(KEYCODE_9)
109   PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_NAME("Enter") PORT_CODE(KEYCODE_MINUS)
127110   PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_START1 )
128111   PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_START2 )
129112
130   PORT_START
113   PORT_START // port 8
131114   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(2)
132115   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(2)
133116   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
r1037r1038
273256ADDRESS_MAP_END
274257
275258
276/* basically from src/drivers/segasyse.c */
277UINT8 segae_vdp_ctrl_r ( UINT8 chip );
278UINT8 segae_vdp_data_r ( UINT8 chip );
279void segae_vdp_ctrl_w ( UINT8 chip, UINT8 data );
280void segae_vdp_data_w ( UINT8 chip, UINT8 data );
281
282READ8_HANDLER (megatech_bios_port_be_bf_r)
283{
284   UINT8 temp = 0;
285
286   switch (offset)
287   {
288      case 0: /* port 0xbe, VDP 1 DATA Read */
289         temp = segae_vdp_data_r(0); break ;
290      case 1: /* port 0xbf, VDP 1 CTRL Read */
291         temp = segae_vdp_ctrl_r(0); break ;
292   }
293   return temp;
294}
295
296WRITE8_HANDLER (megatech_bios_port_be_bf_w)
297{
298   switch (offset)
299   {
300      case 0: /* port 0xbe, VDP 1 DATA Write */
301         segae_vdp_data_w(0, data); break;
302      case 1: /* port 0xbf, VDP 1 CTRL Write */
303         segae_vdp_ctrl_w(0, data); break;
304   }
305}
306
307259static WRITE8_HANDLER (megatech_bios_port_ctrl_w)
308260{
309261   bios_port_ctrl = data;
r1037r1038
331283}
332284
333285
286
334287static ADDRESS_MAP_START( megatech_bios_portmap, ADDRESS_SPACE_IO, 8 )
335288   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
336289   AM_RANGE(0x3f, 0x3f) AM_WRITE(megatech_bios_port_ctrl_w)
337   AM_RANGE(0x7f, 0x7f) AM_WRITE(megatech_bios_port_7f_w)
338   AM_RANGE(0xbe, 0xbf) AM_WRITE(megatech_bios_port_be_bf_w)         /* VDP */
290
291   AM_RANGE(0x7f, 0x7f) AM_READWRITE(sms_vcounter_r, megatech_bios_port_7f_w)
292   AM_RANGE(0xbe, 0xbe) AM_READWRITE(sms_vdp_data_r, sms_vdp_data_w)
293   AM_RANGE(0xbf, 0xbf) AM_READWRITE(sms_vdp_ctrl_r, sms_vdp_ctrl_w)
294
339295   AM_RANGE(0xdc, 0xdc) AM_READ(megatech_bios_port_dc_r)  // player inputs
340296   AM_RANGE(0xdd, 0xdd) AM_READ(megatech_bios_port_dd_r)  // other player 2 inputs
341   AM_RANGE(0xbe, 0xbf) AM_READ(megatech_bios_port_be_bf_r)         /* VDP */
342297ADDRESS_MAP_END
343298
344299
345300
346static UINT8 hintcount;         /* line interrupt counter, decreased each scanline */
347extern UINT8 segae_vintpending;
348extern UINT8 segae_hintpending;
349extern UINT8 *segae_vdp_regs[];      /* pointer to vdp's registers */
301/* in video/segasyse.c */
302//void megatech_start_video_normal(running_machine *machine);
303//void megatech_update_video_normal(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect );
304//void megaplay_update_video_normal(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect );
350305
351// Interrupt handler - from drivers/segasyse.c
352INTERRUPT_GEN (megatech_irq)
353{
354   int sline;
355   sline = 261 - cpu_getiloops();
306/* give us access to the megadriv start and update functions so that we can call them */
307extern UINT32 video_update_megadriv(running_machine *machine, int screen, mame_bitmap *bitmap, const rectangle *cliprect);
308extern void video_start_megadriv(running_machine *machine);
309extern void video_eof_megadriv(running_machine *machine);
310extern void machine_reset_megadriv(running_machine *machine);
356311
357   if (sline ==0) {
358      hintcount = segae_vdp_regs[0][10];
359   }
312/* in drivers/segae.c */
313extern UINT32 video_update_megatech_bios(running_machine *machine, int screen, mame_bitmap *bitmap, const rectangle *cliprect);
314extern void video_eof_megatech_bios(running_machine *machine);
315extern void machine_reset_megatech_bios(running_machine *machine);
316extern void driver_init_megatech_bios(running_machine *machine);
360317
361   if (sline <= 192) {
318DRIVER_INIT(mtnew)
319{
320   driver_init_megadriv(Machine);
321   driver_init_megatech_bios(Machine);
322}
362323
363//      if (sline != 192) segae_drawscanline(sline,1,1);
324VIDEO_START(mtnew)
325{
326   video_start_megadriv(Machine);
327}
364328
365      if (sline == 192)
366         segae_vintpending = 1;
329VIDEO_UPDATE(mtnew)
330{
331   if (screen ==0) video_update_megadriv(Machine,0,bitmap,cliprect);
332   if (screen ==1) video_update_megatech_bios(Machine, 1, bitmap,cliprect);
333   return 0;
334}
367335
368      if (hintcount == 0) {
369         hintcount = segae_vdp_regs[0][10];
370         segae_hintpending = 1;
336VIDEO_EOF(mtnew)
337{
338   video_eof_megadriv(Machine);
339   video_eof_megatech_bios(Machine);
340}
371341
372         if  ((segae_vdp_regs[0][0] & 0x10)) {
373            cpunum_set_input_line(2, 0, HOLD_LINE);
374            return;
375         }
376
377      } else {
378         hintcount--;
379      }
380   }
381
382   if (sline > 192) {
383      hintcount = segae_vdp_regs[0][10];
384
385      if ( (sline<0xe0) && (segae_vintpending) ) {
386         cpunum_set_input_line(2, 0, HOLD_LINE);
387      }
388   }
389
342MACHINE_RESET(mtnew)
343{
344   machine_reset_megadriv(Machine);
345   machine_reset_megatech_bios(Machine);
390346}
391347
392static ADDRESS_MAP_START( genesis_map, ADDRESS_SPACE_PROGRAM, 16 )
393   AM_RANGE(0x000000, 0x3fffff) AM_ROM                        /* Cartridge Program Rom */
394   AM_RANGE(0xa10000, 0xa1001f) AM_READWRITE(genesis_io_r, genesis_io_w) AM_BASE(&genesis_io_ram) /* Genesis Input */
395   AM_RANGE(0xa11000, 0xa11203) AM_WRITE(genesis_ctrl_w)
396   AM_RANGE(0xa00000, 0xa0ffff) AM_READWRITE(genesis_68k_to_z80_r, megaplay_68k_to_z80_w)
397   AM_RANGE(0xc00000, 0xc0001f) AM_READWRITE(genesis_vdp_r, genesis_vdp_w)            /* VDP Access */
398   AM_RANGE(0xe00000, 0xe0ffff) AM_MIRROR(0x1f0000) AM_RAM AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size)
399ADDRESS_MAP_END
400
401
402static ADDRESS_MAP_START( genesis_z80_map, ADDRESS_SPACE_PROGRAM, 8 )
403    AM_RANGE(0x0000, 0x1fff) AM_MIRROR(0x2000) AM_RAM AM_BASE(&genesis_z80_ram)
404   AM_RANGE(0x4000, 0x7fff) AM_READWRITE(genesis_z80_r, genesis_z80_w)
405   AM_RANGE(0x8000, 0xffff) AM_READ(genesis_z80_bank_r)
406ADDRESS_MAP_END
407
408
409static MACHINE_DRIVER_START( genesis_base )
410   /*basic machine hardware */
411   MDRV_CPU_ADD_TAG("main", M68000, MASTER_CLOCK / 7)
412   MDRV_CPU_PROGRAM_MAP(genesis_map, 0)
413   MDRV_CPU_VBLANK_INT(genesis_vblank_interrupt,1)
414
415   MDRV_CPU_ADD_TAG("sound", Z80, MASTER_CLOCK / 15)
416   MDRV_CPU_PROGRAM_MAP(genesis_z80_map, 0)
417   MDRV_CPU_VBLANK_INT(irq0_line_hold, 1) /* from vdp at scanline 0xe0 */
418
419   MDRV_SCREEN_REFRESH_RATE(60)
420
421   MDRV_INTERLEAVE(100)
422
423   MDRV_MACHINE_START(genesis)
424   MDRV_MACHINE_RESET(genesis)
425
426   /* video hardware */
427   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_HAS_SHADOWS | VIDEO_HAS_HIGHLIGHTS)
428   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
429   MDRV_SCREEN_SIZE(342,262)
430   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 223)
431   MDRV_PALETTE_LENGTH(64)
432
433   MDRV_VIDEO_START(genesis)
434   MDRV_VIDEO_UPDATE(genesis)
435
436   /* sound hardware */
437   MDRV_SPEAKER_STANDARD_MONO("mono")
438
439   MDRV_SOUND_ADD(YM3438, MASTER_CLOCK/7)
440   MDRV_SOUND_ROUTE(0, "mono", 0.50)
441   MDRV_SOUND_ROUTE(1, "mono", 0.50)
442MACHINE_DRIVER_END
443
444
445348static MACHINE_DRIVER_START( megatech )
446349
447350   /* basic machine hardware */
448   MDRV_IMPORT_FROM( genesis_base )
351   MDRV_IMPORT_FROM(megadriv)
449352
353   /* Megatech has an extra SMS based bios *and* an additional screen */
450354   MDRV_CPU_ADD_TAG("megatech_bios", Z80, MASTER_CLOCK / 15) /* ?? */
451355   MDRV_CPU_PROGRAM_MAP(megatech_bios_map, 0)
452356   MDRV_CPU_IO_MAP(megatech_bios_portmap,0)
453   MDRV_CPU_VBLANK_INT(megatech_irq, 262)
454357
455   MDRV_MACHINE_START(genesis)
456   MDRV_MACHINE_RESET(genesis)
358   MDRV_MACHINE_RESET(mtnew)
457359
458   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_HAS_SHADOWS | VIDEO_HAS_HIGHLIGHTS)
459   MDRV_PALETTE_LENGTH(64+32) /* +32 for megatech bios vdp part */
360   MDRV_VIDEO_START(mtnew)
361   MDRV_VIDEO_UPDATE(mtnew)
362   MDRV_VIDEO_EOF(mtnew)
460363
461   MDRV_VIDEO_START(megatech)
462   MDRV_VIDEO_UPDATE(megatech)
463364   MDRV_DEFAULT_LAYOUT(layout_dualhovu)
464365
465   MDRV_SCREEN_ADD("top", 0x000)
466   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
366   MDRV_SCREEN_ADD("menu", 0x000)
367   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
467368   MDRV_SCREEN_REFRESH_RATE(60)
468369   MDRV_SCREEN_SIZE(342,262)
469   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0, 192-1)
370   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0, 224-1)
470371
471   MDRV_SCREEN_ADD("bottom", 0x000)
472   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
473   MDRV_SCREEN_REFRESH_RATE(30)
474   MDRV_SCREEN_SIZE(342,262)
475   MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 224-1)
476
477
478
479372   /* sound hardware */
480373   MDRV_SOUND_ADD(SN76496, MASTER_CLOCK/15)
481   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
482
483   MDRV_SOUND_ADD(SN76496, MASTER_CLOCK/15)
484   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
374   MDRV_SOUND_ROUTE(0, "left", 0.50)
375   MDRV_SOUND_ROUTE(1, "right", 0.50)
485376MACHINE_DRIVER_END
486377
487378
r1037r1038
949840
950841
951842/* nn */ /* nn is part of the instruction rom name, should there be a game for each number? */
952/* -- */ GAME( 1989, megatech, 0,        megatech, megatech, 0, ROT0, "Sega",                  "Mega-Tech BIOS", GAME_IS_BIOS_ROOT )
953/* 01 */ GAME( 1988, mt_beast, megatech, megatech, megatech, 0, ROT0, "Sega",                  "Altered Beast (Mega-Tech)", GAME_NOT_WORKING )
954/* 02 */ GAME( 1988, mt_shar2, megatech, megatech, megatech, 0, ROT0, "Sega",                  "Space Harrier II (Mega-Tech)", GAME_NOT_WORKING )
955/* 03 */ GAME( 1988, mt_stbld, megatech, megatech, megatech, 0, ROT0, "Sega",                  "Super Thunder Blade (Mega-Tech)", GAME_NOT_WORKING )
956/* 04 */ GAME( 19??, mt_ggolf, megatech, megatech, megatech, 0, ROT0, "Sega",                  "Great Golf (Mega-Tech)", GAME_NOT_WORKING ) /* sms! also bad */
957/* 05 */ GAME( 19??, mt_gsocr, megatech, megatech, megatech, 0, ROT0, "Sega",                  "Great Soccer (Mega-Tech)", GAME_NOT_WORKING ) /* sms! also bad */
958/* 06 */ GAME( 1989, mt_orun,  megatech, megatech, megatech, 0, ROT0, "Sega",                  "Out Run (Mega-Tech)", GAME_NOT_WORKING ) /* sms! */
959/* 07 */ GAME( 19??, mt_asyn,  megatech, megatech, megatech, 0, ROT0, "Sega",                  "Alien Syndrome (Mega-Tech)", GAME_NOT_WORKING ) /* sms! */
960/* 08 */ GAME( 19??, mt_shnbi, megatech, megatech, megatech, 0, ROT0, "Sega",                  "Shinobi (Mega-Tech)", GAME_NOT_WORKING) /* sms */
843/* -- */ GAME( 1989, megatech, 0,        megatech, megadriv, mtnew, ROT0, "Sega",                  "Mega-Tech BIOS", GAME_IS_BIOS_ROOT )
844/* 01 */ GAME( 1988, mt_beast, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Altered Beast (Mega-Tech)", GAME_NOT_WORKING )
845/* 02 */ GAME( 1988, mt_shar2, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Space Harrier II (Mega-Tech)", GAME_NOT_WORKING )
846/* 03 */ GAME( 1988, mt_stbld, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Super Thunder Blade (Mega-Tech)", GAME_NOT_WORKING )
847/* 04 */ GAME( 19??, mt_ggolf, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Great Golf (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! also bad */
848/* 05 */ GAME( 19??, mt_gsocr, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Great Soccer (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! also bad */
849/* 06 */ GAME( 1989, mt_orun,  megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Out Run (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! */
850/* 07 */ GAME( 19??, mt_asyn,  megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Alien Syndrome (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! */
851/* 08 */ GAME( 19??, mt_shnbi, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Shinobi (Mega-Tech, SMS based)", GAME_NOT_WORKING) /* sms */
961852/* 09 */ // unknown
962/* 10 */ GAME( 19??, mt_aftrb, megatech, megatech, megatech, 0, ROT0, "Sega",                  "After Burner (Mega-Tech)", GAME_NOT_WORKING) /* sms */
963/* 11 */ GAME( 1989, mt_tfor2, megatech, megatech, megatech, 0, ROT0, "Tecno Soft / Sega",     "Thunder Force II MD (Mega-Tech)", GAME_NOT_WORKING )
853/* 10 */ GAME( 19??, mt_aftrb, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "After Burner (Mega-Tech, SMS based)", GAME_NOT_WORKING) /* sms */
854/* 11 */ GAME( 1989, mt_tfor2, megatech, megatech, megadriv, mtnew, ROT0, "Tecno Soft / Sega",     "Thunder Force II MD (Mega-Tech)", GAME_NOT_WORKING )
964855/* 12 */ // unknown
965/* 13 */ GAME( 19??, mt_astro, megatech, megatech, megatech, 0, ROT0, "Sega",                  "Astro Warrior (Mega-Tech)", GAME_NOT_WORKING ) /* sms! */
856/* 13 */ GAME( 19??, mt_astro, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Astro Warrior (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! */
966857/* 14 */ // unknown
967858/* 15 */ // unknown
968859/* 16 */ // unknown
969860/* 17 */ // unknown
970861/* 18 */ // unknown
971862/* 19 */ // unknown
972/* 20 */ GAME( 1989, mt_lastb, megatech, megatech, megatech, 0, ROT0, "Sega",                  "Last Battle (Mega-Tech)", GAME_NOT_WORKING )
973/* 21 */ GAME( 1989, mt_wcsoc, megatech, megatech, megatech, 0, ROT0, "Sega",                  "World Championship Soccer (Mega-Tech)", GAME_NOT_WORKING )
974/* 22 */ GAME( 19??, mt_tetri, megatech, megatech, megatech, 0, ROT0, "Sega",                  "Tetris (Mega-Tech)", GAME_NOT_WORKING )
975/* 23 */ GAME( 1989, mt_gng,   megatech, megatech, megatech, 0, ROT0, "Capcom / Sega",         "Ghouls'n Ghosts (Mega-Tech)", GAME_NOT_WORKING )
976/* 24 */ GAME( 1989, mt_shang, megatech, megatech, megatech, 0, ROT0, "Sega",                  "Super Hang-On (Mega-Tech)", GAME_NOT_WORKING )
977/* 25 */ GAME( 1989, mt_gaxe,  megatech, megatech, megatech, 0, ROT0, "Sega",                  "Golden Axe (Mega-Tech)", GAME_NOT_WORKING )
978/* 26 */ GAME( 1989, mt_fwrld, megatech, megatech, megatech, 0, ROT0, "Sega",                  "Forgotten Worlds (Mega-Tech)", GAME_NOT_WORKING )
979/* 27 */ GAME( 1989, mt_mystd, megatech, megatech, megatech, 0, ROT0, "Sega",                  "Mystic Defender (Mega-Tech)", GAME_NOT_WORKING )
980/* 28 */ GAME( 1989, mt_revsh, megatech, megatech, megatech, 0, ROT0, "Sega",                  "The Revenge of Shinobi (Mega-Tech)", GAME_NOT_WORKING )
981/* 29 */ GAME( 19??, mt_parlg, megatech, megatech, megatech, 0, ROT0, "Sega",                  "Parlour Games (Mega-Tech)", GAME_NOT_WORKING ) /* sms! */
863/* 20 */ GAME( 1989, mt_lastb, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Last Battle (Mega-Tech)", GAME_NOT_WORKING )
864/* 21 */ GAME( 1989, mt_wcsoc, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "World Championship Soccer (Mega-Tech)", GAME_NOT_WORKING )
865/* 22 */ GAME( 19??, mt_tetri, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Tetris (Mega-Tech)", GAME_NOT_WORKING )
866/* 23 */ GAME( 1989, mt_gng,   megatech, megatech, megadriv, mtnew, ROT0, "Capcom / Sega",         "Ghouls'n Ghosts (Mega-Tech)", GAME_NOT_WORKING )
867/* 24 */ GAME( 1989, mt_shang, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Super Hang-On (Mega-Tech)", GAME_NOT_WORKING )
868/* 25 */ GAME( 1989, mt_gaxe,  megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Golden Axe (Mega-Tech)", GAME_NOT_WORKING )
869/* 26 */ GAME( 1989, mt_fwrld, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Forgotten Worlds (Mega-Tech)", GAME_NOT_WORKING )
870/* 27 */ GAME( 1989, mt_mystd, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Mystic Defender (Mega-Tech)", GAME_NOT_WORKING )
871/* 28 */ GAME( 1989, mt_revsh, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "The Revenge of Shinobi (Mega-Tech)", GAME_NOT_WORKING )
872/* 29 */ GAME( 19??, mt_parlg, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Parlour Games (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! */
982873/* 30 */ // unknown
983/* 31 */ GAME( 1989, mt_tgolf, megatech, megatech, megatech, 0, ROT0, "Sega",                  "Arnold Palmer Tournament Golf (Mega-Tech)", GAME_NOT_WORKING )
984/* 32 */ GAME( 1989, mt_srbb,  megatech, megatech, megatech, 0, ROT0, "Sega",                  "Super Real Basketball (Mega-Tech)", GAME_NOT_WORKING )
874/* 31 */ GAME( 1989, mt_tgolf, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Arnold Palmer Tournament Golf (Mega-Tech)", GAME_NOT_WORKING )
875/* 32 */ GAME( 1989, mt_srbb,  megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Super Real Basketball (Mega-Tech)", GAME_NOT_WORKING )
985876/* 33 */ // unknown
986877/* 34 */ // unknown
987/* 35 */ GAME( 1989, mt_tlbba, megatech, megatech, megatech, 0, ROT0, "Sega",                  "Tommy Lasorda Baseball (Mega-Tech)", GAME_NOT_WORKING )
988/* 36 */ GAME( 1990, mt_cols,  megatech, megatech, megatech, 0, ROT0, "Sega",                  "Columns (Mega-Tech)", GAME_NOT_WORKING )
878/* 35 */ GAME( 1989, mt_tlbba, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Tommy Lasorda Baseball (Mega-Tech)", GAME_NOT_WORKING )
879/* 36 */ GAME( 1990, mt_cols,  megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Columns (Mega-Tech)", GAME_NOT_WORKING )
989880/* 37 */ // unknown
990/* 38 */ GAME( 1990, mt_eswat, megatech, megatech, megatech, 0, ROT0, "Sega",                  "Cyber Police ESWAT: Enhanced Special Weapons and Tactics (Mega-Tech)", GAME_NOT_WORKING )
991/* 39 */ GAME( 1990, mt_smgp,  megatech, megatech, megatech, 0, ROT0, "Sega",                  "Super Monaco GP (Mega-Tech)", GAME_NOT_WORKING )
992/* 40 */ GAME( 1990, mt_mwalk, megatech, megatech, megatech, 0, ROT0, "Sega",                  "Moonwalker (Mega-Tech)", GAME_NOT_WORKING )
993/* 41 */ GAME( 1990, mt_crack, megatech, megatech, megatech, 0, ROT0, "Sega",                  "Crack Down (Mega-Tech)", GAME_NOT_WORKING )
881/* 38 */ GAME( 1990, mt_eswat, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Cyber Police ESWAT: Enhanced Special Weapons and Tactics (Mega-Tech)", GAME_NOT_WORKING )
882/* 39 */ GAME( 1990, mt_smgp,  megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Super Monaco GP (Mega-Tech)", GAME_NOT_WORKING )
883/* 40 */ GAME( 1990, mt_mwalk, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Moonwalker (Mega-Tech)", GAME_NOT_WORKING )
884/* 41 */ GAME( 1990, mt_crack, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Crack Down (Mega-Tech)", GAME_NOT_WORKING )
994885/* 42 */ // unknown
995886/* 43 */ // unknown
996/* 44 */ GAME( 1990, mt_arrow, megatech, megatech, megatech, 0, ROT0, "Sega",                  "Arrow Flash (Mega-Tech)", GAME_NOT_WORKING )
887/* 44 */ GAME( 1990, mt_arrow, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Arrow Flash (Mega-Tech)", GAME_NOT_WORKING )
997888/* 45 */ // unknown
998889/* 46 */ // unknown
999/* 47 */ GAME( 1990, mt_astrm, megatech, megatech, megatech, 0, ROT0, "Sega",                  "Alien Storm (Mega-Tech", GAME_NOT_WORKING )
890/* 47 */ GAME( 1990, mt_astrm, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Alien Storm (Mega-Tech", GAME_NOT_WORKING )
1000891/* 48 */ // unknown
1001/* 49 */ GAME( 1991, mt_bbros, megatech, megatech, megatech, 0, ROT0, "Sega",                  "Bonanza Bros. (Mega-Tech)", GAME_NOT_WORKING )
892/* 49 */ GAME( 1991, mt_bbros, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Bonanza Bros. (Mega-Tech)", GAME_NOT_WORKING )
1002893/* 50 */ // unknown
1003894/* 51 */ // unknown
1004/* 52 */ GAME( 1991, mt_sonic, megatech, megatech, megatech, 0, ROT0, "Sega",                  "Sonic The Hedgehog (Mega-Tech, set 1)", GAME_NOT_WORKING )
1005/*    */ GAME( 1991, mt_sonia, mt_sonic, megatech, megatech, 0, ROT0, "Sega",                  "Sonic The Hedgehog (Mega-Tech, set 2)", GAME_NOT_WORKING )
1006/* 53 */ GAME( 1990, mt_fshrk, megatech, megatech, megatech, 0, ROT0, "Toaplan / Sega",        "Fire Shark (Mega-Tech)", GAME_NOT_WORKING )
895/* 52 */ GAME( 1991, mt_sonic, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Sonic The Hedgehog (Mega-Tech, set 1)", GAME_NOT_WORKING )
896/*    */ GAME( 1991, mt_sonia, mt_sonic, megatech, megadriv, mtnew, ROT0, "Sega",                  "Sonic The Hedgehog (Mega-Tech, set 2)", GAME_NOT_WORKING )
897/* 53 */ GAME( 1990, mt_fshrk, megatech, megatech, megadriv, mtnew, ROT0, "Toaplan / Sega",        "Fire Shark (Mega-Tech)", GAME_NOT_WORKING )
1007898/* 54 */ // unknown
1008899/* 55 */ // unknown
1009900/* 56 */ // unknown
1010/* 57 */ GAME( 1991, mt_gaxe2, megatech, megatech, megatech, 0, ROT0, "Sega",                  "Golden Axe II (Mega-Tech)", GAME_NOT_WORKING )
1011/* 58 */ GAME( 1991, mt_stf,   megatech, megatech, megatech, 0, ROT0, "Sega",                  "Joe Montana II: Sports Talk Football (Mega-Tech)", GAME_NOT_WORKING )
1012/* 59 */ GAME( 1991, mt_mlh,   megatech, megatech, megatech, 0, ROT0, "Sega",                  "Mario Lemieux Hockey (Mega-Tech)", GAME_NOT_WORKING )
1013/* 60 */ GAME( 1992, mt_kcham, megatech, megatech, megatech, 0, ROT0, "Sega",                  "Kid Chameleon (Mega-Tech)", GAME_NOT_WORKING )
901/* 57 */ GAME( 1991, mt_gaxe2, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Golden Axe II (Mega-Tech)", GAME_NOT_WORKING )
902/* 58 */ GAME( 1991, mt_stf,   megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Joe Montana II: Sports Talk Football (Mega-Tech)", GAME_NOT_WORKING )
903/* 59 */ GAME( 1991, mt_mlh,   megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Mario Lemieux Hockey (Mega-Tech)", GAME_NOT_WORKING )
904/* 60 */ GAME( 1992, mt_kcham, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Kid Chameleon (Mega-Tech)", GAME_NOT_WORKING )
1014905/* 61 */ // unknown
1015/* 62 */ GAME( 1992, mt_soni2, megatech, megatech, megatech, 0, ROT0, "Sega",                  "Sonic The Hedgehog 2 (Mega-Tech)", GAME_NOT_WORKING )
906/* 62 */ GAME( 1992, mt_soni2, megatech, megatech, megadriv, mtnew, ROT0, "Sega",                  "Sonic The Hedgehog 2 (Mega-Tech)", GAME_NOT_WORKING )
1016907/*
1017908    Known to Exist, but nn number currently not known:
1018909    Wrestle War
src/mame/drivers/igs_blit.c
r1037r1038
11761176   }
11771177}
11781178
1179#ifdef UNUSED_FUNCTION
11791180static WRITE16_HANDLER( vbowl_unk_w )
11801181{
11811182}
1183#endif
11821184
11831185static READ16_HANDLER( vbowl_unk_r )
11841186{
src/mame/drivers/gcpinbal.c
r1037r1038
4949   cpunum_set_input_line(0,1,HOLD_LINE);
5050}
5151
52#ifdef UNUSED_FUNCTION
5253static TIMER_CALLBACK( gcpinbal_interrupt3 )
5354{
5455   // IRQ3 is from the M6585
r1037r1038
5758      cpunum_set_input_line(0,3,HOLD_LINE);
5859   }
5960}
61#endif
6062
6163static INTERRUPT_GEN( gcpinbal_interrupt )
6264{
src/mame/drivers/battlera.c
r1037r1038
314314
315315/******************************************************************************/
316316
317ROM_START( battlera )
318   ROM_REGION( 0x100000, REGION_CPU1, 0 ) /* Main cpu code */
319   ROM_LOAD( "00_e1.bin", 0x00000, 0x10000, CRC(aa1cbe69) SHA1(982530f3202bc7b8d94d2b818873b71f02c0e8de) ) /* ET00 */
320   ROM_LOAD( "es01.rom",  0x10000, 0x10000, CRC(9fea3189) SHA1(0692df6df533dfe55f61df8aa0c5c11944ba3ae3) ) /* ET01 */
321   ROM_LOAD( "02_e4.bin", 0x20000, 0x10000, CRC(cd72f580) SHA1(43b476c8f554348b02aa9558c0773f47cdb47fe0) ) /* ET02, etc */
322   /* Rom sockets 0x30000 - 0x70000 are unused */
323   ROM_LOAD( "es05.rom",  0x80000, 0x10000, CRC(551fa331) SHA1(a70c627c572ba1b8029f61eae6eaad9825c56339) )
324   ROM_LOAD( "es06.rom",  0x90000, 0x10000, CRC(ab91aac8) SHA1(81d820c8b70281a4a52f7ec75a3c54377011d9d9) )
325   ROM_LOAD( "es07.rom",  0xa0000, 0x10000, CRC(8d15a3d0) SHA1(afae081ee5e0de359cae6a7ea8401237c5ab7095) )
326   ROM_LOAD( "es08.rom",  0xb0000, 0x10000, CRC(38f06039) SHA1(cc394f161b2c4423cd2da763701ceaad7d27f741) )
327   ROM_LOAD( "es09.rom",  0xc0000, 0x10000, CRC(b718c47d) SHA1(1d5b2ec819b0848e5b883373887445a63ebddb06) )
328   ROM_LOAD( "es10-1.rom",0xd0000, 0x10000, CRC(d3cddc02) SHA1(d212127a9d7aff384171d79c563f1516c0bd46ae) )
329   /* Rom sockets 0xe0000 - 0x100000 are unused */
330
331   ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Sound CPU */
332   ROM_LOAD( "es11.rom",  0x00000, 0x10000, CRC(f5b29c9c) SHA1(44dcdf96f8deb9a29aa9d94a8b9cf91a0ed808d4) )
333ROM_END
334
317335ROM_START( bldwolf )
318336   ROM_REGION( 0x100000, REGION_CPU1, 0 ) /* Main cpu code */
319337   ROM_LOAD( "es00-1.rom", 0x00000, 0x10000, CRC(ff4aa252) SHA1(3c190e49020bb6923abb3f3c2632d3c86443c292) )
r1037r1038
332350   ROM_LOAD( "es11.rom",   0x00000, 0x10000, CRC(f5b29c9c) SHA1(44dcdf96f8deb9a29aa9d94a8b9cf91a0ed808d4) )
333351ROM_END
334352
335ROM_START( battlera )
353ROM_START( bldwolfj ) /* note, rom codes are ER not ES even if the content of some roms is identical */
336354   ROM_REGION( 0x100000, REGION_CPU1, 0 ) /* Main cpu code */
337   ROM_LOAD( "00_e1.bin", 0x00000, 0x10000, CRC(aa1cbe69) SHA1(982530f3202bc7b8d94d2b818873b71f02c0e8de) ) /* ET00 */
338   ROM_LOAD( "es01.rom",  0x10000, 0x10000, CRC(9fea3189) SHA1(0692df6df533dfe55f61df8aa0c5c11944ba3ae3) ) /* ET01 */
339   ROM_LOAD( "02_e4.bin", 0x20000, 0x10000, CRC(cd72f580) SHA1(43b476c8f554348b02aa9558c0773f47cdb47fe0) ) /* ET02, etc */
355   ROM_LOAD( "er00-.0-0", 0x00000, 0x10000, CRC(3819a14e) SHA1(0222051e0b5ec87a18f2e6e9155034f91898c14f) )
356   ROM_LOAD( "er01-.0-1", 0x10000, 0x10000, CRC(763cf206) SHA1(0f1c0f80a6aaad0c987c2ba3fdd01db1f5ceb7e6) )
357   ROM_LOAD( "er02-.0-2", 0x20000, 0x10000, CRC(bcad8a0f) SHA1(e7c69d2c894eaedd10ce02f6bceaa43bb060afb9) )
340358   /* Rom sockets 0x30000 - 0x70000 are unused */
341   ROM_LOAD( "es05.rom",  0x80000, 0x10000, CRC(551fa331) SHA1(a70c627c572ba1b8029f61eae6eaad9825c56339) )
342   ROM_LOAD( "es06.rom",  0x90000, 0x10000, CRC(ab91aac8) SHA1(81d820c8b70281a4a52f7ec75a3c54377011d9d9) )
343   ROM_LOAD( "es07.rom",  0xa0000, 0x10000, CRC(8d15a3d0) SHA1(afae081ee5e0de359cae6a7ea8401237c5ab7095) )
344   ROM_LOAD( "es08.rom",  0xb0000, 0x10000, CRC(38f06039) SHA1(cc394f161b2c4423cd2da763701ceaad7d27f741) )
345   ROM_LOAD( "es09.rom",  0xc0000, 0x10000, CRC(b718c47d) SHA1(1d5b2ec819b0848e5b883373887445a63ebddb06) )
346   ROM_LOAD( "es10-1.rom",0xd0000, 0x10000, CRC(d3cddc02) SHA1(d212127a9d7aff384171d79c563f1516c0bd46ae) )
359   ROM_LOAD( "er05-.1-0", 0x80000, 0x10000, CRC(551fa331) SHA1(a70c627c572ba1b8029f61eae6eaad9825c56339) )
360   ROM_LOAD( "er06-.1-1", 0x90000, 0x10000, CRC(ab91aac8) SHA1(81d820c8b70281a4a52f7ec75a3c54377011d9d9) )
361   ROM_LOAD( "er07-.1-2", 0xa0000, 0x10000, CRC(8d15a3d0) SHA1(afae081ee5e0de359cae6a7ea8401237c5ab7095) )
362   ROM_LOAD( "er08-.1-3", 0xb0000, 0x10000, CRC(38f06039) SHA1(cc394f161b2c4423cd2da763701ceaad7d27f741) )
363   ROM_LOAD( "er09-.1-4", 0xc0000, 0x10000, CRC(b718c47d) SHA1(1d5b2ec819b0848e5b883373887445a63ebddb06) )
364   ROM_LOAD( "er10-.1-5", 0xd0000, 0x10000, CRC(d3cddc02) SHA1(d212127a9d7aff384171d79c563f1516c0bd46ae) )
347365   /* Rom sockets 0xe0000 - 0x100000 are unused */
348366
349367   ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Sound CPU */
350   ROM_LOAD( "es11.rom",  0x00000, 0x10000, CRC(f5b29c9c) SHA1(44dcdf96f8deb9a29aa9d94a8b9cf91a0ed808d4) )
368   ROM_LOAD( "er11-.tpg",   0x00000, 0x10000, CRC(f5b29c9c) SHA1(44dcdf96f8deb9a29aa9d94a8b9cf91a0ed808d4) )
351369ROM_END
352370
371
372
353373/******************************************************************************/
354374
355375GAME( 1988, battlera, 0,        battlera, battlera,  0,   ROT0, "Data East Corporation", "Battle Rangers (World)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
356376GAME( 1988, bldwolf,  battlera, battlera, battlera,  0,   ROT0, "Data East USA", "Bloody Wolf (US)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
377GAME( 1988, bldwolfj, battlera, battlera, battlera,  0,   ROT0, "Data East Corporation", "Narazumono Sentai Bloody Wolf (Japan)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/40love.c
r1037r1038
254254extern UINT8 *fortyl_video_ctrl;
255255extern int fortyl_pix_color[4];
256256
257static UINT8 *undoukai_ram;
257258
258259static int sound_nmi_enable,pending_nmi;
259260
r1037r1038
432433
433434static WRITE8_HANDLER( undoukai_mcu_w )
434435{
435   UINT8 *RAM = memory_region(REGION_CPU1);
436   UINT16 ram_adr = RAM[0xa1b5]*0x100 + RAM[0xa1b4];
436   int ram_adr = undoukai_ram[0x1b5]*0x100 + undoukai_ram[0x1b4];
437437
438438   int d;
439439   int i;
r1037r1038
489489            break;
490490
491491
492
493492         case 0x01:
494493            mcu_out[0][0] = (mcu_in[0][0] ^ (mcu_in[0][0] >> 4)) & 0x0f;
495494            break;
r1037r1038
574573            break;
575574
576575         case 0x0e:
577            mcu_out[1][0] = RAM[ram_adr];
578            mcu_out[1][1] = RAM[ram_adr+1];
579            mcu_out[1][2] = RAM[ram_adr+2] & 0x0f;
576
577            if(ram_adr >= 0xa000 && ram_adr < 0xa800)
578            {
579               ram_adr = ram_adr - 0xa000;
580               mcu_out[1][0] = undoukai_ram[ram_adr];
581               mcu_out[1][1] = undoukai_ram[ram_adr+1];
582               mcu_out[1][2] = undoukai_ram[ram_adr+2] & 0x0f;
583            }
580584            break;
581585
582
583586         default:
584587            from_mcu = 0x5d;
585588
r1037r1038
667670
668671/***************************************************************************/
669672
670static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
671
672   AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM)
673   AM_RANGE(0x8000, 0x87ff) AM_READ(MRA8_RAM)   /* M5517P on main board */
674   AM_RANGE(0xa000, 0xbfff) AM_READ(MRA8_BANK1)
675
676   AM_RANGE(0x9000, 0x97ff) AM_READ(fortyl_bg_videoram_r)   /* #1 M5517P on video board */
677   AM_RANGE(0x9800, 0x983f) AM_READ(MRA8_RAM)            /* video control area */
678   AM_RANGE(0x9840, 0x987f) AM_READ(MRA8_RAM)            /* sprites part 1 */
679   AM_RANGE(0x9880, 0x98bf) AM_READ(fortyl_bg_colorram_r)   /* background attributes */
680   AM_RANGE(0x98c0, 0x98ff) AM_READ(MRA8_RAM)            /* sprites part 2 */
681
682   AM_RANGE(0xc000, 0xffff) AM_READ(fortyl_pixram_r)
683
684
685   AM_RANGE(0x8800, 0x8800) AM_READ(fortyl_mcu_r)
686   AM_RANGE(0x8801, 0x8801) AM_READ(fortyl_mcu_status_r)
687
688   //AM_RANGE(0x8802, 0x8802) AM_READ(pix1_r) // this one is here just for debugging
689   AM_RANGE(0x8803, 0x8803) AM_READ(pix2_r) // and this one _is_ used.
690
691   AM_RANGE(0x8804, 0x8804) AM_READ(from_snd_r)
692   AM_RANGE(0x8805, 0x8805) AM_READ(snd_flag_r)
693   AM_RANGE(0x8807, 0x8807) AM_READ(MRA8_NOP) /* unknown */
694
673static ADDRESS_MAP_START( 40love_map, ADDRESS_SPACE_PROGRAM, 8 )
674   AM_RANGE(0x0000, 0x7fff) AM_ROM
675   AM_RANGE(0x8000, 0x87ff) AM_RAM   /* M5517P on main board */
676   AM_RANGE(0x8800, 0x8800) AM_READWRITE(fortyl_mcu_r, fortyl_mcu_w)
677   AM_RANGE(0x8801, 0x8801) AM_READWRITE(fortyl_mcu_status_r, pix1_w)      //pixel layer related
678   AM_RANGE(0x8802, 0x8802) AM_WRITE(bank_select_w)
679   AM_RANGE(0x8803, 0x8803) AM_READWRITE(pix2_r, pix2_w)      //pixel layer related
680   AM_RANGE(0x8804, 0x8804) AM_READWRITE(from_snd_r, sound_command_w)
681   AM_RANGE(0x8805, 0x8805) AM_READ(snd_flag_r) AM_WRITENOP /*sound_reset*/ //????
682   AM_RANGE(0x8807, 0x8807) AM_READNOP /* unknown */
695683   AM_RANGE(0x8808, 0x8808) AM_READ(input_port_2_r)
696684   AM_RANGE(0x8809, 0x8809) AM_READ(input_port_4_r)
697685   AM_RANGE(0x880a, 0x880a) AM_READ(input_port_3_r)
698686   AM_RANGE(0x880b, 0x880b) AM_READ(input_port_5_r)
699   AM_RANGE(0x880c, 0x880c) AM_READ(input_port_0_r)
700   AM_RANGE(0x880d, 0x880d) AM_READ(input_port_1_r)
687   AM_RANGE(0x880c, 0x880c) AM_READWRITE(input_port_0_r,fortyl_pixram_sel_w) /* pixram bank select */
688   AM_RANGE(0x880d, 0x880d) AM_READ(input_port_1_r) AM_WRITENOP /* unknown */
689   AM_RANGE(0xa000, 0xbfff) AM_ROMBANK(1)
690   AM_RANGE(0x9000, 0x97ff) AM_READWRITE(fortyl_bg_videoram_r, fortyl_bg_videoram_w) AM_BASE(&videoram)      /* #1 M5517P on video board */
691   AM_RANGE(0x9800, 0x983f) AM_RAM AM_BASE(&fortyl_video_ctrl)         /* video control area */
692   AM_RANGE(0x9840, 0x987f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)   /* sprites part 1 */
693   AM_RANGE(0x9880, 0x98bf) AM_READWRITE(fortyl_bg_colorram_r, fortyl_bg_colorram_w) AM_BASE(&colorram)      /* background attributes (2 bytes per line) */
694   AM_RANGE(0x98c0, 0x98ff) AM_RAM AM_BASE(&spriteram_2) AM_SIZE(&spriteram_2_size)/* sprites part 2 */
695   AM_RANGE(0xc000, 0xffff) AM_READWRITE(fortyl_pixram_r, fortyl_pixram_w) /* banked pixel layer */
701696ADDRESS_MAP_END
702697
703static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
704   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)
705   AM_RANGE(0x8000, 0x87ff) AM_WRITE(MWA8_RAM)   /* M5517P on main board */
706   AM_RANGE(0xa000, 0xbfff) AM_WRITE(MWA8_ROM)
707
708   AM_RANGE(0x9000, 0x97ff) AM_WRITE(fortyl_bg_videoram_w) AM_BASE(&videoram)      /* #1 M5517P on video board */
709   AM_RANGE(0x9800, 0x983f) AM_WRITE(MWA8_RAM) AM_BASE(&fortyl_video_ctrl)         /* video control area */
710   AM_RANGE(0x9840, 0x987f) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)   /* sprites part 1 */
711   AM_RANGE(0x9880, 0x98bf) AM_WRITE(fortyl_bg_colorram_w) AM_BASE(&colorram)      /* background attributes (2 bytes per line) */
712   AM_RANGE(0x98c0, 0x98ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram_2) AM_SIZE(&spriteram_2_size)/* sprites part 2 */
713
714   AM_RANGE(0xc000, 0xffff) AM_WRITE(fortyl_pixram_w) /* banked pixel layer */
715
716
717   AM_RANGE(0x8800, 0x8800) AM_WRITE(fortyl_mcu_w)
718   AM_RANGE(0x8801, 0x8801) AM_WRITE(pix1_w)      //pixel layer related
719   AM_RANGE(0x8802, 0x8802) AM_WRITE(bank_select_w)
720   AM_RANGE(0x8803, 0x8803) AM_WRITE(pix2_w)      //pixel layer related
721   AM_RANGE(0x8804, 0x8804) AM_WRITE(sound_command_w)
722//  AM_RANGE(0x8805, 0x8805) AM_WRITE(MWA8_NOP /*sound_reset*/) //????
723   AM_RANGE(0x880c, 0x880c) AM_WRITE(fortyl_pixram_sel_w) /* pixram bank select */
724   AM_RANGE(0x880d, 0x880d) AM_WRITE(MWA8_NOP) /* unknown */
725
726ADDRESS_MAP_END
727
728static ADDRESS_MAP_START( undoukai_readmem, ADDRESS_SPACE_PROGRAM, 8 )
729
730   AM_RANGE(0x0000, 0x7fff) AM_READ(MRA8_ROM)
731   AM_RANGE(0x8000, 0x9fff) AM_READ(MRA8_BANK1)
732   AM_RANGE(0xa000, 0xa7ff) AM_READ(MRA8_RAM)   /* M5517P on main board */
733
734   AM_RANGE(0xb000, 0xb7ff) AM_READ(fortyl_bg_videoram_r)   /* #1 M5517P on video board */
735   AM_RANGE(0xb800, 0xb83f) AM_READ(MRA8_RAM)            /* video control area */
736   AM_RANGE(0xb840, 0xb87f) AM_READ(MRA8_RAM)            /* sprites part 1 */
737   AM_RANGE(0xb880, 0xb8bf) AM_READ(fortyl_bg_colorram_r)   /* background attributes */
738   AM_RANGE(0xb8c0, 0xb8ff) AM_READ(MRA8_RAM)            /* sprites part 2 */
739
740   AM_RANGE(0xc000, 0xffff) AM_READ(fortyl_pixram_r)
741
742
743   AM_RANGE(0xa800, 0xa800) AM_READ(undoukai_mcu_r)
744   AM_RANGE(0xa801, 0xa801) AM_READ(undoukai_mcu_status_r)
745
746   //AM_RANGE(0xa802, 0xa802) AM_READ(pix1_r) // this one is here just for debugging
747   AM_RANGE(0xa803, 0xa803) AM_READ(pix2_r) // and this one _is_ used.
748
749   AM_RANGE(0xa804, 0xa804) AM_READ(from_snd_r)
750   AM_RANGE(0xa805, 0xa805) AM_READ(snd_flag_r)
751   AM_RANGE(0xa807, 0xa807) AM_READ(MRA8_NOP) /* unknown */
752
698static ADDRESS_MAP_START( undoukai_map, ADDRESS_SPACE_PROGRAM, 8 )
699   AM_RANGE(0x0000, 0x7fff) AM_ROM
700   AM_RANGE(0x8000, 0x9fff) AM_ROMBANK(1)
701   AM_RANGE(0xa000, 0xa7ff) AM_RAM   AM_BASE(&undoukai_ram) /* M5517P on main board */
702   AM_RANGE(0xa800, 0xa800) AM_READWRITE(undoukai_mcu_r, undoukai_mcu_w)
703   AM_RANGE(0xa801, 0xa801) AM_READWRITE(undoukai_mcu_status_r, pix1_w)      //pixel layer related
704   AM_RANGE(0xa802, 0xa802) AM_WRITE(bank_select_w)
705   AM_RANGE(0xa803, 0xa803) AM_READWRITE(pix2_r, pix2_w)      //pixel layer related
706   AM_RANGE(0xa804, 0xa804) AM_READWRITE(from_snd_r, sound_command_w)
707   AM_RANGE(0xa805, 0xa805) AM_READ(snd_flag_r) AM_WRITENOP /*sound_reset*/   //????
708   AM_RANGE(0xa807, 0xa807) AM_READNOP AM_WRITENOP /* unknown */
753709   AM_RANGE(0xa808, 0xa808) AM_READ(input_port_2_r)
754710   AM_RANGE(0xa809, 0xa809) AM_READ(input_port_4_r)
755711   AM_RANGE(0xa80a, 0xa80a) AM_READ(input_port_3_r)
756712   AM_RANGE(0xa80b, 0xa80b) AM_READ(input_port_5_r)
757   AM_RANGE(0xa80c, 0xa80c) AM_READ(input_port_0_r)
758   AM_RANGE(0xa80d, 0xa80d) AM_READ(input_port_1_r)
713   AM_RANGE(0xa80c, 0xa80c) AM_READWRITE(input_port_0_r, fortyl_pixram_sel_w) /* pixram bank select */
714   AM_RANGE(0xa80d, 0xa80d) AM_READ(input_port_1_r) AM_WRITENOP /* unknown */
715   AM_RANGE(0xb000, 0xb7ff) AM_READWRITE(fortyl_bg_videoram_r, fortyl_bg_videoram_w) AM_BASE(&videoram)      /* #1 M5517P on video board */
716   AM_RANGE(0xb800, 0xb83f) AM_RAM AM_BASE(&fortyl_video_ctrl)         /* video control area */
717   AM_RANGE(0xb840, 0xb87f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)   /* sprites part 1 */
718   AM_RANGE(0xb880, 0xb8bf) AM_READWRITE(fortyl_bg_colorram_r, fortyl_bg_colorram_w) AM_BASE(&colorram)      /* background attributes (2 bytes per line) */
719   AM_RANGE(0xb8e0, 0xb8ff) AM_RAM AM_BASE(&spriteram_2) AM_SIZE(&spriteram_2_size) /* sprites part 2 */
720   AM_RANGE(0xc000, 0xffff) AM_READWRITE(fortyl_pixram_r, fortyl_pixram_w)
759721ADDRESS_MAP_END
760722
761static ADDRESS_MAP_START( undoukai_writemem, ADDRESS_SPACE_PROGRAM, 8 )
762   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)
763   AM_RANGE(0x8000, 0x9fff) AM_WRITE(MWA8_ROM)
764   AM_RANGE(0xa000, 0xa7ff) AM_WRITE(MWA8_RAM)   /* M5517P on main board */
765723
766   AM_RANGE(0xa800, 0xa800) AM_WRITE(undoukai_mcu_w)
767   AM_RANGE(0xa801, 0xa801) AM_WRITE(pix1_w)      //pixel layer related
768   AM_RANGE(0xa802, 0xa802) AM_WRITE(bank_select_w)
769   AM_RANGE(0xa803, 0xa803) AM_WRITE(pix2_w)      //pixel layer related
770   AM_RANGE(0xa804, 0xa804) AM_WRITE(sound_command_w)
771   AM_RANGE(0xa805, 0xa805) AM_WRITE(MWA8_NOP) /*sound_reset*/   //????
772   AM_RANGE(0xa807, 0xa807) AM_WRITE(MWA8_NOP) /* unknown */
773   AM_RANGE(0xa80c, 0xa80c) AM_WRITE(fortyl_pixram_sel_w) /* pixram bank select */
774   AM_RANGE(0xa80d, 0xa80d) AM_WRITE(MWA8_NOP) /* unknown */
775
776   AM_RANGE(0xb000, 0xb7ff) AM_WRITE(fortyl_bg_videoram_w) AM_BASE(&videoram)      /* #1 M5517P on video board */
777   AM_RANGE(0xb800, 0xb83f) AM_WRITE(MWA8_RAM) AM_BASE(&fortyl_video_ctrl)         /* video control area */
778   AM_RANGE(0xb840, 0xb87f) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)   /* sprites part 1 */
779   AM_RANGE(0xb880, 0xb8bf) AM_WRITE(fortyl_bg_colorram_w) AM_BASE(&colorram)      /* background attributes (2 bytes per line) */
780   AM_RANGE(0xb8e0, 0xb8ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram_2) AM_SIZE(&spriteram_2_size)/* sprites part 2 */
781
782   AM_RANGE(0xc000, 0xffff) AM_WRITE(fortyl_pixram_w)
783ADDRESS_MAP_END
784
785
786static ADDRESS_MAP_START( readmem_sound, ADDRESS_SPACE_PROGRAM, 8 )
787   AM_RANGE(0x0000, 0xbfff) AM_READ(MRA8_ROM)
788   AM_RANGE(0xc000, 0xc7ff) AM_READ(MRA8_RAM)
789   AM_RANGE(0xd800, 0xd800) AM_READ(soundlatch_r)
790   AM_RANGE(0xda00, 0xda00) AM_READ(MRA8_NOP) /* unknown */
791   AM_RANGE(0xde00, 0xde00) AM_READ(MRA8_NOP) /* unknown */
792   AM_RANGE(0xe000, 0xefff) AM_READ(MRA8_ROM)   /* space for diagnostics ROM */
793ADDRESS_MAP_END
794
795724static int vol_ctrl[16];
796725
797726static MACHINE_RESET( ta7630 )
r1037r1038
856785//  popmessage("SND3 0=%02x 1=%02x 2=%02x 3=%02x", snd_ctrl0, snd_ctrl1, snd_ctrl2, snd_ctrl3);
857786}
858787
859static ADDRESS_MAP_START( writemem_sound, ADDRESS_SPACE_PROGRAM, 8 )
860   AM_RANGE(0x0000, 0xbfff) AM_WRITE(MWA8_ROM)
861   AM_RANGE(0xc000, 0xc7ff) AM_WRITE(MWA8_RAM)
788static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
789   AM_RANGE(0x0000, 0xbfff) AM_ROM
790   AM_RANGE(0xc000, 0xc7ff) AM_RAM
862791   AM_RANGE(0xc800, 0xc800) AM_WRITE(AY8910_control_port_0_w)
863792   AM_RANGE(0xc801, 0xc801) AM_WRITE(AY8910_write_port_0_w)
864793   AM_RANGE(0xca00, 0xca0d) AM_WRITE(MSM5232_0_w)
865794   AM_RANGE(0xcc00, 0xcc00) AM_WRITE(sound_control_0_w)
866795   AM_RANGE(0xce00, 0xce00) AM_WRITE(sound_control_1_w)
867   AM_RANGE(0xd800, 0xd800) AM_WRITE(to_main_w)
868   AM_RANGE(0xda00, 0xda00) AM_WRITE(nmi_enable_w)
796   AM_RANGE(0xd800, 0xd800) AM_READWRITE(soundlatch_r, to_main_w)
797   AM_RANGE(0xda00, 0xda00) AM_READNOP AM_WRITE(nmi_enable_w) /* unknown read */
869798   AM_RANGE(0xdc00, 0xdc00) AM_WRITE(nmi_disable_w)
870   AM_RANGE(0xde00, 0xde00) AM_WRITE(DAC_0_signed_data_w)      /* signed 8-bit DAC */
871   AM_RANGE(0xe000, 0xefff) AM_WRITE(MWA8_ROM)
799   AM_RANGE(0xde00, 0xde00) AM_READNOP AM_WRITE(DAC_0_signed_data_w)      /* signed 8-bit DAC - unknown read */
800   AM_RANGE(0xe000, 0xefff) AM_ROM /* space for diagnostics ROM */
872801ADDRESS_MAP_END
873802
874
875static ADDRESS_MAP_START( mcu_readmem, ADDRESS_SPACE_PROGRAM, 8 )
803static ADDRESS_MAP_START( mcu_map, ADDRESS_SPACE_PROGRAM, 8 )
876804   ADDRESS_MAP_FLAGS( AMEF_ABITS(11) )
877   AM_RANGE(0x0000, 0x0000) AM_READ(buggychl_68705_portA_r)
878   AM_RANGE(0x0001, 0x0001) AM_READ(buggychl_68705_portB_r)
879   AM_RANGE(0x0002, 0x0002) AM_READ(buggychl_68705_portC_r)
880   AM_RANGE(0x0010, 0x007f) AM_READ(MRA8_RAM)
881   AM_RANGE(0x0080, 0x07ff) AM_READ(MRA8_ROM)
882ADDRESS_MAP_END
883
884static ADDRESS_MAP_START( mcu_writemem, ADDRESS_SPACE_PROGRAM, 8 )
885   ADDRESS_MAP_FLAGS( AMEF_ABITS(11) )
886   AM_RANGE(0x0000, 0x0000) AM_WRITE(buggychl_68705_portA_w)
887   AM_RANGE(0x0001, 0x0001) AM_WRITE(buggychl_68705_portB_w)
888   AM_RANGE(0x0002, 0x0002) AM_WRITE(buggychl_68705_portC_w)
805   AM_RANGE(0x0000, 0x0000) AM_READWRITE(buggychl_68705_portA_r, buggychl_68705_portA_w)
806   AM_RANGE(0x0001, 0x0001) AM_READWRITE(buggychl_68705_portB_r, buggychl_68705_portB_w)
807   AM_RANGE(0x0002, 0x0002) AM_READWRITE(buggychl_68705_portC_r, buggychl_68705_portC_w)
889808   AM_RANGE(0x0004, 0x0004) AM_WRITE(buggychl_68705_ddrA_w)
890809   AM_RANGE(0x0005, 0x0005) AM_WRITE(buggychl_68705_ddrB_w)
891810   AM_RANGE(0x0006, 0x0006) AM_WRITE(buggychl_68705_ddrC_w)
892   AM_RANGE(0x0010, 0x007f) AM_WRITE(MWA8_RAM)
893   AM_RANGE(0x0080, 0x07ff) AM_WRITE(MWA8_ROM)
811   AM_RANGE(0x0010, 0x007f) AM_RAM
812   AM_RANGE(0x0080, 0x07ff) AM_ROM
894813ADDRESS_MAP_END
895814
896815
r1037r1038
11801099
11811100   /* basic machine hardware */
11821101   MDRV_CPU_ADD(Z80,8000000/2) /* OK */
1183   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
1102   MDRV_CPU_PROGRAM_MAP(40love_map,0)
11841103   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
11851104
11861105   MDRV_CPU_ADD(Z80,8000000/2)
11871106   /* audio CPU */ /* OK */
1188   MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound)
1107   MDRV_CPU_PROGRAM_MAP(sound_map,0)
11891108   MDRV_CPU_VBLANK_INT(irq0_line_hold,2)   /* source/number of IRQs is unknown */
11901109
11911110   MDRV_CPU_ADD(M68705,18432000/6/M68705_CLOCK_DIVIDER) /* OK */
1192   MDRV_CPU_PROGRAM_MAP(mcu_readmem,mcu_writemem)
1111   MDRV_CPU_PROGRAM_MAP(mcu_map,0)
11931112
11941113   MDRV_SCREEN_REFRESH_RATE(60)
11951114   MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION)
r1037r1038
12271146
12281147   /* basic machine hardware */
12291148   MDRV_CPU_ADD(Z80,8000000/2)
1230   MDRV_CPU_PROGRAM_MAP(undoukai_readmem,undoukai_writemem)
1149   MDRV_CPU_PROGRAM_MAP(undoukai_map,0)
12311150   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
12321151
12331152   MDRV_CPU_ADD(Z80,8000000/2)
12341153   /* audio CPU */
1235   MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound)
1154   MDRV_CPU_PROGRAM_MAP(sound_map,0)
12361155   MDRV_CPU_VBLANK_INT(irq0_line_hold,2)   /* source/number of IRQs is unknown */
12371156
12381157//  MDRV_CPU_ADD(M68705,18432000/6/M68705_CLOCK_DIVIDER)
1239//  MDRV_CPU_PROGRAM_MAP(mcu_readmem,mcu_writemem)
1158//  MDRV_CPU_PROGRAM_MAP(mcu_map,0)
12401159
12411160   MDRV_SCREEN_REFRESH_RATE(60)
12421161   MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION)
src/mame/drivers/galaga.c
r1037r1038
31443144GAME( 1982, digdugat, digdug,  digdug,  digdug,   0,       ROT90, "[Namco] (Atari license)", "Dig Dug (Atari, rev 2)", GAME_SUPPORTS_SAVE )
31453145GAME( 1982, digduga1, digdug,  digdug,  digdug,   0,       ROT90, "[Namco] (Atari license)", "Dig Dug (Atari, rev 1)", GAME_SUPPORTS_SAVE )
31463146GAME( 1982, dzigzag,  digdug,  dzigzag, digdug,   0,       ROT90, "bootleg", "Zig Zag (Dig Dug hardware)", GAME_SUPPORTS_SAVE )
3147GAME( 1982, digsid,   digdug,  digdug, digdug,    0,       ROT90, "bootleg", "Dig Dug (Sidam bootleg)", GAME_SUPPORTS_SAVE ) // still has Namco copyright intact
3147GAME( 1982, digsid,   digdug,  digdug, digdug,    0,       ROT90, "bootleg", "Dig Dug (Sidam license)", GAME_SUPPORTS_SAVE ) // still has Namco copyright intact
src/mame/drivers/othunder.c
r1037r1038
175175  - Notice screen only if region = 0x0001
176176  - According to the manual, DSWB bit 6 determines continue pricing :
177177
178    PORT_DIPNAME( 0x40, 0x00, DEF_STR( Continue_Price ) )
179    PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
180    PORT_DIPSETTING(    0x00, "Same as Start" )
178    PORT_DIPNAME( 0x40, 0x40, DEF_STR( Continue_Price ) )
179    PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
180    PORT_DIPSETTING(    0x40, "Same as Start" )
181181
182182    However, many conditions are required to make it work due to code at 0x00e0c4 :
183183      * region must not be 0x0001
r1037r1038
186186    This is why this Dip Switch has NO effect in the following sets :
187187      * 'othunder' : coinage can't be 2C_1C for the 2 slots (coin B)
188188      * 'othundrj' : region = 0x0001
189  - DSWB bit 7 ("Language") affects parts of the texts (not the ones in "demo mode")
190    but the voices are always in English regardless of the region !
189191
190192
1911932) 'othundu'
r1037r1038
575577   PORT_DIPSETTING(    0x30, "40" )
576578   PORT_DIPSETTING(    0x20, "50" )
577579   PORT_DIPUNUSED( 0x40, IP_ACTIVE_LOW )                        /* see notes */
578   PORT_DIPUNUSED( 0x80, IP_ACTIVE_LOW )
580   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Language ) )
581   PORT_DIPSETTING(    0x00, DEF_STR( English ) )
582   PORT_DIPSETTING(    0x80, DEF_STR( Japanese ) )
579583
580584   PORT_START_TAG("IN0")
581585   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
r1037r1038
635639   PORT_INCLUDE( othundrj )
636640
637641   PORT_MODIFY( "DSWB" )
638    PORT_DIPNAME( 0x40, 0x00, DEF_STR( Continue_Price ) )        /* see notes */
639    PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
640    PORT_DIPSETTING(    0x00, "Same as Start" )
642    PORT_DIPNAME( 0x40, 0x40, DEF_STR( Continue_Price ) )        /* see notes */
643    PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
644    PORT_DIPSETTING(    0x40, "Same as Start" )
641645INPUT_PORTS_END
642646
643647
src/mame/drivers/jcross.c
r1037r1038
3939
4040static int sound_cpu_busy=0;
4141
42#ifdef UNUSED_FUNCTION
4243UINT8 *jcr_sharedram;
4344static READ8_HANDLER(sharedram_r){   return jcr_sharedram[offset];}
4445static WRITE8_HANDLER(sharedram_w){   jcr_sharedram[offset]=data;}
46#endif
4547
4648static struct namco_interface snkwave_interface =
4749{
src/mame/drivers/tumblep.c
r1037r1038
5656
5757/******************************************************************************/
5858
59#ifdef UNUSED_FUNCTION
5960static WRITE16_HANDLER( tumblep_oki_w )
6061{
6162   OKIM6295_data_0_w(0,data&0xff);
r1037r1038
6667{
6768   return ~0;
6869}
70#endif
6971
7072static WRITE16_HANDLER( tumblep_sound_w )
7173{
r1037r1038
7375   cpunum_set_input_line(1,0,HOLD_LINE);
7476}
7577
78#ifdef UNUSED_FUNCTION
7679static WRITE16_HANDLER( jumppop_sound_w )
7780{
7881   soundlatch_w(0,data & 0xff);
7982   cpunum_set_input_line( 1, 0, ASSERT_LINE );
8083}
84#endif
8185
8286/******************************************************************************/
8387
src/mame/drivers/jalmah.c
r1037r1038
453453   }
454454}
455455
456#ifdef UNUSED_FUNCTION
456457static WRITE16_HANDLER( jalmah_reg_w )
457458{
458459   COMBINE_DATA(&jm_regs[offset]);
459460}
461#endif
460462
461463static WRITE16_HANDLER( jalmah_scroll_w )
462464{
src/mame/drivers/namcos2.c
r1037r1038
600600static ADDRESS_MAP_START( master_default_am, ADDRESS_SPACE_PROGRAM, 16 )
601601   AM_RANGE(0x000000, 0x03ffff) AM_READ(MRA16_ROM) AM_WRITE(MWA16_ROM)
602602   AM_RANGE(0x100000, 0x10ffff) AM_READ(NAMCOS2_68K_MASTER_RAM_R) AM_WRITE(NAMCOS2_68K_MASTER_RAM_W)
603   AM_RANGE(0x180000, 0x183fff) AM_READ(NAMCOS2_68K_EEPROM_R) AM_WRITE(NAMCOS2_68K_EEPROM_W) AM_BASE(&namcos2_eeprom) AM_SIZE(&namcos2_eeprom_size)
603   AM_RANGE(0x180000, 0x183fff) AM_READ(NAMCOS2_68K_EEPROM_R) AM_WRITE(NAMCOS2_68K_EEPROM_W)
604604   AM_RANGE(0x1c0000, 0x1fffff) AM_READ(namcos2_68k_master_C148_r) AM_WRITE(namcos2_68k_master_C148_w)
605605ADDRESS_MAP_END
606606
r1037r1038
618618static ADDRESS_MAP_START( master_finallap_am, ADDRESS_SPACE_PROGRAM, 16 )
619619   AM_RANGE(0x000000, 0x03ffff) AM_READ(MRA16_ROM) AM_WRITE(MWA16_ROM)
620620   AM_RANGE(0x100000, 0x10ffff) AM_READ(NAMCOS2_68K_MASTER_RAM_R) AM_WRITE(NAMCOS2_68K_MASTER_RAM_W)
621   AM_RANGE(0x180000, 0x183fff) AM_READ(NAMCOS2_68K_EEPROM_R) AM_WRITE(NAMCOS2_68K_EEPROM_W) AM_BASE(&namcos2_eeprom) AM_SIZE(&namcos2_eeprom_size)
621   AM_RANGE(0x180000, 0x183fff) AM_READ(NAMCOS2_68K_EEPROM_R) AM_WRITE(NAMCOS2_68K_EEPROM_W)
622622   AM_RANGE(0x1c0000, 0x1fffff) AM_READ(namcos2_68k_master_C148_r) AM_WRITE(namcos2_68k_master_C148_w)
623623ADDRESS_MAP_END
624624
r1037r1038
640640static ADDRESS_MAP_START( master_sgunner_am, ADDRESS_SPACE_PROGRAM, 16 )
641641   AM_RANGE(0x000000, 0x03ffff) AM_READ(MRA16_ROM) AM_WRITE(MWA16_ROM)
642642   AM_RANGE(0x100000, 0x10ffff) AM_READ(NAMCOS2_68K_MASTER_RAM_R) AM_WRITE(NAMCOS2_68K_MASTER_RAM_W)
643   AM_RANGE(0x180000, 0x183fff) AM_READ(NAMCOS2_68K_EEPROM_R) AM_WRITE(NAMCOS2_68K_EEPROM_W) AM_BASE(&namcos2_eeprom) AM_SIZE(&namcos2_eeprom_size)
643   AM_RANGE(0x180000, 0x183fff) AM_READ(NAMCOS2_68K_EEPROM_R) AM_WRITE(NAMCOS2_68K_EEPROM_W)
644644   AM_RANGE(0x1c0000, 0x1fffff) AM_READ(namcos2_68k_master_C148_r) AM_WRITE(namcos2_68k_master_C148_w)
645645ADDRESS_MAP_END
646646
r1037r1038
663663static ADDRESS_MAP_START( master_metlhawk_am, ADDRESS_SPACE_PROGRAM, 16 )
664664   AM_RANGE(0x000000, 0x03ffff) AM_READ(MRA16_ROM) AM_WRITE(MWA16_ROM)
665665   AM_RANGE(0x100000, 0x10ffff) AM_READ(NAMCOS2_68K_MASTER_RAM_R) AM_WRITE(NAMCOS2_68K_MASTER_RAM_W)
666   AM_RANGE(0x180000, 0x183fff) AM_READ(NAMCOS2_68K_EEPROM_R) AM_WRITE(NAMCOS2_68K_EEPROM_W) AM_BASE(&namcos2_eeprom) AM_SIZE(&namcos2_eeprom_size)
666   AM_RANGE(0x180000, 0x183fff) AM_READ(NAMCOS2_68K_EEPROM_R) AM_WRITE(NAMCOS2_68K_EEPROM_W)
667667   AM_RANGE(0x1c0000, 0x1fffff) AM_READ(namcos2_68k_master_C148_r) AM_WRITE(namcos2_68k_master_C148_w)
668668ADDRESS_MAP_END
669669
r1037r1038
691691static ADDRESS_MAP_START( master_luckywld_am, ADDRESS_SPACE_PROGRAM, 16 )
692692   AM_RANGE(0x000000, 0x03ffff) AM_READ(MRA16_ROM) AM_WRITE(MWA16_ROM)
693693   AM_RANGE(0x100000, 0x10ffff) AM_READ(NAMCOS2_68K_MASTER_RAM_R) AM_WRITE(NAMCOS2_68K_MASTER_RAM_W)
694   AM_RANGE(0x180000, 0x183fff) AM_READ(NAMCOS2_68K_EEPROM_R) AM_WRITE(NAMCOS2_68K_EEPROM_W) AM_BASE(&namcos2_eeprom) AM_SIZE(&namcos2_eeprom_size)
694   AM_RANGE(0x180000, 0x183fff) AM_READ(NAMCOS2_68K_EEPROM_R) AM_WRITE(NAMCOS2_68K_EEPROM_W)
695695   AM_RANGE(0x1c0000, 0x1fffff) AM_READ(namcos2_68k_master_C148_r) AM_WRITE(namcos2_68k_master_C148_w)
696696ADDRESS_MAP_END
697697
src/mame/drivers/topshoot.c
r1037r1038
214214   AM_RANGE(0x200000, 0x2023ff) AM_WRITE(MWA16_RAM) // tested
215215   AM_RANGE(0xa10000, 0xa1001f) AM_WRITE(genesis_io_w) AM_BASE(&genesis_io_ram)            /* Genesis Input */
216216   AM_RANGE(0xa11000, 0xa11203) AM_WRITE(genesis_ctrl_w)
217   AM_RANGE(0xa00000, 0xa0ffff) AM_WRITE(megaplay_68k_to_z80_w)
217   AM_RANGE(0xa00000, 0xa0ffff) AM_WRITE(genesis_68k_to_z80_w)
218218   AM_RANGE(0xc00000, 0xc0001f) AM_WRITE(genesis_vdp_w)            /* VDP Access */
219219   AM_RANGE(0xfe0000, 0xfeffff) AM_WRITE(MWA16_BANK4)
220220   AM_RANGE(0xff0000, 0xffffff) AM_WRITE(MWA16_RAM) AM_BASE(&genesis_68k_ram)/* Main Ram */
src/mame/drivers/megaplay.c
r1037r1038
1/* Sega MegaPlay */
1/* Sega MegaPlay
22
3  changelog:
4
5  22 Sept 2007 - Started updating this to use the new Megadrive code,
6                 fixing issues with Mazin Wars + Grand Slam.
7                 However I'm still not convinced that the handling of
8                 the Megaplay side of things is correct at all, and
9                 we're still hanging off the old SMS vdp code and
10                 IO code.
11
12*/
13
314/*
415
5todo: cleanup, fix so that everything works properly
6      rewrite genesis emulation (so that it works perfectly with every genesis game)
7
816About MegaPlay:
917
1018Megaplay games are specially designed Genesis games, produced for arcade use.
1119
1220The code of these games has significant modifications when compared to the Genesis
13releases and in many cases the games are cut-down versions of the games released for
14the home system.  For example, Sonic has less zones, and no special stages, thus making
15it impossible to get all the chaos emeralds.  Zones also have a strict timer.
21releases and in many cases the games are cut-down versions of the games that were
22released for the home system.  For example, Sonic has less zones, and no special
23stages, thus making it impossible to get all the chaos emeralds.  Zones also have a
24strict timer.
1625
1726Coins buy you credits on Megaplay games, meaning if you lose all your lives the game is
1827over, like a regular Arcade game.
r1037r1038
3241
3342#include "driver.h"
3443#include "genesis.h"
44#include "megadriv.h"
3545
3646#define MASTER_CLOCK      53693100
3747
r1037r1038
5060static UINT8 bios_6403;
5161static UINT8 bios_6404;
5262static UINT8* ic3_ram;
53//static UINT8 ic36_ram[0x4000];
54static UINT8 ic37_ram[0x8000];
63
64static UINT8* ic37_ram;
5565UINT16 *ic36_ram;
5666
57static UINT32 readpos = 1;  // serial bank selection position (9-bit)
67//static UINT8 ic36_ram[0x4000];
5868
5969
60static MACHINE_RESET( megaplay )
70static UINT8 hintcount;         /* line interrupt counter, decreased each scanline */
71extern UINT8 segae_vintpending;
72extern UINT8 segae_hintpending;
73extern UINT8 *segae_vdp_regs[];      /* pointer to vdp's registers */
74
75// Interrupt handler - from drivers/segasyse.c
76INTERRUPT_GEN (megaplay_bios_irq)
6177{
62//  UINT8* ram = memory_region(REGION_CPU3);
78   int sline;
79   sline = 261 - cpu_getiloops();
6380
64   /* mirroring of ram etc. */
65   memory_set_bankptr(1, &genesis_z80_ram[0]);
66   memory_set_bankptr(2, &ic36_ram[0]);
67   memory_set_bankptr(3, &genesis_68k_ram[0]);
81   if (sline ==0) {
82      hintcount = segae_vdp_regs[0][10];
83   }
6884
69   machine_reset_genesis(machine);
85   if (sline <= 192) {
86
87//      if (sline != 192) segae_drawscanline(sline,1,1);
88
89      if (sline == 192)
90         segae_vintpending = 1;
91
92      if (hintcount == 0) {
93         hintcount = segae_vdp_regs[0][10];
94         segae_hintpending = 1;
95
96         if  ((segae_vdp_regs[0][0] & 0x10)) {
97            cpunum_set_input_line(2, 0, HOLD_LINE);
98            return;
99         }
100
101      } else {
102         hintcount--;
103      }
104   }
105
106   if (sline > 192) {
107      hintcount = segae_vdp_regs[0][10];
108
109      if ( (sline<0xe0) && (segae_vintpending) ) {
110         cpunum_set_input_line(2, 0, HOLD_LINE);
111      }
112   }
113
70114}
71115
72116
117static UINT32 readpos = 1;  // serial bank selection position (9-bit)
118
73119#define MEGAPLAY_TEST \
74120   PORT_START \
75121   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Select") PORT_CODE(KEYCODE_0) \
r1037r1038
538584   }
539585}
540586
541
542static ADDRESS_MAP_START( megaplay_genesis_readmem, ADDRESS_SPACE_PROGRAM, 16 )
543   AM_RANGE(0x000000, 0x3fffff) AM_READ(MRA16_ROM)               /* Cartridge Program Rom */
544   AM_RANGE(0xa10000, 0xa1001f) AM_READ(megaplay_genesis_io_r)            /* Genesis Input */
545   AM_RANGE(0xa11000, 0xa11203) AM_READ(genesis_ctrl_r)
546   AM_RANGE(0xa00000, 0xa0ffff) AM_READ(megaplay_68k_to_z80_r) AM_BASE(&ic36_ram)
547   AM_RANGE(0xc00000, 0xc0001f) AM_READ(genesis_vdp_r)            /* VDP Access */
548   AM_RANGE(0xfe0000, 0xfeffff) AM_READ(MRA16_BANK3)            /* Main Ram */
549   AM_RANGE(0xff0000, 0xffffff) AM_READ(MRA16_RAM)               /* Main Ram */
550ADDRESS_MAP_END
551
552static ADDRESS_MAP_START( genesis_writemem, ADDRESS_SPACE_PROGRAM, 16 )
553   AM_RANGE(0x000000, 0x3fffff) AM_WRITE(MWA16_ROM)               /* Cartridge Program Rom */
554   AM_RANGE(0xa10000, 0xa1001f) AM_WRITE(genesis_io_w) AM_BASE(&genesis_io_ram)            /* Genesis Input */
555   AM_RANGE(0xa11000, 0xa11203) AM_WRITE(genesis_ctrl_w)
556   AM_RANGE(0xa00000, 0xa0ffff) AM_WRITE(megaplay_68k_to_z80_w)
557   AM_RANGE(0xc00000, 0xc0001f) AM_WRITE(genesis_vdp_w)            /* VDP Access */
558   AM_RANGE(0xfe0000, 0xfeffff) AM_WRITE(MWA16_BANK3)            /* Main Ram */
559   AM_RANGE(0xff0000, 0xffffff) AM_WRITE(MWA16_RAM) AM_BASE(&genesis_68k_ram)/* Main Ram */
560ADDRESS_MAP_END
561
562static ADDRESS_MAP_START( megaplay_z80_readmem, ADDRESS_SPACE_PROGRAM, 8 )
563    AM_RANGE(0x0000, 0x1fff) AM_READ(MRA8_BANK1)
564    AM_RANGE(0x2000, 0x3fff) AM_READ(MRA8_BANK2)
565   AM_RANGE(0x4000, 0x7fff) AM_READ(genesis_z80_r)
566   AM_RANGE(0x8000, 0xffff) AM_READ(genesis_z80_bank_r)
567ADDRESS_MAP_END
568
569static ADDRESS_MAP_START( megaplay_z80_writemem, ADDRESS_SPACE_PROGRAM, 8 )
570   AM_RANGE(0x0000, 0x1fff) AM_WRITE(MWA8_BANK1) AM_BASE(&genesis_z80_ram)
571    AM_RANGE(0x2000, 0x3fff) AM_WRITE(MWA8_BANK2)
572   AM_RANGE(0x4000, 0x7fff) AM_WRITE(genesis_z80_w)
573 // AM_RANGE(0x8000, 0xffff) AM_WRITE(genesis_z80_bank_w)
574ADDRESS_MAP_END
575
576
577
578
579587static ADDRESS_MAP_START( megaplay_bios_readmem, ADDRESS_SPACE_PROGRAM, 8 )
580588    AM_RANGE(0x0000, 0x3fff) AM_READ(MRA8_ROM)
581589   AM_RANGE(0x4000, 0x4fff) AM_READ(MRA8_RAM)
r1037r1038
610618   AM_RANGE(0x8000, 0xffff) AM_WRITE(bank_w)
611619ADDRESS_MAP_END
612620
621/* basically from src/drivers/segasyse.c */
622UINT8 segae_vdp_ctrl_r ( UINT8 chip );
623UINT8 segae_vdp_data_r ( UINT8 chip );
624void segae_vdp_ctrl_w ( UINT8 chip, UINT8 data );
625void segae_vdp_data_w ( UINT8 chip, UINT8 data );
626
627READ8_HANDLER (megaplay_bios_port_be_bf_r)
628{
629   UINT8 temp = 0;
630
631   switch (offset)
632   {
633      case 0: /* port 0xbe, VDP 1 DATA Read */
634         temp = segae_vdp_data_r(0); break ;
635      case 1: /* port 0xbf, VDP 1 CTRL Read */
636         temp = segae_vdp_ctrl_r(0); break ;
637   }
638   return temp;
639}
640
641WRITE8_HANDLER (megaplay_bios_port_be_bf_w)
642{
643   switch (offset)
644   {
645      case 0: /* port 0xbe, VDP 1 DATA Write */
646         segae_vdp_data_w(0, data); break;
647      case 1: /* port 0xbf, VDP 1 CTRL Write */
648         segae_vdp_ctrl_w(0, data); break;
649   }
650}
651
613652static ADDRESS_MAP_START( megaplay_bios_readport, ADDRESS_SPACE_IO, 8 )
614653   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
615654//  AM_RANGE(0xdc, 0xdc) AM_READ(megatech_bios_port_dc_r)  // player inputs
616655//  AM_RANGE(0xdd, 0xdd) AM_READ(megatech_bios_port_dd_r)  // other player 2 inputs
617   AM_RANGE(0xbe, 0xbf) AM_READ(megatech_bios_port_be_bf_r)         /* VDP */
656   AM_RANGE(0xbe, 0xbf) AM_READ(megaplay_bios_port_be_bf_r)         /* VDP */
618657ADDRESS_MAP_END
619658
620659static ADDRESS_MAP_START( megaplay_bios_writeport, ADDRESS_SPACE_IO, 8 )
621660   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
622661//  AM_RANGE(0x3f, 0x3f) AM_WRITE(megatech_bios_port_ctrl_w)
623662   AM_RANGE(0x7f, 0x7f) AM_WRITE(SN76496_1_w)   /* SN76489 */
624   AM_RANGE(0xbe, 0xbf) AM_WRITE(megatech_bios_port_be_bf_w)         /* VDP */
663   AM_RANGE(0xbe, 0xbf) AM_WRITE(megaplay_bios_port_be_bf_w)         /* VDP */
625664ADDRESS_MAP_END
626665
627666
628static MACHINE_DRIVER_START( megaplay )
667/* in video/segasyse.c */
668void megaplay_start_video_normal(running_machine *machine);
669void megaplay_update_video_normal(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect );
629670
630   /* basic machine hardware */
631   MDRV_CPU_ADD_TAG("main", M68000, MASTER_CLOCK / 7)
632   MDRV_CPU_PROGRAM_MAP(megaplay_genesis_readmem, genesis_writemem)
633   MDRV_CPU_VBLANK_INT(genesis_vblank_interrupt,1)
671/* give us access to the megadriv start and update functions so that we can call them */
672extern UINT32 video_update_megadriv(running_machine *machine, int screen, mame_bitmap *bitmap, const rectangle *cliprect);
673extern void video_start_megadriv(running_machine *machine);
634674
635   MDRV_CPU_ADD_TAG("sound", Z80, MASTER_CLOCK / 15)
636   MDRV_CPU_PROGRAM_MAP(megaplay_z80_readmem, megaplay_z80_writemem)
637   MDRV_CPU_VBLANK_INT(irq0_line_hold, 1) /* from vdp at scanline 0xe0 */
675VIDEO_START(megplay)
676{
677   //printf("megplay vs\n");
678   video_start_megadriv(Machine);
679   megaplay_start_video_normal(Machine);
680}
638681
639   MDRV_SCREEN_REFRESH_RATE(60)
682VIDEO_UPDATE(megplay)
683{
684   //printf("megplay vu\n");
685   video_update_megadriv(Machine,0,bitmap,cliprect);
686   megaplay_update_video_normal(Machine, bitmap,cliprect);
687   return 0;
688}
640689
641   MDRV_INTERLEAVE(100)
642690
643   /* video hardware */
644   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_HAS_SHADOWS | VIDEO_HAS_HIGHLIGHTS)
645   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
646   MDRV_SCREEN_SIZE(342,262)
647   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 223)
648   MDRV_PALETTE_LENGTH(64+32) /* +32 for megaplay bios vdp part */
691//extern VIDEO_EOF(megadriv);
649692
650   /* sound hardware */
651   MDRV_SPEAKER_STANDARD_MONO("mono")
693static MACHINE_DRIVER_START( mpnew )
652694
653   MDRV_SOUND_ADD(YM3438, MASTER_CLOCK/7)
654   MDRV_SOUND_ROUTE(0, "mono", 0.50)
655   MDRV_SOUND_ROUTE(1, "mono", 0.50)
695   /* basic machine hardware */
696   MDRV_IMPORT_FROM(megadriv)
656697
657//  MDRV_CPU_PROGRAM_MAP(megaplay_genesis_readmem, genesis_writemem)
658
659   MDRV_VIDEO_START(megaplay)
660   MDRV_VIDEO_UPDATE(megaplay)
661   MDRV_MACHINE_RESET(megaplay)
662
698   /* The Megaplay has an extra BIOS cpu which drives an SMS VDP
699       which includes an SN76496 for sound */
663700   MDRV_CPU_ADD_TAG("megaplay_bios", Z80, MASTER_CLOCK / 15) /* ?? */
664701   MDRV_CPU_PROGRAM_MAP(megaplay_bios_readmem, megaplay_bios_writemem)
665702   MDRV_CPU_IO_MAP(megaplay_bios_readport,megaplay_bios_writeport)
703   MDRV_CPU_VBLANK_INT(megaplay_bios_irq, 262)
666704
667   MDRV_SOUND_ADD(SN76496, MASTER_CLOCK/15)
668   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
705   MDRV_INTERLEAVE(100)
669706
670707   MDRV_SOUND_ADD(SN76496, MASTER_CLOCK/15)
671   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
708   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.25) /* 3.58 MHz */
709   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right",0.25) /* 3.58 MHz */
672710
673   MDRV_CPU_VBLANK_INT(megatech_irq, 262)
711   /* New update functions to handle the extra layer */
712   MDRV_VIDEO_START(megplay)
713   MDRV_VIDEO_UPDATE(megplay)
674714MACHINE_DRIVER_END
675715
676716
r1037r1038
812852ROM_END
813853
814854
815
816
817static DRIVER_INIT (megaplay)
855void megplay_stat(void)
818856{
819857   UINT8 *src = memory_region(REGION_CPU3);
820858   UINT8 *instruction_rom = memory_region(REGION_USER1);
821859   UINT8 *game_rom = memory_region(REGION_CPU1);
822860   int offs;
823861
862
824863   memmove(src+0x10000,src+0x8000,0x18000); // move bios..
825864
826865   /* copy game instruction rom to main map.. maybe this should just be accessed
r1037r1038
837876   }
838877}
839878
879/* Old code, todo, update the new code instead */
880static READ16_HANDLER ( OLD_megaplay_genesis_io_r )
881{
882   /* 8-bit only, data is mirrored in both halves */
883
884   UINT8 return_value = 0;
885
886   switch (offset)
887   {
888      case 0:
889      /* Charles MacDonald ( http://cgfm2.emuviews.com/ )
890            D7 : Console is 1= Export (USA, Europe, etc.) 0= Domestic (Japan)
891            D6 : Video type is 1= PAL, 0= NTSC
892            D5 : Sega CD unit is 1= not present, 0= connected.
893            D4 : Unused (always returns zero)
894            D3 : Bit 3 of version number
895            D2 : Bit 2 of version number
896            D1 : Bit 1 of version number
897            D0 : Bit 0 of version number
898        */
899         return_value = 0x80; /* ? megatech is usa? */
900         break;
901
902      case 1: /* port A data (joypad 1) */
903
904         if (genesis_io_ram[offset] & 0x40)
905            return_value = readinputport(1) & (genesis_io_ram[4]^0xff);
906         else
907         {
908            return_value = readinputport(2) & (genesis_io_ram[4]^0xff);
909            return_value |= readinputport(1) & 0x03;
910         }
911         return_value = (genesis_io_ram[offset] & 0x80) | return_value;
912//          logerror ("reading joypad 1 , type %02x %02x\n",genesis_io_ram[offset] & 0xb0, return_value &0x7f);
913         break;
914
915      case 2: /* port B data (joypad 2) */
916
917         if (genesis_io_ram[offset] & 0x40)
918            return_value = readinputport(3) & (genesis_io_ram[5]^0xff);
919         else
920         {
921            return_value = readinputport(4) & (genesis_io_ram[5]^0xff);
922            return_value |= readinputport(3) & 0x03;
923         }
924         return_value = (genesis_io_ram[offset] & 0x80) | return_value;
925//          logerror ("reading joypad 2 , type %02x %02x\n",genesis_io_ram[offset] & 0xb0, return_value &0x7f);
926         break;
927
928//      case 3: /* port C data */
929//          return_value = bios_6402 << 3;
930//          break;
931
932   default:
933         return_value = genesis_io_ram[offset];
934
935   }
936   return return_value | return_value << 8;
937}
938
939static WRITE16_HANDLER ( OLD_megaplay_genesis_io_w )
940{
941//  logerror ("write io offset :%02x data %04x PC: 0x%06x\n",offset,data,activecpu_get_previouspc());
942
943   switch (offset)
944   {
945      case 0x00:
946      /*??*/
947      break;
948
949      case 0x01:/* port A data */
950      genesis_io_ram[offset] = (data & (genesis_io_ram[0x04])) | (genesis_io_ram[offset] & ~(genesis_io_ram[0x04]));
951      break;
952
953      case 0x02: /* port B data */
954      genesis_io_ram[offset] = (data & (genesis_io_ram[0x05])) | (genesis_io_ram[offset] & ~(genesis_io_ram[0x05]));
955      break;
956
957      case 0x03: /* port C data */
958      genesis_io_ram[offset] = (data & (genesis_io_ram[0x06])) | (genesis_io_ram[offset] & ~(genesis_io_ram[0x06]));
959      bios_6204 = data & 0x07;
960      break;
961
962      case 0x04: /* port A control */
963      genesis_io_ram[offset] = data;
964      break;
965
966      case 0x05: /* port B control */
967      genesis_io_ram[offset] = data;
968      break;
969
970      case 0x06: /* port C control */
971      genesis_io_ram[offset] = data;
972      break;
973
974      case 0x07: /* port A TxData */
975      genesis_io_ram[offset] = data;
976      break;
977
978      default:
979      genesis_io_ram[offset] = data;
980   }
981}
982
983
984READ16_HANDLER( megadriv_68k_read_z80_extra_ram )
985{
986   return ic36_ram[(offset<<1)^1] | (ic36_ram[(offset<<1)]<<8);
987}
988
989WRITE16_HANDLER( megadriv_68k_write_z80_extra_ram )
990{
991   if (!ACCESSING_LSB) // byte (MSB) access
992   {
993      ic36_ram[(offset<<1)] = (data & 0xff00) >> 8;
994   }
995   else if (!ACCESSING_MSB)
996   {
997      ic36_ram[(offset<<1)^1] = (data & 0x00ff);
998   }
999   else // for WORD access only the MSB is used, LSB is ignored
1000   {
1001      ic36_ram[(offset<<1)] = (data & 0xff00) >> 8;
1002   }
1003}
1004
1005
1006static DRIVER_INIT (megaplay)
1007{
1008   /* to support the old code.. */
1009   ic36_ram = auto_malloc(0x10000);
1010   ic37_ram = auto_malloc(0x10000);
1011   genesis_io_ram = auto_malloc(0x20);
1012
1013   driver_init_megadrij(machine);
1014   megplay_stat();
1015
1016   /* for now ... */
1017   memory_install_read16_handler(0,  ADDRESS_SPACE_PROGRAM, 0xa10000, 0xa1001f, 0, 0, OLD_megaplay_genesis_io_r);
1018   memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa10000, 0xa1001f, 0, 0, OLD_megaplay_genesis_io_w);
1019
1020   /* megaplay has ram shared with the bios cpu here */
1021   memory_install_read8_handler(1,  ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, MRA8_BANK7);
1022   memory_install_write8_handler(1, ADDRESS_SPACE_PROGRAM, 0x2000, 0x3fff, 0, 0, MWA8_BANK7);
1023   memory_set_bankptr(7, &ic36_ram[0]);
1024
1025   /* instead of a RAM mirror the 68k sees the extra ram of the 2nd z80 too */
1026   memory_install_read16_handler(0,  ADDRESS_SPACE_PROGRAM, 0xa02000, 0xa03fff, 0, 0, megadriv_68k_read_z80_extra_ram);
1027   memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0xa02000, 0xa03fff, 0, 0, megadriv_68k_write_z80_extra_ram);
1028}
1029
8401030/*
8411031Sega Mega Play Cartridges
8421032-------------------------
r1037r1038
8651055
8661056*/
8671057
868/* -- */ GAMEB( 1993, megaplay, 0,        megaplay, megaplay, megaplay, megaplay, ROT0, "Sega",                  "Mega Play BIOS", GAME_IS_BIOS_ROOT )
869/* 01 */ GAMEB( 1993, mp_sonic, megaplay, megaplay, megaplay, mp_sonic, megaplay, ROT0, "Sega",                  "Sonic The Hedgehog (Mega Play)" , 0 )
870/* 02 */ GAMEB( 1993, mp_gaxe2, megaplay, megaplay, megaplay, mp_gaxe2, megaplay, ROT0, "Sega",                  "Golden Axe II (Mega Play)" , 0 )
871/* 03 */ GAMEB( 1993, mp_gslam, megaplay, megaplay, megaplay, mp_gslam,   megaplay, ROT0, "Sega",                  "Grand Slam (Mega Play)",GAME_NOT_WORKING  )
872/* 04 */ GAMEB( 1993, mp_twc,   megaplay, megaplay, megaplay, mp_twc,   megaplay, ROT0, "Sega",                  "Tecmo World Cup (Mega Play)" , 0 )
873/* 05 */ GAMEB( 1993, mp_sor2,  megaplay, megaplay, megaplay, mp_sor2,   megaplay, ROT0, "Sega",                  "Streets of Rage II (Mega Play)" , 0 )
874/* 06 */ GAMEB( 1993, mp_bio,   megaplay, megaplay, megaplay, mp_bio,   megaplay, ROT0, "Sega",                  "Bio-hazard Battle (Mega Play)" , 0 )
875/* 07 */ GAMEB( 1993, mp_soni2, megaplay, megaplay, megaplay, mp_soni2, megaplay, ROT0, "Sega",                  "Sonic The Hedgehog 2 (Mega Play)" , 0 )
1058/* -- */ GAMEB( 1993, megaplay, 0,        megaplay, mpnew, megaplay, megaplay, ROT0, "Sega",                  "Mega Play BIOS", GAME_IS_BIOS_ROOT )
1059/* 01 */ GAMEB( 1993, mp_sonic, megaplay, megaplay, mpnew, mp_sonic, megaplay, ROT0, "Sega",                  "Sonic The Hedgehog (Mega Play)" , 0 )
1060/* 02 */ GAMEB( 1993, mp_gaxe2, megaplay, megaplay, mpnew, mp_gaxe2, megaplay, ROT0, "Sega",                  "Golden Axe II (Mega Play)" , 0 )
1061/* 03 */ GAMEB( 1993, mp_gslam, megaplay, megaplay, mpnew, mp_gslam, megaplay, ROT0, "Sega",                  "Grand Slam (Mega Play)",0  )
1062/* 04 */ GAMEB( 1993, mp_twc,   megaplay, megaplay, mpnew, mp_twc,    megaplay, ROT0, "Sega",                  "Tecmo World Cup (Mega Play)" , 0 )
1063/* 05 */ GAMEB( 1993, mp_sor2,  megaplay, megaplay, mpnew, mp_sor2,    megaplay, ROT0, "Sega",                  "Streets of Rage II (Mega Play)" , 0 )
1064/* 06 */ GAMEB( 1993, mp_bio,   megaplay, megaplay, mpnew, mp_bio,   megaplay, ROT0, "Sega",                  "Bio-hazard Battle (Mega Play)" , 0 )
1065/* 07 */ GAMEB( 1993, mp_soni2, megaplay, megaplay, mpnew, mp_soni2, megaplay, ROT0, "Sega",                  "Sonic The Hedgehog 2 (Mega Play)" , 0 )
8761066/* 08 */
8771067/* 09 */
8781068/* 10 */
879/* 11 */ GAMEB( 1993, mp_mazin,   megaplay, megaplay, megaplay, mp_mazin,   megaplay, ROT0, "Sega",                  "Mazin Wars (Mega Play)",GAME_NOT_WORKING  )
1069/* 11 */ GAMEB( 1993, mp_mazin, megaplay, megaplay, mpnew, mp_mazin, megaplay, ROT0, "Sega",                  "Mazin Wars / Mazin Saga (Mega Play)",0  )
8801070
881/* ?? */ GAMEB( 1993, mp_col3,  megaplay, megaplay, megaplay, mp_col3,   megaplay, ROT0, "Sega",                  "Columns III (Mega Play)" , 0 )
1071/* ?? */ GAMEB( 1993, mp_col3,  megaplay, megaplay, mpnew, megaplay, megaplay, ROT0, "Sega",                  "Columns III (Mega Play)" , 0 )
8821072
8831073
8841074/* Also known to exist:
src/mame/drivers/m72.c
r1037r1038
30143014
30153015ROM_START( poundfor )
30163016   ROM_REGION( 0x100000, REGION_CPU1, 0 )
3017   ROM_LOAD16_BYTE( "ppa-h0-b.bin", 0x00001, 0x20000, CRC(50d4a2d8) SHA1(7fd62c6613cb58b512c6c3670fa66a5b9906e6a1) )
3018   ROM_LOAD16_BYTE( "ppa-l0-b.bin", 0x00000, 0x20000, CRC(bd997942) SHA1(da484afe3b79e09e323c768a0b2165e6283971a7) )
3017   ROM_LOAD16_BYTE( "ppa-h0-b.9e",  0x00001, 0x20000, CRC(50d4a2d8) SHA1(7fd62c6613cb58b512c6c3670fa66a5b9906e6a1) )
3018   ROM_LOAD16_BYTE( "ppa-l0-b.9d",  0x00000, 0x20000, CRC(bd997942) SHA1(da484afe3b79e09e323c768a0b2165e6283971a7) )
30193019   ROM_LOAD16_BYTE( "ppa-h1.9f",    0x40001, 0x20000, CRC(f6c82f48) SHA1(b38a2f9f0f6439b2cf453fec87ca11d959777ee6) )
30203020   ROM_RELOAD(                      0xc0001, 0x20000 )
30213021   ROM_LOAD16_BYTE( "ppa-l1.9c",    0x40000, 0x20000, CRC(5b07b087) SHA1(04a2403eb8c443cb92b880edc612542acdbcafa4) )
r1037r1038
30403040   ROM_LOAD( "ppa-v0.bin",   0x00000, 0x40000, CRC(03321664) SHA1(51f2b2b712385c1cd55fd069829efac01838d603) )
30413041ROM_END
30423042
3043ROM_START( poundfoj )
3044   ROM_REGION( 0x100000, REGION_CPU1, 0 )
3045   ROM_LOAD16_BYTE( "ppa-h0-.9e",  0x00001, 0x20000, CRC(f0165e3b) SHA1(a0482b34c0d05d8f48d1b16f2bc2d5d9ec465dc8) )
3046   ROM_LOAD16_BYTE( "ppa-l0-.9d",  0x00000, 0x20000, CRC(f954f99f) SHA1(6e7a9718dc63e595403bfc0f1ceae4a71dc75133) )
3047   ROM_LOAD16_BYTE( "ppa-h1.9f",   0x40001, 0x20000, CRC(f6c82f48) SHA1(b38a2f9f0f6439b2cf453fec87ca11d959777ee6) )
3048   ROM_RELOAD(                     0xc0001, 0x20000 )
3049   ROM_LOAD16_BYTE( "ppa-l1.9c",   0x40000, 0x20000, CRC(5b07b087) SHA1(04a2403eb8c443cb92b880edc612542acdbcafa4) )
3050   ROM_RELOAD(                     0xc0000, 0x20000 )
3051
3052   ROM_REGION( 0x10000, REGION_CPU2, 0 )
3053   ROM_LOAD( "ppa-sp.4j",    0x0000, 0x10000, CRC(3f458a5b) SHA1(d73740b2a548bf8a895909da0841f18d9ed32668) )
3054
3055   ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE )
3056   ROM_LOAD( "ppb-n0.bin",   0x00000, 0x40000, CRC(951a41f8) SHA1(59b64f63ea2452c2b42ff7ebf1ff6fc4e7879ce3) )   /* sprites */
3057   ROM_LOAD( "ppb-n1.bin",   0x40000, 0x40000, CRC(c609b7f2) SHA1(1da3550c7e4d2a26d75d143934680d9177ba5c35) )
3058   ROM_LOAD( "ppb-n2.bin",   0x80000, 0x40000, CRC(318c0b5f) SHA1(1d4cd17dc2f8fc4e523eaf679f21d83e1bfade4e) )
3059   ROM_LOAD( "ppb-n3.bin",   0xc0000, 0x40000, CRC(93dc9490) SHA1(3df4d57a7bf19443f5aa6a416bcee968f81d9059) )
3060
3061   ROM_REGION( 0x080000, REGION_GFX2, ROMREGION_DISPOSE )
3062   ROM_LOAD( "ppa-g00.bin",  0x00000, 0x20000, CRC(8a88a174) SHA1(d360b9014aec31960538ee488894496248a820dc) )   /* tiles */
3063   ROM_LOAD( "ppa-g10.bin",  0x20000, 0x20000, CRC(e48a66ac) SHA1(49b33db6a922d6f1d1417e28714a67431b7c0217) )
3064   ROM_LOAD( "ppa-g20.bin",  0x40000, 0x20000, CRC(12b93e79) SHA1(f3d2b76a30874827c8998c1d13a55a3990b699b7) )
3065   ROM_LOAD( "ppa-g30.bin",  0x60000, 0x20000, CRC(faa39aee) SHA1(9cc1a468b304437766c04189054d3b8f7ff1f958) )
3066
3067   ROM_REGION( 0x40000, REGION_SOUND1, 0 )   /* samples */
3068   ROM_LOAD( "ppa-v0.bin",   0x00000, 0x40000, CRC(03321664) SHA1(51f2b2b712385c1cd55fd069829efac01838d603) )
3069ROM_END
3070
30433071ROM_START( poundfou )
30443072   ROM_REGION( 0x100000, REGION_CPU1, 0 )
30453073   ROM_LOAD16_BYTE( "ppa-ho-a.9e",  0x00001, 0x20000, CRC(ff4c83a4) SHA1(1b7791c784bf7c4774e3200b76d65ab0bf0ff93b) )
r1037r1038
32123240GAME( 1990, dkgensan, hharry,   hharryu,  hharry,   0,        ROT0,   "Irem", "Daiku no Gensan (Japan)", GAME_NO_COCKTAIL )
32133241GAME( 1990, dkgenm72, hharry,   dkgenm72, hharry,   dkgenm72, ROT0,   "Irem", "Daiku no Gensan (Japan, M72)", GAME_NO_COCKTAIL )
32143242GAME( 1990, poundfor, 0,        poundfor, poundfor, 0,        ROT270, "Irem", "Pound for Pound (World)", GAME_NO_COCKTAIL )
3243GAME( 1990, poundfoj, poundfor, poundfor, poundfor, 0,        ROT270, "Irem", "Pound for Pound (Japan)", GAME_NO_COCKTAIL )
32153244GAME( 1990, poundfou, poundfor, poundfor, poundfor, 0,        ROT270, "Irem America", "Pound for Pound (US)", GAME_NO_COCKTAIL )
32163245GAME( 1990, airduel,  0,        m72,      airduel,  airduel,  ROT270, "Irem", "Air Duel (Japan)", 0 )
32173246GAME( 1991, cosmccop, 0,        kengo,    gallop,   0,        ROT0,   "Irem", "Cosmic Cop (World)", GAME_NO_COCKTAIL )
src/mame/drivers/pokechmp.c
r1037r1038
8585   }
8686}
8787
88#ifdef UNUSED_FUNCTION
8889static WRITE8_HANDLER( pokechmp_sound_bank_w )
8990{
9091   memory_set_bank(3, (data >> 2) & 1);
9192}
93#endif
9294
9395static WRITE8_HANDLER( pokechmp_sound_w )
9496{
src/mame/drivers/crgolf.c
r1037r1038
411411 *
412412 *************************************/
413413
414ROM_START( crgolf ) // 834-5419-03
414ROM_START( crgolf ) // 834-5419-04
415415   ROM_REGION( 0x30000, REGION_CPU1, 0 )
416   ROM_LOAD( "crwnc1.1c",  0x00000, 0x2000, CRC(3246e405) SHA1(f6018029317ac96df5866ca6a2bb2135edbd7e77) )
417   ROM_LOAD( "crwna1.1a",  0x02000, 0x2000, CRC(b9a936e2) SHA1(cebf67d9c42627fbb39648674012a6cf8cb287b5) )
418   ROM_LOAD( "epr5880.6b", 0x10000, 0x2000, CRC(4d6d8dad) SHA1(1530f81ad0097eadc75884ff8690b60b85ae451b) )
419   ROM_LOAD( "epr5885.5e", 0x1e000, 0x2000, CRC(fac6d56c) SHA1(67dc1918d5ab2443e967359e51d49dd134cdf25d) )
420   ROM_LOAD( "epr5881.6f", 0x20000, 0x2000, CRC(dd48dc1f) SHA1(d4560a88d872bd5f401344e3adb25f8486caca11) )
421   ROM_LOAD( "epr5886.5f", 0x22000, 0x2000, CRC(a09b27b8) SHA1(8b2d8322b633f6c7174bdb1fff0f6cef2d5a86de) )
422   ROM_LOAD( "epr5882.6h", 0x24000, 0x2000, CRC(fb86a168) SHA1(a679c9f50ac952da6c65f6593dce805023b8fc45) )
423   ROM_LOAD( "epr5887.5h", 0x26000, 0x2000, CRC(981f03ef) SHA1(42f686b970902bc42ac0f81bd2fc93dbdf766b1a) )
424   ROM_LOAD( "epr5883.6j", 0x28000, 0x2000, CRC(e64125ff) SHA1(ae2014d1039f4ed02c55053519bdeddd2f60a77a) )
425   ROM_LOAD( "epr5888.5j", 0x2a000, 0x2000, CRC(efc0e15a) SHA1(ba5772830f921004a2d9c90f557c04c799c755b9) )
426   ROM_LOAD( "epr5884.6k", 0x2c000, 0x2000, CRC(eb455966) SHA1(14278b598ac1d4007d5357cb40899c92a052417f) )
427   ROM_LOAD( "epr5889.5k", 0x2e000, 0x2000, CRC(88357391) SHA1(afdb5ed6555adf60bd64808413fc72fa5c67b6ec) )
428
429   ROM_REGION( 0x10000, REGION_CPU2, 0 )
430   ROM_LOAD( "epr6198.1f",  0x0000, 0x2000, CRC(388c33d6) SHA1(42fd19c4b4ec7538d6c437552efb258bf2dcebc0) )
431   ROM_LOAD( "epr5892.1e",  0x2000, 0x2000, CRC(608dc2e2) SHA1(d906537cffd3e055f52f37a0490b3bb63107b2f9) )
432   ROM_LOAD( "epr5891a.1d", 0x4000, 0x2000, CRC(f353b585) SHA1(f09dcd0240131f872ceef5ddc9c89ab2fc92d117) )
433   ROM_LOAD( "epr5890a.1c", 0x6000, 0x2000, CRC(b737c2e8) SHA1(8596abbdff74300230b5ec5bf8acfe222eb3414f) )
434
435   ROM_REGION( 0x0020,  REGION_PROMS, 0 )
436   ROM_LOAD( "pr5877.1s", 0x0000, 0x0020, CRC(f880b95d) SHA1(5ad0ee39e2b9befaf3895ec635d5865b7b1e562b) )
437
438   ROM_REGION( 0x0200, REGION_PLDS, ROMREGION_DISPOSE )
439   ROM_LOAD( "pal16l8.3e",  0x0000, 0x0104, NO_DUMP ) /* PAL is read protected */
440ROM_END
441
442ROM_START( crgolfa ) // 834-5419-03
443   ROM_REGION( 0x30000, REGION_CPU1, 0 )
416444   ROM_LOAD( "epr6143.1c", 0x00000, 0x2000, CRC(4b301360) SHA1(2a7dd4876f4448b4b59b6dd02e55eb2d0126b777) )
417445   ROM_LOAD( "epr6142.1a", 0x02000, 0x2000, CRC(8fc5e67f) SHA1(6563db94c55cfc7d2270daccaab57fc7b422b9f9) )
418446   ROM_LOAD( "epr5880.6b", 0x10000, 0x2000, CRC(4d6d8dad) SHA1(1530f81ad0097eadc75884ff8690b60b85ae451b) )
r1037r1038
440468ROM_END
441469
442470
443ROM_START( crgolfa )
471ROM_START( crgolfb )
444472   ROM_REGION( 0x30000, REGION_CPU1, 0 )
445473   ROM_LOAD( "epr5879b.1c", 0x00000, 0x2000, CRC(927be359) SHA1(d534f7e3ef4ced8eea882ae2b8425df4c5842833) )
446474   ROM_LOAD( "epr5878.1a",  0x02000, 0x2000, CRC(65fd0fa0) SHA1(de95ff95c9f981cd9eadf8b028ee5373bc69007b) )
r1037r1038
466494ROM_END
467495
468496
469ROM_START( crgolfb )
470   ROM_REGION( 0x30000, REGION_CPU1, 0 )
471   ROM_LOAD( "epr5879b.1c", 0x00000, 0x2000, CRC(927be359) SHA1(d534f7e3ef4ced8eea882ae2b8425df4c5842833) )
472   ROM_LOAD( "epr5878.1a",  0x02000, 0x2000, CRC(65fd0fa0) SHA1(de95ff95c9f981cd9eadf8b028ee5373bc69007b) )
473   ROM_LOAD( "cg.1",        0x10000, 0x2000, CRC(ad7d537a) SHA1(deff74074a8b16ea91a0fa72d97ec36336c87b97) )
474   ROM_LOAD( "cg.6",        0x1e000, 0x2000, CRC(fac6d56c) SHA1(67dc1918d5ab2443e967359e51d49dd134cdf25d) )
475   ROM_LOAD( "cg.2",        0x20000, 0x2000, CRC(dd48dc1f) SHA1(d4560a88d872bd5f401344e3adb25f8486caca11) )
476   ROM_LOAD( "cg.7",        0x22000, 0x2000, CRC(a09b27b8) SHA1(8b2d8322b633f6c7174bdb1fff0f6cef2d5a86de) )
477   ROM_LOAD( "cg.3",        0x24000, 0x2000, CRC(fb86a168) SHA1(a679c9f50ac952da6c65f6593dce805023b8fc45) )
478   ROM_LOAD( "cg.8",        0x26000, 0x2000, CRC(981f03ef) SHA1(42f686b970902bc42ac0f81bd2fc93dbdf766b1a) )
479   ROM_LOAD( "cg.4",        0x28000, 0x2000, CRC(e64125ff) SHA1(ae2014d1039f4ed02c55053519bdeddd2f60a77a) )
480   ROM_LOAD( "cg.9",        0x2a000, 0x2000, CRC(efc0e15a) SHA1(ba5772830f921004a2d9c90f557c04c799c755b9) )
481   ROM_LOAD( "cg.5",        0x2c000, 0x2000, CRC(eb455966) SHA1(14278b598ac1d4007d5357cb40899c92a052417f) )
482   ROM_LOAD( "cg.10",       0x2e000, 0x2000, CRC(88357391) SHA1(afdb5ed6555adf60bd64808413fc72fa5c67b6ec) )
483
484   ROM_REGION( 0x10000, REGION_CPU2, 0 )
485   ROM_LOAD( "cg.14",       0x0000, 0x1000, CRC(07156cd9) SHA1(8907cf9228d6de117b24969d4e039cee330f9b1e) )
486   ROM_LOAD( "cg.13",       0x2000, 0x2000, CRC(608dc2e2) SHA1(d906537cffd3e055f52f37a0490b3bb63107b2f9) )
487   ROM_LOAD( "cg.12",       0x4000, 0x2000, CRC(f353b585) SHA1(f09dcd0240131f872ceef5ddc9c89ab2fc92d117) )
488   ROM_LOAD( "cg.11",       0x6000, 0x2000, CRC(b737c2e8) SHA1(8596abbdff74300230b5ec5bf8acfe222eb3414f) )
489
490   ROM_REGION( 0x0020,  REGION_PROMS, 0 )
491   ROM_LOAD( "pr5877.1s",   0x0000, 0x0020, CRC(f880b95d) SHA1(5ad0ee39e2b9befaf3895ec635d5865b7b1e562b) )
492ROM_END
493
494
495497ROM_START( crgolfc )
496498   ROM_REGION( 0x30000, REGION_CPU1, 0 )
497499   ROM_LOAD( "15.1a",      0x00000, 0x2000, CRC(e6194356) SHA1(78eec53a0658b552e6a8af109d9c9754e4ddadcb) )
r1037r1038
518520ROM_END
519521
520522
523ROM_START( crgolfbt )
524   ROM_REGION( 0x30000, REGION_CPU1, 0 )
525   ROM_LOAD( "epr5879b.1c", 0x00000, 0x2000, CRC(927be359) SHA1(d534f7e3ef4ced8eea882ae2b8425df4c5842833) )
526   ROM_LOAD( "epr5878.1a",  0x02000, 0x2000, CRC(65fd0fa0) SHA1(de95ff95c9f981cd9eadf8b028ee5373bc69007b) )
527   ROM_LOAD( "cg.1",        0x10000, 0x2000, CRC(ad7d537a) SHA1(deff74074a8b16ea91a0fa72d97ec36336c87b97) )
528   ROM_LOAD( "epr5885.5e",  0x1e000, 0x2000, CRC(fac6d56c) SHA1(67dc1918d5ab2443e967359e51d49dd134cdf25d) ) // cg.6
529   ROM_LOAD( "epr5881.6f",  0x20000, 0x2000, CRC(dd48dc1f) SHA1(d4560a88d872bd5f401344e3adb25f8486caca11) ) // cg.2
530   ROM_LOAD( "epr5886.5f",  0x22000, 0x2000, CRC(a09b27b8) SHA1(8b2d8322b633f6c7174bdb1fff0f6cef2d5a86de) ) // cg.7
531   ROM_LOAD( "epr5882.6h",  0x24000, 0x2000, CRC(fb86a168) SHA1(a679c9f50ac952da6c65f6593dce805023b8fc45) ) // cg.3
532   ROM_LOAD( "epr5887.5h",  0x26000, 0x2000, CRC(981f03ef) SHA1(42f686b970902bc42ac0f81bd2fc93dbdf766b1a) ) // cg.8
533   ROM_LOAD( "epr5883.6j",  0x28000, 0x2000, CRC(e64125ff) SHA1(ae2014d1039f4ed02c55053519bdeddd2f60a77a) ) // cg.4
534   ROM_LOAD( "epr5888.5j",  0x2a000, 0x2000, CRC(efc0e15a) SHA1(ba5772830f921004a2d9c90f557c04c799c755b9) ) // cg.9
535   ROM_LOAD( "epr5884.6k",  0x2c000, 0x2000, CRC(eb455966) SHA1(14278b598ac1d4007d5357cb40899c92a052417f) ) // cg.5
536   ROM_LOAD( "epr5889.5k",  0x2e000, 0x2000, CRC(88357391) SHA1(afdb5ed6555adf60bd64808413fc72fa5c67b6ec) ) // cg.10
537
538   ROM_REGION( 0x10000, REGION_CPU2, 0 )
539   ROM_LOAD( "cg.14",       0x0000, 0x1000, CRC(07156cd9) SHA1(8907cf9228d6de117b24969d4e039cee330f9b1e) )
540   ROM_LOAD( "epr5892.1e",  0x2000, 0x2000, CRC(608dc2e2) SHA1(d906537cffd3e055f52f37a0490b3bb63107b2f9) ) // cg.13
541   ROM_LOAD( "epr5891a.1d", 0x4000, 0x2000, CRC(f353b585) SHA1(f09dcd0240131f872ceef5ddc9c89ab2fc92d117) ) // cg.12
542   ROM_LOAD( "epr5890a.1c", 0x6000, 0x2000, CRC(b737c2e8) SHA1(8596abbdff74300230b5ec5bf8acfe222eb3414f) ) // cg.11
543
544   ROM_REGION( 0x0020,  REGION_PROMS, 0 )
545   ROM_LOAD( "pr5877.1s",   0x0000, 0x0020, CRC(f880b95d) SHA1(5ad0ee39e2b9befaf3895ec635d5865b7b1e562b) )
546ROM_END
547
548
521549ROM_START( crgolfhi )
522550   ROM_REGION( 0x30000, REGION_CPU1, 0 )
523551   ROM_LOAD( "cpu.c1",  0x00000, 0x2000, CRC(8b101085) SHA1(a59c369be3e7e645d8b20032998a778a2056b7d7) )
r1037r1038
571599 *
572600 *************************************/
573601
574GAME( 1984, crgolf,   0,      crgolf,   crgolf,  0,        ROT0, "Nasco Japan", "Crowns Golf (set 1)" , GAME_SUPPORTS_SAVE ) // 834-5419-03
575GAME( 1984, crgolfa,  crgolf, crgolf,   crgolf,  0,        ROT0, "Nasco Japan", "Crowns Golf (set 2)", GAME_SUPPORTS_SAVE )
602GAME( 1984, crgolf,   0,      crgolf,   crgolf,  0,        ROT0, "Nasco Japan", "Crowns Golf (834-5419-04)", GAME_SUPPORTS_SAVE )
603GAME( 1984, crgolfa,  crgolf, crgolf,   crgolf,  0,        ROT0, "Nasco Japan", "Crowns Golf (834-5419-03)", GAME_SUPPORTS_SAVE )
604GAME( 1984, crgolfb,  crgolf, crgolf,   crgolf,  0,        ROT0, "Nasco Japan", "Crowns Golf (set 3)", GAME_SUPPORTS_SAVE )
576605GAME( 1984, crgolfc,  crgolf, crgolf,   crgolf,  0,        ROT0, "Nasco Japan", "Champion Golf", GAME_SUPPORTS_SAVE )
577GAME( 1984, crgolfb, crgolf, crgolf,   crgolf,  0,        ROT0, "Nasco Japan", "Champion Golf (bootleg Set 1)", GAME_SUPPORTS_SAVE )
606GAME( 1984, crgolfbt, crgolf, crgolf,   crgolf,  0,        ROT0, "Nasco Japan", "Champion Golf (bootleg)", GAME_SUPPORTS_SAVE )
578607GAME( 1985, crgolfhi, 0,      crgolfhi, crgolf,  crgolfhi, ROT0, "Nasco Japan", "Crowns Golf in Hawaii" , GAME_SUPPORTS_SAVE )
src/mame/drivers/segae.c
r1037r1038
44-- this is a modified version of the sms.c from HazeMD
55 it really needs some improvements
66
7
8 Sega System 'E' is a piece of hardware used for a couple of Arcade Games
9 produced by Sega in the Mid 80's, its roughly based on their Sega Master System
10 home console unit, using the same '315-5124' VDP (actually in this case 2 of
11 them)
12
13 An interesting feature of the system is that the CPU is contained on the ROM
14 board, the MAIN System E board contains the Graphics processor, this opens the
15 possibility for using processors other than the Standard Z80 to run the main
16 game code on; several games have an encrypted Z80 module instead.
17
18 Also interesting is each VDP has double the Video RAM found on the SMS console
19 this is banked through Port Writes, the System also allows for the Video RAM
20 to be written directly, bypassing the usual procedure of writing to it via the
21 '315-5124' data port, it can not however be read directly, the same area used
22 for writing is used to access banked ROMs when reading
23
24 Pretty much everything on this hardware is done through port accesses, the
25 main memory map consists of simply ROM, BANKED ROM / BANKED RAM, RAM
26
27********************************************************************************
28
29    ROMs + CPU Board (32kb ROMs)
30
31    IC 07 (Good)    IC 05 (Good)
32    IC 04 (Good)    IC 03 (Good)
33    IC 02 (Good)
34
35    (834-5803) MAIN Board (8kb RAMs)
36
37    IC 49 (Good)    IC 55 (Good)    System RAM (0xc000 - 0xffff)
38    IC 03 (Good)    IC 07 (Good)    Front Layer VRAM (Bank 1)   Port F7 -0------
39    IC 04 (Good)    IC 08 (Good)    Front Layer VRAM (Bank 2)   Port F7 -1------
40    IC 01 (Good)    IC 05 (Good)    Back Layer VRAM (Bank 1)    Port F7 0-------
41    IC 02 (Good)    IC 06 (Good)    Back Layer VRAM (Bank 2)    Port F7 1-------
42    (or at least this is how it appears from HangOnJr's RAMs Test)
43
44    2x (315-5124)'s here too, these are the VDP chips
45
46    PORTS (to be completed)
47
48    0xba - 0xbb r/w     Back Layer VDP
49    0xbe - 0xbf r/w     Front Layer VDP
50
51    0xf7 w/o            Banking Controls
52
53    0xe0 r/o            Inputs (Coins, Start Btns)
54    0xe1 r/o            Controls (Transformer)
55
56    0xf2 - 0xf3 r/o     Dipswitches
57
58    0xf8 r/o            Analog Input (Hang On Jr)
59
60    0x7e r/o            V Counter (vertical beam pos in scanlines)
61    0x7f r/o            H Counter (horizontal beam pos in 'pixel clock cycles')
62
63********************************************************************************
64
65Sega System E Hardware Overview
66Sega, 1985-1988
67
68This PCB is essentially a Sega Master System home console unit, but using
69two '315-5124' VDPs and extra RAM.
70The CPU is located on a plug-in board that also holds all of the EPROMs.
71
72The games that run on this hardware include....
73Hang-On Jr.             1985
74Transformer/Astro Flash 1986
75Riddle of Pythagoras    1986
76Opa Opa                 1987
77Fantasy Zone 2          1988
78Tetris                  1988
79
80PCB Layout
81----------
82834-5803 (C)Sega 1985
83|-----------------------------------------------------|
84|         D4168      D4168      D4168       D4168     |
85|                                                     |
86|         D4168      D4168      D4168       D4168     |
87|                                                     |
88|                                                     |
89|    SW1                                              |
90|CN1                                                  |
91|    SW2                                              |
92|                                                     |
93|   LED            |---|             |---|            |
94|                  | 3 |             | 3 |            |
95|                  | 1 |             | 1 |            |
96|                  | 5 |             | 5 |            |
97|                  | | |             | | |         CN3|
98|                  | 5 |             | 5 |     8255   |
99|CN4               | 1 |             | 1 |            |
100|                  | 2 |             | 2 |            |
101|                  | 4 |             | 4 |            |
102|                  |---|             |---|            |
103|               |--------ROM-BOARD-(above)---------|  |
104|               |                                  |  |
105|               |CN2                   10.7386MHz  |  |
106|               |         D4168                    |  |
107|  VOL          |         D4168                    |  |
108| LA4460        |----------------------------------|  |
109|-----------------------------------------------------|
110Notes:
111      315-5124 VDP clock - 10.7386MHz
112      SN76496 clock      - 3.579533MHz [10.7386/3]
113      D4168              - 8k x8 SRAM
114      VSync              - 60Hz
115      HSync              - 15.58kHz
116      CN1                - Connector used for standard controls
117      CN2                - connector for CPU/ROM PCB
118      CN3                - Connector used for special controls (via a small plug-in interface PCB)
119      CN4                - Connector for power
120
121ROM Daughterboard
122-----------------
123834-6592-01
124|--------------------------------------------|
125|                                            |
126|    |---|                                   |
127|C   |   |                           IC6     |
128|N   |Z80|                                   |
129|2   |   |                                   |
130|    |   |   IC2   IC3   IC4   IC5        IC7|
131|    |---|                                   |
132|     IC1             PAD1 PAD2     PAD3 PAD4|
133|--------------------------------------------|
134Notes:
135       IC1: Z80 clock - 5.3693MHz [10.7386/2]
136            On some games this is replaced with a NEC MC-8123 Encrypted CPU Module.
137            The clock speed is the same. The MC-8123 contains a Z80 core, plus a RAM chip
138            and battery. When the battery dies, the program can no longer be decrypted
139            and the PCB does not boot up at all. The battery can not be changed because the
140            MC-8123 is sealed, so there is no way to access it.
141
142 IC2 - IC5: 27C256 EPROM (DIP28)
143
144       IC6: 74LS139
145
146       IC7: 27C256 EPROM (DIP28)
147
148    PAD1-4: These are jumper pads used to configure the ROM board for use with the
149            Z80 or with the MC8123 CPU.
150            PAD1 - Ties Z80 pin 24 (WAIT) to pin1 of the EPROMs at IC2, 3, 4 & 5
151            PAD2 - Ties CN2 pin B21 to pin1 of the EPROMs at IC2, 3, 4 & 5
152            PAD3 - Ties CN2 pin B21 to pin 2 of the 74LS139 @ IC6
153            PAD4 - Ties Z80 pin 24 (WAIT) to pin 2 of the 74LS139 @ IC6
154
155            The pads are configured like this..... (U=Upper, L=Lower)
156
157                                                 |----|      |----|
158                                                 |IC6 |      |IC7 |
159                                                 |  12|------|22  |
160                                                 |    |      |    |
161                       IC2   IC3    IC4   IC5    |   1|------|27  |
162                       PIN1  PIN1   PIN1  PIN1   |   2|--|   |    |
163                        O-----O--+---O------O    |----|  |   |----|
164                                 |                       |
165                                 |         |----|        |
166                              O--+----O    |    O    |---O
167            CN2    Z80      PAD1U   PAD2U  |  PAD3U  | PAD4U
168            B21    PIN24    PAD1L   PAD2L  |  PAD3L  | PAD4L
169             O       O--4.7k--O       O----|    O----|   O
170             |                |       |                  |
171             |                |-------|------------------|
172             |                        |
173             |------------------------|
174
175            When using a regular Z80B (and thus, unencrypted code):
176            PAD1 - Open
177            PAD2 - Open
178            PAD3 - Shorted
179            PAD4 - Open
180
181            When using an encrypted CPU module (MC-8123):
182            PAD1 - Open
183            PAD2 - Shorted
184            PAD3 - Open
185            PAD4 - Open
186            Additionally, a wire must be tied from CN2 pin B22 to the side
187            of PAD3 nearest IC6 (i.e. PAD3U).
188
189ROMs:
190-----
191
192Game                     IC2         IC3         IC4         IC5         IC7
193---------------------------------------------------------------------------------
194Hang-On Jr.              EPR-?       EPR-?       EPR-?       EPR-?       EPR-?     Hello, Sega Part Numbers....!?
195Transformer              EPR-7350    EPR-?       EPR-7348    EPR-7347    EPR-?     Ditto
196           /Astro Flash  EPR-7350    EPR-7349    EPR-7348    EPR-7347    EPR-7723
197Riddle of Pythagoras     EPR-10422   EPR-10423   EPR-10424   EPR-10425   EPR-10426
198Opa Opa                  EPR-11220   EPR-11221   EPR-11222   EPR-11223   EPR-11224
199Fantasy Zone 2           EPR-11412   EPR-11413   EPR-11414   EPR-11415   EPR-11416
200Tetris                   -           -           EPR-12211   EPR-12212   EPR-12213
201
202A System E PCB can run all of the games simply by swapping the EPROMs plus CPU.
203Well, in theory anyway. To run the not-encrypted games, just swap EPROMs and they will work.
204
205To run the encrypted games, use a double sized EPROM in IC7 (i.e. a 27C512)
206and program the decrypted opcodes to the lower half and the decrypted data to the upper half,
207then connect the highest address pin of the EPROM (A15 pin 1) to the M1 pin on the Z80.
208This method has been tested and does not actually work. An update on this may follow....
209
210
211System E PCB Pinout
212-------------------
213
214CN1
215---
216
217+12V             1A  1B  Coin switch 1
218Coin switch 2    2A  2B  Test switch
219Service switch   3A  3B
220                 4A  4B  1P start
2212P start         5A  5B  1P up
2221P down          6A  6B  1P left
2231P right         7A  7B  1P button 1
2241P button 2      8A  8B
225                 9A  9B  2P up
2262P down          10A 10B 2P left
2272P RIGHT         11A 11B 2P button 1
2282P button 2      12A 12B
229                 13A 13B Video RED
230                 14A 14B Video GREEN
231                 15A 15B Video BLUE
232                 16A 16B Video SYNC
233                 17A 17B
234                 18A 18B
235Speaker [+]      19A 19B
236Speaker [-]      20A 20B
237Coin counter GND 21A 21B
238GND              22A 22B Coin counter 1
239                 23A 23B Coin counter 2
240                 24A 24B
241                 25A 25B
242CN4
243---
244
245+5V  1A 1B +5V
246+5V  2A 2B +5V
247     3A 3B
248GND  4A 4B GND
249GND  5A 5B GND
250+12V 6A 6B +12V
251+12V 7A 7B +12V
252GND  8A 8B GND
253
254
255 Game Notes:
256 Riddle of Pythagoras is interesting, it looks like Sega might have planned it
257 as a two player game, there is prelimiary code for 2 player support which
258 never gets executed, see code around 0x0E95.  Theres also quite a bit of
259 pointless code here and there.  Some Interesting Memory Locations
260
261 C000 : level - value (00-0x32)
262 C001 : level - display (00-0x50, BCD coded)
263 C003 : credits (00-0x99, BCD coded)
264 C005 : DSWA put here (coinage, left and right nibbles for left and right slot
265        - freeplay when 0x0f or 0xf0)
266 C006 : DSWB put here
267  bits 0 and 1 : lives ("02", "03", "04", "98")
268  bit 3 : difficulty
269  bits 5 and 6 : bonus lives ("50K, 100K, 200K, 500K", "100K, 200K, 500K", "100K,
270                               200K, 500K, 99999999", "none")
271 C009 : lives (for player 1)
272 C00A : lives (for player 2)
273 C00B : bonus lives counter
274
275 E20B-E20E : score (00000000-0x99999999, BCD coded)
276 E215-E218 : hi-score (00000000-0x99999999, BCD coded)
277
278 E543 : bit 0 : ON = player 1 one still has lives
279        bit 1 : ON = player 2 one still has lives
280        bit 2 : ON = player 1 is the current player - OFF = player 2 is the
281         current player
282
283 E572 : table with L. slot infos (5 bytes wide)
284 E577 : table with R. slot infos (5 bytes wide)
285
7286Known issues:
8287
9288sometimes hangonjr has corrupt gfx when you start a game, I don't know why
r1037r1038
32311/* All Accesses to VRAM go through here for safety */
33312#define SMS_VDP_VRAM(address) chip->vram[(address)&0x3fff]
34313
314#ifdef UNUSED_FUNCTION
35315static ADDRESS_MAP_START( sms_readmem, ADDRESS_SPACE_PROGRAM, 8 )
36316//  AM_RANGE(0x0000 , 0xbfff) AM_READ(MRA8_ROM)
37317//  AM_RANGE(0xc000 , 0xdfff) AM_READ(MRA8_RAM) AM_MIRROR(0x2000)
r1037r1038
41321//  AM_RANGE(0x0000 , 0xbfff) AM_WRITE(MWA8_ROM)
42322//  AM_RANGE(0xc000 , 0xdfff) AM_WRITE(MWA8_RAM) AM_MIRROR(0x2000)
43323ADDRESS_MAP_END
324#endif
44325
45326/* we have to fill in the ROM addresses for systeme due to the encrypted games */
46327static ADDRESS_MAP_START( systeme_readmem, ADDRESS_SPACE_PROGRAM, 8 )
r1037r1038
308589   return 0;
309590}
310591
592int sms_vdp_cpu2_irq_callback(int status)
593{
594   if (status==1)
595   {
596      cpunum_set_input_line(2,0,HOLD_LINE);
597   }
598   else
599   {
600      cpunum_set_input_line(2,0,CLEAR_LINE);
601   }
311602
603   return 0;
604}
312605
313606
607
608
314609struct sms_vdp
315610{
316611   UINT8 chip_id;
r1037r1038
422717}
423718
424719
720#ifdef UNUSED_FUNCTION
425721static READ8_HANDLER( z80_unmapped_r )
426722{
427723   printf("unmapped z80 read %04x\n",offset);
r1037r1038
432728{
433729   printf("unmapped z80 write %04x\n",offset);
434730}
731#endif
435732
436733static UINT8 vcounter_r(struct sms_vdp *chip)
437734{
r1037r1038
10171314   }
10181315}
10191316
1317#ifdef UNUSED_FUNCTION
10201318static void show_tiles(struct sms_vdp* chip)
10211319{
10221320   int x,y,xx,yy;
r1037r1038
10521350      }
10531351   }
10541352}
1353#endif
10551354
10561355/*
10571356 Register $00 - Mode Control No. 1
r1037r1038
16061905   mame_timer_adjust_ptr(vdp2->sms_scanline_timer, time_zero, time_zero);
16071906}
16081907
1908MACHINE_RESET(megatech_bios)
1909{
1910   mame_timer_adjust_ptr(vdp1->sms_scanline_timer, time_zero, time_zero);
1911}
1912
16091913VIDEO_EOF(systeme)
16101914{
16111915   end_of_frame(vdp1);
16121916   end_of_frame(vdp2);
16131917}
16141918
1919VIDEO_EOF(megatech_bios)
1920{
1921   end_of_frame(vdp1);
1922}
1923
1924
1925VIDEO_UPDATE(megatech_bios)
1926{
1927   int x,y;
1928
1929   for (y=0;y<224;y++)
1930   {
1931      UINT16* lineptr = BITMAP_ADDR16(bitmap, y, 0);
1932      UINT16* srcptr =  BITMAP_ADDR16(vdp1->r_bitmap, y, 0);
1933
1934      for (x=0;x<256;x++)
1935      {
1936         lineptr[x]=srcptr[x]&0x7fff;
1937      }
1938   }
1939
1940   return 0;
1941}
1942
16151943VIDEO_UPDATE(systeme)
16161944{
16171945//  show_tiles();
r1037r1038
18332161}
18342162
18352163
2164DRIVER_INIT( megatech_bios )
2165{
2166//  init_systeme_map();
2167
2168   vdp1 = start_vdp(machine, SMS2_VDP);
2169   vdp1->set_irq = sms_vdp_cpu2_irq_callback;
2170   vdp1->is_pal = 0;
2171   vdp1->sms_total_scanlines = 262;
2172   vdp1->sms_framerate = 60;
2173   vdp1->chip_id = 1;
2174
2175   vdp1_vram_bank0 = vdp1->vram;
2176   vdp1_vram_bank1 = auto_malloc(0x4000);
2177}
2178
18362179static DRIVER_INIT( segasyse )
18372180{
18382181   init_systeme_map();
src/mame/drivers/segae.h
r0r1038
1/* System E stuff */
2
3#include "driver.h"
4
5extern VIDEO_UPDATE(megatech_bios);
6extern DRIVER_INIT( megatech_bios );
7extern MACHINE_RESET(megatech_bios);
8extern VIDEO_EOF(megatech_bios);
9
10extern READ8_HANDLER( sms_vcounter_r );
11extern READ8_HANDLER( sms_vdp_data_r );
12extern WRITE8_HANDLER( sms_vdp_data_w );
13extern READ8_HANDLER( sms_vdp_ctrl_r );
14extern WRITE8_HANDLER( sms_vdp_ctrl_w );
src/mame/drivers/legionna.c
r1037r1038
360360   program_write_word(work_ram+0x4,y_data);
361361}
362362
363#ifdef UNUSED_FUNCTION
363364static void protection_move2_jsr(void)
364365{
365366//  static UINT32 move_data;
366367//  popmessage("%08x %08x %08x %08x",ram_addr[0],ram_addr[1],rom_addr[0],rom_addr[1]);
367368}
369#endif
368370
369371static UINT16 hit_check;
370372
r1037r1038
477479   program_write_word(ram_addr[0]+0x36,res);
478480}
479481
482#ifdef UNUSED_FUNCTION
480483/*"To point" movement protection*/
481484static void move3x_prot_jsr(void)
482485{
r1037r1038
505508   program_write_word(ram_addr[0]+0x36,-0x80);/*enable command*/
506509   program_write_word(ram_addr[0]+0x10,y_dis);
507510}
511#endif
508512
509513
510514static READ16_HANDLER( mcu_r )
src/mame/drivers/funworld.c
r1037r1038
3232    * Mongolfier New (Italia),                  bootleg,            199?.
3333    * Soccer New (Italia),                      bootleg,            199?.
3434    * Snooker 10 (Ver 1.11),                    Sandiy,             1998.
35    * Saloon (France, encrypted),               unknown,            199?.
3536
3637
3738***********************************************************************************
r1037r1038
188189    about it and start to implement the missing pieces for an accurate emulation.
189190
190191
192    - Saloon
191193
194    This game is totally encrypted. No PIAs to drive I/O. The PCB has printed "LEOPARDO 5", so we
195    can expect a game called the same way to appear.
196
197    This game should be moved to a new driver in a near future, as soon as we know a bit more about it.
198
199
200
192201***********************************************************************************
193202
194203
r1037r1038
222231    ----------------------------------------------------------------------------------------------------------------------
223232    register:   00    01    02    03    04    05    06    07    08    09    10    11    12    13    14    15    16    17
224233    ----------------------------------------------------------------------------------------------------------------------
225    jollycrd:  0x7C  0x60  0x65  0x08  0x1E  0x08  0x1D  0x1D  0x00  0x07  0x01  0x01  0x00  0x00  #$00  #$00  #$00  #$00.
226    jolycdae:  0x7C  0x60  0x65  0x08  0x1E  0x08  0x1D  0x1D  0x00  0x07  0x01  0x01  0x00  0x00  #$00  #$00  #$00  #$00.
227    jolycdcr:  0x7C  0x60  0x65  0x08  0x1E  0x08  0x1D  0x1D  0x00  0x07  0x01  0x01  0x00  0x00  #$00  #$00  #$00  #$00.
228    jolycdit:  0x7C  0x60  0x65  0x08  0x1E  0x08  0x1D  0x1D  0x00  0x07  0x01  0x01  0x00  0x00  #$00  #$00  #$00  #$00.
229    jolycdab:  0x7C  0x60  0x65  0x08  0x1E  0x08  0x1D  0x1D  0x00  0x07  0x01  0x01  0x00  0x00  #$00  #$00  #$00  #$00.
234    jollycrd:  0x7C  0x60  0x65  0x08  0x1E  0x08  0x1D  0x1D  0x00  0x07  0x01  0x01  0x00  0x00  0x00  0x00  0x00  0x00.
235    jolycdae:  0x7C  0x60  0x65  0x08  0x1E  0x08  0x1D  0x1D  0x00  0x07  0x01  0x01  0x00  0x00  0x00  0x00  0x00  0x00.
236    jolycdcr:  0x7C  0x60  0x65  0x08  0x1E  0x08  0x1D  0x1D  0x00  0x07  0x01  0x01  0x00  0x00  0x00  0x00  0x00  0x00.
237    jolycdit:  0x7C  0x60  0x65  0x08  0x1E  0x08  0x1D  0x1D  0x00  0x07  0x01  0x01  0x00  0x00  0x00  0x00  0x00  0x00.
238    jolycdab:  0x7C  0x60  0x65  0x08  0x1E  0x08  0x1D  0x1D  0x00  0x07  0x01  0x01  0x00  0x00  0x00  0x00  0x00  0x00.
230239
231    bigdeal:   0x7C  0x60  0x65  0x08  0x1E  0x08  0x1D  0x1D  0x00  0x07  0x01  0x01  0x00  0x00  #$00  #$00  #$00  #$00.
240    bigdeal:   0x7C  0x60  0x65  0x08  0x1E  0x08  0x1D  0x1D  0x00  0x07  0x01  0x01  0x00  0x00  0x00  0x00  0x00  0x00.
232241
233    cuoreuno:  0x7C  0x60  0x65  0x08  0x1E  0x08  0x1D  0x1D  0x00  0x07  0x01  0x01  0x00  0x00  #$00  #$00  #$00  #$00.
234    elephfam:  0x7C  0x60  0x65  0x08  0x1E  0x08  0x1D  0x1D  0x00  0x07  0x01  0x01  0x00  0x00  #$00  #$00  #$00  #$00.
235    pool10:    0x7C  0x60  0x65  0x08  0x1E  0x08  0x1D  0x1D  0x00  0x07  0x01  0x01  0x00  0x00  #$00  #$00  #$00  #$00.
236    tortufam:  0x7C  0x60  0x65  0x08  0x1E  0x08  0x1D  0x1D  0x00  0x07  0x01  0x01  0x00  0x00  #$00  #$00  #$00  #$00.
242    cuoreuno:  0x7C  0x60  0x65  0x08  0x1E  0x08  0x1D  0x1D  0x00  0x07  0x01  0x01  0x00  0x00  0x00  0x00  0x00  0x00.
243    elephfam:  0x7C  0x60  0x65  0x08  0x1E  0x08  0x1D  0x1D  0x00  0x07  0x01  0x01  0x00  0x00  0x00  0x00  0x00  0x00.
244    pool10:    0x7C  0x60  0x65  0x08  0x1E  0x08  0x1D  0x1D  0x00  0x07  0x01  0x01  0x00  0x00  0x00  0x00  0x00  0x00.
245    tortufam:  0x7C  0x60  0x65  0x08  0x1E  0x08  0x1D  0x1D  0x00  0x07  0x01  0x01  0x00  0x00  0x00  0x00  0x00  0x00.
237246
238    royalcrd:  0x7C  0x60  0x65  0xA8  0x1E  0x08  0x1D  0x1C  0x00  0x07  0x01  0x01  0x00  0x00  #$00  #$00  #$00  #$00.
239    magiccrd:  0x7B  0x70  0x66  0xA8  0x24  0x08  0x22  0x22  0x00  0x07  0x01  0x01  0x00  0x00  #$00  #$00  #$00  #$00.
247    royalcrd:  0x7C  0x60  0x65  0xA8  0x1E  0x08  0x1D  0x1C  0x00  0x07  0x01  0x01  0x00  0x00  0x00  0x00  0x00  0x00.
248    magiccrd:  0x7B  0x70  0x66  0xA8  0x24  0x08  0x22  0x22  0x00  0x07  0x01  0x01  0x00  0x00  0x00  0x00  0x00  0x00.
240249
241    monglfir:  0x7C  0x60  0x65  0xA8  0x1E  0x08  0x1D  0x1C  0x00  0x07  0x01  0x01  0x00  0x00  #$00  #$00  #$00  #$00.
242    soccernw:  0x7C  0x60  0x65  0xA8  0x1E  0x08  0x1D  0x1C  0x00  0x07  0x01  0x01  0x00  0x00  #$00  #$00  #$00  #$00.
250    monglfir:  0x7C  0x60  0x65  0xA8  0x1E  0x08  0x1D  0x1C  0x00  0x07  0x01  0x01  0x00  0x00  0x00  0x00  0x00  0x00.
251    soccernw:  0x7C  0x60  0x65  0xA8  0x1E  0x08  0x1D  0x1C  0x00  0x07  0x01  0x01  0x00  0x00  0x00  0x00  0x00  0x00.
243252
244253
245254***********************************************************************************
r1037r1038
324333    RAM:  - 1x 6116
325334          - 1x KM6264AL-10
326335
327    - 1x Crystal : 16.000 Mhz
336    - 1x Crystal : 16.000 MHz
328337
329338
330339    Jolly Card (other)
r1037r1038
338347    RAM:  - 1x NVram DS1220Y (instead of 6116)
339348          - 1x KM6264AL-10
340349
341    - 1x Crystal : 16.000 Mhz
350    - 1x Crystal : 16.000 MHz
342351
343352
344353    Jolly Card (Italia)
r1037r1038
367376    - 1x MC6845P
368377    - 1x YM2149F
369378    - 2x MC6821P
370    - 1x Crystal 16.000
379    - 1x Crystal 16.000 MHz
371380
372381
373382    Magic Card II (Bulgaria, bootleg)
r1037r1038
377386    - 1x MC6845P
378387    - 1x YM2149F
379388    - 2x MC6821P
380    - 1x Crystal 16.000
389    - 1x Crystal 16.000 MHz
381390
382391
383392    Cuore Uno (Italia)
r1037r1038
387396    - 1x MC68B45P (CRT controller)
388397    - 2x MC68B21CP (Peripheral Interface Adapter)
389398    - 1x unknown (95101) DIP40 mil600
390    - 1x oscillator 16.000000MHz
399    - 1x oscillator 16.000000 MHz
391400    - ROMs  1x TMS27C512
392401            2x TMS27C256
393402    - 1x PROM AM27S29
r1037r1038
406415    - 1x MC68B45P (CRT controller)
407416    - 2x EF6821P (Peripheral Interface Adapter)
408417    - 1x unknown (95101) DIP40 mil600
409    - 1x oscillator 16.000MHz
418    - 1x oscillator 16.000 MHz
410419    - ROMs  2x M27C256
411420            1x TMS27C256
412421    - 1x PROM AM27S29
r1037r1038
423432
424433    - 1x R65C02P2 (main)
425434    - 1x YM2149F (sound)
426    - 1x HD46505 (CRC controller)
435    - 1x HD46505 (CRT controller)
427436    - 2x EF6821P (Peripheral Interface Adapter)
428    - 1x oscillator 16.000000MHz
437    - 1x oscillator 16.000000 MHz
429438
430439    - 2x M27256 (pool,1)
431440    - 1x D27256 (2)
r1037r1038
444453
445454    - 1x G65SC02P2 (main)
446455    - 1x 95101 (sound)
447    - 1x MC68B45P (CRC controller)
456    - 1x MC68B45P (CRT controller)
448457    - 2x MC68B21CP (Peripheral Interface Adapter)
449    - 1x oscillator 16.000000MHz
458    - 1x oscillator 16.000000 MHz
450459
451460    - 3x TMS27C256
452461    - 1x PROM AM27S29PC
r1037r1038
489498    - CPU 1x R65C02P2 (main)
490499    - 1x MC68B45P (CRT controller)
491500    - 2x MC68B21CP (Peripheral Interface Adapter)
492    - 1x oscillator 16.000MHz
501    - 1x oscillator 16.000 MHz
493502    - 3x ROMs TMS 27C512
494503    - 1x PALCE16V8H
495504    - 1x prom AM27S29APC
r1037r1038
509518
510519    - 1x YM2149
511520
512    - 1x HD6845 (CRTC)
521    - 1x HD6845 (CRT controller)
513522    - 1x MC68A21P (PIA)
514523    - 1x 40 pin IC with surface scratched (PIA)
515524    - 1x 8 DIP Switches
r1037r1038
529538    - 1x G65SC02P2 (main)
530539    - 1x KC89C72 (sound)
531540    - 1x TDA2003 (sound)
532    - 1x MC68B45P (CRC controller)
541    - 1x MC68B45P (CRT controller)
533542    - 2x EF6821P (Peripheral Interface Adapter)
534    - 1x TSC87C52-16CB (PLCC44)(Programmable 8bit Microcontroller)(not dumped)
543    - 1x TSC87C52-16CB (PLCC44)(Programmable 8bit Microcontroller, now dumped)
535544    - 1x M48Z08-100PC1 (Zero Power RAM - Lithium Battery)
536    - 1x oscillator 16.0000MHz
545    - 1x oscillator 16.0000 MHz
537546
538547    - 3x M27C512
539548    - 1x PROM AM27S29PC
r1037r1038
552561    - 1x G65SC02P2 (main)
553562    - 1x KC89C72 (sound)
554563    - 1x TDA2003 (sound)
555    - 1x MC68B45P (CRC controller)
564    - 1x MC68B45P (CRT controller)
556565    - 1x EF68B21P (Peripheral Interface Adapter)
557566    - 1x EF6821P (Peripheral Interface Adapter)
558    - 1x TSC87C52-16CB (PLCC44)(Programmable 8bit Microcontroller)(not dumped)
567    - 1x TSC87C52-16CB (PLCC44)(Programmable 8bit Microcontroller, now dumped)
559568    - 1x M48Z08-100PC1 (Zero Power RAM - Lithium Battery)
560569    - 1x oscillator 16.0000MHz
561570
r1037r1038
591600    - 1x battery
592601
593602
603    Saloon (France, encrypted)
604    --------------------------
594605
606    - 1x 65SC02 (main)
607    - 1x 8948? (sound)
608    - 1x MC6845P (CRT controller)
609    - 1x oscillator 16.000000 MHz
610
611    - 2x M27C512
612    - 1x M27C256B
613    - 1x PROM N82S147N
614    - 1x GAL16V8-25LNC (read protected)
615    - 1x GAL18CV8-25 (read protected)
616
617    - 1x HY6264ALP-12
618    - 1x UM6116K-3L
619
620    - 1x JAMMA edge connector
621    - 1x trimmer (volume?)
622    - 1x LM380N (amplifier)
623    - 1x ULN2803A (8 Darlington arrays)
624    - 1x battery
625    - 1x test button
626    - 1x indicator LED
627    - NO DIP switches
628
629    Board has printed "LEOPARDO 5"
630
631
632
595633***********************************************************************************
596634
597635
r1037r1038
694732        Proper colors decoded.
695733    - Updated technical notes.
696734
735    2007/09/21
736    - Added new game: Saloon (France, encrypted). Preliminary.
737    - Updated technical notes.
697738
739
740
698741    *** TO DO ***
699742
700743    - Fix the last 2 GFX planes in magiccrd.
701    - Figure out the royalcdc and jokercrd encryption.
744    - Figure out the royalcdc, jokercrd and saloon encryption.
702745    - Analyze the unknown writes to $2000/$4000 in some games.
703746    - Check for the reads to the ay8910 output ports in some games.
704747    - Figure out the MCU in monglfir and soccernw.
r1037r1038
18211864   ROM_LOAD( "5.u27", 0x0000, 0x8000, CRC(f3d7d640) SHA1(f78060f4603e316fa3c2ec4ba6d7edf261cf6d8a) )
18221865ROM_END
18231866
1867ROM_START( saloon )
1868   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1869   ROM_LOAD( "1s.bin", 0x8000, 0x8000, CRC(66938330) SHA1(09118d607eff7121472db7d2cc24079e063dc7cf) )
18241870
1871   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
1872   ROM_LOAD( "2s.bin", 0x0000, 0x8000, CRC(39a792d5) SHA1(45c956a4a33587238a24eed602039115db1bb4b6) )
1873   ROM_LOAD( "3s.bin", 0x8000, 0x8000, CRC(babc0964) SHA1(f084465cc34ea7ac19091d3e75ef7d55c48273ae) )
1874
1875    /* looks strange */
1876   ROM_REGION( 0x0200, REGION_PROMS, 0 )
1877   ROM_LOAD( "82s147_saloon.bin", 0x0000, 0x0200, CRC(f424ccc1) SHA1(6df1215f58cca786e9f0ea4bf35407cf7fe21d83) )
1878ROM_END
1879
1880
18251881/**************************
18261882*  Driver Initialization  *
18271883**************************/
r1037r1038
19762032GAME( 199?, monglfir, 0,        royalmcu, royalcrd, funworld, ROT0, "bootleg",         "Mongolfier New (Italia)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
19772033GAME( 199?, soccernw, 0,        royalcrd, royalcrd, soccernw, ROT0, "bootleg",         "Soccer New (Italia)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
19782034GAME( 1998, snookr10, 0,        snookr10, snookr10, 0,        ROT0, "Sandiy",          "Snooker 10 (Ver 1.11)", GAME_NO_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
2035GAME( 198?, saloon,   0,        funworld, funworld, funworld, ROT0, "Unknown",         "Saloon (France, encrypted)", GAME_NO_SOUND | GAME_WRONG_COLORS | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
src/mame/drivers/mario.c
r1037r1038
201201   AM_RANGE(0x00, 0x00) AM_WRITE(MWA8_NOP)  /* unknown... is this a trigger? */
202202ADDRESS_MAP_END
203203
204
204205static ADDRESS_MAP_START( readmem_sound, ADDRESS_SPACE_PROGRAM, 8 )
205206   AM_RANGE(0x0000, 0x0fff) AM_READ(MRA8_ROM)
206207ADDRESS_MAP_END
208
207209static ADDRESS_MAP_START( writemem_sound, ADDRESS_SPACE_PROGRAM, 8 )
208210   AM_RANGE(0x0000, 0x0fff) AM_WRITE(MWA8_ROM)
209211ADDRESS_MAP_END
212
210213static ADDRESS_MAP_START( readport_sound, ADDRESS_SPACE_IO, 8 )
211214   AM_RANGE(0x00, 0xff) AM_READ(mario_sh_tune_r)
212215   AM_RANGE(I8039_p1, I8039_p1) AM_READ(mario_sh_p1_r)
r1037r1038
214217   AM_RANGE(I8039_t0, I8039_t0) AM_READ(mario_sh_t0_r)
215218   AM_RANGE(I8039_t1, I8039_t1) AM_READ(mario_sh_t1_r)
216219ADDRESS_MAP_END
220
217221static ADDRESS_MAP_START( writeport_sound, ADDRESS_SPACE_IO, 8 )
218222   AM_RANGE(0x00, 0xff) AM_WRITE(mario_sh_sound_w)
219223   AM_RANGE(I8039_p1, I8039_p1) AM_WRITE(mario_sh_p1_w)
r1037r1038
223227
224228
225229INPUT_PORTS_START( mario )
226   PORT_START      /* IN0 */
227   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
228   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
230   PORT_START_TAG("IN0")
231   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
232   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
229233   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
230234   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
231   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
235   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
232236   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 )
233237   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )
234   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
238   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_HIGH )
235239
236   PORT_START      /* IN1 */
240   PORT_START_TAG("IN1")
237241   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
238242   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
239243   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
240244   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
241245   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
242   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
243   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN1 )
246   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
247   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 )   /* doesn't work in game, but does in service mode */
244248   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
245249
246   PORT_START      /* DSW0 */
247   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )   PORT_DIPLOCATION("SW1:1,2")
250   PORT_START_TAG("DSW")
251   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
248252   PORT_DIPSETTING(    0x00, "3" )
249253   PORT_DIPSETTING(    0x01, "4" )
250254   PORT_DIPSETTING(    0x02, "5" )
251255   PORT_DIPSETTING(    0x03, "6" )
252   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) )   PORT_DIPLOCATION("SW1:3,4")
256   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:3,4")
253257   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
254258   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
255259   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
256260   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_3C ) )
257   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SW1:5,6")
258   PORT_DIPSETTING(    0x00, "20000" )
259   PORT_DIPSETTING(    0x10, "30000" )
260   PORT_DIPSETTING(    0x20, "40000" )
261   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:5,6")
262   PORT_DIPSETTING(    0x00, "20k only" )
263   PORT_DIPSETTING(    0x10, "30k only" )
264   PORT_DIPSETTING(    0x20, "40k only" )
261265   PORT_DIPSETTING(    0x30, DEF_STR( None ) )
262   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW1:7,8")
266   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:7,8")
263267   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
264268   PORT_DIPSETTING(    0x80, DEF_STR( Medium ) )
265269   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
266270   PORT_DIPSETTING(    0xc0, DEF_STR( Hardest ) )
267271INPUT_PORTS_END
268272
269INPUT_PORTS_START( mariojp )
270   PORT_START      /* IN0 */
271   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
272   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
273   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
274   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
275   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
276   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 )
277   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )
278   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
273INPUT_PORTS_START( marioo )
274   PORT_INCLUDE( mario )
279275
280   PORT_START      /* IN1 */
281   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
282   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
283   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
284   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
285   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
286   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
287   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 )   /* doesn't work in game, but does in service mode */
288   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
276   PORT_MODIFY( "IN1" )
277   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
278   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN1 )
279INPUT_PORTS_END
289280
290   PORT_START      /* DSW0 */
291   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
281INPUT_PORTS_START( marioj )
282   PORT_INCLUDE( mario )
283
284   PORT_MODIFY( "DSW" )
285   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
292286   PORT_DIPSETTING(    0x00, "3" )
293287   PORT_DIPSETTING(    0x01, "4" )
294288   PORT_DIPSETTING(    0x02, "5" )
295289   PORT_DIPSETTING(    0x03, "6" )
296   PORT_DIPNAME( 0x1c, 0x00, DEF_STR( Coinage ) )
290   PORT_DIPNAME( 0x1c, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:3,4,5")
297291   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
298292   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
299293   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
r1037r1038
302296   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
303297   PORT_DIPSETTING(    0x14, DEF_STR( 1C_5C ) )
304298   PORT_DIPSETTING(    0x1c, DEF_STR( 1C_6C ) )
305   PORT_DIPNAME( 0x20, 0x20, "2 Players Game" )
299   PORT_DIPNAME( 0x20, 0x20, "2 Players Game" ) PORT_DIPLOCATION("SW1:6")
306300   PORT_DIPSETTING(    0x00, "1 Credit" )
307301   PORT_DIPSETTING(    0x20, "2 Credits" )
308   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Bonus_Life ) )
309   PORT_DIPSETTING(    0x00, "20000" )
310   PORT_DIPSETTING(    0x40, "30000" )
311   PORT_DIPSETTING(    0x80, "40000" )
302   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:7,8")
303   PORT_DIPSETTING(    0x00, "20k 50k 30k+" )
304   PORT_DIPSETTING(    0x40, "30k 60k 30k+" )
305   PORT_DIPSETTING(    0x80, "40k 70k 30k+" )
312306   PORT_DIPSETTING(    0xc0, DEF_STR( None ) )
313307INPUT_PORTS_END
314308
309INPUT_PORTS_START( masao )
310   PORT_INCLUDE( marioo )
315311
312   PORT_MODIFY( "DSW" )
313   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:5,6")
314   PORT_DIPSETTING(    0x00, "20k 40k 20k+" )
315   PORT_DIPSETTING(    0x10, "30k 50k 20k+" )
316   PORT_DIPSETTING(    0x20, "40k 60k 20k+" )
317   PORT_DIPSETTING(    0x30, DEF_STR( None ) )
318INPUT_PORTS_END
316319
320
321
317322static const gfx_layout charlayout =
318323{
319324   8,8,   /* 8*8 characters */
r1037r1038
482487
483488ROM_START( mario )
484489   ROM_REGION( 0x10000, REGION_CPU1, 0 )
490   ROM_LOAD( "tma1-c.7f_e-1",     0x0000, 0x2000, CRC(c0c6e014) SHA1(36a04f9ca1c2a583477cb8a6f2ef94e044e08296) )
491   ROM_LOAD( "tma1-c.7e_e-b",     0x2000, 0x2000, CRC(b09ab857) SHA1(35b91cd1c4c3dd2d543a1ea8ff7b951715727792) )
492   ROM_LOAD( "tma1-c.7d_e-1",     0x4000, 0x2000, CRC(dcceb6c1) SHA1(b19804e69ce2c98cf276c6055c3a250316b96b45) )
493   ROM_LOAD( "tma1-c.7c_e-3",     0xf000, 0x1000, CRC(0d31bd1c) SHA1(a2e238470ba2ea3c81225fec687f61f047c68c59) )
494
495   ROM_REGION( 0x1000, REGION_CPU2, 0 )   /* sound */
496   ROM_LOAD( "tma1c-a.6k",   0x0000, 0x1000, CRC(06b9ff85) SHA1(111a29bcb9cda0d935675fa26eca6b099a88427f) )
497
498   ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
499   ROM_LOAD( "mario.3f",     0x0000, 0x1000, CRC(28b0c42c) SHA1(46749568aff88a28c3b6a1ac423abd1b90742a4d) )
500   ROM_LOAD( "mario.3j",     0x1000, 0x1000, CRC(0c8cc04d) SHA1(15fae47d701dc1ef15c943cee6aa991776ecffdf) )
501
502   ROM_REGION( 0x6000, REGION_GFX2, ROMREGION_DISPOSE )
503   ROM_LOAD( "tma1-v.7m",     0x0000, 0x1000, CRC(d01c0e2c) SHA1(cd6cc9d69c36db15543601f5da2abf109cde43c9) )
504   ROM_LOAD( "mario.7n",     0x1000, 0x1000, CRC(4f3a1f47) SHA1(0747d693b9482f6dd28b0bc484fd1d3e29d35654) )
505   ROM_LOAD( "mario.7p",     0x2000, 0x1000, CRC(56be6ccd) SHA1(15a6e16c189d45f72761ebcbe9db5001bdecd659) )
506   ROM_LOAD( "tma1-v.7s",     0x3000, 0x1000, CRC(ff856e6f) SHA1(2bc9ff18bb1842e8de2bc61ac828f1b175290bed) )
507   ROM_LOAD( "mario.7t",     0x4000, 0x1000, CRC(641f0008) SHA1(589fe108c7c11278fd897f2ded8f0498bc149cfd) )
508   ROM_LOAD( "tma1-v.7u",     0x5000, 0x1000, CRC(d2dbeb75) SHA1(676cf3e15252cd0d9e926ca15c3aa0caa39be269) )
509
510   ROM_REGION( 0x0200, REGION_PROMS, 0 )
511   ROM_LOAD( "mario.4p",     0x0000, 0x0200, CRC(afc9bd41) SHA1(90b739c4c7f24a88b6ac5ca29b06c032906a2801) )
512ROM_END
513
514ROM_START( marioo )
515   ROM_REGION( 0x10000, REGION_CPU1, 0 )
485516   ROM_LOAD( "mario.7f",     0x0000, 0x2000, CRC(c0c6e014) SHA1(36a04f9ca1c2a583477cb8a6f2ef94e044e08296) )
486517   ROM_LOAD( "mario.7e",     0x2000, 0x2000, CRC(116b3856) SHA1(e372f846d0e5a2b9b47ebd0330293fcc8a12363f) )
487518   ROM_LOAD( "mario.7d",     0x4000, 0x2000, CRC(dcceb6c1) SHA1(b19804e69ce2c98cf276c6055c3a250316b96b45) )
r1037r1038
506537   ROM_LOAD( "mario.4p",     0x0000, 0x0200, CRC(afc9bd41) SHA1(90b739c4c7f24a88b6ac5ca29b06c032906a2801) )
507538ROM_END
508539
509ROM_START( mariojp )
540ROM_START( marioj )
510541   ROM_REGION( 0x10000, REGION_CPU1, 0 )
511542   ROM_LOAD( "tma1c-a1.7f",  0x0000, 0x2000, CRC(b64b6330) SHA1(f7084251ac325bbfa3fb804da16a50622e1fd213) )
512543   ROM_LOAD( "tma1c-a2.7e",  0x2000, 0x2000, CRC(290c4977) SHA1(5af266be0ddc883c6548c90e4a9084024a1e91a0) )
r1037r1038
560591
561592
562593
563GAME( 1983, mario,   0,     mario, mario,   0, ROT180, "Nintendo of America", "Mario Bros. (US)", GAME_SUPPORTS_SAVE )
564GAME( 1983, mariojp, mario, mario, mariojp, 0, ROT180, "Nintendo", "Mario Bros. (Japan)", GAME_SUPPORTS_SAVE )
565GAME( 1983, masao,   mario, masao, mario,   0, ROT180, "bootleg", "Masao", GAME_SUPPORTS_SAVE )
594GAME( 1983, mario,    0,       mario,   mario,   0, ROT180, "Nintendo of America", "Mario Bros. (US, set 1)", GAME_SUPPORTS_SAVE )
595GAME( 1983, marioo,   mario,   mario,   marioo,  0, ROT180, "Nintendo of America", "Mario Bros. (US, set 2)", GAME_SUPPORTS_SAVE )
596GAME( 1983, marioj,   mario,   mario,   marioj,  0, ROT180, "Nintendo", "Mario Bros. (Japan)", GAME_SUPPORTS_SAVE )
597GAME( 1983, masao,    mario,   masao,   masao,   0, ROT180, "bootleg", "Masao", GAME_SUPPORTS_SAVE )
src/mame/drivers/videopin.c
r1037r1038
1212
1313#include "driver.h"
1414#include "videopin.h"
15#include "videopin.lh"
1516#include "sound/discrete.h"
1617
1718static mame_time time_pushed;
r1037r1038
414415 *
415416 *************************************/
416417
417GAME( 1979, videopin, 0, videopin, videopin, 0, ROT270, "Atari", "Video Pinball", 0 )
418GAMEL( 1979, videopin, 0, videopin, videopin, 0, ROT270, "Atari", "Video Pinball", 0, layout_videopin )
src/mame/drivers/tumbleb.c
r1037r1038
335335   return ~0;
336336}
337337
338#ifdef UNUSED_FUNCTION
338339static WRITE16_HANDLER( tumblepb_sound_w )
339340{
340341   soundlatch_w(0,data & 0xff);
341342   cpunum_set_input_line(1,0,HOLD_LINE);
342343}
344#endif
343345
344346static WRITE16_HANDLER( jumppop_sound_w )
345347{
r1037r1038
830832
831833/******************************************************************************/
832834
835#ifdef UNUSED_FUNCTION
833836static WRITE8_HANDLER( YM2151_w )
834837{
835838   switch (offset) {
r1037r1038
841844      break;
842845   }
843846}
847#endif
844848
845849WRITE16_HANDLER( semicom_soundcmd_w )
846850{
src/mame/drivers/micro3d.c
r1037r1038
410410        m68901_int_gen(TMRA);           // Fire an interrupt.
411411}
412412
413#ifdef UNUSED_FUNCTION
413414static TIMER_CALLBACK( timerb_int )
414415{
415416        mame_timer_set(scale_up_mame_time(MAME_TIME_IN_HZ(M68901_CLK), ((m68901_base[0x10]>>8) & 0xff) * 200),0,timera_int);
r1037r1038
421422        mame_timer_set(scale_up_mame_time(MAME_TIME_IN_HZ(M68901_CLK), ((m68901_base[0x11]>>8) & 0xff) * 200),0,timera_int);
422423        m68901_int_gen(TMRC);           // Fire an interrupt.
423424}
425#endif
424426
425427static TIMER_CALLBACK( timerd_int )
426428{
r1037r1038
674676
675677}
676678
679#ifdef UNUSED_FUNCTION
677680static WRITE32_HANDLER( am_uart_w )
678681{
679682       mame_printf_debug("%c",data);
r1037r1038
699702{
700703       popmessage("TMS Write to 2600000: %x",data);
701704}
705#endif
702706
703707
704708static READ16_HANDLER( tms_host_r )
r1037r1038
711715   tms34010_host_w(1, offset, data);
712716}
713717
718#ifdef UNUSED_FUNCTION
714719static WRITE16_HANDLER( reset_slave )
715720{
716721        if(data & 0x0020)
r1037r1038
724729           logerror("TMS Reset\n");
725730        }
726731}
732#endif
727733
728734
729735
src/mame/drivers/taito_z.c
r1037r1038
19591959
19601960
19611961INPUT_PORTS_START( contcirc )
1962   PORT_START /* DSW A */
1962   PORT_START_TAG("DSW1") /* DSW A */
19631963   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )
19641964   PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )
19651965   PORT_DIPSETTING(    0x00, "Cockpit" )   // analogue accelerator pedal
r1037r1038
19721972   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
19731973   TAITO_Z_COINAGE_WORLD_8
19741974
1975   PORT_START /* DSW B */
1975   PORT_START_TAG("DSW2") /* DSW B */
19761976   PORT_DIPNAME( 0x03, 0x03, "Difficulty 1 (time/speed)" )
19771977   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
19781978   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
r1037r1038
20302030INPUT_PORTS_END
20312031
20322032INPUT_PORTS_START( contcrcu )
2033   PORT_START /* DSW A */
2034   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )
2035   PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )
2036   PORT_DIPSETTING(    0x00, "Cockpit" )   // analogue accelerator pedal
2037   PORT_DIPNAME( 0x02, 0x02, "Discounted continues" )
2038   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2039   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
2040   PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
2041   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )
2042   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2043   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
2044   TAITO_Z_COINAGE_JAPAN_8      // confirmed
2033   PORT_INCLUDE(contcirc)
20452034
2046   PORT_START /* DSW B */
2047   PORT_DIPNAME( 0x03, 0x03, "Difficulty 1 (time/speed)" )
2048   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
2049   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
2050   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
2051   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
2052   PORT_DIPNAME( 0x0c, 0x0c, "Difficulty 2 (other cars)" )
2053   PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
2054   PORT_DIPSETTING(    0x0c, DEF_STR( Normal ) )
2055   PORT_DIPSETTING(    0x04, DEF_STR( Hard ) )
2056   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
2057   PORT_DIPNAME( 0x10, 0x10, "Steering wheel" )   //not sure what effect this has
2058   PORT_DIPSETTING(    0x10, "Free" )
2059   PORT_DIPSETTING(    0x00, "Locked" )
2060   PORT_DIPNAME( 0x20, 0x00, "Enable 3d alternate frames" )
2061   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2062   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
2063   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )   //acc. to manual
2064   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2065   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2066   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )   //acc. to manual
2067   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2068   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2069
2070   PORT_START      /* IN0 */
2071   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2072   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2073   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 )
2074   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 )
2075   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_SERVICE1 )
2076   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_PLAYER(1)   /* 3 for accel [7 levels] */
2077   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(1)
2078   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)   /* main accel key */
2079
2080   PORT_START      /* IN1: b3 not mapped: standardized on holding b4=lo gear */
2081   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2082   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2083   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_TILT )
2084   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START1 )
2085   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(1)   /* gear shift lo/hi */
2086   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_PLAYER(1)   /* 3 for brake [7 levels] */
2087   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_PLAYER(1)
2088   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)   /* main brake key */
2089
2090   PORT_START      /* IN2, unused */
2091
2092   PORT_START      /* IN3, "handle" i.e. steering */
2093   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(15) PORT_REVERSE PORT_PLAYER(1)
2094
2095   PORT_START      /* IN4, fake allowing digital steer */
2096   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
2097   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
2098   PORT_DIPNAME( 0x10, 0x00, "Steering type" )
2099   PORT_DIPSETTING(    0x10, "Digital" )
2100   PORT_DIPSETTING(    0x00, "Analogue" )
2035   PORT_MODIFY("DSW1")
2036   TAITO_Z_COINAGE_JAPAN_8      // confirmed
21012037INPUT_PORTS_END
21022038
21032039INPUT_PORTS_START( chasehq )   // IN3-6 perhaps used with cockpit setup? //
2104   PORT_START /* DSW A */
2040   PORT_START_TAG("DSW1") /* DSW A */
21052041   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Cabinet ) )   /* US Manual states DIPS 1 & 2 "MUST REMAIN OFF" */
21062042   PORT_DIPSETTING(    0x03, "Upright / Steering Lock" )
21072043   PORT_DIPSETTING(    0x02, "Upright / No Steering Lock" )
r1037r1038
21132049   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
21142050   TAITO_Z_COINAGE_WORLD_8
21152051
2116   PORT_START /* DSW B */
2052   PORT_START_TAG("DSW2") /* DSW B */
21172053   TAITO_Z_DIFFICULTY_8
21182054   PORT_DIPNAME( 0x0c, 0x0c, "Timer Setting" )
21192055   PORT_DIPSETTING(    0x08, "70 Seconds" )
r1037r1038
22062142   PORT_DIPSETTING(    0x00, "Analogue" )
22072143INPUT_PORTS_END
22082144
2209INPUT_PORTS_START( chasehqj )   // IN3-6 perhaps used with cockpit setup? //
2210   PORT_START /* DSW A */
2211   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Cabinet ) )
2212   PORT_DIPSETTING(    0x03, "Upright / Steering Lock" )
2213   PORT_DIPSETTING(    0x02, "Upright / No Steering Lock" )
2214   PORT_DIPSETTING(    0x01, "Full Throttle Convert, Cockpit" )
2215   PORT_DIPSETTING(    0x00, "Full Throttle Convert, Deluxe" )
2216   PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
2217   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )
2218   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2219   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
2220   TAITO_Z_COINAGE_JAPAN_8
2145INPUT_PORTS_START( chasehqj )
2146   PORT_INCLUDE(chasehq)
22212147
2222   PORT_START /* DSW B */
2223   TAITO_Z_DIFFICULTY_8
2224   PORT_DIPNAME( 0x0c, 0x0c, "Timer Setting" )
2225   PORT_DIPSETTING(    0x08, "70 Seconds" )
2226   PORT_DIPSETTING(    0x04, "65 Seconds" )
2227   PORT_DIPSETTING(    0x0c, "60 Seconds" )
2228   PORT_DIPSETTING(    0x00, "55 Seconds" )
2229   PORT_DIPNAME( 0x10, 0x10, "Turbos Stocked" )
2230   PORT_DIPSETTING(    0x10, "3" )
2231   PORT_DIPSETTING(    0x00, "5" )
2232   PORT_DIPNAME( 0x20, 0x20, "Discounted Continue Play" )   /* Full coin price to start, 1 coin to continue */
2233   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
2234   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2235   PORT_DIPNAME( 0x40, 0x40, "Damage Cleared at Continue" )
2236   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2237   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
2238   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Allow_Continue ) )
2239   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2240   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
2241
2242   PORT_START      /* IN0 */
2243   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2244   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2245   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 )
2246   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 )
2247   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_SERVICE1 )
2248   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_BUTTON2 ) PORT_PLAYER(1)   /* brake */
2249   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2250   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2251
2252   PORT_START      /* IN1 */
2253   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_BUTTON3 ) PORT_PLAYER(1)   /* turbo */
2254   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_TILT )
2255   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2256   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START1 )
2257   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(1)   /* gear */
2258   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_BUTTON1 ) PORT_PLAYER(1)   /* accel */
2259   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2260   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2261
2262   PORT_START      /* IN2, unused */
2263
2264   PORT_START      /* IN3, ??? */
2265   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
2266   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
2267   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
2268   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2269   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
2270   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
2271   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
2272   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
2273
2274   PORT_START      /* IN4, ??? */
2275   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
2276   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
2277   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
2278   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2279   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
2280   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
2281   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
2282   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
2283
2284   PORT_START      /* IN5, ??? */
2285   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
2286   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
2287   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
2288   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2289   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
2290   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
2291   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
2292   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
2293
2294   PORT_START      /* IN6, ??? */
2295   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
2296   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
2297   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
2298   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2299   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
2300   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
2301   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
2302   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
2303
2304   PORT_START      /* IN7, steering */
2305   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(15) PORT_PLAYER(1)
2306
2307   PORT_START      /* IN8, fake allowing digital steer */
2308   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
2309   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
2310   PORT_DIPNAME( 0x10, 0x00, "Steering type" )
2311   PORT_DIPSETTING(    0x10, "Digital" )
2312   PORT_DIPSETTING(    0x00, "Analogue" )
2148   PORT_MODIFY("DSW1")
2149   TAITO_Z_COINAGE_JAPAN_8
23132150INPUT_PORTS_END
23142151
23152152INPUT_PORTS_START( enforce )
r1037r1038
23692206INPUT_PORTS_END
23702207
23712208INPUT_PORTS_START( bshark )
2372   PORT_START /* DSW A */
2209   PORT_START_TAG("DSW1") /* DSW A */
23732210   PORT_DIPNAME( 0x01, 0x01, "Mirror screen" )   // manual says first two must be off
23742211   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
23752212   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r1037r1038
23822219   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
23832220   TAITO_Z_COINAGE_US_8
23842221
2385   PORT_START /* DSW B */
2222   PORT_START_TAG("DSW2") /* DSW B */
23862223   TAITO_Z_DIFFICULTY_8
23872224   PORT_DIPNAME( 0x0c, 0x04, "Speed of Sight" )
23882225   PORT_DIPSETTING(    0x0c, "Slow" )
r1037r1038
24382275INPUT_PORTS_END
24392276
24402277INPUT_PORTS_START( bsharkj )
2441   PORT_START /* DSW A */
2442   PORT_DIPNAME( 0x01, 0x01, "Mirror screen" )
2443   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
2444   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2445   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
2446   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
2447   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2448   PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
2449   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )
2450   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2451   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
2452   TAITO_Z_COINAGE_JAPAN_8
2278   PORT_INCLUDE(bshark)
24532279
2454   PORT_START /* DSW B */
2455   TAITO_Z_DIFFICULTY_8
2456   PORT_DIPNAME( 0x0c, 0x04, "Speed of Sight" )
2457   PORT_DIPSETTING(    0x0c, "Slow" )
2458   PORT_DIPSETTING(    0x08, DEF_STR( Medium ) )
2459   PORT_DIPSETTING(    0x04, "Fast" )
2460   PORT_DIPSETTING(    0x00, "Fastest" )
2461   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
2462   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
2463   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2464   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
2465   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
2466   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2467   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
2468   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2469   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2470   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
2471   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2472   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2473
2474   PORT_START      /* IN0 */
2475   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 )
2476   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 )
2477   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
2478   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_TILT )
2479   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
2480   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
2481   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
2482   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
2483
2484   PORT_START      /* IN1, unused */
2485
2486   PORT_START      /* IN2, b2-5 affect sound num in service mode but otherwise useless (?) */
2487   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
2488   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
2489   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
2490   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
2491   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
2492   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
2493   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)   /* "Fire" */
2494   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1)   /* same as "Fire" */
2495
2496   PORT_START   /* values chosen to match allowed crosshair area */
2497   PORT_BIT( 0xff, 0x00, IPT_AD_STICK_X ) PORT_MINMAX(0xcc,0x35) PORT_SENSITIVITY(20) PORT_KEYDELTA(4) PORT_REVERSE PORT_PLAYER(1)
2498
2499   PORT_START   /* "X adjust" */
2500   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
2501
2502   PORT_START   /* values chosen to match allowed crosshair area */
2503   PORT_BIT( 0xff, 0x00, IPT_AD_STICK_Y ) PORT_MINMAX(0xd5,0x32) PORT_SENSITIVITY(20) PORT_KEYDELTA(4) PORT_PLAYER(1)
2504
2505   PORT_START   /* "Y adjust" */
2506   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
2280   PORT_MODIFY("DSW1")
2281   TAITO_Z_COINAGE_JAPAN_8
25072282INPUT_PORTS_END
25082283
25092284INPUT_PORTS_START( sci )
2510   PORT_START /* DSW A */
2285   PORT_START_TAG("DSW1") /* DSW A */
25112286   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
25122287   PORT_DIPSETTING(    0x01, "Cockpit" )
25132288   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
r1037r1038
25202295   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
25212296   TAITO_Z_COINAGE_WORLD_8
25222297
2523   PORT_START /* DSW B */
2298   PORT_START_TAG("DSW2") /* DSW B */
25242299   TAITO_Z_DIFFICULTY_8
25252300   PORT_DIPNAME( 0x0c, 0x0c, "Timer Setting" )
25262301   PORT_DIPSETTING(    0x08, "70 Seconds" )
r1037r1038
25742349INPUT_PORTS_END
25752350
25762351INPUT_PORTS_START( sciu )
2577   PORT_START /* DSW A */
2578   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
2579   PORT_DIPSETTING(    0x01, "Cockpit" )
2580   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
2581   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unused ) ) /* Manual states "MUST REMAIN OFF" */
2582   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
2583   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2584   PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
2585   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )
2586   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2587   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
2352   PORT_INCLUDE(sci)
2353
2354   PORT_MODIFY("DSW1")
25882355   TAITO_Z_COINAGE_US_8
2356INPUT_PORTS_END
25892357
2590   PORT_START /* DSW B */
2591   TAITO_Z_DIFFICULTY_8
2592   PORT_DIPNAME( 0x0c, 0x0c, "Timer Setting" )
2593   PORT_DIPSETTING(    0x08, "70 Seconds" )
2594   PORT_DIPSETTING(    0x04, "65 Seconds" )
2595   PORT_DIPSETTING(    0x0c, "60 Seconds" )
2596   PORT_DIPSETTING(    0x00, "55 Seconds" )
2597   PORT_DIPNAME( 0x10, 0x10, "Turbos Stocked" )
2598   PORT_DIPSETTING(    0x10, "3" )
2599   PORT_DIPSETTING(    0x00, "5" )
2600   PORT_DIPNAME( 0x20, 0x20, "Steering Radius" )
2601   PORT_DIPSETTING(    0x00, "270 Degree" )
2602   PORT_DIPSETTING(    0x20, "360 Degree" )
2603   PORT_DIPNAME( 0x40, 0x40, "Damage Cleared at Continue" )
2604   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2605   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
2606   PORT_DIPNAME( 0x80, 0x80, "Siren Volume" )
2607   PORT_DIPSETTING(    0x80, DEF_STR( Normal ) )
2608   PORT_DIPSETTING(    0x00, DEF_STR( Low ) )
2358INPUT_PORTS_START( scij )
2359   PORT_INCLUDE(sci)
26092360
2610   PORT_START      /* IN0 */
2611   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
2612   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)   /* fire */
2613   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
2614   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
2615   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
2616   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)   /* brake */
2617   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
2618   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
2619
2620   PORT_START      /* IN1 */
2621   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_BUTTON5 ) PORT_PLAYER(1)   /* turbo */
2622   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_TILT )
2623   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_BUTTON6 ) PORT_PLAYER(1)   /* "center" */
2624   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START1 )
2625   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(1)   /* gear */
2626   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_BUTTON1 ) PORT_PLAYER(1)   /* accel */
2627   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2628   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2629
2630   PORT_START      /* IN2, unused */
2631
2632   PORT_START      /* IN3, steering */
2633   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(15) PORT_PLAYER(1)
2634
2635   PORT_START      /* IN4, fake allowing digital steer */
2636   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
2637   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
2638   PORT_DIPNAME( 0x10, 0x00, "Steering type" )
2639   PORT_DIPSETTING(    0x10, "Digital" )
2640   PORT_DIPSETTING(    0x00, "Analogue" )
2361   PORT_MODIFY("DSW1")
2362   TAITO_Z_COINAGE_JAPAN_8
26412363INPUT_PORTS_END
26422364
26432365INPUT_PORTS_START( nightstr )
r1037r1038
27092431INPUT_PORTS_END
27102432
27112433INPUT_PORTS_START( aquajack )
2712   PORT_START /* DSW A */
2434   PORT_START_TAG("DSW1") /* DSW A */
27132435   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
27142436   PORT_DIPSETTING(    0x80, "Cockpit" )
27152437   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
r1037r1038
27312453   PORT_DIPSETTING(    0x02, DEF_STR( 1C_4C ) )   /* 2 Coins to Continue */
27322454   PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )   /* 3 Coins to Continue */
27332455
2734   PORT_START /* DSW B */
2456   PORT_START_TAG("DSW2") /* DSW B */
27352457   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )
27362458   PORT_DIPSETTING(    0x40, DEF_STR( Easy ) )
27372459   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
r1037r1038
27792501INPUT_PORTS_END
27802502
27812503INPUT_PORTS_START( aquajckj )
2782   PORT_START /* DSW A */
2783   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
2784   PORT_DIPSETTING(    0x80, "Cockpit" )
2785   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
2786   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
2787   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2788   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2789   PORT_SERVICE( 0x20, IP_ACTIVE_LOW )
2790   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Demo_Sounds ) )
2791   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
2792   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
2504   PORT_INCLUDE(aquajack)
2505
2506   PORT_MODIFY("DSW1")
27932507   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_A ) )
27942508   PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
27952509   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
r1037r1038
28002514   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
28012515   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )
28022516   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
2803
2804   PORT_START /* DSW B */
2805   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )
2806   PORT_DIPSETTING(    0x40, DEF_STR( Easy ) )
2807   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
2808   PORT_DIPSETTING(    0x80, DEF_STR( Hard ) )
2809   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
2810   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
2811   PORT_DIPSETTING(    0x00, "30k" )
2812   PORT_DIPSETTING(    0x30, "50k" )
2813   PORT_DIPSETTING(    0x10, "80k" )
2814   PORT_DIPSETTING(    0x20, "100k" )
2815   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
2816   PORT_DIPSETTING(    0x08, "1" )
2817   PORT_DIPSETTING(    0x04, "2" )
2818   PORT_DIPSETTING(    0x0c, "3" )
2819   PORT_DIPSETTING(    0x00, "5" )
2820   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unused ) ) /* Dips 7 & 8 shown as "Do Not Touch" in manual */
2821   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
2822   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2823   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) )
2824   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
2825   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2826
2827   PORT_START      /* IN0 */
2828   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
2829   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
2830   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
2831   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
2832   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
2833   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_TILT )
2834   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
2835   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
2836
2837   PORT_START      /* IN1 */
2838   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
2839   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
2840   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
2841   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
2842   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
2843   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
2844   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
2845   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
2846
2847   PORT_START      /* IN2, what is it ??? */
2848   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_PLAYER(1)
28492517INPUT_PORTS_END
28502518
28512519INPUT_PORTS_START( spacegun )
r1037r1038
29192587INPUT_PORTS_END
29202588
29212589INPUT_PORTS_START( dblaxle )
2922   PORT_START /* DSW A */
2590   PORT_START_TAG("DSW1") /* DSW A */
29232591   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
29242592   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
29252593   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r1037r1038
29322600   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
29332601   TAITO_Z_COINAGE_US_8
29342602
2935   PORT_START /* DSW B */
2603   PORT_START_TAG("DSW2") /* DSW B */
29362604   TAITO_Z_DIFFICULTY_8
29372605   PORT_DIPNAME( 0x04, 0x00, "Multi-machine hookup ?" )   // doesn't boot if on
29382606   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
r1037r1038
29872655INPUT_PORTS_END
29882656
29892657INPUT_PORTS_START( pwheelsj )
2990   PORT_START /* DSW A */
2991   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
2992   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
2993   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2994   PORT_DIPNAME( 0x02, 0x02, "Gear shift" )
2995   PORT_DIPSETTING(    0x02, DEF_STR( Normal ) )
2996   PORT_DIPSETTING(    0x00, "Inverted" )
2997   PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
2998   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )
2999   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3000   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
3001   TAITO_Z_COINAGE_JAPAN_8
2658   PORT_INCLUDE(dblaxle)
30022659
3003   PORT_START /* DSW B */
3004   TAITO_Z_DIFFICULTY_8
3005   PORT_DIPNAME( 0x04, 0x00, "Multi-machine hookup ?" )   // doesn't boot if on
3006   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
3007   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
3008   PORT_DIPNAME( 0x08, 0x08, "Player Truck" )
3009   PORT_DIPSETTING(    0x08, "Red" )
3010   PORT_DIPSETTING(    0x00, "Blue" )
3011   PORT_DIPNAME( 0x10, 0x10, "Back button" )
3012   PORT_DIPSETTING(    0x10, DEF_STR( Normal ) )
3013   PORT_DIPSETTING(    0x00, "Inverted" )
3014   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )   // causes "Root CPU Error" on "Icy Road" (Tourniquet)
3015   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
3016   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3017   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
3018   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
3019   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3020   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
3021   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
3022   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3023
3024   PORT_START      /* IN0 */
3025   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
3026   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)   /* shift */
3027   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
3028   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
3029   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
3030   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)   /* brake */
3031   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
3032   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)   /* "back" */
3033
3034   PORT_START      /* IN1 */
3035   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)   /* nitro */
3036   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_TILT )
3037   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1)   /* "center" */
3038   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
3039   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
3040   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)   /* accel */
3041   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
3042   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
3043
3044   PORT_START      /* IN2, unused */
3045
3046   PORT_START      /* IN3, steering */
3047   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(40) PORT_KEYDELTA(10) PORT_PLAYER(1)
3048
3049   PORT_START      /* IN4, fake allowing digital steer */
3050   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
3051   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
3052   PORT_DIPNAME( 0x10, 0x00, "Steering type" )
3053   PORT_DIPSETTING(    0x10, "Digital" )
3054   PORT_DIPSETTING(    0x00, "Analogue" )
2660   PORT_MODIFY("DSW1")
2661   TAITO_Z_COINAGE_JAPAN_8
30552662INPUT_PORTS_END
30562663
30572664
r1037r1038
40913698
40923699ROM_START( sci )
40933700   ROM_REGION( 0x80000, REGION_CPU1, 0 )   /* 512K for 68000 code (CPU A) */
4094   ROM_LOAD16_BYTE( "c09-37.rom", 0x00000, 0x20000, CRC(0fecea17) SHA1(0ad4454eee6646b0f978b1ba83206d64c1f6d081) )
4095   ROM_LOAD16_BYTE( "c09-40.rom", 0x00001, 0x20000, CRC(e46ebd9b) SHA1(52b0c1f95e8a664076d8fbc0f6204ca55893e281) )
4096   ROM_LOAD16_BYTE( "c09-38.rom", 0x40000, 0x20000, CRC(f4404f87) SHA1(8f051f1ffbf323cb3d613bc22afa53676590f29c) )
4097   ROM_LOAD16_BYTE( "c09-41.rom", 0x40001, 0x20000, CRC(de87bcb9) SHA1(b5537a25871ea90294f3b6f0b6386a883cfdf991) )
3701   ROM_LOAD16_BYTE( "c09-37.37", 0x00000, 0x20000, CRC(0fecea17) SHA1(0ad4454eee6646b0f978b1ba83206d64c1f6d081) )
3702   ROM_LOAD16_BYTE( "c09-38.40", 0x00001, 0x20000, CRC(e46ebd9b) SHA1(52b0c1f95e8a664076d8fbc0f6204ca55893e281) )
3703   ROM_LOAD16_BYTE( "c09-42.38", 0x40000, 0x20000, CRC(f4404f87) SHA1(8f051f1ffbf323cb3d613bc22afa53676590f29c) )
3704   ROM_LOAD16_BYTE( "c09-39.41", 0x40001, 0x20000, CRC(de87bcb9) SHA1(b5537a25871ea90294f3b6f0b6386a883cfdf991) )
40983705
40993706   ROM_REGION( 0x20000, REGION_CPU3, 0 )   /* 128K for 68000 code (CPU B) */
4100   ROM_LOAD16_BYTE( "c09-33.rom", 0x00000, 0x10000, CRC(cf4e6c5b) SHA1(8d6720b605b8e0c7f0473ba452c79bf5efc2615d) )
4101   ROM_LOAD16_BYTE( "c09-32.rom", 0x00001, 0x10000, CRC(a4713719) SHA1(b1110e397d3407ec63975cdd92a23cbb16348200) )
3707   ROM_LOAD16_BYTE( "c09-33.6", 0x00000, 0x10000, CRC(cf4e6c5b) SHA1(8d6720b605b8e0c7f0473ba452c79bf5efc2615d) ) /* Actual label is "C09 33*" */
3708   ROM_LOAD16_BYTE( "c09-32.5", 0x00001, 0x10000, CRC(a4713719) SHA1(b1110e397d3407ec63975cdd92a23cbb16348200) ) /* Actual label is "C09 32*" */
41023709
41033710   ROM_REGION( 0x2c000, REGION_CPU2, 0 )   /* Z80 sound cpu */
4104   ROM_LOAD( "c09-34.rom",   0x00000, 0x04000, CRC(a21b3151) SHA1(f59c7b1ba5edf97d72670ee194ce9fdc5c5b9a58) )
4105   ROM_CONTINUE(             0x10000, 0x1c000 )   /* banked stuff */
3711   ROM_LOAD( "c09-34.31",   0x00000, 0x04000, CRC(a21b3151) SHA1(f59c7b1ba5edf97d72670ee194ce9fdc5c5b9a58) )
3712   ROM_CONTINUE(            0x10000, 0x1c000 )   /* banked stuff */
41063713
41073714   ROM_REGION( 0x80000, REGION_GFX1, ROMREGION_DISPOSE )
4108   ROM_LOAD( "c09-05.rom", 0x00000, 0x80000, CRC(890b38f0) SHA1(b478c96214ce027926346a4653250c8ee8a98bdc) )   /* SCR 8x8 */
3715   ROM_LOAD( "c09-05.16", 0x00000, 0x80000, CRC(890b38f0) SHA1(b478c96214ce027926346a4653250c8ee8a98bdc) )   /* SCR 8x8 */
41093716
41103717   ROM_REGION( 0x200000, REGION_GFX2, ROMREGION_DISPOSE )
4111   ROM_LOAD32_BYTE( "c09-04.rom", 0x000000, 0x080000, CRC(2cbb3c9b) SHA1(9e3d95f76f5f5d385b6a9516af781aefef1eb0ca) )   /* OBJ 16x8 */
4112   ROM_LOAD32_BYTE( "c09-02.rom", 0x000001, 0x080000, CRC(a83a0389) SHA1(932788b5b5f01326d0fbb2b9fdb94a8c7c004db3) )
4113   ROM_LOAD32_BYTE( "c09-03.rom", 0x000002, 0x080000, CRC(a31d0e80) SHA1(dfeff1b89dd7b3f19b26e77f2d66f6448cb00553) )
4114   ROM_LOAD32_BYTE( "c09-01.rom", 0x000003, 0x080000, CRC(64bfea10) SHA1(15ea43092027b1717d0f24fbe6ac2cdf11a7ddc6) )
3718   ROM_LOAD32_BYTE( "c09-04.52", 0x000000, 0x080000, CRC(2cbb3c9b) SHA1(9e3d95f76f5f5d385b6a9516af781aefef1eb0ca) )   /* OBJ 16x8 */
3719   ROM_LOAD32_BYTE( "c09-02.53", 0x000001, 0x080000, CRC(a83a0389) SHA1(932788b5b5f01326d0fbb2b9fdb94a8c7c004db3) )
3720   ROM_LOAD32_BYTE( "c09-03.54", 0x000002, 0x080000, CRC(a31d0e80) SHA1(dfeff1b89dd7b3f19b26e77f2d66f6448cb00553) )
3721   ROM_LOAD32_BYTE( "c09-01.55", 0x000003, 0x080000, CRC(64bfea10) SHA1(15ea43092027b1717d0f24fbe6ac2cdf11a7ddc6) )
41153722
41163723   ROM_REGION( 0x80000, REGION_GFX3, 0 )   /* don't dispose */
4117   ROM_LOAD( "c09-07.rom", 0x00000, 0x80000, CRC(963bc82b) SHA1(e3558aecd1b82ddbf10ab2b71843a3664705f1f1) )   /* ROD, road lines */
3724   ROM_LOAD( "c09-07.15", 0x00000, 0x80000, CRC(963bc82b) SHA1(e3558aecd1b82ddbf10ab2b71843a3664705f1f1) )   /* ROD, road lines */
41183725
41193726   ROM_REGION16_LE( 0x80000, REGION_USER1, 0 )
4120   ROM_LOAD16_WORD( "c09-06.rom", 0x00000, 0x80000, CRC(12df6d7b) SHA1(8ce742eb3f7eb6283b5ca32bb520d1cc7684d515) )   /* STY spritemap */
3727   ROM_LOAD16_WORD( "c09-06.37", 0x00000, 0x80000, CRC(12df6d7b) SHA1(8ce742eb3f7eb6283b5ca32bb520d1cc7684d515) )   /* STY spritemap */
41213728
41223729   ROM_REGION( 0x180000, REGION_SOUND1, 0 )   /* ADPCM samples */
4123   ROM_LOAD( "c09-14.rom", 0x000000, 0x080000, CRC(ad78bf46) SHA1(4020744bbdc4b9ec3dee1a9d7b5ffa8def43d7b2) )
4124   ROM_LOAD( "c09-13.rom", 0x080000, 0x080000, CRC(d57c41d3) SHA1(3375a1fc6389840544b9fdb96b2fafbc8e3276e2) )
4125   ROM_LOAD( "c09-12.rom", 0x100000, 0x080000, CRC(56c99fa5) SHA1(3f9a6bc89d847cc4c99d35f98157ea3f187c0f98) )
3730   ROM_LOAD( "c09-14.42", 0x000000, 0x080000, CRC(ad78bf46) SHA1(4020744bbdc4b9ec3dee1a9d7b5ffa8def43d7b2) )
3731   ROM_LOAD( "c09-13.43", 0x080000, 0x080000, CRC(d57c41d3) SHA1(3375a1fc6389840544b9fdb96b2fafbc8e3276e2) )
3732   ROM_LOAD( "c09-12.44", 0x100000, 0x080000, CRC(56c99fa5) SHA1(3f9a6bc89d847cc4c99d35f98157ea3f187c0f98) )
41263733
41273734   ROM_REGION( 0x80000, REGION_SOUND2, 0 )   /* Delta-T samples */
4128   ROM_LOAD( "c09-15.rom", 0x00000, 0x80000, CRC(e63b9095) SHA1(c6ea670b5a90ab39429259ec1fefb2bde5d0213f) )
3735   ROM_LOAD( "c09-15.29", 0x00000, 0x80000, CRC(e63b9095) SHA1(c6ea670b5a90ab39429259ec1fefb2bde5d0213f) )
41293736
41303737   ROM_REGION( 0x10000, REGION_USER2, 0 )   /* unused ROMs */
4131   ROM_LOAD( "c09-16.rom", 0x00000, 0x10000, CRC(7245a6f6) SHA1(5bdde4e3bcde8c59dc84478c3cc079d7ef8ee9c5) )
4132   ROM_LOAD( "c09-20.rom", 0x00000, 0x00100, CRC(cd8ffd80) SHA1(133bcd291a3751bce5293cb6b685f87258e8db19) )   // road/sprite priority and palette select
4133   ROM_LOAD( "c09-23.rom", 0x00000, 0x00100, CRC(fbf81f30) SHA1(c868452c334792345dcced075f6df69cff9e31ca) )   // road A/B internal priority
4134//  ROM_LOAD( "c09-21.rom", 0x00000, 0x00???, NO_DUMP ) /* pals (Guru dump) */
4135//  ROM_LOAD( "c09-22.rom", 0x00000, 0x00???, NO_DUMP )
4136//  ROM_LOAD( "c09-24.rom", 0x00000, 0x00???, NO_DUMP )
4137//  ROM_LOAD( "c09-25.rom", 0x00000, 0x00???, NO_DUMP )
4138//  ROM_LOAD( "c09-26.rom", 0x00000, 0x00???, NO_DUMP )
3738   ROM_LOAD( "c09-16.17", 0x00000, 0x10000, CRC(7245a6f6) SHA1(5bdde4e3bcde8c59dc84478c3cc079d7ef8ee9c5) )
3739   ROM_LOAD( "c09-20.71", 0x00000, 0x00100, CRC(cd8ffd80) SHA1(133bcd291a3751bce5293cb6b685f87258e8db19) )   // road/sprite priority and palette select
3740   ROM_LOAD( "c09-23.14", 0x00000, 0x00100, CRC(fbf81f30) SHA1(c868452c334792345dcced075f6df69cff9e31ca) )   // road A/B internal priority
3741//  ROM_LOAD( "c09-21.2",  0x00000, 0x00???, NO_DUMP ) /* pals (Guru dump) */
3742//  ROM_LOAD( "c09-22.3",  0x00000, 0x00???, NO_DUMP )
3743//  ROM_LOAD( "c09-24.22", 0x00000, 0x00???, NO_DUMP )
3744//  ROM_LOAD( "c09-25.25", 0x00000, 0x00???, NO_DUMP )
3745//  ROM_LOAD( "c09-26.26", 0x00000, 0x00???, NO_DUMP )
41393746ROM_END
41403747
41413748ROM_START( scia )
41423749   ROM_REGION( 0x80000, REGION_CPU1, 0 )   /* 512K for 68000 code (CPU A) */
4143   ROM_LOAD16_BYTE( "c09-28.bin",  0x00000, 0x20000, CRC(630dbaad) SHA1(090f6a97007ac04f64d92ae5823b7254152144af) )
4144   ROM_LOAD16_BYTE( "c09-30.bin",  0x00001, 0x20000, CRC(68b1a97d) SHA1(c377f7880154b38fe25dc0ec420ca0cd7228fbad) )
4145   ROM_LOAD16_BYTE( "c09-36.bin",  0x40000, 0x20000, CRC(59e47cba) SHA1(313302bc62ff02b437b1091d394d2010ce66c7e7) )
4146   ROM_LOAD16_BYTE( "c09-31.bin",  0x40001, 0x20000, CRC(962b1fbf) SHA1(62181a289dfc6d1da674ba4bcbefeb16a67a55e3) )
3750   ROM_LOAD16_BYTE( "c09-28.43",  0x00000, 0x20000, CRC(630dbaad) SHA1(090f6a97007ac04f64d92ae5823b7254152144af) )
3751   ROM_LOAD16_BYTE( "c09-30.40",  0x00001, 0x20000, CRC(68b1a97d) SHA1(c377f7880154b38fe25dc0ec420ca0cd7228fbad) )
3752   ROM_LOAD16_BYTE( "c09-36.38",  0x40000, 0x20000, CRC(59e47cba) SHA1(313302bc62ff02b437b1091d394d2010ce66c7e7) )
3753   ROM_LOAD16_BYTE( "c09-31.41",  0x40001, 0x20000, CRC(962b1fbf) SHA1(62181a289dfc6d1da674ba4bcbefeb16a67a55e3) )
41473754
41483755   ROM_REGION( 0x20000, REGION_CPU3, 0 )   /* 128K for 68000 code (CPU B) */
4149   ROM_LOAD16_BYTE( "c09-33.rom", 0x00000, 0x10000, CRC(cf4e6c5b) SHA1(8d6720b605b8e0c7f0473ba452c79bf5efc2615d) )
4150   ROM_LOAD16_BYTE( "c09-32.rom", 0x00001, 0x10000, CRC(a4713719) SHA1(b1110e397d3407ec63975cdd92a23cbb16348200) )
3756   ROM_LOAD16_BYTE( "c09-33.6", 0x00000, 0x10000, CRC(cf4e6c5b) SHA1(8d6720b605b8e0c7f0473ba452c79bf5efc2615d) ) /* Actual label is "C09 33*" */
3757   ROM_LOAD16_BYTE( "c09-32.5", 0x00001, 0x10000, CRC(a4713719) SHA1(b1110e397d3407ec63975cdd92a23cbb16348200) ) /* Actual label is "C09 32*" */
41513758
41523759   ROM_REGION( 0x2c000, REGION_CPU2, 0 )   /* Z80 sound cpu */
4153   ROM_LOAD( "c09-34.rom",   0x00000, 0x04000, CRC(a21b3151) SHA1(f59c7b1ba5edf97d72670ee194ce9fdc5c5b9a58) )
4154   ROM_CONTINUE(             0x10000, 0x1c000 )   /* banked stuff */
3760   ROM_LOAD( "c09-34.31",   0x00000, 0x04000, CRC(a21b3151) SHA1(f59c7b1ba5edf97d72670ee194ce9fdc5c5b9a58) )
3761   ROM_CONTINUE(            0x10000, 0x1c000 )   /* banked stuff */
41553762
41563763   ROM_REGION( 0x80000, REGION_GFX1, ROMREGION_DISPOSE )
4157   ROM_LOAD( "c09-05.rom", 0x00000, 0x80000, CRC(890b38f0) SHA1(b478c96214ce027926346a4653250c8ee8a98bdc) )   /* SCR 8x8 */
3764   ROM_LOAD( "c09-05.16", 0x00000, 0x80000, CRC(890b38f0) SHA1(b478c96214ce027926346a4653250c8ee8a98bdc) )   /* SCR 8x8 */
41583765
41593766   ROM_REGION( 0x200000, REGION_GFX2, ROMREGION_DISPOSE )
4160   ROM_LOAD32_BYTE( "c09-04.rom", 0x000000, 0x080000, CRC(2cbb3c9b) SHA1(9e3d95f76f5f5d385b6a9516af781aefef1eb0ca) )   /* OBJ 16x8 */
4161   ROM_LOAD32_BYTE( "c09-02.rom", 0x000001, 0x080000, CRC(a83a0389) SHA1(932788b5b5f01326d0fbb2b9fdb94a8c7c004db3) )
4162   ROM_LOAD32_BYTE( "c09-03.rom", 0x000002, 0x080000, CRC(a31d0e80) SHA1(dfeff1b89dd7b3f19b26e77f2d66f6448cb00553) )
4163   ROM_LOAD32_BYTE( "c09-01.rom", 0x000003, 0x080000, CRC(64bfea10) SHA1(15ea43092027b1717d0f24fbe6ac2cdf11a7ddc6) )
3767   ROM_LOAD32_BYTE( "c09-04.52", 0x000000, 0x080000, CRC(2cbb3c9b) SHA1(9e3d95f76f5f5d385b6a9516af781aefef1eb0ca) )   /* OBJ 16x8 */
3768   ROM_LOAD32_BYTE( "c09-02.53", 0x000001, 0x080000, CRC(a83a0389) SHA1(932788b5b5f01326d0fbb2b9fdb94a8c7c004db3) )
3769   ROM_LOAD32_BYTE( "c09-03.54", 0x000002, 0x080000, CRC(a31d0e80) SHA1(dfeff1b89dd7b3f19b26e77f2d66f6448cb00553) )
3770   ROM_LOAD32_BYTE( "c09-01.55", 0x000003, 0x080000, CRC(64bfea10) SHA1(15ea43092027b1717d0f24fbe6ac2cdf11a7ddc6) )
41643771
41653772   ROM_REGION( 0x80000, REGION_GFX3, 0 )   /* don't dispose */
4166   ROM_LOAD( "c09-07.rom", 0x00000, 0x80000, CRC(963bc82b) SHA1(e3558aecd1b82ddbf10ab2b71843a3664705f1f1) )   /* ROD, road lines */
3773   ROM_LOAD( "c09-07.15", 0x00000, 0x80000, CRC(963bc82b) SHA1(e3558aecd1b82ddbf10ab2b71843a3664705f1f1) )   /* ROD, road lines */
41673774
41683775   ROM_REGION16_LE( 0x80000, REGION_USER1, 0 )
4169   ROM_LOAD16_WORD( "c09-06.rom", 0x00000, 0x80000, CRC(12df6d7b) SHA1(8ce742eb3f7eb6283b5ca32bb520d1cc7684d515) )   /* STY spritemap */
3776   ROM_LOAD16_WORD( "c09-06.37", 0x00000, 0x80000, CRC(12df6d7b) SHA1(8ce742eb3f7eb6283b5ca32bb520d1cc7684d515) )   /* STY spritemap */
41703777
41713778   ROM_REGION( 0x180000, REGION_SOUND1, 0 )   /* ADPCM samples */
4172   ROM_LOAD( "c09-14.rom", 0x000000, 0x080000, CRC(ad78bf46) SHA1(4020744bbdc4b9ec3dee1a9d7b5ffa8def43d7b2) )
4173   ROM_LOAD( "c09-13.rom", 0x080000, 0x080000, CRC(d57c41d3) SHA1(3375a1fc6389840544b9fdb96b2fafbc8e3276e2) )
4174   ROM_LOAD( "c09-12.rom", 0x100000, 0x080000, CRC(56c99fa5) SHA1(3f9a6bc89d847cc4c99d35f98157ea3f187c0f98) )
3779   ROM_LOAD( "c09-14.42", 0x000000, 0x080000, CRC(ad78bf46) SHA1(4020744bbdc4b9ec3dee1a9d7b5ffa8def43d7b2) )
3780   ROM_LOAD( "c09-13.43", 0x080000, 0x080000, CRC(d57c41d3) SHA1(3375a1fc6389840544b9fdb96b2fafbc8e3276e2) )
3781   ROM_LOAD( "c09-12.44", 0x100000, 0x080000, CRC(56c99fa5) SHA1(3f9a6bc89d847cc4c99d35f98157ea3f187c0f98) )
41753782
41763783   ROM_REGION( 0x80000, REGION_SOUND2, 0 )   /* Delta-T samples */
4177   ROM_LOAD( "c09-15.rom", 0x00000, 0x80000, CRC(e63b9095) SHA1(c6ea670b5a90ab39429259ec1fefb2bde5d0213f) )
3784   ROM_LOAD( "c09-15.29", 0x00000, 0x80000, CRC(e63b9095) SHA1(c6ea670b5a90ab39429259ec1fefb2bde5d0213f) )
41783785
41793786   ROM_REGION( 0x10000, REGION_USER2, 0 )   /* unused ROMs */
4180   ROM_LOAD( "c09-16.rom", 0x00000, 0x10000, CRC(7245a6f6) SHA1(5bdde4e3bcde8c59dc84478c3cc079d7ef8ee9c5) )
4181   ROM_LOAD( "c09-20.rom", 0x00000, 0x00100, CRC(cd8ffd80) SHA1(133bcd291a3751bce5293cb6b685f87258e8db19) )   // road/sprite priority and palette select
4182   ROM_LOAD( "c09-23.rom", 0x00000, 0x00100, CRC(fbf81f30) SHA1(c868452c334792345dcced075f6df69cff9e31ca) )   // road A/B internal priority
3787   ROM_LOAD( "c09-16.17", 0x00000, 0x10000, CRC(7245a6f6) SHA1(5bdde4e3bcde8c59dc84478c3cc079d7ef8ee9c5) )
3788   ROM_LOAD( "c09-20.71", 0x00000, 0x00100, CRC(cd8ffd80) SHA1(133bcd291a3751bce5293cb6b685f87258e8db19) )   // road/sprite priority and palette select
3789   ROM_LOAD( "c09-23.14", 0x00000, 0x00100, CRC(fbf81f30) SHA1(c868452c334792345dcced075f6df69cff9e31ca) )   // road A/B internal priority
41833790ROM_END
41843791
3792ROM_START( scij )
3793   ROM_REGION( 0x80000, REGION_CPU1, 0 )   /* 512K for 68000 code (CPU A) */
3794   ROM_LOAD16_BYTE( "c09-37.43", 0x00000, 0x20000, CRC(0fecea17) SHA1(0ad4454eee6646b0f978b1ba83206d64c1f6d081) )
3795   ROM_LOAD16_BYTE( "c09-38.40", 0x00001, 0x20000, CRC(e46ebd9b) SHA1(52b0c1f95e8a664076d8fbc0f6204ca55893e281) )
3796   ROM_LOAD16_BYTE( "c09-40.38", 0x40000, 0x20000, CRC(1a4e2eab) SHA1(7c95ba516d164b7b4e6eaf80e3dacf7c35d8123d) )
3797   ROM_LOAD16_BYTE( "c09-39.41", 0x40001, 0x20000, CRC(de87bcb9) SHA1(b5537a25871ea90294f3b6f0b6386a883cfdf991) )
3798
3799   ROM_REGION( 0x20000, REGION_CPU3, 0 )   /* 128K for 68000 code (CPU B) */
3800   ROM_LOAD16_BYTE( "c09-33.6", 0x00000, 0x10000, CRC(cf4e6c5b) SHA1(8d6720b605b8e0c7f0473ba452c79bf5efc2615d) ) /* Actual label is "C09 33*" */
3801   ROM_LOAD16_BYTE( "c09-32.5", 0x00001, 0x10000, CRC(a4713719) SHA1(b1110e397d3407ec63975cdd92a23cbb16348200) ) /* Actual label is "C09 32*" */
3802
3803   ROM_REGION( 0x2c000, REGION_CPU2, 0 )   /* Z80 sound cpu */
3804   ROM_LOAD( "c09-27.31",   0x00000, 0x04000, CRC(cd161dca) SHA1(2e0632f290f8efae5e479c67ca8808a90e0f4afd) )
3805   ROM_CONTINUE(            0x10000, 0x1c000 )   /* banked stuff */
3806
3807   ROM_REGION( 0x80000, REGION_GFX1, ROMREGION_DISPOSE )
3808   ROM_LOAD( "c09-05.16", 0x00000, 0x80000, CRC(890b38f0) SHA1(b478c96214ce027926346a4653250c8ee8a98bdc) )   /* SCR 8x8 */
3809
3810   ROM_REGION( 0x200000, REGION_GFX2, ROMREGION_DISPOSE )
3811   ROM_LOAD32_BYTE( "c09-04.52", 0x000000, 0x080000, CRC(2cbb3c9b) SHA1(9e3d95f76f5f5d385b6a9516af781aefef1eb0ca) )   /* OBJ 16x8 */
3812   ROM_LOAD32_BYTE( "c09-02.53", 0x000001, 0x080000, CRC(a83a0389) SHA1(932788b5b5f01326d0fbb2b9fdb94a8c7c004db3) )
3813   ROM_LOAD32_BYTE( "c09-03.54", 0x000002, 0x080000, CRC(a31d0e80) SHA1(dfeff1b89dd7b3f19b26e77f2d66f6448cb00553) )
3814   ROM_LOAD32_BYTE( "c09-01.55", 0x000003, 0x080000, CRC(64bfea10) SHA1(15ea43092027b1717d0f24fbe6ac2cdf11a7ddc6) )
3815
3816   ROM_REGION( 0x80000, REGION_GFX3, 0 )   /* don't dispose */
3817   ROM_LOAD( "c09-07.15", 0x00000, 0x80000, CRC(963bc82b) SHA1(e3558aecd1b82ddbf10ab2b71843a3664705f1f1) )   /* ROD, road lines */
3818
3819   ROM_REGION16_LE( 0x80000, REGION_USER1, 0 )
3820   ROM_LOAD16_WORD( "c09-06.37", 0x00000, 0x80000, CRC(12df6d7b) SHA1(8ce742eb3f7eb6283b5ca32bb520d1cc7684d515) )   /* STY spritemap */
3821
3822   ROM_REGION( 0x180000, REGION_SOUND1, 0 )   /* ADPCM samples */
3823   ROM_LOAD( "c09-10.42", 0x000000, 0x080000, CRC(ad78bf46) SHA1(4020744bbdc4b9ec3dee1a9d7b5ffa8def43d7b2) )
3824   ROM_LOAD( "c09-09.43", 0x080000, 0x080000, CRC(6a655c00) SHA1(5ae1ee422226e386550b69a1f35668c10d3bdcc2) )
3825   ROM_LOAD( "c09-08.44", 0x100000, 0x080000, CRC(7ddfc316) SHA1(47f0ed8eecd4719b4c5cb8762ee6b8bb01686812) )
3826
3827   ROM_REGION( 0x80000, REGION_SOUND2, 0 )   /* Delta-T samples */
3828   ROM_LOAD( "c09-11.29", 0x00000, 0x80000, CRC(6b1a11e1) SHA1(4304d029ecf91fa5b779057f195f75ebdd0a7c1c) )
3829
3830   ROM_REGION( 0x10000, REGION_USER2, 0 )   /* unused ROMs */
3831   ROM_LOAD( "c09-16.17", 0x00000, 0x10000, CRC(7245a6f6) SHA1(5bdde4e3bcde8c59dc84478c3cc079d7ef8ee9c5) )
3832   ROM_LOAD( "c09-20.71", 0x00000, 0x00100, CRC(cd8ffd80) SHA1(133bcd291a3751bce5293cb6b685f87258e8db19) )   // road/sprite priority and palette select
3833   ROM_LOAD( "c09-23.14", 0x00000, 0x00100, CRC(fbf81f30) SHA1(c868452c334792345dcced075f6df69cff9e31ca) )   // road A/B internal priority
3834ROM_END
3835
41853836ROM_START( sciu )
41863837   ROM_REGION( 0x80000, REGION_CPU1, 0 )   /* 512K for 68000 code (CPU A) */
4187   ROM_LOAD16_BYTE( "c09-43.37",  0x00000, 0x20000, CRC(20a9343e) SHA1(b0185ddbda827236b7b41687f18c92e10c2dbd3a) )
3838   ROM_LOAD16_BYTE( "c09-43.43",  0x00000, 0x20000, CRC(20a9343e) SHA1(b0185ddbda827236b7b41687f18c92e10c2dbd3a) )
41883839   ROM_LOAD16_BYTE( "c09-44.40",  0x00001, 0x20000, CRC(7524338a) SHA1(f4e68a4d09f843f4697b4b4a4e94b5759a14fd01) )
41893840   ROM_LOAD16_BYTE( "c09-41.38",  0x40000, 0x20000, CRC(83477f11) SHA1(f6dba2137a182dae215cf212bf85f4528e3d006d) )
4190   ROM_LOAD16_BYTE( "c09-41.rom", 0x40001, 0x20000, CRC(de87bcb9) SHA1(b5537a25871ea90294f3b6f0b6386a883cfdf991) )
3841   ROM_LOAD16_BYTE( "c09-39.41", 0x40001, 0x20000, CRC(de87bcb9) SHA1(b5537a25871ea90294f3b6f0b6386a883cfdf991) )
41913842
41923843   ROM_REGION( 0x20000, REGION_CPU3, 0 )   /* 128K for 68000 code (CPU B) */
4193   ROM_LOAD16_BYTE( "c09-33.rom", 0x00000, 0x10000, CRC(cf4e6c5b) SHA1(8d6720b605b8e0c7f0473ba452c79bf5efc2615d) )
4194   ROM_LOAD16_BYTE( "c09-32.rom", 0x00001, 0x10000, CRC(a4713719) SHA1(b1110e397d3407ec63975cdd92a23cbb16348200) )
3844   ROM_LOAD16_BYTE( "c09-33.6", 0x00000, 0x10000, CRC(cf4e6c5b) SHA1(8d6720b605b8e0c7f0473ba452c79bf5efc2615d) ) /* Actual label is "C09 33*" */
3845   ROM_LOAD16_BYTE( "c09-32.5", 0x00001, 0x10000, CRC(a4713719) SHA1(b1110e397d3407ec63975cdd92a23cbb16348200) ) /* Actual label is "C09 32*" */
41953846
41963847   ROM_REGION( 0x2c000, REGION_CPU2, 0 )   /* Z80 sound cpu */
4197   ROM_LOAD( "c09-34.rom",   0x00000, 0x04000, CRC(a21b3151) SHA1(f59c7b1ba5edf97d72670ee194ce9fdc5c5b9a58) )
4198   ROM_CONTINUE(             0x10000, 0x1c000 )   /* banked stuff */
3848   ROM_LOAD( "c09-34.31",   0x00000, 0x04000, CRC(a21b3151) SHA1(f59c7b1ba5edf97d72670ee194ce9fdc5c5b9a58) )
3849   ROM_CONTINUE(            0x10000, 0x1c000 )   /* banked stuff */
41993850
42003851   ROM_REGION( 0x80000, REGION_GFX1, ROMREGION_DISPOSE )
4201   ROM_LOAD( "c09-05.rom", 0x00000, 0x80000, CRC(890b38f0) SHA1(b478c96214ce027926346a4653250c8ee8a98bdc) )   /* SCR 8x8 */
3852   ROM_LOAD( "c09-05.16", 0x00000, 0x80000, CRC(890b38f0) SHA1(b478c96214ce027926346a4653250c8ee8a98bdc) )   /* SCR 8x8 */
42023853
42033854   ROM_REGION( 0x200000, REGION_GFX2, ROMREGION_DISPOSE )
4204   ROM_LOAD32_BYTE( "c09-04.rom", 0x000000, 0x080000, CRC(2cbb3c9b) SHA1(9e3d95f76f5f5d385b6a9516af781aefef1eb0ca) )   /* OBJ 16x8 */
4205   ROM_LOAD32_BYTE( "c09-02.rom", 0x000001, 0x080000, CRC(a83a0389) SHA1(932788b5b5f01326d0fbb2b9fdb94a8c7c004db3) )
4206   ROM_LOAD32_BYTE( "c09-03.rom", 0x000002, 0x080000, CRC(a31d0e80) SHA1(dfeff1b89dd7b3f19b26e77f2d66f6448cb00553) )
4207   ROM_LOAD32_BYTE( "c09-01.rom", 0x000003, 0x080000, CRC(64bfea10) SHA1(15ea43092027b1717d0f24fbe6ac2cdf11a7ddc6) )
3855   ROM_LOAD32_BYTE( "c09-04.52", 0x000000, 0x080000, CRC(2cbb3c9b) SHA1(9e3d95f76f5f5d385b6a9516af781aefef1eb0ca) )   /* OBJ 16x8 */
3856   ROM_LOAD32_BYTE( "c09-02.53", 0x000001, 0x080000, CRC(a83a0389) SHA1(932788b5b5f01326d0fbb2b9fdb94a8c7c004db3) )
3857   ROM_LOAD32_BYTE( "c09-03.54", 0x000002, 0x080000, CRC(a31d0e80) SHA1(dfeff1b89dd7b3f19b26e77f2d66f6448cb00553) )
3858   ROM_LOAD32_BYTE( "c09-01.55", 0x000003, 0x080000, CRC(64bfea10) SHA1(15ea43092027b1717d0f24fbe6ac2cdf11a7ddc6) )
42083859
42093860   ROM_REGION( 0x80000, REGION_GFX3, 0 )   /* don't dispose */
4210   ROM_LOAD( "c09-07.rom", 0x00000, 0x80000, CRC(963bc82b) SHA1(e3558aecd1b82ddbf10ab2b71843a3664705f1f1) )   /* ROD, road lines */
3861   ROM_LOAD( "c09-07.15", 0x00000, 0x80000, CRC(963bc82b) SHA1(e3558aecd1b82ddbf10ab2b71843a3664705f1f1) )   /* ROD, road lines */
42113862
42123863   ROM_REGION16_LE( 0x80000, REGION_USER1, 0 )
4213   ROM_LOAD16_WORD( "c09-06.rom", 0x00000, 0x80000, CRC(12df6d7b) SHA1(8ce742eb3f7eb6283b5ca32bb520d1cc7684d515) )   /* STY spritemap */
3864   ROM_LOAD16_WORD( "c09-06.37", 0x00000, 0x80000, CRC(12df6d7b) SHA1(8ce742eb3f7eb6283b5ca32bb520d1cc7684d515) )   /* STY spritemap */
42143865
42153866   ROM_REGION( 0x180000, REGION_SOUND1, 0 )   /* ADPCM samples */
4216   ROM_LOAD( "c09-14.rom", 0x000000, 0x080000, CRC(ad78bf46) SHA1(4020744bbdc4b9ec3dee1a9d7b5ffa8def43d7b2) )
4217   ROM_LOAD( "c09-13.rom", 0x080000, 0x080000, CRC(d57c41d3) SHA1(3375a1fc6389840544b9fdb96b2fafbc8e3276e2) )
4218   ROM_LOAD( "c09-12.rom", 0x100000, 0x080000, CRC(56c99fa5) SHA1(3f9a6bc89d847cc4c99d35f98157ea3f187c0f98) )
3867   ROM_LOAD( "c09-14.42", 0x000000, 0x080000, CRC(ad78bf46) SHA1(4020744bbdc4b9ec3dee1a9d7b5ffa8def43d7b2) )
3868   ROM_LOAD( "c09-13.43", 0x080000, 0x080000, CRC(d57c41d3) SHA1(3375a1fc6389840544b9fdb96b2fafbc8e3276e2) )
3869   ROM_LOAD( "c09-12.44", 0x100000, 0x080000, CRC(56c99fa5) SHA1(3f9a6bc89d847cc4c99d35f98157ea3f187c0f98) )
42193870
42203871   ROM_REGION( 0x80000, REGION_SOUND2, 0 )   /* Delta-T samples */
4221   ROM_LOAD( "c09-15.rom", 0x00000, 0x80000, CRC(e63b9095) SHA1(c6ea670b5a90ab39429259ec1fefb2bde5d0213f) )
3872   ROM_LOAD( "c09-15.29", 0x00000, 0x80000, CRC(e63b9095) SHA1(c6ea670b5a90ab39429259ec1fefb2bde5d0213f) )
42223873
42233874   ROM_REGION( 0x10000, REGION_USER2, 0 )   /* unused ROMs */
4224   ROM_LOAD( "c09-16.rom", 0x00000, 0x10000, CRC(7245a6f6) SHA1(5bdde4e3bcde8c59dc84478c3cc079d7ef8ee9c5) )
4225   ROM_LOAD( "c09-20.rom", 0x00000, 0x00100, CRC(cd8ffd80) SHA1(133bcd291a3751bce5293cb6b685f87258e8db19) )   // road/sprite priority and palette select
4226   ROM_LOAD( "c09-23.rom", 0x00000, 0x00100, CRC(fbf81f30) SHA1(c868452c334792345dcced075f6df69cff9e31ca) )   // road A/B internal priority
3875   ROM_LOAD( "c09-16.17", 0x00000, 0x10000, CRC(7245a6f6) SHA1(5bdde4e3bcde8c59dc84478c3cc079d7ef8ee9c5) )
3876   ROM_LOAD( "c09-20.71", 0x00000, 0x00100, CRC(cd8ffd80) SHA1(133bcd291a3751bce5293cb6b685f87258e8db19) )   // road/sprite priority and palette select
3877   ROM_LOAD( "c09-23.14", 0x00000, 0x00100, CRC(fbf81f30) SHA1(c868452c334792345dcced075f6df69cff9e31ca) )   // road A/B internal priority
42273878ROM_END
42283879
42293880ROM_START( nightstr )
r1037r1038
45694220GAME( 1989, bsharkj,  bshark,   bshark,   bsharkj,  bshark,   ORIENTATION_FLIP_X, "Taito Corporation", "Battle Shark (Japan)", GAME_IMPERFECT_GRAPHICS )
45704221GAME( 1989, sci,      0,        sci,      sci,      taitoz,   ROT0,               "Taito Corporation Japan", "Special Criminal Investigation (World set 1)", GAME_IMPERFECT_GRAPHICS )
45714222GAME( 1989, scia,     sci,      sci,      sci,      taitoz,   ROT0,               "Taito Corporation Japan", "Special Criminal Investigation (World set 2)", GAME_IMPERFECT_GRAPHICS )
4223GAME( 1989, scij,     sci,      sci,      scij,     taitoz,   ROT0,               "Taito Corporation", "Special Criminal Investigation (Japan)", GAME_IMPERFECT_GRAPHICS )
45724224GAME( 1989, sciu,     sci,      sci,      sciu,     taitoz,   ROT0,               "Taito America Corporation", "Special Criminal Investigation (US)", GAME_IMPERFECT_GRAPHICS )
45734225GAME( 1989, nightstr, 0,        nightstr, nightstr, taitoz,   ROT0,               "Taito America Corporation", "Night Striker (US)", GAME_IMPERFECT_GRAPHICS )
45744226GAME( 1990, aquajack, 0,        aquajack, aquajack, taitoz,   ROT0,               "Taito Corporation Japan", "Aqua Jack (World)", GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/lockon.c
r1037r1038
413413}
414414
415415
416#ifdef UNUSED_FUNCTION
416417/* Allow /CUDISP to interrupt main CPU */
417418static WRITE8_HANDLER(sound_atten)
418419{
419420       mame_printf_debug("%x\n",data);
420421}
422#endif
421423
422424/* Allow /CUDISP to interrupt main CPU */
423425static WRITE16_HANDLER(inten_w)
src/mame/drivers/namcoic.c
r1037r1038
740740   xscroll = (INT16)mSpritePos[1];
741741   yscroll = (INT16)mSpritePos[0];
742742
743   xscroll &= 0x1ff; if( xscroll & 0x100 ) xscroll |= ~0x1ff;
743   xscroll &= 0x3ff; if( xscroll & 0x200 ) xscroll |= ~0x3ff;
744744   yscroll &= 0x1ff; if( yscroll & 0x100 ) yscroll |= ~0x1ff;
745745
746746   if( bitmap->width > 384 )
747747   { /* Medium Resolution: System21 adjust */
748         if( yscroll<0 )
749         { /* solvalou */
750            yscroll += 0x20;
751         }
748752         yscroll += 0x10;
749753   }
750754   else
src/mame/drivers/segas16a.c
r1037r1038
1919SDI            (C) Sega 1987
2020Shinobi        (C) Sega 1987
2121Tetris         (C) Sega 1988
22Passing Shot   (C) Sega 1988
2223
2324PCB Layout
2425----------
r1037r1038
679680   return standard_io_r(offset, mem_mask);
680681}
681682
683/*************************************
684 *
685 *  Passing Shot custom I/O
686 *
687 *************************************/
682688
689static READ16_HANDLER( pshot16a_custom_io_r )
690{
691   static int read_port = 0;
683692
693   switch (offset & (0x3000/2))
694   {
695      case 0x1000/2:
696         switch (offset & 3)
697         {
698            case 0:
699               read_port = 0;
700               break;
701
702            case 1:
703               switch ((read_port++)&3)
704               {
705                  case 0: return readinputportbytag("P1");
706                  case 1: return readinputportbytag("P2");
707                  case 2: return readinputportbytag("P3");
708                  case 3: return readinputportbytag("P4");
709               }
710
711               break;
712         }
713         break;
714   }
715   return standard_io_r(offset, mem_mask);
716}
717
684718/*************************************
685719 *
686720 *  SDI custom I/O
r1037r1038
12801314INPUT_PORTS_END
12811315
12821316
1317static INPUT_PORTS_START( pshot16a )
1318   PORT_INCLUDE( system16a_generic )
1319
1320   PORT_MODIFY("SERVICE")
1321   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START3 )
1322   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START4 )
1323
1324   PORT_MODIFY("P1")
1325   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1326   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1327   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1328   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1329   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
1330   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
1331   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
1332   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 )
1333
1334   PORT_MODIFY("P2")
1335   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1336   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1337   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1338   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1339   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1340   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1341   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1342   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
1343
1344   PORT_START_TAG("P3")
1345   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
1346   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
1347   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
1348   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
1349   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
1350   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
1351   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
1352   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(3)
1353
1354   PORT_START_TAG("P4")
1355   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4)
1356   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4)
1357   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
1358   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
1359   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
1360   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
1361   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4)
1362   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4)
1363
1364   PORT_MODIFY("DSW")
1365   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:1")
1366   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1367   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1368   PORT_DIPNAME( 0x0e, 0x00, "Initial Point" ) PORT_DIPLOCATION("SWB:2,3,4")
1369   PORT_DIPSETTING(    0x06, "2000" )
1370   PORT_DIPSETTING(    0x0a, "3000" )
1371   PORT_DIPSETTING(    0x0c, "4000" )
1372   PORT_DIPSETTING(    0x0e, "5000" )
1373   PORT_DIPSETTING(    0x08, "6000" )
1374   PORT_DIPSETTING(    0x04, "7000" )
1375   PORT_DIPSETTING(    0x02, "8000" )
1376   PORT_DIPSETTING(    0x00, "9000" )
1377   PORT_DIPNAME( 0x30, 0x30, "Point Table" ) PORT_DIPLOCATION("SWB:5,6")
1378   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
1379   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
1380   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
1381   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1382   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:7,8")
1383   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
1384   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
1385   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
1386   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1387INPUT_PORTS_END
1388
1389
12831390static INPUT_PORTS_START( quartet )
12841391   PORT_INCLUDE( system16a_generic )
12851392
r1037r1038
22212328/**************************************************************************************************************************
22222329 **************************************************************************************************************************
22232330 **************************************************************************************************************************
2331    Passing Shot (Japan, 4 Players), Sega System 16A
2332    CPU: FD1094 (317-0071)
2333 */
2334
2335ROM_START( pshot16a )
2336   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
2337   ROM_LOAD16_BYTE( "epr11833.43", 0x000000, 0x10000, CRC(5eb1405c) SHA1(0a68d3fcc074475d38f999c93082d4a9dff0f19a) )
2338   ROM_LOAD16_BYTE( "epr11832.26", 0x000001, 0x10000, CRC(718a3fe4) SHA1(bd6844c53ce3b64b113795360175df92d095b467) )
2339
2340   ROM_REGION( 0x2000, REGION_USER1, 0 )   /* decryption key */
2341   ROM_LOAD( "317-0071.key", 0x0000, 0x2000, CRC(c69949ec) SHA1(1c63f42404ee1d8333e734e892b1c4cac0cb440e) )
2342
2343   ROM_REGION( 0x30000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
2344   ROM_LOAD( "epr11834.95", 0x00000, 0x10000, CRC(df4e18ab) SHA1(ac9b424eded18f128e6cc743bbddf9afd869c8c4) )
2345   ROM_LOAD( "epr11835.94", 0x10000, 0x10000, CRC(6a07acc0) SHA1(218071612ee6fa89b16a47a77325a962ba38926d) )
2346   ROM_LOAD( "epr11836.93", 0x20000, 0x10000, CRC(93c74928) SHA1(43ea7855d5d4dcc4921b3a7b814acc75c5cfde15) )
2347
2348   ROM_REGION16_BE( 0x080000, REGION_GFX2, 0 ) /* sprites */
2349   ROM_LOAD16_BYTE( "epr11842.10", 0x00001, 0x08000, CRC(b6e94727) SHA1(0838e034f1f10d9cd1312c8c94b5c57387c0c271) )
2350   ROM_CONTINUE(                   0x40001, 0x08000 )
2351   ROM_LOAD16_BYTE( "epr11845.11", 0x00000, 0x08000, CRC(17e8d5d5) SHA1(ac1074b0a705be13c6e3391441e6cfec1d2b3f8a) )
2352   ROM_CONTINUE(                   0x40000, 0x08000 )
2353   ROM_LOAD16_BYTE( "epr11843.17", 0x10001, 0x08000, CRC(3e670098) SHA1(2cfc83f4294be30cd868738886ac546bd8489962) )
2354   ROM_CONTINUE(                   0x50001, 0x08000 )
2355   ROM_LOAD16_BYTE( "epr11846.18", 0x10000, 0x08000, CRC(50eb71cc) SHA1(463b4917ca19c7f4ad2c2845caa104d5e4a2dda3) )
2356   ROM_CONTINUE(                   0x50000, 0x08000 )
2357   ROM_LOAD16_BYTE( "epr11844.23", 0x20001, 0x08000, CRC(05733ca8) SHA1(1dbc7c99450ebe6a9fd8c0244fd3cb38b74984ef) )
2358   ROM_CONTINUE(                   0x60001, 0x08000 )
2359   ROM_LOAD16_BYTE( "epr11847.24", 0x20000, 0x08000, CRC(81e49697) SHA1(a70fa409e3555ad6c8f28930a7026fdf2deb8c65) )
2360   ROM_CONTINUE(                   0x60000, 0x08000 )
2361
2362   ROM_REGION( 0x20000, REGION_CPU2, 0 ) /* sound CPU */
2363   ROM_LOAD( "epr11837.12", 0x0000, 0x8000, CRC(74d11552) SHA1(5a0f0c3fb858ed2bad8002fce4e29d730f102bcd) )
2364
2365   ROM_REGION( 0x1000, REGION_CPU3, 0 )      /* 4k for 7751 onboard ROM */
2366   ROM_LOAD( "7751.bin",     0x0000, 0x0400, CRC(6a9534fc) SHA1(67ad94674db5c2aab75785668f610f6f4eccd158) ) /* 7751 - U34 */
2367
2368   ROM_REGION( 0x20000, REGION_SOUND1, 0 ) /* 7751 sound data */
2369   ROM_LOAD( "epr11838.1", 0x00000, 0x8000, CRC(a465cd69) SHA1(25da3809824fb3df1f93bbfa88355a7c50e44211) )
2370   ROM_LOAD( "epr11839.2", 0x08000, 0x8000, CRC(99de6197) SHA1(f7de6a34fa185754c12276a94b1513234d352f3f) )
2371   ROM_LOAD( "epr11840.4", 0x10000, 0x8000, CRC(9854e8b3) SHA1(bc9d8a17ff96cf03f9a955223c11d9f1fb0309c5) )
2372   ROM_LOAD( "epr11841.5", 0x18000, 0x8000, CRC(1e89877e) SHA1(bbceb4f3cafae40d1e256f4336d3ee0bcdf8d077) )
2373ROM_END
2374
2375
2376/**************************************************************************************************************************
2377 **************************************************************************************************************************
2378 **************************************************************************************************************************
22242379    Quartet, pre-System 16
22252380    CPU: 68000
22262381    i8751 315-5194
r1037r1038
28713026   custom_io_r = mjleague_custom_io_r;
28723027}
28733028
3029static DRIVER_INIT( pshot16a )
3030{
3031   system16a_generic_init(machine);
3032   custom_io_r = pshot16a_custom_io_r;
3033}
28743034
28753035static DRIVER_INIT( quartet )
28763036{
r1037r1038
29313091GAME( 1986, alexkid1, alexkidd, system16a,        alexkidd, alexkid1,    ROT0,   "Sega",           "Alex Kidd: The Lost Stars (set 1, FD1089A 317-unknown)", 0 )
29323092GAME( 1986, fantzone, 0,        system16a_no7751, fantzone, generic_16a, ROT0,   "Sega",           "Fantasy Zone (set 2, unprotected)", 0 )
29333093GAME( 1986, fantzon1, fantzone, system16a_no7751, fantzone, generic_16a, ROT0,   "Sega",           "Fantasy Zone (set 1, unprotected)", 0 )
3094GAME( 1988, pshot16a, passsht,  system16a,        pshot16a, pshot16a,    ROT270, "Sega",           "Passing Shot (Japan, 4 Players, System 16A, FD1094 317-0071)", 0 )
29343095GAME( 1987, sdi,      0,        system16a_no7751, sdi,      sdi,         ROT0,   "Sega",           "SDI - Strategic Defense Initiative (Europe, System 16A, FD1089B 317-0027)", 0 )
29353096GAME( 1987, shinobi,  0,        system16a,        shinobi,  generic_16a, ROT0,   "Sega",           "Shinobi (set 5, System 16A, unprotected)", 0 )
29363097GAME( 1987, shinobi1, shinobi,  system16a,        shinobi,  generic_16a, ROT0,   "Sega",           "Shinobi (set 1, System 16A, FD1094 317-0050)", 0 )
src/mame/drivers/konamigx.c
r1037r1038
586586  memory_install_read32_handler \
587587  (0, ADDRESS_SPACE_PROGRAM, (BASE+START)&~3, (BASE+END)|3, 0, 0, waitskip_r);}
588588
589static int suspension_active, resume_trigger;
590#ifdef UNUSED_FUNCTION
589591static struct { UINT32 offs, pc, mask, data; } waitskip;
590static int suspension_active, resume_trigger;
591592
592593static READ32_HANDLER(waitskip_r)
593594{
r1037r1038
602603
603604   return(data);
604605}
606#endif
605607
606608
607609static READ32_HANDLER( ccu_r )
src/mame/drivers/stvinit.c
r1037r1038
620620   return stv_workram_h[0x0033762/4];
621621}
622622
623#ifdef UNUSED_FUNCTION
623624static READ32_HANDLER( bakubaku_hangskip_r )
624625{
625626   if (activecpu_get_pc()==0x060335e4) stv_workram_h[0x0335e6/4] = 0x32300909;
626627
627628   return stv_workram_h[0x033660/4];
628629}
630#endif
629631
630632DRIVER_INIT(bakubaku)
631633{
src/mame/drivers/ttchamp.c
r1037r1038
8787    COMBINE_DATA(&paloff);
8888}
8989
90#ifdef UNUSED_FUNCTION
9091static WRITE16_HANDLER( pcup_prgbank_w )
9192{
9293    int bank;
r1037r1038
9899        memory_set_bankptr(2,&ROM1[0x80000*(bank)]);
99100    }
100101}
102#endif
101103
102104static WRITE16_HANDLER( paldat_w )
103105{
r1037r1038
109111    return 0xffff;// mame_rand(Machine);
110112}
111113
114#ifdef UNUSED_FUNCTION
112115static READ16_HANDLER( peno_rand2 )
113116{
114117    return mame_rand(Machine);
115118}
119#endif
116120
117121static ADDRESS_MAP_START( ttchamp_map, ADDRESS_SPACE_PROGRAM, 16 )
118122    AM_RANGE(0x00000, 0x0ffff) AM_RAM
src/mame/drivers/hng64.c
r1037r1038
710710   return hng_cart[offset];
711711}
712712
713#ifdef UNUSED_FUNCTION
713714static READ32_HANDLER( no_machine_error )
714715{
715716   return no_machine_error_code;
716717}
718#endif
717719
718720WRITE32_HANDLER( hng64_dualport_w )
719721{
src/mame/drivers/taito_l.c
r1037r1038
27882788PCB number info:
27892789 K1100439A FLIPULL
27902790 K1100441A PLOTTING
2791 J1100187A (US Plotting PCB ID#?)
2791 K1100466A (US Plotting PCB ID#?)
27922792
27932793  +--------------------------+
27942794 _|    PAL           4 4 4 4 |
r1037r1038
28942894   ROM_LOAD( "u09.rom",  0x20000, 0x20000, CRC(3c115f8b) SHA1(8d518be01b7c4d6d993d5d9b62aab719a5c8baca) )
28952895ROM_END
28962896
2897ROM_START( puzznici )
2898   ROM_REGION( 0x30000, REGION_CPU1, 0 )
2899   ROM_LOAD( "1.bin",  0x00000, 0x20000, CRC(4612f5e0) SHA1(dc07a365414666568537d31ef01b58f2362cadaf) )
2900   ROM_RELOAD(           0x10000, 0x20000 )
2901
2902   ROM_REGION( 0x0800, REGION_CPU2, 0 )   /* 2k for the microcontroller */
2903   ROM_LOAD( "mc68705p", 0x0000, 0x0800, NO_DUMP )
2904
2905   ROM_REGION( 0x40000, REGION_GFX1, ROMREGION_DISPOSE )
2906   ROM_LOAD( "u10.rom",  0x00000, 0x20000, CRC(4264056c) SHA1(d2d8a170ae0f361093a5384935238605a59e5938) )
2907   ROM_LOAD( "3.bin",  0x20000, 0x20000, CRC(2bf5232a) SHA1(a8fc06bb8bae2ca6bd21e3a96c9ed38bb356d5d7) )
2908ROM_END
2909
28972910ROM_START( horshoes )
28982911   ROM_REGION( 0x30000, REGION_CPU1, 0 )
28992912   ROM_LOAD( "c47.03", 0x00000, 0x20000, CRC(37e15b20) SHA1(85baa0ee553e4c9fed38294ba8912f18f519e62f) )
r1037r1038
30463059GAME( 1989, flipull,  plotting, plotting, plotting, 0,        ROT0,   "Taito Corporation", "Flipull (Japan)", 0 )
30473060GAME( 1989, puzznic,  0,        puzznic,  puzznic,  0,        ROT0,   "Taito Corporation Japan", "Puzznic (World)", 0 )
30483061GAME( 1989, puzznicj, puzznic,  puzznic,  puzznic,  0,        ROT0,   "Taito Corporation", "Puzznic (Japan)", 0 )
3062GAME( 1989, puzznici, puzznic,  puzznic,  puzznic,  0,        ROT0,   "Taito Corporation", "Puzznic (Italy)", 0 )
30493063GAME( 1990, horshoes, 0,        horshoes, horshoes, 0,        ROT270, "Taito America Corporation", "American Horseshoes (US)", 0 )
30503064GAME( 1990, palamed,  0,        palamed,  palamed,  0,        ROT0,   "Taito Corporation", "Palamedes (Japan)", 0 )
30513065GAME( 1993, cachat,   0,        cachat,   cachat,   0,        ROT0,   "Taito Corporation", "Cachat (Japan)", 0 )
src/mame/drivers/srmp5.c
r0r1038
1/*
2
3Super Real Mahjong P5
4(c)1994 SETA
5
6preliminary driver by Tomasz Slanina
7
8
9--
10
11CPU   : R3560 (IDT MIPS R3000 derivative)
12SOUND : TC6210AF (ST-0016)
13OSC.  : 50.0000MHz 42.9545MHz
14
15SX008-01.BIN ; CHR ROM
16SX008-02.BIN ;  |
17SX008-03.BIN ;  |
18SX008-04.BIN ;  |
19SX008-05.BIN ;  |
20SX008-06.BIN ;  |
21SX008-07.BIN ; /
22SX008-08.BIN ; SOUND DATA
23SX008-09.BIN ; /
24SX008-11.BIN ; MAIN PRG
25SX008-12.BIN ;  |
26SX008-13.BIN ;  |
27SX008-14.BIN ; /
28
29*/
30
31#include "driver.h"
32#include "cpu/mips/r3000.h"
33#include "sound/st0016.h"
34#include "st0016.h"
35
36extern UINT8 *st0016_charram;
37static UINT32 databank;
38
39static UINT16 *tileram;
40static UINT16 *sprram;
41
42#define SPRITE_GLOBAL_X 0
43#define SPRITE_GLOBAL_Y 1
44#define SUBLIST_OFFSET   2
45#define SUBLIST_LENGTH   3
46
47#define SUBLIST_OFFSET_SHIFT 3
48#define SPRITE_LIST_END_MARKER 0x8000
49
50#define SPRITE_TILE    0
51#define SPRITE_PALETTE 1
52#define SPRITE_LOCAL_X 2
53#define SPRITE_LOCAL_Y 3
54#define SPRITE_SIZE    4
55
56#define SPRITE_SUBLIST_ENTRY_LENGTH 8
57#define SPRITE_LIST_ENTRY_LENGTH    4
58
59#define SPRITE_DATA_GRANULARITY 0x80
60
61
62VIDEO_UPDATE( srmp5 )
63{
64   // sprite/tile flipping is not implemented
65   int x,y,address,xs,ys,height,width,xw,yw,sprite,xb,yb,sizex,sizey;
66   UINT16 *sprite_list=sprram;
67   UINT16 *sprite_list_end=&sprram[0x1000]; //guess
68   UINT8 *pixels=(UINT8 *)tileram;
69
70   fillbitmap(bitmap,0,&machine->screen[0].visarea);
71
72   while((sprite_list[SUBLIST_OFFSET]&SPRITE_LIST_END_MARKER)==0 && sprite_list<sprite_list_end)
73   {
74      UINT16 *sprite_sublist=&sprram[sprite_list[SUBLIST_OFFSET]<<SUBLIST_OFFSET_SHIFT];
75      UINT16 sublist_length=sprite_list[SUBLIST_LENGTH];
76      INT16 global_x,global_y;
77
78      if(0!=sprite_list[SUBLIST_OFFSET])
79      {
80         global_x=(INT16)sprite_list[SPRITE_GLOBAL_X];
81         global_y=(INT16)sprite_list[SPRITE_GLOBAL_Y];
82         while(sublist_length)
83         {
84            sprite=sprite_sublist[SPRITE_TILE];
85            x=(INT16)sprite_sublist[SPRITE_LOCAL_X]+global_x;
86            y=(INT16)sprite_sublist[SPRITE_LOCAL_Y]+global_y;
87            width=(sprite_sublist[SPRITE_SIZE]>>4)&0xf;
88            height=(sprite_sublist[SPRITE_SIZE]>>12)&0xf;
89
90            sizex=(sprite_sublist[SPRITE_SIZE]>>0)&0xf;
91            sizey=(sprite_sublist[SPRITE_SIZE]>>8)&0xf;
92
93            address=sprite*SPRITE_DATA_GRANULARITY;
94            for(xw=0;xw<=width;xw++)
95               for(yw=0;yw<=height;yw++)
96               {
97                  xb=x+xw*(sizex+1);
98                  yb=y+yw*(sizey+1);
99                  for(ys=0;ys<=sizey;ys++)
100                  {
101                      for(xs=0;xs<=sizex;xs++)
102                      {
103                         UINT32 pen=pixels[address&(0x100000-1)];
104
105                         if(pen)
106                         {
107                            if(xb+xs<=machine->screen[0].visarea.max_x && xb+xs>=machine->screen[0].visarea.min_x && yb+ys<=machine->screen[0].visarea.max_y && yb+ys>=machine->screen[0].visarea.min_y )
108                            {
109                               UINT32 pixdata=paletteram32[pen+((sprite_sublist[SPRITE_PALETTE]&0xff)<<8)];
110                               *BITMAP_ADDR32(bitmap, yb+ys, xb+xs) = ((pixdata&0x7c00)>>7) | ((pixdata&0x3e0)<<6) | ((pixdata&0x1f)<<19);
111                            }
112                         }
113                         ++address;
114                      }
115                   }
116
117                }
118            sprite_sublist+=SPRITE_SUBLIST_ENTRY_LENGTH;
119            --sublist_length;
120         }
121      }
122      sprite_list+=SPRITE_LIST_ENTRY_LENGTH;
123   }
124
125   return 0;
126}
127
128static WRITE32_HANDLER(bank_w)
129{
130   COMBINE_DATA(&databank);
131}
132
133static READ32_HANDLER(tileram_r)
134{
135   return videoram32[offset];
136}
137
138static WRITE32_HANDLER(tileram_w)
139{
140   COMBINE_DATA(&videoram32[offset]);
141   tileram[offset]=videoram32[offset]&0xffff;
142}
143
144static READ32_HANDLER(spr_r)
145{
146   return spriteram32[offset];
147}
148
149static WRITE32_HANDLER(spr_w)
150{
151   COMBINE_DATA(&spriteram32[offset]);
152   sprram[offset]=spriteram32[offset];
153}
154
155static READ32_HANDLER(data_r)
156{
157   UINT32 data;
158   data=((databank>>4)&0xf)*0x100000; //guess
159   data=memory_region(REGION_USER2)[data+offset*2]+memory_region(REGION_USER2)[data+offset*2+1]*256;
160   return data|(data<<16);
161}
162
163static ADDRESS_MAP_START( srmp5_mem, ADDRESS_SPACE_PROGRAM, 32 )
164   AM_RANGE(0x00000000, 0x000fffff) AM_RAM //maybe 0 - 2fffff ?
165   AM_RANGE(0x002f0000, 0x002f7fff) AM_RAM
166   AM_RANGE(0x01000000, 0x01000003) AM_WRITE(MWA32_RAM)  // 0xaa .. watchdog ?
167   AM_RANGE(0x01800004, 0x01800007) AM_READ(input_port_0_dword_r)
168   AM_RANGE(0x01800008, 0x0180000b) AM_READ(input_port_1_dword_r)
169   AM_RANGE(0x0180000c, 0x0180000f) AM_WRITE(bank_w)
170   AM_RANGE(0x01800010, 0x01800013) AM_READ(input_port_2_dword_r) //multiplexed controls (selected by writes to 1c)
171   AM_RANGE(0x01800014, 0x01800017) AM_READ(input_port_3_dword_r)
172   AM_RANGE(0x0180001c, 0x0180001f) AM_WRITE(MWA32_RAM)//c1 c2 c4 c8 => mahjong inputs (at $10) - bits 0-3
173   AM_RANGE(0x01800200, 0x0180020f) AM_RAM  //sound related ? only few writes after boot
174   AM_RANGE(0x01a00000, 0x01bfffff) AM_READ(data_r)
175
176   AM_RANGE(0x0a000000, 0x0a0fffff) AM_READWRITE(spr_r, spr_w) AM_BASE(&spriteram32)
177   AM_RANGE(0x0a100000, 0x0a1fffff) AM_RAM AM_BASE(&paletteram32)
178   AM_RANGE(0x0a200000, 0x0a3fffff) AM_READWRITE(tileram_r, tileram_w) AM_BASE(&videoram32)
179
180   AM_RANGE(0x1eff0000, 0x1eff001f) AM_WRITE(MWA32_RAM)
181   AM_RANGE(0x1eff003c, 0x1eff003f) AM_READNOP
182   AM_RANGE(0x1fc00000, 0x1fdfffff) AM_READ(MRA32_ROM) AM_WRITE(MWA32_ROM) AM_REGION(REGION_USER1, 0)
183   AM_RANGE(0x2fc00000, 0x2fdfffff) AM_READ(MRA32_ROM) AM_WRITE(MWA32_ROM) AM_REGION(REGION_USER1, 0)
184ADDRESS_MAP_END
185
186static ADDRESS_MAP_START( st0016_mem, ADDRESS_SPACE_PROGRAM, 8 )
187   AM_RANGE(0x0000, 0x7fff) AM_ROM
188   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(1)
189   AM_RANGE(0xc000, 0xcfff) AM_READ(st0016_sprite_ram_r) AM_WRITE(st0016_sprite_ram_w)
190   AM_RANGE(0xd000, 0xdfff) AM_READ(st0016_sprite2_ram_r) AM_WRITE(st0016_sprite2_ram_w)
191   AM_RANGE(0xe000, 0xe7ff) AM_RAM
192   AM_RANGE(0xe800, 0xe87f) AM_RAM
193   AM_RANGE(0xe900, 0xe9ff) AM_RAM AM_WRITE(st0016_snd_w) AM_BASE(&st0016_sound_regs)
194   AM_RANGE(0xea00, 0xebff) AM_READ(st0016_palette_ram_r) AM_WRITE(st0016_palette_ram_w)
195   AM_RANGE(0xec00, 0xec1f) AM_READ(st0016_character_ram_r) AM_WRITE(st0016_character_ram_w)
196   AM_RANGE(0xf000, 0xffff) AM_RAM
197ADDRESS_MAP_END
198
199READ8_HANDLER(st0016_dma_r);
200
201static ADDRESS_MAP_START( st0016_io, ADDRESS_SPACE_IO, 8 )
202   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
203   AM_RANGE(0x00, 0xbf) AM_READ(st0016_vregs_r) AM_WRITE(st0016_vregs_w)
204   AM_RANGE(0xc0, 0xc3) AM_NOP // data from other cpu ?
205   AM_RANGE(0xe0, 0xe0) AM_WRITENOP
206   AM_RANGE(0xe1, 0xe1) AM_WRITE(st0016_rom_bank_w)
207   AM_RANGE(0xe2, 0xe2) AM_WRITE(st0016_sprite_bank_w)
208   AM_RANGE(0xe3, 0xe4) AM_WRITE(st0016_character_bank_w)
209   AM_RANGE(0xe5, 0xe5) AM_WRITE(st0016_palette_bank_w)
210   AM_RANGE(0xe6, 0xe6) AM_WRITENOP
211   AM_RANGE(0xe7, 0xe7) AM_WRITENOP
212   AM_RANGE(0xf0, 0xf0) AM_READ(st0016_dma_r)
213ADDRESS_MAP_END
214
215
216static struct r3000_config config =
217{
218   1,   /* 1 if we have an FPU, 0 otherwise */
219   4096,   /* code cache size */
220   4096   /* data cache size */
221};
222
223INPUT_PORTS_START( srmp5 )
224   PORT_START
225   PORT_DIPNAME( 0x0001, 0x0001, "0-0" )
226   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
227   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
228   PORT_DIPNAME( 0x0002, 0x0002, "0-1" )
229   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
230   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
231   PORT_DIPNAME( 0x0004, 0x0004, "0-2" )
232   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
233   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
234   PORT_DIPNAME( 0x0008, 0x0008, "0-3" )
235   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
236   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
237   PORT_DIPNAME( 0x0010, 0x0010, "0-4" )
238   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
239   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
240   PORT_DIPNAME( 0x0020, 0x0020, "0-5" )
241   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
242   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
243   PORT_DIPNAME( 0x0040, 0x0040, "0-6" )
244   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
245   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
246   PORT_DIPNAME( 0x0080, 0x0080, "0-7" )
247   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
248   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
249   PORT_DIPNAME( 0x0100, 0x0100, "0-8" )
250   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
251   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
252   PORT_DIPNAME( 0x0200, 0x0200, "0-9" )
253   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
254   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
255   PORT_DIPNAME( 0x0400, 0x0400, "0-a" )
256   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
257   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
258   PORT_DIPNAME( 0x0800, 0x0800, "0-b" )
259   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
260   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
261   PORT_DIPNAME( 0x1000, 0x1000, "0-c" )
262   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
263   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
264   PORT_DIPNAME( 0x2000, 0x2000, "0-d" )
265   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
266   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
267  PORT_DIPNAME( 0x4000, 0x4000, "0-e" )
268   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
269   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
270   PORT_DIPNAME( 0x8000, 0x8000, "0-f" )
271   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
272   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
273   PORT_DIPNAME( 0x00010000, 0x00010000, "0-10" )
274   PORT_DIPSETTING(      0x00010000, DEF_STR( Off ) )
275   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
276   PORT_DIPNAME( 0x00020000, 0x00020000, "0-11" )
277   PORT_DIPSETTING(      0x00020000, DEF_STR( Off ) )
278   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
279   PORT_DIPNAME( 0x00040000, 0x00040000, "0-12" )
280   PORT_DIPSETTING(      0x00040000, DEF_STR( Off ) )
281   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
282   PORT_DIPNAME( 0x00080000, 0x00080000, "0-13" )
283   PORT_DIPSETTING(      0x00080000, DEF_STR( Off ) )
284   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
285   PORT_DIPNAME( 0x00100000, 0x00100000, "0-14" )
286   PORT_DIPSETTING(      0x00100000, DEF_STR( Off ) )
287   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
288   PORT_DIPNAME( 0x00200000, 0x00200000, "0-15" )
289   PORT_DIPSETTING(      0x00200000, DEF_STR( Off ) )
290   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
291   PORT_DIPNAME( 0x00400000, 0x00400000, "0-16" )
292   PORT_DIPSETTING(      0x00400000, DEF_STR( Off ) )
293   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
294   PORT_DIPNAME( 0x00800000, 0x00800000, "0-17" )
295   PORT_DIPSETTING(      0x00800000, DEF_STR( Off ) )
296   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
297   PORT_DIPNAME( 0x01000000, 0x01000000, "0-18" )
298   PORT_DIPSETTING(      0x01000000, DEF_STR( Off ) )
299   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
300   PORT_DIPNAME( 0x02000000, 0x02000000, "0-19" )
301   PORT_DIPSETTING(      0x02000000, DEF_STR( Off ) )
302   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
303   PORT_DIPNAME( 0x04000000, 0x04000000, "0-1a" )
304   PORT_DIPSETTING(      0x04000000, DEF_STR( Off ) )
305   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
306   PORT_DIPNAME( 0x08000000, 0x08000000, "0-1b" )
307   PORT_DIPSETTING(      0x08000000, DEF_STR( Off ) )
308   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
309   PORT_DIPNAME( 0x10000000, 0x10000000, "0-1c" )
310   PORT_DIPSETTING(      0x10000000, DEF_STR( Off ) )
311   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
312   PORT_DIPNAME( 0x20000000, 0x20000000, "0-1d" )
313   PORT_DIPSETTING(      0x20000000, DEF_STR( Off ) )
314   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
315  PORT_DIPNAME( 0x40000000, 0x40000000, "0-1e" )
316   PORT_DIPSETTING(      0x40000000, DEF_STR( Off ) )
317   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
318   PORT_DIPNAME( 0x80000000, 0x80000000, "0-1f" )
319   PORT_DIPSETTING(      0x80000000, DEF_STR( Off ) )
320   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
321
322   PORT_START
323   PORT_DIPNAME( 0x0001, 0x0001, "1-0" )
324   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
325   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
326   PORT_DIPNAME( 0x0002, 0x0002, "1-1" )
327   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
328   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
329   PORT_DIPNAME( 0x0004, 0x0004, "1-2" )
330   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
331   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
332   PORT_DIPNAME( 0x0008, 0x0008, "1-3" )
333   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
334   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
335   PORT_DIPNAME( 0x0010, 0x0010, "1-4" )
336   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
337   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
338   PORT_DIPNAME( 0x0020, 0x0020, "1-5" )
339   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
340   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
341   PORT_DIPNAME( 0x0040, 0x0040, "1-6" )
342   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
343   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
344   PORT_DIPNAME( 0x0080, 0x0080, "Test mode" )
345   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
346   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
347   PORT_DIPNAME( 0x0100, 0x0100, "1-8" )
348   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
349   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
350   PORT_DIPNAME( 0x0200, 0x0200, "1-9" )
351   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
352   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
353   PORT_DIPNAME( 0x0400, 0x0400, "1-a" )
354   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
355   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
356   PORT_DIPNAME( 0x0800, 0x0800, "1-b" )
357   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
358   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
359   PORT_DIPNAME( 0x1000, 0x1000, "1-c" )
360   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
361   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
362   PORT_DIPNAME( 0x2000, 0x2000, "1-d" )
363   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
364   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
365  PORT_DIPNAME( 0x4000, 0x4000, "1-e" )
366   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
367   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
368   PORT_DIPNAME( 0x8000, 0x8000, "1-f" )
369   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
370   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
371
372   PORT_DIPNAME( 0x00010000, 0x00010000, "1-10" )
373   PORT_DIPSETTING(      0x00010000, DEF_STR( Off ) )
374   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
375   PORT_DIPNAME( 0x00020000, 0x00020000, "1-11" )
376   PORT_DIPSETTING(      0x00020000, DEF_STR( Off ) )
377   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
378   PORT_DIPNAME( 0x00040000, 0x00040000, "1-12" )
379   PORT_DIPSETTING(      0x00040000, DEF_STR( Off ) )
380   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
381   PORT_DIPNAME( 0x00080000, 0x00080000, "1-13" )
382   PORT_DIPSETTING(      0x00080000, DEF_STR( Off ) )
383   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
384   PORT_DIPNAME( 0x00100000, 0x00100000, "1-14" )
385   PORT_DIPSETTING(      0x00100000, DEF_STR( Off ) )
386   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
387   PORT_DIPNAME( 0x00200000, 0x00200000, "1-15" )
388   PORT_DIPSETTING(      0x00200000, DEF_STR( Off ) )
389   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
390   PORT_DIPNAME( 0x00400000, 0x00400000, "1-16" )
391   PORT_DIPSETTING(      0x00400000, DEF_STR( Off ) )
392   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
393   PORT_DIPNAME( 0x00800000, 0x00800000, "1-17" )
394   PORT_DIPSETTING(      0x00800000, DEF_STR( Off ) )
395   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
396   PORT_DIPNAME( 0x01000000, 0x01000000, "1-18" )
397   PORT_DIPSETTING(      0x01000000, DEF_STR( Off ) )
398   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
399   PORT_DIPNAME( 0x02000000, 0x02000000, "1-19" )
400   PORT_DIPSETTING(      0x02000000, DEF_STR( Off ) )
401   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
402   PORT_DIPNAME( 0x04000000, 0x04000000, "1-1a" )
403   PORT_DIPSETTING(      0x04000000, DEF_STR( Off ) )
404   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
405   PORT_DIPNAME( 0x08000000, 0x08000000, "1-1b" )
406   PORT_DIPSETTING(      0x08000000, DEF_STR( Off ) )
407   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
408   PORT_DIPNAME( 0x10000000, 0x10000000, "1-1c" )
409   PORT_DIPSETTING(      0x10000000, DEF_STR( Off ) )
410   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
411   PORT_DIPNAME( 0x20000000, 0x20000000, "1-1d" )
412   PORT_DIPSETTING(      0x20000000, DEF_STR( Off ) )
413   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
414  PORT_DIPNAME( 0x40000000, 0x40000000, "1-1e" )
415   PORT_DIPSETTING(      0x40000000, DEF_STR( Off ) )
416   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
417   PORT_DIPNAME( 0x80000000, 0x80000000, "1-1f" )
418   PORT_DIPSETTING(      0x80000000, DEF_STR( Off ) )
419   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
420
421PORT_START
422   PORT_DIPNAME( 0x0001, 0x0001, "2-0" )
423   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
424   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
425   PORT_DIPNAME( 0x0002, 0x0002, "2-1" )
426   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
427   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
428   PORT_DIPNAME( 0x0004, 0x0004, "2-2" )
429   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
430   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
431   PORT_DIPNAME( 0x0008, 0x0008, "2-3" )
432   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
433   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
434   PORT_DIPNAME( 0x0010, 0x0010, "2-4" )
435   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
436   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
437
438   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
439   PORT_DIPNAME( 0x0040, 0x0040, "2-5" )
440   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
441   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
442   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
443   PORT_DIPNAME( 0x0100, 0x0100, "2-8" )
444   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
445   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
446   PORT_DIPNAME( 0x0200, 0x0200, "2-9" )
447   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
448   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
449   PORT_DIPNAME( 0x0400, 0x0400, "2-a" )
450   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
451   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
452   PORT_DIPNAME( 0x0800, 0x0800, "2-b" )
453   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
454   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
455   PORT_DIPNAME( 0x1000, 0x1000, "2-c" )
456   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
457   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
458   PORT_DIPNAME( 0x2000, 0x2000, "2-d" )
459   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
460   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
461  PORT_DIPNAME( 0x4000, 0x4000, "2-e" )
462   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
463   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
464   PORT_DIPNAME( 0x8000, 0x8000, "2-f" )
465   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
466   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
467
468
469   PORT_DIPNAME( 0x00010000, 0x00010000, "2-10" )
470   PORT_DIPSETTING(      0x00010000, DEF_STR( Off ) )
471   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
472   PORT_DIPNAME( 0x00020000, 0x00020000, "2-11" )
473   PORT_DIPSETTING(      0x00020000, DEF_STR( Off ) )
474   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
475   PORT_DIPNAME( 0x00040000, 0x00040000, "2-12" )
476   PORT_DIPSETTING(      0x00040000, DEF_STR( Off ) )
477   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
478   PORT_DIPNAME( 0x00080000, 0x00080000, "2-13" )
479   PORT_DIPSETTING(      0x00080000, DEF_STR( Off ) )
480   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
481   PORT_DIPNAME( 0x00100000, 0x00100000, "2-14" )
482   PORT_DIPSETTING(      0x00100000, DEF_STR( Off ) )
483   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
484   PORT_DIPNAME( 0x00200000, 0x00200000, "2-15" )
485   PORT_DIPSETTING(      0x00200000, DEF_STR( Off ) )
486   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
487   PORT_DIPNAME( 0x00400000, 0x00400000, "2-16" )
488   PORT_DIPSETTING(      0x00400000, DEF_STR( Off ) )
489   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
490   PORT_DIPNAME( 0x00800000, 0x00800000, "2-17" )
491   PORT_DIPSETTING(      0x00800000, DEF_STR( Off ) )
492   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
493   PORT_DIPNAME( 0x01000000, 0x01000000, "2-18" )
494   PORT_DIPSETTING(      0x01000000, DEF_STR( Off ) )
495   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
496   PORT_DIPNAME( 0x02000000, 0x02000000, "2-19" )
497   PORT_DIPSETTING(      0x02000000, DEF_STR( Off ) )
498   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
499   PORT_DIPNAME( 0x04000000, 0x04000000, "2-1a" )
500   PORT_DIPSETTING(      0x04000000, DEF_STR( Off ) )
501   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
502   PORT_DIPNAME( 0x08000000, 0x08000000, "2-1b" )
503   PORT_DIPSETTING(      0x08000000, DEF_STR( Off ) )
504   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
505   PORT_DIPNAME( 0x10000000, 0x10000000, "2-1c" )
506   PORT_DIPSETTING(      0x10000000, DEF_STR( Off ) )
507   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
508   PORT_DIPNAME( 0x20000000, 0x20000000, "2-1d" )
509   PORT_DIPSETTING(      0x20000000, DEF_STR( Off ) )
510   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
511  PORT_DIPNAME( 0x40000000, 0x40000000, "2-1e" )
512   PORT_DIPSETTING(      0x40000000, DEF_STR( Off ) )
513   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
514   PORT_DIPNAME( 0x80000000, 0x80000000, "2-1f" )
515   PORT_DIPSETTING(      0x80000000, DEF_STR( Off ) )
516   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
517
518   PORT_START
519   PORT_DIPNAME( 0x0001, 0x0001, "3-0" )
520   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
521   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
522   PORT_DIPNAME( 0x0002, 0x0002, "3-1" )
523   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
524   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
525   PORT_DIPNAME( 0x0004, 0x0004, "3-2" )
526   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
527   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
528   PORT_DIPNAME( 0x0008, 0x0008, "3-3" )
529   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
530   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
531   PORT_DIPNAME( 0x0010, 0x0010, "3-4" )
532   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
533   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
534   PORT_DIPNAME( 0x0020, 0x0020, "3-5" )
535   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
536   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
537   PORT_DIPNAME( 0x0040, 0x0040, "3-6" )
538   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
539   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
540   PORT_DIPNAME( 0x0080, 0x0080, "3-7" )
541   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
542   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
543   PORT_DIPNAME( 0x0100, 0x0100, "3-8" )
544   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
545   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
546   PORT_DIPNAME( 0x0200, 0x0200, "3-9" )
547   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
548   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
549   PORT_DIPNAME( 0x0400, 0x0400, "3-a" )
550   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
551   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
552   PORT_DIPNAME( 0x0800, 0x0800, "3-b" )
553   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
554   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
555   PORT_DIPNAME( 0x1000, 0x1000, "3-c" )
556   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
557   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
558   PORT_DIPNAME( 0x2000, 0x2000, "3-d" )
559   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
560   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
561  PORT_DIPNAME( 0x4000, 0x4000, "3-e" )
562   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
563   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
564   PORT_DIPNAME( 0x8000, 0x8000, "3-f" )
565   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
566   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
567
568   PORT_DIPNAME( 0x00010000, 0x00010000, "3-10" )
569   PORT_DIPSETTING(      0x00010000, DEF_STR( Off ) )
570   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
571   PORT_DIPNAME( 0x00020000, 0x00020000, "3-11" )
572   PORT_DIPSETTING(      0x00020000, DEF_STR( Off ) )
573   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
574   PORT_DIPNAME( 0x00040000, 0x00040000, "3-12" )
575   PORT_DIPSETTING(      0x00040000, DEF_STR( Off ) )
576   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
577   PORT_DIPNAME( 0x00080000, 0x00080000, "3-13" )
578   PORT_DIPSETTING(      0x00080000, DEF_STR( Off ) )
579   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
580   PORT_DIPNAME( 0x00100000, 0x00100000, "3-14" )
581   PORT_DIPSETTING(      0x00100000, DEF_STR( Off ) )
582   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
583   PORT_DIPNAME( 0x00200000, 0x00200000, "3-15" )
584   PORT_DIPSETTING(      0x00200000, DEF_STR( Off ) )
585   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
586   PORT_DIPNAME( 0x00400000, 0x00400000, "3-16" )
587   PORT_DIPSETTING(      0x00400000, DEF_STR( Off ) )
588   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
589   PORT_DIPNAME( 0x00800000, 0x00800000, "3-17" )
590   PORT_DIPSETTING(      0x00800000, DEF_STR( Off ) )
591   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
592   PORT_DIPNAME( 0x01000000, 0x01000000, "3-18" )
593   PORT_DIPSETTING(      0x01000000, DEF_STR( Off ) )
594   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
595   PORT_DIPNAME( 0x02000000, 0x02000000, "3-19" )
596   PORT_DIPSETTING(      0x02000000, DEF_STR( Off ) )
597   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
598   PORT_DIPNAME( 0x04000000, 0x04000000, "3-1a" )
599   PORT_DIPSETTING(      0x04000000, DEF_STR( Off ) )
600   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
601   PORT_DIPNAME( 0x08000000, 0x08000000, "3-1b" )
602   PORT_DIPSETTING(      0x08000000, DEF_STR( Off ) )
603   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
604   PORT_DIPNAME( 0x10000000, 0x10000000, "3-1c" )
605   PORT_DIPSETTING(      0x10000000, DEF_STR( Off ) )
606   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
607   PORT_DIPNAME( 0x20000000, 0x20000000, "3-1d" )
608   PORT_DIPSETTING(      0x20000000, DEF_STR( Off ) )
609   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
610  PORT_DIPNAME( 0x40000000, 0x40000000, "3-1e" )
611   PORT_DIPSETTING(      0x40000000, DEF_STR( Off ) )
612   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
613   PORT_DIPNAME( 0x80000000, 0x80000000, "3-1f" )
614   PORT_DIPSETTING(      0x80000000, DEF_STR( Off ) )
615   PORT_DIPSETTING(      0x00000000, DEF_STR( On ) )
616INPUT_PORTS_END
617
618static struct ST0016interface st0016_interface =
619{
620   &st0016_charram
621};
622
623static MACHINE_DRIVER_START( srmp5 )
624   MDRV_CPU_ADD_TAG("main",Z80,8000000)
625   MDRV_CPU_PROGRAM_MAP(st0016_mem,0)
626   MDRV_CPU_IO_MAP(st0016_io,0)
627   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
628
629  MDRV_CPU_ADD(R3000LE, 40000000)
630   MDRV_CPU_CONFIG(config)
631   MDRV_CPU_VBLANK_INT(irq4_line_hold,2)
632   MDRV_CPU_PROGRAM_MAP(srmp5_mem,0)
633
634   MDRV_SCREEN_REFRESH_RATE(60)
635   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
636
637   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
638   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
639   MDRV_SCREEN_SIZE(64*8, 64*8)
640   MDRV_SCREEN_VISIBLE_AREA(0*8, 350, 30, 280)
641   MDRV_PALETTE_LENGTH(16*16*4+1)
642
643   MDRV_VIDEO_START(st0016)
644   MDRV_VIDEO_UPDATE(srmp5)
645
646   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
647
648   MDRV_SOUND_ADD(ST0016, 0)
649   MDRV_SOUND_CONFIG(st0016_interface)
650   MDRV_SOUND_ROUTE(0, "left", 1.0)
651   MDRV_SOUND_ROUTE(1, "right", 1.0)
652MACHINE_DRIVER_END
653
654ROM_START( srmp5 )
655   ROM_REGION( 0x410000, REGION_CPU1, 0 )
656   ROM_LOAD( "sx008-08.bin",   0x010000, 0x200000,   CRC(d4ac54f4) SHA1(c3dc76cd71485796a0b6a960294ea96eae8c946e) )
657   ROM_LOAD( "sx008-09.bin",   0x200000, 0x200000,   CRC(5a3e6560) SHA1(92ea398f3c5e3035869f0ca5dfe7b05c90095318) )
658   ROM_COPY( REGION_CPU1,  0x10000, 0x00000, 0x08000 )
659
660   ROM_REGION32_BE( 0x200000, REGION_USER1, 0 )
661   ROM_LOAD32_BYTE( "sx008-14.bin",   0x00000, 0x80000,   CRC(b5c55120) SHA1(0a41351c9563b2c6a00709189a917757bd6e0a24) )
662   ROM_LOAD32_BYTE( "sx008-13.bin",   0x00001, 0x80000,   CRC(0af475e8) SHA1(24cddffa0f8c81832ae8870823d772e3b7493194) )
663   ROM_LOAD32_BYTE( "sx008-12.bin",   0x00002, 0x80000,   CRC(43e9bb98) SHA1(e46dd98d2e1babfa12ddf2fa9b31377e8691d3a1) )
664   ROM_LOAD32_BYTE( "sx008-11.bin",   0x00003, 0x80000,   CRC(ca15ff45) SHA1(5ee610e0bb835568c36898210a6f8394902d5b54) )
665
666   ROM_REGION( 0x200000*8, REGION_USER2,0) /* gfx ? */
667   ROM_LOAD( "sx008-01.bin",   0x000000, 0x200000,   CRC(82dabf48) SHA1(c53e9ed0056c431eab13ab362936c25d3cc5abba) )
668   ROM_LOAD( "sx008-02.bin",   0x200000, 0x200000,   CRC(cfd2be0f) SHA1(a21f2928e08047c97443123aceba7ff4e95c6d3d) )
669   ROM_LOAD( "sx008-03.bin",   0x400000, 0x200000,   CRC(d7323b10) SHA1(94ecc17b6b8b071cf2c61bbef4aec2c6c7693c62) )
670   ROM_LOAD( "sx008-04.bin",   0x600000, 0x200000,   CRC(b10d3067) SHA1(21c36307780d4f38ec54d87cd222d65e4f8c00a5) )
671   ROM_LOAD( "sx008-05.bin",   0x800000, 0x200000,   CRC(0ff5e6f5) SHA1(ab7d021757f341d28db6d7d009c20ec9d7bd83c1) )
672   ROM_LOAD( "sx008-06.bin",   0xa00000, 0x200000,   CRC(ba6fd7c4) SHA1(f086195c5c647e07e77ce2a23e94d28e6ad9ff4f) )
673   ROM_LOAD( "sx008-07.bin",   0xc00000, 0x200000,   CRC(3564485d) SHA1(12464de4e2b6c4df1595183996d1987f0ecffb01) )
674ROM_END
675
676static DRIVER_INIT(srmp5)
677{
678   st0016_game=9;
679   tileram=(UINT16*)auto_malloc(0x100000);
680   sprram=(UINT16*)auto_malloc(0x080000);
681}
682
683GAME( 1994, srmp5,   0,     srmp5,    srmp5,    srmp5,    ROT0, "Seta",  "Super Real Mahjong P5", GAME_NOT_WORKING)
src/mame/drivers/gaelco2.c
r1037r1038
13791379GAME( 1995, wrally2,  0,        wrally2,  wrally2,  0,        ROT0, "Gaelco", "World Rally 2: Twin Racing", GAME_UNEMULATED_PROTECTION )
13801380GAME( 1996, maniacsq, 0,        maniacsq, maniacsq, 0,        ROT0, "Gaelco", "Maniac Square (unprotected)", 0 )
13811381GAME( 1996, snowboar, 0,        snowboar, snowboar, snowboar, ROT0, "Gaelco", "Snow Board Championship (set 1)", GAME_UNEMULATED_PROTECTION )
1382GAME( 1996, snowbalt, snowboar, snowboar, snowboar, 0,        ROT0, "Gaelco", "Snow Board Championship (set 2)", GAME_UNEMULATED_PROTECTION )
1382GAME( 1996, snowbalt, snowboar, snowboar, snowboar, 0,        ROT0, "Gaelco", "Snow Board Championship (Version 2.1)", GAME_UNEMULATED_PROTECTION )
13831383GAME( 1998, bang,     0,        bang,     bang,     bang,     ROT0, "Gaelco", "Bang!", 0 )
13841384GAME( 1998, bangj,    bang,     bang,     bang,     bang,     ROT0, "Gaelco", "Gun Gabacho (Japan)", 0 )
src/mame/drivers/srmp6.c
r1037r1038
22    Super Real Mahjong P6 (JPN Ver.)
33    (c)1996 Seta
44
5WIP driver by Sebastien Volpe, Tomasz Slanina and David Haywood
5WIP driver by Sebastien Volpe
66
7Emulation Notes:
8The graphics are compressed, using the same 8bpp RLE scheme as CPS3 uses
9for the background on Sean's stage of Street Fighter III.
10
11DMA Operations are not fully understood
12
13
147according prg ROM (offset $0fff80):
158
169    S12 SYSTEM
r1037r1038
2013    V1.00
2114
2215TODO:
16 - gfx decoding / emulation
2317 - sound emulation (appears to be really close to st0016)
24 - fix DMA operations
25 - fix video emulation
2618
2719Are there other games on this 'System S12' hardware ???
2820
r1037r1038
6254
6355
6456Dumped 06/15/2000
65
6657*/
6758
68
6959#include "driver.h"
60#include "srmp6.h"
7061
71static UINT16* tileram;
72static UINT8* dirty_tileram;
73static UINT16* dmaram;
7462
75static UINT16 *sprram;
76
77#define SRMP6_VERBOSE 0
78
79static const gfx_layout tiles8x8_layout =
80{
81   8,8,
82   (0x100000*16)/0x40,
83   8,
84   { 0,1,2,3,4,5,6,7 },
85   { 0*8,1*8,2*8,3*8,4*8,5*8,6*8,7*8 },
86   { 0*64,1*64,2*64,3*64,4*64,5*64,6*64,7*64 },
87   8*64
88};
89
90
91static VIDEO_START(srmp6)
92{
93   /* create the char set (gfx will then be updated dynamically from RAM) */
94   machine->gfx[0] = allocgfx(&tiles8x8_layout);
95   machine->gfx[0]->total_colors = machine->drv->total_colors / 256;
96   machine->gfx[0]->color_granularity=256;
97
98   tileram = auto_malloc(0x100000*16);
99   dirty_tileram = auto_malloc((0x100000*16)/0x40); // every 8x8x8 tile is 0x40 bytes
100
101   memset(tileram,(0x100000*16),0x00);
102   memset(dirty_tileram,(0x100000*16)/0x40,1);
103
104   dmaram = auto_malloc(0x100);
105}
106
107/* Debug code */
108static void srmp6_decode_charram(void)
109{
110   if(input_code_pressed_once(KEYCODE_Z))
111   {
112      int i;
113      for (i=0;i<(0x100000*16)/0x40;i++)
114      {
115         decodechar(Machine->gfx[0], i, (UINT8*)tileram, &tiles8x8_layout);
116         dirty_tileram[i] = 0;
117      }
118   }
119}
120
121#if 0
122static int xixi=0;
123#endif
124
125static VIDEO_UPDATE(srmp6)
126{
127   int x,y,tileno,height,width,xw,yw,sprite,xb,yb;
128   UINT16 *sprite_list=sprram;
129   UINT16 mainlist_offset = 0;
130
131   union
132   {
133      INT16  a;
134      UINT16 b;
135   } temp;
136
137   fillbitmap(bitmap,0,&machine->screen[0].visarea);
138
139#if 0
140   /* debug */
141   srmp6_decode_charram();
142
143
144
145   /* debug */
146   if(input_code_pressed_once(KEYCODE_Q))
147   {
148      ++xixi;
149      printf("%x\n",xixi);
150   }
151
152   if(input_code_pressed_once(KEYCODE_W))
153   {
154      --xixi;
155      printf("%x\n",xixi);
156   }
157#endif
158
159   /* Main spritelist is 0x0000 - 0x1fff in spriteram, sublists follow */
160   while (mainlist_offset<0x2000/2)
161   {
162
163      UINT16 *sprite_sublist=&sprram[sprite_list[mainlist_offset+1]<<3];
164      UINT16 sublist_length=sprite_list[mainlist_offset+0]&0x7fff; //+1 ?
165      INT16 global_x,global_y;
166      UINT16 global_pal;
167
168      /* end of list marker */
169      if (sprite_list[mainlist_offset+0] == 0x8000)
170         return 0;
171
172
173      if(sprite_list[mainlist_offset+0]!=0)
174      {
175         temp.b=sprite_list[mainlist_offset+2];
176         global_x=temp.a;
177         temp.b=sprite_list[mainlist_offset+3];
178         global_y=temp.a;
179
180         global_pal = sprite_list[mainlist_offset+4] & 0xf;
181
182   //  printf("%x %x \n",sprite_list[mainlist_offset+1],sublist_length);
183
184         while(sublist_length)
185         {
186            sprite=sprite_sublist[0]&0x3fff;
187            temp.b=sprite_sublist[2];
188            x=temp.a;
189            temp.b=sprite_sublist[3];
190            y=temp.a;
191            x+=global_x;
192            y+=global_y;
193
194            width=((sprite_sublist[1])&0x3);
195            height=((sprite_sublist[1]>>2)&0x3);
196
197            height = 1 << height;
198            width = 1 << width;
199
200            tileno = sprite&0x3fff;
201            //tileno += (sprite_list[4]&0xf)*0x4000; // this makes things worse in places (title screen for example)
202
203            for(xw=0;xw<width;xw++)
204            {
205               for(yw=0;yw<height;yw++)
206               {
207
208                  xb=x+xw*8;
209                  yb=y+yw*8;
210
211                  if (dirty_tileram[tileno])
212                  {
213                     decodechar(Machine->gfx[0], tileno, (UINT8*)tileram, &tiles8x8_layout);
214                     dirty_tileram[tileno] = 0;
215                  }
216
217                  drawgfx(bitmap,machine->gfx[0],tileno,global_pal,0,0,xb,yb,cliprect,TRANSPARENCY_PEN,0);
218                  tileno++;
219                }
220            }
221
222            sprite_sublist+=8;
223            --sublist_length;
224         }
225      }
226      mainlist_offset+=8;
227   }
228
229   return 0;
230}
231
23263/***************************************************************************
233    audio - VERY preliminary
64    sndhrdw - VERY preliminary
23465
23566    TODO: watch similarities with st0016
23667***************************************************************************/
r1037r1038
270101
271102*/
272103
273/***************************************************************************
274    Main CPU memory handlers
275***************************************************************************/
104UINT16 *sound_regs;
276105
277static UINT16 srmp6_input_select = 0;
278
279static WRITE16_HANDLER( srmp6_input_select_w )
106READ16_HANDLER( sound_regs_r )
280107{
281   srmp6_input_select = data & 0x0f;
282}
283
284static READ16_HANDLER( srmp6_inputs_r )
285{
286   if (offset == 0)         // DSW
287      return readinputport(4);
288
289   switch(srmp6_input_select)   // inputs
290   {
291      case 1<<0: return readinputport(0);
292      case 1<<1: return readinputport(1);
293      case 1<<2: return readinputport(2);
294      case 1<<3: return readinputport(3);
295   }
296
297108   return 0;
298109}
299110
300
301static UINT16 *video_regs;
302
303static WRITE16_HANDLER( video_regs_w )
111WRITE16_HANDLER( sound_regs_w )
304112{
305   switch(offset)
306   {
113   COMBINE_DATA(&sound_regs[offset]);
307114
308      case 0x5e/2: // bank switch, used by ROM check
309#if SRMP6_VERBOSE
310         printf("%x\n",data);
311#endif
312
313         memory_set_bankptr(1,(UINT16 *)(memory_region(REGION_USER2) + (data & 0x0f)*0x200000));
115   switch(offset & 0x0f)
116   {
117      case 0x02: // Start Address LSW
314118         break;
315
316
317      /* unknown registers - there are others */
318
319      // set by IT4 (jsr $b3c), according flip screen dsw
320      case 0x48/2: //     0 /  0xb0 if flipscreen
321      case 0x52/2: //     0 / 0x2ef if flipscreen
322      case 0x54/2: // 0x152 / 0x15e if flipscreen
323
324      // set by IT4 ($82e-$846)
325      case 0x56/2: // written 8,9,8,9 successively
326
327      // set by IT4
328      case 0x5c/2: // either 0x40 explicitely in many places, or according $2083b0 (IT4)
329
119      case 0x03: // Start Address MSW
120//          fprintf(stdout, "Ch %d Start Address %08X\n", offset>>4, (sound_regs[offset]<<16)|sound_regs[offset-1]);
121         break;
122      case 0x0c: // End Address LSW
123         break;
124      case 0x0d: // End Address MSW
125//          fprintf(stdout, "Ch %d End Address   %08X\n", offset>>4, (sound_regs[offset]<<16)|sound_regs[offset-1]);
126         break;
127      case 0x05: // Status Register
128         break;
129      case 0x06: // frequency Register?
130         break;
131      case 0x0e: // Left Volume
132//          fprintf(stdout, "Ch.%d Left Volume  %04X\n", offset>>4, data);
133         break;
134      case 0x0f: // Right Volume
135//          fprintf(stdout, "Ch.%d Right Volume %04X\n", offset>>4, data);
136         break;
330137      default:
331         logerror("video_regs_w (PC=%06X): %04x = %04x & %04x\n", activecpu_get_previouspc(), offset*2, data, mem_mask);
138//          fprintf(stdout, "Sound Regs %02X: %04X\n", offset, data);
332139         break;
333140   }
334   COMBINE_DATA(&video_regs[offset]);
335141}
336142
337static READ16_HANDLER( video_regs_r )
143READ16_HANDLER( sndctrl_reg_r )
338144{
339   logerror("video_regs_r (PC=%06X): %04x\n", activecpu_get_previouspc(), offset*2);
340   return video_regs[offset];
145   return 0;
341146}
342147
343
344/* DMA RLE stuff - the same as CPS3 */
345static unsigned short lastb;
346static unsigned short lastb2;
347static int destl;
348
349static UINT32 process(UINT8 b,UINT32 dst_offset)
148WRITE16_HANDLER( sndctrl_reg_w )
350149{
150/*
151    int i;
152    for(i=0;i<8;i++)
153        if(data & (1 << i))
154            fprintf(stdout, "Ch.%d Sound Start\n", i);
155*/
156}
351157
352    int l=0;
158/***************************************************************************
159    Main CPU memory handlers
160***************************************************************************/
353161
354    UINT8 *tram=(UINT8*)tileram;
162static UINT16 srmp6_input_select = 0;
355163
356    if(lastb==lastb2)   //rle
357    {
358      int i;
359       int rle=(b+1)&0xff;
360
361       for(i=0;i<rle;++i)
362       {
363         tram[dst_offset+destl] = lastb;
364         dirty_tileram[(dst_offset+destl)/0x40] = 1;
365
366         dst_offset++;
367          ++l;
368       }
369       lastb2=0xffff;
370
371       return l;
372    }
373    else
374    {
375       lastb2=lastb;
376       lastb=b;
377      tram[dst_offset+destl] = b;
378      dirty_tileram[(dst_offset+destl)/0x40] = 1;
379
380       return 1;
381    }
382 }
383
384
385static WRITE16_HANDLER(srmp6_dma_w)
164WRITE16_HANDLER( srmp6_input_select_w )
386165{
387   COMBINE_DATA(&dmaram[offset]);
388   if(offset==13 && dmaram[offset]==0x40)
389   {
390      UINT32 srctab=2*((((UINT32)dmaram[5])<<16)|dmaram[4]);
391      UINT32 srcdata=2*((((UINT32)dmaram[11])<<16)|dmaram[10]);
392      UINT32 len=(((((UINT32)dmaram[7])<<16)|dmaram[6])+1); //??? WRONG!
393      int tempidx=0;
394
395      /* show params */
396#if SRMP6_VERBOSE
397      printf("DMA! %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x\n",
398            dmaram[0x00/2],
399            dmaram[0x02/2],
400            dmaram[0x04/2],
401            dmaram[0x06/2],
402            dmaram[0x08/2],
403            dmaram[0x0a/2],
404            dmaram[0x0c/2],
405            dmaram[0x0e/2],
406            dmaram[0x10/2],
407            dmaram[0x12/2],
408            dmaram[0x14/2],
409            dmaram[0x16/2],
410            dmaram[0x18/2],
411            dmaram[0x1a/2]);
412#endif
413
414      destl=dmaram[9]*0x100000;
415
416      lastb=0xfffe;
417      lastb2=0xffff;
418
419      while(1)
420      {
421         int i;
422         UINT8 ctrl=memory_region(REGION_USER2)[srcdata];
423          ++srcdata;
424
425         for(i=0;i<8;++i)
426         {
427            UINT8 p=memory_region(REGION_USER2)[srcdata];
428
429            if(ctrl&0x80)
430            {
431               UINT8 real_byte;
432               p&=0x7f;
433               real_byte = memory_region(REGION_USER2)[srctab+p*2];
434               tempidx+=process(real_byte,tempidx);
435               real_byte = memory_region(REGION_USER2)[srctab+p*2+1];//px[DMA_XOR((current_table_address+p*2+1))];
436               tempidx+=process(real_byte,tempidx);
437             }
438             else
439             {
440                tempidx+=process(p,tempidx);
441             }
442
443             ctrl<<=1;
444             ++srcdata;
445
446
447            if(tempidx>=len)
448            {
449#if SRMP6_VERBOSE
450               printf("%x\n",srcdata);
451#endif
452               return;
453            }
454          }
455      }
456   }
166   srmp6_input_select = data & 0x0f;
457167}
458168
459/* if tileram is actually bigger than the mapped area, how do we access the rest? */
460static READ16_HANDLER(tileram_r)
169READ16_HANDLER( srmp6_inputs_r )
461170{
462//  return tileram[offset];
463   return 0x0000;
464}
171   if (offset == 0)         // DSW
172      return readinputport(4);
465173
466static WRITE16_HANDLER(tileram_w)
467{
468   //UINT16 tmp;
469//  COMBINE_DATA(&tileram[offset]);
470
471   /* are the DMA registers enabled some other way, or always mapped here, over RAM? */
472   if (offset >= 0xfff00/2 && offset <= 0xfff1a/2 )
174   switch(srmp6_input_select)   // inputs
473175   {
474      offset &=0x1f;
475      srmp6_dma_w(offset,data,mem_mask);
176      case 1<<0: return readinputport(0);
177      case 1<<1: return readinputport(1);
178      case 1<<2: return readinputport(2);
179      case 1<<3: return readinputport(3);
476180   }
181
182   return 0;
477183}
184
478185static ADDRESS_MAP_START( srmp6, ADDRESS_SPACE_PROGRAM, 16 )
479186   AM_RANGE(0x000000, 0x0fffff) AM_ROM
480187   AM_RANGE(0x200000, 0x23ffff) AM_RAM               // work RAM
r1037r1038
482189   AM_RANGE(0x800000, 0x9fffff) AM_ROM AM_REGION(REGION_USER1, 0)
483190
484191   AM_RANGE(0x300000, 0x300005) AM_READWRITE(srmp6_inputs_r, srmp6_input_select_w)      // inputs
485   AM_RANGE(0x480000, 0x480fff) AM_READWRITE(MRA16_RAM, paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
192   AM_RANGE(0x480000, 0x480fff) AM_READWRITE(MRA16_RAM, paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
486193   AM_RANGE(0x4d0000, 0x4d0001) AM_READWRITE(watchdog_reset16_r, watchdog_reset16_w)   // watchdog
487194
488195   // OBJ RAM: checked [$400000-$47dfff]
489   AM_RANGE(0x400000, 0x47ffff) AM_RAM AM_BASE(&sprram)
196   AM_RANGE(0x400000, 0x47dfff) AM_RAM AM_BASE(&sprite_ram)   // 512 sprites & character list
197//  AM_RANGE(0x402000, 0x40200f) AM_RAM // set by routine $11c48
198//  AM_RANGE(0x402010, 0x40806f) AM_RAM // set by routine $11bf6 - 2nd sprite RAM maybe ?
199//  AM_RANGE(0x412000, 0x416ebf) AM_RAM // probably larger
490200
491201   // CHR RAM: checked [$500000-$5fffff]
492   AM_RANGE(0x500000, 0x5fffff) AM_READWRITE(tileram_r,tileram_w)//AM_RAM AM_BASE(&tileram)
493//  AM_RANGE(0x5fff00, 0x5fffff) AM_WRITE(dma_w) AM_BASE(&dmaram)
494202
203   AM_RANGE(0x5fff00, 0x5fff1f) AM_WRITE(gfx_decode_w) AM_BASE(&dec_regs)// ? see routine $5ca8, video_regs related ???
204   AM_RANGE(0x500000, 0x5fffff) AM_RAM
205//  AM_RANGE(0x500000, 0x505cff) AM_RAM
206//  AM_RANGE(0x505d00, 0x5fffff) AM_RAM
207
495208   AM_RANGE(0x4c0000, 0x4c006f) AM_READWRITE(video_regs_r, video_regs_w) AM_BASE(&video_regs)   // ? gfx regs ST-0026 NiLe
496//  AM_RANGE(0x4e0000, 0x4e00ff) AM_READWRITE(sound_regs_r, sound_regs_w) AM_BASE(&sound_regs)  // ? sound regs (data) ST-0026 NiLe
497//  AM_RANGE(0x4e0100, 0x4e0101) AM_READWRITE(sndctrl_reg_r, sndctrl_reg_w)                     // ? sound reg  (ctrl) ST-0026 NiLe
209   AM_RANGE(0x4e0000, 0x4e00ff) AM_READWRITE(sound_regs_r, sound_regs_w) AM_BASE(&sound_regs)  // ? sound regs (data) ST-0026 NiLe
210   AM_RANGE(0x4e0100, 0x4e0101) AM_READWRITE(sndctrl_reg_r, sndctrl_reg_w)                     // ? sound reg  (ctrl) ST-0026 NiLe
498211//  AM_RANGE(0x4e0110, 0x4e0111) AM_NOP // ? accessed once ($268dc, written $b.w)
499//  AM_RANGE(0x5fff00, 0x5fff1f) AM_RAM // ? see routine $5ca8, video_regs related ???
500212
213
501214//  AM_RANGE(0xf00004, 0xf00005) AM_RAM // ?
502215//  AM_RANGE(0xf00006, 0xf00007) AM_RAM // ?
503
216   AM_RANGE(0xfffffe, 0xffffff) AM_NOP
504217ADDRESS_MAP_END
505218
506219
r1037r1038
594307   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
595308   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
596309   PORT_SERVICE( 0x8000, IP_ACTIVE_LOW )
310
597311INPUT_PORTS_END
598312
599313/***************************************************************************
600314    Machine driver
601315***************************************************************************/
602316
603INTERRUPT_GEN(srmp6_interrupt)
604{
605   if(!cpu_getiloops())
606   {
607      cpunum_set_input_line(0,3,HOLD_LINE);
608   }
609   else
610   {
611      cpunum_set_input_line(0,4,HOLD_LINE);
612   }
613}
614
615317static MACHINE_DRIVER_START( srmp6 )
616318   MDRV_CPU_ADD(M68000, 16000000)
617319   MDRV_CPU_PROGRAM_MAP(srmp6,0)
618   MDRV_CPU_VBLANK_INT(srmp6_interrupt,2)
320   MDRV_CPU_VBLANK_INT(irq4_line_hold,1) // don't trigger IT 3 for now...
619321
620322   MDRV_SCREEN_REFRESH_RATE(60)
621323   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
622324
623325   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
624326   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
625   MDRV_SCREEN_SIZE(64*8, 64*8)
626   MDRV_SCREEN_VISIBLE_AREA(0*8, 340, 2*8, 256)
327   MDRV_SCREEN_SIZE(0x150,0xf0)
328   MDRV_SCREEN_VISIBLE_AREA(0*8, 42*8-1, 0*8, 30*8-1)
627329   MDRV_PALETTE_LENGTH(0x800)
628330
629331   MDRV_VIDEO_START(srmp6)
r1037r1038
658360   ROM_REGION( 0x200000, REGION_USER1, 0 ) /* 68000 Data */
659361   ROM_LOAD( "sx011-09.10", 0x000000, 0x200000, CRC(58f74438) SHA1(a256e39ca0406e513ab4dbd812fb0b559b4f61f2) )
660362
661    /* these are accessed directly by the 68k, DMA device etc.  NOT decoded */
363   ROM_REGION( 0xc00000, REGION_SOUND1, 0) /* Samples */
364   ROM_LOAD( "sx011-08.15", 0x0000000, 0x400000, CRC(01b3b1f0) SHA1(bbd60509c9ba78358edbcbb5953eafafd6e2eaf5) ) // CHR00
365   ROM_LOAD( "sx011-07.16", 0x0400000, 0x400000, CRC(26e57dac) SHA1(91272268977c5fbff7e8fbe1147bf108bd2ed321) ) // CHR01
366   ROM_LOAD( "sx011-06.17", 0x0800000, 0x400000, CRC(220ee32c) SHA1(77f39b54891c2381b967534b0f6d380962eadcae) ) // CHR02
367
368    /* CHRxx loaded here undecoded for ROM Check */
662369   ROM_REGION( 0x2000000, REGION_USER2, 0)   /* Banked ROM */
663   ROM_LOAD16_WORD_SWAP( "sx011-08.15", 0x0000000, 0x0400000, CRC(01b3b1f0) SHA1(bbd60509c9ba78358edbcbb5953eafafd6e2eaf5) ) // CHR00
664   ROM_LOAD16_WORD_SWAP( "sx011-07.16", 0x0400000, 0x0400000, CRC(26e57dac) SHA1(91272268977c5fbff7e8fbe1147bf108bd2ed321) ) // CHR01
665   ROM_LOAD16_WORD_SWAP( "sx011-06.17", 0x0800000, 0x0400000, CRC(220ee32c) SHA1(77f39b54891c2381b967534b0f6d380962eadcae) ) // CHR02
666   ROM_LOAD16_WORD_SWAP( "sx011-05.18", 0x0c00000, 0x0400000, CRC(87e5fea9) SHA1(abd751b5744d6ac7e697774ea9a7f7455bf3ac7c) ) // CHR03
667   ROM_LOAD16_WORD_SWAP( "sx011-04.19", 0x1000000, 0x0400000, CRC(e90d331e) SHA1(d8afb1497cec8fe6de10d23d49427e11c4c57910) ) // CHR04
668   ROM_LOAD16_WORD_SWAP( "sx011-03.20", 0x1400000, 0x0400000, CRC(f1f24b35) SHA1(70d6848f77940331e1be8591a33d62ac22a3aee9) ) // CHR05
669   ROM_LOAD16_WORD_SWAP( "sx011-02.21", 0x1800000, 0x0400000, CRC(c56d7e50) SHA1(355c64b38e7b266f386b9c0b906c8581fc15374b) ) // CHR06
670   ROM_LOAD16_WORD_SWAP( "sx011-01.22", 0x1c00000, 0x0400000, CRC(785409d1) SHA1(3e31254452a30d929161a1ea3a3daa69de058364) ) // CHR07
370   ROM_LOAD( "sx011-08.15", 0x0000000, 0x400000, CRC(01b3b1f0) SHA1(bbd60509c9ba78358edbcbb5953eafafd6e2eaf5) ) // CHR00
371   ROM_LOAD( "sx011-07.16", 0x0400000, 0x400000, CRC(26e57dac) SHA1(91272268977c5fbff7e8fbe1147bf108bd2ed321) ) // CHR01
372   ROM_LOAD( "sx011-06.17", 0x0800000, 0x400000, CRC(220ee32c) SHA1(77f39b54891c2381b967534b0f6d380962eadcae) ) // CHR02
373   ROM_LOAD( "sx011-05.18", 0x0c00000, 0x400000, CRC(87e5fea9) SHA1(abd751b5744d6ac7e697774ea9a7f7455bf3ac7c) ) // CHR03
374   ROM_LOAD( "sx011-04.19", 0x1000000, 0x400000, CRC(e90d331e) SHA1(d8afb1497cec8fe6de10d23d49427e11c4c57910) ) // CHR04
375   ROM_LOAD( "sx011-03.20", 0x1400000, 0x400000, CRC(f1f24b35) SHA1(70d6848f77940331e1be8591a33d62ac22a3aee9) ) // CHR05
376   ROM_LOAD( "sx011-02.21", 0x1800000, 0x400000, CRC(c56d7e50) SHA1(355c64b38e7b266f386b9c0b906c8581fc15374b) ) // CHR06
377   ROM_LOAD( "sx011-01.22", 0x1c00000, 0x400000, CRC(785409d1) SHA1(3e31254452a30d929161a1ea3a3daa69de058364) ) // CHR07
378
379
380   ROM_REGION( 0x1400000, REGION_USER3, 0)
381   ROM_LOAD16_WORD_SWAP( "sx011-05.18", 0x0000000, 0x400000, CRC(87e5fea9) SHA1(abd751b5744d6ac7e697774ea9a7f7455bf3ac7c) ) // CHR03
382   ROM_LOAD16_WORD_SWAP( "sx011-04.19", 0x0400000, 0x400000, CRC(e90d331e) SHA1(d8afb1497cec8fe6de10d23d49427e11c4c57910) ) // CHR04
383   ROM_LOAD16_WORD_SWAP( "sx011-03.20", 0x0800000, 0x400000, CRC(f1f24b35) SHA1(70d6848f77940331e1be8591a33d62ac22a3aee9) ) // CHR05
384   ROM_LOAD16_WORD_SWAP( "sx011-02.21", 0x0c00000, 0x400000, CRC(c56d7e50) SHA1(355c64b38e7b266f386b9c0b906c8581fc15374b) ) // CHR06
385   ROM_LOAD16_WORD_SWAP( "sx011-01.22", 0x1000000, 0x400000, CRC(785409d1) SHA1(3e31254452a30d929161a1ea3a3daa69de058364) ) // CHR07
386
671387ROM_END
672388
673389
r1037r1038
685401***************************************************************************/
686402
687403/*GAME( YEAR,NAME,PARENT,MACHINE,INPUT,INIT,MONITOR,COMPANY,FULLNAME,FLAGS)*/
688GAME( 1995, srmp6, 0, srmp6, srmp6, srmp6, ROT0, "Seta", "Super Real Mahjong P6 (Japan)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND)
404GAME( 1995, srmp6, 0, srmp6, srmp6, srmp6, ROT0, "Seta", "Super Real Mahjong P6 (Japan)",GAME_NO_SOUND)
689405
src/mame/drivers/konamim2.c
r1037r1038
181181   //return 0;
182182}
183183
184#ifdef UNUSED_FUNCTION
184185static READ64_HANDLER(unk2_r)
185186{
186187   if (!(mem_mask & U64(0xffffffff00000000)))
r1037r1038
189190   }
190191   return 0;
191192}
193#endif
192194
193195static UINT64 unk3 = -1;
194196static READ64_HANDLER(unk3_r)
src/mame/drivers/comebaby.c
r1037r1038
1010  Very little is known about the actual PC at this time, and the driver is
1111  just a skeleton placeholder for the CHD dump of the hard disk.
1212
13  The donor PC looks like a standard Windows98 setup.
14  The only exceptions I see are that there's a game logo.sys/logo.bmp in the
15  root directory to hide the Windows98 startup screen, and a shortcut to
16  the game in the startup programs.
17  Also of interest, Windows98 was installed from a setup folder on the HD.
18  To me this hints that there may have been some expectation of the disk
19  being plugged into random hardware.
20
21  The game is pretty much standard PC game running on Windows98 PC.
22  It uses DirectSound and the Microsoft MCI interfaces and Glide for video.
23  The PC that the game was dumped from has Sound Blaster and Ensoniq drivers,
24  but it works fine with some other sound configurations.
25  The donor PC has a 3dfxvoodoo3 driver installation directory, but it works
26  fine with a Voodoo4 4500.
27
28  The game itself has some protection, it expects a file C:\\WINDOWS\win386p.swp of 84 bytes
29  to have the hard disk volume serial number in ascii number (not hex) format at offset 4.
30
31  The game appears to use parallel port (0x378,0x379)for I/O.
32  The direct port access means it won't run on XP
33  For the controls, it writes a device select to 0x378, and reads the device value from 0x379.
34  There is some other output, maybe lights?
35   --------------------------------------------
36  |SELECT|RETURN                               |
37  |--------------------------------------------|
38  | 0x8  | self test/protection, return 5      |
39  | 0x0  | P1 4 way joystick                   |
40  |      | ----x--- right                      |
41  |      | -----x-- left                       |
42  |      | ------x- down                       |
43  |      | -------x up                         |
44  | 0x1  | P1 buttons                          |
45  |      | -----x-- C+D (is also start button) |
46  |      | ------x- B                          |
47  |      | -------x A                          |
48  | 0x2  | P2 joystick (as P1)                 |
49  | 0x3  | P2 buttons  (as P1)                 |
50  | 0x4  | Coin/Service                        |
51  |      | -----x-- Coin                       |
52  |      | ------x- Coin                       |
53  |      | -------x Test                       |
54   --------------------------------------------
55
56  Easy enough to fix a broken game if you have the controls to plug into it.
1357*/
1458
1559#include "driver.h"
src/mame/drivers/genesis.c
r1037r1038
361361   return 0x0000;
362362}
363363
364WRITE16_HANDLER ( megaplay_68k_to_z80_w )
364WRITE16_HANDLER ( genesis_68k_to_z80_w )
365365{
366366   offset *= 2;
367367   offset &= 0x7fff;
368368
369369   /* Shared Ram */
370   if ((offset >= 0x0000) && (offset <= 0x1fff))
370   if ((offset >= 0x0000) && (offset <= 0x3fff))
371371   {
372372      offset &=0x1fff;
373373
r1037r1038
375375   if (ACCESSING_MSB) genesis_z80_ram[offset] = (data >> 8) & 0xff;
376376   }
377377
378   if ((offset >= 0x2000) && (offset <= 0x3fff))
379   {
380      offset &=0x1fff;
381378
382   if (ACCESSING_LSB) ic36_ram[offset+1] = data & 0xff;
383   if (ACCESSING_MSB) ic36_ram[offset] = (data >> 8) & 0xff;
384   }
385
386
387379   /* YM2610 */
388380   if ((offset >= 0x4000) && (offset <= 0x5fff))
389381   {
r1037r1038
642634   AM_RANGE(0x000000, 0x3fffff) AM_WRITE(MWA16_ROM)               /* Cartridge Program Rom */
643635   AM_RANGE(0xa10000, 0xa1001f) AM_WRITE(genesis_io_w) AM_BASE(&genesis_io_ram)            /* Genesis Input */
644636   AM_RANGE(0xa11000, 0xa11203) AM_WRITE(genesis_ctrl_w)
645   AM_RANGE(0xa00000, 0xa0ffff) AM_WRITE(megaplay_68k_to_z80_w)
637   AM_RANGE(0xa00000, 0xa0ffff) AM_WRITE(genesis_68k_to_z80_w)
646638   AM_RANGE(0xc00000, 0xc0001f) AM_WRITE(genesis_vdp_w)            /* VDP Access */
647639   AM_RANGE(0xfe0000, 0xfeffff) AM_WRITE(MWA16_BANK3)            /* Main Ram */
648640   AM_RANGE(0xff0000, 0xffffff) AM_WRITE(MWA16_RAM) AM_BASE(&genesis_68k_ram)/* Main Ram */
src/mame/drivers/trvmadns.c
r1037r1038
146146   tilemap_mark_all_tiles_dirty(bg_tilemap);
147147}
148148
149#ifdef UNUSED_FUNCTION
149150//WRONG!
150151static WRITE8_HANDLER( trvmadns_palette_w )
151152{
r1037r1038
159160
160161   palette_set_color_rgb(Machine, offset >> 1, pal4bit(r), pal4bit(g), pal4bit(b));
161162}
163#endif
162164
163165static WRITE8_HANDLER( w2 )
164166{
src/mame/drivers/backfire.c
r1037r1038
240240   return (EEPROM_read_bit()<<24) | readinputport(1) | (readinputport(1)<<16);
241241}
242242
243#ifdef UNUSED_FUNCTION
243244static READ32_HANDLER(backfire_control3_r)
244245{
245246//  logerror("%08x:Read eprom %08x (%08x)\n",activecpu_get_pc(),offset<<1,mem_mask);
246247   return (EEPROM_read_bit()<<24) | readinputport(2) | (readinputport(2)<<16);
247248}
249#endif
248250
249251
250252static WRITE32_HANDLER(backfire_eeprom_w)
src/mame/drivers/royalmah.c
r1037r1038
11/****************************************************************************
22
3Royal Mahjong (c) 1982 Falcon
3Royal Mahjong (c) 1981 Nichibutsu
44and many other Dyna/Dynax games running in similar bare-bones hardware
55
66driver by Zsolt Vasvari and Nicola Salmoria
r1037r1038
1313OSC:    18.432MHz and 8MHz
1414
1515----------------------------------------------------------------------------------------------------------
16Year + Game                 Board           CPU        Company             Notes
16Year + Game                  Board           CPU        Company             Notes
1717----------------------------------------------------------------------------------------------------------
1882 Royal Mahjong            FRM-03          Z80        Falcon
1986 Don Den Mahjong          D039198L-0      Z80        Dyna Electronics
2086 Watashiha Suzumechan                     Z80        Dyna Electronics
2187 Mahjong Diplomat         D0706088L1-0    Z80        Dynax
2287 Mahjong Studio 101       D1708228L1      Z80        Dynax
2387 Tonton                   D0908288L1-0    Z80        Dynax
2488 Mahjong Almond Pinky     D1401128L-0     Z80        Dynax
2589 Mahjong Derringer        D2203018L       Z80        Dynax               Larger palette
2690 Mahjong If..?            D29?            TLCS-90    Dynax               Larger palette
2792 Mahjong Cafe Time        D6310128L1-1    TLCS-90    Dynax               Larger palette, Real Time Clock
2895 Mahjong Tensinhai        D10010318L1     TLCS-90    Dynax               Larger palette, Real Time Clock
2996 Janputer '96                             Z80        Dynax               Larger palette, Real Time Clock
1881  Royal Mahjong                            Z80        Nichibutsu
1981? Open Mahjong                             Z80        Sapporo Mechanic
2082  Royal Mahjong            FRM-03          Z80        Falcon              bootleg
2186  Ippatsu Gyakuten                         Z80        Public/Paradais
2286  Don Den Mahjong          D039198L-0      Z80        Dyna Electronics
2386  Watashiha Suzumechan                     Z80        Dyna Electronics
2487  Mahjong Diplomat         D0706088L1-0    Z80        Dynax
2587  Mahjong Studio 101       D1708228L1      Z80        Dynax
2687  Tonton                   D0908288L1-0    Z80        Dynax
2788  Mahjong Almond Pinky     D1401128L-0     Z80        Dynax
2889  Mahjong Derringer        D2203018L       Z80        Dynax               Larger palette
2990  Mahjong If..?            D29?            TLCS-90    Dynax               Larger palette
3092  Mahjong Cafe Time        D6310128L1-1    TLCS-90    Dynax               Larger palette, Real Time Clock
3193  Mahjong Cafe Doll                        TLCS-90    Dynax               Undumped internal rom
3295  Mahjong Tensinhai        D10010318L1     TLCS-90    Dynax               Larger palette, Real Time Clock
3396  Janputer '96                             Z80        Dynax               Larger palette, Real Time Clock
3034----------------------------------------------------------------------------------------------------------
3135
3236TODO:
r1037r1038
376380   AM_RANGE( 0x11, 0x11 ) AM_READWRITE( input_port_10_r, input_port_select_w )
377381ADDRESS_MAP_END
378382
383static ADDRESS_MAP_START( ippatsu_iomap, ADDRESS_SPACE_IO, 8 )
384   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
385   AM_RANGE( 0x01, 0x01 ) AM_READ( AY8910_read_port_0_r )
386   AM_RANGE( 0x02, 0x02 ) AM_WRITE( AY8910_write_port_0_w )
387   AM_RANGE( 0x03, 0x03 ) AM_WRITE( AY8910_control_port_0_w )
388   AM_RANGE( 0x10, 0x10 ) AM_READWRITE( input_port_11_r, royalmah_palbank_w )
389   AM_RANGE( 0x11, 0x11 ) AM_READWRITE( input_port_10_r, input_port_select_w )
390   AM_RANGE( 0x12, 0x12 ) AM_READ( input_port_12_r )
391   AM_RANGE( 0x13, 0x13 ) AM_READ( input_port_13_r )
392ADDRESS_MAP_END
393
379394static ADDRESS_MAP_START( suzume_iomap, ADDRESS_SPACE_IO, 8 )
380395   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
381396   AM_RANGE( 0x01, 0x01 ) AM_READ( AY8910_read_port_0_r )
r1037r1038
26802695   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
26812696INPUT_PORTS_END
26822697
2698static INPUT_PORTS_START( ippatsu )
2699   PORT_START   /* P1 IN0 */
2700   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A )
2701   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E )
2702   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I )
2703   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M )
2704   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
2705   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
2706   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Credit Clear") PORT_CODE(KEYCODE_7)
2707   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Credit Clear") PORT_CODE(KEYCODE_8)
26832708
2709   PORT_START   /* P1 IN1 */
2710   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B )
2711   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F )
2712   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J )
2713   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N )
2714   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
2715   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET )
2716   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
2717
2718   PORT_START   /* P1 IN2 */
2719   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C )
2720   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G )
2721   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K )
2722   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
2723   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
2724   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
2725
2726   PORT_START   /* P1 IN3 */
2727   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D )
2728   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H )
2729   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L )
2730   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
2731   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
2732
2733   PORT_START   /* P1 IN4 */
2734   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE )
2735   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE )
2736   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP )
2737   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP )
2738   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG )
2739   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL )
2740   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
2741
2742   PORT_START   /* P2 IN0 */
2743   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A )PORT_PLAYER(2)
2744   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E )PORT_PLAYER(2)
2745   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I )PORT_PLAYER(2)
2746   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M )PORT_PLAYER(2)
2747   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )PORT_PLAYER(2)
2748   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
2749   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )   // "COIN2"
2750   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )   // "COIN1", but not working
2751
2752   PORT_START   /* P2 IN1 */
2753   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B )PORT_PLAYER(2)
2754   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F )PORT_PLAYER(2)
2755   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J )PORT_PLAYER(2)
2756   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N )PORT_PLAYER(2)
2757   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )PORT_PLAYER(2)
2758   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET )PORT_PLAYER(2)
2759   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
2760
2761   PORT_START   /* P2 IN2 */
2762   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C )PORT_PLAYER(2)
2763   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G )PORT_PLAYER(2)
2764   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K )PORT_PLAYER(2)
2765   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )PORT_PLAYER(2)
2766   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON )PORT_PLAYER(2)
2767   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
2768
2769   PORT_START   /* P2 IN3 */
2770   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D )PORT_PLAYER(2)
2771   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H )PORT_PLAYER(2)
2772   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L )PORT_PLAYER(2)
2773   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON )PORT_PLAYER(2)
2774   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
2775
2776   PORT_START   /* P2 IN4 */
2777   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE )PORT_PLAYER(2)
2778   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE )PORT_PLAYER(2)
2779   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP )PORT_PLAYER(2)
2780   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP )PORT_PLAYER(2)
2781   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG )PORT_PLAYER(2)
2782   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL )PORT_PLAYER(2)
2783   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
2784
2785   PORT_START   /* IN10 */
2786   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 )   /* "Note" ("Paper Money") = 10 Credits */
2787   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE3 )   /* Memory Reset */
2788   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE2 )   /* Analizer (Statistics) */
2789   PORT_SERVICE( 0x08, IP_ACTIVE_HIGH )
2790   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
2791
2792   PORT_START   /* DSW  (inport $10) */
2793   PORT_DIPNAME( 0x0f, 0x0f, "Pay Out Rate" )
2794   PORT_DIPSETTING(    0x0f, "96%" )
2795   PORT_DIPSETTING(    0x0e, "93%" )
2796   PORT_DIPSETTING(    0x0d, "90%" )
2797   PORT_DIPSETTING(    0x0c, "87%" )
2798   PORT_DIPSETTING(    0x0b, "84%" )
2799   PORT_DIPSETTING(    0x0a, "81%" )
2800   PORT_DIPSETTING(    0x09, "78%" )
2801   PORT_DIPSETTING(    0x08, "75%" )
2802   PORT_DIPSETTING(    0x07, "71%" )
2803   PORT_DIPSETTING(    0x06, "68%" )
2804   PORT_DIPSETTING(    0x05, "65%" )
2805   PORT_DIPSETTING(    0x04, "62%" )
2806   PORT_DIPSETTING(    0x03, "59%" )
2807   PORT_DIPSETTING(    0x02, "56%" )
2808   PORT_DIPSETTING(    0x01, "53%" )
2809   PORT_DIPSETTING(    0x00, "50%" )
2810   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
2811   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
2812   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2813   PORT_DIPNAME( 0x60, 0x60, "Maximum Bet" )
2814   PORT_DIPSETTING(    0x00, "1" )
2815   PORT_DIPSETTING(    0x20, "5" )
2816   PORT_DIPSETTING(    0x40, "7" )
2817   PORT_DIPSETTING(    0x60, "10" )
2818   PORT_DIPNAME( 0x80, 0x80, "First Chance" )
2819   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
2820   PORT_DIPSETTING(    0x80, DEF_STR( Yes ) )
2821
2822   PORT_START   /* DSW  (inport $12) */
2823   PORT_DIPNAME( 0x03, 0x03, "Cut" )
2824   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
2825   PORT_DIPSETTING(    0x02, "2 Bai" )
2826   PORT_DIPSETTING(    0x01, "3 Bai" )
2827   PORT_DIPSETTING(    0x03, "Yakuman" )
2828   PORT_DIPNAME( 0x0c, 0x0c, "Yakuman Bonus" )
2829   PORT_DIPSETTING(    0x00, "32" )
2830   PORT_DIPSETTING(    0x04, "100" )
2831   PORT_DIPSETTING(    0x08, "200" )
2832   PORT_DIPSETTING(    0x0c, "300" )
2833   PORT_DIPNAME( 0x30, 0x30, "Unknown 1-4&5*" )
2834   PORT_DIPSETTING(    0x00, "3" )
2835   PORT_DIPSETTING(    0x10, "4" )
2836   PORT_DIPSETTING(    0x20, "5" )
2837   PORT_DIPSETTING(    0x30, "6" )
2838   PORT_DIPNAME( 0x40, 0x40, "Unknown 1-6*" )
2839   PORT_DIPSETTING(    0x00, "3" )
2840   PORT_DIPSETTING(    0x40, "5" )
2841   PORT_DIPNAME( 0x80, 0x80, "Unknown 1-7" )
2842   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2843   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2844
2845   PORT_START   /* DSW  (inport $13) */
2846   PORT_DIPNAME( 0x01, 0x01, "Unknown 2-0*" )
2847   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
2848   PORT_DIPSETTING(    0x01, DEF_STR( Yes ) )
2849   PORT_DIPNAME( 0x02, 0x02, "Second Bonus" )
2850   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
2851   PORT_DIPSETTING(    0x02, DEF_STR( Yes ) )
2852   PORT_DIPNAME( 0x04, 0x04, "Allow Bets" )
2853   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
2854   PORT_DIPSETTING(    0x04, DEF_STR( Yes ) )
2855   PORT_DIPNAME( 0x08, 0x08, "Unknown 2-2" )
2856   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
2857   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2858   PORT_DIPNAME( 0x18, 0x18, "Unknown 2-3&4*" )
2859   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
2860   PORT_DIPSETTING(    0x18, "2" )
2861   PORT_DIPSETTING(    0x10, "4" )
2862   PORT_DIPSETTING(    0x08, "8" )
2863   PORT_DIPNAME( 0x20, 0x20, "Unknown 2-5" )
2864   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
2865   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2866   PORT_DIPNAME( 0x40, 0x40, "Unknown 2-6" )
2867   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2868   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2869   PORT_DIPNAME( 0x80, 0x80, "Unknown 2-7" )
2870   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2871   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2872INPUT_PORTS_END
2873
2874
26842875static struct AY8910interface ay8910_interface =
26852876{
26862877   royalmah_player_1_port_r,
r1037r1038
27252916   MDRV_CPU_IO_MAP(dondenmj_iomap,0)
27262917MACHINE_DRIVER_END
27272918
2919static MACHINE_DRIVER_START( ippatsu )
2920   MDRV_IMPORT_FROM(dondenmj)
2921   MDRV_CPU_MODIFY("main")
2922   MDRV_CPU_IO_MAP(ippatsu_iomap,0)
2923MACHINE_DRIVER_END
2924
27282925static void suzume_irq(void)
27292926{
27302927   if ( suzume_bank & 0x40 )
r1037r1038
28403037
28413038***************************************************************************/
28423039
3040/***************************************************************************
3041
3042Royal Mahjong
3043(c)1981 Nichibutsu
3044
3045CPU: Z80
3046Sound: AY-3-8910
3047OSC: 18.432MHz
3048
3049***************************************************************************/
3050
3051ROM_START( royalmj )
3052   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3053   ROM_LOAD( "1.p1", 0x0000, 0x1000, CRC(549544bb) SHA1(dfb221572c7bfd267a22c0a944830d5f127f9942) )
3054   ROM_LOAD( "2.p2", 0x1000, 0x1000, CRC(afc8a61e) SHA1(4134f6404f955838fc48fd0f87b83ebc75c1a021) )
3055   ROM_LOAD( "3.p3", 0x2000, 0x1000, CRC(5d33e54d) SHA1(bf5e0ad5177c086f1cea5c90d7273a841db941bc) )
3056   ROM_LOAD( "4.p4", 0x3000, 0x1000, CRC(91339560) SHA1(0fb4141e236ab57b3e915dadb982b28ca11d269f) )
3057   ROM_LOAD( "5.p5", 0x4000, 0x1000, CRC(cc9123a3) SHA1(75276045247a0c9ac5810be01f3b58ad63101f9b) )
3058   ROM_LOAD( "6.p6", 0x5000, 0x1000, CRC(92150a0f) SHA1(5c97ba5014abdba4afc78e02e7d90e6ca4d777ac) )
3059
3060   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3061   ROM_LOAD( "18s030n.6k", 0x0000, 0x0020, CRC(d3007282) SHA1(e4d863ab193e49208ed0f59dcddb1da0492314f6) )
3062ROM_END
3063
28433064ROM_START( royalmah )
28443065   ROM_REGION( 0x10000, REGION_CPU1, 0 )
28453066   ROM_LOAD( "rom1",       0x0000, 0x1000, CRC(69b37a62) SHA1(7792528754b0df4e11f4ebe33380b713ac7351a3) )
r1037r1038
28533074   ROM_LOAD( "f-rom.bpr",  0x0000, 0x0020, CRC(d3007282) SHA1(e4d863ab193e49208ed0f59dcddb1da0492314f6) )
28543075ROM_END
28553076
3077ROM_START( openmj )
3078   ROM_REGION( 0x7000, REGION_CPU1, ROMREGION_ERASEFF )
3079   ROM_LOAD( "10", 0x0000, 0x2000, CRC(4042920e) SHA1(19753bcb27ebf391ab824a45c6e41d956826a263) )
3080   ROM_LOAD( "20", 0x2000, 0x2000, CRC(8fa0f735) SHA1(645154d51c0679b953b9ffc2f1d3b8f2752a0796) )
3081   ROM_LOAD( "30", 0x4000, 0x2000, CRC(00045cd7) SHA1(0c32995753c1da14dacc8bc6c12dbcbdcae4e1b0) )
28563082
3083   ROM_REGION( 0x20, REGION_PROMS, 0 )
3084   ROM_LOAD( "82s123.prm", 0x00, 0x20, CRC(d3007282) SHA1(e4d863ab193e49208ed0f59dcddb1da0492314f6) )
3085ROM_END
3086
3087/****************************************************************************
3088
3089Ippatsu Gyakuten
3090(c)1986 Public Software / Paradais
3091
3092modified Royal Mahjong hardware
3093
3094CPU: Z80
3095Sound: AY-3-8910
3096
3097ROMs:
309811(27256)
309912(27128)
310082S123AN
3101
3102dumped by sayu
3103
3104****************************************************************************/
3105
3106ROM_START( ippatsu )
3107   ROM_REGION( 0x10000, REGION_CPU1, 0 )
3108   ROM_LOAD( "11", 0x0000, 0x8000, CRC(5f563be7) SHA1(2ce486777bd61a2de789683cd0c8abeefe31775b) )
3109   ROM_LOAD( "12", 0x8000, 0x4000, CRC(a09a43b0) SHA1(da12e669ccd036da817a69bd549e8668e6a45730) )
3110   ROM_RELOAD(     0xc000, 0x4000 )
3111
3112   ROM_REGION( 0x0020, REGION_PROMS, 0 )
3113   ROM_LOAD( "82s123an", 0x00, 0x20, CRC(3bde1bbd) SHA1(729498483943f960e38c4ada992b099b698b497a) )
3114ROM_END
3115
3116
28573117ROM_START( suzume )
28583118   ROM_REGION( 0x100000, REGION_CPU1, 0 )
28593119   ROM_LOAD( "p1.bin",     0x00000, 0x1000, CRC(e9706967) SHA1(2e3d78178623de6552c9036da90e02f240d94055) )
r1037r1038
31733433   ROM_LOAD( "d63-1.7f", 0x200, 0x200, CRC(e7410136) SHA1(54d3aec0d11485d4f419e76f9c4071ab9b817937) )
31743434ROM_END
31753435
3436ROM_START( cafedoll )
3437   ROM_REGION( 0x190000, REGION_CPU1, 0 )
3438   ROM_LOAD( "76xx.tmp90841", 0x00000, 0x02000, NO_DUMP )
3439   ROM_LOAD( "7601", 0x000000, 0x80000, CRC(20c80ad9) SHA1(e45edd101c6e26c0fa3c3f15f4a4152a853e41bd) )
3440   /* bank switched ROMs follow */
3441   ROM_RELOAD(       0x010000, 0x80000 )
3442   ROM_LOAD( "7602", 0x090000, 0x80000, CRC(f472960c) SHA1(cc2feb4374ba94035101114c73e1690cfeac9b91) )
3443   ROM_LOAD( "7603", 0x110000, 0x80000, CRC(c4293019) SHA1(afd717844e9e681ada14e80cd10dce0ed60d4259) )
31763444
3445   ROM_REGION( 0x400, REGION_PROMS, 0 )
3446   ROM_LOAD( "cafedoll.prom1", 0x000, 0x200, NO_DUMP )
3447   ROM_LOAD( "cafedoll.prom2", 0x200, 0x200, NO_DUMP )
3448ROM_END
3449
3450static DRIVER_INIT( ippatsu )   {   memory_set_bankptr(1, memory_region(REGION_CPU1) + 0x8000 );   }
3451
31773452static DRIVER_INIT( janptr96 )
31783453{
31793454   generic_nvram_size = 0x1000 * 9;
r1037r1038
31823457   memory_set_bankptr(3,generic_nvram);
31833458}
31843459
3185
3186GAME( 1982, royalmah, 0, royalmah, royalmah, 0,        ROT0, "Falcon",           "Royal Mahjong (Japan)",              0 )
3187GAME( 1986, dondenmj, 0, dondenmj, majs101b, 0,        ROT0, "Dyna Electronics", "Don Den Mahjong [BET] (Japan)",      0 )
3188GAME( 1986, suzume,   0, suzume,   suzume,   0,        ROT0, "Dyna Electronics", "Watashiha Suzumechan (Japan)",       0 )
3189GAME( 1987, mjdiplob, 0, mjdiplob, mjdiplob, 0,        ROT0, "Dynax",            "Mahjong Diplomat [BET] (Japan)",     0 )
3190GAME( 1987, tontonb,  0, tontonb,  tontonb,  0,        ROT0, "Dynax",            "Tonton [BET] (Japan)",               0 )
3191GAME( 1988, majs101b, 0, majs101b, majs101b, 0,        ROT0, "Dynax",            "Mahjong Studio 101 [BET] (Japan)",   0 )
3192GAME( 1988, mjapinky, 0, mjapinky, mjapinky, 0,        ROT0, "Dynax",            "Almond Pinky [BET] (Japan)",         0)
3193GAME( 1989, mjderngr, 0, mjderngr, majs101b, 0,        ROT0, "Dynax",            "Mahjong Derringer (Japan)",          0 )
3194GAME( 1990, mjifb,    0, mjifb,    mjifb,    0,        ROT0, "Dynax",            "Mahjong If...? [BET]",               0 )
3195GAME( 1992, cafetime, 0, cafetime, cafetime, 0,        ROT0, "Dynax",            "Mahjong Cafe Time",                  0 )
3196GAME( 1995, mjtensin, 0, mjtensin, mjtensin, 0,        ROT0, "Dynax",            "Mahjong Tensinhai (Japan)",          GAME_NOT_WORKING )
3197GAME( 1996, janptr96, 0, janptr96, janptr96, janptr96, ROT0, "Dynax",            "Janputer '96 (Japan)",               0 )
3460GAME( 1981,  royalmj,  0,        royalmah, royalmah, 0,        ROT0, "Nichibutsu",                 "Royal Mahjong (Japan, v1.13)",          0 )
3461GAME( 1981?, openmj,   royalmj,  royalmah, royalmah, 0,        ROT0, "Sapporo Mechanic",           "Open Mahjong [BET] (Japan)",            0 )
3462GAME( 1982,  royalmah, royalmj,  royalmah, royalmah, 0,        ROT0, "bootleg",                    "Royal Mahjong (Falcon bootleg, v1.01)", 0 )
3463GAME( 1986,  dondenmj, 0,        dondenmj, majs101b, 0,        ROT0, "Dyna Electronics",           "Don Den Mahjong [BET] (Japan)",         0 )
3464GAME( 1986,  ippatsu,  0,        ippatsu,  ippatsu,  ippatsu,  ROT0, "Public Software / Paradais", "Ippatsu Gyakuten [BET] (Japan)",        0 )
3465GAME( 1986,  suzume,   0,        suzume,   suzume,   0,        ROT0, "Dyna Electronics",           "Watashiha Suzumechan (Japan)",          0 )
3466GAME( 1987,  mjdiplob, 0,        mjdiplob, mjdiplob, 0,        ROT0, "Dynax",                      "Mahjong Diplomat [BET] (Japan)",        0 )
3467GAME( 1987,  tontonb,  0,        tontonb,  tontonb,  0,        ROT0, "Dynax",                      "Tonton [BET] (Japan)",                  0 )
3468GAME( 1988,  majs101b, 0,        majs101b, majs101b, 0,        ROT0, "Dynax",                      "Mahjong Studio 101 [BET] (Japan)",      0 )
3469GAME( 1988,  mjapinky, 0,        mjapinky, mjapinky, 0,        ROT0, "Dynax",                      "Almond Pinky [BET] (Japan)",            0 )
3470GAME( 1989,  mjderngr, 0,        mjderngr, majs101b, 0,        ROT0, "Dynax",                      "Mahjong Derringer (Japan)",             0 )
3471GAME( 1990,  mjifb,    0,        mjifb,    mjifb,    0,        ROT0, "Dynax",                      "Mahjong If...? [BET]",                  0 )
3472GAME( 1992,  cafetime, 0,        cafetime, cafetime, 0,        ROT0, "Dynax",                      "Mahjong Cafe Time",                     0 )
3473GAME( 1993,  cafedoll, 0,        mjifb,    mjifb,    0,        ROT0, "Dynax",                      "Mahjong Cafe Doll (Japan)",             GAME_NOT_WORKING )
3474GAME( 1995,  mjtensin, 0,        mjtensin, mjtensin, 0,        ROT0, "Dynax",                      "Mahjong Tensinhai (Japan)",             GAME_NOT_WORKING )
3475GAME( 1996,  janptr96, 0,        janptr96, janptr96, janptr96, ROT0, "Dynax",                      "Janputer '96 (Japan)",                  0 )
src/tools/regrep.c
r1037r1038
153153/* HTML helpers */
154154static FILE *create_file_and_output_header(const char *filename, const char *title, const char *subtitle);
155155static void output_footer_and_close_file(FILE *file);
156static int copy_file(const char *srcdir, const char *srcname, const char *dstdir, const char *dstname);
157156
158157/* report generators */
159158static void output_report(const char *dirname, summary_file *filelist);
r1037r1038
639638}
640639
641640
642/*-------------------------------------------------
643    copy_file - copy a file from source directory
644    to the destination directory
645-------------------------------------------------*/
646641
647static int copy_file(const char *srcdir, const char *srcname, const char *dstdir, const char *dstname)
648{
649   const char *srcfilename = alloc_filename(srcdir, srcname);
650   const char *dstfilename = alloc_filename(dstdir, dstname);
651   FILE *srcfile, *dstfile;
652   void *buffer;
653   int bytes;
654
655   /* open the source for read */
656   srcfile = fopen(srcfilename, "rb");
657   if (srcfile == NULL)
658   {
659      free((void *)srcfilename);
660      free((void *)dstfilename);
661      return 1;
662   }
663   free((void *)srcfilename);
664
665   /* open the destination for write */
666   dstfile = fopen(dstfilename, "wb");
667   if (dstfile == NULL)
668   {
669      fprintf(stderr, "Could not create file '%s'\n", dstfilename);
670      free((void *)dstfilename);
671      fclose(srcfile);
672      return 1;
673   }
674   free((void *)dstfilename);
675
676   /* determine source size */
677   fseek(srcfile, 0, SEEK_END);
678   bytes = ftell(srcfile);
679   fseek(srcfile, 0, SEEK_SET);
680   buffer = malloc(bytes);
681   if (buffer == NULL)
682   {
683      fprintf(stderr, "Couldn't allocate %d bytes for file copy\n", bytes);
684      fclose(srcfile);
685      fclose(dstfile);
686      return 1;
687   }
688
689   /* read/write the data */
690   fread(buffer, 1, bytes, srcfile);
691   fwrite(buffer, 1, bytes, dstfile);
692   fclose(srcfile);
693   fclose(dstfile);
694   return 0;
695}
696
697
698
699642/***************************************************************************
700643    REPORT GENERATORS
701644***************************************************************************/
src/osd/windows/input.c
r1037r1038
238238// device list management
239239static void device_list_poll_devices(device_info *devlist_head);
240240static void device_list_reset_devices(device_info *devlist_head);
241static int device_list_count(device_info *devlist_head);
242241
243242// generic device management
244243static device_info *generic_device_alloc(device_info **devlist_head_ptr, const TCHAR *name);
r1037r1038
780779
781780
782781//============================================================
783//  device_list_count
784//============================================================
785
786static int device_list_count(device_info *devlist_head)
787{
788   device_info *curdev;
789   int count = 0;
790
791   for (curdev = devlist_head; curdev != NULL; curdev = curdev->next)
792      count++;
793   return count;
794}
795
796
797//============================================================
798782//  generic_device_alloc
799783//============================================================
800784
src/osd/windows/debugwin.c
r1037r1038
8787   ID_1_BYTE_CHUNKS,
8888   ID_2_BYTE_CHUNKS,
8989   ID_4_BYTE_CHUNKS,
90   ID_8_BYTE_CHUNKS,
91   ID_LOGICAL_ADDRESSES,
92   ID_PHYSICAL_ADDRESSES,
9093   ID_REVERSE_VIEW,
9194   ID_INCREASE_MEM_WIDTH,
9295   ID_DECREASE_MEM_WIDTH,
r1037r1038
211214
212215static LRESULT CALLBACK debug_edit_proc(HWND wnd, UINT message, WPARAM wparam, LPARAM lparam);
213216
214static void generic_create_window(int type);
217//static void generic_create_window(int type);
215218static void generic_recompute_children(debugwin_info *info);
216219
217220static void memory_create_window(void);
r1037r1038
269272
270273   switch (message.message)
271274   {
272      // special case for quit
273      case WM_QUIT:
274         mame_schedule_exit(Machine);
275         break;
276
277275      // check for F10 -- we need to capture that ourselves
278276      case WM_SYSKEYDOWN:
279277      case WM_SYSKEYUP:
r1037r1038
283281
284282      // process everything else
285283      default:
286         TranslateMessage(&message);
287         DispatchMessage(&message);
284         winwindow_dispatch_message(&message);
288285         break;
289286   }
290287
r1037r1038
16081605//  generic_create_window
16091606//============================================================
16101607
1608#ifdef UNUSED_FUNCTION
16111609static void generic_create_window(int type)
16121610{
16131611   debugwin_info *info;
r1037r1038
16291627   SetWindowPos(info->wnd, HWND_TOP, 100, 100, info->maxwidth, 200, SWP_SHOWWINDOW);
16301628   generic_recompute_children(info);
16311629}
1630#endif
16321631
16331632
16341633
r1037r1038
17311730               memset(ci, 0, sizeof(*ci));
17321731               ci->cpunum = cpunum;
17331732               ci->spacenum = spacenum;
1734               ci->prefsize = MIN(cpuinfo->space[spacenum].databytes, 4);
1733               ci->prefsize = MIN(cpuinfo->space[spacenum].databytes, 8);
17351734               sprintf(ci->name, "CPU #%d (%s) %s memory", cpunum, cpunum_name(cpunum), address_space_names[spacenum]);
17361735               *tail = ci;
17371736               tail = &ci->next;
r1037r1038
17621761               little_endian = (cpuinfo->endianness == CPU_IS_LE);
17631762            }
17641763         }
1765         ci->prefsize = MIN(width, 4);
1764         ci->prefsize = MIN(width, 8);
17661765         ci->offset_xor = width - 1;
17671766         ci->little_endian = little_endian;
17681767         strcpy(ci->name, memory_region_names[type - REGION_INVALID]);
r1037r1038
17901789         memset(ci, 0, sizeof(*ci));
17911790         ci->base = base;
17921791         ci->length = valcount * valsize;
1793         ci->prefsize = MIN(valsize, 4);
1792         ci->prefsize = MIN(valsize, 8);
17941793         ci->little_endian = TRUE;
17951794         strcpy(ci->name, strrchr(name, '/') + 1);
17961795         *tail = ci;
r1037r1038
18421841   AppendMenu(optionsmenu, MF_ENABLED, ID_1_BYTE_CHUNKS, TEXT("1-byte chunks\tCtrl+1"));
18431842   AppendMenu(optionsmenu, MF_ENABLED, ID_2_BYTE_CHUNKS, TEXT("2-byte chunks\tCtrl+2"));
18441843   AppendMenu(optionsmenu, MF_ENABLED, ID_4_BYTE_CHUNKS, TEXT("4-byte chunks\tCtrl+4"));
1844   AppendMenu(optionsmenu, MF_ENABLED, ID_8_BYTE_CHUNKS, TEXT("8-byte chunks\tCtrl+8"));
18451845   AppendMenu(optionsmenu, MF_DISABLED | MF_SEPARATOR, 0, TEXT(""));
1846   AppendMenu(optionsmenu, MF_ENABLED, ID_LOGICAL_ADDRESSES, TEXT("Logical Addresses\tCtrl+L"));
1847   AppendMenu(optionsmenu, MF_ENABLED, ID_PHYSICAL_ADDRESSES, TEXT("Physical Addresses\tCtrl+Y"));
1848   AppendMenu(optionsmenu, MF_DISABLED | MF_SEPARATOR, 0, TEXT(""));
18461849   AppendMenu(optionsmenu, MF_ENABLED, ID_REVERSE_VIEW, TEXT("Reverse View\tCtrl+R"));
18471850   AppendMenu(optionsmenu, MF_DISABLED | MF_SEPARATOR, 0, TEXT(""));
18481851   AppendMenu(optionsmenu, MF_ENABLED, ID_INCREASE_MEM_WIDTH, TEXT("Increase bytes per line\tCtrl+P"));
r1037r1038
19891992   CheckMenuItem(GetMenu(info->wnd), ID_1_BYTE_CHUNKS, MF_BYCOMMAND | (debug_view_get_property_UINT32(info->view[0].view, DVP_MEM_BYTES_PER_CHUNK) == 1? MF_CHECKED : MF_UNCHECKED));
19901993   CheckMenuItem(GetMenu(info->wnd), ID_2_BYTE_CHUNKS, MF_BYCOMMAND | (debug_view_get_property_UINT32(info->view[0].view, DVP_MEM_BYTES_PER_CHUNK) == 2 ? MF_CHECKED : MF_UNCHECKED));
19911994   CheckMenuItem(GetMenu(info->wnd), ID_4_BYTE_CHUNKS, MF_BYCOMMAND | (debug_view_get_property_UINT32(info->view[0].view, DVP_MEM_BYTES_PER_CHUNK) == 4 ? MF_CHECKED : MF_UNCHECKED));
1995   CheckMenuItem(GetMenu(info->wnd), ID_8_BYTE_CHUNKS, MF_BYCOMMAND | (debug_view_get_property_UINT32(info->view[0].view, DVP_MEM_BYTES_PER_CHUNK) == 8 ? MF_CHECKED : MF_UNCHECKED));
1996   CheckMenuItem(GetMenu(info->wnd), ID_LOGICAL_ADDRESSES, MF_BYCOMMAND | (debug_view_get_property_UINT32(info->view[0].view, DVP_MEM_NO_TRANSLATION) ? MF_UNCHECKED : MF_CHECKED));
1997   CheckMenuItem(GetMenu(info->wnd), ID_PHYSICAL_ADDRESSES, MF_BYCOMMAND | (debug_view_get_property_UINT32(info->view[0].view, DVP_MEM_NO_TRANSLATION) ? MF_CHECKED : MF_UNCHECKED));
19921998   CheckMenuItem(GetMenu(info->wnd), ID_REVERSE_VIEW, MF_BYCOMMAND | (debug_view_get_property_UINT32(info->view[0].view, DVP_MEM_REVERSE_VIEW) ? MF_CHECKED : MF_UNCHECKED));
19931999}
19942000
r1037r1038
20502056               memory_update_checkmarks(info);
20512057               return 1;
20522058
2059            case ID_8_BYTE_CHUNKS:
2060               debug_view_begin_update(info->view[0].view);
2061               debug_view_set_property_UINT32(info->view[0].view, DVP_MEM_BYTES_PER_CHUNK, 8);
2062               debug_view_end_update(info->view[0].view);
2063               memory_update_checkmarks(info);
2064               return 1;
2065
2066            case ID_LOGICAL_ADDRESSES:
2067               debug_view_begin_update(info->view[0].view);
2068               debug_view_set_property_UINT32(info->view[0].view, DVP_MEM_NO_TRANSLATION, FALSE);
2069               debug_view_end_update(info->view[0].view);
2070               memory_update_checkmarks(info);
2071               return 1;
2072
2073            case ID_PHYSICAL_ADDRESSES:
2074               debug_view_begin_update(info->view[0].view);
2075               debug_view_set_property_UINT32(info->view[0].view, DVP_MEM_NO_TRANSLATION, TRUE);
2076               debug_view_end_update(info->view[0].view);
2077               memory_update_checkmarks(info);
2078               return 1;
2079
20532080            case ID_REVERSE_VIEW:
20542081               debug_view_begin_update(info->view[0].view);
20552082               debug_view_set_property_UINT32(info->view[0].view, DVP_MEM_REVERSE_VIEW, !debug_view_get_property_UINT32(info->view[0].view, DVP_MEM_REVERSE_VIEW));
r1037r1038
20982125            SendMessage(info->wnd, WM_COMMAND, ID_4_BYTE_CHUNKS, 0);
20992126            return 1;
21002127
2128         case '8':
2129            SendMessage(info->wnd, WM_COMMAND, ID_8_BYTE_CHUNKS, 0);
2130            return 1;
2131
2132         case 'L':
2133            SendMessage(info->wnd, WM_COMMAND, ID_LOGICAL_ADDRESSES, 0);
2134            return 1;
2135
2136         case 'Y':
2137            SendMessage(info->wnd, WM_COMMAND, ID_PHYSICAL_ADDRESSES, 0);
2138            return 1;
2139
21012140         case 'R':
21022141            SendMessage(info->wnd, WM_COMMAND, ID_REVERSE_VIEW, 0);
21032142            return 1;
src/osd/windows/window.c
r1037r1038
373373      {
374374         int dispatch = TRUE;
375375
376         if ((message.hwnd == NULL) || is_mame_window(message.hwnd))
376         if (message.hwnd == NULL || is_mame_window(message.hwnd))
377377         {
378378            switch (message.message)
379379            {
r1037r1038
388388                  dispatch = FALSE;
389389                  break;
390390
391               // special case for quit
392               case WM_QUIT:
393                  mame_schedule_exit(Machine);
394                  break;
395
396               // temporary pause from the window thread
397               case WM_USER_UI_TEMP_PAUSE:
398                  winwindow_ui_pause_from_main_thread(message.wParam);
399                  dispatch = FALSE;
400                  break;
401
402               // execute arbitrary function
403               case WM_USER_EXEC_FUNC:
404                  {
405                     void (*func)(void *) = (void (*)(void *)) message.wParam;
406                     void *param = (void *) message.lParam;
407                     func(param);
408                  }
409                  break;
410
411391               // forward mouse button downs to the input system
412392               case WM_LBUTTONDOWN:
413393                  wininput_handle_mouse_button(0, TRUE, GET_X_LPARAM(message.lParam), GET_Y_LPARAM(message.lParam));
r1037r1038
454434
455435         // dispatch if necessary
456436         if (dispatch)
457         {
458            TranslateMessage(&message);
459            DispatchMessage(&message);
460         }
437            winwindow_dispatch_message(&message);
461438      }
462439   } while (ui_temp_pause > 0);
463440
r1037r1038
468445
469446
470447//============================================================
448//  winwindow_dispatch_message
449//  (main thread)
450//============================================================
451
452void winwindow_dispatch_message(MSG *message)
453{
454   assert(GetCurrentThreadId() == main_threadid);
455
456   // dispatch our special communication messages
457   switch (message->message)
458   {
459      // special case for quit
460      case WM_QUIT:
461         mame_schedule_exit(Machine);
462         break;
463
464      // temporary pause from the window thread
465      case WM_USER_UI_TEMP_PAUSE:
466         winwindow_ui_pause_from_main_thread(message->wParam);
467         break;
468
469      // execute arbitrary function
470      case WM_USER_EXEC_FUNC:
471         {
472            void (*func)(void *) = (void (*)(void *)) message->wParam;
473            void *param = (void *) message->lParam;
474            func(param);
475         }
476         break;
477
478      // everything else dispatches normally
479      default:
480         TranslateMessage(message);
481         DispatchMessage(message);
482         break;
483   }
484}
485
486
487
488//============================================================
471489//  winwindow_toggle_full_screen
472490//  (main thread)
473491//============================================================
r1037r1038
9941012
9951013   // otherwise, we just do it directly
9961014   else
997      func(param);
1015      (*func)(param);
9981016}
9991017
10001018
src/osd/windows/window.h
r1037r1038
132132int winwindow_ui_is_paused(void);
133133
134134void winwindow_ui_exec_on_main_thread(void (*func)(void *), void *param);
135void winwindow_dispatch_message(MSG *message);
135136
136137#if HAS_WINDOW_MENU
137138int win_create_menu(HMENU *menus);
src/osd/windows/drawd3d.c
r1037r1038
706706   d3d->presentation.MultiSampleType            = D3DMULTISAMPLE_NONE;
707707   d3d->presentation.SwapEffect               = D3DSWAPEFFECT_DISCARD;
708708   d3d->presentation.hDeviceWindow               = window->hwnd;
709   d3d->presentation.Windowed                  = !window->fullscreen || HAS_WINDOW_MENU;
709   d3d->presentation.Windowed                  = (!video_config.switchres || !window->fullscreen) || HAS_WINDOW_MENU;
710710   d3d->presentation.EnableAutoDepthStencil      = FALSE;
711711   d3d->presentation.AutoDepthStencilFormat      = D3DFMT_D16;
712712   d3d->presentation.Flags                     = 0;
r1037r1038
11071107   }
11081108
11091109   // choose a resolution: window mode case
1110   if (!window->fullscreen || HAS_WINDOW_MENU)
1110   if (!window->fullscreen || !video_config.switchres || HAS_WINDOW_MENU)
11111111   {
11121112      RECT client;
11131113
src/emu/debug/debugvw.c
r1037r1038
2065206500000000  00 11 22 33 44 55 66 77-88 99 aa bb cc dd ee ff  0123456789abcdef
2066206600000000   0011  2233  4455  6677- 8899  aabb  ccdd  eeff  0123456789abcdef
2067206700000000    00112233    44556677 -  8899aabb    ccddeeff   0123456789abcdef
206800000000      0011223344556677   -    8899aabbccddeeff     0123456789abcdef
20682069*/
20692070
20702071/*-------------------------------------------------
r1037r1038
21452146   *address = bytes_per_row * cury + memdata->byte_offset;
21462147
21472148   /* the rest depends on the current format */
2148
2149   /* non-reverse case */
2150   if (!memdata->reverse_view)
2149   switch (memdata->bytes_per_chunk)
21512150   {
2152      switch (memdata->bytes_per_chunk)
2153      {
2154         default:
2155         case 1:
2156            modval = curx % 3;
2157            if (modval == 0) modval = 1;
2158            modval -= 1;
2151      default:
2152      case 1:
2153         modval = curx % 3;
2154         if (modval == 0) modval = 1;
2155         modval -= 1;
2156         if (!memdata->reverse_view)
21592157            *address += curx / 3;
2160            *shift = 4 - 4 * modval;
2161            break;
2158         else
2159            *address += 15 - curx / 3;
2160         *shift = 8-4 - 4 * modval;
2161         break;
21622162
2163         case 2:
2164            modval = curx % 6;
2165            if (modval <= 1) modval = 2;
2166            modval -= 2;
2163      case 2:
2164         modval = curx % 6;
2165         if (modval <= 1) modval = 2;
2166         modval -= 2;
2167         if (!memdata->reverse_view)
21672168            *address += 2 * (curx / 6);
2168            *shift = 12 - 4 * modval;
2169            break;
2169         else
2170            *address += 14 - 2 * (curx / 6);
2171         *shift = 16-4 - 4 * modval;
2172         break;
21702173
2171         case 4:
2172            modval = curx % 12;
2173            if (modval <= 2) modval = 3;
2174            if (modval == 11) modval = 10;
2175            modval -= 3;
2174      case 4:
2175         modval = curx % 12;
2176         if (modval <= 2) modval = 3;
2177         if (modval == 11) modval = 10;
2178         modval -= 3;
2179         if (!memdata->reverse_view)
21762180            *address += 4 * (curx / 12);
2177            *shift = 28 - 4 * modval;
2178            break;
2179      }
2181         else
2182            *address += 12 - 4 * (curx / 12);
2183         *shift = 32-4 - 4 * modval;
2184         break;
2185
2186      case 8:
2187         modval = curx % 24;
2188         if (modval <= 4) modval = 5;
2189         if (modval >= 21) modval = 20;
2190         modval -= 5;
2191         if (!memdata->reverse_view)
2192            *address += 8 * (curx / 24);
2193         else
2194            *address += 8 - 8 * (curx / 24);
2195         *shift = 64-4 - 4 * modval;
2196         break;
21802197   }
2181   else
2182   {
2183      switch (memdata->bytes_per_chunk)
2184      {
2185         default:
2186         case 1:
2187            modval = curx % 3;
2188            if (modval == 0) modval = 1;
2189            modval -= 1;
2190            *address += 15 - curx / 3;
2191            *shift = 4 - 4 * modval;
2192            break;
21932198
2194         case 2:
2195            modval = curx % 6;
2196            if (modval <= 1) modval = 2;
2197            modval -= 2;
2198            *address += 14 - 2 * (curx / 6);
2199            *shift = 12 - 4 * modval;
2200            break;
2201
2202         case 4:
2203            modval = curx % 12;
2204            if (modval <= 2) modval = 3;
2205            if (modval == 11) modval = 10;
2206            modval -= 3;
2207            *address += 12 - 4 * (curx / 12);
2208            *shift = 28 - 4 * modval;
2209            break;
2210      }
2211   }
22122199   return 1;
22132200}
22142201
r1037r1038
22522239         case 4:
22532240            curx = memdata->divider1 + 3 + 12 * ((address % bytes_per_row) / 4) + (7 - (shift / 4));
22542241            break;
2242
2243         case 8:
2244            curx = memdata->divider1 + 5 + 24 * ((address % bytes_per_row) / 8) + (15 - (shift / 4));
2245            break;
22552246      }
22562247   }
22572248   else
r1037r1038
22702261         case 4:
22712262            curx = memdata->divider1 + 3 + 12 * (3 - (address % bytes_per_row) / 4) + (7 - (shift / 4));
22722263            break;
2264
2265         case 8:
2266            curx = memdata->divider1 + 5 + 24 * (1 - (address % bytes_per_row) / 8) + (15 - (shift / 4));
2267            break;
22732268      }
22742269   }
22752270
r1037r1038
22922287static UINT8 memory_read_byte(debug_view_memory *memdata, offs_t offs, int apply_translation)
22932288{
22942289   /* if no raw data, just use the standard debug routines */
2295   if (!memdata->raw_base)
2290   if (memdata->raw_base == NULL)
22962291      return debug_read_byte(memdata->spacenum, offs, apply_translation);
22972292
22982293   /* all 0xff if out of bounds */
r1037r1038
23102305static UINT16 memory_read_word(debug_view_memory *memdata, offs_t offs, int apply_translation)
23112306{
23122307   /* if no raw data, just use the standard debug routines */
2313   if (!memdata->raw_base)
2308   if (memdata->raw_base == NULL)
23142309      return debug_read_word(memdata->spacenum, offs, apply_translation);
23152310
23162311   /* otherwise, decompose into bytes */
r1037r1038
23282323static UINT32 memory_read_dword(debug_view_memory *memdata, offs_t offs, int apply_translation)
23292324{
23302325   /* if no raw data, just use the standard debug routines */
2331   if (!memdata->raw_base)
2326   if (memdata->raw_base == NULL)
23322327      return debug_read_dword(memdata->spacenum, offs, apply_translation);
23332328
23342329   /* otherwise, decompose into words */
r1037r1038
23462341static UINT64 memory_read_qword(debug_view_memory *memdata, offs_t offs, int apply_translation)
23472342{
23482343   /* if no raw data, just use the standard debug routines */
2349   if (!memdata->raw_base)
2344   if (memdata->raw_base == NULL)
23502345      return debug_read_qword(memdata->spacenum, offs, apply_translation);
23512346
23522347   /* otherwise, decompose into dwords */
23532348   if (memdata->raw_little_endian)
2354      return memory_read_word(memdata, offs + 0, apply_translation) | ((UINT64)memory_read_word(memdata, offs + 4, apply_translation) << 32);
2349      return memory_read_dword(memdata, offs + 0, apply_translation) | ((UINT64)memory_read_dword(memdata, offs + 4, apply_translation) << 32);
23552350   else
2356      return memory_read_word(memdata, offs + 4, apply_translation) | ((UINT64)memory_read_word(memdata, offs + 0, apply_translation) << 32);
2351      return memory_read_dword(memdata, offs + 4, apply_translation) | ((UINT64)memory_read_dword(memdata, offs + 0, apply_translation) << 32);
23572352}
23582353
23592354
r1037r1038
23642359static void memory_write_byte(debug_view_memory *memdata, offs_t offs, UINT8 data, int apply_translation)
23652360{
23662361   /* if no raw data, just use the standard debug routines */
2367   if (!memdata->raw_base)
2362   if (memdata->raw_base == NULL)
23682363   {
23692364      debug_write_byte(memdata->spacenum, offs, data, apply_translation);
23702365      return;
r1037r1038
23942389static void memory_write_word(debug_view_memory *memdata, offs_t offs, UINT16 data, int apply_translation)
23952390{
23962391   /* if no raw data, just use the standard debug routines */
2397   if (!memdata->raw_base)
2392   if (memdata->raw_base == NULL)
23982393   {
23992394      debug_write_word(memdata->spacenum, offs, data, apply_translation);
24002395      return;
r1037r1038
24212416static void memory_write_dword(debug_view_memory *memdata, offs_t offs, UINT32 data, int apply_translation)
24222417{
24232418   /* if no raw data, just use the standard debug routines */
2424   if (!memdata->raw_base)
2419   if (memdata->raw_base == NULL)
24252420   {
24262421      debug_write_dword(memdata->spacenum, offs, data, apply_translation);
24272422      return;
r1037r1038
24482443static void memory_write_qword(debug_view_memory *memdata, offs_t offs, UINT64 data, int apply_translation)
24492444{
24502445   /* if no raw data, just use the standard debug routines */
2451   if (!memdata->raw_base)
2446   if (memdata->raw_base == NULL)
24522447   {
24532448      debug_write_qword(memdata->spacenum, offs, data, apply_translation);
24542449      return;
r1037r1038
25652560            memory_write_byte(memdata, address, (memory_read_byte(memdata, address, !memdata->no_translation) & ~(0xf << shift)) | ((hexchar - hexvals) << shift), !memdata->no_translation);
25662561         if (hexchar || chval == DCH_RIGHT)
25672562         {
2568            if (shift == 0) { shift = 4; if (address != maxaddr) address++; }
2563            if (shift == 0) { shift = 8-4; if (address != maxaddr) address++; }
25692564            else shift -= 4;
25702565         }
25712566         else if (chval == DCH_LEFT)
25722567         {
2573            if (shift == 4) { shift = 0; if (address != 0) address--; }
2568            if (shift == 8-4) { shift = 0; if (address != 0) address--; }
25742569            else shift += 4;
25752570         }
25762571         break;
r1037r1038
25802575            memory_write_word(memdata, address, (memory_read_word(memdata, address, !memdata->no_translation) & ~(0xf << shift)) | ((hexchar - hexvals) << shift), !memdata->no_translation);
25812576         if (hexchar || chval == DCH_RIGHT)
25822577         {
2583            if (shift == 0) { shift = 12; if (address != maxaddr) address += 2; }
2578            if (shift == 0) { shift = 16-4; if (address != maxaddr) address += 2; }
25842579            else shift -= 4;
25852580         }
25862581         else if (chval == DCH_LEFT)
25872582         {
2588            if (shift == 12) { shift = 0; if (address != 0) address -= 2; }
2583            if (shift == 16-4) { shift = 0; if (address != 0) address -= 2; }
25892584            else shift += 4;
25902585         }
25912586         break;
r1037r1038
25952590            memory_write_dword(memdata, address, (memory_read_dword(memdata, address, !memdata->no_translation) & ~(0xf << shift)) | ((hexchar - hexvals) << shift), !memdata->no_translation);
25962591         if (hexchar || chval == DCH_RIGHT)
25972592         {
2598            if (shift == 0) { shift = 28; if (address != maxaddr) address += 4; }
2593            if (shift == 0) { shift = 32-4; if (address != maxaddr) address += 4; }
25992594            else shift -= 4;
26002595         }
26012596         else if (chval == DCH_LEFT)
26022597         {
2603            if (shift == 28) { shift = 0; if (address != 0) address -= 4; }
2598            if (shift == 32-4) { shift = 0; if (address != 0) address -= 4; }
26042599            else shift += 4;
26052600         }
26062601         break;
2602
2603      case 8:
2604         if (hexchar)
2605            memory_write_qword(memdata, address, (memory_read_qword(memdata, address, !memdata->no_translation) & ~((UINT64)0xf << shift)) | ((UINT64)(hexchar - hexvals) << shift), !memdata->no_translation);
2606         if (hexchar || chval == DCH_RIGHT)
2607         {
2608            if (shift == 0) { shift = 64-4; if (address != maxaddr) address += 8; }
2609            else shift -= 4;
2610         }
2611         else if (chval == DCH_LEFT)
2612         {
2613            if (shift == 64-4) { shift = 0; if (address != 0) address -= 8; }
2614            else shift += 4;
2615         }
2616         break;
26072617   }
26082618   cpuintrf_pop_context();
26092619
r1037r1038
26592669   /* determine how many characters we need for an address and set the divider */
26602670   sprintf(addrformat, " %*s%%0%dX ", 8 - addrchars, "", addrchars);
26612671
2662
26632672   /* determine how wide the memory display area is */
26642673   bytes_per_line = memdata->chunks_displayed * memdata->bytes_per_chunk;
26652674   memory_display_width = 1 + (bytes_per_line * 3) + 1;      /* characters + spaces */
26662675
2667
26682676   /* compute total displayed rows and columns */
26692677   view->total_rows =  (maxaddr / bytes_per_line) + 1;
26702678   view->total_cols =  (1 + 8 + 1) + memory_display_width;
r1037r1038
27502758                     offs_t curaddr = addrbyte + i;
27512759                     if (curaddr > maxaddr)
27522760                        len += sprintf(&data[len], "   ");
2753                     else if (memdata->raw_base == NULL || memdata->no_translation ||
2761                     else if (memdata->raw_base != NULL || memdata->no_translation ||
27542762                            cpuinfo->translate == NULL || (*cpuinfo->translate)(memdata->spacenum, &curaddr))
27552763                        len += sprintf(&data[len], "%02X ", memory_read_byte(memdata, addrbyte + i, !memdata->no_translation));
27562764                     else
r1037r1038
27642772                     offs_t curaddr = addrbyte + 2 * i;
27652773                     if (curaddr > maxaddr)
27662774                        len += sprintf(&data[len], "      ");
2767                     else if (memdata->raw_base == NULL || memdata->no_translation ||
2775                     else if (memdata->raw_base != NULL || memdata->no_translation ||
27682776                            cpuinfo->translate == NULL || (*cpuinfo->translate)(memdata->spacenum, &curaddr))
27692777                        len += sprintf(&data[len], " %04X ", memory_read_word(memdata, addrbyte + 2 * i, !memdata->no_translation));
27702778                     else
r1037r1038
27782786                     offs_t curaddr = addrbyte + 4 * i;
27792787                     if (curaddr > maxaddr)
27802788                        len += sprintf(&data[len], "            ");
2781                     else if (memdata->raw_base == NULL || memdata->no_translation ||
2789                     else if (memdata->raw_base != NULL || memdata->no_translation ||
27822790                            cpuinfo->translate == NULL || (*cpuinfo->translate)(memdata->spacenum, &curaddr))
27832791                        len += sprintf(&data[len], "  %08X  ", memory_read_dword(memdata, addrbyte + 4 * i, !memdata->no_translation));
27842792                     else
27852793                        len += sprintf(&data[len], "  ********  ");
27862794                  }
27872795                  break;
2796
2797               case 8:
2798                  for (i = 0; i < memdata->chunks_displayed; i++)
2799                  {
2800                     offs_t curaddr = addrbyte + 8 * i;
2801                     if (curaddr > maxaddr)
2802                        len += sprintf(&data[len], "                        ");
2803                     else if (memdata->raw_base != NULL || memdata->no_translation ||
2804                            cpuinfo->translate == NULL || (*cpuinfo->translate)(memdata->spacenum, &curaddr))
2805                     {
2806                        UINT64 qword = memory_read_qword(memdata, addrbyte + 8 * i, !memdata->no_translation);
2807                        len += sprintf(&data[len], "    %08X%08X    ", (UINT32)(qword >> 32), (UINT32)qword);
2808                     }
2809                     else
2810                        len += sprintf(&data[len], "    ****************    ");
2811                  }
2812                  break;
27882813            }
27892814            len += sprintf(&data[len], " ");
27902815            if (memdata->ascii_view)
r1037r1038
28292854                     offs_t curaddr = addrbyte + i;
28302855                     if (curaddr > maxaddr)
28312856                        len += sprintf(&data[len], "   ");
2832                     else if (memdata->raw_base == NULL || memdata->no_translation ||
2857                     else if (memdata->raw_base != NULL || memdata->no_translation ||
28332858                            cpuinfo->translate == NULL || (*cpuinfo->translate)(memdata->spacenum, &curaddr))
28342859                        len += sprintf(&data[len], "%02X ", memory_read_byte(memdata, addrbyte + i, !memdata->no_translation));
28352860                     else
r1037r1038
28432868                     offs_t curaddr = addrbyte + 2 * i;
28442869                     if (curaddr > maxaddr)
28452870                        len += sprintf(&data[len], "      ");
2846                     else if (memdata->raw_base == NULL || memdata->no_translation ||
2871                     else if (memdata->raw_base != NULL || memdata->no_translation ||
28472872                            cpuinfo->translate == NULL || (*cpuinfo->translate)(memdata->spacenum, &curaddr))
28482873                        len += sprintf(&data[len], " %04X ", memory_read_word(memdata, addrbyte + 2 * i, !memdata->no_translation));
28492874                     else
r1037r1038
28572882                     offs_t curaddr = addrbyte + 4 * i;
28582883                     if (curaddr > maxaddr)
28592884                        len += sprintf(&data[len], "            ");
2860                     else if (memdata->raw_base == NULL || memdata->no_translation ||
2885                     else if (memdata->raw_base != NULL || memdata->no_translation ||
28612886                            cpuinfo->translate == NULL || (*cpuinfo->translate)(memdata->spacenum, &curaddr))
28622887                        len += sprintf(&data[len], "  %08X  ", memory_read_dword(memdata, addrbyte + 4 * i, !memdata->no_translation));
28632888                     else
28642889                        len += sprintf(&data[len], "  ********  ");
28652890                  }
28662891                  break;
2892
2893               case 8:
2894                  for (i = memdata->chunks_displayed - 1; i >= 0; i--)
2895                  {
2896                     offs_t curaddr = addrbyte + 8 * i;
2897                     if (curaddr > maxaddr)
2898                        len += sprintf(&data[len], "                        ");
2899                     else if (memdata->raw_base != NULL || memdata->no_translation ||
2900                            cpuinfo->translate == NULL || (*cpuinfo->translate)(memdata->spacenum, &curaddr))
2901                     {
2902                        UINT64 qword = memory_read_qword(memdata, addrbyte + 8 * i, !memdata->no_translation);
2903                        len += sprintf(&data[len], "    %08X%08X    ", (UINT32)(qword >> 32), (UINT32)qword);
2904                     }
2905                     else
2906                        len += sprintf(&data[len], "    ****************    ");
2907                  }
2908                  break;
28672909            }
28682910            len += sprintf(&data[len], addrformat, BYTE2ADDR(addrbyte & addrmask, cpuinfo, memdata->spacenum));
28692911         }
r1037r1038
30453087            memdata->chunks_displayed = memdata->chunks_displayed *
30463088                                          memdata->bytes_per_chunk  / value.i;
30473089
3048            if (memdata->chunks_displayed <= 0) memdata->chunks_displayed = 1;
3090            if (memdata->chunks_displayed <= 0)
3091               memdata->chunks_displayed = 1;
30493092
30503093            memdata->bytes_per_chunk = value.i;
30513094            view->update_pending = TRUE;
src/emu/cpu/h83002/h83002.c
r1037r1038
160160static UINT16 h8_inc16(UINT16 src);
161161static UINT32 h8_inc32(UINT32 src);
162162
163static UINT8 h8_bnot8(UINT8 src, UINT8 dst);
163//static UINT8 h8_bnot8(UINT8 src, UINT8 dst);
164164static UINT8 h8_bst8(UINT8 src, UINT8 dst);
165165static UINT8 h8_bist8(UINT8 src, UINT8 dst);
166166static UINT8 h8_bset8(UINT8 src, UINT8 dst);
r1037r1038
168168static void h8_btst8(UINT8 src, UINT8 dst);
169169static void h8_bld8(UINT8 src, UINT8 dst); // loads to carry
170170static void h8_bor8(UINT8 src, UINT8 dst); // result in carry
171static void h8_bxor8(UINT8 src, UINT8 dst);
171//static void h8_bxor8(UINT8 src, UINT8 dst);
172172
173173static INT32 h8_mulxs16(INT16 src, INT16 dst);
174174static UINT32 h8_divxs16(INT16 src, INT32 dst);
r1037r1038
27512751   h8.h8cflag = (dst >> bit) & 1;
27522752}
27532753
2754#ifdef UNUSED_FUNCTION
27542755static UINT8 h8_bnot8(UINT8 src, UINT8 dst)
27552756{
27562757   UINT8 res;
r1037r1038
27602761
27612762   return res;
27622763}
2764#endif
27632765
27642766static UINT8 h8_bst8(UINT8 src, UINT8 dst)
27652767{
r1037r1038
28112813   h8.h8cflag |= res ? 1 : 0;
28122814}
28132815
2816#ifdef UNUSED_FUNCTION
28142817static void h8_bxor8(UINT8 src, UINT8 dst)
28152818{
28162819   dst >>= src;
28172820   dst &= 0x1;
28182821   h8.h8cflag ^= dst;
28192822}
2823#endif
28202824
28212825static UINT8 h8_bclr8(UINT8 src, UINT8 dst)
28222826{
src/emu/cpu/tms34010/tms34010.c
r1037r1038
667667      tms34010_io_register_w(REG_HSTCTLH, 0x8000, 0);
668668}
669669
670#if (HAS_TMS34020)
670671static void tms34020_reset(void)
671672{
672673   tms34010_reset();
673674   state.is_34020 = 1;
674675}
676#endif
675677
676678
677679
r1037r1038
696698      memcpy(dst, &state, TMS34010_STATE_SIZE);
697699}
698700
701#if (HAS_TMS34020)
699702static void tms34020_get_context(void *dst)
700703{
701704   if (dst)
702705      memcpy(dst, &state, TMS34020_STATE_SIZE);
703706}
707#endif
704708
705709
706710
r1037r1038
715719   change_pc(TOBYTE(PC));
716720}
717721
722#if (HAS_TMS34020)
718723static void tms34020_set_context(void *src)
719724{
720725   if (src)
721726      memcpy(&state, src, TMS34020_STATE_SIZE);
722727   change_pc(TOBYTE(PC));
723728}
729#endif
724730
725731
726732
src/emu/cpu/cpu.mak
r1037r1038
792792DBGOBJS += $(CPUOBJ)/mips/mips3dsm.o
793793
794794ifdef X86_MIPS3_DRC
795CPUOBJS += $(CPUOBJ)/mips/mips3drc.o $(DRCOBJ)
795CPUOBJS += $(CPUOBJ)/mips/mips3drc.o $(CPUOBJ)/mips/mips3fe.o $(DRCOBJ)
796796else
797797CPUOBJS += $(CPUOBJ)/mips/mips3.o
798798endif
r1037r1038
804804
805805$(CPUOBJ)/mips/mips3drc.o:   $(CPUSRC)/mips/mips3drc.c \
806806                     $(CPUSRC)/mips/mdrcold.c \
807                     $(CPUSRC)/mips/mdrc64.c \
807808                     $(CPUSRC)/mips/mips3.h \
808809                     $(CPUSRC)/mips/mips3com.h \
810                     $(CPUSRC)/mips/mips3fe.h \
809811                     $(DRCDEPS)
810812
811813
r1037r1038
11341136endif
11351137
11361138ifneq ($(filter V30MZ,$(CPUS)),)
1137OBJDIRS += $(CPUOBJ)/v30mz
1139OBJDIRS += $(CPUOBJ)/v30mz $(CPUOBJ)/nec
11381140CPUOBJS += $(CPUOBJ)/v30mz/v30mz.o
11391141DBGOBJS += $(CPUOBJ)/nec/necdasm.o
11401142endif
src/emu/cpu/sharc/sharcdsm.c
r1037r1038
10301030   return 0;
10311031}
10321032
1033#ifdef UNUSED_FUNCTION
10331034static UINT32 dasm_cjump_rframe(UINT32 pc, UINT64 opcode)
10341035{
10351036   /* TODO */
r1037r1038
10431044   }
10441045   return 0;
10451046}
1047#endif
10461048
10471049static UINT32 dasm_invalid(UINT32 pc, UINT64 opcode)
10481050{
src/emu/cpu/z180/z180op.c
r1037r1038
432432
433433static void take_interrupt(int irq)
434434{
435   if( _IFF1 )
436   {
437      int irq_vector;
435   int irq_vector;
438436
439      /* there isn't a valid previous program counter */
440      _PPC = -1;
437   /* there isn't a valid previous program counter */
438   _PPC = -1;
441439
442      /* Check if processor was halted */
443      LEAVE_HALT;
440   /* Check if processor was halted */
441   LEAVE_HALT;
444442
445      if( irq == Z180_INT0 )
446      {
447         /* Clear both interrupt flip flops */
448         _IFF1 = _IFF2 = 0;
443   /* Clear both interrupt flip flops */
444   _IFF1 = _IFF2 = 0;
449445
450         /* Daisy chain mode? If so, call the requesting device */
451         if (Z180.daisy)
452            irq_vector = z80daisy_call_ack_device(Z180.daisy);
446   if( irq == Z180_INT0 )
447   {
448      /* Daisy chain mode? If so, call the requesting device */
449      if (Z180.daisy)
450         irq_vector = z80daisy_call_ack_device(Z180.daisy);
453451
454         /* else call back the cpu interface to retrieve the vector */
455         else
456            irq_vector = (*Z180.irq_callback)(0);
452      /* else call back the cpu interface to retrieve the vector */
453      else
454         irq_vector = (*Z180.irq_callback)(0);
457455
458         LOG(("Z180 #%d single int. irq_vector $%02x\n", cpu_getactivecpu(), irq_vector));
456      LOG(("Z180 #%d single int. irq_vector $%02x\n", cpu_getactivecpu(), irq_vector));
459457
460         /* Interrupt mode 2. Call [Z180.I:databyte] */
461         if( _IM == 2 )
462         {
463            irq_vector = (irq_vector & 0xff) + (_I << 8);
464            PUSH( PC );
465            RM16( irq_vector, &Z180.PC );
466            LOG(("Z180 #%d IM2 [$%04x] = $%04x\n",cpu_getactivecpu() , irq_vector, _PCD));
467            /* CALL opcode timing */
468            Z180.extra_cycles += cc[Z180_TABLE_op][0xcd];
469         }
470         else
471         /* Interrupt mode 1. RST 38h */
472         if( _IM == 1 )
473         {
474            LOG(("Z180 #%d IM1 $0038\n",cpu_getactivecpu() ));
475            PUSH( PC );
476            _PCD = 0x0038;
477            /* RST $38 + 'interrupt latency' cycles */
478            Z180.extra_cycles += cc[Z180_TABLE_op][0xff] + cc[Z180_TABLE_ex][0xff];
479         }
480         else
481         {
482            /* Interrupt mode 0. We check for CALL and JP instructions, */
483            /* if neither of these were found we assume a 1 byte opcode */
484            /* was placed on the databus                                */
485            LOG(("Z180 #%d IM0 $%04x\n",cpu_getactivecpu() , irq_vector));
486            switch (irq_vector & 0xff0000)
487            {
488               case 0xcd0000:   /* call */
489                  PUSH( PC );
490                  _PCD = irq_vector & 0xffff;
491                   /* CALL $xxxx + 'interrupt latency' cycles */
492                  Z180.extra_cycles += cc[Z180_TABLE_op][0xcd] + cc[Z180_TABLE_ex][0xff];
493                  break;
494               case 0xc30000:   /* jump */
495                  _PCD = irq_vector & 0xffff;
496                  /* JP $xxxx + 2 cycles */
497                  Z180.extra_cycles += cc[Z180_TABLE_op][0xc3] + cc[Z180_TABLE_ex][0xff];
498                  break;
499               default:      /* rst (or other opcodes?) */
500                  PUSH( PC );
501                  _PCD = irq_vector & 0x0038;
502                  /* RST $xx + 2 cycles */
503                  Z180.extra_cycles += cc[Z180_TABLE_op][_PCD] + cc[Z180_TABLE_ex][_PCD];
504                  break;
505            }
506         }
507      }
508      else
458      /* Interrupt mode 2. Call [Z180.I:databyte] */
459      if( _IM == 2 )
509460      {
510         irq_vector = (IO(Z180_IL) & Z180_IL_IL) + (irq - Z180_INT1) * 2;
511         irq_vector = (_I << 8) + (irq_vector & 0xff);
461         irq_vector = (irq_vector & 0xff) + (_I << 8);
512462         PUSH( PC );
513463         RM16( irq_vector, &Z180.PC );
514         LOG(("Z180 #%d INT%d [$%04x] = $%04x\n", cpu_getactivecpu(), irq, irq_vector, _PCD));
464         LOG(("Z180 #%d IM2 [$%04x] = $%04x\n",cpu_getactivecpu() , irq_vector, _PCD));
515465         /* CALL opcode timing */
516         Z180.extra_cycles += cc[Z180_TABLE_op][0xcd];
466         z180_icount -= cc[Z180_TABLE_op][0xcd];
517467      }
518      z180_change_pc(_PCD);
468      else
469      /* Interrupt mode 1. RST 38h */
470      if( _IM == 1 )
471      {
472         LOG(("Z180 #%d IM1 $0038\n",cpu_getactivecpu() ));
473         PUSH( PC );
474         _PCD = 0x0038;
475         /* RST $38 + 'interrupt latency' cycles */
476         z180_icount -= cc[Z180_TABLE_op][0xff] - cc[Z180_TABLE_ex][0xff];
477      }
478      else
479      {
480         /* Interrupt mode 0. We check for CALL and JP instructions, */
481         /* if neither of these were found we assume a 1 byte opcode */
482         /* was placed on the databus                                */
483         LOG(("Z180 #%d IM0 $%04x\n",cpu_getactivecpu() , irq_vector));
484         switch (irq_vector & 0xff0000)
485         {
486            case 0xcd0000:   /* call */
487               PUSH( PC );
488               _PCD = irq_vector & 0xffff;
489                  /* CALL $xxxx + 'interrupt latency' cycles */
490               z180_icount -= cc[Z180_TABLE_op][0xcd] - cc[Z180_TABLE_ex][0xff];
491               break;
492            case 0xc30000:   /* jump */
493               _PCD = irq_vector & 0xffff;
494               /* JP $xxxx + 2 cycles */
495               z180_icount -= cc[Z180_TABLE_op][0xc3] - cc[Z180_TABLE_ex][0xff];
496               break;
497            default:      /* rst (or other opcodes?) */
498               PUSH( PC );
499               _PCD = irq_vector & 0x0038;
500               /* RST $xx + 2 cycles */
501               z180_icount -= cc[Z180_TABLE_op][_PCD] - cc[Z180_TABLE_ex][_PCD];
502               break;
503         }
504      }
519505   }
506   else
507   {
508      irq_vector = (IO(Z180_IL) & Z180_IL_IL) + (irq - Z180_INT1) * 2;
509      irq_vector = (_I << 8) + (irq_vector & 0xff);
510      PUSH( PC );
511      RM16( irq_vector, &Z180.PC );
512      LOG(("Z180 #%d INT%d [$%04x] = $%04x\n", cpu_getactivecpu(), irq, irq_vector, _PCD));
513      /* CALL opcode timing */
514      z180_icount -= cc[Z180_TABLE_op][0xcd];
515   }
516   z180_change_pc(_PCD);
517
518
520519}
521520
src/emu/cpu/z180/z180.c
r1037r1038
11/*****************************************************************************
22 *
33 *   z180.c
4 *   Portable Z180 emulator V0.2
4 *   Portable Z180 emulator V0.3
55 *
66 *   Copyright (C) 2000 Juergen Buchmueller, all rights reserved.
77 *
r1037r1038
5959
6060/* execute main opcodes inside a big switch statement */
6161#ifndef BIG_SWITCH
62#define BIG_SWITCH         1
62#define BIG_SWITCH         
6363#endif
6464
6565/* use big flag arrays (4*64K) for ADD/ADC/SUB/SBC/CP results */
r1037r1038
6969#define Z180_EXACT         1
7070
7171/* on JP and JR opcodes check for tight loops */
72#define BUSY_LOOP_HACKS    1
72#define BUSY_LOOP_HACKS   
7373
7474/* check for delay loops counting down BC */
75#define TIME_LOOP_HACKS    1
75#define TIME_LOOP_HACKS   
7676
77static void set_irq_line(int irqline, int state);
78
7779/****************************************************************************/
7880/* The Z180 registers. HALT is set to 1 when the CPU is halted, the refresh */
7981/* register is calculated as follows: refresh=(Regs.R&127)|(Regs.R2&128)    */
r1037r1038
8385   PAIR   AF2,BC2,DE2,HL2;
8486   UINT8   R,R2,IFF1,IFF2,HALT,IM,I;
8587   UINT8   tmdr_latch;       /* flag latched TMDR0H, TMDR1H values */
88   UINT8   read_tcr_tmdr[2];   /* flag to indicate that TCR or TMDR was read */
8689   UINT32   iol;            /* I/O line status bits */
8790   UINT8   io[64];          /* 64 internal 8 bit registers */
8891   offs_t   mmu[16];         /* MMU address translation */
89   UINT8   tmdr[2];         /* latched TMDR0H and TMDR1H values */
92   UINT8   tmdrh[2];         /* latched TMDR0H and TMDR1H values */
93   UINT16   tmdr_value[2];      /* TMDR values used byt PRT0 and PRT1 as down counter */
94   UINT8   tif[2];            /* TIF0 and TIF1 values */
9095   UINT8   nmi_state;         /* nmi line state */
96   UINT8   nmi_pending;      /* nmi pending */
9197   UINT8   irq_state[3];      /* irq line states (INT0,INT1,INT2) */
98   UINT8   after_EI;         /* are we in the EI shadow? */
9299   const struct z80_irq_daisy_chain *daisy;
93100   int    (*irq_callback)(int irqline);
94   int    extra_cycles;      /* extra cycles for interrupts */
95101}   Z180_Regs;
96102
97103#define CF   0x01
r1037r1038
400406
401407#define Z180_TCR_RESET         0x00
402408#define Z180_TCR_RMASK         0xff
403#define Z180_TCR_WMASK         0xff
409#define Z180_TCR_WMASK         0x3f
404410
405411/* 11 reserved */
406412#define Z180_IO11_RESET       0x00
r1037r1038
740746int z180_icount;
741747static Z180_Regs Z180;
742748static UINT32 EA;
743static int after_EI = 0;
744749
745750static UINT8 SZ[256];      /* zero and sign flags */
746751static UINT8 SZ_BIT[256];   /* zero, sign and parity/overflow (=zero) flags for BIT opcode */
r1037r1038
789794   /* normal external readport */
790795   UINT8 data = io_read_byte_8(port);
791796
797   /* remap internal I/O registers */
798   if((port & (IO_IOCR & 0xc0)) == (IO_IOCR & 0xc0))
799      port = port - (IO_IOCR & 0xc0);
800
792801   /* but ignore the data and read the internal register */
793   switch ((port & 0x3f) + Z180_CNTLA0)
802   switch (port + Z180_CNTLA0)
794803   {
795804   case Z180_CNTLA0:
796805      data = IO_CNTLA0 & Z180_CNTLA0_RMASK;
r1037r1038
854863      break;
855864
856865   case Z180_TMDR0L:
857      data = IO_TMDR0L & Z180_TMDR0L_RMASK;
866      data = Z180.tmdr_value[0] & Z180_TMDR0L_RMASK;
858867      LOG(("Z180 #%d TMDR0L rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]));
859868      /* if timer is counting, latch the MSB and set the latch flag */
860869      if ((IO_TCR & Z180_TCR_TDE0) == 0)
861870      {
862871         Z180.tmdr_latch |= 1;
863         Z180.tmdr[0] = IO_TMDR0H;
872         Z180.tmdrh[0] = (Z180.tmdr_value[0] & 0xff00) >> 8;
864873      }
874
875      if(Z180.read_tcr_tmdr[0])
876      {
877         Z180.tif[0] = 0; // reset TIF0
878         Z180.read_tcr_tmdr[0] = 0;
879      }
880      else
881      {
882         Z180.read_tcr_tmdr[0] = 1;
883      }
865884      break;
866885
867886   case Z180_TMDR0H:
r1037r1038
869888      if (Z180.tmdr_latch & 1)
870889      {
871890         Z180.tmdr_latch &= ~1;
872         data = Z180.tmdr[0] & Z180_TMDR1H_RMASK;
891         data = Z180.tmdrh[0];
873892      }
874893      else
875894      {
876         data = IO_TMDR0H & Z180_TMDR0H_RMASK;
895         data = (Z180.tmdr_value[0] & 0xff00) >> 8;
877896      }
897
898      if(Z180.read_tcr_tmdr[0])
899      {
900         Z180.tif[0] = 0; // reset TIF0
901         Z180.read_tcr_tmdr[0] = 0;
902      }
903      else
904      {
905         Z180.read_tcr_tmdr[0] = 1;
906      }
878907      LOG(("Z180 #%d TMDR0H rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]));
879908      break;
880909
r1037r1038
889918      break;
890919
891920   case Z180_TCR:
892      data = IO_TCR & Z180_TCR_RMASK;
921      data = (IO_TCR & Z180_TCR_RMASK) | (Z180.tif[0] << 6) | (Z180.tif[1] << 7);
922
923      if(Z180.read_tcr_tmdr[0])
924      {
925         Z180.tif[0] = 0; // reset TIF0
926         Z180.read_tcr_tmdr[0] = 0;
927      }
928      else
929      {
930         Z180.read_tcr_tmdr[0] = 1;
931      }
932
933      if(Z180.read_tcr_tmdr[1])
934      {
935         Z180.tif[1] = 0; // reset TIF1
936         Z180.read_tcr_tmdr[1] = 0;
937      }
938      else
939      {
940         Z180.read_tcr_tmdr[1] = 1;
941      }
942
893943      LOG(("Z180 #%d TCR    rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]));
894944      break;
895945
r1037r1038
909959      break;
910960
911961   case Z180_TMDR1L:
912      data = IO_TMDR1L & Z180_TMDR1L_RMASK;
962      data = Z180.tmdr_value[1] & Z180_TMDR1L_RMASK;
913963      LOG(("Z180 #%d TMDR1L rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]));
914964      /* if timer is counting, latch the MSB and set the latch flag */
915965      if ((IO_TCR & Z180_TCR_TDE1) == 0)
916966      {
917967         Z180.tmdr_latch |= 2;
918         Z180.tmdr[1] = IO_TMDR1H;
968         Z180.tmdrh[1] = (Z180.tmdr_value[1] & 0xff00) >> 8;
919969      }
970
971      if(Z180.read_tcr_tmdr[1])
972      {
973         Z180.tif[1] = 0; // reset TIF1
974         Z180.read_tcr_tmdr[1] = 0;
975      }
976      else
977      {
978         Z180.read_tcr_tmdr[1] = 1;
979      }
920980      break;
921981
922982   case Z180_TMDR1H:
r1037r1038
924984      if (Z180.tmdr_latch & 2)
925985      {
926986         Z180.tmdr_latch &= ~2;
927         data = Z180.tmdr[0] & Z180_TMDR1H_RMASK;
987         data = Z180.tmdrh[1];
928988      }
929989      else
930990      {
931         data = IO_TMDR1H & Z180_TMDR1H_RMASK;
991         data = (Z180.tmdr_value[1] & 0xff00) >> 8;
932992      }
993
994      if(Z180.read_tcr_tmdr[1])
995      {
996         Z180.tif[1] = 0; // reset TIF1
997         Z180.read_tcr_tmdr[1] = 0;
998      }
999      else
1000      {
1001         Z180.read_tcr_tmdr[1] = 1;
1002      }
9331003      LOG(("Z180 #%d TMDR1H rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]));
9341004      break;
9351005
r1037r1038
11431213      LOG(("Z180 #%d IOCR   rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f]));
11441214      break;
11451215   }
1216
11461217   return data;
11471218}
11481219
r1037r1038
11501221{
11511222   /* normal external write port */
11521223   io_write_byte_8(port, data);
1224
1225   /* remap internal I/O registers */
1226   if((port & (IO_IOCR & 0xc0)) == (IO_IOCR & 0xc0))
1227      port = port - (IO_IOCR & 0xc0);
1228
11531229   /* store the data in the internal register */
1154   switch ((port & 0x3f) + Z180_CNTLA0)
1230   switch (port + Z180_CNTLA0)
11551231   {
11561232   case Z180_CNTLA0:
11571233      LOG(("Z180 #%d CNTLA0 wr $%02x ($%02x)\n", cpu_getactivecpu(), data,  data & Z180_CNTLA0_WMASK));
r1037r1038
12151291
12161292   case Z180_TMDR0L:
12171293      LOG(("Z180 #%d TMDR0L wr $%02x ($%02x)\n", cpu_getactivecpu(), data,  data & Z180_TMDR0L_WMASK));
1218      IO_TMDR0L = (IO_TMDR0L & ~Z180_TMDR0L_WMASK) | (data & Z180_TMDR0L_WMASK);
1294      IO_TMDR0L = data & Z180_TMDR0L_WMASK;
1295      Z180.tmdr_value[0] = (Z180.tmdr_value[0] & 0xff00) | IO_TMDR0L;
12191296      break;
12201297
12211298   case Z180_TMDR0H:
12221299      LOG(("Z180 #%d TMDR0H wr $%02x ($%02x)\n", cpu_getactivecpu(), data,  data & Z180_TMDR0H_WMASK));
1223      IO_TMDR0H = (IO_TMDR0H & ~Z180_TMDR0H_WMASK) | (data & Z180_TMDR0H_WMASK);
1300      IO_TMDR0H = data & Z180_TMDR0H_WMASK;
1301      Z180.tmdr_value[0] = (Z180.tmdr_value[0] & 0x00ff) | (IO_TMDR0H << 8);
12241302      break;
12251303
12261304   case Z180_RLDR0L:
r1037r1038
12551333
12561334   case Z180_TMDR1L:
12571335      LOG(("Z180 #%d TMDR1L wr $%02x ($%02x)\n", cpu_getactivecpu(), data,  data & Z180_TMDR1L_WMASK));
1258      IO_TMDR1L = (IO_TMDR1L & ~Z180_TMDR1L_WMASK) | (data & Z180_TMDR1L_WMASK);
1336      IO_TMDR1L = data & Z180_TMDR1L_WMASK;
1337      Z180.tmdr_value[1] = (Z180.tmdr_value[1] & 0xff00) | IO_TMDR1L;
12591338      break;
12601339
12611340   case Z180_TMDR1H:
12621341      LOG(("Z180 #%d TMDR1H wr $%02x ($%02x)\n", cpu_getactivecpu(), data,  data & Z180_TMDR1H_WMASK));
1263      IO_TMDR1H = (IO_TMDR1H & ~Z180_TMDR1H_WMASK) | (data & Z180_TMDR1H_WMASK);
1342      IO_TMDR1H = data & Z180_TMDR1H_WMASK;
1343      Z180.tmdr_value[1] = (Z180.tmdr_value[1] & 0x00ff) | IO_TMDR1H;
12641344      break;
12651345
12661346   case Z180_RLDR1L:
r1037r1038
18221902   state_save_register_item("z180", index, Z180.IM);
18231903   state_save_register_item("z180", index, Z180.I);
18241904   state_save_register_item("z180", index, Z180.nmi_state);
1905   state_save_register_item("z180", index, Z180.nmi_pending);
18251906   state_save_register_item("z180", index, Z180.irq_state[0]);
18261907   state_save_register_item("z180", index, Z180.irq_state[1]);
18271908   state_save_register_item("z180", index, Z180.irq_state[2]);
1909   state_save_register_item("z180", index, Z180.after_EI);
18281910}
18291911
18301912/****************************************************************************
r1037r1038
19342016   _IX = _IY = 0xffff; /* IX and IY are FFFF after a reset! */
19352017   _F = ZF;         /* Zero flag is set */
19362018   Z180.nmi_state = CLEAR_LINE;
2019   Z180.nmi_pending = 0;
19372020   Z180.irq_state[0] = CLEAR_LINE;
19382021   Z180.irq_state[1] = CLEAR_LINE;
19392022   Z180.irq_state[2] = CLEAR_LINE;
2023   Z180.after_EI = 0;
2024   Z180.tif[0] = 0;
2025   Z180.tif[1] = 0;
2026   Z180.read_tcr_tmdr[0] = 0;
2027   Z180.read_tcr_tmdr[1] = 0;
2028   Z180.tmdr_value[0] = 0xffff;
2029   Z180.tmdr_value[1] = 0xffff;
19402030
19412031   /* reset io registers */
19422032   IO_CNTLA0  = Z180_CNTLA0_RESET;
r1037r1038
20102100   z180_change_pc(_PCD);
20112101}
20122102
2103/* Handle PRT timers, decreasing them after 20 clocks and returning the new icount base that needs to be used for the next check */
2104static int handle_timers(int current_icount, int previous_icount)
2105{
2106   int diff = previous_icount - current_icount;
2107   int new_icount_base;
2108
2109   if(diff >= 20)
2110   {
2111      /* Programmable Reload Timer 0 */
2112      if(IO_TCR & Z180_TCR_TDE0)
2113      {
2114         Z180.tmdr_value[0]--;
2115         if(Z180.tmdr_value[0] == 0)
2116         {
2117            Z180.tmdr_value[0] = IO_RLDR0L | (IO_RLDR0H << 8);
2118            Z180.tif[0] = 1;
2119         }
2120      }
2121
2122      /* Programmable Reload Timer 1 */
2123      if(IO_TCR & Z180_TCR_TDE1)
2124      {
2125         Z180.tmdr_value[1]--;
2126         if(Z180.tmdr_value[1] == 0)
2127         {
2128            Z180.tmdr_value[1] = IO_RLDR1L | (IO_RLDR1H << 8);
2129            Z180.tif[1] = 1;
2130         }
2131      }
2132
2133      if((IO_TCR & Z180_TCR_TIE0) && Z180.tif[0])
2134      {
2135         // check if we can take the interrupt
2136         if(_IFF1 && !Z180.after_EI)
2137         {
2138            take_interrupt(Z180_INT_PRT0);
2139         }
2140      }
2141
2142      if((IO_TCR & Z180_TCR_TIE1) && Z180.tif[1])
2143      {
2144         // check if we can take the interrupt
2145         if(_IFF1 && !Z180.after_EI)
2146         {
2147            take_interrupt(Z180_INT_PRT1);
2148         }
2149      }
2150
2151      new_icount_base = current_icount + (diff - 20);
2152   }
2153   else
2154   {
2155      new_icount_base = previous_icount;
2156   }
2157
2158   return new_icount_base;
2159}
2160
2161static void check_interrupts(void)
2162{
2163   int i;
2164   for(i = 0; i <= 2; i++)
2165   {
2166      /* check for IRQs before each instruction */
2167      if(Z180.irq_state[i] != CLEAR_LINE && _IFF1 && !Z180.after_EI)
2168      {
2169         take_interrupt(Z180_INT0 + i);
2170      }
2171   }
2172}
2173
20132174/****************************************************************************
20142175 * Execute 'cycles' T-states. Return number of T-states really executed
20152176 ****************************************************************************/
20162177static int z180_execute(int cycles)
20172178{
2018   z180_icount = cycles - Z180.extra_cycles;
2019   Z180.extra_cycles = 0;
2179   int old_icount = cycles;
2180   z180_icount = cycles;
20202181
2182   /* check for NMIs on the way in; they can only be set externally */
2183   /* via timers, and can't be dynamically enabled, so it is safe */
2184   /* to just check here */
2185   if (Z180.nmi_pending)
2186   {
2187      LOG(("Z180 #%d take NMI\n", cpu_getactivecpu()));
2188      _PPC = -1;         /* there isn't a valid previous program counter */
2189      LEAVE_HALT;       /* Check if processor was halted */
2190
2191      /* disable DMA transfers!! */
2192      IO_DSTAT &= ~Z180_DSTAT_DME;
2193
2194      _IFF2 = _IFF1;
2195      _IFF1 = 0;
2196      PUSH( PC );
2197      _PCD = 0x0066;
2198      z180_icount -= 11;
2199      Z180.nmi_pending = 0;
2200   }
2201
20212202again:
20222203    /* check if any DMA transfer is running */
20232204   if ((IO_DSTAT & Z180_DSTAT_DME) == Z180_DSTAT_DME)
r1037r1038
20272208         (IO_DMODE & Z180_DMODE_MMOD) == Z180_DMODE_MMOD)
20282209      {
20292210         CALL_MAME_DEBUG;
2211
20302212         z180_dma0();
2213         old_icount = handle_timers(z180_icount, old_icount);
20312214      }
20322215      else
20332216      {
20342217         do
20352218         {
2219            check_interrupts();
2220            Z180.after_EI = 0;
2221
20362222            _PPC = _PCD;
20372223            CALL_MAME_DEBUG;
20382224            _R++;
2225
20392226            EXEC_INLINE(op,ROP());
2227            old_icount = handle_timers(z180_icount, old_icount);
2228
20402229            z180_dma0();
2230            old_icount = handle_timers(z180_icount, old_icount);
2231
20412232            z180_dma1();
2233            old_icount = handle_timers(z180_icount, old_icount);
2234
20422235            /* If DMA is done break out to the faster loop */
20432236            if ((IO_DSTAT & Z180_DSTAT_DME) != Z180_DSTAT_DME)
20442237               break;
r1037r1038
20502243    {
20512244        do
20522245      {
2246         check_interrupts();
2247         Z180.after_EI = 0;
2248
20532249         _PPC = _PCD;
20542250         CALL_MAME_DEBUG;
20552251         _R++;
20562252         EXEC_INLINE(op,ROP());
2253         old_icount = handle_timers(z180_icount, old_icount);
2254
20572255         /* If DMA is started go to check the mode */
20582256         if ((IO_DSTAT & Z180_DSTAT_DME) == Z180_DSTAT_DME)
20592257            goto again;
20602258        } while( z180_icount > 0 );
20612259   }
20622260
2063   z180_icount -= Z180.extra_cycles;
2064   Z180.extra_cycles = 0;
2065
20662261   return cycles - z180_icount;
20672262}
20682263
r1037r1038
21182313{
21192314   if (irqline == INPUT_LINE_NMI)
21202315   {
2121      if( Z180.nmi_state == state ) return;
2122
2123      LOG(("Z180 #%d set_irq_line (NMI) %d\n", cpu_getactivecpu(), state));
2316      /* mark an NMI pending on the rising edge */
2317      if (Z180.nmi_state == CLEAR_LINE && state != CLEAR_LINE)
2318         Z180.nmi_pending = 1;
21242319      Z180.nmi_state = state;
2125      if( state == CLEAR_LINE ) return;
2126
2127      LOG(("Z180 #%d take NMI\n", cpu_getactivecpu()));
2128      _PPC = -1;         /* there isn't a valid previous program counter */
2129      LEAVE_HALT;       /* Check if processor was halted */
2130
2131      /* disable DMA transfers!! */
2132      IO_DSTAT &= ~Z180_DSTAT_DME;
2133
2134      _IFF1 = 0;
2135      PUSH( PC );
2136      _PCD = 0x0066;
2137      Z180.extra_cycles += 11;
21382320   }
21392321   else
21402322   {
r1037r1038
21452327      if (Z180.daisy)
21462328         Z180.irq_state[0] = z80daisy_update_irq_state(Z180.daisy);
21472329
2148      /* if there's something pending, take it */
2149      if (Z180.irq_state[0] != CLEAR_LINE)
2150         take_interrupt(Z180_INT0);
2151      if (Z180.irq_state[1] != CLEAR_LINE)
2152         take_interrupt(Z180_INT1);
2153      if (Z180.irq_state[2] != CLEAR_LINE)
2154         take_interrupt(Z180_INT2);
2330      /* the main execute loop will take the interrupt */
21552331   }
21562332}
21572333
2334/* logical to physical address translation */
2335static int z180_translate(int space, offs_t *addr)
2336{
2337   if (space == ADDRESS_SPACE_PROGRAM)
2338   {
2339      *addr = MMU_REMAP_ADDR(*addr);
2340   }
2341   return 1;
2342}
21582343
2159
21602344/**************************************************************************
21612345 * Generic set_info
21622346 **************************************************************************/
r1037r1038
21712355      case CPUINFO_INT_INPUT_STATE + Z180_INT1:      set_irq_line(Z180_INT1, info->i);      break;
21722356      case CPUINFO_INT_INPUT_STATE + Z180_INT2:      set_irq_line(Z180_INT2, info->i);      break;
21732357
2174/* TODO: timer interrupts are triggered internally, this is just a kludge to get 20pacgal running */
2175      case CPUINFO_INT_INPUT_STATE + Z180_INT_PRT0:   set_irq_line(Z180_INT_PRT0, info->i);   break;
2176
2177
21782358      case CPUINFO_INT_PC:                     _PC = info->i; z180_change_pc(_PCD);   break;
21792359      case CPUINFO_INT_REGISTER + Z180_PC:         Z180.PC.w.l = info->i;               break;
21802360      case CPUINFO_INT_SP:                     _SP = info->i;                     break;
r1037r1038
22822462   {
22832463      /* --- the following bits of info are returned as 64-bit signed integers --- */
22842464      case CPUINFO_INT_CONTEXT_SIZE:               info->i = sizeof(Z180);               break;
2285      case CPUINFO_INT_INPUT_LINES:               info->i = 1;                     break;
2465      case CPUINFO_INT_INPUT_LINES:               info->i = 3;                     break;
22862466      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0xff;                     break;
22872467      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
22882468      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
r1037r1038
24062586      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = z180_dasm;         break;
24072587#endif /* MAME_DEBUG */
24082588      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &z180_icount;         break;
2589      case CPUINFO_PTR_TRANSLATE:                  info->translate = z180_translate;      break;
24092590      case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_op: info->p = cc[Z180_TABLE_op];         break;
24102591      case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_cb: info->p = cc[Z180_TABLE_cb];         break;
24112592      case CPUINFO_PTR_Z180_CYCLE_TABLE + Z180_TABLE_ed: info->p = cc[Z180_TABLE_ed];         break;
r1037r1038
24162597      /* --- the following bits of info are returned as NULL-terminated strings --- */
24172598      case CPUINFO_STR_NAME:                     strcpy(info->s, "Z180");            break;
24182599      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Zilog Z8x180");      break;
2419      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "0.2");               break;
2600      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "0.3");               break;
24202601      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
24212602      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright (C) 2000 Juergen Buchmueller, all rights reserved."); break;
24222603
src/emu/cpu/z180/z180ops.h
r1037r1038
44#define ENTER_HALT {                                 \
55   _PC--;                                          \
66   _HALT = 1;                                       \
7   if( !after_EI )                                  \
7   if( !Z180.after_EI )                               \
88      z180_burn( z180_icount );                        \
99}
1010
r1037r1038
171171   /* speed up busy loop */                           \
172172   if( _PCD == oldpc )                               \
173173   {                                             \
174      if( !after_EI )                               \
174      if( !Z180.after_EI )                            \
175175         BURNODD( z180_icount, 1, cc[Z180_TABLE_op][0xc3] ); \
176176   }                                             \
177177   else                                          \
r1037r1038
182182         /* NOP - JP $-1 or EI - JP $-1 */               \
183183         if ( op == 0x00 || op == 0xfb )                \
184184         {                                       \
185            if( !after_EI )                         \
185            if( !Z180.after_EI )                      \
186186               BURNODD( z180_icount-cc[Z180_TABLE_op][0x00],\
187187                  2, cc[Z180_TABLE_op][0x00]+cc[Z180_TABLE_op][0xc3]); \
188188         }                                       \
r1037r1038
191191      /* LD SP,#xxxx - JP $-3 (Galaga) */                \
192192      if( _PCD == oldpc-3 && op == 0x31 )                \
193193      {                                          \
194         if( !after_EI )                            \
194         if( !Z180.after_EI )                         \
195195            BURNODD( z180_icount-cc[Z180_TABLE_op][0x31],   \
196196               2, cc[Z180_TABLE_op][0x31]+cc[Z180_TABLE_op][0xc3]); \
197197      }                                          \
r1037r1038
231231   /* speed up busy loop */                           \
232232   if( _PCD == oldpc )                               \
233233   {                                             \
234      if( !after_EI )                               \
234      if( !Z180.after_EI )                            \
235235         BURNODD( z180_icount, 1, cc[Z180_TABLE_op][0x18] ); \
236236   }                                             \
237237   else                                          \
r1037r1038
242242         /* NOP - JR $-1 or EI - JR $-1 */               \
243243         if ( op == 0x00 || op == 0xfb )                \
244244         {                                       \
245            if( !after_EI )                         \
245            if( !Z180.after_EI )                      \
246246               BURNODD( z180_icount-cc[Z180_TABLE_op][0x00],\
247247                  2, cc[Z180_TABLE_op][0x00]+cc[Z180_TABLE_op][0x18]); \
248248         }                                       \
r1037r1038
251251      /* LD SP,#xxxx - JR $-3 */                        \
252252      if( _PCD == oldpc-3 && op == 0x31 )                \
253253      {                                          \
254         if( !after_EI )                            \
254         if( !Z180.after_EI )                         \
255255            BURNODD( z180_icount-cc[Z180_TABLE_op][0x31],   \
256256               2, cc[Z180_TABLE_op][0x31]+cc[Z180_TABLE_op][0x18]); \
257257      }                                          \
r1037r1038
315315   LOG(("Z180 #%d RETN IFF1:%d IFF2:%d\n", cpu_getactivecpu(), _IFF1, _IFF2)); \
316316   POP(PC);                                       \
317317   z180_change_pc(_PCD);                              \
318   if( _IFF1 == 0 && _IFF2 == 1 )                        \
319   {                                             \
320      _IFF1 = 1;                                    \
321      if( Z180.irq_state[0] != CLEAR_LINE )               \
322      {                                          \
323         LOG(("Z180 #%d RETN takes INT0\n",                  \
324            cpu_getactivecpu()));                     \
325         take_interrupt(Z180_INT0);                     \
326      }                                          \
327      else if( Z180.irq_state[1] != CLEAR_LINE )            \
328      {                                          \
329         LOG(("Z180 #%d RETN takes INT1\n",                  \
330            cpu_getactivecpu()));                     \
331         take_interrupt(Z180_INT1);                     \
332      }                                          \
333      else if( Z180.irq_state[2] != CLEAR_LINE )            \
334      {                                          \
335         LOG(("Z180 #%d RETN takes INT2\n",                  \
336            cpu_getactivecpu()));                     \
337         take_interrupt(Z180_INT2);                     \
338      }                                          \
339   }                                             \
340   else _IFF1 = _IFF2;                               \
318   _IFF1 = _IFF2;                                    \
341319}
342320
343321/***************************************************************
r1037r1038
11481126 * EI
11491127 ***************************************************************/
11501128#define EI {                                       \
1151   /* If interrupts were disabled, execute one more            \
1152     * instruction and check the IRQ line.                      \
1153     * If not, simply set interrupt flip-flop 2                 \
1154     */                                           \
1155   if( _IFF1 == 0 )                                 \
1156   {                                             \
1157      _IFF1 = _IFF2 = 1;                              \
1158      _PPC = _PCD;                                 \
1159      CALL_MAME_DEBUG;                              \
1160      _R++;                                       \
1161      while( cpu_readop(_PCD) == 0xfb ) /* more EIs? */      \
1162      {                                          \
1163         LOG(("Z180 #%d multiple EI opcodes at %04X\n",      \
1164            cpu_getactivecpu(), _PC));                  \
1165         CC(op,0xfb);                              \
1166         _PPC =_PCD;                               \
1167         CALL_MAME_DEBUG;                           \
1168         _PC++;                                    \
1169         _R++;                                    \
1170      }                                          \
1171      if( Z180.irq_state[0] != CLEAR_LINE )               \
1172      {                                          \
1173         after_EI = 1;   /* avoid cycle skip hacks */      \
1174         EXEC(op,ROP());                            \
1175         after_EI = 0;                              \
1176         LOG(("Z180 #%d EI takes INT0\n", cpu_getactivecpu())); \
1177         take_interrupt(Z180_INT0);                     \
1178      }                                          \
1179      else if( Z180.irq_state[1] != CLEAR_LINE )            \
1180      {                                          \
1181         after_EI = 1;   /* avoid cycle skip hacks */      \
1182         EXEC(op,ROP());                            \
1183         after_EI = 0;                              \
1184         LOG(("Z180 #%d EI takes INT1\n", cpu_getactivecpu())); \
1185         take_interrupt(Z180_INT1);                     \
1186      }                                          \
1187      else if( Z180.irq_state[2] != CLEAR_LINE )            \
1188      {                                          \
1189         after_EI = 1;   /* avoid cycle skip hacks */      \
1190         EXEC(op,ROP());                            \
1191         after_EI = 0;                              \
1192         LOG(("Z180 #%d EI takes INT2\n", cpu_getactivecpu())); \
1193         take_interrupt(Z180_INT2);                     \
1194      } else EXEC(op,ROP());                           \
1195   } else _IFF2 = 1;                                 \
1129   _IFF1 = _IFF2 = 1;                                 \
1130   Z180.after_EI = 1;                                 \
11961131}
11971132
11981133/***************************************************************
src/emu/cpu/i86/i86mem.c
r1037r1038
22    8-bit memory accessors
33 *****************************************************************************/
44
5#ifdef I8086
6#if (HAS_I8088||HAS_I80188)
57static UINT16 read_word_8(offs_t addr)
68{
79   UINT16 result = program_read_byte_8(addr);
r1037r1038
4042   I.mem.wbyte_port = io_write_byte_8;
4143   I.mem.wword_port = write_port_word_8;
4244}
45#endif
46#endif
4347
4448
4549/*****************************************************************************
src/emu/cpu/i86/i86.c
r1037r1038
8080#include "table86.h"
8181
8282#include "instr86.c"
83#include "i86mem.c"
8384#undef I8086
8485
85#include "i86mem.c"
8686
8787/***************************************************************************/
8888static void i8086_state_register(int index)
r1037r1038
142142   configure_memory_16bit();
143143}
144144
145#if (HAS_I8088||HAS_I80188)
145146static void i8088_init(int index, int clock, const void *config, int (*irqcallback)(int))
146147{
147148   i8086_init(index, clock, config, irqcallback);
148149   configure_memory_8bit();
149150}
151#endif
150152
151153static void i8086_reset(void)
152154{
src/emu/cpu/v60/v60.c
r1037r1038
292292// Opcode jump table
293293#include "optable.c"
294294
295#ifdef UNUSED_FUNCTION
295296static int v60_default_irq_cb(int irqline)
296297{
297298   return 0;
298299}
300#endif
299301
300302static void base_init(const char *type, int index, int (*irqcallback)(int))
301303{
src/emu/cpu/v60/am1.c
r1037r1038
11121112   return 0; /* never reached, fatalerror won't return */
11131113}
11141114
1115#ifdef UNUSED_FUNCTION
11151116static UINT32 am1Error3(void)
11161117{
11171118   fatalerror("CPU - AM1 - 3 (PC=%06x)", PC);
r1037r1038
11231124   fatalerror("CPU - BAM1 - 3 (PC=%06x)", PC);
11241125   return 0; /* never reached, fatalerror won't return */
11251126}
1127#endif
11261128
11271129static UINT32 am1Error4(void)
11281130{
src/emu/cpu/v60/am2.c
r1037r1038
966966   return 0; /* never reached, fatalerror won't return */
967967}
968968
969#ifdef UNUSED_FUNCTION
969970static UINT32 am2Error3(void)
970971{
971972   fatalerror("CPU - AM2 - 3 (PC=%06x)", PC);
972973   return 0; /* never reached, fatalerror won't return */
973974}
975#endif
974976
975977static UINT32 am2Error4(void)
976978{
r1037r1038
996998   return 0; /* never reached, fatalerror won't return */
997999}
9981000
1001#ifdef UNUSED_FUNCTION
9991002static UINT32 bam2Error3(void)
10001003{
10011004   fatalerror("CPU - BAM2 - 3 (PC=%06x)", PC);
10021005   return 0; /* never reached, fatalerror won't return */
10031006}
1007#endif
10041008
10051009static UINT32 bam2Error4(void)
10061010{
src/emu/cpu/v60/am3.c
r1037r1038
745745   return 0; /* never reached, fatalerror won't return */
746746}
747747
748#ifdef UNUSED_FUNCTION
748749static UINT32 am3Error3(void)
749750{
750751   fatalerror("CPU - AM3 - 3 (PC=%06x)", PC);
751752   return 0; /* never reached, fatalerror won't return */
752753}
754#endif
753755
754756static UINT32 am3Error4(void)
755757{
src/emu/cpu/v60/optable.c
r1037r1038
254254   /* 0xfb */ opRETIS_1,
255255   /* 0xfc */ opSTTASK_0,
256256   /* 0xfd */ opSTTASK_1,
257   /* 0xfe */ opUNHANDLED,
258   /* 0xff */ opUNHANDLED,
257   /* 0xfe */ opCLRTLB_0,
258   /* 0xff */ opCLRTLB_1,
259259};
src/emu/cpu/dsp56k/dsp56ops.c
r1037r1038
5050static int MovePOperation(void) ;
5151
5252static int AndiOperation(void) ;
53static int OriOperation(void) ;
53//static int OriOperation(void) ;
5454
5555static int BitfieldOperation(void) ;
5656static int JmpOperation(void) ;
r1037r1038
105105    IMPLEMENTATION
106106***************************************************************************/
107107
108#ifdef UNUSED_FUNCTION
108109static void unimplemented(void)
109110{
110111   fatalerror("Unimplemented OP @ %04X: %04X", PC-2, OP) ;
111112}
113#endif
112114
113115
114116static void execute_one(void)
r1037r1038
17131715   return retSize ;
17141716}
17151717
1718#ifdef UNUSED_FUNCTION
17161719// !!! NOT IMPLEMENTED YET - JUST PUT HERE TO BE NEXT TO ANDI SOMEDAY !!!
17171720static int OriOperation(void)
17181721{
r1037r1038
17201723
17211724   return retSize ;
17221725}
1726#endif
17231727
17241728static int CmpOperation(void **wd, UINT64 *pa)
17251729{
src/emu/cpu/dsp56k/dsp56dsm.c
r1037r1038
1616
1717// Main opcode categories
1818static unsigned DecodeDataALUOpcode(char *buffer, UINT16 op, unsigned pc, int parallelType) ;
19static unsigned DecodeDXMDROpcode(char *buffer, UINT16 op, unsigned pc) ;
19//static unsigned DecodeDXMDROpcode(char *buffer, UINT16 op, unsigned pc) ;
2020static unsigned DecodeNPMOpcode(char *buffer, UINT16 op, unsigned pc, const UINT8 *oprom) ;
2121static unsigned DecodeMisfitOpcode(char *buffer, UINT16 op, unsigned pc, const UINT8 *oprom) ;
2222static unsigned DecodeSpecialOpcode(char *buffer, UINT16 op, unsigned pc, const UINT8 *oprom) ;
r1037r1038
2828static void AppendARU(char *buffer, UINT16 op) ;
2929static void AppendRRDM(char *buffer, UINT16 op, char *working) ;
3030
31static void AppendDXMDR(char *buffer, UINT16 op) ;
31//static void AppendDXMDR(char *buffer, UINT16 op) ;
3232
3333
3434// Helper functions
r1037r1038
4343static void DecodeccccTable (UINT16 cccc,           char *mnemonic) ;
4444static void DecodeDDDDDTable(UINT16 DDDDD,          char *SD) ;
4545static void DecodeDDTable   (UINT16 DD,             char *SD) ;
46static void DecodeDDFTable  (UINT16 DD,   UINT16 F, char *S, char *D) ;
46//static void DecodeDDFTable  (UINT16 DD,   UINT16 F, char *S, char *D) ;
4747static void DecodeEETable   (UINT16 EE,             char *D) ;
4848static void DecodeFTable    (UINT16 F,              char *SD) ;
4949static void Decodeh0hFTable (UINT16 h0h,  UINT16 F, char *S, char *D) ;
r1037r1038
5252static void DecodeIIIITable (UINT16 IIII,           char *S, char *D) ;
5353static void DecodeJJJFTable (UINT16 JJJ,  UINT16 F, char *S, char *D) ;
5454static void DecodeJJFTable  (UINT16 JJ,   UINT16 F, char *S, char *D) ;
55static void DecodeJFTable   (UINT16 J,    UINT16 F, char *S, char *D) ;
56static void DecodekTable    (UINT16 k,              char *Dnot) ;
57static void DecodekSignTable(UINT16 k,              char *plusMinus) ;
58static void DecodeKKKTable  (UINT16 KKK,            char *D1, char *D2) ;
59static int  DecodeNNTable   (UINT16 NN) ;
60static void DecodeQQFTable  (UINT16 QQ,   UINT16 F, char *S1, char *S2, char *D) ;
55//static void DecodeJFTable   (UINT16 J,    UINT16 F, char *S, char *D) ;
56//static void DecodekTable    (UINT16 k,              char *Dnot) ;
57//static void DecodekSignTable(UINT16 k,              char *plusMinus) ;
58//static void DecodeKKKTable  (UINT16 KKK,            char *D1, char *D2) ;
59//static int  DecodeNNTable   (UINT16 NN) ;
60//static void DecodeQQFTable  (UINT16 QQ,   UINT16 F, char *S1, char *S2, char *D) ;
6161static void DecodeQQFTableSp(UINT16 QQ,   UINT16 F, char *S1, char *S2, char *D) ;
62static void DecodeQQQFTable (UINT16 QQQ,  UINT16 F, char *S1, char *S2, char *D) ;
62//static void DecodeQQQFTable (UINT16 QQQ,  UINT16 F, char *S1, char *S2, char *D) ;
6363static int  DecodeRRTable   (UINT16 RR) ;
6464static void DecodesTable    (UINT16 s,              char *arithmetic) ;
65static void DecodessTable   (UINT16 ss,             char *arithmetic) ;
66static void DecodeuuuuFTable(UINT16 uuuu, UINT16 F, char *arg, char *S, char *D) ;
65//static void DecodessTable   (UINT16 ss,             char *arithmetic) ;
66//static void DecodeuuuuFTable(UINT16 uuuu, UINT16 F, char *arg, char *S, char *D) ;
6767static void DecodeZTable    (UINT16 Z,              char *ea) ;
6868
6969
7070static void AssembleeaFrommTable (UINT16 m,  int n,          char *ea) ;
71static void AssembleeaFrommmTable(UINT16 mm, int n1, int n2, char *ea1, char *ea2) ;
71//static void AssembleeaFrommmTable(UINT16 mm, int n1, int n2, char *ea1, char *ea2) ;
7272static void AssembleeaFromMMTable(UINT16 MM, int n,          char *ea) ;
7373static void AssembleeaFromtTable (UINT16 t,  UINT16 val,     char *ea) ;
7474static void AssembleeaFromqTable (UINT16 q,  int n,          char *ea) ;
r1037r1038
431431}
432432
433433
434#ifdef UNUSED_FUNCTION
434435static unsigned DecodeDXMDROpcode(char *buffer, UINT16 op, unsigned pc)
435436{
436437   unsigned retSize = 0 ;
r1037r1038
501502
502503   return retSize ;
503504}
505#endif
504506
505507
506508static unsigned DecodeNPMOpcode(char *buffer, UINT16 op, unsigned pc, const UINT8 *oprom)
r1037r1038
14101412   strcat(buffer, final) ;
14111413}
14121414
1415#ifdef UNUSED_FUNCTION
14131416static void AppendDXMDR(char *buffer, UINT16 op)
14141417{
14151418   char D1[32] ;
r1037r1038
14281431   sprintf(temp, "  X:%s,%s X:%s,%s", ea1, D1, ea2, D2) ;
14291432   strcat(buffer, temp) ;
14301433}
1434#endif
14311435
14321436
14331437
r1037r1038
15211525   }
15221526}
15231527
1528#ifdef UNUSED_FUNCTION
15241529static void DecodeDDFTable(UINT16 DD, UINT16 F, char *S, char *D)
15251530{
15261531   UINT16 switchVal = (DD << 1) | F ;
r1037r1038
15371542      case 0x7: sprintf(S, "Y1") ; sprintf(D, "B") ; break ;
15381543   }
15391544}
1545#endif
15401546
15411547static void DecodeEETable(UINT16 EE, char *D)
15421548{
r1037r1038
16621668   }
16631669}
16641670
1671#ifdef UNUSED_FUNCTION
16651672static void DecodeJFTable(UINT16 J, UINT16 F, char *S, char *D)
16661673{
16671674   UINT16 switchVal = (J << 1) | F ;
r1037r1038
17291736      case 0x7: sprintf(S1, "X1") ; sprintf(S2, "Y1") ; sprintf(D, "B") ; break ;
17301737   }
17311738}
1739#endif
17321740
17331741static void DecodeQQFTableSp(UINT16 QQ, UINT16 F, char *S1, char *S2, char *D)
17341742{
r1037r1038
17471755   }
17481756}
17491757
1758#ifdef UNUSED_FUNCTION
17501759static void DecodeQQQFTable(UINT16 QQQ, UINT16 F, char *S1, char *S2, char *D)
17511760{
17521761   UINT16 switchVal = (QQQ << 1) | F ;
r1037r1038
17711780      case 0xf: sprintf(S1, "Y1") ; sprintf(S2, "X1") ; sprintf(D, "B") ; break ;
17721781   }
17731782}
1783#endif
17741784
17751785static int DecodeRRTable(UINT16 RR)
17761786{
r1037r1038
17861796   }
17871797}
17881798
1799#ifdef UNUSED_FUNCTION
17891800static void DecodessTable(UINT16 ss, char *arithmetic)
17901801{
17911802   switch(ss)
r1037r1038
18161827      case 0x19: sprintf(arg, "add") ; case 0x1b: sprintf(arg, "sub") ; sprintf(S, "A")  ; sprintf(D, "B") ; break ;
18171828   }
18181829}
1830#endif
18191831
18201832static void DecodeZTable(UINT16 Z, char *ea)
18211833{
r1037r1038
18371849   }
18381850}
18391851
1852#ifdef UNUSED_FUNCTION
18401853static void AssembleeaFrommmTable(UINT16 mm, int n1, int n2, char *ea1, char *ea2)
18411854{
18421855   switch(mm)
r1037r1038
18511864               sprintf(ea2, "(R%d)+N%d", n2, n2) ; break ;
18521865   }
18531866}
1867#endif
18541868
18551869static void AssembleeaFromMMTable(UINT16 MM, int n, char *ea)
18561870{
src/emu/cpu/e132xs/e132xs.c
r1037r1038
3030
3131 TODO:
3232 - some wrong cycle counts
33 - support more than 1 cpu when it'll be needed
3433
3534 CHANGELOG:
3635
r1037r1038
419418   UINT32   trap_entry; // entry point to get trap address
420419
421420   UINT8   n;
422   mame_timer *timer;
423   mame_time time;
424421   INT32   delay_timer;
422   int      timer_clocks;
425423
426424   struct _delay delay;
427425
r1037r1038
479477#define SAME_SRC_DSTF  current_regs.same_src_dstf
480478#define SAME_SRCF_DST  current_regs.same_srcf_dst
481479
480#if (HAS_E116T || HAS_E116XT || HAS_E116XS || HAS_E116XSR || HAS_GMS30C2116 || HAS_GMS30C2216)
482481static UINT32 program_read_dword_16be(offs_t address)
483482{
484483   return (program_read_word_16be(address & ~1) << 16) | program_read_word_16be((address & ~1) + 2);
r1037r1038
500499   io_write_word_16be(address & ~1, (data & 0xffff0000)>>16);
501500   io_write_word_16be((address & ~1)+2, data & 0xffff);
502501}
502#endif
503503
504504
505505/* Opcodes table */
r1037r1038
761761//other bits are reversed, in particular 7 - 5 for the operating system.
762762//the user program can only changes the above 2 flags
763763
764/* Timer */
765static TIMER_CALLBACK( hyperstone_timer )
766{
767   TR++; // wrap around to 0 modulo 32 bits
768
769   if( hyperstone.delay_timer )
770   {
771      hyperstone.delay_timer = 0;
772      mame_timer_adjust(hyperstone.timer,hyperstone.time,0,hyperstone.time);
773   }
774}
775
776764static UINT32 get_global_register(UINT8 code)
777765{
778766/*
r1037r1038
876864         case TPR_REGISTER:
877865
878866            hyperstone.n = (val & 0xff0000) >> 16;
879            hyperstone.time = scale_up_mame_time(MAME_TIME_IN_HZ(cpunum_get_clock(0)), hyperstone.n + 2);
880867
881868            if(!(val & 0x80000000)) /* change immediately */
882869            {
883870               hyperstone.delay_timer = 0;
884               mame_timer_adjust(hyperstone.timer,hyperstone.time,0,hyperstone.time);
871               hyperstone.timer_clocks = hyperstone.n + 2;
885872            }
886873            else
887874            {
r1037r1038
16721659   state_save_register_item("E132XS", index, hyperstone.intblock);
16731660   state_save_register_item("E132XS", index, hyperstone.delay_timer);
16741661   state_save_register_item("E132XS", index, hyperstone.delay.delay_cmd);
1675   state_save_register_item("E132XS", index, hyperstone.time.seconds);
1676   state_save_register_item("E132XS", index, hyperstone.time.subseconds);
1662   state_save_register_item("E132XS", index, hyperstone.timer_clocks);
16771663
1678   hyperstone.timer = mame_timer_alloc(hyperstone_timer);
1679   mame_timer_adjust(hyperstone.timer, time_never, 0, time_zero);
1680
16811664   hyperstone.irq_callback = irqcallback;
16821665}
16831666
1667#if (HAS_E116T || HAS_E116XT || HAS_E116XS || HAS_E116XSR || HAS_GMS30C2116 || HAS_GMS30C2216)
16841668static void e116_init(int index, int clock, const void *config, int (*irqcallback)(int))
16851669{
16861670   hyp_cpu_read_byte      = program_read_byte_16be;
r1037r1038
16971681
16981682   hyperstone_init(index, clock, config, irqcallback);
16991683}
1684#endif
17001685
1686#if (HAS_E132N || HAS_E132T || HAS_E132XN || HAS_E132XT || HAS_E132XS || HAS_E132XSR || HAS_GMS30C2132 || HAS_GMS30C2232)
17011687static void e132_init(int index, int clock, const void *config, int (*irqcallback)(int))
17021688{
17031689   hyp_cpu_read_byte      = program_read_byte_32be;
r1037r1038
17141700
17151701   hyperstone_init(index, clock, config, irqcallback);
17161702}
1703#endif
17171704
17181705static void hyperstone_reset(void)
17191706{
17201707   //TODO: Add different reset initializations for BCR, MCR, FCR, TPR
17211708
17221709   int (*save_irqcallback)(int);
1723   mame_timer *hyp_timer;
17241710
17251711   save_irqcallback = hyperstone.irq_callback;
1726   hyp_timer = hyperstone.timer;
17271712   memset(&hyperstone, 0, sizeof(hyperstone_regs));
1728   hyperstone.timer = hyp_timer;
17291713   hyperstone.irq_callback = save_irqcallback;
17301714
17311715   hyperstone.h_clear = 0;
r1037r1038
17601744   // nothing to do
17611745}
17621746
1747/* Handle the timer, increasing its value after "timer_clocks" clocks and returning the new icount base that needs to be used for the next check */
1748static int handle_timers(int current_icount, int previous_icount)
1749{
1750   int diff = previous_icount - current_icount;
1751   int new_icount_base;
1752
1753   if(diff >= hyperstone.timer_clocks)
1754   {
1755      TR++; // wrap around to 0 modulo 32 bits
1756
1757      if( hyperstone.delay_timer )
1758      {
1759         hyperstone.delay_timer = 0;
1760         hyperstone.timer_clocks = hyperstone.n + 2;
1761      }
1762
1763      new_icount_base = current_icount + (diff - hyperstone.timer_clocks);
1764   }
1765   else
1766   {
1767      new_icount_base = previous_icount;
1768   }
1769
1770   if(!hyperstone.intblock)
1771   {
1772      if( !((TR - TCR) & 0x80000000) )
1773      {
1774         /* generate a timer interrupt */
1775         set_irq_line(7, PULSE_LINE);
1776      }
1777   }
1778
1779   return new_icount_base;
1780}
1781
17631782static int hyperstone_execute(int cycles)
17641783{
1784   int old_icount = cycles;
17651785   hyperstone_ICount = cycles;
17661786
17671787   do
r1037r1038
18091829
18101830      SET_ILC(hyperstone.instruction_length & 3);
18111831
1832      old_icount = handle_timers(hyperstone_ICount, old_icount);
1833
18121834      if(hyperstone.h_clear)
18131835      {
18141836         SET_H(0);
r1037r1038
18301852      {
18311853         hyperstone.intblock--;
18321854      }
1833      else
1834      {
1835         if( !((TR - TCR) & 0x80000000) )
1836         {
1837            /* generate a timer interrupt */
1838            set_irq_line(7, PULSE_LINE);
1839         }
1840      }
18411855
18421856   } while( hyperstone_ICount > 0 );
18431857
src/emu/cpu/i386/i386.h
r1037r1038
277277static I386_REGS I;
278278
279279
280/* Forward declarations */
281static void I386OP(decode_opcode)(void);
282static void I386OP(decode_two_byte)(void);
283
284
285280extern int i386_parity_table[256];
286281
287282#define PROTECTED_MODE      (I.cr[0] & 0x1)
src/emu/cpu/i386/i386dasm.c
r1037r1038
12501250   if( address_size == 2 ) {
12511251      if ((rm & 7) == 4)
12521252         s = handle_sib_byte( s, mod );
1253      else if (rm == 5 && mod == 0) {
1253      else if ((rm & 7) == 5 && mod == 0) {
12541254         disp32 = FETCHD32();
12551255         s += sprintf( s, "rip%s", shexstring(disp32, 0, TRUE) );
12561256      } else
r1037r1038
12671267   } else if (address_size == 1) {
12681268      if ((rm & 7) == 4)
12691269         s = handle_sib_byte( s, mod );
1270      else if (rm == 5 && mod == 0) {
1270      else if ((rm & 7) == 5 && mod == 0) {
12711271         disp32 = FETCHD32();
12721272         if (curmode == 64)
12731273            s += sprintf( s, "eip%s", shexstring(disp32, 0, TRUE) );
src/emu/cpu/i386/i386.c
r1037r1038
391391   }
392392}
393393
394/* Forward declarations */
395static void I386OP(decode_opcode)(void);
396static void I386OP(decode_two_byte)(void);
394397
395398
399
396400#include "i386ops.c"
397401#include "i386op16.c"
398402#include "i386op32.c"
src/emu/cpu/x86drc.c
r1037r1038
111111   if (!drc->tentative_list)
112112      return NULL;
113113
114   /* seed the cache */
115//  drc_cache_reset(drc);
116114   return drc;
117115
118116error:
src/emu/cpu/powerpc/ppc_mem.c
r1037r1038
6666
6767/***********************************************************************/
6868
69#if (HAS_PPC601||HAS_PPC602||HAS_PPC603||HAS_MPC8240)
6970static UINT16 ppc_read16_unaligned(UINT32 a)
7071{
7172   return ((UINT16)ppc.read8(a+0) << 8) | ((UINT16)ppc.read8(a+1) << 0);
r1037r1038
101102   ppc.write32(a+0, (UINT32)(d >> 32));
102103   ppc.write32(a+4, (UINT32)(d));
103104}
105#endif
104106
105107/***********************************************************************/
106108
r1037r1038
119121   PPC_TRANSLATE_NOEXCEPTION = 0x0004
120122};
121123
124#ifdef MESS
122125static int ppc_is_protected(UINT32 pp, int flags)
123126{
124127   if (flags & PPC_TRANSLATE_WRITE)
r1037r1038
133136   }
134137   return FALSE;
135138}
139#endif
136140
137141static int ppc_translate_address(offs_t *addr_ptr, int flags)
138142{
r1037r1038
282286#endif
283287}
284288
289#if (HAS_PPC602||HAS_PPC603)
285290static int ppc_translate_address_cb(int space, offs_t *addr)
286291{
287292   int success = 1;
r1037r1038
293298   }
294299   return success;
295300}
301#endif
296302
297303static UINT8 ppc_read8_translated(offs_t address)
298304{
r1037r1038
342348   program_write_qword_64be(address, data);
343349}
344350
351#ifndef PPC_DRC
352#if (HAS_PPC601||HAS_PPC602||HAS_PPC603||HAS_MPC8240)
345353static UINT32 ppc_readop_translated(offs_t address)
346354{
347355   ppc_translate_address(&address, PPC_TRANSLATE_CODE | PPC_TRANSLATE_READ);
348356   return program_read_dword_64be(address);
349357}
358#endif
359#endif
350360
351361/***********************************************************************/
352362
r1037r1038
362372
363373/***********************************************************************/
364374
375#if (HAS_PPC601||HAS_PPC602||HAS_PPC603||HAS_MPC8240)
365376static int ppc_readop(UINT32 offset, int size, UINT64 *value)
366377{
367378   if (!(ppc.msr & MSR_IR))
r1037r1038
422433
423434   return 1;
424435}
436#endif
src/emu/cpu/powerpc/ppc.c
r1037r1038
7171   if((ppc.msr & 0x2000) == 0){   \
7272   }
7373
74#if (HAS_PPC601||HAS_PPC602||HAS_PPC603||HAS_MPC8240)
7475static UINT32      ppc_field_xlat[256];
76#endif
7577
7678
7779
r1037r1038
247249   FPR   fpr[32];
248250   UINT32 sr[16];
249251
250#if HAS_PPC603 || HAS_PPC601
252#if HAS_PPC603 || HAS_PPC601 || HAS_MPC8240
251253   int is603;
252254#endif
253255#if HAS_PPC602
r1037r1038
831833#include "ppc602.c"
832834#endif
833835
834#if (HAS_PPC603 || HAS_PPC601)
836#if (HAS_PPC603 || HAS_PPC601 || HAS_MPC8240)
835837#include "ppc603.c"
836838#endif
837839
r1037r1038
18341836      case CPUINFO_PTR_READ:                     info->read = ppc_read;               break;
18351837      case CPUINFO_PTR_WRITE:                     info->write = ppc_write;            break;
18361838      case CPUINFO_PTR_READOP:                  info->readop = ppc_readop;            break;
1839      case CPUINFO_PTR_TRANSLATE:                  info->translate = ppc_translate_address_cb;   break;
18371840
18381841      /* --- the following bits of info are returned as NULL-terminated strings --- */
18391842      case CPUINFO_STR_NAME:                     strcpy(info->s, "PPC602");            break;
src/emu/cpu/powerpc/ppc_ops.c
r1037r1038
33// it really seems like this should be elsewhere - like maybe the floating point checks can hang out someplace else
44#include <math.h>
55
6#ifndef PPC_DRC
7#if (HAS_PPC601||HAS_PPC602||HAS_PPC603||HAS_MPC8240)
68static void ppc_unimplemented(UINT32 op)
79{
810   fatalerror("ppc: Unimplemented opcode %08X at %08X", op, ppc.pc);
911}
12#endif
1013
1114static void ppc_addx(UINT32 op)
1215{
r1037r1038
3942      SET_CR0(REG(RT));
4043   }
4144}
45#endif
4246
4347static void ppc_addex(UINT32 op)
4448{
r1037r1038
6367   }
6468}
6569
70#ifndef PPC_DRC
6671static void ppc_addi(UINT32 op)
6772{
6873   UINT32 i = SIMM16;
r1037r1038
112117
113118   REG(RT) = i;
114119}
120#endif
115121
116122static void ppc_addmex(UINT32 op)
117123{
r1037r1038
155161   }
156162}
157163
164#ifndef PPC_DRC
158165static void ppc_andx(UINT32 op)
159166{
160167   REG(RA) = REG(RS) & REG(RB);
r1037r1038
345352      SET_CR0(REG(RA));
346353   }
347354}
355#endif
348356
349357static void ppc_crand(UINT32 op)
350358{
r1037r1038
426434      CR(bit / 4) &= ~_BIT(3-(bit % 4));
427435}
428436
437#ifndef PPC_DRC
429438static void ppc_dcbf(UINT32 op)
430439{
431440
r1037r1038
455464{
456465
457466}
467#endif
458468
459469static void ppc_divwx(UINT32 op)
460470{
r1037r1038
507517   }
508518}
509519
520#ifndef PPC_DRC
510521static void ppc_eieio(UINT32 op)
511522{
512523
r1037r1038
682693
683694   REG(RT) = (UINT32)READ16(ea);
684695}
696#endif
685697
686698static void ppc_lmw(UINT32 op)
687699{
r1037r1038
777789   REG(RT) = READ32(ea);
778790}
779791
792#ifndef PPC_DRC
780793static void ppc_lwbrx(UINT32 op)
781794{
782795   UINT32 ea;
r1037r1038
856869{
857870   REG(RT) = ppc_get_spr(SPR);
858871}
872#endif
859873
860874static void ppc_mtcrf(UINT32 op)
861875{
r1037r1038
872886   if( fxm & 0x01 )   CR(7) = (REG(t) >> 0) & 0xf;
873887}
874888
889#ifndef PPC_DRC
875890static void ppc_mtmsr(UINT32 op)
876891{
877892   ppc_set_msr(REG(RS));
r1037r1038
10511066      SET_CR0(REG(RA));
10521067   }
10531068}
1069#endif
10541070
10551071#ifndef PPC_DRC
10561072static void ppc_sc(UINT32 op)
r1037r1038
11451161   }
11461162}
11471163
1164#ifndef PPC_DRC
11481165static void ppc_stb(UINT32 op)
11491166{
11501167   UINT32 ea;
r1037r1038
12381255
12391256   WRITE16(ea, (UINT16)REG(RS));
12401257}
1258#endif
12411259
12421260static void ppc_stmw(UINT32 op)
12431261{
r1037r1038
13161334   }
13171335}
13181336
1337#ifndef PPC_DRC
13191338static void ppc_stw(UINT32 op)
13201339{
13211340   UINT32 ea;
r1037r1038
13411360   w = REG(RS);
13421361   WRITE32(ea, BYTE_REVERSE32(w));
13431362}
1363#endif
13441364
13451365static void ppc_stwcx_rc(UINT32 op)
13461366{
r1037r1038
13671387   }
13681388}
13691389
1390#ifndef PPC_DRC
13701391static void ppc_stwu(UINT32 op)
13711392{
13721393   UINT32 ea = REG(RA) + SIMM16;
r1037r1038
14081429      SET_CR0(REG(RT));
14091430   }
14101431}
1432#endif
14111433
14121434static void ppc_subfcx(UINT32 op)
14131435{
r1037r1038
14251447   }
14261448}
14271449
1450#ifndef PPC_DRC
14281451static void ppc_subfex(UINT32 op)
14291452{
14301453   UINT32 ra = REG(RA);
r1037r1038
14561479
14571480   SET_SUB_CA(REG(RT), i, ra);
14581481}
1482#endif
14591483
14601484static void ppc_subfmex(UINT32 op)
14611485{
r1037r1038
14951519   }
14961520}
14971521
1522#ifndef PPC_DRC
14981523static void ppc_sync(UINT32 op)
14991524{
15001525
15011526}
1527#endif
15021528
15031529#ifndef PPC_DRC
15041530static void ppc_tw(UINT32 op)
r1037r1038
15881614}
15891615#endif
15901616
1617#ifndef PPC_DRC
15911618static void ppc_xorx(UINT32 op)
15921619{
15931620   REG(RA) = REG(RS) ^ REG(RB);
r1037r1038
16131640{
16141641   fatalerror("ppc: Invalid opcode %08X PC : %X", op, ppc.pc);
16151642}
1643#endif
16161644
16171645
16181646// Everything below is new from AJG
r1037r1038
17571785
17581786
17591787
1788#if (HAS_PPC601||HAS_PPC602||HAS_PPC603||HAS_MPC8240)
17601789static void ppc_lfs(UINT32 op)
17611790{
17621791   UINT32 ea = SIMM16;
r1037r1038
17861815   REG(a) = ea;
17871816}
17881817
1818#ifndef PPC_DRC
17891819static void ppc_lfd(UINT32 op)
17901820{
17911821   UINT32 ea = SIMM16;
r1037r1038
18101840
18111841   REG(a) = ea;
18121842}
1843#endif
18131844
18141845static void ppc_stfs(UINT32 op)
18151846{
r1037r1038
18401871   REG(a) = ea;
18411872}
18421873
1874#ifndef PPC_DRC
18431875static void ppc_stfd(UINT32 op)
18441876{
18451877   UINT32 ea = SIMM16;
r1037r1038
18891921
18901922   FPR(d).id = READ64(ea);
18911923}
1924#endif
18921925
18931926static void ppc_lfsux(UINT32 op)
18941927{
r1037r1038
19712004   ppc.sr[REG(b) >> 28] = REG(t);
19722005}
19732006
2007#ifndef PPC_DRC
19742008static void ppc_dcba(UINT32 op)
19752009{
19762010   /* TODO: Cache not emulated so this opcode doesn't need to be implemented */
r1037r1038
19882022
19892023   REG(a) = ea;
19902024}
2025#endif
19912026
19922027static void ppc_stfdx(UINT32 op)
19932028{
r1037r1038
20432078   WRITE32(ea, f.i);
20442079}
20452080
2081#ifndef PPC_DRC
20462082static void ppc_tlbia(UINT32 op)
20472083{
20482084   /* TODO: TLB not emulated so this opcode doesn't need to implemented */
r1037r1038
20672103{
20682104   ppc_unimplemented(op);
20692105}
2106#endif
20702107
20712108static void ppc_fabsx(UINT32 op)
20722109{
r1037r1038
28082845      SET_CR1();
28092846   }
28102847}
2848#endif
src/emu/cpu/powerpc/drc_ops.c
r1037r1038
499499   emit_xor_r32_r32(DRCTOP, REG_EBX, REG_EBX);
500500   emit_xor_r32_r32(DRCTOP, REG_EAX, REG_EAX);
501501   emit_cmp_r32_imm(DRCTOP, REG_EDX, 0);
502   /*_lahf();
502/*
503    _lahf();
503504
504505    _shr_r32_imm(REG_EAX, 14);
505506
506507    _add_r32_imm(REG_EAX, &condition_table);
507    _mov_r8_m8(REG_BL, MBD(REG_EAX, 0));
508    */
509
508    _mov_r8_m8bd(REG_BL, REG_EAX, 0);
509*/
510510   emit_setcc_r8(DRCTOP, COND_Z, REG_AL);
511511   emit_setcc_r8(DRCTOP, COND_L, REG_AH);
512512   emit_setcc_r8(DRCTOP, COND_G, REG_BL);
r1037r1038
522522   emit_mov_m8_r8(DRCTOP, MABS(&ppc.cr[0]), REG_BL);
523523}
524524
525#ifdef UNUSED_FUNCTION
525526static void append_set_cr1(drc_core *drc)
526527{
527528   emit_mov_r32_m32(DRCTOP, REG_EAX, MABS(&ppc.fpscr));
r1037r1038
529530   emit_and_r32_imm(DRCTOP, REG_EAX, 0xf);
530531   emit_mov_m8_r8(DRCTOP, MABS(&ppc.cr[1]), REG_AL);
531532}
533#endif
532534
533535static UINT32 recompile_addx(drc_core *drc, UINT32 op)
534536{
r1037r1038
26182620   return RECOMPILE_SUCCESSFUL_CP(1,4);
26192621}
26202622
2623#if HAS_PPC403
26212624static UINT32 recompile_dccci(drc_core *drc, UINT32 op)
26222625{
26232626   return RECOMPILE_SUCCESSFUL_CP(1,4);
r1037r1038
26492652   return RECOMPILE_UNIMPLEMENTED;
26502653}
26512654
2652#if HAS_PPC403
26532655static UINT32 recompile_mfdcr(drc_core *drc, UINT32 op)
26542656{
26552657   emit_mov_m32_r32(DRCTOP, MABS(&ppc_icount), REG_EBP);
r1037r1038
27072709
27082710/* PowerPC 60x Recompilers */
27092711
2712#if (HAS_PPC601||HAS_PPC602||HAS_PPC603||HAS_MPC8240)
27102713static UINT32 recompile_lfs(drc_core *drc,UINT32 op)
27112714{
27122715   emit_mov_m32_r32(DRCTOP, MABS(&ppc_icount), REG_EBP);
r1037r1038
37573760
37583761   return RECOMPILE_SUCCESSFUL_CP(1,4);
37593762}
3763#endif
37603764
37613765// PPC602
37623766
src/emu/cpu/powerpc/ppc403.c
r1037r1038
498498
499499
500500
501#ifndef PPC_DRC
501502static void ppc_dccci(UINT32 op)
502503{
503504
r1037r1038
532533
533534   change_pc(ppc.npc);
534535}
536#endif
535537
536538static void ppc_mfdcr(UINT32 op)
537539{
src/emu/cpu/powerpc/ppc602.c
r1037r1038
2929   ppc_set_msr(msr);
3030}
3131
32#ifndef PPC_DRC
3233static void ppc_tlbli(UINT32 op)
3334{
3435
r1037r1038
3839{
3940
4041}
42#endif
4143
4244#ifndef PPC_DRC
4345void ppc602_exception(int exception)
src/emu/cpu/powerpc/ppc603.c
r1037r1038
183183   }
184184}
185185
186#if HAS_PPC603
186187static void ppc603_set_smi_line(int state)
187188{
188189   if( state ) {
189190      ppc.interrupt_pending |= 0x4;
190191   }
191192}
193#endif
192194
193195INLINE void ppc603_check_interrupts(void)
194196{
src/emu/cpu/powerpc/ppcdrc.c
r1037r1038
1616#define MAX_INSTRUCTIONS   512
1717
1818
19#if (HAS_PPC603 || HAS_PPC601)
19#if (HAS_PPC603)
2020static void ppcdrc603_init(int index, int clock, const void *_config, int (*irqcallback)(int));
2121static void ppcdrc603_exit(void);
2222#endif
23#if (HAS_PPC603 || HAS_MPC8240)
23#if (HAS_PPC601 || HAS_PPC603 || HAS_MPC8240)
2424static void ppcdrc603_reset(void);
2525static int ppcdrc603_execute(int cycles);
2626static void ppcdrc603_set_irq_line(int irqline, int state);
r1037r1038
102102   if((ppc.msr & 0x2000) == 0){   \
103103   }
104104
105#if (HAS_PPC601||HAS_PPC602||HAS_PPC603||HAS_MPC8240)
105106static UINT32      ppc_field_xlat[256];
107#endif
106108
107109
108110
r1037r1038
845847   return CR(0) << 28 | CR(1) << 24 | CR(2) << 20 | CR(3) << 16 | CR(4) << 12 | CR(5) << 8 | CR(6) << 4 | CR(7);
846848}
847849
850#ifdef UNUSED_FUNCTION
848851static void log_code(drc_core *drc)
849852{
850853#if LOG_CODE
r1037r1038
854857   fclose(temp);
855858#endif
856859}
860#endif
861
857862/***********************************************************************/
858863
859864static UINT32 (* optable19[1024])(drc_core *, UINT32);
r1037r1038
13381343}
13391344#endif
13401345
1341#if (HAS_PPC603 || HAS_MPC8240)
1346#if (HAS_PPC601 || HAS_PPC603 || HAS_MPC8240)
13421347static void ppcdrc603_reset(void)
13431348{
13441349   ppc.pc = ppc.npc = 0xfff00100;
src/emu/cpu/sh4/sh4.c
r1037r1038
273273   }
274274}
275275
276#ifdef MAME_DEBUG
276277static void sh4_syncronize_register_bank(int to)
277278{
278279int s;
r1037r1038
282283      sh4.rbnk[to][s] = sh4.r[s];
283284   }
284285}
286#endif
285287
286288static void sh4_default_exception_priorities(void) // setup default priorities for exceptions
287289{
r1037r1038
33763378   cpuintrf_pop_context();
33773379}
33783380
3381#ifdef UNUSED_FUNCTION
33793382static void sh4_dmac_check(int dma)
33803383{
33813384   if(sh4.m[0x63+4*dma] & sh4.m[0x6c] & 1)
r1037r1038
34853488      }
34863489   }
34873490}
3491#endif
34883492
34893493WRITE32_HANDLER( sh4_internal_w )
34903494{
src/emu/cpu/nec/nec.c
r1037r1038
10351035    8-bit memory accessors
10361036 *****************************************************************************/
10371037
1038#if (HAS_V20||HAS_V25)
10381039static UINT16 read_word_8(offs_t addr)
10391040{
10401041   UINT16 result = program_read_byte_8(addr);
r1037r1038
10731074   I.mem.wbyte_port = io_write_byte_8;
10741075   I.mem.wword_port = write_port_word_8;
10751076}
1077#endif
10761078
10771079
10781080/*****************************************************************************
10791081    16-bit memory accessors
10801082 *****************************************************************************/
10811083
1084#if (HAS_V30||HAS_V33||HAS_V35)
10821085static UINT16 read_word_16le(offs_t addr)
10831086{
10841087   if (!(addr & 1))
r1037r1038
11371140   I.mem.wbyte_port = io_write_byte_16le;
11381141   I.mem.wword_port = write_port_word_16le;
11391142}
1143#endif
11401144
11411145
11421146/* Wrappers for the different CPU types */
1143#if (HAS_V20)
1147#if (HAS_V20||HAS_V25)
11441148void v20_init(int index, int clock, const void *config, int (*irqcallback)(int))
11451149{
11461150   nec_init(index, clock, config, irqcallback, 0);
r1037r1038
11721176}
11731177#endif
11741178
1175#if (HAS_V30)
1179#if (HAS_V30||HAS_V35)
11761180void v30_init(int index, int clock, const void *config, int (*irqcallback)(int))
11771181{
11781182   nec_init(index, clock, config, irqcallback, 1);
src/emu/cpu/i960/i960.c
r1037r1038
14021402            i960_icount -= 30;
14031403            t1 = get_1_ri(opcode);
14041404            t2f = get_2_rifl(opcode);
1405            set_rifl(opcode, t2f * pow(2.0, (double)t1));
1405            set_rifl(opcode, t2f * pow(2.0, (double)(INT32)t1));
14061406            break;
14071407
14081408         case 0x7: // scaler
14091409            i960_icount -= 30;
14101410            t1 = get_1_ri(opcode);
14111411            t2f = get_2_rif(opcode);
1412            set_rif(opcode, t2f * pow(2.0, (double)t1));
1412         set_rif(opcode, t2f * pow(2.0, (double)(INT32)t1));
14131413            break;
14141414
14151415         default:
r1037r1038
14951495         case 0x0: // atanrl
14961496            i960_icount -= 350;
14971497            t1f = get_1_rifl(opcode);
1498            set_rifl(opcode, atan(t1f));
1498            t2f = get_2_rifl(opcode);
1499            set_rifl(opcode, atan2(t2f, t1f));
14991500            break;
15001501
15011502         case 0x2: // logrl
src/emu/cpu/x86emit.h
r1037r1038
12161216   }
12171217
12181218   /* base only case */
1219   else if (index == REG_NONE && base != REG_ESP)
1219   else if (index == REG_NONE && (base & 7) != REG_ESP)
12201220   {
12211221      emit_op(emitptr, op, opsize, reg, 0, base);
12221222
12231223      /* mode 0 for no offset */
1224      if (disp == 0 && base != REG_EBP)
1224      if (disp == 0 && (base & 7) != REG_EBP)
12251225         emit_byte(emitptr, make_modrm(0, reg, base));
12261226
12271227      /* mode 1 for 1-byte offset */
r1037r1038
12581258      }
12591259
12601260      /* mode 0 for no offset */
1261      else if (disp == 0 && base != REG_EBP)
1261      else if (disp == 0 && (base & 7) != REG_EBP)
12621262      {
12631263         emit_byte(emitptr, make_modrm(0, reg, 4));
12641264         emit_byte(emitptr, make_sib(scale, index, base));
r1037r1038
17141714
17151715INLINE void emit_mov_r64_imm(x86code **emitptr, UINT8 dreg, UINT64 imm)
17161716{
1717   if ((INT32)imm == (INT64)imm)
1717   if ((UINT32)imm == imm)
1718   {
1719      emit_op_reg(emitptr, OP_MOV_rAX_Iv | (dreg & 7), OP_32BIT, dreg);
1720      emit_dword(emitptr, imm);
1721   }
1722   else if ((INT32)imm == imm)
17181723      emit_op_modrm_reg_imm32(emitptr, OP_G11_Ev_Iz, OP_64BIT, 0, dreg, imm);
17191724   else
17201725   {
r1037r1038
19962001INLINE void emit_shift_reg_imm(x86code **emitptr, UINT32 op1, UINT32 opn, UINT8 opsize, UINT8 opindex, UINT8 dreg, UINT8 imm)
19972002{
19982003   if (imm == 1)
1999      emit_op_modrm_reg(emitptr, op1, OP_32BIT, opindex, dreg);
2004      emit_op_modrm_reg(emitptr, op1, opsize, opindex, dreg);
20002005   else
2001      emit_op_modrm_reg_imm8(emitptr, opn, OP_32BIT, opindex, dreg, imm);
2006      emit_op_modrm_reg_imm8(emitptr, opn, opsize, opindex, dreg, imm);
20022007}
20032008
20042009INLINE void emit_shift_mem_imm(x86code **emitptr, UINT32 op1, UINT32 opn, UINT8 opsize, UINT8 opindex, DECLARE_MEMPARAMS, UINT8 imm)
20052010{
20062011   if (imm == 1)
2007      emit_op_modrm_mem(emitptr, op1, OP_32BIT, opindex, MEMPARAMS);
2012      emit_op_modrm_mem(emitptr, op1, opsize, opindex, MEMPARAMS);
20082013   else
2009      emit_op_modrm_mem_imm8(emitptr, opn, OP_32BIT, opindex, MEMPARAMS, imm);
2014      emit_op_modrm_mem_imm8(emitptr, opn, opsize, opindex, MEMPARAMS, imm);
20102015}
20112016
20122017
src/emu/cpu/x64drc.c
r0r1038
1/***************************************************************************
2
3    x64drc.c
4
5    x64 Dynamic recompiler support routines.
6
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10****************************************************************************
11
12    Windows x64 conventions:
13
14        Register        Status          Use
15        --------        ------          ---
16        RAX             Volatile        Return value register
17        RCX             Volatile        First integer argument
18        RDX             Volatile        Second integer argument
19        R8              Volatile        Third integer argument
20        R9              Volatile        Fourth integer argument
21        R10:R11         Volatile        Must be preserved as needed by caller; used in syscall/sysret instructions
22        R12:R15         Nonvolatile     Must be preserved by callee
23        RDI             Nonvolatile     Must be preserved by callee
24        RSI             Nonvolatile     Must be preserved by callee
25        RBX             Nonvolatile     Must be preserved by callee
26        RBP             Nonvolatile     May be used as a frame pointer; must be preserved by callee
27        RSP             Nonvolatile     Stack pointer
28
29        XMM0            Volatile        First FP argument
30        XMM1            Volatile        Second FP argument
31        XMM2            Volatile        Third FP argument
32        XMM3            Volatile        Fourth FP argument
33        XMM4:XMM5       Volatile        Must be preserved as needed by caller
34        XMM6:XMM15      Nonvolatile     Must be preserved as needed by callee.
35
36
37    Linux/MacOS x64 conventions:
38
39        Register        Status          Use
40        --------        ------          ---
41        RAX             Volatile        Return value register
42        RDI             Volatile        First integer argument
43        RSI             Volatile        Second integer argument
44        RDX             Volatile        Third integer argument
45        RCX             Volatile        Fourth integer argument
46        R8              Volatile        Fifth integer argument
47        R9              Volatile        Sixth integer argument
48        R10:R11         Volatile        Must be preserved as needed by caller
49        R12:R15         Nonvolatile     Must be preserved by callee
50        RBX             Nonvolatile     Must be preserved by callee
51        RBP             Nonvolatile     Must be preserved by callee
52        RSP             Nonvolatile     Stack pointer
53
54        XMM0            Volatile        First FP argument
55        XMM1            Volatile        Second FP argument
56        XMM2            Volatile        Third FP argument
57        XMM3            Volatile        Fourth FP argument
58        XMM4            Volatile        Fifth FP argument
59        XMM5            Volatile        Sixth FP argument
60        XMM6:XMM15      Volatile        Must be preserved as needed by caller.
61
62***************************************************************************/
63
64#include "cpuintrf.h"
65#include "x64drc.h"
66#include "debugger.h"
67
68#include <stddef.h>
69
70
71
72/***************************************************************************
73    MACROS
74***************************************************************************/
75
76#define MXCSR_VALUE(x)      (0x1fc0 | ((x) << 14))
77
78
79
80/***************************************************************************
81    FUNCTION PROTOTYPES
82***************************************************************************/
83
84static void append_entry_point(drc_core *drc);
85static void append_exit_point(drc_core *drc);
86static void recompile_code(drc_core *drc);
87static void append_recompile(drc_core *drc);
88static void append_flush(drc_core *drc);
89
90
91
92/***************************************************************************
93    INLINE FUNCTIONS
94***************************************************************************/
95
96/*-------------------------------------------------
97    allocate_l2_table - allocate an L2 table
98    if necessary
99-------------------------------------------------*/
100
101INLINE void allocate_l2_table(drc_core *drc, UINT32 l1index)
102{
103   if (drc->lookup_l1[l1index] == drc->lookup_l2_recompile)
104   {
105      /* create a new copy of the recompile table */
106      drc->lookup_l1[l1index] = drc_alloc(drc, sizeof(*drc->lookup_l2_recompile) << drc->l2bits);
107      memcpy(drc->lookup_l1[l1index], drc->lookup_l2_recompile, sizeof(*drc->lookup_l2_recompile) << drc->l2bits);
108   }
109}
110
111
112/***************************************************************************
113    EXTERNAL INTERFACES
114***************************************************************************/
115
116/*-------------------------------------------------
117    drc_init - initialize the DRC core
118-------------------------------------------------*/
119
120drc_core *drc_init(UINT8 cpunum, drc_config *config)
121{
122   int address_bits = config->address_bits;
123   int effective_address_bits = address_bits - config->lsbs_to_ignore;
124   drc_core *drc;
125   int i;
126
127   /* the drc structure lives at the start of the cache */
128   drc = (drc_core *)config->cache_base;
129   memset(drc, 0, sizeof(*drc));
130
131   /* copy in relevant data from the config */
132   drc->baseptr      = config->baseptr;
133   drc->pcptr        = config->pcptr;
134   drc->cb_reset     = config->cb_reset;
135   drc->cb_recompile = config->cb_recompile;
136   drc->cb_entrygen  = config->cb_entrygen;
137   drc->mxcsr_curr   = MXCSR_VALUE(FPRND_NEAR);
138
139   /* configure cache */
140   drc->cache_base = (UINT8 *)config->cache_base + sizeof(*drc);
141   drc->cache_size = config->cache_size - sizeof(*drc);
142   drc->cache_end = drc->cache_base + drc->cache_size;
143   drc->cache_danger = drc->cache_end - 65536;
144
145   /* compute shifts and masks */
146   drc->l1bits = effective_address_bits / 2;
147   drc->l2bits = effective_address_bits - drc->l1bits;
148   drc->l1shift = config->lsbs_to_ignore + drc->l2bits;
149   drc->l2mask = ((1 << drc->l2bits) - 1) << config->lsbs_to_ignore;
150   drc->l2scale = sizeof(x86code *) >> config->lsbs_to_ignore;
151
152   /* configure the MXCSR states */
153   for (i = 0; i < 4; i++)
154      drc->mxcsr_values[i] = MXCSR_VALUE(i);
155
156   /* allocate lookup tables out of the cache */
157   drc->lookup_l1 = drc_alloc(drc, sizeof(*drc->lookup_l1) << drc->l1bits);
158   drc->lookup_l2_recompile = drc_alloc(drc, sizeof(*drc->lookup_l2_recompile) << drc->l2bits);
159   if (drc->lookup_l1 == NULL || drc->lookup_l2_recompile == NULL)
160      goto error;
161   memset(drc->lookup_l1, 0, sizeof(*drc->lookup_l1) << drc->l1bits);
162   memset(drc->lookup_l2_recompile, 0, sizeof(*drc->lookup_l2_recompile) << drc->l2bits);
163
164   /* allocate the sequence and tentative lists */
165   drc->sequence_count_max = config->max_instructions;
166   drc->sequence_list = malloc(drc->sequence_count_max * sizeof(*drc->sequence_list));
167   if (drc->sequence_list == NULL)
168      goto error;
169
170   drc->tentative_count_max = config->max_instructions;
171   drc->tentative_list = malloc(drc->tentative_count_max * sizeof(*drc->tentative_list));
172   if (drc->tentative_list == NULL)
173      goto error;
174
175   /* get pointers to external C functions */
176#ifdef MAME_DEBUG
177   drc->mame_debug_hook = (x86code *)mame_debug_hook;
178#endif
179   drc->recompile_code = (x86code *)recompile_code;
180   drc->drc_cache_reset = (x86code *)drc_cache_reset;
181   return drc;
182
183error:
184   if (drc != NULL)
185      drc_exit(drc);
186   return NULL;
187}
188
189
190/*-------------------------------------------------
191    drc_alloc - allocate memory from the top of
192    the DRC cache
193-------------------------------------------------*/
194
195void *drc_alloc(drc_core *drc, size_t amount)
196{
197   /* if we don't have enough space, reset the cache */
198   if (drc->cache_top >= drc->cache_danger - amount)
199      drc_cache_reset(drc);
200
201   /* if we still don't have enough space, fail */
202   if (drc->cache_top >= drc->cache_danger - amount)
203      return NULL;
204
205   /* adjust the end and danger values downward */
206   drc->cache_end -= amount;
207   drc->cache_danger -= amount;
208   return drc->cache_end;
209}
210
211
212/*-------------------------------------------------
213    drc_cache_reset - reset the DRC cache
214-------------------------------------------------*/
215
216void drc_cache_reset(drc_core *drc)
217{
218   int i;
219
220   /* reset the cache and add the basics */
221   drc->cache_top = drc->cache_base;
222
223   /* append the core entry points to the fresh cache */
224   drc->entry_point = (void (*)(void *))(FPTR)drc->cache_top;
225   append_entry_point(drc);
226   drc->exit_point = drc->cache_top;
227   append_exit_point(drc);
228   drc->recompile = drc->cache_top;
229   append_recompile(drc);
230   drc->dispatch = drc->cache_top;
231   drc_append_dispatcher(drc);
232   drc->flush = drc->cache_top;
233   append_flush(drc);
234
235   /* populate the recompile table */
236   for (i = 0; i < (1 << drc->l2bits); i++)
237      drc->lookup_l2_recompile[i] = drc->recompile;
238
239   /* reset all the l1 tables */
240   for (i = 0; i < (1 << drc->l1bits); i++)
241   {
242      /* point NULL entries to the generic recompile table */
243      if (drc->lookup_l1[i] == NULL)
244         drc->lookup_l1[i] = drc->lookup_l2_recompile;
245
246      /* reset allocated tables to point all entries back to the recompiler */
247      else if (drc->lookup_l1[i] != drc->lookup_l2_recompile)
248         memcpy(drc->lookup_l1[i], drc->lookup_l2_recompile, sizeof(*drc->lookup_l2_recompile) << drc->l2bits);
249   }
250
251   /* call back to the host */
252   if (drc->cb_reset != NULL)
253      (*drc->cb_reset)(drc);
254}
255
256
257/*-------------------------------------------------
258    drc_execute - execute generated code
259-------------------------------------------------*/
260
261void drc_execute(drc_core *drc)
262{
263   (*drc->entry_point)(drc->baseptr);
264}
265
266
267/*-------------------------------------------------
268    drc_exit - release resources allocated by
269    the DRC core
270-------------------------------------------------*/
271
272void drc_exit(drc_core *drc)
273{
274   /* free the lists */
275   if (drc->sequence_list != NULL)
276      free(drc->sequence_list);
277   if (drc->tentative_list != NULL)
278      free(drc->tentative_list);
279}
280
281
282/*-------------------------------------------------
283    drc_begin_sequence - begin code generation
284    for a particular PC
285-------------------------------------------------*/
286
287void drc_begin_sequence(drc_core *drc, UINT32 pc)
288{
289   /* reset the sequence and tentative counts */
290   drc->sequence_count = 0;
291   drc->tentative_count = 0;
292}
293
294
295/*-------------------------------------------------
296    drc_add_entry_point - add a new external
297    entry point for a given PC
298-------------------------------------------------*/
299
300int drc_add_entry_point(drc_core *drc, UINT32 pc, int override)
301{
302   UINT32 l1index = pc >> drc->l1shift;
303   UINT32 l2index = ((pc & drc->l2mask) * drc->l2scale) / sizeof(x86code *);
304   int was_occupied;
305
306   /* allocate memory if necessary */
307   allocate_l2_table(drc, l1index);
308
309   /* in case anybody was jumping directly to this code entry, replace
310       the code with a jmp to the new code */
311    was_occupied = (drc->lookup_l1[l1index][l2index] != drc->recompile);
312   if (was_occupied && override)
313   {
314      x86code *dest = drc->lookup_l1[l1index][l2index];
315      emit_jmp(&dest, drc->cache_top);
316   }
317
318   /* note the current location for this instruction */
319   if (!was_occupied || override)
320      drc->lookup_l1[l1index][l2index] = drc->cache_top;
321   return was_occupied;
322}
323
324
325/*------------------------------------------------------------------
326    drc_end_sequence
327------------------------------------------------------------------*/
328
329void drc_end_sequence(drc_core *drc)
330{
331   int i, j;
332
333   /* fix up any internal links */
334   for (i = 0; i < drc->tentative_count; i++)
335   {
336      for (j = 0; j < drc->sequence_count; j++)
337         if (drc->tentative_list[i].pc == drc->sequence_list[j].pc)
338         {
339            x86code *dest = drc->tentative_list[i].target;
340            emit_jmp(&dest, drc->sequence_list[j].target);
341            while (dest < drc->tentative_list[i].end)
342               emit_int_3(&dest);
343            break;
344         }
345   }
346}
347
348
349/*------------------------------------------------------------------
350    drc_register_code_at_cache_top
351------------------------------------------------------------------*/
352
353void drc_register_code_at_cache_top(drc_core *drc, UINT32 pc)
354{
355   pc_ptr_pair *pair = &drc->sequence_list[drc->sequence_count++];
356   assert_always(drc->sequence_count <= drc->sequence_count_max, "drc_register_code_at_cache_top: too many instructions!");
357
358   pair->target = drc->cache_top;
359   pair->pc = pc;
360}
361
362
363/*------------------------------------------------------------------
364    drc_get_code_at_pc
365------------------------------------------------------------------*/
366
367x86code *drc_get_code_at_pc(drc_core *drc, UINT32 pc)
368{
369   UINT32 l1index = pc >> drc->l1shift;
370   UINT32 l2index = ((pc & drc->l2mask) * drc->l2scale) / sizeof(x86code *);
371   x86code *codeptr = drc->lookup_l1[l1index][l2index];
372   return (codeptr != drc->recompile) ? codeptr : NULL;
373}
374
375
376/*------------------------------------------------------------------
377    drc_invalidate_code_range
378------------------------------------------------------------------*/
379
380void drc_invalidate_code_range(drc_core *drc, UINT32 startpc, UINT32 endpc)
381{
382   UINT32 startl1index = startpc >> drc->l1shift;
383   UINT32 startl2index = ((startpc & drc->l2mask) * drc->l2scale) / sizeof(x86code *);
384   UINT32 endl1index = endpc >> drc->l1shift;
385   UINT32 endl2index = ((endpc & drc->l2mask) * drc->l2scale) / sizeof(x86code *);
386   UINT32 curl1;
387
388   /* iterate over l1 bunches */
389   for (curl1 = startl1index; curl1 <= endl1index; curl1++)
390   {
391      x86code **l2table = drc->lookup_l1[curl1];
392      UINT32 l2start, l2end, curl2;
393
394      /* if this is already empty, skip it */
395      if (l2table == drc->lookup_l2_recompile)
396         continue;
397
398      /* determine start/stop for this range */
399      l2start = (curl1 == startl1index) ? startl2index : 0;
400      l2end = (curl1 == endl1index) ? endl2index : ((1 << drc->l2bits) - 1);
401
402      /* invalidate any code entries here */
403      for (curl2 = l2start; curl2 <= l2end; curl2++)
404         if (l2table[curl2] != drc->recompile)
405         {
406            /* overwrite code there with a jump to the recompiler in case we ever get there */
407            x86code *dest = l2table[curl2];
408//              emit_int_3(&dest);
409            emit_jmp(&dest, drc->recompile);
410            l2table[curl2] = drc->recompile;
411         }
412   }
413}
414
415
416/*------------------------------------------------------------------
417    drc_append_call_debugger
418------------------------------------------------------------------*/
419
420void drc_append_call_debugger(drc_core *drc)
421{
422#ifdef MAME_DEBUG
423   if (Machine->debug_mode)
424      emit_call_m64(DRCTOP, MDRC(&drc->mame_debug_hook));                     // call mame_debug_hook
425#endif
426}
427
428
429/*------------------------------------------------------------------
430    drc_append_dispatcher
431------------------------------------------------------------------*/
432
433void drc_append_dispatcher(drc_core *drc)
434{
435   /* target PC is in P1 on entry; we must keep P1 intact in case we jump to the recompile callback */
436   emit_mov_r32_r32(DRCTOP, REG_P2, REG_P1);                              // mov  p2,p1
437   emit_mov_r32_r32(DRCTOP, REG_EAX, REG_P1);                              // mov  eax,p1
438   emit_shr_r32_imm(DRCTOP, REG_P2, drc->l1shift);                           // shr  p2,l1shift
439   emit_mov_r64_m64(DRCTOP, REG_P2, MDRCISD(drc->lookup_l1, REG_P2, 8, 0));      // mov  p2,[rbp+p2*8+l1lookup]
440   emit_and_r32_imm(DRCTOP, REG_EAX, drc->l2mask);                           // and  eax,l2mask
441   emit_jmp_m64(DRCTOP, MBISD(REG_P2, REG_EAX, drc->l2scale, 0));               // jmp  [p2 + eax*l2scale]
442}
443
444
445/*------------------------------------------------------------------
446    drc_append_fixed_dispatcher
447------------------------------------------------------------------*/
448
449void drc_append_fixed_dispatcher(drc_core *drc, UINT32 pc, int loadpc)
450{
451   UINT32 l1index = pc >> drc->l1shift;
452   UINT32 l2index = ((pc & drc->l2mask) * drc->l2scale) / sizeof(x86code *);
453
454   /* make sure we have an L2 table for this entry */
455   allocate_l2_table(drc, l1index);
456
457   /* emit a jump through the table entry */
458   if (loadpc)
459      emit_mov_r32_imm(DRCTOP, REG_P1, pc);                              // mov  p1,pc
460   emit_jmp_m64(DRCTOP, MDRC(&drc->lookup_l1[l1index][l2index]));               // jmp  [lookup[l1index][l2index]]
461}
462
463
464/*------------------------------------------------------------------
465    drc_append_tentative_fixed_dispatcher
466------------------------------------------------------------------*/
467
468void drc_append_tentative_fixed_dispatcher(drc_core *drc, UINT32 newpc, int loadpc)
469{
470   pc_ptr_pair *pair = &drc->tentative_list[drc->tentative_count++];
471   assert_always(drc->tentative_count <= drc->tentative_count_max, "drc_append_tentative_fixed_dispatcher: too many tentative branches!");
472
473   pair->target = drc->cache_top;
474   pair->pc = newpc;
475   drc_append_fixed_dispatcher(drc, newpc, loadpc);
476   pair->end = drc->cache_top;
477}
478
479
480/*------------------------------------------------------------------
481    drc_append_set_sse_rounding
482------------------------------------------------------------------*/
483
484void drc_append_set_sse_rounding(drc_core *drc, UINT8 regindex)
485{
486   emit_ldmxcsr_m32(DRCTOP, MDRCISD(&drc->mxcsr_values[0], regindex, 4, 0));      // ldmxcsr [mxcsr_values + reg*4]
487   emit_stmxcsr_m32(DRCTOP, MDRC(&drc->mxcsr_curr));                        // stmxcsr [mxcsr_curr]
488}
489
490
491
492/*------------------------------------------------------------------
493    drc_append_set_temp_sse_rounding
494------------------------------------------------------------------*/
495
496void drc_append_set_temp_sse_rounding(drc_core *drc, UINT8 rounding)
497{
498   emit_ldmxcsr_m32(DRCTOP, MDRC(&drc->mxcsr_values[rounding]));               // ldmxcsr mxcsr_values[rounding]
499}
500
501
502
503/*------------------------------------------------------------------
504    drc_append_restore_sse_rounding
505------------------------------------------------------------------*/
506
507void drc_append_restore_sse_rounding(drc_core *drc)
508{
509   emit_ldmxcsr_m32(DRCTOP, MDRC(&drc->mxcsr_curr));                        // ldmxcsr [mxcsr_curr]
510}
511
512
513
514/***************************************************************************
515    INTERNAL CODEGEN
516***************************************************************************/
517
518/*------------------------------------------------------------------
519    append_entry_point
520------------------------------------------------------------------*/
521
522static void append_entry_point(drc_core *drc)
523{
524   int pushbytes = 8 * (5 + (REG_NV5 != REG_NONE) + (REG_NV6 != REG_NONE));
525
526   /* save non-volatile registers */
527   emit_push_r64(DRCTOP, REG_NV0);                                       // push nv0
528   emit_push_r64(DRCTOP, REG_NV1);                                     // push nv1
529   emit_push_r64(DRCTOP, REG_NV2);                                       // push nv2
530   emit_push_r64(DRCTOP, REG_NV3);                                       // push nv3
531   emit_push_r64(DRCTOP, REG_NV4);                                       // push nv4
532   if (REG_NV5 != REG_NONE) emit_push_r64(DRCTOP, REG_NV5);                  // push nv5
533   if (REG_NV6 != REG_NONE) emit_push_r64(DRCTOP, REG_NV6);                  // push nv6
534
535   /* stack frame:
536        0x40/0x48 bytes of scratch space/alignment
537        0x20 bytes for register parameter spilling in Windows ABI
538    */
539   emit_sub_r64_imm(DRCTOP, REG_RSP, 0x68 + (pushbytes % 16));                  // sub  rsp,0x68/0x70
540
541   /* parameter 1 is the baseptr; copy to RBP */
542   emit_mov_r64_r64(DRCTOP, REG_DRC, REG_P1);                              // mov  rbp,p1
543
544   /* update the MXCSR register */
545   emit_stmxcsr_m32(DRCTOP, MDRC(&drc->mxcsr_save));                        // stmxcsr [mxcsr_save]
546   emit_ldmxcsr_m32(DRCTOP, MDRC(&drc->mxcsr_curr));                        // ldmxcsr [mxcsr_curr]
547
548   /* continue performing entry generation duties */
549   if (drc->cb_entrygen != NULL)
550      (*drc->cb_entrygen)(drc);                                       // additional entry point duties
551
552   /* reload the PC into P1 and dispatch */
553   emit_mov_r32_m32(DRCTOP, REG_P1, MDRC(drc->pcptr));                        // mov  p1,[pc]
554   drc_append_dispatcher(drc);                                          // dispatch
555}
556
557
558/*------------------------------------------------------------------
559    append_exit_point
560------------------------------------------------------------------*/
561
562static void append_exit_point(drc_core *drc)
563{
564   int pushbytes = 8 * (5 + (REG_NV5 != REG_NONE) + (REG_NV6 != REG_NONE));
565
566   /* on exit, P1 must contain the final PC */
567   emit_mov_m32_r32(DRCTOP, MDRC(drc->pcptr), REG_P1);                        // mov  [pc],p1
568
569   /* restore the MXCSR state */
570   emit_ldmxcsr_m32(DRCTOP, MDRC(&drc->mxcsr_save));                        // ldmxcsr [mxcsr_save]
571
572   /* add 0x18 to RSP to get us back to the original stack pointer */
573   emit_add_r64_imm(DRCTOP, REG_RSP, 0x68 + (pushbytes % 16));                  // add  rsp,0x68/0x70
574
575   /* save non-volatile registers */
576   if (REG_NV6 != REG_NONE) emit_pop_r64(DRCTOP, REG_NV6);                     // pop nv6
577   if (REG_NV5 != REG_NONE) emit_pop_r64(DRCTOP, REG_NV5);                     // pop nv5
578   emit_pop_r64(DRCTOP, REG_NV4);                                       // pop nv4
579   emit_pop_r64(DRCTOP, REG_NV3);                                       // pop nv3
580   emit_pop_r64(DRCTOP, REG_NV2);                                       // pop nv2
581   emit_pop_r64(DRCTOP, REG_NV1);                                       // pop nv1
582   emit_pop_r64(DRCTOP, REG_NV0);                                       // pop nv0
583   emit_ret(DRCTOP);                                                // ret
584}
585
586
587/*------------------------------------------------------------------
588    recompile_code
589------------------------------------------------------------------*/
590
591static void recompile_code(drc_core *drc)
592{
593   /* if we're above the danger line, flush the cache before recompiling */
594   if (drc->cache_top >= drc->cache_danger)
595      drc_cache_reset(drc);
596
597   /* call the recompile callback */
598   (*drc->cb_recompile)(drc);
599}
600
601
602/*------------------------------------------------------------------
603    append_recompile
604------------------------------------------------------------------*/
605
606static void append_recompile(drc_core *drc)
607{
608   /* on entry, P1 must contain the PC that needs recompilation */
609   emit_mov_m32_r32(DRCTOP, MDRC(drc->pcptr), REG_P1);                        // mov  [pc],p1
610   emit_lea_r64_m64(DRCTOP, REG_P1, MDRC(drc));                           // lea  p1,drc
611   emit_call_m64(DRCTOP, MDRC(&drc->recompile_code));                        // call recompile_code
612   emit_mov_r32_m32(DRCTOP, REG_P1, MDRC(drc->pcptr));                        // mov  p1,[pc]
613   drc_append_dispatcher(drc);                                          // dispatch
614}
615
616
617/*------------------------------------------------------------------
618    append_flush
619------------------------------------------------------------------*/
620
621static void append_flush(drc_core *drc)
622{
623   /* on entry, P1 must contain the PC that needs recompilation */
624   emit_mov_m32_r32(DRCTOP, MDRC(drc->pcptr), REG_P1);                        // mov  [pc],p1
625   emit_lea_r64_m64(DRCTOP, REG_P1, MDRC(drc));                           // lea  p1,drc
626   emit_call_m64(DRCTOP, MDRC(&drc->drc_cache_reset));                        // call drc_cache_reset
627   emit_mov_r32_m32(DRCTOP, REG_P1, MDRC(drc->pcptr));                        // mov  p1,[pc]
628   drc_append_dispatcher(drc);                                          // dispatch
629}
src/emu/cpu/tms32025/tms32025.c
r1037r1038
18001800   tms32025_datamap[7] = &R.intRAM[0x380];         /* B1 */
18011801}
18021802
1803#if (HAS_TMS32026)
18031804static void tms32026_reset (void)
18041805{
18051806   tms32025_reset();
r1037r1038
18221823   tms32025_datamap[14] = &R.intRAM[0x700];         /* B3 */
18231824   tms32025_datamap[15] = &R.intRAM[0x780];         /* B3 */
18241825}
1826#endif
18251827
18261828
18271829/****************************************************************************
src/emu/cpu/x64drc.h
r0r1038
1/***************************************************************************
2
3    x64drc.h
4
5    x64 Dynamic recompiler support routines.
6
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10***************************************************************************/
11
12#pragma once
13
14#ifndef __X64DRC_H__
15#define __X64DRC_H__
16
17#include "cpuintrf.h"
18#include "x86emit.h"
19
20
21/***************************************************************************
22    CONSTANTS
23***************************************************************************/
24
25/* ABI-specific configuration */
26#define REG_DRC      REG_RBP         /* pointer to DRC base */
27
28#ifdef X64_WINDOWS_ABI
29
30#define REG_P1      REG_RCX         /* 1st function parameter */
31#define REG_P2      REG_RDX         /* 2nd function parameter */
32#define REG_P3      REG_R8         /* 3rd function parameter */
33#define REG_P4      REG_R9         /* 4th function parameter */
34#define REG_V5      REG_R10         /* volatile register 5 */
35#define REG_V6      REG_R11         /* volatile register 6 */
36#define REG_NV0      REG_RBX         /* non-volatile reg 0 */
37#define REG_NV1      REG_RDI         /* non-volatile reg 1 */
38#define REG_NV2      REG_RSI         /* non-volatile reg 2 */
39#define REG_NV3      REG_R12         /* non-volatile reg 3 */
40#define REG_NV4      REG_R13         /* non-volatile reg 4 */
41#define REG_NV5      REG_R14         /* non-volatile reg 5 */
42#define REG_NV6      REG_R15         /* non-volatile reg 6 */
43
44#else
45
46#define REG_P1      REG_RDI         /* 1st function parameter */
47#define REG_P2      REG_RSI         /* 2nd function parameter */
48#define REG_P3      REG_RDX         /* 3rd function parameter */
49#define REG_P4      REG_RCX         /* 4th function parameter */
50#define REG_V5      REG_R10         /* volatile register 5 */
51#define REG_V6      REG_R11         /* volatile register 6 */
52#define REG_NV0      REG_RBX         /* non-volatile reg 0 */
53#define REG_NV1      REG_R12         /* non-volatile reg 1 */
54#define REG_NV2      REG_R13         /* non-volatile reg 2 */
55#define REG_NV3      REG_R14         /* non-volatile reg 3 */
56#define REG_NV4      REG_R15         /* non-volatile reg 4 */
57#define REG_NV5      REG_NONE      /* non-volatile reg 5 */
58#define REG_NV6      REG_NONE      /* non-volatile reg 6 */
59
60#endif
61
62
63
64/***************************************************************************
65    TYPE DEFINITIONS
66***************************************************************************/
67
68/* PC and pointer pair */
69typedef struct _pc_ptr_pair pc_ptr_pair;
70struct _pc_ptr_pair
71{
72   UINT32         pc;
73   x86code *      target;
74   x86code *      end;
75};
76
77
78/* core interface structure for the drc common code */
79typedef struct _drc_core drc_core;
80struct _drc_core
81{
82   /* cache parameters */
83   x86code *      cache_base;               /* base pointer to the compiler cache */
84   x86code *      cache_top;               /* current top of cache */
85   x86code *      cache_danger;            /* high water mark for the end */
86   x86code *      cache_end;               /* end of cache memory */
87   size_t         cache_size;               /* cache allocated size */
88
89   /* hash table lookups */
90   x86code ***      lookup_l1;               /* level 1 lookup */
91   x86code **      lookup_l2_recompile;      /* level 2 lookup populated with recompile pointers */
92   UINT8         l1bits;                  /* number of bits in level 1 lookup */
93   UINT8         l2bits;                  /* number of bits in level 2 lookup */
94   UINT8         l1shift;               /* shift to go from PC to level 1 lookup */
95   UINT32         l2mask;                  /* mask to go from PC to level 2 lookup */
96   UINT8         l2scale;               /* scale to get from masked PC value to final level 2 lookup */
97
98   /* entry point for calling from C code */
99   void          (*entry_point)(void *);      /* pointer to asm entry point */
100
101   /* base pointer for memory accesses */
102   void *         baseptr;               /* pointer to base; all cache must be accessible from here */
103
104   /* internal subroutines generated in the cache */
105   x86code *      exit_point;               /* exit out of the DRC engine */
106   x86code *      recompile;               /* pointer to recompile jump point */
107   x86code *      dispatch;               /* pointer to dispatch jump point */
108   x86code *      flush;                  /* pointer to flush jump point */
109
110   /* pointers to external C code */
111   x86code *      mame_debug_hook;         /* pointer to mame_debug_hook function */
112   x86code *      recompile_code;            /* pointer to recompile_code function */
113   x86code *      drc_cache_reset;         /* pointer to drc_cache_reset function */
114
115   /* pointers to the PC */
116   UINT32 *      pcptr;                  /* pointer to where the PC is stored */
117
118   /* save areas for the MXCSR register */
119   UINT32         mxcsr_curr;               /* current SSE control word */
120   UINT32         mxcsr_save;               /* saved SSE control word */
121   UINT32         mxcsr_values[4];         /* array of values for different modes */
122
123   /* internal lists of sequences and tentative branches */
124   pc_ptr_pair *   sequence_list;            /* PC/pointer sets for the current instruction sequence */
125   UINT32         sequence_count;            /* number of instructions in the current sequence */
126   UINT32         sequence_count_max;         /* max number of instructions in the current sequence */
127   pc_ptr_pair *   tentative_list;            /* PC/pointer sets for tentative branches */
128   UINT32         tentative_count;         /* number of tentative branches */
129   UINT32         tentative_count_max;      /* max number of tentative branches */
130
131   /* CPU-specific callbacks */
132   void          (*cb_reset)(struct _drc_core *drc);      /* callback when the cache is reset */
133   void          (*cb_recompile)(struct _drc_core *drc);   /* callback when code needs to be recompiled */
134   void          (*cb_entrygen)(struct _drc_core *drc);   /* callback before generating the dispatcher on entry */
135};
136
137
138/* configuration structure for the drc common code */
139typedef struct _drc_config drc_config;
140struct _drc_config
141{
142   void *         cache_base;               /* base of cache */
143   UINT32         cache_size;               /* size of cache */
144   UINT32         max_instructions;         /* maximum instructions per sequence */
145   UINT8         address_bits;            /* number of live address bits in the PC */
146   UINT8         lsbs_to_ignore;            /* number of LSBs to ignore on the PC */
147
148   void *         baseptr;               /* pointer to base; all cache must be accessible from here */
149   UINT32 *      pcptr;                  /* pointer to where the PC is stored */
150
151   void          (*cb_reset)(drc_core *drc);      /* callback when the cache is reset */
152   void          (*cb_recompile)(drc_core *drc);   /* callback when code needs to be recompiled */
153   void          (*cb_entrygen)(drc_core *drc);   /* callback before generating the dispatcher on entry */
154};
155
156
157
158/***************************************************************************
159    MACROS
160***************************************************************************/
161
162/* use this macro in emit_* instructions to make them shorter */
163#define DRCTOP               &drc->cache_top
164
165/* memory references to DRC-relative data */
166#define MDRC(x)                     MBD(REG_DRC, drcrel32(drc->baseptr, (x)))
167#define MDRCD(x, disp)               MBD(REG_DRC, drcrel32(drc->baseptr, (x)) + (disp))
168#define MDRCISD(x, index, scale, disp)   MBISD(REG_DRC, (index), (scale), drcrel32(drc->baseptr, (x)) + (disp))
169
170
171
172/***************************************************************************
173    FUNCTION PROTOTYPES
174***************************************************************************/
175
176/* init/shutdown */
177drc_core *drc_init(UINT8 cpunum, drc_config *config);
178void *drc_alloc(drc_core *drc, size_t amount);
179void drc_cache_reset(drc_core *drc);
180void drc_execute(drc_core *drc);
181void drc_exit(drc_core *drc);
182
183/* code management */
184void drc_begin_sequence(drc_core *drc, UINT32 pc);
185int drc_add_entry_point(drc_core *drc, UINT32 pc, int override);
186void drc_end_sequence(drc_core *drc);
187void drc_register_code_at_cache_top(drc_core *drc, UINT32 pc);
188x86code *drc_get_code_at_pc(drc_core *drc, UINT32 pc);
189void drc_invalidate_code_range(drc_core *drc, UINT32 startpc, UINT32 endpc);
190
191/* standard appendages */
192void drc_append_dispatcher(drc_core *drc);
193void drc_append_fixed_dispatcher(drc_core *drc, UINT32 newpc, int loadpc);
194void drc_append_tentative_fixed_dispatcher(drc_core *drc, UINT32 newpc, int loadpc);
195void drc_append_call_debugger(drc_core *drc);
196
197void drc_append_set_sse_rounding(drc_core *drc, UINT8 regindex);
198void drc_append_set_temp_sse_rounding(drc_core *drc, UINT8 rounding);
199void drc_append_restore_sse_rounding(drc_core *drc);
200
201
202
203/***************************************************************************
204    INLINE FUNCTIONS
205***************************************************************************/
206
207INLINE INT32 drcrel32(void *base, void *ptr)
208{
209   INT64 delta = (UINT8 *)ptr - (UINT8 *)base;
210   assert((INT32)delta == delta);
211   return (INT32)delta;
212}
213
214INLINE void *drcrelptr(drc_core *drc, INT32 offset)
215{
216   return (UINT8 *)drc + offset;
217}
218
219#endif   /* __X64DRC_H__ */
src/emu/cpu/mb86233/mb86233.c
r1037r1038
66    Written by ElSemi
77    MAME version by Ernesto Corvi
88
9
109    TODO:
1110    - Properly emulate the TGP Tables from the ROM (See GETEXTERNAL)
1211    - Many unknown opcodes and addressing modes
r1037r1038
4342   UINT32         shift;
4443   UINT16         sr;
4544
46   UINT16         gpr[16];
45   UINT32         gpr[16];
4746   UINT32         extport[0x30];
4847
4948   /* FIFO */
r1037r1038
357356      break;
358357
359358      case 0x18:   /* ASR D, SHIFT */
360         GETD().u = (GETD().u & 0x80000000) | (GETD().u >> GETSHIFT());
359//          GETD().u = (GETD().u & 0x80000000) | (GETD().u >> GETSHIFT());
360         GETD().i >>= GETSHIFT();
361361         FLAGSI(GETD().u);
362362      break;
363363
r1037r1038
396396
397397         r.u = GETEXTPORT()[0x20];
398398         a = r.i;
399         r.f = (float)sin((float)a*(2.0*M_PI/65536.0));
399         if ( a == 0 || a == -32768 )
400            r.f = 0;
401         else if ( a == 16384 )
402            r.f = 1.0;
403         else if ( a == -16384 )
404            r.f=-1.0;
405         else
406            r.f = (float)sin((float)a*(2.0*M_PI/65536.0));
407
400408         return r.u;
401409      }
402410
r1037r1038
407415
408416         r.u = GETEXTPORT()[0x20];
409417         a = r.i;
418         if ( a == 16384 || a == -16384 )
419            r.f = 0;
420         else if ( a == 0 )
421            r.f = 1.0;
422         else if ( a == -32768 )
423            r.f = -1.0;
424         else
425            r.f = (float)cos((float)a*(2.0*M_PI/65536.0));
410426
411         r.f = (float)cos((float)a*(2.0*M_PI/65536.0));
412427         return r.u;
413428      }
414429
430#if 0
415431      if ( offset == 0x22 )   /* -SIN from value at RAM(0x20) in 0x4000/PI steps */
416432      {
417433         MB86233_REG      r;
r1037r1038
422438         r.f = (float)-sin((float)a*(2.0*M_PI/65536.0));
423439         return r.u;
424440      }
441#endif
425442
426443      if ( offset == 0x27 )   /* atan */
427444      {
428445         MB86233_REG      r1, r2;
429         INT32         v;
430446
431447         r1.u = GETEXTPORT()[0x24]; /* A */
432448         r2.u = GETEXTPORT()[0x25]; /* B */
433449
434         v = (INT32)(atan2(r2.f,r1.f)*32768.0/M_PI);
450         if ( r2.f == 0 )
451         {
452            if ( r1.f >= 0 )
453               GETEXTPORT()[0x27] = 0;
454            else
455               GETEXTPORT()[0x27] = 0xFFFF8000;
456         }
457         else if ( r1.f == 0 )
458         {
459            if ( r2.f >= 0 )
460               GETEXTPORT()[0x27] = 0x4000;
461            else
462               GETEXTPORT()[0x27] = 0xFFFFC000;
463         }
464         else
465         {
466            r1.i = (INT32)((atan2(r2.f,r1.f))*32768.0/M_PI);
467            GETEXTPORT()[0x27] = r1.u;
468         }
435469
436         r1.i = v;
437         return r1.u;
470         return GETEXTPORT()[0x27];
438471      }
439472
440473      if ( offset == 0x28 )   /* 1/x - part 1 */
r1037r1038
444477      {
445478         MB86233_REG      r;
446479         r.u = GETEXTPORT()[0x28];
480         if ( r.f==0 )
481               r.u = 0x80000000;
447482         r.f = 1/r.f;
448483         return r.u;
449484      }
r1037r1038
455490      {
456491         MB86233_REG      r;
457492         r.u = GETEXTPORT()[0x2a];
458         r.f = 1/sqrt(r.f);
493         if ( r.f == 0 )
494            r.u=0x80000000;
495         else
496            r.f = 1/sqrt(r.f);
459497         return r.u;
460498      }
461499
r1037r1038
508546         break;
509547
510548         case 0x11:   /* A.e */
511            return (GETA().u >> 23) & 0x7f;
549            return (GETA().u >> 23) & 0xff;
512550         break;
513551
514552         case 0x12:   /* A.m */
r1037r1038
520558         break;
521559
522560         case 0x14:   /* B.e */
523            return (GETB().u >> 23) & 0x7f;
561            return (GETB().u >> 23) & 0xff;
524562         break;
525563
526564         case 0x15:   /* B.m */
r1037r1038
532570         break;
533571
534572         case 0x1A:   /* D.e */
535            return (GETD().u >> 23) & 0x7f;
573            return (GETD().u >> 23) & 0xff;
536574         break;
537575
538576         case 0x1B:   /* D.m */
r1037r1038
544582         break;
545583
546584         case 0x1D:   /* P.e */
547            return (GETP().u >> 23) & 0x7f;
585            return (GETP().u >> 23) & 0xff;
548586         break;
549587
550588         case 0x1E:   /* P.m */
r1037r1038
568606            {
569607               if ( mb86233.fifo_read_cb(&fifo_data) )
570608               {
571#if 0
572                  if ( GETPC() == 0x4C )
573                     printf( "TGP: Function %02x\n", (fifo_data >> 23 ) & 0xff );
574#endif
575609                  return fifo_data;
576610               }
577611            }
r1037r1038
669703   {
670704      if ( reg < 0x10 )
671705      {
706         if ( reg == 12 || reg == 13 )
707            val &= 0xff;
708
672709         GETGPR(reg) = val;
673710         return;
674711      }
r1037r1038
681718
682719         case 0x11:   /* A.e */
683720            GETA().u &= ~((0x0000007f) << 23);
684            GETA().u |= (( val & 0x7f ) << 23 );
721            GETA().u |= (( val & 0xff ) << 23 );
685722         break;
686723
687724         case 0x12:   /* A.m */
r1037r1038
696733
697734         case 0x14:   /* B.e */
698735            GETB().u &= ~((0x0000007f) << 23);
699            GETB().u |= (( val & 0x7f ) << 23 );
736            GETB().u |= (( val & 0xff ) << 23 );
700737         break;
701738
702739         case 0x15:   /* B.m */
r1037r1038
711748
712749         case 0x1A:   /* D.e */
713750            GETD().u &= ~((0x0000007f) << 23);
714            GETD().u |= (( val & 0x7f ) << 23 );
751            GETD().u |= (( val & 0xff ) << 23 );
715752         break;
716753
717754         case 0x1B:   /* B.m */
r1037r1038
726763
727764         case 0x1D:   /* P.e */
728765            GETP().u &= ~((0x0000007f) << 23);
729            GETP().u |= (( val & 0x7f ) << 23 );
766            GETP().u |= (( val & 0xff ) << 23 );
730767         break;
731768
732769         case 0x1E:   /* P.m */
r1037r1038
845882   return 0;
846883}
847884
848
849
850885/***************************************************************************
851886    Core Execution Loop
852887***************************************************************************/
r1037r1038
887922
888923               case 0x0D:
889924                  GETA().u = GETARAM()[INDIRECT(r1,0)];
890                  GETB().u = GETBRAM()[INDIRECT(r2|(2<<6),1)];
925                  GETB().u = GETBRAM()[INDIRECT(r2|2<<6,0)];
891926               break;
892927
893928               case 0x0F:
r1037r1038
921956
922957            switch( op )
923958            {
924               case 0x04:   /* MOV RAM->RAM */
959               case 0x04:   /* MOV RAM->External */
925960               {
926                  GETARAM()[r2] = GETARAM()[r1];
961                  SETEXTERNAL(GETEB(), r2, GETARAM()[r1]);
927962                  ALU(alu);
928963               }
929964               break;
r1037r1038
10361071               }
10371072               break;
10381073
1039               case 0x03:   /* RAM->External */
1074               case 0x03:   /* RAM->External Ind */
10401075               {
10411076                  val = GETARAM()[r1];
10421077                  ALU(alu);
r1037r1038
11141149
11151150            if( sub2 == 0x00 )         /* CLEAR reg */
11161151            {
1117               UINT32   reg = opcode & 0x3f;
1152               UINT32   reg = opcode & 0x1f;
11181153
11191154               switch( reg )
11201155               {
r1037r1038
11221157                     GETD().u = 0;
11231158                  break;
11241159
1160                  case 0x08:
1161                     GETB().u = 0;
1162                  break;
1163
11251164                  case 0x04:
11261165                     GETA().u = 0;
11271166                  break;
r1037r1038
11291168            }
11301169            else if ( sub2 == 0x04 )   /* REP xxx */
11311170            {
1132               if ( (opcode & 0xff) == 0 )
1133                  GETREPS() = 0x100;
1134               else
1135                  GETREPS() = opcode & 0xff;
1171               UINT32      sub3 = ( opcode >> 12 ) & 0x0f;
11361172
1137               GETPC()++;
1173               if ( sub3 == 0 )
1174               {
1175                  GETREPS() = opcode & 0xfff;
1176
1177                  if ( GETREPS() == 0 )
1178                     GETREPS() = 0x100;
1179
1180                  GETPC()++;
1181               }
1182               else if ( sub3 == 8 )
1183               {
1184                  GETREPS() = GETREGS( opcode & 0xfff, 0 );
1185                  GETPC()++;
1186               }
11381187            }
11391188            else if ( sub2 == 0x02 )   /* CLRFLAGS */
11401189            {
1141               GETSR() &= ~(opcode&0xffff);
1190               GETSR() &= ~(opcode&0xfff);
11421191            }
11431192            else if ( sub2 == 0x06 )   /* SETFLAGS */
11441193            {
1145               GETSR() |= (opcode&0xffff);
1194               GETSR() |= (opcode&0xfff);
11461195            }
11471196         }
11481197         break;
r1037r1038
11621211            UINT32   imm = opcode & 0xffffff;
11631212
11641213            if ( sub == 0 ) /* R12 */
1165               GETGPR(12) = imm;
1214               GETGPR(12) = imm & 0xff;
11661215            else if ( sub == 1 ) /* R13 */
1167               GETGPR(13) = imm;
1216               GETGPR(13) = imm & 0xff;
11681217            else
11691218               logerror( "TGP: Unknown LDIMM r12 (sub=%d) at PC:%04x\n", sub, GETPC() );
11701219         }
r1037r1038
11751224            UINT32   sub = (opcode>>24) & 0x03;
11761225            UINT32   imm = opcode & 0xffffff;
11771226
1178            if ( sub == 1 ) /* A.e */
1227            if ( sub == 0 ) /* A */
11791228            {
1180               GETA().u = (imm & 0x7f) << 23;
1229               GETA().u = imm;
11811230            }
1231            else if ( sub == 1 ) /* A.e */
1232            {
1233               GETA().u = (imm & 0xff) << 23;
1234            }
11821235            else if ( sub == 2 ) /* A.m */
11831236            {
11841237               GETA().u |= (imm & 0x7fffff ) | ((imm & 0x800000) << 8);
r1037r1038
11951248            UINT32   sub = (opcode>>24) & 0x03;
11961249            UINT32   imm = opcode & 0xffffff;
11971250
1198            if ( sub == 0 ) /* B.e */
1251            if ( sub == 0 ) /* B ? */
11991252            {
1200               GETB().u = (imm & 0x7f) << 23;
1253               GETB().u = ((imm & 0x7f) << 23) | ((imm & 0xff) << 8) | ( imm & 0xff );
12011254            }
1202            else if ( sub == 1 ) /* B.m */
1255            else if ( sub == 1 ) /* B.e */
12031256            {
1257               GETB().u = (imm & 0xff) << 23;
1258            }
1259            else if ( sub == 2 ) /* B.m */
1260            {
12041261               GETB().u |= (imm & 0x7fffff ) | ((imm & 0x800000) << 8);
12051262            }
12061263            else
r1037r1038
12151272            UINT32   sub = (opcode>>24) & 0x03;
12161273            UINT32   imm = opcode & 0xffffff;
12171274
1218            if ( sub == 2 ) /* D.e */
1275            if ( sub == 1 ) /* clear + D.m */
12191276            {
1220               GETD().u = (imm & 0x7f) << 23;
1277               GETD().u = (imm & 0x7fffff ) | ((imm & 0x800000) << 8);
12211278            }
1279            else if ( sub == 2 ) /* D.e */
1280            {
1281               GETD().u = (imm & 0xff) << 23;
1282            }
12221283            else if ( sub == 3 ) /* D.m */
12231284            {
12241285               GETD().u |= (imm & 0x7fffff ) | ((imm & 0x800000) << 8);
src/emu/cpu/mb86233/mb86233d.c
r1037r1038
431431
432432          switch(op)
433433          {
434            case 0x03:   /* RAM->External */
434            case 0x03:   /* RAM->External Indirect */
435435            {
436436               p += sprintf(p,"MOV RAM(0x%x)->E(EB+%s)",r1,INDIRECT(r2|(6<<6),0));
437437            }
438438            break;
439439
440            case 0x04:   /* MOV RAM->RAM */
440            case 0x04:   /* MOV RAM->External */
441441            {
442               p += sprintf(p,"MOV RAM(0x%x)->RAM(0x%x)",r1,r2);
442               p += sprintf(p,"MOV RAM(0x%x)->E(EB+0x%x)",r1,r2);
443443            }
444444            break;
445445
r1037r1038
560560            switch( opcode & 0x3f )
561561            {
562562               case 0x04: p += sprintf(p, "a" ); break;
563               case 0x08: p += sprintf(p, "b" ); break;
563564               case 0x10: p += sprintf(p, "d" ); break;
564565               default: p += sprintf(p, "UNKNOWN REG(%x)",opcode&0x3F); break;
565566            }
r1037r1038
568569            p += sprintf(p,"CLRFLAG 0x%x",opcode&0xffff);
569570         else if ( sub2==0x4 )
570571         {
571            if ( (opcode & 0xff) == 0 )
572            if ( (opcode & 0xfff) == 0 )
572573               p += sprintf(p,"REP 0x100");
573574            else
574575               p += sprintf(p,"REP 0x%x",opcode&0xff);
r1037r1038
608609
609610         p += sprintf(p,"LDIMM 0x%X->",opcode&0xffffff);
610611
611         if ( sub == 1 ) p += sprintf(p,"a.e");
612         if ( sub == 0 ) p += sprintf(p,"a.exp");
613         else if ( sub == 1 ) p += sprintf(p,"a.e");
612614         else if ( sub == 2 ) p += sprintf(p,"a.m");
613615         else p += sprintf(p,"UNKREG(%x)", sub);
614616      }
r1037r1038
620622
621623          p += sprintf(p,"LDIMM 0x%X->",opcode&0xffffff);
622624
623         if ( sub == 0 ) p += sprintf(p,"b.e");
624         else if ( sub == 1 ) p += sprintf(p,"b.m");
625         if ( sub == 0 ) p += sprintf(p,"b.exp");
626         else if ( sub == 1 ) p += sprintf(p,"b.e");
627         else if ( sub == 2 ) p += sprintf(p,"b.m");
625628         else p += sprintf(p,"UNKREG(%x)", sub);
626629      }
627630      break;
src/emu/cpu/m6800/6800ops.c
r1037r1038
2020}
2121
2222/* HD63701 only */
23#if (HAS_HD63701)
2324//INLINE void trap( void )
2425static void trap( void )
2526{
2627   logerror("M6808: illegal opcode: address %04X, op %02X\n",PC,(int) M_RDOP_ARG(PC)&0xFF);
2728   TAKE_TRAP;
2829}
30#endif
2931
3032/* $00 ILLEGAL */
3133
src/emu/cpu/m6800/6800tbl.c
r1037r1038
246246INLINE void cpx_ex(void);
247247INLINE void cpx_im(void);
248248INLINE void cpx_ix(void);
249#if (HAS_HD63701)
249250//INLINE void trap(void);
250251static void trap(void);
252#endif
251253
252254static void (*m6800_insn[0x100])(void) = {
253255illegal,nop,   illegal,illegal,illegal,illegal,tap,   tpa,
src/emu/uimenu.c
r1037r1038
163163static UINT32 menu_cheat(UINT32 state);
164164static UINT32 menu_memory_card(UINT32 state);
165165static UINT32 menu_video(UINT32 state);
166static UINT32 menu_reset_game(UINT32 state);
167166static UINT32 menu_quit_game(UINT32 state);
168167static UINT32 menu_select_game(UINT32 state);
169168#ifdef MESS
r1037r1038
837836      ADD_MENU(UI_memorycard, menu_memory_card, 0);
838837
839838   /* add reset and exit menus */
840/*  ADD_MENU(UI_resetgame, menu_reset_game, 0);*/
841839   ADD_MENU(UI_selectgame, menu_select_game, 1 << 16);
842840   ADD_MENU(UI_returntogame, NULL, 0);
843841
r1037r1038
15271525
15281526
15291527/*-------------------------------------------------
1530    menu_reset_game - handle the "menu" for
1531    resetting the game
1532-------------------------------------------------*/
1533
1534static UINT32 menu_reset_game(UINT32 state)
1535{
1536   /* request a reset */
1537   mame_schedule_soft_reset(Machine);
1538
1539   /* reset the menu stack */
1540   ui_menu_stack_reset();
1541   return 0;
1542}
1543
1544
1545/*-------------------------------------------------
15461528    menu_quit_game - handle the "menu" for
15471529    quitting the game
15481530-------------------------------------------------*/
src/emu/mame.c
r1037r1038
14081408   machine->playback_file = NULL;
14091409
14101410   /* debugger-related information */
1411#ifdef MAME_DEBUG
14111412   machine->debug_mode = options_get_bool(mame_options(), OPTION_DEBUG);
1413#else
1414   machine->debug_mode = 0;
1415#endif
14121416
14131417   /* reset the global MAME data and clear the other privates */
14141418   memset(machine->mame_data, 0, sizeof(*machine->mame_data));
src/emu/sound/scsp.c
r1037r1038
220220};
221221
222222static void dma_scsp(struct _SCSP *SCSP);       /*SCSP DMA transfer function*/
223#define   scsp_dgate      scsp_regs[0x416/2] & 0x4000
224#define   scsp_ddir      scsp_regs[0x416/2] & 0x2000
225#define scsp_dexe       scsp_regs[0x416/2] & 0x1000
226#define dma_transfer_end   ((scsp_regs[0x424/2] & 0x10)>>4)|(((scsp_regs[0x426/2] & 0x10)>>4)<<1)|(((scsp_regs[0x428/2] & 0x10)>>4)<<2)
223#define   scsp_dgate      scsp_regs[0x16/2] & 0x4000
224#define   scsp_ddir      scsp_regs[0x16/2] & 0x2000
225#define scsp_dexe       scsp_regs[0x16/2] & 0x1000
226#define dma_transfer_end   ((scsp_regs[0x24/2] & 0x10)>>4)|(((scsp_regs[0x26/2] & 0x10)>>4)<<1)|(((scsp_regs[0x28/2] & 0x10)>>4)<<2)
227227
228228static const float SDLT[8]={-1000000.0,-36.0,-30.0,-24.0,-18.0,-12.0,-6.0,0.0};
229229
r1037r1038
742742   }
743743   else if(addr<0x600)
744744   {
745      *((unsigned short *) (SCSP->udata.datab+((addr&0xff)))) = val;
746      SCSP_UpdateReg(SCSP, addr&0xff);
745      if (addr < 0x430)
746      {
747         *((unsigned short *) (SCSP->udata.datab+((addr&0x3f)))) = val;
748         SCSP_UpdateReg(SCSP, addr&0x3f);
749      }
747750   }
748751   else if(addr<0x700)
749752      SCSP->RINGBUF[(addr-0x600)/2]=val;
r1037r1038
777780   }
778781   else if(addr<0x600)
779782   {
780      SCSP_UpdateRegR(SCSP, addr&0xff);
781      v= *((unsigned short *) (SCSP->udata.datab+((addr&0xff))));
783      if (addr < 0x430)
784      {
785         SCSP_UpdateRegR(SCSP, addr&0x3f);
786         v= *((unsigned short *) (SCSP->udata.datab+((addr&0x3f))));
787      }
782788   }
783789   else if(addr<0x700)
784790      v=SCSP->RINGBUF[(addr-0x600)/2];
r1037r1038
12211227
12221228   scsp_regs = (UINT16 *)SCSP->udata.datab;
12231229
1224   logerror("SCSP: DMA transfer START\n"
1230   mame_printf_debug("SCSP: DMA transfer START\n"
12251231          "DMEA: %04x DRGA: %04x DTLG: %04x\n"
12261232          "DGATE: %d  DDIR: %d\n",SCSP->scsp_dmea,SCSP->scsp_drga,SCSP->scsp_dtlg,scsp_dgate ? 1 : 0,scsp_ddir ? 1 : 0);
12271233
r1037r1038
12291235     * (DMA *can't* overwrite his parameters).                  */
12301236   if(!(scsp_ddir))
12311237   {
1232      tmp_dma[0] = scsp_regs[0x412/2];
1233      tmp_dma[1] = scsp_regs[0x414/2];
1234      tmp_dma[2] = scsp_regs[0x416/2];
1238      tmp_dma[0] = scsp_regs[0x12/2];
1239      tmp_dma[1] = scsp_regs[0x14/2];
1240      tmp_dma[2] = scsp_regs[0x16/2];
12351241   }
12361242
12371243   if(scsp_ddir)
r1037r1038
12561262   /*Resume the values*/
12571263   if(!(scsp_ddir))
12581264   {
1259       scsp_regs[0x412/2] = tmp_dma[0];
1260      scsp_regs[0x414/2] = tmp_dma[1];
1261      scsp_regs[0x416/2] = tmp_dma[2];
1265       scsp_regs[0x12/2] = tmp_dma[0];
1266      scsp_regs[0x14/2] = tmp_dma[1];
1267      scsp_regs[0x16/2] = tmp_dma[2];
12621268   }
12631269
12641270   /*Job done,request a dma end irq*/
1265   if(scsp_regs[0x41e/2] & 0x10)
1271   if(scsp_regs[0x1e/2] & 0x10)
12661272   cpunum_set_input_line(2,dma_transfer_end,HOLD_LINE);
12671273}
12681274
r1037r1038
13491355      case 0x412:
13501356      /*DMEA [15:1]*/
13511357      /*Sound memory address*/
1352      SCSP->scsp_dmea = (((scsp_regs[0x414/2] & 0xf000)>>12)*0x10000) | (scsp_regs[0x412/2] & 0xfffe);
1358      SCSP->scsp_dmea = (((scsp_regs[0x14/2] & 0xf000)>>12)*0x10000) | (scsp_regs[0x12/2] & 0xfffe);
13531359      break;
13541360      case 0x414:
13551361      /*DMEA [19:16]*/
1356      SCSP->scsp_dmea = (((scsp_regs[0x414/2] & 0xf000)>>12)*0x10000) | (scsp_regs[0x412/2] & 0xfffe);
1362      SCSP->scsp_dmea = (((scsp_regs[0x14/2] & 0xf000)>>12)*0x10000) | (scsp_regs[0x12/2] & 0xfffe);
13571363      /*DRGA [11:1]*/
13581364      /*Register memory address*/
1359      SCSP->scsp_drga = scsp_regs[0x414/2] & 0x0ffe;
1365      SCSP->scsp_drga = scsp_regs[0x14/2] & 0x0ffe;
13601366      break;
13611367      case 0x416:
13621368      /*DGATE[14]*/
r1037r1038
13671373      /*starting bit*/
13681374      /*DTLG[11:1]*/
13691375      /*size of transfer*/
1370      SCSP->scsp_dtlg = scsp_regs[0x416/2] & 0x0ffe;
1376      SCSP->scsp_dtlg = scsp_regs[0x16/2] & 0x0ffe;
13711377      if(scsp_dexe)
13721378      {
13731379         dma_scsp(SCSP);
1374         scsp_regs[0x416/2]^=0x1000;//disable starting bit
1380         scsp_regs[0x16/2]^=0x1000;//disable starting bit
13751381      }
13761382      break;
13771383      //check main cpu IRQ
src/emu/sound/2610intf.c
r1037r1038
106106   stream_update(info->stream);
107107}
108108
109#if BUILD_YM2610
109110static void ym2610_stream_update(void *param, stream_sample_t **inputs, stream_sample_t **buffers, int length)
110111{
111112   struct ym2610_info *info = param;
r1037r1038
163164   /* error */
164165   return NULL;
165166}
167#endif
166168
167169#if BUILD_YM2610B
168170static void ym2610b_stream_update(void *param, stream_sample_t **inputs, stream_sample_t **buffers, int length)
src/lib/util/options.h
r1037r1038
44
55    Core options code code
66
7    Copyright (c) 1996-2006, Nicola Salmoria and the MAME Team.
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/lib/util/aviio.c
r1037r1038
44
55    AVI movie format parsing helpers.
66
7    Copyright (c) 1996-2006, Nicola Salmoria and the MAME Team.
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/lib/util/aviio.h
r1037r1038
44
55    AVI movie format parsing helpers.
66
7    Copyright (c) 1996-2006, Nicola Salmoria and the MAME Team.
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/lib/util/pool.c
r1037r1038
44
55    Resource pool code
66
7    Copyright (c) 1996-2006, Nicola Salmoria and the MAME Team.
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
r1037r1038
519519
520520
521521
522
523/*-------------------------------------------------
524    pointer_in_block - returns whether a pointer
525    is within a memory block
526-------------------------------------------------*/
527
528static int pointer_in_block(const UINT8 *ptr, const UINT8 *block, size_t block_size)
529{
530   return (ptr >= block && ptr < block + block_size);
531}
532
533
534
535522/***************************************************************************
536523    INTERNAL FUNCTIONS
537524***************************************************************************/
src/lib/util/pool.h
r1037r1038
44
55    Abstract object pool management
66
7    Copyright (c) 1996-2006, Nicola Salmoria and the MAME Team.
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/lib/util/huffman.c
r1037r1038
44
55    Video compression and decompression helpers.
66
7    Copyright (c) 1996-2006, Nicola Salmoria and the MAME Team.
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010****************************************************************************
src/lib/util/avcomp.c
r1037r1038
1010
1111    Audio/video compression and decompression helpers.
1212
13    Copyright (c) 1996-2006, Nicola Salmoria and the MAME Team.
13    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
1414    Visit http://mamedev.org for licensing and usage restrictions.
1515
1616****************************************************************************
src/lib/util/huffman.h
r1037r1038
44
55    Huffman compression routines.
66
7    Copyright (c) 1996-2006, Nicola Salmoria and the MAME Team.
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
src/lib/util/avcomp.h
r1037r1038
44
55    Audio/video compression and decompression helpers.
66
7    Copyright (c) 1996-2006, Nicola Salmoria and the MAME Team.
7    Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
1010***************************************************************************/
docs/messnew.txt
r1037r1038
1010----------------------
1111- [PCE] Added support for Populous on-cart RAM.  [Wilbert Pol]
1212
13- [PCE] Added preliminary emulation of the CD-ROM interface.  [Wilbert
14  Pol]
13- [PCE] Added preliminary emulation of the CD-ROM interface.  [Wilbert Pol]
1514
1615
1716
r1037r1038
2928
3029Source Changes:
3130----------------
31- The core is based on MAME 0.119u1.  This incorporates all features of the
32  update to this core.  [MAME team]
33
3234- Fixed multisession crash with the new menu selector.  (bug #1328) [Nate
3335  Woods]
3436
makefile
r1037r1038
322322   -Wundef \
323323   -Wformat-security \
324324   -Wwrite-strings \
325   -Wno-unused-function \
326325
327326# add profiling information for the compiler
328327ifdef PROFILE

Previous 15994 Revisions Next


© 1998-2018 The MESS Team