Previous 15994 Revisions Next

r4500 Thursday 16th April, 2009 at 11:20:52 UTC by Nathan Woods
Updated to MAME 0.130u4 core; disabling nes
[docs]messnew.txt
[src/emu]audit.c crsshair.c inptport.c uimenu.c
[src/emu/cpu/mips]psx.c
[src/emu/cpu/tms32031]tms32031.c
[src/emu/debug]debugvw.c
[src/ldplayer]ldplayer.c
[src/mame]mame.mak mamedriv.c
[src/mame/drivers]alpha68k.c asuka.c atarigt.c cham24.c cps2.c dec0.c dec8.c fcombat.c freekick.c goldstar.c harddriv.c jackal.c jalmah.c jangou.c metro.c multigam.c munchmo.c mystwarr.c namcos12.c naomi.c naughtyb.c nightgal.c ninjakd2.c ninjaw.c playch10.c rohga.c roul.c* seta.c seta2.c slapshot.c ssrj.c surpratk.c system1.c system16.c system18.c taito_b.c taito_f2.c taito_f3.c taito_h.c taito_l.c taito_x.c taito_z.c taitoair.c tmaster.c topspeed.c vsnes.c warriorb.c wgp.c
[src/mame/includes]playch10.h taito_f2.h vsnes.h
[src/mame/machine]cps2crpt.c dc.c dec0.c playch10.c vsnes.c
[src/mame/video]dc.c munchmo.c ninjakd2.c playch10.c ppu2c0x.c ppu2c0x.h ssrj.c system1.c taito_f2.c taitoic.c taitoic.h vsnes.c
[src/mess]mess.mak messdriv.c
[src/mess/includes]nes.h
[src/mess/machine]nes.c nes_mmc.c

src/mame/machine/playch10.c
r4499r4500
2929MACHINE_RESET( pc10 )
3030{
3131   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
32   const device_config *ppu = devtag_get_device(machine, "ppu");
33
3234   /* initialize latches and flip-flops */
3335   pc10_nmi_enable = pc10_dog_di = pc10_dispmask = pc10_sdcs = pc10_int_detect = 0;
3436
r4499r4500
4951   RP5H01_0_reset_w( space, 0, 1 );
5052   RP5H01_enable_w( 0, 1 );
5153
52   /* reset the ppu */
53   ppu2c0x_reset( machine, 0, /* video_screen_get_scan_period(machine->primary_screen) * */ 1 );
54
55   ppu2c0x_set_mirroring( 0, mirroring );
54   ppu2c0x_set_mirroring( ppu, mirroring );
5655}
5756
5857/*************************************
r4499r4500
115114WRITE8_HANDLER( pc10_PPURES_w )
116115{
117116   if ( data & 1 )
118      ppu2c0x_reset( space->machine, 0, /* video_screen_get_scan_period(space->machine->primary_screen) * */ 1 );
117      devtag_reset(space->machine, "ppu");
119118}
120119
121120READ8_HANDLER( pc10_detectclr_r )
r4499r4500
220219   /* do the gun thing */
221220   if ( pc10_gun_controller )
222221   {
222      const device_config *ppu = devtag_get_device(space->machine, "ppu");
223223      int trigger = input_port_read(space->machine, "P1");
224224      int x = input_port_read(space->machine, "GUNX");
225225      int y = input_port_read(space->machine, "GUNY");
r4499r4500
229229      ret |= 0x08;
230230
231231      /* get the pixel at the gun position */
232      pix = ppu2c0x_get_pixel( 0, x, y );
232      pix = ppu2c0x_get_pixel( ppu, x, y );
233233
234234      /* get the color base from the ppu */
235      color_base = ppu2c0x_get_colorbase( 0 );
235      color_base = ppu2c0x_get_colorbase( ppu );
236236
237237      /* look at the screen and see if the cursor is over a bright pixel */
238238      if ( ( pix == color_base+0x20 ) || ( pix == color_base+0x30 ) ||
r4499r4500
348348   /* are we done shifting? */
349349   if ( mmc1_shiftcount == 5 )
350350   {
351      const device_config *ppu = devtag_get_device(space->machine, "ppu");
352
351353      /* reset count */
352354      mmc1_shiftcount = 0;
353355
r4499r4500
383385               }
384386
385387               /* apply mirroring */
386               ppu2c0x_set_mirroring( 0, _mirroring );
388               ppu2c0x_set_mirroring( ppu, _mirroring );
387389            }
388390         break;
389391
390392         case 1:   /* video rom banking - bank 0 - 4k or 8k */
391            ppu2c0x_set_videorom_bank( 0, 0, ( vrom4k ) ? 4 : 8, ( mmc1_shiftreg & 0x1f ), 256 );
393            ppu2c0x_set_videorom_bank( ppu, 0, ( vrom4k ) ? 4 : 8, ( mmc1_shiftreg & 0x1f ), 256 );
392394         break;
393395
394396         case 2: /* video rom banking - bank 1 - 4k only */
395397            if ( vrom4k )
396               ppu2c0x_set_videorom_bank( 0, 4, 4, ( mmc1_shiftreg & 0x1f ), 256 );
398               ppu2c0x_set_videorom_bank( ppu, 4, 4, ( mmc1_shiftreg & 0x1f ), 256 );
397399         break;
398400
399401         case 3:   /* program banking */
r4499r4500
432434
433435static WRITE8_HANDLER( aboard_vrom_switch_w )
434436{
435   ppu2c0x_set_videorom_bank( 0, 0, 8, ( data & 3 ), 512 );
437   const device_config *ppu = devtag_get_device(space->machine, "ppu");
438   ppu2c0x_set_videorom_bank( ppu, 0, 8, ( data & 3 ), 512 );
436439}
437440
438441DRIVER_INIT( pcaboard )
r4499r4500
483486
484487static WRITE8_HANDLER( cboard_vrom_switch_w )
485488{
486   ppu2c0x_set_videorom_bank( 0, 0, 8, ( ( data >> 1 ) & 1 ), 512 );
489   const device_config *ppu = devtag_get_device(space->machine, "ppu");
490   ppu2c0x_set_videorom_bank( ppu, 0, 8, ( ( data >> 1 ) & 1 ), 512 );
487491}
488492
489493DRIVER_INIT( pccboard )
r4499r4500
533537/* E Board games (Mike Tyson's Punchout) - BROKEN - FIX ME */
534538
535539/* callback for the ppu_latch */
536static void mapper9_latch( offs_t offset )
540static void mapper9_latch( const device_config *ppu, offs_t offset )
537541{
542
538543   if( (offset & 0x1ff0) == 0x0fd0 && MMC2_bank_latch[0] != 0xfd )
539544   {
540545      MMC2_bank_latch[0] = 0xfd;
541      ppu2c0x_set_videorom_bank( 0, 0, 4, MMC2_bank[0], 256 );
546      ppu2c0x_set_videorom_bank( ppu, 0, 4, MMC2_bank[0], 256 );
542547   }
543548   else if( (offset & 0x1ff0) == 0x0fe0 && MMC2_bank_latch[0] != 0xfe )
544549   {
545550      MMC2_bank_latch[0] = 0xfe;
546      ppu2c0x_set_videorom_bank( 0, 0, 4, MMC2_bank[1], 256 );
551      ppu2c0x_set_videorom_bank( ppu, 0, 4, MMC2_bank[1], 256 );
547552   }
548553   else if( (offset & 0x1ff0) == 0x1fd0 && MMC2_bank_latch[1] != 0xfd )
549554   {
550555      MMC2_bank_latch[1] = 0xfd;
551      ppu2c0x_set_videorom_bank( 0, 4, 4, MMC2_bank[2], 256 );
556      ppu2c0x_set_videorom_bank( ppu, 4, 4, MMC2_bank[2], 256 );
552557   }
553558   else if( (offset & 0x1ff0) == 0x1fe0 && MMC2_bank_latch[1] != 0xfe )
554559   {
555560      MMC2_bank_latch[1] = 0xfe;
556      ppu2c0x_set_videorom_bank( 0, 4, 4, MMC2_bank[3], 256 );
561      ppu2c0x_set_videorom_bank( ppu, 4, 4, MMC2_bank[3], 256 );
557562   }
558563}
559564
560565static WRITE8_HANDLER( eboard_rom_switch_w )
561566{
567   const device_config *ppu = devtag_get_device(space->machine, "ppu");
568
562569   /* a variation of mapper 9 on a nes */
563570   switch( offset & 0x7000 )
564571   {
r4499r4500
573580      case 0x3000: /* gfx bank 0 - 4k */
574581         MMC2_bank[0] = data;
575582         if( MMC2_bank_latch[0] == 0xfd )
576            ppu2c0x_set_videorom_bank( 0, 0, 4, data, 256 );
583            ppu2c0x_set_videorom_bank( ppu, 0, 4, data, 256 );
577584      break;
578585
579586      case 0x4000: /* gfx bank 0 - 4k */
580587         MMC2_bank[1] = data;
581588         if( MMC2_bank_latch[0] == 0xfe )
582            ppu2c0x_set_videorom_bank( 0, 0, 4, data, 256 );
589            ppu2c0x_set_videorom_bank( ppu, 0, 4, data, 256 );
583590      break;
584591
585592      case 0x5000: /* gfx bank 1 - 4k */
586593         MMC2_bank[2] = data;
587594         if( MMC2_bank_latch[1] == 0xfd )
588            ppu2c0x_set_videorom_bank( 0, 4, 4, data, 256 );
595            ppu2c0x_set_videorom_bank( ppu, 4, 4, data, 256 );
589596      break;
590597
591598      case 0x6000: /* gfx bank 1 - 4k */
592599         MMC2_bank[3] = data;
593600         if( MMC2_bank_latch[1] == 0xfe )
594            ppu2c0x_set_videorom_bank( 0, 4, 4, data, 256 );
601            ppu2c0x_set_videorom_bank( ppu, 4, 4, data, 256 );
595602      break;
596603
597604      case 0x7000: /* mirroring */
598         ppu2c0x_set_mirroring( 0, data ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
605         ppu2c0x_set_mirroring( ppu, data ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
599606
600607      break;
601608   }
r4499r4500
667674static int gboard_last_bank;
668675static int gboard_command;
669676
670static void gboard_scanline_cb( running_machine *machine, int num, int scanline, int vblank, int blanked )
677static void gboard_scanline_cb( const device_config *device, int scanline, int vblank, int blanked )
671678{
672679   if ( !vblank && !blanked )
673680   {
674681      if ( --gboard_scanline_counter == -1 )
675682      {
676683         gboard_scanline_counter = gboard_scanline_latch;
677         generic_pulse_irq_line(machine->cpu[1], 0);
684         generic_pulse_irq_line(device->machine->cpu[1], 0);
678685      }
679686   }
680687}
681688
682689static WRITE8_HANDLER( gboard_rom_switch_w )
683690{
691   const device_config *ppu = devtag_get_device(space->machine, "ppu");
692
684693   /* basically, a MMC3 mapper from the nes */
685694
686695   switch( offset & 0x7001 )
r4499r4500
731740               case 1: /* char banking */
732741                  data &= 0xfe;
733742                  page ^= ( cmd << 1 );
734                  ppu2c0x_set_videorom_bank( 0, page, 2, data, 64 );
743                  ppu2c0x_set_videorom_bank( ppu, page, 2, data, 64 );
735744               break;
736745
737746               case 2: /* char banking */
r4499r4500
739748               case 4: /* char banking */
740749               case 5: /* char banking */
741750                  page ^= cmd + 2;
742                  ppu2c0x_set_videorom_bank( 0, page, 1, data, 64 );
751                  ppu2c0x_set_videorom_bank( ppu, page, 1, data, 64 );
743752               break;
744753
745754               case 6: /* program banking */
r4499r4500
784793         if( !gboard_4screen )
785794         {
786795            if ( data & 0x40 )
787               ppu2c0x_set_mirroring( 0, PPU_MIRROR_HIGH );
796               ppu2c0x_set_mirroring( ppu, PPU_MIRROR_HIGH );
788797            else
789               ppu2c0x_set_mirroring( 0, ( data & 1 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
798               ppu2c0x_set_mirroring( ppu, ( data & 1 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
790799         }
791800      break;
792801
r4499r4500
803812      break;
804813
805814      case 0x6000: /* disable irqs */
806         ppu2c0x_set_scanline_callback( 0, 0 );
815         ppu2c0x_set_scanline_callback( ppu, 0 );
807816      break;
808817
809818      case 0x6001: /* enable irqs */
810         ppu2c0x_set_scanline_callback( 0, gboard_scanline_cb );
819         ppu2c0x_set_scanline_callback( ppu, gboard_scanline_cb );
811820      break;
812821   }
813822}
r4499r4500
854863static WRITE8_HANDLER( iboard_rom_switch_w )
855864{
856865   int bank = data & 7;
866   const device_config *ppu = devtag_get_device(space->machine, "ppu");
857867   UINT8 *prg = memory_region( space->machine, "cart" );
858868
859869   if ( data & 0x10 )
860      ppu2c0x_set_mirroring( 0, PPU_MIRROR_HIGH );
870      ppu2c0x_set_mirroring( ppu, PPU_MIRROR_HIGH );
861871   else
862      ppu2c0x_set_mirroring( 0, PPU_MIRROR_LOW );
872      ppu2c0x_set_mirroring( ppu, PPU_MIRROR_LOW );
863873
864874   memcpy( &prg[0x08000], &prg[bank * 0x8000 + 0x10000], 0x8000 );
865875}
r4499r4500
885895
886896static WRITE8_HANDLER( hboard_rom_switch_w )
887897{
898   const device_config *ppu = devtag_get_device(space->machine, "ppu");
899
888900   switch( offset & 0x7001 )
889901   {
890902      case 0x0001:
r4499r4500
900912                  page ^= ( cmd << 1 );
901913                  if ( data & 0x20 )
902914                  {
903                     ppu2c0x_set_videoram_bank( 0, page, 2, data, 64 );
915                     ppu2c0x_set_videoram_bank( ppu, page, 2, data, 64 );
904916                  }
905917                  else
906918                  {
907                     ppu2c0x_set_videorom_bank( 0, page, 2, data, 64 );
919                     ppu2c0x_set_videorom_bank( ppu, page, 2, data, 64 );
908920                  }
909921               return;
910922
r4499r4500
915927                  page ^= cmd + 2;
916928                  if ( data & 0x40 )
917929                  {
918                     ppu2c0x_set_videoram_bank( 0, page, 1, data, 64 );
930                     ppu2c0x_set_videoram_bank( ppu, page, 1, data, 64 );
919931                  }
920932                  else
921933                  {
922                     ppu2c0x_set_videorom_bank( 0, page, 1, data, 64 );
934                     ppu2c0x_set_videorom_bank( ppu, page, 1, data, 64 );
923935                  }
924936               return;
925937            }
src/mame/machine/dc.c
r4499r4500
1919#define DEBUG_MAPLE   (0)
2020#define DEBUG_MAPLE_REGS   (0)
2121
22#define ENABLE_MAPLE_IRQ (0)
23
2224#if DEBUG_SYSCTRL
2325static const char *const sysctrl_names[] =
2426{
r4499r4500
374376   {
375377   case SB_MDST:
376378      maple_regs[reg] = old;
377      if (!(old & 1) && (dat & 1)) // 0 -> 1
379      if (!(old & 1) && (dat & 1) && maple_regs[SB_MDEN] & 1) // 0 -> 1
378380      {
379381         if (!(maple_regs[SB_MDTSEL] & 1))
380382         {
381383            maple_regs[reg] = 1;
382384            dat=maple_regs[SB_MDSTAR];
385            //printf("Maple DMA: %08x %08x %08x %08x\n",maple_regs[SB_MDSTAR],maple_regs[SB_MDTSEL],maple_regs[SB_MDEN],maple_regs[SB_MDST]);
386            //printf("           %08x %08x %08x %08x\n",maple_regs[SB_MSYS],maple_regs[SB_MST],maple_regs[SB_MSHTCL],maple_regs[SB_MMSEL]);
383387            while (1) // do transfers
384388            {
385389               ddtdata.source=dat;      // source address
r4499r4500
413417                     case 3:
414418                        ddtdata.length=1;
415419                        #if DEBUG_MAPLE
416                        mame_printf_verbose("MAPLE: transfer command %d port %d\n", command, port);
420                        printf("MAPLE: transfer command %x port %x\n", command, port);
417421                        #endif
418422                        break;
419423                     case 0x80: // get data and compute checksum
r4499r4500
453457
454458                        subcommand = buff[0] & 0xff;
455459                        #if DEBUG_MAPLE
456                        mame_printf_verbose("MAPLE: transfer command %d port %d subcommand %d\n", command, port, subcommand);
460                        printf("MAPLE: transfer command %x port %x subcommand %x\n", command, port, subcommand);
457461                        #endif
458462                        if (subcommand == 3) // read data
459463                        {
r4499r4500
485489                           jvs_address = (buff[1] >> 16) & 0xff; // slave address
486490                           jvs_command = buff[2] & 0xff; // jvs command
487491                           #if DEBUG_MAPLE
488                           mame_printf_verbose("MAPLE: sent jvs command %d\n", jvs_command);
492                           printf("MAPLE: sent jvs command %x\n", jvs_command);
489493                           #endif
490494                           buff[1] = 0xe4e3e2e1;
491495                           ddtdata.length = 2;
r4499r4500
703707                        break;
704708                     default:
705709                        #if DEBUG_MAPLE
706                        mame_printf_verbose("MAPLE: unknown transfer command %d port %d\n", command, port);
710                        printf("MAPLE: unknown transfer command %x port %x\n", command, port);
707711                        #endif
708712                        ddtdata.length=1;
709713                        buff[0]=0xffffffff;
r4499r4500
717721
718722               if (endflag)
719723               {
724                  #if ENABLE_MAPLE_IRQ
725                  /*TODO: this fixes moeru but breaks other games, understand why.*/
726                  dc_sysctrl_regs[SB_ISTNRM] |= IST_DMA_MAPLE;
727                  dc_update_interrupt_status(space->machine);
728                  #endif
720729                  break;
721730               }
722731               // skip fixed packet header
r4499r4500
729738         else
730739         {
731740            #if DEBUG_MAPLE
732            mame_printf_verbose("MAPLE: hardware trigger not supported yet\n");
741            printf("MAPLE: hardware trigger not supported yet\n");
733742            #endif
734743         }
735744      }
r4499r4500
833842         device_set_info_ptr(space->machine->cpu[0], CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA, &ddtdata);
834843         g1bus_regs[SB_GDST]=0;
835844         dc_sysctrl_regs[SB_ISTNRM] |= IST_DMA_GDROM;
845         dc_update_interrupt_status(space->machine);
836846      }
837847      break;
838848   }
r4499r4500
904914            /* 0 rounding size = 32 Mbytes */
905915            if(wave_dma.size == 0) { wave_dma.size = 0x200000; }
906916
907            /* TODO: use the ddt function. */
908917            if(wave_dma.dir == 0)
909918            {
910919               for(;size<wave_dma.size;size+=4)
r4499r4500
930939            wave_dma.flag = (wave_dma.indirect & 1) ? 1 : 0;
931940            wave_dma.start = g2bus_regs[SB_ADST] = 0;
932941            dc_sysctrl_regs[SB_ISTNRM] |= IST_DMA_AICA;
942            dc_update_interrupt_status(space->machine);
933943         }
934944         break;
935945   }
src/mame/machine/vsnes.c
r4499r4500
8787
8888
8989/* remap callback */
90static int remap_colors( running_machine *machine, int num, int addr, int data )
90static int remap_colors( const device_config *device, int addr, int data )
9191{
9292   /* this is the protection. color codes are shuffled around */
9393   /* the ones with value 0xff are unknown */
r4499r4500
221221
222222MACHINE_RESET( vsnes )
223223{
224   const device_config *ppu = devtag_get_device(machine, "ppu1");
225
224226   last_bank = 0xff;
225227   sound_fix = 0;
226228   input_latch[0] = input_latch[1] = 0;
227229   input_latch[2] = input_latch[3] = 0;
228230
229   /* reset the ppu */
230   ppu2c0x_reset( machine, 0, 1 );
231
232231   /* if we need to remap, install the callback */
233232   if ( remapped_colortable )
234      ppu2c0x_set_vidaccess_callback( 0, remap_colors );
233      ppu2c0x_set_vidaccess_callback( ppu, remap_colors );
235234}
236235
237236/*************************************
r4499r4500
241240 *************************************/
242241MACHINE_RESET( vsdual )
243242{
243   const device_config *ppu1 = devtag_get_device(machine, "ppu1");
244   const device_config *ppu2 = devtag_get_device(machine, "ppu2");
245
244246   input_latch[0] = input_latch[1] = 0;
245247   input_latch[2] = input_latch[3] = 0;
246248
247   /* reset the ppu */
248   ppu2c0x_reset( machine,0,1 );
249   ppu2c0x_reset( machine,1,1 );
250
251249   /* if we need to remap, install the callback */
252250   if ( remapped_colortable )
253251   {
254      ppu2c0x_set_vidaccess_callback( 0, remap_colors );
255      ppu2c0x_set_vidaccess_callback( 1, remap_colors );
252      ppu2c0x_set_vidaccess_callback( ppu1, remap_colors );
253      ppu2c0x_set_vidaccess_callback( ppu2, remap_colors );
256254   }
257255}
258256
r4499r4500
278276
279277static WRITE8_HANDLER( vsnormal_vrom_banking )
280278{
279   const device_config *ppu1 = devtag_get_device(space->machine, "ppu1");
280
281281   /* switch vrom */
282   ppu2c0x_set_videorom_bank( 0, 0, 8, ( data & 4 ) ? 1 : 0, 512 );
282   ppu2c0x_set_videorom_bank( ppu1, 0, 8, ( data & 4 ) ? 1 : 0, 512 );
283283
284284   /* bit 1 ( data & 2 ) enables writes to extra ram, we ignore it */
285285
r4499r4500
297297
298298static WRITE8_HANDLER( ppuRC2C05_protection )
299299{
300   const device_config *ppu1 = devtag_get_device(space->machine, "ppu1");
301
300302   /* This PPU has registers mapped at $2000 and $2001 inverted */
301303   /* and no remapped color */
302304   if ( offset == 0 )
303305   {
304      ppu2c0x_0_w( space, 1, data );
306      ppu2c0x_w( ppu1, 1, data );
305307      return;
306308   }
307309
308   ppu2c0x_0_w( space, 0, data );
310   ppu2c0x_w( ppu1, 0, data );
309311}
310312
311313/**********************************************************************************/
r4499r4500
336338
337339static WRITE8_HANDLER( gun_in0_w )
338340{
341   const device_config *ppu1 = devtag_get_device(space->machine, "ppu1");
339342   static int zapstore;
340343
341344   if (vsnes_do_vrom_bank)
342345   {
343346      /* switch vrom */
344      ppu2c0x_set_videorom_bank( 0, 0, 8, ( data & 4 ) ? 1 : 0, 512 );
347      ppu2c0x_set_videorom_bank( ppu1, 0, 8, ( data & 4 ) ? 1 : 0, 512 );
345348   }
346349
347350   /* here we do things a little different */
r4499r4500
359362         UINT32 pix, color_base;
360363
361364         /* get the pixel at the gun position */
362         pix = ppu2c0x_get_pixel( 0, x, y );
365         pix = ppu2c0x_get_pixel( ppu1, x, y );
363366
364367         /* get the color base from the ppu */
365         color_base = ppu2c0x_get_colorbase( 0 );
368         color_base = ppu2c0x_get_colorbase( ppu1 );
366369
367370         /* look at the screen and see if the cursor is over a bright pixel */
368371         if ( ( pix == color_base+0x20 ) || ( pix == color_base+0x30 ) ||
r4499r4500
403406
404407static WRITE8_HANDLER( goonies_rom_banking )
405408{
409   const device_config *ppu1 = devtag_get_device(space->machine, "ppu1");
406410   int reg = ( offset >> 12 ) & 0x07;
407411   int bankoffset = ( data & 7 ) * 0x2000 + 0x10000;
408412
r4499r4500
418422      break;
419423
420424      case 6: /* vrom bank 0 */
421         ppu2c0x_set_videorom_bank( 0, 0, 4, data, 256 );
425         ppu2c0x_set_videorom_bank( ppu1, 0, 4, data, 256 );
422426      break;
423427
424428      case 7: /* vrom bank 1 */
425         ppu2c0x_set_videorom_bank( 0, 4, 4, data, 256 );
429         ppu2c0x_set_videorom_bank( ppu1, 4, 4, data, 256 );
426430      break;
427431   }
428432}
r4499r4500
498502static READ8_HANDLER( vsgshoe_security_r )
499503{
500504   /* low part must be 0x1c */
501   return ppu2c0x_0_r( space, 2 ) | 0x1c;
505   return ppu2c0x_r( devtag_get_device(space->machine, "ppu"), 2 ) | 0x1c;
502506}
503507
504508static WRITE8_HANDLER( vsgshoe_gun_in0_w )
r4499r4500
545549
546550static WRITE8_HANDLER( drmario_rom_banking )
547551{
552   const device_config *ppu1 = devtag_get_device(space->machine, "ppu1");
553
548554   /* basically, a MMC1 mapper from the nes */
549555   static int size16k, switchlow, vrom4k;
550556
r4499r4500
609615               }
610616
611617               /* apply mirroring */
612               ppu2c0x_set_mirroring( 0, mirroring );
618               ppu2c0x_set_mirroring( ppu1, mirroring );
613619            }
614620         break;
615621
616622         case 1:   /* video rom banking - bank 0 - 4k or 8k */
617            ppu2c0x_set_videorom_bank( 0, 0, ( vrom4k ) ? 4 : 8, drmario_shiftreg, ( vrom4k ) ? 256 : 512 );
623            ppu2c0x_set_videorom_bank( ppu1, 0, ( vrom4k ) ? 4 : 8, drmario_shiftreg, ( vrom4k ) ? 256 : 512 );
618624         break;
619625
620626         case 2: /* video rom banking - bank 1 - 4k only */
621627            if ( vrom4k )
622               ppu2c0x_set_videorom_bank( 0, 4, 4, drmario_shiftreg, 256 );
628               ppu2c0x_set_videorom_bank( ppu1, 4, 4, drmario_shiftreg, 256 );
623629         break;
624630
625631         case 3:   /* program banking */
r4499r4500
778784static READ8_HANDLER( topgun_security_r )
779785{
780786   /* low part must be 0x1b */
781   return ppu2c0x_0_r( space, 2 ) | 0x1b;
787   return ppu2c0x_r( devtag_get_device(space->machine, "ppu"), 2 ) | 0x1b;
782788}
783789
784790DRIVER_INIT( topgun )
r4499r4500
826832
827833static void mapper4_set_chr (const address_space *space)
828834{
835   const device_config *ppu1 = devtag_get_device(space->machine, "ppu1");
829836   UINT8 chr_page = (MMC3_cmd & 0x80) >> 5;
830   ppu2c0x_set_videorom_bank(0, chr_page ^ 0, 2, MMC3_chr[0], 1);
831   ppu2c0x_set_videorom_bank(0, chr_page ^ 2, 2, MMC3_chr[1], 1);
832   ppu2c0x_set_videorom_bank(0, chr_page ^ 4, 1, MMC3_chr[2], 1);
833   ppu2c0x_set_videorom_bank(0, chr_page ^ 5, 1, MMC3_chr[3], 1);
834   ppu2c0x_set_videorom_bank(0, chr_page ^ 6, 1, MMC3_chr[4], 1);
835   ppu2c0x_set_videorom_bank(0, chr_page ^ 7, 1, MMC3_chr[5], 1);
837   ppu2c0x_set_videorom_bank(ppu1, chr_page ^ 0, 2, MMC3_chr[0], 1);
838   ppu2c0x_set_videorom_bank(ppu1, chr_page ^ 2, 2, MMC3_chr[1], 1);
839   ppu2c0x_set_videorom_bank(ppu1, chr_page ^ 4, 1, MMC3_chr[2], 1);
840   ppu2c0x_set_videorom_bank(ppu1, chr_page ^ 5, 1, MMC3_chr[3], 1);
841   ppu2c0x_set_videorom_bank(ppu1, chr_page ^ 6, 1, MMC3_chr[4], 1);
842   ppu2c0x_set_videorom_bank(ppu1, chr_page ^ 7, 1, MMC3_chr[5], 1);
836843}
837844
838845#define BOTTOM_VISIBLE_SCANLINE   239      /* The bottommost visible scanline */
839846#define NUM_SCANLINE 262
840847
841static void mapper4_irq ( running_machine *machine, int num, int scanline, int vblank, int blanked )
848static void mapper4_irq ( const device_config *device, int scanline, int vblank, int blanked )
842849{
843850   mame_printf_debug("entra\n");
844851   if ((scanline < BOTTOM_VISIBLE_SCANLINE) || (scanline == NUM_SCANLINE-1))
r4499r4500
848855         if (IRQ_count == 0)
849856         {
850857            IRQ_count = IRQ_count_latch;
851            cpu_set_input_line (machine->cpu[0], 0, HOLD_LINE);
858            cpu_set_input_line (device->machine->cpu[0], 0, HOLD_LINE);
852859         }
853860         IRQ_count --;
854861      }
r4499r4500
857864
858865static WRITE8_HANDLER( mapper4_w )
859866{
867   const device_config *ppu1 = devtag_get_device(space->machine, "ppu1");
868
860869   switch (offset & 0x7001)
861870   {
862871      case 0x0000: /* $8000 */
r4499r4500
905914      }
906915      case 0x2000: /* $a000 */
907916         if (data & 0x40)
908            ppu2c0x_set_mirroring(0, PPU_MIRROR_HIGH);
917            ppu2c0x_set_mirroring(ppu1, PPU_MIRROR_HIGH);
909918         else
910919         {
911920            if (data & 0x01)
912               ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ);
921               ppu2c0x_set_mirroring(ppu1, PPU_MIRROR_HORZ);
913922            else
914               ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT);
923               ppu2c0x_set_mirroring(ppu1, PPU_MIRROR_VERT);
915924         }
916925         break;
917926
r4499r4500
934943         IRQ_enable = 0;
935944         IRQ_count = IRQ_count_latch;
936945
937         ppu2c0x_set_scanline_callback (0, 0);
946         ppu2c0x_set_scanline_callback (ppu1, 0);
938947
939948         break;
940949
941950      case 0x6001: /* $e001 - Enable IRQs */
942951         IRQ_enable = 1;
943         ppu2c0x_set_scanline_callback (0, mapper4_irq);
952         ppu2c0x_set_scanline_callback (ppu1, mapper4_irq);
944953
945954         break;
946955
r4499r4500
11251134/**********************************************************************************/
11261135/* Platoon rom banking */
11271136
1128static WRITE8_HANDLER( mapper68_rom_banking ){
1137static WRITE8_HANDLER( mapper68_rom_banking )
1138{
1139   const device_config *ppu1 = devtag_get_device(space->machine, "ppu1");
11291140
11301141   switch (offset & 0x7000)
11311142   {
11321143      case 0x0000:
1133      ppu2c0x_set_videorom_bank(0,0,2,data,128);
1144      ppu2c0x_set_videorom_bank(ppu1,0,2,data,128);
11341145
11351146      break;
11361147      case 0x1000:
1137      ppu2c0x_set_videorom_bank(0,2,2,data,128);
1148      ppu2c0x_set_videorom_bank(ppu1,2,2,data,128);
11381149
11391150      break;
11401151      case 0x2000:
1141      ppu2c0x_set_videorom_bank(0,4,2,data,128);
1152      ppu2c0x_set_videorom_bank(ppu1,4,2,data,128);
11421153
11431154      break;
11441155      case 0x3000: /* ok? */
1145      ppu2c0x_set_videorom_bank(0,6,2,data,128);
1156      ppu2c0x_set_videorom_bank(ppu1,6,2,data,128);
11461157
11471158      break;
11481159
r4499r4500
12171228static READ8_HANDLER( jajamaru_security_r )
12181229{
12191230   /* low part must be 0x40 */
1220   return ppu2c0x_0_r( space, 2 ) | 0x40;
1231   return ppu2c0x_r( devtag_get_device(space->machine, "ppu"), 2 ) | 0x40;
12211232}
12221233
12231234DRIVER_INIT( jajamaru )
r4499r4500
12441255static READ8_HANDLER( mightybj_security_r )
12451256{
12461257   /* low part must be 0x3d */
1247   return ppu2c0x_0_r( space, 2 ) | 0x3d;
1258   return ppu2c0x_r( devtag_get_device(space->machine, "ppu"), 2 ) | 0x3d;
12481259}
12491260
12501261DRIVER_INIT( mightybj )
r4499r4500
12631274static WRITE8_HANDLER( vstennis_vrom_banking )
12641275{
12651276   const device_config *other_cpu = (space->cpu == space->machine->cpu[0]) ? space->machine->cpu[1] : space->machine->cpu[0];
1277   const device_config *ppu1 = devtag_get_device(space->machine, "ppu1");
1278   const device_config *ppu2 = devtag_get_device(space->machine, "ppu2");
12661279
12671280   /* switch vrom */
1268   ppu2c0x_set_videorom_bank( (space->cpu == space->machine->cpu[0]) ? 0 : 1, 0, 8, ( data & 4 ) ? 1 : 0, 512 );
1281   ppu2c0x_set_videorom_bank( (space->cpu == space->machine->cpu[0]) ? ppu1 : ppu2, 0, 8, ( data & 4 ) ? 1 : 0, 512 );
12691282
12701283   /* bit 1 ( data & 2 ) triggers irq on the other cpu */
12711284   cpu_set_input_line(other_cpu, 0, ( data & 2 ) ? CLEAR_LINE : ASSERT_LINE );
src/mame/machine/dec0.c
r4499r4500
4343   switch (offset<<1)
4444   {
4545      case 0: /* Player 1 rotary */
46         return ~(1 << (input_port_read(space->machine, "AN0") * 12 / 256));
46         return ~(1 << input_port_read(space->machine, "AN0"));
4747
4848      case 8: /* Player 2 rotary */
49         return ~(1 << (input_port_read(space->machine, "AN1") * 12 / 256));
49         return ~(1 << input_port_read(space->machine, "AN1"));
5050
5151      default:
5252         logerror("Unknown rotary read at 300000 %02x\n", offset);
r4499r4500
6868         return input_port_read(space->machine, "DSW");
6969
7070      case 4: /* Player 1 rotary */
71         return ~(1 << (input_port_read(space->machine, "AN0") * 12 / 256));
71         return ~(1 << input_port_read(space->machine, "AN0"));
7272
7373      case 6: /* Player 2 rotary */
74         return ~(1 << (input_port_read(space->machine, "AN1") * 12 / 256));
74         return ~(1 << input_port_read(space->machine, "AN1"));
7575
7676      case 8: /* Credits, start buttons */
7777         return input_port_read(space->machine, "SYSTEM");
src/mame/machine/cps2crpt.c
r4499r4500
823823   { "nwarru",   { 0x104a7d0c,0x3f1b7a1e }, 0x180000 },   // 0838 0000 6160  btst    #0,$6160
824824   { "nwarrh",   { 0xc4961b01,0x2a946020 }, 0x180000 },   // 0838 0000 6160  btst    #0,$6160
825825   { "nwarrb",   { 0x17c67109,0xb7362a20 }, 0x180000 },   // 0838 0000 6160  btst    #0,$6160
826   { "nwarra",   { 0x4e940d0c,0x39b861a4 }, 0x180000 },   // 0838 0000 6160  btst    #0,$6160
826827   { "vhuntj",   { 0x1135b2c3,0xa4e9d7f2 }, 0x180000 },   // 0838 0000 6160  btst    #0,$6160
827828   { "vhuntjr1", { 0x1135b2c3,0xa4e9d7f2 }, 0x180000 },   // 0838 0000 6160  btst    #0,$6160
828829   { "vhuntjr2", { 0x1135b2c3,0xa4e9d7f2 }, 0x180000 },   // 0838 0000 6160  btst    #0,$6160
r4499r4500
945946   { "mmatrix",  { 0xac9ebd79,0x410467df }, 0x180000 },   // B6C0 B447 BACF  cmpa.w  D0,A3   cmp.w   D7,D2   cmpa.w  A7,A5
946947   { "mmatrixj", { 0x4df81e95,0x72ed9823 }, 0x180000 },   // B6C0 B447 BACF  cmpa.w  D0,A3   cmp.w   D7,D2   cmpa.w  A7,A5
947948   { "mpang",    { 0x95f741c6,0xe547a21b }, 0x100000 },   // 0C84 347D 89A3  cmpi.l  #$347D89A3,D4
949   { "mpangr1",  { 0x95f741c6,0xe547a21b }, 0x100000 },   // 0C84 347D 89A3  cmpi.l  #$347D89A3,D4
948950   { "mpangu",   { 0x95f741c6,0xe547a21b }, 0x100000 },   // 0C84 347D 89A3  cmpi.l  #$347D89A3,D4
949951   { "mpangj",   { 0x95f741c6,0xe547a21b }, 0x100000 },   // 0C84 347D 89A3  cmpi.l  #$347D89A3,D4
950952   { "pzloop2",  { 0xa054f812,0xc40d36b4 }, 0x400000 },   // 0C82 9A73 15F1  cmpi.l  #$9A7315F1,D2
src/mame/mamedriv.c
r4499r4500
590590   DRIVER( trvmstr )   /* (c) 1985 Enerdyne Technologies Inc. */
591591   DRIVER( trvmstra )   /* (c) 1985 Enerdyne Technologies Inc. */
592592   DRIVER( trvmstrb )   /* (c) 1985 Enerdyne Technologies Inc. */
593   DRIVER( trvgns )   /* (c) 198? Enerdyne Technologies Inc. */
593   DRIVER( trvmstrc )   /* (c) 1985 Enerdyne Technologies Inc. */
594   DRIVER( trvgns )   /* bootleg */
594595
595596
596597
r4499r4500
17791780
17801781   /* Taito "X"-system games */
17811782   DRIVER( superman )   /* B61 (c) 1988 Taito Corporation */
1782   DRIVER( suprmanj )   /* B61 (c) 1988 Taito Corporation */
1783   DRIVER( supermanj )   /* B61 (c) 1988 Taito Corporation */
17831784   DRIVER( twinhawk )   /* B87 (c) 1989 Taito Corporation Japan (World) */
1784   DRIVER( twinhwku )   /* B87 (c) 1989 Taito America Corporation (US) */
1785   DRIVER( twinhawku )   /* B87 (c) 1989 Taito America Corporation (US) */
17851786   DRIVER( daisenpu )   /* B87 (c) 1989 Taito Corporation (Japan) */
17861787   DRIVER( gigandes )   /* (c) 1989 East Technology */
1787   DRIVER( gigandsj )   /* (c) 1989 East Technology */
1788   DRIVER( gigandesj )   /* (c) 1989 East Technology */
17881789   DRIVER( kyustrkr )   /* (c) 1989 East Technology */
17891790   DRIVER( ballbros )   /* no copyright notice */
17901791
r4499r4500
18201821   /* Taito L-System games */
18211822   DRIVER( raimais )   /* B36 (c) 1988 Taito Corporation (Japan) */
18221823   DRIVER( raimaisj )   /* B36 (c) 1988 Taito Corporation */
1823   DRIVER( raimaijo )   /* B36 (c) 1988 Taito Corporation */
1824   DRIVER( raimaisjo )   /* B36 (c) 1988 Taito Corporation */
18241825   DRIVER( kurikint )   /* B42 (c) 1988 Taito Corporation Japan (World) */
1825   DRIVER( kurikinu )   /* B42 (c) 1988 Taito America Corporation (US) */
1826   DRIVER( kurikinj )   /* B42 (c) 1988 Taito Corporation (Japan) */
1827   DRIVER( kurikina )   /* B42 (c) 1988 Taito Corporation Japan (World) */
1826   DRIVER( kurikintu )   /* B42 (c) 1988 Taito America Corporation (US) */
1827   DRIVER( kurikintj )   /* B42 (c) 1988 Taito Corporation (Japan) */
1828   DRIVER( kurikinta )   /* B42 (c) 1988 Taito Corporation Japan (World) */
18281829   DRIVER( evilston )   /* C67 (c) 1990 Spacy Industrial, Ltd */
18291830   DRIVER( fhawk )      /* B70 (c) 1988 Taito Corporation Japan (World) */
18301831   DRIVER( fhawkj )   /* B70 (c) 1988 Taito Corporation (Japan) */
18311832   DRIVER( plotting )   /* B96 (c) 1989 Taito Corporation Japan (World) */
1832   DRIVER( plottinu )   /* B96 (c) 1989 Taito Corporation Japan (US) */
1833   DRIVER( plottina )   /* B96 (c) 1989 Taito Corporation Japan (World) */
1834   DRIVER( plottinb )   /* B96 (c) 1989 Taito Corporation Japan (World) */
1833   DRIVER( plottingu )   /* B96 (c) 1989 Taito Corporation Japan (US) */
1834   DRIVER( plottinga )   /* B96 (c) 1989 Taito Corporation Japan (World) */
1835   DRIVER( plottingb )   /* B96 (c) 1989 Taito Corporation Japan (World) */
18351836   DRIVER( flipull )   /* B96 (c) 1989 Taito Corporation Japan (World) */
18361837   DRIVER( champwr )   /* C01 (c) 1989 Taito Corporation Japan (World) */
18371838   DRIVER( champwru )   /* C01 (c) 1989 Taito America Corporation (US) */
r4499r4500
18681869   DRIVER( tetrist )   /* C12 (c) 1989 Sega Enterprises,Ltd. (Japan) */
18691870   DRIVER( tetrista )   /* C35 (c) 1989 Sega Enterprises,Ltd. (Japan) */
18701871   DRIVER( viofight )   /* C16 (c) 1989 Taito Corporation Japan (World) */
1871   DRIVER( viofighu )   /* C16 (c) 1989 Taito America Corporation (US) */
1872   DRIVER( viofighj )   /* C16 (c) 1989 Taito Corporation (Japan) */
1872   DRIVER( viofightu )   /* C16 (c) 1989 Taito America Corporation (US) */
1873   DRIVER( viofightj )   /* C16 (c) 1989 Taito Corporation (Japan) */
18731874   DRIVER( ashura )   /* C43 (c) 1990 Taito Corporation (Japan) */
18741875   DRIVER( ashurau )   /* C43 (c) 1990 Taito America Corporation (US) */
18751876   DRIVER( hitice )   /* C59 (c) 1990 Williams (US) */
r4499r4500
19301931   DRIVER( finalbj )   /* 1989.04 B82 (c) 1988 Taito Corporation (Japan) */
19311932   DRIVER( finalbu )   /* 1989.06 B82 (c) 1988 Taito America Corporation (US) */
19321933   DRIVER( dondokod )   /* 1989.?? B95 (c) 1989 Taito Corporation Japan (World) */
1933   DRIVER( dondokdu )   /* 1989.?? B95 (c) 1989 Taito America Corporation (US) */
1934   DRIVER( dondokdj )   /* 1989.07 B95 (c) 1989 Taito Corporation (Japan) */
1934   DRIVER( dondokodu )   /* 1989.?? B95 (c) 1989 Taito America Corporation (US) */
1935   DRIVER( dondokodj )   /* 1989.07 B95 (c) 1989 Taito Corporation (Japan) */
19351936   DRIVER( megab )      /* 1989.?? C11 (c) 1989 Taito Corporation Japan (World) */
19361937   DRIVER( megabj )   /* 1989.11 C11 (c) 1989 Taito Corporation (Japan) */
19371938   DRIVER( thundfox )   /* 1990.?? C28 (c) 1990 Taito Corporation Japan (World) */
1938   DRIVER( thndfoxu )   /* 1990.06 C28 (c) 1990 Taito America Corporation (US) */
1939   DRIVER( thndfoxj )   /* 1990.07 C28 (c) 1990 Taito Corporation (Japan) */
1939   DRIVER( thundfoxu )   /* 1990.06 C28 (c) 1990 Taito America Corporation (US) */
1940   DRIVER( thundfoxj )   /* 1990.07 C28 (c) 1990 Taito Corporation (Japan) */
19401941   DRIVER( cameltry )   /* 1990.?? C38 (c) 1989 Taito America Corporation (US) */
1941   DRIVER( camltrya )   /* 1990.?? C38 (c) 1989 Taito America Corporation (US) */
1942   DRIVER( camltrua )   /* 1990.?? C38 (c) 1989 Taito America Corporation (US) */
1943   DRIVER( cameltrj )   /* 1990.04 C38 (c) 1989 Taito Corporation (Japan) */
1942   DRIVER( cameltrya )   /* 1990.?? C38 (c) 1989 Taito America Corporation (US) */
1943   DRIVER( cameltryua )/* 1990.?? C38 (c) 1989 Taito America Corporation (US) */
1944   DRIVER( cameltryj )   /* 1990.04 C38 (c) 1989 Taito Corporation (Japan) */
19441945   DRIVER( qtorimon )   /* 1990.02 C41 (c) 1990 Taito Corporation (Japan) */
19451946   DRIVER( liquidk )   /* 1990.?? C49 (c) 1990 Taito Corporation Japan (World) */
19461947   DRIVER( liquidku )   /* 1990.?? C49 (c) 1990 Taito America Corporation (US) */
r4499r4500
19501951   DRIVER( majest12 )   /* 1990.11 C64 (c) 1990 Taito Corporation (Japan) */
19511952                  /* 1990.12 C64 (US) */
19521953   DRIVER( gunfront )   /* 1991.?? C71 (c) 1990 Taito Corporation Japan (World) */
1953   DRIVER( gunfronj )   /* 1991.01 C71 (c) 1990 Taito Corporation (Japan) */
1954   DRIVER( gunfrontj )   /* 1991.01 C71 (c) 1990 Taito Corporation (Japan) */
19541955   DRIVER( growl )      /* 1991.?? C74 (c) 1990 Taito Corporation Japan (World) */
19551956   DRIVER( growlu )   /* 1991.02 C74 (c) 1990 Taito America Corporation (US) */
19561957   DRIVER( runark )   /* 1991.02 C74 (c) 1990 Taito Corporation (Japan) */
19571958   DRIVER( mjnquest )   /* 1991.05 C77 (c) 1990 Taito Corporation (Japan) */
1958   DRIVER( mjnquesb )   /* 1991.05 C77 (c) 1990 Taito Corporation (Japan) */
1959   DRIVER( mjnquestb )   /* 1991.05 C77 (c) 1990 Taito Corporation (Japan) */
19591960   DRIVER( footchmp )   /* 1991.?? C80 (c) 1990 Taito Corporation Japan (World) */
19601961   DRIVER( hthero )   /* 1991.03 C80 (c) 1990 Taito Corporation (Japan) */
19611962   DRIVER( euroch92 )   /* 1991.??     (c) 1992 Taito Corporation Japan (World) */
r4499r4500
19671968   DRIVER( solfigtr )   /* 1991.?? C91 (c) 1991 Taito Corporation Japan (World) */
19681969   DRIVER( qzquest )   /* 1991.07 C92 (c) 1991 Taito Corporation (Japan) */
19691970   DRIVER( pulirula )   /* 1991.?? C98 (c) 1991 Taito Corporation Japan (World) */
1970   DRIVER( pulirulj )   /* 1991.11 C98 (c) 1991 Taito Corporation (Japan) */
1971   DRIVER( pulirulaj )   /* 1991.11 C98 (c) 1991 Taito Corporation (Japan) */
19711972   DRIVER( metalb )   /* 1991.?? D16? (c) 1991 Taito Corporation Japan (World) */
19721973   DRIVER( metalbj )   /* 1991.11 D12 (c) 1991 Taito Corporation (Japan) */
19731974   DRIVER( qzchikyu )   /* 1992.02 D19 (c) 1991 Taito Corporation (Japan) */
19741975   DRIVER( yesnoj )   /* 1992.03 D20 (c) 1992 Taito Corporation (Japan) */
19751976   DRIVER( deadconx )   /* 1992.?? D28 (c) 1992 Taito Corporation Japan (World) */
1976   DRIVER( deadconj )   /* 1992.08 D28 (c) 1992 Taito Corporation (Japan) */
1977   DRIVER( deadconxj )   /* 1992.08 D28 (c) 1992 Taito Corporation (Japan) */
19771978   DRIVER( dinorex )   /* 1992.?? D39 (c) 1992 Taito Corporation Japan (World) */
19781979   DRIVER( dinorexj )   /* 1992.11 D39 (c) 1992 Taito Corporation (Japan) */
19791980   DRIVER( dinorexu )   /* 1992.?? D39 (c) 1992 Taito America Corporation (US) */
r4499r4500
26572658   DRIVER( nwarru )   /* 06/04/1995 (c) 1995 (US) */
26582659   DRIVER( nwarrh )   /* 03/04/1995 (c) 1995 (Hispanic) */
26592660   DRIVER( nwarrb )   /* 03/04/1995 (c) 1995 (Brazil) */
2661   DRIVER( nwarra )   /* 02/03/1995 (c) 1995 (Asia) */
26602662   DRIVER( vhuntj )   /* 02/03/1995 (c) 1995 (Japan) */
26612663   DRIVER( vhuntjr1 )   /* 07/03/1995 (c) 1995 (Japan) */
26622664   DRIVER( vhuntjr2 )   /* 02/03/1995 (c) 1995 (Japan) */
r4499r4500
27932795   DRIVER( 1944 )      /* 20/06/2000 (c) 2000 Eighting/Raizing (US) */
27942796   DRIVER( 1944j )      /* 20/06/2000 (c) 2000 Eighting/Raizing (Japan) */
27952797   DRIVER( mpang )      /* 10/10/2000 (c) 2000 Mitchell (Euro) */
2798   DRIVER( mpangr1 )   /* 25/09/2000 (c) 2000 Mitchell (Euro) */
27962799   DRIVER( mpangu )   /* 10/10/2000 (c) 2000 Mitchell (US) */
27972800   DRIVER( mpangj )   /* 11/10/2000 (c) 2000 Mitchell (Japan) */
27982801   DRIVER( progear )   /* 17/01/2001 (c) 2001 Cave (US) */
r4499r4500
42964299                  /* 1999.12 Puyopuyo DA! */
42974300                  /* 1999.12 Mars TV */
42984301                  /* 2000.01 18 Wheeler */
4299                  /* 2000.01 The Typing of the Dead */
4302   DRIVER( totd )      /* 2000.01 The Typing of the Dead */
43004303   DRIVER( spawn )      /* 2000.01 Spawn */
43014304   DRIVER( doa2m )      /* 2000.01 Dead or Alive 2 Millenium */
43024305                  /* 2000.02 Touch de UNO! 2 */
r4499r4500
45854588      /* cassette system, parent is decocass */
45864589   DRIVER( decocass )
45874590   DRIVER( ctsttape )   /* ? */
4588   DRIVER( cterrani )   /* 04 (c) 1981 */
4589   DRIVER( castfant )   /* 07 (c) 1981 */
4590   DRIVER( csuperas )   /* 09 (c) 1981 */
4591   DRIVER( clocknch )   /* 11 (c) 1981 */
4592   DRIVER( cprogolf )   /* 13 (c) 1981 */
4593   DRIVER( cluckypo )   /* 15 (c) 1981 */
4594   DRIVER( ctisland )   /* 16 (c) 1981 */
4595   DRIVER( ctislnd2 )   /* 16 (c) 1981 */
4596   DRIVER( ctislnd3 )   /* 16? (c) 1981 */
4597   DRIVER( cdiscon1 )   /* 19 (c) 1982 */
4598   DRIVER( csweetht )   /* ?? (c) 1982, clone of disco no 1 */
4599   DRIVER( ctornado )   /* 20 (c) 1982 */
4600   DRIVER( cmissnx )   /* 21 (c) 1982 */
4601   DRIVER( cptennis )   /* 22 (c) 1982 */
4602   DRIVER( cexplore )   /* ?? (c) 1982 */
4603   DRIVER( cbtime )   /* 26 (c) 1982 */
4604   DRIVER( cburnrub )   /* ?? (c) 1982 */
4605   DRIVER( cburnrb2 )   /* ?? (c) 1982 */
4606   DRIVER( cbnj )      /* 27 (c) 1982 */
4607   DRIVER( cgraplop )   /* 28 (c) 1983 */
4608   DRIVER( cgraplp2 )   /* 28? (c) 1983 */
4609   DRIVER( clapapa )   /* 29 (c) 1983 */
4610   DRIVER( clapapa2 )   /* 29 (c) 1983 */ /* this one doesn't display lapapa anyehere */
4611   DRIVER( cnightst )   /* 32 (c) 1983 */
4612   DRIVER( cnights2 )   /* 32 (c) 1983 */
4613   DRIVER( cprosocc )   /* 33 (c) 1983 */
4614   DRIVER( cprobowl )   /* ?? (c) 1983 */
4615   DRIVER( cscrtry )   /* 38 (c) 1984 */
4616   DRIVER( cscrtry2 )   /* 38 (c) 1984 */
4617   DRIVER( cppicf )   /* 39 (c) 1984 */
4618   DRIVER( cppicf2 )   /* 39 (c) 1984 */
4619   DRIVER( cfghtice )   /* 40 (c) 1984 */
4620   DRIVER( cbdash )   /* 44 (c) 1985 */
4621      /* the following don't work at all */
4622   DRIVER( chwy )      /* ?? (c) 198? */
4623   DRIVER( cflyball )   /* ?? (c) 198? */
4624   DRIVER( czeroize )   /* ?? (c) 198? */
4591   DRIVER( chwy )      /* 01 1980.12 Highway Chase */
4592                  /* 02 1980.12 Sengoku Ninjatai */
4593                  /* 03 1981.01 Manhattan */
4594   DRIVER( cterrani )   /* 04 1981.02 Terranian */
4595                  /* 05 1981.?? Missile Sprinter */
4596                  /* 06 1980.12 Nebbler */
4597   DRIVER( castfant )   /* 07 1981.02 Astro Fantasia */
4598                  /* 08 1981.03 The Tower */
4599   DRIVER( csuperas )   /* 09 1981.05 Super Astro Fighter */
4600                  /* 10 1981.?? Ocean to Ocean (medal) */
4601   DRIVER( clocknch )   /* 11 1981.04 Rock'n Chase */
4602                  /* 12 1981.08 Flash Boy/DECO Kid */
4603   DRIVER( cprogolf )   /* 13 1981.08 Pro Golf */
4604                  /* 14 1981.06 DS Telejan */
4605   DRIVER( cluckypo )   /* 15 1981.?? Lucky Poker */
4606   DRIVER( ctisland )   /* 16 1982.02 Treasure Island */
4607   DRIVER( ctislnd2 )   /* 16 */
4608   DRIVER( ctislnd3 )   /* 16 */
4609                  /* 17 1981.10 Bobbit */
4610   DRIVER( cexplore )   /* 18 1982.02 Explorer */
4611   DRIVER( cdiscon1 )   /* 19 1982.04 Disco No.1 */
4612   DRIVER( csweetht )   /* 19 */
4613   DRIVER( ctornado )   /* 20 1982.05 Tornado */
4614   DRIVER( cmissnx )   /* 21 1982.04 Mission X/Zoar */
4615   DRIVER( cptennis )   /* 22 1982.06 Pro Tennis */
4616                  /* 23 1982.?? 18 Hole Pro Golf */
4617                  /* 24 1982.07 Tsumego Kaisyou */
4618                  /* 25 1982.10 Fishing */
4619   DRIVER( cbtime )   /* 26 1982.08 Hamburger/Burger Time */
4620   DRIVER( cburnrub )   /* 27 1982.11 Burnin' Rubber/Bump'n Jump */
4621   DRIVER( cburnrb2 )   /* 27 */
4622   DRIVER( cbnj )      /* 27 */
4623   DRIVER( cgraplop )   /* 28 1982.11 Grapelop */
4624   DRIVER( cgraplp2 )   /* 28 */
4625   DRIVER( clapapa )   /* 29 1982.11 Lapapa/Rootin' Tootin' */
4626   DRIVER( clapapa2 )   /* 29 */ /* this one doesn't display lapapa anyehere */
4627                  /* 30 1983.03 Skater */
4628   DRIVER( cprobowl )   /* 31 1983.03 Pro Bowling */
4629   DRIVER( cnightst )   /* 32 1983.04 Night Star */
4630   DRIVER( cnights2 )   /* 32 */
4631   DRIVER( cprosocc )   /* 33 1982.08 Pro Soccer */
4632                  /* 34 1983.09 Super Doubles Tennis */
4633   DRIVER( cflyball )   /* 35 1983.?? Bampoline/Flying Ball */
4634                  /* 36 1984.04 Genesis/Boomer Rang'r */
4635   DRIVER( czeroize )   /* 37 1983.10 Zeroize */ /* doesn't work at all */
4636   DRIVER( cscrtry )   /* 38 1984.03 Scrum Try */
4637   DRIVER( cscrtry2 )   /* 38 */
4638   DRIVER( cppicf )   /* 39 1984.02 Peter Pepper's Ice Cream Factory */
4639   DRIVER( cppicf2 )   /* 39 */
4640   DRIVER( cfghtice )   /* 40 1984.04 Fighting Ice Hockey */
4641                  /* 41 1984.05 Oozumou */
4642                  /* 42 1984.08 Hellow Gateball */ /* not a typo, this is official spelling */
4643                  /* 43 1984.08 Yellow Cab */
4644   DRIVER( cbdash )   /* 44 1985.08 Boulder Dash */
4645                  /* UX7 1984.12 Tokyo Mie Shinryoujo */
4646                  /* UX8 1985.01 Tokyo Mie Shinryoujo Part 2 */
4647                  /* UX9 1985.05 Geinoujin Shikaku Shiken */
46254648
46264649   /* other Data East games */
46274650   DRIVER( madalien )   /* (c) 1980 */
r4499r4500
48024825   DRIVER( rohga2 )   /* MAM (c) 1991 Data East Corporation (Asia/Euro) */
48034826   DRIVER( rohgah )   /* MAM (c) 1991 Data East Corporation (Hong Kong) */
48044827   DRIVER( rohgau )   /* MAM (c) 1991 Data East Corporation (US) */
4828   DRIVER( wolffang )   /* MAM (c) 1991 Data East Corporation (Japan) */
48054829   DRIVER( schmeisr )   /*     (c) 1993 Hot B */
48064830   DRIVER( captaven )   /* MAN (c) 1991 Data East Corporation (Asia) */
48074831   DRIVER( captavna )   /* MAN (c) 1991 Data East Corporation (Asia) */
r4499r4500
52635287   DRIVER( gaiapolj )   /* GX123 (c) 1993 (Japan) */
52645288   DRIVER( mystwarr )   /* GX128 (c) 1993 (World) */
52655289   DRIVER( mystwaru )   /* GX128 (c) 1993 (US) */
5290   DRIVER( mystwarj )   /* GX128 (c) 1993 (Japan) */
52665291   DRIVER( viostorm )   /* GX168 (c) 1993 (Europe) */
52675292   DRIVER( viostrmu )   /* GX168 (c) 1993 (US) */
52685293   DRIVER( viostmub )   /* GX168 (c) 1993 (US) */
r4499r4500
90179042
90189043   DRIVER( ladylinr )   /* (c) 198? TAB Austria */
90199044   DRIVER( kkojnoli )   /* 198? south korean hack */
9045   DRIVER( wcat3 )
90209046   DRIVER( mtonic )   /* 198? (c) Tonic */
90219047
90229048   DRIVER( sfbonus )   /* (c) 199? Amcoe */
r4499r4500
93929418   /* MPU5 */
93939419   DRIVER( m_honmon )
93949420
9421   DRIVER( roul )
9422
93959423#endif   /* DRIVER_RECURSIVE */
src/mame/includes/vsnes.h
r4499r4500
77VIDEO_UPDATE( vsdual );
88PALETTE_INIT( vsdual );
99
10extern const ppu2c0x_interface vsnes_ppu_interface_1;
11extern const ppu2c0x_interface vsnes_ppu_interface_2;
1012
13
1114/*----------- defined in machine/vsnes.c -----------*/
1215
1316MACHINE_RESET( vsnes );
src/mame/includes/playch10.h
r4499r4500
4646
4747/*----------- defined in video/playch10.c -----------*/
4848
49extern const ppu2c0x_interface playch10_ppu_interface;
50extern const ppu2c0x_interface playch10_ppu_interface_hboard;
51
4952WRITE8_HANDLER( playch10_videoram_w );
5053PALETTE_INIT( playch10 );
5154VIDEO_START( playch10 );
src/mame/includes/taito_f2.h
r4499r4500
2525VIDEO_START( taitof2_qzchikyu );
2626VIDEO_START( taitof2_yesnoj );
2727VIDEO_START( taitof2_deadconx );
28VIDEO_START( taitof2_deadconj );
28VIDEO_START( taitof2_deadconxj );
2929VIDEO_START( taitof2_dinorex );
3030VIDEO_EOF( taitof2_no_buffer );
3131VIDEO_EOF( taitof2_full_buffer_delayed );
src/mame/mame.mak
r4499r4500
16101610   $(DRIVERS)/cb2001.o \
16111611   $(DRIVERS)/sfbonus.o \
16121612   $(DRIVERS)/multfish.o \
1613   $(DRIVERS)/roul.o \
16131614
16141615#-------------------------------------------------
16151616# layout dependencies
src/mame/video/system1.c
r4499r4500
247247 *
248248 *************************************/
249249
250INLINE void videoram_wait_states(const device_config *cpu)
251{
252   /* The main Z80's CPU clock is halted whenever an access to VRAM happens,
253       and is only restarted by the FIXST signal, which occurs once every
254       'n' pixel clocks. 'n' is determined by the horizontal control PAL. */
255
256   /* this assumes 4 5MHz pixel clocks per FIXST, or 8*4 20MHz CPU clocks,
257       and is based on a dump of 315-5137 */
258   const UINT32 cpu_cycles_per_fixst = 4 * 4;
259   const UINT32 fixst_offset = 2 * 4;
260   UINT32 cycles_until_next_fixst = cpu_cycles_per_fixst - ((cpu_get_total_cycles(cpu) - fixst_offset) % cpu_cycles_per_fixst);
261
262   cpu_adjust_icount(cpu, -cycles_until_next_fixst);
263}
264
250265READ8_HANDLER( system1_videoram_r )
251266{
267   videoram_wait_states(space->cpu);
252268   offset |= 0x1000 * ((videoram_bank >> 1) % (tilemap_pages / 2));
253269   return videoram[offset];
254270}
255271
256272WRITE8_HANDLER( system1_videoram_w )
257273{
274   videoram_wait_states(space->cpu);
258275   offset |= 0x1000 * ((videoram_bank >> 1) % (tilemap_pages / 2));
259276   videoram[offset] = data;
260277
src/mame/video/taitoic.c
r4499r4500
578578/* Note: various assumptions are made in these routines, typically that
579579   only CPU#0 is of interest. If in doubt, check the routine. */
580580
581static int has_write_handler8(const device_config *cpu, write8_space_func handler)
582{
583   if (cpu != NULL)
584   {
585      const address_space *space = cpu_get_address_space(cpu, ADDRESS_SPACE_PROGRAM);
586      const address_map_entry *entry;
587
588      if (space != NULL && space->map != NULL)
589         for (entry = space->map->entrylist; entry != NULL; entry = entry->next)
590            if (entry->write.shandler8 == handler)
591               return 1;
592   }
593
594   return 0;
595}
596
581597static int has_write_handler(const device_config *cpu, write16_space_func handler)
582598{
583599   if (cpu != NULL)
r4499r4500
636652
637653int has_TC0360PRI(running_machine *machine)
638654{
639   return   has_write_handler(machine->cpu[0], TC0360PRI_halfword_w) ||
640         has_write_handler(machine->cpu[0], TC0360PRI_halfword_swap_w);
655   return   has_write_handler8(machine->cpu[0], TC0360PRI_w);
641656}
642657
643658
r4499r4500
28322847#endif
28332848}
28342849
2835WRITE16_HANDLER( TC0360PRI_halfword_w )
2836{
2837   if (ACCESSING_BITS_0_7)
2838   {
2839      TC0360PRI_w(space,offset,data & 0xff);
2840#if 0
2841if (data & 0xff00)
2842{ logerror("CPU #0 PC %06x: warning - write %02x to MSB of TC0360PRI address %02x\n",cpu_get_pc(space->cpu),data,offset); }
2843   else
2844{ logerror("CPU #0 PC %06x: warning - write %02x to MSB of TC0360PRI address %02x\n",cpu_get_pc(space->cpu),data,offset); }
2845#endif
2846   }
2847}
28482850
2849WRITE16_HANDLER( TC0360PRI_halfword_swap_w )
2850{
2851   if (ACCESSING_BITS_8_15)
2852   {
2853      TC0360PRI_w(space,offset,(data >> 8) & 0xff);
2854#if 0
2855if (data & 0xff)
2856{ logerror("CPU #0 PC %06x: warning - write %02x to LSB of TC0360PRI address %02x\n",cpu_get_pc(space->cpu),data,offset); }
2857   else
2858{ logerror("CPU #0 PC %06x: warning - write %02x to LSB of TC0360PRI address %02x\n",cpu_get_pc(space->cpu),data,offset); }
2859#endif
2860   }
2861}
2862
2863
28642851/***************************************************************************/
28652852
28662853
r4499r4500
48984885   TC0220IOC_w(space, TC0220IOC_port, data);
48994886}
49004887
4901READ16_HANDLER( TC0220IOC_halfword_port_r )
4902{
4903   return TC0220IOC_port_r( space, offset );
4904}
49054888
4906WRITE16_HANDLER( TC0220IOC_halfword_port_w )
4907{
4908   if (ACCESSING_BITS_0_7)
4909      TC0220IOC_port_w( space, offset, data & 0xff );
4910}
4911
4912READ16_HANDLER( TC0220IOC_halfword_portreg_r )
4913{
4914   return TC0220IOC_portreg_r( space, offset );
4915}
4916
4917WRITE16_HANDLER( TC0220IOC_halfword_portreg_w )
4918{
4919   if (ACCESSING_BITS_0_7)
4920      TC0220IOC_portreg_w( space, offset, data & 0xff );
4921}
4922
4923READ16_HANDLER( TC0220IOC_halfword_byteswap_port_r )
4924{
4925   return TC0220IOC_port_r( space, offset ) << 8;
4926}
4927
4928WRITE16_HANDLER( TC0220IOC_halfword_byteswap_port_w )
4929{
4930   if (ACCESSING_BITS_8_15)
4931      TC0220IOC_port_w( space, offset, (data>>8) & 0xff );
4932}
4933
4934READ16_HANDLER( TC0220IOC_halfword_byteswap_portreg_r )
4935{
4936   return TC0220IOC_portreg_r( space, offset )<<8;
4937}
4938
4939WRITE16_HANDLER( TC0220IOC_halfword_byteswap_portreg_w )
4940{
4941   if (ACCESSING_BITS_8_15)
4942      TC0220IOC_portreg_w( space, offset, (data>>8) & 0xff );
4943}
4944
4945READ16_HANDLER( TC0220IOC_halfword_r )
4946{
4947   return TC0220IOC_r(space,offset);
4948}
4949
4950WRITE16_HANDLER( TC0220IOC_halfword_w )
4951{
4952   if (ACCESSING_BITS_0_7)
4953      TC0220IOC_w(space,offset,data & 0xff);
4954   else
4955   {
4956      /* qtorimon writes here the coin counters - bug? */
4957      TC0220IOC_w(space,offset,(data >> 8) & 0xff);
4958
4959      if (offset)      /* ainferno writes watchdog in msb */
4960logerror("CPU #0 PC %06x: warning - write to MSB of TC0220IOC address %02x\n",cpu_get_pc(space->cpu),offset);
4961   }
4962}
4963
4964READ16_HANDLER( TC0220IOC_halfword_byteswap_r )
4965{
4966   return TC0220IOC_halfword_r(space,offset,mem_mask) << 8;
4967}
4968
4969WRITE16_HANDLER( TC0220IOC_halfword_byteswap_w )
4970{
4971   if (ACCESSING_BITS_8_15)
4972      TC0220IOC_w(space,offset,(data >> 8) & 0xff);
4973   else
4974   {
4975      TC0220IOC_w(space,offset,data & 0xff);
4976
4977logerror("CPU #0 PC %06x: warning - write to LSB of TC0220IOC address %02x\n",cpu_get_pc(space->cpu),offset);
4978   }
4979}
4980
4981
49824889/***************************************************************************/
49834890
49844891
src/mame/video/taitoic.h
r4499r4500
193193
194194void TC0360PRI_vh_start(running_machine *machine);   /* must be called to ensure regs saved in state.c */
195195WRITE8_HANDLER( TC0360PRI_w );
196WRITE16_HANDLER( TC0360PRI_halfword_w );
197WRITE16_HANDLER( TC0360PRI_halfword_swap_w );
198196
199197
200198/***************************************************************************/
r4499r4500
209207READ8_HANDLER ( TC0220IOC_portreg_r );
210208WRITE8_HANDLER( TC0220IOC_portreg_w );
211209
212READ16_HANDLER ( TC0220IOC_halfword_port_r );
213WRITE16_HANDLER( TC0220IOC_halfword_port_w );
214READ16_HANDLER ( TC0220IOC_halfword_portreg_r );
215WRITE16_HANDLER( TC0220IOC_halfword_portreg_w );
216READ16_HANDLER ( TC0220IOC_halfword_byteswap_port_r );
217WRITE16_HANDLER( TC0220IOC_halfword_byteswap_port_w );
218READ16_HANDLER ( TC0220IOC_halfword_byteswap_portreg_r );
219WRITE16_HANDLER( TC0220IOC_halfword_byteswap_portreg_w );
220READ16_HANDLER ( TC0220IOC_halfword_r );
221WRITE16_HANDLER( TC0220IOC_halfword_w );
222READ16_HANDLER ( TC0220IOC_halfword_byteswap_r );
223WRITE16_HANDLER( TC0220IOC_halfword_byteswap_w );
224
225210READ8_HANDLER ( TC0510NIO_r );
226211WRITE8_HANDLER( TC0510NIO_w );
227212
src/mame/video/dc.c
r4499r4500
3333static UINT32 tafifo_buff[32];
3434
3535static emu_timer *vbout_timer;
36static emu_timer *endofrender_timer;
36static emu_timer *hbin_timer;
37static emu_timer *endofrender_timer_isp;
38static emu_timer *endofrender_timer_tsp;
39static emu_timer *endofrender_timer_video;
40
41static int scanline;
3742static bitmap_t *fakeframebuffer_bitmap;
3843static void testdrawscreen(const running_machine *machine,bitmap_t *bitmap,const rectangle *cliprect);
3944
r4499r4500
170175         /*We need to know where this is actually used on Naomi, for testing purpose.*/
171176         if(pvr_dma.start) { printf("Warning: PVR-DMA start\n"); }
172177
173         /*TODO: use the ddt function.*/
174178         if(pvr_dma.flag && pvr_dma.start)
175179         {
176180            UINT32 src,dst,size;
r4499r4500
201205            /*Note: do not update the params, since this DMA type doesn't support it. */
202206
203207            dc_sysctrl_regs[SB_ISTNRM] |= IST_DMA_PVR;
208            dc_update_interrupt_status(space->machine);
204209         }
205210         break;
206211   }
r4499r4500
343348            // we've got a request to draw, so, draw to the fake fraembuffer!
344349            testdrawscreen(space->machine,fakeframebuffer_bitmap,&clip);
345350
346            timer_adjust_oneshot(endofrender_timer, ATTOTIME_IN_USEC(1000) , 0); // hack, make sure render takes some amount of time
351            timer_adjust_oneshot(endofrender_timer_isp, ATTOTIME_IN_USEC(4000) , 0); // hack, make sure render takes some amount of time
347352
348353            break;
349354         }
r4499r4500
11891194         }
11901195      }
11911196
1192
1197      #if 1
11931198      // test--draw the verts fore each quad as polys too
11941199      {
11951200         testvertices vv[4];
r4499r4500
12131218         v[2] = &vv[3];
12141219         testdrawpoly(bitmap,v);
12151220      }
1216
1221      #endif
12171222   }
12181223   state_ta.grab[rs].busy=0;
12191224#if DEBUG_VERTICES
r4499r4500
13601365
13611366static TIMER_CALLBACK(vbout)
13621367{
1363
13641368   UINT32 a;
13651369   //printf("vbout\n");
13661370
r4499r4500
13681372   dc_sysctrl_regs[SB_ISTNRM] = a; // V Blank-out interrupt
13691373   dc_update_interrupt_status(machine);
13701374
1375   scanline = 0;
13711376   timer_adjust_oneshot(vbout_timer, attotime_never, 0);
1377   timer_adjust_oneshot(hbin_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, 640), 0);
13721378}
13731379
1374// moved, interrupts should never be changed in a VIDEO_UDPATE call!!
1375static TIMER_CALLBACK(endofrender)
1380static TIMER_CALLBACK(hbin)
13761381{
1377   UINT32 a;
1382   dc_sysctrl_regs[SB_ISTNRM] |= IST_HBL_IN; // H Blank-in interrupt
1383   dc_update_interrupt_status(machine);
13781384
1379   //printf("endofrender\n");
1385//  printf("hbin on scanline %d\n",scanline);
13801386
1381   // don't know if this is right.. but we get asserts otherwise, timing error?
1382   if (state_ta.start_render_received == 1)
1383   {
1384      for (a=0;a < NUM_BUFFERS;a++)
1385         if (state_ta.grab[a].busy == 1)
1386            state_ta.grab[a].busy = 0;
1387      state_ta.start_render_received = 0;
1388   }
1387   scanline++;
13891388
1390   state_ta.start_render_received=0;
1391   state_ta.renderselect= -1;
1389   timer_adjust_oneshot(hbin_timer, video_screen_get_time_until_pos(machine->primary_screen, scanline, 640), 0);
1390}
1391
1392
1393
1394static TIMER_CALLBACK(endofrender_video)
1395{
1396   dc_sysctrl_regs[SB_ISTNRM] |= IST_EOR_VIDEO;// VIDEO end of render
1397   dc_update_interrupt_status(machine);
1398   timer_adjust_oneshot(endofrender_timer_video, attotime_never, 0);
1399}
1400
1401static TIMER_CALLBACK(endofrender_tsp)
1402{
13921403   dc_sysctrl_regs[SB_ISTNRM] |= IST_EOR_TSP;   // TSP end of render
13931404   dc_update_interrupt_status(machine);
13941405
1395   timer_adjust_oneshot(endofrender_timer, attotime_never, 0);
1406   timer_adjust_oneshot(endofrender_timer_tsp, attotime_never, 0);
1407   timer_adjust_oneshot(endofrender_timer_video, ATTOTIME_IN_USEC(500) , 0);
1408}
13961409
1410static TIMER_CALLBACK(endofrender_isp)
1411{
1412   dc_sysctrl_regs[SB_ISTNRM] |= IST_EOR_ISP;   // ISP end of render
1413   dc_update_interrupt_status(machine);
13971414
1415   timer_adjust_oneshot(endofrender_timer_isp, attotime_never, 0);
1416   timer_adjust_oneshot(endofrender_timer_tsp, ATTOTIME_IN_USEC(500) , 0);
13981417}
13991418
14001419
r4499r4500
14231442   vbout_timer = timer_alloc(machine, vbout, 0);
14241443   timer_adjust_oneshot(vbout_timer, attotime_never, 0);
14251444
1426   endofrender_timer = timer_alloc(machine, endofrender, 0);
1427   timer_adjust_oneshot(endofrender_timer, attotime_never, 0);
1445   hbin_timer = timer_alloc(machine, hbin, 0);
1446   timer_adjust_oneshot(hbin_timer, attotime_never, 0);
1447   scanline = 0;
14281448
1449   endofrender_timer_isp = timer_alloc(machine, endofrender_isp, 0);
1450   endofrender_timer_tsp = timer_alloc(machine, endofrender_tsp, 0);
1451   endofrender_timer_video = timer_alloc(machine, endofrender_video, 0);
1452
1453   timer_adjust_oneshot(endofrender_timer_isp, attotime_never, 0);
1454   timer_adjust_oneshot(endofrender_timer_tsp, attotime_never, 0);
1455   timer_adjust_oneshot(endofrender_timer_video, attotime_never, 0);
1456
14291457   fakeframebuffer_bitmap = auto_bitmap_alloc(1024,1024,BITMAP_FORMAT_RGB32);
14301458
1431
14321459}
14331460
14341461VIDEO_UPDATE(dc)
r4499r4500
14781505
14791506   timer_adjust_oneshot(vbout_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, 0), 0);
14801507}
1481
src/mame/video/munchmo.c
r4499r4500
122122static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
123123{
124124   int scroll = mnchmobl_vreg[6];
125   int flags = mnchmobl_vreg[7];               /*   XB?????? */
126   int xadjust = - 128-16 - ((flags&0x80)?1:0);
127   int bank = (flags&0x40)?1:0;
128   const gfx_element *gfx = machine->gfx[2+bank];
129   int color_base = mnchmobl_palette_bank*4+3;
130   int i;
131   for( i=0; i<0x200; i++ )
125   int flags = mnchmobl_vreg[7];                     /*   XB?????? */
126   int xadjust = - 128 - 16 - ((flags & 0x80) ? 1 : 0);
127   int bank = (flags & 0x40) ? 1 : 0;
128   const gfx_element *gfx = machine->gfx[2 + bank];
129   int color_base = mnchmobl_palette_bank * 4 + 3;
130   int i, j;
131   int firstsprite = mnchmobl_vreg[4] & 0x3f;
132   for( i = firstsprite; i < firstsprite + 0x40; i++ )
132133   {
133      int tile_number = mnchmobl_sprite_tile[i];   /*   ETTTTTTT */
134      int attributes = mnchmobl_sprite_attr[i];   /*   XYYYYYCC */
135      int sx = mnchmobl_sprite_xpos[i];         /*   XXXXXXX? */
136      int sy = (i/0x40)*0x20;                  /* Y YY------ */
137      sy += (attributes>>2)&0x1f;
138      if( tile_number != 0xff && (attributes&0x80) )
134      for( j = 0; j < 8; j++ )
139135      {
140         sx = (sx>>1) | (tile_number&0x80);
141         sx = 2*((-32-scroll - sx)&0xff)+xadjust;
142         drawgfx( bitmap, gfx,
143            0x7f - (tile_number&0x7f),
144            color_base-(attributes&0x03),
145            0,0, /* no flip */
146            sx,sy,
147            cliprect, TRANSPARENCY_PEN, 7 );
136         int offs = (j << 6) | ( i & 0x3f );
137         int tile_number = mnchmobl_sprite_tile[offs];      /*   ETTTTTTT */
138         int attributes = mnchmobl_sprite_attr[offs];      /*   XYYYYYCC */
139         int sx = mnchmobl_sprite_xpos[offs];         /*   XXXXXXX? */
140         int sy = (offs >> 6) << 5;               /* Y YY------ */
141         sy += (attributes >> 2) & 0x1f;
142         if( attributes & 0x80 )
143         {
144            sx = (sx >> 1) | (tile_number & 0x80);
145            sx = 2 * ((- 32 - scroll - sx) & 0xff) + xadjust;
146            drawgfx( bitmap, gfx,
147               0x7f - (tile_number & 0x7f),
148               color_base - (attributes & 0x03),
149               0,0,                      /* no flip */
150               sx,sy,
151               cliprect, TRANSPARENCY_PEN, 7 );
152         }
148153      }
149154   }
150155}
src/mame/video/ninjakd2.c
r4499r4500
44UINT8* ninjakd2_bg_videoram;
55UINT8* ninjakd2_fg_videoram;
66
7static int sprite_overdraw_enabled;
87static int next_sprite_overdraw_enabled;
8static int stencil_palette;
99static int sprites_updated;
1010static bitmap_t *sp_bitmap;
1111// in robokid and omegaf big sprites are laid out differently in ROM
r4499r4500
154154   tilemap_set_transparent_pen(fg_tilemap, 15);
155155
156156   robokid_sprites = 0;
157   stencil_palette = 0xf0;  // stencil palette when overdraw mode = 0xf (watched bit 7-4)
157158}
158159
159160VIDEO_START( mnight )
r4499r4500
166167   tilemap_set_transparent_pen(fg_tilemap, 15);
167168
168169   robokid_sprites = 0;
170   stencil_palette = 0xf0;  // stencil palette when overdraw mode = 0xf (watched bit 7-4)
169171}
170172
171173VIDEO_START( robokid )
r4499r4500
184186   tilemap_set_transparent_pen(bg2_tilemap, 15);
185187
186188   robokid_sprites = 1;
189   stencil_palette = 0xf0;  // stencil palette when overdraw mode = 0xf (watched bit 7-4)
187190}
188191
189192VIDEO_START( omegaf )
r4499r4500
203206   tilemap_set_transparent_pen(bg2_tilemap, 15);
204207
205208   robokid_sprites = 1;
209   stencil_palette = 0xf0;  // stencil palette when overdraw mode = 0xf (watched bit 7-4)
206210}
207211
208212
r4499r4500
366370         int const color = sprptr[4] & 0x0f;
367371         // Ninja Kid II doesn't use the 'big' feature so it might not be available on the board
368372         int const big = (sprptr[2] & 0x04) >> 2;
369         int x,y;
370373
371374         if (flip_screen_get(machine))
372375         {
r4499r4500
383386            code ^= flipy << big_yshift;
384387         }
385388
386         for (y = 0; y <= big; ++y)
387389         {
388            for (x = 0; x <= big; ++x)
390            int y;
391            for (y = 0; y <= big; ++y)
389392            {
390               int const tile = code ^ (x << big_xshift) ^ (y << big_yshift);
393               int x;
394               for (x = 0; x <= big; ++x)
395               {
396                  int const tile = code ^ (x << big_xshift) ^ (y << big_yshift);
391397
392               drawgfx(bitmap, gfx,
393                     tile,
394                     color,
395                     flipx,flipy,
396                     sx + 16*x, sy + 16*y,
397                     0, TRANSPARENCY_PEN, 15);
398                  drawgfx(bitmap, gfx,
399                        tile,
400                        color,
401                        flipx,flipy,
402                        sx + 16*x, sy + 16*y,
403                        0, TRANSPARENCY_PEN, 15);
398404
399               ++sprites_drawn;
400               if (sprites_drawn >= 96)
401                  return;
405                  ++sprites_drawn;
406                  if (sprites_drawn >= 96)
407                     return;
408               }
402409            }
403410         }
404411      }
r4499r4500
417424static void erase_sprites(running_machine* const machine, bitmap_t* const bitmap, const rectangle* const cliprect)
418425{
419426   // if sprite overdraw is disabled, clear the sprite framebuffer
420   // if sprite overdraw is enabled, only clear palettes 0-B and F, and leave C-E on screen
421   if (!sprite_overdraw_enabled)
427   // if sprite overdraw is enabled, leave palette "0-E" on screen, and stencil only "F".
428   if (!next_sprite_overdraw_enabled)
422429      bitmap_fill(sp_bitmap, cliprect, 15);
423430   else
424431   {
425      int x,y;
426
432      int y;
427433      for (y = 0; y < sp_bitmap->height; ++y)
428434      {
435         int x;
429436         for (x = 0; x < sp_bitmap->width; ++x)
430437         {
431438            UINT16* const ptr = BITMAP_ADDR16(sp_bitmap, y, x);
432439
433            int pal = (*ptr & 0xf0) >> 4;
434
435            if (pal < 0xc || pal == 0xf)
436               *ptr = 15;
440            if ( (*ptr & 0xf0) == stencil_palette ) { *ptr = 15; }
441            ////// Before modified, clears palettes 0-B and F, and leaves C-E on screen
442            ////// But I'm sure "Ninja Kid II" clears F, and leaves 0-E
443            //////  (apply this to other games when verified)
444            //////  Now, I use variable "stencil_palette".
445            //////  But, I think that it may be "F", because I don't know why 0-B was cleared.
437446         }
438447      }
439448   }
r4499r4500
443452static void update_sprites(running_machine* const machine)
444453{
445454   erase_sprites(machine, sp_bitmap, 0);
446
447   // we want to erase the sprites with the old setting and draw them with the
448   // new one. Not doing this causes a glitch in Ninja Kid II when taking the top
449   // exit from stage 3.
450   sprite_overdraw_enabled = next_sprite_overdraw_enabled;
451
452455   draw_sprites(machine, sp_bitmap);
453456}
457   ////// Before modified, this was written.
458      // we want to erase the sprites with the old setting and draw them with the
459      // new one. Not doing this causes a glitch in Ninja Kid II when taking the top
460      // exit from stage 3.
461   ////// The glitch is correct behavior.
454462
455463
456464VIDEO_UPDATE( ninjakd2 )
src/mame/video/vsnes.c
r4499r4500
1414   ppu2c0x_init_palette(machine, 8*4*16 );
1515}
1616
17static void ppu_irq( running_machine *machine, int num, int *ppu_regs )
17static void ppu_irq_1( const device_config *device, int *ppu_regs )
1818{
19   cpu_set_input_line(machine->cpu[num], INPUT_LINE_NMI, PULSE_LINE );
19   cpu_set_input_line(device->machine->cpu[0], INPUT_LINE_NMI, PULSE_LINE );
2020}
2121
22static void ppu_irq_2( const device_config *device, int *ppu_regs )
23{
24   cpu_set_input_line(device->machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE );
25}
26
2227/* our ppu interface                                            */
23static const ppu2c0x_interface ppu_interface =
28const ppu2c0x_interface vsnes_ppu_interface_1 =
2429{
25   PPU_2C04,            /* type */
26   1,                  /* num */
27   { "gfx1" },            /* vrom gfx region */
28   { 0 },               /* gfxlayout num */
29   { 0 },               /* color base */
30   { PPU_MIRROR_NONE },   /* mirroring */
31   { ppu_irq }            /* irq */
30   "gfx1",            /* vrom gfx region */
31   0,               /* gfxlayout num */
32   0,               /* color base */
33   PPU_MIRROR_NONE,   /* mirroring */
34   ppu_irq_1         /* irq */
3235};
3336
3437/* our ppu interface for dual games                             */
35static const ppu2c0x_interface ppu_dual_interface =
38const ppu2c0x_interface vsnes_ppu_interface_2 =
3639{
37   PPU_2C04,                        /* type */
38   2,                              /* num */
39   { "gfx1", "gfx2" },                  /* vrom gfx region */
40   { 0, 1 },                        /* gfxlayout num */
41   { 0, 64 },                        /* color base */
42   { PPU_MIRROR_NONE, PPU_MIRROR_NONE },   /* mirroring */
43   { ppu_irq, ppu_irq }               /* irq */
40   "gfx2",            /* vrom gfx region */
41   1,               /* gfxlayout num */
42   64,               /* color base */
43   PPU_MIRROR_NONE,   /* mirroring */
44   ppu_irq_2         /* irq */
4445};
4546
4647VIDEO_START( vsnes )
4748{
48   ppu2c0x_init(machine, &ppu_interface );
4949}
5050
5151VIDEO_START( vsdual )
5252{
53   ppu2c0x_init(machine, &ppu_dual_interface );
5453}
5554
5655/***************************************************************************
r4499r4500
6160VIDEO_UPDATE( vsnes )
6261{
6362   /* render the ppu */
64   ppu2c0x_render( 0, bitmap, 0, 0, 0, 0 );
63   ppu2c0x_render( devtag_get_device(screen->machine, "ppu1"), bitmap, 0, 0, 0, 0 );
6564   return 0;
6665}
6766
r4499r4500
7372
7473   /* render the ppu's */
7574   if (screen == top_screen)
76      ppu2c0x_render(0, bitmap, 0, 0, 0, 0);
75      ppu2c0x_render(devtag_get_device(screen->machine, "ppu1"), bitmap, 0, 0, 0, 0);
7776   else if (screen == bottom_screen)
78      ppu2c0x_render(1, bitmap, 0, 0, 0, 0);
77      ppu2c0x_render(devtag_get_device(screen->machine, "ppu2"), bitmap, 0, 0, 0, 0);
7978
8079   return 0;
8180}
src/mame/video/ssrj.c
r4499r4500
1111   tilemap_mark_tile_dirty(tilemap1,offset>>1);
1212}
1313
14READ8_HANDLER(ssrj_vram1_r)
15{
16   return ssrj_vram1[offset];
17}
18
1914static TILE_GET_INFO( get_tile_info1 )
2015{
2116   int code;
2217   code=ssrj_vram1[tile_index<<1]+(ssrj_vram1[(tile_index<<1)+1]<<8);
2318   SET_TILE_INFO(
2419      0,
25      code&1023,
20      code&0x3ff,
2621      (code>>12)&0x3,
2722     ((code & 0x8000) ? TILE_FLIPX:0) |( (code & 0x4000) ? TILE_FLIPY:0)   );
2823}
r4499r4500
3530   tilemap_mark_tile_dirty(tilemap2,offset>>1);
3631}
3732
38READ8_HANDLER(ssrj_vram2_r)
39{
40   return ssrj_vram2[offset];
41}
42
4333static TILE_GET_INFO( get_tile_info2 )
4434{
4535   int code;
4636   code=ssrj_vram2[tile_index<<1]+(ssrj_vram2[(tile_index<<1)+1]<<8);
4737   SET_TILE_INFO(
4838      0,
49      code&1023,
39      code&0x3ff,
5040      ((code>>12)&0x3)+4,
5141     ((code & 0x8000) ? TILE_FLIPX:0) |( (code & 0x4000) ? TILE_FLIPY:0)   );
5242}
r4499r4500
5949   tilemap_mark_tile_dirty(tilemap4,offset>>1);
6050}
6151
62READ8_HANDLER(ssrj_vram4_r)
63{
64   return ssrj_vram4[offset];
65}
66
6752static TILE_GET_INFO( get_tile_info4 )
6853{
6954   int code;
7055   code=ssrj_vram4[tile_index<<1]+(ssrj_vram4[(tile_index<<1)+1]<<8);
7156   SET_TILE_INFO(
7257      0,
73      code&1023,
58      code&0x3ff,
7459      ((code>>12)&0x3)+12,
7560     ((code & 0x8000) ? TILE_FLIPX:0) |( (code & 0x4000) ? TILE_FLIPY:0)   );
7661}
src/mame/video/playch10.c
r4499r4500
5757   ppu2c0x_init_palette(machine, 256 );
5858}
5959
60static void ppu_irq( running_machine *machine, int num, int *ppu_regs )
60static void ppu_irq( const device_config *device, int *ppu_regs )
6161{
62   cpu_set_input_line(machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE );
62   cpu_set_input_line(device->machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE );
6363   pc10_int_detect = 1;
6464}
6565
r4499r4500
6767/* things like mirroring and whether to use vrom or vram       */
6868/* can be set by calling 'ppu2c0x_override_hardware_options'   */
6969
70static const ppu2c0x_interface ppu_interface =
70const ppu2c0x_interface playch10_ppu_interface =
7171{
72   PPU_2C03B,            /* type */
73   1,                  /* num */
74   { "gfx2" },            /* vrom gfx region */
75   { 1 },               /* gfxlayout num */
76   { 256 },            /* color base */
77   { PPU_MIRROR_NONE },   /* mirroring */
78   { ppu_irq },         /* irq */
79   { 0 }               /* vram */
72   "gfx2",            /* vrom gfx region */
73   1,               /* gfxlayout num */
74   256,            /* color base */
75   PPU_MIRROR_NONE,   /* mirroring */
76   ppu_irq,         /* irq */
77   0               /* vram */
8078};
8179
82static const ppu2c0x_interface ppu_interface_hboard =
80const ppu2c0x_interface playch10_ppu_interface_hboard =
8381{
84   PPU_2C03B,            /* type */
85   1,                  /* num */
86   { "gfx2" },            /* vrom gfx region */
87   { 1 },               /* gfxlayout num */
88   { 256 },            /* color base */
89   { PPU_MIRROR_NONE },   /* mirroring */
90   { ppu_irq },         /* irq */
91   { 1 }               /* vram */
82   "gfx2",            /* vrom gfx region */
83   1,               /* gfxlayout num */
84   256,            /* color base */
85   PPU_MIRROR_NONE,   /* mirroring */
86   ppu_irq,         /* irq */
87   1               /* vram */
9288};
9389
9490static TILE_GET_INFO( get_bg_tile_info )
r4499r4500
107103
108104   bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
109105       8, 8, 32, 32);
110
111   ppu2c0x_init(machine, &ppu_interface );
112106}
113107
114108VIDEO_START( playch10_hboard )
r4499r4500
118112
119113   bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
120114       8, 8, 32, 32);
121
122   ppu2c0x_init(machine, &ppu_interface_hboard );
123115}
124116
125117/***************************************************************************
r4499r4500
130122
131123VIDEO_UPDATE( playch10 )
132124{
125   const device_config *ppu = devtag_get_device(screen->machine, "ppu");
126
133127   /* Dual monitor version */
134128   if (pc10_bios == 1)
135129   {
r4499r4500
145139      {
146140         if ( !pc10_dispmask )
147141            /* render the ppu */
148            ppu2c0x_render( 0, bitmap, 0, 0, 0, 0 );
142            ppu2c0x_render( ppu, bitmap, 0, 0, 0, 0 );
149143         else
150144            bitmap_fill(bitmap, cliprect, 0);
151145      }
r4499r4500
175169
176170      if ( pc10_game_mode )
177171         /* render the ppu */
178         ppu2c0x_render( 0, bitmap, 0, 0, 0, 0 );
172         ppu2c0x_render( ppu, bitmap, 0, 0, 0, 0 );
179173      else
180174      {
181175         /* When the bios is accessing vram, the video circuitry can't access it */
src/mame/video/ppu2c0x.c
r4499r4500
2828#include "profiler.h"
2929#include "video/ppu2c0x.h"
3030
31
32/***************************************************************************
33    CONSTANTS
34***************************************************************************/
35
3136/* constant definitions */
3237#define VISIBLE_SCREEN_WIDTH   (32*8)   /* Visible screen width */
3338#define VISIBLE_SCREEN_HEIGHT   (30*8)   /* Visible screen height */
r4499r4500
3742#define SPRITERAM_MASK         (0x100-1)   /* spriteram size */
3843#define CHARGEN_NUM_CHARS      512      /* max number of characters handled by the chargen */
3944
45enum
46{
47   PPU2C0XINFO_INT_SCANLINES_PER_FRAME = DEVINFO_INT_DEVICE_SPECIFIC
48};
49
4050/* default monochromatic colortable */
4151static const pen_t default_colortable_mono[] =
4252{
r4499r4500
6373   0,29,30,31,
6474};
6575
76
77/***************************************************************************
78    TYPE DEFINITIONS
79***************************************************************************/
80
6681/* our chip state */
67typedef struct {
68   running_machine       *machine;            /* execution context */
82typedef struct
83{
6984   bitmap_t            *bitmap;            /* target bitmap */
7085   UINT8               *videomem;            /* video mem */
7186   UINT8               *videoram;            /* video ram */
r4499r4500
104119   rgb_t               palette[64*4];         /* palette for this chip */
105120} ppu2c0x_chip;
106121
107/* our local copy of the interface */
108static ppu2c0x_interface *intf;
109122
110/* chips state - allocated at init time */
111static ppu2c0x_chip *chips = 0;
112123
113static void update_scanline(running_machine *machine, int num );
124/***************************************************************************
125    PROTOTYPES
126***************************************************************************/
114127
128static void update_scanline(const device_config *device);
129
115130static TIMER_CALLBACK( scanline_callback );
116131static TIMER_CALLBACK( hblank_callback );
117132static TIMER_CALLBACK( nmi_callback );
118133
119void (*ppu_latch)( offs_t offset );
134void (*ppu_latch)( const device_config *device, offs_t offset );
120135
121136
137/***************************************************************************
138    INLINE FUNCTIONS
139***************************************************************************/
140
141INLINE ppu2c0x_chip *get_token(const device_config *device)
142{
143   assert(device != NULL);
144   assert((device->type == PPU_2C02) || (device->type == PPU_2C03B)
145       || (device->type == PPU_2C04) || (device->type == PPU_2C05)
146       || (device->type == PPU_2C07));
147   return (ppu2c0x_chip *) device->token;
148}
149
150
151INLINE const ppu2c0x_interface *get_interface(const device_config *device)
152{
153   assert(device != NULL);
154   assert((device->type == PPU_2C02) || (device->type == PPU_2C03B)
155       || (device->type == PPU_2C04) || (device->type == PPU_2C05)
156       || (device->type == PPU_2C07));
157   return (const ppu2c0x_interface *) device->static_config;
158}
159
160
161/***************************************************************************
162    IMPLEMENTATION
163***************************************************************************/
164
122165/*************************************
123166 *
124167 *  PPU Palette Initialization
r4499r4500
254297 *  PPU Initialization and Disposal
255298 *
256299 *************************************/
257void ppu2c0x_init(running_machine *machine, const ppu2c0x_interface *interface )
300
301static DEVICE_START( ppu2c0x )
258302{
259   int i;
260303   UINT32 total;
304   ppu2c0x_chip *chip = get_token(device);
305   const ppu2c0x_interface *intf = get_interface(device);
261306
262   /* keep a local copy of the interface */
263   intf = auto_malloc(sizeof(*interface));
264   memcpy(intf, interface, sizeof(*interface));
307   memset(chip, 0, sizeof(*chip));
308   chip->scanlines_per_frame = (int) device_get_info_int(device, PPU2C0XINFO_INT_SCANLINES_PER_FRAME);
265309
266   /* safety check */
267   assert_always ( intf->num > 0, "Invalid intf->num" );
310   /* initialize the scanline handling portion */
311   chip->scanline_timer = timer_alloc(device->machine, scanline_callback, (void *) device);
312   chip->hblank_timer = timer_alloc(device->machine, hblank_callback, (void *) device);
313   chip->nmi_timer = timer_alloc(device->machine, nmi_callback, (void *) device);
314   chip->scanline = 0;
315   chip->scan_scale = 1;
268316
269   chips = auto_malloc( intf->num * sizeof( ppu2c0x_chip ) );
270   memset(chips, 0, intf->num * sizeof( ppu2c0x_chip ));
317   /* allocate a screen bitmap, videomem and spriteram, a dirtychar array and the monochromatic colortable */
318   chip->bitmap = auto_bitmap_alloc( VISIBLE_SCREEN_WIDTH, VISIBLE_SCREEN_HEIGHT, video_screen_get_format(device->machine->primary_screen));
319   chip->videomem = auto_malloc( VIDEOMEM_SIZE );
320   chip->videoram = auto_malloc( VIDEOMEM_SIZE );
321   chip->spriteram = auto_malloc( SPRITERAM_SIZE );
322   chip->colortable = auto_malloc( sizeof( default_colortable ) );
323   chip->colortable_mono = auto_malloc( sizeof( default_colortable_mono ) );
271324
272   /* intialize our virtual chips */
273   for( i = 0; i < intf->num; i++ )
325   /* clear videomem & spriteram */
326   memset( chip->videomem, 0, VIDEOMEM_SIZE );
327   memset( chip->videoram, 0, VIDEOMEM_SIZE );
328   memset( chip->spriteram, 0, SPRITERAM_SIZE );
329   memset( chip->videoram_banks_indices, 0xff, sizeof(chip->videoram_banks_indices) );
330
331   if ( intf->vram_enabled )
274332   {
275      chips[i].machine = machine;
333      chip->has_videoram = 1;
334   }
276335
277      switch (intf->type)
278      {
279         case PPU_2C02:
280            chips[i].scanlines_per_frame = PPU_NTSC_SCANLINES_PER_FRAME;
281            break;
282         case PPU_2C03B:
283            chips[i].scanlines_per_frame = PPU_NTSC_SCANLINES_PER_FRAME;
284            break;
285         case PPU_2C04:
286            chips[i].scanlines_per_frame = PPU_NTSC_SCANLINES_PER_FRAME;
287            break;
288         case PPU_2C05:
289            chips[i].scanlines_per_frame = PPU_NTSC_SCANLINES_PER_FRAME;
290            break;
291         case PPU_2C07:
292            chips[i].scanlines_per_frame = PPU_PAL_SCANLINES_PER_FRAME;
293            break;
294         default:
295            chips[i].scanlines_per_frame = PPU_NTSC_SCANLINES_PER_FRAME;
296            break;
297      }
336   /* initialize the video ROM portion, if available */
337   if ( ( intf->vrom_region != NULL ) && ( memory_region( device->machine, intf->vrom_region ) != 0 ) )
338   {
339      /* mark that we have a videorom */
340      chip->has_videorom = 1;
298341
299      /* initialize the scanline handling portion */
300      chips[i].scanline_timer = timer_alloc(machine, scanline_callback, NULL);
301      chips[i].hblank_timer = timer_alloc(machine, hblank_callback, NULL);
302      chips[i].nmi_timer = timer_alloc(machine, nmi_callback, NULL);
303      chips[i].scanline = 0;
304      chips[i].scan_scale = 1;
342      /* find out how many banks */
343      chip->videorom_banks = memory_region_length( device->machine, intf->vrom_region ) / 0x2000;
305344
306      /* allocate a screen bitmap, videomem and spriteram, a dirtychar array and the monochromatic colortable */
307      chips[i].bitmap = auto_bitmap_alloc( VISIBLE_SCREEN_WIDTH, VISIBLE_SCREEN_HEIGHT, video_screen_get_format(machine->primary_screen));
308      chips[i].videomem = auto_malloc( VIDEOMEM_SIZE );
309      chips[i].videoram = auto_malloc( VIDEOMEM_SIZE );
310      chips[i].spriteram = auto_malloc( SPRITERAM_SIZE );
311      chips[i].colortable = auto_malloc( sizeof( default_colortable ) );
312      chips[i].colortable_mono = auto_malloc( sizeof( default_colortable_mono ) );
313
314      /* clear videomem & spriteram */
315      memset( chips[i].videomem, 0, VIDEOMEM_SIZE );
316      memset( chips[i].videoram, 0, VIDEOMEM_SIZE );
317      memset( chips[i].spriteram, 0, SPRITERAM_SIZE );
318      memset( chips[i].videoram_banks_indices, 0xff, sizeof(chips[i].videoram_banks_indices) );
319
320      if ( intf->vram_enabled[i] )
345      /* tweak the layout accordingly */
346      if ( chip->has_videoram )
321347      {
322         chips[i].has_videoram = 1;
348         total = CHARGEN_NUM_CHARS;
323349      }
324
325      /* initialize the video ROM portion, if available */
326      if ( ( intf->vrom_region[i] != NULL ) && ( memory_region( machine, intf->vrom_region[i] ) != 0 ) )
327      {
328         /* mark that we have a videorom */
329         chips[i].has_videorom = 1;
330
331         /* find out how many banks */
332         chips[i].videorom_banks = memory_region_length( machine, intf->vrom_region[i] ) / 0x2000;
333
334         /* tweak the layout accordingly */
335         if ( chips[i].has_videoram )
336         {
337            total = CHARGEN_NUM_CHARS;
338         }
339         else
340         {
341            total = chips[i].videorom_banks * CHARGEN_NUM_CHARS;
342         }
343      }
344350      else
345351      {
346         chips[i].has_videorom = chips[i].videorom_banks = 0;
347
348         /* we need to reset this in case of mame running multisession */
349         total = CHARGEN_NUM_CHARS;
352         total = chip->videorom_banks * CHARGEN_NUM_CHARS;
350353      }
354   }
355   else
356   {
357      chip->has_videorom = chip->videorom_banks = 0;
351358
352      /* now create the gfx region */
353      {
354         gfx_layout gl;
355         UINT8 *src = (chips[i].has_videorom && !chips[i].has_videoram) ? memory_region( machine, intf->vrom_region[i] ) : chips[i].videomem;
359      /* we need to reset this in case of mame running multisession */
360      total = CHARGEN_NUM_CHARS;
361   }
356362
357         memcpy(&gl, &ppu_charlayout, sizeof(gl));
358         gl.total = total;
359         machine->gfx[intf->gfx_layout_number[i]] = gfx_element_alloc( machine, &gl, src, 8, 0 );
360      }
363   /* now create the gfx region */
364   {
365      gfx_layout gl;
366      UINT8 *src = (chip->has_videorom && !chip->has_videoram) ? memory_region( device->machine, intf->vrom_region ) : chip->videomem;
361367
362      /* setup our videomem handlers based on mirroring */
363      ppu2c0x_set_mirroring( i, intf->mirroring[i] );
368      memcpy(&gl, &ppu_charlayout, sizeof(gl));
369      gl.total = total;
370      device->machine->gfx[intf->gfx_layout_number] = gfx_element_alloc( device->machine, &gl, src, 8, 0 );
364371   }
372
373   /* setup our videomem handlers based on mirroring */
374   ppu2c0x_set_mirroring( device, intf->mirroring );
365375}
366376
367377static TIMER_CALLBACK( hblank_callback )
368378{
369   int num = param;
370   ppu2c0x_chip* this_ppu = &chips[num];
371   int *ppu_regs = &chips[num].regs[0];
379   const device_config *device = ptr;
380   ppu2c0x_chip *this_ppu = get_token(device);
381   int *ppu_regs = &this_ppu->regs[0];
372382
373383   int blanked = ( ppu_regs[PPU_CONTROL1] & ( PPU_CONTROL1_BACKGROUND | PPU_CONTROL1_SPRITES ) ) == 0;
374384   int vblank = ((this_ppu->scanline >= PPU_VBLANK_FIRST_SCANLINE-1) && (this_ppu->scanline < this_ppu->scanlines_per_frame-1)) ? 1 : 0;
375385
376//  update_scanline (machine, num);
386//  update_scanline (device);
377387
378388   if (this_ppu->hblank_callback_proc)
379      (*this_ppu->hblank_callback_proc) (machine, num, this_ppu->scanline, vblank, blanked);
389      (*this_ppu->hblank_callback_proc) (device, this_ppu->scanline, vblank, blanked);
380390
381   timer_adjust_oneshot(chips[num].hblank_timer, attotime_never, num);
391   timer_adjust_oneshot(this_ppu->hblank_timer, attotime_never, 0);
382392}
383393
384394static TIMER_CALLBACK( nmi_callback )
385395{
386   int num = param;
387   int *ppu_regs = &chips[num].regs[0];
396   const device_config *device = ptr;
397   ppu2c0x_chip *this_ppu = get_token(device);
398   const ppu2c0x_interface *intf = get_interface(device);
399   int *ppu_regs = &this_ppu->regs[0];
388400
389401   // Actually fire the VMI
390   if (intf->nmi_handler[num])
391      (*intf->nmi_handler[num]) (machine, num, ppu_regs);
402   if (intf->nmi_handler != NULL)
403      (*intf->nmi_handler) (device, ppu_regs);
392404
393   timer_adjust_oneshot(chips[num].nmi_timer, attotime_never, num);
405   timer_adjust_oneshot(this_ppu->nmi_timer, attotime_never, 0);
394406}
395407
396static void draw_background(running_machine *machine, int num, UINT8 *line_priority )
408static void draw_background(const device_config *device, UINT8 *line_priority )
397409{
410   const ppu2c0x_interface *intf = get_interface(device);
411   ppu2c0x_chip *this_ppu = get_token(device);
412
398413   /* cache some values locally */
399   bitmap_t *bitmap = chips[num].bitmap;
400   const int *ppu_regs = &chips[num].regs[0];
401   const int scanline = chips[num].scanline;
402   const int refresh_data = chips[num].refresh_data;
403   const int gfx_bank = intf->gfx_layout_number[num];
404   const int total_elements = chips[num].machine->gfx[gfx_bank]->total_elements;
405   const int *nes_vram = &chips[num].nes_vram[0];
406   const int tile_page = chips[num].tile_page;
407   const int line_modulo = chips[num].machine->gfx[gfx_bank]->line_modulo;
408   UINT8 **ppu_page = chips[num].ppu_page;
409   int   start_x = ( chips[num].x_fine ^ 0x07 ) - 7;
414   bitmap_t *bitmap = this_ppu->bitmap;
415   const int *ppu_regs = &this_ppu->regs[0];
416   const int scanline = this_ppu->scanline;
417   const int refresh_data = this_ppu->refresh_data;
418   const int gfx_bank = intf->gfx_layout_number;
419   const int total_elements = device->machine->gfx[gfx_bank]->total_elements;
420   const int *nes_vram = &this_ppu->nes_vram[0];
421   const int tile_page = this_ppu->tile_page;
422   const int line_modulo = device->machine->gfx[gfx_bank]->line_modulo;
423   UINT8 **ppu_page = this_ppu->ppu_page;
424   int   start_x = ( this_ppu->x_fine ^ 0x07 ) - 7;
410425   UINT16 back_pen;
411426   UINT16 *dest;
412427
r4499r4500
423438   if ( ppu_regs[PPU_CONTROL1] & PPU_CONTROL1_DISPLAY_MONO )
424439   {
425440      color_mask = 0xf0;
426      color_table = chips[num].colortable_mono;
441      color_table = this_ppu->colortable_mono;
427442   }
428443   else
429444   {
430445      color_mask = 0xff;
431      color_table = chips[num].colortable;
446      color_table = this_ppu->colortable;
432447   }
433448
434449   /* cache the background pen */
435   back_pen = (chips[num].back_color & color_mask)+intf->color_base[num];
450   back_pen = (this_ppu->back_color & color_mask)+intf->color_base;
436451
437452   /* determine where in the nametable to start drawing from */
438453   /* based on the current scanline and scroll regs */
r4499r4500
477492      //27/12/2002
478493      if( ppu_latch )
479494      {
480         (*ppu_latch)(( tile_page << 10 ) | ( page2 << 4 ));
495         (*ppu_latch)(device, ( tile_page << 10 ) | ( page2 << 4 ));
481496      }
482497
483498      if(start_x < VISIBLE_SCREEN_WIDTH )
484499      {
485500         paldata = &color_table[ 4 * ( ( ( color_byte >> color_bits ) & 0x03 ) ) ];
486501         start = scroll_y_fine * line_modulo;
487         sd = gfx_element_get_data(chips[num].machine->gfx[gfx_bank], index2 % total_elements) + start;
502         sd = gfx_element_get_data(device->machine->gfx[gfx_bank], index2 % total_elements) + start;
488503
489504         /* render the pixel */
490505         for( i = 0; i < 8; i++ )
r4499r4500
530545   }
531546}
532547
533static void draw_sprites(running_machine *machine, int num, UINT8 *line_priority )
548static void draw_sprites(const device_config *device, UINT8 *line_priority )
534549{
550   const ppu2c0x_interface *intf = get_interface(device);
551   ppu2c0x_chip *this_ppu = get_token(device);
552
535553   /* cache some values locally */
536   bitmap_t *bitmap = chips[num].bitmap;
537   const int scanline = chips[num].scanline;
538   const int gfx_bank = intf->gfx_layout_number[num];
539   const int total_elements = chips[num].machine->gfx[gfx_bank]->total_elements;
540   const int sprite_page = chips[num].sprite_page;
541   const int line_modulo = chips[num].machine->gfx[gfx_bank]->line_modulo;
542   const UINT8 *sprite_ram = chips[num].spriteram;
543   pen_t *color_table = chips[num].colortable;
544   int *ppu_regs = &chips[num].regs[0];
554   bitmap_t *bitmap = this_ppu->bitmap;
555   const int scanline = this_ppu->scanline;
556   const int gfx_bank = intf->gfx_layout_number;
557   const int total_elements = device->machine->gfx[gfx_bank]->total_elements;
558   const int sprite_page = this_ppu->sprite_page;
559   const int line_modulo = device->machine->gfx[gfx_bank]->line_modulo;
560   const UINT8 *sprite_ram = this_ppu->spriteram;
561   pen_t *color_table = this_ppu->colortable;
562   int *ppu_regs = &this_ppu->regs[0];
545563
546564   int spriteXPos, spriteYPos, spriteIndex;
547565   int tile, index1, page;
r4499r4500
613631         page = ( tile >> 6 ) | sprite_page;
614632
615633
616      index1 = chips[num].nes_vram[page] + ( tile & 0x3f );
634      index1 = this_ppu->nes_vram[page] + ( tile & 0x3f );
617635
618636      if ( ppu_latch )
619         (*ppu_latch)(( sprite_page << 10 ) | ( (tile & 0xff) << 4 ));
637         (*ppu_latch)(device, ( sprite_page << 10 ) | ( (tile & 0xff) << 4 ));
620638
621639      /* compute the character's line to draw */
622640      sprite_line = scanline - spriteYPos;
r4499r4500
626644
627645      paldata = &color_table[4 * color];
628646      start = sprite_line * line_modulo;
629      sd = gfx_element_get_data(chips[num].machine->gfx[gfx_bank], index1 % total_elements) + start;
647      sd = gfx_element_get_data(device->machine->gfx[gfx_bank], index1 % total_elements) + start;
630648      if (size > 8)
631         gfx_element_get_data(chips[num].machine->gfx[gfx_bank], (index1 + 1) % total_elements);
649         gfx_element_get_data(device->machine->gfx[gfx_bank], (index1 + 1) % total_elements);
632650
633651      if ( pri )
634652      {
r4499r4500
716734 *  Scanline Rendering and Update
717735 *
718736 *************************************/
719static void render_scanline(running_machine *machine, int num)
737static void render_scanline(const device_config *device)
720738{
739   ppu2c0x_chip *this_ppu = get_token(device);
740   const ppu2c0x_interface *intf = get_interface(device);
721741   UINT8   line_priority[VISIBLE_SCREEN_WIDTH];
722   int      *ppu_regs = &chips[num].regs[0];
742   int      *ppu_regs = &this_ppu->regs[0];
723743
724744   /* lets see how long it takes */
725   profiler_mark(PROFILER_USER1+num);
745   profiler_mark(PROFILER_USER1);
726746
727747   /* clear the line priority for this scanline */
728748   memset( line_priority, 0, VISIBLE_SCREEN_WIDTH );
r4499r4500
732752
733753   /* see if we need to render the background */
734754   if ( ppu_regs[PPU_CONTROL1] & PPU_CONTROL1_BACKGROUND )
735      draw_background(machine, num, line_priority );
755      draw_background(device, line_priority );
736756   else
737757   {
738      bitmap_t *bitmap = chips[num].bitmap;
739      const int scanline = chips[num].scanline;
758      bitmap_t *bitmap = this_ppu->bitmap;
759      const int scanline = this_ppu->scanline;
740760      UINT8 color_mask;
741761      UINT16 back_pen;
742762      int i;
r4499r4500
748768         color_mask = 0xff;
749769
750770      /* cache the background pen */
751      back_pen = (chips[num].back_color & color_mask)+intf->color_base[num];
771      back_pen = (this_ppu->back_color & color_mask)+intf->color_base;
752772
753773      // Fill this scanline with the background pen.
754774      for (i = 0; i < bitmap->width; i ++)
r4499r4500
757777
758778   /* if sprites are on, draw them */
759779   if ( ppu_regs[PPU_CONTROL1] & PPU_CONTROL1_SPRITES )
760      draw_sprites( machine, num, line_priority );
780      draw_sprites( device, line_priority );
761781
762782    /* done updating, whew */
763783   profiler_mark(PROFILER_END);
764784}
765785
766static void update_scanline(running_machine *machine, int num )
786static void update_scanline(const device_config *device)
767787{
768   ppu2c0x_chip* this_ppu;
769   int scanline = chips[num].scanline;
770   int *ppu_regs = &chips[num].regs[0];
788   ppu2c0x_chip *this_ppu = get_token(device);
789   const ppu2c0x_interface *intf = get_interface(device);
790   int scanline = this_ppu->scanline;
791   int *ppu_regs = &this_ppu->regs[0];
771792
772   this_ppu = &chips[num];
773
774793   if ( scanline <= PPU_BOTTOM_VISIBLE_SCANLINE )
775794   {
776795      /* Render this scanline if appropriate */
r4499r4500
782801         this_ppu->refresh_data |= ( this_ppu->refresh_latch & 0x041f );
783802
784803//logerror("   updating refresh_data: %04x (scanline: %d)\n", this_ppu->refresh_data, this_ppu->scanline);
785         render_scanline( machine, num );
804         render_scanline( device );
786805      }
787806      else
788807      {
r4499r4500
812831            else
813832               penNum = this_ppu->videomem[this_ppu->videomem_addr & 0x3f00] & 0x3f;
814833
815            back_pen = penNum + intf->color_base[num];
834            back_pen = penNum + intf->color_base;
816835         }
817836         else
818            back_pen = (this_ppu->back_color & color_mask)+intf->color_base[num];
837            back_pen = (this_ppu->back_color & color_mask)+intf->color_base;
819838
820839         // Fill this scanline with the background pen.
821840         for (i = 0; i < bitmap->width; i ++)
r4499r4500
846865
847866static TIMER_CALLBACK( scanline_callback )
848867{
849   int num = param;
850   ppu2c0x_chip* this_ppu = &chips[num];
851   int *ppu_regs = &chips[num].regs[0];
868   const device_config *device = ptr;
869   ppu2c0x_chip *this_ppu = get_token(device);
870   int *ppu_regs = &this_ppu->regs[0];
852871   int blanked = ( ppu_regs[PPU_CONTROL1] & ( PPU_CONTROL1_BACKGROUND | PPU_CONTROL1_SPRITES ) ) == 0;
853872   int vblank = ((this_ppu->scanline >= PPU_VBLANK_FIRST_SCANLINE-1) && (this_ppu->scanline < this_ppu->scanlines_per_frame-1)) ? 1 : 0;
854873   int next_scanline;
855874
856875   /* if a callback is available, call it */
857   if ( this_ppu->scanline_callback_proc )
858      (*this_ppu->scanline_callback_proc)( machine, num, this_ppu->scanline, vblank, blanked );
876   if ( this_ppu->scanline_callback_proc != NULL )
877      (*this_ppu->scanline_callback_proc)( device, this_ppu->scanline, vblank, blanked );
859878
860879   /* update the scanline that just went by */
861   update_scanline( machine, num );
880   update_scanline( device );
862881
863882   /* increment our scanline count */
864883   this_ppu->scanline++;
865884
866//logerror("starting scanline %d (MAME %d, beam %d)\n", this_ppu->scanline, video_screen_get_vpos(machine->primary_screen), video_screen_get_hpos(machine->primary_screen));
885//logerror("starting scanline %d (MAME %d, beam %d)\n", this_ppu->scanline, video_screen_get_vpos(device->machine->primary_screen), video_screen_get_hpos(device->machine->primary_screen));
867886
868887   /* Note: this is called at the _end_ of each scanline */
869888   if (this_ppu->scanline == PPU_VBLANK_FIRST_SCANLINE)
r4499r4500
879898         // a game can read the high bit of $2002 before the NMI is called (potentially resetting the bit
880899         // via a read from $2002 in the NMI handler).
881900         // B-Wings is an example game that needs this.
882         timer_adjust_oneshot(this_ppu->nmi_timer, cpu_clocks_to_attotime(machine->cpu[0], 4), num);
901         timer_adjust_oneshot(this_ppu->nmi_timer, cpu_clocks_to_attotime(device->machine->cpu[0], 4), 0);
883902      }
884903   }
885904
r4499r4500
907926      next_scanline = 0;
908927
909928   // Call us back when the hblank starts for this scanline
910   timer_adjust_oneshot(this_ppu->hblank_timer, cpu_clocks_to_attotime(machine->cpu[0], 86.67), num); // ??? FIXME - hardcoding NTSC, need better calculation
929   timer_adjust_oneshot(this_ppu->hblank_timer, cpu_clocks_to_attotime(device->machine->cpu[0], 86.67), 0); // ??? FIXME - hardcoding NTSC, need better calculation
911930
912931   // trigger again at the start of the next scanline
913   timer_adjust_oneshot(this_ppu->scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, next_scanline * this_ppu->scan_scale, 0), num);
932   timer_adjust_oneshot(this_ppu->scanline_timer, video_screen_get_time_until_pos(device->machine->primary_screen, next_scanline * this_ppu->scan_scale, 0), 0);
914933}
915934
916935/*************************************
r4499r4500
918937 *  PPU Reset
919938 *
920939 *************************************/
921void ppu2c0x_reset(running_machine *machine, int num, int scan_scale)
940
941static DEVICE_RESET( ppu2c0x )
922942{
943   ppu2c0x_chip *this_ppu = get_token(device);
944   const ppu2c0x_interface *intf = get_interface(device);
945   int scan_scale = 1;
923946   int i;
924947
925   /* check bounds */
926   if ( num >= intf->num )
927   {
928      logerror( "PPU(reset): Attempting to access an unmapped chip\n" );
929      return;
930   }
931
932948   /* reset the scanline count */
933   chips[num].scanline = 0;
949   this_ppu->scanline = 0;
934950
935951   /* set the scan scale (this is for dual monitor vertical setups) */
936   chips[num].scan_scale = scan_scale;
952   this_ppu->scan_scale = scan_scale;
937953
938   timer_adjust_oneshot(chips[num].nmi_timer, attotime_never, num);
954   timer_adjust_oneshot(this_ppu->nmi_timer, attotime_never, 0);
939955
940956   // Call us back when the hblank starts for this scanline
941   timer_adjust_oneshot(chips[num].hblank_timer, cpu_clocks_to_attotime(machine->cpu[0], 86.67), num); // ??? FIXME - hardcoding NTSC, need better calculation
957   timer_adjust_oneshot(this_ppu->hblank_timer, cpu_clocks_to_attotime(device->machine->cpu[0], 86.67), 0); // ??? FIXME - hardcoding NTSC, need better calculation
942958
943959   // Call us back at the start of the next scanline
944   timer_adjust_oneshot(chips[num].scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, 1, 0), num);
960   timer_adjust_oneshot(this_ppu->scanline_timer, video_screen_get_time_until_pos(device->machine->primary_screen, 1, 0), 0);
945961
946962   /* reset the callbacks */
947   chips[num].scanline_callback_proc = 0;
948   chips[num].vidaccess_callback_proc = 0;
963   this_ppu->scanline_callback_proc = 0;
964   this_ppu->vidaccess_callback_proc = 0;
949965
950966   for( i = 0; i < PPU_MAX_REG; i++ )
951      chips[num].regs[i] = 0;
967      this_ppu->regs[i] = 0;
952968
953969   /* initialize the rest of the members */
954   chips[num].refresh_data = 0;
955   chips[num].refresh_latch = 0;
956   chips[num].x_fine = 0;
957   chips[num].toggle = 0;
958   chips[num].add = 1;
959   chips[num].videomem_addr = 0;
960   chips[num].addr_latch = 0;
961   chips[num].data_latch = 0;
962   chips[num].tile_page = 0;
963   chips[num].sprite_page = 0;
964   chips[num].back_color = 0;
970   this_ppu->refresh_data = 0;
971   this_ppu->refresh_latch = 0;
972   this_ppu->x_fine = 0;
973   this_ppu->toggle = 0;
974   this_ppu->add = 1;
975   this_ppu->videomem_addr = 0;
976   this_ppu->addr_latch = 0;
977   this_ppu->data_latch = 0;
978   this_ppu->tile_page = 0;
979   this_ppu->sprite_page = 0;
980   this_ppu->back_color = 0;
965981
966982   /* initialize the color tables */
967983   {
968      int color_base = intf->color_base[num];
984      int color_base = intf->color_base;
969985
970986      for( i = 0; i < ARRAY_LENGTH( default_colortable_mono ); i++ )
971987      {
972988         /* monochromatic table */
973         chips[num].colortable_mono[i] = default_colortable_mono[i] + color_base;
989         this_ppu->colortable_mono[i] = default_colortable_mono[i] + color_base;
974990
975991         /* color table */
976         chips[num].colortable[i] = default_colortable[i] + color_base;
992         this_ppu->colortable[i] = default_colortable[i] + color_base;
977993      }
978994   }
979995
980996   /* set the vram bank-switch values to the default */
981997   for( i = 0; i < 8; i++ )
982      chips[num].nes_vram[i] = i * 64;
998      this_ppu->nes_vram[i] = i * 64;
983999
984   if ( chips[num].has_videorom )
985      ppu2c0x_set_videorom_bank( num, 0, 8, 0, 512 );
1000   if ( this_ppu->has_videorom )
1001      ppu2c0x_set_videorom_bank( device, 0, 8, 0, 512 );
9861002}
9871003
9881004
r4499r4500
9911007 *  PPU Registers Read
9921008 *
9931009 *************************************/
994int ppu2c0x_r( const address_space *space, offs_t offset, int num )
1010
1011READ8_DEVICE_HANDLER( ppu2c0x_r )
9951012{
996   ppu2c0x_chip* this_ppu;
1013   ppu2c0x_chip *this_ppu = get_token(device);
9971014
998   /* check bounds */
999   if ( num >= intf->num )
1000   {
1001      logerror( "PPU %d(r): Attempting to access an unmapped chip\n", num );
1002      return 0;
1003   }
1004
1005   this_ppu = &chips[num];
1006
10071015   if ( offset >= PPU_MAX_REG )
10081016   {
1009      logerror( "PPU %d(r): Attempting to read past the chip\n", num );
1017      logerror( "PPU %s(r): Attempting to read past the chip\n", device->tag );
10101018      offset &= PPU_MAX_REG - 1;
10111019   }
10121020
r4499r4500
10411049            this_ppu->data_latch = this_ppu->buffered_data;
10421050
10431051         if ( ppu_latch )
1044            (*ppu_latch)( this_ppu->videomem_addr & 0x3fff );
1052            (*ppu_latch)( device, this_ppu->videomem_addr & 0x3fff );
10451053
10461054         if ( ( this_ppu->videomem_addr >= 0x2000 ) && ( this_ppu->videomem_addr <= 0x3fff ) )
10471055            this_ppu->buffered_data = this_ppu->ppu_page[ ( this_ppu->videomem_addr & 0xc00) >> 10][ this_ppu->videomem_addr & 0x3ff ];
r4499r4500
10641072 *  PPU Registers Write
10651073 *
10661074 *************************************/
1067void ppu2c0x_w( const address_space *space, offs_t offset, UINT8 data, int num )
1075
1076WRITE8_DEVICE_HANDLER( ppu2c0x_w )
10681077{
1069   ppu2c0x_chip* this_ppu;
1078   ppu2c0x_chip *this_ppu = get_token(device);
1079   const ppu2c0x_interface *intf = get_interface(device);
10701080   int color_base;
10711081
1072   /* check bounds */
1073   if ( num >= intf->num )
1074   {
1075      logerror( "PPU(w): Attempting to access an unmapped chip\n" );
1076      return;
1077   }
1082   color_base = intf->color_base;
10781083
1079   this_ppu = &chips[num];
1080   color_base = intf->color_base[num];
1081
10821084   if ( offset >= PPU_MAX_REG )
10831085   {
10841086      logerror( "PPU: Attempting to write past the chip\n" );
r4499r4500
10881090#ifdef MAME_DEBUG
10891091   if (this_ppu->scanline <= PPU_BOTTOM_VISIBLE_SCANLINE)
10901092   {
1091      const device_config *screen = space->machine->primary_screen;
1093      const device_config *screen = device->machine->primary_screen;
10921094      logerror("  PPU register %d write %02x during non-vblank scanline %d (MAME %d, beam pos: %d)\n", offset, data, this_ppu->scanline, video_screen_get_vpos(screen), video_screen_get_hpos(screen));
10931095   }
10941096#endif
r4499r4500
11881190            int tempAddr = this_ppu->videomem_addr & 0x3fff;
11891191
11901192            if ( ppu_latch )
1191               (*ppu_latch)( tempAddr );
1193               (*ppu_latch)( device, tempAddr );
11921194
11931195            /* if there's a callback, call it now */
11941196            if ( this_ppu->vidaccess_callback_proc )
1195               data = (*this_ppu->vidaccess_callback_proc)( space->machine, num, tempAddr, data );
1197               data = (*this_ppu->vidaccess_callback_proc)( device, tempAddr, data );
11961198
11971199            /* see if it's on the chargen portion */
11981200            if ( tempAddr < 0x2000 )
r4499r4500
12101212                  this_ppu->videomem[tempAddr] = data;
12111213
12121214                  /* mark the char dirty */
1213                  gfx_element_mark_dirty(this_ppu->machine->gfx[intf->gfx_layout_number[num]], tempAddr >> 4);
1215                  gfx_element_mark_dirty(device->machine->gfx[intf->gfx_layout_number], tempAddr >> 4);
12141216               }
12151217            }
12161218
r4499r4500
12771279 *  Sprite DMA
12781280 *
12791281 *************************************/
1280void ppu2c0x_spriteram_dma (const address_space *space, int num, const UINT8 page)
1282void ppu2c0x_spriteram_dma (const address_space *space, const device_config *device, const UINT8 page)
12811283{
12821284   int i;
12831285   int address = page << 8;
12841286
1285   /* check bounds */
1286   if ( num >= intf->num )
1287   {
1288      logerror( "PPU(w): Attempting to access an unmapped chip\n" );
1289      return;
1290   }
1291
1292//logerror("   sprite DMA: %d (scanline: %d)\n", page, chips[num].scanline);
1287//logerror("   sprite DMA: %d (scanline: %d)\n", page, this_ppu->scanline);
12931288   for (i = 0; i < SPRITERAM_SIZE; i++)
12941289   {
12951290      UINT8 spriteData = memory_read_byte(space, address + i);
1296      ppu2c0x_w (space, PPU_SPRITE_DATA, spriteData, num);
1291      ppu2c0x_w (device, PPU_SPRITE_DATA, spriteData);
12971292   }
12981293
12991294   // should last 513 CPU cycles.
r4499r4500
13041299   // the scanline timers should catch us up before drawing actually happens.
13051300#if 0
13061301{
1307   ppu2c0x_chip* this_ppu = &chips[num];
1308
1309   scanline_callback(this_ppu->machine, num);
1310   scanline_callback(this_ppu->machine, num);
1311   scanline_callback(this_ppu->machine, num);
1312   scanline_callback(this_ppu->machine, num);
1302   scanline_callback(device);
1303   scanline_callback(device);
1304   scanline_callback(device);
1305   scanline_callback(device);
13131306}
13141307#endif
13151308}
r4499r4500
13191312 *  PPU Rendering
13201313 *
13211314 *************************************/
1322void ppu2c0x_render( int num, bitmap_t *bitmap, int flipx, int flipy, int sx, int sy )
1323{
1324   /* check bounds */
1325   if ( num >= intf->num )
1326   {
1327      logerror( "PPU(render): Attempting to access an unmapped chip\n" );
1328      return;
1329   }
13301315
1331   copybitmap( bitmap, chips[num].bitmap, flipx, flipy, sx, sy, 0 );
1316void ppu2c0x_render( const device_config *device, bitmap_t *bitmap, int flipx, int flipy, int sx, int sy )
1317{
1318   ppu2c0x_chip *this_ppu = get_token(device);
1319   copybitmap( bitmap, this_ppu->bitmap, flipx, flipy, sx, sy, 0 );
13321320}
13331321
13341322/*************************************
r4499r4500
13361324 *  PPU VideoROM banking
13371325 *
13381326 *************************************/
1339void ppu2c0x_set_videorom_bank( int num, int start_page, int num_pages, int bank, int bank_size )
1327void ppu2c0x_set_videorom_bank( const device_config *device, int start_page, int num_pages, int bank, int bank_size )
13401328{
1329   ppu2c0x_chip *this_ppu = get_token(device);
1330   const ppu2c0x_interface *intf = get_interface(device);
13411331   int i;
13421332
1343   /* check bounds */
1344   if ( num >= intf->num )
1333   if ( !this_ppu->has_videorom )
13451334   {
1346      logerror( "PPU(set vrom bank): Attempting to access an unmapped chip\n" );
1347      return;
1348   }
1349
1350   if ( !chips[num].has_videorom )
1351   {
13521335      logerror( "PPU(set vrom bank): Attempting to switch videorom banks and no rom is mapped\n" );
13531336      return;
13541337   }
13551338
1356   bank &= ( chips[num].videorom_banks * ( CHARGEN_NUM_CHARS / bank_size ) ) - 1;
1339   bank &= ( this_ppu->videorom_banks * ( CHARGEN_NUM_CHARS / bank_size ) ) - 1;
13571340
1358   if (chips[num].has_videoram)
1341   if (this_ppu->has_videoram)
13591342   {
13601343      for ( i = start_page; i < start_page + num_pages; i++ )
13611344      {
13621345         int elemnum;
13631346
1364         if ( chips[num].videoram_banks_indices[i] != -1 )
1347         if ( this_ppu->videoram_banks_indices[i] != -1 )
13651348         {
1366            memcpy( &chips[num].videoram[chips[num].videoram_banks_indices[i]*0x400], &chips[num].videomem[i*0x400], 0x400);
1349            memcpy( &this_ppu->videoram[this_ppu->videoram_banks_indices[i]*0x400], &this_ppu->videomem[i*0x400], 0x400);
13671350         }
1368         chips[num].videoram_banks_indices[i] = -1;
1351         this_ppu->videoram_banks_indices[i] = -1;
13691352         for (elemnum = 0; elemnum < (num_pages*0x400 >> 4); elemnum++)
1370            gfx_element_mark_dirty(chips[num].machine->gfx[intf->gfx_layout_number[num]], (start_page*0x400 >> 4) + elemnum);
1353            gfx_element_mark_dirty(device->machine->gfx[intf->gfx_layout_number], (start_page*0x400 >> 4) + elemnum);
13711354      }
13721355   }
13731356   else
13741357   {
13751358      for( i = start_page; i < ( start_page + num_pages ); i++ )
1376         chips[num].nes_vram[i] = bank * bank_size + 64 * ( i - start_page );
1359         this_ppu->nes_vram[i] = bank * bank_size + 64 * ( i - start_page );
13771360   }
13781361
13791362   {
r4499r4500
13811364      int count = num_pages * 0x400;
13821365      int rom_start = bank * bank_size * 16;
13831366
1384      memcpy( &chips[num].videomem[vram_start], &memory_region( chips[num].machine, intf->vrom_region[num] )[rom_start], count );
1367      memcpy( &this_ppu->videomem[vram_start], &memory_region( device->machine, intf->vrom_region )[rom_start], count );
13851368   }
13861369}
13871370
r4499r4500
13901373 *  PPU VideoRAM banking
13911374 *
13921375 *************************************/
1393void ppu2c0x_set_videoram_bank( int num, int start_page, int num_pages, int bank, int bank_size )
1376
1377void ppu2c0x_set_videoram_bank( const device_config *device, int start_page, int num_pages, int bank, int bank_size )
13941378{
1379   ppu2c0x_chip *this_ppu = get_token(device);
1380   const ppu2c0x_interface *intf = get_interface(device);
13951381   int i;
13961382
1397   /* check bounds */
1398   if ( num >= intf->num )
1383   if ( !this_ppu->has_videoram )
13991384   {
1400      logerror( "PPU(set vrom bank): Attempting to access an unmapped chip\n" );
1401      return;
1402   }
1403
1404   if ( !chips[num].has_videoram )
1405   {
14061385      logerror( "PPU(set vram bank): Attempting to switch videoram banks and no ram is mapped\n" );
14071386      return;
14081387   }
r4499r4500
14121391   for ( i = start_page; i < start_page + num_pages; i++ )
14131392   {
14141393      int elemnum;
1415      if ( chips[num].videoram_banks_indices[i] != -1 )
1394      if ( this_ppu->videoram_banks_indices[i] != -1 )
14161395      {
1417         memcpy( &chips[num].videoram[chips[num].videoram_banks_indices[i]*0x400], &chips[num].videomem[i*0x400], 0x400);
1396         memcpy( &this_ppu->videoram[this_ppu->videoram_banks_indices[i]*0x400], &this_ppu->videomem[i*0x400], 0x400);
14181397      }
1419      chips[num].videoram_banks_indices[i] = (bank * bank_size * 16)/0x400 + (i - start_page);
1398      this_ppu->videoram_banks_indices[i] = (bank * bank_size * 16)/0x400 + (i - start_page);
14201399      for (elemnum = 0; elemnum < (num_pages*0x400 >> 4); elemnum++)
1421         gfx_element_mark_dirty(chips[num].machine->gfx[intf->gfx_layout_number[num]], (start_page*0x400 >> 4) + elemnum);
1400         gfx_element_mark_dirty(device->machine->gfx[intf->gfx_layout_number], (start_page*0x400 >> 4) + elemnum);
14221401   }
14231402
14241403   {
r4499r4500
14271406      int ram_start = bank * bank_size * 16;
14281407
14291408      logerror( "ppu2c0x_set_videoram_bank: vram_start = %04x, count = %04x, ram_start = %04x\n", vram_start, count, ram_start );
1430      memcpy( &chips[num].videomem[vram_start], &chips[num].videoram[ram_start], count );
1409      memcpy( &this_ppu->videomem[vram_start], &this_ppu->videoram[ram_start], count );
14311410   }
14321411}
14331412
r4499r4500
14361415 *  Utility functions
14371416 *
14381417 *************************************/
1439int ppu2c0x_get_pixel( int num, int x, int y )
1418
1419int ppu2c0x_get_pixel( const device_config *device, int x, int y )
14401420{
1441   /* check bounds */
1442   if ( num >= intf->num )
1443   {
1444      logerror( "PPU(get_pixel): Attempting to access an unmapped chip\n" );
1445      return 0;
1446   }
1421   ppu2c0x_chip *this_ppu = get_token(device);
14471422
14481423   if ( x >= VISIBLE_SCREEN_WIDTH )
14491424      x = VISIBLE_SCREEN_WIDTH - 1;
r4499r4500
14511426   if ( y >= VISIBLE_SCREEN_HEIGHT )
14521427      y = VISIBLE_SCREEN_HEIGHT - 1;
14531428
1454   return *BITMAP_ADDR16(chips[num].bitmap, y, x);
1429   return *BITMAP_ADDR16(this_ppu->bitmap, y, x);
14551430}
14561431
1457int ppu2c0x_get_colorbase( int num )
1432int ppu2c0x_get_colorbase( const device_config *device )
14581433{
1459   /* check bounds */
1460   if ( num >= intf->num )
1461   {
1462      logerror( "PPU(get_colorbase): Attempting to access an unmapped chip\n" );
1463      return 0;
1464   }
1465
1466   return intf->color_base[num];
1434   const ppu2c0x_interface *intf = get_interface(device);
1435   return intf->color_base;
14671436}
14681437
1469int ppu2c0x_get_current_scanline( int num )
1438int ppu2c0x_get_current_scanline( const device_config *device )
14701439{
1471   /* check bounds */
1472   if ( num >= intf->num )
1473   {
1474      logerror( "PPU(get_colorbase): Attempting to access an unmapped chip\n" );
1475      return 0;
1476   }
1477
1478   return chips[num].scanline;
1440   ppu2c0x_chip *this_ppu = get_token(device);
1441   return this_ppu->scanline;
14791442}
14801443
1481void ppu2c0x_set_mirroring( int num, int mirroring )
1444void ppu2c0x_set_mirroring( const device_config *device, int mirroring )
14821445{
1483   ppu2c0x_chip* this_ppu;
1446   ppu2c0x_chip *this_ppu = get_token(device);
14841447
1485   /* check bounds */
1486   if ( num >= intf->num )
1487   {
1488      logerror( "PPU %d: Attempting to access an unmapped chip\n", num );
1489      return;
1490   }
1491
1492   this_ppu = &chips[num];
1493
14941448   // Once we've set 4-screen mirroring, do not change. Some games
14951449   // (notably Gauntlet) use mappers that can change the mirroring
14961450   // state, but are also hard-coded for 4-screen VRAM.
r4499r4500
15411495   this_ppu->mirror_state = mirroring;
15421496}
15431497
1544#ifdef UNUSED_FUNCTION
1545void ppu2c0x_set_nmi_callback( int num, ppu2c0x_nmi_cb cb )
1498void ppu2c0x_set_scanline_callback( const device_config *device, ppu2c0x_scanline_cb cb )
15461499{
1547   /* check bounds */
1548   if ( num >= intf->num )
1549   {
1550      logerror( "PPU(set_nmi_callback): Attempting to access an unmapped chip\n" );
1551      return;
1552   }
1500   ppu2c0x_chip *this_ppu = get_token(device);
1501   this_ppu->scanline_callback_proc = cb;
1502}
15531503
1554   intf->nmi_handler[num] = cb;
1504void ppu2c0x_set_hblank_callback( const device_config *device, ppu2c0x_hblank_cb cb )
1505{
1506   ppu2c0x_chip *this_ppu = get_token(device);
1507   this_ppu->hblank_callback_proc = cb;
15551508}
1556#endif
15571509
1558void ppu2c0x_set_scanline_callback( int num, ppu2c0x_scanline_cb cb )
1510void ppu2c0x_set_vidaccess_callback( const device_config *device, ppu2c0x_vidaccess_cb cb )
15591511{
1560   /* check bounds */
1561   if ( num >= intf->num )
1562   {
1563      logerror( "PPU(set_scanline_callback): Attempting to access an unmapped chip\n" );
1564      return;
1565   }
1512   ppu2c0x_chip *this_ppu = get_token(device);
1513   this_ppu->vidaccess_callback_proc = cb;
1514}
15661515
1567   chips[num].scanline_callback_proc = cb;
1516void ppu2c0x_set_scanlines_per_frame( const device_config *device, int scanlines )
1517{
1518   ppu2c0x_chip *this_ppu = get_token(device);
1519   this_ppu->scanlines_per_frame = scanlines;
15681520}
15691521
1570void ppu2c0x_set_hblank_callback( int num, ppu2c0x_hblank_cb cb )
1522
1523/***************************************************************************
1524    GET INFO FUNCTIONS
1525***************************************************************************/
1526
1527DEVICE_GET_INFO(ppu2c02)
15711528{
1572   /* check bounds */
1573   if ( num >= intf->num )
1529   switch (state)
15741530   {
1575      logerror( "PPU(set_scanline_callback): Attempting to access an unmapped chip\n" );
1576      return;
1577   }
1531      /* --- the following bits of info are returned as 64-bit signed integers --- */
1532      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(ppu2c0x_chip);            break;
1533      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0;                        break;
1534      case DEVINFO_INT_CLASS:                     info->i = DEVICE_CLASS_PERIPHERAL;         break;
1535      case PPU2C0XINFO_INT_SCANLINES_PER_FRAME:      info->i = PPU_NTSC_SCANLINES_PER_FRAME;      break;
15781536
1579   chips[num].hblank_callback_proc = cb;
1537      /* --- the following bits of info are returned as pointers to data or functions --- */
1538      case DEVINFO_FCT_SET_INFO:                  /* Nothing */                        break;
1539      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(ppu2c0x);   break;
1540      case DEVINFO_FCT_STOP:                     /* Nothing */                        break;
1541      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(ppu2c0x);   break;
1542
1543      /* --- the following bits of info are returned as NULL-terminated strings --- */
1544      case DEVINFO_STR_NAME:                     strcpy(info->s, "2C02 PPU");            break;
1545      case DEVINFO_STR_FAMILY:                  strcpy(info->s, "2C0X PPU");            break;
1546      case DEVINFO_STR_VERSION:                  strcpy(info->s, "1.0");                  break;
1547      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);               break;
1548      case DEVINFO_STR_CREDITS:                  /* Nothing */                        break;
1549   }
15801550}
15811551
1582void ppu2c0x_set_vidaccess_callback( int num, ppu2c0x_vidaccess_cb cb )
1552DEVICE_GET_INFO(ppu2c03b)
15831553{
1584   /* check bounds */
1585   if ( num >= intf->num )
1554   switch (state)
15861555   {
1587      logerror( "PPU(set_vidaccess_callback): Attempting to access an unmapped chip\n" );
1588      return;
1556      case DEVINFO_STR_NAME:                     strcpy(info->s, "2C02B PPU");            break;
1557      case PPU2C0XINFO_INT_SCANLINES_PER_FRAME:      info->i = PPU_NTSC_SCANLINES_PER_FRAME;      break;
1558      default:                               DEVICE_GET_INFO_CALL(ppu2c02);            break;
15891559   }
1590
1591   chips[num].vidaccess_callback_proc = cb;
15921560}
15931561
1594void ppu2c0x_set_scanlines_per_frame( int num, int scanlines )
1562DEVICE_GET_INFO(ppu2c04)
15951563{
1596   /* check bounds */
1597   if ( num >= intf->num )
1564   switch (state)
15981565   {
1599      logerror( "PPU(set_scanlines_per_frame): Attempting to access an unmapped chip\n" );
1600      return;
1566      case DEVINFO_STR_NAME:                     strcpy(info->s, "2C04 PPU");            break;
1567      case PPU2C0XINFO_INT_SCANLINES_PER_FRAME:      info->i = PPU_NTSC_SCANLINES_PER_FRAME;      break;
1568      default:                               DEVICE_GET_INFO_CALL(ppu2c02);            break;
16011569   }
1602
1603   chips[num].scanlines_per_frame = scanlines;
16041570}
16051571
1606/*************************************
1607 *
1608 *  Accesors
1609 *
1610 *************************************/
1611
1612READ8_HANDLER( ppu2c0x_0_r )
1572DEVICE_GET_INFO(ppu2c05)
16131573{
1614   return ppu2c0x_r( space, offset, 0 );
1574   switch (state)
1575   {
1576      case DEVINFO_STR_NAME:                     strcpy(info->s, "2C05 PPU");            break;
1577      case PPU2C0XINFO_INT_SCANLINES_PER_FRAME:      info->i = PPU_NTSC_SCANLINES_PER_FRAME;      break;
1578      default:                               DEVICE_GET_INFO_CALL(ppu2c02);            break;
1579   }
16151580}
16161581
1617READ8_HANDLER( ppu2c0x_1_r )
1582DEVICE_GET_INFO(ppu2c07)
16181583{
1619   return ppu2c0x_r( space, offset, 1 );
1584   switch (state)
1585   {
1586      case DEVINFO_STR_NAME:                     strcpy(info->s, "2C07 PPU");            break;
1587      case PPU2C0XINFO_INT_SCANLINES_PER_FRAME:      info->i = PPU_PAL_SCANLINES_PER_FRAME;      break;
1588      default:                               DEVICE_GET_INFO_CALL(ppu2c02);            break;
1589   }
16201590}
1621
1622WRITE8_HANDLER( ppu2c0x_0_w )
1623{
1624   ppu2c0x_w( space, offset, data, 0 );
1625}
1626
1627WRITE8_HANDLER( ppu2c0x_1_w )
1628{
1629   ppu2c0x_w( space, offset, data, 1 );
1630}
src/mame/video/ppu2c0x.h
r4499r4500
66    This code is heavily based on Brad Oliver's MESS implementation.
77
88******************************************************************************/
9
910#ifndef __PPU_2C03B_H__
1011#define __PPU_2C03B_H__
1112
12/* increment to use more chips */
13#define MAX_PPU 2
1413
14/***************************************************************************
15    CONSTANTS
16***************************************************************************/
17
1518/* mirroring types */
1619#define PPU_MIRROR_NONE      0
1720#define PPU_MIRROR_VERT      1
r4499r4500
6972   // are non-rendering and non-vblank.
7073};
7174
72typedef enum
73{
74   PPU_2C02,   // NTSC NES
75   PPU_2C03B,   // Playchoice 10
76   PPU_2C04,   // Vs. Unisystem
77   PPU_2C05,   // Vs. Unisystem, Famicom Titler
78   PPU_2C07   // PAL NES
79} ppu_t;
75#define PPU_2C02   DEVICE_GET_INFO_NAME(ppu2c02)   // NTSC NES
76#define PPU_2C03B   DEVICE_GET_INFO_NAME(ppu2c03b)   // Playchoice 10
77#define PPU_2C04   DEVICE_GET_INFO_NAME(ppu2c04)   // Vs. Unisystem
78#define PPU_2C05   DEVICE_GET_INFO_NAME(ppu2c05)   // Vs. Unisystem, Famicom Titler
79#define PPU_2C07   DEVICE_GET_INFO_NAME(ppu2c07)   // PAL NES
8080
8181/* callback datatypes */
82typedef void (*ppu2c0x_scanline_cb)( running_machine *machine, int num, int scanline, int vblank, int blanked );
83typedef void (*ppu2c0x_hblank_cb)( running_machine *machine, int num, int scanline, int vblank, int blanked );
84typedef void (*ppu2c0x_nmi_cb)( running_machine *machine, int num, int *ppu_regs );
85typedef int  (*ppu2c0x_vidaccess_cb)( running_machine *machine, int num, int address, int data );
82typedef void (*ppu2c0x_scanline_cb)( const device_config *device, int scanline, int vblank, int blanked );
83typedef void (*ppu2c0x_hblank_cb)( const device_config *device, int scanline, int vblank, int blanked );
84typedef void (*ppu2c0x_nmi_cb)( const device_config *device, int *ppu_regs );
85typedef int  (*ppu2c0x_vidaccess_cb)( const device_config *device, int address, int data );
8686
8787typedef struct _ppu2c0x_interface ppu2c0x_interface;
8888struct _ppu2c0x_interface
8989{
90   ppu_t         type;                     // model/version of the PPU
91   int            num;                     /* number of chips ( 1 to MAX_PPU ) */
92   const char *   vrom_region[MAX_PPU];         /* region id of gfx vrom (or REGION_INVALID if none) */
93   int            gfx_layout_number[MAX_PPU];      /* gfx layout number used by each chip */
94   int            color_base[MAX_PPU];         /* color base to use per ppu */
95   int            mirroring[MAX_PPU];            /* mirroring options (PPU_MIRROR_* flag) */
96   ppu2c0x_nmi_cb   nmi_handler[MAX_PPU];         /* NMI handler */
97   int            vram_enabled[MAX_PPU];         /* PPU uses vram together with vrom */
90   const char *   vrom_region;         /* region id of gfx vrom (or REGION_INVALID if none) */
91   int            gfx_layout_number;      /* gfx layout number used by each chip */
92   int            color_base;            /* color base to use per ppu */
93   int            mirroring;            /* mirroring options (PPU_MIRROR_* flag) */
94   ppu2c0x_nmi_cb   nmi_handler;         /* NMI handler */
95   int            vram_enabled;         /* PPU uses vram together with vrom */
9896};
9997
98
99/***************************************************************************
100    PROTOTYPES
101***************************************************************************/
102
103DEVICE_GET_INFO(ppu2c02);
104DEVICE_GET_INFO(ppu2c03b);
105DEVICE_GET_INFO(ppu2c04);
106DEVICE_GET_INFO(ppu2c05);
107DEVICE_GET_INFO(ppu2c07);
108
100109/* routines */
101void ppu2c0x_init_palette(running_machine *machine, int first_entry );
102void ppu2c0x_init(running_machine *machine, const ppu2c0x_interface *interface );
110void ppu2c0x_init_palette(running_machine *machine, int first_entry ) ATTR_NONNULL(1);
103111
104void ppu2c0x_reset( running_machine *machine, int num, int scan_scale );
105void ppu2c0x_set_videorom_bank( int num, int start_page, int num_pages, int bank, int bank_size );
106void ppu2c0x_set_videoram_bank( int num, int start_page, int num_pages, int bank, int bank_size );
107void ppu2c0x_spriteram_dma(const address_space *space, int num, const UINT8 page );
108void ppu2c0x_render( int num, bitmap_t *bitmap, int flipx, int flipy, int sx, int sy );
109int ppu2c0x_get_pixel( int num, int x, int y );
110int ppu2c0x_get_colorbase( int num );
111int ppu2c0x_get_current_scanline( int num );
112void ppu2c0x_set_mirroring( int num, int mirroring );
113void ppu2c0x_set_scanline_callback( int num, ppu2c0x_scanline_cb cb );
114void ppu2c0x_set_hblank_callback( int num, ppu2c0x_scanline_cb cb );
115void ppu2c0x_set_vidaccess_callback( int num, ppu2c0x_vidaccess_cb cb );
116void ppu2c0x_set_scanlines_per_frame( int num, int scanlines );
112void ppu2c0x_set_videorom_bank( const device_config *device, int start_page, int num_pages, int bank, int bank_size ) ATTR_NONNULL(1);
113void ppu2c0x_set_videoram_bank( const device_config *device, int start_page, int num_pages, int bank, int bank_size ) ATTR_NONNULL(1);
114void ppu2c0x_spriteram_dma(const address_space *space, const device_config *device, const UINT8 page ) ATTR_NONNULL(1);
115void ppu2c0x_render( const device_config *device, bitmap_t *bitmap, int flipx, int flipy, int sx, int sy ) ATTR_NONNULL(1);
116int ppu2c0x_get_pixel( const device_config *device, int x, int y ) ATTR_NONNULL(1);
117int ppu2c0x_get_colorbase( const device_config *device ) ATTR_NONNULL(1);
118int ppu2c0x_get_current_scanline( const device_config *device ) ATTR_NONNULL(1);
119void ppu2c0x_set_mirroring( const device_config *device, int mirroring ) ATTR_NONNULL(1);
120void ppu2c0x_set_scanline_callback( const device_config *device, ppu2c0x_scanline_cb cb ) ATTR_NONNULL(1);
121void ppu2c0x_set_hblank_callback( const device_config *device, ppu2c0x_scanline_cb cb ) ATTR_NONNULL(1);
122void ppu2c0x_set_vidaccess_callback( const device_config *device, ppu2c0x_vidaccess_cb cb ) ATTR_NONNULL(1);
123void ppu2c0x_set_scanlines_per_frame( const device_config *device, int scanlines ) ATTR_NONNULL(1);
117124
118//27/12/2002
119extern void (*ppu_latch)( offs_t offset );
125//27/12/2002 (HACK!)
126extern void (*ppu_latch)( const device_config *device, offs_t offset );
120127
121void ppu2c0x_w( const address_space *space, offs_t offset, UINT8 data, int num );
122int ppu2c0x_r( const address_space *space, offs_t offset, int num );
128WRITE8_DEVICE_HANDLER( ppu2c0x_w );
129READ8_DEVICE_HANDLER( ppu2c0x_r );
123130
124/* accesors */
125READ8_HANDLER( ppu2c0x_0_r );
126READ8_HANDLER( ppu2c0x_1_r );
127131
128WRITE8_HANDLER( ppu2c0x_0_w );
129WRITE8_HANDLER( ppu2c0x_1_w );
132/***************************************************************************
133    DEVICE CONFIGURATION MACROS
134***************************************************************************/
130135
136#define MDRV_PPU2C02_ADD(_tag, _intrf) \
137   MDRV_DEVICE_ADD(_tag, PPU_2C02, 0) \
138   MDRV_DEVICE_CONFIG(_intrf)
139
140#define MDRV_PPU2C03B_ADD(_tag, _intrf) \
141   MDRV_DEVICE_ADD(_tag, PPU_2C03B, 0) \
142   MDRV_DEVICE_CONFIG(_intrf)
143
144#define MDRV_PPU2C04_ADD(_tag, _intrf) \
145   MDRV_DEVICE_ADD(_tag, PPU_2C04, 0) \
146   MDRV_DEVICE_CONFIG(_intrf)
147
148#define MDRV_PPU2C05_ADD(_tag, _intrf) \
149   MDRV_DEVICE_ADD(_tag, PPU_2C05, 0) \
150   MDRV_DEVICE_CONFIG(_intrf)
151
152#define MDRV_PPU2C07_ADD(_tag, _intrf) \
153   MDRV_DEVICE_ADD(_tag, PPU_2C07, 0) \
154   MDRV_DEVICE_CONFIG(_intrf)
155
131156#endif /* __PPU_2C0X_H__ */
src/mame/video/taito_f2.c
r4499r4500
243243   taitof2_core_vh_start(machine, 0,3,3,0,0,0,0,0,0);
244244}
245245
246VIDEO_START( taitof2_deadconj )
246VIDEO_START( taitof2_deadconxj )
247247{
248248   f2_tilemap_xoffs = 0x34;
249249   f2_tilemap_yoffs = - 0x05;
src/mame/drivers/system1.c
r4499r4500
44
55driver by Jarek Parchanski, Nicola Salmoria, Mirko Buffoni
66
7
8Issues:
9 * pitfall2 - missing title
10
11
127Up'n Down, Mister Viking, Flicky, SWAT, Water Match and Bull Fight are known
138to run on IDENTICAL hardware (they were sold by Bally-Midway as ROM swaps).
149
r4499r4500
233228    count is 11, which means the clock is divided by 5.
234229
235230    To account for this, we install custom cycle tables for the Z80. We clock the Z80
236    at 20MHz and count 5 cycles for each original Z80 cycle, plus an extra cycle for
237    each opcode fetch.
231    at 20MHz and count 5 cycles for each original Z80 cycle, plus an extra 2 cycles for
232    each opcode fetch (since the M1 line is low for 2 cycles per byte).
238233*/
239234
240235static const UINT8 cc_op[0x100] = {
241 4*5+1,10*5+3, 7*5+1, 6*5+1, 4*5+1, 4*5+1, 7*5+2, 4*5+1, 4*5+1,11*5+1, 7*5+1, 6*5+1, 4*5+1, 4*5+1, 7*5+2, 4*5+1,
242 8*5+2,10*5+3, 7*5+1, 6*5+1, 4*5+1, 4*5+1, 7*5+2, 4*5+1,12*5+2,11*5+1, 7*5+1, 6*5+1, 4*5+1, 4*5+1, 7*5+2, 4*5+1,
243 7*5+2,10*5+3,16*5+3, 6*5+1, 4*5+1, 4*5+1, 7*5+2, 4*5+1, 7*5+2,11*5+1,16*5+3, 6*5+1, 4*5+1, 4*5+1, 7*5+2, 4*5+1,
244 7*5+2,10*5+3,13*5+3, 6*5+1,11*5+1,11*5+1,10*5+2, 4*5+1, 7*5+2,11*5+1,13*5+3, 6*5+1, 4*5+1, 4*5+1, 7*5+2, 4*5+1,
245 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 7*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 7*5+1, 4*5+1,
246 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 7*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 7*5+1, 4*5+1,
247 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 7*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 7*5+1, 4*5+1,
248 7*5+1, 7*5+1, 7*5+1, 7*5+1, 7*5+1, 7*5+1, 4*5+1, 7*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 7*5+1, 4*5+1,
249 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 7*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 7*5+1, 4*5+1,
250 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 7*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 7*5+1, 4*5+1,
251 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 7*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 7*5+1, 4*5+1,
252 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 7*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 4*5+1, 7*5+1, 4*5+1,
253 5*5+1,10*5+1,10*5+3,10*5+3,10*5+3,11*5+1, 7*5+2,11*5+1, 5*5+1,10*5+1,10*5+3, 0*5+1,10*5+3,17*5+3, 7*5+2,11*5+1,
254 5*5+1,10*5+1,10*5+3,11*5+2,10*5+3,11*5+1, 7*5+2,11*5+1, 5*5+1, 4*5+1,10*5+3,11*5+2,10*5+3, 0*5  , 7*5+2,11*5+1,
255 5*5+1,10*5+1,10*5+3,19*5+1,10*5+3,11*5+1, 7*5+2,11*5+1, 5*5+1, 4*5+1,10*5+3, 4*5+1,10*5+3, 0*5  , 7*5+2,11*5+1,
256 5*5+1,10*5+1,10*5+3, 4*5+1,10*5+3,11*5+1, 7*5+2,11*5+1, 5*5+1, 6*5+1,10*5+3, 4*5+1,10*5+3, 0*5  , 7*5+2,11*5+1};
236 4*5+1*2,10*5+3*2, 7*5+1*2, 6*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+2*2, 4*5+1*2, 4*5+1*2,11*5+1*2, 7*5+1*2, 6*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+2*2, 4*5+1*2,
237 8*5+2*2,10*5+3*2, 7*5+1*2, 6*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+2*2, 4*5+1*2,12*5+2*2,11*5+1*2, 7*5+1*2, 6*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+2*2, 4*5+1*2,
238 7*5+2*2,10*5+3*2,16*5+3*2, 6*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+2*2, 4*5+1*2, 7*5+2*2,11*5+1*2,16*5+3*2, 6*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+2*2, 4*5+1*2,
239 7*5+2*2,10*5+3*2,13*5+3*2, 6*5+1*2,11*5+1*2,11*5+1*2,10*5+2*2, 4*5+1*2, 7*5+2*2,11*5+1*2,13*5+3*2, 6*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+2*2, 4*5+1*2,
240 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+1*2, 4*5+1*2,
241 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+1*2, 4*5+1*2,
242 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+1*2, 4*5+1*2,
243 7*5+1*2, 7*5+1*2, 7*5+1*2, 7*5+1*2, 7*5+1*2, 7*5+1*2, 4*5+1*2, 7*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+1*2, 4*5+1*2,
244 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+1*2, 4*5+1*2,
245 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+1*2, 4*5+1*2,
246 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+1*2, 4*5+1*2,
247 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+1*2, 4*5+1*2,
248 5*5+1*2,10*5+1*2,10*5+3*2,10*5+3*2,10*5+3*2,11*5+1*2, 7*5+2*2,11*5+1*2, 5*5+1*2,10*5+1*2,10*5+3*2, 0*5+1*2,10*5+3*2,17*5+3*2, 7*5+2*2,11*5+1*2,
249 5*5+1*2,10*5+1*2,10*5+3*2,11*5+2*2,10*5+3*2,11*5+1*2, 7*5+2*2,11*5+1*2, 5*5+1*2, 4*5+1*2,10*5+3*2,11*5+2*2,10*5+3*2, 0*5    , 7*5+2*2,11*5+1*2,
250 5*5+1*2,10*5+1*2,10*5+3*2,19*5+1*2,10*5+3*2,11*5+1*2, 7*5+2*2,11*5+1*2, 5*5+1*2, 4*5+1*2,10*5+3*2, 4*5+1*2,10*5+3*2, 0*5    , 7*5+2*2,11*5+1*2,
251 5*5+1*2,10*5+1*2,10*5+3*2, 4*5+1*2,10*5+3*2,11*5+1*2, 7*5+2*2,11*5+1*2, 5*5+1*2, 6*5+1*2,10*5+3*2, 4*5+1*2,10*5+3*2, 0*5    , 7*5+2*2,11*5+1*2};
257252
258253static const UINT8 cc_cb[0x100] = {
259 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,15*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,15*5+2, 8*5+2,
260 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,15*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,15*5+2, 8*5+2,
261 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,15*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,15*5+2, 8*5+2,
262 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,15*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,15*5+2, 8*5+2,
263 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,12*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,12*5+2, 8*5+2,
264 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,12*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,12*5+2, 8*5+2,
265 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,12*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,12*5+2, 8*5+2,
266 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,12*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,12*5+2, 8*5+2,
267 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,15*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,15*5+2, 8*5+2,
268 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,15*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,15*5+2, 8*5+2,
269 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,15*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,15*5+2, 8*5+2,
270 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,15*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,15*5+2, 8*5+2,
271 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,15*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,15*5+2, 8*5+2,
272 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,15*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,15*5+2, 8*5+2,
273 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,15*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,15*5+2, 8*5+2,
274 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,15*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,15*5+2, 8*5+2};
254 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2,
255 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2,
256 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2,
257 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2,
258 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,12*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,12*5+2*2, 8*5+2*2,
259 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,12*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,12*5+2*2, 8*5+2*2,
260 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,12*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,12*5+2*2, 8*5+2*2,
261 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,12*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,12*5+2*2, 8*5+2*2,
262 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2,
263 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2,
264 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2,
265 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2,
266 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2,
267 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2,
268 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2,
269 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2};
275270
276271static const UINT8 cc_ed[0x100] = {
277 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,
278 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,
279 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,
280 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,
28112*5+2,12*5+2,15*5+2,20*5+4, 8*5+2,14*5+2, 8*5+2, 9*5+2,12*5+2,12*5+2,15*5+2,20*5+4, 8*5+2,14*5+2, 8*5+2, 9*5+2,
28212*5+2,12*5+2,15*5+2,20*5+4, 8*5+2,14*5+2, 8*5+2, 9*5+2,12*5+2,12*5+2,15*5+2,20*5+4, 8*5+2,14*5+2, 8*5+2, 9*5+2,
28312*5+2,12*5+2,15*5+2,20*5+4, 8*5+2,14*5+2, 8*5+2,18*5+2,12*5+2,12*5+2,15*5+2,20*5+4, 8*5+2,14*5+2, 8*5+2,18*5+2,
28412*5+2,12*5+2,15*5+2,20*5+4, 8*5+2,14*5+2, 8*5+2, 8*5+2,12*5+2,12*5+2,15*5+2,20*5+4, 8*5+2,14*5+2, 8*5+2, 8*5+2,
285 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,
286 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,
28716*5+2,16*5+2,16*5+2,16*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,16*5+2,16*5+2,16*5+2,16*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,
28816*5+2,16*5+2,16*5+2,16*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,16*5+2,16*5+2,16*5+2,16*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,
289 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,
290 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,
291 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2,
292 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2, 8*5+2};
272 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,
273 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,
274 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,
275 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,
27612*5+2*2,12*5+2*2,15*5+2*2,20*5+4*2, 8*5+2*2,14*5+2*2, 8*5+2*2, 9*5+2*2,12*5+2*2,12*5+2*2,15*5+2*2,20*5+4*2, 8*5+2*2,14*5+2*2, 8*5+2*2, 9*5+2*2,
27712*5+2*2,12*5+2*2,15*5+2*2,20*5+4*2, 8*5+2*2,14*5+2*2, 8*5+2*2, 9*5+2*2,12*5+2*2,12*5+2*2,15*5+2*2,20*5+4*2, 8*5+2*2,14*5+2*2, 8*5+2*2, 9*5+2*2,
27812*5+2*2,12*5+2*2,15*5+2*2,20*5+4*2, 8*5+2*2,14*5+2*2, 8*5+2*2,18*5+2*2,12*5+2*2,12*5+2*2,15*5+2*2,20*5+4*2, 8*5+2*2,14*5+2*2, 8*5+2*2,18*5+2*2,
27912*5+2*2,12*5+2*2,15*5+2*2,20*5+4*2, 8*5+2*2,14*5+2*2, 8*5+2*2, 8*5+2*2,12*5+2*2,12*5+2*2,15*5+2*2,20*5+4*2, 8*5+2*2,14*5+2*2, 8*5+2*2, 8*5+2*2,
280 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,
281 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,
28216*5+2*2,16*5+2*2,16*5+2*2,16*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,16*5+2*2,16*5+2*2,16*5+2*2,16*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,
28316*5+2*2,16*5+2*2,16*5+2*2,16*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,16*5+2*2,16*5+2*2,16*5+2*2,16*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,
284 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,
285 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,
286 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,
287 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2};
293288
294289static const UINT8 cc_xy[0x100] = {
295 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2,15*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2,
296 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2,15*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2,
297 4*5+2,14*5+4,20*5+4,10*5+2, 9*5+2, 9*5+2, 9*5+3, 4*5+2, 4*5+2,15*5+2,20*5+4,10*5+2, 9*5+2, 9*5+2, 9*5+3, 4*5+2,
298 4*5+2, 4*5+2, 4*5+2, 4*5+2,23*5+3,23*5+3,19*5+4, 4*5+2, 4*5+2,15*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2,
299 4*5+2, 4*5+2, 4*5+2, 4*5+2, 9*5+2, 9*5+2,19*5+3, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 9*5+2, 9*5+2,19*5+3, 4*5+2,
300 4*5+2, 4*5+2, 4*5+2, 4*5+2, 9*5+2, 9*5+2,19*5+3, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 9*5+2, 9*5+2,19*5+3, 4*5+2,
301 9*5+2, 9*5+2, 9*5+2, 9*5+2, 9*5+2, 9*5+2,19*5+2, 9*5+2, 9*5+2, 9*5+2, 9*5+2, 9*5+2, 9*5+2, 9*5+2,19*5+2, 9*5+2,
30219*5+3,19*5+3,19*5+3,19*5+3,19*5+3,19*5+3, 4*5+2,19*5+3, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 9*5+2, 9*5+2,19*5+3, 4*5+2,
303 4*5+2, 4*5+2, 4*5+2, 4*5+2, 9*5+2, 9*5+2,19*5+3, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 9*5+2, 9*5+2,19*5+3, 4*5+2,
304 4*5+2, 4*5+2, 4*5+2, 4*5+2, 9*5+2, 9*5+2,19*5+3, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 9*5+2, 9*5+2,19*5+3, 4*5+2,
305 4*5+2, 4*5+2, 4*5+2, 4*5+2, 9*5+2, 9*5+2,19*5+3, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 9*5+2, 9*5+2,19*5+3, 4*5+2,
306 4*5+2, 4*5+2, 4*5+2, 4*5+2, 9*5+2, 9*5+2,19*5+3, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 9*5+2, 9*5+2,19*5+3, 4*5+2,
307 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 0*5  , 4*5+2, 4*5+2, 4*5+2, 4*5+2,
308 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2,
309 4*5+2,14*5+2, 4*5+2,23*5+2, 4*5+2,15*5+2, 4*5+2, 4*5+2, 4*5+2, 8*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2,
310 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2,10*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2, 4*5+2};
290 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2,15*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2,
291 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2,15*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2,
292 4*5+2*2,14*5+4*2,20*5+4*2,10*5+2*2, 9*5+2*2, 9*5+2*2, 9*5+3*2, 4*5+2*2, 4*5+2*2,15*5+2*2,20*5+4*2,10*5+2*2, 9*5+2*2, 9*5+2*2, 9*5+3*2, 4*5+2*2,
293 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2,23*5+3*2,23*5+3*2,19*5+4*2, 4*5+2*2, 4*5+2*2,15*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2,
294 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 9*5+2*2, 9*5+2*2,19*5+3*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 9*5+2*2, 9*5+2*2,19*5+3*2, 4*5+2*2,
295 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 9*5+2*2, 9*5+2*2,19*5+3*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 9*5+2*2, 9*5+2*2,19*5+3*2, 4*5+2*2,
296 9*5+2*2, 9*5+2*2, 9*5+2*2, 9*5+2*2, 9*5+2*2, 9*5+2*2,19*5+2*2, 9*5+2*2, 9*5+2*2, 9*5+2*2, 9*5+2*2, 9*5+2*2, 9*5+2*2, 9*5+2*2,19*5+2*2, 9*5+2*2,
29719*5+3*2,19*5+3*2,19*5+3*2,19*5+3*2,19*5+3*2,19*5+3*2, 4*5+2*2,19*5+3*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 9*5+2*2, 9*5+2*2,19*5+3*2, 4*5+2*2,
298 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 9*5+2*2, 9*5+2*2,19*5+3*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 9*5+2*2, 9*5+2*2,19*5+3*2, 4*5+2*2,
299 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 9*5+2*2, 9*5+2*2,19*5+3*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 9*5+2*2, 9*5+2*2,19*5+3*2, 4*5+2*2,
300 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 9*5+2*2, 9*5+2*2,19*5+3*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 9*5+2*2, 9*5+2*2,19*5+3*2, 4*5+2*2,
301 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 9*5+2*2, 9*5+2*2,19*5+3*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 9*5+2*2, 9*5+2*2,19*5+3*2, 4*5+2*2,
302 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 0*5    , 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2,
303 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2,
304 4*5+2*2,14*5+2*2, 4*5+2*2,23*5+2*2, 4*5+2*2,15*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 8*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2,
305 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2,10*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2, 4*5+2*2};
311306
312307static const UINT8 cc_xycb[0x100] = {
31323*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,
31423*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,
31523*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,
31623*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,
31720*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,
31820*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,
31920*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,
32020*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,20*5+4,
32123*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,
32223*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,
32323*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,
32423*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,
32523*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,
32623*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,
32723*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,
32823*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4,23*5+4};
30823*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,
30923*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,
31023*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,
31123*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,
31220*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,
31320*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,
31420*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,
31520*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,
31623*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,
31723*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,
31823*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,
31923*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,
32023*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,
32123*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,
32223*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,
32323*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2};
329324
330325/* extra cycles if jr/jp/call taken and 'interrupt latency' on rst 0-7 */
331326static const UINT8 cc_ex[0x100] = {
r4499r4500
20222017   MDRV_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)   /* needed for proper hardware collisions */
20232018
20242019   MDRV_SCREEN_ADD("screen", RASTER)
2025   MDRV_SCREEN_REFRESH_RATE(60)
2026   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
20272020   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
2028   MDRV_SCREEN_SIZE(256, 256)
2029   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1)
2021   MDRV_SCREEN_RAW_PARAMS(MASTER_CLOCK/4, 320, 0, 256, 260, 0, 224)
20302022
20312023   MDRV_GFXDECODE(system1)
20322024   MDRV_PALETTE_LENGTH(2048)
r4499r4500
20782070
20792071
20802072
2081/* main CPU hacked speed */
2082static MACHINE_DRIVER_START( pitfall2 )
2083   MDRV_IMPORT_FROM( sys1pio )
2084
2085   /* basic machine hardware */
2086   MDRV_CPU_REPLACE( "maincpu", Z80, 3600000 )/* should be 4 MHz but that value makes the title screen disappear */
2087MACHINE_DRIVER_END
2088
20892073/* alternate program map with RAM/collision swapped */
20902074static MACHINE_DRIVER_START( nob )
2091   MDRV_IMPORT_FROM( sys1ppis )
2075   MDRV_IMPORT_FROM( sys1ppi )
20922076
20932077   /* basic machine hardware */
20942078   MDRV_CPU_MODIFY("maincpu")
r4499r4500
21062090   MDRV_VIDEO_UPDATE(system2)
21072091MACHINE_DRIVER_END
21082092
2109/* system 2 with small screen */
2110static MACHINE_DRIVER_START( sys2s )
2111   MDRV_IMPORT_FROM( sys2 )
2112
2113   /* video hardware */
2114   MDRV_SCREEN_MODIFY("screen")
2115   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 1*8, 27*8-1)
2116MACHINE_DRIVER_END
2117
21182093/* system2 with rowscroll */
21192094static MACHINE_DRIVER_START( sys2row )
21202095   MDRV_IMPORT_FROM( sys2 )
r4499r4500
21232098   MDRV_VIDEO_UPDATE(system2_rowscroll)
21242099MACHINE_DRIVER_END
21252100
2126/* rowscroll with small screen */
2127static MACHINE_DRIVER_START( sys2rows )
2128   MDRV_IMPORT_FROM( sys2row )
21292101
2130   /* video hardware */
2131   MDRV_SCREEN_MODIFY("screen")
2132   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 1*8, 27*8-1)
2133MACHINE_DRIVER_END
21342102
2135
2136
21372103/*************************************
21382104 *
21392105 *  ROM definition(s)
r4499r4500
21672133   ROM_LOAD( "epr-5319.93",   0x4000, 0x4000, CRC(ebee4999) SHA1(bb331be270dc1da63699533d9f02d73ce28f1bc5) )
21682134
21692135   ROM_REGION( 0x0100, "proms", 0 )
2170   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2136   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
21712137ROM_END
21722138
21732139ROM_START( starjacks )
r4499r4500
21952161   ROM_LOAD( "a1_ic93.93",   0x4000, 0x4000, CRC(07987244) SHA1(8468b95684b1f62c6de6af1b1d405bfb333e4e26) )
21962162
21972163   ROM_REGION( 0x0100, "proms", 0 )
2198   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2164   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
21992165ROM_END
22002166
22012167
r4499r4500
22242190   ROM_LOAD( "epr-5515.93",   0x4000, 0x4000, CRC(60908838) SHA1(aedff8ce07ab16942037e5aff212652e51c19e71) )
22252191
22262192   ROM_REGION( 0x0100, "proms", 0 )
2227   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2193   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
22282194ROM_END
22292195
22302196ROM_START( upndownu )
r4499r4500
22522218   ROM_LOAD( "epr-5515.93",   0x4000, 0x4000, CRC(60908838) SHA1(aedff8ce07ab16942037e5aff212652e51c19e71) )
22532219
22542220   ROM_REGION( 0x0100, "proms", 0 )
2255   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2221   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
22562222ROM_END
22572223
22582224
r4499r4500
22812247   ROM_LOAD( "epr-5639.93",   0x4000, 0x4000, CRC(a4ec5131) SHA1(033bf46d2625f99544a784fe3fa299cc1b1b48e1) )
22822248
22832249   ROM_REGION( 0x0100, "proms", 0 )
2284   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2250   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
22852251ROM_END
22862252
22872253ROM_START( reguluso )
r4499r4500
23092275   ROM_LOAD( "epr-5639.93",   0x4000, 0x4000, CRC(a4ec5131) SHA1(033bf46d2625f99544a784fe3fa299cc1b1b48e1) )
23102276
23112277   ROM_REGION( 0x0100, "proms", 0 )
2312   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2278   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
23132279ROM_END
23142280
23152281ROM_START( regulusu )
r4499r4500
23372303   ROM_LOAD( "epr-5639.93",   0x4000, 0x4000, CRC(a4ec5131) SHA1(033bf46d2625f99544a784fe3fa299cc1b1b48e1) )
23382304
23392305   ROM_REGION( 0x0100, "proms", 0 )
2340   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2306   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
23412307ROM_END
23422308
23432309
r4499r4500
23662332   ROM_LOAD( "epr-5750.93",   0x4000, 0x4000, CRC(6564d1ad) SHA1(f246afee7e73bc30054b0e5dcb83fa0edd2d2164) )
23672333
23682334   ROM_REGION( 0x0100, "proms", 0 )
2369   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2335   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
23702336ROM_END
23712337
23722338ROM_START( mrvikingj )
r4499r4500
23942360   ROM_LOAD( "epr-5750.93",   0x4000, 0x4000, CRC(6564d1ad) SHA1(f246afee7e73bc30054b0e5dcb83fa0edd2d2164) )
23952361
23962362   ROM_REGION( 0x0100, "proms", 0 )
2397   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2363   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
23982364ROM_END
23992365
24002366
r4499r4500
24232389   ROM_LOAD( "epr-5806.93",   0x4000, 0x4000, CRC(26ac258c) SHA1(e4e9f929ab8ae7da74f885481cf94335d7553a1c) )
24242390
24252391   ROM_REGION( 0x0100, "proms", 0 )
2426   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2392   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
24272393ROM_END
24282394
24292395
r4499r4500
24482414   ROM_LOAD( "epr-5856.110",   0x4000, 0x4000, CRC(266af78f) SHA1(dcbfce550d10a1f2b3ce3e7e081fc008cb575708) )
24492415
24502416   ROM_REGION( 0x0100, "proms", 0 )
2451   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2417   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
24522418ROM_END
24532419
24542420ROM_START( flickys2 )
r4499r4500
24722438   ROM_LOAD( "epr-5856.110",   0x4000, 0x4000, CRC(266af78f) SHA1(dcbfce550d10a1f2b3ce3e7e081fc008cb575708) )
24732439
24742440   ROM_REGION( 0x0100, "proms", 0 )
2475   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2441   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
24762442ROM_END
24772443
24782444ROM_START( flickys1 )
r4499r4500
24982464   ROM_LOAD( "epr-5856.110",   0x4000, 0x4000, CRC(266af78f) SHA1(dcbfce550d10a1f2b3ce3e7e081fc008cb575708) )
24992465
25002466   ROM_REGION( 0x0100, "proms", 0 )
2501   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2467   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
25022468ROM_END
25032469
25042470ROM_START( flickyo )
r4499r4500
25242490   ROM_LOAD( "epr-5856.110",   0x4000, 0x4000, CRC(266af78f) SHA1(dcbfce550d10a1f2b3ce3e7e081fc008cb575708) )
25252491
25262492   ROM_REGION( 0x0100, "proms", 0 )
2527   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2493   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
25282494ROM_END
25292495
25302496
r4499r4500
25532519   ROM_LOAD( "wm.93",         0x4000, 0x4000, CRC(a2f19170) SHA1(47dacc380b09c6365c737d320145cedad54ecedb) )
25542520
25552521   ROM_REGION( 0x0100, "proms", 0 )
2556   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2522   ROM_LOAD( "pr-5317.106",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
25572523ROM_END
25582524
25592525
r4499r4500
25822548   ROM_LOAD( "epr-6070.93",   0x4000, 0x4000, CRC(34f080df) SHA1(0e7d28e3325c8c3f06438fde29ea0ffe57fc325f) ) /* epr-6070.93 */
25832549
25842550   ROM_REGION( 0x0100, "proms", 0 )
2585   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2551   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
25862552                                              /* pr-5317.106 */
25872553ROM_END
25882554
r4499r4500
26082574   ROM_LOAD( "epr-6070.110",   0x4000, 0x4000, CRC(34f080df) SHA1(0e7d28e3325c8c3f06438fde29ea0ffe57fc325f) )
26092575
26102576   ROM_REGION( 0x0100, "proms", 0 )
2611   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2577   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
26122578ROM_END
26132579
26142580
r4499r4500
26362602   ROM_LOAD( "epr-6309.110",   0xc000, 0x4000, CRC(7423ad98) SHA1(e19b4c64795f30e1491520160d315e4148d58df2) )
26372603
26382604   ROM_REGION( 0x0100, "proms", 0 )
2639   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2605   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
26402606                                              /* pr-5317.106 */
26412607ROM_END
26422608
r4499r4500
26642630   ROM_LOAD( "epr-6309.110",   0xc000, 0x4000, CRC(7423ad98) SHA1(e19b4c64795f30e1491520160d315e4148d58df2) )
26652631
26662632   ROM_REGION( 0x0100, "proms", 0 )
2667   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2633   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
26682634                                              /* pr-5317.106 */
26692635ROM_END
26702636
r4499r4500
26912657   ROM_LOAD( "epr-6455.05",   0x4000, 0x4000, CRC(32ee64a1) SHA1(21743f78735fc9105fbbfac420bdaa2965b4b56f) )
26922658
26932659   ROM_REGION( 0x0100, "proms", 0 )
2694   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2660   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
26952661ROM_END
26962662
26972663ROM_START( pitfall2a )
r4499r4500
27162682   ROM_LOAD( "epr-6455.05",   0x4000, 0x4000, CRC(32ee64a1) SHA1(21743f78735fc9105fbbfac420bdaa2965b4b56f) )
27172683
27182684   ROM_REGION( 0x0100, "proms", 0 )
2719   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2685   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
27202686ROM_END
27212687
27222688ROM_START( pitfall2u )
r4499r4500
27412707   ROM_LOAD( "epr-6455.05",   0x4000, 0x4000, CRC(32ee64a1) SHA1(21743f78735fc9105fbbfac420bdaa2965b4b56f) )
27422708
27432709   ROM_REGION( 0x0100, "proms", 0 )
2744   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2710   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
27452711ROM_END
27462712
27472713
r4499r4500
27692735   ROM_LOAD( "epr-6549.05",   0xc000, 0x4000, CRC(d2057668) SHA1(ded2a04f7555eb3b1e4da57901ca00635de2c043) )
27702736
27712737   ROM_REGION( 0x0100, "proms", 0 )
2772   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2738   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
27732739ROM_END
27742740
27752741ROM_START( seganinju )
r4499r4500
27962762   ROM_LOAD( "epr-6549.05",   0xc000, 0x4000, CRC(d2057668) SHA1(ded2a04f7555eb3b1e4da57901ca00635de2c043) )
27972763
27982764   ROM_REGION( 0x0100, "proms", 0 )
2799   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2765   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
28002766ROM_END
28012767
28022768ROM_START( nprinces )
r4499r4500
28262792   ROM_LOAD( "epr-6549.05",   0xc000, 0x4000, CRC(d2057668) SHA1(ded2a04f7555eb3b1e4da57901ca00635de2c043) ) /* epr-6549.2 */
28272793
28282794   ROM_REGION( 0x0100, "proms", 0 )
2829   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2795   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
28302796                                              /* pr-5317.106 */
28312797ROM_END
28322798
r4499r4500
28542820   ROM_LOAD( "epr-6549.05",   0xc000, 0x4000, CRC(d2057668) SHA1(ded2a04f7555eb3b1e4da57901ca00635de2c043) )
28552821
28562822   ROM_REGION( 0x0100, "proms", 0 )
2857   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2823   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
28582824ROM_END
28592825
28602826ROM_START( nprincesu )
r4499r4500
28842850   ROM_LOAD( "epr-6549.05",   0xc000, 0x4000, CRC(d2057668) SHA1(ded2a04f7555eb3b1e4da57901ca00635de2c043) ) /* epr-6549.2 */
28852851
28862852   ROM_REGION( 0x0100, "proms", 0 )
2887   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2853   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
28882854ROM_END
28892855
28902856ROM_START( nprincesb )
r4499r4500
29112877   ROM_LOAD( "epr-6549.05",   0xc000, 0x4000, CRC(d2057668) SHA1(ded2a04f7555eb3b1e4da57901ca00635de2c043) )
29122878
29132879   ROM_REGION( 0x0220, "proms", 0 )
2914   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2880   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
29152881   ROM_LOAD( "nprinces.129",   0x0100, 0x0100, CRC(ae765f62) SHA1(9434b5a23d118a9c62015b479719826b38269cd4) ) /* decryption table (not used) */
29162882   ROM_LOAD( "nprinces.123",   0x0200, 0x0020, CRC(ed5146e9) SHA1(7044035c07636e4029f4b746c1a92e15173869e9) ) /* decryption table (not used) */
29172883ROM_END
r4499r4500
29402906   ROM_LOAD( "epr-6549.05",   0xc000, 0x4000, CRC(d2057668) SHA1(ded2a04f7555eb3b1e4da57901ca00635de2c043) )
29412907
29422908   ROM_REGION( 0x0100, "proms", 0 )
2943   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2909   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
29442910ROM_END
29452911
29462912
r4499r4500
29662932   ROM_LOAD( "epr-6646.04",   0x4000, 0x4000, CRC(edda7ad6) SHA1(eef7dcde632787283c4cb522380b138060018204) )
29672933
29682934   ROM_REGION( 0x0100, "proms", 0 )
2969   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2935   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
29702936ROM_END
29712937
29722938ROM_START( imsorryj )
r4499r4500
29912957   ROM_LOAD( "epr-6646.04",   0x4000, 0x4000, CRC(edda7ad6) SHA1(eef7dcde632787283c4cb522380b138060018204) )
29922958
29932959   ROM_REGION( 0x0100, "proms", 0 )
2994   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2960   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
29952961ROM_END
29962962
29972963
r4499r4500
30192985   ROM_LOAD( "epr-6738.05",   0xc000, 0x4000, CRC(e116285f) SHA1(b6fb50b02a981b3b23385200045ae537092d26d6) )
30202986
30212987   ROM_REGION( 0x0100, "proms", 0 )
3022   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
2988   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
30232989ROM_END
30242990
30252991ROM_START( teddybbo )
r4499r4500
30463012   ROM_LOAD( "epr-6738.05",   0xc000, 0x4000, CRC(e116285f) SHA1(b6fb50b02a981b3b23385200045ae537092d26d6) )
30473013
30483014   ROM_REGION( 0x0100, "proms", 0 )
3049   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3015   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
30503016ROM_END
30513017
30523018
r4499r4500
30793045   ROM_LOAD( "pr7034.1",     0x0200, 0x0100, CRC(dfb5f139) SHA1(56cba261819fd5f2beab56ffd80bb3fd328efe3e) ) /* palette blue component */
30803046
30813047   ROM_REGION( 0x0100, "proms", 0 )
3082   ROM_LOAD( "pr5317p.4",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3048   ROM_LOAD( "pr5317p.4",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
30833049ROM_END
30843050
30853051
r4499r4500
31073073   ROM_LOAD( "epr-6924.05",   0xc000, 0x4000, CRC(42bdc8f6) SHA1(f31d82641187a7cc77a4a19189b5a15d5168cbd7) )
31083074
31093075   ROM_REGION( 0x0100, "proms", 0 )
3110   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3076   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
31113077ROM_END
31123078
31133079ROM_START( sscandal )
r4499r4500
31343100   ROM_LOAD( "epr-6924.05",   0xc000, 0x4000, CRC(42bdc8f6) SHA1(f31d82641187a7cc77a4a19189b5a15d5168cbd7) )
31353101
31363102   ROM_REGION( 0x0100, "proms", 0 )
3137   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3103   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
31383104ROM_END
31393105
31403106ROM_START( myherok )
r4499r4500
31623128   ROM_LOAD( "epr-6924.05",   0xc000, 0x4000, CRC(42bdc8f6) SHA1(f31d82641187a7cc77a4a19189b5a15d5168cbd7) )
31633129
31643130   ROM_REGION( 0x0100, "proms", 0 )
3165   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3131   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
31663132ROM_END
31673133
31683134
r4499r4500
31903156   ROM_LOAD( "4d.05",        0xc000, 0x4000, CRC(f31a1e6a) SHA1(f49dbc4b381e7096d5ffe3c16660dd63121dabf7) )
31913157
31923158   ROM_REGION( 0x0100, "proms", 0 )
3193   ROM_LOAD( "pr5317.76",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3159   ROM_LOAD( "pr5317.76",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
31943160ROM_END
31953161
31963162
r4499r4500
32413207   ROM_LOAD( "epr7111.ic8",    0x00200, 0x0100, CRC(8123b6b9) SHA1(fb2c5498f0603b5cd270402a738c891a85453666) ) /* palette blue component - N82S129AN */
32423208
32433209   ROM_REGION( 0x0100, "proms", 0 )
3244   ROM_LOAD( "epr5317.ic37",   0x00000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) - N82S129AN */
3210   ROM_LOAD( "epr5317.ic37",   0x00000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* N82S129AN */
32453211
32463212    /* These pld's are located on the main board. */
32473213   ROM_REGION( 0x0618, "plds", 0 )
r4499r4500
33003266   ROM_LOAD( "epr7111.ic8",    0x00200, 0x0100, CRC(8123b6b9) SHA1(fb2c5498f0603b5cd270402a738c891a85453666) ) /* palette blue component - N82S129AN */
33013267
33023268   ROM_REGION( 0x0100, "proms", 0 )
3303   ROM_LOAD( "epr5317.ic37",   0x00000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) - N82S129AN */
3269   ROM_LOAD( "epr5317.ic37",   0x00000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* N82S129AN */
33043270
33053271    /* These pld's are located on the main board. */
33063272   ROM_REGION( 0x0618, "plds", 0 )
r4499r4500
33903356   ROM_LOAD( "epr7111.ic8",    0x00200, 0x0100, CRC(8123b6b9) SHA1(fb2c5498f0603b5cd270402a738c891a85453666) ) /* palette blue component - N82S129AN */
33913357
33923358   ROM_REGION( 0x0100, "proms", 0 )
3393   ROM_LOAD( "epr5317.ic37",   0x00000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) - N82S129AN */
3359   ROM_LOAD( "epr5317.ic37",   0x00000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* N82S129AN */
33943360
33953361   ROM_REGION( 0x0400, "plds", 0 )
33963362   ROM_LOAD( "315-5137.bin",   0x00000, 0x0104, CRC(6ffd9e6f) SHA1(a60a3a2ec5bc256b18bfff0fec0172ee2e4fd955) ) /* TI PAL16R4A-2CN Located at IC10 */
r4499r4500
34343400   ROM_LOAD( "pr7117.ic8",      0x0200, 0x0100, CRC(4124307e) SHA1(cee28d891e6ce732c43a61acb5beeafd2200cf37) ) /* palette blue component */
34353401
34363402   ROM_REGION( 0x0100, "proms", 0 )
3437   ROM_LOAD( "pr5317.ic28",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3403   ROM_LOAD( "pr5317.ic28",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
34383404
34393405   ROM_REGION( 0x0618, "plds", 0 )
34403406   ROM_LOAD( "315-5152.bin",   0x00000, 0x0104, CRC(2c9229b4) SHA1(9755013afcf89f99d7a399c7e223e027761cf89a) ) /* PAL16R4A located at IC10. */
r4499r4500
34783444   ROM_LOAD( "pr7117.ic8",      0x0200, 0x0100, CRC(4124307e) SHA1(cee28d891e6ce732c43a61acb5beeafd2200cf37) ) /* palette blue component */
34793445
34803446   ROM_REGION( 0x0100, "proms", 0 )
3481   ROM_LOAD( "pr5317.ic28",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3447   ROM_LOAD( "pr5317.ic28",   0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
34823448
34833449   ROM_REGION( 0x0618, "plds", 0 )
34843450   ROM_LOAD( "315-5152.bin",   0x00000, 0x0104, CRC(2c9229b4) SHA1(9755013afcf89f99d7a399c7e223e027761cf89a) ) /* PAL16R4A located at IC10. */
r4499r4500
35593525   ROM_LOAD( "pr7117.8",      0x0200, 0x0100, CRC(4124307e) SHA1(cee28d891e6ce732c43a61acb5beeafd2200cf37) ) /* palette blue component */
35603526
35613527   ROM_REGION( 0x0100, "proms", 0 )
3562   ROM_LOAD( "pr5317.28",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3528   ROM_LOAD( "pr5317.28",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
35633529
35643530   ROM_REGION( 0x0003, "plds_main", 0 )
35653531    ROM_LOAD( "pal16r4.bin",    0x00000, 0x0001, NO_DUMP ) /* PAL16R4 located at IC13. */
r4499r4500
36103576   ROM_LOAD( "epr-7410.05",   0xc000, 0x4000, CRC(ced74789) SHA1(d0ad845bfe83412ac8d43125e1c50d0581a5b47e) ) /* epr-7410.2 */
36113577
36123578   ROM_REGION( 0x0100, "proms", 0 )
3613   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3579   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
36143580                                              /* pr-5317.106 */
36153581ROM_END
36163582
r4499r4500
36393605   ROM_LOAD( "epr-7488.05",   0xc000, 0x4000, CRC(007c2f1b) SHA1(c2f1376144a49d20cb35384648e06d06978474c1) )
36403606
36413607   ROM_REGION( 0x0100, "proms", 0 )
3642   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3608   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
36433609ROM_END
36443610
36453611ROM_START( wboyo )
r4499r4500
36663632   ROM_LOAD( "epr-7488.05",   0xc000, 0x4000, CRC(007c2f1b) SHA1(c2f1376144a49d20cb35384648e06d06978474c1) )
36673633
36683634   ROM_REGION( 0x0100, "proms", 0 )
3669   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3635   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
36703636ROM_END
36713637
36723638ROM_START( wboy2 )
r4499r4500
36963662   ROM_LOAD( "epr-7488.05",   0xc000, 0x4000, CRC(007c2f1b) SHA1(c2f1376144a49d20cb35384648e06d06978474c1) ) /* epr-7488.2 */
36973663
36983664   ROM_REGION( 0x0100, "proms", 0 )
3699   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3665   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
37003666                                              /* pr-5317.106 */
37013667ROM_END
37023668
r4499r4500
37273693   ROM_LOAD( "epr-7488.05",   0xc000, 0x4000, CRC(007c2f1b) SHA1(c2f1376144a49d20cb35384648e06d06978474c1) ) /* epr-7488.2 */
37283694
37293695   ROM_REGION( 0x0100, "proms", 0 )
3730   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3696   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
37313697                                              /* pr-5317.106 */
37323698ROM_END
37333699
r4499r4500
37553721   ROM_LOAD( "epr-7488.05",   0xc000, 0x4000, CRC(007c2f1b) SHA1(c2f1376144a49d20cb35384648e06d06978474c1) )
37563722
37573723   ROM_REGION( 0x0100, "proms", 0 )
3758   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3724   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
37593725ROM_END
37603726
37613727/*
r4499r4500
37893755   ROM_LOAD( "7577.86",  0x08000, 0x8000, CRC(58b3705e) SHA1(1a8ff3f1765a3b21145bd1a6c85441f806f7b17d) )   // epr7576.ic117
37903756
37913757   ROM_REGION( 0x0100, "proms", 0 )
3792   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3758   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
37933759ROM_END
37943760
37953761ROM_START( wboyu )
r4499r4500
38163782   ROM_LOAD( "ic005_88.bin",   0xc000, 0x4000, CRC(2602e519) SHA1(00e94ec7ae37b5063137d4d49af7806fb0357c4b) )
38173783
38183784   ROM_REGION( 0x0100, "proms", 0 )
3819   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3785   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
38203786ROM_END
38213787
38223788ROM_START( wboysys2 )
r4499r4500
38423808   ROM_LOAD( "pr-7343.8",      0x0200, 0x0100, CRC(371c44a6) SHA1(ac37458d1feb6566b09a795b20c21953d4ab109d) ) /* palette blue component */
38433809
38443810   ROM_REGION( 0x0100, "proms", 0 )
3845   ROM_LOAD( "pr-5317.28",     0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3811   ROM_LOAD( "pr-5317.28",     0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
38463812ROM_END
38473813
38483814ROM_START( wbdeluxe )
r4499r4500
38723838   ROM_LOAD( "epr-7488.05",   0xc000, 0x4000, CRC(007c2f1b) SHA1(c2f1376144a49d20cb35384648e06d06978474c1) ) /* epr-7488.2 */
38733839
38743840   ROM_REGION( 0x0100, "proms", 0 )
3875   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3841   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
38763842                                              /* pr-5317.106 */
38773843ROM_END
38783844
r4499r4500
39033869   ROM_LOAD( "bprom.1",      0x0200, 0x0100, CRC(371c44a6) SHA1(ac37458d1feb6566b09a795b20c21953d4ab109d) ) /* palette blue component */
39043870
39053871   ROM_REGION( 0x0100, "proms", 0 )
3906   ROM_LOAD( "pr5317.4",     0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3872   ROM_LOAD( "pr5317.4",     0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
39073873ROM_END
39083874
39093875ROM_START( gardiab )
r4499r4500
39323898   ROM_LOAD( "bprom.1",      0x0200, 0x0100, CRC(371c44a6) SHA1(ac37458d1feb6566b09a795b20c21953d4ab109d) ) /* palette blue component */
39333899
39343900   ROM_REGION( 0x0100, "proms", 0 )
3935   ROM_LOAD( "pr5317.4",     0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3901   ROM_LOAD( "pr5317.4",     0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
39363902ROM_END
39373903
39383904
r4499r4500
39643930   ROM_LOAD( "bprom.1",      0x0200, 0x0100, BAD_DUMP CRC(371c44a6) SHA1(ac37458d1feb6566b09a795b20c21953d4ab109d)  ) /* palette blue component */
39653931
39663932   ROM_REGION( 0x0100, "proms", 0 )
3967   ROM_LOAD( "pr5317.76",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3933   ROM_LOAD( "pr5317.76",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
39683934ROM_END
39693935
39703936
r4499r4500
39943960   ROM_LOAD( "bprom.8",       0x0200, 0x0100, CRC(371c44a6) SHA1(ac37458d1feb6566b09a795b20c21953d4ab109d) ) /* palette blue component */
39953961
39963962   ROM_REGION( 0x0100, "proms", 0 )
3997   ROM_LOAD( "bprom.28",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3963   ROM_LOAD( "bprom.28",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
39983964ROM_END
39993965
40003966
r4499r4500
40273993   ROM_LOAD( "pr11024.8",    0x0200, 0x0100, CRC(08d71954) SHA1(df045dbfb3d669e4d42fbdba1e7191cd046f7b47) )
40283994
40293995   ROM_REGION( 0x0100, "proms", 0 )
4030   ROM_LOAD( "pr5317.37",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3996   ROM_LOAD( "pr5317.37",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
40313997ROM_END
40323998
40333999ROM_START( wbmljo )
r4499r4500
40594025   ROM_LOAD( "pr11024.8",    0x0200, 0x0100, CRC(08d71954) SHA1(df045dbfb3d669e4d42fbdba1e7191cd046f7b47) )
40604026
40614027   ROM_REGION( 0x0100, "proms", 0 )
4062   ROM_LOAD( "pr5317.37",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
4028   ROM_LOAD( "pr5317.37",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
40634029ROM_END
40644030
40654031ROM_START( wbmljb )
r4499r4500
40914057   ROM_LOAD( "pr11024.8",    0x0200, 0x0100, CRC(08d71954) SHA1(df045dbfb3d669e4d42fbdba1e7191cd046f7b47) )
40924058
40934059   ROM_REGION( 0x0100, "proms", 0 )
4094   ROM_LOAD( "pr5317.37",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
4060   ROM_LOAD( "pr5317.37",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
40954061ROM_END
40964062
40974063ROM_START( wbmlb )
r4499r4500
41234089   ROM_LOAD( "pr11024.8",    0x0200, 0x0100, CRC(08d71954) SHA1(df045dbfb3d669e4d42fbdba1e7191cd046f7b47) )
41244090
41254091   ROM_REGION( 0x0100, "proms", 0 )
4126   ROM_LOAD( "pr5317.37",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
4092   ROM_LOAD( "pr5317.37",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
41274093ROM_END
41284094
41294095ROM_START( wbmlbg )
r4499r4500
41554121   ROM_LOAD( "pr11024.8",    0x0200, 0x0100, CRC(08d71954) SHA1(df045dbfb3d669e4d42fbdba1e7191cd046f7b47) )
41564122
41574123   ROM_REGION( 0x0100, "proms", 0 )
4158   ROM_LOAD( "pr5317.37",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
4124   ROM_LOAD( "pr5317.37",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
41594125ROM_END
41604126
41614127
r4499r4500
41884154   ROM_LOAD( "pr11217.8",    0x0200, 0x0100, CRC(49dbde88) SHA1(7057da5617de7e4775adf092cce1709135066129) ) /* palette blue component */
41894155
41904156   ROM_REGION( 0x0100, "proms", 0 )
4191   ROM_LOAD( "pr5317.37",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
4157   ROM_LOAD( "pr5317.37",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
41924158ROM_END
41934159
41944160
r4499r4500
42214187   ROM_LOAD( "pr11654.8",    0x0200, 0x0100, CRC(ba624305) SHA1(eb1d0dde60f81ff510ac8c1212e0ed5703febaf3) ) /* palette blue component */
42224188
42234189   ROM_REGION( 0x0100, "proms", 0 )
4224   ROM_LOAD( "pr5317.28",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
4190   ROM_LOAD( "pr5317.28",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
42254191ROM_END
42264192
42274193ROM_START( ufosensib )
r4499r4500
42534219   ROM_LOAD( "pr11654.8",    0x0200, 0x0100, CRC(ba624305) SHA1(eb1d0dde60f81ff510ac8c1212e0ed5703febaf3) ) /* palette blue component - label on chip is "74s287.ic132.9d" */
42544220
42554221   ROM_REGION( 0x0100, "proms", 0 )
4256   ROM_LOAD( "pr5317.28",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) - label on chip is "74s287.ic115.8j" */
4222   ROM_LOAD( "pr5317.28",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* label on chip is "74s287.ic115.8j" */
42574223
42584224   ROM_REGION( 0x2000, "plds", 0 )
42594225   ROM_LOAD( "pal6l8.ic3.1c",   0x0000, 0x0104, NO_DUMP ) /* PAL is read protected */
r4499r4500
42954261   ROM_LOAD( "bg.05",        0xc000, 0x4000, CRC(02e0b040) SHA1(fb626fc31dfe25bf9fac0c8d76d5041609b06e82) )
42964262
42974263   ROM_REGION( 0x0100, "proms", 0 )
4298   ROM_LOAD( "pr5317.76",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
4264   ROM_LOAD( "pr5317.76",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
42994265ROM_END
43004266
43014267ROM_START( blockgalb )
r4499r4500
43214287   ROM_LOAD( "bg.05",        0xc000, 0x4000, CRC(02e0b040) SHA1(fb626fc31dfe25bf9fac0c8d76d5041609b06e82) )
43224288
43234289   ROM_REGION( 0x0100, "proms", 0 )
4324   ROM_LOAD( "pr5317.76",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
4290   ROM_LOAD( "pr5317.76",    0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
43254291ROM_END
43264292
43274293
r4499r4500
44344400   ROM_LOAD( "dm-12.ic3", 0x0200, 0x0100, CRC(de394cee) SHA1(511c53f22459e5e238b48685f85b10f5e15f2ac1) ) /* palette blue component */
44354401
44364402   ROM_REGION( 0x0100, "proms", 0 )
4437   ROM_LOAD( "dc-11.6a", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
4403   ROM_LOAD( "dc-11.6a", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
44384404ROM_END
44394405
44404406/* the bootleg has different protection.. */
r4499r4500
44644430   ROM_LOAD( "nobo_pr.14d", 0x0200, 0x0100, CRC(de394cee) SHA1(511c53f22459e5e238b48685f85b10f5e15f2ac1) ) /* palette blue component */
44654431
44664432   ROM_REGION( 0x0100, "proms", 0 )
4467   ROM_LOAD( "nobo_pr.13a", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
4433   ROM_LOAD( "nobo_pr.13a", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) )
44684434ROM_END
44694435
44704436
r4499r4500
46454611GAME( 1983, starjacks,  starjack, sys1ppis, starjacks, bank00,   ROT270, "Stern",           "Star Jacker (Stern)", GAME_SUPPORTS_SAVE )
46464612GAME( 1983, upndown,    0,        sys1ppi,  upndown,   nprinces, ROT270, "Sega",            "Up'n Down (315-5030)", GAME_SUPPORTS_SAVE )
46474613GAME( 1983, upndownu,   upndown,  sys1ppi,  upndown,   bank00,   ROT270, "Sega",            "Up'n Down (not encrypted)", GAME_SUPPORTS_SAVE )
4648GAME( 1983, regulus,    0,        sys1ppis, regulus,   regulus,  ROT270, "Sega",            "Regulus (315-5033, Rev A.)", GAME_SUPPORTS_SAVE )
4649GAME( 1983, reguluso,   regulus,  sys1ppis, reguluso,  regulus,  ROT270, "Sega",            "Regulus (315-5033)", GAME_SUPPORTS_SAVE )
4650GAME( 1983, regulusu,   regulus,  sys1ppis, regulus,   bank00,   ROT270, "Sega",            "Regulus (not encrypted)", GAME_SUPPORTS_SAVE )
4614GAME( 1983, regulus,    0,        sys1ppi,  regulus,   regulus,  ROT270, "Sega",            "Regulus (315-5033, Rev A.)", GAME_SUPPORTS_SAVE )
4615GAME( 1983, reguluso,   regulus,  sys1ppi,  reguluso,  regulus,  ROT270, "Sega",            "Regulus (315-5033)", GAME_SUPPORTS_SAVE )
4616GAME( 1983, regulusu,   regulus,  sys1ppi,  regulus,   bank00,   ROT270, "Sega",            "Regulus (not encrypted)", GAME_SUPPORTS_SAVE )
46514617GAME( 1984, mrviking,   0,        sys1ppis, mrviking,  mrviking, ROT270, "Sega",            "Mister Viking (315-5041)", GAME_SUPPORTS_SAVE )
46524618GAME( 1984, mrvikingj,  mrviking, sys1ppis, mrvikingj, mrviking, ROT270, "Sega",            "Mister Viking (315-5041, Japan)", GAME_SUPPORTS_SAVE )
46534619GAME( 1984, swat,       0,        sys1ppi,  swat,      swat,     ROT270, "Coreland / Sega", "SWAT (315-5048)", GAME_SUPPORTS_SAVE )
r4499r4500
47024668GAME( 1985, choplift,   0,        sys2row,  choplift,  choplift, ROT0,   "Sega",            "Choplifter (8751 315-5151)", GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )
47034669GAME( 1985, chopliftu,  choplift, sys2row,  choplift,  bank0c,   ROT0,   "Sega",            "Choplifter (unprotected)", GAME_SUPPORTS_SAVE )
47044670GAME( 1985, chopliftbl, choplift, sys2row,  choplift,  bank0c,   ROT0,   "bootleg",         "Choplifter (bootleg)", GAME_SUPPORTS_SAVE )
4705GAME( 1985, shtngmst,   0,        sys2s,    shtngmst,  shtngmst, ROT0,   "Sega",            "Shooting Master (Rev A, 8751 315-5159a)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )
4706GAME( 1985, shtngmst1,  shtngmst, sys2s,    shtngmst,  shtngmst, ROT0,   "Sega",            "Shooting Master (8751 315-5159)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )
4707GAME( 1985, shtngmsta,  shtngmst, sys2s,    shtngmst,  shtngmst, ROT0,   "Sega [EVG]",      "Shooting Master (EVG, 8751 315-5159)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )
4671GAME( 1985, shtngmst,   0,        sys2,     shtngmst,  shtngmst, ROT0,   "Sega",            "Shooting Master (Rev A, 8751 315-5159a)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )
4672GAME( 1985, shtngmst1,  shtngmst, sys2,     shtngmst,  shtngmst, ROT0,   "Sega",            "Shooting Master (8751 315-5159)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )
4673GAME( 1985, shtngmsta,  shtngmst, sys2,     shtngmst,  shtngmst, ROT0,   "Sega [EVG]",      "Shooting Master (EVG, 8751 315-5159)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )
47084674GAME( 1986, gardiab,    gardia,   sys2,     gardia,    gardiab,  ROT270, "bootleg",         "Gardia (317-0007?, bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
47094675GAME( 1986, wboysys2,   wboy,     sys2,     wboysys2,  wboysys2, ROT0,   "Sega (Escape license)", "Wonder Boy (system 2)", GAME_SUPPORTS_SAVE )
47104676GAME( 1987, tokisens,   0,        sys2,     tokisens,  bank0c,   ROT90,  "Sega",            "Toki no Senshi - Chrono Soldier", GAME_SUPPORTS_SAVE )
r4499r4500
47154681GAME( 1987, wbmlbg,     wbml,     sys2,     wbml,      bootlegb, ROT0,   "bootleg",         "Wonder Boy in Monster Land (Galaxy Electronics English bootleg)", GAME_SUPPORTS_SAVE)
47164682GAME( 1987, dakkochn,   0,        sys2,     dakkochn,  dakkochn, ROT0,   "Whiteboard",      "DakkoChan House (MC-8123, 317-0014)", GAME_SUPPORTS_SAVE )
47174683GAME( 1987, blockgalb,  blockgal, sys2,     blockgal,  bootleg,  ROT90,  "bootleg",         "Block Gal (bootleg)", GAME_SUPPORTS_SAVE )
4718GAME( 1988, ufosensi,   0,        sys2rows, ufosensi,  ufosensi, ROT0,   "Sega",            "Ufo Senshi Yohko Chan (MC-8123, 317-0064)", GAME_SUPPORTS_SAVE )
4719GAME( 1988, ufosensib,  ufosensi, sys2rows, ufosensi,  bootlegb, ROT0,   "bootleg",         "Ufo Senshi Yohko Chan (not encrypted)", GAME_SUPPORTS_SAVE )
4684GAME( 1988, ufosensi,   0,        sys2row,  ufosensi,  ufosensi, ROT0,   "Sega",            "Ufo Senshi Yohko Chan (MC-8123, 317-0064)", GAME_SUPPORTS_SAVE )
4685GAME( 1988, ufosensib,  ufosensi, sys2row,  ufosensi,  bootlegb, ROT0,   "bootleg",         "Ufo Senshi Yohko Chan (not encrypted)", GAME_SUPPORTS_SAVE )
src/mame/drivers/seta2.c
r4499r4500
871871                            Sammy Outdoor Shooting
872872***************************************************************************/
873873
874static READ16_HANDLER( samshoot_lightgun1_r )
875{
876//  popmessage("%02x %02x",input_port_read(space->machine, "GUN1X"),input_port_read(space->machine, "GUN1Y"));
877   return (input_port_read(space->machine, "GUN1Y") << 8) | input_port_read(space->machine, "GUN1X");
878}
879static READ16_HANDLER( samshoot_lightgun2_r )
880{
881   return (input_port_read(space->machine, "GUN2Y") << 8) | input_port_read(space->machine, "GUN2X");
882}
883
884874static WRITE16_HANDLER( samshoot_coin_w )
885875{
886876   if (ACCESSING_BITS_0_7)
r4499r4500
904894
905895   AM_RANGE( 0x400300, 0x40030f ) AM_WRITE( seta2_sound_bank_w )   // Samples Banks
906896
907   AM_RANGE( 0x500000, 0x500001 ) AM_READ( samshoot_lightgun1_r )   // P1
908   AM_RANGE( 0x580000, 0x580001 ) AM_READ( samshoot_lightgun2_r )   // P2
897   AM_RANGE( 0x500000, 0x500001 ) AM_READ_PORT("GUN1")            // P1
898   AM_RANGE( 0x580000, 0x580001 ) AM_READ_PORT("GUN2")            // P2
909899
910900   AM_RANGE( 0x700000, 0x700001 ) AM_READ_PORT("TRIGGER")         // Trigger
911901   AM_RANGE( 0x700002, 0x700003 ) AM_READ_PORT("PUMP")            // Pump
r4499r4500
18471837***************************************************************************/
18481838
18491839static INPUT_PORTS_START( deerhunt )
1850   PORT_START("DSW1") // IN0 - $400000.w
1840   PORT_START("DSW1") // $400000.w
18511841   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3")
18521842   PORT_DIPSETTING(      0x0005, DEF_STR( 4C_1C ) )
18531843   PORT_DIPSETTING(      0x0006, DEF_STR( 2C_1C ) )
r4499r4500
18721862   PORT_SERVICE_DIPLOC(  0x0080, IP_ACTIVE_LOW, "SW1:8" )
18731863   PORT_BIT(     0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
18741864
1875   PORT_START("DSW2") // IN1 - fffd0a.w
1865   PORT_START("DSW2") // fffd0a.w
18761866   PORT_DIPNAME( 0x0001, 0x0001, "Vert. Flip Screen" ) PORT_DIPLOCATION("SW2:1")
18771867   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
18781868   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
r4499r4500
18981888   PORT_DIPSETTING(      0x0000, "Hand Gun" )
18991889   PORT_BIT(     0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
19001890
1901   PORT_START("GUN1Y") // IN2 - $500000.b
1902   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)
1891   PORT_START("GUN1") // $500000
1892   PORT_BIT( 0x00ff, 0x0080, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1, 0, 0) PORT_MINMAX(0x0025,0x00c5) PORT_SENSITIVITY(35) PORT_KEYDELTA(10) PORT_PLAYER(1)
1893   PORT_BIT( 0xff00, 0x8000, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1, 0, 0) PORT_MINMAX(0x0800,0xf800) PORT_SENSITIVITY(35) PORT_KEYDELTA(10) PORT_PLAYER(1)
19031894
1904   PORT_START("GUN1X")   // IN3 - $500001.b
1905   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)
1906
1907   PORT_START("GUN2Y")   // IN4 - $580000.b
1895   PORT_START("GUN2")   // $580000.b
19081896   PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN )   // P2 gun, read but not used
19091897
1910   PORT_START("GUN2X")   // IN5 - $580001.b
1911   PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN )   // P2 gun, read but not used
1912
1913   PORT_START("TRIGGER")   // IN6 - $700000
1898   PORT_START("TRIGGER")   // $700000
19141899   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SPECIAL )   // trigger
19151900   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1  )
19161901   PORT_BIT( 0xff3f, IP_ACTIVE_LOW, IPT_UNKNOWN )
19171902
1918   PORT_START("PUMP")   // IN7 - $700003.b
1903   PORT_START("PUMP")   // $700003.b
19191904   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SPECIAL )   // pump
19201905   PORT_BIT( 0xffbf, IP_ACTIVE_LOW, IPT_UNKNOWN )
19211906
1922   PORT_START("COIN")   // IN8 - $700005.b
1907   PORT_START("COIN")   // $700005.b
19231908   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
19241909   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
19251910   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
19261911   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE2 )
19271912   PORT_BIT( 0xfff0, IP_ACTIVE_LOW, IPT_UNKNOWN )
19281913
1929   PORT_START("BUTTONS")   // IN9 - $400002
1914   PORT_START("BUTTONS")   // $400002
19301915   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 )   // trigger
19311916   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 )   // pump
19321917   PORT_BIT( 0xfffc, IP_ACTIVE_LOW, IPT_UNKNOWN )
r4499r4500
19361921static INPUT_PORTS_START( turkhunt )
19371922   PORT_INCLUDE(deerhunt)
19381923
1939   PORT_MODIFY("DSW2") // IN1 - fffd0a.w
1924   PORT_MODIFY("DSW2") // fffd0a.w
19401925   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:7")
19411926   PORT_DIPSETTING(      0x0040, "2" )
19421927   PORT_DIPSETTING(      0x0000, "3" )
r4499r4500
19461931static INPUT_PORTS_START( wschamp )
19471932   PORT_INCLUDE(deerhunt)
19481933
1949   PORT_MODIFY("DSW1")   // IN0 - $400000.w
1934   PORT_MODIFY("DSW1")   // $400000.w
19501935   PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3,4")
19511936   PORT_DIPSETTING(      0x0009, "4 Coins Start, 4 Coins Continue" )
19521937   PORT_DIPSETTING(      0x0008, "4 Coins Start, 3 Coins Continue" )
r4499r4500
19701955   PORT_SERVICE_DIPLOC(  0x0080, IP_ACTIVE_LOW, "SW1:8" )
19711956   PORT_BIT(     0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
19721957
1973   PORT_MODIFY("DSW2") // IN1 - fffd0a.w
1958   PORT_MODIFY("DSW2") // fffd0a.w
19741959   PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW2:6" )
19751960   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:7")
19761961   PORT_DIPSETTING(      0x0040, "2" )
19771962   PORT_DIPSETTING(      0x0000, "3" )
19781963
1979   PORT_MODIFY("GUN2Y") // IN4 - $580000.b
1980   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)
1964   PORT_MODIFY("GUN2") // $580000
1965   PORT_BIT( 0x00ff, 0x0080, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1, 0, 0) PORT_MINMAX(0x0025,0x00c5) PORT_SENSITIVITY(35) PORT_KEYDELTA(10) PORT_PLAYER(2)
1966   PORT_BIT( 0xff00, 0x8000, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1, 0, 0) PORT_MINMAX(0x0800,0xf800) PORT_SENSITIVITY(35) PORT_KEYDELTA(10) PORT_PLAYER(2)
19811967
1982   PORT_MODIFY("GUN2X")   // IN5 - $580001.b
1983   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)
1984
1985   PORT_MODIFY("TRIGGER")   // IN6 - $700000
1968   PORT_MODIFY("TRIGGER")   // $700000
19861969   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL )   // trigger P2
19871970   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SPECIAL )   // trigger P1
19881971   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1  )
19891972   PORT_BIT( 0xff1f, IP_ACTIVE_LOW, IPT_UNKNOWN )
19901973
1991   PORT_MODIFY("PUMP")   // IN7 - $700003.b
1974   PORT_MODIFY("PUMP")   // $700003.b
19921975   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL )   // pump P2
19931976   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SPECIAL )   // pump P1
19941977   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2  )
19951978   PORT_BIT( 0xff1f, IP_ACTIVE_LOW, IPT_UNKNOWN )
19961979
1997   PORT_MODIFY("COIN")   // IN8 - $700005.b
1980   PORT_MODIFY("COIN")   // $700005.b
19981981   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
19991982   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
20001983   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
20011984   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE2 )
20021985   PORT_BIT( 0xfff0, IP_ACTIVE_LOW, IPT_UNKNOWN )
20031986
2004   PORT_MODIFY("BUTTONS")   // IN9 - $400002
1987   PORT_MODIFY("BUTTONS")   // $400002
20051988   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 )   // trigger P1
20061989   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 )   // pump P1
20071990   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 )   PORT_PLAYER(2)   // trigger P2
r4499r4500
20121995static INPUT_PORTS_START( trophyh )
20131996   PORT_INCLUDE(wschamp)
20141997
2015   PORT_MODIFY("DSW2") // IN1 - fffd0a.w
1998   PORT_MODIFY("DSW2") // fffd0a.w
20161999   PORT_DIPNAME( 0x0020, 0x0020, "Blood Color" ) PORT_DIPLOCATION("SW2:6") /* WSChamp doesn't use Blood Color, so add it back in */
20172000   PORT_DIPSETTING(      0x0020, "Red" )
20182001   PORT_DIPSETTING(      0x0000, "Yellow" )
src/mame/drivers/goldstar.c
r4499r4500
46864686   //MDRV_CPU_IO_MAP(goldstar_readport,0)
46874687   MDRV_CPU_VBLANK_INT("screen", nmi_line_pulse)
46884688
4689
46894690   /* 3x 8255 */
46904691   MDRV_PPI8255_ADD( "ppi8255_0", kkojnoli_ppi8255_intf[0] )
46914692   MDRV_PPI8255_ADD( "ppi8255_1", kkojnoli_ppi8255_intf[1] )
r4499r4500
56975698   ROM_LOAD( "am27s19pc.73",   0x0000, 0x0020, CRC(b48d0b41) SHA1(01d2d0fd5e79c17043e97146001150b4b32ac86c) )
56985699ROM_END
56995700
5701ROM_START( wcat3 )
5702   ROM_REGION( 0x10000, "maincpu", 0 )
5703   ROM_LOAD( "wcat3.u5",   0x0000, 0x10000, CRC(bf21cde5) SHA1(b501ba8ea815e3b19b26196f6fd48243892278eb) )
5704
5705   ROM_REGION( 0x18000, "gfx1", ROMREGION_DISPOSE )
5706   ROM_LOAD( "wcat3.h7",   0x10000, 0x8000, CRC(065cb575) SHA1(4dd49773c4caeaa489342e61f26c8eaaae876edc) )
5707   ROM_LOAD( "wcat3.h8",   0x08000, 0x8000, CRC(60463213) SHA1(b0937b4a55f74831ce9a06f3df0af504845f908d) )
5708   ROM_LOAD( "wcat3.h10",   0x00000, 0x8000, CRC(dda38c26) SHA1(4b9292911133dd6067a1c61a44845e824e88a52d) )
5709
5710   ROM_REGION( 0x8000, "gfx2", ROMREGION_DISPOSE )
5711   ROM_LOAD( "wcat3.h1",   0x6000, 0x2000, CRC(0509d556) SHA1(c2f46d279f45b544c67b0c966659cc6d5d53c22f) )
5712   ROM_LOAD( "wcat3.h2",   0x4000, 0x2000, CRC(d50f3d62) SHA1(8500c7f3a2f51ea0ed7e142ecdc4e669ba3e7065) )
5713   ROM_LOAD( "wcat3.h4",   0x2000, 0x2000, CRC(373d9949) SHA1(ff483505fb9e86411acad7059bf5434dde290946) )
5714   ROM_LOAD( "wcat3.h5",   0x0000, 0x2000, CRC(50febe3b) SHA1(0479bcee53b174aa0413951e283e446b09a6f156) )
5715
5716   ROM_REGION( 0x200, "proms", 0 )
5717   ROM_LOAD( "wcat3.g13",   0x0000, 0x0100, CRC(c29a36f2) SHA1(936b07a195f6e7f6a884bd35f442003cf67aa447) )
5718   ROM_LOAD( "wcat3.g14",   0x0100, 0x0100, CRC(dcd53d2c) SHA1(bbcb4266117c3cd1c8ef0e5046d3558c8293313a) )
5719
5720   ROM_REGION( 0x40, "proms2", 0 )
5721   ROM_LOAD( "wcat3.d12",   0x0000, 0x0020, CRC(6df3f972) SHA1(0096a7f7452b70cac6c0752cb62e24b643015b5c) )
5722
5723   ROM_REGION( 0x100, "unkprom", 0 )
5724   ROM_LOAD( "wcat3.f3",   0x0000, 0x0100, CRC(1d668d4a) SHA1(459117f78323ea264d3a29f1da2889bbabe9e4be) )
5725
5726   ROM_REGION( 0x40, "unkprom2", 0 )
5727   ROM_LOAD( "wcat3.d13",   0x0000, 0x0020, CRC(eab832ed) SHA1(0fbc8914ba1805cfc6698fe7f137a934e63a4f89) )
5728ROM_END
5729
5730
57005731/*
57015732
57025733  Board had a sticker that said MODEL 9006
r4499r4500
75087539GAME( 1989, lucky8a,   lucky8,   lucky8,   lucky8a,  lucky8a,   ROT0, "Wing Co.Ltd / GEI", "New Lucky 8 Lines (set 2)",                   0 )
75097540GAME( 198?, ladylinr,  0,        ladylinr, ladylinr, 0,         ROT0, "TAB Austria",       "Lady Liner",                                  0 )
75107541GAME( 198?, kkojnoli,  0,        kkojnoli, kkojnoli, 0,         ROT0, "south korean hack", "Kkoj Noli (Kill the Bees)",                   GAME_IMPERFECT_COLORS )
7542GAME( 198?, wcat3,     0,        kkojnoli, kkojnoli, 0,         ROT0, "bootleg?", "Wild Cat 3",GAME_NOT_WORKING )
75117543
75127544GAME( 198?, mtonic,    0,        ncb3,     cmv801,   mtonic,         ROT0, "Tonic",             "Magical Tonic?",                              GAME_WRONG_COLORS | GAME_NOT_WORKING )
75137545
src/mame/drivers/system16.c
r4499r4500
304304   }
305305}
306306
307static ADDRESS_MAP_START( tturfbl_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
308   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
307static ADDRESS_MAP_START(tturfbl_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
308   AM_RANGE(0x0000, 0x7fff) AM_ROM
309309   AM_RANGE(0x8000, 0xbfff) AM_READ(tturfbl_soundbank_r)
310   AM_RANGE(0xe800, 0xe800) AM_READ(soundlatch_r)
311   AM_RANGE(0xf800, 0xffff) AM_READ(SMH_RAM)
312ADDRESS_MAP_END
313
314static ADDRESS_MAP_START(tturfbl_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
315   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
316   AM_RANGE(0x8000, 0xbfff) AM_WRITENOP /* ROM bank */
317310   AM_RANGE(0xe000, 0xe000) AM_WRITE(tturfbl_soundbank_w)
311   AM_RANGE(0xe800, 0xe800) AM_READ(soundlatch_r)
318312   AM_RANGE(0xf000, 0xf000) AM_WRITE(tturfbl_msm5205_data_w)
319   AM_RANGE(0xf800, 0xffff) AM_WRITE(SMH_RAM)
313   AM_RANGE(0xf800, 0xffff) AM_RAM
320314ADDRESS_MAP_END
321315
322static ADDRESS_MAP_START( tturfbl_sound_readport, ADDRESS_SPACE_IO, 8 )
316static ADDRESS_MAP_START( tturfbl_sound_io_map, ADDRESS_SPACE_IO, 8 )
323317   ADDRESS_MAP_GLOBAL_MASK(0xff)
324   AM_RANGE(0x00, 0x01) AM_DEVREAD("ym", ym2151_r)
325   AM_RANGE(0x80, 0x80) AM_READNOP
326ADDRESS_MAP_END
327
328static ADDRESS_MAP_START( tturfbl_sound_writeport, ADDRESS_SPACE_IO, 8 )
329   ADDRESS_MAP_GLOBAL_MASK(0xff)
330   AM_RANGE(0x00, 0x01) AM_DEVWRITE("ym", ym2151_w)
318   AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ym", ym2151_r, ym2151_w)
331319   AM_RANGE(0x40, 0x40) AM_WRITENOP
332   AM_RANGE(0x80, 0x80) AM_WRITENOP
320   AM_RANGE(0x80, 0x80) AM_NOP
333321ADDRESS_MAP_END
334322
335323/*******************************************************************************/
336324
337static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
338   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
325static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
326   AM_RANGE(0x0000, 0x7fff) AM_ROM
339327   AM_RANGE(0xe800, 0xe800) AM_READ(soundlatch_r)
340   AM_RANGE(0xf800, 0xffff) AM_READ(SMH_RAM)
328   AM_RANGE(0xf800, 0xffff) AM_RAM
341329ADDRESS_MAP_END
342330
343static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
344   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
345   AM_RANGE(0xf800, 0xffff) AM_WRITE(SMH_RAM)
346ADDRESS_MAP_END
347
348static ADDRESS_MAP_START( sound_readport, ADDRESS_SPACE_IO, 8 )
331static ADDRESS_MAP_START( sound_io_map, ADDRESS_SPACE_IO, 8 )
349332   ADDRESS_MAP_GLOBAL_MASK(0xff)
350   AM_RANGE(0x00, 0x01) AM_DEVREAD("ym", ym2151_r)
333   AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ym", ym2151_r, ym2151_w)
351334   AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_r)
352335ADDRESS_MAP_END
353336
354static ADDRESS_MAP_START( sound_writeport, ADDRESS_SPACE_IO, 8 )
355   ADDRESS_MAP_GLOBAL_MASK(0xff)
356   AM_RANGE(0x00, 0x01) AM_DEVWRITE("ym", ym2151_w)
357ADDRESS_MAP_END
358337
359
360338// 7759
361static ADDRESS_MAP_START( sound_readmem_7759, ADDRESS_SPACE_PROGRAM, 8 )
362   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
363   AM_RANGE(0x8000, 0xdfff) AM_READ(SMH_BANK1)
339static ADDRESS_MAP_START( sound_7759_map, ADDRESS_SPACE_PROGRAM, 8 )
340   AM_RANGE(0x0000, 0x7fff) AM_ROM
341   AM_RANGE(0x8000, 0xdfff) AM_ROMBANK(1)
364342   AM_RANGE(0xe800, 0xe800) AM_READ(soundlatch_r)
365   AM_RANGE(0xf800, 0xffff) AM_READ(SMH_RAM)
343   AM_RANGE(0xf800, 0xffff) AM_RAM
366344ADDRESS_MAP_END
367345
368346
r4499r4500
376354}
377355
378356
379static ADDRESS_MAP_START( sound_writeport_7759, ADDRESS_SPACE_IO, 8 )
357static ADDRESS_MAP_START( sound_7759_io_map, ADDRESS_SPACE_IO, 8 )
380358   ADDRESS_MAP_GLOBAL_MASK(0xff)
381   AM_RANGE(0x00, 0x01) AM_DEVWRITE("ym", ym2151_w)
359   AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("ym", ym2151_r, ym2151_w)
382360   AM_RANGE(0x40, 0x40) AM_DEVWRITE("7759", upd7759_bank_w)
383361   AM_RANGE(0x80, 0x80) AM_DEVWRITE("7759", upd7759_port_w)
362   AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_r)
384363ADDRESS_MAP_END
385364
386365
r4499r4500
429408   MDRV_CPU_VBLANK_INT("screen", sys16_interrupt)
430409
431410   MDRV_CPU_ADD("soundcpu", Z80, 4000000)
432   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
433   MDRV_CPU_IO_MAP(sound_readport,sound_writeport)
411   MDRV_CPU_PROGRAM_MAP(sound_map,0)
412   MDRV_CPU_IO_MAP(sound_io_map,0)
434413
435414   /* video hardware */
436415   MDRV_SCREEN_ADD("screen", RASTER)
r4499r4500
461440   MDRV_IMPORT_FROM(system16)
462441
463442   MDRV_CPU_MODIFY("soundcpu")
464   MDRV_CPU_PROGRAM_MAP(sound_readmem_7759,sound_writemem)
465   MDRV_CPU_IO_MAP(sound_readport,sound_writeport_7759)
443   MDRV_CPU_PROGRAM_MAP(sound_7759_map,0)
444   MDRV_CPU_IO_MAP(sound_7759_io_map,0)
466445
467446   /* sound hardware */
468447   MDRV_SOUND_ADD("7759", UPD7759, UPD7759_STANDARD_CLOCK)
r4499r4500
619598#endif
620599/****************************************************************************/
621600
622static ADDRESS_MAP_START( bayroute_readmem, ADDRESS_SPACE_PROGRAM, 16 )
623   AM_RANGE(0x000000, 0x0bffff) AM_READ(SMH_ROM)
624   AM_RANGE(0x500000, 0x503fff) AM_READ(SYS16_MRA16_WORKINGRAM)
625   AM_RANGE(0x600000, 0x600fff) AM_READ(SYS16_MRA16_SPRITERAM)
626   AM_RANGE(0x700000, 0x70ffff) AM_READ(SYS16_MRA16_TILERAM)
627   AM_RANGE(0x710000, 0x710fff) AM_READ(SYS16_MRA16_TEXTRAM)
628   AM_RANGE(0x800000, 0x800fff) AM_READ(SYS16_MRA16_PALETTERAM)
601static ADDRESS_MAP_START( bayroute_map, ADDRESS_SPACE_PROGRAM, 16 )
602   AM_RANGE(0x000000, 0x0bffff) AM_ROM
603   AM_RANGE(0x100000, 0x100003) AM_WRITENOP // tilebank control?
604   AM_RANGE(0x500000, 0x503fff) AM_READWRITE(SYS16_MRA16_WORKINGRAM, SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
605   AM_RANGE(0x600000, 0x600fff) AM_READWRITE(SYS16_MRA16_SPRITERAM, SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
606   AM_RANGE(0x700000, 0x70ffff) AM_READWRITE(SYS16_MRA16_TILERAM, SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
607   AM_RANGE(0x710000, 0x710fff) AM_READWRITE(SYS16_MRA16_TEXTRAM, SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
608   AM_RANGE(0x800000, 0x800fff) AM_READWRITE(SYS16_MRA16_PALETTERAM, SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
609   AM_RANGE(0x900000, 0x900001) AM_WRITE(sys16_coinctrl_w)
629610   AM_RANGE(0x901002, 0x901003) AM_READ_PORT("P1")
630611   AM_RANGE(0x901006, 0x901007) AM_READ_PORT("P2")
631612   AM_RANGE(0x901000, 0x901001) AM_READ_PORT("SERVICE")
632613   AM_RANGE(0x902002, 0x902003) AM_READ_PORT("DSW1")
633614   AM_RANGE(0x902000, 0x902001) AM_READ_PORT("DSW2")
634ADDRESS_MAP_END
635
636static ADDRESS_MAP_START( bayroute_writemem, ADDRESS_SPACE_PROGRAM, 16 )
637   AM_RANGE(0x000000, 0x0bffff) AM_WRITE(SMH_ROM)
638   AM_RANGE(0x100000, 0x100003) AM_WRITENOP // tilebank control?
639   AM_RANGE(0x500000, 0x503fff) AM_WRITE(SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
640   AM_RANGE(0x600000, 0x600fff) AM_WRITE(SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
641   AM_RANGE(0x700000, 0x70ffff) AM_WRITE(SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
642   AM_RANGE(0x710000, 0x710fff) AM_WRITE(SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
643   AM_RANGE(0x800000, 0x800fff) AM_WRITE(SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
644   AM_RANGE(0x900000, 0x900001) AM_WRITE(sys16_coinctrl_w)
645615   AM_RANGE(0xff0006, 0xff0007) AM_WRITE(sound_command_w)
646616   AM_RANGE(0xff0020, 0xff003f) AM_WRITENOP // config regs
647617ADDRESS_MAP_END
r4499r4500
712682   /* basic machine hardware */
713683   MDRV_IMPORT_FROM(system16_7759)
714684   MDRV_CPU_MODIFY("maincpu")
715   MDRV_CPU_PROGRAM_MAP(bayroute_readmem,bayroute_writemem)
685   MDRV_CPU_PROGRAM_MAP(bayroute_map,0)
716686
717687   MDRV_MACHINE_RESET(bayroute)
718688MACHINE_DRIVER_END
719689
720690/***************************************************************************/
721691
722static ADDRESS_MAP_START( dduxbl_readmem, ADDRESS_SPACE_PROGRAM, 16 )
723   AM_RANGE(0x000000, 0x0bffff) AM_READ(SMH_ROM)
724   AM_RANGE(0x400000, 0x40ffff) AM_READ(SYS16_MRA16_TILERAM)
725   AM_RANGE(0x410000, 0x410fff) AM_READ(SYS16_MRA16_TEXTRAM)
726   AM_RANGE(0x440000, 0x440fff) AM_READ(SYS16_MRA16_SPRITERAM)
727   AM_RANGE(0x840000, 0x840fff) AM_READ(SYS16_MRA16_PALETTERAM)
692static ADDRESS_MAP_START( dduxbl_map, ADDRESS_SPACE_PROGRAM, 16 )
693   AM_RANGE(0x000000, 0x0bffff) AM_ROM
694   AM_RANGE(0x3f0000, 0x3fffff) AM_WRITE(sys16_tilebank_w)
695   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(SYS16_MRA16_TILERAM, SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
696   AM_RANGE(0x410000, 0x410fff) AM_READWRITE(SYS16_MRA16_TEXTRAM, SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
697   AM_RANGE(0x440000, 0x440fff) AM_READWRITE(SYS16_MRA16_SPRITERAM, SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
698   AM_RANGE(0x840000, 0x840fff) AM_READWRITE(SYS16_MRA16_PALETTERAM, SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
699   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
700   AM_RANGE(0xc40006, 0xc40007) AM_WRITE(sound_command_w)
728701   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
729702   AM_RANGE(0xc41004, 0xc41005) AM_READ_PORT("P2")
730703   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
731704   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
732705   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
733   AM_RANGE(0xffc000, 0xffffff) AM_READ(SYS16_MRA16_WORKINGRAM)
734ADDRESS_MAP_END
735
736static ADDRESS_MAP_START( dduxbl_writemem, ADDRESS_SPACE_PROGRAM, 16 )
737   AM_RANGE(0x000000, 0x0bffff) AM_WRITE(SMH_ROM)
738   AM_RANGE(0x3f0000, 0x3fffff) AM_WRITE(sys16_tilebank_w)
739   AM_RANGE(0x400000, 0x40ffff) AM_WRITE(SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
740   AM_RANGE(0x410000, 0x410fff) AM_WRITE(SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
741   AM_RANGE(0x440000, 0x440fff) AM_WRITE(SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
742   AM_RANGE(0x840000, 0x840fff) AM_WRITE(SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
743   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
744   AM_RANGE(0xc40006, 0xc40007) AM_WRITE(sound_command_w)
745706   AM_RANGE(0xc46000, 0xc4603f) AM_WRITE(SYS16_MWA16_EXTRAM2) AM_BASE(&sys16_extraram2)
746707   AM_RANGE(0xfe0020, 0xfe003f) AM_WRITENOP // config regs
747   AM_RANGE(0xffc000, 0xffffff) AM_WRITE(SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
708   AM_RANGE(0xffc000, 0xffffff) AM_READWRITE(SYS16_MRA16_WORKINGRAM, SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
748709ADDRESS_MAP_END
749710
750711/***************************************************************************/
r4499r4500
856817   /* basic machine hardware */
857818   MDRV_IMPORT_FROM(system16)
858819   MDRV_CPU_MODIFY("maincpu")
859   MDRV_CPU_PROGRAM_MAP(dduxbl_readmem,dduxbl_writemem)
820   MDRV_CPU_PROGRAM_MAP(dduxbl_map,0)
860821
861822   MDRV_MACHINE_RESET(dduxbl)
862823MACHINE_DRIVER_END
863824
864825/***************************************************************************/
865826
866static ADDRESS_MAP_START( eswat_readmem, ADDRESS_SPACE_PROGRAM, 16 )
867   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
868   AM_RANGE(0x400000, 0x40ffff) AM_READ(SYS16_MRA16_TILERAM)
869   AM_RANGE(0x410000, 0x418fff) AM_READ(SYS16_MRA16_TEXTRAM) //*
870   AM_RANGE(0x440000, 0x440fff) AM_READ(SYS16_MRA16_SPRITERAM)
871   AM_RANGE(0x840000, 0x840fff) AM_READ(SYS16_MRA16_PALETTERAM)
872   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
873   AM_RANGE(0xc41006, 0xc41007) AM_READ_PORT("P2")
874   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
875   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
876   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
877   AM_RANGE(0xffc000, 0xffffff) AM_READ(SYS16_MRA16_WORKINGRAM)
878ADDRESS_MAP_END
879
880827static int eswat_tilebank0;
881828
882829static WRITE16_HANDLER( eswat_tilebank0_w )
r4499r4500
888835}
889836
890837
891static ADDRESS_MAP_START( eswatbl_writemem, ADDRESS_SPACE_PROGRAM, 16 )
892   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
838static ADDRESS_MAP_START( eswatbl_map, ADDRESS_SPACE_PROGRAM, 16 )
839   AM_RANGE(0x000000, 0x07ffff) AM_ROM
893840   AM_RANGE(0x3e2000, 0x3e2001) AM_WRITE(eswat_tilebank0_w)
894   AM_RANGE(0x400000, 0x40ffff) AM_WRITE(SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
895   AM_RANGE(0x410000, 0x418fff) AM_WRITE(SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
896   AM_RANGE(0x440000, 0x440fff) AM_WRITE(SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
897   AM_RANGE(0x840000, 0x840fff) AM_WRITE(SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
898   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w)
841   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(SYS16_MRA16_TILERAM, SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
842   AM_RANGE(0x410000, 0x418fff) AM_READWRITE(SYS16_MRA16_TEXTRAM, SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
843   AM_RANGE(0x440000, 0x440fff) AM_READWRITE(SYS16_MRA16_SPRITERAM, SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
844   AM_RANGE(0x840000, 0x840fff) AM_READWRITE(SYS16_MRA16_PALETTERAM, SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
899845   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
846   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
847   AM_RANGE(0xc41006, 0xc41007) AM_READ_PORT("P2")
848   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
849   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
850   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
851   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w)
900852   AM_RANGE(0xc80000, 0xc80001) AM_WRITENOP
901   AM_RANGE(0xffc000, 0xffffff) AM_WRITE(SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
853   AM_RANGE(0xffc000, 0xffffff) AM_READWRITE(SYS16_MRA16_WORKINGRAM, SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
902854ADDRESS_MAP_END
903855
904856/***************************************************************************/
r4499r4500
984936   /* basic machine hardware */
985937   MDRV_IMPORT_FROM(system16_7759)
986938   MDRV_CPU_MODIFY("maincpu")
987   MDRV_CPU_PROGRAM_MAP(eswat_readmem,eswatbl_writemem)
939   MDRV_CPU_PROGRAM_MAP(eswatbl_map,0)
988940
989941   MDRV_MACHINE_RESET(eswatbl)
990942MACHINE_DRIVER_END
r4499r4500
11581110    Flash Point (Datsu bootlegs = fpointbl, fpointbj)
11591111    Has sound latch at $E000 instead of I/O ports $C0-FF
11601112*/
1161static ADDRESS_MAP_START( fpointbl_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
1162   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
1113static ADDRESS_MAP_START( fpointbl_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
1114   AM_RANGE(0x0000, 0x7fff) AM_ROM
11631115   AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r)
1164   AM_RANGE(0xf800, 0xffff) AM_READ(SMH_RAM)
1116   AM_RANGE(0xf800, 0xffff) AM_RAM
11651117ADDRESS_MAP_END
11661118
11671119static MACHINE_DRIVER_START( fpointbl )
r4499r4500
11721124   MDRV_CPU_PROGRAM_MAP(fpointbl_map,0)
11731125
11741126   MDRV_CPU_MODIFY("soundcpu")
1175   MDRV_CPU_PROGRAM_MAP(fpointbl_sound_readmem,sound_writemem)
1127   MDRV_CPU_PROGRAM_MAP(fpointbl_sound_map,0)
11761128
11771129   MDRV_MACHINE_RESET(fpointbl)
11781130MACHINE_DRIVER_END
r4499r4500
11871139   return (input_port_read(space->machine,"SERVICE") << 8) | (sys16_workingram[0x2c96/2] & 0x00ff);
11881140}
11891141
1190static ADDRESS_MAP_START( goldnaxe_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1191   AM_RANGE(0x000000, 0x0bffff) AM_READ(SMH_ROM)
1192   AM_RANGE(0x100000, 0x10ffff) AM_READ(SYS16_MRA16_TILERAM)
1193   AM_RANGE(0x110000, 0x110fff) AM_READ(SYS16_MRA16_TEXTRAM)
1194   AM_RANGE(0x140000, 0x140fff) AM_READ(SYS16_MRA16_PALETTERAM)
1195   AM_RANGE(0x1f0000, 0x1f0003) AM_READ(SYS16_MRA16_EXTRAM)
1196   AM_RANGE(0x200000, 0x200fff) AM_READ(SYS16_MRA16_SPRITERAM)
1197   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
1198   AM_RANGE(0xc41006, 0xc41007) AM_READ_PORT("P2")
1199   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
1200   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
1201   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
1202   AM_RANGE(0xffecd0, 0xffecd1) AM_READ(ga_io_players_r)
1203   AM_RANGE(0xffec96, 0xffec97) AM_READ(ga_io_service_r)
1204   AM_RANGE(0xffc000, 0xffffff) AM_READ(SYS16_MRA16_WORKINGRAM)
1205ADDRESS_MAP_END
1206
12071142static WRITE16_HANDLER( ga_sound_command_w )
12081143{
12091144   COMBINE_DATA( &sys16_workingram[(0xecfc-0xc000)/2] );
r4499r4500
12231158   COMBINE_DATA( &sys16_workingram[(0xec1c-0xc000)/2] );
12241159}
12251160
1226static ADDRESS_MAP_START( goldnaxe_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1227   AM_RANGE(0x000000, 0x0bffff) AM_WRITE(SMH_ROM)
1228   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
1229   AM_RANGE(0x110000, 0x110fff) AM_WRITE(SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
1230   AM_RANGE(0x140000, 0x140fff) AM_WRITE(SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
1231   AM_RANGE(0x1f0000, 0x1f0003) AM_WRITE(SYS16_MWA16_EXTRAM) AM_BASE(&sys16_extraram)
1232   AM_RANGE(0x200000, 0x200fff) AM_WRITE(SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
1161static ADDRESS_MAP_START( goldnaxe_map, ADDRESS_SPACE_PROGRAM, 16 )
1162   AM_RANGE(0x000000, 0x0bffff) AM_ROM
1163   AM_RANGE(0x100000, 0x10ffff) AM_READWRITE(SYS16_MRA16_TILERAM, SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
1164   AM_RANGE(0x110000, 0x110fff) AM_READWRITE(SYS16_MRA16_TEXTRAM, SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
1165   AM_RANGE(0x140000, 0x140fff) AM_READWRITE(SYS16_MRA16_PALETTERAM, SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
1166   AM_RANGE(0x1f0000, 0x1f0003) AM_READWRITE(SYS16_MRA16_EXTRAM, SYS16_MWA16_EXTRAM) AM_BASE(&sys16_extraram)
1167   AM_RANGE(0x200000, 0x200fff) AM_READWRITE(SYS16_MRA16_SPRITERAM, SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
12331168   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
1169   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
1170   AM_RANGE(0xc41006, 0xc41007) AM_READ_PORT("P2")
1171   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
1172   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
1173   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
12341174   AM_RANGE(0xc43000, 0xc43001) AM_WRITENOP // ?
12351175//  AM_RANGE(0xfe0006, 0xfe0007) AM_WRITENOP I think this is the real sound out
12361176   AM_RANGE(0xffec1c, 0xffec1d) AM_WRITE(goldnaxe_prot_w)// how does this really work?
1177   AM_RANGE(0xffecd0, 0xffecd1) AM_READ(ga_io_players_r)
1178   AM_RANGE(0xffec96, 0xffec97) AM_READ(ga_io_service_r)
12371179   AM_RANGE(0xffecfc, 0xffecfd) AM_WRITE(ga_sound_command_w)// probably just a buffer
1238   AM_RANGE(0xffc000, 0xffffff) AM_WRITE(SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram) /* fails SCRATCH RAM test because of hacks */
1180   AM_RANGE(0xffc000, 0xffffff) AM_READWRITE(SYS16_MRA16_WORKINGRAM, SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram) /* fails SCRATCH RAM test because of hacks */
12391181//  AM_RANGE(0xfffc00, 0xffffff) AM_WRITE(MWA15_NOP) /* 0x400 bytes; battery backed up */
12401182ADDRESS_MAP_END
12411183
r4499r4500
13271269   /* basic machine hardware */
13281270   MDRV_IMPORT_FROM(system16_7759)
13291271   MDRV_CPU_MODIFY("maincpu")
1330   MDRV_CPU_PROGRAM_MAP(goldnaxe_readmem,goldnaxe_writemem)
1272   MDRV_CPU_PROGRAM_MAP(goldnaxe_map,0)
13311273
13321274   MDRV_MACHINE_RESET(goldnaxe)
13331275MACHINE_DRIVER_END
13341276
13351277/***************************************************************************/
13361278
1337static ADDRESS_MAP_START( passsht_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1338   AM_RANGE(0x000000, 0x01ffff) AM_READ(SMH_ROM)
1339   AM_RANGE(0x400000, 0x40ffff) AM_READ(SYS16_MRA16_TILERAM)
1340   AM_RANGE(0x410000, 0x410fff) AM_READ(SYS16_MRA16_TEXTRAM)
1341   AM_RANGE(0x440000, 0x440fff) AM_READ(SYS16_MRA16_SPRITERAM)
1342   AM_RANGE(0x840000, 0x840fff) AM_READ(SYS16_MRA16_PALETTERAM)
1279static ADDRESS_MAP_START( passsht_map, ADDRESS_SPACE_PROGRAM, 16 )
1280   AM_RANGE(0x000000, 0x01ffff) AM_ROM
1281   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(SYS16_MRA16_TILERAM, SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
1282   AM_RANGE(0x410000, 0x410fff) AM_READWRITE(SYS16_MRA16_TEXTRAM, SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
1283   AM_RANGE(0x440000, 0x440fff) AM_READWRITE(SYS16_MRA16_SPRITERAM, SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
1284   AM_RANGE(0x840000, 0x840fff) AM_READWRITE(SYS16_MRA16_PALETTERAM, SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
1285   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
13431286   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
13441287   AM_RANGE(0xc41004, 0xc41005) AM_READ_PORT("P2")
13451288   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
13461289   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
13471290   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
1348   AM_RANGE(0xffc000, 0xffffff) AM_READ(SYS16_MRA16_WORKINGRAM)
1349ADDRESS_MAP_END
1350
1351static ADDRESS_MAP_START( passsht_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1352   AM_RANGE(0x000000, 0x01ffff) AM_WRITE(SMH_ROM)
1353   AM_RANGE(0x400000, 0x40ffff) AM_WRITE(SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
1354   AM_RANGE(0x410000, 0x410fff) AM_WRITE(SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
1355   AM_RANGE(0x440000, 0x440fff) AM_WRITE(SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
1356   AM_RANGE(0x840000, 0x840fff) AM_WRITE(SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
13571291   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w)
1358   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
1359   AM_RANGE(0xffc000, 0xffffff) AM_WRITE(SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
1292   AM_RANGE(0xffc000, 0xffffff) AM_READWRITE(SYS16_MRA16_WORKINGRAM, SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
13601293ADDRESS_MAP_END
13611294
13621295static int passht4b_io1_val;
r4499r4500
14141347   return passht4b_io3_val;
14151348}
14161349
1417static ADDRESS_MAP_START( passht4b_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1418   AM_RANGE(0x000000, 0x01ffff) AM_READ(SMH_ROM)
1419   AM_RANGE(0x400000, 0x40ffff) AM_READ(SYS16_MRA16_TILERAM)
1420   AM_RANGE(0x410000, 0x410fff) AM_READ(SYS16_MRA16_TEXTRAM)
1421   AM_RANGE(0x440000, 0x440fff) AM_READ(SYS16_MRA16_SPRITERAM)
1422   AM_RANGE(0x840000, 0x840fff) AM_READ(SYS16_MRA16_PALETTERAM)
1350static ADDRESS_MAP_START( passht4b_map, ADDRESS_SPACE_PROGRAM, 16 )
1351   AM_RANGE(0x000000, 0x01ffff) AM_ROM
1352   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(SYS16_MRA16_TILERAM, SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
1353   AM_RANGE(0x410000, 0x410fff) AM_READWRITE(SYS16_MRA16_TEXTRAM, SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
1354   AM_RANGE(0x440000, 0x440fff) AM_READWRITE(SYS16_MRA16_SPRITERAM, SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
1355   AM_RANGE(0x840000, 0x840fff) AM_READWRITE(SYS16_MRA16_PALETTERAM, SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
14231356   AM_RANGE(0xc41000, 0xc41001) AM_READ(passht4b_service_r)
14241357   AM_RANGE(0xc41002, 0xc41003) AM_READ(passht4b_io1_r)
14251358   AM_RANGE(0xc41004, 0xc41005) AM_READ(passht4b_io2_r)
14261359   AM_RANGE(0xc41006, 0xc41007) AM_READ(passht4b_io3_r)
1427   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
14281360   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
1361   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
1362   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w)
14291363   AM_RANGE(0xc43000, 0xc43001) AM_READ_PORT("P1")      // test mode only
14301364   AM_RANGE(0xc43002, 0xc43003) AM_READ_PORT("P2")
14311365   AM_RANGE(0xc43004, 0xc43005) AM_READ_PORT("P3")
14321366   AM_RANGE(0xc43006, 0xc43007) AM_READ_PORT("P4")
1433   AM_RANGE(0xffc000, 0xffffff) AM_READ(SYS16_MRA16_WORKINGRAM)
1434ADDRESS_MAP_END
1435
1436static ADDRESS_MAP_START( passht4b_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1437   AM_RANGE(0x000000, 0x01ffff) AM_WRITE(SMH_ROM)
1438   AM_RANGE(0x400000, 0x40ffff) AM_WRITE(SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
1439   AM_RANGE(0x410000, 0x410fff) AM_WRITE(SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
1440   AM_RANGE(0x440000, 0x440fff) AM_WRITE(SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
1441   AM_RANGE(0x840000, 0x840fff) AM_WRITE(SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
1442   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w)
14431367   AM_RANGE(0xc4600a, 0xc4600b) AM_WRITE(sys16_coinctrl_w)   /* coin counter doesn't work */
1444   AM_RANGE(0xffc000, 0xffffff) AM_WRITE(SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
1368   AM_RANGE(0xffc000, 0xffffff) AM_READWRITE(SYS16_MRA16_WORKINGRAM, SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
14451369ADDRESS_MAP_END
14461370
14471371/***************************************************************************/
r4499r4500
15991523   /* basic machine hardware */
16001524   MDRV_IMPORT_FROM(system16_7759)
16011525   MDRV_CPU_MODIFY("maincpu")
1602   MDRV_CPU_PROGRAM_MAP(passsht_readmem,passsht_writemem)
1526   MDRV_CPU_PROGRAM_MAP(passsht_map,0)
16031527
16041528   MDRV_MACHINE_RESET(passsht)
16051529MACHINE_DRIVER_END
r4499r4500
16101534   /* basic machine hardware */
16111535   MDRV_IMPORT_FROM(system16_7759)
16121536   MDRV_CPU_MODIFY("maincpu")
1613   MDRV_CPU_PROGRAM_MAP(passht4b_readmem,passht4b_writemem)
1537   MDRV_CPU_PROGRAM_MAP(passht4b_map,0)
16141538
16151539   MDRV_MACHINE_RESET(passht4b)
16161540MACHINE_DRIVER_END
r4499r4500
16471571
16481572/***************************************************************************/
16491573
1650static ADDRESS_MAP_START( shinobl_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1651   AM_RANGE(0x000000, 0x03ffff) AM_READ(SMH_ROM)
1652   AM_RANGE(0x400000, 0x40ffff) AM_READ(SYS16_MRA16_TILERAM)
1653   AM_RANGE(0x410000, 0x410fff) AM_READ(SYS16_MRA16_TEXTRAM)
1654   AM_RANGE(0x440000, 0x440fff) AM_READ(SYS16_MRA16_SPRITERAM)
1655   AM_RANGE(0x840000, 0x840fff) AM_READ(SYS16_MRA16_PALETTERAM)
1574static ADDRESS_MAP_START( shinobl_map, ADDRESS_SPACE_PROGRAM, 16 )
1575   AM_RANGE(0x000000, 0x03ffff) AM_ROM
1576   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(SYS16_MRA16_TILERAM, SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
1577   AM_RANGE(0x410000, 0x410fff) AM_READWRITE(SYS16_MRA16_TEXTRAM, SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
1578   AM_RANGE(0x440000, 0x440fff) AM_READWRITE(SYS16_MRA16_SPRITERAM, SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
1579   AM_RANGE(0x840000, 0x840fff) AM_READWRITE(SYS16_MRA16_PALETTERAM, SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
1580   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sound_command_nmi_w)
1581   AM_RANGE(0xc40002, 0xc40003) AM_WRITE(sys16_3d_coinctrl_w)
1582   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
16561583   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
16571584   AM_RANGE(0xc41006, 0xc41007) AM_READ_PORT("P2")
1658   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
16591585   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW1")
16601586   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW2")
1661   AM_RANGE(0xffc000, 0xffffff) AM_READ(SYS16_MRA16_WORKINGRAM)
1587   AM_RANGE(0xffc000, 0xffffff) AM_READWRITE(SYS16_MRA16_WORKINGRAM, SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
16621588ADDRESS_MAP_END
16631589
1664static ADDRESS_MAP_START( shinobl_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1665   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(SMH_ROM)
1666   AM_RANGE(0x400000, 0x40ffff) AM_WRITE(SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
1667   AM_RANGE(0x410000, 0x410fff) AM_WRITE(SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
1668   AM_RANGE(0x440000, 0x440fff) AM_WRITE(SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
1669   AM_RANGE(0x840000, 0x840fff) AM_WRITE(SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
1670   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sound_command_nmi_w)
1671   AM_RANGE(0xc40002, 0xc40003) AM_WRITE(sys16_3d_coinctrl_w)
1672   AM_RANGE(0xffc000, 0xffffff) AM_WRITE(SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
1673ADDRESS_MAP_END
1674
16751590/***************************************************************************/
16761591
16771592static void shinobl_update_proc( void )
r4499r4500
17121627   /* basic machine hardware */
17131628   MDRV_IMPORT_FROM(system16)
17141629   MDRV_CPU_MODIFY("maincpu")
1715   MDRV_CPU_PROGRAM_MAP(shinobl_readmem,shinobl_writemem)
1630   MDRV_CPU_PROGRAM_MAP(shinobl_map,0)
17161631
17171632   MDRV_MACHINE_RESET(shinobl)
17181633MACHINE_DRIVER_END
r4499r4500
17211636
17221637/* bootleg has extra ram for regs? */
17231638
1724static ADDRESS_MAP_START( tetrisbl_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1725   AM_RANGE(0x000000, 0x03ffff) AM_READ(SMH_ROM)
1726   AM_RANGE(0x400000, 0x40ffff) AM_READ(SYS16_MRA16_TILERAM)
1727   AM_RANGE(0x410000, 0x410fff) AM_READ(SYS16_MRA16_TEXTRAM)
1728   AM_RANGE(0x418000, 0x41803f) AM_READ(SYS16_MRA16_EXTRAM2)
1729   AM_RANGE(0x440000, 0x440fff) AM_READ(SYS16_MRA16_SPRITERAM)
1730   AM_RANGE(0x840000, 0x840fff) AM_READ(SYS16_MRA16_PALETTERAM)
1639static ADDRESS_MAP_START( tetrisbl_map, ADDRESS_SPACE_PROGRAM, 16 )
1640   AM_RANGE(0x000000, 0x03ffff) AM_ROM
1641   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(SYS16_MRA16_TILERAM, SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
1642   AM_RANGE(0x410000, 0x410fff) AM_READWRITE(SYS16_MRA16_TEXTRAM, SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
1643   AM_RANGE(0x418000, 0x41803f) AM_READWRITE(SYS16_MRA16_EXTRAM2, SYS16_MWA16_EXTRAM2) AM_BASE(&sys16_extraram2)
1644   AM_RANGE(0x440000, 0x440fff) AM_READWRITE(SYS16_MRA16_SPRITERAM, SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
1645   AM_RANGE(0x840000, 0x840fff) AM_READWRITE(SYS16_MRA16_PALETTERAM, SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
1646   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
1647   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
17311648   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
17321649   AM_RANGE(0xc41006, 0xc41007) AM_READ_PORT("P2")
1733   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
1734   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
17351650   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
1736   AM_RANGE(0xc80000, 0xc80001) AM_READNOP
1737   AM_RANGE(0xffc000, 0xffffff) AM_READ(SYS16_MRA16_WORKINGRAM)
1738ADDRESS_MAP_END
1739
1740static ADDRESS_MAP_START( tetrisbl_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1741   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(SMH_ROM)
1742   AM_RANGE(0x400000, 0x40ffff) AM_WRITE(SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
1743   AM_RANGE(0x410000, 0x410fff) AM_WRITE(SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
1744   AM_RANGE(0x418000, 0x41803f) AM_WRITE(SYS16_MWA16_EXTRAM2) AM_BASE(&sys16_extraram2)
1745   AM_RANGE(0x440000, 0x440fff) AM_WRITE(SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
1746   AM_RANGE(0x840000, 0x840fff) AM_WRITE(SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
1747   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
1651   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
17481652   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w)
17491653   AM_RANGE(0xc43034, 0xc43035) AM_WRITENOP
1750   AM_RANGE(0xc80000, 0xc80001) AM_WRITENOP
1751   AM_RANGE(0xffc000, 0xffffff) AM_WRITE(SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
1654   AM_RANGE(0xc80000, 0xc80001) AM_NOP
1655   AM_RANGE(0xffc000, 0xffffff) AM_READWRITE(SYS16_MRA16_WORKINGRAM, SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
17521656ADDRESS_MAP_END
17531657
17541658
r4499r4500
17651669}
17661670
17671671static ADDRESS_MAP_START( beautyb_map, ADDRESS_SPACE_PROGRAM, 16 )
1768   AM_RANGE(0x000000, 0x00ffff) AM_READWRITE(SMH_ROM, SMH_NOP)
1672   AM_RANGE(0x000000, 0x00ffff) AM_ROM
17691673   //AM_RANGE(0x010000, 0x03ffff) AM_WRITENOP
17701674
17711675   AM_RANGE(0x0280D6, 0x0280D7) AM_READ(beautyb_unk2_r)
r4499r4500
17831687   AM_RANGE(0xc40000, 0xc40001) AM_WRITENOP
17841688   AM_RANGE(0xc80000, 0xc80001) AM_WRITENOP
17851689
1786   AM_RANGE(0xffc000, 0xffffff) AM_RAM_WRITE(SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
1690   AM_RANGE(0xffc000, 0xffffff) AM_READWRITE(SYS16_MRA16_WORKINGRAM, SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
17871691ADDRESS_MAP_END
17881692
17891693/***************************************************************************/
r4499r4500
18541758   /* basic machine hardware */
18551759   MDRV_IMPORT_FROM(system16)
18561760   MDRV_CPU_MODIFY("maincpu")
1857   MDRV_CPU_PROGRAM_MAP(tetrisbl_readmem,tetrisbl_writemem)
1761   MDRV_CPU_PROGRAM_MAP(tetrisbl_map,0)
18581762
18591763   MDRV_MACHINE_RESET(tetrisbl)
18601764MACHINE_DRIVER_END
r4499r4500
19431847
19441848/***************************************************************************/
19451849
1946static ADDRESS_MAP_START( tturfbl_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1947   AM_RANGE(0x000000, 0x03ffff) AM_READ(SMH_ROM)
1850static ADDRESS_MAP_START( tturfbl_map, ADDRESS_SPACE_PROGRAM, 16 )
1851   AM_RANGE(0x000000, 0x03ffff) AM_ROM
19481852   AM_RANGE(0x2001e6, 0x2001e7) AM_READ(tt_io_service_r)
19491853   AM_RANGE(0x2001e8, 0x2001e9) AM_READ(tt_io_player1_r)
19501854   AM_RANGE(0x2001ea, 0x2001eb) AM_READ(tt_io_player2_r)
1951   AM_RANGE(0x200000, 0x203fff) AM_READ(SYS16_MRA16_EXTRAM)
1952   AM_RANGE(0x300000, 0x300fff) AM_READ(SYS16_MRA16_SPRITERAM)
1953   AM_RANGE(0x400000, 0x40ffff) AM_READ(SYS16_MRA16_TILERAM)
1954   AM_RANGE(0x410000, 0x410fff) AM_READ(SYS16_MRA16_TEXTRAM)
1955   AM_RANGE(0x500000, 0x500fff) AM_READ(SYS16_MRA16_PALETTERAM)
1956   AM_RANGE(0x600002, 0x600003) AM_READ_PORT("DSW1")
1855   AM_RANGE(0x200000, 0x203fff) AM_READWRITE(SYS16_MRA16_EXTRAM, SYS16_MWA16_EXTRAM) AM_BASE(&sys16_extraram)
1856   AM_RANGE(0x300000, 0x300fff) AM_READWRITE(SYS16_MRA16_SPRITERAM, SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
1857   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(SYS16_MRA16_TILERAM, SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
1858   AM_RANGE(0x410000, 0x410fff) AM_READWRITE(SYS16_MRA16_TEXTRAM, SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
1859   AM_RANGE(0x500000, 0x500fff) AM_READWRITE(SYS16_MRA16_PALETTERAM, SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
1860   AM_RANGE(0x600000, 0x600001) AM_WRITE(sys16_coinctrl_w)
19571861   AM_RANGE(0x600000, 0x600001) AM_READ_PORT("DSW2")
1862   AM_RANGE(0x600002, 0x600003) AM_READ_PORT("DSW1")
1863   AM_RANGE(0x600006, 0x600007) AM_WRITE(sound_command_w)
1864   AM_RANGE(0x601000, 0x601001) AM_READ_PORT("SERVICE")
19581865   AM_RANGE(0x601002, 0x601003) AM_READ_PORT("P1")
19591866   AM_RANGE(0x601004, 0x601005) AM_READ_PORT("P2")
1960   AM_RANGE(0x601000, 0x601001) AM_READ_PORT("SERVICE")
1961   AM_RANGE(0x602002, 0x602003) AM_READ_PORT("DSW1")
19621867   AM_RANGE(0x602000, 0x602001) AM_READ_PORT("DSW2")
1963   AM_RANGE(0xc46000, 0xc4601f) AM_READ(SYS16_MRA16_EXTRAM3)
1964ADDRESS_MAP_END
1965
1966static ADDRESS_MAP_START( tturfbl_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1967   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(SMH_ROM)
1968   AM_RANGE(0x200000, 0x203fff) AM_WRITE(SYS16_MWA16_EXTRAM) AM_BASE(&sys16_extraram)
1969   AM_RANGE(0x300000, 0x300fff) AM_WRITE(SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
1970   AM_RANGE(0x400000, 0x40ffff) AM_WRITE(SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
1971   AM_RANGE(0x410000, 0x410fff) AM_WRITE(SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
1972   AM_RANGE(0x500000, 0x500fff) AM_WRITE(SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
1973   AM_RANGE(0x600000, 0x600001) AM_WRITE(sys16_coinctrl_w)
1974   AM_RANGE(0x600006, 0x600007) AM_WRITE(sound_command_w)
1868   AM_RANGE(0x602002, 0x602003) AM_READ_PORT("DSW1")
19751869   AM_RANGE(0xc44000, 0xc44001) AM_WRITENOP
1976   AM_RANGE(0xc46000, 0xc4601f) AM_WRITE(SYS16_MWA16_EXTRAM3) AM_BASE(&sys16_extraram3)
1870   AM_RANGE(0xc46000, 0xc4601f) AM_READWRITE(SYS16_MRA16_EXTRAM3, SYS16_MWA16_EXTRAM3) AM_BASE(&sys16_extraram3)
19771871   AM_RANGE(0xff0020, 0xff003f) AM_WRITENOP // config regs
19781872ADDRESS_MAP_END
19791873
r4499r4500
20361930   /* basic machine hardware */
20371931   MDRV_IMPORT_FROM(system16_7759)
20381932   MDRV_CPU_MODIFY("maincpu")
2039   MDRV_CPU_PROGRAM_MAP(tturfbl_readmem,tturfbl_writemem)
1933   MDRV_CPU_PROGRAM_MAP(tturfbl_map,0)
20401934
20411935   MDRV_CPU_MODIFY("soundcpu")
2042   MDRV_CPU_PROGRAM_MAP(tturfbl_sound_readmem,tturfbl_sound_writemem)
2043   MDRV_CPU_IO_MAP(tturfbl_sound_readport,tturfbl_sound_writeport)
1936   MDRV_CPU_PROGRAM_MAP(tturfbl_sound_map,0)
1937   MDRV_CPU_IO_MAP(tturfbl_sound_io_map,0)
20441938
20451939   MDRV_SOUND_REMOVE("7759")
20461940   MDRV_SOUND_ADD("5205", MSM5205, 220000)
r4499r4500
20811975
20821976/***************************************************************************/
20831977
2084static ADDRESS_MAP_START( wb3bbl_readmem, ADDRESS_SPACE_PROGRAM, 16 )
2085   AM_RANGE(0x000000, 0x03ffff) AM_READ(SMH_ROM)
2086   AM_RANGE(0x400000, 0x40ffff) AM_READ(SYS16_MRA16_TILERAM)
2087   AM_RANGE(0x410000, 0x410fff) AM_READ(SYS16_MRA16_TEXTRAM)
2088   AM_RANGE(0x440000, 0x440fff) AM_READ(SYS16_MRA16_SPRITERAM)
2089   AM_RANGE(0x840000, 0x840fff) AM_READ(SYS16_MRA16_PALETTERAM)
1978static ADDRESS_MAP_START( wb3bbl_map, ADDRESS_SPACE_PROGRAM, 16 )
1979   AM_RANGE(0x000000, 0x03ffff) AM_ROM
1980   AM_RANGE(0x3f0000, 0x3fffff) AM_WRITE(sys16_tilebank_w)
1981   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(SYS16_MRA16_TILERAM, SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
1982   AM_RANGE(0x410000, 0x410fff) AM_READWRITE(SYS16_MRA16_TEXTRAM, SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
1983   AM_RANGE(0x440000, 0x440fff) AM_READWRITE(SYS16_MRA16_SPRITERAM, SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
1984   AM_RANGE(0x840000, 0x840fff) AM_READWRITE(SYS16_MRA16_PALETTERAM, SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
1985   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
1986   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
20901987   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
20911988   AM_RANGE(0xc41004, 0xc41005) AM_READ_PORT("P2")
2092   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
2093   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
20941989   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
2095   AM_RANGE(0xc46000, 0xc4601f) AM_READ(SYS16_MRA16_EXTRAM3)
2096   AM_RANGE(0xff0000, 0xffffff) AM_READ(SYS16_MRA16_WORKINGRAM)
2097ADDRESS_MAP_END
2098
2099static ADDRESS_MAP_START( wb3bbl_writemem, ADDRESS_SPACE_PROGRAM, 16 )
2100   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(SMH_ROM)
2101   AM_RANGE(0x3f0000, 0x3fffff) AM_WRITE(sys16_tilebank_w)
2102   AM_RANGE(0x400000, 0x40ffff) AM_WRITE(SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
2103   AM_RANGE(0x410000, 0x410fff) AM_WRITE(SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
2104   AM_RANGE(0x440000, 0x440fff) AM_WRITE(SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
2105   AM_RANGE(0x840000, 0x840fff) AM_WRITE(SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
2106   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
1990   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
21071991   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w)
21081992   AM_RANGE(0xc44000, 0xc44001) AM_WRITENOP
2109   AM_RANGE(0xc46000, 0xc4601f) AM_WRITE(SYS16_MWA16_EXTRAM3) AM_BASE(&sys16_extraram3)
2110   AM_RANGE(0xff0000, 0xffffff) AM_WRITE(SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
1993   AM_RANGE(0xc46000, 0xc4601f) AM_READWRITE(SYS16_MRA16_EXTRAM3, SYS16_MWA16_EXTRAM3) AM_BASE(&sys16_extraram3)
1994   AM_RANGE(0xff0000, 0xffffff) AM_READWRITE(SYS16_MRA16_WORKINGRAM, SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
21111995ADDRESS_MAP_END
21121996
21131997/***************************************************************************/
r4499r4500
21802064   /* basic machine hardware */
21812065   MDRV_IMPORT_FROM(system16)
21822066   MDRV_CPU_MODIFY("maincpu")
2183   MDRV_CPU_PROGRAM_MAP(wb3bbl_readmem,wb3bbl_writemem)
2067   MDRV_CPU_PROGRAM_MAP(wb3bbl_map,0)
21842068
21852069   MDRV_MACHINE_RESET(wb3bbl)
21862070MACHINE_DRIVER_END
src/mame/drivers/taito_b.c
r4499r4500
466466
467467
468468
469#define TC0180VCU_MEMR( ADDR )                                 \
470   AM_RANGE(ADDR+0x00000, ADDR+0x0ffff) AM_READ(TC0180VCU_word_r)               \
471   AM_RANGE(ADDR+0x10000, ADDR+0x1197f) AM_READ(SMH_RAM)                     \
472   AM_RANGE(ADDR+0x11980, ADDR+0x137ff) AM_READ(SMH_RAM)                     \
473   AM_RANGE(ADDR+0x13800, ADDR+0x13fff) AM_READ(SMH_RAM)                     \
474   AM_RANGE(ADDR+0x18000, ADDR+0x1801f) AM_READ(taitob_v_control_r)               \
475   AM_RANGE(ADDR+0x40000, ADDR+0x7ffff) AM_READ(TC0180VCU_framebuffer_word_r)
469#define TC0180VCU_MEMRW( ADDR )                                 \
470   AM_RANGE(ADDR+0x00000, ADDR+0x0ffff) AM_READWRITE(TC0180VCU_word_r, TC0180VCU_word_w) AM_BASE(&TC0180VCU_ram)   \
471   AM_RANGE(ADDR+0x10000, ADDR+0x1197f) AM_RAM AM_BASE(&taitob_spriteram)      \
472   AM_RANGE(ADDR+0x11980, ADDR+0x137ff) AM_RAM                     \
473   AM_RANGE(ADDR+0x13800, ADDR+0x13fff) AM_RAM AM_BASE(&taitob_scroll)         \
474   AM_RANGE(ADDR+0x18000, ADDR+0x1801f) AM_READWRITE(taitob_v_control_r, taitob_v_control_w)               \
475   AM_RANGE(ADDR+0x40000, ADDR+0x7ffff) AM_READWRITE(TC0180VCU_framebuffer_word_r, TC0180VCU_framebuffer_word_w)
476476
477#define TC0180VCU_MEMW( ADDR )                                 \
478   AM_RANGE(ADDR+0x00000, ADDR+0x0ffff) AM_WRITE(TC0180VCU_word_w) AM_BASE(&TC0180VCU_ram)   \
479   AM_RANGE(ADDR+0x10000, ADDR+0x1197f) AM_WRITE(SMH_RAM) AM_BASE(&taitob_spriteram)      \
480   AM_RANGE(ADDR+0x11980, ADDR+0x137ff) AM_WRITE(SMH_RAM)                     \
481   AM_RANGE(ADDR+0x13800, ADDR+0x13fff) AM_WRITE(SMH_RAM) AM_BASE(&taitob_scroll)         \
482   AM_RANGE(ADDR+0x18000, ADDR+0x1801f) AM_WRITE(taitob_v_control_w)               \
483   AM_RANGE(ADDR+0x40000, ADDR+0x7ffff) AM_WRITE(TC0180VCU_framebuffer_word_w)
484477
485
486static ADDRESS_MAP_START( rastsag2_readmem, ADDRESS_SPACE_PROGRAM, 16 )
487   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
488   AM_RANGE(0x600000, 0x607fff) AM_READ(SMH_RAM)         /* Main RAM */
489
490   AM_RANGE(0x200000, 0x201fff) AM_READ(SMH_RAM)         /* palette */
491
492   TC0180VCU_MEMR( 0x400000 )
493
494   AM_RANGE(0xa00000, 0xa0000f) AM_READ(TC0220IOC_halfword_byteswap_r)
495
496   AM_RANGE(0x800000, 0x800001) AM_READNOP
497   AM_RANGE(0x800002, 0x800003) AM_READ8(taitosound_comm_r, 0xff00)
478static ADDRESS_MAP_START( rastsag2_map, ADDRESS_SPACE_PROGRAM, 16 )
479   AM_RANGE(0x000000, 0x07ffff) AM_ROM
480   AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
481   AM_RANGE(0x600000, 0x607fff) AM_RAM   /* Main RAM */ /*ashura up to 603fff only*/
482   TC0180VCU_MEMRW( 0x400000 )
483   AM_RANGE(0x800000, 0x800001) AM_READNOP AM_WRITE8(taitosound_port_w, 0xff00)
484   AM_RANGE(0x800002, 0x800003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
485   AM_RANGE(0xa00000, 0xa0000f) AM_READWRITE8(TC0220IOC_r, TC0220IOC_w, 0xff00)
498486ADDRESS_MAP_END
499487
500static ADDRESS_MAP_START( rastsag2_writemem, ADDRESS_SPACE_PROGRAM, 16 )
501   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
502   AM_RANGE(0x600000, 0x607fff) AM_WRITE(SMH_RAM)   /* Main RAM */ /*ashura up to 603fff only*/
503488
504   AM_RANGE(0x200000, 0x201fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
505
506   TC0180VCU_MEMW( 0x400000 )
507
508   AM_RANGE(0xa00000, 0xa0000f) AM_WRITE(TC0220IOC_halfword_byteswap_w)
509
510   AM_RANGE(0x800000, 0x800001) AM_WRITE8(taitosound_port_w, 0xff00)
511   AM_RANGE(0x800002, 0x800003) AM_WRITE8(taitosound_comm_w, 0xff00)
489static ADDRESS_MAP_START( crimec_map, ADDRESS_SPACE_PROGRAM, 16 )
490   AM_RANGE(0x000000, 0x07ffff) AM_ROM
491   AM_RANGE(0x200000, 0x20000f) AM_READWRITE8(TC0220IOC_r, TC0220IOC_w, 0xff00)
492   TC0180VCU_MEMRW( 0x400000 )
493   AM_RANGE(0x600000, 0x600001) AM_READNOP AM_WRITE8(taitosound_port_w, 0xff00)
494   AM_RANGE(0x600002, 0x600003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
495   AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
496   AM_RANGE(0xa00000, 0xa0ffff) AM_RAM   /* Main RAM */
512497ADDRESS_MAP_END
513498
514499
515static ADDRESS_MAP_START( crimec_readmem, ADDRESS_SPACE_PROGRAM, 16 )
516   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
517   AM_RANGE(0xa00000, 0xa0ffff) AM_READ(SMH_RAM)   /* Main RAM */
518
519   AM_RANGE(0x800000, 0x801fff) AM_READ(SMH_RAM)
520
521   TC0180VCU_MEMR( 0x400000 )
522
523   AM_RANGE(0x200000, 0x20000f) AM_READ(TC0220IOC_halfword_byteswap_r)
524
525   AM_RANGE(0x600000, 0x600001) AM_READNOP
526   AM_RANGE(0x600002, 0x600003) AM_READ8(taitosound_comm_r, 0xff00)
500static ADDRESS_MAP_START( tetrist_map, ADDRESS_SPACE_PROGRAM, 16 )
501   AM_RANGE(0x000000, 0x07ffff) AM_ROM
502   AM_RANGE(0x200000, 0x200001) AM_READNOP AM_WRITE8(taitosound_port_w, 0xff00)
503   AM_RANGE(0x200002, 0x200003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
504   TC0180VCU_MEMRW( 0x400000 )
505   AM_RANGE(0x600000, 0x60000f) AM_READWRITE8(TC0220IOC_r, TC0220IOC_w, 0xff00)
506   AM_RANGE(0x800000, 0x807fff) AM_RAM   /* Main RAM */
507   AM_RANGE(0xa00000, 0xa01fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_BASE(&paletteram16)
527508ADDRESS_MAP_END
528509
529static ADDRESS_MAP_START( crimec_writemem, ADDRESS_SPACE_PROGRAM, 16 )
530   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
531   AM_RANGE(0xa00000, 0xa0ffff) AM_WRITE(SMH_RAM)   /* Main RAM */
532
533   AM_RANGE(0x800000, 0x801fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
534
535   TC0180VCU_MEMW( 0x400000 )
536
537   AM_RANGE(0x200000, 0x20000f) AM_WRITE(TC0220IOC_halfword_byteswap_w)
538
539   AM_RANGE(0x600000, 0x600001) AM_WRITE8(taitosound_port_w, 0xff00)
540   AM_RANGE(0x600002, 0x600003) AM_WRITE8(taitosound_comm_w, 0xff00)
510static ADDRESS_MAP_START( tetrista_map, ADDRESS_SPACE_PROGRAM, 16 )
511   AM_RANGE(0x000000, 0x07ffff) AM_ROM
512   AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
513   TC0180VCU_MEMRW( 0x400000 )
514   AM_RANGE(0x600000, 0x600001) AM_READWRITE8(TC0220IOC_portreg_r, TC0220IOC_portreg_w, 0xff00)
515   AM_RANGE(0x600002, 0x600003) AM_READWRITE8(TC0220IOC_port_r, TC0220IOC_port_w, 0xff00)
516   AM_RANGE(0x800000, 0x803fff) AM_RAM   /* Main RAM */
517   AM_RANGE(0xa00000, 0xa00001) AM_READNOP AM_WRITE8(taitosound_port_w, 0xff00)
518   AM_RANGE(0xa00002, 0xa00003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
541519ADDRESS_MAP_END
542520
543521
544static ADDRESS_MAP_START( tetrist_readmem, ADDRESS_SPACE_PROGRAM, 16 )
545   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
546   AM_RANGE(0x800000, 0x807fff) AM_READ(SMH_RAM)   /* Main RAM */
547
548   AM_RANGE(0xa00000, 0xa01fff) AM_READ(SMH_RAM) /*palette*/
549
550   TC0180VCU_MEMR( 0x400000 )
551
552   AM_RANGE(0x600000, 0x60000f) AM_READ(TC0220IOC_halfword_byteswap_r)
553
554   AM_RANGE(0x200000, 0x200001) AM_READNOP
555   AM_RANGE(0x200002, 0x200003) AM_READ8(taitosound_comm_r, 0xff00)
556ADDRESS_MAP_END
557
558static ADDRESS_MAP_START( tetrist_writemem, ADDRESS_SPACE_PROGRAM, 16 )
559   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
560   AM_RANGE(0x800000, 0x807fff) AM_WRITE(SMH_RAM)   /* Main RAM */
561
562   AM_RANGE(0xa00000, 0xa01fff) AM_WRITE(paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_BASE(&paletteram16)
563
564   TC0180VCU_MEMW( 0x400000 )
565
566   AM_RANGE(0x600000, 0x60000f) AM_WRITE(TC0220IOC_halfword_byteswap_w)
567
568   AM_RANGE(0x200000, 0x200001) AM_WRITE8(taitosound_port_w, 0xff00)
569   AM_RANGE(0x200002, 0x200003) AM_WRITE8(taitosound_comm_w, 0xff00)
570ADDRESS_MAP_END
571
572static ADDRESS_MAP_START( tetrista_readmem, ADDRESS_SPACE_PROGRAM, 16 )
573   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
574   AM_RANGE(0x800000, 0x803fff) AM_READ(SMH_RAM)         /* Main RAM */
575
576   AM_RANGE(0x200000, 0x201fff) AM_READ(SMH_RAM)   /*palette*/
577
578   TC0180VCU_MEMR( 0x400000 )
579
580   AM_RANGE(0x600000, 0x600001) AM_READ(TC0220IOC_halfword_byteswap_portreg_r)   /* DSW A/B, player inputs*/
581   AM_RANGE(0x600002, 0x600003) AM_READ(TC0220IOC_halfword_byteswap_port_r /*watchdog_reset16_r*/ )
582
583   AM_RANGE(0xa00000, 0xa00001) AM_READNOP
584   AM_RANGE(0xa00002, 0xa00003) AM_READ8(taitosound_comm_r, 0xff00)
585ADDRESS_MAP_END
586
587static ADDRESS_MAP_START( tetrista_writemem, ADDRESS_SPACE_PROGRAM, 16 )
588   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
589   AM_RANGE(0x800000, 0x803fff) AM_WRITE(SMH_RAM)   /* Main RAM */
590
591   AM_RANGE(0x200000, 0x201fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
592
593   TC0180VCU_MEMW( 0x400000 )
594
595   AM_RANGE(0x600000, 0x600001) AM_WRITE(TC0220IOC_halfword_byteswap_portreg_w)
596   AM_RANGE(0x600002, 0x600003) AM_WRITE(TC0220IOC_halfword_byteswap_port_w)
597
598   AM_RANGE(0xa00000, 0xa00001) AM_WRITE8(taitosound_port_w, 0xff00)
599   AM_RANGE(0xa00002, 0xa00003) AM_WRITE8(taitosound_comm_w, 0xff00)
600ADDRESS_MAP_END
601
602static ADDRESS_MAP_START( hitice_readmem, ADDRESS_SPACE_PROGRAM, 16 )
603   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
604   AM_RANGE(0x800000, 0x803fff) AM_READ(SMH_RAM)   /* Main RAM */
605
606   AM_RANGE(0xa00000, 0xa01fff) AM_READ(SMH_RAM)
607
608   TC0180VCU_MEMR( 0x400000 )
609
610   AM_RANGE(0x600000, 0x60000f) AM_READ(TC0220IOC_halfword_byteswap_r)
522static ADDRESS_MAP_START( hitice_map, ADDRESS_SPACE_PROGRAM, 16 )
523   AM_RANGE(0x000000, 0x07ffff) AM_ROM
524   TC0180VCU_MEMRW( 0x400000 )
525   AM_RANGE(0x600000, 0x60000f) AM_READWRITE8(TC0220IOC_r, TC0220IOC_w, 0xff00)
611526   AM_RANGE(0x610000, 0x610001) AM_READ_PORT("P3_P4")
612
613   AM_RANGE(0x700000, 0x700001) AM_READNOP
614   AM_RANGE(0x700002, 0x700003) AM_READ8(taitosound_comm_r, 0xff00)
615
616   AM_RANGE(0xb00000, 0xb7ffff) AM_READ(SMH_RAM)
617ADDRESS_MAP_END
618
619static ADDRESS_MAP_START( hitice_writemem, ADDRESS_SPACE_PROGRAM, 16 )
620   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
621   AM_RANGE(0x800000, 0x803fff) AM_WRITE(SMH_RAM)   /* Main RAM */
622
623   AM_RANGE(0xa00000, 0xa01fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
624
625   TC0180VCU_MEMW( 0x400000 )
626
627   AM_RANGE(0x600000, 0x60000f) AM_WRITE(TC0220IOC_halfword_byteswap_w)
628
629   AM_RANGE(0x700000, 0x700001) AM_WRITE8(taitosound_port_w, 0xff00)
630   AM_RANGE(0x700002, 0x700003) AM_WRITE8(taitosound_comm_w, 0xff00)
631
632   AM_RANGE(0xb00000, 0xb7ffff) AM_WRITE(hitice_pixelram_w) AM_BASE(&taitob_pixelram)
527   AM_RANGE(0x700000, 0x700001) AM_READNOP AM_WRITE8(taitosound_port_w, 0xff00)
528   AM_RANGE(0x700002, 0x700003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
529   AM_RANGE(0x800000, 0x803fff) AM_RAM   /* Main RAM */
530   AM_RANGE(0xa00000, 0xa01fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
531   AM_RANGE(0xb00000, 0xb7ffff) AM_RAM_WRITE(hitice_pixelram_w) AM_BASE(&taitob_pixelram)
633532//  { 0xbffff0, 0xbffff1, ???
634533   AM_RANGE(0xbffff2, 0xbffff5) AM_WRITE(hitice_pixel_scroll_w)
635534//  { 0xbffffa, 0xbffffb, ???
636535ADDRESS_MAP_END
637536
638537
639static ADDRESS_MAP_START( rambo3_readmem, ADDRESS_SPACE_PROGRAM, 16 )
640   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
641   AM_RANGE(0x800000, 0x803fff) AM_READ(SMH_RAM)   /* Main RAM */
642
643   AM_RANGE(0xa00000, 0xa01fff) AM_READ(SMH_RAM)
644
645   TC0180VCU_MEMR( 0x400000 )
646
647   AM_RANGE(0x600000, 0x60000f) AM_READ(TC0220IOC_halfword_byteswap_r)
538static ADDRESS_MAP_START( rambo3_map, ADDRESS_SPACE_PROGRAM, 16 )
539   AM_RANGE(0x000000, 0x07ffff) AM_ROM
540   AM_RANGE(0x200000, 0x200001) AM_READNOP AM_WRITE8(taitosound_port_w, 0xff00)
541   AM_RANGE(0x200002, 0x200003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
542   TC0180VCU_MEMRW( 0x400000 )
543   AM_RANGE(0x600000, 0x60000f) AM_READWRITE8(TC0220IOC_r, TC0220IOC_w, 0xff00)
648544   AM_RANGE(0x600010, 0x600011) AM_READ(tracky1_lo_r) /*player 1*/
649545   AM_RANGE(0x600012, 0x600013) AM_READ(tracky1_hi_r)
650546   AM_RANGE(0x600014, 0x600015) AM_READ(trackx1_lo_r)
r4499r4500
653549   AM_RANGE(0x60001a, 0x60001b) AM_READ(tracky2_hi_r)
654550   AM_RANGE(0x60001c, 0x60001d) AM_READ(trackx2_lo_r)
655551   AM_RANGE(0x60001e, 0x60001f) AM_READ(trackx2_hi_r)
656
657   AM_RANGE(0x200000, 0x200001) AM_READNOP
658   AM_RANGE(0x200002, 0x200003) AM_READ8(taitosound_comm_r, 0xff00)
552   AM_RANGE(0x800000, 0x803fff) AM_RAM   /* Main RAM */
553   AM_RANGE(0xa00000, 0xa01fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
659554ADDRESS_MAP_END
660555
661static ADDRESS_MAP_START( rambo3_writemem, ADDRESS_SPACE_PROGRAM, 16 )
662   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
663   AM_RANGE(0x800000, 0x803fff) AM_WRITE(SMH_RAM)   /* Main RAM */
664556
665   AM_RANGE(0xa00000, 0xa01fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
666
667   TC0180VCU_MEMW( 0x400000 )
668
669   AM_RANGE(0x600000, 0x60000f) AM_WRITE(TC0220IOC_halfword_byteswap_w)
670
671   AM_RANGE(0x200000, 0x200001) AM_WRITE8(taitosound_port_w, 0xff00)
672   AM_RANGE(0x200002, 0x200003) AM_WRITE8(taitosound_comm_w, 0xff00)
673ADDRESS_MAP_END
674
675
676static ADDRESS_MAP_START( pbobble_readmem, ADDRESS_SPACE_PROGRAM, 16 )
677   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
678   AM_RANGE(0x900000, 0x90ffff) AM_READ(SMH_RAM)   /* Main RAM */
679
680   AM_RANGE(0x800000, 0x801fff) AM_READ(SMH_RAM)
681
682   TC0180VCU_MEMR( 0x400000 )
683
684   AM_RANGE(0x500000, 0x50000f) AM_READ(pbobble_input_bypass_r)
557static ADDRESS_MAP_START( pbobble_map, ADDRESS_SPACE_PROGRAM, 16 )
558   AM_RANGE(0x000000, 0x07ffff) AM_ROM
559   TC0180VCU_MEMRW( 0x400000 )
560   AM_RANGE(0x500000, 0x50000f) AM_READWRITE(pbobble_input_bypass_r, TC0640FIO_halfword_byteswap_w)
685561   AM_RANGE(0x500024, 0x500025) AM_READ_PORT("IN3")      /* shown in service mode, game omits to read it */
686   AM_RANGE(0x500026, 0x500027) AM_READ(eep_latch_r)   /* not read by this game */
687   AM_RANGE(0x50002e, 0x50002f) AM_READ_PORT("IN4")      /* shown in service mode, game omits to read it */
688
689   AM_RANGE(0x700000, 0x700001) AM_READNOP
690   AM_RANGE(0x700002, 0x700003) AM_READ8(taitosound_comm_r, 0xff00)
691ADDRESS_MAP_END
692
693static ADDRESS_MAP_START( pbobble_writemem, ADDRESS_SPACE_PROGRAM, 16 )
694   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
695   AM_RANGE(0x900000, 0x90ffff) AM_WRITE(SMH_RAM)   /* Main RAM */
696
697   AM_RANGE(0x800000, 0x801fff) AM_WRITE(paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_BASE(&paletteram16)
698
699   TC0180VCU_MEMW( 0x400000 )
700
701   AM_RANGE(0x500000, 0x50000f) AM_WRITE(TC0640FIO_halfword_byteswap_w)
702   AM_RANGE(0x500026, 0x500027) AM_WRITE(eeprom_w)
562   AM_RANGE(0x500026, 0x500027) AM_READWRITE(eep_latch_r, eeprom_w)
703563   AM_RANGE(0x500028, 0x500029) AM_WRITE(player_34_coin_ctrl_w)   /* simply locks coins 3&4 out */
704
705   AM_RANGE(0x700000, 0x700001) AM_WRITE8(taitosound_port_w, 0xff00)
706   AM_RANGE(0x700002, 0x700003) AM_WRITE8(taitosound_comm_w, 0xff00)
564   AM_RANGE(0x50002e, 0x50002f) AM_READ_PORT("IN4")      /* shown in service mode, game omits to read it */
707565   AM_RANGE(0x600000, 0x600003) AM_WRITE(gain_control_w)
566   AM_RANGE(0x700000, 0x700001) AM_READNOP AM_WRITE8(taitosound_port_w, 0xff00)
567   AM_RANGE(0x700002, 0x700003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
568   AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_BASE(&paletteram16)
569   AM_RANGE(0x900000, 0x90ffff) AM_RAM   /* Main RAM */
708570ADDRESS_MAP_END
709571
710static ADDRESS_MAP_START( spacedx_readmem, ADDRESS_SPACE_PROGRAM, 16 )
711   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
712   AM_RANGE(0x900000, 0x90ffff) AM_READ(SMH_RAM)   /* Main RAM */
713
714   AM_RANGE(0x800000, 0x801fff) AM_READ(SMH_RAM)
715
716   TC0180VCU_MEMR( 0x400000 )
717
718   AM_RANGE(0x500000, 0x50000f) AM_READ(pbobble_input_bypass_r)
572/* identical to pbobble, above??? */
573static ADDRESS_MAP_START( spacedx_map, ADDRESS_SPACE_PROGRAM, 16 )
574   AM_RANGE(0x000000, 0x07ffff) AM_ROM
575   TC0180VCU_MEMRW( 0x400000 )
576   AM_RANGE(0x500000, 0x50000f) AM_READWRITE(pbobble_input_bypass_r, TC0640FIO_halfword_byteswap_w)
719577   AM_RANGE(0x500024, 0x500025) AM_READ_PORT("IN3")
720   AM_RANGE(0x500026, 0x500027) AM_READ(eep_latch_r)
721   AM_RANGE(0x50002e, 0x50002f) AM_READ_PORT("IN4")
722
723   AM_RANGE(0x700000, 0x700001) AM_READNOP
724   AM_RANGE(0x700002, 0x700003) AM_READ8(taitosound_comm_r, 0xff00)
725ADDRESS_MAP_END
726
727static ADDRESS_MAP_START( spacedx_writemem, ADDRESS_SPACE_PROGRAM, 16 )
728   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
729   AM_RANGE(0x900000, 0x90ffff) AM_WRITE(SMH_RAM)   /* Main RAM */
730
731   AM_RANGE(0x800000, 0x801fff) AM_WRITE(paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_BASE(&paletteram16)
732
733   TC0180VCU_MEMW( 0x400000 )
734
735   AM_RANGE(0x500000, 0x50000f) AM_WRITE(TC0640FIO_halfword_byteswap_w)
736   AM_RANGE(0x500026, 0x500027) AM_WRITE(eeprom_w)
578   AM_RANGE(0x500026, 0x500027) AM_READWRITE(eep_latch_r, eeprom_w)
737579   AM_RANGE(0x500028, 0x500029) AM_WRITE(player_34_coin_ctrl_w)   /* simply locks coins 3&4 out */
738
739   AM_RANGE(0x700000, 0x700001) AM_WRITE8(taitosound_port_w, 0xff00)
740   AM_RANGE(0x700002, 0x700003) AM_WRITE8(taitosound_comm_w, 0xff00)
580   AM_RANGE(0x50002e, 0x50002f) AM_READ_PORT("IN4")
741581   AM_RANGE(0x600000, 0x600003) AM_WRITE(gain_control_w)
582   AM_RANGE(0x700000, 0x700001) AM_READNOP AM_WRITE8(taitosound_port_w, 0xff00)
583   AM_RANGE(0x700002, 0x700003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
584   AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_BASE(&paletteram16)
585   AM_RANGE(0x900000, 0x90ffff) AM_RAM   /* Main RAM */
742586ADDRESS_MAP_END
743587
744static ADDRESS_MAP_START( spacedxo_readmem, ADDRESS_SPACE_PROGRAM, 16 )
745   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
746   AM_RANGE(0x400000, 0x40ffff) AM_READ(SMH_RAM)   /* Main RAM */
747588
748   AM_RANGE(0x300000, 0x303fff) AM_READ(SMH_RAM)
749
750   TC0180VCU_MEMR( 0x500000 )
751
752   AM_RANGE(0x200000, 0x20000f) AM_READ(TC0220IOC_halfword_r)
589static ADDRESS_MAP_START( spacedxo_map, ADDRESS_SPACE_PROGRAM, 16 )
590   AM_RANGE(0x000000, 0x07ffff) AM_ROM
591   AM_RANGE(0x100000, 0x100001) AM_READNOP AM_WRITE8(taitosound_port_w, 0xff00)
592   AM_RANGE(0x100002, 0x100003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
593   AM_RANGE(0x200000, 0x20000f) AM_READWRITE8(TC0220IOC_r, TC0220IOC_w, 0x00ff)
753594   AM_RANGE(0x210000, 0x210001) AM_READ_PORT("IN3")
754595   AM_RANGE(0x220000, 0x220001) AM_READ_PORT("IN4")
755596   AM_RANGE(0x230000, 0x230001) AM_READ_PORT("IN5")
756
757   AM_RANGE(0x100000, 0x100001) AM_READNOP
758   AM_RANGE(0x100002, 0x100003) AM_READ8(taitosound_comm_r, 0xff00)
597   AM_RANGE(0x300000, 0x301fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_BASE(&paletteram16)
598   AM_RANGE(0x400000, 0x40ffff) AM_RAM   /* Main RAM */
599   TC0180VCU_MEMRW( 0x500000 )
759600ADDRESS_MAP_END
760601
761static ADDRESS_MAP_START( spacedxo_writemem, ADDRESS_SPACE_PROGRAM, 16 )
762   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
763   AM_RANGE(0x400000, 0x40ffff) AM_WRITE(SMH_RAM)   /* Main RAM */
764602
765   AM_RANGE(0x300000, 0x301fff) AM_WRITE(paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_BASE(&paletteram16)
766
767   TC0180VCU_MEMW( 0x500000 )
768
769   AM_RANGE(0x200000, 0x20000f) AM_WRITE(TC0220IOC_halfword_w)
770
771   AM_RANGE(0x100000, 0x100001) AM_WRITE8(taitosound_port_w, 0xff00)
772   AM_RANGE(0x100002, 0x100003) AM_WRITE8(taitosound_comm_w, 0xff00)
773ADDRESS_MAP_END
774
775static ADDRESS_MAP_START( qzshowby_readmem, ADDRESS_SPACE_PROGRAM, 16 )
776   AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM)
777   AM_RANGE(0x900000, 0x90ffff) AM_READ(SMH_RAM)   /* Main RAM */
778
779   AM_RANGE(0x800000, 0x801fff) AM_READ(SMH_RAM)
780
781   TC0180VCU_MEMR( 0x400000 )
782
783   AM_RANGE(0x200000, 0x20000f) AM_READ(pbobble_input_bypass_r)
603static ADDRESS_MAP_START( qzshowby_map, ADDRESS_SPACE_PROGRAM, 16 )
604   AM_RANGE(0x000000, 0x0fffff) AM_ROM
605   AM_RANGE(0x200000, 0x20000f) AM_READWRITE(pbobble_input_bypass_r, TC0640FIO_halfword_byteswap_w)
784606   AM_RANGE(0x200024, 0x200025) AM_READ_PORT("IN3")   /* player 3,4 start */
785   AM_RANGE(0x200028, 0x200029) AM_READ(player_34_coin_ctrl_r)
786   AM_RANGE(0x20002e, 0x20002f) AM_READ_PORT("IN4")   /* player 3,4 buttons */
787
788   AM_RANGE(0x600000, 0x600001) AM_READNOP
789   AM_RANGE(0x600002, 0x600003) AM_READ8(taitosound_comm_r, 0xff00)
790ADDRESS_MAP_END
791
792static ADDRESS_MAP_START( qzshowby_writemem, ADDRESS_SPACE_PROGRAM, 16 )
793   AM_RANGE(0x000000, 0x0fffff) AM_WRITE(SMH_ROM)
794   AM_RANGE(0x900000, 0x90ffff) AM_WRITE(SMH_RAM)   /* Main RAM */
795
796   AM_RANGE(0x800000, 0x801fff) AM_WRITE(paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_BASE(&paletteram16)
797
798   TC0180VCU_MEMW( 0x400000 )
799
800   AM_RANGE(0x200000, 0x20000f) AM_WRITE(TC0640FIO_halfword_byteswap_w)
801607   AM_RANGE(0x200026, 0x200027) AM_WRITE(eeprom_w)
802   AM_RANGE(0x200028, 0x200029) AM_WRITE(player_34_coin_ctrl_w)
803
804   AM_RANGE(0x600000, 0x600001) AM_WRITE8(taitosound_port_w, 0xff00)
805   AM_RANGE(0x600002, 0x600003) AM_WRITE8(taitosound_comm_w, 0xff00)
608   AM_RANGE(0x200028, 0x200029) AM_READWRITE(player_34_coin_ctrl_r, player_34_coin_ctrl_w)
609   AM_RANGE(0x20002e, 0x20002f) AM_READ_PORT("IN4")   /* player 3,4 buttons */
610   TC0180VCU_MEMRW( 0x400000 )
611   AM_RANGE(0x600000, 0x600001) AM_READNOP AM_WRITE8(taitosound_port_w, 0xff00)
612   AM_RANGE(0x600002, 0x600003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
806613   AM_RANGE(0x700000, 0x700003) AM_WRITE(gain_control_w)
614   AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_BASE(&paletteram16)
615   AM_RANGE(0x900000, 0x90ffff) AM_RAM   /* Main RAM */
807616ADDRESS_MAP_END
808617
809618
810static ADDRESS_MAP_START( viofight_readmem, ADDRESS_SPACE_PROGRAM, 16 )
811   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
812   AM_RANGE(0xa00000, 0xa03fff) AM_READ(SMH_RAM)   /* Main RAM */
813
814   AM_RANGE(0x600000, 0x601fff) AM_READ(SMH_RAM)
815
816   TC0180VCU_MEMR( 0x400000 )
817
818   AM_RANGE(0x800000, 0x80000f) AM_READ(TC0220IOC_halfword_byteswap_r)
819
820   AM_RANGE(0x200000, 0x200001) AM_READNOP
821   AM_RANGE(0x200002, 0x200003) AM_READ8(taitosound_comm_r, 0xff00)
619static ADDRESS_MAP_START( viofight_map, ADDRESS_SPACE_PROGRAM, 16 )
620   AM_RANGE(0x000000, 0x07ffff) AM_ROM
621   AM_RANGE(0x200000, 0x200001) AM_READNOP AM_WRITE8(taitosound_port_w, 0xff00)
622   AM_RANGE(0x200002, 0x200003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
623   TC0180VCU_MEMRW( 0x400000 )
624   AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
625   AM_RANGE(0x800000, 0x80000f) AM_READWRITE8(TC0220IOC_r, TC0220IOC_w, 0xff00)
626   AM_RANGE(0xa00000, 0xa03fff) AM_RAM   /* Main RAM */
822627ADDRESS_MAP_END
823628
824static ADDRESS_MAP_START( viofight_writemem, ADDRESS_SPACE_PROGRAM, 16 )
825   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
826   AM_RANGE(0xa00000, 0xa03fff) AM_WRITE(SMH_RAM)   /* Main RAM */
827629
828   AM_RANGE(0x600000, 0x601fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
829
830   TC0180VCU_MEMW( 0x400000 )
831
832   AM_RANGE(0x800000, 0x80000f) AM_WRITE(TC0220IOC_halfword_byteswap_w)
833
834   AM_RANGE(0x200000, 0x200001) AM_WRITE8(taitosound_port_w, 0xff00)
835   AM_RANGE(0x200002, 0x200003) AM_WRITE8(taitosound_comm_w, 0xff00)
630static ADDRESS_MAP_START( masterw_map, ADDRESS_SPACE_PROGRAM, 16 )
631   AM_RANGE(0x000000, 0x07ffff) AM_ROM
632   AM_RANGE(0x200000, 0x203fff) AM_RAM   /* Main RAM */
633   TC0180VCU_MEMRW( 0x400000 )
634   AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
635   AM_RANGE(0x800000, 0x800001) AM_READWRITE8(TC0220IOC_portreg_r, TC0220IOC_portreg_w, 0xff00)
636   AM_RANGE(0x800002, 0x800003) AM_READWRITE8(TC0220IOC_port_r, TC0220IOC_port_w, 0xff00)
637   AM_RANGE(0xa00000, 0xa00001) AM_READNOP AM_WRITE8(taitosound_port_w, 0xff00)
638   AM_RANGE(0xa00002, 0xa00003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
836639ADDRESS_MAP_END
837640
838641
839static ADDRESS_MAP_START( masterw_readmem, ADDRESS_SPACE_PROGRAM, 16 )
840   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
841   AM_RANGE(0x200000, 0x203fff) AM_READ(SMH_RAM)         /* Main RAM */
842
843   AM_RANGE(0x600000, 0x601fff) AM_READ(SMH_RAM)   /*palette*/
844
845   TC0180VCU_MEMR( 0x400000 )
846
847   AM_RANGE(0x800000, 0x800001) AM_READ(TC0220IOC_halfword_byteswap_portreg_r)   /* DSW A/B, player inputs*/
848   AM_RANGE(0x800002, 0x800003) AM_READ(TC0220IOC_halfword_byteswap_port_r /*watchdog_reset16_r*/ )
849
850   AM_RANGE(0xa00000, 0xa00001) AM_READNOP
851   AM_RANGE(0xa00002, 0xa00003) AM_READ8(taitosound_comm_r, 0xff00)
852ADDRESS_MAP_END
853
854static ADDRESS_MAP_START( masterw_writemem, ADDRESS_SPACE_PROGRAM, 16 )
855   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
856   AM_RANGE(0x200000, 0x203fff) AM_WRITE(SMH_RAM)   /* Main RAM */
857
858   AM_RANGE(0x600000, 0x601fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
859
860   TC0180VCU_MEMW( 0x400000 )
861
862   AM_RANGE(0x800000, 0x800001) AM_WRITE(TC0220IOC_halfword_byteswap_portreg_w)
863   AM_RANGE(0x800002, 0x800003) AM_WRITE(TC0220IOC_halfword_byteswap_port_w)
864
865   AM_RANGE(0xa00000, 0xa00001) AM_WRITE8(taitosound_port_w, 0xff00)
866   AM_RANGE(0xa00002, 0xa00003) AM_WRITE8(taitosound_comm_w, 0xff00)
867ADDRESS_MAP_END
868
869
870static ADDRESS_MAP_START( silentd_readmem, ADDRESS_SPACE_PROGRAM, 16 )
871   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
872   AM_RANGE(0x400000, 0x403fff) AM_READ(SMH_RAM)   /* Main RAM */
873
874   AM_RANGE(0x300000, 0x301fff) AM_READ(SMH_RAM)
875
876   TC0180VCU_MEMR( 0x500000 )
877
878   AM_RANGE(0x200000, 0x20000f) AM_READ(TC0220IOC_halfword_r)
642static ADDRESS_MAP_START( silentd_map, ADDRESS_SPACE_PROGRAM, 16 )
643   AM_RANGE(0x000000, 0x07ffff) AM_ROM
644   AM_RANGE(0x100000, 0x100001) AM_READNOP AM_WRITE8(taitosound_port_w, 0xff00)
645   AM_RANGE(0x100002, 0x100003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
646//  AM_RANGE(0x10001a, 0x10001b) AM_READNOP // ??? read at $1e344
647//  AM_RANGE(0x10001c, 0x10001d) AM_READNOP // ??? read at $1e356
648   AM_RANGE(0x200000, 0x20000f) AM_READWRITE8(TC0220IOC_r, TC0220IOC_w, 0x00ff)
879649   AM_RANGE(0x210000, 0x210001) AM_READ_PORT("IN3")
880650   AM_RANGE(0x220000, 0x220001) AM_READ_PORT("IN4")
881651   AM_RANGE(0x230000, 0x230001) AM_READ_PORT("IN5")
652   AM_RANGE(0x240000, 0x240001) AM_WRITENOP // ???
882653//  AM_RANGE(0x240000, 0x240001) AM_READNOP /* read 4 times at init */
883
884   AM_RANGE(0x100000, 0x100001) AM_READNOP
885   AM_RANGE(0x100002, 0x100003) AM_READ8(taitosound_comm_r, 0xff00)
886//  AM_RANGE(0x10001a, 0x10001b) AM_READNOP // ??? read at $1e344
887//  AM_RANGE(0x10001c, 0x10001d) AM_READNOP // ??? read at $1e356
654   AM_RANGE(0x300000, 0x301fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_BASE(&paletteram16)
655   AM_RANGE(0x400000, 0x403fff) AM_RAM   /* Main RAM */
656   TC0180VCU_MEMRW( 0x500000 )
888657ADDRESS_MAP_END
889658
890static ADDRESS_MAP_START( silentd_writemem, ADDRESS_SPACE_PROGRAM, 16 )
891   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
892   AM_RANGE(0x400000, 0x403fff) AM_WRITE(SMH_RAM)   /* Main RAM */
893659
894   AM_RANGE(0x300000, 0x301fff) AM_WRITE(paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_BASE(&paletteram16)
895
896   TC0180VCU_MEMW( 0x500000 )
897
898   AM_RANGE(0x200000, 0x20000f) AM_WRITE(TC0220IOC_halfword_w)
899   AM_RANGE(0x240000, 0x240001) AM_WRITENOP // ???
900
901   AM_RANGE(0x100000, 0x100001) AM_WRITE8(taitosound_port_w, 0xff00)
902   AM_RANGE(0x100002, 0x100003) AM_WRITE8(taitosound_comm_w, 0xff00)
660static ADDRESS_MAP_START( selfeena_map, ADDRESS_SPACE_PROGRAM, 16 )
661   AM_RANGE(0x000000, 0x07ffff) AM_ROM
662   AM_RANGE(0x100000, 0x103fff) AM_RAM   /* Main RAM */
663   TC0180VCU_MEMRW( 0x200000 )
664   AM_RANGE(0x300000, 0x301fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_BASE(&paletteram16)
665   AM_RANGE(0x400000, 0x40000f) AM_READWRITE8(TC0220IOC_r, TC0220IOC_w, 0xff00)
666   AM_RANGE(0x410000, 0x41000f) AM_READWRITE8(TC0220IOC_r, TC0220IOC_w, 0xff00) /* mirror address - seems to be only used for coin control */
667   AM_RANGE(0x500000, 0x500001) AM_READNOP AM_WRITE8(taitosound_port_w, 0xff00)
668   AM_RANGE(0x500002, 0x500003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
903669ADDRESS_MAP_END
904670
905671
906static ADDRESS_MAP_START( selfeena_readmem, ADDRESS_SPACE_PROGRAM, 16 )
907   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
908   AM_RANGE(0x100000, 0x103fff) AM_READ(SMH_RAM)   /* Main RAM */
909
910   AM_RANGE(0x300000, 0x301fff) AM_READ(SMH_RAM)
911
912   TC0180VCU_MEMR( 0x200000 )
913
914   AM_RANGE(0x400000, 0x40000f) AM_READ(TC0220IOC_halfword_byteswap_r)
915   AM_RANGE(0x410000, 0x41000f) AM_READ(TC0220IOC_halfword_byteswap_r) /* mirror address - seems to be only used for coin control */
916
917   AM_RANGE(0x500000, 0x500001) AM_READNOP
918   AM_RANGE(0x500002, 0x500003) AM_READ8(taitosound_comm_r, 0xff00)
672static ADDRESS_MAP_START( sbm_map, ADDRESS_SPACE_PROGRAM, 16 )
673   AM_RANGE(0x000000, 0x07ffff) AM_ROM
674   AM_RANGE(0x100000, 0x10ffff) AM_RAM   /* Main RAM */
675   AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
676   AM_RANGE(0x300000, 0x30000f) AM_READWRITE(TC0510NIO_halfword_wordswap_r, TC0510NIO_halfword_wordswap_w)
677   AM_RANGE(0x320000, 0x320001) AM_READNOP AM_WRITE8(taitosound_port_w, 0xff00)
678   AM_RANGE(0x320002, 0x320003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
679   TC0180VCU_MEMRW( 0x900000 )
919680ADDRESS_MAP_END
920681
921static ADDRESS_MAP_START( selfeena_writemem, ADDRESS_SPACE_PROGRAM, 16 )
922   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
923   AM_RANGE(0x100000, 0x103fff) AM_WRITE(SMH_RAM)   /* Main RAM */
924682
925   AM_RANGE(0x300000, 0x301fff) AM_WRITE(paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_BASE(&paletteram16)
926683
927   TC0180VCU_MEMW( 0x200000 )
928
929   AM_RANGE(0x400000, 0x40000f) AM_WRITE(TC0220IOC_halfword_byteswap_w)
930   AM_RANGE(0x410000, 0x41000f) AM_WRITE(TC0220IOC_halfword_byteswap_w) /* mirror address - seems to be only used for coin control */
931
932   AM_RANGE(0x500000, 0x500001) AM_WRITE8(taitosound_port_w, 0xff00)
933   AM_RANGE(0x500002, 0x500003) AM_WRITE8(taitosound_comm_w, 0xff00)
934ADDRESS_MAP_END
935
936
937static ADDRESS_MAP_START( sbm_readmem, ADDRESS_SPACE_PROGRAM, 16 )
938   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
939   AM_RANGE(0x100000, 0x10ffff) AM_READ(SMH_RAM)   /* Main RAM */
940
941   AM_RANGE(0x200000, 0x201fff) AM_READ(SMH_RAM)
942
943   TC0180VCU_MEMR( 0x900000 )
944
945   AM_RANGE(0x300000, 0x30000f) AM_READ(TC0510NIO_halfword_wordswap_r)
946
947   AM_RANGE(0x320000, 0x320001) AM_READNOP
948   AM_RANGE(0x320002, 0x320003) AM_READ8(taitosound_comm_r, 0xff00)
949ADDRESS_MAP_END
950
951static ADDRESS_MAP_START( sbm_writemem, ADDRESS_SPACE_PROGRAM, 16 )
952   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
953   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM)   /* Main RAM */
954
955   AM_RANGE(0x200000, 0x201fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
956
957   TC0180VCU_MEMW( 0x900000 )
958
959   AM_RANGE(0x300000, 0x30000f) AM_WRITE(TC0510NIO_halfword_wordswap_w)
960
961   AM_RANGE(0x320000, 0x320001) AM_WRITE8(taitosound_port_w, 0xff00)
962   AM_RANGE(0x320002, 0x320003) AM_WRITE8(taitosound_comm_w, 0xff00)
963ADDRESS_MAP_END
964
965
966
967static ADDRESS_MAP_START( masterw_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
968   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
969   AM_RANGE(0x4000, 0x7fff) AM_READ(SMH_BANK1)
970   AM_RANGE(0x8000, 0x8fff) AM_READ(SMH_RAM)
971   AM_RANGE(0x9000, 0x9001) AM_DEVREAD("ym", ym2203_r)
972   AM_RANGE(0xa001, 0xa001) AM_READ(taitosound_slave_comm_r)
973ADDRESS_MAP_END
974
975static ADDRESS_MAP_START( masterw_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
976   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
977   AM_RANGE(0x8000, 0x8fff) AM_WRITE(SMH_RAM)
978   AM_RANGE(0x9000, 0x9001) AM_DEVWRITE("ym", ym2203_w)
684static ADDRESS_MAP_START( masterw_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
685   AM_RANGE(0x0000, 0x3fff) AM_ROM
686   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(1)
687   AM_RANGE(0x8000, 0x8fff) AM_RAM
688   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ym", ym2203_r, ym2203_w)
979689   AM_RANGE(0xa000, 0xa000) AM_WRITE(taitosound_slave_port_w)
980   AM_RANGE(0xa001, 0xa001) AM_WRITE(taitosound_slave_comm_w)
690   AM_RANGE(0xa001, 0xa001) AM_READWRITE(taitosound_slave_comm_r, taitosound_slave_comm_w)
981691ADDRESS_MAP_END
982692
983static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
984   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
985   AM_RANGE(0x4000, 0x7fff) AM_READ(SMH_BANK1)
986   AM_RANGE(0xc000, 0xdfff) AM_READ(SMH_RAM)
987   AM_RANGE(0xe000, 0xe003) AM_DEVREAD("ym", ym2610_r)
988   AM_RANGE(0xe200, 0xe200) AM_READNOP
989   AM_RANGE(0xe201, 0xe201) AM_READ(taitosound_slave_comm_r)
990   AM_RANGE(0xea00, 0xea00) AM_READNOP
991ADDRESS_MAP_END
992
993static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
994   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
995   AM_RANGE(0xc000, 0xdfff) AM_WRITE(SMH_RAM)
996   AM_RANGE(0xe000, 0xe003) AM_DEVWRITE("ym", ym2610_w)
997   AM_RANGE(0xe200, 0xe200) AM_WRITE(taitosound_slave_port_w)
998   AM_RANGE(0xe201, 0xe201) AM_WRITE(taitosound_slave_comm_w)
693static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
694   AM_RANGE(0x0000, 0x3fff) AM_ROM
695   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(1)
696   AM_RANGE(0xc000, 0xdfff) AM_RAM
697   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ym", ym2610_r, ym2610_w)
698   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_WRITE(taitosound_slave_port_w)
699   AM_RANGE(0xe201, 0xe201) AM_READWRITE(taitosound_slave_comm_r, taitosound_slave_comm_w)
999700   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
1000701   AM_RANGE(0xe600, 0xe600) AM_WRITENOP /* ? */
702   AM_RANGE(0xea00, 0xea00) AM_READNOP
1001703   AM_RANGE(0xee00, 0xee00) AM_WRITENOP /* ? */
1002704   AM_RANGE(0xf000, 0xf000) AM_WRITENOP /* ? */
1003705   AM_RANGE(0xf200, 0xf200) AM_WRITE(bankswitch_w)
1004706ADDRESS_MAP_END
1005707
1006static ADDRESS_MAP_START( viofight_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
1007   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
1008   AM_RANGE(0x4000, 0x7fff) AM_READ(SMH_BANK1)
1009   AM_RANGE(0x8000, 0x8fff) AM_READ(SMH_RAM)
1010   AM_RANGE(0x9000, 0x9001) AM_DEVREAD("ym", ym2203_r)
1011   AM_RANGE(0xb000, 0xb000) AM_DEVREAD("oki", okim6295_r)
1012   AM_RANGE(0xa001, 0xa001) AM_READ(taitosound_slave_comm_r)
1013ADDRESS_MAP_END
1014
1015static ADDRESS_MAP_START( viofight_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
1016   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
1017   AM_RANGE(0x8000, 0x8fff) AM_WRITE(SMH_RAM)
1018   AM_RANGE(0x9000, 0x9001) AM_DEVWRITE("ym", ym2203_w)
1019   AM_RANGE(0xb000, 0xb001) AM_DEVWRITE("oki", okim6295_w)      /* yes, both addresses for the same chip */
708static ADDRESS_MAP_START( viofight_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
709   AM_RANGE(0x0000, 0x3fff) AM_ROM
710   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(1)
711   AM_RANGE(0x8000, 0x8fff) AM_RAM
712   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ym", ym2203_r, ym2203_w)
713   AM_RANGE(0xb000, 0xb001) AM_DEVREADWRITE("oki", okim6295_r, okim6295_w)      /* yes, both addresses for the same chip */
1020714   AM_RANGE(0xa000, 0xa000) AM_WRITE(taitosound_slave_port_w)
1021   AM_RANGE(0xa001, 0xa001) AM_WRITE(taitosound_slave_comm_w)
715   AM_RANGE(0xa001, 0xa001) AM_READWRITE(taitosound_slave_comm_r, taitosound_slave_comm_w)
1022716ADDRESS_MAP_END
1023717
1024718
r4499r4500
24152109
24162110   /* basic machine hardware */
24172111   MDRV_CPU_ADD("maincpu", M68000, 12000000)   /* 12 MHz */
2418   MDRV_CPU_PROGRAM_MAP(rastsag2_readmem,rastsag2_writemem)
2112   MDRV_CPU_PROGRAM_MAP(rastsag2_map,0)
24192113   MDRV_CPU_VBLANK_INT("screen", rastansaga2_interrupt)
24202114
24212115   MDRV_CPU_ADD("audiocpu", Z80, 4000000)   /* 4 MHz */
2422   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
2116   MDRV_CPU_PROGRAM_MAP(sound_map,0)
24232117
24242118   MDRV_QUANTUM_TIME(HZ(600))
24252119
r4499r4500
24532147
24542148   /* basic machine hardware */
24552149   MDRV_CPU_ADD("maincpu", M68000, 12000000)   /* 12 MHz */
2456   MDRV_CPU_PROGRAM_MAP(rastsag2_readmem,rastsag2_writemem)
2150   MDRV_CPU_PROGRAM_MAP(rastsag2_map,0)
24572151   MDRV_CPU_VBLANK_INT("screen", rastansaga2_interrupt)
24582152
24592153   MDRV_CPU_ADD("audiocpu", Z80, 4000000)   /* 4 MHz */
2460   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
2154   MDRV_CPU_PROGRAM_MAP(sound_map,0)
24612155
24622156   MDRV_QUANTUM_TIME(HZ(600))
24632157
r4499r4500
24912185
24922186   /* basic machine hardware */
24932187   MDRV_CPU_ADD("maincpu", M68000, 12000000)   /* 12 MHz */
2494   MDRV_CPU_PROGRAM_MAP(crimec_readmem,crimec_writemem)
2188   MDRV_CPU_PROGRAM_MAP(crimec_map,0)
24952189   MDRV_CPU_VBLANK_INT("screen", crimec_interrupt)
24962190
24972191   MDRV_CPU_ADD("audiocpu", Z80, 4000000)   /* 4 MHz */
2498   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
2192   MDRV_CPU_PROGRAM_MAP(sound_map,0)
24992193
25002194   MDRV_QUANTUM_TIME(HZ(600))
25012195
r4499r4500
25292223
25302224   /* basic machine hardware */
25312225   MDRV_CPU_ADD("maincpu", M68000, 12000000)   /* 12 MHz ???*/
2532   MDRV_CPU_PROGRAM_MAP(tetrist_readmem,tetrist_writemem)
2226   MDRV_CPU_PROGRAM_MAP(tetrist_map,0)
25332227   MDRV_CPU_VBLANK_INT("screen", rastansaga2_interrupt)
25342228
25352229   MDRV_CPU_ADD("audiocpu", Z80, 4000000)   /* 4 MHz */
2536   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
2230   MDRV_CPU_PROGRAM_MAP(sound_map,0)
25372231
25382232   MDRV_QUANTUM_TIME(HZ(600))
25392233
r4499r4500
25662260
25672261   /* basic machine hardware */
25682262   MDRV_CPU_ADD("maincpu", M68000, 12000000)   /* 12 MHz */
2569   MDRV_CPU_PROGRAM_MAP(tetrista_readmem,tetrista_writemem)
2263   MDRV_CPU_PROGRAM_MAP(tetrista_map,0)
25702264   MDRV_CPU_VBLANK_INT("screen", masterw_interrupt)
25712265
25722266   MDRV_CPU_ADD("audiocpu", Z80, 4000000)   /* 4 MHz */
2573   MDRV_CPU_PROGRAM_MAP(masterw_sound_readmem,masterw_sound_writemem)
2267   MDRV_CPU_PROGRAM_MAP(masterw_sound_map,0)
25742268
25752269   MDRV_QUANTUM_TIME(HZ(600))
25762270
r4499r4500
26042298
26052299   /* basic machine hardware */
26062300   MDRV_CPU_ADD("maincpu", M68000, 12000000)   /* 12 MHz */
2607   MDRV_CPU_PROGRAM_MAP(hitice_readmem, hitice_writemem)
2301   MDRV_CPU_PROGRAM_MAP(hitice_map,0)
26082302   MDRV_CPU_VBLANK_INT("screen", hitice_interrupt)
26092303
26102304   MDRV_CPU_ADD("audiocpu", Z80, 4000000)   /* 4 MHz */
2611   MDRV_CPU_PROGRAM_MAP(viofight_sound_readmem, viofight_sound_writemem)
2305   MDRV_CPU_PROGRAM_MAP(viofight_sound_map,0)
26122306
26132307   MDRV_QUANTUM_TIME(HZ(600))
26142308
r4499r4500
26482342
26492343   /* basic machine hardware */
26502344   MDRV_CPU_ADD("maincpu", M68000, XTAL_24MHz/2)   /* verified on pcb */
2651   MDRV_CPU_PROGRAM_MAP(rambo3_readmem,rambo3_writemem)
2345   MDRV_CPU_PROGRAM_MAP(rambo3_map,0)
26522346   MDRV_CPU_VBLANK_INT("screen", rambo3_interrupt)
26532347
26542348   MDRV_CPU_ADD("audiocpu", Z80, XTAL_24MHz/6)   /* verified on pcb */
2655   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
2349   MDRV_CPU_PROGRAM_MAP(sound_map,0)
26562350
26572351   MDRV_QUANTUM_TIME(HZ(600))
26582352
r4499r4500
26862380
26872381   /* basic machine hardware */
26882382   MDRV_CPU_ADD("maincpu", M68000, XTAL_24MHz/2)   /* verified on pcb */
2689   MDRV_CPU_PROGRAM_MAP(rambo3_readmem,rambo3_writemem)
2383   MDRV_CPU_PROGRAM_MAP(rambo3_map,0)
26902384   MDRV_CPU_VBLANK_INT("screen", rambo3_interrupt)
26912385
26922386   MDRV_CPU_ADD("audiocpu", Z80, XTAL_24MHz/6)   /* verified on pcb */
2693   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
2387   MDRV_CPU_PROGRAM_MAP(sound_map,0)
26942388
26952389   MDRV_QUANTUM_TIME(HZ(600))
26962390
r4499r4500
27242418
27252419   /* basic machine hardware */
27262420   MDRV_CPU_ADD("maincpu", M68000, 12000000)   /* 12 MHz */
2727   MDRV_CPU_PROGRAM_MAP(pbobble_readmem,pbobble_writemem)
2421   MDRV_CPU_PROGRAM_MAP(pbobble_map,0)
27282422   MDRV_CPU_VBLANK_INT("screen", pbobble_interrupt)
27292423
27302424   MDRV_CPU_ADD("audiocpu", Z80, 4000000)   /* 4 MHz */
2731   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
2425   MDRV_CPU_PROGRAM_MAP(sound_map,0)
27322426
27332427   MDRV_QUANTUM_TIME(HZ(600))
27342428
r4499r4500
27652459
27662460   /* basic machine hardware */
27672461   MDRV_CPU_ADD("maincpu", M68000, 12000000)   /* 12 MHz */
2768   MDRV_CPU_PROGRAM_MAP(spacedx_readmem,spacedx_writemem)
2462   MDRV_CPU_PROGRAM_MAP(spacedx_map,0)
27692463   MDRV_CPU_VBLANK_INT("screen", pbobble_interrupt)
27702464
27712465   MDRV_CPU_ADD("audiocpu", Z80, 4000000)   /* 4 MHz */
2772   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
2466   MDRV_CPU_PROGRAM_MAP(sound_map,0)
27732467
27742468   MDRV_QUANTUM_TIME(HZ(600))
27752469
r4499r4500
28062500
28072501   /* basic machine hardware */
28082502   MDRV_CPU_ADD("maincpu", M68000, 12000000)   /* 12 MHz */
2809   MDRV_CPU_PROGRAM_MAP(spacedxo_readmem,spacedxo_writemem)
2503   MDRV_CPU_PROGRAM_MAP(spacedxo_map,0)
28102504   MDRV_CPU_VBLANK_INT("screen", selfeena_interrupt)
28112505
28122506   MDRV_CPU_ADD("audiocpu", Z80, 4000000)   /* 4 MHz */
2813   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
2507   MDRV_CPU_PROGRAM_MAP(sound_map,0)
28142508
28152509   MDRV_QUANTUM_TIME(HZ(600))
28162510
r4499r4500
28442538
28452539   /* basic machine hardware */
28462540   MDRV_CPU_ADD("maincpu", M68000, 16000000)   /* 16 MHz according to the readme*/
2847   MDRV_CPU_PROGRAM_MAP(qzshowby_readmem,qzshowby_writemem)
2541   MDRV_CPU_PROGRAM_MAP(qzshowby_map,0)
28482542   MDRV_CPU_VBLANK_INT("screen", pbobble_interrupt)
28492543
28502544   MDRV_CPU_ADD("audiocpu", Z80, 4000000)   /* 4 MHz */
2851   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
2545   MDRV_CPU_PROGRAM_MAP(sound_map,0)
28522546
28532547   MDRV_QUANTUM_TIME(HZ(600))
28542548
r4499r4500
28852579
28862580   /* basic machine hardware */
28872581   MDRV_CPU_ADD("maincpu", M68000, 12000000)   /* 12 MHz */
2888   MDRV_CPU_PROGRAM_MAP(viofight_readmem,viofight_writemem)
2582   MDRV_CPU_PROGRAM_MAP(viofight_map,0)
28892583   MDRV_CPU_VBLANK_INT("screen", viofight_interrupt)
28902584
28912585   MDRV_CPU_ADD("audiocpu", Z80, 6000000)   /* 6 MHz verified */
2892   MDRV_CPU_PROGRAM_MAP(viofight_sound_readmem, viofight_sound_writemem)
2586   MDRV_CPU_PROGRAM_MAP(viofight_sound_map,0)
28932587
28942588   MDRV_QUANTUM_TIME(HZ(600))
28952589
r4499r4500
29272621
29282622   /* basic machine hardware */
29292623   MDRV_CPU_ADD("maincpu", M68000, 12000000)   /* 12 MHz */
2930   MDRV_CPU_PROGRAM_MAP(masterw_readmem,masterw_writemem)
2624   MDRV_CPU_PROGRAM_MAP(masterw_map,0)
29312625   MDRV_CPU_VBLANK_INT("screen", masterw_interrupt)
29322626
29332627   MDRV_CPU_ADD("audiocpu", Z80, 4000000)   /* 4 MHz */
2934   MDRV_CPU_PROGRAM_MAP(masterw_sound_readmem,masterw_sound_writemem)
2628   MDRV_CPU_PROGRAM_MAP(masterw_sound_map,0)
29352629
29362630   MDRV_QUANTUM_TIME(HZ(600))
29372631
r4499r4500
29662660
29672661   /* basic machine hardware */
29682662   MDRV_CPU_ADD("maincpu", M68000, 16000000)   /* 16 MHz ??? */
2969   MDRV_CPU_PROGRAM_MAP(silentd_readmem,silentd_writemem)
2663   MDRV_CPU_PROGRAM_MAP(silentd_map,0)
29702664   MDRV_CPU_VBLANK_INT("screen", silentd_interrupt)
29712665
29722666   MDRV_CPU_ADD("audiocpu", Z80, 4000000)   /* 4 MHz */
2973   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
2667   MDRV_CPU_PROGRAM_MAP(sound_map,0)
29742668
29752669   MDRV_QUANTUM_TIME(HZ(600))
29762670
r4499r4500
30042698
30052699   /* basic machine hardware */
30062700   MDRV_CPU_ADD("maincpu", M68000, 12000000)   /* 12 MHz */
3007   MDRV_CPU_PROGRAM_MAP(selfeena_readmem,selfeena_writemem)
2701   MDRV_CPU_PROGRAM_MAP(selfeena_map,0)
30082702   MDRV_CPU_VBLANK_INT("screen", selfeena_interrupt)
30092703
30102704   MDRV_CPU_ADD("audiocpu", Z80, 4000000)   /* 4 MHz */
3011   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
2705   MDRV_CPU_PROGRAM_MAP(sound_map,0)
30122706
30132707   MDRV_QUANTUM_TIME(HZ(600))
30142708
r4499r4500
30512745
30522746   /* basic machine hardware */
30532747   MDRV_CPU_ADD("maincpu", M68000, 12000000)   /* 12 MHz */
3054   MDRV_CPU_PROGRAM_MAP(selfeena_readmem,selfeena_writemem)
2748   MDRV_CPU_PROGRAM_MAP(selfeena_map,0)
30552749   MDRV_CPU_VBLANK_INT("screen", selfeena_interrupt)
30562750
30572751   MDRV_CPU_ADD("audiocpu", Z80, 4000000)   /* 4 MHz */
3058   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
2752   MDRV_CPU_PROGRAM_MAP(sound_map,0)
30592753
30602754   MDRV_QUANTUM_TIME(HZ(600))
30612755
r4499r4500
30962790
30972791   /* basic machine hardware */
30982792   MDRV_CPU_ADD("maincpu", M68000, 12000000)   /* 12 MHz */
3099   MDRV_CPU_PROGRAM_MAP(sbm_readmem,sbm_writemem)
2793   MDRV_CPU_PROGRAM_MAP(sbm_map,0)
31002794   MDRV_CPU_VBLANK_INT("screen", sbm_interrupt)
31012795
31022796   MDRV_CPU_ADD("audiocpu", Z80, 4000000)   /* 4 MHz */
3103   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
2797   MDRV_CPU_PROGRAM_MAP(sound_map,0)
31042798
31052799   MDRV_QUANTUM_TIME(HZ(600))
31062800
r4499r4500
36073301   ROM_LOAD( "pal16l8b-c16-09.ic35", 0x0200, 0x0104, CRC(0965baab) SHA1(3f704cd42d5277e9ba0b0680a2722488fc4cc630) )
36083302ROM_END
36093303
3610ROM_START( viofighu )
3304ROM_START( viofightu )
36113305   ROM_REGION( 0x080000, "maincpu", 0 )     /* 1M for 68000 code */
36123306   ROM_LOAD16_BYTE( "c16-11.42", 0x00000, 0x10000, CRC(23dbd388) SHA1(488f928826d16b201dcc4b491b09955d0af91f19) )
36133307   ROM_LOAD16_BYTE( "c16-13.23", 0x00001, 0x10000, CRC(ab947ffc) SHA1(103023cee4b20afa5086ba60522ea5aa723aebef) )
r4499r4500
36323326   ROM_LOAD( "pal16l8b-c16-09.ic35", 0x0200, 0x0104, CRC(0965baab) SHA1(3f704cd42d5277e9ba0b0680a2722488fc4cc630) )
36333327ROM_END
36343328
3635ROM_START( viofighj )
3329ROM_START( viofightj )
36363330   ROM_REGION( 0x080000, "maincpu", 0 )     /* 1M for 68000 code */
36373331   ROM_LOAD16_BYTE( "c16-11.42", 0x00000, 0x10000, CRC(23dbd388) SHA1(488f928826d16b201dcc4b491b09955d0af91f19) )
36383332   ROM_LOAD16_BYTE( "c16-10.23", 0x00001, 0x10000, CRC(329d2e46) SHA1(044e8a283e3bdd3d64dbeb9b6982088e967b10ff) )
r4499r4500
38583552GAME( 1989, tetrist,  tetris,  tetrist,  tetrist,  taito_b, ROT0,   "Sega", "Tetris (Japan, B-System, YM2610)", GAME_SUPPORTS_SAVE )
38593553GAME( 1989, tetrista, tetris,  tetrista, tetrist,  taito_b, ROT0,   "Sega", "Tetris (Japan, B-System, YM2203)", GAME_SUPPORTS_SAVE )
38603554GAME( 1989, viofight, 0,       viofight, viofight, taito_b, ROT0,   "Taito Corporation Japan", "Violence Fight (World)", GAME_SUPPORTS_SAVE )
3861GAME( 1989, viofighu, viofight,viofight, viofight, taito_b, ROT0,   "Taito America Corporation", "Violence Fight (US)", GAME_SUPPORTS_SAVE )
3862GAME( 1989, viofighj, viofight,viofight, viofight, taito_b, ROT0,   "Taito Corporation", "Violence Fight (Japan)", GAME_SUPPORTS_SAVE )
3555GAME( 1989, viofightu,viofight,viofight, viofight, taito_b, ROT0,   "Taito America Corporation", "Violence Fight (US)", GAME_SUPPORTS_SAVE )
3556GAME( 1989, viofightj,viofight,viofight, viofight, taito_b, ROT0,   "Taito Corporation", "Violence Fight (Japan)", GAME_SUPPORTS_SAVE )
38633557GAME( 1990, ashura,   0,       ashura,   ashura,   taito_b, ROT270, "Taito Corporation", "Ashura Blaster (Japan)", GAME_SUPPORTS_SAVE )
38643558GAME( 1990, ashurau,  ashura,  ashura,   ashurau,  taito_b, ROT270, "Taito America Corporation", "Ashura Blaster (US)", GAME_SUPPORTS_SAVE )
38653559GAME( 1990, hitice,   0,       hitice,   hitice,   taito_b, ROT0,   "Williams", "Hit the Ice (US)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
src/mame/drivers/jackal.c
r4499r4500
8686
8787static READ8_HANDLER( topgunbl_rotary_r )
8888{
89   return (1 << (input_port_read(space->machine, offset ? "DIAL1" : "DIAL0") * 8 / 256)) ^ 0xff;
89   return (1 << input_port_read(space->machine, offset ? "DIAL1" : "DIAL0")) ^ 0xff;
9090}
9191
9292static WRITE8_HANDLER( jackal_flipscreen_w )
r4499r4500
183183   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
184184
185185   PORT_START("DIAL0")   // player 1 8-way rotary control - converted in topgunbl_rotary_r()
186   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X)
186   PORT_BIT( 0xff, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(8) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_FULL_TURN_COUNT(8)
187187
188188   PORT_START("DIAL1")   // player 2 8-way rotary control - converted in topgunbl_rotary_r()
189   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_PLAYER(2)
189   PORT_BIT( 0xff, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(8) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_PLAYER(2) PORT_FULL_TURN_COUNT(8)
190190INPUT_PORTS_END
191191
192192/* Graphics Layouts */
src/mame/drivers/cps2.c
r4499r4500
29032903ROM_START( vampj )
29042904   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
29052905   ROM_LOAD16_WORD_SWAP( "vamj.03a", 0x000000, 0x80000, CRC(f55d3722) SHA1(e26bbcc47a2485914d567a6cf1cddd0f668689a1) )
2906   ROM_LOAD16_WORD_SWAP( "vamj.04b", 0x080000, 0x80000, CRC(4d9c43c4) SHA1(2087090306646fed959d503ee75e24996ad95b88) )
2907   ROM_LOAD16_WORD_SWAP( "vamj.05a", 0x100000, 0x80000, CRC(6c497e92) SHA1(7c1ccdfd77fb50afe024c8402376daaeab641a24) )
2906   ROM_LOAD16_WORD_SWAP( "vamj.04b", 0x080000, 0x80000, CRC(4d9c43c4) SHA1(2087090306646fed959d503ee75e24996ad95b88) ) /* incomplete updated set, all */
2907   ROM_LOAD16_WORD_SWAP( "vamj.05a", 0x100000, 0x80000, CRC(6c497e92) SHA1(7c1ccdfd77fb50afe024c8402376daaeab641a24) ) /* roms should be "B" revision */
29082908   ROM_LOAD16_WORD_SWAP( "vamj.06a", 0x180000, 0x80000, CRC(f1bbecb6) SHA1(6adba89393e05f16f70b57085cabd6b4c20f53e8) )
29092909   ROM_LOAD16_WORD_SWAP( "vamj.07a", 0x200000, 0x80000, CRC(1067ad84) SHA1(5e4cc75cfdfd512b6230c656e7304262b5143aee) )
29102910   ROM_LOAD16_WORD_SWAP( "vamj.08a", 0x280000, 0x80000, CRC(4b89f41f) SHA1(bd78f33a6d448655eecf7448921d282b302fa4cb) )
r4499r4500
43324332   ROM_LOAD16_WORD_SWAP( "mpn-simm.05b",   0x200000, 0x200000, CRC(5462f4e8) SHA1(299fbdab700e735e6395c5d9e3f079bb2e3dbd73) ) // ROM on a simm
43334333ROM_END
43344334
4335ROM_START( mpangr1 )
4336   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
4337   ROM_LOAD16_WORD_SWAP( "mpne.03b", 0x000000, 0x80000, CRC(6ef0f9b2) SHA1(fd1c76e151466fe27b02a6d07683fdd9c6a4816d) )
4338   ROM_LOAD16_WORD_SWAP( "mpne.04b", 0x080000, 0x80000, CRC(30a468bb) SHA1(f2f8f600a079ff050c9a0c12e1a6368943bdc536) )
4339
4340   ROM_REGION( 0x1000000, "gfx", 0 )
4341   ROMX_LOAD( "mpn-simm.01c",   0x0000000, 0x200000, CRC(388db66b) SHA1(7416cce3d0dbea71c92ea9f72f5536146f757b45) , ROM_GROUPBYTE | ROM_SKIP(7) ) // ROM on a simm
4342   ROMX_LOAD( "mpn-simm.01d",   0x0000001, 0x200000, CRC(aff1b494) SHA1(d376c02ce01e71a7707d3d3fe5b0ae59ce781686) , ROM_GROUPBYTE | ROM_SKIP(7) ) // ROM on a simm
4343   ROMX_LOAD( "mpn-simm.01a",   0x0000002, 0x200000, CRC(a9c4857b) SHA1(66f538105c710d1480141e48a15b1a760f5ce985) , ROM_GROUPBYTE | ROM_SKIP(7) ) // ROM on a simm
4344   ROMX_LOAD( "mpn-simm.01b",   0x0000003, 0x200000, CRC(f759df22) SHA1(1678e3e819dd808f3a6fdd52b7c933eac4777b5b) , ROM_GROUPBYTE | ROM_SKIP(7) ) // ROM on a simm
4345   ROMX_LOAD( "mpn-simm.03c",   0x0000004, 0x200000, CRC(dec6b720) SHA1(331776e1cba3fb82071e7c2195dc4ae27b3613a2) , ROM_GROUPBYTE | ROM_SKIP(7) ) // ROM on a simm
4346   ROMX_LOAD( "mpn-simm.03d",   0x0000005, 0x200000, CRC(f8774c18) SHA1(58e0ea4dd62e39bcfaa3a2be4ef08eb2f0bd3c00) , ROM_GROUPBYTE | ROM_SKIP(7) ) // ROM on a simm
4347   ROMX_LOAD( "mpn-simm.03a",   0x0000006, 0x200000, CRC(c2aea4ec) SHA1(f5e2a815fa802598611efa48e5de97e929155e77) , ROM_GROUPBYTE | ROM_SKIP(7) ) // ROM on a simm
4348   ROMX_LOAD( "mpn-simm.03b",   0x0000007, 0x200000, CRC(84d6dc33) SHA1(f5ababb479facc08c425381570644230c09334e7) , ROM_GROUPBYTE | ROM_SKIP(7) ) // ROM on a simm
4349
4350   ROM_REGION( QSOUND_SIZE, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */
4351   ROM_LOAD( "mpn.01",   0x00000, 0x08000, CRC(90c7adb6) SHA1(a2653e977e5e0457b249e098e5ca0abc93dac336) )
4352   ROM_CONTINUE(         0x10000, 0x18000 )
4353
4354   ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
4355   ROM_LOAD16_WORD_SWAP( "mpn-simm.05a",   0x000000, 0x200000, CRC(318a2e21) SHA1(c573cd88f8279a062c73ef1d79cd8421dbdcd93e) ) // ROM on a simm
4356   ROM_LOAD16_WORD_SWAP( "mpn-simm.05b",   0x200000, 0x200000, CRC(5462f4e8) SHA1(299fbdab700e735e6395c5d9e3f079bb2e3dbd73) ) // ROM on a simm
4357ROM_END
4358
43354359ROM_START( mpangu )
43364360   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
43374361   ROM_LOAD16_WORD_SWAP( "mpnu.03", 0x000000, 0x80000, CRC(6e7ed03c) SHA1(3562362d9573252d4d19dbfd0ec7e47e9eaa5f46) ) /* USA version, but has no "u" in label code */
r4499r4500
45034527   ROM_LOAD16_WORD_SWAP( "vph.12m",   0x200000, 0x200000, CRC(fbd3cd90) SHA1(4813c25802ad71b77ca04fd8f3a86344f99f0d6a) )
45044528ROM_END
45054529
4530ROM_START( nwarra )
4531   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
4532   ROM_LOAD16_WORD_SWAP( "vpha.03b", 0x000000, 0x80000, CRC(0a70cdd6) SHA1(08d3f3892bfc8e741c59071150e6c3a8bf5ffbef) )
4533   ROM_LOAD16_WORD_SWAP( "vpha.04b", 0x080000, 0x80000, CRC(70ce62e4) SHA1(8bc9066071585805b6420bcc40eb03e641e3f027) )
4534   ROM_LOAD16_WORD_SWAP( "vpha.05b", 0x100000, 0x80000, CRC(5692a03f) SHA1(7c2ba1022ee4045d985477a6c9026140b7809234) )
4535   ROM_LOAD16_WORD_SWAP( "vpha.06b", 0x180000, 0x80000, CRC(b810fe66) SHA1(787198f546a0d3dbf0f2d54a4328aaaf4e3cdcae) )
4536   ROM_LOAD16_WORD_SWAP( "vpha.07b", 0x200000, 0x80000, CRC(1be264f3) SHA1(b08d0771963e6b8c1a2d32e6db3edd9bffea39e1) )
4537   ROM_LOAD16_WORD_SWAP( "vpha.08b", 0x280000, 0x80000, CRC(86f1ed52) SHA1(95095ef7037cf5f90f00b15f224e4b35e3ea675e) )
4538   ROM_LOAD16_WORD_SWAP( "vpha.09b", 0x300000, 0x80000, CRC(7e96bd0a) SHA1(f7750209b157a405710c0797e9eb30f980db582d) )
4539   ROM_LOAD16_WORD_SWAP( "vpha.10b", 0x380000, 0x80000, CRC(58bce2fd) SHA1(2df1460cb349d64ca84fd3372a9a64b6cdbe078f) )
4540
4541   ROM_REGION( 0x2000000, "gfx", 0 )
4542   ROMX_LOAD( "vph.13m",   0x0000000, 0x400000, CRC(c51baf99) SHA1(2fb6642908e542e404391eb17392f8270e87bf48) , ROM_GROUPWORD | ROM_SKIP(6) )
4543   ROMX_LOAD( "vph.15m",   0x0000002, 0x400000, CRC(3ce83c77) SHA1(93369b23c6d7d834297434691bb047ee3dd9539c) , ROM_GROUPWORD | ROM_SKIP(6) )
4544   ROMX_LOAD( "vph.17m",   0x0000004, 0x400000, CRC(4f2408e0) SHA1(cd49c6b3c7e6470c6058f98ccc5210b052bb13e2) , ROM_GROUPWORD | ROM_SKIP(6) )
4545   ROMX_LOAD( "vph.19m",   0x0000006, 0x400000, CRC(9ff60250) SHA1(d69ba4dc6bd37d003245f0cf3211d6e2623005b8) , ROM_GROUPWORD | ROM_SKIP(6) )
4546   ROMX_LOAD( "vph.14m",   0x1000000, 0x400000, CRC(7a0e1add) SHA1(6b28a91bd59bba97886fdea30116a5b1071109ed) , ROM_GROUPWORD | ROM_SKIP(6) )
4547   ROMX_LOAD( "vph.16m",   0x1000002, 0x400000, CRC(2f41ca75) SHA1(f4a67e60b62001e6fe75cb05b9c81040a8a09f54) , ROM_GROUPWORD | ROM_SKIP(6) )
4548   ROMX_LOAD( "vph.18m",   0x1000004, 0x400000, CRC(64498eed) SHA1(d64e54a9ad1cbb927b7bac2eb16e1487834c5706) , ROM_GROUPWORD | ROM_SKIP(6) )
4549   ROMX_LOAD( "vph.20m",   0x1000006, 0x400000, CRC(17f2433f) SHA1(0cbf8c96f92016fefb4a9c668ce5fd260342d712) , ROM_GROUPWORD | ROM_SKIP(6) )
4550
4551   ROM_REGION( QSOUND_SIZE, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */
4552   ROM_LOAD( "vph.01",   0x00000, 0x08000, CRC(5045dcac) SHA1(fd1a6586fbdd48a707df1fa52309b4cf50e3cc4c) )
4553   ROM_CONTINUE(         0x10000, 0x18000 )
4554   ROM_LOAD( "vph.02",   0x28000, 0x20000, CRC(86b60e59) SHA1(197d07ced8b9850729c83fa59b7afc283500bdee) )
4555
4556   ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
4557   ROM_LOAD16_WORD_SWAP( "vph.11m",   0x000000, 0x200000, CRC(e1837d33) SHA1(e3cb69f64767bacbec7286d0b4cd0ce7a0ba13d8) )
4558   ROM_LOAD16_WORD_SWAP( "vph.12m",   0x200000, 0x200000, CRC(fbd3cd90) SHA1(4813c25802ad71b77ca04fd8f3a86344f99f0d6a) )
4559ROM_END
4560
45064561ROM_START( vhuntj )
45074562   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
45084563   ROM_LOAD16_WORD_SWAP( "vphj.03f", 0x000000, 0x80000, CRC(3de2e333) SHA1(2f9f756c5c91646625d70debd5b19b8dbd13a62f) )
r4499r4500
74437498GAME( 1994, dstlku,   dstlk,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Darkstalkers: The Night Warriors (USA 940818)", 0 )
74447499GAME( 1994, dstlkur1, dstlk,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Darkstalkers: The Night Warriors (USA 940705)", 0 )
74457500GAME( 1994, dstlka,   dstlk,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Darkstalkers: The Night Warriors (Asia 940705)", 0 )
7446GAME( 1994, vampj,    dstlk,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire: The Night Warriors (Japan 940705)", 0 )   // one of these two must be a bad dump
7501GAME( 1994, vampj,    dstlk,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire: The Night Warriors (Japan 940705)", 0 )   // partial update set? Only rom 04 is "B" revision
74477502GAME( 1994, vampja,   dstlk,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire: The Night Warriors (Japan 940705 alt)", 0 )
74487503GAME( 1994, vampjr1,  dstlk,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire: The Night Warriors (Japan 940630)", 0 )
74497504GAME( 1994, ringdest, 0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Ring of Destruction: Slammasters II (Euro 940902)", 0 )
r4499r4500
74687523GAME( 1995, nwarru,   nwarr,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Night Warriors: Darkstalkers' Revenge (USA 950406)", 0 )
74697524GAME( 1995, nwarrh,   nwarr,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Night Warriors: Darkstalkers' Revenge (Hispanic 950403)", 0 )
74707525GAME( 1995, nwarrb,   nwarr,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Night Warriors: Darkstalkers' Revenge (Brazil 950403)", 0 )
7526GAME( 1995, nwarra,   nwarr,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Night Warriors: Darkstalkers' Revenge (Asia 950302)", 0 )
74717527GAME( 1995, vhuntj,   nwarr,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Hunter: Darkstalkers' Revenge (Japan 950316)", 0 )
74727528GAME( 1995, vhuntjr1, nwarr,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Hunter: Darkstalkers' Revenge (Japan 950307)", 0 )
74737529GAME( 1995, vhuntjr2, nwarr,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Hunter: Darkstalkers' Revenge (Japan 950302)", 0 )
r4499r4500
76077663/* Games released on CPS-2 hardware by Mitchell */
76087664
76097665GAME( 2000, mpang,    0,        cps2, cps2_2p1b, cps2,     ROT0,   "Mitchell, distributed by Capcom", "Mighty! Pang (Euro 001010)", 0 )
7666GAME( 2000, mpangr1,  mpang,    cps2, cps2_2p1b, cps2,     ROT0,   "Mitchell, distributed by Capcom", "Mighty! Pang (Euro 000925)", 0 )
76107667GAME( 2000, mpangu,   mpang,    cps2, cps2_2p1b, cps2,     ROT0,   "Mitchell, distributed by Capcom", "Mighty! Pang (USA 001010)", 0 )
76117668GAME( 2000, mpangj,   mpang,    cps2, cps2_2p1b, cps2,     ROT0,   "Mitchell, distributed by Capcom", "Mighty! Pang (Japan 001011)", 0 )
76127669GAME( 2001, pzloop2,  0,        cps2, pzloop2,   pzloop2,  ROT0,   "Mitchell, distributed by Capcom", "Puzz Loop 2 (Euro 010302)", 0 )
src/mame/drivers/namcos12.c
r4499r4500
10001000static UINT32 m_n_dmaoffset;
10011001static UINT32 m_n_dmabias;
10021002static UINT32 m_n_tektagdmaoffset;
1003static int has_tektagt_dma;
10031004
10041005static WRITE32_HANDLER( dmaoffset_w )
10051006{
r4499r4500
10251026   UINT16 *source;
10261027   UINT16 *destination;
10271028
1028   if( ( m_n_dmaoffset >= 0x80000000 ) || ( m_n_dmabias == 0x1f300000 ) )
1029   if(has_tektagt_dma && !m_n_dmaoffset)
10291030   {
1030      n_region =  "user1";
1031      n_offset = m_n_dmaoffset & 0x003fffff;
1032      verboselog( machine, 1, "namcos12_rom_read( %08x, %08x ) boot %08x\n", n_address, n_size, n_offset );
1033   }
1034   else if( m_n_tektagdmaoffset >= 0x00000000 && m_n_tektagdmaoffset <= 0x03800000 )
1035   {
10361031      n_region = "user2";
10371032      n_offset = m_n_tektagdmaoffset & 0x7fffffff;
1038      verboselog( machine, 1, "namcos12_rom_read( %08x, %08x ) tektag1 %08x\n", n_address, n_size, n_offset );
1033      verboselog( machine, 1, "namcos12_rom_read( %08x, %08x ) tektagt %08x\n", n_address, n_size, n_offset );
10391034   }
1040   else if( m_n_tektagdmaoffset >= 0x04000000 && m_n_tektagdmaoffset <= 0x04400000 )
1035   else if( ( m_n_dmaoffset >= 0x80000000 ) || ( m_n_dmabias == 0x1f300000 ) )
10411036   {
10421037      n_region = "user1";
1043      n_offset = m_n_tektagdmaoffset & 0x003fffff;
1044      verboselog( machine, 1, "namcos12_rom_read( %08x, %08x ) tektag2 %08x\n", n_address, n_size, n_offset );
1038      n_offset = m_n_dmaoffset & 0x003fffff;
1039      verboselog( machine, 1, "namcos12_rom_read( %08x, %08x ) boot %08x\n", n_address, n_size, n_offset );
10451040   }
10461041   else
10471042   {
r4499r4500
10851080}
10861081
10871082static ADDRESS_MAP_START( namcos12_map, ADDRESS_SPACE_PROGRAM, 32 )
1088   AM_RANGE(0x00000000, 0x003fffff) AM_RAM   AM_SHARE(1) AM_BASE(&g_p_n_psxram) AM_SIZE(&g_n_psxramsize) /* ram */
1083   AM_RANGE(0x00000000, 0x003fffff) AM_RAM AM_SHARE(1) AM_BASE(&g_p_n_psxram) AM_SIZE(&g_n_psxramsize) /* ram */
10891084   AM_RANGE(0x1f000000, 0x1f000003) AM_READWRITE(SMH_NOP, bankoffset_w)         /* banking */
10901085   AM_RANGE(0x1f080000, 0x1f083fff) AM_READWRITE(sharedram_r, sharedram_w) AM_BASE(&namcos12_sharedram) /* shared ram?? */
10911086   AM_RANGE(0x1f140000, 0x1f140fff) AM_DEVREADWRITE8("at28c16", at28c16_r, at28c16_w, 0x00ff00ff) /* eeprom */
r4499r4500
11771172   memory_set_bankptr(space->machine,  2, kcram );
11781173}
11791174
1175static int ttt_cnt;
1176static UINT32 ttt_val[2];
1177
11801178static WRITE32_HANDLER( tektagt_protection_1_w )
11811179{
1180   // Second dma offset or protection ref values write
11821181   m_n_tektagdmaoffset = data;
1183   verboselog( space->machine, 1, "tektagt_protection_1_w( %08x, %08x, %08x)\n", offset, mem_mask, data );
1182   if(ttt_cnt != 2)
1183      ttt_val[ttt_cnt++] = data;
11841184}
11851185
11861186static READ32_HANDLER( tektagt_protection_1_r )
11871187{
1188   UINT32 data = 0x8000;
1189   verboselog( space->machine, 1, "tektagt_protection_1_r( %08x, %08x, %08x)\n", offset, mem_mask, data );
1190   return data;
1188   // Reads are either ignored or bit 15 is tested for a busy flag
1189   return 0x8000;
11911190}
11921191
11931192static WRITE32_HANDLER( tektagt_protection_2_w )
11941193{
1195   verboselog( space->machine, 1, "tektagt_protection_2_w( %08x, %08x, %08x)\n", offset, mem_mask, data );
1194   // Writes are 0 or rand(), only used as a "start prot value write" trigger
1195   ttt_cnt = 0;
11961196}
11971197
11981198static READ32_HANDLER( tektagt_protection_2_r )
11991199{
1200   UINT32 data = 0x36e2;
1201   verboselog( space->machine, 1, "tektagt_protection_2_r( %08x, %08x, %08x)\n", offset, mem_mask, data );
1200   UINT32 data = 0;
1201
1202   if(((ttt_val[0] >> 16) & 0xff) == 0x6d)
1203      data |= 0x000036e2;
1204
1205   if(((ttt_val[0] >> 16) & 0xff) == 0x4c)
1206      data |= 0x00002651;
1207
1208   if(((ttt_val[1] >> 16) & 0xff) == 0x82)
1209      data |= 0x41860000;
1210
1211   if(((ttt_val[1] >> 16) & 0xff) == 0x78)
1212      data |= 0x3c7d0000;
1213
1214   if(((ttt_val[1] >> 16) & 0xff) == 0xa9)
1215      data |= 0x552e0000;
1216
12021217   return data;
12031218}
12041219
1220static READ32_HANDLER( tektagt_protection_3_r )
1221{
1222   // Always ignored
1223   return 0;
1224}
1225
12051226static MACHINE_RESET( namcos12 )
12061227{
12071228   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
12081229   psx_machine_init(machine);
12091230   bankoffset_w(space,0,0,0xffffffff);
1231   has_tektagt_dma = 0;
12101232
12111233   if( strcmp( machine->gamedrv->name, "tektagt" ) == 0 ||
12121234      strcmp( machine->gamedrv->name, "tektagta" ) == 0 ||
12131235      strcmp( machine->gamedrv->name, "tektagtb" ) == 0 ||
12141236      strcmp( machine->gamedrv->name, "tektagtc" ) == 0 )
12151237   {
1216      memory_install_readwrite32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1fb00000, 0x1fb00003, 0, 0, tektagt_protection_1_r, tektagt_protection_1_w );
1217      memory_install_readwrite32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1fb80000, 0x1fb80003, 0, 0, tektagt_protection_2_r, tektagt_protection_2_w );
1238      has_tektagt_dma = 1;
1239      memory_install_readwrite32_handler(space, 0x1fb00000, 0x1fb00003, 0, 0, tektagt_protection_1_r, tektagt_protection_1_w );
1240      memory_install_readwrite32_handler(space, 0x1fb80000, 0x1fb80003, 0, 0, tektagt_protection_2_r, tektagt_protection_2_w );
1241      memory_install_read32_handler(space, 0x1f700000, 0x1f700003, 0, 0, tektagt_protection_3_r );
12181242   }
12191243
12201244   if( strcmp( machine->gamedrv->name, "tektagt" ) == 0 ||
r4499r4500
12361260      strcmp( machine->gamedrv->name, "ghlpanic" ) == 0 )
12371261   {
12381262      /* this is based on guesswork, it might not even be keycus. */
1239      memory_install_read32_handler (cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1fc20280, 0x1fc2028b, 0, 0, SMH_BANK2 );
1240      memory_install_write32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1f008000, 0x1f008003, 0, 0, kcon_w );
1241      memory_install_write32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1f018000, 0x1f018003, 0, 0, kcoff_w );
1263      memory_install_read32_handler (space, 0x1fc20280, 0x1fc2028b, 0, 0, SMH_BANK2 );
1264      memory_install_write32_handler(space, 0x1f008000, 0x1f008003, 0, 0, kcon_w );
1265      memory_install_write32_handler(space, 0x1f018000, 0x1f018003, 0, 0, kcoff_w );
12421266
12431267      memset( kcram, 0, sizeof( kcram ) );
12441268      memory_set_bankptr(space->machine,  2, kcram );
12451269   }
12461270}
12471271
1248
12491272/* H8/3002 MCU stuff */
12501273static ADDRESS_MAP_START( s12h8rwmap, ADDRESS_SPACE_PROGRAM, 16 )
12511274   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
r4499r4500
14471470   s12_setnum = 0;
14481471   memset(s12_settings, 0, sizeof(s12_settings));
14491472
1450   m_n_tektagdmaoffset = 0xffffffff;
1473   m_n_tektagdmaoffset = 0;
14511474   m_n_dmaoffset = 0;
14521475   m_n_dmabias = 0;
14531476   m_n_bankoffset = 0;
r4499r4500
22062229   ROM_LOAD32_WORD( "teg3rom1o.14", 0x1000002, 0x800000, CRC(2434ceb6) SHA1(f19f1599acbd6fd48793a2ee5a500ca817d9df56) )
22072230   ROM_LOAD32_WORD( "teg3rom2e.11", 0x2000000, 0x800000, CRC(6e5c3428) SHA1(e3cdb60a4445406877b2e273385f34bfb0974220) )
22082231   ROM_LOAD32_WORD( "teg3rom2o.15", 0x2000002, 0x800000, CRC(21ce9dfa) SHA1(f27e8210ee236c327aa3e1ce4dd408abc6580a1b) )
2209   ROM_LOAD16_BYTE( "teg3flel.4",   0x3000000, 0x200000, CRC(88b3823c) SHA1(6f31acb642c57daccbfdb87b790037e261c8c73c) )
2210   ROM_LOAD16_BYTE( "teg3fleu.5",   0x3000001, 0x200000, CRC(36df0867) SHA1(6bec8560ad4c122dc909daa83aa9089ba5b281f7) )
2211   ROM_LOAD16_BYTE( "teg3flol.6",   0x3400000, 0x200000, CRC(03a76765) SHA1(ae35ae28375f2a3e52d72b77ec09750c326cc269) )
2212   ROM_LOAD16_BYTE( "teg3flou.7",   0x3400001, 0x200000, CRC(6d6947d1) SHA1(2f307bc4070fadb510c0473bc91d917b2d845ca5) )
22132232
2233   ROM_LOAD32_BYTE( "teg3flel.4",   0x3000000, 0x200000, CRC(88b3823c) SHA1(6f31acb642c57daccbfdb87b790037e261c8c73c) )
2234   ROM_LOAD32_BYTE( "teg3fleu.5",   0x3000001, 0x200000, CRC(36df0867) SHA1(6bec8560ad4c122dc909daa83aa9089ba5b281f7) )
2235   ROM_LOAD32_BYTE( "teg3flol.6",   0x3000002, 0x200000, CRC(03a76765) SHA1(ae35ae28375f2a3e52d72b77ec09750c326cc269) )
2236   ROM_LOAD32_BYTE( "teg3flou.7",   0x3000003, 0x200000, CRC(6d6947d1) SHA1(2f307bc4070fadb510c0473bc91d917b2d845ca5) )
2237
22142238   ROM_REGION( 0x0080000, "sub", 0 ) /* sound prg */
22152239   ROM_LOAD16_WORD_SWAP( "teg3verb.11s", 0x0000000, 0x080000, CRC(67d0c469) SHA1(da164702fc21b9f46a9e32c89e7b1d36070ddf79) )
22162240
r4499r4500
22312255   ROM_LOAD32_WORD( "teg3rom1o.14", 0x1000002, 0x800000, CRC(2434ceb6) SHA1(f19f1599acbd6fd48793a2ee5a500ca817d9df56) )
22322256   ROM_LOAD32_WORD( "teg3rom2e.11", 0x2000000, 0x800000, CRC(6e5c3428) SHA1(e3cdb60a4445406877b2e273385f34bfb0974220) )
22332257   ROM_LOAD32_WORD( "teg3rom2o.15", 0x2000002, 0x800000, CRC(21ce9dfa) SHA1(f27e8210ee236c327aa3e1ce4dd408abc6580a1b) )
2234   ROM_LOAD16_BYTE( "teg3flel.4",   0x3000000, 0x200000, CRC(88b3823c) SHA1(6f31acb642c57daccbfdb87b790037e261c8c73c) )
2235   ROM_LOAD16_BYTE( "teg3fleu.5",   0x3000001, 0x200000, CRC(36df0867) SHA1(6bec8560ad4c122dc909daa83aa9089ba5b281f7) )
2236   ROM_LOAD16_BYTE( "teg3flol.6",   0x3400000, 0x200000, CRC(03a76765) SHA1(ae35ae28375f2a3e52d72b77ec09750c326cc269) )
2237   ROM_LOAD16_BYTE( "teg3flou.7",   0x3400001, 0x200000, CRC(6d6947d1) SHA1(2f307bc4070fadb510c0473bc91d917b2d845ca5) )
22382258
2259   ROM_LOAD32_BYTE( "teg3flel.4",   0x3000000, 0x200000, CRC(88b3823c) SHA1(6f31acb642c57daccbfdb87b790037e261c8c73c) )
2260   ROM_LOAD32_BYTE( "teg3fleu.5",   0x3000001, 0x200000, CRC(36df0867) SHA1(6bec8560ad4c122dc909daa83aa9089ba5b281f7) )
2261   ROM_LOAD32_BYTE( "teg3flol.6",   0x3000002, 0x200000, CRC(03a76765) SHA1(ae35ae28375f2a3e52d72b77ec09750c326cc269) )
2262   ROM_LOAD32_BYTE( "teg3flou.7",   0x3000003, 0x200000, CRC(6d6947d1) SHA1(2f307bc4070fadb510c0473bc91d917b2d845ca5) )
2263
22392264   ROM_REGION( 0x0080000, "sub", 0 ) /* sound prg */
22402265   ROM_LOAD16_WORD_SWAP( "teg3verb.11s", 0x0000000, 0x080000, CRC(67d0c469) SHA1(da164702fc21b9f46a9e32c89e7b1d36070ddf79) )
22412266
r4499r4500
22562281   ROM_LOAD32_WORD( "teg3rom1o.14", 0x1000002, 0x800000, CRC(2434ceb6) SHA1(f19f1599acbd6fd48793a2ee5a500ca817d9df56) )
22572282   ROM_LOAD32_WORD( "teg3rom2e.11", 0x2000000, 0x800000, CRC(6e5c3428) SHA1(e3cdb60a4445406877b2e273385f34bfb0974220) )
22582283   ROM_LOAD32_WORD( "teg3rom2o.15", 0x2000002, 0x800000, CRC(21ce9dfa) SHA1(f27e8210ee236c327aa3e1ce4dd408abc6580a1b) )
2259   ROM_LOAD16_BYTE( "teg3flel.4",   0x3000000, 0x200000, CRC(88b3823c) SHA1(6f31acb642c57daccbfdb87b790037e261c8c73c) )
2260   ROM_LOAD16_BYTE( "teg3fleu.5",   0x3000001, 0x200000, CRC(36df0867) SHA1(6bec8560ad4c122dc909daa83aa9089ba5b281f7) )
2261   ROM_LOAD16_BYTE( "teg3flol.6",   0x3400000, 0x200000, CRC(03a76765) SHA1(ae35ae28375f2a3e52d72b77ec09750c326cc269) )
2262   ROM_LOAD16_BYTE( "teg3flou.7",   0x3400001, 0x200000, CRC(6d6947d1) SHA1(2f307bc4070fadb510c0473bc91d917b2d845ca5) )
22632284
2285   ROM_LOAD32_BYTE( "teg3flel.4",   0x3000000, 0x200000, CRC(88b3823c) SHA1(6f31acb642c57daccbfdb87b790037e261c8c73c) )
2286   ROM_LOAD32_BYTE( "teg3fleu.5",   0x3000001, 0x200000, CRC(36df0867) SHA1(6bec8560ad4c122dc909daa83aa9089ba5b281f7) )
2287   ROM_LOAD32_BYTE( "teg3flol.6",   0x3000002, 0x200000, CRC(03a76765) SHA1(ae35ae28375f2a3e52d72b77ec09750c326cc269) )
2288   ROM_LOAD32_BYTE( "teg3flou.7",   0x3000003, 0x200000, CRC(6d6947d1) SHA1(2f307bc4070fadb510c0473bc91d917b2d845ca5) )
2289
22642290   ROM_REGION( 0x0080000, "sub", 0 ) /* sound prg */
22652291   ROM_LOAD16_WORD_SWAP( "teg3verb.11s", 0x0000000, 0x080000, CRC(67d0c469) SHA1(da164702fc21b9f46a9e32c89e7b1d36070ddf79) )
22662292
r4499r4500
22812307   ROM_LOAD32_WORD( "teg3rom1o.14", 0x1000002, 0x800000, CRC(2434ceb6) SHA1(f19f1599acbd6fd48793a2ee5a500ca817d9df56) )
22822308   ROM_LOAD32_WORD( "teg3rom2e.11", 0x2000000, 0x800000, CRC(6e5c3428) SHA1(e3cdb60a4445406877b2e273385f34bfb0974220) )
22832309   ROM_LOAD32_WORD( "teg3rom2o.15", 0x2000002, 0x800000, CRC(21ce9dfa) SHA1(f27e8210ee236c327aa3e1ce4dd408abc6580a1b) )
2284   ROM_LOAD16_BYTE( "teg3flel.4",   0x3000000, 0x200000, CRC(88b3823c) SHA1(6f31acb642c57daccbfdb87b790037e261c8c73c) )
2285   ROM_LOAD16_BYTE( "teg3fleu.5",   0x3000001, 0x200000, CRC(36df0867) SHA1(6bec8560ad4c122dc909daa83aa9089ba5b281f7) )
2286   ROM_LOAD16_BYTE( "teg3flol.6",   0x3400000, 0x200000, CRC(03a76765) SHA1(ae35ae28375f2a3e52d72b77ec09750c326cc269) )
2287   ROM_LOAD16_BYTE( "teg3flou.7",   0x3400001, 0x200000, CRC(6d6947d1) SHA1(2f307bc4070fadb510c0473bc91d917b2d845ca5) )
22882310
2311   ROM_LOAD32_BYTE( "teg3flel.4",   0x3000000, 0x200000, CRC(88b3823c) SHA1(6f31acb642c57daccbfdb87b790037e261c8c73c) )
2312   ROM_LOAD32_BYTE( "teg3fleu.5",   0x3000001, 0x200000, CRC(36df0867) SHA1(6bec8560ad4c122dc909daa83aa9089ba5b281f7) )
2313   ROM_LOAD32_BYTE( "teg3flol.6",   0x3000002, 0x200000, CRC(03a76765) SHA1(ae35ae28375f2a3e52d72b77ec09750c326cc269) )
2314   ROM_LOAD32_BYTE( "teg3flou.7",   0x3000003, 0x200000, CRC(6d6947d1) SHA1(2f307bc4070fadb510c0473bc91d917b2d845ca5) )
2315
22892316   ROM_REGION( 0x0080000, "sub", 0 ) /* sound prg */
22902317   ROM_LOAD16_WORD_SWAP( "teg3verb.11s", 0x0000000, 0x080000, CRC(67d0c469) SHA1(da164702fc21b9f46a9e32c89e7b1d36070ddf79) )
22912318
r4499r4500
23782405GAME( 1999, pacapp,    0,        coh700,   namcos12, namcos12, ROT0, "Produce/Namco", "Paca Paca Passion (Japan, PPP1/VER.A2)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC038 */
23792406GAME( 1999, ptblank2,  0,        coh700,   ptblank2, ptblank2, ROT0, "Namco",         "Point Blank 2 (GNB5/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC042 */
23802407GAME( 1999, sws99,     0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Super World Stadium '99 (Japan, SS91/VER.A3)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC043 */
2381GAME( 1999, tektagt,   0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Tekken Tag Tournament (TEG3/VER.C1)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) /* KC044 */
2382GAME( 1999, tektagta,  tektagt,  coh700,   namcos12, namcos12, ROT0, "Namco",         "Tekken Tag Tournament (TEG3/VER.B)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) /* KC044 */
2408GAME( 1999, tektagt,   0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Tekken Tag Tournament (TEG3/VER.C1)", GAME_IMPERFECT_SOUND ) /* KC044 */
2409GAME( 1999, tektagta,  tektagt,  coh700,   namcos12, namcos12, ROT0, "Namco",         "Tekken Tag Tournament (TEG3/VER.B)", GAME_IMPERFECT_SOUND ) /* KC044 */
23832410GAME( 1999, tektagtb,  tektagt,  coh700,   namcos12, namcos12, ROT0, "Namco",         "Tekken Tag Tournament (Japan, TEG1/VER.B)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) /* KC044 */
23842411GAME( 1999, tektagtc,  tektagt,  coh700,   namcos12, namcos12, ROT0, "Namco",         "Tekken Tag Tournament (Japan, TEG1/VER.A3)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) /* KC044 */
23852412GAME( 1999, ghlpanic,  0,        coh700,   ghlpanic, ghlpanic, ROT0, "Namco",         "Ghoul Panic (OB2/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC045 */
src/mame/drivers/system18.c
r4499r4500
223223   }
224224}
225225
226static ADDRESS_MAP_START( shdancbl_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
227   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
226static ADDRESS_MAP_START(shdancbl_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
227   AM_RANGE(0x0000, 0x7fff) AM_ROM
228228   AM_RANGE(0x8000, 0xbfff) AM_READ(shdancbl_soundbank_r)
229   AM_RANGE(0xc400, 0xc400) AM_READ(soundlatch_r)
230   AM_RANGE(0xcc00, 0xcc03) AM_DEVREAD("3438.0", ym3438_r)
231   AM_RANGE(0xd000, 0xd003) AM_DEVREAD("3438.1", ym3438_r)
232   AM_RANGE(0xdf00, 0xdfff) AM_READNOP
233   AM_RANGE(0xe000, 0xffff) AM_READ(SMH_RAM)
234ADDRESS_MAP_END
235
236static ADDRESS_MAP_START(shdancbl_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
237   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
238   AM_RANGE(0x8000, 0xbfff) AM_WRITENOP /* ROM bank */
239229   AM_RANGE(0xc000, 0xc00f) AM_WRITENOP
230   AM_RANGE(0xc400, 0xc400) AM_READ(soundlatch_r)
240231   AM_RANGE(0xc800, 0xc800) AM_WRITE(shdancbl_msm5205_data_w)
241   AM_RANGE(0xcc00, 0xcc03) AM_DEVWRITE("3438.0", ym3438_w)
242   AM_RANGE(0xd000, 0xd003) AM_DEVWRITE("3438.1", ym3438_w)
232   AM_RANGE(0xcc00, 0xcc03) AM_DEVREADWRITE("3438.0", ym3438_r, ym3438_w)
233   AM_RANGE(0xd000, 0xd003) AM_DEVREADWRITE("3438.1", ym3438_r, ym3438_w)
243234   AM_RANGE(0xd400, 0xd400) AM_WRITE(shdancbl_bankctrl_w)
244   AM_RANGE(0xdf00, 0xdfff) AM_WRITENOP
245   AM_RANGE(0xe000, 0xffff) AM_WRITE(SMH_RAM)
235   AM_RANGE(0xdf00, 0xdfff) AM_NOP
236   AM_RANGE(0xe000, 0xffff) AM_RAM
246237ADDRESS_MAP_END
247238
248239static ADDRESS_MAP_START( shdancbl_sound_io_map, ADDRESS_SPACE_IO, 8 )
r4499r4500
262253   return 0xFF;
263254}
264255
265static ADDRESS_MAP_START( sound_readmem_18, ADDRESS_SPACE_PROGRAM, 8 )
266   AM_RANGE(0x0000, 0x9fff) AM_READ(SMH_ROM)
256static ADDRESS_MAP_START( sound_18_map, ADDRESS_SPACE_PROGRAM, 8 )
257   AM_RANGE(0x0000, 0x9fff) AM_ROM
267258   AM_RANGE(0xa000, 0xbfff) AM_READ(system18_bank_r)
268259   /**** D/A register ****/
269   AM_RANGE(0xd000, 0xdfff) AM_DEVREAD("5c68", rf5c68_mem_r)
270   AM_RANGE(0xe000, 0xffff) AM_READ(SMH_RAM)
271ADDRESS_MAP_END
272
273static ADDRESS_MAP_START( sound_writemem_18, ADDRESS_SPACE_PROGRAM, 8 )
274   AM_RANGE(0x0000, 0xbfff) AM_WRITE(SMH_ROM)
275   /**** D/A register ****/
276260   AM_RANGE(0xc000, 0xc008) AM_DEVWRITE("5c68", rf5c68_w)
277   AM_RANGE(0xd000, 0xdfff) AM_DEVWRITE("5c68", rf5c68_mem_w)
278   AM_RANGE(0xe000, 0xffff) AM_WRITE(SMH_RAM)   //??
261   AM_RANGE(0xd000, 0xdfff) AM_DEVREADWRITE("5c68", rf5c68_mem_r, rf5c68_mem_w)
262   AM_RANGE(0xe000, 0xffff) AM_RAM   //??
279263ADDRESS_MAP_END
280264
281265
r4499r4500
649633*/
650634/***************************************************************************/
651635
652static ADDRESS_MAP_START( shdancbl_readmem, ADDRESS_SPACE_PROGRAM, 16 )
653   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
654   AM_RANGE(0x400000, 0x40ffff) AM_READ(SYS16_MRA16_TILERAM)
655   AM_RANGE(0x410000, 0x410fff) AM_READ(SYS16_MRA16_TEXTRAM)
656   AM_RANGE(0x440000, 0x4407ff) AM_READ(SYS16_MRA16_SPRITERAM)
657   AM_RANGE(0x840000, 0x840fff) AM_READ(SYS16_MRA16_PALETTERAM)
658   AM_RANGE(0xc00000, 0xc0ffff) AM_READ(vdp_r)
659   AM_RANGE(0xe40000, 0xe4ffff) AM_READ(sys18_io_r)
636static ADDRESS_MAP_START( shdancbl_map, ADDRESS_SPACE_PROGRAM, 16 )
637   AM_RANGE(0x000000, 0x07ffff) AM_ROM
638   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(SYS16_MRA16_TILERAM, SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
639   AM_RANGE(0x410000, 0x410fff) AM_READWRITE(SYS16_MRA16_TEXTRAM, SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
640   AM_RANGE(0x440000, 0x440fff) AM_READWRITE(SYS16_MRA16_SPRITERAM, SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
641   AM_RANGE(0x840000, 0x840fff) AM_READWRITE(SYS16_MRA16_PALETTERAM, SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
642   AM_RANGE(0xc00000, 0xc0ffff) AM_READWRITE(vdp_r, vdp_w)
660643   AM_RANGE(0xc40000, 0xc40001) AM_READ_PORT("COINAGE")
661644   AM_RANGE(0xc40002, 0xc40003) AM_READ_PORT("DSW1")
645   AM_RANGE(0xc40006, 0xc40007) AM_WRITE(sound_command_irq_w)
646   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
662647   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
663648   AM_RANGE(0xc41004, 0xc41005) AM_READ_PORT("P2")
664   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
665   AM_RANGE(0xffc000, 0xffffff) AM_READ(SYS16_MRA16_WORKINGRAM)
666ADDRESS_MAP_END
667
668static ADDRESS_MAP_START( shdancbl_writemem, ADDRESS_SPACE_PROGRAM, 16 )
669   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
670   AM_RANGE(0x400000, 0x40ffff) AM_WRITE(SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
671   AM_RANGE(0x410000, 0x410fff) AM_WRITE(SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
672   AM_RANGE(0x440000, 0x440fff) AM_WRITE(SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
673   AM_RANGE(0x840000, 0x840fff) AM_WRITE(SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
674   AM_RANGE(0xc00000, 0xc0ffff) AM_WRITE(vdp_w)
675   AM_RANGE(0xe4001c, 0xe4001d) AM_WRITENOP // to prevent access to screen blanking control below
676   AM_RANGE(0xe40000, 0xe4ffff) AM_WRITE(sys18_io_w)
677   AM_RANGE(0xc40006, 0xc40007) AM_WRITE(sound_command_irq_w)
678649   AM_RANGE(0xc44000, 0xc44001) AM_WRITENOP // only used via clr.w after tilebank set
679650   AM_RANGE(0xc46000, 0xc46fff) AM_WRITENOP // bootleg specific video hardware
651   AM_RANGE(0xe4001c, 0xe4001d) AM_WRITENOP // to prevent access to screen blanking control below
652   AM_RANGE(0xe40000, 0xe4ffff) AM_READWRITE(sys18_io_r, sys18_io_w)
680653   AM_RANGE(0xfe0020, 0xfe003f) AM_WRITENOP // config regs
681   AM_RANGE(0xffc000, 0xffffff) AM_WRITE(SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
654   AM_RANGE(0xffc000, 0xffffff) AM_READWRITE(SYS16_MRA16_WORKINGRAM, SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
682655ADDRESS_MAP_END
683656
684657/***************************************************************************/
r4499r4500
749722*/
750723/***************************************************************************/
751724
752static READ16_HANDLER( mwalkbl_skip_r ){
753   if (cpu_get_pc(space->cpu)==0x308a) {cpu_spinuntil_int(space->cpu); return 0xffff;}
754   return sys16_workingram[0x202c/2];
755}
756
757
758static ADDRESS_MAP_START( mwalkbl_readmem, ADDRESS_SPACE_PROGRAM, 16 )
759   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
760   AM_RANGE(0x400000, 0x40ffff) AM_READ(SYS16_MRA16_TILERAM)
761   AM_RANGE(0x410000, 0x410fff) AM_READ(SYS16_MRA16_TEXTRAM)
762   AM_RANGE(0x440000, 0x440fff) AM_READ(SYS16_MRA16_SPRITERAM)
763   AM_RANGE(0x840000, 0x840fff) AM_READ(SYS16_MRA16_PALETTERAM)
764   AM_RANGE(0xc00000, 0xc0ffff) AM_READ(vdp_r)
725static ADDRESS_MAP_START( mwalkbl_map, ADDRESS_SPACE_PROGRAM, 16 )
726   AM_RANGE(0x000000, 0x07ffff) AM_ROM
727   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(SYS16_MRA16_TILERAM, SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
728   AM_RANGE(0x410000, 0x410fff) AM_READWRITE(SYS16_MRA16_TEXTRAM, SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
729   AM_RANGE(0x440000, 0x440fff) AM_READWRITE(SYS16_MRA16_SPRITERAM, SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
730   AM_RANGE(0x840000, 0x840fff) AM_READWRITE(SYS16_MRA16_PALETTERAM, SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
731   AM_RANGE(0xc00000, 0xc0ffff) AM_READWRITE(vdp_r, vdp_w)
765732   AM_RANGE(0xc40000, 0xc40001) AM_READ_PORT("COINAGE")
766733   AM_RANGE(0xc40002, 0xc40003) AM_READ_PORT("DSW1")
734   AM_RANGE(0xc40006, 0xc40007) AM_WRITE(sound_command_nmi_w)
735   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
767736   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
768737   AM_RANGE(0xc41004, 0xc41005) AM_READ_PORT("P2")
769738   AM_RANGE(0xc41006, 0xc41007) AM_READ_PORT("P3")
770739   AM_RANGE(0xc41008, 0xc41009) AM_READNOP // figure this out, extra input for 3p?
771   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
772   AM_RANGE(0xe40000, 0xe4ffff) AM_READ(SYS16_MRA16_EXTRAM2)
773   AM_RANGE(0xffe02c, 0xffe02d) AM_READ(mwalkbl_skip_r)
774   AM_RANGE(0xffc000, 0xffffff) AM_READ(SYS16_MRA16_WORKINGRAM)
775ADDRESS_MAP_END
776
777static ADDRESS_MAP_START( mwalkbl_writemem, ADDRESS_SPACE_PROGRAM, 16 )
778   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
779   AM_RANGE(0x400000, 0x40ffff) AM_WRITE(SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
780   AM_RANGE(0x410000, 0x410fff) AM_WRITE(SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
781   AM_RANGE(0x440000, 0x440fff) AM_WRITE(SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
782   AM_RANGE(0x840000, 0x840fff) AM_WRITE(SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
783   AM_RANGE(0xc00000, 0xc0ffff) AM_WRITE(vdp_w)
784   AM_RANGE(0xc40006, 0xc40007) AM_WRITE(sound_command_nmi_w)
785740   AM_RANGE(0xc46600, 0xc46601) AM_WRITE(sys18_refreshenable_w)
786741   AM_RANGE(0xc46800, 0xc46801) AM_WRITE(sys18_tilebank_w)
787   AM_RANGE(0xe40000, 0xe4ffff) AM_WRITE(SYS16_MWA16_EXTRAM2) AM_BASE(&sys16_extraram2)
742   AM_RANGE(0xe40000, 0xe4ffff) AM_READWRITE(SYS16_MRA16_EXTRAM2, SYS16_MWA16_EXTRAM2) AM_BASE(&sys16_extraram2)
788743   AM_RANGE(0xfe0020, 0xfe003f) AM_WRITENOP // config regs
789   AM_RANGE(0xffc000, 0xffffff) AM_WRITE(SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
744   AM_RANGE(0xffc000, 0xffffff) AM_READWRITE(SYS16_MRA16_WORKINGRAM, SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
790745ADDRESS_MAP_END
791746
792747/***************************************************************************/
r4499r4500
889844
890845/* bootleg doesn't have real vdp or i/o */
891846
892static ADDRESS_MAP_START( astormbl_readmem, ADDRESS_SPACE_PROGRAM, 16 )
893   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
894   AM_RANGE(0x100000, 0x10ffff) AM_READ(SYS16_MRA16_TILERAM)
895   AM_RANGE(0x110000, 0x110fff) AM_READ(SYS16_MRA16_TEXTRAM)
896   AM_RANGE(0x140000, 0x140fff) AM_READ(SYS16_MRA16_PALETTERAM)
897   AM_RANGE(0x200000, 0x200fff) AM_READ(SYS16_MRA16_SPRITERAM)
847static ADDRESS_MAP_START( astormbl_map, ADDRESS_SPACE_PROGRAM, 16 )
848   AM_RANGE(0x000000, 0x07ffff) AM_ROM
849   AM_RANGE(0x100000, 0x10ffff) AM_READWRITE(SYS16_MRA16_TILERAM, SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
850   AM_RANGE(0x110000, 0x110fff) AM_READWRITE(SYS16_MRA16_TEXTRAM, SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
851   AM_RANGE(0x140000, 0x140fff) AM_READWRITE(SYS16_MRA16_PALETTERAM, SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
852   AM_RANGE(0x200000, 0x200fff) AM_READWRITE(SYS16_MRA16_SPRITERAM, SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
898853   AM_RANGE(0xa00000, 0xa00001) AM_READ_PORT("COINAGE")
899854   AM_RANGE(0xa00002, 0xa00003) AM_READ_PORT("DSW1")
855   AM_RANGE(0xa00006, 0xa00007) AM_WRITE(sound_command_nmi_w)
856   AM_RANGE(0xa0000e, 0xa0000f) AM_WRITE(sys18_tilebank_w)
857   AM_RANGE(0xa01000, 0xa01001) AM_READ_PORT("SERVICE")
900858   AM_RANGE(0xa01002, 0xa01003) AM_READ_PORT("P1")
901859   AM_RANGE(0xa01004, 0xa01005) AM_READ_PORT("P2")
902860   AM_RANGE(0xa01006, 0xa01007) AM_READ_PORT("P3")
903   AM_RANGE(0xa01000, 0xa01001) AM_READ_PORT("SERVICE")
904   AM_RANGE(0xc00000, 0xc0ffff) AM_READ(vdp_r)
905   AM_RANGE(0xffc000, 0xffffff) AM_READ(SYS16_MRA16_WORKINGRAM)
906ADDRESS_MAP_END
907
908
909static ADDRESS_MAP_START( astormbl_writemem, ADDRESS_SPACE_PROGRAM, 16 )
910   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
911   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
912   AM_RANGE(0x110000, 0x110fff) AM_WRITE(SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
913   AM_RANGE(0x140000, 0x140fff) AM_WRITE(SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
914   AM_RANGE(0x200000, 0x200fff) AM_WRITE(SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
915   AM_RANGE(0xa00006, 0xa00007) AM_WRITE(sound_command_nmi_w)
916   AM_RANGE(0xa0000e, 0xa0000f) AM_WRITE(sys18_tilebank_w)
917   AM_RANGE(0xc00000, 0xc0ffff) AM_WRITE(vdp_w)
861   AM_RANGE(0xc00000, 0xc0ffff) AM_READWRITE(vdp_r, vdp_w)
918862   AM_RANGE(0xc46600, 0xc46601) AM_WRITE(sys18_refreshenable_w)
919863   AM_RANGE(0xfe0020, 0xfe003f) AM_WRITENOP
920   AM_RANGE(0xffc000, 0xffffff) AM_WRITE(SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
864   AM_RANGE(0xffc000, 0xffffff) AM_READWRITE(SYS16_MRA16_WORKINGRAM, SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
921865ADDRESS_MAP_END
922866
923867
r4499r4500
10691013   MDRV_CPU_VBLANK_INT("screen", irq4_line_hold)
10701014
10711015   MDRV_CPU_ADD("soundcpu", Z80, 8000000)
1072   MDRV_CPU_PROGRAM_MAP(sound_readmem_18,sound_writemem_18)
1016   MDRV_CPU_PROGRAM_MAP(sound_18_map,0)
10731017   MDRV_CPU_IO_MAP(sound_18_io_map,0)
10741018
10751019   /* video hardware */
r4499r4500
11121056   /* basic machine hardware */
11131057   MDRV_IMPORT_FROM(system18)
11141058   MDRV_CPU_MODIFY("maincpu")
1115   MDRV_CPU_PROGRAM_MAP(astormbl_readmem,astormbl_writemem)
1059   MDRV_CPU_PROGRAM_MAP(astormbl_map,0)
11161060
11171061   MDRV_MACHINE_RESET(astormbl)
11181062MACHINE_DRIVER_END
r4499r4500
11231067   /* basic machine hardware */
11241068   MDRV_IMPORT_FROM(system18)
11251069   MDRV_CPU_MODIFY("maincpu")
1126   MDRV_CPU_PROGRAM_MAP(mwalkbl_readmem,mwalkbl_writemem)
1070   MDRV_CPU_PROGRAM_MAP(mwalkbl_map,0)
11271071
11281072   MDRV_MACHINE_RESET(mwalkbl)
11291073MACHINE_DRIVER_END
r4499r4500
11341078   /* basic machine hardware */
11351079   MDRV_IMPORT_FROM(system18)
11361080   MDRV_CPU_MODIFY("maincpu")
1137   MDRV_CPU_PROGRAM_MAP(shdancbl_readmem,shdancbl_writemem)
1081   MDRV_CPU_PROGRAM_MAP(shdancbl_map,0)
11381082
11391083   MDRV_CPU_MODIFY("soundcpu")
1140   MDRV_CPU_PROGRAM_MAP(shdancbl_sound_readmem,shdancbl_sound_writemem)
1084   MDRV_CPU_PROGRAM_MAP(shdancbl_sound_map,0)
11411085   MDRV_CPU_IO_MAP(shdancbl_sound_io_map,0)
11421086   MDRV_SOUND_REMOVE("5c68")
11431087
src/mame/drivers/jangou.c
r4499r4500
2929#include "sound/ay8910.h"
3030#include "sound/hc55516.h"
3131#include "sound/msm5205.h"
32#include "video/resnet.h"
3233
3334#define MASTER_CLOCK   XTAL_19_968MHz
3435
r4499r4500
5253 *
5354 *************************************/
5455
56/* guess: use the same resistor values as Crazy Climber (needs checking on the real HW) */
5557static PALETTE_INIT( jangou )
5658{
57   int   bit0, bit1, bit2 , r, g, b;
58   int   i;
59   static const int resistances_rg[3] = { 1000, 470, 220 };
60   static const int resistances_b [2] = { 470, 220 };
61   double weights_rg[3], weights_b[2];
62   int i;
5963
60   for (i = 0; i < 0x20; ++i)
64   /* compute the color output resistor weights */
65   compute_resistor_weights(0,   255, -1.0,
66         3, resistances_rg, weights_rg, 0, 0,
67         2, resistances_b,  weights_b,  0, 0,
68         0, 0, 0, 0, 0);
69
70   for (i = 0;i < machine->config->total_colors; i++)
6171   {
62      bit0 = (color_prom[0] >> 0) & 0x01;
63      bit1 = (color_prom[0] >> 1) & 0x01;
64      bit2 = (color_prom[0] >> 2) & 0x01;
65      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
66      bit0 = (color_prom[0] >> 3) & 0x01;
67      bit1 = (color_prom[0] >> 4) & 0x01;
68      bit2 = (color_prom[0] >> 5) & 0x01;
69      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
70      bit0 = 0;
71      bit1 = (color_prom[0] >> 6) & 0x01;
72      bit2 = (color_prom[0] >> 7) & 0x01;
73      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
72      int bit0, bit1, bit2;
73      int r, g, b;
7474
75      /* red component */
76      bit0 = (color_prom[i] >> 0) & 0x01;
77      bit1 = (color_prom[i] >> 1) & 0x01;
78      bit2 = (color_prom[i] >> 2) & 0x01;
79      r = combine_3_weights(weights_rg, bit0, bit1, bit2);
80
81      /* green component */
82      bit0 = (color_prom[i] >> 3) & 0x01;
83      bit1 = (color_prom[i] >> 4) & 0x01;
84      bit2 = (color_prom[i] >> 5) & 0x01;
85      g = combine_3_weights(weights_rg, bit0, bit1, bit2);
86
87      /* blue component */
88      bit0 = (color_prom[i] >> 6) & 0x01;
89      bit1 = (color_prom[i] >> 7) & 0x01;
90      b = combine_2_weights(weights_b, bit0, bit1);
91
7592      palette_set_color(machine, i, MAKE_RGB(r, g, b));
76      color_prom++;
7793   }
7894}
7995
src/mame/drivers/munchmo.c
r4499r4500
77  15 MHz crystal
88
99  Known Issues:
10    - sprite priority problems
1110    - it's unclear if mirroring the videoram chunks is correct behavior
1211    - several unmapped registers
1312    - sustained sounds (when there should be silence)
src/mame/drivers/alpha68k.c
r4499r4500
289289static READ16_HANDLER( control_2_r )
290290{
291291   if (invert_controls)
292      return ~(input_port_read(space->machine, "IN3") + ((~(1 << (input_port_read(space->machine, "IN5") * 12 / 256))) << 8));
292      return ~(input_port_read(space->machine, "IN3") + ((~(1 << input_port_read(space->machine, "IN5"))) << 8));
293293
294294   return input_port_read(space->machine, "IN3") + /* Low byte of CN1 */
295      ((~(1 << (input_port_read(space->machine, "IN5") * 12 / 256))) << 8);
295      ((~(1 << input_port_read(space->machine, "IN5"))) << 8);
296296}
297297
298298static READ16_HANDLER( control_2_V_r )
r4499r4500
303303static READ16_HANDLER( control_3_r )
304304{
305305   if (invert_controls)
306      return ~((( ~(1 << (input_port_read(space->machine, "IN6") * 12 / 256)) )<<8) & 0xff00);
306      return ~((( ~(1 << input_port_read(space->machine, "IN6")) )<<8) & 0xff00);
307307
308   return (( ~(1 << (input_port_read(space->machine, "IN6") * 12 / 256)) )<<8) & 0xff00;
308   return (( ~(1 << input_port_read(space->machine, "IN6")) )<<8) & 0xff00;
309309}
310310
311311/* High 4 bits of CN1 & CN2 */
312312static READ16_HANDLER( control_4_r )
313313{
314314   if (invert_controls)
315      return ~(((( ~(1 << (input_port_read(space->machine, "IN6") * 12 / 256))  ) <<4) & 0xf000)
316       + ((( ~(1 << (input_port_read(space->machine, "IN5") * 12 / 256))  )    ) & 0x0f00));
315      return ~(((( ~(1 << input_port_read(space->machine, "IN6"))  ) <<4) & 0xf000)
316       + ((( ~(1 << input_port_read(space->machine, "IN5"))  )    ) & 0x0f00));
317317
318   return ((( ~(1 << (input_port_read(space->machine, "IN6") * 12 / 256))  ) <<4) & 0xf000)
319       + ((( ~(1 << (input_port_read(space->machine, "IN5") * 12 / 256))  )    ) & 0x0f00);
318   return ((( ~(1 << input_port_read(space->machine, "IN6"))  ) <<4) & 0xf000)
319       + ((( ~(1 << input_port_read(space->machine, "IN5"))  )    ) & 0x0f00);
320320}
321321
322322static READ16_HANDLER( jongbou_inputs_r )
r4499r4500
11751175   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
11761176
11771177   PORT_START("IN5")  /* player 1 12-way rotary control - converted in controls_r() */
1178   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(8) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE
1178   PORT_BIT( 0x0f, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE PORT_FULL_TURN_COUNT(12)
11791179
11801180   PORT_START("IN6")  /* player 2 12-way rotary control - converted in controls_r() */
1181   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(8) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_REVERSE PORT_PLAYER(2)
1181   PORT_BIT( 0x0f, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_PLAYER(2) PORT_REVERSE PORT_FULL_TURN_COUNT(12)
11821182INPUT_PORTS_END
11831183
11841184/* Same as 'timesold' but different default settings for the "Language" Dip Switch */
src/mame/drivers/tmaster.c
r4499r4500
715715   PORT_START("SYSTEM")
716716   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )   // CS 1 (coin)
717717   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )   // CS 2 (coin)
718   PORT_SERVICE_NO_TOGGLE( 0x0004, IP_ACTIVE_LOW )   // System Check
718   PORT_SERVICE( 0x0004, IP_ACTIVE_HIGH )   // System Check
719719   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
720720   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
721721   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
src/mame/drivers/roul.c
r0r4500
1/* Super Lucky Roulette?
2
3driver by Roberto Zandona'
4thanks to Angelo Salese for some precious advice
5
6TO DO:
7- blitter
8- sound
9- input
10
11Has 36 pin Cherry master looking edge connector
12
13.u12 2764 stickered 1
14.u19 27256 stickered 2
15.u15 tibpal16l8-25 (checksum was 0)
16.u56 tibpal16l8-25 (checksum was 0)
17.u38 82s123
18.u53 82s123
19
20Z80 x2
21Altera Ep1810LC-45
2220.000 MHz crystal
23video 464p10 x4 (board silcksreeend 4416)
24AY-3-8912A
25
26ROM text showed SUPER LUCKY ROULETTE LEISURE ENT
27*/
28
29#include "driver.h"
30#include "cpu/z80/z80.h"
31#include "sound/ay8910.h"
32
33#define VIDEOBUF_SIZE 256*256
34
35UINT8 reg[0x10];
36UINT8 *videobuf;
37
38static READ8_HANDLER( testf5_r )
39{
40   logerror("Read unknown port $f5 at %04x\n",cpu_get_pc(space->cpu));
41   return mame_rand(space->machine) & 0x00ff;
42}
43
44static READ8_HANDLER( testf8_r )
45{
46   logerror("Read unknown port $f8 at %04x\n",cpu_get_pc(space->cpu));
47   return mame_rand(space->machine) & 0x00ff;
48}
49
50static READ8_HANDLER( testfa_r )
51{
52   logerror("Read unknown port $fa at %04x\n",cpu_get_pc(space->cpu));
53   return mame_rand(space->machine) & 0x00ff;
54}
55
56static READ8_HANDLER( testfd_r )
57{
58   logerror("Read unknown port $fd at %04x\n",cpu_get_pc(space->cpu));
59   return mame_rand(space->machine) & 0x00ff;
60}
61
62static WRITE8_HANDLER( testfx_w )
63{
64   reg[offset] = data;
65   if (offset==2)
66   {
67      int y = reg[0];
68      int x = reg[1];
69      int color = reg[3];
70      videobuf[y * 256 + x] = color;
71   }
72   logerror("Write [%02x] -> %02x\n",offset,data);
73}
74
75/*
76static READ8_HANDLER( test_r )
77{
78    logerror("Read unknown port $f5 at %04x\n",cpu_get_pc(space->cpu));
79    return mame_rand(space->machine) & 0x00ff;
80}
81*/
82
83static ADDRESS_MAP_START( roul_map, ADDRESS_SPACE_PROGRAM, 8 )
84   AM_RANGE(0x0000, 0x7fff) AM_ROM
85   AM_RANGE(0x8000, 0x8fff) AM_RAM
86ADDRESS_MAP_END
87
88static ADDRESS_MAP_START( roul_cpu_io_map, ADDRESS_SPACE_IO, 8 )
89   ADDRESS_MAP_GLOBAL_MASK(0xff)
90   AM_RANGE(0xf0, 0xff) AM_WRITE(testfx_w)
91   AM_RANGE(0xf5, 0xf5) AM_READ(testf5_r)
92   AM_RANGE(0xf8, 0xf8) AM_READ(testf8_r)
93   AM_RANGE(0xfa, 0xfa) AM_READ(testfa_r)
94   AM_RANGE(0xfd, 0xfd) AM_READ(testfd_r)
95ADDRESS_MAP_END
96
97static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
98   AM_RANGE(0x0000, 0x0fff) AM_ROM
99   AM_RANGE(0x1000, 0x13ff) AM_RAM
100ADDRESS_MAP_END
101
102static ADDRESS_MAP_START( sound_cpu_io_map, ADDRESS_SPACE_IO, 8 )
103   ADDRESS_MAP_GLOBAL_MASK(0xff)
104   AM_RANGE(0x00, 0x00) AM_READ(soundlatch_r)
105   AM_RANGE(0x00, 0x01) AM_DEVWRITE("ay", ay8910_address_data_w)
106ADDRESS_MAP_END
107
108static VIDEO_START(roul)
109{
110   videobuf = auto_malloc(VIDEOBUF_SIZE * sizeof(*videobuf));
111   memset(videobuf, 0, VIDEOBUF_SIZE * sizeof(*videobuf));
112}
113
114static VIDEO_UPDATE(roul)
115{
116   int i,j;
117   for (i=0; i<256; i++)
118      for (j=0; j<256; j++)
119         *BITMAP_ADDR16(bitmap, i, j    ) = videobuf[j*256+i];
120   return 0;
121}
122
123static INPUT_PORTS_START( roul )
124INPUT_PORTS_END
125
126static MACHINE_DRIVER_START( roul )
127   /* basic machine hardware */
128   MDRV_CPU_ADD("maincpu", Z80, 1000000)
129   MDRV_CPU_PROGRAM_MAP(roul_map, 0)
130   MDRV_CPU_IO_MAP(roul_cpu_io_map,0)
131   MDRV_CPU_VBLANK_INT("screen",nmi_line_pulse)
132
133   MDRV_CPU_ADD("soundcpu", Z80, 1000000)
134   MDRV_CPU_PROGRAM_MAP(sound_map, 0)
135   MDRV_CPU_IO_MAP(sound_cpu_io_map,0)
136   MDRV_CPU_VBLANK_INT("screen",irq0_line_hold)
137
138    /* video hardware */
139   MDRV_SCREEN_ADD("screen", RASTER)
140   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
141   MDRV_SCREEN_REFRESH_RATE(60)
142   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
143   MDRV_SCREEN_SIZE(32*8, 32*8)
144   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
145
146   MDRV_PALETTE_LENGTH(0x100)
147
148   MDRV_VIDEO_START(roul)
149   MDRV_VIDEO_UPDATE(roul)
150
151   MDRV_SPEAKER_STANDARD_MONO("mono")
152   MDRV_SOUND_ADD("ay", AY8910, 1000000)
153   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
154MACHINE_DRIVER_END
155
156ROM_START(roul)
157   ROM_REGION( 0x10000, "maincpu", 0 )
158   ROM_LOAD("roul.u19",   0x0000, 0x8000, CRC(1ec37876) SHA1(c2877646dad9daebc55db57d513ad448b1f4c923) )
159
160   ROM_REGION( 0x10000, "soundcpu", 0 )
161   ROM_LOAD("roul.u12",   0x0000, 0x1000, CRC(356fe025) SHA1(bca69e090a852454e921130afbdd28021b62c44e) )
162   ROM_CONTINUE(0x0000,0x1000)
163
164   ROM_REGION( 0x0040, "proms", 0 )
165   ROM_LOAD( "roul.u38",   0x0000, 0x0020, CRC(23ae22c1) SHA1(bf0383462976ec6341ffa8a173264ce820bc654a) )
166   ROM_LOAD( "roul.u53",   0x0020, 0x0020, CRC(1965dfaa) SHA1(114eccd3e478902ac7dbb10b9425784231ff581e) )
167ROM_END
168
169GAME( 1982, roul,  0,   roul, roul, 0, ROT0, "bootleg", "Super Lucky Roulette?", GAME_NOT_WORKING | GAME_NO_SOUND )
src/mame/drivers/freekick.c
r4499r4500
99- Quite interestingly, Free Kick's sound ROM contains a Z80 program, but
1010  there isn't a sound CPU and that program isn't executed. Instead, the main
1111  CPU reads the sound program through an 8255 PPI and plays sounds directly.
12- Gigas: according to a photo of a genuine board:
13    Sega Game ID#: 834-6167
14    NEC MC-8123 with Sega security number 317-5002
1215
1316TODO:
1417- Gigas cocktail mode / flipscreen
src/mame/drivers/wgp.c
r4499r4500
657657   AM_RANGE(0x000000, 0x0fffff) AM_ROM
658658   AM_RANGE(0x100000, 0x10ffff) AM_RAM      /* main CPUA ram */
659659   AM_RANGE(0x140000, 0x143fff) AM_RAM AM_BASE(&sharedram) AM_SIZE(&sharedram_size)
660   AM_RANGE(0x180000, 0x18000f) AM_READWRITE(TC0220IOC_halfword_byteswap_r,TC0220IOC_halfword_byteswap_w)
660   AM_RANGE(0x180000, 0x18000f) AM_READWRITE8(TC0220IOC_r,TC0220IOC_w, 0xff00)
661661   AM_RANGE(0x1c0000, 0x1c0001) AM_WRITE(cpua_ctrl_w)
662662   AM_RANGE(0x200000, 0x20000f) AM_READWRITE(wgp_adinput_r,wgp_adinput_w)
663663   AM_RANGE(0x300000, 0x30ffff) AM_READWRITE(TC0100SCN_word_0_r,TC0100SCN_word_0_w)         /* tilemaps */
src/mame/drivers/dec0.c
r4499r4500
591591   PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW1:8" )   // Always OFF
592592
593593   PORT_START("AN0")   /* player 1 12-way rotary control - converted in controls_r() */
594   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE
594   PORT_BIT( 0x0f, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE PORT_FULL_TURN_COUNT(12)
595595
596596   PORT_START("AN1")   /* player 2 12-way rotary control - converted in controls_r() */
597   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_REVERSE PORT_PLAYER(2)
597   PORT_BIT( 0x0f, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_PLAYER(2) PORT_REVERSE PORT_FULL_TURN_COUNT(12)
598598INPUT_PORTS_END
599599
600600static INPUT_PORTS_START( birdtry )
r4499r4500
634634   PORT_DIPSETTING(      0x0000, "Type C - Upright" )
635635
636636   PORT_START("AN0")   /* player 1 12-way rotary control - converted in controls_r() */
637   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE
637   PORT_BIT( 0x0f, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE PORT_FULL_TURN_COUNT(12)
638638
639639   PORT_START("AN1")   /* player 2 12-way rotary control - converted in controls_r() */
640   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_REVERSE PORT_PLAYER(2)
640   PORT_BIT( 0x0f, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_PLAYER(2) PORT_REVERSE PORT_FULL_TURN_COUNT(12)
641641INPUT_PORTS_END
642642
643643static INPUT_PORTS_START( baddudes )
r4499r4500
825825   PORT_DIPUNUSED_DIPLOC( 0x8000, 0x8000, "SW2:8" )   // Always OFF
826826
827827   PORT_START("AN0")   /* player 1 12-way rotary control - converted in controls_r() */
828   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE
828   PORT_BIT( 0x0f, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE PORT_FULL_TURN_COUNT(12)
829829
830830   PORT_START("AN1")   /* player 2 12-way rotary control - converted in controls_r() */
831   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_REVERSE PORT_PLAYER(2)
831   PORT_BIT( 0x0f, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_PLAYER(2) PORT_REVERSE PORT_FULL_TURN_COUNT(12)
832832INPUT_PORTS_END
833833
834834static INPUT_PORTS_START( bouldash )
src/mame/drivers/taitoair.c
r4499r4500
387387   AM_RANGE(0x910000, 0x91ffff) AM_RAM   AM_BASE(&dsp_ram)   /* "dsp common ram" (TMS320C25) */
388388   AM_RANGE(0xa00000, 0xa00007) AM_READ(stick_input_r)
389389   AM_RANGE(0xa00100, 0xa00107) AM_READ(stick2_input_r)
390   AM_RANGE(0xa00200, 0xa0020f) AM_READWRITE(TC0220IOC_halfword_r, TC0220IOC_halfword_w)   /* other I/O */
390   AM_RANGE(0xa00200, 0xa0020f) AM_READWRITE8(TC0220IOC_r, TC0220IOC_w, 0x00ff)   /* other I/O */
391391   AM_RANGE(0xa80000, 0xa80001) AM_READNOP AM_WRITE8(taitosound_port_w, 0x00ff)
392392   AM_RANGE(0xa80002, 0xa80003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0x00ff)
393393   AM_RANGE(0xb00000, 0xb007ff) AM_RAM                  /* "power common ram" (mecha drive) */
src/mame/drivers/metro.c
r4499r4500
20282028static WRITE16_DEVICE_HANDLER( mouja_sound_rombank_w )
20292029{
20302030   if (ACCESSING_BITS_0_7)
2031      okim6295_set_bank_base(device, ((data >> 3) & 0x07) * 0x40000);
2031      okim6295_set_bank_base(devtag_get_device(device->machine, "oki"), ((data >> 3) & 0x07) * 0x40000);
20322032}
20332033
20342034static ADDRESS_MAP_START( mouja_readmem, ADDRESS_SPACE_PROGRAM, 16 )
r4499r4500
20722072   AM_RANGE(0x478888, 0x478889) AM_WRITENOP                        // ??
20732073   AM_RANGE(0x479700, 0x479713) AM_WRITE(SMH_RAM) AM_BASE(&metro_videoregs   )   // Video Registers
20742074   AM_RANGE(0xc00000, 0xc00003) AM_DEVWRITE8("ym", ym2413_w, 0x00ff)
2075   AM_RANGE(0x800000, 0x800001) AM_DEVWRITE("oki", mouja_sound_rombank_w         )
2076   AM_RANGE(0xd00000, 0xd00001) AM_DEVWRITE8("oki", okim6295_w, 0x00ff        )
2077
2075   AM_RANGE(0x800000, 0x800001) AM_DEVWRITE("oki", mouja_sound_rombank_w)
2076   AM_RANGE(0xd00000, 0xd00001) AM_DEVWRITE8("oki", okim6295_w, 0xff00)
20782077#if 0
20792078   AM_RANGE(0x478840, 0x47884d) AM_WRITE(metro_blitter_w) AM_BASE(&metro_blitter_regs   )   // Tiles Blitter
20802079   AM_RANGE(0x47883a, 0x47883b) AM_WRITE(SMH_RAM) AM_BASE(&metro_rombank      )   // Rom Bank
src/mame/drivers/nightgal.c
r4499r4500
2020#include "sound/2203intf.h"
2121#include "cpu/z80/z80.h"
2222#include "cpu/m6800/m6800.h"
23#include "video/resnet.h"
2324
2425#define MASTER_CLOCK   XTAL_19_968MHz
2526
r4499r4500
9091   }
9192}
9293
93static WRITE8_HANDLER(nsc_true_blitter_w )
94static WRITE8_HANDLER( nsc_true_blitter_w )
9495{
9596   static UINT8 true_blit[7];
9697
r4499r4500
142143   }
143144}
144145
146/* different register writes (probably a PAL line swapping).*/
145147static WRITE8_HANDLER( sexygal_nsc_true_blitter_w )
146148{
147149   static UINT8 true_blit[7];
r4499r4500
196198   }
197199}
198200
201/* guess: use the same resistor values as Crazy Climber (needs checking on the real HW) */
199202static PALETTE_INIT( nightgal )
200203{
201   int   bit0, bit1, bit2 , r, g, b;
202   int   i;
204   static const int resistances_rg[3] = { 1000, 470, 220 };
205   static const int resistances_b [2] = { 470, 220 };
206   double weights_rg[3], weights_b[2];
207   int i;
203208
204   for (i = 0; i < 0x10; ++i)
209   /* compute the color output resistor weights */
210   compute_resistor_weights(0,   255, -1.0,
211         3, resistances_rg, weights_rg, 0, 0,
212         2, resistances_b,  weights_b,  0, 0,
213         0, 0, 0, 0, 0);
214
215   for (i = 0;i < machine->config->total_colors; i++)
205216   {
206      bit0 = (color_prom[0] >> 0) & 0x01;
207      bit1 = (color_prom[0] >> 1) & 0x01;
208      bit2 = (color_prom[0] >> 2) & 0x01;
209      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
210      bit0 = (color_prom[0] >> 3) & 0x01;
211      bit1 = (color_prom[0] >> 4) & 0x01;
212      bit2 = (color_prom[0] >> 5) & 0x01;
213      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
214      bit0 = 0;
215      bit1 = (color_prom[0] >> 6) & 0x01;
216      bit2 = (color_prom[0] >> 7) & 0x01;
217      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
217      int bit0, bit1, bit2;
218      int r, g, b;
218219
220      /* red component */
221      bit0 = (color_prom[i] >> 0) & 0x01;
222      bit1 = (color_prom[i] >> 1) & 0x01;
223      bit2 = (color_prom[i] >> 2) & 0x01;
224      r = combine_3_weights(weights_rg, bit0, bit1, bit2);
225
226      /* green component */
227      bit0 = (color_prom[i] >> 3) & 0x01;
228      bit1 = (color_prom[i] >> 4) & 0x01;
229      bit2 = (color_prom[i] >> 5) & 0x01;
230      g = combine_3_weights(weights_rg, bit0, bit1, bit2);
231
232      /* blue component */
233      bit0 = (color_prom[i] >> 6) & 0x01;
234      bit1 = (color_prom[i] >> 7) & 0x01;
235      b = combine_2_weights(weights_b, bit0, bit1);
236
219237      palette_set_color(machine, i, MAKE_RGB(r, g, b));
220      color_prom++;
221238   }
222239}
223240
r4499r4500
10161033GAME( 1985, sexygal,  0,       sexygal,  sexygal,  0, ROT0,"Nichibutsu", "Sexy Gal (Japan 850501 SXG 1-00)", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION )
10171034GAME( 1985, sweetgal, sexygal, sexygal,  sexygal,  0, ROT0,"Nichibutsu", "Sweet Gal (Japan 850510 SWG 1-02)", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION )
10181035/* Type 3 HW*/
1019GAME( 1985, ngalsumr, 0,       sexygal, sexygal,  0, ROT0,"Nichibutsu", "Night Gal Summer", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION )
1036GAME( 1985, ngalsumr, 0,       nightgal, sexygal,  0, ROT0,"Nichibutsu", "Night Gal Summer", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION )
src/mame/drivers/surpratk.c
r4499r4500
8585
8686/********************************************/
8787
88static ADDRESS_MAP_START( surpratk_readmem, ADDRESS_SPACE_PROGRAM, 8 )
89   AM_RANGE(0x0000, 0x07ff) AM_READ(bankedram_r)
90   AM_RANGE(0x0800, 0x1fff) AM_READ(SMH_RAM)
91   AM_RANGE(0x2000, 0x3fff) AM_READ(SMH_BANK1)         /* banked ROM */
88static ADDRESS_MAP_START( surpratk_map, ADDRESS_SPACE_PROGRAM, 8 )
89   AM_RANGE(0x0000, 0x07ff) AM_READWRITE(bankedram_r, bankedram_w) AM_BASE(&ram)
90   AM_RANGE(0x0800, 0x1fff) AM_RAM
91   AM_RANGE(0x2000, 0x3fff) AM_ROMBANK(1)               /* banked ROM */
9292   AM_RANGE(0x5f8c, 0x5f8c) AM_READ_PORT("P1")
9393   AM_RANGE(0x5f8d, 0x5f8d) AM_READ_PORT("P2")
9494   AM_RANGE(0x5f8e, 0x5f8e) AM_READ_PORT("DSW3")
9595   AM_RANGE(0x5f8f, 0x5f8f) AM_READ_PORT("DSW1")
9696   AM_RANGE(0x5f90, 0x5f90) AM_READ_PORT("DSW2")
97//  AM_RANGE(0x5f91, 0x5f91) AM_DEVREAD("ym", ym2151_status_port_r)    /* ? */
98   AM_RANGE(0x5fa0, 0x5faf) AM_READ(K053244_r)
99   AM_RANGE(0x5fc0, 0x5fc0) AM_READ(watchdog_reset_r)
100   AM_RANGE(0x4000, 0x7fff) AM_READ(K052109_r)
101   AM_RANGE(0x8000, 0xffff) AM_READ(SMH_ROM)         /* ROM */
102ADDRESS_MAP_END
103
104static ADDRESS_MAP_START( surpratk_writemem, ADDRESS_SPACE_PROGRAM, 8 )
105   AM_RANGE(0x0000, 0x07ff) AM_WRITE(bankedram_w) AM_BASE(&ram)
106   AM_RANGE(0x0800, 0x1fff) AM_WRITE(SMH_RAM)
107   AM_RANGE(0x2000, 0x3fff) AM_WRITE(SMH_ROM)               /* banked ROM */
108   AM_RANGE(0x5fa0, 0x5faf) AM_WRITE(K053244_w)
97   AM_RANGE(0x5fa0, 0x5faf) AM_READWRITE(K053244_r, K053244_w)
10998   AM_RANGE(0x5fb0, 0x5fbf) AM_WRITE(K053251_w)
110   AM_RANGE(0x5fc0, 0x5fc0) AM_WRITE(surpratk_5fc0_w)
99   AM_RANGE(0x5fc0, 0x5fc0) AM_READWRITE(watchdog_reset_r, surpratk_5fc0_w)
111100   AM_RANGE(0x5fd0, 0x5fd1) AM_DEVWRITE("ym", ym2151_w)
112101   AM_RANGE(0x5fc4, 0x5fc4) AM_WRITE(surpratk_videobank_w)
113   AM_RANGE(0x4000, 0x7fff) AM_WRITE(K052109_w)
114   AM_RANGE(0x8000, 0xffff) AM_WRITE(SMH_ROM)               /* ROM */
102   AM_RANGE(0x4000, 0x7fff) AM_READWRITE(K052109_r, K052109_w)
103   AM_RANGE(0x8000, 0xffff) AM_ROM               /* ROM */
115104ADDRESS_MAP_END
116105
117106
r4499r4500
190179
191180   /* basic machine hardware */
192181   MDRV_CPU_ADD("maincpu", KONAMI, 3000000)   /* 053248 */
193   MDRV_CPU_PROGRAM_MAP(surpratk_readmem,surpratk_writemem)
182   MDRV_CPU_PROGRAM_MAP(surpratk_map,0)
194183   MDRV_CPU_VBLANK_INT("screen", surpratk_interrupt)
195184
196185   MDRV_MACHINE_RESET(surpratk)
src/mame/drivers/ninjakd2.c
r4499r4500
7676  ROM is replaced with a double-sized decrypted version. They are presumably
7777  bootlegs but this isn't known for sure.
7878
79- For Ninja Kid II: On Nov 15, 2008 a fully decrypted sound rom was created by
80  www.segaresurrection.com It allows you to replace the NEC MC8123 and encrypted
81  sound rom with a standard Z80B and the newly decrypted sound without any other
82  mods to the Z80 & sound rom as required by the other "double-sized" version.
83  The CRCs are listed here so it doesn't show up as a newly "found" bootleg version:
84  nk2_06.rom   CRC32: 73b1b0d2  SHA1: 56add8c5f959a86b98aa4870b32aa23455be21ef
85
7986- The Ninja Kid II sound program writes to unmapped locations 0xeff5, 0xeff6, and
8087  0xefee due to a bug. This happens in both the encrypted and decrypted versions,
8188  so it appears to be a genuine bug with no ill effect.
r4499r4500
118125-----
119126- What does the "credit service" dip switch do in Ninja Kid II?
120127
128
121129******************************************************************************/
122130
123131#include "driver.h"
r4499r4500
14761484GAME( 1987, ninjak2b, ninjakd2, ninjakd2, rdaction, bootleg,  ROT0,   "UPL", "Ninja-Kid II / NinjaKun Ashura no Shou (set 3, bootleg?)", 0 )
14771485GAME( 1987, rdaction, ninjakd2, ninjakd2, rdaction, ninjakd2, ROT0,   "UPL (World Games license)", "Rad Action / NinjaKun Ashura no Shou", 0 )
14781486GAME( 1987, mnight,   0,        mnight,   mnight,   mnight,   ROT0,   "UPL (Kawakus license)", "Mutant Night", GAME_IMPERFECT_GRAPHICS )
1479GAME( 1987, arkarea,  0,        mnight,   arkarea,  mnight,   ROT0,   "UPL", "Ark Area", 0 )
1480GAME( 1988, robokid,  0,        robokid,  robokid,  0,        ROT0,   "UPL", "Atomic Robo-kid", 0 )
1481GAME( 1988, robokidj, robokid,  robokid,  robokidj, 0,        ROT0,   "UPL", "Atomic Robo-kid (Japan, set 1)", 0 )
1482GAME( 1988, robokdj2, robokid,  robokid,  robokidj, 0,        ROT0,   "UPL", "Atomic Robo-kid (Japan, set 2)", 0 )
1483GAME( 1989, omegaf,   0,        omegaf,   omegaf,   0,        ROT270, "UPL", "Omega Fighter", 0 )
1484GAME( 1989, omegafs,  omegaf,   omegaf,   omegaf,   0,        ROT270, "UPL", "Omega Fighter Special", 0 )
1487GAME( 1987, arkarea,  0,        mnight,   arkarea,  mnight,   ROT0,   "UPL", "Ark Area", GAME_IMPERFECT_GRAPHICS )
1488GAME( 1988, robokid,  0,        robokid,  robokid,  0,        ROT0,   "UPL", "Atomic Robo-kid", GAME_IMPERFECT_GRAPHICS )
1489GAME( 1988, robokidj, robokid,  robokid,  robokidj, 0,        ROT0,   "UPL", "Atomic Robo-kid (Japan, set 1)", GAME_IMPERFECT_GRAPHICS )
1490GAME( 1988, robokdj2, robokid,  robokid,  robokidj, 0,        ROT0,   "UPL", "Atomic Robo-kid (Japan, set 2)", GAME_IMPERFECT_GRAPHICS )
1491GAME( 1989, omegaf,   0,        omegaf,   omegaf,   0,        ROT270, "UPL", "Omega Fighter", GAME_IMPERFECT_GRAPHICS )
1492GAME( 1989, omegafs,  omegaf,   omegaf,   omegaf,   0,        ROT270, "UPL", "Omega Fighter Special", GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/seta.c
r4499r4500
16591659
16601660static READ16_HANDLER ( calibr50_ip_r )
16611661{
1662   int dir1 = input_port_read(space->machine, "ROT1") & 0xfff;   // analog port
1663   int dir2 = input_port_read(space->machine, "ROT2") & 0xfff;   // analog port
1662   int dir1 = input_port_read(space->machine, "ROT1");   // analog port
1663   int dir2 = input_port_read(space->machine, "ROT2");   // analog port
16641664
16651665   switch (offset)
16661666   {
r4499r4500
16691669
16701670      case 0x08/2:   return input_port_read(space->machine, "COINS");   // Coins
16711671
1672      case 0x10/2:   return (dir1&0xff);         // lower 8 bits of p1 rotation
1673      case 0x12/2:   return (dir1>>8);         // upper 4 bits of p1 rotation
1674      case 0x14/2:   return (dir2&0xff);         // lower 8 bits of p2 rotation
1675      case 0x16/2:   return (dir2>>8);         // upper 4 bits of p2 rotation
1672      case 0x10/2:   return (dir1 & 0xff);      // lower 8 bits of p1 rotation
1673      case 0x12/2:   return (dir1 >> 8);         // upper 4 bits of p1 rotation
1674      case 0x14/2:   return (dir2 & 0xff);      // lower 8 bits of p2 rotation
1675      case 0x16/2:   return (dir2 >> 8);         // upper 4 bits of p2 rotation
16761676      case 0x18/2:   return 0xffff;            // ? (value's read but not used)
16771677      default:
16781678         logerror("PC %06X - Read input %02X !\n", cpu_get_pc(space->cpu), offset*2);
r4499r4500
29542954   int dir1 = input_port_read(space->machine, "ROT1");   // analog port
29552955   int dir2 = input_port_read(space->machine, "ROT2");   // analog port
29562956
2957   dir1 = (~ (0x800 >> ((dir1 * 12)/0x100)) ) & 0xfff;
2958   dir2 = (~ (0x800 >> ((dir2 * 12)/0x100)) ) & 0xfff;
2957   dir1 = (~ (0x800 >> dir1)) & 0xfff;
2958   dir2 = (~ (0x800 >> dir2)) & 0xfff;
29592959
29602960   switch (offset)
29612961   {
r4499r4500
36443644   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
36453645
36463646   PORT_START("ROT1")   // Rotation Player 1
3647   JOY_ROTATION(1, Z, X)
3647   PORT_BIT( 0xfff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(15) PORT_KEYDELTA(15) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X)
36483648
36493649   PORT_START("ROT2")   // Rotation Player 2
3650   JOY_ROTATION(2, N, M)
3650   PORT_BIT( 0xfff, 0x00, IPT_DIAL ) PORT_PLAYER(2) PORT_SENSITIVITY(15) PORT_KEYDELTA(15) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M)
36513651INPUT_PORTS_END
36523652
36533653/***************************************************************************
r4499r4500
38873887   PORT_DIPSETTING(      0x0000, "2" )
38883888
38893889   PORT_START("ROT1")   //Rotation Player 1
3890   JOY_ROTATION(1, Z, X)
3890   PORT_BIT( 0xff, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_FULL_TURN_COUNT(12)
38913891
38923892   PORT_START("ROT2")   //Rotation Player 2
3893   JOY_ROTATION(2, N, M)
3893   PORT_BIT( 0xff, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_PLAYER(2) PORT_FULL_TURN_COUNT(12)
38943894INPUT_PORTS_END
38953895
38963896
src/mame/drivers/rohga.c
r4499r4500
12161216   ROM_LOAD( "hb-00.11p", 0x00000,  0x200,  CRC(b7a7baad) SHA1(39781c3412493b985d3616ac31142fc00bbcddf4) )   /* ? */
12171217ROM_END
12181218
1219ROM_START( wolffang ) /* Japan */
1220   ROM_REGION(0x200000, "maincpu", 0 ) /* 68000 code */
1221   ROM_LOAD16_BYTE( "hw_00-1.2a",  0x000000, 0x40000, CRC(69dc611e) SHA1(37fc54df32cc8e0502b59d33d94a805dbd7018c5) )
1222   ROM_LOAD16_BYTE( "hw_03-1.2d",  0x000001, 0x40000, CRC(b66d9680) SHA1(6bb97a720cc8a5df4051d8ae55586baf03cdc6bc) )
1223   ROM_LOAD16_BYTE( "mam00.8a",  0x100000, 0x80000, CRC(0fa440a6) SHA1(f0f84c630fc30ec164acc21de871c857d391c398) )
1224   ROM_LOAD16_BYTE( "mam07.8d",  0x100001, 0x80000, CRC(f8bc7f20) SHA1(909324248bd207f3b01d9f694975b629d8ccaa08) )
1225
1226   ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */
1227   ROM_LOAD( "hw_04-.18p",  0x00000,  0x10000,  CRC(eb6608eb) SHA1(0233677970aba12783dd4d6d58d70568ef641115) )
1228
1229   ROM_REGION( 0x020000, "gfx1", ROMREGION_DISPOSE )
1230   ROM_LOAD16_BYTE( "hw_01-.13a",  0x00000,  0x10000,  CRC(d9810ca4) SHA1(f8d85c93eaf8e26f115afff6193617caa864a6b7) ) /* Encrypted tiles */
1231   ROM_LOAD16_BYTE( "hw_02-.14a",  0x00001,  0x10000,  CRC(2a27ac8e) SHA1(9ed752cc212d29a621226deee79e62585232c923) )
1232
1233   ROM_REGION( 0x100000, "gfx2", ROMREGION_DISPOSE )
1234   ROM_LOAD( "mam01.10a", 0x000000, 0x080000,  CRC(dbf4fbcc) SHA1(2f289556fd25beb7d30501cba17ac35ad28c5b91) ) /* Encrypted tiles */
1235   ROM_LOAD( "mam02.11a", 0x080000, 0x080000,  CRC(b1fac481) SHA1(da370499ea8ff7b3dd338b31f3799b760fd0d981) )
1236
1237   ROM_REGION( 0x200000, "gfx3", ROMREGION_DISPOSE )
1238   ROM_LOAD( "mam08.17d",  0x000000, 0x100000,  CRC(ca97a83f) SHA1(2e097840ae56cf19ad2651d59c31182f47239d60) ) /* tiles 1 & 2 */
1239   ROM_LOAD( "mam09.18d",  0x100000, 0x100000,  CRC(3f57d56f) SHA1(0d4537da6ab62762179215deae72fe2e6a7869e1) )
1240
1241   ROM_REGION( 0x600000, "gfx4", ROMREGION_DISPOSE )
1242   ROM_LOAD( "mam05.19a", 0x000000, 0x100000,  CRC(307a2cd1) SHA1(d7a795e47cf1533f0bb5a96162c8025282abe09f) ) /* 6bpp sprites */
1243   ROM_LOAD( "mam06.20a", 0x100000, 0x100000,  CRC(a1119a2d) SHA1(876f9295c2032ce491b45a103ffafc750d8c78e1) )
1244   ROM_LOAD( "mam10.19d", 0x200000, 0x100000,  CRC(99f48f9f) SHA1(685787de54e9158ced80f3821996c3a63f2a72a2) )
1245   ROM_LOAD( "mam11.20d", 0x300000, 0x100000,  CRC(c3f12859) SHA1(45fdfd55f606316c936f0a9e6b4940740138d344) )
1246   ROM_LOAD( "mam03.17a", 0x400000, 0x100000,  CRC(fc4dfd48) SHA1(0c5f5a09833ebeb3018e65edd6f7ce06d4ba84ed) )
1247   ROM_LOAD( "mam04.18a", 0x500000, 0x100000,  CRC(7d3b38bf) SHA1(9f83ad7497ed57405ad648f403eb69f776567a50) )
1248
1249   ROM_REGION(0x80000, "oki2", 0 ) /* Oki samples */
1250   ROM_LOAD( "mam12.14p", 0x00000,  0x80000,  CRC(6f00b791) SHA1(c9fbc9ab5ce84fec79efa0a23373be97a27bf898) )
1251
1252   ROM_REGION(0x80000, "oki1", 0 ) /* Oki samples */
1253   ROM_LOAD( "mam13.15p", 0x00000,  0x80000,  CRC(525b9461) SHA1(1d9bb3725dfe601b05a779b84b4191455087b969) )
1254
1255   ROM_REGION( 512, "proms", 0 )
1256   ROM_LOAD( "hb-00.11p", 0x00000,  0x200,  CRC(b7a7baad) SHA1(39781c3412493b985d3616ac31142fc00bbcddf4) )   /* ? */
1257ROM_END
1258
12191259ROM_START( wizdfire )
12201260   ROM_REGION(0x200000, "maincpu", 0 ) /* 68000 code */
12211261   ROM_LOAD16_BYTE( "jf-01.3d",   0x000000, 0x20000, CRC(bde42a41) SHA1(0379de9c4cdcce35554b5dc15241ed2c4f0d7611) )
r4499r4500
14741514GAME( 1991, rohga2,   rohga,   rohga,    rohga,    rohga,    ROT0,   "Data East Corporation", "Rohga Armor Force (Asia/Europe v3.0 Set 2)", 0 )
14751515GAME( 1991, rohgah,   rohga,   rohga,    rohga,    rohga,    ROT0,   "Data East Corporation", "Rohga Armor Force (Hong Kong v3.0)", 0 )
14761516GAME( 1991, rohgau,   rohga,   rohga,    rohga,    rohga,    ROT0,   "Data East Corporation", "Rohga Armor Force (US v1.0)", 0 )
1517GAME( 1991, wolffang, rohga,   rohga,    rohga,    rohga,    ROT0,   "Data East Corporation", "Wolf Fang -Kuhga 2001- (Japan)", 0 )
14771518GAME( 1992, wizdfire, 0,       wizdfire, wizdfire, wizdfire, ROT0,   "Data East Corporation", "Wizard Fire (US v1.1)", 0 )
14781519GAME( 1992, darksel2, wizdfire,wizdfire, wizdfire, wizdfire, ROT0,   "Data East Corporation", "Dark Seal 2 (Japan v2.1)", 0 )
14791520GAME( 1992, nitrobal, 0,       nitrobal, nitrobal, nitrobal, ROT270, "Data East Corporation", "Nitro Ball (US)", 0 )
src/mame/drivers/naomi.c
r4499r4500
1717|cvsgd     |   2   |  H  | Yes  | Yes  | Yes  | joystick with 4 buttons        | 2 + 2 extra buttons                                 |
1818|gundmxgd  |   1   |  H  | Yes  | Yes  | Yes  | joystick with 4+6 buttons      |                                                     |
1919|cvs2gd    |   2   |  H  | Yes  | Yes  | Yes  | joystick with 6 buttons        |                                                     |
20|ikaruga   |   2   |  V  | Yes  | Yes  | Yes  | joystick with 3 buttons?       |                                                     |
20|ikaruga   |   2   |  V  | Yes  | Yes  | Yes  | joystick with 2 buttons        |                                                     |
2121|ggxx      |   2   |  H  | Yes  | Yes  | Yes  | joystick with 5 buttons        |                                                     |
22|moeru     |   2   |  H  | No   | No   | No   | joystick with 3 buttons?       | Broken i/o, stuck at the "now loading" msg          |
23|chocomk   |   2   |  H  | Yes  | Yes  | Yes  | joystick with 3 buttons?       |                                                     |
22|moeru     |   2   |  H  | No   | No   | No   | joystick with 3 buttons        | Broken i/o, stuck at the "now loading" msg          |
23|chocomk   |   2   |  H  | Yes  | Yes  | Yes  | joystick with 2 buttons        |                                                     |
2424|quizqgd   |   2   |  V  | Yes  | Yes  | Yes  | joystick(?) with 4 buttons     |                                                     |
2525|ggxxrl    |   2   |  H  | Yes  | Yes  | Yes  | joystick with 5 buttons        |                                                     |
26|tetkiwam  |   2   |  H  | No   | No   | No   | joystick with 3 buttons?       | Black screen, tests the SCIF (UART) regs?           |
27|shikgam2  |   2   |  V  | Yes  | Yes  | No   | joystick with 3 buttons?       | Broken i/o, crashes on the proper gameplay          |
26|tetkiwam  |   2   |  H  | No   | No   | No   | joystick with 3 buttons        | Black screen, tests the SCIF (UART) regs?           |
27|shikgam2  |   2   |  V  | Yes  | Yes  | No   | joystick with 3 buttons        | Broken i/o, crashes on the proper gameplay          |
2828|usagui    |   1   |  H  | Yes  | Yes  | No   | mahjong panel                  |                                                     |
29|bdrdown   |   2   |  H  | Yes  | Yes  | Yes  | joystick with 3 buttons?       |                                                     |
30|psyvar2   |   1   |  V  | No   | No   | No   | joystick with 3 buttons?       |                                                     |
31|cfield    |   1?  |  H  | No?  | Yes  | No   | joystick with 3 buttons?       | Broken i/o                                          |
32|trizeal   |   2   |  V  | No   | No   | No   | joystick with 3 buttons?       |                                                     |
33|meltybld  |   2   |  H  | No?  | Yes  | No?  | joystick with 4 buttons?       | Crashes in attract/gameplay with wrong mask         |
34|senko     |   2   |  H  | Yes  | Yes  | No   | joystick with 3 buttons?       | Broken i/o                                          |
35|senkoo    |   2   |  H  | Yes  | Yes  | No   | joystick with 3 buttons?       | Broken i/o                                          |
36|ss2005    |   1   |  H  | Yes  | Yes  | No   | joystick with 3 buttons?       | Broken i/o                                          |
37|radirgy   |   1   |  V  | Yes  | Yes  | No   | joystick with 3 buttons?       | Broken i/o                                          |
29|bdrdown   |   2   |  H  | Yes  | Yes  | Yes  | joystick with 3 buttons        |                                                     |
30|psyvar2   |   1   |  V  | Yes  | Yes  | No   | joystick with 2 buttons        | Broken i/o? Hangs after pressing start              |
31|cfield    |   1   |  H  | Yes  | Yes  | Yes  | joystick with 3 buttons        |                                                     |
32|trizeal   |   2   |  V  | No   | No   | No   | joystick with 3 buttons        |                                                     |
33|meltybld  |   2   |  H  | Yes  | Yes  | Yes  | joystick with 4 buttons        | Crashes in attract mode                             |
34|senko     |   2   |  H  | Yes  | Yes  | No   | joystick with 3 buttons        | Senko no Londe SP (undumped) uses 5 buttons         |
35|senkoo    |   2   |  H  | Yes  | Yes  | No   | joystick with 3 buttons        |                                                     |
36|ss2005    |   1   |  H  | Yes  | Yes  | No   | joystick with 3 buttons        | Calls a YUV FMV, crashes due of that                |
37|radirgy   |   1   |  V  | Yes  | Yes  | Yes  | joystick with 3 buttons        |                                                     |
3838|ggxxsla   |   2   |  H  | Yes  | Yes  | Yes  | joystick with 5 buttons        |                                                     |
39|kurucham  |   2   |  H  | Yes  | Yes  | No   | joystick with 3 buttons?       | Broken i/o, crashes in attract with wrong mask      |
40|undefeat  |   2   |  V  | No   | No   | No   | joystick with 3 buttons?       | Stuck at the "now loading" msg                      |
41|trgheart  |   1   |  V  | Yes  | Yes  | No   | joystick with 3 buttons?       | Broken i/o                                          |
42|jingystm  |   2   |  H  | Yes  | Yes  | No   | joystick with 4 buttons?       | Broken i/o                                          |
43|meltyb    |   2   |  H  | No?  | Yes  | No?  | joystick with 4 buttons?       | Crashes in attract/gameplay with wrong mask         |
44|meltyba   |   2   |  H  | No?  | Yes  | No?  | joystick with 4 buttons?       | Crashes in attract/gameplay with wrong mask         |
45|karous    |   1   |  V  | Yes  | Yes  | No   | joystick with 3 buttons?       | Broken i/o                                          |
39|kurucham  |   2   |  H  | Yes  | Yes  | No   | joystick with 3 buttons        | Broken i/o, crashes in attract with wrong mask      |
40|undefeat  |   2   |  V  | No   | No   | No   | joystick with 2 buttons        | Stuck at the "now loading" msg                      |
41|trgheart  |   1   |  V  | Yes  | Yes  | No   | joystick with 3 buttons        | Broken i/o                                          |
42|jingystm  |   2   |  H  | Yes  | Yes  | No   | joystick with 3 buttons        | Broken i/o                                          |
43|meltyb    |   2   |  H  | Yes  | Yes  | Yes  | joystick with 5 buttons        | Crashes in attract mode                             |
44|meltyba   |   2   |  H  | Yes  | Yes  | Yes  | joystick with 5 buttons        | Crashes in attract mode                             |
45|karous    |   1   |  V  | Yes  | Yes  | No   | joystick with 3 buttons        | Broken i/o                                          |
4646|takoron   |   2   |  H  | Yes  | Yes  | Yes  | joystick with 3 buttons        |                                                     |
4747--------------------------------------------------------------------------------------------------------------------------------------
4848|confmiss  |   2   |  H  | Yes  | Yes  | No   | lightgun                       |                                                     |
r4499r4500
5353|dygolf    |   2   |  H  | No   | No   | No   | trackball + 4 buttons          | Moans about the jvs settings                        |
5454|wsbbgd    |   2   |  H  | No   | No   | No   | ad stick + 2 buttons           | Moans about the jvs settings                        |
5555|vtennisg  |   2   |  H  | Yes  | Yes  | No   | joystick with 2 buttons        | Broken gfxs, crashes after a while                  |
56|vathlete  |   2   |  H  | Yes  | Yes  | No   | joystick with 3 buttons?       | Broken i/o                                          |
56|vathlete  |   2   |  H  | Yes  | Yes  | No   | joystick with 3 buttons        | Broken i/o                                          |
5757|vtennis2  |   2   |  H  | No   | No   | No   | joystick with 3 buttons        |                                                     |
5858|keyboard  |   2   |  H  | Yes  | Yes  | No   | keyboard                       | Broken i/o, crashes after a while                   |
5959|lupinsho  |   2   |  H  | Yes  | Yes  | No   | lightgun                       | Broken i/o, crashes after a while                   |
60|luptype   |   2   |  H  | Yes  | Yes  | No   | keyboard                       | Broken i/o, crashes after a while                  |
60|luptype   |   2   |  H  | Yes  | Yes  | No   | keyboard                       | Broken i/o, ARM cpu crashes when inserting a coin   |
6161|mok       |   2   |  H  | Yes  | Yes  | No   | lightgun                       | Broken i/o                                          |
6262|ngdup23a  |   2   |  H  | Yes  | Yes  | Yes  | n/a                            | Missing DIMM emulation                              |
6363|ngdup23c  |   2   |  H  | Yes  | Yes  | Yes  | n/a                            | Missing DIMM emulation                              |
64|puyofev   |   2   |  H  | Yes  | Yes  | No   | joystick with 3 buttons?       | Broken i/o                                       |
64|puyofev   |   2   |  H  | Yes  | Yes  | No   | joystick with 2 buttons        | Broken i/o? Hangs after pressing start              |
6565--------------------------------------------------------------------------------------------------------------------------------------
6666
6767Test: If it enters into test mode (not actually working test mode, i.e. if inputs doesn't work)
r4499r4500
15501550   ROM_REGION( 0x200000, "maincpu", 0)
15511551   NAOMI_BIOS
15521552
1553   ROM_REGION( 0x400000, "user1", 0)
1554   ROM_LOAD("epr23210.22", 0x00000, 0x400000,  CRC(a15c54b5) SHA1(5c7872244d3d648e4c04751f120d0e9d47239921) )
1555
1556   ROM_REGION( 0x8000000, "user2", 0)
1557   ROM_LOAD("ic1", 0x0000000, 0x0800000, NO_DUMP )
1558   ROM_LOAD("ic2", 0x0800000, 0x0800000, NO_DUMP )
1559   ROM_LOAD("ic3", 0x1000000, 0x0800000, NO_DUMP )
1560   ROM_LOAD("ic4", 0x1800000, 0x0800000, NO_DUMP )
1561   ROM_LOAD("ic5", 0x2000000, 0x0800000, NO_DUMP )
1562   ROM_LOAD("ic6", 0x2800000, 0x0800000, NO_DUMP )
1563   ROM_LOAD("ic7", 0x3000000, 0x0800000, NO_DUMP )
1564   ROM_LOAD("ic8", 0x3800000, 0x0800000, NO_DUMP )
1565   ROM_LOAD("ic9", 0x4000000, 0x0800000, NO_DUMP )
1566   ROM_LOAD("ic10",0x4800000, 0x0800000, NO_DUMP )
1567   ROM_LOAD("ic11",0x5000000, 0x0800000, NO_DUMP )
1568   ROM_LOAD("ic12",0x5800000, 0x0800000, NO_DUMP )
1553   ROM_REGION( 0x6800000, "user1", 0)
1554   ROM_LOAD("epr-23210.ic22", 0x0000000, 0x0400000, CRC(a15c54b5) SHA1(5c7872244d3d648e4c04751f120d0e9d47239921) )
1555   ROM_RELOAD( 0x400000, 0x400000)
1556   ROM_LOAD("mpr-23198.ic1",  0x0800000, 0x0800000, CRC(ce8d3edf) SHA1(1df5bb4eb440c221b8f1e5f019b02accc235fc28) )
1557   ROM_LOAD("mpr-23199.ic2",  0x1000000, 0x0800000, CRC(0979392a) SHA1(7dc433da6f3e47a721a2e86720a65d9752248e92) )
1558   ROM_LOAD("mpr-23200.ic3",  0x1800000, 0x0800000, CRC(e4b2db33) SHA1(063bc3789f68be5fcefeeec9e1c8268feb84b7eb) )
1559   ROM_LOAD("mpr-23201.ic4",  0x2000000, 0x0800000, CRC(c55ca0fa) SHA1(e6fde606b9ed4fd195da304a7b57e8b7797e368f) )
1560   ROM_LOAD("mpr-23202.ic5",  0x2800000, 0x0800000, CRC(983bb21c) SHA1(a30f9b09370cceadf11defc85b5acd3e578477e0) )
1561   ROM_LOAD("mpr-23203.ic6",  0x3000000, 0x0800000, CRC(f61b8d96) SHA1(a3522963b1e13b809818ffe5a209dd4ce087ec38) )
1562   ROM_LOAD("mpr-23204.ic7",  0x3800000, 0x0800000, CRC(03593ecd) SHA1(5ef3ccbfb7b1cc85ad352b13d70eefcad2b209f6) )
1563   ROM_LOAD("mpr-23205.ic8",  0x4000000, 0x0800000, CRC(e8c9349b) SHA1(310f02c5dad84e84362f0f674afa405f7d72f8ce) )
1564   ROM_LOAD("mpr-23206.ic9",  0x4800000, 0x0800000, CRC(8089d80f) SHA1(821f5f24616920bf0ed4c86597c27f6a3c39b8e6) )
1565   ROM_LOAD("mpr-23207.ic10", 0x5000000, 0x0800000, CRC(39f692a1) SHA1(14bc86b48a995378b4dd3609d38b90cddf2d7483) )
1566   ROM_LOAD("mpr-23208.ic11", 0x5800000, 0x0800000, CRC(b9494f4b) SHA1(2f35b25edf5210a82d4b67e639eeae11440d065a) )
1567   ROM_LOAD("mpr-23209.ic12s",0x6000000, 0x0800000, CRC(560188c0) SHA1(77f14c9a031c6e5414ffa854d20c40115361d715) )
15691568ROM_END
15701569
15711570/*
r4499r4500
17011700   NAOMI_BIOS
17021701
17031702   ROM_REGION( 0x6000000, "user1", 0)
1704   ROM_LOAD("epr22927.22", 0x0000000, 0x0400000,  CRC(89781723) SHA1(cf644aa66abcec6964d77485a0292f11ba80dd0d) )
1703   ROM_LOAD("epr-22927.ic22", 0x0000000, 0x0400000,  CRC(89781723) SHA1(cf644aa66abcec6964d77485a0292f11ba80dd0d) )
17051704   ROM_RELOAD( 0x400000, 0x400000)
1706   ROM_LOAD("ic1.bin", 0x0800000, 0x0800000, CRC(903873e5) SHA1(09af791bc02cca0e2dc72187679830ed9f4fc772) )
1707   ROM_LOAD("ic2.bin", 0x1000000, 0x0800000, CRC(5f020fa6) SHA1(bd2519be8c88ff34cf2fd2b17271d2b41b64ce9f) )
1708   ROM_LOAD("ic3.bin", 0x1800000, 0x0800000, CRC(3c3bf533) SHA1(db43ca9332e76b968b9b388b4824b768f82b9859) )
1709   ROM_LOAD("ic4.bin", 0x2000000, 0x0800000, CRC(3d8dd003) SHA1(91f494b06b9977215ab726a2499b5855d4d49e81) )
1710   ROM_LOAD("ic5.bin", 0x2800000, 0x0800000, CRC(efd781d4) SHA1(ced5a8dc8ff7677b3cac2a4fae04670c46cc96af) )
1711   ROM_LOAD("ic6.bin", 0x3000000, 0x0800000, CRC(79e75be1) SHA1(82318613c947907e01bbe50569b05ef24789d7c9) )
1712   ROM_LOAD("ic7.bin", 0x3800000, 0x0800000, CRC(44bd3883) SHA1(5c595d903d8865bf8bf3aafb1f527bff232718ed) )
1713   ROM_LOAD("ic8.bin", 0x4000000, 0x0800000, CRC(9ebdf0f8) SHA1(f1b688bda387fc00c70cb6a0c374c6c13926c138) )
1714   ROM_LOAD("ic9.bin", 0x4800000, 0x0800000, CRC(ecde9d57) SHA1(1fbe7fdf66a56f4f1765baf113dff95142bfd114) )
1715   ROM_LOAD("ic10.bin",0x5000000, 0x0800000, CRC(81057e42) SHA1(d41137ae28c64dbdb50150db8cf25851bc0709c4) )
1716   ROM_LOAD("ic11.bin",0x5800000, 0x0800000, CRC(57eec89d) SHA1(dd8f9a9155e51ee5260f559449fb0ea245077952) )
1705   ROM_LOAD("mpr-22916.ic1", 0x0800000, 0x0800000, CRC(903873e5) SHA1(09af791bc02cca0e2dc72187679830ed9f4fc772) )
1706   ROM_LOAD("mpr-22917.ic2", 0x1000000, 0x0800000, CRC(5f020fa6) SHA1(bd2519be8c88ff34cf2fd2b17271d2b41b64ce9f) )
1707   ROM_LOAD("mpr-22918.ic3", 0x1800000, 0x0800000, CRC(3c3bf533) SHA1(db43ca9332e76b968b9b388b4824b768f82b9859) )
1708   ROM_LOAD("mpr-22919.ic4", 0x2000000, 0x0800000, CRC(3d8dd003) SHA1(91f494b06b9977215ab726a2499b5855d4d49e81) )
1709   ROM_LOAD("mpr-22920.ic5", 0x2800000, 0x0800000, CRC(efd781d4) SHA1(ced5a8dc8ff7677b3cac2a4fae04670c46cc96af) )
1710   ROM_LOAD("mpr-22921.ic6", 0x3000000, 0x0800000, CRC(79e75be1) SHA1(82318613c947907e01bbe50569b05ef24789d7c9) )
1711   ROM_LOAD("mpr-22922.ic7", 0x3800000, 0x0800000, CRC(44bd3883) SHA1(5c595d903d8865bf8bf3aafb1f527bff232718ed) )
1712   ROM_LOAD("mpr-22923.ic8", 0x4000000, 0x0800000, CRC(9ebdf0f8) SHA1(f1b688bda387fc00c70cb6a0c374c6c13926c138) )
1713   ROM_LOAD("mpr-22924.ic9", 0x4800000, 0x0800000, CRC(ecde9d57) SHA1(1fbe7fdf66a56f4f1765baf113dff95142bfd114) )
1714   ROM_LOAD("mpr-22925.ic10",0x5000000, 0x0800000, CRC(81057e42) SHA1(d41137ae28c64dbdb50150db8cf25851bc0709c4) )
1715   ROM_LOAD("mpr-22926.ic11",0x5800000, 0x0800000, CRC(57eec89d) SHA1(dd8f9a9155e51ee5260f559449fb0ea245077952) )
17171716ROM_END
17181717
17191718
r4499r4500
19491948   ROM_REGION( 0x200000, "maincpu", 0)
19501949   NAOMI_BIOS
19511950
1952   ROM_REGION( 0x400000, "user1", 0)
1953   ROM_LOAD("epr23716a.22", 0x0000000, 0x0400000,  CRC(c5cb0d3b) SHA1(20de8f5ee183e996ccde77b10564a302939662db) )
1954
1955   ROM_REGION( 0x5800000, "user2", 0)
1956   ROM_LOAD("ic1", 0x0000000, 0x0800000, NO_DUMP )
1957   ROM_LOAD("ic2", 0x0800000, 0x0800000, NO_DUMP )
1958   ROM_LOAD("ic3", 0x1000000, 0x0800000, NO_DUMP )
1959   ROM_LOAD("ic4", 0x1800000, 0x0800000, NO_DUMP )
1960   ROM_LOAD("ic5", 0x2000000, 0x0800000, NO_DUMP )
1961   ROM_LOAD("ic6", 0x2800000, 0x0800000, NO_DUMP )
1962   ROM_LOAD("ic7", 0x3000000, 0x0800000, NO_DUMP )
1963   ROM_LOAD("ic8", 0x3800000, 0x0800000, NO_DUMP )
1964   ROM_LOAD("ic9", 0x4000000, 0x0800000, NO_DUMP )
1965   ROM_LOAD("ic10",0x4800000, 0x0800000, NO_DUMP )
1966   ROM_LOAD("ic11",0x5000000, 0x0800000, NO_DUMP )
1951   ROM_REGION( 0x6000000, "user1", 0)
1952   ROM_LOAD("epr-23716a.ic22", 0x0000000, 0x0400000,  CRC(c5cb0d3b) SHA1(20de8f5ee183e996ccde77b10564a302939662db) )
1953   ROM_RELOAD( 0x400000, 0x400000)
1954   ROM_LOAD("mpr-23705.ic1", 0x0800000, 0x0800000, CRC(2549b57d) SHA1(02c04c8ccb0de680171d06700ca9a40208286894) )
1955   ROM_LOAD("mpr-23706.ic2", 0x1000000, 0x0800000, CRC(9f21865c) SHA1(a1f5aec34097cf2b86110110f586ba8b3cf28bd1) )
1956   ROM_LOAD("mpr-23707.ic3", 0x1800000, 0x0800000, CRC(ba2f42cd) SHA1(e924f8ef58cc81b7303d8fb3baf0e384c6387e7f) )
1957   ROM_LOAD("mpr-23708.ic4", 0x2000000, 0x0800000, CRC(19c4e61b) SHA1(a4619df98818d33bdaa3e6429c14d1aeec316e6a))
1958   ROM_LOAD("mpr-23709.ic5", 0x2800000, 0x0800000, CRC(676430b3) SHA1(5fa40c45afe97b0f09e575e3c01d44aa9259961d) )
1959   ROM_LOAD("mpr-23710.ic6", 0x3000000, 0x0800000, CRC(5d32dba3) SHA1(5bb5796a682cc6ee68458403c69343bf753ece7a) )
1960   ROM_LOAD("mpr-23711.ic7", 0x3800000, 0x0800000, CRC(650df507) SHA1(dff192b3bd4f39627779e2ba86d9dd13536221dd) )
1961   ROM_LOAD("mpr-23712.ic8", 0x4000000, 0x0800000, CRC(154f10ce) SHA1(67f6ff297f77632efe1965a81ed9f5c7dfa7a6b3) )
1962   ROM_LOAD("mpr-23713.ic9", 0x4800000, 0x0800000, CRC(2969bac7) SHA1(5f1cf6ac726c2fe183d66e4022962e44592f9ccd) )
1963   ROM_LOAD("mpr-23714.ic10",0x5000000, 0x0800000, CRC(da462c44) SHA1(ca450b6c07f939f96eba7b44c45b4e38abd598aa) )
1964   ROM_LOAD("mpr-23715.ic11",0x5800000, 0x0800000, BAD_DUMP CRC(59dfd3ad) SHA1(bb8f7a1bcf16038b18f4485a6b6d81fa72ca7bd0) )
19671965ROM_END
19681966
19691967/*
r4499r4500
21122110   NAOMI_BIOS
21132111
21142112   ROM_REGION( 0x9000000, "user1", 0)
2115   ROM_LOAD("epr23341.22", 0x0000000, 0x0400000,  CRC(477fa123) SHA1(d2474766dcd0b0e5fe317a858534829eb1c26789) )
2113   ROM_LOAD("epr-23341.ic22", 0x0000000, 0x0400000,  CRC(477fa123) SHA1(d2474766dcd0b0e5fe317a858534829eb1c26789) )
21162114   ROM_RELOAD( 0x400000, 0x400000)
2117   ROM_LOAD("ic1.bin", 0x0800000, 0x0800000, CRC(8624493a) SHA1(4fe940a889619f2a75c45e15efb2b8ed9020bc55) )
2118   ROM_LOAD("ic2.bin", 0x1000000, 0x0800000, CRC(f952d0d4) SHA1(4b5403b98bf977c1e3a045619e1eddb4e4ab69c7) )
2119   ROM_LOAD("ic3.bin", 0x1800000, 0x0800000, CRC(6c5ce16e) SHA1(110b5d536557ab6610a7c32db2e6e46901da9579) )
2120   ROM_LOAD("ic4.bin", 0x2000000, 0x0800000, CRC(1b3d02a0) SHA1(3e02a0cb3d945e5d6cea03236d6571d45a7afd51) )
2121   ROM_LOAD("ic5.bin", 0x2800000, 0x0800000, CRC(50053662) SHA1(3ced87ee533fd7a32d64c41f1fcbde9c648ab188) )
2122   ROM_LOAD("ic6.bin", 0x3000000, 0x0800000, CRC(96148e80) SHA1(c0f30556395edb9a7558006e89d6adc2f6bdc048) )
2123   ROM_LOAD("ic7.bin", 0x3800000, 0x0800000, CRC(15f2f9a1) SHA1(9cea71b6f6466ccd840218f5dcb09ea7525208d8) )
2124   ROM_LOAD("ic8.bin", 0x4000000, 0x0800000, CRC(a084ab51) SHA1(1f5c863012004bbeefc82b172a92011a175428a6) )
2125   ROM_LOAD("ic9.bin", 0x4800000, 0x0800000, CRC(50539e17) SHA1(38ec16a868c892e177fbb45be563e1b649956550) )
2126   ROM_LOAD("ic10.bin",0x5000000, 0x0800000, CRC(29891831) SHA1(f318bca11ac5eb24b32d5b910a596280221a44ab) )
2127   ROM_LOAD("ic11.bin",0x5800000, 0x0800000, CRC(c1ad0614) SHA1(e38ff316da889eb029d0a9348f6b2284f3a36f29) )
2128   ROM_LOAD("ic12.bin",0x6000000, 0x0800000, CRC(faeb25ed) SHA1(623f3f78c94ba44e77491c18a6521a19b1101a67) )
2129   ROM_LOAD("ic13.bin",0x6800000, 0x0800000, CRC(63589d0f) SHA1(53770cc1268892e8cdb76b6edf2fb39e8b605554) )
2130   ROM_LOAD("ic14.bin",0x7000000, 0x0800000, CRC(2bc46263) SHA1(38ec579768ac37ed3ad21911b1970241906af8ea) )
2131   ROM_LOAD("ic15.bin",0x7800000, 0x0800000, CRC(323e4db2) SHA1(c5484589c1613110faef6cf8b8f4def8867a8226) )
2132   ROM_LOAD("ic16.bin",0x8000000, 0x0800000, CRC(fd8c2736) SHA1(34ae1a4e35b4aac6666719fb4fc0959bd64ff3d6) )
2133   ROM_LOAD("ic17.bin",0x8800000, 0x0800000, CRC(001604f8) SHA1(615ec027d383d44d4aadb1175be6320e4139d7d1) )
2115   ROM_LOAD("mpr-23324.ic1", 0x0800000, 0x0800000, CRC(8624493a) SHA1(4fe940a889619f2a75c45e15efb2b8ed9020bc55) )
2116   ROM_LOAD("mpr-23325.ic2", 0x1000000, 0x0800000, CRC(f952d0d4) SHA1(4b5403b98bf977c1e3a045619e1eddb4e4ab69c7) )
2117   ROM_LOAD("mpr-23326.ic3", 0x1800000, 0x0800000, CRC(6c5ce16e) SHA1(110b5d536557ab6610a7c32db2e6e46901da9579) )
2118   ROM_LOAD("mpr-23327.ic4", 0x2000000, 0x0800000, CRC(1b3d02a0) SHA1(3e02a0cb3d945e5d6cea03236d6571d45a7afd51) )
2119   ROM_LOAD("mpr-23328.ic5", 0x2800000, 0x0800000, CRC(50053662) SHA1(3ced87ee533fd7a32d64c41f1fcbde9c648ab188) )
2120   ROM_LOAD("mpr-23329.ic6", 0x3000000, 0x0800000, CRC(96148e80) SHA1(c0f30556395edb9a7558006e89d6adc2f6bdc048) )
2121   ROM_LOAD("mpr-23330.ic7", 0x3800000, 0x0800000, CRC(15f2f9a1) SHA1(9cea71b6f6466ccd840218f5dcb09ea7525208d8) )
2122   ROM_LOAD("mpr-23331.ic8", 0x4000000, 0x0800000, CRC(a084ab51) SHA1(1f5c863012004bbeefc82b172a92011a175428a6) )
2123   ROM_LOAD("mpr-23332.ic9", 0x4800000, 0x0800000, CRC(50539e17) SHA1(38ec16a868c892e177fbb45be563e1b649956550) )
2124   ROM_LOAD("mpr-23333.ic10",0x5000000, 0x0800000, CRC(29891831) SHA1(f318bca11ac5eb24b32d5b910a596280221a44ab) )
2125   ROM_LOAD("mpr-23334.ic11",0x5800000, 0x0800000, CRC(c1ad0614) SHA1(e38ff316da889eb029d0a9348f6b2284f3a36f29) )
2126   ROM_LOAD("mpr-23335.ic12s",0x6000000, 0x0800000, CRC(faeb25ed) SHA1(623f3f78c94ba44e77491c18a6521a19b1101a67) )
2127   ROM_LOAD("mpr-23336.ic13s",0x6800000, 0x0800000, CRC(63589d0f) SHA1(53770cc1268892e8cdb76b6edf2fb39e8b605554) )
2128   ROM_LOAD("mpr-23337.ic14s",0x7000000, 0x0800000, CRC(2bc46263) SHA1(38ec579768ac37ed3ad21911b1970241906af8ea) )
2129   ROM_LOAD("mpr-23338.ic15s",0x7800000, 0x0800000, CRC(323e4db2) SHA1(c5484589c1613110faef6cf8b8f4def8867a8226) )
2130   ROM_LOAD("mpr-23339.ic16s",0x8000000, 0x0800000, CRC(fd8c2736) SHA1(34ae1a4e35b4aac6666719fb4fc0959bd64ff3d6) )
2131   ROM_LOAD("mpr-23340.ic17s",0x8800000, 0x0800000, CRC(001604f8) SHA1(615ec027d383d44d4aadb1175be6320e4139d7d1) )
21342132ROM_END
21352133
21362134
r4499r4500
22242222   ROM_REGION( 0x200000, "maincpu", 0)
22252223   NAOMI_BIOS
22262224
2227   ROM_REGION( 0x400000, "user1", 0)
2228   ROM_LOAD("epr21597.22", 0x0000000, 0x0200000,  CRC(62c7acc0) SHA1(bb61641a7f3650757132cde379447bdc9bd91c78) )
2229
2230   ROM_REGION( 0x4000000, "user2", 0)
2231   ROM_LOAD("ic1", 0x0000000, 0x0800000, NO_DUMP )
2232   ROM_LOAD("ic2", 0x0800000, 0x0800000, NO_DUMP )
2233   ROM_LOAD("ic3", 0x1000000, 0x0800000, NO_DUMP )
2234   ROM_LOAD("ic4", 0x1800000, 0x0800000, NO_DUMP )
2235   ROM_LOAD("ic5", 0x2000000, 0x0800000, NO_DUMP )
2236   ROM_LOAD("ic6", 0x2800000, 0x0800000, NO_DUMP )
2237   ROM_LOAD("ic7", 0x3000000, 0x0800000, NO_DUMP )
2238   ROM_LOAD("ic8", 0x3800000, 0x0800000, NO_DUMP )
2225   ROM_REGION( 0x4800000, "user1", 0)
2226   ROM_LOAD("epr-21597.ic22", 0x0000000, 0x0200000,  CRC(62c7acc0) SHA1(bb61641a7f3650757132cde379447bdc9bd91c78) )
2227   ROM_RELOAD( 0x200000, 0x200000)
2228   ROM_RELOAD( 0x400000, 0x200000)
2229   ROM_RELOAD( 0x600000, 0x200000)
2230   ROM_LOAD("mpr-21589.ic1", 0x0800000, 0x0800000, CRC(2fa66608) SHA1(144bda75f892a1e4dbd8332439e9e44fad1d0695) )
2231   ROM_LOAD("mpr-21590.ic2", 0x1000000, 0x0800000, CRC(6341b399) SHA1(d123b6a3eb7c4800950cc5849d748b0edafabc7d) )
2232   ROM_LOAD("mpr-21591.ic3", 0x1800000, 0x0800000, CRC(7f2d99aa) SHA1(00f9ae67be0d7229c37479b6dc0ed5816035fd98) )
2233   ROM_LOAD("mpr-21592.ic4", 0x2000000, 0x0800000, CRC(6ebe3b25) SHA1(c7dec77d55b0fcf1d230311b24553581a90a7d22) )
2234   ROM_LOAD("mpr-21593.ic5", 0x2800000, 0x0800000, CRC(84366f3e) SHA1(c61985f627813db2e16182e437ab4a69d5253c9f) )
2235   ROM_LOAD("mpr-21594.ic6", 0x3000000, 0x0800000, CRC(ddfa0467) SHA1(e758eae50035d5f18d99dbed728513e306d9566f) )
2236   ROM_LOAD("mpr-21595.ic7", 0x3800000, 0x0800000, CRC(7ab218f7) SHA1(c5c022e63f926cce09d49331647cde20e8e42ab3) )
2237   ROM_LOAD("mpr-21596.ic8", 0x4000000, 0x0800000, CRC(f27dbdc5) SHA1(d54717d62897546968de2f049239f68bee49bdd8) )
22392238ROM_END
22402239
22412240/*
r4499r4500
22652264   ROM_REGION( 0x200000, "maincpu", 0)
22662265   NAOMI_BIOS
22672266
2268   ROM_REGION( 0x400000, "user1", 0)
2269   ROM_LOAD("epr23127.22", 0x0000000, 0x0400000,  CRC(185761d6) SHA1(8c91b594dd59313d249c9da7b39dee21d3c9082e) )
2270
2271   ROM_REGION( 0x4800000, "user2", 0)
2272   ROM_LOAD("ic1", 0x0000000, 0x0800000, NO_DUMP )
2273   ROM_LOAD("ic2", 0x0800000, 0x0800000, NO_DUMP )
2274   ROM_LOAD("ic3", 0x1000000, 0x0800000, NO_DUMP )
2275   ROM_LOAD("ic4", 0x1800000, 0x0800000, NO_DUMP )
2276   ROM_LOAD("ic5", 0x2000000, 0x0800000, NO_DUMP )
2277   ROM_LOAD("ic6", 0x2800000, 0x0800000, NO_DUMP )
2278   ROM_LOAD("ic7", 0x3000000, 0x0800000, NO_DUMP )
2279   ROM_LOAD("ic8", 0x3800000, 0x0800000, NO_DUMP )
2280   ROM_LOAD("ic9", 0x4000000, 0x0800000, NO_DUMP )
2267   ROM_REGION( 0x5000000, "user1", 0)
2268   ROM_LOAD("epr-23127.ic22", 0x0000000, 0x0400000,  CRC(185761d6) SHA1(8c91b594dd59313d249c9da7b39dee21d3c9082e) )
2269   ROM_RELOAD( 0x400000, 0x400000)
2270   ROM_LOAD("mpr-23118.ic1", 0x0800000, 0x0800000, CRC(c69f3c3c) SHA1(e96ad24473197f8581f5e4398244b9b76957bfdd) )
2271   ROM_LOAD("mpr-23119.ic2", 0x1000000, 0x0800000, CRC(a80d444d) SHA1(a7d2a5831412134a26ba37bf83e5ce38eb9f3928) )
2272   ROM_LOAD("mpr-23120.ic3", 0x1800000, 0x0800000, CRC(c285dd64) SHA1(e64507caedb9f312ab291b41b8d7fe8922eb434e) )
2273   ROM_LOAD("mpr-23121.ic4", 0x2000000, 0x0800000, CRC(1f3f6505) SHA1(da5eb3b9b5c85f5f0b4afe0c0ee8d034108300a2) )
2274   ROM_LOAD("mpr-23122.ic5", 0x2800000, 0x0800000, CRC(5e403a12) SHA1(e71c15e63c30e60b6db1fcd2841f66490f31579a) )
2275   ROM_LOAD("mpr-23123.ic6", 0x3000000, 0x0800000, CRC(4b71078b) SHA1(f3ed39402f585ae5cf6f8987bf6be6c6d46eafa1) )
2276   ROM_LOAD("mpr-23124.ic7", 0x3800000, 0x0800000, CRC(508c0207) SHA1(e50d97a17cdd6771fbc63a254a4d638e7daa8f57) )
2277   ROM_LOAD("mpr-23125.ic8", 0x4000000, 0x0800000, CRC(b9938bbc) SHA1(d55d7adecb5a5a4a276a5a17c12808085d980fd9) )
2278   ROM_LOAD("mpr-23126.ic9", 0x4800000, 0x0800000, CRC(fbb0325b) SHA1(21b965519d7508d84344641d43e8af2c3ca29ba4) )
22812279ROM_END
22822280
22832281/*
r4499r4500
23182316   ROM_REGION( 0x200000, "maincpu", 0)
23192317   NAOMI_BIOS
23202318
2321   ROM_REGION( 0x400000, "user1", 0)
2322   ROM_LOAD("epr22163.22", 0x0000000, 0x0400000, CRC(3bdafb6a) SHA1(c4c5a4ba94d85c4353df22d70bb08be67e9c22c3) )
2323
2324   ROM_REGION( 0x9800000, "user2", 0)
2325   ROM_LOAD("ic1", 0x0000000, 0x0800000, NO_DUMP )
2326   ROM_LOAD("ic2", 0x0800000, 0x0800000, NO_DUMP )
2327   ROM_LOAD("ic3", 0x1000000, 0x0800000, NO_DUMP )
2328   ROM_LOAD("ic4", 0x1800000, 0x0800000, NO_DUMP )
2329   ROM_LOAD("ic5", 0x2000000, 0x0800000, NO_DUMP )
2330   ROM_LOAD("ic6", 0x2800000, 0x0800000, NO_DUMP )
2331   ROM_LOAD("ic7", 0x3000000, 0x0800000, NO_DUMP )
2332   ROM_LOAD("ic8", 0x3800000, 0x0800000, NO_DUMP )
2333   ROM_LOAD("ic9", 0x4000000, 0x0800000, NO_DUMP )
2334   ROM_LOAD("ic10",0x4800000, 0x0800000, NO_DUMP )
2335   ROM_LOAD("ic11",0x5000000, 0x0800000, NO_DUMP )
2336   ROM_LOAD("ic12",0x5800000, 0x0800000, NO_DUMP )
2337   ROM_LOAD("ic13",0x6000000, 0x0800000, NO_DUMP )
2338   ROM_LOAD("ic14",0x6800000, 0x0800000, NO_DUMP )
2339   ROM_LOAD("ic15",0x7000000, 0x0800000, NO_DUMP )
2340   ROM_LOAD("ic16",0x7800000, 0x0800000, NO_DUMP )
2341   ROM_LOAD("ic17",0x8000000, 0x0800000, NO_DUMP )
2342   ROM_LOAD("ic18",0x8800000, 0x0800000, NO_DUMP )
2343   ROM_LOAD("ic19",0x9000000, 0x0800000, NO_DUMP )
2319   ROM_REGION( 0xa000000, "user1", 0)
2320   ROM_LOAD("epr-22163.ic22", 0x0000000, 0x0400000, CRC(3bdafb6a) SHA1(c4c5a4ba94d85c4353df22d70bb08be67e9c22c3) )
2321   ROM_RELOAD( 0x400000, 0x400000)
2322   ROM_LOAD("mpr-22142.ic1", 0x0800000, 0x0800000, CRC(5b45fa35) SHA1(7d3fbecc6f0dce2b13bfb21ed68f44632b91b94b) )
2323   ROM_LOAD("mpr-22143.ic2", 0x1000000, 0x0800000, CRC(b43c4d6d) SHA1(77e0b37ca3ee94b7f77d88ccb14bd0469a76aac0) )
2324   ROM_LOAD("mpr-22144.ic3", 0x1800000, 0x0800000, CRC(e78581af) SHA1(d1fe4da3f16dd5ebc7d9eaa092de1e16ec9c3321) )
2325   ROM_LOAD("mpr-22145.ic4", 0x2000000, 0x0800000, CRC(2b6274ea) SHA1(89165cf84ebb02e99163624c6d31da38aeec000e) )
2326   ROM_LOAD("mpr-22146.ic5", 0x2800000, 0x0800000, CRC(c24eb03f) SHA1(2f4b720b4ab106f891f4469b6e93a9979b1c1061) )
2327   ROM_LOAD("mpr-22147.ic6", 0x3000000, 0x0800000, CRC(578e36fd) SHA1(f39f74b046efbff7e7baf70effdd368605da496f) )
2328   ROM_LOAD("mpr-22148.ic7", 0x3800000, 0x0800000, CRC(e6053373) SHA1(e7bafaffeac9b6851a3fce060be21e8be8eaa71e) )
2329   ROM_LOAD("mpr-22149.ic8", 0x4000000, 0x0800000, CRC(cc86691b) SHA1(624958bc07eef5fac98642e9acd460cd5fe0c815) )
2330   ROM_LOAD("mpr-22150.ic9", 0x4800000, 0x0800000, CRC(f585d41d) SHA1(335df3d3f2631e5c03c39465cd702b77ce3f9717) )
2331   ROM_LOAD("mpr-22151.ic10",0x5000000, 0x0800000, CRC(aae31a4b) SHA1(1472e477c2c6b89ca03824838757bdf20efbdf45) )
2332   ROM_LOAD("mpr-22152.ic11",0x5800000, 0x0800000, CRC(5ed2c5ea) SHA1(2b9237eda566ccb87b4914db61a03e2c9035a280) )
2333   ROM_LOAD("mpr-22153.ic12s",0x6000000, 0x0800000, CRC(16630b85) SHA1(10e926c0d13270b5bf99d7456fe63baafc2df56a) )
2334   ROM_LOAD("mpr-22154.ic13s",0x6800000, 0x0800000, CRC(30a2d60b) SHA1(6431b2d4e5106e25e5517707c9667bcd714f43ac) )
2335   ROM_LOAD("mpr-22155.ic14s",0x7000000, 0x0800000, CRC(163993a5) SHA1(351a626a0dc9a3030b10fc0b822075f3010fdc05) )
2336   ROM_LOAD("mpr-22156.ic15s",0x7800000, 0x0800000, CRC(37720b4f) SHA1(bd60beadb0081ed20610c3988577bbf37bfdab07) )
2337   ROM_LOAD("mpr-22157.ic16s",0x8000000, 0x0800000, CRC(dfd6fa83) SHA1(e0dc9606f5521af16c29a30378e81843c8dbc188) )
2338   ROM_LOAD("mpr-22158.ic17s",0x8800000, 0x0800000, CRC(f5d96fe9) SHA1(d5d0ac3d6b7c9b851a18b22d5fb599710c684a76) )
2339   ROM_LOAD("mpr-22159.ic18s",0x9000000, 0x0800000, CRC(f8b5e99d) SHA1(bb174a6a80967d0ff05c3a7512e4f0f9c921d130) )
2340   ROM_LOAD("mpr-22160.ic19s",0x9800000, 0x0800000, CRC(579eef4e) SHA1(bfcabd57f623647053afcedcabfbc74e5736819f) )
23442341ROM_END
23452342
23462343/*
r4499r4500
23752372   ROM_REGION( 0x200000, "maincpu", 0)
23762373   NAOMI_BIOS
23772374
2378   ROM_REGION( 0x400000, "user1", 0)
2379   ROM_LOAD("epr22966b.ic22", 0x0000000, 0x0400000,  CRC(893116b8) SHA1(35cb4f40690ff21af5ab7cc5adbc53228d6fb0b3) )
2380
2381   ROM_REGION( 0x8000000, "user2", 0)
2382   ROM_LOAD("ic1", 0x0000000, 0x0800000, NO_DUMP )
2383   ROM_LOAD("ic2", 0x0800000, 0x0800000, NO_DUMP )
2384   ROM_LOAD("ic3", 0x1000000, 0x0800000, NO_DUMP )
2385   ROM_LOAD("ic4", 0x1800000, 0x0800000, NO_DUMP )
2386   ROM_LOAD("ic5", 0x2000000, 0x0800000, NO_DUMP )
2387   ROM_LOAD("ic6", 0x2800000, 0x0800000, NO_DUMP )
2388   ROM_LOAD("ic7", 0x3000000, 0x0800000, NO_DUMP )
2389   ROM_LOAD("ic8", 0x3800000, 0x0800000, NO_DUMP )
2390   ROM_LOAD("ic9", 0x4000000, 0x0800000, NO_DUMP )
2391   ROM_LOAD("ic10",0x4800000, 0x0800000, NO_DUMP )
2392   ROM_LOAD("ic11",0x5000000, 0x0800000, NO_DUMP )
2393   ROM_LOAD("ic12",0x5800000, 0x0800000, NO_DUMP )
2394   ROM_LOAD("ic13",0x6000000, 0x0800000, NO_DUMP )
2395   ROM_LOAD("ic14",0x6800000, 0x0800000, NO_DUMP )
2396   ROM_LOAD("ic15",0x7000000, 0x0800000, NO_DUMP )
2397   ROM_LOAD("ic16",0x7800000, 0x0800000, NO_DUMP )
2375   ROM_REGION( 0x8800000, "user1", 0)
2376   ROM_LOAD("epr-22966b.ic22", 0x0000000, 0x0400000,  CRC(893116b8) SHA1(35cb4f40690ff21af5ab7cc5adbc53228d6fb0b3) )
2377   ROM_LOAD("mpr-22950.ic1", 0x0800000, 0x0800000, CRC(16dee15c) SHA1(b46849e492756ff406bf8956303472255fcf55a5) )
2378   ROM_LOAD("mpr-22951.ic2", 0x1000000, 0x0800000, CRC(f509496f) SHA1(41281576f7d58c8ede9c0a89bfd46a98d5b97033) )
2379   ROM_LOAD("mpr-22952.ic3", 0x1800000, 0x0800000, CRC(fb9b3ef0) SHA1(e9d44b673c273e97445a12186496a0594e291542) )
2380   ROM_LOAD("mpr-22953.ic4", 0x2000000, 0x0800000, CRC(07207ce0) SHA1(b802bb4e78f3737a4e333f819b9a4e0249037288) )
2381   ROM_LOAD("mpr-22954.ic5", 0x2800000, 0x0800000, CRC(c8e797d1) SHA1(fadbd1e24882787634229003245293ce79ba2617) )
2382   ROM_LOAD("mpr-22955.ic6", 0x3000000, 0x0800000, CRC(064ef007) SHA1(8325f9aa537ce329e71dce2b588a3d4fc176c37b) )
2383   ROM_LOAD("mpr-22956.ic7", 0x3800000, 0x0800000, CRC(fe8f2964) SHA1(3a33162f797cd93b7dbb313b531215e340719110) )
2384   ROM_LOAD("mpr-22957.ic8", 0x4000000, 0x0800000, CRC(74842c01) SHA1(b02884925270edb66831ab502a0aa2f9430adc9f) )
2385   ROM_LOAD("mpr-22958.ic9", 0x4800000, 0x0800000, CRC(b1ead447) SHA1(06b848eb7f592763768050a1ae82b4cac9499684) )
2386   ROM_LOAD("mpr-22959.ic10",0x5000000, 0x0800000, CRC(d32d7983) SHA1(86a9e5eae4598b6998f0ea578d6152e66c1a0df1) )
2387   ROM_LOAD("mpr-22960.ic11",0x5800000, 0x0800000, CRC(6c3b228e) SHA1(782c0fda106222be75b1973586c8bf78fd2186e7) )
2388   ROM_LOAD("mpr-22961.ic12s",0x6000000, 0x0800000, CRC(d6d26a8d) SHA1(7d416f8ac9fbbeb9bfe217ccc8eccf1644511110) )
2389   ROM_LOAD("mpr-22962.ic13s",0x6800000, 0x0800000, CRC(c2f41101) SHA1(0bf87cbffb7d6a5ab32543cef56c9759f475419a) )
2390   ROM_LOAD("mpr-22963.ic14s",0x7000000, 0x0800000, CRC(a53e9919) SHA1(d81eb79bc706f85ebfbc56a9b2889ae62d629e8e) )
2391   ROM_LOAD("mpr-22964.ic15s",0x7800000, 0x0800000, CRC(f581d5a3) SHA1(8cf769f5b0a48951246bb60e9cf58232bcee7bc8) )
2392   ROM_LOAD("mpr-22965.ic16s",0x8000000, 0x0800000, CRC(8f7bfa8a) SHA1(19f137b1552978d232785c4408805b71835585c6) )
23982393ROM_END
23992394
24002395/*
r4499r4500
24252420   ROM_REGION( 0x200000, "maincpu", 0)
24262421   NAOMI_BIOS
24272422
2428   ROM_REGION( 0x400000, "user1", 0)
2429   ROM_LOAD("epr22977b.22", 0x0000000, 0x0400000,  CRC(814ff5d1) SHA1(5a0a9e55878927f98750000eb7d9391cbecfe21d) )
2430
2431   ROM_REGION( 0x5000000, "user2", 0)
2432   ROM_LOAD("ic1", 0x0000000, 0x0800000, NO_DUMP )
2433   ROM_LOAD("ic2", 0x0800000, 0x0800000, NO_DUMP )
2434   ROM_LOAD("ic3", 0x1000000, 0x0800000, NO_DUMP )
2435   ROM_LOAD("ic4", 0x1800000, 0x0800000, NO_DUMP )
2436   ROM_LOAD("ic5", 0x2000000, 0x0800000, NO_DUMP )
2437   ROM_LOAD("ic6", 0x2800000, 0x0800000, NO_DUMP )
2438   ROM_LOAD("ic7", 0x3000000, 0x0800000, NO_DUMP )
2439   ROM_LOAD("ic8", 0x3800000, 0x0800000, NO_DUMP )
2440   ROM_LOAD("ic9", 0x4000000, 0x0800000, NO_DUMP )
2441   ROM_LOAD("ic10",0x4800000, 0x0800000, NO_DUMP )
2423   ROM_REGION( 0x5800000, "user1", 0)
2424   ROM_LOAD("epr-22977b.ic22", 0x0000000, 0x0400000,  CRC(814ff5d1) SHA1(5a0a9e55878927f98750000eb7d9391cbecfe21d) )
2425   ROM_LOAD("mpr-22967.ic1", 0x0800000, 0x0800000, CRC(78c7d914) SHA1(0a000e396f9a83c2c777cfb61212a82ec17417ba) )
2426   ROM_LOAD("mpr-22968.ic2", 0x1000000, 0x0800000, CRC(8c4ae1bb) SHA1(a91934a01d306c8fd8f987b3013f33aec028de70) )
2427   ROM_LOAD("mpr-22969.ic3", 0x1800000, 0x0800000, CRC(2928627c) SHA1(146844edd22b0caf00b40f7635c8753d5758e958) )
2428   ROM_LOAD("mpr-22970.ic4", 0x2000000, 0x0800000, CRC(12e27ffd) SHA1(d09096cd1ff9218cd849bfe05b34ec4d642e1663) )
2429   ROM_LOAD("mpr-22971.ic5", 0x2800000, 0x0800000, CRC(993d2bce) SHA1(f04e484704dbddbbff0f36ac5a019fbdde56d402) )
2430   ROM_LOAD("mpr-22972.ic6", 0x3000000, 0x0800000, CRC(e0f75067) SHA1(741ebef9e7ae6e5207f1819c3eea80491b934c63) )
2431   ROM_LOAD("mpr-22973.ic7", 0x3800000, 0x0800000, CRC(698498ca) SHA1(b3691409cbf644b8acea01abaebf7b2dea4dd4f7) )
2432   ROM_LOAD("mpr-22974.ic8", 0x4000000, 0x0800000, CRC(20983c51) SHA1(f7321abf8bf5f2a7329c98174e5cf9b1ebf596b2) )
2433   ROM_LOAD("mpr-22975.ic9", 0x4800000, 0x0800000, CRC(0d3c70d1) SHA1(22920bc5fd1dda760b5cb17482e9181be899bc08) )
2434   ROM_LOAD("mpr-22976.ic10",0x5000000, 0x0800000, CRC(092d8063) SHA1(14fafd3f4c4f2b37172453d1c815fb9b8f4814f4) )
24422435ROM_END
24432436
24442437/*
r4499r4500
25372530   NAOMI_BIOS
25382531
25392532   ROM_REGION( 0x8000000, "user1", 0)
2540   ROM_LOAD("epr21929c.22", 0x0000000, 0x0400000, CRC(831af08a) SHA1(af4c74623be823fd061765cede354c6a9722fd10) )
2541   ROM_LOAD("mpr21914.u1",  0x0800000, 0x0800000, CRC(f91ef69b) SHA1(4ed23091efad7ddf1878a0bfcdcbba3cf151af84) )
2542   ROM_LOAD("mpr21915.u2",  0x1000000, 0x0800000, CRC(40128a67) SHA1(9d191c4ec33465f29bbc09491dde62f354a9ab15) )
2543   ROM_LOAD("mpr21916.u3",  0x1800000, 0x0800000, CRC(19708b3c) SHA1(7d1ef995ce870ffcb68f420a571efb084f5bfcf2) )
2544   ROM_LOAD("mpr21917.u4",  0x2000000, 0x0800000, CRC(b082379b) SHA1(42f585279da1de7e613e42b76e1b81986c48e6ea) )
2545   ROM_LOAD("mpr21918.u5",  0x2800000, 0x0800000, CRC(a3bc1a47) SHA1(0e5043ab6e118feb59f68c84c095cf5b1dba7d09) )
2546   ROM_LOAD("mpr21919.u6",  0x3000000, 0x0800000, CRC(b1dfada7) SHA1(b4c906bc96b615975f6319a1fdbd5b990e7e4124) )
2547   ROM_LOAD("mpr21920.u7",  0x3800000, 0x0800000, CRC(1c189e28) SHA1(93400de2cb803357fa17ae7e1a5297177f9bcfa1) )
2548   ROM_LOAD("mpr21921.u8",  0x4000000, 0x0800000, CRC(55bcb652) SHA1(4de2e7e584dd4999dc8e405837a18a904dfee0bf) )
2549   ROM_LOAD("mpr21922.u9",  0x4800000, 0x0800000, CRC(2ecda3ff) SHA1(54afc77a01470662d580f5676b4e8dc4d04f63f8) )
2550   ROM_LOAD("mpr21923.u10", 0x5000000, 0x0800000, CRC(a5cd42ad) SHA1(59f62e995d45311b1592434d1ffa42c261fa8ba1) )
2551   ROM_LOAD("mpr21924.u11", 0x5800000, 0x0800000, CRC(cc1a4ed9) SHA1(0e3aaeaa55f1d145fb4877b6d187a3ee78cf214e) )
2552   ROM_LOAD("mpr21925.u12", 0x6000000, 0x0800000, CRC(9452c5fb) SHA1(5a04f96d83cca6248f513de0c6240fc671bcadf9) )
2553   ROM_LOAD("mpr21926.u13", 0x6800000, 0x0800000, CRC(d6346491) SHA1(830971cbc14cab022a09ad4c6e11ee49c550e308) )
2554   ROM_LOAD("mpr21927.u14", 0x7000000, 0x0800000, CRC(a1901e1e) SHA1(2281f91ac696cc14886bcdf4b0685ce2f5bb8117) )
2555   ROM_LOAD("mpr21928.u15", 0x7800000, 0x0400000, CRC(d127d9a5) SHA1(78c95357344ea15469b84fa8b1332e76521892cd) )
2533   ROM_LOAD("epr-21929.ic22", 0x0000000, 0x0400000, CRC(831af08a) SHA1(af4c74623be823fd061765cede354c6a9722fd10) )
2534   ROM_LOAD("mpr-21924.ic1",  0x0800000, 0x0800000, CRC(f91ef69b) SHA1(4ed23091efad7ddf1878a0bfcdcbba3cf151af84) )
2535   ROM_LOAD("mpr-21925.ic2",  0x1000000, 0x0800000, CRC(40128a67) SHA1(9d191c4ec33465f29bbc09491dde62f354a9ab15) )
2536   ROM_LOAD("mpr-21911.ic3",  0x1800000, 0x0800000, CRC(19708b3c) SHA1(7d1ef995ce870ffcb68f420a571efb084f5bfcf2) )
2537   ROM_LOAD("mpr-21926.ic4",  0x2000000, 0x0800000, CRC(b082379b) SHA1(42f585279da1de7e613e42b76e1b81986c48e6ea) )
2538   ROM_LOAD("mpr-21913.ic5",  0x2800000, 0x0800000, CRC(a3bc1a47) SHA1(0e5043ab6e118feb59f68c84c095cf5b1dba7d09) )
2539   ROM_LOAD("mpr-21914.ic6",  0x3000000, 0x0800000, CRC(b1dfada7) SHA1(b4c906bc96b615975f6319a1fdbd5b990e7e4124) )
2540   ROM_LOAD("mpr-21915.ic7",  0x3800000, 0x0800000, CRC(1c189e28) SHA1(93400de2cb803357fa17ae7e1a5297177f9bcfa1) )
2541   ROM_LOAD("mpr-21916.ic8",  0x4000000, 0x0800000, CRC(55bcb652) SHA1(4de2e7e584dd4999dc8e405837a18a904dfee0bf) )
2542   ROM_LOAD("mpr-21917.ic9",  0x4800000, 0x0800000, CRC(2ecda3ff) SHA1(54afc77a01470662d580f5676b4e8dc4d04f63f8) )
2543   ROM_LOAD("mpr-21918.ic10", 0x5000000, 0x0800000, CRC(a5cd42ad) SHA1(59f62e995d45311b1592434d1ffa42c261fa8ba1) )
2544   ROM_LOAD("mpr-21919.ic11", 0x5800000, 0x0800000, CRC(cc1a4ed9) SHA1(0e3aaeaa55f1d145fb4877b6d187a3ee78cf214e) )
2545   ROM_LOAD("mpr-21920.ic12s", 0x6000000, 0x0800000, CRC(9452c5fb) SHA1(5a04f96d83cca6248f513de0c6240fc671bcadf9) )
2546   ROM_LOAD("mpr-21921.ic13s", 0x6800000, 0x0800000, CRC(d6346491) SHA1(830971cbc14cab022a09ad4c6e11ee49c550e308) )
2547   ROM_LOAD("mpr-21922.ic14s", 0x7000000, 0x0800000, CRC(a1901e1e) SHA1(2281f91ac696cc14886bcdf4b0685ce2f5bb8117) )
2548   ROM_LOAD("mpr-21923.ic15s", 0x7800000, 0x0400000, CRC(d127d9a5) SHA1(78c95357344ea15469b84fa8b1332e76521892cd) )
25562549ROM_END
25572550
25582551/* Sega Marine Fishing */
r4499r4500
27692762/*
27702763
27712764SYSTEMID: NAOMI
2765JAP: THE TYPING OF THE DEAD
2766USA: THE TYPING OF THE DEAD
2767EXP: THE TYPING OF THE DEAD
2768
2769*/
2770
2771ROM_START( totd )
2772   ROM_REGION( 0x200000, "maincpu", 0)
2773   NAOMI_BIOS
2774
2775   ROM_REGION( 0xb000000, "user1", 0)
2776   ROM_LOAD("epr-23021a.ic22", 0x0000000, 0x0400000,  CRC(07d21033) SHA1(d1e619d13c1c01648eb1a6964aad1554dd16c6d5) )
2777
2778   ROM_LOAD("mpr-23001.ic1", 0x0800000, 0x0800000, CRC(2eaab8ed) SHA1(e078bd8781e2a04e23fd18b11d118b2548fa59a8) )
2779   ROM_LOAD("mpr-23002.ic2", 0x1000000, 0x0800000, CRC(617edcc7) SHA1(10f92cd9be94739c7c2f94cf9a5fa54accbe6227) )
2780   ROM_LOAD("mpr-23003.ic3", 0x1800000, 0x0800000, CRC(37d6d9f8) SHA1(3ad3fa65f33d250eb8a620e7dc7c6b1209794a80) )
2781   ROM_LOAD("mpr-23004.ic4", 0x2000000, 0x0800000, CRC(e41186f2) SHA1(2f4b26d8dba1629db539736cf88ec85c21820aeb) )
2782   ROM_LOAD("mpr-23005.ic5", 0x2800000, 0x0800000, CRC(2b8e1fc6) SHA1(a5cd8c5840dd316dd1ad9500804b459476ca8ba0) )
2783   ROM_LOAD("mpr-23006.ic6", 0x3000000, 0x0800000, CRC(3de23e27) SHA1(d3aae2a7e5c78fc3bf8e296392d8f893961d946f) ) //not populated
2784   ROM_LOAD("mpr-23007.ic7", 0x3800000, 0x0800000, CRC(ca16cfdf) SHA1(6279bc9bd661bde2d3e36ca52625f9b91867c4b4) )
2785   ROM_LOAD("mpr-23008.ic8", 0x4000000, 0x0800000, CRC(8c33191c) SHA1(6227fbb3d51c4301dd1fc60ec43df7c18eef06fa) )
2786   ROM_LOAD("mpr-23009.ic9", 0x4800000, 0x0800000, CRC(c982d24d) SHA1(d5a15d04f19f5569709b0b1cde64814230f4f0bb) )
2787   ROM_LOAD("mpr-23010.ic10",0x5000000, 0x0800000, CRC(c6e129b4) SHA1(642a9e1052efcb43d2b809f13d10617b43bd38f3) )
2788   ROM_LOAD("mpr-23011.ic11",0x5800000, 0x0800000, CRC(9e6942ff) SHA1(8c657d7d74c4c9106756a9934bc3c850f5069e29) )
2789   ROM_LOAD("mpr-23012.ic12s",0x6000000, 0x0800000, CRC(20e1ebe8) SHA1(e24cb5f48101e665c90af9be333e54ec274004fb) )
2790   ROM_LOAD("mpr-23013.ic13s",0x6800000, 0x0800000, CRC(3de23e27) SHA1(d3aae2a7e5c78fc3bf8e296392d8f893961d946f) ) //not populated
2791   ROM_LOAD("mpr-23014.ic14s",0x7000000, 0x0800000, CRC(c4f95fdb) SHA1(8c0e806e27d7bed274dcb20b932897ea8b8bbf86) )
2792   ROM_LOAD("mpr-23015.ic15s",0x7800000, 0x0800000, CRC(5360c49d) SHA1(dbdf955d9bb9a387ded8ada18d26d222d73514d7) )
2793   ROM_LOAD("mpr-23016.ic16s",0x8000000, 0x0800000, CRC(fae2958b) SHA1(2bfe164723b7b2f57ae0c6e2fe348459f00dc460) )
2794   ROM_LOAD("mpr-23017.ic17s",0x8800000, 0x0800000, CRC(22337e15) SHA1(6a9f5569177c2936d8ff04da74e1fd036a093422) )
2795   ROM_LOAD("mpr-23018.ic18s",0x9000000, 0x0800000, CRC(5a608e74) SHA1(4f2ec47dad71d77ad1b8c640db236332c06d7ab7) )
2796   ROM_LOAD("mpr-23019.ic19s",0x9800000, 0x0800000, CRC(5cc91cc4) SHA1(66a68991f716ec23555784163aa5140b4e44c7ab) )
2797   ROM_LOAD("mpr-23020.ic20s",0xa000000, 0x0800000, CRC(b5943007) SHA1(d0e95084aec5e05027c21a6b4a3331408853781b) )
2798   //ic21 not populated
2799ROM_END
2800
2801/*
2802
2803SYSTEMID: NAOMI
27722804JAP: DYNAMITE BASEBALL NAOMI
27732805USA: SAMPLE GAME IN USA--------
27742806EXP: SAMPLE GAME
r4499r4500
29753007GAME( 2000, doa2m,    doa2,     naomi,    naomi,    0, ROT0, "Tecmo",           "Dead or Alive 2 Millennium (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
29763008GAME( 1999, vtennis,  naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Power Smash (JPN) / Virtua Tennis (USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
29773009GAME( 2000, slasho,   naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Slashout (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
3010GAME( 2000, totd,     naomi,    naomi,    naomi,    0, ROT0, "Sega",            "The Typing of the Dead (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
3011GAME( 1999, otrigger, naomi,    naomi,    naomi,    0, ROT0, "Sega",            "OutTrigger (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
3012GAME( 1999, spawn,    naomi,    naomi,    naomi,    0, ROT0, "Capcom",          "Spawn (JPN, USA, EUR, ASI, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
3013GAME( 1999, samba,    naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Samba De Amigo (JPN)", GAME_NO_SOUND|GAME_NOT_WORKING )
3014GAME( 1999, pstone,   naomi,    naomi,    naomi,    0, ROT0, "Capcom",          "Power Stone (JPN, USA, EUR, ASI, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
3015GAME( 2000, pstone2,  naomi,    naomi,    naomi,    0, ROT0, "Capcom",          "Power Stone 2 (JPN, USA, EUR, ASI, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
3016GAME( 2001, hmgeo,    naomi,    naomi,    naomi,    0, ROT0, "Capcom",          "Heavy Metal Geomatrix (JPN, USA, EUR, ASI, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
3017GAME( 2000, cspike,   naomi,    naomi,    naomi,    0, ROT0, "Psikyo / Capcom", "Gun Spike (JPN) / Cannon Spike (USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
29783018
2979
29803019/* Incomplete Dumps (just the program rom IC22) */
2981GAME( 2000, cspike,   naomi,    naomi,    naomi,    0, ROT0, "Psikyo / Capcom", "Gun Spike (JPN) / Cannon Spike (USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
29823020GAME( 2000, capsnk,   naomi,    naomi,    naomi,    0, ROT0, "Capcom / SNK",    "Capcom Vs. SNK Millennium Fight 2000 (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
29833021GAME( 1999, derbyoc,  naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Derby Owners Club (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
29843022GAME( 1998, dybb99,   naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Dynamite Baseball '99 (JPN) / World Series '99 (USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
29853023GAME( 2000, gram2000, naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Giant Gram 2000 (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
29863024GAME( 1999, ggram2,   naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Giant Gram (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING ) // strings in rom don't contain '2'
2987GAME( 2001, hmgeo,    naomi,    naomi,    naomi,    0, ROT0, "Capcom",          "Heavy Metal Geomatrix (JPN, USA, EUR, ASI, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
29883025GAME( 2000, gwing2,   naomi,    naomi,    naomi,    0, ROT0, "Takumi / Capcom", "Giga Wing 2 (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
29893026GAME( 2000, pjustic,  naomi,    naomi,    naomi,    0, ROT0, "Capcom",          "Moero Justice Gakuen (JPN) / Project Justice (USA, EXP, KOR, AUS) ", GAME_NO_SOUND|GAME_NOT_WORKING )
2990GAME( 1999, pstone,   naomi,    naomi,    naomi,    0, ROT0, "Capcom",          "Power Stone (JPN, USA, EUR, ASI, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2991GAME( 2000, pstone2,  naomi,    naomi,    naomi,    0, ROT0, "Capcom",          "Power Stone 2 (JPN, USA, EUR, ASI, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2992GAME( 1999, otrigger, naomi,    naomi,    naomi,    0, ROT0, "Sega",            "OutTrigger (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
2993GAME( 1999, samba,    naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Samba De Amigo (JPN)", GAME_NO_SOUND|GAME_NOT_WORKING )
2994GAME( 1999, spawn,    naomi,    naomi,    naomi,    0, ROT0, "Capcom",          "Spawn (JPN, USA, EUR, ASI, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
29953027GAME( 2000, virnba,   naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Virtua NBA (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
29963028GAME( 1999, zombrvn,  naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Zombie Revenge (JPN, USA, EXP, KOR, AUS)", GAME_NO_SOUND|GAME_NOT_WORKING )
29973029GAME( 1998, dybbnao,  naomi,    naomi,    naomi,    0, ROT0, "Sega",            "Dynamite Baseball NAOMI (JPN)", GAME_NO_SOUND|GAME_NOT_WORKING )
r4499r4500
38533885
38543886
38553887/* Naomi GD-Rom Sets */
3856GAME( 2001, naomigd,   0,        naomi,    naomi, naomigd,       ROT0, "Sega",           "Naomi GD-ROM Bios", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT )
3888GAME( 2001, naomigd,   0,        naomi,    naomi, naomigd,   ROT0,   "Sega",             "Naomi GD-ROM Bios", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT )
38573889
3858// GDL-xxxx (licensed games?)
3890/* GDL-xxxx ("licensed by Sega" games) */
38593891GAME( 2001, gundmgd,   naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Capcom",           "Mobile Suit Gundam: Federation VS Zeon (GDL-0001)", GAME_NO_SOUND|GAME_NOT_WORKING )
38603892GAME( 2001, sfz3ugd,   naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Capcom",           "Street Fighter Zero 3 Upper (GDL-0002)", GAME_NO_SOUND|GAME_NOT_WORKING )
3861GAME( 2001, cvsgd,     naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Capcom",           "Capcom vs SNK Millenium Fight 2000 Pro (GDL-0004)", GAME_NO_SOUND|GAME_NOT_WORKING )
3893//GDL-0003
3894GAME( 2001, cvsgd,     naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Capcom / SNK",     "Capcom vs SNK Millenium Fight 2000 Pro (GDL-0004)", GAME_NO_SOUND|GAME_NOT_WORKING )
3895//GDL-0005 Doki Doki Idol Star Seeker
38623896GAME( 2001, gundmxgd,  naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Capcom",           "Mobile Suit Gundam: Federation VS Zeon DX  (GDL-0006)", GAME_NO_SOUND|GAME_NOT_WORKING )
3863GAME( 2001, cvs2gd,    naomigd,  naomigd,  naomi, naomigd,    ROT0,   "Capcom",           "Capcom vs SNK 2 Millionaire Fighting 2001 (Rev A) (GDL-0007A)", GAME_NO_SOUND|GAME_NOT_WORKING )
3897//GDL-0007 Capcom vs SNK 2
3898GAME( 2001, cvs2gd,    naomigd,  naomigd,  naomi, naomigd,    ROT0,   "Capcom / SNK",     "Capcom vs SNK 2 Millionaire Fighting 2001 (Rev A) (GDL-0007A)", GAME_NO_SOUND|GAME_NOT_WORKING )
3899//GDL-0008 Capcom vs SNK 2 Mark Of The Millenium 2001 (Export)
3900//GDL-0009
38643901GAME( 2001, ikaruga,   naomigd,  naomigd,  naomi, naomigd,   ROT270, "Treasure",         "Ikaruga (GDL-0010)", GAME_NO_SOUND|GAME_NOT_WORKING )
38653902GAME( 2002, ggxx,      naomigd,  naomigd,  naomi, ggxx,      ROT0,   "Arc System Works", "Guilty Gear XX (GDL-0011)", GAME_NO_SOUND|GAME_NOT_WORKING )
3903//GDL-0012 Cleopatra Fortune Plus
38663904GAME( 2002, moeru,     naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Altron",          "Moeru Casinyo (GDL-0013)", GAME_NO_SOUND|GAME_NOT_WORKING )
3905//GDL-0014 Musapey's Choco Marker
38673906GAME( 2002, chocomk,   naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Ecole Software",   "Musapey's Choco Marker (Rev A) (GDL-0014A)", GAME_NO_SOUND|GAME_NOT_WORKING )
3868GAME( 2002, quizqgd,   naomigd,  naomigd,  naomi, naomigd,   ROT270, "Amedio",           "Quiz Keitai Q mode (GDL-0017)", GAME_NO_SOUND|GAME_NOT_WORKING )
3907//GDL-0015 Mazan
3908//GDL-0016 Yonin Uchi Mahjong MJ
3909GAME( 2002, quizqgd,   naomigd,  naomigd,  naomi, naomigd,   ROT270, "Amedio (Taito license)", "Quiz Keitai Q mode (GDL-0017)", GAME_NO_SOUND|GAME_NOT_WORKING )
3910//GDL-0018 Azumanga Daioh Puzzle Bobble
3911//GDL-0019 Guilty Gear XX #Reload
38693912GAME( 2003, ggxxrl,    naomigd,  naomigd,  naomi, ggxxrl,    ROT0,   "Arc System Works", "Guilty Gear XX #Reload (Rev A) (GDL-0019A)", GAME_NO_SOUND|GAME_NOT_WORKING )
38703913GAME( 200?, tetkiwam,  naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Success",          "Tetris Kiwamemichi (GDL-0020)", GAME_NO_SOUND|GAME_NOT_WORKING )
38713914GAME( 2003, shikgam2,  naomigd,  naomigd,  naomi, naomigd,   ROT270, "Alpha System",     "Shikigami No Shiro II / The Castle of Shikigami II (GDL-0021)", GAME_NO_SOUND|GAME_NOT_WORKING )
38723915GAME( 2003, usagui,    naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Warashi",          "Usagui - Yamashiro Mahjong Hen (GDL-0022)", GAME_NO_SOUND|GAME_NOT_WORKING )
3916//GDL-0023 Border Down
38733917GAME( 2004, bdrdown,   naomigd,  naomigd,  naomi, naomigd,   ROT0,   "G-Rev",            "Border Down (Rev A) (GDL-0023A)", GAME_NO_SOUND|GAME_NOT_WORKING )
38743918GAME( 2003, psyvar2,   naomigd,  naomigd,  naomi, naomigd,   ROT270, "G-Rev",            "Psyvariar 2 - The Will To Fabricate (GDL-0024)", GAME_NO_SOUND|GAME_NOT_WORKING )
38753919GAME( 2004, cfield,    naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Able",             "Chaos Field (GDL-0025)", GAME_NO_SOUND|GAME_NOT_WORKING )
38763920GAME( 2004, trizeal,   naomigd,  naomigd,  naomi, naomigd,   ROT270, "Taito",            "Trizeal (GDL-0026)", GAME_NO_SOUND|GAME_NOT_WORKING )
3877GAME( 2005, meltybld,  naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Ecole Software",   "Melty Blood Act Cadenza (Rev C) (GDL-0028C)", GAME_NO_SOUND|GAME_NOT_WORKING )
3921//GDL-0027 Melty Blood Act Cadenza?
3922//GDL-0028  Melty Blood Act Cadenza Ver A
3923//GDL-0028A Melty Blood Act Cadenza Ver A (Rev A)
3924//GDL-0028B Melty Blood Act Cadenza Ver A (Rev B)
3925GAME( 2005, meltybld,  naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Ecole Software",   "Melty Blood Act Cadenza Ver A (Rev C) (GDL-0028C)", GAME_NO_SOUND|GAME_NOT_WORKING )
3926//GDL-0029
38783927GAME( 2005, senko,     naomigd,  naomigd,  naomi, naomigd,   ROT0,   "G-Rev",            "Senko No Ronde NEW ver. (Rev A) (GDL-0030A)", GAME_NO_SOUND|GAME_NOT_WORKING )
38793928GAME( 2005, senkoo,    senko,    naomigd,  naomi, naomigd,   ROT0,   "G-Rev",            "Senko No Ronde (GDL-0030)", GAME_NO_SOUND|GAME_NOT_WORKING )
3929//GDL-0031 Super Shanghai 2005
38803930GAME( 2005, ss2005,    naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Starfish",         "Super Shanghai 2005 (Rev A) (GDL-0031A)", GAME_NO_SOUND|GAME_NOT_WORKING )
38813931GAME( 2005, radirgy,   naomigd,  naomigd,  naomi, naomigd,   ROT270, "Milestone",        "Radirgy (GDL-0032)", GAME_NO_SOUND|GAME_NOT_WORKING )
3932//GDL-0033 Guilty Gear XX Slash
38823933GAME( 2005, ggxxsla,   naomigd,  naomigd,  naomi, ggxxsla,   ROT0,   "Arc System Works", "Guilty Gear XX Slash (Rev A) (GDL-0033A)", GAME_NO_SOUND|GAME_NOT_WORKING )
38833934GAME( 2006, kurucham,  naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Able",             "Kurukuru Chameleon (GDL-0034)", GAME_NO_SOUND|GAME_NOT_WORKING )
38843935GAME( 2005, undefeat,  naomigd,  naomigd,  naomi, naomigd,   ROT270, "G-Rev",            "Under Defeat (GDL-0035)", GAME_NO_SOUND|GAME_NOT_WORKING )
3936//GDL-0036 Trigger Heart Exelica
38853937GAME( 2005, trgheart,  naomigd,  naomigd,  naomi, naomigd,   ROT270, "Warashi",          "Trigger Heart Exelica (Rev A) (GDL-0036A)", GAME_NO_SOUND|GAME_NOT_WORKING )
38863938GAME( 2005, jingystm,  naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Atrativa Japan",   "Jingi Storm - The Arcade (GDL-0037)", GAME_NO_SOUND|GAME_NOT_WORKING )
3939//GDL-0038 Senko No Ronde Special
38873940GAME( 2006, meltyb,    naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Ecole Software",   "Melty Blood Act Cadenza Ver B (GDL-0039)", GAME_NO_SOUND|GAME_NOT_WORKING )
38883941GAME( 2006, meltyba,   meltyb,   naomigd,  naomi, naomigd,   ROT0,   "Ecole Software",   "Melty Blood Act Cadenza Ver B (Rev A) (GDL-0039A)", GAME_NO_SOUND|GAME_NOT_WORKING )
38893942GAME( 2006, karous,    naomigd,  naomigd,  naomi, naomigd,   ROT270, "Milestone",        "Karous (GDL-0040)", GAME_NO_SOUND|GAME_NOT_WORKING )
3943//GDL-0041 Guilty Gear XX Accent Core
38903944GAME( 2006, takoron,   naomigd,  naomigd,  naomi, naomigd,   ROT0,   "Compile",          "Noukone Puzzle Takoron (GDL-0042)", GAME_NO_SOUND|GAME_NOT_WORKING )
38913945
38923946
3893
3894
3895
3896// GDS-xxxx (first party games?)
3947/* GDS-xxxx (Sega first party games) */
38973948GAME( 2001, confmiss,  naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Confidential Mission (GDS-0001)", GAME_NO_SOUND|GAME_NOT_WORKING )
3949//GDS-0002 Shakatto Tambourine
38983950GAME( 2000, sprtjam,   naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Sports Jam (GDS-0003)", GAME_NO_SOUND|GAME_NOT_WORKING )
38993951GAME( 2000, slashout,  naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Slashout (GDS-0004)", GAME_NO_SOUND|GAME_NOT_WORKING )
39003952GAME( 2001, spkrbtl,   naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Spikers Battle (GDS-0005)", GAME_NO_SOUND|GAME_NOT_WORKING )
3953//GDS-0006 Virtua Striker 3 (NAOMI 2)
3954//GDS-0007 Shakatto Tambourine Motto Norinori Shinkyoku Tsuika
39013955GAME( 2001, monkeyba,  naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Monkey Ball (GDS-0008)", GAME_NO_SOUND|GAME_NOT_WORKING )
39023956GAME( 2001, dygolf,    naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Virtua Golf / Dynamic Golf (GDS-0009)", GAME_NO_SOUND|GAME_NOT_WORKING )
39033957GAME( 2001, wsbbgd,    naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "World Series Baseball / Super Major League (GDS-0010)", GAME_NO_SOUND|GAME_NOT_WORKING )
39043958GAME( 2001, vtennisg,  naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Virtua Tennis (GDS-0011)", GAME_NO_SOUND|GAME_NOT_WORKING )
3905GAME( 2002, vathlete,  naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Virtua Athletics / Virtua Athlete (GDS-0019)", GAME_NO_SOUND|GAME_NOT_WORKING )
3959//GDS-0012 Virtua Fighter 4 (NAOMI 2)
3960//GDS-0013
3961//GDS-0014 Beach Spikers (NAOMI 2)
3962//GDS-0015 Virtua Tennis 2 / Power Smash 2
39063963GAME( 2001, vtennis2,  naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Virtua Tennis 2 (Rev A) (GDS-0015A)", GAME_NO_SOUND|GAME_NOT_WORKING )
3964//GDS-0016 Shakatto Tambourine Cho Powerup Chu
39073965GAME( 2001, keyboard,  naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "La Keyboardxyu (GDS-0017)", GAME_NO_SOUND|GAME_NOT_WORKING )
39083966GAME( 2001, lupinsho,  naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Lupin The Third - The Shooting (GDS-0018)", GAME_NO_SOUND|GAME_NOT_WORKING )
3967GAME( 2002, vathlete,  naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Virtua Athletics / Virtua Athlete (GDS-0019)", GAME_NO_SOUND|GAME_NOT_WORKING )
3968//GDS-0020 Initial D Arcade Stage (Japan) (NAOMI 2)
3969//GDS-0021 Lupin The Third - The Typing
39093970GAME( 2002, luptype,   naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Lupin The Third - The Typing (Rev A) (GDS-0021A)", GAME_NO_SOUND|GAME_NOT_WORKING )
39103971GAME( 2002, mok,       naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "The Maze of the Kings (GDS-0022)", GAME_NO_SOUND|GAME_NOT_WORKING )
3911GAME( 2001, ngdup23a,  naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Naomi DIMM Firmware Updater (GDL-0023A)", GAME_NO_SOUND|GAME_NOT_WORKING )
3912GAME( 2001, ngdup23c,  naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Naomi DIMM Firmware Updater (GDL-0023C)", GAME_NO_SOUND|GAME_NOT_WORKING )
3972//GDS-0023 Naomi DIMM Firmware Updater
3973GAME( 2001, ngdup23a,  naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Naomi DIMM Firmware Updater (GDS-0023A)", GAME_NO_SOUND|GAME_NOT_WORKING )
3974//GDS-0023B Naomi DIMM Firmware Updater
3975GAME( 2001, ngdup23c,  naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Naomi DIMM Firmware Updater (GDS-0023C)", GAME_NO_SOUND|GAME_NOT_WORKING )
3976//GDS-0024 Virtua Fighter 4 Evolution (NAOMI 2)
3977//GDS-0025 Initial D Arcade Stage (Export) (NAOMI 2)
3978//GDS-0026 Initial D Arcade Stage Ver. 2 (Japan) (NAOMI 2)
3979//GDS-0027 Initial D Arcade Stage Ver. 2 (Export) (NAOMI 2)
3980//GDS-0028
3981//GDS-0029
3982//GDS-0030
39133983GAME( 2003, puyofev,   naomigd,  naomigd,  naomi, naomigd,  ROT0, "Sega",          "Puyo Puyo Fever (GDS-0031)", GAME_NO_SOUND|GAME_NOT_WORKING )
3984//GDS-0032 Initial D Arcade Stage Ver. 3 (Japan)
3985//GDS-0033 Initial D Arcade Stage Ver. 3 (Export)
3986//GDS-0034
3987//GDS-0035
3988//GDS-0036 Virtua Fighter 4 Final Tuned
3989//GDS-0037? Puyo Puyo Fever (Export)
39143990
3991
39153992/* Naomi 2 & Naomi 2 GD-ROM */
39163993
39173994ROM_START( vstrik3c )
src/mame/drivers/warriorb.c
r4499r4500
225225   AM_RANGE(0x400000, 0x400007) AM_READWRITE(TC0110PCR_word_r, TC0110PCR_step1_word_w)      /* palette (1st screen) */
226226   AM_RANGE(0x420000, 0x420007) AM_READWRITE(TC0110PCR_word_1_r, TC0110PCR_step1_word_1_w)   /* palette (2nd screen) */
227227   AM_RANGE(0x600000, 0x6013ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
228   AM_RANGE(0x800000, 0x80000f) AM_READWRITE(TC0220IOC_halfword_r, TC0220IOC_halfword_w)
228   AM_RANGE(0x800000, 0x80000f) AM_READWRITE8(TC0220IOC_r, TC0220IOC_w, 0x00ff)
229229//  AM_RANGE(0x820000, 0x820001) AM_WRITENOP    // ???
230230   AM_RANGE(0x830000, 0x830003) AM_READWRITE(warriorb_sound_r, warriorb_sound_w)
231231ADDRESS_MAP_END
src/mame/drivers/taito_h.c
r4499r4500
177177
178178***************************************************************************/
179179
180static READ16_HANDLER( taitoh_mirrorram_r )
181{
182   /* This is a read handler of main RAM mirror. */
183   return taitoh_68000_mainram[offset];
184}
185
186180#define P1TRACKX_PORT_TAG     "P1X"
187181#define P1TRACKY_PORT_TAG     "P1Y"
188182#define P2TRACKX_PORT_TAG     "P2X"
189183#define P2TRACKY_PORT_TAG     "P2Y"
190184
191static READ16_HANDLER( syvalion_input_bypass_r )
185static READ8_HANDLER( syvalion_input_bypass_r )
192186{
193187   /* Bypass TC0220IOC controller for analog input */
194188
r4499r4500
258252
259253***************************************************************************/
260254
261static ADDRESS_MAP_START( syvalion_readmem, ADDRESS_SPACE_PROGRAM, 16 )
262   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
263   AM_RANGE(0x100000, 0x10ffff) AM_READ(SMH_RAM)            /* 68000 RAM */
264   AM_RANGE(0x110000, 0x11ffff) AM_READ(taitoh_mirrorram_r)      /* 68000 RAM (Mirror) */
265   AM_RANGE(0x200000, 0x200001) AM_READ(syvalion_input_bypass_r)
266   AM_RANGE(0x200002, 0x200003) AM_READ(TC0220IOC_halfword_port_r)
267   AM_RANGE(0x300000, 0x300001) AM_READNOP
268   AM_RANGE(0x300002, 0x300003) AM_READ8(taitosound_comm_r, 0x00ff)
269   AM_RANGE(0x400000, 0x420fff) AM_READ(TC0080VCO_word_r)
270   AM_RANGE(0x500800, 0x500fff) AM_READ(SMH_RAM)
255static ADDRESS_MAP_START( syvalion_map, ADDRESS_SPACE_PROGRAM, 16 )
256   AM_RANGE(0x000000, 0x07ffff) AM_ROM
257   AM_RANGE(0x100000, 0x10ffff) AM_MIRROR(0x010000) AM_RAM AM_BASE(&taitoh_68000_mainram)
258   AM_RANGE(0x200000, 0x200001) AM_READWRITE8(syvalion_input_bypass_r, TC0220IOC_portreg_w, 0x00ff)
259   AM_RANGE(0x200002, 0x200003) AM_READWRITE8(TC0220IOC_port_r, TC0220IOC_port_w, 0x00ff)
260   AM_RANGE(0x300000, 0x300001) AM_READNOP AM_WRITE8(taitosound_port_w, 0x00ff)
261   AM_RANGE(0x300002, 0x300003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0x00ff)
262   AM_RANGE(0x400000, 0x420fff) AM_READWRITE(TC0080VCO_word_r, TC0080VCO_word_w)
263   AM_RANGE(0x500800, 0x500fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
271264ADDRESS_MAP_END
272265
273static ADDRESS_MAP_START( syvalion_writemem, ADDRESS_SPACE_PROGRAM, 16 )
274   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
275   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM) AM_BASE(&taitoh_68000_mainram)
276   AM_RANGE(0x200000, 0x200001) AM_WRITE(TC0220IOC_halfword_portreg_w)
277   AM_RANGE(0x200002, 0x200003) AM_WRITE(TC0220IOC_halfword_port_w)
278   AM_RANGE(0x300000, 0x300001) AM_WRITE8(taitosound_port_w, 0x00ff)
279   AM_RANGE(0x300002, 0x300003) AM_WRITE8(taitosound_comm_w, 0x00ff)
280   AM_RANGE(0x400000, 0x420fff) AM_WRITE(TC0080VCO_word_w)
281   AM_RANGE(0x500800, 0x500fff) AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
266static ADDRESS_MAP_START( recordbr_map, ADDRESS_SPACE_PROGRAM, 16 )
267   AM_RANGE(0x000000, 0x07ffff) AM_ROM
268   AM_RANGE(0x100000, 0x10ffff) AM_MIRROR(0x010000) AM_RAM AM_BASE(&taitoh_68000_mainram)
269   AM_RANGE(0x200000, 0x200001) AM_READWRITE8(TC0220IOC_portreg_r, TC0220IOC_portreg_w, 0x00ff)
270   AM_RANGE(0x200002, 0x200003) AM_READWRITE8(TC0220IOC_port_r, TC0220IOC_port_w, 0x00ff)
271   AM_RANGE(0x300000, 0x300001) AM_READNOP AM_WRITE8(taitosound_port_w, 0x00ff)
272   AM_RANGE(0x300002, 0x300003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0x00ff)
273   AM_RANGE(0x400000, 0x420fff) AM_READWRITE(TC0080VCO_word_r, TC0080VCO_word_w)
274   AM_RANGE(0x500800, 0x500fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
282275ADDRESS_MAP_END
283276
284static ADDRESS_MAP_START( recordbr_readmem, ADDRESS_SPACE_PROGRAM, 16 )
285   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
286   AM_RANGE(0x100000, 0x10ffff) AM_READ(SMH_RAM)            /* 68000 RAM */
287   AM_RANGE(0x110000, 0x11ffff) AM_READ(taitoh_mirrorram_r)      /* 68000 RAM (Mirror) */
288   AM_RANGE(0x200000, 0x200001) AM_READ(TC0220IOC_halfword_portreg_r)
289   AM_RANGE(0x200002, 0x200003) AM_READ(TC0220IOC_halfword_port_r)
290   AM_RANGE(0x300000, 0x300001) AM_READNOP
291   AM_RANGE(0x300002, 0x300003) AM_READ8(taitosound_comm_r, 0x00ff)
292   AM_RANGE(0x400000, 0x420fff) AM_READ(TC0080VCO_word_r)
293   AM_RANGE(0x500800, 0x500fff) AM_READ(SMH_RAM)
294ADDRESS_MAP_END
295
296static ADDRESS_MAP_START( recordbr_writemem, ADDRESS_SPACE_PROGRAM, 16 )
297   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
298   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM) AM_BASE(&taitoh_68000_mainram)
299   AM_RANGE(0x200000, 0x200001) AM_WRITE(TC0220IOC_halfword_portreg_w)
300   AM_RANGE(0x200002, 0x200003) AM_WRITE(TC0220IOC_halfword_port_w)
301   AM_RANGE(0x300000, 0x300001) AM_WRITE8(taitosound_port_w, 0x00ff)
302   AM_RANGE(0x300002, 0x300003) AM_WRITE8(taitosound_comm_w, 0x00ff)
303   AM_RANGE(0x400000, 0x420fff) AM_WRITE(TC0080VCO_word_w)
304   AM_RANGE(0x500800, 0x500fff) AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
305ADDRESS_MAP_END
306
307static ADDRESS_MAP_START( dleague_readmem, ADDRESS_SPACE_PROGRAM, 16 )
308   AM_RANGE(0x000000, 0x05ffff) AM_READ(SMH_ROM)
309   AM_RANGE(0x100000, 0x10ffff) AM_READ(SMH_RAM)            /* 68000 RAM */
310   AM_RANGE(0x110000, 0x11ffff) AM_READ(taitoh_mirrorram_r)      /* 68000 RAM (Mirror) */
311   AM_RANGE(0x200000, 0x20000f) AM_READ(TC0220IOC_halfword_r)
312   AM_RANGE(0x300000, 0x300001) AM_READNOP
313   AM_RANGE(0x300002, 0x300003) AM_READ8(taitosound_comm_r, 0x00ff)
314   AM_RANGE(0x400000, 0x420fff) AM_READ(TC0080VCO_word_r)
315   AM_RANGE(0x500800, 0x500fff) AM_READ(SMH_RAM)
316ADDRESS_MAP_END
317
318static ADDRESS_MAP_START( dleague_writemem, ADDRESS_SPACE_PROGRAM, 16 )
319   AM_RANGE(0x000000, 0x05ffff) AM_WRITE(SMH_ROM)
320   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM) AM_BASE(&taitoh_68000_mainram)
321   AM_RANGE(0x200000, 0x20000f) AM_WRITE(TC0220IOC_halfword_w)
322   AM_RANGE(0x300000, 0x300001) AM_WRITE8(taitosound_port_w, 0x00ff)
323   AM_RANGE(0x300002, 0x300003) AM_WRITE8(taitosound_comm_w, 0x00ff)
324   AM_RANGE(0x400000, 0x420fff) AM_WRITE(TC0080VCO_word_w)
325   AM_RANGE(0x500800, 0x500fff) AM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
277static ADDRESS_MAP_START( dleague_map, ADDRESS_SPACE_PROGRAM, 16 )
278   AM_RANGE(0x000000, 0x05ffff) AM_ROM
279   AM_RANGE(0x100000, 0x10ffff) AM_MIRROR(0x010000) AM_RAM AM_BASE(&taitoh_68000_mainram)
280   AM_RANGE(0x200000, 0x20000f) AM_READWRITE8(TC0220IOC_r, TC0220IOC_w, 0x00ff)
281   AM_RANGE(0x300000, 0x300001) AM_READNOP AM_WRITE8(taitosound_port_w, 0x00ff)
282   AM_RANGE(0x300002, 0x300003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0x00ff)
283   AM_RANGE(0x400000, 0x420fff) AM_READWRITE(TC0080VCO_word_r, TC0080VCO_word_w)
284   AM_RANGE(0x500800, 0x500fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
326285   AM_RANGE(0x600000, 0x600001) AM_WRITENOP   /* ?? writes zero once per frame */
327286ADDRESS_MAP_END
328287
329288
330static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
331   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
332   AM_RANGE(0x4000, 0x7fff) AM_READ(SMH_BANK1)
333   AM_RANGE(0xc000, 0xdfff) AM_READ(SMH_RAM)
334   AM_RANGE(0xe000, 0xe003) AM_DEVREAD("ym", ym2610_r)
335   AM_RANGE(0xe200, 0xe200) AM_READNOP
336   AM_RANGE(0xe201, 0xe201) AM_READ(taitosound_slave_comm_r)
337   AM_RANGE(0xea00, 0xea00) AM_READNOP
338ADDRESS_MAP_END
339
340static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
341   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
342   AM_RANGE(0xc000, 0xdfff) AM_WRITE(SMH_RAM)
343   AM_RANGE(0xe000, 0xe003) AM_DEVWRITE("ym", ym2610_w)
344   AM_RANGE(0xe200, 0xe200) AM_WRITE(taitosound_slave_port_w)
345   AM_RANGE(0xe201, 0xe201) AM_WRITE(taitosound_slave_comm_w)
289static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
290   AM_RANGE(0x0000, 0x3fff) AM_ROM
291   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(1)
292   AM_RANGE(0xc000, 0xdfff) AM_RAM
293   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ym", ym2610_r, ym2610_w)
294   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_WRITE(taitosound_slave_port_w)
295   AM_RANGE(0xe201, 0xe201) AM_READWRITE(taitosound_slave_comm_r, taitosound_slave_comm_w)
346296   AM_RANGE(0xe400, 0xe403) AM_WRITENOP      /* pan control */
297   AM_RANGE(0xea00, 0xea00) AM_READNOP
347298   AM_RANGE(0xee00, 0xee00) AM_WRITENOP       /* ? */
348299   AM_RANGE(0xf000, 0xf000) AM_WRITENOP       /* ? */
349300   AM_RANGE(0xf200, 0xf200) AM_WRITE(sound_bankswitch_w)
r4499r4500
577528
578529   /* basic machine hardware */
579530   MDRV_CPU_ADD("maincpu", M68000,24000000 / 2)      /* 12 MHz */
580   MDRV_CPU_PROGRAM_MAP(syvalion_readmem,syvalion_writemem)
531   MDRV_CPU_PROGRAM_MAP(syvalion_map,0)
581532   MDRV_CPU_VBLANK_INT("screen", irq2_line_hold)
582533
583534   MDRV_CPU_ADD("audiocpu", Z80,8000000 / 2)      /* 4 MHz ??? */
584   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
535   MDRV_CPU_PROGRAM_MAP(sound_map,0)
585536
586537   MDRV_MACHINE_START(taitoh)
587538   MDRV_MACHINE_RESET(taitoh)
r4499r4500
617568
618569   /* basic machine hardware */
619570   MDRV_CPU_ADD("maincpu", M68000,24000000 / 2)      /* 12 MHz */
620   MDRV_CPU_PROGRAM_MAP(recordbr_readmem,recordbr_writemem)
571   MDRV_CPU_PROGRAM_MAP(recordbr_map,0)
621572   MDRV_CPU_VBLANK_INT("screen", irq2_line_hold)
622573
623574   MDRV_CPU_ADD("audiocpu", Z80,8000000 / 2)      /* 4 MHz ??? */
624   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
575   MDRV_CPU_PROGRAM_MAP(sound_map,0)
625576
626577   MDRV_MACHINE_START(taitoh)
627578   MDRV_MACHINE_RESET(taitoh)
r4499r4500
657608
658609   /* basic machine hardware */
659610   MDRV_CPU_ADD("maincpu", M68000,24000000 / 2)      /* 12 MHz */
660   MDRV_CPU_PROGRAM_MAP(dleague_readmem,dleague_writemem)
611   MDRV_CPU_PROGRAM_MAP(dleague_map,0)
661612   MDRV_CPU_VBLANK_INT("screen", irq1_line_hold)
662613
663614   MDRV_CPU_ADD("audiocpu", Z80,8000000 / 2)      /* 4 MHz ??? */
664   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
615   MDRV_CPU_PROGRAM_MAP(sound_map,0)
665616
666617   MDRV_MACHINE_START(taitoh)
667618   MDRV_MACHINE_RESET(taitoh)
src/mame/drivers/slapshot.c
r4499r4500
287287   AM_RANGE(0x830000, 0x83002f) AM_READWRITE(TC0480SCP_ctrl_word_r, TC0480SCP_ctrl_word_w)
288288   AM_RANGE(0x900000, 0x907fff) AM_READWRITE(color_ram_word_r, color_ram_word_w) AM_BASE(&color_ram)   /* 8bpg palette */
289289   AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE8("mk48t08", timekeeper_r, timekeeper_w, 0xff00)   /* nvram (only low bytes used) */
290   AM_RANGE(0xb00000, 0xb0001f) AM_WRITE(TC0360PRI_halfword_swap_w)   /* priority chip */
290   AM_RANGE(0xb00000, 0xb0001f) AM_WRITE8(TC0360PRI_w, 0xff00)   /* priority chip */
291291   AM_RANGE(0xc00000, 0xc0000f) AM_READWRITE(TC0640FIO_halfword_byteswap_r, TC0640FIO_halfword_byteswap_w)
292292   AM_RANGE(0xc00020, 0xc0002f) AM_READ(slapshot_service_input_r)   /* service mirror */
293293   AM_RANGE(0xd00000, 0xd00003) AM_READWRITE(slapshot_msb_sound_r, slapshot_msb_sound_w)
r4499r4500
302302   AM_RANGE(0x830000, 0x83002f) AM_READWRITE(TC0480SCP_ctrl_word_r, TC0480SCP_ctrl_word_w)
303303   AM_RANGE(0x900000, 0x907fff) AM_READWRITE(color_ram_word_r, color_ram_word_w) AM_BASE(&color_ram)   /* 8bpg palette */
304304   AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE8("mk48t08", timekeeper_r, timekeeper_w, 0xff00)   /* nvram (only low bytes used) */
305   AM_RANGE(0xb00000, 0xb0001f) AM_WRITE(TC0360PRI_halfword_swap_w)   /* priority chip */
305   AM_RANGE(0xb00000, 0xb0001f) AM_WRITE8(TC0360PRI_w, 0xff00)   /* priority chip */
306306   AM_RANGE(0xc00000, 0xc0000f) AM_READWRITE(TC0640FIO_halfword_byteswap_r, TC0640FIO_halfword_byteswap_w)
307307   AM_RANGE(0xc00020, 0xc0002f) AM_READ(slapshot_service_input_r)   /* service mirror */
308308   AM_RANGE(0xd00000, 0xd00003) AM_READWRITE(slapshot_msb_sound_r, slapshot_msb_sound_w)
src/mame/drivers/vsnes.c
r4499r4500
148148
149149static WRITE8_HANDLER( sprite_dma_0_w )
150150{
151    int source = ( data & 7 );
152     ppu2c0x_spriteram_dma( space, 0, source );
151   int source = ( data & 7 );
152   ppu2c0x_spriteram_dma( space, devtag_get_device(space->machine, "ppu1"), source );
153153}
154154
155155static WRITE8_HANDLER( sprite_dma_1_w )
156156{
157    int source = ( data & 7 );
158    ppu2c0x_spriteram_dma( space, 1, source );
157   int source = ( data & 7 );
158   ppu2c0x_spriteram_dma( space, devtag_get_device(space->machine, "ppu2"), source );
159159}
160160
161161static WRITE8_HANDLER( vsnes_coin_counter_w )
r4499r4500
203203
204204static ADDRESS_MAP_START( vsnes_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 )
205205   AM_RANGE(0x0000, 0x07ff) AM_MIRROR(0x1800) AM_RAM AM_BASE(&work_ram)
206   AM_RANGE(0x2000, 0x3fff) AM_READWRITE(ppu2c0x_0_r, ppu2c0x_0_w)
206   AM_RANGE(0x2000, 0x3fff) AM_DEVREADWRITE("ppu1", ppu2c0x_r, ppu2c0x_w)
207207   AM_RANGE(0x4011, 0x4011) AM_DEVWRITE("dac1", dac_w)
208208   AM_RANGE(0x4000, 0x4013) AM_DEVREADWRITE("nes1", nes_psg_r, nes_psg_w)
209209   AM_RANGE(0x4014, 0x4014) AM_WRITE(sprite_dma_0_w)
r4499r4500
216216
217217static ADDRESS_MAP_START( vsnes_cpu2_map, ADDRESS_SPACE_PROGRAM, 8 )
218218   AM_RANGE(0x0000, 0x07ff) AM_MIRROR(0x1800) AM_RAM AM_BASE(&work_ram_1)
219   AM_RANGE(0x2000, 0x3fff) AM_READWRITE(ppu2c0x_1_r, ppu2c0x_1_w)
219   AM_RANGE(0x2000, 0x3fff) AM_DEVREADWRITE("ppu2", ppu2c0x_r, ppu2c0x_w)
220220   AM_RANGE(0x4011, 0x4011) AM_DEVWRITE("dac2", dac_w)
221221   AM_RANGE(0x4000, 0x4013) AM_DEVREADWRITE("nes2", nes_psg_r, nes_psg_w)
222222   AM_RANGE(0x4014, 0x4014) AM_WRITE(sprite_dma_1_w)
r4499r4500
17821782   MDRV_VIDEO_START(vsnes)
17831783   MDRV_VIDEO_UPDATE(vsnes)
17841784
1785   MDRV_PPU2C04_ADD("ppu1", vsnes_ppu_interface_1)
1786
17851787   /* sound hardware */
17861788   MDRV_SPEAKER_STANDARD_MONO("mono")
17871789
r4499r4500
18251827   MDRV_VIDEO_START(vsdual)
18261828   MDRV_VIDEO_UPDATE(vsdual)
18271829
1830   MDRV_PPU2C04_ADD("ppu1", vsnes_ppu_interface_1)
1831   MDRV_PPU2C04_ADD("ppu2", vsnes_ppu_interface_2)
1832
18281833   /* sound hardware */
18291834   MDRV_SPEAKER_STANDARD_MONO("mono")
18301835
src/mame/drivers/taito_x.c
r4499r4500
224224
225225Stephh's notes (based on the game M68000 code and some tests) :
226226
2271) 'superman' and 'suprmanj'
2271) 'superman' and 'supermanj'
228228
229229  - Region stored at 0x07fffe.w
230230  - Sets :
231231      * 'superman' : region = 0x0002
232      * 'suprmanj' : region = 0x0000
232      * 'supermanj' : region = 0x0000
233233  - These 2 games are 100% the same, only region differs !
234234  - Coinage relies on the region (code at 0x003b8a) :
235235      * 0x0000 (Japan) uses TAITO_COINAGE_JAPAN_OLD
r4499r4500
250250  - BUTTON3 is only tested in "Test Mode", not when you are playing
251251
252252
2533) 'twinhwku'
2533) 'twinhawku'
254254
255255  - No region
256256  - Hard coded coinage table at 0x00b02a and is different from TAITO_COINAGE_US :
r4499r4500
271271  - Same other notes as for 'twinhawk'
272272
273273
2745) 'gigandes' and 'gigandsj'
2745) 'gigandes' and 'gigandesj'
275275
276276  - No region (not a Taito game anyway)
277277  - No notice screen
278278  - Constant bonus life at 50k, 250k then every 200k
279  - Bogus "Test Mode" in 'gigandes' (while it is correct for 'gigandsj') :
279  - Bogus "Test Mode" in 'gigandes' (while it is correct for 'gigandesj') :
280280      * screen is flipped while it shouldn't and it isn't flipped while it should
281281      * displays cabinet type instead of number of controls
282282  - DSWA bit 4 effect remains unknown but it MUST remain OFF !
r4499r4500
411411
412412/**************************************************************************/
413413
414static ADDRESS_MAP_START( superman_readmem, ADDRESS_SPACE_PROGRAM, 16 )
415   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
416   AM_RANGE(0x500000, 0x500007) AM_READ(superman_dsw_input_r)
417   AM_RANGE(0x800000, 0x800001) AM_READNOP
418   AM_RANGE(0x800002, 0x800003) AM_READ8(taitosound_comm_r, 0x00ff)
419   AM_RANGE(0x900000, 0x9007ff) AM_READ(cchip1_ram_r)
420   AM_RANGE(0x900802, 0x900803) AM_READ(cchip1_ctrl_r)
421   AM_RANGE(0xb00000, 0xb00fff) AM_READ(SMH_RAM)
422   AM_RANGE(0xd00000, 0xd007ff) AM_READ(SMH_RAM)   /* video attribute ram */
423   AM_RANGE(0xe00000, 0xe03fff) AM_READ(SMH_RAM)   /* object ram */
424   AM_RANGE(0xf00000, 0xf03fff) AM_READ(SMH_RAM)   /* Main RAM */
425ADDRESS_MAP_END
426
427static ADDRESS_MAP_START( superman_writemem, ADDRESS_SPACE_PROGRAM, 16 )
428   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
414static ADDRESS_MAP_START( superman_map, ADDRESS_SPACE_PROGRAM, 16 )
415   AM_RANGE(0x000000, 0x07ffff) AM_ROM
429416   AM_RANGE(0x300000, 0x300001) AM_WRITENOP   /* written each frame at $3a9c, mostly 0x10 */
430417   AM_RANGE(0x400000, 0x400001) AM_WRITENOP   /* written each frame at $3aa2, mostly 0x10 */
418   AM_RANGE(0x500000, 0x500007) AM_READ(superman_dsw_input_r)
431419   AM_RANGE(0x600000, 0x600001) AM_WRITENOP   /* written each frame at $3ab0, mostly 0x10 */
432   AM_RANGE(0x800000, 0x800001) AM_WRITE8(taitosound_port_w, 0x00ff)
433   AM_RANGE(0x800002, 0x800003) AM_WRITE8(taitosound_comm_w, 0x00ff)
434   AM_RANGE(0x900000, 0x9007ff) AM_WRITE(cchip1_ram_w)
435   AM_RANGE(0x900802, 0x900803) AM_WRITE(cchip1_ctrl_w)
420   AM_RANGE(0x800000, 0x800001) AM_READNOP AM_WRITE8(taitosound_port_w, 0x00ff)
421   AM_RANGE(0x800002, 0x800003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0x00ff)
422   AM_RANGE(0x900000, 0x9007ff) AM_READWRITE(cchip1_ram_r, cchip1_ram_w)
423   AM_RANGE(0x900802, 0x900803) AM_READWRITE(cchip1_ctrl_r, cchip1_ctrl_w)
436424   AM_RANGE(0x900c00, 0x900c01) AM_WRITE(cchip1_bank_w)
437   AM_RANGE(0xb00000, 0xb00fff) AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
438   AM_RANGE(0xd00000, 0xd007ff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16   )   // Sprites Y
439   AM_RANGE(0xe00000, 0xe03fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16_2   )   // Sprites Code + X + Attr
440   AM_RANGE(0xf00000, 0xf03fff) AM_WRITE(SMH_RAM)         /* Main RAM */
425   AM_RANGE(0xb00000, 0xb00fff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
426   AM_RANGE(0xd00000, 0xd007ff) AM_RAM AM_BASE(&spriteram16   )   // Sprites Y
427   AM_RANGE(0xe00000, 0xe03fff) AM_RAM AM_BASE(&spriteram16_2   )   // Sprites Code + X + Attr
428   AM_RANGE(0xf00000, 0xf03fff) AM_RAM         /* Main RAM */
441429ADDRESS_MAP_END
442430
443static ADDRESS_MAP_START( daisenpu_readmem, ADDRESS_SPACE_PROGRAM, 16 )
444   AM_RANGE(0x000000, 0x03ffff) AM_READ(SMH_ROM)
445   AM_RANGE(0x500000, 0x50000f) AM_READ(superman_dsw_input_r)
446   AM_RANGE(0x800000, 0x800001) AM_READNOP
447   AM_RANGE(0x800002, 0x800003) AM_READ8(taitosound_comm_r, 0x00ff)
448   AM_RANGE(0x900000, 0x90000f) AM_READ(daisenpu_input_r)
449   AM_RANGE(0xb00000, 0xb00fff) AM_READ(SMH_RAM)
450   AM_RANGE(0xd00000, 0xd00fff) AM_READ(SMH_RAM)   /* video attribute ram */
451   AM_RANGE(0xe00000, 0xe03fff) AM_READ(SMH_RAM)   /* object ram */
452   AM_RANGE(0xf00000, 0xf03fff) AM_READ(SMH_RAM)   /* Main RAM */
453ADDRESS_MAP_END
454
455static ADDRESS_MAP_START( daisenpu_writemem, ADDRESS_SPACE_PROGRAM, 16 )
456   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(SMH_ROM)
431static ADDRESS_MAP_START( daisenpu_map, ADDRESS_SPACE_PROGRAM, 16 )
432   AM_RANGE(0x000000, 0x03ffff) AM_ROM
457433//  AM_RANGE(0x400000, 0x400001) AM_WRITENOP    /* written each frame at $2ac, values change */
434   AM_RANGE(0x500000, 0x50000f) AM_READ(superman_dsw_input_r)
458435//  AM_RANGE(0x600000, 0x600001) AM_WRITENOP    /* written each frame at $2a2, values change */
459   AM_RANGE(0x800000, 0x800001) AM_WRITE8(taitosound_port_w, 0x00ff)
460   AM_RANGE(0x800002, 0x800003) AM_WRITE8(taitosound_comm_w, 0x00ff)
461   AM_RANGE(0x900000, 0x90000f) AM_WRITE(daisenpu_input_w)
462   AM_RANGE(0xb00000, 0xb00fff) AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
463   AM_RANGE(0xd00000, 0xd007ff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16   )   // Sprites Y
464   AM_RANGE(0xe00000, 0xe03fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16_2   )   // Sprites Code + X + Attr
465   AM_RANGE(0xf00000, 0xf03fff) AM_WRITE(SMH_RAM)         /* Main RAM */
436   AM_RANGE(0x800000, 0x800001) AM_READNOP AM_WRITE8(taitosound_port_w, 0x00ff)
437   AM_RANGE(0x800002, 0x800003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0x00ff)
438   AM_RANGE(0x900000, 0x90000f) AM_READWRITE(daisenpu_input_r, daisenpu_input_w)
439   AM_RANGE(0xb00000, 0xb00fff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
440   AM_RANGE(0xd00000, 0xd007ff) AM_RAM AM_BASE(&spriteram16   )   // Sprites Y
441   AM_RANGE(0xe00000, 0xe03fff) AM_RAM AM_BASE(&spriteram16_2   )   // Sprites Code + X + Attr
442   AM_RANGE(0xf00000, 0xf03fff) AM_RAM         /* Main RAM */
466443ADDRESS_MAP_END
467444
468static ADDRESS_MAP_START( gigandes_readmem, ADDRESS_SPACE_PROGRAM, 16 )
469   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
470   AM_RANGE(0x500000, 0x500007) AM_READ(superman_dsw_input_r)
471   AM_RANGE(0x800000, 0x800001) AM_READNOP
472   AM_RANGE(0x800002, 0x800003) AM_READ8(taitosound_comm_r, 0x00ff)
473   AM_RANGE(0x900000, 0x90000f) AM_READ(daisenpu_input_r)
474   AM_RANGE(0xb00000, 0xb00fff) AM_READ(SMH_RAM)
475   AM_RANGE(0xd00000, 0xd007ff) AM_READ(SMH_RAM)   /* video attribute ram */
476   AM_RANGE(0xe00000, 0xe03fff) AM_READ(SMH_RAM)   /* object ram */
477   AM_RANGE(0xf00000, 0xf03fff) AM_READ(SMH_RAM)   /* Main RAM */
478ADDRESS_MAP_END
479
480static ADDRESS_MAP_START( gigandes_writemem, ADDRESS_SPACE_PROGRAM, 16 )
481   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
445static ADDRESS_MAP_START( gigandes_map, ADDRESS_SPACE_PROGRAM, 16 )
446   AM_RANGE(0x000000, 0x07ffff) AM_ROM
482447   AM_RANGE(0x400000, 0x400001) AM_WRITENOP   /* 0x1 written each frame at $d42, watchdog? */
448   AM_RANGE(0x500000, 0x500007) AM_READ(superman_dsw_input_r)
483449   AM_RANGE(0x600000, 0x600001) AM_WRITENOP   /* 0x1 written each frame at $d3c, watchdog? */
484   AM_RANGE(0x800000, 0x800001) AM_WRITE8(taitosound_port_w, 0x00ff)
485   AM_RANGE(0x800002, 0x800003) AM_WRITE8(taitosound_comm_w, 0x00ff)
486   AM_RANGE(0x900000, 0x90000f) AM_WRITE(daisenpu_input_w)
487   AM_RANGE(0xb00000, 0xb00fff) AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
488   AM_RANGE(0xd00000, 0xd007ff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16   )   // Sprites Y
489   AM_RANGE(0xe00000, 0xe03fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16_2   )   // Sprites Code + X + Attr
490   AM_RANGE(0xf00000, 0xf03fff) AM_WRITE(SMH_RAM)         /* Main RAM */
450   AM_RANGE(0x800000, 0x800001) AM_READNOP AM_WRITE8(taitosound_port_w, 0x00ff)
451   AM_RANGE(0x800002, 0x800003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0x00ff)
452   AM_RANGE(0x900000, 0x90000f) AM_READWRITE(daisenpu_input_r, daisenpu_input_w)
453   AM_RANGE(0xb00000, 0xb00fff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
454   AM_RANGE(0xd00000, 0xd007ff) AM_RAM AM_BASE(&spriteram16   )   // Sprites Y
455   AM_RANGE(0xe00000, 0xe03fff) AM_RAM AM_BASE(&spriteram16_2   )   // Sprites Code + X + Attr
456   AM_RANGE(0xf00000, 0xf03fff) AM_RAM         /* Main RAM */
491457ADDRESS_MAP_END
492458
493static ADDRESS_MAP_START( ballbros_readmem, ADDRESS_SPACE_PROGRAM, 16 )
494   AM_RANGE(0x000000, 0x03ffff) AM_READ(SMH_ROM)
495   AM_RANGE(0x500000, 0x50000f) AM_READ(superman_dsw_input_r)
496   AM_RANGE(0x800000, 0x800001) AM_READNOP
497   AM_RANGE(0x800002, 0x800003) AM_READ8(taitosound_comm_r, 0x00ff)
498   AM_RANGE(0x900000, 0x90000f) AM_READ(daisenpu_input_r)
499   AM_RANGE(0xb00000, 0xb00fff) AM_READ(SMH_RAM)
500   AM_RANGE(0xd00000, 0xd007ff) AM_READ(SMH_RAM)   /* video attribute ram */
501   AM_RANGE(0xe00000, 0xe03fff) AM_READ(SMH_RAM)   /* object ram */
502   AM_RANGE(0xf00000, 0xf03fff) AM_READ(SMH_RAM)   /* Main RAM */
503ADDRESS_MAP_END
504
505static ADDRESS_MAP_START( ballbros_writemem, ADDRESS_SPACE_PROGRAM, 16 )
506   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(SMH_ROM)
459static ADDRESS_MAP_START( ballbros_map, ADDRESS_SPACE_PROGRAM, 16 )
460   AM_RANGE(0x000000, 0x03ffff) AM_ROM
507461   AM_RANGE(0x400000, 0x400001) AM_WRITENOP   /* 0x1 written each frame at $c56, watchdog? */
462   AM_RANGE(0x500000, 0x50000f) AM_READ(superman_dsw_input_r)
508463   AM_RANGE(0x600000, 0x600001) AM_WRITENOP   /* 0x1 written each frame at $c4e, watchdog? */
509   AM_RANGE(0x800000, 0x800001) AM_WRITE8(taitosound_port_w, 0x00ff)
510   AM_RANGE(0x800002, 0x800003) AM_WRITE8(taitosound_comm_w, 0x00ff)
511   AM_RANGE(0x900000, 0x90000f) AM_WRITE(daisenpu_input_w)
512   AM_RANGE(0xb00000, 0xb00fff) AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
513   AM_RANGE(0xd00000, 0xd007ff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16   )   // Sprites Y
514   AM_RANGE(0xe00000, 0xe03fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16_2   )   // Sprites Code + X + Attr
515   AM_RANGE(0xf00000, 0xf03fff) AM_WRITE(SMH_RAM)         /* Main RAM */
464   AM_RANGE(0x800000, 0x800001) AM_READNOP AM_WRITE8(taitosound_port_w, 0x00ff)
465   AM_RANGE(0x800002, 0x800003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0x00ff)
466   AM_RANGE(0x900000, 0x90000f) AM_READWRITE(daisenpu_input_r, daisenpu_input_w)
467   AM_RANGE(0xb00000, 0xb00fff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
468   AM_RANGE(0xd00000, 0xd007ff) AM_RAM AM_BASE(&spriteram16   )   // Sprites Y
469   AM_RANGE(0xe00000, 0xe03fff) AM_RAM AM_BASE(&spriteram16_2   )   // Sprites Code + X + Attr
470   AM_RANGE(0xf00000, 0xf03fff) AM_RAM         /* Main RAM */
516471ADDRESS_MAP_END
517472
518473
519474/**************************************************************************/
520475
521static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
522   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
523   AM_RANGE(0x4000, 0x7fff) AM_READ(SMH_BANK2)
524   AM_RANGE(0xc000, 0xdfff) AM_READ(SMH_RAM)
525   AM_RANGE(0xe000, 0xe003) AM_DEVREAD("ym", ym2610_r)
526   AM_RANGE(0xe200, 0xe200) AM_READNOP
527   AM_RANGE(0xe201, 0xe201) AM_READ(taitosound_slave_comm_r)
528   AM_RANGE(0xea00, 0xea00) AM_READNOP
529ADDRESS_MAP_END
530
531static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
532   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
533   AM_RANGE(0xc000, 0xdfff) AM_WRITE(SMH_RAM)
534   AM_RANGE(0xe000, 0xe003) AM_DEVWRITE("ym", ym2610_w)
535   AM_RANGE(0xe200, 0xe200) AM_WRITE(taitosound_slave_port_w)
536   AM_RANGE(0xe201, 0xe201) AM_WRITE(taitosound_slave_comm_w)
476static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
477   AM_RANGE(0x0000, 0x3fff) AM_ROM
478   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(2)
479   AM_RANGE(0xc000, 0xdfff) AM_RAM
480   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ym", ym2610_r, ym2610_w)
481   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_WRITE(taitosound_slave_port_w)
482   AM_RANGE(0xe201, 0xe201) AM_READWRITE(taitosound_slave_comm_r, taitosound_slave_comm_w)
537483   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
484   AM_RANGE(0xea00, 0xea00) AM_READNOP
538485   AM_RANGE(0xee00, 0xee00) AM_WRITENOP /* ? */
539486   AM_RANGE(0xf000, 0xf000) AM_WRITENOP /* ? */
540487   AM_RANGE(0xf200, 0xf200) AM_WRITE(sound_bankswitch_w) /* bankswitch ? */
541488ADDRESS_MAP_END
542489
543static ADDRESS_MAP_START( daisenpu_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
544   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
545   AM_RANGE(0x4000, 0x7fff) AM_READ(SMH_BANK2)
546   AM_RANGE(0xc000, 0xdfff) AM_READ(SMH_RAM)
547   AM_RANGE(0xe000, 0xe001) AM_DEVREAD("ym", ym2151_r)
548   AM_RANGE(0xe200, 0xe200) AM_READNOP
549   AM_RANGE(0xe201, 0xe201) AM_READ(taitosound_slave_comm_r)
550   AM_RANGE(0xea00, 0xea00) AM_READNOP
551ADDRESS_MAP_END
552
553static ADDRESS_MAP_START( daisenpu_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
554   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
555   AM_RANGE(0xc000, 0xdfff) AM_WRITE(SMH_RAM)
556   AM_RANGE(0xe000, 0xe001) AM_DEVWRITE("ym", ym2151_w)
557   AM_RANGE(0xe200, 0xe200) AM_WRITE(taitosound_slave_port_w)
558   AM_RANGE(0xe201, 0xe201) AM_WRITE(taitosound_slave_comm_w)
490static ADDRESS_MAP_START( daisenpu_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
491   AM_RANGE(0x0000, 0x3fff) AM_ROM
492   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(2)
493   AM_RANGE(0xc000, 0xdfff) AM_RAM
494   AM_RANGE(0xe000, 0xe001) AM_DEVREADWRITE("ym", ym2151_r, ym2151_w)
495   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_WRITE(taitosound_slave_port_w)
496   AM_RANGE(0xe201, 0xe201) AM_READWRITE(taitosound_slave_comm_r, taitosound_slave_comm_w)
559497   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
498   AM_RANGE(0xea00, 0xea00) AM_READNOP
560499   AM_RANGE(0xee00, 0xee00) AM_WRITENOP /* ? */
561500   AM_RANGE(0xf000, 0xf000) AM_WRITENOP
562501   AM_RANGE(0xf200, 0xf200) AM_WRITE(sound_bankswitch_w)
563502ADDRESS_MAP_END
564503
565static ADDRESS_MAP_START( ballbros_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
566   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
567   AM_RANGE(0x4000, 0x7fff) AM_READ(SMH_BANK2)
568   AM_RANGE(0xc000, 0xdfff) AM_READ(SMH_RAM)
569   AM_RANGE(0xe000, 0xe003) AM_DEVREAD("ym", ym2610_r)
570   AM_RANGE(0xe200, 0xe200) AM_READNOP
571   AM_RANGE(0xe200, 0xe200) AM_READNOP
572   AM_RANGE(0xe201, 0xe201) AM_READ(taitosound_slave_comm_r)
573   AM_RANGE(0xea00, 0xea00) AM_READNOP
574ADDRESS_MAP_END
575
576static ADDRESS_MAP_START( ballbros_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
577   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
578   AM_RANGE(0xc000, 0xdfff) AM_WRITE(SMH_RAM)
579   AM_RANGE(0xe000, 0xe003) AM_DEVWRITE("ym", ym2610_w)
580   AM_RANGE(0xe200, 0xe200) AM_WRITE(taitosound_slave_port_w)
581   AM_RANGE(0xe201, 0xe201) AM_WRITE(taitosound_slave_comm_w)
504static ADDRESS_MAP_START( ballbros_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
505   AM_RANGE(0x0000, 0x3fff) AM_ROM
506   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(2)
507   AM_RANGE(0xc000, 0xdfff) AM_RAM
508   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ym", ym2610_r, ym2610_w)
509   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_WRITE(taitosound_slave_port_w)
510   AM_RANGE(0xe201, 0xe201) AM_READWRITE(taitosound_slave_comm_r, taitosound_slave_comm_w)
582511   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
512   AM_RANGE(0xea00, 0xea00) AM_READNOP
583513   AM_RANGE(0xee00, 0xee00) AM_WRITENOP /* ? */
584514   AM_RANGE(0xf000, 0xf000) AM_WRITENOP /* ? */
585515   AM_RANGE(0xf200, 0xf200) AM_WRITE(sound_bankswitch_w) /* bankswitch ? */
r4499r4500
687617   TAITO_JOY_UDLR_2_BUTTONS_START( 2 )
688618INPUT_PORTS_END
689619
690static INPUT_PORTS_START( suprmanj )
620static INPUT_PORTS_START( supermanj )
691621   PORT_INCLUDE( superman )
692622
693623   PORT_MODIFY("DSWA")
r4499r4500
727657   TAITO_JOY_UDLR_2_BUTTONS_START( 2 )
728658INPUT_PORTS_END
729659
730static INPUT_PORTS_START( twinhwku )
660static INPUT_PORTS_START( twinhawku )
731661   PORT_INCLUDE( twinhawk )
732662
733663   PORT_MODIFY("DSWA")
r4499r4500
987917
988918   /* basic machine hardware */
989919   MDRV_CPU_ADD("maincpu", M68000, XTAL_16MHz/2)   /* verified on pcb */
990   MDRV_CPU_PROGRAM_MAP(superman_readmem,superman_writemem)
920   MDRV_CPU_PROGRAM_MAP(superman_map,0)
991921   MDRV_CPU_VBLANK_INT("screen", irq6_line_hold)
992922
993923   MDRV_CPU_ADD("audiocpu", Z80, XTAL_16MHz/4)   /* verified on pcb */
994   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
924   MDRV_CPU_PROGRAM_MAP(sound_map,0)
995925
996926   MDRV_QUANTUM_TIME(HZ(600))   /* 10 CPU slices per frame - enough for the sound CPU to read all commands */
997927
r4499r4500
1027957
1028958   /* basic machine hardware */
1029959   MDRV_CPU_ADD("maincpu", M68000, XTAL_16MHz/2)   /* verified on pcb */
1030   MDRV_CPU_PROGRAM_MAP(daisenpu_readmem,daisenpu_writemem)
960   MDRV_CPU_PROGRAM_MAP(daisenpu_map,0)
1031961   MDRV_CPU_VBLANK_INT("screen", irq2_line_hold)
1032962
1033963   MDRV_CPU_ADD("audiocpu", Z80, XTAL_16MHz/4)   /* verified on pcb */
1034   MDRV_CPU_PROGRAM_MAP(daisenpu_sound_readmem,daisenpu_sound_writemem)
964   MDRV_CPU_PROGRAM_MAP(daisenpu_sound_map,0)
1035965
1036966   MDRV_QUANTUM_TIME(HZ(600))   /* 10 CPU slices per frame - enough for the sound CPU to read all commands */
1037967
r4499r4500
1064994
1065995   /* basic machine hardware */
1066996   MDRV_CPU_ADD("maincpu", M68000, 8000000)   /* 8 MHz? */
1067   MDRV_CPU_PROGRAM_MAP(gigandes_readmem,gigandes_writemem)
997   MDRV_CPU_PROGRAM_MAP(gigandes_map,0)
1068998   MDRV_CPU_VBLANK_INT("screen", irq2_line_hold)
1069999
10701000   MDRV_CPU_ADD("audiocpu", Z80, 4000000)   /* 4 MHz ??? */
1071   MDRV_CPU_PROGRAM_MAP(ballbros_sound_readmem,ballbros_sound_writemem)
1001   MDRV_CPU_PROGRAM_MAP(ballbros_sound_map,0)
10721002
10731003   MDRV_QUANTUM_TIME(HZ(600))   /* 10 CPU slices per frame - enough for the sound CPU to read all commands */
10741004
r4499r4500
11031033
11041034   /* basic machine hardware */
11051035   MDRV_CPU_ADD("maincpu", M68000, 8000000)   /* 8 MHz? */
1106   MDRV_CPU_PROGRAM_MAP(ballbros_readmem,ballbros_writemem)
1036   MDRV_CPU_PROGRAM_MAP(ballbros_map,0)
11071037   MDRV_CPU_VBLANK_INT("screen", irq2_line_hold)
11081038
11091039   MDRV_CPU_ADD("audiocpu", Z80, 4000000)   /* 4 MHz ??? */
1110   MDRV_CPU_PROGRAM_MAP(ballbros_sound_readmem,ballbros_sound_writemem)
1040   MDRV_CPU_PROGRAM_MAP(ballbros_sound_map,0)
11111041
11121042   MDRV_QUANTUM_TIME(HZ(600))   /* 10 CPU slices per frame - enough for the sound CPU to read all commands */
11131043
r4499r4500
12081138   ROM_LOAD( "e18_01.bin", 0x00000, 0x80000, CRC(3cf99786) SHA1(f6febf9bda87ca04f0a5890d0e8001c26dfa6c81) )
12091139ROM_END
12101140
1211ROM_START( suprmanj )
1141ROM_START( supermanj )
12121142   ROM_REGION( 0x80000, "maincpu", 0 )     /* 512k for 68000 code */
12131143   ROM_LOAD16_BYTE( "a10_09.bin", 0x00000, 0x20000, CRC(640f1d58) SHA1(e768d32eae1dba39c23189996fbd5454c8627809) )
12141144   ROM_LOAD16_BYTE( "a05_07.bin", 0x00001, 0x20000, CRC(fddb9953) SHA1(8b562712810a5a72f4647f1ba1314a1be2e249e7) )
r4499r4500
12451175   ROM_LOAD( "b87-03", 0x180000, 0x80000, CRC(ce155ae0) SHA1(7293125fc23f2411c4edd427a2576c145b3f2dd4) )
12461176ROM_END
12471177
1248ROM_START( twinhwku )
1178ROM_START( twinhawku )
12491179   ROM_REGION( 0x40000, "maincpu", 0 )     /* 256k for 68000 code */
12501180   ROM_LOAD16_BYTE( "b87-09.u6", 0x00000, 0x20000, CRC(7e6267c7) SHA1(a623c1b740008675f36e8b63bbc17a573917db30) )
12511181   ROM_LOAD16_BYTE( "b87-08.u4", 0x00001, 0x20000, CRC(31d9916f) SHA1(8ae491a51a4095717c6f65fe81a83902feccd54b) )
r4499r4500
13011231   ROM_LOAD( "east-10.16e", 0x00000, 0x80000, CRC(ca0ac419) SHA1(b29f30a8ff1286c65b741353b6551918a45bcafe) )
13021232ROM_END
13031233
1304ROM_START( gigandsj )
1234ROM_START( gigandesj )
13051235   ROM_REGION( 0x80000, "maincpu", 0 )     /* 512k for 68000 code */
13061236   ROM_LOAD16_BYTE( "east_1.10a", 0x00000, 0x20000, CRC(ae74e4e5) SHA1(1CAC0A0E591B63142D8D249C67F803256FB28C2A) )
13071237   ROM_LOAD16_BYTE( "east_3.5a",  0x00001, 0x20000, CRC(8bcf2116) SHA1(9255D7E0AB568AD7A894421D3260FA80B8A0A5D0) )
r4499r4500
13761306}
13771307
13781308
1379GAME( 1988, superman, 0,        superman, superman, 0,        ROT0,   "Taito Corporation", "Superman", 0 )
1380GAME( 1988, suprmanj, superman, superman, suprmanj, 0,        ROT0,   "Taito Corporation", "Superman (Japan)", 0 )
1381GAME( 1989, twinhawk, 0,        daisenpu, twinhawk, 0,        ROT270, "Taito Corporation Japan", "Twin Hawk (World)", 0 )
1382GAME( 1989, twinhwku, twinhawk, daisenpu, twinhwku, 0,        ROT270, "Taito America Corporation", "Twin Hawk (US)", 0 )
1383GAME( 1989, daisenpu, twinhawk, daisenpu, daisenpu, 0,        ROT270, "Taito Corporation", "Daisenpu (Japan)", 0 )
1384GAME( 1989, gigandes, 0,        gigandes, gigandes, 0,        ROT0,   "East Technology", "Gigandes", 0 )
1385GAME( 1989, gigandsj, gigandes, gigandes, gigandes, 0,        ROT0,   "East Technology", "Gigandes (Japan)", 0 )
1386GAME( 1989, kyustrkr, 0,        ballbros, kyustrkr, kyustrkr, ROT180, "East Technology", "Last Striker / Kyuukyoku no Striker", 0 )
1387GAME( 1992, ballbros, 0,        ballbros, ballbros, 0,        ROT0,   "East Technology", "Balloon Brothers", 0 )
1309GAME( 1988, superman,  0,        superman, superman,  0,        ROT0,   "Taito Corporation", "Superman", 0 )
1310GAME( 1988, supermanj, superman, superman, supermanj, 0,        ROT0,   "Taito Corporation", "Superman (Japan)", 0 )
1311GAME( 1989, twinhawk,  0,        daisenpu, twinhawk,  0,        ROT270, "Taito Corporation Japan", "Twin Hawk (World)", 0 )
1312GAME( 1989, twinhawku, twinhawk, daisenpu, twinhawku, 0,        ROT270, "Taito America Corporation", "Twin Hawk (US)", 0 )
1313GAME( 1989, daisenpu,  twinhawk, daisenpu, daisenpu,  0,        ROT270, "Taito Corporation", "Daisenpu (Japan)", 0 )
1314GAME( 1989, gigandes,  0,        gigandes, gigandes,  0,        ROT0,   "East Technology", "Gigandes", 0 )
1315GAME( 1989, gigandesj, gigandes, gigandes, gigandes,  0,        ROT0,   "East Technology", "Gigandes (Japan)", 0 )
1316GAME( 1989, kyustrkr,  0,        ballbros, kyustrkr,  kyustrkr, ROT180, "East Technology", "Last Striker / Kyuukyoku no Striker", 0 )
1317GAME( 1992, ballbros,  0,        ballbros, ballbros,  0,        ROT0,   "East Technology", "Balloon Brothers", 0 )
src/mame/drivers/jalmah.c
r4499r4500
2424-daireika: the ranking screen on the original pcb shows some hearts instead of the "0".
2525 Some investigation indicates that the game reads area "fe100" onwards for these to be filled.
2626 These are likely to be provided by one of the mcu snippets...
27-kakumei/kakumei2:has weird text layer strings in test mode (like "#p control panel"),
28 unsure if this one is somehow related to the above daireika bug, it's a BTANB or something else.
2729-Check if urashima has a "mode 3" for the layer 0 tilemap;
2830-Complete the dip-switches for all the games;
2931-There could be timing issues caused by MCU simulation at $80004;
r4499r4500
101103Sound:  M6295
102104OSC:    12.000MHz
103105        4.000MHz
106
107
1082009-04: Verified DipLocations and Default settings with manual (thanks to Uki)
109
104110*******************************************************************************************/
105111
106112#include "driver.h"
r4499r4500
607613#define SUCHIPI_MCU  (0x23)
608614
609615static int respcount;
616static UINT8 test_mode;
610617
611618#define MCU_READ(tag, _bit_, _offset_, _retval_) \
612619if((0xffff - input_port_read(machine, tag)) & _bit_) { jm_shared_ram[_offset_] = _retval_; }
r4499r4500
656663      daireika_palette_dma(machine,((jm_shared_ram[0x540/2] & 0x0f00) >> 8));
657664   }
658665
659   if((0xffff - input_port_read(machine, "SYSTEM")) & 0x0008)   //service_mode
666   if(test_mode)   //service_mode
660667   {
661668      jm_shared_ram[0x000/2] = input_port_read(machine, "KEY0");
662669      jm_shared_ram[0x002/2] = input_port_read(machine, "KEY1");
r4499r4500
699706{
700707   static UINT16 prg_prot;
701708
702   if((0xffff - input_port_read(machine, "SYSTEM")) & 0x0008)   //service_mode
709   if(test_mode)   //service_mode
703710   {
704711      jm_shared_ram[0x000/2] = input_port_read(machine, "KEY0");
705712      jm_shared_ram[0x002/2] = input_port_read(machine, "KEY1");
r4499r4500
743750{
744751   static UINT16 prg_prot;
745752
746   if((0xffff - input_port_read(machine, "SYSTEM")) & 0x0008)   //service_mode
753   if(test_mode)   //service_mode
747754   {
748755      jm_shared_ram[0x300/2] = input_port_read(machine, "KEY0");
749756      jm_shared_ram[0x302/2] = input_port_read(machine, "KEY1");
r4499r4500
785792
786793static void second_mcu_run(running_machine *machine)
787794{
788   if((0xffff - input_port_read(machine, "DSW")) & 0x0004)   //service_mode
795   if(test_mode)   //service_mode
789796   {
790797      jm_shared_ram[0x200/2] = input_port_read(machine, "KEY0");
791798      jm_shared_ram[0x202/2] = input_port_read(machine, "KEY1");
r4499r4500
938945
939946static INPUT_PORTS_START( common )
940947   PORT_START("SYSTEM")
941   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) )
942   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
943   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
944   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
945   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
946   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
947   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
948   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
949   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
950   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
951   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
952   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
953   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
954   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
955   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
948   PORT_BIT( 0x001f, IP_ACTIVE_LOW, IPT_UNKNOWN )
956949   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE1 )
957950   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_COIN1 )
958951   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN2 )
959   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
960   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
961   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
962   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
963   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
964   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
965   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
966   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
967   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
968   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
969   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
970   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
971   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
972   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
973   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
974   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
975   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
976   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
977   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
978   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
979   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
980   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
981   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
982   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
952   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
953INPUT_PORTS_END
983954
984   PORT_START("DSW")
985   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) )    // Coin2 is always 1C/1C.
986   PORT_DIPSETTING(      0x0001, DEF_STR( 4C_1C ) )
987   PORT_DIPSETTING(      0x0002, DEF_STR( 3C_1C ) )
988   PORT_DIPSETTING(      0x0003, DEF_STR( 2C_1C ) )
989   PORT_DIPSETTING(      0x0007, DEF_STR( 1C_1C ) )
990   PORT_DIPSETTING(      0x0006, DEF_STR( 1C_2C ) )
991   PORT_DIPSETTING(      0x0005, DEF_STR( 1C_3C ) )
992   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_4C ) )
993   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
994   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
995   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
996   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
997   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
998   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
999   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1000   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
1001   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
1002   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1003   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
1004   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
1005   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1006   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) )
1007   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
1008   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1009   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
1010   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
1011   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1012   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
1013   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
1014   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1015   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
1016   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
1017   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1018   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
1019   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
1020   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1021   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
1022   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
1023   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1024   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
1025   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
1026   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1027   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
1028   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
1029   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1030   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
1031   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
1032   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1033
955static INPUT_PORTS_START( ctrl_mj1 )
1034956   PORT_START("KEY0")
1035957   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
1036958   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
r4499r4500
1062984   PORT_BIT( 0xe1e1, IP_ACTIVE_LOW, IPT_UNUSED )
1063985INPUT_PORTS_END
1064986
1065static INPUT_PORTS_START( jalmah )
1066   PORT_INCLUDE( common )
1067
1068   PORT_MODIFY("SYSTEM")
1069   PORT_SERVICE( 0x0008, IP_ACTIVE_LOW )
1070
987static INPUT_PORTS_START( ctrl_mj2 )
1071988   PORT_START("KEY3")
1072989   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START2 )
1073990   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_PLAYER(2)
r4499r4500
10991016   PORT_BIT( 0xe1e1, IP_ACTIVE_LOW, IPT_UNUSED )
11001017INPUT_PORTS_END
11011018
1019static INPUT_PORTS_START( urashima )
1020   PORT_INCLUDE( common )
1021   PORT_INCLUDE( ctrl_mj1 )
1022   PORT_INCLUDE( ctrl_mj2 )
11021023
1103static INPUT_PORTS_START( jalmah2 )
1024   PORT_MODIFY("SYSTEM")
1025   PORT_SERVICE( 0x0008, IP_ACTIVE_LOW )
1026
1027   PORT_START("DSW")
1028   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:8,7,6")
1029   PORT_DIPSETTING(      0x0001, DEF_STR( 4C_1C ) )
1030   PORT_DIPSETTING(      0x0002, DEF_STR( 3C_1C ) )
1031   PORT_DIPSETTING(      0x0003, DEF_STR( 2C_1C ) )
1032   PORT_DIPSETTING(      0x0007, DEF_STR( 1C_1C ) )
1033   PORT_DIPSETTING(      0x0006, DEF_STR( 1C_2C ) )
1034   PORT_DIPSETTING(      0x0005, DEF_STR( 1C_3C ) )
1035   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_4C ) )
1036   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
1037   PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,4")
1038   PORT_DIPSETTING(      0x0018, DEF_STR( Normal ) )
1039   PORT_DIPSETTING(      0x0010, DEF_STR( Hard ) )
1040   PORT_DIPSETTING(      0x0008, DEF_STR( Harder ) )
1041   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
1042   PORT_DIPNAME( 0x0020, 0x0020, "Display Tenpai/Noten" ) PORT_DIPLOCATION("SW2:3")
1043   PORT_DIPSETTING(      0x0020, DEF_STR( No ) )
1044   PORT_DIPSETTING(      0x0000, DEF_STR( Yes ) )
1045   PORT_DIPNAME( 0x0040, 0x0040, "Pinfu with Tsumo" ) PORT_DIPLOCATION("SW2:2")
1046   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
1047   PORT_DIPSETTING(      0x0040, DEF_STR( Yes ) )
1048   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1")
1049   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
1050   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1051   PORT_DIPNAME( 0x0300, 0x0300, "Number of Chips (Start - Continue)" ) PORT_DIPLOCATION("SW1:8,7")
1052   PORT_DIPSETTING(      0x0300, "1 - 1" )
1053   PORT_DIPSETTING(      0x0200, "1 - 2" )
1054   PORT_DIPSETTING(      0x0100, "2 - 1" )
1055   PORT_DIPSETTING(      0x0000, "2 - 2" )
1056   PORT_DIPNAME( 0x0c00, 0x0c00, "Number of Players" ) PORT_DIPLOCATION("SW1:6,5")
1057   PORT_DIPSETTING(      0x0800, "0" )
1058   PORT_DIPSETTING(      0x0c00, "1" )
1059   PORT_DIPSETTING(      0x0400, "2" )
1060   PORT_DIPSETTING(      0x0000, "4" )
1061   PORT_DIPNAME( 0x1000, 0x1000, "Chip Added After Win" ) PORT_DIPLOCATION("SW1:4")
1062   PORT_DIPSETTING(      0x1000, "Less" )
1063   PORT_DIPSETTING(      0x0000, "More" )
1064   PORT_DIPUNKNOWN_DIPLOC( 0x2000, 0x2000, "SW1:3" )   // Unused according to the manual
1065   PORT_DIPUNKNOWN_DIPLOC( 0x4000, 0x4000, "SW1:2" )   // Unused according to the manual
1066   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Service_Mode ) ) PORT_DIPLOCATION("SW1:1")
1067   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
1068   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1069INPUT_PORTS_END
1070
1071static INPUT_PORTS_START( daireika )
11041072   PORT_INCLUDE( common )
1073   PORT_INCLUDE( ctrl_mj1 )
1074   PORT_INCLUDE( ctrl_mj2 )
11051075
1076   PORT_MODIFY("SYSTEM")
1077   PORT_SERVICE( 0x0008, IP_ACTIVE_LOW )
1078
1079   PORT_START("DSW")
1080   PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:1,2,3")
1081   PORT_DIPSETTING(      0x0001, DEF_STR( 4C_1C ) )
1082   PORT_DIPSETTING(      0x0002, DEF_STR( 3C_1C ) )
1083   PORT_DIPSETTING(      0x0003, DEF_STR( 2C_1C ) )
1084   PORT_DIPSETTING(      0x0007, DEF_STR( 1C_1C ) )
1085   PORT_DIPSETTING(      0x0006, DEF_STR( 1C_2C ) )
1086   PORT_DIPSETTING(      0x0005, DEF_STR( 1C_3C ) )
1087   PORT_DIPSETTING(      0x0004, DEF_STR( 1C_4C ) )
1088   PORT_DIPSETTING(      0x0000, DEF_STR( Free_Play ) )
1089   PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:4,5")
1090   PORT_DIPSETTING(      0x0018, DEF_STR( Normal ) )
1091   PORT_DIPSETTING(      0x0010, DEF_STR( Hard ) )
1092   PORT_DIPSETTING(      0x0008, DEF_STR( Harder ) )
1093   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
1094   PORT_DIPUNKNOWN_DIPLOC( 0x0020, 0x0020, "SW2:6" )   // Unused according to the manual
1095   PORT_DIPNAME( 0x0040, 0x0040, "Pinfu with Tsumo" ) PORT_DIPLOCATION("SW2:7")
1096   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
1097   PORT_DIPSETTING(      0x0040, DEF_STR( Yes ) )
1098   PORT_DIPUNKNOWN_DIPLOC( 0x0080, 0x0080, "SW2:8" )   // Unused according to the manual
1099   PORT_DIPNAME( 0x0300, 0x0300, "Number of Chips (Start - Continue)" ) PORT_DIPLOCATION("SW1:1,2")
1100   PORT_DIPSETTING(      0x0300, "1 - 1" )
1101   PORT_DIPSETTING(      0x0200, "1 - 2" )
1102   PORT_DIPSETTING(      0x0100, "2 - 1" )
1103   PORT_DIPSETTING(      0x0000, "2 - 2" )
1104   PORT_DIPUNKNOWN_DIPLOC( 0x0400, 0x0400, "SW1:3" )   // Unused according to the manual
1105   PORT_DIPUNKNOWN_DIPLOC( 0x0800, 0x0800, "SW1:4" )   // Unused according to the manual
1106   PORT_DIPUNKNOWN_DIPLOC( 0x1000, 0x1000, "SW1:5" )   // Unused according to the manual
1107   PORT_DIPUNKNOWN_DIPLOC( 0x2000, 0x2000, "SW1:6" )   // Unused according to the manual
1108   PORT_DIPUNKNOWN_DIPLOC( 0x4000, 0x4000, "SW1:7" )   // Unused according to the manual
1109   /* SW1:8 should be "Switch Control Panel" off: no - on : yes -> likely to be controlled by the MCU. */
1110   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:8")
1111   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
1112   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1113INPUT_PORTS_END
1114
1115static INPUT_PORTS_START( mjzoomin )
1116   PORT_INCLUDE( daireika )
1117
11061118   PORT_MODIFY("DSW")
1107   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
1119   PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:4,5,6")
1120   PORT_DIPSETTING(      0x0010, "0 (Easy)" )
1121   PORT_DIPSETTING(      0x0008, "1 (Easier)" )
1122   PORT_DIPSETTING(      0x0000, "2 (Easiest)" )
1123   PORT_DIPSETTING(      0x0038, "3 (Normal)" )
1124   PORT_DIPSETTING(      0x0030, "4 (Little Hard)" )
1125   PORT_DIPSETTING(      0x0028, "5 (Hard)" )
1126   PORT_DIPSETTING(      0x0020, "6 (Harder)" )
1127   PORT_DIPSETTING(      0x0018, "7 (Hardest)" )
1128   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:8")
1129   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
1130   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1131   PORT_DIPNAME( 0x0300, 0x0300, "Start Score Type" ) PORT_DIPLOCATION("SW1:1,2")
1132   PORT_DIPSETTING(      0x0300, "1" )
1133   PORT_DIPSETTING(      0x0200, "2" )
1134   PORT_DIPSETTING(      0x0100, "3" )
1135   PORT_DIPSETTING(      0x0000, "4" )
1136   PORT_DIPUNKNOWN_DIPLOC( 0x0400, 0x0400, "SW1:3" )   // Unused according to the manual
1137   PORT_DIPUNKNOWN_DIPLOC( 0x0800, 0x0800, "SW1:4" )   // Unused according to the manual
1138   PORT_DIPUNKNOWN_DIPLOC( 0x1000, 0x1000, "SW1:5" )   // Unused according to the manual
1139   PORT_DIPNAME( 0x2000, 0x2000, "Item Availability" ) PORT_DIPLOCATION("SW1:6")
1140   PORT_DIPSETTING(      0x2000, DEF_STR( Normal ) )
1141   PORT_DIPSETTING(      0x0000, DEF_STR( High ) )
1142   PORT_DIPUNKNOWN_DIPLOC( 0x4000, 0x4000, "SW1:7" )   // Unused according to the manual
1143   PORT_DIPUNKNOWN_DIPLOC( 0x8000, 0x8000, "SW1:8" )   // Unused according to the manual
1144INPUT_PORTS_END
1145
1146static INPUT_PORTS_START( kakumei )
1147   PORT_INCLUDE( common )
1148   PORT_INCLUDE( ctrl_mj1 )
1149
1150   PORT_MODIFY("KEY1")
1151   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_NAME("P1 Mahjong Flip Flop")   PORT_CODE(KEYCODE_2)
1152
1153   PORT_START("DSW")
1154   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1")
11081155   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
11091156   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1110   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
1111   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
1112   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1113   PORT_SERVICE( 0x0004, IP_ACTIVE_LOW )
1114   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
1115   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
1116   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1117   PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coinage ) )
1157   PORT_DIPUNKNOWN_DIPLOC( 0x0002, 0x0002, "SW2:2" )   // Unused according to the manual
1158   PORT_SERVICE_DIPLOC( 0x0004, IP_ACTIVE_LOW, "SW2:3" )
1159   PORT_DIPUNKNOWN_DIPLOC( 0x0008, 0x0008, "SW2:4" )   // Unused according to the manual
1160   PORT_DIPUNKNOWN_DIPLOC( 0x0010, 0x0010, "SW2:5" )   // Unused according to the manual
1161   PORT_DIPUNKNOWN_DIPLOC( 0x0020, 0x0020, "SW2:6" )   // Unused according to the manual
1162   PORT_DIPUNKNOWN_DIPLOC( 0x0040, 0x0040, "SW2:7" )   // Unused according to the manual
1163   PORT_DIPUNKNOWN_DIPLOC( 0x0080, 0x0080, "SW2:8" )   // Unused according to the manual
1164   PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2,3")
11181165   PORT_DIPSETTING(      0x0100, DEF_STR( 4C_1C ) )
11191166   PORT_DIPSETTING(      0x0200, DEF_STR( 3C_1C ) )
11201167   PORT_DIPSETTING(      0x0300, DEF_STR( 2C_1C ) )
r4499r4500
11221169   PORT_DIPSETTING(      0x0600, DEF_STR( 1C_2C ) )
11231170   PORT_DIPSETTING(      0x0500, DEF_STR( 1C_3C ) )
11241171   PORT_DIPSETTING(      0x0400, DEF_STR( 1C_4C ) )
1125   PORT_DIPSETTING(      0x0000, "1 Coin / 99 Credits" )
1126
1127   PORT_MODIFY("KEY1")
1128   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_NAME("P1 Mahjong Flip Flop?")   PORT_CODE(KEYCODE_2) //? seems a button,affects continue countdown
1172   PORT_DIPSETTING(      0x0000, "1 Coin / 99 Credits" )   // Free Play according to the manual
1173   PORT_DIPNAME( 0x1800, 0x1800, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:4,5")
1174   PORT_DIPSETTING(      0x1800, DEF_STR( Easy ) )
1175   PORT_DIPSETTING(      0x1000, DEF_STR( Normal ) )
1176   PORT_DIPSETTING(      0x0800, DEF_STR( Hard ) )
1177   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
1178   PORT_DIPUNKNOWN_DIPLOC( 0x2000, 0x2000, "SW1:6" )   // Unused according to the manual
1179   PORT_DIPUNKNOWN_DIPLOC( 0x4000, 0x4000, "SW1:7" )   // Unused according to the manual
1180   PORT_DIPUNKNOWN_DIPLOC( 0x8000, 0x8000, "SW1:8" )   // Unused according to the manual
11291181INPUT_PORTS_END
11301182
1131
1132static INPUT_PORTS_START( jalmah2a )
1183static INPUT_PORTS_START( kakumei2 )
11331184   PORT_INCLUDE( common )
1185   PORT_INCLUDE( ctrl_mj1 )
11341186
1135   PORT_MODIFY("DSW")
1136   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) )
1137   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
1138   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1139   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
1140   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
1141   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1142   PORT_SERVICE( 0x0004, IP_ACTIVE_LOW )
1143   PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Demo_Sounds ) )
1187   PORT_MODIFY("KEY1")
1188   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_NAME("P1 Mahjong Flip Flop")   PORT_CODE(KEYCODE_2)
1189
1190   PORT_START("DSW")
1191   PORT_DIPUNKNOWN_DIPLOC( 0x0001, 0x0001, "SW2:1" )   // Unused according to the manual
1192   PORT_DIPUNKNOWN_DIPLOC( 0x0002, 0x0002, "SW2:2" )   // Unused according to the manual
1193   PORT_SERVICE_DIPLOC( 0x0004, IP_ACTIVE_LOW, "SW2:3" )
1194   PORT_DIPUNKNOWN_DIPLOC( 0x0008, 0x0008, "SW2:4" )   // Unused according to the manual
1195   PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:5")   // Should default to OFF according to manual
11441196   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
11451197   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1146   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
1147   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
1148   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1149   PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coinage ) )
1198   PORT_DIPUNKNOWN_DIPLOC( 0x0020, 0x0020, "SW2:6" )   // Unused according to the manual
1199   PORT_DIPUNKNOWN_DIPLOC( 0x0040, 0x0040, "SW2:7" )   // Unused according to the manual
1200   PORT_DIPUNKNOWN_DIPLOC( 0x0080, 0x0080, "SW2:8" )   // Unused according to the manual
1201   PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2,3")
11501202   PORT_DIPSETTING(      0x0100, DEF_STR( 4C_1C ) )
11511203   PORT_DIPSETTING(      0x0200, DEF_STR( 3C_1C ) )
11521204   PORT_DIPSETTING(      0x0300, DEF_STR( 2C_1C ) )
r4499r4500
11541206   PORT_DIPSETTING(      0x0600, DEF_STR( 1C_2C ) )
11551207   PORT_DIPSETTING(      0x0500, DEF_STR( 1C_3C ) )
11561208   PORT_DIPSETTING(      0x0400, DEF_STR( 1C_4C ) )
1157   PORT_DIPSETTING(      0x0000, "1 Coin / 99 Credits" )
1158   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Flip_Screen ) )
1209   PORT_DIPSETTING(      0x0000, "1 Coin / 99 Credits" )   // Free Play according to the manual
1210   PORT_DIPNAME( 0x1800, 0x1800, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:4,5")
1211   PORT_DIPSETTING(      0x1000, DEF_STR( Easy ) )
1212   PORT_DIPSETTING(      0x1800, DEF_STR( Normal ) )
1213   PORT_DIPSETTING(      0x0800, DEF_STR( Hard ) )
1214   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
1215   PORT_DIPUNKNOWN_DIPLOC( 0x2000, 0x2000, "SW1:6" )   // Unused according to the manual
1216   PORT_DIPNAME( 0x4000, 0x4000, "Pinfu with Tsumo" ) PORT_DIPLOCATION("SW1:7")
1217   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
1218   PORT_DIPSETTING(      0x4000, DEF_STR( Yes ) )
1219   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8")
11591220   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
11601221   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
1222INPUT_PORTS_END
11611223
1162   PORT_MODIFY("KEY1")
1163   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_NAME("P1 Mahjong Flip Flop?")   PORT_CODE(KEYCODE_2) //? seems a button,affects continue countdown
1224static INPUT_PORTS_START( suchipi )
1225   PORT_INCLUDE( kakumei2 )
1226
1227   PORT_MODIFY("DSW")
1228   PORT_DIPNAME( 0x1800, 0x1800, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:4,5")
1229   PORT_DIPSETTING(      0x1800, DEF_STR( Easy ) )
1230   PORT_DIPSETTING(      0x1000, DEF_STR( Normal ) )
1231   PORT_DIPSETTING(      0x0800, DEF_STR( Hard ) )
1232   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
1233   PORT_DIPNAME( 0x2000, 0x2000, "Campaign Mode" ) PORT_DIPLOCATION("SW1:6")
1234   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
1235   PORT_DIPSETTING(      0x2000, DEF_STR( Yes ) )
11641236INPUT_PORTS_END
11651237
11661238static const gfx_layout charlayout =
r4499r4500
12051277static MACHINE_RESET ( jalmah )
12061278{
12071279   respcount = 0;
1280   /*check if we are into service or normal mode*/
1281   switch(mcu_prg)
1282   {
1283      case MJZOOMIN_MCU:
1284      case DAIREIKA_MCU:
1285         test_mode = (~(input_port_read(machine, "SYSTEM")) & 0x0008) ? (1) : (0);
1286         break;
1287      case URASHIMA_MCU:
1288         test_mode = ((~(input_port_read(machine, "SYSTEM")) & 0x0008) || (~(input_port_read(machine, "DSW")) & 0x8000)) ? (1) : (0);
1289         break;
1290      case KAKUMEI_MCU:
1291      case KAKUMEI2_MCU:
1292      case SUCHIPI_MCU:
1293         test_mode = (~(input_port_read(machine, "DSW")) & 0x0004) ? (1) : (0);
1294         break;
1295   }
12081296}
12091297
12101298static MACHINE_DRIVER_START( jalmah )
r4499r4500
22562344}
22572345
22582346/*First version of the MCU*/
2259GAME( 1989, urashima, 0, urashima,   jalmah,     urashima, ROT0, "UPL",            "Otogizoushi Urashima Mahjong",         GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
2260GAME( 1989, daireika, 0, jalmah,   jalmah,     daireika, ROT0, "Jaleco / NMK", "Mahjong Daireikai",               GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
2261GAME( 1990, mjzoomin, 0, jalmah,   jalmah,     mjzoomin, ROT0, "Jaleco",       "Mahjong Channel Zoom In",            GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
2347GAME( 1989, urashima, 0, urashima,  urashima,   urashima, ROT0, "UPL",          "Otogizoushi Urashima Mahjong",         GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
2348GAME( 1989, daireika, 0, jalmah,    daireika,   daireika, ROT0, "Jaleco / NMK", "Mahjong Daireikai",                    GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
2349GAME( 1990, mjzoomin, 0, jalmah,    mjzoomin,   mjzoomin, ROT0, "Jaleco",       "Mahjong Channel Zoom In",              GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
22622350/*Second version of the MCU*/
2263GAME( 1990, kakumei,  0, jalmah,   jalmah2,    kakumei,  ROT0, "Jaleco",       "Mahjong Kakumei",                  GAME_IMPERFECT_GRAPHICS )
2264GAME( 1992, kakumei2, 0, jalmah,   jalmah2a,   kakumei2, ROT0, "Jaleco",       "Mahjong Kakumei 2 - Princess League",   GAME_IMPERFECT_GRAPHICS )
2265GAME( 1993, suchipi,  0, jalmah,   jalmah2a,   suchipi,  ROT0, "Jaleco",       "Idol Janshi Suchie-Pai Special",      GAME_IMPERFECT_GRAPHICS )
2351GAME( 1990, kakumei,  0, jalmah,    kakumei,    kakumei,  ROT0, "Jaleco",       "Mahjong Kakumei",                      GAME_IMPERFECT_GRAPHICS )
2352GAME( 1992, kakumei2, 0, jalmah,    kakumei2,   kakumei2, ROT0, "Jaleco",       "Mahjong Kakumei 2 - Princess League",  GAME_IMPERFECT_GRAPHICS )
2353GAME( 1993, suchipi,  0, jalmah,    suchipi,    suchipi,  ROT0, "Jaleco",       "Idol Janshi Suchie-Pai Special",       GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/ssrj.c
r4499r4500
6363   return retval;
6464}
6565
66static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
67   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
68   AM_RANGE(0xc000, 0xc7ff) AM_READ(ssrj_vram1_r)
69   AM_RANGE(0xc800, 0xcfff) AM_READ(ssrj_vram2_r)
70   AM_RANGE(0xd000, 0xd7ff) AM_READ(SMH_RAM)
71   AM_RANGE(0xd800, 0xdfff) AM_READ(ssrj_vram4_r)
72   AM_RANGE(0xe000, 0xe7ff) AM_READ(SMH_RAM)
73   AM_RANGE(0xe800, 0xefff) AM_READ(SMH_RAM)
66static ADDRESS_MAP_START( ssrj_map, ADDRESS_SPACE_PROGRAM, 8 )
67   AM_RANGE(0x0000, 0x7fff) AM_ROM
68   AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(ssrj_vram1_w) AM_BASE(&ssrj_vram1)
69   AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(ssrj_vram2_w) AM_BASE(&ssrj_vram2)
70   AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_BASE(&ssrj_vram3)
71   AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(ssrj_vram4_w) AM_BASE(&ssrj_vram4)
72   AM_RANGE(0xe000, 0xe7ff) AM_RAM
73   AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE(&ssrj_scrollram)
7474   AM_RANGE(0xf000, 0xf000) AM_READ_PORT("IN0")
7575   AM_RANGE(0xf001, 0xf001) AM_READ(ssrj_wheel_r)
7676   AM_RANGE(0xf002, 0xf002) AM_READ_PORT("IN2")
77   AM_RANGE(0xf401, 0xf401) AM_DEVREAD("ay", ay8910_r)
78ADDRESS_MAP_END
79
80static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
81   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
82   AM_RANGE(0xc000, 0xc7ff) AM_WRITE(ssrj_vram1_w) AM_BASE(&ssrj_vram1)
83   AM_RANGE(0xc800, 0xcfff) AM_WRITE(ssrj_vram2_w) AM_BASE(&ssrj_vram2)
84   AM_RANGE(0xd000, 0xd7ff) AM_WRITE(SMH_RAM) AM_BASE(&ssrj_vram3)
85   AM_RANGE(0xd800, 0xdfff) AM_WRITE(ssrj_vram4_w) AM_BASE(&ssrj_vram4)
86   AM_RANGE(0xe000, 0xe7ff) AM_WRITE(SMH_RAM)
87   AM_RANGE(0xe800, 0xefff) AM_WRITE(SMH_RAM) AM_BASE(&ssrj_scrollram)
8877   AM_RANGE(0xf003, 0xf003) AM_WRITENOP /* unknown */
78   AM_RANGE(0xf401, 0xf401) AM_DEVREAD("ay", ay8910_r)
8979   AM_RANGE(0xf400, 0xf401) AM_DEVWRITE("ay", ay8910_address_data_w)
90   AM_RANGE(0xfc00, 0xfc00) AM_WRITENOP /* unknown */
9180   AM_RANGE(0xf800, 0xf800) AM_WRITENOP /* wheel ? */
81   AM_RANGE(0xfc00, 0xfc00) AM_WRITENOP /* unknown */
9282ADDRESS_MAP_END
9383
9484static INPUT_PORTS_START( ssrj )
r4499r4500
165155
166156   /* basic machine hardware */
167157   MDRV_CPU_ADD("maincpu", Z80,8000000/2)
168   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
158   MDRV_CPU_PROGRAM_MAP(ssrj_map,0)
169159   MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
170160
171161   /* video hardware */
src/mame/drivers/harddriv.c
r4499r4500
598598   PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
599599
600600   PORT_START("8BADC3")      /* b00000 - 8 bit ADC 3 - shifter lever Y */
601   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(128) PORT_PLAYER(2)
601   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(128) PORT_CODE_DEC(KEYCODE_R) PORT_CODE_INC(KEYCODE_F)
602602
603603   PORT_START("8BADC4")      /* b00000 - 8 bit ADC 4 - shifter lever X*/
604   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(128) PORT_PLAYER(2)
604   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(128) PORT_CODE_DEC(KEYCODE_D) PORT_CODE_INC(KEYCODE_G)
605605
606606   PORT_START("8BADC5")      /* b00000 - 8 bit ADC 5 - wheel */
607607   PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(25) PORT_KEYDELTA(5)
r4499r4500
654654   PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
655655
656656   PORT_START("8BADC3")      /* b00000 - 8 bit ADC 3 - shifter lever Y */
657   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(128) PORT_PLAYER(2)
657   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(128) PORT_CODE_DEC(KEYCODE_R) PORT_CODE_INC(KEYCODE_F)
658658
659659   PORT_START("8BADC4")      /* b00000 - 8 bit ADC 4 - shifter lever X*/
660   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(128) PORT_PLAYER(2)
660   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(128) PORT_CODE_DEC(KEYCODE_D) PORT_CODE_INC(KEYCODE_G)
661661
662662   PORT_START("8BADC5")      /* b00000 - 8 bit ADC 5 - wheel */
663663   PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(25) PORT_KEYDELTA(5)
r4499r4500
959959   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
960960
961961   PORT_START("8BADC0")      /* b00000 - 8 bit ADC 0 - gas pedal */
962   PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(20) PORT_PLAYER(1)
962   PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(20)
963963
964964   PORT_START("8BADC1")      /* b00000 - 8 bit ADC 1 */
965965   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
src/mame/drivers/topspeed.c
r4499r4500
334334#define STEER_PORT_TAG   "STEER"
335335#define FAKE_PORT_TAG    "FAKE"
336336
337static READ16_HANDLER( topspeed_input_bypass_r )
337static READ8_HANDLER( topspeed_input_bypass_r )
338338{
339339   UINT8 port = TC0220IOC_port_r(space,0);   /* read port number */
340340   int steer = 0;
r4499r4500
475475static ADDRESS_MAP_START( topspeed_cpub_map, ADDRESS_SPACE_PROGRAM, 16 )
476476   AM_RANGE(0x000000, 0x01ffff) AM_ROM
477477   AM_RANGE(0x400000, 0X40ffff) AM_READWRITE(sharedram_r, sharedram_w) AM_BASE(&sharedram)
478   AM_RANGE(0x880000, 0x880001) AM_READWRITE(topspeed_input_bypass_r, TC0220IOC_halfword_portreg_w)
479   AM_RANGE(0x880002, 0x880003) AM_READWRITE(TC0220IOC_halfword_port_r, TC0220IOC_halfword_port_w)
478   AM_RANGE(0x880000, 0x880001) AM_READWRITE8(topspeed_input_bypass_r, TC0220IOC_portreg_w, 0x00ff)
479   AM_RANGE(0x880002, 0x880003) AM_READWRITE8(TC0220IOC_port_r, TC0220IOC_port_w, 0x00ff)
480480   AM_RANGE(0x900000, 0x9003ff) AM_READWRITE(topspeed_motor_r, topspeed_motor_w)   /* motor CPU */
481481ADDRESS_MAP_END
482482
src/mame/drivers/naughtyb.c
r4499r4500
176176
177177
178178
179static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
180   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
181   AM_RANGE(0x4000, 0x8fff) AM_READ(SMH_RAM)
179static ADDRESS_MAP_START( naughtyb_map, ADDRESS_SPACE_PROGRAM, 8 )
180   AM_RANGE(0x0000, 0x3fff) AM_ROM
181   AM_RANGE(0x4000, 0x7fff) AM_RAM
182   AM_RANGE(0x8000, 0x87ff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
183   AM_RANGE(0x8800, 0x8fff) AM_RAM AM_BASE(&naughtyb_videoram2)
184   AM_RANGE(0x9000, 0x97ff) AM_RAM_WRITE(naughtyb_videoreg_w)
185   AM_RANGE(0x9800, 0x9fff) AM_RAM AM_BASE(&naughtyb_scrollreg)
186   AM_RANGE(0xa000, 0xa7ff) AM_WRITE(pleiads_sound_control_a_w)
187   AM_RANGE(0xa800, 0xafff) AM_WRITE(pleiads_sound_control_b_w)
182188   AM_RANGE(0xb000, 0xb7ff) AM_READ(in0_port_r)   // IN0
183189   AM_RANGE(0xb800, 0xbfff) AM_READ(dsw0_port_r)   // DSW0
184190ADDRESS_MAP_END
185191
186static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
187   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
188   AM_RANGE(0x4000, 0x7fff) AM_WRITE(SMH_RAM)
189   AM_RANGE(0x8000, 0x87ff) AM_WRITE(SMH_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
190   AM_RANGE(0x8800, 0x8fff) AM_WRITE(SMH_RAM) AM_BASE(&naughtyb_videoram2)
191   AM_RANGE(0x9000, 0x97ff) AM_WRITE(naughtyb_videoreg_w)
192   AM_RANGE(0x9800, 0x9fff) AM_WRITE(SMH_RAM) AM_BASE(&naughtyb_scrollreg)
192static ADDRESS_MAP_START( popflame_map, ADDRESS_SPACE_PROGRAM, 8 )
193   AM_RANGE(0x0000, 0x3fff) AM_ROM
194   AM_RANGE(0x4000, 0x7fff) AM_RAM
195   AM_RANGE(0x8000, 0x87ff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
196   AM_RANGE(0x8800, 0x8fff) AM_RAM AM_BASE(&naughtyb_videoram2)
197   AM_RANGE(0x9000, 0x97ff) AM_RAM_WRITE(popflame_videoreg_w)
198   AM_RANGE(0x9800, 0x9fff) AM_RAM AM_BASE(&naughtyb_scrollreg)
193199   AM_RANGE(0xa000, 0xa7ff) AM_WRITE(pleiads_sound_control_a_w)
194200   AM_RANGE(0xa800, 0xafff) AM_WRITE(pleiads_sound_control_b_w)
201   AM_RANGE(0xb000, 0xb7ff) AM_READ(in0_port_r)   // IN0
202   AM_RANGE(0xb800, 0xbfff) AM_READ(dsw0_port_r)   // DSW0
195203ADDRESS_MAP_END
196204
197static ADDRESS_MAP_START( popflame_writemem, ADDRESS_SPACE_PROGRAM, 8 )
198   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
199   AM_RANGE(0x4000, 0x7fff) AM_WRITE(SMH_RAM)
200   AM_RANGE(0x8000, 0x87ff) AM_WRITE(SMH_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
201   AM_RANGE(0x8800, 0x8fff) AM_WRITE(SMH_RAM) AM_BASE(&naughtyb_videoram2)
202   AM_RANGE(0x9000, 0x97ff) AM_WRITE(popflame_videoreg_w)
203   AM_RANGE(0x9800, 0x9fff) AM_WRITE(SMH_RAM) AM_BASE(&naughtyb_scrollreg)
204   AM_RANGE(0xa000, 0xa7ff) AM_WRITE(pleiads_sound_control_a_w)
205   AM_RANGE(0xa800, 0xafff) AM_WRITE(pleiads_sound_control_b_w)
206ADDRESS_MAP_END
207205
208206
209
210207/***************************************************************************
211208
212209  Naughty Boy doesn't have VBlank interrupts.
r4499r4500
370367
371368   /* basic machine hardware */
372369   MDRV_CPU_ADD("maincpu", Z80, CLOCK_XTAL / 4) /* 12 MHz clock, divided by 4. CPU is a Z80A */
373   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
370   MDRV_CPU_PROGRAM_MAP(naughtyb_map,0)
374371   MDRV_CPU_VBLANK_INT("screen", naughtyb_interrupt)
375372
376373   /* video hardware */
r4499r4500
406403
407404   /* basic machine hardware */
408405   MDRV_CPU_ADD("maincpu", Z80, CLOCK_XTAL / 4) /* 12 MHz clock, divided by 4. CPU is a Z80A */
409   MDRV_CPU_PROGRAM_MAP(readmem,popflame_writemem)
406   MDRV_CPU_PROGRAM_MAP(popflame_map,0)
410407   MDRV_CPU_VBLANK_INT("screen", naughtyb_interrupt)
411408
412409   /* video hardware */
r4499r4500
721718   ROM_LOAD( "lifesci_hi.u7", 0x1c000, 0x4000, CRC(e03dfa12) SHA1(e668ea5bccc95d8a53a1de1d96583beef6636edb) )
722719ROM_END
723720
721ROM_START( trvmstrc )
722   ROM_REGION( 0x10000, "maincpu", 0 )
723   ROM_LOAD( "jaleco.30",   0x0000, 0x1000, CRC(9a80c5a7) SHA1(d8094572b946527a652f9b978a17f0a8a7acbddb) )
724   ROM_LOAD( "jaleco.28",   0x1000, 0x1000, CRC(70322d65) SHA1(498102236390f2e15444943e0fff8a53f37db083) )
725   ROM_LOAD( "jaleco.26",   0x2000, 0x1000, CRC(3431a2ba) SHA1(d704d5420e232e9d0ea65142aab063dbc20da8c5) )
726
727   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
728   ROM_LOAD( "jaleco.44",     0x0000, 0x1000, CRC(dac8cff7) SHA1(21da2b2ceb4a726d03b2e49a2df75ca66b89a197) )
729   ROM_LOAD( "jaleco.46",     0x1000, 0x1000, CRC(a97ab879) SHA1(67b86d056896f10e0c055fb58c97341cf75c3d17) )
730
731   ROM_REGION( 0x2000, "gfx2", ROMREGION_DISPOSE )
732   ROM_LOAD( "jaleco.48",     0x0000, 0x1000, CRC(79952015) SHA1(8407c2bab476a60d945d82201f01bf59ae9e0dad) )
733   ROM_LOAD( "jaleco.50",     0x1000, 0x1000, CRC(f09da428) SHA1(092d0eea41c8bbd48d7a3aff54c15f85262b21ff) )
734
735   ROM_REGION( 0x0200, "proms", 0 )
736   ROM_LOAD( "jaleco.64",     0x0000, 0x0100, CRC(e9915da8) SHA1(7c64ea76e39eaff724179d52ff5482df363fcf56) )  /* palette low & high bits */
737   ROM_RELOAD(              0x0100, 0x0100 )
738
739   ROM_REGION( 0x20000, "user1", 0 )   /* Questions roms */
740   ROM_LOAD( "jaleco.2", 0x00000, 0x4000, CRC(1ad4c446) SHA1(daef6e4bea69002a52bca016cf33d2726eac4e66) ) //car boats and planes
741   ROM_LOAD( "jaleco.1", 0x04000, 0x4000, CRC(9c308849) SHA1(b40a5c238c0116ac92f3076fbec02b3d7d209883) )
742   ROM_LOAD( "jaleco.4", 0x08000, 0x4000, CRC(38dd45cd) SHA1(e701de1509a898fe400a6284794ead6bee8ccba3) ) //movies
743   ROM_LOAD( "jaleco.3", 0x0c000, 0x4000, CRC(83b5465b) SHA1(828500a008926057f10d40ac9aaaa14d2890181e) )
744   ROM_LOAD( "jaleco.6", 0x10000, 0x4000, CRC(4a2263a7) SHA1(63f2f79261d508c9bba3d73d78f7dce5d348b6d4) ) //sports II
745   ROM_LOAD( "jaleco.5", 0x14000, 0x4000, CRC(bd31f382) SHA1(ec04a5d4a5fc8be059abf3c21c65cd970e569d44) )
746   ROM_LOAD( "jaleco.8", 0x18000, 0x4000, CRC(b73f2e31) SHA1(4390152e053118c31ed74fe850ea7124c0e7b731) ) //sex II
747   ROM_LOAD( "jaleco.7", 0x1c000, 0x4000, CRC(bf654110) SHA1(5229f5e6973a04c53572ea94c14d79a238c0e90f) )
748ROM_END
749
724750/* These 'Trivia Genius' roms were found on a Naughty Boy pcb, factory?-retooled somewhat to use 8 2732s instead of 16 2716s. The pcb is a real Naughty Boy PCB, with Jaleco markings. Latest chip datecodes on the PCB are from 85 (on the two proms) but the other chips are dated 81 and 82 (which makes sense if they're formerly naughty boy pcbs).
725751This may be a hacked/bootlegged version of trivia master, hacked to run on a naughty boy pcb, or (if ALL versions of trivia master ran on naughty boy pcbs) may be a 'second source bootleg', a bootleg of the trivia master naughty boy conversion.
726752*/
r4499r4500
801827GAME( 1985, trvmstr,  0,      naughtyb, trvmstr,  trvmstr,  ROT90, "Enerdyne Technologies Inc.", "Trivia Master (set 1)", 0 )
802828GAME( 1985, trvmstra, trvmstr,  naughtyb, trvmstr,  trvmstr,  ROT90, "Enerdyne Technologies Inc.", "Trivia Master (set 2)", 0 )
803829GAME( 1985, trvmstrb, trvmstr,  naughtyb, trvmstr,  trvmstr,  ROT90, "Enerdyne Technologies Inc.", "Trivia Master (set 3)", 0 )
804GAME( 1985, trvgns,   0,      naughtyb, trvmstr,  trvmstr,  ROT90, "bootleg?", "Trivia Genius", 0 )
830GAME( 1985, trvmstrc, trvmstr,  naughtyb, trvmstr,  trvmstr,  ROT90, "Enerdyne Technologies Inc.", "Trivia Master (set 4)", 0 )
831GAME( 1985, trvgns,   trvmstr,   naughtyb, trvmstr,  trvmstr,  ROT90, "bootleg", "Trivia Genius", 0 )
src/mame/drivers/taito_z.c
r4499r4500
11031103                       GAME INPUTS
11041104**********************************************************/
11051105
1106static READ16_HANDLER( contcirc_input_bypass_r )
1106static READ8_HANDLER( contcirc_input_bypass_r )
11071107{
11081108   /* Bypass TC0220IOC controller for analog input */
11091109
r4499r4500
11431143}
11441144
11451145
1146static READ16_HANDLER( chasehq_input_bypass_r )
1146static READ8_HANDLER( chasehq_input_bypass_r )
11471147{
11481148   /* Bypass TC0220IOC controller for extra inputs */
11491149
r4499r4500
15441544   AM_RANGE(0x000000, 0x03ffff) AM_ROM
15451545   AM_RANGE(0x080000, 0x083fff) AM_RAM
15461546   AM_RANGE(0x084000, 0x087fff) AM_RAM AM_SHARE(1)
1547   AM_RANGE(0x100000, 0x100001) AM_READWRITE(contcirc_input_bypass_r, TC0220IOC_halfword_portreg_w)
1548   AM_RANGE(0x100002, 0x100003) AM_READWRITE(TC0220IOC_halfword_port_r, TC0220IOC_halfword_port_w) /* (actually game uses TC040IOC) */
1547   AM_RANGE(0x100000, 0x100001) AM_READWRITE8(contcirc_input_bypass_r, TC0220IOC_portreg_w, 0x00ff)
1548   AM_RANGE(0x100002, 0x100003) AM_READWRITE8(TC0220IOC_port_r, TC0220IOC_port_w, 0x00ff) /* (actually game uses TC040IOC) */
15491549   AM_RANGE(0x200000, 0x200003) AM_READWRITE(taitoz_sound_r, taitoz_sound_w)
15501550ADDRESS_MAP_END
15511551
r4499r4500
15551555   AM_RANGE(0x100000, 0x107fff) AM_RAM
15561556   AM_RANGE(0x108000, 0x10bfff) AM_RAM AM_SHARE(1)
15571557   AM_RANGE(0x10c000, 0x10ffff) AM_RAM
1558   AM_RANGE(0x400000, 0x400001) AM_READWRITE(chasehq_input_bypass_r, TC0220IOC_halfword_portreg_w)
1559   AM_RANGE(0x400002, 0x400003) AM_READWRITE(TC0220IOC_halfword_port_r, TC0220IOC_halfword_port_w)
1558   AM_RANGE(0x400000, 0x400001) AM_READWRITE8(chasehq_input_bypass_r, TC0220IOC_portreg_w, 0x00ff)
1559   AM_RANGE(0x400002, 0x400003) AM_READWRITE8(TC0220IOC_port_r, TC0220IOC_port_w, 0x00ff)
15601560   AM_RANGE(0x800000, 0x800001) AM_WRITE(cpua_ctrl_w)
15611561   AM_RANGE(0x820000, 0x820003) AM_READWRITE(taitoz_sound_r, taitoz_sound_w)
15621562   AM_RANGE(0xa00000, 0xa00007) AM_READWRITE(TC0110PCR_word_r, TC0110PCR_step1_word_w)   /* palette */
r4499r4500
15911591   AM_RANGE(0x100000, 0x103fff) AM_RAM
15921592   AM_RANGE(0x104000, 0x107fff) AM_RAM AM_SHARE(1)
15931593   AM_RANGE(0x200000, 0x200003) AM_READWRITE(taitoz_sound_r, taitoz_sound_w)
1594   AM_RANGE(0x300000, 0x300001) AM_READWRITE(TC0220IOC_halfword_portreg_r, TC0220IOC_halfword_portreg_w)
1595   AM_RANGE(0x300002, 0x300003) AM_READWRITE(TC0220IOC_halfword_port_r, TC0220IOC_halfword_port_w)
1594   AM_RANGE(0x300000, 0x300001) AM_READWRITE8(TC0220IOC_portreg_r, TC0220IOC_portreg_w, 0x00ff)
1595   AM_RANGE(0x300002, 0x300003) AM_READWRITE8(TC0220IOC_port_r, TC0220IOC_port_w, 0x00ff)
15961596ADDRESS_MAP_END
15971597
15981598
r4499r4500
16001600   AM_RANGE(0x000000, 0x07ffff) AM_ROM
16011601   AM_RANGE(0x100000, 0x10ffff) AM_RAM
16021602   AM_RANGE(0x110000, 0x113fff) AM_RAM AM_SHARE(1)
1603   AM_RANGE(0x400000, 0x40000f) AM_READWRITE(TC0220IOC_halfword_r, TC0220IOC_halfword_w)
1603   AM_RANGE(0x400000, 0x40000f) AM_READWRITE8(TC0220IOC_r, TC0220IOC_w, 0x00ff)
16041604   AM_RANGE(0x600000, 0x600001) AM_WRITE(cpua_noz80_ctrl_w)
16051605   AM_RANGE(0x800000, 0x800007) AM_READWRITE(bshark_stick_r, bshark_stick_w)
16061606   AM_RANGE(0xa00000, 0xa01fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
r4499r4500
16271627   AM_RANGE(0x100000, 0x107fff) AM_RAM
16281628   AM_RANGE(0x108000, 0x10bfff) AM_RAM AM_SHARE(1)
16291629   AM_RANGE(0x10c000, 0x10ffff) AM_RAM
1630   AM_RANGE(0x200000, 0x20000f) AM_READWRITE(TC0220IOC_halfword_r, TC0220IOC_halfword_w)
1630   AM_RANGE(0x200000, 0x20000f) AM_READWRITE8(TC0220IOC_r, TC0220IOC_w, 0x00ff)
16311631   AM_RANGE(0x200010, 0x20001f) AM_READ(sci_steer_input_r)
16321632//  AM_RANGE(0x400000, 0x400001) AM_WRITE(cpua_ctrl_w)  // ?? doesn't seem to fit what's written
16331633   AM_RANGE(0x420000, 0x420003) AM_READWRITE(taitoz_sound_r, taitoz_sound_w)
r4499r4500
16501650   AM_RANGE(0x000000, 0x07ffff) AM_ROM
16511651   AM_RANGE(0x100000, 0x10ffff) AM_RAM
16521652   AM_RANGE(0x110000, 0x113fff) AM_RAM AM_SHARE(1)
1653   AM_RANGE(0x400000, 0x40000f) AM_READWRITE(TC0220IOC_halfword_r, TC0220IOC_halfword_w)
1653   AM_RANGE(0x400000, 0x40000f) AM_READWRITE8(TC0220IOC_r, TC0220IOC_w, 0x00ff)
16541654   AM_RANGE(0x800000, 0x800001) AM_WRITE(cpua_ctrl_w)
16551655   AM_RANGE(0x820000, 0x820003) AM_READWRITE(taitoz_sound_r, taitoz_sound_w)
16561656   AM_RANGE(0xa00000, 0xa00007) AM_READWRITE(TC0110PCR_word_r, TC0110PCR_step1_word_w)   /* palette */
r4499r4500
16871687   AM_RANGE(0x000000, 0x03ffff) AM_ROM
16881688   AM_RANGE(0x100000, 0x103fff) AM_RAM
16891689   AM_RANGE(0x104000, 0x107fff) AM_RAM AM_SHARE(1)
1690   AM_RANGE(0x200000, 0x20000f) AM_READWRITE(TC0220IOC_halfword_r, TC0220IOC_halfword_w)
1690   AM_RANGE(0x200000, 0x20000f) AM_READWRITE8(TC0220IOC_r, TC0220IOC_w, 0x00ff)
16911691   AM_RANGE(0x300000, 0x300003) AM_READWRITE(taitoz_sound_r, taitoz_sound_w)
16921692   AM_RANGE(0x800800, 0x80083f) AM_READ(aquajack_unknown_r) // Read regularly after write to 800800...
16931693//  AM_RANGE(0x800800, 0x800801) AM_WRITE(taitoz_unknown_w)
src/mame/drivers/playch10.c
r4499r4500
333333static WRITE8_HANDLER( sprite_dma_w )
334334{
335335   int source = ( data & 7 );
336   ppu2c0x_spriteram_dma( space, 0, source );
336   ppu2c0x_spriteram_dma( space, devtag_get_device(space->machine, "ppu"), source );
337337}
338338
339339static NVRAM_HANDLER( playch10 )
r4499r4500
407407
408408static ADDRESS_MAP_START( cart_map, ADDRESS_SPACE_PROGRAM, 8 )
409409   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_MIRROR(0x1800) AM_BASE(&work_ram)
410   AM_RANGE(0x2000, 0x3fff) AM_READWRITE(ppu2c0x_0_r, ppu2c0x_0_w)
410   AM_RANGE(0x2000, 0x3fff) AM_DEVREADWRITE("ppu", ppu2c0x_r, ppu2c0x_w)
411411   AM_RANGE(0x4011, 0x4011) AM_DEVWRITE("dac", dac_w)
412412   AM_RANGE(0x4000, 0x4013) AM_DEVREADWRITE("nes", nes_psg_r, nes_psg_w)
413413   AM_RANGE(0x4014, 0x4014) AM_WRITE(sprite_dma_w)
r4499r4500
717717   MDRV_VIDEO_START(playch10)
718718   MDRV_VIDEO_UPDATE(playch10)
719719
720   MDRV_PPU2C03B_ADD("ppu", playch10_ppu_interface)
721
720722   // sound hardware
721723   MDRV_SPEAKER_STANDARD_MONO("mono")
722724   MDRV_SOUND_ADD("nes", NES, N2A03_DEFAULTCLOCK)
r4499r4500
735737static MACHINE_DRIVER_START( playch10_hboard )
736738   MDRV_IMPORT_FROM(playch10)
737739   MDRV_VIDEO_START(playch10_hboard)
740
741   MDRV_DEVICE_REMOVE("ppu")
742   MDRV_PPU2C03B_ADD("ppu", playch10_ppu_interface)
738743MACHINE_DRIVER_END
739744
740745/***************************************************************************
src/mame/drivers/mystwarr.c
r4499r4500
13411341   ROM_LOAD( "128a07.1d", 0x200000, 2*1024*1024, CRC(db79a66e) SHA1(b7e118ed26bac557038e8ae6cb77f23f3da5646f) )
13421342ROM_END
13431343
1344ROM_START( mystwarj )
1345   /* main program */
1346   ROM_REGION( 0x200000, "maincpu", 0 )
1347   ROM_LOAD16_BYTE( "128jaa01.20f", 0x000000, 0x40000, CRC(49c37bfe) SHA1(177843899055476c9d2716ba494ac3892993eee5) )
1348   ROM_LOAD16_BYTE( "128jaa02.20g", 0x000001, 0x40000, CRC(e39fb3bb) SHA1(0467b51f66c32ffa8fae3b00d43c6d4aa19b24ef) )
1349   ROM_LOAD16_BYTE( "128a03.19f",   0x100000, 0x80000, CRC(e98094f3) SHA1(a3f9b804ff487f792a00ce85a383868ab0b1b5d8) )
1350   ROM_LOAD16_BYTE( "128a04.19g",   0x100001, 0x80000, CRC(88c6a3e4) SHA1(7c2361f716a2320730a3dd6723a271e349ad61c3) )
1351
1352   /* sound program */
1353   ROM_REGION( 0x030000, "soundcpu", 0 )
1354   ROM_LOAD("128a05.6b", 0x000000, 0x020000, CRC(0e5194e0) SHA1(83356158d561f1b8e21f6ae5936b61da834a0545) )
1355   ROM_RELOAD(           0x010000, 0x020000 )
1356
1357   /* tiles */
1358   ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
1359   ROM_LOADTILE_WORD( "128a08.1h", 0x000000, 1*1024*1024, CRC(63d6cfa0) SHA1(324bf25cf79aa030d2dcc94a53c1984eb8abec3a) )
1360   ROM_LOADTILE_WORD( "128a09.1k", 0x000002, 1*1024*1024, CRC(573a7725) SHA1(f2fef32053ed2a65c6c3ddd3e1657a866aa80b3e) )
1361   ROM_LOADTILE_BYTE( "128a10.3h", 0x000004, 512*1024, CRC(558e545a) SHA1(cac53e545f3f8980d431443f2c3b8b95e6077d1c) )
1362
1363   /* sprites */
1364   ROM_REGION( 0x500000, "gfx2", ROMREGION_ERASE00 )
1365   ROM_LOAD64_WORD( "128a16.22k", 0x000000, 1*1024*1024, CRC(459b6407) SHA1(e4dace4912f9558bee75a8e95ee2637f5e950b47) )
1366   ROM_LOAD64_WORD( "128a15.20k", 0x000002, 1*1024*1024, CRC(6bbfedf4) SHA1(0b3acb2b34c722ddc60c0e64e12baa1f225e4fbb) )
1367   ROM_LOAD64_WORD( "128a14.19k", 0x000004, 1*1024*1024, CRC(f7bd89dd) SHA1(c9b2ebd5a49840f8b260d53c25cfcc238d21c75c) )
1368   ROM_LOAD64_WORD( "128a13.17k", 0x000006, 1*1024*1024, CRC(e89b66a2) SHA1(fce6e56d1759ffe987766426ecb28e9015a500b7) )
1369   ROM_LOAD16_BYTE( "128a12.12k", 0x400000, 512*1024, CRC(63de93e2) SHA1(c9a50e7beff1cbbc5d5820664adbd54d52782c54) )
1370   ROM_LOAD16_BYTE( "128a11.10k", 0x400001, 512*1024, CRC(4eac941a) SHA1(c0a33f4b975ebee217fd335001839992f4c0bdc8) )
1371
1372   /* road generator */
1373   ROM_REGION( 0x40000, "gfx3", ROMREGION_ERASE00 )
1374
1375   /* sound data */
1376   ROM_REGION( 0x400000, "shared", 0 )
1377   ROM_LOAD( "128a06.2d", 0x000000, 2*1024*1024, CRC(88ed598c) SHA1(3c123e26b3a12541df77b368bc0e0d486f5622b6) )
1378   ROM_LOAD( "128a07.1d", 0x200000, 2*1024*1024, CRC(db79a66e) SHA1(b7e118ed26bac557038e8ae6cb77f23f3da5646f) )
1379ROM_END
1380
13441381ROM_START( viostorm )
13451382   /* main program */
13461383   ROM_REGION( 0x200000, "maincpu", 0)
r4499r4500
14051442   ROM_LOAD( "168a07.1e", 0x200000, 2*1024*1024, CRC(fdbbf8cc) SHA1(a8adf72a25fe2b9c4c338350d02c92deb5f8c8e9) )
14061443ROM_END
14071444
1408
14091445ROM_START( viostmub )
14101446   /* main program */
14111447   ROM_REGION( 0x200000, "maincpu", 0)
r4499r4500
20112047/*           ROM       parent    machine   inp       init */
20122048GAME( 1993, mystwarr, 0,        mystwarr, mystwarr, 0,        ROT0,  "Konami", "Mystic Warriors (ver EAA)", GAME_IMPERFECT_GRAPHICS )
20132049GAME( 1993, mystwaru, mystwarr, mystwarr, mystwarr, 0,        ROT0,  "Konami", "Mystic Warriors (ver UAA)", GAME_IMPERFECT_GRAPHICS )
2050GAME( 1993, mystwarj, mystwarr, mystwarr, mystwarr, 0,        ROT0,  "Konami", "Mystic Warriors (ver JAA)", GAME_IMPERFECT_GRAPHICS )
20142051GAME( 1993, mmaulers, 0,        dadandrn, dadandrn, 0,        ROT0,  "Konami", "Monster Maulers (ver EAA)", GAME_IMPERFECT_GRAPHICS )
20152052GAME( 1993, dadandrn, mmaulers, dadandrn, dadandrn, 0,        ROT0,  "Konami", "Kyukyoku Sentai Dadandarn (ver JAA)", GAME_IMPERFECT_GRAPHICS )
20162053GAME( 1993, viostorm, 0,        viostorm, viostorm, 0,        ROT0,  "Konami", "Violent Storm (ver EAB)", GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/taito_f2.c
r4499r4500
186186Roz layer is one pixel out vertically when screen flipped.
187187
188188
189Cameltry (camltrya)
189Cameltry (cameltrya)
190190--------
191191
192192Alt version with YM2203 and M6295
r4499r4500
305305#include "includes/cchip.h"
306306
307307
308static INT32 banknum = 0;
309308static INT32 mjnquest_input;
310309
311310
r4499r4500
313312                        GAME INPUTS
314313**********************************************************/
315314
316static WRITE16_HANDLER( taitof2_watchdog_w )
317{
318   watchdog_reset(space->machine);
319}
320
321315static WRITE16_HANDLER( growl_coin_word_w )   /* what about coins 3&4 ?? */
322316{
323317   if (ACCESSING_BITS_0_7)
r4499r4500
359353   }
360354}
361355
362static READ16_HANDLER( growl_dsw_r )
363{
364    switch (offset)
365    {
366         case 0x00:
367              return input_port_read(space->machine, "DSWA");
368
369         case 0x01:
370              return input_port_read(space->machine, "DSWB");
371    }
372
373   logerror("CPU #0 PC %06x: warning - read unmapped dsw_r offset %06x\n", cpu_get_pc(space->cpu), offset);
374
375   return 0xff;
376}
377
378static READ16_HANDLER( growl_input_r )
379{
380    switch (offset)
381    {
382         case 0x00:
383              return input_port_read(space->machine, "IN0");
384
385         case 0x01:
386              return input_port_read(space->machine, "IN1");
387
388         case 0x02:
389              return input_port_read(space->machine, "IN2");
390
391    }
392
393   logerror("CPU #0 PC %06x: warning - read unmapped input_r offset %06x\n", cpu_get_pc(space->cpu), offset);
394
395   return 0xff;
396}
397
398static READ16_HANDLER( footchmp_input_r )
399{
400   switch (offset)
401   {
402      case 0x00:
403         return input_port_read(space->machine, "DSWA");
404
405      case 0x01:
406         return input_port_read(space->machine, "DSWB");
407
408      case 0x02:
409         return input_port_read(space->machine, "IN2");
410
411//      case 0x03:
412//          return (coin_word & mem_mask);
413
414      case 0x05:
415         return input_port_read(space->machine, "IN0");
416
417      case 0x06:
418         return input_port_read(space->machine, "IN1");
419
420      case 0x07:
421         return input_port_read(space->machine, "IN3");
422
423      case 0x08:
424         return input_port_read(space->machine, "IN4");
425    }
426
427   logerror("CPU #0 PC %06x: warning - read unmapped input offset %06x\n", cpu_get_pc(space->cpu), offset);
428
429   return 0xff;
430}
431
432356static READ16_HANDLER( ninjak_input_r )
433357{
434358   switch (offset)
r4499r4500
488412   return 0;
489413}
490414
491static READ16_HANDLER( driftout_paddle_r )
492{
493    switch (offset)
494    {
495         case 0x00:
496              return input_port_read(space->machine, "PADDLE1");
497
498         case 0x01:
499              return input_port_read(space->machine, "PADDLE2");
500    }
501
502   logerror("CPU #0 PC %06x: warning - read unmapped paddle offset %06x\n", cpu_get_pc(space->cpu), offset);
503
504        return 0xff;
505}
506
507static READ16_HANDLER( deadconx_input_r )
508{
509   switch (offset)
510   {
511      case 0x00:
512         return input_port_read(space->machine, "DSWA");
513
514      case 0x01:
515         return input_port_read(space->machine, "DSWB");
516
517      case 0x02:
518         return input_port_read(space->machine, "IN2");
519
520//      case 0x03:
521//          return (coin_word & mem_mask);
522
523      case 0x05:
524         return input_port_read(space->machine, "IN0");
525
526      case 0x06:
527         return input_port_read(space->machine, "IN1");
528    }
529
530   logerror("CPU #0 PC %06x: warning - read unmapped input offset %06x\n", cpu_get_pc(space->cpu), offset);
531
532   return 0xff;
533}
534
535415static READ16_HANDLER( mjnquest_dsw_r )
536416{
537417    switch (offset)
r4499r4500
583463    mjnquest_input = (data >> 6);
584464}
585465
586static READ16_HANDLER( quizhq_input1_r )
587{
588    switch (offset)
589    {
590         case 0x00:
591              return input_port_read(space->machine, "DSWB");
592
593         case 0x01:
594              return input_port_read(space->machine, "IN0");
595    }
596
597   logerror("CPU #0 PC %06x: warning - read unmapped input_r offset %06x\n", cpu_get_pc(space->cpu), offset);
598
599   return 0xff;
600}
601
602static READ16_HANDLER( quizhq_input2_r )
603{
604    switch (offset)
605    {
606         case 0x00:
607              return input_port_read(space->machine, "DSWA");
608
609         case 0x01:
610              return input_port_read(space->machine, "IN1");
611
612         case 0x02:
613              return input_port_read(space->machine, "IN2");
614    }
615
616   logerror("CPU #0 PC %06x: warning - read unmapped input_r offset %06x\n", cpu_get_pc(space->cpu), offset);
617
618   return 0xff;
619}
620
621static READ16_HANDLER( yesnoj_input_r )
622{
623    switch (offset)
624    {
625         case 0x00:
626              return input_port_read(space->machine, "IN0");
627
628         case 0x01:
629              return input_port_read(space->machine, "IN1");
630
631         case 0x02:
632              return input_port_read(space->machine, "IN2");
633    }
634#ifdef MAME_DEBUG
635   logerror("CPU #0 PC %06x: warning - read unmapped input_r offset %06x\n", cpu_get_pc(space->cpu), offset);
636#endif
637
638   return 0x0;
639}
640
641static READ16_HANDLER( yesnoj_dsw_r )
642{
643   return input_port_read(space->machine, "DSWA");
644}
645
646466/******************************************************************
647467                       INTERRUPTS (still a WIP)
648468
r4499r4500
803623                            SOUND
804624****************************************************************/
805625
806static void reset_sound_region(running_machine *machine)
807{
808   memory_set_bankptr(machine,  2, memory_region(machine, "audiocpu") + (banknum * 0x4000) + 0x10000 );
809}
810
811626static WRITE8_HANDLER( sound_bankswitch_w )
812627{
813   banknum = (data - 1) & 7;
814   reset_sound_region(space->machine);
628   memory_set_bank(space->machine, 2, (data - 1) & 7);
815629
816630#ifdef MAME_DEBUG
817   if (banknum>2) logerror("CPU #1 switch to ROM bank %06x: should only happen if Z80 prg rom is 128K!\n",banknum);
631   if (((data - 1) & 7)>2) logerror("CPU #1 switch to ROM bank %06x: should only happen if Z80 prg rom is 128K!\n",(data - 1) & 7);
818632#endif
819633}
820634
821635
822static READ16_HANDLER( taitof2_sound_r )
823{
824   if (offset == 1 && ACCESSING_BITS_0_7)
825      return (taitosound_comm_r(space,0));
826   else return 0;
827}
828636
829static READ16_HANDLER( taitof2_msb_sound_r )
830{
831   if (offset == 1 && ACCESSING_BITS_8_15)
832      return (taitosound_comm_r(space,0));
833   else return 0;
834}
835
836
837637static INT32 driveout_sound_latch = 0;
838638
839639
r4499r4500
891691                     MEMORY STRUCTURES
892692***********************************************************/
893693
894static ADDRESS_MAP_START( finalb_readmem, ADDRESS_SPACE_PROGRAM, 16 )
895   AM_RANGE(0x000000, 0x03ffff) AM_READ(SMH_ROM)
896   AM_RANGE(0x100000, 0x10ffff) AM_READ(SMH_RAM)
897   AM_RANGE(0x200000, 0x200007) AM_READ(TC0110PCR_word_r)   /* palette */
898   AM_RANGE(0x300000, 0x30000f) AM_READ(TC0220IOC_halfword_r)   /* I/O */
899   AM_RANGE(0x320000, 0x320003) AM_READ(taitof2_sound_r)
900   AM_RANGE(0x800000, 0x80ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
901   AM_RANGE(0x820000, 0x82000f) AM_READ(TC0100SCN_ctrl_word_0_r)
902   AM_RANGE(0x900000, 0x90ffff) AM_READ(SMH_RAM)
903ADDRESS_MAP_END
904
905static ADDRESS_MAP_START( finalb_writemem, ADDRESS_SPACE_PROGRAM, 16 )
906   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(SMH_ROM)
907   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM)
908   AM_RANGE(0x200000, 0x200007) AM_WRITE(TC0110PCR_word_w)   /* palette */
909   AM_RANGE(0x300000, 0x30000f) AM_WRITE(TC0220IOC_halfword_w)   /* I/O */
694static ADDRESS_MAP_START( finalb_map, ADDRESS_SPACE_PROGRAM, 16 )
695   AM_RANGE(0x000000, 0x03ffff) AM_ROM
696   AM_RANGE(0x100000, 0x10ffff) AM_RAM
697   AM_RANGE(0x200000, 0x200007) AM_READWRITE(TC0110PCR_word_r, TC0110PCR_word_w)   /* palette */
698   AM_RANGE(0x300000, 0x30000f) AM_READWRITE8(TC0220IOC_r, TC0220IOC_w, 0x00ff)   /* I/O */
910699   AM_RANGE(0x320000, 0x320001) AM_WRITE8(taitosound_port_w, 0x00ff)
911   AM_RANGE(0x320002, 0x320003) AM_WRITE8(taitosound_comm_w, 0x00ff)
912   AM_RANGE(0x800000, 0x80ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
700   AM_RANGE(0x320002, 0x320003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0x00ff)
701   AM_RANGE(0x800000, 0x80ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
913702   AM_RANGE(0x810000, 0x81ffff) AM_WRITENOP   /* error in game init code ? */
914   AM_RANGE(0x820000, 0x82000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
915   AM_RANGE(0x900000, 0x90ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
703   AM_RANGE(0x820000, 0x82000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
704   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
916705   AM_RANGE(0xb00002, 0xb00003) AM_WRITENOP   /* ?? */
917706ADDRESS_MAP_END
918707
919static ADDRESS_MAP_START( dondokod_readmem, ADDRESS_SPACE_PROGRAM, 16 )
920   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
921   AM_RANGE(0x100000, 0x10ffff) AM_READ(SMH_RAM)
922   AM_RANGE(0x200000, 0x201fff) AM_READ(SMH_RAM)
923   AM_RANGE(0x300000, 0x30000f) AM_READ(TC0220IOC_halfword_r)   /* I/O */
924   AM_RANGE(0x320000, 0x320003) AM_READ(taitof2_msb_sound_r)
925   AM_RANGE(0x800000, 0x80ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
926   AM_RANGE(0x820000, 0x82000f) AM_READ(TC0100SCN_ctrl_word_0_r)
927   AM_RANGE(0x900000, 0x90ffff) AM_READ(SMH_RAM)
928   AM_RANGE(0xa00000, 0xa01fff) AM_READ(TC0280GRD_word_r)
929ADDRESS_MAP_END
930
931static ADDRESS_MAP_START( dondokod_writemem, ADDRESS_SPACE_PROGRAM, 16 )
932   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
933   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM)
934   AM_RANGE(0x200000, 0x201fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
935   AM_RANGE(0x300000, 0x30000f) AM_WRITE(TC0220IOC_halfword_w)   /* I/O */
708static ADDRESS_MAP_START( dondokod_map, ADDRESS_SPACE_PROGRAM, 16 )
709   AM_RANGE(0x000000, 0x07ffff) AM_ROM
710   AM_RANGE(0x100000, 0x10ffff) AM_RAM
711   AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
712   AM_RANGE(0x300000, 0x30000f) AM_READWRITE8(TC0220IOC_r, TC0220IOC_w, 0x00ff)   /* I/O */
936713   AM_RANGE(0x320000, 0x320001) AM_WRITE8(taitosound_port_w, 0xff00)
937   AM_RANGE(0x320002, 0x320003) AM_WRITE8(taitosound_comm_w, 0xff00)
938   AM_RANGE(0x800000, 0x80ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
939   AM_RANGE(0x820000, 0x82000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
940   AM_RANGE(0x900000, 0x90ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
941   AM_RANGE(0xa00000, 0xa01fff) AM_WRITE(TC0280GRD_word_w)   /* ROZ tilemap */
714   AM_RANGE(0x320002, 0x320003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
715   AM_RANGE(0x800000, 0x80ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
716   AM_RANGE(0x820000, 0x82000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
717   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
718   AM_RANGE(0xa00000, 0xa01fff) AM_READWRITE(TC0280GRD_word_r, TC0280GRD_word_w)   /* ROZ tilemap */
942719   AM_RANGE(0xa02000, 0xa0200f) AM_WRITE(TC0280GRD_ctrl_word_w)
943   AM_RANGE(0xb00000, 0xb0001f) AM_WRITE(TC0360PRI_halfword_w)   /* ?? */
720   AM_RANGE(0xb00000, 0xb0001f) AM_WRITE8(TC0360PRI_w, 0x00ff)   /* ?? */
944721ADDRESS_MAP_END
945722
946static ADDRESS_MAP_START( megab_readmem, ADDRESS_SPACE_PROGRAM, 16 )
947   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
948   AM_RANGE(0x100000, 0x100003) AM_READ(taitof2_msb_sound_r)
949   AM_RANGE(0x120000, 0x12000f) AM_READ(TC0220IOC_halfword_r)   /* I/O */
950   AM_RANGE(0x180000, 0x180fff) AM_READ(cchip2_word_r)
951   AM_RANGE(0x200000, 0x20ffff) AM_READ(SMH_RAM)
952   AM_RANGE(0x300000, 0x301fff) AM_READ(SMH_RAM)
953   AM_RANGE(0x600000, 0x60ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
954   AM_RANGE(0x610000, 0x61ffff) AM_READ(SMH_RAM) /* unused? */
955   AM_RANGE(0x620000, 0x62000f) AM_READ(TC0100SCN_ctrl_word_0_r)
956   AM_RANGE(0x800000, 0x80ffff) AM_READ(SMH_RAM)
957ADDRESS_MAP_END
958
959static ADDRESS_MAP_START( megab_writemem, ADDRESS_SPACE_PROGRAM, 16 )
960   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
723static ADDRESS_MAP_START( megab_map, ADDRESS_SPACE_PROGRAM, 16 )
724   AM_RANGE(0x000000, 0x07ffff) AM_ROM
961725   AM_RANGE(0x100000, 0x100001) AM_WRITE8(taitosound_port_w, 0xff00)
962   AM_RANGE(0x100002, 0x100003) AM_WRITE8(taitosound_comm_w, 0xff00)
963   AM_RANGE(0x120000, 0x12000f) AM_WRITE(TC0220IOC_halfword_w)   /* I/O */
964   AM_RANGE(0x180000, 0x180fff) AM_WRITE(cchip2_word_w) AM_BASE(&cchip2_ram)
965   AM_RANGE(0x200000, 0x20ffff) AM_WRITE(SMH_RAM)
966   AM_RANGE(0x300000, 0x301fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
967   AM_RANGE(0x400000, 0x40001f) AM_WRITE(TC0360PRI_halfword_w)   /* ?? */
968   AM_RANGE(0x600000, 0x60ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
969   AM_RANGE(0x610000, 0x61ffff) AM_WRITE(SMH_RAM)   /* unused? */
970   AM_RANGE(0x620000, 0x62000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
971   AM_RANGE(0x800000, 0x80ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
726   AM_RANGE(0x100002, 0x100003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
727   AM_RANGE(0x120000, 0x12000f) AM_READWRITE8(TC0220IOC_r, TC0220IOC_w, 0x00ff)   /* I/O */
728   AM_RANGE(0x180000, 0x180fff) AM_READWRITE(cchip2_word_r, cchip2_word_w) AM_BASE(&cchip2_ram)
729   AM_RANGE(0x200000, 0x20ffff) AM_RAM
730   AM_RANGE(0x300000, 0x301fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
731   AM_RANGE(0x400000, 0x40001f) AM_WRITE8(TC0360PRI_w, 0x00ff)   /* ?? */
732   AM_RANGE(0x600000, 0x60ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
733   AM_RANGE(0x610000, 0x61ffff) AM_RAM   /* unused? */
734   AM_RANGE(0x620000, 0x62000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
735   AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
972736ADDRESS_MAP_END
973737
974static ADDRESS_MAP_START( thundfox_readmem, ADDRESS_SPACE_PROGRAM, 16 )
975   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
976   AM_RANGE(0x100000, 0x101fff) AM_READ(SMH_RAM)
977   AM_RANGE(0x200000, 0x20000f) AM_READ(TC0220IOC_halfword_r)   /* I/O */
978   AM_RANGE(0x220000, 0x220003) AM_READ(taitof2_msb_sound_r)
979   AM_RANGE(0x300000, 0x30ffff) AM_READ(SMH_RAM)
980   AM_RANGE(0x400000, 0x40ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
981   AM_RANGE(0x420000, 0x42000f) AM_READ(TC0100SCN_ctrl_word_0_r)
982   AM_RANGE(0x500000, 0x50ffff) AM_READ(TC0100SCN_word_1_r)   /* tilemaps */
983   AM_RANGE(0x520000, 0x52000f) AM_READ(TC0100SCN_ctrl_word_1_r)
984   AM_RANGE(0x600000, 0x60ffff) AM_READ(SMH_RAM)
985ADDRESS_MAP_END
986
987static ADDRESS_MAP_START( thundfox_writemem, ADDRESS_SPACE_PROGRAM, 16 )
988   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
989   AM_RANGE(0x100000, 0x101fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
990   AM_RANGE(0x200000, 0x20000f) AM_WRITE(TC0220IOC_halfword_w)   /* I/O */
738static ADDRESS_MAP_START( thundfox_map, ADDRESS_SPACE_PROGRAM, 16 )
739   AM_RANGE(0x000000, 0x07ffff) AM_ROM
740   AM_RANGE(0x100000, 0x101fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
741   AM_RANGE(0x200000, 0x20000f) AM_READWRITE8(TC0220IOC_r, TC0220IOC_w, 0x00ff)   /* I/O */
991742   AM_RANGE(0x220000, 0x220001) AM_WRITE8(taitosound_port_w, 0xff00)
992   AM_RANGE(0x220002, 0x220003) AM_WRITE8(taitosound_comm_w, 0xff00)
993   AM_RANGE(0x300000, 0x30ffff) AM_WRITE(SMH_RAM)
994   AM_RANGE(0x400000, 0x40ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
995   AM_RANGE(0x420000, 0x42000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
996   AM_RANGE(0x500000, 0x50ffff) AM_WRITE(TC0100SCN_word_1_w)   /* tilemaps */
997   AM_RANGE(0x520000, 0x52000f) AM_WRITE(TC0100SCN_ctrl_word_1_w)
998   AM_RANGE(0x600000, 0x60ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
999   AM_RANGE(0x800000, 0x80001f) AM_WRITE(TC0360PRI_halfword_swap_w)
743   AM_RANGE(0x220002, 0x220003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
744   AM_RANGE(0x300000, 0x30ffff) AM_RAM
745   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
746   AM_RANGE(0x420000, 0x42000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
747   AM_RANGE(0x500000, 0x50ffff) AM_READWRITE(TC0100SCN_word_1_r, TC0100SCN_word_1_w)   /* tilemaps */
748   AM_RANGE(0x520000, 0x52000f) AM_READWRITE(TC0100SCN_ctrl_word_1_r, TC0100SCN_ctrl_word_1_w)
749   AM_RANGE(0x600000, 0x60ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
750   AM_RANGE(0x800000, 0x80001f) AM_WRITE8(TC0360PRI_w, 0xff00)
1000751ADDRESS_MAP_END
1001752
1002static ADDRESS_MAP_START( cameltry_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1003   AM_RANGE(0x000000, 0x03ffff) AM_READ(SMH_ROM)
1004   AM_RANGE(0x100000, 0x10ffff) AM_READ(SMH_RAM)
1005   AM_RANGE(0x200000, 0x201fff) AM_READ(SMH_RAM)
1006   AM_RANGE(0x300000, 0x30000f) AM_READ(TC0220IOC_halfword_r)   /* I/O */
753static ADDRESS_MAP_START( cameltry_map, ADDRESS_SPACE_PROGRAM, 16 )
754   AM_RANGE(0x000000, 0x03ffff) AM_ROM
755   AM_RANGE(0x100000, 0x10ffff) AM_RAM
756   AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
757   AM_RANGE(0x300000, 0x30000f) AM_READWRITE8(TC0220IOC_r, TC0220IOC_w, 0x00ff)   /* I/O */
1007758   AM_RANGE(0x300018, 0x30001f) AM_READ(cameltry_paddle_r)
1008   AM_RANGE(0x320000, 0x320003) AM_READ(taitof2_msb_sound_r)
1009   AM_RANGE(0x800000, 0x813fff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
1010   AM_RANGE(0x820000, 0x82000f) AM_READ(TC0100SCN_ctrl_word_0_r)
1011   AM_RANGE(0x900000, 0x90ffff) AM_READ(SMH_RAM)
1012   AM_RANGE(0xa00000, 0xa01fff) AM_READ(TC0280GRD_word_r)
1013ADDRESS_MAP_END
1014
1015static ADDRESS_MAP_START( cameltry_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1016   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(SMH_ROM)
1017   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM)
1018   AM_RANGE(0x200000, 0x201fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
1019   AM_RANGE(0x300000, 0x30000f) AM_WRITE(TC0220IOC_halfword_w)   /* I/O */
1020759   AM_RANGE(0x320000, 0x320001) AM_WRITE8(taitosound_port_w, 0xff00)
1021   AM_RANGE(0x320002, 0x320003) AM_WRITE8(taitosound_comm_w, 0xff00)
1022   AM_RANGE(0x800000, 0x813fff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
1023   AM_RANGE(0x820000, 0x82000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
1024   AM_RANGE(0x900000, 0x90ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1025   AM_RANGE(0xa00000, 0xa01fff) AM_WRITE(TC0280GRD_word_w)   /* ROZ tilemap */
760   AM_RANGE(0x320002, 0x320003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
761   AM_RANGE(0x800000, 0x813fff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
762   AM_RANGE(0x820000, 0x82000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
763   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
764   AM_RANGE(0xa00000, 0xa01fff) AM_READWRITE(TC0280GRD_word_r, TC0280GRD_word_w)   /* ROZ tilemap */
1026765   AM_RANGE(0xa02000, 0xa0200f) AM_WRITE(TC0280GRD_ctrl_word_w)
1027   AM_RANGE(0xd00000, 0xd0001f) AM_WRITE(TC0360PRI_halfword_w)   /* ?? */
766   AM_RANGE(0xd00000, 0xd0001f) AM_WRITE8(TC0360PRI_w, 0x00ff)   /* ?? */
1028767ADDRESS_MAP_END
1029768
1030static ADDRESS_MAP_START( qtorimon_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1031   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
1032   AM_RANGE(0x100000, 0x10ffff) AM_READ(SMH_RAM)
1033   AM_RANGE(0x200000, 0x200007) AM_READ(TC0110PCR_word_r)   /* palette */
1034   AM_RANGE(0x500000, 0x50000f) AM_READ(TC0220IOC_halfword_r)   /* I/O */
1035   AM_RANGE(0x600000, 0x600003) AM_READ(taitof2_msb_sound_r)
1036   AM_RANGE(0x800000, 0x80ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
1037   AM_RANGE(0x820000, 0x82000f) AM_READ(TC0100SCN_ctrl_word_0_r)
1038   AM_RANGE(0x900000, 0x90ffff) AM_READ(SMH_RAM)
1039ADDRESS_MAP_END
1040
1041static ADDRESS_MAP_START( qtorimon_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1042   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(SMH_ROM)
1043   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM)
1044   AM_RANGE(0x200000, 0x200007) AM_WRITE(TC0110PCR_word_w)   /* palette */
1045   AM_RANGE(0x500000, 0x50000f) AM_WRITE(TC0220IOC_halfword_w)   /* I/O */
769static ADDRESS_MAP_START( qtorimon_map, ADDRESS_SPACE_PROGRAM, 16 )
770   AM_RANGE(0x000000, 0x07ffff) AM_ROM
771   AM_RANGE(0x100000, 0x10ffff) AM_RAM
772   AM_RANGE(0x200000, 0x200007) AM_READWRITE(TC0110PCR_word_r, TC0110PCR_word_w)   /* palette */
773   AM_RANGE(0x500000, 0x50000f) AM_READWRITE8(TC0220IOC_r, TC0220IOC_w, 0x00ff)   /* I/O */
1046774   AM_RANGE(0x600000, 0x600001) AM_WRITE8(taitosound_port_w, 0xff00)
1047   AM_RANGE(0x600002, 0x600003) AM_WRITE8(taitosound_comm_w, 0xff00)
1048   AM_RANGE(0x800000, 0x80ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
1049   AM_RANGE(0x820000, 0x82000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
1050   AM_RANGE(0x900000, 0x90ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
775   AM_RANGE(0x600002, 0x600003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
776   AM_RANGE(0x800000, 0x80ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
777   AM_RANGE(0x820000, 0x82000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
778   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1051779   AM_RANGE(0x910000, 0x9120ff) AM_WRITENOP   /* error in init code ? */
1052780ADDRESS_MAP_END
1053781
1054static ADDRESS_MAP_START( liquidk_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1055   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
1056   AM_RANGE(0x100000, 0x10ffff) AM_READ(SMH_RAM)
1057   AM_RANGE(0x200000, 0x201fff) AM_READ(SMH_RAM)
1058   AM_RANGE(0x300000, 0x30000f) AM_READ(TC0220IOC_halfword_r)   /* I/O */
1059   AM_RANGE(0x320000, 0x320003) AM_READ(taitof2_sound_r)
1060   AM_RANGE(0x800000, 0x80ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
1061   AM_RANGE(0x820000, 0x82000f) AM_READ(TC0100SCN_ctrl_word_0_r)
1062   AM_RANGE(0x900000, 0x90ffff) AM_READ(SMH_RAM)
1063ADDRESS_MAP_END
1064
1065static ADDRESS_MAP_START( liquidk_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1066   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
1067   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM)
1068   AM_RANGE(0x200000, 0x201fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
1069   AM_RANGE(0x300000, 0x30000f) AM_WRITE(TC0220IOC_halfword_w)   /* I/O */
782static ADDRESS_MAP_START( liquidk_map, ADDRESS_SPACE_PROGRAM, 16 )
783   AM_RANGE(0x000000, 0x07ffff) AM_ROM
784   AM_RANGE(0x100000, 0x10ffff) AM_RAM
785   AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
786   AM_RANGE(0x300000, 0x30000f) AM_READWRITE8(TC0220IOC_r, TC0220IOC_w, 0x00ff)   /* I/O */
1070787   AM_RANGE(0x320000, 0x320001) AM_WRITE8(taitosound_port_w, 0x00ff)
1071   AM_RANGE(0x320002, 0x320003) AM_WRITE8(taitosound_comm_w, 0x00ff)
1072   AM_RANGE(0x800000, 0x80ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
1073   AM_RANGE(0x820000, 0x82000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
1074   AM_RANGE(0x900000, 0x90ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1075   AM_RANGE(0xb00000, 0xb0001f) AM_WRITE(TC0360PRI_halfword_w)   /* ?? */
788   AM_RANGE(0x320002, 0x320003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0x00ff)
789   AM_RANGE(0x800000, 0x80ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
790   AM_RANGE(0x820000, 0x82000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
791   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
792   AM_RANGE(0xb00000, 0xb0001f) AM_WRITE8(TC0360PRI_w, 0x00ff)   /* ?? */
1076793ADDRESS_MAP_END
1077794
1078static ADDRESS_MAP_START( quizhq_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1079   AM_RANGE(0x000000, 0x0bffff) AM_READ(SMH_ROM)
1080   AM_RANGE(0x100000, 0x10ffff) AM_READ(SMH_RAM)
1081   AM_RANGE(0x200000, 0x200007) AM_READ(TC0110PCR_word_r)   /* palette */
1082   AM_RANGE(0x500000, 0x50000f) AM_READ(quizhq_input1_r)
1083   AM_RANGE(0x580000, 0x58000f) AM_READ(quizhq_input2_r)
1084   AM_RANGE(0x600000, 0x600003) AM_READ(taitof2_sound_r)
1085   AM_RANGE(0x800000, 0x80ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
1086   AM_RANGE(0x820000, 0x82000f) AM_READ(TC0100SCN_ctrl_word_0_r)
1087   AM_RANGE(0x900000, 0x90ffff) AM_READ(SMH_RAM)
1088ADDRESS_MAP_END
1089
1090static ADDRESS_MAP_START( quizhq_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1091   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(SMH_ROM)
1092   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM)
1093   AM_RANGE(0x200000, 0x200007) AM_WRITE(TC0110PCR_word_w)   /* palette */
795static ADDRESS_MAP_START( quizhq_map, ADDRESS_SPACE_PROGRAM, 16 )
796   AM_RANGE(0x000000, 0x0bffff) AM_ROM
797   AM_RANGE(0x100000, 0x10ffff) AM_RAM
798   AM_RANGE(0x200000, 0x200007) AM_READWRITE(TC0110PCR_word_r, TC0110PCR_word_w)   /* palette */
1094799   AM_RANGE(0x500004, 0x500005) AM_WRITE(growl_coin_word_w)
1095   AM_RANGE(0x580000, 0x580001) AM_WRITE(taitof2_watchdog_w)   /* ??? */
800   AM_RANGE(0x500000, 0x500001) AM_READ_PORT("DSWB")
801   AM_RANGE(0x500002, 0x500003) AM_READ_PORT("IN0")
802   AM_RANGE(0x580000, 0x580001) AM_WRITE(watchdog_reset16_w)   /* ??? */
1096803   AM_RANGE(0x580006, 0x580007) AM_WRITENOP   /* ??? */
804   AM_RANGE(0x580000, 0x580001) AM_READ_PORT("DSWA")
805   AM_RANGE(0x580002, 0x580003) AM_READ_PORT("IN1")
806   AM_RANGE(0x580004, 0x580005) AM_READ_PORT("IN2")
1097807   AM_RANGE(0x600000, 0x600001) AM_WRITE8(taitosound_port_w, 0x00ff)
1098   AM_RANGE(0x600002, 0x600003) AM_WRITE8(taitosound_comm_w, 0x00ff)
808   AM_RANGE(0x600002, 0x600003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0x00ff)
1099809   AM_RANGE(0x680000, 0x680001) AM_WRITENOP   /* ??? */
1100   AM_RANGE(0x800000, 0x80ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
810   AM_RANGE(0x800000, 0x80ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
1101811   AM_RANGE(0x810000, 0x81ffff) AM_WRITENOP   /* error in init code ? */
1102   AM_RANGE(0x820000, 0x82000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
1103   AM_RANGE(0x900000, 0x90ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
812   AM_RANGE(0x820000, 0x82000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
813   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1104814ADDRESS_MAP_END
1105815
1106static ADDRESS_MAP_START( ssi_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1107   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
1108   AM_RANGE(0x100000, 0x10000f) AM_READ(TC0510NIO_halfword_r)
1109   AM_RANGE(0x200000, 0x20ffff) AM_READ(SMH_RAM)
1110   AM_RANGE(0x300000, 0x301fff) AM_READ(SMH_RAM)
1111   AM_RANGE(0x400000, 0x400003) AM_READ(taitof2_msb_sound_r)
1112   AM_RANGE(0x600000, 0x60ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
1113   AM_RANGE(0x620000, 0x62000f) AM_READ(TC0100SCN_ctrl_word_0_r)
1114   AM_RANGE(0x800000, 0x80ffff) AM_READ(SMH_RAM)
1115ADDRESS_MAP_END
1116
1117static ADDRESS_MAP_START( ssi_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1118   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
1119   AM_RANGE(0x100000, 0x10000f) AM_WRITE(TC0510NIO_halfword_w)
1120   AM_RANGE(0x200000, 0x20ffff) AM_WRITE(SMH_RAM)
1121   AM_RANGE(0x300000, 0x301fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
816static ADDRESS_MAP_START( ssi_map, ADDRESS_SPACE_PROGRAM, 16 )
817   AM_RANGE(0x000000, 0x07ffff) AM_ROM
818   AM_RANGE(0x100000, 0x10000f) AM_READWRITE(TC0510NIO_halfword_r, TC0510NIO_halfword_w)
819   AM_RANGE(0x200000, 0x20ffff) AM_RAM
820   AM_RANGE(0x300000, 0x301fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
1122821   AM_RANGE(0x400000, 0x400001) AM_WRITE8(taitosound_port_w, 0xff00)
1123   AM_RANGE(0x400002, 0x400003) AM_WRITE8(taitosound_comm_w, 0xff00)
822   AM_RANGE(0x400002, 0x400003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
1124823//  AM_RANGE(0x500000, 0x500001) AM_WRITENOP   /* ?? */
1125   AM_RANGE(0x600000, 0x60ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps (not used) */
1126   AM_RANGE(0x620000, 0x62000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
1127   AM_RANGE(0x800000, 0x80ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)   /* sprite ram */
824   AM_RANGE(0x600000, 0x60ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps (not used) */
825   AM_RANGE(0x620000, 0x62000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
826   AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)   /* sprite ram */
1128827ADDRESS_MAP_END
1129828
1130static ADDRESS_MAP_START( gunfront_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1131   AM_RANGE(0x000000, 0x0bffff) AM_READ(SMH_ROM)
1132   AM_RANGE(0x100000, 0x10ffff) AM_READ(SMH_RAM)
1133   AM_RANGE(0x200000, 0x201fff) AM_READ(SMH_RAM)
1134   AM_RANGE(0x300000, 0x30000f) AM_READ(TC0510NIO_halfword_wordswap_r)
1135   AM_RANGE(0x320000, 0x320003) AM_READ(taitof2_msb_sound_r)
1136   AM_RANGE(0x800000, 0x80ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
1137   AM_RANGE(0x820000, 0x82000f) AM_READ(TC0100SCN_ctrl_word_0_r)
1138   AM_RANGE(0x900000, 0x90ffff) AM_READ(SMH_RAM)
1139ADDRESS_MAP_END
1140
1141static ADDRESS_MAP_START( gunfront_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1142   AM_RANGE(0x000000, 0x0bffff) AM_WRITE(SMH_ROM)
1143   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM)
1144   AM_RANGE(0x200000, 0x201fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
1145   AM_RANGE(0x300000, 0x30000f) AM_WRITE(TC0510NIO_halfword_wordswap_w)
829static ADDRESS_MAP_START( gunfront_map, ADDRESS_SPACE_PROGRAM, 16 )
830   AM_RANGE(0x000000, 0x0bffff) AM_ROM
831   AM_RANGE(0x100000, 0x10ffff) AM_RAM
832   AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
833   AM_RANGE(0x300000, 0x30000f) AM_READWRITE(TC0510NIO_halfword_wordswap_r, TC0510NIO_halfword_wordswap_w)
1146834   AM_RANGE(0x320000, 0x320001) AM_WRITE8(taitosound_port_w, 0xff00)
1147   AM_RANGE(0x320002, 0x320003) AM_WRITE8(taitosound_comm_w, 0xff00)
1148   AM_RANGE(0x800000, 0x80ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
1149   AM_RANGE(0x820000, 0x82000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
1150   AM_RANGE(0x900000, 0x90ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
835   AM_RANGE(0x320002, 0x320003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
836   AM_RANGE(0x800000, 0x80ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
837   AM_RANGE(0x820000, 0x82000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
838   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1151839//  AM_RANGE(0xa00000, 0xa00001) AM_WRITENOP   /* ?? */
1152   AM_RANGE(0xb00000, 0xb0001f) AM_WRITE(TC0360PRI_halfword_w)   /* ?? */
840   AM_RANGE(0xb00000, 0xb0001f) AM_WRITE8(TC0360PRI_w, 0x00ff)   /* ?? */
1153841ADDRESS_MAP_END
1154842
1155static ADDRESS_MAP_START( growl_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1156   AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM)
1157   AM_RANGE(0x100000, 0x10ffff) AM_READ(SMH_RAM)
1158   AM_RANGE(0x200000, 0x201fff) AM_READ(SMH_RAM)
1159   AM_RANGE(0x300000, 0x30000f) AM_READ(growl_dsw_r)
1160   AM_RANGE(0x320000, 0x32000f) AM_READ(growl_input_r)
1161   AM_RANGE(0x400000, 0x400003) AM_READ(taitof2_msb_sound_r)
1162   AM_RANGE(0x508000, 0x50800f) AM_READ_PORT("IN3")
1163   AM_RANGE(0x50c000, 0x50c00f) AM_READ_PORT("IN4")
1164   AM_RANGE(0x800000, 0x80ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
1165   AM_RANGE(0x820000, 0x82000f) AM_READ(TC0100SCN_ctrl_word_0_r)
1166   AM_RANGE(0x900000, 0x90ffff) AM_READ(SMH_RAM)
1167ADDRESS_MAP_END
1168
1169static ADDRESS_MAP_START( growl_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1170   AM_RANGE(0x000000, 0x0fffff) AM_WRITE(SMH_ROM)
1171   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM)
1172   AM_RANGE(0x200000, 0x201fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
843static ADDRESS_MAP_START( growl_map, ADDRESS_SPACE_PROGRAM, 16 )
844   AM_RANGE(0x000000, 0x0fffff) AM_ROM
845   AM_RANGE(0x100000, 0x10ffff) AM_RAM
846   AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
1173847   AM_RANGE(0x300004, 0x300005) AM_WRITE(growl_coin_word_w)
1174   AM_RANGE(0x340000, 0x340001) AM_WRITE(taitof2_watchdog_w)
848   AM_RANGE(0x300000, 0x300001) AM_READ_PORT("DSWA")
849   AM_RANGE(0x300002, 0x300003) AM_READ_PORT("DSWB")
850   AM_RANGE(0x320000, 0x320001) AM_READ_PORT("IN0")
851   AM_RANGE(0x320002, 0x320003) AM_READ_PORT("IN1")
852   AM_RANGE(0x320004, 0x320005) AM_READ_PORT("IN2")
853   AM_RANGE(0x340000, 0x340001) AM_WRITE(watchdog_reset16_w)
1175854   AM_RANGE(0x400000, 0x400001) AM_WRITE8(taitosound_port_w, 0xff00)
1176   AM_RANGE(0x400002, 0x400003) AM_WRITE8(taitosound_comm_w, 0xff00)
855   AM_RANGE(0x400002, 0x400003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
1177856   AM_RANGE(0x500000, 0x50000f) AM_WRITE(taitof2_spritebank_w)
1178857   AM_RANGE(0x504000, 0x504001) AM_WRITENOP   /* unknown... various values */
1179   AM_RANGE(0x800000, 0x80ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
1180   AM_RANGE(0x820000, 0x82000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
1181   AM_RANGE(0x900000, 0x90ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1182   AM_RANGE(0xb00000, 0xb0001f) AM_WRITE(TC0360PRI_halfword_w)   /* ?? */
858   AM_RANGE(0x508000, 0x50800f) AM_READ_PORT("IN3")
859   AM_RANGE(0x50c000, 0x50c00f) AM_READ_PORT("IN4")
860   AM_RANGE(0x800000, 0x80ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
861   AM_RANGE(0x820000, 0x82000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
862   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
863   AM_RANGE(0xb00000, 0xb0001f) AM_WRITE8(TC0360PRI_w, 0x00ff)   /* ?? */
1183864ADDRESS_MAP_END
1184865
1185static ADDRESS_MAP_START( mjnquest_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1186   AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM)
1187   AM_RANGE(0x110000, 0x11ffff) AM_READ(SMH_RAM)   /* "sram" */
1188   AM_RANGE(0x120000, 0x12ffff) AM_READ(SMH_RAM)
1189   AM_RANGE(0x200000, 0x200007) AM_READ(TC0110PCR_word_r)   /* palette */
866static ADDRESS_MAP_START( mjnquest_map, ADDRESS_SPACE_PROGRAM, 16 )
867   AM_RANGE(0x000000, 0x0fffff) AM_ROM
868   AM_RANGE(0x110000, 0x11ffff) AM_RAM   /* "sram" */
869   AM_RANGE(0x120000, 0x12ffff) AM_RAM
870   AM_RANGE(0x200000, 0x200007) AM_READWRITE(TC0110PCR_word_r, TC0110PCR_word_w)   /* palette */
1190871   AM_RANGE(0x300000, 0x30000f) AM_READ(mjnquest_dsw_r)
1191872   AM_RANGE(0x310000, 0x310001) AM_READ(mjnquest_input_r)
1192   AM_RANGE(0x360000, 0x360003) AM_READ(taitof2_msb_sound_r)
1193   AM_RANGE(0x400000, 0x40ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
1194   AM_RANGE(0x420000, 0x42000f) AM_READ(TC0100SCN_ctrl_word_0_r)
1195   AM_RANGE(0x500000, 0x50ffff) AM_READ(SMH_RAM)
1196ADDRESS_MAP_END
1197
1198static ADDRESS_MAP_START( mjnquest_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1199   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(SMH_ROM)
1200   AM_RANGE(0x110000, 0x11ffff) AM_WRITE(SMH_RAM)   /* "sram" */
1201   AM_RANGE(0x120000, 0x12ffff) AM_WRITE(SMH_RAM)
1202   AM_RANGE(0x200000, 0x200007) AM_WRITE(TC0110PCR_word_w)   /* palette */
1203873   AM_RANGE(0x320000, 0x320001) AM_WRITE(mjnquest_inputselect_w)
1204874   AM_RANGE(0x330000, 0x330001) AM_WRITENOP   /* watchdog ? */
1205875   AM_RANGE(0x350000, 0x350001) AM_WRITENOP   /* watchdog ? */
1206876   AM_RANGE(0x360000, 0x360001) AM_WRITE8(taitosound_port_w, 0xff00)
1207   AM_RANGE(0x360002, 0x360003) AM_WRITE8(taitosound_comm_w, 0xff00)
877   AM_RANGE(0x360002, 0x360003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
1208878   AM_RANGE(0x380000, 0x380001) AM_WRITE(TC0100SCN_gfxbank_w)   /* scr gfx bank select */
1209   AM_RANGE(0x400000, 0x40ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
1210   AM_RANGE(0x420000, 0x42000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
1211   AM_RANGE(0x500000, 0x50ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
879   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
880   AM_RANGE(0x420000, 0x42000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
881   AM_RANGE(0x500000, 0x50ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1212882ADDRESS_MAP_END
1213883
1214static ADDRESS_MAP_START( footchmp_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1215   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
1216   AM_RANGE(0x100000, 0x10ffff) AM_READ(SMH_RAM)
1217   AM_RANGE(0x200000, 0x20ffff) AM_READ(SMH_RAM)
1218   AM_RANGE(0x400000, 0x40ffff) AM_READ(TC0480SCP_word_r)   /* tilemaps */
1219   AM_RANGE(0x430000, 0x43002f) AM_READ(TC0480SCP_ctrl_word_r)
1220   AM_RANGE(0x600000, 0x601fff) AM_READ(SMH_RAM)
1221   AM_RANGE(0x700000, 0x70001f) AM_READ(footchmp_input_r)
1222   AM_RANGE(0xa00000, 0xa00003) AM_READ(taitof2_sound_r)
1223ADDRESS_MAP_END
1224
1225static ADDRESS_MAP_START( footchmp_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1226   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
1227   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM)
1228   AM_RANGE(0x200000, 0x20ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
884static ADDRESS_MAP_START( footchmp_map, ADDRESS_SPACE_PROGRAM, 16 )
885   AM_RANGE(0x000000, 0x07ffff) AM_ROM
886   AM_RANGE(0x100000, 0x10ffff) AM_RAM
887   AM_RANGE(0x200000, 0x20ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1229888   AM_RANGE(0x300000, 0x30000f) AM_WRITE(taitof2_spritebank_w)   /* updated at $a6e, off irq5 */
1230   AM_RANGE(0x400000, 0x40ffff) AM_WRITE(TC0480SCP_word_w)     /* tilemaps */
1231   AM_RANGE(0x430000, 0x43002f) AM_WRITE(TC0480SCP_ctrl_word_w)
1232   AM_RANGE(0x500000, 0x50001f) AM_WRITE(TC0360PRI_halfword_w)   /* 500002 written like a watchdog?! */
1233   AM_RANGE(0x600000, 0x601fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
889   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(TC0480SCP_word_r, TC0480SCP_word_w)     /* tilemaps */
890   AM_RANGE(0x430000, 0x43002f) AM_READWRITE(TC0480SCP_ctrl_word_r, TC0480SCP_ctrl_word_w)
891   AM_RANGE(0x500000, 0x50001f) AM_WRITE8(TC0360PRI_w, 0x00ff)   /* 500002 written like a watchdog?! */
892   AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
1234893   AM_RANGE(0x700006, 0x700007) AM_WRITE(taitof2_4p_coin_word_w)
1235   AM_RANGE(0x800000, 0x800001) AM_WRITE(taitof2_watchdog_w)   /* ??? */
894   AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSWA")
895   AM_RANGE(0x700002, 0x700003) AM_READ_PORT("DSWB")
896   AM_RANGE(0x700004, 0x700005) AM_READ_PORT("IN2")
897   AM_RANGE(0x70000a, 0x70000b) AM_READ_PORT("IN0")
898   AM_RANGE(0x70000c, 0x70000d) AM_READ_PORT("IN1")
899   AM_RANGE(0x70000e, 0x70000f) AM_READ_PORT("IN3")
900   AM_RANGE(0x700010, 0x700011) AM_READ_PORT("IN4")
901   AM_RANGE(0x800000, 0x800001) AM_WRITE(watchdog_reset16_w)   /* ??? */
1236902   AM_RANGE(0xa00000, 0xa00001) AM_WRITE8(taitosound_port_w, 0x00ff)
1237   AM_RANGE(0xa00002, 0xa00003) AM_WRITE8(taitosound_comm_w, 0x00ff)
903   AM_RANGE(0xa00002, 0xa00003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0x00ff)
1238904ADDRESS_MAP_END
1239905
1240static ADDRESS_MAP_START( koshien_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1241   AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM)
1242   AM_RANGE(0x100000, 0x10ffff) AM_READ(SMH_RAM)
1243   AM_RANGE(0x200000, 0x201fff) AM_READ(SMH_RAM)
1244   AM_RANGE(0x300000, 0x30000f) AM_READ(TC0510NIO_halfword_r)
1245   AM_RANGE(0x320000, 0x320003) AM_READ(taitof2_msb_sound_r)
1246   AM_RANGE(0x800000, 0x80ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
1247   AM_RANGE(0x820000, 0x82000f) AM_READ(TC0100SCN_ctrl_word_0_r)
1248   AM_RANGE(0x900000, 0x90ffff) AM_READ(SMH_RAM)
1249//  AM_RANGE(0xa20000, 0xa20001) AM_READ(koshien_spritebank_r)   /* for debugging spritebank */
1250ADDRESS_MAP_END
1251
1252static ADDRESS_MAP_START( koshien_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1253   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(SMH_ROM)
1254   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM)
1255   AM_RANGE(0x200000, 0x201fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
1256   AM_RANGE(0x300000, 0x30000f) AM_WRITE(TC0510NIO_halfword_w)
906static ADDRESS_MAP_START( koshien_map, ADDRESS_SPACE_PROGRAM, 16 )
907   AM_RANGE(0x000000, 0x0fffff) AM_ROM
908   AM_RANGE(0x100000, 0x10ffff) AM_RAM
909   AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
910   AM_RANGE(0x300000, 0x30000f) AM_READWRITE(TC0510NIO_halfword_r, TC0510NIO_halfword_w)
1257911   AM_RANGE(0x320000, 0x320001) AM_WRITE8(taitosound_port_w, 0xff00)
1258   AM_RANGE(0x320002, 0x320003) AM_WRITE8(taitosound_comm_w, 0xff00)
1259   AM_RANGE(0x800000, 0x80ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
1260   AM_RANGE(0x820000, 0x82000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
1261   AM_RANGE(0x900000, 0x90ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
912   AM_RANGE(0x320002, 0x320003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
913   AM_RANGE(0x800000, 0x80ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
914   AM_RANGE(0x820000, 0x82000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
915   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1262916   AM_RANGE(0xa20000, 0xa20001) AM_WRITE(koshien_spritebank_w)
1263   AM_RANGE(0xb00000, 0xb0001f) AM_WRITE(TC0360PRI_halfword_swap_w)
917   AM_RANGE(0xb00000, 0xb0001f) AM_WRITE8(TC0360PRI_w, 0xff00)
1264918ADDRESS_MAP_END
1265919
1266static ADDRESS_MAP_START( yuyugogo_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1267   AM_RANGE(0x000000, 0x03ffff) AM_READ(SMH_ROM)
1268   AM_RANGE(0x200000, 0x20000f) AM_READ(TC0510NIO_halfword_r)
1269   AM_RANGE(0x400000, 0x400003) AM_READ(taitof2_msb_sound_r)
1270   AM_RANGE(0x800000, 0x80ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
1271   AM_RANGE(0x820000, 0x82000f) AM_READ(TC0100SCN_ctrl_word_0_r)
1272   AM_RANGE(0x900000, 0x90ffff) AM_READ(SMH_RAM)
1273   AM_RANGE(0xa00000, 0xa01fff) AM_READ(SMH_RAM)
1274   AM_RANGE(0xb00000, 0xb10fff) AM_READ(SMH_RAM)
1275   AM_RANGE(0xd00000, 0xdfffff) AM_READ(SMH_BANK1)   /* extra data rom */
1276ADDRESS_MAP_END
1277
1278static ADDRESS_MAP_START( yuyugogo_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1279   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(SMH_ROM)
1280   AM_RANGE(0x200000, 0x20000f) AM_WRITE(TC0510NIO_halfword_w)
920static ADDRESS_MAP_START( yuyugogo_map, ADDRESS_SPACE_PROGRAM, 16 )
921   AM_RANGE(0x000000, 0x03ffff) AM_ROM
922   AM_RANGE(0x200000, 0x20000f) AM_READWRITE(TC0510NIO_halfword_r, TC0510NIO_halfword_w)
1281923   AM_RANGE(0x400000, 0x400001) AM_WRITE8(taitosound_port_w, 0xff00)
1282   AM_RANGE(0x400002, 0x400003) AM_WRITE8(taitosound_comm_w, 0xff00)
1283   AM_RANGE(0x800000, 0x80ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
1284   AM_RANGE(0x820000, 0x82000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
1285   AM_RANGE(0x900000, 0x90ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1286   AM_RANGE(0xa00000, 0xa01fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
1287   AM_RANGE(0xb00000, 0xb10fff) AM_WRITE(SMH_RAM)   /* deliberate writes to $b10xxx, I think */
924   AM_RANGE(0x400002, 0x400003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
925   AM_RANGE(0x800000, 0x80ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
926   AM_RANGE(0x820000, 0x82000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
927   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
928   AM_RANGE(0xa00000, 0xa01fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
929   AM_RANGE(0xb00000, 0xb10fff) AM_RAM   /* deliberate writes to $b10xxx, I think */
1288930   AM_RANGE(0xc00000, 0xc01fff) AM_WRITE(taitof2_sprite_extension_w) AM_BASE(&f2_sprite_extension) AM_SIZE(&f2_spriteext_size)
1289   AM_RANGE(0xd00000, 0xdfffff) AM_WRITE(SMH_ROM)
931   AM_RANGE(0xd00000, 0xdfffff) AM_ROM AM_REGION("extra", 0)
1290932ADDRESS_MAP_END
1291933
1292static ADDRESS_MAP_START( ninjak_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1293   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
1294   AM_RANGE(0x100000, 0x10ffff) AM_READ(SMH_RAM)
1295   AM_RANGE(0x200000, 0x201fff) AM_READ(SMH_RAM)
934static ADDRESS_MAP_START( ninjak_map, ADDRESS_SPACE_PROGRAM, 16 )
935   AM_RANGE(0x000000, 0x07ffff) AM_ROM
936   AM_RANGE(0x100000, 0x10ffff) AM_RAM
937   AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
1296938   AM_RANGE(0x300000, 0x30000f) AM_READ(ninjak_input_r)
1297   AM_RANGE(0x400000, 0x400003) AM_READ(taitof2_msb_sound_r)
1298   AM_RANGE(0x800000, 0x80ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
1299   AM_RANGE(0x820000, 0x82000f) AM_READ(TC0100SCN_ctrl_word_0_r)
1300   AM_RANGE(0x900000, 0x90ffff) AM_READ(SMH_RAM)
1301ADDRESS_MAP_END
1302
1303static ADDRESS_MAP_START( ninjak_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1304   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
1305   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM)
1306   AM_RANGE(0x200000, 0x201fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
1307939   AM_RANGE(0x30000e, 0x30000f) AM_WRITE(ninjak_coin_word_w)
1308   AM_RANGE(0x380000, 0x380001) AM_WRITE(taitof2_watchdog_w)   /* ??? */
940   AM_RANGE(0x380000, 0x380001) AM_WRITE(watchdog_reset16_w)   /* ??? */
1309941   AM_RANGE(0x400000, 0x400001) AM_WRITE8(taitosound_port_w, 0xff00)
1310   AM_RANGE(0x400002, 0x400003) AM_WRITE8(taitosound_comm_w, 0xff00)
942   AM_RANGE(0x400002, 0x400003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
1311943   AM_RANGE(0x600000, 0x60000f) AM_WRITE(taitof2_spritebank_w)
1312   AM_RANGE(0x800000, 0x80ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
1313   AM_RANGE(0x820000, 0x82000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
1314   AM_RANGE(0x900000, 0x90ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1315   AM_RANGE(0xb00000, 0xb0001f) AM_WRITE(TC0360PRI_halfword_w)   /* b00002 written like a watchdog?! */
944   AM_RANGE(0x800000, 0x80ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
945   AM_RANGE(0x820000, 0x82000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
946   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
947   AM_RANGE(0xb00000, 0xb0001f) AM_WRITE8(TC0360PRI_w, 0x00ff)   /* b00002 written like a watchdog?! */
1316948ADDRESS_MAP_END
1317949
1318static ADDRESS_MAP_START( solfigtr_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1319   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
1320   AM_RANGE(0x100000, 0x10ffff) AM_READ(SMH_RAM)
1321   AM_RANGE(0x200000, 0x201fff) AM_READ(SMH_RAM)
1322   AM_RANGE(0x300000, 0x30000f) AM_READ(growl_dsw_r)
1323   AM_RANGE(0x320000, 0x32000f) AM_READ(growl_input_r)
1324   AM_RANGE(0x400000, 0x400003) AM_READ(taitof2_msb_sound_r)
1325   AM_RANGE(0x800000, 0x80ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
1326   AM_RANGE(0x820000, 0x82000f) AM_READ(TC0100SCN_ctrl_word_0_r)
1327   AM_RANGE(0x900000, 0x90ffff) AM_READ(SMH_RAM)
1328ADDRESS_MAP_END
1329
1330static ADDRESS_MAP_START( solfigtr_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1331   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
1332   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM)
1333   AM_RANGE(0x200000, 0x201fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
950static ADDRESS_MAP_START( solfigtr_map, ADDRESS_SPACE_PROGRAM, 16 )
951   AM_RANGE(0x000000, 0x07ffff) AM_ROM
952   AM_RANGE(0x100000, 0x10ffff) AM_RAM
953   AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
1334954   AM_RANGE(0x300004, 0x300005) AM_WRITE(growl_coin_word_w)   /* NOT VERIFIED */
1335   AM_RANGE(0x340000, 0x340001) AM_WRITE(taitof2_watchdog_w)   /* NOT VERIFIED */
955   AM_RANGE(0x300000, 0x300001) AM_READ_PORT("DSWA")
956   AM_RANGE(0x300002, 0x300003) AM_READ_PORT("DSWB")
957   AM_RANGE(0x320000, 0x320001) AM_READ_PORT("IN0")
958   AM_RANGE(0x320002, 0x320003) AM_READ_PORT("IN1")
959   AM_RANGE(0x320004, 0x320005) AM_READ_PORT("IN2")
960   AM_RANGE(0x340000, 0x340001) AM_WRITE(watchdog_reset16_w)   /* NOT VERIFIED */
1336961   AM_RANGE(0x400000, 0x400001) AM_WRITE8(taitosound_port_w, 0xff00)
1337   AM_RANGE(0x400002, 0x400003) AM_WRITE8(taitosound_comm_w, 0xff00)
962   AM_RANGE(0x400002, 0x400003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
1338963   AM_RANGE(0x500000, 0x50000f) AM_WRITE(taitof2_spritebank_w)
1339964   AM_RANGE(0x504000, 0x504001) AM_WRITENOP   /* unknown... various values */
1340   AM_RANGE(0x800000, 0x80ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
1341   AM_RANGE(0x820000, 0x82000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
1342   AM_RANGE(0x900000, 0x90ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1343   AM_RANGE(0xb00000, 0xb0001f) AM_WRITE(TC0360PRI_halfword_w)   /* ?? */
965   AM_RANGE(0x800000, 0x80ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
966   AM_RANGE(0x820000, 0x82000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
967   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
968   AM_RANGE(0xb00000, 0xb0001f) AM_WRITE8(TC0360PRI_w, 0x00ff)   /* ?? */
1344969ADDRESS_MAP_END
1345970
1346static ADDRESS_MAP_START( qzquest_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1347   AM_RANGE(0x000000, 0x17ffff) AM_READ(SMH_ROM)
1348   AM_RANGE(0x200000, 0x20000f) AM_READ(TC0510NIO_halfword_r)
1349   AM_RANGE(0x300000, 0x300003) AM_READ(taitof2_sound_r)
1350   AM_RANGE(0x400000, 0x401fff) AM_READ(SMH_RAM)
1351   AM_RANGE(0x500000, 0x50ffff) AM_READ(SMH_RAM)
1352   AM_RANGE(0x600000, 0x60ffff) AM_READ(SMH_RAM)
1353   AM_RANGE(0x700000, 0x70ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
1354   AM_RANGE(0x720000, 0x72000f) AM_READ(TC0100SCN_ctrl_word_0_r)
1355ADDRESS_MAP_END
1356
1357static ADDRESS_MAP_START( qzquest_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1358   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(SMH_ROM)
1359   AM_RANGE(0x200000, 0x20000f) AM_WRITE(TC0510NIO_halfword_w)
971static ADDRESS_MAP_START( qzquest_map, ADDRESS_SPACE_PROGRAM, 16 )
972   AM_RANGE(0x000000, 0x17ffff) AM_ROM
973   AM_RANGE(0x200000, 0x20000f) AM_READWRITE(TC0510NIO_halfword_r, TC0510NIO_halfword_w)
1360974   AM_RANGE(0x300000, 0x300001) AM_WRITE8(taitosound_port_w, 0x00ff)
1361   AM_RANGE(0x300002, 0x300003) AM_WRITE8(taitosound_comm_w, 0x00ff)
1362   AM_RANGE(0x400000, 0x401fff) AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
1363   AM_RANGE(0x500000, 0x50ffff) AM_WRITE(SMH_RAM)
1364   AM_RANGE(0x600000, 0x60ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1365   AM_RANGE(0x700000, 0x70ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
1366   AM_RANGE(0x720000, 0x72000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
975   AM_RANGE(0x300002, 0x300003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0x00ff)
976   AM_RANGE(0x400000, 0x401fff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
977   AM_RANGE(0x500000, 0x50ffff) AM_RAM
978   AM_RANGE(0x600000, 0x60ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
979   AM_RANGE(0x700000, 0x70ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
980   AM_RANGE(0x720000, 0x72000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
1367981ADDRESS_MAP_END
1368982
1369static ADDRESS_MAP_START( pulirula_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1370   AM_RANGE(0x000000, 0x0bffff) AM_READ(SMH_ROM)
1371   AM_RANGE(0x200000, 0x200003) AM_READ(taitof2_msb_sound_r)
1372   AM_RANGE(0x300000, 0x30ffff) AM_READ(SMH_RAM)
1373   AM_RANGE(0x400000, 0x401fff) AM_READ(TC0430GRW_word_r)
1374   AM_RANGE(0x700000, 0x701fff) AM_READ(SMH_RAM)
1375   AM_RANGE(0x800000, 0x80ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
1376   AM_RANGE(0x820000, 0x82000f) AM_READ(TC0100SCN_ctrl_word_0_r)
1377   AM_RANGE(0x900000, 0x90ffff) AM_READ(SMH_RAM)
1378   AM_RANGE(0xb00000, 0xb0000f) AM_READ(TC0510NIO_halfword_r)
1379ADDRESS_MAP_END
1380
1381static ADDRESS_MAP_START( pulirula_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1382   AM_RANGE(0x000000, 0x0bffff) AM_WRITE(SMH_ROM)
983static ADDRESS_MAP_START( pulirula_map, ADDRESS_SPACE_PROGRAM, 16 )
984   AM_RANGE(0x000000, 0x0bffff) AM_ROM
1383985   AM_RANGE(0x200000, 0x200001) AM_WRITE8(taitosound_port_w, 0xff00)
1384   AM_RANGE(0x200002, 0x200003) AM_WRITE8(taitosound_comm_w, 0xff00)
1385   AM_RANGE(0x300000, 0x30ffff) AM_WRITE(SMH_RAM)
1386   AM_RANGE(0x400000, 0x401fff) AM_WRITE(TC0430GRW_word_w)   /* ROZ tilemap */
986   AM_RANGE(0x200002, 0x200003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
987   AM_RANGE(0x300000, 0x30ffff) AM_RAM
988   AM_RANGE(0x400000, 0x401fff) AM_READWRITE(TC0430GRW_word_r, TC0430GRW_word_w)   /* ROZ tilemap */
1387989   AM_RANGE(0x402000, 0x40200f) AM_WRITE(TC0430GRW_ctrl_word_w)
1388990//  AM_RANGE(0x500000, 0x500001) AM_WRITENOP   /* ??? */
1389991   AM_RANGE(0x600000, 0x603fff) AM_WRITE(taitof2_sprite_extension_w) AM_BASE(&f2_sprite_extension) AM_SIZE(&f2_spriteext_size)
1390   AM_RANGE(0x700000, 0x701fff) AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
1391   AM_RANGE(0x800000, 0x80ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
1392   AM_RANGE(0x820000, 0x82000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
1393   AM_RANGE(0x900000, 0x90ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1394   AM_RANGE(0xa00000, 0xa0001f) AM_WRITE(TC0360PRI_halfword_swap_w)
1395   AM_RANGE(0xb00000, 0xb0000f) AM_WRITE(TC0510NIO_halfword_w)
992   AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
993   AM_RANGE(0x800000, 0x80ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
994   AM_RANGE(0x820000, 0x82000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
995   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
996   AM_RANGE(0xa00000, 0xa0001f) AM_WRITE8(TC0360PRI_w, 0xff00)
997   AM_RANGE(0xb00000, 0xb0000f) AM_READWRITE(TC0510NIO_halfword_r, TC0510NIO_halfword_w)
1396998ADDRESS_MAP_END
1397999
1398static ADDRESS_MAP_START( metalb_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1399   AM_RANGE(0x000000, 0x0bffff) AM_READ(SMH_ROM)
1400   AM_RANGE(0x100000, 0x10ffff) AM_READ(SMH_RAM)
1401   AM_RANGE(0x300000, 0x30ffff) AM_READ(SMH_RAM)
1402   AM_RANGE(0x500000, 0x50ffff) AM_READ(TC0480SCP_word_r)   /* tilemaps */
1403   AM_RANGE(0x530000, 0x53002f) AM_READ(TC0480SCP_ctrl_word_r)
1404   AM_RANGE(0x700000, 0x703fff) AM_READ(SMH_RAM)
1405   AM_RANGE(0x800000, 0x80000f) AM_READ(TC0510NIO_halfword_wordswap_r)
1406   AM_RANGE(0x900000, 0x900003) AM_READ(taitof2_msb_sound_r)
1407ADDRESS_MAP_END
1408
1409static ADDRESS_MAP_START( metalb_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1410   AM_RANGE(0x000000, 0x0bffff) AM_WRITE(SMH_ROM)
1411   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM)
1412   AM_RANGE(0x300000, 0x30ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1000static ADDRESS_MAP_START( metalb_map, ADDRESS_SPACE_PROGRAM, 16 )
1001   AM_RANGE(0x000000, 0x0bffff) AM_ROM
1002   AM_RANGE(0x100000, 0x10ffff) AM_RAM
1003   AM_RANGE(0x300000, 0x30ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
14131004//  AM_RANGE(0x42000c, 0x42000f) AM_WRITENOP   /* zeroed */
1414   AM_RANGE(0x500000, 0x50ffff) AM_WRITE(TC0480SCP_word_w)     /* tilemaps */
1415   AM_RANGE(0x530000, 0x53002f) AM_WRITE(TC0480SCP_ctrl_word_w)
1416   AM_RANGE(0x600000, 0x60001f) AM_WRITE(TC0360PRI_halfword_w)
1417   AM_RANGE(0x700000, 0x703fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
1418   AM_RANGE(0x800000, 0x80000f) AM_WRITE(TC0510NIO_halfword_wordswap_w)
1005   AM_RANGE(0x500000, 0x50ffff) AM_READWRITE(TC0480SCP_word_r, TC0480SCP_word_w)     /* tilemaps */
1006   AM_RANGE(0x530000, 0x53002f) AM_READWRITE(TC0480SCP_ctrl_word_r, TC0480SCP_ctrl_word_w)
1007   AM_RANGE(0x600000, 0x60001f) AM_WRITE8(TC0360PRI_w, 0x00ff)
1008   AM_RANGE(0x700000, 0x703fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
1009   AM_RANGE(0x800000, 0x80000f) AM_READWRITE(TC0510NIO_halfword_wordswap_r, TC0510NIO_halfword_wordswap_w)
14191010   AM_RANGE(0x900000, 0x900001) AM_WRITE8(taitosound_port_w, 0xff00)
1420   AM_RANGE(0x900002, 0x900003) AM_WRITE8(taitosound_comm_w, 0xff00)
1011   AM_RANGE(0x900002, 0x900003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
14211012//  AM_RANGE(0xa00000, 0xa00001) AM_WRITENOP   /* ??? */
14221013ADDRESS_MAP_END
14231014
1424static ADDRESS_MAP_START( qzchikyu_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1425   AM_RANGE(0x000000, 0x17ffff) AM_READ(SMH_ROM)
1426   AM_RANGE(0x200000, 0x20000f) AM_READ(TC0510NIO_halfword_r)
1427   AM_RANGE(0x300000, 0x300003) AM_READ(taitof2_sound_r)
1428   AM_RANGE(0x400000, 0x401fff) AM_READ(SMH_RAM)
1429   AM_RANGE(0x500000, 0x50ffff) AM_READ(SMH_RAM)
1430   AM_RANGE(0x600000, 0x60ffff) AM_READ(SMH_RAM)
1431   AM_RANGE(0x700000, 0x70ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
1432   AM_RANGE(0x720000, 0x72000f) AM_READ(TC0100SCN_ctrl_word_0_r)
1433ADDRESS_MAP_END
1434
1435static ADDRESS_MAP_START( qzchikyu_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1436   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(SMH_ROM)
1437   AM_RANGE(0x200000, 0x20000f) AM_WRITE(TC0510NIO_halfword_w)
1015static ADDRESS_MAP_START( qzchikyu_map, ADDRESS_SPACE_PROGRAM, 16 )
1016   AM_RANGE(0x000000, 0x17ffff) AM_ROM
1017   AM_RANGE(0x200000, 0x20000f) AM_READWRITE(TC0510NIO_halfword_r, TC0510NIO_halfword_w)
14381018   AM_RANGE(0x300000, 0x300001) AM_WRITE8(taitosound_port_w, 0x00ff)
1439   AM_RANGE(0x300002, 0x300003) AM_WRITE8(taitosound_comm_w, 0x00ff)
1440   AM_RANGE(0x400000, 0x401fff) AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
1441   AM_RANGE(0x500000, 0x50ffff) AM_WRITE(SMH_RAM)
1442   AM_RANGE(0x600000, 0x60ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1443   AM_RANGE(0x700000, 0x70ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
1444   AM_RANGE(0x720000, 0x72000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
1019   AM_RANGE(0x300002, 0x300003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0x00ff)
1020   AM_RANGE(0x400000, 0x401fff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
1021   AM_RANGE(0x500000, 0x50ffff) AM_RAM
1022   AM_RANGE(0x600000, 0x60ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1023   AM_RANGE(0x700000, 0x70ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
1024   AM_RANGE(0x720000, 0x72000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
14451025ADDRESS_MAP_END
14461026
1447static ADDRESS_MAP_START( yesnoj_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1448   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
1449   AM_RANGE(0x200000, 0x20ffff) AM_READ(SMH_RAM)
1450   AM_RANGE(0x400000, 0x40ffff) AM_READ(SMH_RAM)
1451   AM_RANGE(0x500000, 0x50ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
1452   AM_RANGE(0x520000, 0x52000f) AM_READ(TC0100SCN_ctrl_word_0_r)
1453   AM_RANGE(0x600000, 0x601fff) AM_READ(SMH_RAM)
1027static ADDRESS_MAP_START( yesnoj_map, ADDRESS_SPACE_PROGRAM, 16 )
1028   AM_RANGE(0x000000, 0x07ffff) AM_ROM
1029   AM_RANGE(0x200000, 0x20ffff) AM_RAM
1030   AM_RANGE(0x400000, 0x40ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1031   AM_RANGE(0x500000, 0x50ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
1032   AM_RANGE(0x520000, 0x52000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
1033   AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
14541034//  AM_RANGE(0x700000, 0x70000b) AM_READ(yesnoj_unknown_r)   /* what's this? */
1455   AM_RANGE(0x800000, 0x800003) AM_READ(taitof2_msb_sound_r)
1456   AM_RANGE(0xa00000, 0xa0000f) AM_READ(yesnoj_input_r)
1457   AM_RANGE(0xb00000, 0xb00001) AM_READ(yesnoj_dsw_r)
1458ADDRESS_MAP_END
1459
1460static ADDRESS_MAP_START( yesnoj_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1461   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
1462   AM_RANGE(0x200000, 0x20ffff) AM_WRITE(SMH_RAM)
1463   AM_RANGE(0x400000, 0x40ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1464   AM_RANGE(0x500000, 0x50ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
1465   AM_RANGE(0x520000, 0x52000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
1466   AM_RANGE(0x600000, 0x601fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
14671035   AM_RANGE(0x800000, 0x800001) AM_WRITE8(taitosound_port_w, 0xff00)
1468   AM_RANGE(0x800002, 0x800003) AM_WRITE8(taitosound_comm_w, 0xff00)
1036   AM_RANGE(0x800002, 0x800003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
14691037   AM_RANGE(0x900002, 0x900003) AM_WRITENOP   /* lots of similar writes */
1038   AM_RANGE(0xa00000, 0xa00001) AM_READ_PORT("IN0")
1039   AM_RANGE(0xa00002, 0xa00003) AM_READ_PORT("IN1")
1040   AM_RANGE(0xa00004, 0xa00005) AM_READ_PORT("IN2")
1041   AM_RANGE(0xb00000, 0xb00001) AM_READ_PORT("DSWA")
14701042   AM_RANGE(0xc00000, 0xc00001) AM_WRITENOP   /* watchdog ?? */
14711043   AM_RANGE(0xd00000, 0xd00001) AM_WRITENOP   /* lots of similar writes */
14721044ADDRESS_MAP_END
14731045
1474static ADDRESS_MAP_START( deadconx_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1475   AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM)
1476   AM_RANGE(0x100000, 0x10ffff) AM_READ(SMH_RAM)
1477   AM_RANGE(0x200000, 0x20ffff) AM_READ(SMH_RAM)
1478   AM_RANGE(0x400000, 0x40ffff) AM_READ(TC0480SCP_word_r)   /* tilemaps */
1479   AM_RANGE(0x430000, 0x43002f) AM_READ(TC0480SCP_ctrl_word_r)
1480   AM_RANGE(0x600000, 0x601fff) AM_READ(SMH_RAM)
1481   AM_RANGE(0x700000, 0x70001f) AM_READ(deadconx_input_r)
1482   AM_RANGE(0xa00000, 0xa00003) AM_READ(taitof2_msb_sound_r)
1483ADDRESS_MAP_END
1484
1485static ADDRESS_MAP_START( deadconx_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1486   AM_RANGE(0x000000, 0x0fffff) AM_WRITE(SMH_ROM)
1487   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM)
1488   AM_RANGE(0x200000, 0x20ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1046static ADDRESS_MAP_START( deadconx_map, ADDRESS_SPACE_PROGRAM, 16 )
1047   AM_RANGE(0x000000, 0x0fffff) AM_ROM
1048   AM_RANGE(0x100000, 0x10ffff) AM_RAM
1049   AM_RANGE(0x200000, 0x20ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
14891050   AM_RANGE(0x300000, 0x30000f) AM_WRITE(taitof2_spritebank_w)
1490   AM_RANGE(0x400000, 0x40ffff) AM_WRITE(TC0480SCP_word_w)     /* tilemaps */
1051   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(TC0480SCP_word_r, TC0480SCP_word_w)     /* tilemaps */
14911052//  AM_RANGE(0x42000c, 0x42000f) AM_WRITENOP   /* zeroed */
1492   AM_RANGE(0x430000, 0x43002f) AM_WRITE(TC0480SCP_ctrl_word_w)
1493   AM_RANGE(0x500000, 0x50001f) AM_WRITE(TC0360PRI_halfword_w)   /* uses 500002 like a watchdog !? */
1494   AM_RANGE(0x600000, 0x601fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
1053   AM_RANGE(0x430000, 0x43002f) AM_READWRITE(TC0480SCP_ctrl_word_r, TC0480SCP_ctrl_word_w)
1054   AM_RANGE(0x500000, 0x50001f) AM_WRITE8(TC0360PRI_w, 0x00ff)   /* uses 500002 like a watchdog !? */
1055   AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
1056   AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSWA")
1057   AM_RANGE(0x700002, 0x700003) AM_READ_PORT("DSWB")
1058   AM_RANGE(0x700004, 0x700005) AM_READ_PORT("IN2")
14951059   AM_RANGE(0x700006, 0x700007) AM_WRITE(taitof2_4p_coin_word_w)
1496   AM_RANGE(0x800000, 0x800001) AM_WRITE(taitof2_watchdog_w)   /* ??? */
1060   AM_RANGE(0x70000a, 0x70000b) AM_READ_PORT("IN0")
1061   AM_RANGE(0x70000c, 0x70000d) AM_READ_PORT("IN1")
1062   AM_RANGE(0x800000, 0x800001) AM_WRITE(watchdog_reset16_w)   /* ??? */
14971063   AM_RANGE(0xa00000, 0xa00001) AM_WRITE8(taitosound_port_w, 0xff00)
1498   AM_RANGE(0xa00002, 0xa00003) AM_WRITE8(taitosound_comm_w, 0xff00)
1064   AM_RANGE(0xa00002, 0xa00003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
14991065ADDRESS_MAP_END
15001066
1501static ADDRESS_MAP_START( dinorex_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1502   AM_RANGE(0x000000, 0x2fffff) AM_READ(SMH_ROM)
1503   AM_RANGE(0x300000, 0x30000f) AM_READ(TC0510NIO_halfword_r)
1504   AM_RANGE(0x500000, 0x501fff) AM_READ(SMH_RAM)
1505   AM_RANGE(0x600000, 0x60ffff) AM_READ(SMH_RAM)
1506   AM_RANGE(0x800000, 0x80ffff) AM_READ(SMH_RAM)
1507   AM_RANGE(0x900000, 0x90ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
1508   AM_RANGE(0x920000, 0x92000f) AM_READ(TC0100SCN_ctrl_word_0_r)
1509   AM_RANGE(0xa00000, 0xa00003) AM_READ(taitof2_msb_sound_r)
1510ADDRESS_MAP_END
1511
1512static ADDRESS_MAP_START( dinorex_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1513   AM_RANGE(0x000000, 0x2fffff) AM_WRITE(SMH_ROM)
1514   AM_RANGE(0x300000, 0x30000f) AM_WRITE(TC0510NIO_halfword_w)
1067static ADDRESS_MAP_START( dinorex_map, ADDRESS_SPACE_PROGRAM, 16 )
1068   AM_RANGE(0x000000, 0x2fffff) AM_ROM
1069   AM_RANGE(0x300000, 0x30000f) AM_READWRITE(TC0510NIO_halfword_r, TC0510NIO_halfword_w)
15151070   AM_RANGE(0x400000, 0x400fff) AM_WRITE(taitof2_sprite_extension_w) AM_BASE(&f2_sprite_extension) AM_SIZE(&f2_spriteext_size)
1516   AM_RANGE(0x500000, 0x501fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
1517   AM_RANGE(0x600000, 0x60ffff) AM_WRITE(SMH_RAM)
1518   AM_RANGE(0x700000, 0x70001f) AM_WRITE(TC0360PRI_halfword_w)   /* ?? */
1519   AM_RANGE(0x800000, 0x80ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1520   AM_RANGE(0x900000, 0x90ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
1521   AM_RANGE(0x920000, 0x92000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
1071   AM_RANGE(0x500000, 0x501fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
1072   AM_RANGE(0x600000, 0x60ffff) AM_RAM
1073   AM_RANGE(0x700000, 0x70001f) AM_WRITE8(TC0360PRI_w, 0x00ff)   /* ?? */
1074   AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1075   AM_RANGE(0x900000, 0x90ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
1076   AM_RANGE(0x920000, 0x92000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
15221077   AM_RANGE(0xa00000, 0xa00001) AM_WRITE8(taitosound_port_w, 0xff00)
1523   AM_RANGE(0xa00002, 0xa00003) AM_WRITE8(taitosound_comm_w, 0xff00)
1078   AM_RANGE(0xa00002, 0xa00003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
15241079   AM_RANGE(0xb00000, 0xb00001) AM_WRITENOP   /* watchdog? */
15251080ADDRESS_MAP_END
15261081
1527static ADDRESS_MAP_START( qjinsei_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1528   AM_RANGE(0x000000, 0x1fffff) AM_READ(SMH_ROM)
1529   AM_RANGE(0x200000, 0x200003) AM_READ(taitof2_msb_sound_r)
1530   AM_RANGE(0x300000, 0x30ffff) AM_READ(SMH_RAM)
1531   AM_RANGE(0x700000, 0x701fff) AM_READ(SMH_RAM)
1532   AM_RANGE(0x800000, 0x80ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
1533   AM_RANGE(0x820000, 0x82000f) AM_READ(TC0100SCN_ctrl_word_0_r)
1534   AM_RANGE(0x900000, 0x90ffff) AM_READ(SMH_RAM)
1535   AM_RANGE(0xb00000, 0xb0000f) AM_READ(TC0510NIO_halfword_r)
1536ADDRESS_MAP_END
1537
1538static ADDRESS_MAP_START( qjinsei_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1539   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
1082static ADDRESS_MAP_START( qjinsei_map, ADDRESS_SPACE_PROGRAM, 16 )
1083   AM_RANGE(0x000000, 0x1fffff) AM_ROM
15401084   AM_RANGE(0x200000, 0x200001) AM_WRITE8(taitosound_port_w, 0xff00)
1541   AM_RANGE(0x200002, 0x200003) AM_WRITE8(taitosound_comm_w, 0xff00)
1542   AM_RANGE(0x300000, 0x30ffff) AM_WRITE(SMH_RAM)
1085   AM_RANGE(0x200002, 0x200003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
1086   AM_RANGE(0x300000, 0x30ffff) AM_RAM
15431087   AM_RANGE(0x500000, 0x500001) AM_WRITENOP   /* watchdog ? */
15441088   AM_RANGE(0x600000, 0x603fff) AM_WRITE(taitof2_sprite_extension_w) AM_BASE(&f2_sprite_extension) AM_SIZE(&f2_spriteext_size)
1545   AM_RANGE(0x700000, 0x701fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
1546   AM_RANGE(0x800000, 0x80ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
1547   AM_RANGE(0x820000, 0x82000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
1548   AM_RANGE(0x900000, 0x90ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1549   AM_RANGE(0xa00000, 0xa0001f) AM_WRITE(TC0360PRI_halfword_w)   /* ?? */
1550   AM_RANGE(0xb00000, 0xb0000f) AM_WRITE(TC0510NIO_halfword_w)
1089   AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
1090   AM_RANGE(0x800000, 0x80ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
1091   AM_RANGE(0x820000, 0x82000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
1092   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1093   AM_RANGE(0xa00000, 0xa0001f) AM_WRITE8(TC0360PRI_w, 0x00ff)   /* ?? */
1094   AM_RANGE(0xb00000, 0xb0000f) AM_READWRITE(TC0510NIO_halfword_r, TC0510NIO_halfword_w)
15511095ADDRESS_MAP_END
15521096
1553static ADDRESS_MAP_START( qcrayon_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1554   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
1555   AM_RANGE(0x100000, 0x10ffff) AM_READ(SMH_RAM)
1556   AM_RANGE(0x300000, 0x3fffff) AM_READ(SMH_BANK1)   /* extra data rom */
1557   AM_RANGE(0x500000, 0x500003) AM_READ(taitof2_msb_sound_r)
1558   AM_RANGE(0x700000, 0x701fff) AM_READ(SMH_RAM)
1559   AM_RANGE(0x800000, 0x80ffff) AM_READ(SMH_RAM)
1560   AM_RANGE(0x900000, 0x90ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
1561   AM_RANGE(0x920000, 0x92000f) AM_READ(TC0100SCN_ctrl_word_0_r)
1562   AM_RANGE(0xa00000, 0xa0000f) AM_READ(TC0510NIO_halfword_r)
1563ADDRESS_MAP_END
1564
1565static ADDRESS_MAP_START( qcrayon_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1566   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
1567   AM_RANGE(0x100000, 0x10ffff) AM_WRITE(SMH_RAM)
1097static ADDRESS_MAP_START( qcrayon_map, ADDRESS_SPACE_PROGRAM, 16 )
1098   AM_RANGE(0x000000, 0x07ffff) AM_ROM
1099   AM_RANGE(0x100000, 0x10ffff) AM_RAM
15681100//  AM_RANGE(0x200000, 0x200001) AM_WRITENOP   /* unknown */
1569   AM_RANGE(0x300000, 0x3fffff) AM_WRITE(SMH_ROM)
1101   AM_RANGE(0x300000, 0x3fffff) AM_ROM AM_REGION("extra", 0)   /* extra data rom */
15701102   AM_RANGE(0x500000, 0x500001) AM_WRITE8(taitosound_port_w, 0xff00)
1571   AM_RANGE(0x500002, 0x500003) AM_WRITE8(taitosound_comm_w, 0xff00)
1103   AM_RANGE(0x500002, 0x500003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
15721104   AM_RANGE(0x600000, 0x603fff) AM_WRITE(taitof2_sprite_extension_w) AM_BASE(&f2_sprite_extension) AM_SIZE(&f2_spriteext_size)
1573   AM_RANGE(0x700000, 0x701fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
1574   AM_RANGE(0x800000, 0x80ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1575   AM_RANGE(0x900000, 0x90ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
1576   AM_RANGE(0x920000, 0x92000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
1577   AM_RANGE(0xa00000, 0xa0000f) AM_WRITE(TC0510NIO_halfword_w)
1578   AM_RANGE(0xb00000, 0xb0001f) AM_WRITE(TC0360PRI_halfword_w)   /* ?? */
1105   AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
1106   AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1107   AM_RANGE(0x900000, 0x90ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
1108   AM_RANGE(0x920000, 0x92000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
1109   AM_RANGE(0xa00000, 0xa0000f) AM_READWRITE(TC0510NIO_halfword_r, TC0510NIO_halfword_w)
1110   AM_RANGE(0xb00000, 0xb0001f) AM_WRITE8(TC0360PRI_w, 0x00ff)   /* ?? */
15791111ADDRESS_MAP_END
15801112
1581static ADDRESS_MAP_START( qcrayon2_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1582   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
1583   AM_RANGE(0x200000, 0x20ffff) AM_READ(SMH_RAM)
1584   AM_RANGE(0x300000, 0x301fff) AM_READ(SMH_RAM)
1585   AM_RANGE(0x400000, 0x40ffff) AM_READ(SMH_RAM)
1586   AM_RANGE(0x500000, 0x50ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
1587   AM_RANGE(0x520000, 0x52000f) AM_READ(TC0100SCN_ctrl_word_0_r)
1588   AM_RANGE(0x600000, 0x67ffff) AM_READ(SMH_BANK1)   /* extra data rom */
1589   AM_RANGE(0x700000, 0x70000f) AM_READ(TC0510NIO_halfword_r)
1590   AM_RANGE(0xa00000, 0xa00003) AM_READ(taitof2_msb_sound_r)
1591ADDRESS_MAP_END
1592
1593static ADDRESS_MAP_START( qcrayon2_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1594   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
1595   AM_RANGE(0x200000, 0x20ffff) AM_WRITE(SMH_RAM)
1596   AM_RANGE(0x300000, 0x301fff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
1597   AM_RANGE(0x400000, 0x40ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1598   AM_RANGE(0x500000, 0x50ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
1599   AM_RANGE(0x520000, 0x52000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
1600   AM_RANGE(0x600000, 0x67ffff) AM_WRITE(SMH_ROM)
1601   AM_RANGE(0x700000, 0x70000f) AM_WRITE(TC0510NIO_halfword_w)
1602   AM_RANGE(0x900000, 0x90001f) AM_WRITE(TC0360PRI_halfword_w)   /* ?? */
1113static ADDRESS_MAP_START( qcrayon2_map, ADDRESS_SPACE_PROGRAM, 16 )
1114   AM_RANGE(0x000000, 0x07ffff) AM_ROM
1115   AM_RANGE(0x200000, 0x20ffff) AM_RAM
1116   AM_RANGE(0x300000, 0x301fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
1117   AM_RANGE(0x400000, 0x40ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1118   AM_RANGE(0x500000, 0x50ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
1119   AM_RANGE(0x520000, 0x52000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
1120   AM_RANGE(0x600000, 0x67ffff) AM_ROM AM_REGION("extra", 0)   /* extra data rom */
1121   AM_RANGE(0x700000, 0x70000f) AM_READWRITE(TC0510NIO_halfword_r, TC0510NIO_halfword_w)
1122   AM_RANGE(0x900000, 0x90001f) AM_WRITE8(TC0360PRI_w, 0x00ff)   /* ?? */
16031123   AM_RANGE(0xa00000, 0xa00001) AM_WRITE8(taitosound_port_w, 0xff00)
1604   AM_RANGE(0xa00002, 0xa00003) AM_WRITE8(taitosound_comm_w, 0xff00)
1124   AM_RANGE(0xa00002, 0xa00003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
16051125   AM_RANGE(0xb00000, 0xb017ff) AM_WRITE(taitof2_sprite_extension_w) AM_BASE(&f2_sprite_extension) AM_SIZE(&f2_spriteext_size)
16061126ADDRESS_MAP_END
16071127
1608static ADDRESS_MAP_START( driftout_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1609   AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM)
1610   AM_RANGE(0x200000, 0x200003) AM_READ(taitof2_msb_sound_r)
1611   AM_RANGE(0x300000, 0x30ffff) AM_READ(SMH_RAM)
1612   AM_RANGE(0x400000, 0x401fff) AM_READ(TC0430GRW_word_r)
1613   AM_RANGE(0x700000, 0x701fff) AM_READ(SMH_RAM)
1614   AM_RANGE(0x800000, 0x80ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
1615   AM_RANGE(0x820000, 0x82000f) AM_READ(TC0100SCN_ctrl_word_0_r)
1616   AM_RANGE(0x900000, 0x90ffff) AM_READ(SMH_RAM)
1617   AM_RANGE(0xb00000, 0xb0000f) AM_READ(TC0510NIO_halfword_r)
1618   AM_RANGE(0xb00018, 0xb0001f) AM_READ(driftout_paddle_r)
1619ADDRESS_MAP_END
1620
1621static ADDRESS_MAP_START( driftout_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1622   AM_RANGE(0x000000, 0x0fffff) AM_WRITE(SMH_ROM)
1128static ADDRESS_MAP_START( driftout_map, ADDRESS_SPACE_PROGRAM, 16 )
1129   AM_RANGE(0x000000, 0x0fffff) AM_ROM
16231130   AM_RANGE(0x200000, 0x200001) AM_WRITE8(taitosound_port_w, 0xff00)
1624   AM_RANGE(0x200002, 0x200003) AM_WRITE8(taitosound_comm_w, 0xff00)
1625   AM_RANGE(0x300000, 0x30ffff) AM_WRITE(SMH_RAM)
1626   AM_RANGE(0x400000, 0x401fff) AM_WRITE(TC0430GRW_word_w)   /* ROZ tilemap */
1131   AM_RANGE(0x200002, 0x200003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0xff00)
1132   AM_RANGE(0x300000, 0x30ffff) AM_RAM
1133   AM_RANGE(0x400000, 0x401fff) AM_READWRITE(TC0430GRW_word_r, TC0430GRW_word_w)   /* ROZ tilemap */
16271134   AM_RANGE(0x402000, 0x40200f) AM_WRITE(TC0430GRW_ctrl_word_w)
1628   AM_RANGE(0x700000, 0x701fff) AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
1629   AM_RANGE(0x800000, 0x80ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
1630   AM_RANGE(0x820000, 0x82000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
1631   AM_RANGE(0x900000, 0x90ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1632   AM_RANGE(0xa00000, 0xa0001f) AM_WRITE(TC0360PRI_halfword_swap_w)
1633   AM_RANGE(0xb00000, 0xb0000f) AM_WRITE(TC0510NIO_halfword_w)
1135   AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
1136   AM_RANGE(0x800000, 0x80ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
1137   AM_RANGE(0x820000, 0x82000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
1138   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1139   AM_RANGE(0xa00000, 0xa0001f) AM_WRITE8(TC0360PRI_w, 0xff00)
1140   AM_RANGE(0xb00000, 0xb0000f) AM_READWRITE(TC0510NIO_halfword_r, TC0510NIO_halfword_w)
1141   AM_RANGE(0xb00018, 0xb00019) AM_READ_PORT("PADDLE1")
1142   AM_RANGE(0xb0001a, 0xb0001b) AM_READ_PORT("PADDLE2")
16341143ADDRESS_MAP_END
16351144
16361145/* same as driftout, except for sound address 0x200000 */
1637static ADDRESS_MAP_START( driveout_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1638   AM_RANGE(0x000000, 0x0fffff) AM_READ(SMH_ROM)
1639   AM_RANGE(0x200000, 0x200003) AM_READNOP
1640   AM_RANGE(0x300000, 0x30ffff) AM_READ(SMH_RAM)
1641   AM_RANGE(0x400000, 0x401fff) AM_READ(TC0430GRW_word_r)
1642   AM_RANGE(0x700000, 0x701fff) AM_READ(SMH_RAM)
1643   AM_RANGE(0x800000, 0x80ffff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps */
1644   AM_RANGE(0x820000, 0x82000f) AM_READ(TC0100SCN_ctrl_word_0_r)
1645   AM_RANGE(0x900000, 0x90ffff) AM_READ(SMH_RAM)
1646   AM_RANGE(0xb00000, 0xb0000f) AM_READ(TC0510NIO_halfword_r)
1647   AM_RANGE(0xb00018, 0xb0001f) AM_READ(driftout_paddle_r)
1648ADDRESS_MAP_END
1649
1650static ADDRESS_MAP_START( driveout_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1651   AM_RANGE(0x000000, 0x0fffff) AM_WRITE(SMH_ROM)
1652   AM_RANGE(0x200000, 0x200003) AM_WRITE(driveout_sound_command_w)
1653   AM_RANGE(0x300000, 0x30ffff) AM_WRITE(SMH_RAM)
1654   AM_RANGE(0x400000, 0x401fff) AM_WRITE(TC0430GRW_word_w)   /* ROZ tilemap */
1146static ADDRESS_MAP_START( driveout_map, ADDRESS_SPACE_PROGRAM, 16 )
1147   AM_RANGE(0x000000, 0x0fffff) AM_ROM
1148   AM_RANGE(0x200000, 0x200003) AM_READNOP AM_WRITE(driveout_sound_command_w)
1149   AM_RANGE(0x300000, 0x30ffff) AM_RAM
1150   AM_RANGE(0x400000, 0x401fff) AM_READWRITE(TC0430GRW_word_r, TC0430GRW_word_w)   /* ROZ tilemap */
16551151   AM_RANGE(0x402000, 0x40200f) AM_WRITE(TC0430GRW_ctrl_word_w)
1656   AM_RANGE(0x700000, 0x701fff) AM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
1657   AM_RANGE(0x800000, 0x80ffff) AM_WRITE(TC0100SCN_word_0_w)   /* tilemaps */
1658   AM_RANGE(0x820000, 0x82000f) AM_WRITE(TC0100SCN_ctrl_word_0_w)
1659   AM_RANGE(0x900000, 0x90ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1660   AM_RANGE(0xa00000, 0xa0001f) AM_WRITE(TC0360PRI_halfword_swap_w)
1661   AM_RANGE(0xb00000, 0xb0000f) AM_WRITE(TC0510NIO_halfword_w)
1152   AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE(&paletteram16)
1153   AM_RANGE(0x800000, 0x80ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
1154   AM_RANGE(0x820000, 0x82000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
1155   AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
1156   AM_RANGE(0xa00000, 0xa0001f) AM_WRITE8(TC0360PRI_w, 0xff00)
1157   AM_RANGE(0xb00000, 0xb0000f) AM_READWRITE(TC0510NIO_halfword_r, TC0510NIO_halfword_w)
1158   AM_RANGE(0xb00018, 0xb00019) AM_READ_PORT("PADDLE1")
1159   AM_RANGE(0xb0001a, 0xb0001b) AM_READ_PORT("PADDLE2")
16621160ADDRESS_MAP_END
16631161
16641162
16651163/***************************************************************************/
16661164
1667static ADDRESS_MAP_START( sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
1668   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
1669   AM_RANGE(0x4000, 0x7fff) AM_READ(SMH_BANK2)
1670   AM_RANGE(0xc000, 0xdfff) AM_READ(SMH_RAM)
1671   AM_RANGE(0xe000, 0xe003) AM_DEVREAD("ym", ym2610_r)
1672   AM_RANGE(0xe200, 0xe200) AM_READNOP
1673   AM_RANGE(0xe201, 0xe201) AM_READ(taitosound_slave_comm_r)
1674   AM_RANGE(0xea00, 0xea00) AM_READNOP
1675ADDRESS_MAP_END
1676
1677static ADDRESS_MAP_START( sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
1678   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
1679   AM_RANGE(0xc000, 0xdfff) AM_WRITE(SMH_RAM)
1680   AM_RANGE(0xe000, 0xe003) AM_DEVWRITE("ym", ym2610_w)
1681   AM_RANGE(0xe200, 0xe200) AM_WRITE(taitosound_slave_port_w)
1682   AM_RANGE(0xe201, 0xe201) AM_WRITE(taitosound_slave_comm_w)
1165static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
1166   AM_RANGE(0x0000, 0x3fff) AM_ROM
1167   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(2)
1168   AM_RANGE(0xc000, 0xdfff) AM_RAM
1169   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ym", ym2610_r, ym2610_w)
1170   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_WRITE(taitosound_slave_port_w)
1171   AM_RANGE(0xe201, 0xe201) AM_READWRITE(taitosound_slave_comm_r, taitosound_slave_comm_w)
16831172   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
1173   AM_RANGE(0xea00, 0xea00) AM_READNOP
16841174   AM_RANGE(0xee00, 0xee00) AM_WRITENOP /* ? */
16851175   AM_RANGE(0xf000, 0xf000) AM_WRITENOP /* ? */
16861176   AM_RANGE(0xf200, 0xf200) AM_WRITE(sound_bankswitch_w)   /* ?? */
r4499r4500
16891179
16901180/* Alt version of Cameltry, YM2203 + M6925 sound */
16911181
1692static ADDRESS_MAP_START( camltrya_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
1693   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)   // I can't see a bank control, but there ARE some bytes past 0x8000
1694//  AM_RANGE(0x4000, 0x7fff) AM_READ(SMH_BANK1)
1695   AM_RANGE(0x8000, 0x8fff) AM_READ(SMH_RAM)
1696   AM_RANGE(0x9000, 0x9001) AM_DEVREAD("ym", ym2203_r)
1697   AM_RANGE(0xa001, 0xa001) AM_READ(taitosound_slave_comm_r)
1698   AM_RANGE(0xb000, 0xb000) AM_DEVREAD("oki", okim6295_r)
1699ADDRESS_MAP_END
1700
1701static ADDRESS_MAP_START( camltrya_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
1702   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
1703   AM_RANGE(0x8000, 0x8fff) AM_WRITE(SMH_RAM)
1704   AM_RANGE(0x9000, 0x9001) AM_DEVWRITE("ym", ym2203_w)
1182static ADDRESS_MAP_START( cameltrya_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
1183   AM_RANGE(0x0000, 0x7fff) AM_ROM      // I can't see a bank control, but there ARE some bytes past 0x8000
1184   AM_RANGE(0x8000, 0x8fff) AM_RAM
1185   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ym", ym2203_r, ym2203_w)
17051186   AM_RANGE(0xa000, 0xa000) AM_WRITE(taitosound_slave_port_w)
1706   AM_RANGE(0xa001, 0xa001) AM_WRITE(taitosound_slave_comm_w)
1187   AM_RANGE(0xa001, 0xa001) AM_READWRITE(taitosound_slave_comm_r, taitosound_slave_comm_w)
17071188//  AM_RANGE(0xb000, 0xb000) AM_WRITE(unknown_w)    // probably controlling sample player?
1708   AM_RANGE(0xb000, 0xb000) AM_DEVWRITE("oki", okim6295_w)
1709   AM_RANGE(0xb001, 0xb001) AM_DEVWRITE("oki", okim6295_w)
1189   AM_RANGE(0xb000, 0xb001) AM_MIRROR(0x0001) AM_DEVREADWRITE("oki", okim6295_r, okim6295_w)
17101190ADDRESS_MAP_END
17111191
17121192
1713static ADDRESS_MAP_START( driveout_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
1714   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
1715   AM_RANGE(0x8000, 0x87ff) AM_READ(SMH_RAM)
1716   AM_RANGE(0x9800, 0x9800) AM_DEVREAD("oki", okim6295_r)
1193static ADDRESS_MAP_START( driveout_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
1194   AM_RANGE(0x0000, 0x7fff) AM_ROM
1195   AM_RANGE(0x8000, 0x87ff) AM_RAM
1196   AM_RANGE(0x9000, 0x9000) AM_WRITE(oki_bank_w)
1197   AM_RANGE(0x9800, 0x9800) AM_DEVREADWRITE("oki", okim6295_r, okim6295_w)
17171198   AM_RANGE(0xa000, 0xa000) AM_READ(driveout_sound_command_r)
17181199ADDRESS_MAP_END
17191200
1720static ADDRESS_MAP_START( driveout_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
1721   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
1722   AM_RANGE(0x8000, 0x87ff) AM_WRITE(SMH_RAM)
1723   AM_RANGE(0x9000, 0x9000) AM_WRITE(oki_bank_w)
1724   AM_RANGE(0x9800, 0x9800) AM_DEVWRITE("oki", okim6295_w)
1725ADDRESS_MAP_END
1726
17271201/***********************************************************
17281202                     INPUT PORTS, DIPs
17291203***********************************************************/
r4499r4500
18411315   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
18421316INPUT_PORTS_END
18431317
1844static INPUT_PORTS_START( dondokdu )
1318static INPUT_PORTS_START( dondokodu )
18451319   PORT_INCLUDE(dondokod)
18461320
18471321   PORT_MODIFY("DSWA")
18481322   TAITO_COINAGE_US
18491323INPUT_PORTS_END
18501324
1851static INPUT_PORTS_START( dondokdj )
1325static INPUT_PORTS_START( dondokodj )
18521326   PORT_INCLUDE(dondokod)
18531327
18541328   PORT_MODIFY("DSWA")
r4499r4500
19591433   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
19601434INPUT_PORTS_END
19611435
1962static INPUT_PORTS_START( thndfoxu )
1436static INPUT_PORTS_START( thundfoxu )
19631437   PORT_INCLUDE(thundfox)
19641438
19651439   PORT_MODIFY("DSWA")
19661440   TAITO_COINAGE_US
19671441INPUT_PORTS_END
19681442
1969static INPUT_PORTS_START( thndfoxj )
1443static INPUT_PORTS_START( thundfoxj )
19701444   PORT_INCLUDE(thundfox)
19711445
19721446   PORT_MODIFY("DSWA")
r4499r4500
20411515   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_PLAYER(2)
20421516INPUT_PORTS_END
20431517
2044static INPUT_PORTS_START( cameltrj )
1518static INPUT_PORTS_START( cameltryj )
20451519   PORT_INCLUDE(cameltry)
20461520
20471521   PORT_MODIFY("DSWA")
r4499r4500
24051879   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
24061880INPUT_PORTS_END
24071881
2408static INPUT_PORTS_START( pulirulj )
1882static INPUT_PORTS_START( pulirulaj )
24091883   PORT_INCLUDE(pulirula)
24101884
24111885   PORT_MODIFY("DSWA")
r4499r4500
28162290   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
28172291INPUT_PORTS_END
28182292
2819static INPUT_PORTS_START( gunfronj )
2293static INPUT_PORTS_START( gunfrontj )
28202294   PORT_INCLUDE(gunfront)
28212295
28222296   PORT_MODIFY("DSWA")
r4499r4500
29282402   PORT_DIPSETTING(    0x80, "Multiplayer" )
29292403INPUT_PORTS_END
29302404
2931static INPUT_PORTS_START( deadconj )
2405static INPUT_PORTS_START( deadconxj )
29322406   PORT_INCLUDE(deadconx)
29332407
29342408   PORT_MODIFY("DSWA")
r4499r4500
36643138};
36653139
36663140
3667static WRITE8_DEVICE_HANDLER( camltrya_porta_w )
3141static WRITE8_DEVICE_HANDLER( cameltrya_porta_w )
36683142{
36693143   // Implement //
36703144}
r4499r4500
36763150      AY8910_DEFAULT_LOADS,
36773151      DEVCB_NULL,            /* portA read */
36783152      DEVCB_NULL,
3679      DEVCB_HANDLER(camltrya_porta_w),   /* portA write - not implemented */
3153      DEVCB_HANDLER(cameltrya_porta_w),   /* portA write - not implemented */
36803154      DEVCB_NULL,            /* portB write */
36813155   },
36823156   irq_handler
r4499r4500
36873161                      MACHINE DRIVERS
36883162***********************************************************/
36893163
3690static STATE_POSTLOAD( f2_postload )
3691{
3692   reset_sound_region(machine);
3693}
3694
36953164static MACHINE_START( f2 )
36963165{
3697   state_save_register_global(machine, banknum);
3698   state_save_register_postload(machine, f2_postload, NULL);
3166   memory_configure_bank(machine, 2, 0, 8, memory_region(machine, "audiocpu") + 0x10000, 0x4000);
36993167}
37003168
3701static MACHINE_RESET( qcrayon )
3702{
3703   /* point to the extra ROM */
3704   memory_set_bankptr(machine, 1,memory_region(machine, "user1"));
3705}
37063169
3707
37083170static MACHINE_DRIVER_START( taito_f2 )
37093171
37103172   /* basic machine hardware */
r4499r4500
37123174   MDRV_CPU_VBLANK_INT("screen", taitof2_interrupt)
37133175
37143176   MDRV_CPU_ADD("audiocpu", Z80, 24000000/6)   /* 4 MHz */
3715   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
3177   MDRV_CPU_PROGRAM_MAP(sound_map,0)
37163178
37173179   MDRV_MACHINE_START(f2)
37183180
r4499r4500
37483210   /* basic machine hardware */
37493211   MDRV_IMPORT_FROM(taito_f2)
37503212   MDRV_CPU_MODIFY("maincpu")
3751   MDRV_CPU_PROGRAM_MAP(finalb_readmem,finalb_writemem)
3213   MDRV_CPU_PROGRAM_MAP(finalb_map,0)
37523214
37533215   /* video hardware */
37543216   MDRV_GFXDECODE(finalb)
r4499r4500
37623224   /* basic machine hardware */
37633225   MDRV_IMPORT_FROM(taito_f2)
37643226   MDRV_CPU_MODIFY("maincpu")
3765   MDRV_CPU_PROGRAM_MAP(dondokod_readmem,dondokod_writemem)
3227   MDRV_CPU_PROGRAM_MAP(dondokod_map,0)
37663228
37673229   /* video hardware */
37683230   MDRV_GFXDECODE(pivot)
r4499r4500
37773239   /* basic machine hardware */
37783240   MDRV_IMPORT_FROM(taito_f2)
37793241   MDRV_CPU_MODIFY("maincpu")
3780   MDRV_CPU_PROGRAM_MAP(megab_readmem,megab_writemem)
3242   MDRV_CPU_PROGRAM_MAP(megab_map,0)
37813243
37823244   /* video hardware */
37833245   MDRV_VIDEO_START(taitof2_megab)
r4499r4500
37903252   /* basic machine hardware */
37913253   MDRV_IMPORT_FROM(taito_f2)
37923254   MDRV_CPU_MODIFY("maincpu")
3793   MDRV_CPU_PROGRAM_MAP(thundfox_readmem,thundfox_writemem)
3255   MDRV_CPU_PROGRAM_MAP(thundfox_map,0)
37943256
37953257   /* video hardware */
37963258   MDRV_GFXDECODE(thundfox)
r4499r4500
38053267   /* basic machine hardware */
38063268   MDRV_IMPORT_FROM(taito_f2)
38073269   MDRV_CPU_MODIFY("maincpu")
3808   MDRV_CPU_PROGRAM_MAP(cameltry_readmem,cameltry_writemem)
3270   MDRV_CPU_PROGRAM_MAP(cameltry_map,0)
38093271
38103272   /* video hardware */
38113273   MDRV_GFXDECODE(pivot)
r4499r4500
38193281   /* basic machine hardware */
38203282   MDRV_IMPORT_FROM(taito_f2)
38213283   MDRV_CPU_MODIFY("maincpu")
3822   MDRV_CPU_PROGRAM_MAP(qtorimon_readmem,qtorimon_writemem)
3284   MDRV_CPU_PROGRAM_MAP(qtorimon_map,0)
38233285
38243286   /* video hardware */
38253287   MDRV_GFXDECODE(yuyugogo)
r4499r4500
38323294   /* basic machine hardware */
38333295   MDRV_IMPORT_FROM(taito_f2)
38343296   MDRV_CPU_MODIFY("maincpu")
3835   MDRV_CPU_PROGRAM_MAP(liquidk_readmem,liquidk_writemem)
3297   MDRV_CPU_PROGRAM_MAP(liquidk_map,0)
38363298
38373299   /* video hardware */
38383300   MDRV_VIDEO_START(taitof2_megab)
r4499r4500
38463308   /* basic machine hardware */
38473309   MDRV_IMPORT_FROM(taito_f2)
38483310   MDRV_CPU_MODIFY("maincpu")
3849   MDRV_CPU_PROGRAM_MAP(quizhq_readmem,quizhq_writemem)
3311   MDRV_CPU_PROGRAM_MAP(quizhq_map,0)
38503312
38513313   /* video hardware */
38523314   MDRV_GFXDECODE(yuyugogo)
r4499r4500
38593321   /* basic machine hardware */
38603322   MDRV_IMPORT_FROM(taito_f2)
38613323   MDRV_CPU_MODIFY("maincpu")
3862   MDRV_CPU_PROGRAM_MAP(ssi_readmem,ssi_writemem)
3324   MDRV_CPU_PROGRAM_MAP(ssi_map,0)
38633325
38643326   /* video hardware */
38653327   MDRV_VIDEO_START(taitof2_ssi)
r4499r4500
38733335   /* basic machine hardware */
38743336   MDRV_IMPORT_FROM(taito_f2)
38753337   MDRV_CPU_MODIFY("maincpu")
3876   MDRV_CPU_PROGRAM_MAP(gunfront_readmem,gunfront_writemem)
3338   MDRV_CPU_PROGRAM_MAP(gunfront_map,0)
38773339
38783340   /* video hardware */
38793341   MDRV_VIDEO_START(taitof2_gunfront)
r4499r4500
38863348   /* basic machine hardware */
38873349   MDRV_IMPORT_FROM(taito_f2)
38883350   MDRV_CPU_MODIFY("maincpu")
3889   MDRV_CPU_PROGRAM_MAP(growl_readmem,growl_writemem)
3351   MDRV_CPU_PROGRAM_MAP(growl_map,0)
38903352
38913353   /* video hardware */
38923354   MDRV_VIDEO_START(taitof2_growl)
r4499r4500
38993361   /* basic machine hardware */
39003362   MDRV_IMPORT_FROM(taito_f2)
39013363   MDRV_CPU_MODIFY("maincpu")
3902   MDRV_CPU_PROGRAM_MAP(mjnquest_readmem,mjnquest_writemem)
3364   MDRV_CPU_PROGRAM_MAP(mjnquest_map,0)
39033365
39043366   /* video hardware */
39053367   MDRV_VIDEO_START(taitof2_mjnquest)
r4499r4500
39113373   /* basic machine hardware */
39123374   MDRV_IMPORT_FROM(taito_f2)
39133375   MDRV_CPU_MODIFY("maincpu")
3914   MDRV_CPU_PROGRAM_MAP(footchmp_readmem,footchmp_writemem)
3376   MDRV_CPU_PROGRAM_MAP(footchmp_map,0)
39153377
39163378   /* video hardware */
39173379   MDRV_GFXDECODE(deadconx)
r4499r4500
39263388   /* basic machine hardware */
39273389   MDRV_IMPORT_FROM(taito_f2)
39283390   MDRV_CPU_MODIFY("maincpu")
3929   MDRV_CPU_PROGRAM_MAP(footchmp_readmem,footchmp_writemem)
3391   MDRV_CPU_PROGRAM_MAP(footchmp_map,0)
39303392
39313393   /* video hardware */
39323394   MDRV_GFXDECODE(deadconx)
r4499r4500
39413403   /* basic machine hardware */
39423404   MDRV_IMPORT_FROM(taito_f2)
39433405   MDRV_CPU_MODIFY("maincpu")
3944   MDRV_CPU_PROGRAM_MAP(koshien_readmem,koshien_writemem)
3406   MDRV_CPU_PROGRAM_MAP(koshien_map,0)
39453407
39463408   /* video hardware */
39473409   MDRV_VIDEO_START(taitof2_koshien)
r4499r4500
39543416   /* basic machine hardware */
39553417   MDRV_IMPORT_FROM(taito_f2)
39563418   MDRV_CPU_MODIFY("maincpu")
3957   MDRV_CPU_PROGRAM_MAP(yuyugogo_readmem,yuyugogo_writemem)
3419   MDRV_CPU_PROGRAM_MAP(yuyugogo_map,0)
39583420
3959   MDRV_MACHINE_RESET(qcrayon)
3960
39613421   /* video hardware */
39623422   MDRV_GFXDECODE(yuyugogo)
39633423   MDRV_VIDEO_START(taitof2_yuyugogo)
r4499r4500
39703430   /* basic machine hardware */
39713431   MDRV_IMPORT_FROM(taito_f2)
39723432   MDRV_CPU_MODIFY("maincpu")
3973   MDRV_CPU_PROGRAM_MAP(ninjak_readmem,ninjak_writemem)
3433   MDRV_CPU_PROGRAM_MAP(ninjak_map,0)
39743434
39753435   /* video hardware */
39763436   MDRV_VIDEO_START(taitof2_ninjak)
r4499r4500
39833443   /* basic machine hardware */
39843444   MDRV_IMPORT_FROM(taito_f2)
39853445   MDRV_CPU_MODIFY("maincpu")
3986   MDRV_CPU_PROGRAM_MAP(solfigtr_readmem,solfigtr_writemem)
3446   MDRV_CPU_PROGRAM_MAP(solfigtr_map,0)
39873447
39883448   /* video hardware */
39893449   MDRV_VIDEO_START(taitof2_solfigtr)
r4499r4500
39963456   /* basic machine hardware */
39973457   MDRV_IMPORT_FROM(taito_f2)
39983458   MDRV_CPU_MODIFY("maincpu")
3999   MDRV_CPU_PROGRAM_MAP(qzquest_readmem,qzquest_writemem)
3459   MDRV_CPU_PROGRAM_MAP(qzquest_map,0)
40003460
40013461   /* video hardware */
40023462   MDRV_VIDEO_EOF(taitof2_partial_buffer_delayed)
r4499r4500
40083468   /* basic machine hardware */
40093469   MDRV_IMPORT_FROM(taito_f2)
40103470   MDRV_CPU_MODIFY("maincpu")
4011   MDRV_CPU_PROGRAM_MAP(pulirula_readmem,pulirula_writemem)
3471   MDRV_CPU_PROGRAM_MAP(pulirula_map,0)
40123472
40133473   /* video hardware */
40143474   MDRV_GFXDECODE(pivot)
r4499r4500
40223482   /* basic machine hardware */
40233483   MDRV_IMPORT_FROM(taito_f2)
40243484   MDRV_CPU_MODIFY("maincpu")
4025   MDRV_CPU_PROGRAM_MAP(metalb_readmem,metalb_writemem)
3485   MDRV_CPU_PROGRAM_MAP(metalb_map,0)
40263486
40273487   /* video hardware */
40283488   MDRV_GFXDECODE(deadconx)
r4499r4500
40373497   /* basic machine hardware */
40383498   MDRV_IMPORT_FROM(taito_f2)
40393499   MDRV_CPU_MODIFY("maincpu")
4040   MDRV_CPU_PROGRAM_MAP(qzchikyu_readmem,qzchikyu_writemem)
3500   MDRV_CPU_PROGRAM_MAP(qzchikyu_map,0)
40413501
40423502   /* video hardware */
40433503   MDRV_VIDEO_START(taitof2_qzchikyu)
r4499r4500
40503510   /* basic machine hardware */
40513511   MDRV_IMPORT_FROM(taito_f2)
40523512   MDRV_CPU_MODIFY("maincpu")
4053   MDRV_CPU_PROGRAM_MAP(yesnoj_readmem,yesnoj_writemem)
3513   MDRV_CPU_PROGRAM_MAP(yesnoj_map,0)
40543514
40553515   /* video hardware */
40563516   MDRV_GFXDECODE(yuyugogo)
r4499r4500
40643524   /* basic machine hardware */
40653525   MDRV_IMPORT_FROM(taito_f2)
40663526   MDRV_CPU_MODIFY("maincpu")
4067   MDRV_CPU_PROGRAM_MAP(deadconx_readmem,deadconx_writemem)
3527   MDRV_CPU_PROGRAM_MAP(deadconx_map,0)
40683528
40693529   /* video hardware */
40703530   MDRV_GFXDECODE(deadconx)
r4499r4500
40733533MACHINE_DRIVER_END
40743534
40753535
4076static MACHINE_DRIVER_START( deadconj )
3536static MACHINE_DRIVER_START( deadconxj )
40773537
40783538   /* basic machine hardware */
40793539   MDRV_IMPORT_FROM(taito_f2)
40803540   MDRV_CPU_MODIFY("maincpu")
4081   MDRV_CPU_PROGRAM_MAP(deadconx_readmem,deadconx_writemem)
3541   MDRV_CPU_PROGRAM_MAP(deadconx_map,0)
40823542
40833543   /* video hardware */
40843544   MDRV_GFXDECODE(deadconx)
4085   MDRV_VIDEO_START(taitof2_deadconj)
3545   MDRV_VIDEO_START(taitof2_deadconxj)
40863546   MDRV_VIDEO_UPDATE(deadconx)
40873547MACHINE_DRIVER_END
40883548
r4499r4500
40923552   /* basic machine hardware */
40933553   MDRV_IMPORT_FROM(taito_f2)
40943554   MDRV_CPU_MODIFY("maincpu")
4095   MDRV_CPU_PROGRAM_MAP(dinorex_readmem,dinorex_writemem)
3555   MDRV_CPU_PROGRAM_MAP(dinorex_map,0)
40963556
40973557   /* video hardware */
40983558   MDRV_VIDEO_START(taitof2_dinorex)
r4499r4500
41053565   /* basic machine hardware */
41063566   MDRV_IMPORT_FROM(taito_f2)
41073567   MDRV_CPU_MODIFY("maincpu")
4108   MDRV_CPU_PROGRAM_MAP(qjinsei_readmem,qjinsei_writemem)
3568   MDRV_CPU_PROGRAM_MAP(qjinsei_map,0)
41093569
41103570   /* video hardware */
41113571   MDRV_VIDEO_START(taitof2_quiz)
r4499r4500
41183578   /* basic machine hardware */
41193579   MDRV_IMPORT_FROM(taito_f2)
41203580   MDRV_CPU_MODIFY("maincpu")
4121   MDRV_CPU_PROGRAM_MAP(qcrayon_readmem,qcrayon_writemem)
3581   MDRV_CPU_PROGRAM_MAP(qcrayon_map,0)
41223582
4123   MDRV_MACHINE_RESET(qcrayon)
4124
41253583   /* video hardware */
41263584   MDRV_VIDEO_START(taitof2_quiz)
41273585   MDRV_VIDEO_UPDATE(taitof2_pri)
r4499r4500
41333591   /* basic machine hardware */
41343592   MDRV_IMPORT_FROM(taito_f2)
41353593   MDRV_CPU_MODIFY("maincpu")
4136   MDRV_CPU_PROGRAM_MAP(qcrayon2_readmem,qcrayon2_writemem)
3594   MDRV_CPU_PROGRAM_MAP(qcrayon2_map,0)
41373595
4138   MDRV_MACHINE_RESET(qcrayon)
4139
41403596   /* video hardware */
41413597   MDRV_VIDEO_START(taitof2_quiz)
41423598   MDRV_VIDEO_UPDATE(taitof2_pri)
r4499r4500
41483604   /* basic machine hardware */
41493605   MDRV_IMPORT_FROM(taito_f2)
41503606   MDRV_CPU_MODIFY("maincpu")
4151   MDRV_CPU_PROGRAM_MAP(driftout_readmem,driftout_writemem)
3607   MDRV_CPU_PROGRAM_MAP(driftout_map,0)
41523608
41533609   /* video hardware */
41543610   MDRV_GFXDECODE(pivot)
r4499r4500
41573613MACHINE_DRIVER_END
41583614
41593615
4160static MACHINE_DRIVER_START( camltrya )
3616static MACHINE_DRIVER_START( cameltrya )
41613617
41623618   /* basic machine hardware */
41633619   MDRV_CPU_ADD("maincpu", M68000,24000000/2)   /* verified on pcb  */
4164   MDRV_CPU_PROGRAM_MAP(cameltry_readmem,cameltry_writemem)
3620   MDRV_CPU_PROGRAM_MAP(cameltry_map,0)
41653621   MDRV_CPU_VBLANK_INT("screen", taitof2_interrupt)
41663622
41673623   MDRV_CPU_ADD("audiocpu", Z80,24000000/4)   /* verifed on pcb */
4168   MDRV_CPU_PROGRAM_MAP(camltrya_sound_readmem,camltrya_sound_writemem)
3624   MDRV_CPU_PROGRAM_MAP(cameltrya_sound_map,0)
41693625
41703626   /* video hardware */
41713627   MDRV_SCREEN_ADD("screen", RASTER)
r4499r4500
42023658
42033659   /* basic machine hardware */
42043660   MDRV_CPU_ADD("maincpu", M68000,24000000/2)   /* 12 MHz */
4205   MDRV_CPU_PROGRAM_MAP(driveout_readmem,driveout_writemem)
3661   MDRV_CPU_PROGRAM_MAP(driveout_map,0)
42063662   MDRV_CPU_VBLANK_INT("screen", taitof2_interrupt)
42073663
42083664   MDRV_CPU_ADD("audiocpu", Z80,24000000/6)   /* 4 MHz */
4209   MDRV_CPU_PROGRAM_MAP(driveout_sound_readmem,driveout_sound_writemem)
3665   MDRV_CPU_PROGRAM_MAP(driveout_sound_map,0)
42103666
42113667   /* video hardware */
42123668   MDRV_SCREEN_ADD("screen", RASTER)
r4499r4500
43783834   /* no Delta-T samples */
43793835ROM_END
43803836
4381ROM_START( dondokdu )
3837ROM_START( dondokodu )
43823838   ROM_REGION( 0x80000, "maincpu", 0 )     /* 512k for 68000 code */
43833839   ROM_LOAD16_BYTE( "b95-12.bin",   0x00000, 0x20000, CRC(d0fce87a) SHA1(7b346d3b7cbaf0b5447d66a71e815202d796f140) )
43843840   ROM_LOAD16_BYTE( "b95-11-1.bin", 0x00001, 0x20000, CRC(dad40cd3) SHA1(6c07ed3dd609a8743f5851caa4d205bce8db595e) )
r4499r4500
44043860   /* no Delta-T samples */
44053861ROM_END
44063862
4407ROM_START( dondokdj )
3863ROM_START( dondokodj )
44083864   ROM_REGION( 0x80000, "maincpu", 0 )     /* 512k for 68000 code */
44093865   ROM_LOAD16_BYTE( "b95-12.bin",   0x00000, 0x20000, CRC(d0fce87a) SHA1(7b346d3b7cbaf0b5447d66a71e815202d796f140) )
44103866   ROM_LOAD16_BYTE( "b95-11-1.bin", 0x00001, 0x20000, CRC(dad40cd3) SHA1(6c07ed3dd609a8743f5851caa4d205bce8db595e) )
r4499r4500
45243980   ROM_LOAD( "pal16l8b-c28-11.ic35",  0x0a00, 0x0104, CRC(33414fe8) SHA1(7f497189fd48c6201d1048419eb67153c6cf730c) )  // MDEC 2
45253981ROM_END
45263982
4527ROM_START( thndfoxu )      /* Thunder Fox */
3983ROM_START( thundfoxu )      /* Thunder Fox */
45283984   ROM_REGION( 0x80000, "maincpu", 0 )     /* 512k for 68000 code */
45293985   ROM_LOAD16_BYTE( "c28-13-1.51",  0x00000, 0x20000, CRC(acb07013) SHA1(5043d1859ae908c00f0c00c7b8e377362d908423) )
45303986   ROM_LOAD16_BYTE( "c28-15-1.40",  0x00001, 0x20000, CRC(874a84e1) SHA1(f2688030faf526bc64bbb06225d3938f423f0f8b) )
r4499r4500
45544010// Pals: c28-09.25  c28-10.26  c28-11.35  b89-01.19  b89-03.37  b89-04.33
45554011ROM_END
45564012
4557ROM_START( thndfoxj )      /* Thunder Fox */
4013ROM_START( thundfoxj )      /* Thunder Fox */
45584014   ROM_REGION( 0x80000, "maincpu", 0 )     /* 512k for 68000 code */
45594015   ROM_LOAD16_BYTE( "c28-13-1.51",  0x00000, 0x20000, CRC(acb07013) SHA1(5043d1859ae908c00f0c00c7b8e377362d908423) )
45604016   ROM_LOAD16_BYTE( "c28-12-1.40",  0x00001, 0x20000, CRC(f04db477) SHA1(da66895b8cc79f1776f30d9c204c6907cab935db) )
r4499r4500
46084064   /* no Delta-T samples */
46094065ROM_END
46104066
4611ROM_START( camltrya )
4067ROM_START( cameltrya )
46124068   ROM_REGION( 0x40000, "maincpu", 0 )     /* 256k for 68000 code */
46134069   ROM_LOAD16_BYTE( "c38-11", 0x00000, 0x20000, CRC(be172da0) SHA1(e4915bf25832175591a014aa1abac5edae09380d) )
46144070   ROM_LOAD16_BYTE( "c38-16", 0x00001, 0x20000, CRC(66ad6164) SHA1(2df22a6a1d6e194a467e6a6c6b6c2fc9f8441852) )
r4499r4500
46324088   ROM_LOAD( "c38-04.bin", 0x000000, 0x020000, CRC(53d330bb) SHA1(22982d889a69aefe482b24ac958ef755fd2c7601) )
46334089ROM_END
46344090
4635ROM_START( camltrua )
4091ROM_START( cameltryua )
46364092   ROM_REGION( 0x40000, "maincpu", 0 )     /* 256k for 68000 code */
46374093   ROM_LOAD16_BYTE( "c38-11", 0x00000, 0x20000, CRC(be172da0) SHA1(e4915bf25832175591a014aa1abac5edae09380d) )
46384094   ROM_LOAD16_BYTE( "c38-14", 0x00001, 0x20000, CRC(ffa430de) SHA1(a3cdb35151a92ddfa2090c1f8710500925e7ad0c) )
r4499r4500
46564112   ROM_LOAD( "c38-04.bin", 0x000000, 0x020000, CRC(53d330bb) SHA1(22982d889a69aefe482b24ac958ef755fd2c7601) )
46574113ROM_END
46584114
4659ROM_START( cameltrj )
4115ROM_START( cameltryj )
46604116   ROM_REGION( 0x40000, "maincpu", 0 )     /* 256k for 68000 code */
46614117   ROM_LOAD16_BYTE( "c38-09.bin", 0x00000, 0x20000, CRC(2ae01120) SHA1(6da4155fde0edd76976264f929c5da3c79db5017) )
46624118   ROM_LOAD16_BYTE( "c38-10.bin", 0x00001, 0x20000, CRC(48d8ff56) SHA1(73da47b0f9e67defcd0072b71a3661f2c3534f55) )
r4499r4500
49424398// Pals c71-16.28  c71-07.27
49434399ROM_END
49444400
4945ROM_START( gunfronj )
4401ROM_START( gunfrontj )
49464402   ROM_REGION( 0xc0000, "maincpu", 0 )     /* 768k for 68000 code */
49474403   ROM_LOAD16_BYTE( "c71-09.ic42",  0x00000, 0x20000, CRC(10a544a2) SHA1(3b46bbd494b432d36aed3fd4b429cef074050c1d) )
49484404   ROM_LOAD16_BYTE( "c71-08.ic41",  0x00001, 0x20000, CRC(c17dc0a0) SHA1(f84e0d1afb403bb06480e8687558cd320d60099e) )
r4499r4500
50674523   /* no Delta-T samples */
50684524ROM_END
50694525
5070ROM_START( mjnquesb )   /* Mahjong Quest (No Nudity) */
4526ROM_START( mjnquestb )   /* Mahjong Quest (No Nudity) */
50714527   ROM_REGION( 0x100000, "maincpu", 0 )     /* 256k for 68000 code */
50724528   ROM_LOAD16_BYTE( "c77-09a", 0x000000, 0x020000, CRC(fc17f1c2) SHA1(438b0a780560940b2d3dab42b34dc2bc94a15f80) )
50734529   ROM_LOAD16_BYTE( "c77-08",  0x000001, 0x020000, CRC(4244f775) SHA1(801045d7433684195876e172676b2345827de7cc) )
r4499r4500
52014657   ROM_LOAD16_BYTE( "c83-10.3",  0x00000,  0x20000, CRC(4d185d03) SHA1(ab494c777a0acfe088d3db7c1a0488d40884ea0a) )
52024658   ROM_LOAD16_BYTE( "c83-09.2",  0x00001,  0x20000, CRC(f9892792) SHA1(310d02833c821a34baa0ce537019b8cade6402b7) )
52034659
5204   ROM_REGION16_BE( 0x100000, "user1", 0 )
4660   ROM_REGION16_BE( 0x100000, "extra", 0 )
52054661   /* extra ROM mapped at d00000 */
52064662   ROM_LOAD16_WORD_SWAP( "c83-03.10", 0x000000, 0x100000, CRC(eed9acc2) SHA1(baa6a9aa5ed8fbbff7b289693407192b464cb7c7) )   /* data rom */
52074663
r4499r4500
53744830   /* no Delta-T samples */
53754831ROM_END
53764832
5377ROM_START( pulirulj )
4833ROM_START( pulirulaj )
53784834   ROM_REGION( 0xc0000, "maincpu", 0 )     /* 768k for 68000 code */
53794835   ROM_LOAD16_BYTE( "c98-12.rom", 0x00000, 0x40000, CRC(816d6cde) SHA1(cac583440cca9aa57373f4a6c9a68c5442a5258b) )
53804836   ROM_LOAD16_BYTE( "c98-13.rom", 0x00001, 0x40000, CRC(b7d13d5b) SHA1(f2cac6931c5984d68c2d5303b53c54b5781b3aed) )
r4499r4500
55244980   /* no Delta-T samples */
55254981ROM_END
55264982
5527ROM_START( deadconj )
4983ROM_START( deadconxj )
55284984   ROM_REGION( 0x100000, "maincpu", 0 )     /* 1024k for 68000 code */
55294985   ROM_LOAD16_BYTE( "d28-06.3",  0x00000, 0x40000, CRC(5b4bff51) SHA1(a589cbc8425add9ed5f2add26f17bb18fe53ca8a) )
55304986   ROM_LOAD16_BYTE( "d28-07.5",  0x00001, 0x40000, CRC(3fb8954c) SHA1(3104c1537f5fda7e5619aacfb48b02e969399a89) )
r4499r4500
56555111   ROM_LOAD16_BYTE( "d55-13",  0x00000, 0x40000, CRC(16afbfc7) SHA1(daf948603c78312aa8fb8e239097939ec89ecc64) )
56565112   ROM_LOAD16_BYTE( "d55-14",  0x00001, 0x40000, CRC(2fb3057f) SHA1(3b107dc69c01ca1b90c78a122336896b89509a3e) )
56575113
5658   ROM_REGION16_BE( 0x100000, "user1", 0 )
5114   ROM_REGION16_BE( 0x100000, "extra", 0 )
56595115   /* extra ROM mapped 0x300000 */
56605116   ROM_LOAD16_WORD_SWAP( "d55-03", 0x000000, 0x100000, CRC(4d161e76) SHA1(96189294f91f165423ba585c650ee47fc8165725) )   /* data rom */
56615117
r4499r4500
56815137   ROM_LOAD16_BYTE( "d63-12",  0x00000, 0x40000, CRC(0f445a38) SHA1(cb9212c6c61d7dec7cfa039ebbbabd368dad52c3) )
56825138   ROM_LOAD16_BYTE( "d63-13",  0x00001, 0x40000, CRC(74455752) SHA1(9835eb5ebad8df96abe8f7d5f8e4ff663b38015a) )
56835139
5684   ROM_REGION16_BE( 0x080000, "user1", 0 )
5140   ROM_REGION16_BE( 0x080000, "extra", 0 )
56855141   /* extra ROM mapped at 600000 */
56865142   ROM_LOAD16_WORD_SWAP( "d63-01", 0x00000, 0x80000, CRC(872e38b4) SHA1(dbb3728655dee03f6583db976708507c9ac5be16) )   /* data rom */
56875143
r4499r4500
58125268}
58135269
58145270
5815GAME( 1988, finalb,   0,        finalb,   finalb,   finalb,   ROT0,   "Taito Corporation Japan", "Final Blow (World)", 0 )
5816GAME( 1988, finalbj,  finalb,   finalb,   finalbj,  finalb,   ROT0,   "Taito Corporation", "Final Blow (Japan)", 0 )
5817GAME( 1988, finalbu,  finalb,   finalb,   finalbj,  finalb,   ROT0,   "Taito America Corporation", "Final Blow (US)", 0 )
5818GAME( 1989, dondokod, 0,        dondokod, dondokod, 0,        ROT0,   "Taito Corporation Japan", "Don Doko Don (World)", 0 )
5819GAME( 1989, dondokdu, dondokod, dondokod, dondokdu, 0,        ROT0,   "Taito America Corporation", "Don Doko Don (US)", 0 )
5820GAME( 1989, dondokdj, dondokod, dondokod, dondokdj, 0,        ROT0,   "Taito Corporation", "Don Doko Don (Japan)", 0 )
5821GAME( 1989, megab,    0,        megab,    megab,    0,        ROT0,   "Taito Corporation Japan", "Mega Blast (World)", 0 )
5822GAME( 1989, megabj,   megab,    megab,    megabj,   0,        ROT0,   "Taito Corporation", "Mega Blast (Japan)", 0 )
5823GAME( 1990, thundfox, 0,        thundfox, thundfox, 0,        ROT0,   "Taito Corporation Japan", "Thunder Fox (World)", 0 )
5824GAME( 1990, thndfoxu, thundfox, thundfox, thndfoxu, 0,        ROT0,   "Taito America Corporation", "Thunder Fox (US)", 0 )
5825GAME( 1990, thndfoxj, thundfox, thundfox, thndfoxj, 0,        ROT0,   "Taito Corporation", "Thunder Fox (Japan)", 0 )
5826GAME( 1989, cameltry, 0,        cameltry, cameltry, 0,        ROT0,   "Taito America Corporation", "Cameltry (US, YM2610)", 0 )
5827GAME( 1989, camltrya, cameltry, camltrya, cameltry, 0,        ROT0,   "Taito America Corporation", "Cameltry (World, YM2203 + M6295)", 0 )
5828GAME( 1989, camltrua, cameltry, camltrya, cameltry, 0,        ROT0,   "Taito America Corporation", "Cameltry (US, YM2203 + M6295)", 0 )
5829GAME( 1989, cameltrj, cameltry, cameltry, cameltrj, 0,        ROT0,   "Taito Corporation", "Cameltry (Japan, YM2610)", 0 )
5830GAME( 1990, qtorimon, 0,        qtorimon, qtorimon, 0,        ROT0,   "Taito Corporation", "Quiz Torimonochou (Japan)", 0 )
5831GAME( 1990, liquidk,  0,        liquidk,  liquidk,  0,        ROT0,   "Taito Corporation Japan", "Liquid Kids (World)", 0 )
5832GAME( 1990, liquidku, liquidk,  liquidk,  liquidku, 0,        ROT0,   "Taito America Corporation", "Liquid Kids (US)", 0 )
5833GAME( 1990, mizubaku, liquidk,  liquidk,  mizubaku, 0,        ROT0,   "Taito Corporation", "Mizubaku Daibouken (Japan)", 0 )
5834GAME( 1990, quizhq,   0,        quizhq,   quizhq,   0,        ROT0,   "Taito Corporation", "Quiz H.Q. (Japan)", 0 )
5835GAME( 1990, ssi,      0,        ssi,      ssi,      0,        ROT270, "Taito Corporation Japan", "Super Space Invaders '91 (World)", 0 )
5836GAME( 1990, majest12, ssi,      ssi,      majest12, 0,        ROT270, "Taito Corporation", "Majestic Twelve - The Space Invaders Part IV (Japan)", 0 )
5837GAME( 1990, gunfront, 0,        gunfront, gunfront, 0,        ROT270, "Taito Corporation Japan", "Gun & Frontier (World)", 0 )
5838GAME( 1990, gunfronj, gunfront, gunfront, gunfronj, 0,        ROT270, "Taito Corporation", "Gun Frontier (Japan)", 0 )
5839GAME( 1990, growl,    0,        growl,    growl,    0,        ROT0,   "Taito Corporation Japan", "Growl (World)", 0 )
5840GAME( 1990, growlu,   growl,    growl,    growlu,   0,        ROT0,   "Taito America Corporation", "Growl (US)", 0 )
5841GAME( 1990, runark,   growl,    growl,    runark,   0,        ROT0,   "Taito Corporation", "Runark (Japan)", 0 )
5842GAME( 1990, mjnquest, 0,        mjnquest, mjnquest, mjnquest, ROT0,   "Taito Corporation", "Mahjong Quest (Japan)", 0 )
5843GAME( 1990, mjnquesb, mjnquest, mjnquest, mjnquest, mjnquest, ROT0,   "Taito Corporation", "Mahjong Quest (No Nudity)", 0 )
5844GAME( 1990, footchmp, 0,        footchmp, footchmp, 0,        ROT0,   "Taito Corporation Japan", "Football Champ (World)", 0 )
5845GAME( 1990, hthero,   footchmp, hthero,   hthero,   0,        ROT0,   "Taito Corporation", "Hat Trick Hero (Japan)", 0 )
5846GAME( 1992, euroch92, footchmp, footchmp, footchmp, 0,        ROT0,   "Taito Corporation Japan", "Euro Champ '92 (World)", 0 )
5847GAME( 1990, koshien,  0,        koshien,  koshien,  0,        ROT0,   "Taito Corporation", "Ah Eikou no Koshien (Japan)", 0 )
5848GAME( 1990, yuyugogo, 0,        yuyugogo, yuyugogo, 0,        ROT0,   "Taito Corporation", "Yuuyu no Quiz de GO!GO! (Japan)", 0 )
5849GAME( 1990, ninjak,   0,        ninjak,   ninjak,   0,        ROT0,   "Taito Corporation Japan", "The Ninja Kids (World)", 0 )
5850GAME( 1990, ninjakj,  ninjak,   ninjak,   ninjakj,  0,        ROT0,   "Taito Corporation", "The Ninja Kids (Japan)", 0 )
5851GAME( 1990, ninjaku,  ninjak,   ninjak,   ninjaku,  0,        ROT0,   "Taito America Corporation", "The Ninja Kids (US)", 0 )
5852GAME( 1991, solfigtr, 0,        solfigtr, solfigtr, 0,        ROT0,   "Taito Corporation Japan", "Solitary Fighter (World)", 0 )
5853GAME( 1991, qzquest,  0,        qzquest , qzquest,  0,        ROT0,   "Taito Corporation", "Quiz Quest - Hime to Yuusha no Monogatari (Japan)", 0 )
5854GAME( 1991, pulirula, 0,        pulirula, pulirula, 0,        ROT0,   "Taito Corporation Japan", "PuLiRuLa (World)", 0 )
5855GAME( 1991, pulirulj, pulirula, pulirula, pulirulj, 0,        ROT0,   "Taito Corporation", "PuLiRuLa (Japan)", 0 )
5856GAME( 1991, metalb,   0,        metalb,   metalb,   0,        ROT0,   "Taito Corporation Japan", "Metal Black (World)", 0 )
5857GAME( 1991, metalbj,  metalb,   metalb,   metalbj,  0,        ROT0,   "Taito Corporation", "Metal Black (Japan)", 0 )
5858GAME( 1991, qzchikyu, 0,        qzchikyu, qzchikyu, 0,        ROT0,   "Taito Corporation", "Quiz Chikyu Bouei Gun (Japan)", 0 )
5859GAME( 1992, yesnoj,   0,        yesnoj,   yesnoj,   0,        ROT0,   "Taito Corporation", "Yes/No Sinri Tokimeki Chart", 0 )
5860GAME( 1992, deadconx, 0,        deadconx, deadconx, 0,        ROT0,   "Taito Corporation Japan", "Dead Connection (World)", 0 )
5861GAME( 1992, deadconj, deadconx, deadconj, deadconj, 0,        ROT0,   "Taito Corporation", "Dead Connection (Japan)", 0 )
5862GAME( 1992, dinorex,  0,        dinorex,  dinorex,  0,        ROT0,   "Taito Corporation Japan", "Dino Rex (World)", 0 )
5863GAME( 1992, dinorexj, dinorex,  dinorex,  dinorexj, 0,        ROT0,   "Taito Corporation", "Dino Rex (Japan)", 0 )
5864GAME( 1992, dinorexu, dinorex,  dinorex,  dinorex,  0,        ROT0,   "Taito America Corporation", "Dino Rex (US)", 0 )
5865GAME( 1992, qjinsei,  0,        qjinsei,  qjinsei,  0,        ROT0,   "Taito Corporation", "Quiz Jinsei Gekijoh (Japan)", 0 )
5866GAME( 1993, qcrayon,  0,        qcrayon,  qcrayon,  0,        ROT0,   "Taito Corporation", "Quiz Crayon Shinchan (Japan)", 0 )
5867GAME( 1993, qcrayon2, 0,        qcrayon2, qcrayon2, 0,        ROT0,   "Taito Corporation", "Crayon Shinchan Orato Asobo (Japan)", 0 )
5868GAME( 1991, driftout, 0,        driftout, driftout, 0,        ROT270, "Visco", "Drift Out (Japan)", 0 )
5869GAME( 1991, driveout, driftout, driveout, driftout, driveout, ROT270, "bootleg", "Drive Out", 0 )
5271GAME( 1988, finalb,    0,        finalb,   finalb,   finalb,   ROT0,   "Taito Corporation Japan", "Final Blow (World)", 0 )
5272GAME( 1988, finalbj,   finalb,   finalb,   finalbj,  finalb,   ROT0,   "Taito Corporation", "Final Blow (Japan)", 0 )
5273GAME( 1988, finalbu,   finalb,   finalb,   finalbj,  finalb,   ROT0,   "Taito America Corporation", "Final Blow (US)", 0 )
5274GAME( 1989, dondokod,  0,        dondokod, dondokod, 0,        ROT0,   "Taito Corporation Japan", "Don Doko Don (World)", 0 )
5275GAME( 1989, dondokodu, dondokod, dondokod, dondokodu,0,        ROT0,   "Taito America Corporation", "Don Doko Don (US)", 0 )
5276GAME( 1989, dondokodj, dondokod, dondokod, dondokodj,0,        ROT0,   "Taito Corporation", "Don Doko Don (Japan)", 0 )
5277GAME( 1989, megab,     0,        megab,    megab,    0,        ROT0,   "Taito Corporation Japan", "Mega Blast (World)", 0 )
5278GAME( 1989, megabj,    megab,    megab,    megabj,   0,        ROT0,   "Taito Corporation", "Mega Blast (Japan)", 0 )
5279GAME( 1990, thundfox,  0,        thundfox, thundfox, 0,        ROT0,   "Taito Corporation Japan", "Thunder Fox (World)", 0 )
5280GAME( 1990, thundfoxu, thundfox, thundfox, thundfoxu,0,        ROT0,   "Taito America Corporation", "Thunder Fox (US)", 0 )
5281GAME( 1990, thundfoxj, thundfox, thundfox, thundfoxj,0,        ROT0,   "Taito Corporation", "Thunder Fox (Japan)", 0 )
5282GAME( 1989, cameltry,  0,        cameltry, cameltry, 0,        ROT0,   "Taito America Corporation", "Cameltry (US, YM2610)", 0 )
5283GAME( 1989, cameltrya, cameltry, cameltrya,cameltry, 0,        ROT0,   "Taito America Corporation", "Cameltry (World, YM2203 + M6295)", 0 )
5284GAME( 1989, cameltryua,cameltry, cameltrya,cameltry, 0,        ROT0,   "Taito America Corporation", "Cameltry (US, YM2203 + M6295)", 0 )
5285GAME( 1989, cameltryj, cameltry, cameltry, cameltryj,0,        ROT0,   "Taito Corporation", "Cameltry (Japan, YM2610)", 0 )
5286GAME( 1990, qtorimon,  0,        qtorimon, qtorimon, 0,        ROT0,   "Taito Corporation", "Quiz Torimonochou (Japan)", 0 )
5287GAME( 1990, liquidk,   0,        liquidk,  liquidk,  0,        ROT0,   "Taito Corporation Japan", "Liquid Kids (World)", 0 )
5288GAME( 1990, liquidku,  liquidk,  liquidk,  liquidku, 0,        ROT0,   "Taito America Corporation", "Liquid Kids (US)", 0 )
5289GAME( 1990, mizubaku,  liquidk,  liquidk,  mizubaku, 0,        ROT0,   "Taito Corporation", "Mizubaku Daibouken (Japan)", 0 )
5290GAME( 1990, quizhq,    0,        quizhq,   quizhq,   0,        ROT0,   "Taito Corporation", "Quiz H.Q. (Japan)", 0 )
5291GAME( 1990, ssi,       0,        ssi,      ssi,      0,        ROT270, "Taito Corporation Japan", "Super Space Invaders '91 (World)", 0 )
5292GAME( 1990, majest12,  ssi,      ssi,      majest12, 0,        ROT270, "Taito Corporation", "Majestic Twelve - The Space Invaders Part IV (Japan)", 0 )
5293GAME( 1990, gunfront,  0,        gunfront, gunfront, 0,        ROT270, "Taito Corporation Japan", "Gun & Frontier (World)", 0 )
5294GAME( 1990, gunfrontj, gunfront, gunfront, gunfrontj,0,        ROT270, "Taito Corporation", "Gun Frontier (Japan)", 0 )
5295GAME( 1990, growl,     0,        growl,    growl,    0,        ROT0,   "Taito Corporation Japan", "Growl (World)", 0 )
5296GAME( 1990, growlu,    growl,    growl,    growlu,   0,        ROT0,   "Taito America Corporation", "Growl (US)", 0 )
5297GAME( 1990, runark,    growl,    growl,    runark,   0,        ROT0,   "Taito Corporation", "Runark (Japan)", 0 )
5298GAME( 1990, mjnquest,  0,        mjnquest, mjnquest, mjnquest, ROT0,   "Taito Corporation", "Mahjong Quest (Japan)", 0 )
5299GAME( 1990, mjnquestb, mjnquest, mjnquest, mjnquest, mjnquest, ROT0,   "Taito Corporation", "Mahjong Quest (No Nudity)", 0 )
5300GAME( 1990, footchmp,  0,        footchmp, footchmp, 0,        ROT0,   "Taito Corporation Japan", "Football Champ (World)", 0 )
5301GAME( 1990, hthero,    footchmp, hthero,   hthero,   0,        ROT0,   "Taito Corporation", "Hat Trick Hero (Japan)", 0 )
5302GAME( 1992, euroch92,  footchmp, footchmp, footchmp, 0,        ROT0,   "Taito Corporation Japan", "Euro Champ '92 (World)", 0 )
5303GAME( 1990, koshien,   0,        koshien,  koshien,  0,        ROT0,   "Taito Corporation", "Ah Eikou no Koshien (Japan)", 0 )
5304GAME( 1990, yuyugogo,  0,        yuyugogo, yuyugogo, 0,        ROT0,   "Taito Corporation", "Yuuyu no Quiz de GO!GO! (Japan)", 0 )
5305GAME( 1990, ninjak,    0,        ninjak,   ninjak,   0,        ROT0,   "Taito Corporation Japan", "The Ninja Kids (World)", 0 )
5306GAME( 1990, ninjakj,   ninjak,   ninjak,   ninjakj,  0,        ROT0,   "Taito Corporation", "The Ninja Kids (Japan)", 0 )
5307GAME( 1990, ninjaku,   ninjak,   ninjak,   ninjaku,  0,        ROT0,   "Taito America Corporation", "The Ninja Kids (US)", 0 )
5308GAME( 1991, solfigtr,  0,        solfigtr, solfigtr, 0,        ROT0,   "Taito Corporation Japan", "Solitary Fighter (World)", 0 )
5309GAME( 1991, qzquest,   0,        qzquest , qzquest,  0,        ROT0,   "Taito Corporation", "Quiz Quest - Hime to Yuusha no Monogatari (Japan)", 0 )
5310GAME( 1991, pulirula,  0,        pulirula, pulirula, 0,        ROT0,   "Taito Corporation Japan", "PuLiRuLa (World)", 0 )
5311GAME( 1991, pulirulaj, pulirula, pulirula, pulirulaj,0,        ROT0,   "Taito Corporation", "PuLiRuLa (Japan)", 0 )
5312GAME( 1991, metalb,    0,        metalb,   metalb,   0,        ROT0,   "Taito Corporation Japan", "Metal Black (World)", 0 )
5313GAME( 1991, metalbj,   metalb,   metalb,   metalbj,  0,        ROT0,   "Taito Corporation", "Metal Black (Japan)", 0 )
5314GAME( 1991, qzchikyu,  0,        qzchikyu, qzchikyu, 0,        ROT0,   "Taito Corporation", "Quiz Chikyu Bouei Gun (Japan)", 0 )
5315GAME( 1992, yesnoj,    0,        yesnoj,   yesnoj,   0,        ROT0,   "Taito Corporation", "Yes/No Sinri Tokimeki Chart", 0 )
5316GAME( 1992, deadconx,  0,        deadconx, deadconx, 0,        ROT0,   "Taito Corporation Japan", "Dead Connection (World)", 0 )
5317GAME( 1992, deadconxj, deadconx, deadconxj,deadconxj,0,        ROT0,   "Taito Corporation", "Dead Connection (Japan)", 0 )
5318GAME( 1992, dinorex,   0,        dinorex,  dinorex,  0,        ROT0,   "Taito Corporation Japan", "Dino Rex (World)", 0 )
5319GAME( 1992, dinorexj,  dinorex,  dinorex,  dinorexj, 0,        ROT0,   "Taito Corporation", "Dino Rex (Japan)", 0 )
5320GAME( 1992, dinorexu,  dinorex,  dinorex,  dinorex,  0,        ROT0,   "Taito America Corporation", "Dino Rex (US)", 0 )
5321GAME( 1992, qjinsei,   0,        qjinsei,  qjinsei,  0,        ROT0,   "Taito Corporation", "Quiz Jinsei Gekijoh (Japan)", 0 )
5322GAME( 1993, qcrayon,   0,        qcrayon,  qcrayon,  0,        ROT0,   "Taito Corporation", "Quiz Crayon Shinchan (Japan)", 0 )
5323GAME( 1993, qcrayon2,  0,        qcrayon2, qcrayon2, 0,        ROT0,   "Taito Corporation", "Crayon Shinchan Orato Asobo (Japan)", 0 )
5324GAME( 1991, driftout,  0,        driftout, driftout, 0,        ROT270, "Visco", "Drift Out (Japan)", 0 )
5325GAME( 1991, driveout,  driftout, driveout, driftout, driveout, ROT270, "bootleg", "Drive Out", 0 )
src/mame/drivers/taito_l.c
r4499r4500
2323Notes:
2424- the system uses RAM based characters, which aren't really supported by the
2525  TileMap system, so we have to tilemap_mark_all_tiles_dirty() to compensate
26- kurikina has some debug dip switches (invulnerability, slow motion) so might
26- kurikinta has some debug dip switches (invulnerability, slow motion) so might
2727  be a prototype. It also doesn't have service mode (or has it disabled).
2828
2929TODO:
r4499r4500
637637
638638
639639
640#define COMMON_BANKS_READ \
641   AM_RANGE(0x0000, 0x5fff) AM_READ(SMH_ROM)         \
642   AM_RANGE(0x6000, 0x7fff) AM_READ(SMH_BANK1)         \
643   AM_RANGE(0xc000, 0xcfff) AM_READ(SMH_BANK2)         \
644   AM_RANGE(0xd000, 0xdfff) AM_READ(SMH_BANK3)         \
645   AM_RANGE(0xe000, 0xefff) AM_READ(SMH_BANK4)         \
646   AM_RANGE(0xf000, 0xfdff) AM_READ(SMH_BANK5)         \
647   AM_RANGE(0xfe00, 0xfe03) AM_READ(taitol_bankc_r)      \
648   AM_RANGE(0xfe04, 0xfe04) AM_READ(taitol_control_r)   \
649   AM_RANGE(0xff00, 0xff02) AM_READ(irq_adr_r)         \
650   AM_RANGE(0xff03, 0xff03) AM_READ(irq_enable_r)      \
651   AM_RANGE(0xff04, 0xff07) AM_READ(rambankswitch_r)   \
652   AM_RANGE(0xff08, 0xff08) AM_READ(rombankswitch_r)
640#define COMMON_BANKS_MAP \
641   AM_RANGE(0x0000, 0x5fff) AM_ROM         \
642   AM_RANGE(0x6000, 0x7fff) AM_ROMBANK(1)          \
643   AM_RANGE(0xc000, 0xcfff) AM_ROMBANK(2) AM_WRITE(bank0_w) \
644   AM_RANGE(0xd000, 0xdfff) AM_ROMBANK(3) AM_WRITE(bank1_w) \
645   AM_RANGE(0xe000, 0xefff) AM_ROMBANK(4) AM_WRITE(bank2_w) \
646   AM_RANGE(0xf000, 0xfdff) AM_ROMBANK(5) AM_WRITE(bank3_w) \
647   AM_RANGE(0xfe00, 0xfe03) AM_READWRITE(taitol_bankc_r, taitol_bankc_w)      \
648   AM_RANGE(0xfe04, 0xfe04) AM_READWRITE(taitol_control_r, taitol_control_w)   \
649   AM_RANGE(0xff00, 0xff02) AM_READWRITE(irq_adr_r, irq_adr_w)         \
650   AM_RANGE(0xff03, 0xff03) AM_READWRITE(irq_enable_r, irq_enable_w)      \
651   AM_RANGE(0xff04, 0xff07) AM_READWRITE(rambankswitch_r, rambankswitch_w)   \
652   AM_RANGE(0xff08, 0xff08) AM_READWRITE(rombankswitch_r, rombankswitch_w)
653653
654#define COMMON_BANKS_WRITE \
655   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)         \
656   AM_RANGE(0xc000, 0xcfff) AM_WRITE(bank0_w)         \
657   AM_RANGE(0xd000, 0xdfff) AM_WRITE(bank1_w)         \
658   AM_RANGE(0xe000, 0xefff) AM_WRITE(bank2_w)         \
659   AM_RANGE(0xf000, 0xfdff) AM_WRITE(bank3_w)         \
660   AM_RANGE(0xfe00, 0xfe03) AM_WRITE(taitol_bankc_w)      \
661   AM_RANGE(0xfe04, 0xfe04) AM_WRITE(taitol_control_w)   \
662   AM_RANGE(0xff00, 0xff02) AM_WRITE(irq_adr_w)         \
663   AM_RANGE(0xff03, 0xff03) AM_WRITE(irq_enable_w)      \
664   AM_RANGE(0xff04, 0xff07) AM_WRITE(rambankswitch_w)   \
665   AM_RANGE(0xff08, 0xff08) AM_WRITE(rombankswitch_w)
654#define COMMON_SINGLE_MAP \
655   AM_RANGE(0xa000, 0xa003) AM_DEVREADWRITE("ym", extport_select_and_ym2203_r, ym2203_w)   \
656   AM_RANGE(0x8000, 0x9fff) AM_RAM
666657
667#define COMMON_SINGLE_READ \
668   AM_RANGE(0xa000, 0xa003) AM_DEVREAD("ym", extport_select_and_ym2203_r)   \
669   AM_RANGE(0x8000, 0x9fff) AM_READ(SMH_RAM)
670658
671#define COMMON_SINGLE_WRITE \
672   AM_RANGE(0xa000, 0xa001) AM_DEVWRITE("ym", ym2203_w)      \
673   AM_RANGE(0x8000, 0x9fff) AM_WRITE(SMH_RAM)
674659
675
676
677static ADDRESS_MAP_START( fhawk_readmem, ADDRESS_SPACE_PROGRAM, 8 )
678   COMMON_BANKS_READ
679   AM_RANGE(0x8000, 0x9fff) AM_READ(SMH_RAM)
680   AM_RANGE(0xa000, 0xbfff) AM_READ(SMH_RAM)
660static ADDRESS_MAP_START( fhawk_map, ADDRESS_SPACE_PROGRAM, 8 )
661   COMMON_BANKS_MAP
662   AM_RANGE(0x8000, 0x9fff) AM_RAM AM_BASE(&shared_ram)
663   AM_RANGE(0xa000, 0xbfff) AM_RAM
681664ADDRESS_MAP_END
682665
683static ADDRESS_MAP_START( fhawk_writemem, ADDRESS_SPACE_PROGRAM, 8 )
684   COMMON_BANKS_WRITE
685   AM_RANGE(0x8000, 0x9fff) AM_WRITE(SMH_RAM) AM_BASE(&shared_ram)
686   AM_RANGE(0xa000, 0xbfff) AM_WRITE(SMH_RAM)
687ADDRESS_MAP_END
688
689static ADDRESS_MAP_START( fhawk_2_readmem, ADDRESS_SPACE_PROGRAM, 8 )
690   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
691   AM_RANGE(0x8000, 0xbfff) AM_READ(SMH_BANK6)
692   AM_RANGE(0xc800, 0xc800) AM_READNOP
693   AM_RANGE(0xc801, 0xc801) AM_READ(taitosound_comm_r)
694   AM_RANGE(0xe000, 0xffff) AM_READ(shared_r)
695   AM_RANGE(0xd000, 0xd000) AM_READ_PORT("DSWA")
666static ADDRESS_MAP_START( fhawk_2_map, ADDRESS_SPACE_PROGRAM, 8 )
667   AM_RANGE(0x0000, 0x7fff) AM_ROM
668   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(6)
669   AM_RANGE(0xc000, 0xc000) AM_WRITE(rombank2switch_w)
670   AM_RANGE(0xc800, 0xc800) AM_READNOP AM_WRITE(taitosound_port_w)
671   AM_RANGE(0xc801, 0xc801) AM_READWRITE(taitosound_comm_r, taitosound_comm_w)
672   AM_RANGE(0xd000, 0xd000) AM_READ_PORT("DSWA") AM_WRITENOP   // Direct copy of input port 0
696673   AM_RANGE(0xd001, 0xd001) AM_READ_PORT("DSWB")
697674   AM_RANGE(0xd002, 0xd002) AM_READ_PORT("IN0")
698675   AM_RANGE(0xd003, 0xd003) AM_READ_PORT("IN1")
699   AM_RANGE(0xd007, 0xd007) AM_READ_PORT("IN2")
700ADDRESS_MAP_END
701
702static ADDRESS_MAP_START( fhawk_2_writemem, ADDRESS_SPACE_PROGRAM, 8 )
703   AM_RANGE(0x0000, 0xbfff) AM_WRITE(SMH_ROM)
704   AM_RANGE(0xc000, 0xc000) AM_WRITE(rombank2switch_w)
705   AM_RANGE(0xc800, 0xc800) AM_WRITE(taitosound_port_w)
706   AM_RANGE(0xc801, 0xc801) AM_WRITE(taitosound_comm_w)
707   AM_RANGE(0xd000, 0xd000) AM_WRITENOP   // Direct copy of input port 0
708676   AM_RANGE(0xd004, 0xd004) AM_WRITE(control2_w)
709677   AM_RANGE(0xd005, 0xd006) AM_WRITENOP   // Always 0
710   AM_RANGE(0xe000, 0xffff) AM_WRITE(shared_w)
678   AM_RANGE(0xd007, 0xd007) AM_READ_PORT("IN2")
679   AM_RANGE(0xe000, 0xffff) AM_READWRITE(shared_r, shared_w)
711680ADDRESS_MAP_END
712681
713static ADDRESS_MAP_START( fhawk_3_readmem, ADDRESS_SPACE_PROGRAM, 8 )
714   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
715   AM_RANGE(0x4000, 0x7fff) AM_READ(SMH_BANK7)
716   AM_RANGE(0x8000, 0x9fff) AM_READ(SMH_RAM)
717   AM_RANGE(0xe000, 0xe000) AM_READNOP
718   AM_RANGE(0xe001, 0xe001) AM_READ(taitosound_slave_comm_r)
719   AM_RANGE(0xf000, 0xf001) AM_DEVREAD("ym", ym2203_r)
682static ADDRESS_MAP_START( fhawk_3_map, ADDRESS_SPACE_PROGRAM, 8 )
683   AM_RANGE(0x0000, 0x3fff) AM_ROM
684   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(7)
685   AM_RANGE(0x8000, 0x9fff) AM_RAM
686   AM_RANGE(0xe000, 0xe000) AM_READNOP AM_WRITE(taitosound_slave_port_w)
687   AM_RANGE(0xe001, 0xe001) AM_READWRITE(taitosound_slave_comm_r, taitosound_slave_comm_w)
688   AM_RANGE(0xf000, 0xf001) AM_DEVREADWRITE("ym", ym2203_r, ym2203_w)
720689ADDRESS_MAP_END
721690
722static ADDRESS_MAP_START( fhawk_3_writemem, ADDRESS_SPACE_PROGRAM, 8 )
723   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
724   AM_RANGE(0x8000, 0x9fff) AM_WRITE(SMH_RAM)
725   AM_RANGE(0xe000, 0xe000) AM_WRITE(taitosound_slave_port_w)
726   AM_RANGE(0xe001, 0xe001) AM_WRITE(taitosound_slave_comm_w)
727   AM_RANGE(0xf000, 0xf001) AM_DEVWRITE("ym", ym2203_w)
728ADDRESS_MAP_END
729691
730static ADDRESS_MAP_START( raimais_readmem, ADDRESS_SPACE_PROGRAM, 8 )
731   COMMON_BANKS_READ
732   AM_RANGE(0x8000, 0x87ff) AM_READ(SMH_RAM)
733   AM_RANGE(0x8800, 0x8800) AM_READ(mux_r)
734   AM_RANGE(0x8801, 0x8801) AM_READNOP   // Watchdog or interrupt ack (value ignored)
735   AM_RANGE(0x8c00, 0x8c00) AM_READNOP
736   AM_RANGE(0x8c01, 0x8c01) AM_READ(taitosound_comm_r)
737   AM_RANGE(0xa000, 0xbfff) AM_READ(SMH_RAM)
692static ADDRESS_MAP_START( raimais_map, ADDRESS_SPACE_PROGRAM, 8 )
693   COMMON_BANKS_MAP
694   AM_RANGE(0x8000, 0x87ff) AM_RAM AM_BASE(&shared_ram)
695   AM_RANGE(0x8800, 0x8800) AM_READWRITE(mux_r, mux_w)
696   AM_RANGE(0x8801, 0x8801) AM_WRITE(mux_ctrl_w) AM_READNOP   // Watchdog or interrupt ack (value ignored)
697   AM_RANGE(0x8c00, 0x8c00) AM_READNOP AM_WRITE(taitosound_port_w)
698   AM_RANGE(0x8c01, 0x8c01) AM_READWRITE(taitosound_comm_r, taitosound_comm_w)
699   AM_RANGE(0xa000, 0xbfff) AM_RAM
738700ADDRESS_MAP_END
739static ADDRESS_MAP_START( raimais_writemem, ADDRESS_SPACE_PROGRAM, 8 )
740   COMMON_BANKS_WRITE
741   AM_RANGE(0x8000, 0x87ff) AM_WRITE(SMH_RAM) AM_BASE(&shared_ram)
742   AM_RANGE(0x8800, 0x8800) AM_WRITE(mux_w)
743   AM_RANGE(0x8801, 0x8801) AM_WRITE(mux_ctrl_w)
744   AM_RANGE(0x8c00, 0x8c00) AM_WRITE(taitosound_port_w)
745   AM_RANGE(0x8c01, 0x8c01) AM_WRITE(taitosound_comm_w)
746   AM_RANGE(0xa000, 0xbfff) AM_WRITE(SMH_RAM)
747ADDRESS_MAP_END
748701
749static ADDRESS_MAP_START( raimais_2_readmem, ADDRESS_SPACE_PROGRAM, 8 )
750   AM_RANGE(0x0000, 0xbfff) AM_READ(SMH_ROM)
751   AM_RANGE(0xc000, 0xdfff) AM_READ(SMH_RAM)
752   AM_RANGE(0xe000, 0xe7ff) AM_READ(shared_r)
702static ADDRESS_MAP_START( raimais_2_map, ADDRESS_SPACE_PROGRAM, 8 )
703   AM_RANGE(0x0000, 0xbfff) AM_ROM
704   AM_RANGE(0xc000, 0xdfff) AM_RAM
705   AM_RANGE(0xe000, 0xe7ff) AM_READWRITE(shared_r, shared_w)
753706ADDRESS_MAP_END
754707
755static ADDRESS_MAP_START( raimais_2_writemem, ADDRESS_SPACE_PROGRAM, 8 )
756   AM_RANGE(0x0000, 0xbfff) AM_WRITE(SMH_ROM)
757   AM_RANGE(0xc000, 0xdfff) AM_WRITE(SMH_RAM)
758   AM_RANGE(0xe000, 0xe7ff) AM_WRITE(shared_w)
759ADDRESS_MAP_END
760708
761
762static ADDRESS_MAP_START( raimais_3_readmem, ADDRESS_SPACE_PROGRAM, 8 )
763   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
764   AM_RANGE(0x4000, 0x7fff) AM_READ(SMH_BANK7)
765   AM_RANGE(0xc000, 0xdfff) AM_READ(SMH_RAM)
766   AM_RANGE(0xe000, 0xe003) AM_DEVREAD("ym", ym2610_r)
767   AM_RANGE(0xe200, 0xe200) AM_READNOP
768   AM_RANGE(0xe201, 0xe201) AM_READ(taitosound_slave_comm_r)
769ADDRESS_MAP_END
770
771709static WRITE8_HANDLER( sound_bankswitch_w )
772710{
773711   UINT8 *RAM = memory_region(space->machine, "audiocpu");
r4499r4500
776714   memory_set_bankptr (space->machine, 7, &RAM [0x10000 + (banknum * 0x4000)]);
777715}
778716
779static ADDRESS_MAP_START( raimais_3_writemem, ADDRESS_SPACE_PROGRAM, 8 )
780   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
781   AM_RANGE(0xc000, 0xdfff) AM_WRITE(SMH_RAM)
782   AM_RANGE(0xe000, 0xe003) AM_DEVWRITE("ym", ym2610_w)
783   AM_RANGE(0xe200, 0xe200) AM_WRITE(taitosound_slave_port_w)
784   AM_RANGE(0xe201, 0xe201) AM_WRITE(taitosound_slave_comm_w)
717static ADDRESS_MAP_START( raimais_3_map, ADDRESS_SPACE_PROGRAM, 8 )
718   AM_RANGE(0x0000, 0x3fff) AM_ROM
719   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(7)
720   AM_RANGE(0xc000, 0xdfff) AM_RAM
721   AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ym", ym2610_r, ym2610_w)
722   AM_RANGE(0xe200, 0xe200) AM_READNOP AM_WRITE(taitosound_slave_port_w)
723   AM_RANGE(0xe201, 0xe201) AM_READWRITE(taitosound_slave_comm_r, taitosound_slave_comm_w)
785724   AM_RANGE(0xe400, 0xe403) AM_WRITENOP /* pan */
786725   AM_RANGE(0xe600, 0xe600) AM_WRITENOP /* ? */
787726   AM_RANGE(0xee00, 0xee00) AM_WRITENOP /* ? */
r4499r4500
790729ADDRESS_MAP_END
791730
792731
793static ADDRESS_MAP_START( champwr_readmem, ADDRESS_SPACE_PROGRAM, 8 )
794   COMMON_BANKS_READ
795   AM_RANGE(0x8000, 0x9fff) AM_READ(SMH_RAM)
796   AM_RANGE(0xa000, 0xbfff) AM_READ(SMH_RAM)
732static ADDRESS_MAP_START( champwr_map, ADDRESS_SPACE_PROGRAM, 8 )
733   COMMON_BANKS_MAP
734   AM_RANGE(0x8000, 0x9fff) AM_RAM
735   AM_RANGE(0xa000, 0xbfff) AM_RAM AM_BASE(&shared_ram)
797736ADDRESS_MAP_END
798737
799
800static ADDRESS_MAP_START( champwr_writemem, ADDRESS_SPACE_PROGRAM, 8 )
801   COMMON_BANKS_WRITE
802   AM_RANGE(0x8000, 0x9fff) AM_WRITE(SMH_RAM)
803   AM_RANGE(0xa000, 0xbfff) AM_WRITE(SMH_RAM) AM_BASE(&shared_ram)
804ADDRESS_MAP_END
805
806static ADDRESS_MAP_START( champwr_2_readmem, ADDRESS_SPACE_PROGRAM, 8 )
807   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
808   AM_RANGE(0x8000, 0xbfff) AM_READ(SMH_BANK6)
809   AM_RANGE(0xc000, 0xdfff) AM_READ(shared_r)
810   AM_RANGE(0xe000, 0xe000) AM_READ_PORT("DSWA")
738static ADDRESS_MAP_START( champwr_2_map, ADDRESS_SPACE_PROGRAM, 8 )
739   AM_RANGE(0x0000, 0x7fff) AM_ROM
740   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(6)
741   AM_RANGE(0xc000, 0xdfff) AM_READWRITE(shared_r, shared_w)
742   AM_RANGE(0xe000, 0xe000) AM_READ_PORT("DSWA") AM_WRITENOP   // Watchdog
811743   AM_RANGE(0xe001, 0xe001) AM_READ_PORT("DSWB")
812744   AM_RANGE(0xe002, 0xe002) AM_READ_PORT("IN0")
813745   AM_RANGE(0xe003, 0xe003) AM_READ_PORT("IN1")
746   AM_RANGE(0xe004, 0xe004) AM_WRITE(control2_w)
814747   AM_RANGE(0xe007, 0xe007) AM_READ_PORT("IN2")
815748   AM_RANGE(0xe008, 0xe00f) AM_READNOP
816   AM_RANGE(0xe800, 0xe800) AM_READNOP
817   AM_RANGE(0xe801, 0xe801) AM_READ(taitosound_comm_r)
818   AM_RANGE(0xf000, 0xf000) AM_READ(rombank2switch_r)
749   AM_RANGE(0xe800, 0xe800) AM_READNOP AM_WRITE(taitosound_port_w)
750   AM_RANGE(0xe801, 0xe801) AM_READWRITE(taitosound_comm_r, taitosound_comm_w)
751   AM_RANGE(0xf000, 0xf000) AM_READWRITE(rombank2switch_r, rombank2switch_w)
819752ADDRESS_MAP_END
820753
821static ADDRESS_MAP_START( champwr_2_writemem, ADDRESS_SPACE_PROGRAM, 8 )
822   AM_RANGE(0x0000, 0xbfff) AM_WRITE(SMH_ROM)
823   AM_RANGE(0xc000, 0xdfff) AM_WRITE(shared_w)
824   AM_RANGE(0xe000, 0xe000) AM_WRITENOP   // Watchdog
825   AM_RANGE(0xe004, 0xe004) AM_WRITE(control2_w)
826   AM_RANGE(0xe800, 0xe800) AM_WRITE(taitosound_port_w)
827   AM_RANGE(0xe801, 0xe801) AM_WRITE(taitosound_comm_w)
828   AM_RANGE(0xf000, 0xf000) AM_WRITE(rombank2switch_w)
829ADDRESS_MAP_END
830
831static ADDRESS_MAP_START( champwr_3_readmem, ADDRESS_SPACE_PROGRAM, 8 )
832   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
833   AM_RANGE(0x4000, 0x7fff) AM_READ(SMH_BANK7)
834   AM_RANGE(0x8000, 0x8fff) AM_READ(SMH_RAM)
835   AM_RANGE(0x9000, 0x9001) AM_DEVREAD("ym", ym2203_r)
836   AM_RANGE(0xa000, 0xa000) AM_READNOP
837   AM_RANGE(0xa001, 0xa001) AM_READ(taitosound_slave_comm_r)
838ADDRESS_MAP_END
839
840static ADDRESS_MAP_START( champwr_3_writemem, ADDRESS_SPACE_PROGRAM, 8 )
841   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
842   AM_RANGE(0x8000, 0x8fff) AM_WRITE(SMH_RAM)
843   AM_RANGE(0x9000, 0x9001) AM_DEVWRITE("ym", ym2203_w)
844   AM_RANGE(0xa000, 0xa000) AM_WRITE(taitosound_slave_port_w)
845   AM_RANGE(0xa001, 0xa001) AM_WRITE(taitosound_slave_comm_w)
754static ADDRESS_MAP_START( champwr_3_map, ADDRESS_SPACE_PROGRAM, 8 )
755   AM_RANGE(0x0000, 0x3fff) AM_ROM
756   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(7)
757   AM_RANGE(0x8000, 0x8fff) AM_RAM
758   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ym", ym2203_r, ym2203_w)
759   AM_RANGE(0xa000, 0xa000) AM_READNOP AM_WRITE(taitosound_slave_port_w)
760   AM_RANGE(0xa001, 0xa001) AM_READWRITE(taitosound_slave_comm_r, taitosound_slave_comm_w)
846761   AM_RANGE(0xb000, 0xb000) AM_WRITE(champwr_msm5205_hi_w)
847762   AM_RANGE(0xc000, 0xc000) AM_WRITE(champwr_msm5205_lo_w)
848763   AM_RANGE(0xd000, 0xd000) AM_DEVWRITE("msm", champwr_msm5205_start_w)
r4499r4500
851766
852767
853768
854static ADDRESS_MAP_START( kurikint_readmem, ADDRESS_SPACE_PROGRAM, 8 )
855   COMMON_BANKS_READ
856   AM_RANGE(0x8000, 0x9fff) AM_READ(SMH_RAM)
857   AM_RANGE(0xa000, 0xa7ff) AM_READ(SMH_RAM)
858   AM_RANGE(0xa800, 0xa800) AM_READ(mux_r)
859   AM_RANGE(0xa801, 0xa801) AM_READNOP   // Watchdog or interrupt ack (value ignored)
769static ADDRESS_MAP_START( kurikint_map, ADDRESS_SPACE_PROGRAM, 8 )
770   COMMON_BANKS_MAP
771   AM_RANGE(0x8000, 0x9fff) AM_RAM
772   AM_RANGE(0xa000, 0xa7ff) AM_RAM AM_BASE(&shared_ram)
773   AM_RANGE(0xa800, 0xa800) AM_READWRITE(mux_r, mux_w)
774   AM_RANGE(0xa801, 0xa801) AM_WRITE(mux_ctrl_w) AM_READNOP   // Watchdog or interrupt ack (value ignored)
860775ADDRESS_MAP_END
861776
862static ADDRESS_MAP_START( kurikint_writemem, ADDRESS_SPACE_PROGRAM, 8 )
863   COMMON_BANKS_WRITE
864   AM_RANGE(0x8000, 0x9fff) AM_WRITE(SMH_RAM)
865   AM_RANGE(0xa000, 0xa7ff) AM_WRITE(SMH_RAM) AM_BASE(&shared_ram)
866   AM_RANGE(0xa800, 0xa800) AM_WRITE(mux_w)
867   AM_RANGE(0xa801, 0xa801) AM_WRITE(mux_ctrl_w)
868ADDRESS_MAP_END
869
870static ADDRESS_MAP_START( kurikint_2_readmem, ADDRESS_SPACE_PROGRAM, 8 )
871   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
872   AM_RANGE(0xc000, 0xdfff) AM_READ(SMH_RAM)
873   AM_RANGE(0xe000, 0xe7ff) AM_READ(shared_r)
874   AM_RANGE(0xe800, 0xe801) AM_DEVREAD("ym", ym2203_r)
777static ADDRESS_MAP_START( kurikint_2_map, ADDRESS_SPACE_PROGRAM, 8 )
778   AM_RANGE(0x0000, 0x7fff) AM_ROM
779   AM_RANGE(0xc000, 0xdfff) AM_RAM
780   AM_RANGE(0xe000, 0xe7ff) AM_READWRITE(shared_r, shared_w)
781   AM_RANGE(0xe800, 0xe801) AM_DEVREADWRITE("ym", ym2203_r, ym2203_w)
875782#if 0
783   AM_RANGE(0xc000, 0xc000) AM_WRITE(rombank2switch_w)
876784   AM_RANGE(0xd000, 0xd000) AM_READ_PORT("DSWA")
877785   AM_RANGE(0xd001, 0xd001) AM_READ_PORT("DSWB")
878786   AM_RANGE(0xd002, 0xd002) AM_READ_PORT("IN0")
r4499r4500
881789#endif
882790ADDRESS_MAP_END
883791
884static ADDRESS_MAP_START( kurikint_2_writemem, ADDRESS_SPACE_PROGRAM, 8 )
885   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
886   AM_RANGE(0xc000, 0xdfff) AM_WRITE(SMH_RAM)
887   AM_RANGE(0xe000, 0xe7ff) AM_WRITE(shared_w)
888   AM_RANGE(0xe800, 0xe801) AM_DEVWRITE("ym", ym2203_w)
889#if 0
890   AM_RANGE(0xc000, 0xc000) AM_WRITE(rombank2switch_w)
891#endif
892ADDRESS_MAP_END
893792
894793
895
896static ADDRESS_MAP_START( puzznic_readmem, ADDRESS_SPACE_PROGRAM, 8 )
897   COMMON_BANKS_READ
898   COMMON_SINGLE_READ
794static ADDRESS_MAP_START( puzznic_map, ADDRESS_SPACE_PROGRAM, 8 )
795   COMMON_BANKS_MAP
796   COMMON_SINGLE_MAP
899797   AM_RANGE(0xa800, 0xa800) AM_READNOP   // Watchdog
900   AM_RANGE(0xb000, 0xb7ff) AM_READ(SMH_RAM)   // Wrong, used to overcome protection
901   AM_RANGE(0xb800, 0xb800) AM_READ(mcu_data_r)
902   AM_RANGE(0xb801, 0xb801) AM_READ(mcu_control_r)
903ADDRESS_MAP_END
904
905static ADDRESS_MAP_START( puzznic_writemem, ADDRESS_SPACE_PROGRAM, 8 )
906   COMMON_BANKS_WRITE
907   COMMON_SINGLE_WRITE
908   AM_RANGE(0xb000, 0xb7ff) AM_WRITE(SMH_RAM)   // Wrong, used to overcome protection
909   AM_RANGE(0xb800, 0xb800) AM_WRITE(mcu_data_w)
910   AM_RANGE(0xb801, 0xb801) AM_WRITE(mcu_control_w)
798   AM_RANGE(0xb000, 0xb7ff) AM_RAM      // Wrong, used to overcome protection
799   AM_RANGE(0xb800, 0xb800) AM_READWRITE(mcu_data_r, mcu_data_w)
800   AM_RANGE(0xb801, 0xb801) AM_READWRITE(mcu_control_r, mcu_control_w)
911801   AM_RANGE(0xbc00, 0xbc00) AM_WRITENOP   // Control register, function unknown
912802ADDRESS_MAP_END
913803
914804/* bootleg, doesn't have the MCU */
915static ADDRESS_MAP_START( puzznici_readmem, ADDRESS_SPACE_PROGRAM, 8 )
916   COMMON_BANKS_READ
917   COMMON_SINGLE_READ
805static ADDRESS_MAP_START( puzznici_map, ADDRESS_SPACE_PROGRAM, 8 )
806   COMMON_BANKS_MAP
807   COMMON_SINGLE_MAP
918808   AM_RANGE(0xa800, 0xa800) AM_READNOP   // Watchdog
919   AM_RANGE(0xb000, 0xb7ff) AM_READ(SMH_RAM)   // Wrong, used to overcome protection
920//  AM_RANGE(0xb800, 0xb800) AM_READ(mcu_data_r)
809   AM_RANGE(0xb000, 0xb7ff) AM_RAM      // Wrong, used to overcome protection
810//  AM_RANGE(0xb800, 0xb800) AM_READWRITE(mcu_data_r, mcu_data_w)
921811   AM_RANGE(0xb801, 0xb801) AM_READ(mcu_control_r)
922ADDRESS_MAP_END
923
924static ADDRESS_MAP_START( puzznici_writemem, ADDRESS_SPACE_PROGRAM, 8 )
925   COMMON_BANKS_WRITE
926   COMMON_SINGLE_WRITE
927   AM_RANGE(0xb000, 0xb7ff) AM_WRITE(SMH_RAM)   // Wrong, used to overcome protection
928//  AM_RANGE(0xb800, 0xb800) AM_WRITE(mcu_data_w)
929812//  AM_RANGE(0xb801, 0xb801) AM_WRITE(mcu_control_w)
930813   AM_RANGE(0xbc00, 0xbc00) AM_WRITENOP   // Control register, function unknown
931814ADDRESS_MAP_END
932815
933816
934static ADDRESS_MAP_START( plotting_readmem, ADDRESS_SPACE_PROGRAM, 8 )
935   COMMON_BANKS_READ
936   COMMON_SINGLE_READ
937ADDRESS_MAP_END
938
939static ADDRESS_MAP_START( plotting_writemem, ADDRESS_SPACE_PROGRAM, 8 )
940   COMMON_BANKS_WRITE
941   COMMON_SINGLE_WRITE
817static ADDRESS_MAP_START( plotting_map, ADDRESS_SPACE_PROGRAM, 8 )
818   COMMON_BANKS_MAP
819   COMMON_SINGLE_MAP
942820   AM_RANGE(0xa800, 0xa800) AM_WRITENOP   // Watchdog or interrupt ack
943821   AM_RANGE(0xb800, 0xb800) AM_WRITENOP   // Control register, function unknown
944822ADDRESS_MAP_END
945823
946824
947static ADDRESS_MAP_START( palamed_readmem, ADDRESS_SPACE_PROGRAM, 8 )
948   COMMON_BANKS_READ
949   COMMON_SINGLE_READ
825static ADDRESS_MAP_START( palamed_map, ADDRESS_SPACE_PROGRAM, 8 )
826   COMMON_BANKS_MAP
827   COMMON_SINGLE_MAP
950828   AM_RANGE(0xa800, 0xa800) AM_READ_PORT("IN0")
951829   AM_RANGE(0xa801, 0xa801) AM_READ_PORT("IN1")
952830   AM_RANGE(0xa802, 0xa802) AM_READ_PORT("IN2")
953   AM_RANGE(0xb001, 0xb001) AM_READNOP   // Watchdog or interrupt ack
954ADDRESS_MAP_END
955
956static ADDRESS_MAP_START( palamed_writemem, ADDRESS_SPACE_PROGRAM, 8 )
957   COMMON_BANKS_WRITE
958   COMMON_SINGLE_WRITE
959831   AM_RANGE(0xa803, 0xa803) AM_WRITENOP   // Control register, function unknown
960832   AM_RANGE(0xb000, 0xb000) AM_WRITENOP   // Control register, function unknown (copy of 8822)
833   AM_RANGE(0xb001, 0xb001) AM_READNOP   // Watchdog or interrupt ack
961834ADDRESS_MAP_END
962835
963836
964static ADDRESS_MAP_START( cachat_readmem, ADDRESS_SPACE_PROGRAM, 8 )
965   COMMON_BANKS_READ
966   COMMON_SINGLE_READ
837static ADDRESS_MAP_START( cachat_map, ADDRESS_SPACE_PROGRAM, 8 )
838   COMMON_BANKS_MAP
839   COMMON_SINGLE_MAP
967840   AM_RANGE(0xa800, 0xa800) AM_READ_PORT("IN0")
968841   AM_RANGE(0xa801, 0xa801) AM_READ_PORT("IN1")
969842   AM_RANGE(0xa802, 0xa802) AM_READ_PORT("IN2")
970   AM_RANGE(0xb001, 0xb001) AM_READNOP   // Watchdog or interrupt ack (value ignored)
971   AM_RANGE(0xfff8, 0xfff8) AM_READ(rombankswitch_r)
972ADDRESS_MAP_END
973
974static ADDRESS_MAP_START( cachat_writemem, ADDRESS_SPACE_PROGRAM, 8 )
975   COMMON_BANKS_WRITE
976   COMMON_SINGLE_WRITE
977843   AM_RANGE(0xa803, 0xa803) AM_WRITENOP   // Control register, function unknown
978844   AM_RANGE(0xb000, 0xb000) AM_WRITENOP   // Control register, function unknown
979   AM_RANGE(0xfff8, 0xfff8) AM_WRITE(rombankswitch_w)
845   AM_RANGE(0xb001, 0xb001) AM_READNOP   // Watchdog or interrupt ack (value ignored)
846   AM_RANGE(0xfff8, 0xfff8) AM_READWRITE(rombankswitch_r, rombankswitch_w)
980847ADDRESS_MAP_END
981848
982849
983static ADDRESS_MAP_START( horshoes_readmem, ADDRESS_SPACE_PROGRAM, 8 )
984   COMMON_BANKS_READ
985   COMMON_SINGLE_READ
850static ADDRESS_MAP_START( horshoes_map, ADDRESS_SPACE_PROGRAM, 8 )
851   COMMON_BANKS_MAP
852   COMMON_SINGLE_MAP
986853   AM_RANGE(0xa800, 0xa800) AM_READ(horshoes_tracky_lo_r)
987854   AM_RANGE(0xa802, 0xa802) AM_READ(horshoes_tracky_reset_r)
988855   AM_RANGE(0xa803, 0xa803) AM_READ(horshoes_trackx_reset_r)
r4499r4500
990857   AM_RANGE(0xa808, 0xa808) AM_READ(horshoes_trackx_lo_r)
991858   AM_RANGE(0xa80c, 0xa80c) AM_READ(horshoes_trackx_hi_r)
992859   AM_RANGE(0xb801, 0xb801) AM_READNOP   // Watchdog or interrupt ack
993ADDRESS_MAP_END
994
995static ADDRESS_MAP_START( horshoes_writemem, ADDRESS_SPACE_PROGRAM, 8 )
996   COMMON_BANKS_WRITE
997   COMMON_SINGLE_WRITE
998860   AM_RANGE(0xb802, 0xb802) AM_WRITE(horshoes_bankg_w)
999861   AM_RANGE(0xbc00, 0xbc00) AM_WRITENOP
1000862ADDRESS_MAP_END
1001863
1002static ADDRESS_MAP_START( evilston_readmem, ADDRESS_SPACE_PROGRAM, 8 )
1003   COMMON_BANKS_READ
1004   AM_RANGE(0x8000, 0x9fff) AM_READ(SMH_RAM)
1005   AM_RANGE(0xa000, 0xa7ff) AM_READ(SMH_RAM)
1006   AM_RANGE(0xa800, 0xa800) AM_READ_PORT("DSWA")
1007   AM_RANGE(0xa801, 0xa801) AM_READ_PORT("DSWB")
1008   AM_RANGE(0xa802, 0xa802) AM_READ_PORT("IN0")
1009   AM_RANGE(0xa803, 0xa803) AM_READ_PORT("IN1")
1010   AM_RANGE(0xa807, 0xa807) AM_READ_PORT("IN2")
1011ADDRESS_MAP_END
1012864
1013865
1014866
r4499r4500
1018870   cpu_set_input_line(space->machine->cpu[1],INPUT_LINE_NMI,PULSE_LINE);
1019871}
1020872
1021
1022
1023
1024static ADDRESS_MAP_START( evilston_writemem, ADDRESS_SPACE_PROGRAM, 8 )
1025   COMMON_BANKS_WRITE
1026   AM_RANGE(0x8000, 0x9fff) AM_WRITE(SMH_RAM)
1027   AM_RANGE(0xa000, 0xa7ff) AM_WRITE(SMH_RAM) AM_BASE(&shared_ram)//shared2_w },
1028   AM_RANGE(0xa800, 0xa800) AM_WRITE(SMH_RAM)//watchdog ?
1029   AM_RANGE(0xa804, 0xa804) AM_WRITE(SMH_RAM) //coin couters/locks ?
1030
873static ADDRESS_MAP_START( evilston_map, ADDRESS_SPACE_PROGRAM, 8 )
874   COMMON_BANKS_MAP
875   AM_RANGE(0x8000, 0x9fff) AM_RAM
876   AM_RANGE(0xa000, 0xa7ff) AM_RAM AM_BASE(&shared_ram)//shared2_w },
877   AM_RANGE(0xa800, 0xa800) AM_READ_PORT("DSWA") AM_WRITENOP   //watchdog ?
878   AM_RANGE(0xa801, 0xa801) AM_READ_PORT("DSWB")
879   AM_RANGE(0xa802, 0xa802) AM_READ_PORT("IN0")
880   AM_RANGE(0xa803, 0xa803) AM_READ_PORT("IN1")
881   AM_RANGE(0xa804, 0xa804) AM_WRITENOP   //coin couters/locks ?
882   AM_RANGE(0xa807, 0xa807) AM_READ_PORT("IN2")
1031883ADDRESS_MAP_END
1032884
1033static ADDRESS_MAP_START( evilston_2_readmem, ADDRESS_SPACE_PROGRAM, 8 )
1034   AM_RANGE(0x0000, 0xbfff) AM_READ(SMH_ROM)
1035   AM_RANGE(0xc000, 0xdfff) AM_READ(SMH_RAM)
1036   AM_RANGE(0xe000, 0xe7ff) AM_READ(shared_r)//shared_r },
1037   AM_RANGE(0xe800, 0xe801) AM_DEVREAD("ym", ym2203_r)
1038   AM_RANGE(0xf000, 0xf7ff) AM_READ(SMH_BANK7)
885static ADDRESS_MAP_START( evilston_2_map, ADDRESS_SPACE_PROGRAM, 8 )
886   AM_RANGE(0x0000, 0xbfff) AM_ROM
887   AM_RANGE(0xc000, 0xdfff) AM_RAM
888   AM_RANGE(0xe000, 0xe7ff) AM_READWRITE(shared_r, shared_w)
889   AM_RANGE(0xe800, 0xe801) AM_DEVREADWRITE("ym", ym2203_r, ym2203_w)
890   AM_RANGE(0xf000, 0xf7ff) AM_ROMBANK(7)
1039891ADDRESS_MAP_END
1040892
1041static ADDRESS_MAP_START( evilston_2_writemem, ADDRESS_SPACE_PROGRAM, 8 )
1042   AM_RANGE(0x0000, 0xbfff) AM_WRITE(SMH_ROM)
1043   AM_RANGE(0xc000, 0xdfff) AM_WRITE(SMH_RAM)
1044   AM_RANGE(0xe000, 0xe7ff) AM_WRITE(shared_w)
1045   AM_RANGE(0xe800, 0xe801) AM_DEVWRITE("ym", ym2203_w)
1046ADDRESS_MAP_END
1047893
1048894
1049
1050895/***********************************************************
1051896             INPUT PORTS, DIPs
1052897***********************************************************/
r4499r4500
12481093   TAITO_L_SYSTEM_INPUT( IP_ACTIVE_HIGH, 4 )
12491094INPUT_PORTS_END
12501095
1251static INPUT_PORTS_START( kurikinj )
1096static INPUT_PORTS_START( kurikintj )
12521097   PORT_INCLUDE( kurikint )
12531098
12541099   PORT_MODIFY("DSWA")
12551100   TAITO_COINAGE_JAPAN_OLD
12561101INPUT_PORTS_END
12571102
1258static INPUT_PORTS_START( kurikina )
1103static INPUT_PORTS_START( kurikinta )
12591104   PORT_INCLUDE( kurikint )
12601105
12611106   PORT_MODIFY("DSWA")
r4499r4500
21051950
21061951   /* basic machine hardware */
21071952   MDRV_CPU_ADD("maincpu", Z80, 13330560/2)    /* verified freq on pin122 of TC0090LVC cpu */
2108   MDRV_CPU_PROGRAM_MAP(fhawk_readmem,fhawk_writemem)
1953   MDRV_CPU_PROGRAM_MAP(fhawk_map,0)
21091954   MDRV_CPU_VBLANK_INT_HACK(vbl_interrupt,3)
21101955
21111956   MDRV_CPU_ADD("audiocpu", Z80, 4000000)   /* verified on pcb */
2112   MDRV_CPU_PROGRAM_MAP(fhawk_3_readmem,fhawk_3_writemem)
1957   MDRV_CPU_PROGRAM_MAP(fhawk_3_map,0)
21131958
21141959   MDRV_CPU_ADD("slave", Z80, 12000000/3)    /* verified on pcb */
2115   MDRV_CPU_PROGRAM_MAP(fhawk_2_readmem,fhawk_2_writemem)
1960   MDRV_CPU_PROGRAM_MAP(fhawk_2_map,0)
21161961   MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,3) /* fixes slow down problems */
21171962
21181963   MDRV_QUANTUM_TIME(HZ(6000))
r4499r4500
21511996   /* basic machine hardware */
21521997   MDRV_IMPORT_FROM(fhawk)
21531998   MDRV_CPU_MODIFY("maincpu")
2154   MDRV_CPU_PROGRAM_MAP(champwr_readmem,champwr_writemem)
1999   MDRV_CPU_PROGRAM_MAP(champwr_map,0)
21552000
21562001   MDRV_CPU_MODIFY("audiocpu")
2157   MDRV_CPU_PROGRAM_MAP(champwr_3_readmem,champwr_3_writemem)
2002   MDRV_CPU_PROGRAM_MAP(champwr_3_map,0)
21582003
21592004   MDRV_CPU_MODIFY("slave")
2160   MDRV_CPU_PROGRAM_MAP(champwr_2_readmem,champwr_2_writemem)
2005   MDRV_CPU_PROGRAM_MAP(champwr_2_map,0)
21612006
21622007   MDRV_MACHINE_RESET(champwr)
21632008
r4499r4500
21812026   /* basic machine hardware */
21822027   MDRV_IMPORT_FROM(fhawk)
21832028   MDRV_CPU_MODIFY("maincpu")
2184   MDRV_CPU_PROGRAM_MAP(raimais_readmem,raimais_writemem)
2029   MDRV_CPU_PROGRAM_MAP(raimais_map,0)
21852030
21862031   MDRV_CPU_MODIFY("audiocpu")
2187   MDRV_CPU_PROGRAM_MAP(raimais_3_readmem,raimais_3_writemem)
2032   MDRV_CPU_PROGRAM_MAP(raimais_3_map,0)
21882033
21892034   MDRV_CPU_MODIFY("slave")
2190   MDRV_CPU_PROGRAM_MAP(raimais_2_readmem,raimais_2_writemem)
2035   MDRV_CPU_PROGRAM_MAP(raimais_2_map,0)
21912036
21922037   MDRV_MACHINE_RESET(raimais)
21932038
r4499r4500
22042049
22052050   /* basic machine hardware */
22062051   MDRV_CPU_ADD("maincpu", Z80, 13330560/2)    /* verified freq on pin122 of TC0090LVC cpu */
2207   MDRV_CPU_PROGRAM_MAP(kurikint_readmem,kurikint_writemem)
2052   MDRV_CPU_PROGRAM_MAP(kurikint_map,0)
22082053   MDRV_CPU_VBLANK_INT_HACK(vbl_interrupt,3)
22092054
22102055   MDRV_CPU_ADD("audiocpu",  Z80, 12000000/3)    /* verified on pcb */
2211   MDRV_CPU_PROGRAM_MAP(kurikint_2_readmem,kurikint_2_writemem)
2056   MDRV_CPU_PROGRAM_MAP(kurikint_2_map,0)
22122057   MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
22132058
22142059   MDRV_QUANTUM_TIME(HZ(6000))
r4499r4500
22412086MACHINE_DRIVER_END
22422087
22432088
2244static MACHINE_DRIVER_START( kurikina )
2089static MACHINE_DRIVER_START( kurikinta )
22452090
22462091   /* basic machine hardware */
22472092   MDRV_IMPORT_FROM(kurikint)
r4499r4500
22552100
22562101   /* basic machine hardware */
22572102   MDRV_CPU_ADD("maincpu", Z80, 13330560/2)    /* verified freq on pin122 of TC0090LVC cpu */
2258   MDRV_CPU_PROGRAM_MAP(plotting_readmem,plotting_writemem)
2103   MDRV_CPU_PROGRAM_MAP(plotting_map,0)
22592104   MDRV_CPU_VBLANK_INT_HACK(vbl_interrupt,3)
22602105
22612106   MDRV_MACHINE_RESET(plotting)
r4499r4500
22922137   /* basic machine hardware */
22932138   MDRV_IMPORT_FROM(plotting)
22942139   MDRV_CPU_MODIFY("maincpu")
2295   MDRV_CPU_PROGRAM_MAP(puzznic_readmem,puzznic_writemem)
2140   MDRV_CPU_PROGRAM_MAP(puzznic_map,0)
22962141
22972142   MDRV_MACHINE_RESET(puzznic)
22982143MACHINE_DRIVER_END
r4499r4500
23022147   /* basic machine hardware */
23032148   MDRV_IMPORT_FROM(plotting)
23042149   MDRV_CPU_MODIFY("maincpu")
2305   MDRV_CPU_PROGRAM_MAP(puzznici_readmem,puzznici_writemem)
2150   MDRV_CPU_PROGRAM_MAP(puzznici_map,0)
23062151
23072152   MDRV_MACHINE_RESET(puzznic)
23082153MACHINE_DRIVER_END
r4499r4500
23132158   /* basic machine hardware */
23142159   MDRV_IMPORT_FROM(plotting)
23152160   MDRV_CPU_MODIFY("maincpu")
2316   MDRV_CPU_PROGRAM_MAP(horshoes_readmem,horshoes_writemem)
2161   MDRV_CPU_PROGRAM_MAP(horshoes_map,0)
23172162
23182163   MDRV_MACHINE_RESET(horshoes)
23192164MACHINE_DRIVER_END
r4499r4500
23242169   /* basic machine hardware */
23252170   MDRV_IMPORT_FROM(plotting)
23262171   MDRV_CPU_MODIFY("maincpu")
2327   MDRV_CPU_PROGRAM_MAP(palamed_readmem,palamed_writemem)
2172   MDRV_CPU_PROGRAM_MAP(palamed_map,0)
23282173
23292174   MDRV_MACHINE_RESET(palamed)
23302175MACHINE_DRIVER_END
r4499r4500
23352180   /* basic machine hardware */
23362181   MDRV_IMPORT_FROM(plotting)
23372182   MDRV_CPU_MODIFY("maincpu")
2338   MDRV_CPU_PROGRAM_MAP(cachat_readmem,cachat_writemem)
2183   MDRV_CPU_PROGRAM_MAP(cachat_map,0)
23392184
23402185   MDRV_MACHINE_RESET(cachat)
23412186MACHINE_DRIVER_END
r4499r4500
23442189
23452190   /* basic machine hardware */
23462191   MDRV_CPU_ADD("maincpu", Z80, 13330560/2)    /* not verfied */
2347   MDRV_CPU_PROGRAM_MAP(evilston_readmem,evilston_writemem)
2192   MDRV_CPU_PROGRAM_MAP(evilston_map,0)
23482193   MDRV_CPU_VBLANK_INT_HACK(vbl_interrupt,3)
23492194
23502195   MDRV_CPU_ADD("audiocpu", Z80, 12000000/3)    /* not verified */
2351   MDRV_CPU_PROGRAM_MAP(evilston_2_readmem,evilston_2_writemem)
2196   MDRV_CPU_PROGRAM_MAP(evilston_2_map,0)
23522197   MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
23532198
23542199   MDRV_QUANTUM_TIME(HZ(6000))
r4499r4500
24252270   ROM_LOAD( "b36-03.bin",   0x00000, 0x80000, CRC(96166516) SHA1(a6748218188cbd1b037f6c0845416665c0d55a7b) )
24262271ROM_END
24272272
2428ROM_START( raimaijo )
2273ROM_START( raimaisjo )
24292274   ROM_REGION( 0xb0000, "maincpu", 0 )
24302275   ROM_LOAD( "b36-08.bin", 0x00000, 0x20000, CRC(f40b9178) SHA1(ccf5afcf08cac0d5b2d6ba74abd62d35412f0265) )
24312276   ROM_RELOAD(               0x10000, 0x20000 )
r4499r4500
25682413   ROM_LOAD( "b42-02.ic5",  0x80000, 0x80000, CRC(1a52e65c) SHA1(20a1fc4d02b5928fb01444079692e23d178c6297) )
25692414ROM_END
25702415
2571ROM_START( kurikinu )
2416ROM_START( kurikintu )
25722417   ROM_REGION( 0xb0000, "maincpu", 0 )
25732418   ROM_LOAD( "b42-08.ic2",  0x00000, 0x20000, CRC(7075122e) SHA1(55f5f0cf3b91b7b408f9c05c91f9839c43b49c5f) )
25742419   ROM_RELOAD(              0x10000, 0x20000 )
r4499r4500
25822427   ROM_LOAD( "b42-02.ic5",  0x80000, 0x80000, CRC(1a52e65c) SHA1(20a1fc4d02b5928fb01444079692e23d178c6297) )
25832428ROM_END
25842429
2585ROM_START( kurikinj )
2430ROM_START( kurikintj )
25862431   ROM_REGION( 0xb0000, "maincpu", 0 )
25872432   ROM_LOAD( "b42-05.ic2",  0x00000, 0x20000, CRC(077222b8) SHA1(953fb3444f6bb0dbe0323a0fd8fc3067b106a4f6) )
25882433   ROM_RELOAD(              0x10000, 0x20000 )
r4499r4500
25962441   ROM_LOAD( "b42-02.ic5",  0x80000, 0x80000, CRC(1a52e65c) SHA1(20a1fc4d02b5928fb01444079692e23d178c6297) )
25972442ROM_END
25982443
2599ROM_START( kurikina )
2444ROM_START( kurikinta )
26002445   ROM_REGION( 0xb0000, "maincpu", 0 )
26012446   ROM_LOAD( "kk_ic2.ic2",  0x00000, 0x20000, CRC(908603f2) SHA1(f810f2501458224e9264a984f22547cc8ccc2b0e) )
26022447   ROM_RELOAD(              0x10000, 0x20000 )
r4499r4500
26782523ROM_END
26792524
26802525
2681ROM_START( plottina ) /* B96-09 or higher by Taito's rom numbering system, demo mode is 2 players */
2526ROM_START( plottinga ) /* B96-09 or higher by Taito's rom numbering system, demo mode is 2 players */
26822527   ROM_REGION( 0x20000, "maincpu", 0 )
26832528   ROM_LOAD( "plot01.ic10", 0x00000, 0x10000, CRC(5b30bc25) SHA1(df8839a90da9e5122d75b6faaf97f59499dbd316) )
26842529   ROM_RELOAD(              0x10000, 0x10000 )
r4499r4500
26912536   ROM_LOAD( "gal16v8-b86-04.bin", 0x0000, 0x0117, CRC(bf8c0ea0) SHA1(e0a00f1f6363fb79650202f90a56329990876d49) )   /* derived, but verified  Pal Stamped B86-04 */
26922537ROM_END
26932538
2694ROM_START( plottinb ) /* The first (earliest) "World" version by Taito's rom numbering system, demo mode is 2 players */
2539ROM_START( plottingb ) /* The first (earliest) "World" version by Taito's rom numbering system, demo mode is 2 players */
26952540   ROM_REGION( 0x20000, "maincpu", 0 )
26962541   ROM_LOAD( "b96-06.ic10",0x00000, 0x10000, CRC(f89a54b1) SHA1(19757b5fb61acdd6f5ae8e32a38ae54bfda0c522) )
26972542   ROM_RELOAD(             0x10000, 0x10000 )
r4499r4500
27042549   ROM_LOAD( "gal16v8-b86-04.bin", 0x0000, 0x0117, CRC(bf8c0ea0) SHA1(e0a00f1f6363fb79650202f90a56329990876d49) )   /* derived, but verified  Pal Stamped B86-04 */
27052550ROM_END
27062551
2707ROM_START( plottinu ) /* The demo mode is 2 players */
2552ROM_START( plottingu ) /* The demo mode is 2 players */
27082553   ROM_REGION( 0x20000, "maincpu", 0 )
27092554   ROM_LOAD( "b96-05.ic10",0x00000, 0x10000, CRC(afb99d1f) SHA1(a5cabc182d4f1d5709e6835d8b0a481dd0f9a563) )
27102555   ROM_RELOAD(             0x10000, 0x10000 )
r4499r4500
28902735
28912736
28922737// bits 7..0 => bits 0..7
2893static DRIVER_INIT( plottina )
2738static DRIVER_INIT( plottinga )
28942739{
28952740   UINT8 tab[256];
28962741   UINT8 *p;
r4499r4500
29202765}
29212766
29222767
2923GAME( 1988, raimais,  0,        raimais,  raimais,  0,        ROT0,   "Taito Corporation Japan", "Raimais (World)", 0 )
2924GAME( 1988, raimaisj, raimais,  raimais,  raimaisj, 0,        ROT0,   "Taito Corporation", "Raimais (Japan)", 0 )
2925GAME( 1988, raimaijo, raimais,  raimais,  raimaisj, 0,        ROT0,   "Taito Corporation", "Raimais (Japan / First Revision)", 0 )
2926GAME( 1988, fhawk,    0,        fhawk,    fhawk,    0,        ROT270, "Taito Corporation Japan", "Fighting Hawk (World)", 0 )
2927GAME( 1988, fhawkj,   fhawk,    fhawk,    fhawkj,   0,        ROT270, "Taito Corporation", "Fighting Hawk (Japan)", 0 )
2928GAME( 1989, champwr,  0,        champwr,  champwr,  0,        ROT0,   "Taito Corporation Japan", "Champion Wrestler (World)", GAME_IMPERFECT_SOUND )
2929GAME( 1989, champwru, champwr,  champwr,  champwru, 0,        ROT0,   "Taito America Corporation", "Champion Wrestler (US)", GAME_IMPERFECT_SOUND )
2930GAME( 1989, champwrj, champwr,  champwr,  champwrj, 0,        ROT0,   "Taito Corporation", "Champion Wrestler (Japan)", GAME_IMPERFECT_SOUND )
2931GAME( 1988, kurikint, 0,        kurikint, kurikint, 0,        ROT0,   "Taito Corporation Japan", "Kuri Kinton (World)", 0 )
2932GAME( 1988, kurikinu, kurikint, kurikint, kurikinj, 0,        ROT0,   "Taito America Corporation", "Kuri Kinton (US)", 0 )
2933GAME( 1988, kurikinj, kurikint, kurikint, kurikinj, 0,        ROT0,   "Taito Corporation", "Kuri Kinton (Japan)", 0 )
2934GAME( 1988, kurikina, kurikint, kurikina, kurikina, 0,        ROT0,   "Taito Corporation Japan", "Kuri Kinton (World, prototype?)", 0 )
2935GAME( 1989, plotting, 0,        plotting, plotting, 0,        ROT0,   "Taito Corporation Japan", "Plotting (World set 1)", 0 )
2936GAME( 1989, plottina, plotting, plotting, plotting, plottina, ROT0,   "Taito Corporation Japan", "Plotting (World set 2, Protected)", 0 )
2937GAME( 1989, plottinb, plotting, plotting, plotting, 0,        ROT0,   "Taito Corporation Japan", "Plotting (World set 3, Earliest Version)", 0 )
2938GAME( 1989, plottinu, plotting, plotting, plotting, 0,        ROT0,   "Taito America Corporation", "Plotting (US)", 0 )
2939GAME( 1989, flipull,  plotting, plotting, plotting, 0,        ROT0,   "Taito Corporation", "Flipull (Japan)", 0 )
2940GAME( 1989, puzznic,  0,        puzznic,  puzznic,  0,        ROT0,   "Taito Corporation Japan", "Puzznic (World)", 0 )
2941GAME( 1989, puzznicj, puzznic,  puzznic,  puzznic,  0,        ROT0,   "Taito Corporation", "Puzznic (Japan)", 0 )
2942GAME( 1989, puzznici, puzznic,  puzznici, puzznic,  0,        ROT0,   "bootleg", "Puzznic (Italian bootleg)", 0 )
2943GAME( 1990, horshoes, 0,        horshoes, horshoes, 0,        ROT270, "Taito America Corporation", "American Horseshoes (US)", 0 )
2944GAME( 1990, palamed,  0,        palamed,  palamed,  0,        ROT0,   "Taito Corporation", "Palamedes (Japan)", 0 )
2945GAME( 1993, cachat,   0,        cachat,   cachat,   0,        ROT0,   "Taito Corporation", "Cachat (Japan)", 0 )
2946GAME( 1993, tubeit,   cachat,   cachat,   tubeit,   0,        ROT0,   "Taito Corporation", "Tube-It", 0 )  // No (c) message
2947GAME( 199?, cubybop,  0,        cachat,   cubybop,  0,        ROT0,   "Taito Corporation", "Cuby Bop (Location Test)", 0 ) // No (c) message
2768GAME( 1988, raimais,   0,        raimais,  raimais,  0,        ROT0,   "Taito Corporation Japan", "Raimais (World)", 0 )
2769GAME( 1988, raimaisj,  raimais,  raimais,  raimaisj, 0,        ROT0,   "Taito Corporation", "Raimais (Japan)", 0 )
2770GAME( 1988, raimaisjo, raimais,  raimais,  raimaisj, 0,        ROT0,   "Taito Corporation", "Raimais (Japan / First Revision)", 0 )
2771GAME( 1988, fhawk,     0,        fhawk,    fhawk,    0,        ROT270, "Taito Corporation Japan", "Fighting Hawk (World)", 0 )
2772GAME( 1988, fhawkj,    fhawk,    fhawk,    fhawkj,   0,        ROT270, "Taito Corporation", "Fighting Hawk (Japan)", 0 )
2773GAME( 1989, champwr,   0,        champwr,  champwr,  0,        ROT0,   "Taito Corporation Japan", "Champion Wrestler (World)", GAME_IMPERFECT_SOUND )
2774GAME( 1989, champwru,  champwr,  champwr,  champwru, 0,        ROT0,   "Taito America Corporation", "Champion Wrestler (US)", GAME_IMPERFECT_SOUND )
2775GAME( 1989, champwrj,  champwr,  champwr,  champwrj, 0,        ROT0,   "Taito Corporation", "Champion Wrestler (Japan)", GAME_IMPERFECT_SOUND )
2776GAME( 1988, kurikint,  0,        kurikint, kurikint, 0,        ROT0,   "Taito Corporation Japan", "Kuri Kinton (World)", 0 )
2777GAME( 1988, kurikintu, kurikint, kurikint, kurikintj,0,        ROT0,   "Taito America Corporation", "Kuri Kinton (US)", 0 )
2778GAME( 1988, kurikintj, kurikint, kurikint, kurikintj,0,        ROT0,   "Taito Corporation", "Kuri Kinton (Japan)", 0 )
2779GAME( 1988, kurikinta, kurikint, kurikinta,kurikinta,0,        ROT0,   "Taito Corporation Japan", "Kuri Kinton (World, prototype?)", 0 )
2780GAME( 1989, plotting,  0,        plotting, plotting, 0,        ROT0,   "Taito Corporation Japan", "Plotting (World set 1)", 0 )
2781GAME( 1989, plottinga, plotting, plotting, plotting, plottinga,ROT0,   "Taito Corporation Japan", "Plotting (World set 2, Protected)", 0 )
2782GAME( 1989, plottingb, plotting, plotting, plotting, 0,        ROT0,   "Taito Corporation Japan", "Plotting (World set 3, Earliest Version)", 0 )
2783GAME( 1989, plottingu, plotting, plotting, plotting, 0,        ROT0,   "Taito America Corporation", "Plotting (US)", 0 )
2784GAME( 1989, flipull,   plotting, plotting, plotting, 0,        ROT0,   "Taito Corporation", "Flipull (Japan)", 0 )
2785GAME( 1989, puzznic,   0,        puzznic,  puzznic,  0,        ROT0,   "Taito Corporation Japan", "Puzznic (World)", 0 )
2786GAME( 1989, puzznicj,  puzznic,  puzznic,  puzznic,  0,        ROT0,   "Taito Corporation", "Puzznic (Japan)", 0 )
2787GAME( 1989, puzznici,  puzznic,  puzznici, puzznic,  0,        ROT0,   "bootleg", "Puzznic (Italian bootleg)", 0 )
2788GAME( 1990, horshoes,  0,        horshoes, horshoes, 0,        ROT270, "Taito America Corporation", "American Horseshoes (US)", 0 )
2789GAME( 1990, palamed,   0,        palamed,  palamed,  0,        ROT0,   "Taito Corporation", "Palamedes (Japan)", 0 )
2790GAME( 1993, cachat,    0,        cachat,   cachat,   0,        ROT0,   "Taito Corporation", "Cachat (Japan)", 0 )
2791GAME( 1993, tubeit,    cachat,   cachat,   tubeit,   0,        ROT0,   "Taito Corporation", "Tube-It", 0 )  // No (c) message
2792GAME( 199?, cubybop,   0,        cachat,   cubybop,  0,        ROT0,   "Taito Corporation", "Cuby Bop (Location Test)", 0 ) // No (c) message
29482793
2949GAME( 1992, plgirls,  0,        cachat,   plgirls,  0,        ROT270, "Hot-B.", "Play Girls", 0 )
2950GAME( 1993, plgirls2, 0,        cachat,   plgirls2, 0,        ROT270, "Hot-B.", "Play Girls 2", 0 )
2794GAME( 1992, plgirls,   0,        cachat,   plgirls,  0,        ROT270, "Hot-B.", "Play Girls", 0 )
2795GAME( 1993, plgirls2,  0,        cachat,   plgirls2, 0,        ROT270, "Hot-B.", "Play Girls 2", 0 )
29512796
2952GAME( 1990, evilston, 0,        evilston, evilston, evilston, ROT270, "Spacy Industrial, Ltd.", "Evil Stone", 0 )
2797GAME( 1990, evilston, 0,        evilston, evilston, evilston, ROT270, "Spacy Industrial, Ltd.", "Evil Stone", 0 )
src/mame/drivers/fcombat.c
r4499r4500
418418   ROM_LOAD( "fcombat1.t5",  0x0000, 0x4000, CRC(a0cc1216) SHA1(3a8963ffde2ff4a3f428369133f94bb37717cae5) )
419419
420420   ROM_REGION( 0x02000, "gfx1", ROMREGION_DISPOSE )
421   ROM_LOAD( "fcombat7.l11", 0x00000, 0x2000, BAD_DUMP CRC(54e978ef) SHA1(834f428f8d3e6b2cd865db8d2a0e069484a98316) ) /* fg chars */
421   ROM_LOAD( "fcombat7.l11", 0x00000, 0x2000, CRC(401061b5) SHA1(09dd23e86a56db8021e14432aced0eaf013fefe2) ) /* fg chars */
422422
423423   ROM_REGION( 0x0c000, "gfx2", ROMREGION_DISPOSE )
424424   ROM_LOAD( "fcombat8.d10", 0x00000, 0x4000, CRC(e810941e) SHA1(19ae85af0bf245caf3afe10d65e618cfb47d33c2) ) /* sprites */
src/mame/drivers/multigam.c
r4499r4500
5454static WRITE8_HANDLER( sprite_dma_w )
5555{
5656   int source = ( data & 7 );
57   ppu2c0x_spriteram_dma( space, 0, source );
57   ppu2c0x_spriteram_dma( space, devtag_get_device(space->machine, "ppu"), source );
5858}
5959
6060static READ8_DEVICE_HANDLER( psg_4015_r )
r4499r4500
151151
152152static WRITE8_HANDLER(multigam_switch_gfx_rom)
153153{
154   ppu2c0x_set_videorom_bank( 0, 0, 8, data /*& 0x3f*/, 512 );
155   ppu2c0x_set_mirroring( 0, data & 0x40 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
154   const device_config *ppu = devtag_get_device(space->machine, "ppu");
155   ppu2c0x_set_videorom_bank( ppu, 0, 8, data /*& 0x3f*/, 512 );
156   ppu2c0x_set_mirroring( ppu, data & 0x40 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
156157   multigam_game_gfx_bank = data;
157158};
158159
r4499r4500
161162{
162163   if ( multigam_game_gfx_bank & 0x80 )
163164   {
164      ppu2c0x_set_videorom_bank( 0, 0, 8, multigam_game_gfx_bank + (data & 0xf), 512 );
165      const device_config *ppu = devtag_get_device(space->machine, "ppu");
166      ppu2c0x_set_videorom_bank( ppu, 0, 8, multigam_game_gfx_bank + (data & 0xf), 512 );
165167   }
166168   else
167169   {
r4499r4500
178180static ADDRESS_MAP_START( multigam_map, ADDRESS_SPACE_PROGRAM, 8 )
179181   AM_RANGE(0x0000, 0x07ff) AM_RAM   /* NES RAM */
180182   AM_RANGE(0x0800, 0x0fff) AM_RAM /* additional RAM */
181   AM_RANGE(0x2000, 0x3fff) AM_READWRITE(ppu2c0x_0_r, ppu2c0x_0_w)
183   AM_RANGE(0x2000, 0x3fff) AM_DEVREADWRITE("ppu", ppu2c0x_r, ppu2c0x_w)
182184   AM_RANGE(0x4000, 0x4013) AM_DEVREADWRITE("nes", nes_psg_r, nes_psg_w)         /* PSG primary registers */
183185   AM_RANGE(0x4014, 0x4014) AM_WRITE(sprite_dma_w)
184186   AM_RANGE(0x4015, 0x4015) AM_DEVREADWRITE("nes", psg_4015_r, psg_4015_w)         /* PSG status / first control register */
r4499r4500
206208static int multigam3_mmc3_last_bank;
207209static UINT8* multigmc_mmc3_6000_ram;
208210
209static void multigam3_mmc3_scanline_cb( running_machine *machine, int num, int scanline, int vblank, int blanked )
211static void multigam3_mmc3_scanline_cb( const device_config *device, int scanline, int vblank, int blanked )
210212{
211213   if ( !vblank && !blanked )
212214   {
213215      if ( --multigam3_mmc3_scanline_counter == -1 )
214216      {
215217         multigam3_mmc3_scanline_counter = multigam3_mmc3_scanline_latch;
216         generic_pulse_irq_line(machine->cpu[0], 0);
218         generic_pulse_irq_line(device->machine->cpu[0], 0);
217219      }
218220   }
219221}
220222
221223static WRITE8_HANDLER( multigam3_mmc3_rom_switch_w )
222224{
225   const device_config *ppu = devtag_get_device(space->machine, "ppu");
226
223227   /* basically, a MMC3 mapper from the nes */
224228   static int multigam3_mmc3_command;
225229
r4499r4500
271275               case 1: /* char banking */
272276                  data &= 0xfe;
273277                  page ^= ( cmd << 1 );
274                  ppu2c0x_set_videorom_bank( 0, page, 2, 0x100 + data, 64 );
278                  ppu2c0x_set_videorom_bank( ppu, page, 2, 0x100 + data, 64 );
275279               break;
276280
277281               case 2: /* char banking */
r4499r4500
279283               case 4: /* char banking */
280284               case 5: /* char banking */
281285                  page ^= cmd + 2;
282                  ppu2c0x_set_videorom_bank( 0, page, 1, 0x100 + data, 64 );
286                  ppu2c0x_set_videorom_bank( ppu, page, 1, 0x100 + data, 64 );
283287               break;
284288
285289               case 6: /* program banking */
r4499r4500
324328         if( !multigam3_mmc3_4screen )
325329         {
326330            if ( data & 0x40 )
327               ppu2c0x_set_mirroring( 0, PPU_MIRROR_HIGH );
331               ppu2c0x_set_mirroring( ppu, PPU_MIRROR_HIGH );
328332            else
329               ppu2c0x_set_mirroring( 0, ( data & 1 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
333               ppu2c0x_set_mirroring( ppu, ( data & 1 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
330334         }
331335      break;
332336
r4499r4500
343347      break;
344348
345349      case 0x6000: /* disable irqs */
346         ppu2c0x_set_scanline_callback( 0, 0 );
350         ppu2c0x_set_scanline_callback( ppu, 0 );
347351      break;
348352
349353      case 0x6001: /* enable irqs */
350         ppu2c0x_set_scanline_callback( 0, multigam3_mmc3_scanline_cb );
354         ppu2c0x_set_scanline_callback( ppu, multigam3_mmc3_scanline_cb );
351355      break;
352356   }
353357}
r4499r4500
377381{
378382   if ( multigam_game_gfx_bank & 0x80 )
379383   {
380      ppu2c0x_set_videorom_bank( 0, 0, 8, (multigam_game_gfx_bank & 0xfc)  + (data & 0x3), 512 );
384      const device_config *ppu = devtag_get_device(space->machine, "ppu");
385      ppu2c0x_set_videorom_bank( ppu, 0, 8, (multigam_game_gfx_bank & 0xfc)  + (data & 0x3), 512 );
381386   }
382387   else
383388   {
r4499r4500
426431static ADDRESS_MAP_START( multigm3_map, ADDRESS_SPACE_PROGRAM, 8 )
427432   AM_RANGE(0x0000, 0x07ff) AM_RAM   /* NES RAM */
428433   AM_RANGE(0x0800, 0x0fff) AM_RAM /* additional RAM */
429   AM_RANGE(0x2000, 0x3fff) AM_READWRITE(ppu2c0x_0_r, ppu2c0x_0_w)
434   AM_RANGE(0x2000, 0x3fff) AM_DEVREADWRITE("ppu", ppu2c0x_r, ppu2c0x_w)
430435   AM_RANGE(0x4000, 0x4013) AM_DEVREADWRITE("nes", nes_psg_r, nes_psg_w)         /* PSG primary registers */
431436   AM_RANGE(0x4014, 0x4014) AM_WRITE(sprite_dma_w)
432437   AM_RANGE(0x4015, 0x4015) AM_DEVREADWRITE("nes", psg_4015_r, psg_4015_w)         /* PSG status / first control register */
r4499r4500
513518   ppu2c0x_init_palette(machine, 0 );
514519}
515520
516static void ppu_irq( running_machine *machine, int num, int *ppu_regs )
521static void ppu_irq( const device_config *device, int *ppu_regs )
517522{
518   cpu_set_input_line(machine->cpu[num], INPUT_LINE_NMI, PULSE_LINE );
523   cpu_set_input_line(device->machine->cpu[0], INPUT_LINE_NMI, PULSE_LINE );
519524}
520525
521526/* our ppu interface                                            */
522527static const ppu2c0x_interface ppu_interface =
523528{
524   PPU_2C04,            /* type */
525   1,                  /* num */
526   { "gfx1" },            /* vrom gfx region */
527   { 0 },               /* gfxlayout num */
528   { 0 },               /* color base */
529   { PPU_MIRROR_NONE },   /* mirroring */
530   { ppu_irq }            /* irq */
529   "gfx1",            /* vrom gfx region */
530   0,               /* gfxlayout num */
531   0,               /* color base */
532   PPU_MIRROR_NONE,   /* mirroring */
533   ppu_irq            /* irq */
531534};
532535
533536static VIDEO_START( multigam )
534537{
535   ppu2c0x_init(machine, &ppu_interface );
536538}
537539
538540static VIDEO_UPDATE( multigam )
539541{
540542   /* render the ppu */
541   ppu2c0x_render( 0, bitmap, 0, 0, 0, 0 );
543   ppu2c0x_render( devtag_get_device(screen->machine, "ppu"), bitmap, 0, 0, 0, 0 );
542544   return 0;
543545}
544546
r4499r4500
554556
555557static MACHINE_RESET( multigam )
556558{
557   /* reset the ppu */
558   ppu2c0x_reset( machine, 0, 1 );
559559}
560560
561561static MACHINE_RESET( multigm3 )
562562{
563563   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
564564   /* reset the ppu */
565   ppu2c0x_reset( machine, 0, 1 );
566565   multigm3_switch_prg_rom(space, 0, 0x01 );
567566};
568567
r4499r4500
588587   MDRV_VIDEO_START(multigam)
589588   MDRV_VIDEO_UPDATE(multigam)
590589
590   MDRV_PPU2C04_ADD("ppu", ppu_interface)
591
591592   /* sound hardware */
592593   MDRV_SPEAKER_STANDARD_MONO("mono")
593594
src/mame/drivers/taito_f3.c
r4499r4500
153153
154154/******************************************************************************/
155155
156static ADDRESS_MAP_START( f3_readmem, ADDRESS_SPACE_PROGRAM, 32 )
157   AM_RANGE(0x000000, 0x1fffff) AM_READ(SMH_ROM)
158     AM_RANGE(0x400000, 0x41ffff) AM_MIRROR(0x20000) AM_READ(SMH_RAM)
159   AM_RANGE(0x440000, 0x447fff) AM_READ(SMH_RAM) /* Palette ram */
160   AM_RANGE(0x4a0000, 0x4a0017) AM_READ(f3_control_r)
161   AM_RANGE(0x600000, 0x60ffff) AM_READ(SMH_RAM) /* Object data */
162   AM_RANGE(0x610000, 0x61bfff) AM_READ(SMH_RAM) /* Playfield data */
163   AM_RANGE(0x61c000, 0x61dfff) AM_READ(SMH_RAM) /* Text layer */
164   AM_RANGE(0x61e000, 0x61ffff) AM_READ(SMH_RAM) /* Vram */
165   AM_RANGE(0x620000, 0x62ffff) AM_READ(SMH_RAM) /* Line ram */
166   AM_RANGE(0x630000, 0x63ffff) AM_READ(SMH_RAM) /* Pivot ram */
167   AM_RANGE(0xc00000, 0xc007ff) AM_READ(SMH_RAM) /* Sound CPU shared ram */
168ADDRESS_MAP_END
169
170static ADDRESS_MAP_START( f3_writemem, ADDRESS_SPACE_PROGRAM, 32 )
171   AM_RANGE(0x000000, 0x1fffff) AM_WRITE(SMH_ROM)
156static ADDRESS_MAP_START( f3_map, ADDRESS_SPACE_PROGRAM, 32 )
157   AM_RANGE(0x000000, 0x1fffff) AM_ROM
172158   AM_RANGE(0x300000, 0x30007f) AM_WRITE(f3_sound_bankswitch_w)
173   AM_RANGE(0x400000, 0x41ffff) AM_MIRROR(0x20000) AM_WRITE(SMH_RAM) AM_BASE(&f3_ram)
174   AM_RANGE(0x440000, 0x447fff) AM_WRITE(f3_palette_24bit_w) AM_BASE(&paletteram32)
175   AM_RANGE(0x4a0000, 0x4a001f) AM_WRITE(f3_control_w)
176   AM_RANGE(0x600000, 0x60ffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram32) AM_SIZE(&spriteram_size)
177   AM_RANGE(0x610000, 0x61bfff) AM_WRITE(f3_pf_data_w) AM_BASE(&f3_pf_data)
178   AM_RANGE(0x61c000, 0x61dfff) AM_WRITE(f3_videoram_w) AM_BASE(&videoram32)
179   AM_RANGE(0x61e000, 0x61ffff) AM_WRITE(f3_vram_w) AM_BASE(&f3_vram)
180   AM_RANGE(0x620000, 0x62ffff) AM_WRITE(f3_lineram_w) AM_BASE(&f3_line_ram)
181   AM_RANGE(0x630000, 0x63ffff) AM_WRITE(f3_pivot_w) AM_BASE(&f3_pivot_ram)
159   AM_RANGE(0x400000, 0x41ffff) AM_MIRROR(0x20000) AM_RAM AM_BASE(&f3_ram)
160   AM_RANGE(0x440000, 0x447fff) AM_RAM_WRITE(f3_palette_24bit_w) AM_BASE(&paletteram32)
161   AM_RANGE(0x4a0000, 0x4a001f) AM_READWRITE(f3_control_r,  f3_control_w)
162   AM_RANGE(0x600000, 0x60ffff) AM_RAM AM_BASE(&spriteram32) AM_SIZE(&spriteram_size)
163   AM_RANGE(0x610000, 0x61bfff) AM_RAM_WRITE(f3_pf_data_w) AM_BASE(&f3_pf_data)
164   AM_RANGE(0x61c000, 0x61dfff) AM_RAM_WRITE(f3_videoram_w) AM_BASE(&videoram32)
165   AM_RANGE(0x61e000, 0x61ffff) AM_RAM_WRITE(f3_vram_w) AM_BASE(&f3_vram)
166   AM_RANGE(0x620000, 0x62ffff) AM_RAM_WRITE(f3_lineram_w) AM_BASE(&f3_line_ram)
167   AM_RANGE(0x630000, 0x63ffff) AM_RAM_WRITE(f3_pivot_w) AM_BASE(&f3_pivot_ram)
182168   AM_RANGE(0x660000, 0x66000f) AM_WRITE(f3_control_0_w)
183169   AM_RANGE(0x660010, 0x66001f) AM_WRITE(f3_control_1_w)
184   AM_RANGE(0xc00000, 0xc007ff) AM_WRITE(SMH_RAM) AM_BASE(&f3_shared_ram)
170   AM_RANGE(0xc00000, 0xc007ff) AM_RAM AM_BASE(&f3_shared_ram)
185171   AM_RANGE(0xc80000, 0xc80003) AM_WRITE(f3_sound_reset_0_w)
186172   AM_RANGE(0xc80100, 0xc80103) AM_WRITE(f3_sound_reset_1_w)
187173ADDRESS_MAP_END
r4499r4500
431417
432418   /* basic machine hardware */
433419   MDRV_CPU_ADD("maincpu", M68EC020, 16000000)
434   MDRV_CPU_PROGRAM_MAP(f3_readmem,f3_writemem)
420   MDRV_CPU_PROGRAM_MAP(f3_map,0)
435421   MDRV_CPU_VBLANK_INT("screen", f3_interrupt2)
436422
437423   TAITO_F3_SOUND_SYSTEM_CPU(16000000)
r4499r4500
516502static MACHINE_DRIVER_START( bubsympb )
517503   /* basic machine hardware */
518504   MDRV_CPU_ADD("maincpu", M68EC020, 16000000)
519   MDRV_CPU_PROGRAM_MAP(f3_readmem,f3_writemem)
505   MDRV_CPU_PROGRAM_MAP(f3_map,0)
520506   MDRV_CPU_VBLANK_INT("screen", f3_interrupt2)
521507
522508   MDRV_MACHINE_START(f3)
src/mame/drivers/ninjaw.c
r4499r4500
286286static ADDRESS_MAP_START( ninjaw_readmem, ADDRESS_SPACE_PROGRAM, 16 )
287287   AM_RANGE(0x000000, 0x0bffff) AM_READ(SMH_ROM)
288288   AM_RANGE(0x0c0000, 0x0cffff) AM_READ(SMH_RAM)   /* main ram */
289   AM_RANGE(0x200000, 0x200001) AM_READ(TC0220IOC_halfword_portreg_r)
290   AM_RANGE(0x200002, 0x200003) AM_READ(TC0220IOC_halfword_port_r)
289   AM_RANGE(0x200000, 0x200001) AM_READ8(TC0220IOC_portreg_r, 0x00ff)
290   AM_RANGE(0x200002, 0x200003) AM_READ8(TC0220IOC_port_r, 0x00ff)
291291   AM_RANGE(0x220000, 0x220003) AM_READ(ninjaw_sound_r)
292292   AM_RANGE(0x280000, 0x293fff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps (1st screen) */
293293   AM_RANGE(0x2a0000, 0x2a000f) AM_READ(TC0100SCN_ctrl_word_0_r)
r4499r4500
303303static ADDRESS_MAP_START( ninjaw_writemem, ADDRESS_SPACE_PROGRAM, 16 )
304304   AM_RANGE(0x000000, 0x0bffff) AM_WRITE(SMH_ROM)
305305   AM_RANGE(0x0c0000, 0x0cffff) AM_WRITE(SMH_RAM)
306   AM_RANGE(0x200000, 0x200001) AM_WRITE(TC0220IOC_halfword_portreg_w)
307   AM_RANGE(0x200002, 0x200003) AM_WRITE(TC0220IOC_halfword_port_w)
306   AM_RANGE(0x200000, 0x200001) AM_WRITE8(TC0220IOC_portreg_w, 0x00ff)
307   AM_RANGE(0x200002, 0x200003) AM_WRITE8(TC0220IOC_port_w, 0x00ff)
308308   AM_RANGE(0x210000, 0x210001) AM_WRITE(cpua_ctrl_w)
309309   AM_RANGE(0x220000, 0x220003) AM_WRITE(ninjaw_sound_w)
310310   AM_RANGE(0x240000, 0x24ffff) AM_RAM AM_SHARE(1)
r4499r4500
326326static ADDRESS_MAP_START( ninjaw_cpub_readmem, ADDRESS_SPACE_PROGRAM, 16 )
327327   AM_RANGE(0x000000, 0x05ffff) AM_READ(SMH_ROM)
328328   AM_RANGE(0x080000, 0x08ffff) AM_READ(SMH_RAM)   /* main ram */
329   AM_RANGE(0x200000, 0x200001) AM_READ(TC0220IOC_halfword_portreg_r)
330   AM_RANGE(0x200002, 0x200003) AM_READ(TC0220IOC_halfword_port_r)
329   AM_RANGE(0x200000, 0x200001) AM_READ8(TC0220IOC_portreg_r, 0x00ff)
330   AM_RANGE(0x200002, 0x200003) AM_READ8(TC0220IOC_port_r, 0x00ff)
331331   AM_RANGE(0x280000, 0x293fff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps (1st screen) */
332332   AM_RANGE(0x340000, 0x340007) AM_READ(TC0110PCR_word_r)      /* palette (1st screen) */
333333   AM_RANGE(0x350000, 0x350007) AM_READ(TC0110PCR_word_1_r)   /* palette (2nd screen) */
r4499r4500
337337static ADDRESS_MAP_START( ninjaw_cpub_writemem, ADDRESS_SPACE_PROGRAM, 16 )
338338   AM_RANGE(0x000000, 0x05ffff) AM_WRITE(SMH_ROM)
339339   AM_RANGE(0x080000, 0x08ffff) AM_WRITE(SMH_RAM)
340   AM_RANGE(0x200000, 0x200001) AM_WRITE(TC0220IOC_halfword_portreg_w)
341   AM_RANGE(0x200002, 0x200003) AM_WRITE(TC0220IOC_halfword_port_w)
340   AM_RANGE(0x200000, 0x200001) AM_WRITE8(TC0220IOC_portreg_w, 0x00ff)
341   AM_RANGE(0x200002, 0x200003) AM_WRITE8(TC0220IOC_port_w, 0x00ff)
342342   AM_RANGE(0x240000, 0x24ffff) AM_RAM AM_SHARE(1)
343343   AM_RANGE(0x260000, 0x263fff) AM_RAM AM_SHARE(2)
344344   AM_RANGE(0x280000, 0x293fff) AM_WRITE(TC0100SCN_triple_screen_w)   /* tilemaps (all screens) */
r4499r4500
351351static ADDRESS_MAP_START( darius2_readmem, ADDRESS_SPACE_PROGRAM, 16 )
352352   AM_RANGE(0x000000, 0x0bffff) AM_READ(SMH_ROM)
353353   AM_RANGE(0x0c0000, 0x0cffff) AM_READ(SMH_RAM)   /* main ram */
354   AM_RANGE(0x200000, 0x200001) AM_READ(TC0220IOC_halfword_portreg_r)
355   AM_RANGE(0x200002, 0x200003) AM_READ(TC0220IOC_halfword_port_r)
354   AM_RANGE(0x200000, 0x200001) AM_READ8(TC0220IOC_portreg_r, 0x00ff)
355   AM_RANGE(0x200002, 0x200003) AM_READ8(TC0220IOC_port_r, 0x00ff)
356356   AM_RANGE(0x220000, 0x220003) AM_READ(ninjaw_sound_r)
357357   AM_RANGE(0x280000, 0x293fff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps (1st screen) */
358358   AM_RANGE(0x2a0000, 0x2a000f) AM_READ(TC0100SCN_ctrl_word_0_r)
r4499r4500
368368static ADDRESS_MAP_START( darius2_writemem, ADDRESS_SPACE_PROGRAM, 16 )
369369   AM_RANGE(0x000000, 0x0bffff) AM_WRITE(SMH_ROM)
370370   AM_RANGE(0x0c0000, 0x0cffff) AM_WRITE(SMH_RAM)
371   AM_RANGE(0x200000, 0x200001) AM_WRITE(TC0220IOC_halfword_portreg_w)
372   AM_RANGE(0x200002, 0x200003) AM_WRITE(TC0220IOC_halfword_port_w)
371   AM_RANGE(0x200000, 0x200001) AM_WRITE8(TC0220IOC_portreg_w, 0x00ff)
372   AM_RANGE(0x200002, 0x200003) AM_WRITE8(TC0220IOC_port_w, 0x00ff)
373373   AM_RANGE(0x210000, 0x210001) AM_WRITE(cpua_ctrl_w)
374374   AM_RANGE(0x220000, 0x220003) AM_WRITE(ninjaw_sound_w)
375375   AM_RANGE(0x240000, 0x24ffff) AM_RAM AM_SHARE(1)
r4499r4500
388388static ADDRESS_MAP_START( darius2_cpub_readmem, ADDRESS_SPACE_PROGRAM, 16 )
389389   AM_RANGE(0x000000, 0x05ffff) AM_READ(SMH_ROM)
390390   AM_RANGE(0x080000, 0x08ffff) AM_READ(SMH_RAM)   /* main ram */
391   AM_RANGE(0x200000, 0x200001) AM_READ(TC0220IOC_halfword_portreg_r)
392   AM_RANGE(0x200002, 0x200003) AM_READ(TC0220IOC_halfword_port_r)
391   AM_RANGE(0x200000, 0x200001) AM_READ8(TC0220IOC_portreg_r, 0x00ff)
392   AM_RANGE(0x200002, 0x200003) AM_READ8(TC0220IOC_port_r, 0x00ff)
393393   AM_RANGE(0x280000, 0x293fff) AM_READ(TC0100SCN_word_0_r)   /* tilemaps (1st screen) */
394394ADDRESS_MAP_END
395395
396396static ADDRESS_MAP_START( darius2_cpub_writemem, ADDRESS_SPACE_PROGRAM, 16 )
397397   AM_RANGE(0x000000, 0x05ffff) AM_WRITE(SMH_ROM)
398398   AM_RANGE(0x080000, 0x08ffff) AM_WRITE(SMH_RAM)
399   AM_RANGE(0x200000, 0x200001) AM_WRITE(TC0220IOC_halfword_portreg_w)
400   AM_RANGE(0x200002, 0x200003) AM_WRITE(TC0220IOC_halfword_port_w)
399   AM_RANGE(0x200000, 0x200001) AM_WRITE8(TC0220IOC_portreg_w, 0x00ff)
400   AM_RANGE(0x200002, 0x200003) AM_WRITE8(TC0220IOC_port_w, 0x00ff)
401401   AM_RANGE(0x240000, 0x24ffff) AM_RAM AM_SHARE(1)
402402   AM_RANGE(0x260000, 0x263fff) AM_RAM AM_SHARE(2)
403403   AM_RANGE(0x280000, 0x293fff) AM_WRITE(TC0100SCN_triple_screen_w)   /* tilemaps (all screens) */
src/mame/drivers/cham24.c
r4499r4500
6363static WRITE8_HANDLER( sprite_dma_w )
6464{
6565   int source = ( data & 7 );
66   ppu2c0x_spriteram_dma( space, 0, source );
66   ppu2c0x_spriteram_dma( space, devtag_get_device(space->machine, "ppu"), source );
6767}
6868
6969static READ8_DEVICE_HANDLER( psg_4015_r )
r4499r4500
123123   UINT32 prg_bank = (offset >> 7) & 0x1f;
124124   UINT32 prg_bank_page_size = (offset >> 12) & 0x01;
125125   UINT32 gfx_mirroring = (offset >> 13) & 0x01;
126   const device_config *ppu = devtag_get_device(space->machine, "ppu");
126127
127128   UINT8* dst = memory_region( space->machine, "maincpu" );
128129   UINT8* src = memory_region( space->machine, "user1" );
129130
130131   // switch PPU VROM bank
131   ppu2c0x_set_videorom_bank( 0, 0, 8, gfx_bank, 512 );
132   ppu2c0x_set_videorom_bank( ppu, 0, 8, gfx_bank, 512 );
132133
133134   // set gfx mirroring
134   ppu2c0x_set_mirroring( 0, gfx_mirroring != 0 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
135   ppu2c0x_set_mirroring( ppu, gfx_mirroring != 0 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
135136
136137   // switch PRG bank
137138   if ( prg_bank_page_size == 0 )
r4499r4500
158159
159160static ADDRESS_MAP_START( cham24_map, ADDRESS_SPACE_PROGRAM, 8 )
160161   AM_RANGE(0x0000, 0x07ff) AM_RAM   /* NES RAM */
161   AM_RANGE(0x2000, 0x3fff) AM_READWRITE(ppu2c0x_0_r, ppu2c0x_0_w)
162   AM_RANGE(0x2000, 0x3fff) AM_DEVREADWRITE("ppu", ppu2c0x_r, ppu2c0x_w)
162163   AM_RANGE(0x4000, 0x4013) AM_DEVREADWRITE("nes", nes_psg_r, nes_psg_w)         /* PSG primary registers */
163164   AM_RANGE(0x4014, 0x4014) AM_WRITE(sprite_dma_w)
164165   AM_RANGE(0x4015, 0x4015) AM_DEVREADWRITE("nes", psg_4015_r, psg_4015_w)         /* PSG status / first control register */
r4499r4500
203204
204205   memcpy( &dst[0x8000], &src[0x0f8000], 0x4000 );
205206   memcpy( &dst[0xc000], &src[0x0f8000], 0x4000 );
206   device_reset(machine->cpu[0]);
207
208   /* reset the ppu */
209   ppu2c0x_reset( machine, 0, 1 );
210207}
211208
212209static PALETTE_INIT( cham24 )
r4499r4500
214211   ppu2c0x_init_palette(machine, 0 );
215212}
216213
217static void ppu_irq( running_machine *machine, int num, int *ppu_regs )
214static void ppu_irq( const device_config *device, int *ppu_regs )
218215{
219   cpu_set_input_line(machine->cpu[num], INPUT_LINE_NMI, PULSE_LINE );
216   cpu_set_input_line(device->machine->cpu[0], INPUT_LINE_NMI, PULSE_LINE );
220217}
221218
222219/* our ppu interface                                            */
223220static const ppu2c0x_interface ppu_interface =
224221{
225   PPU_2C04,            /* type */
226   1,                  /* num */
227   { "gfx1" },            /* vrom gfx region */
228   { 0 },               /* gfxlayout num */
229   { 0 },               /* color base */
230   { PPU_MIRROR_NONE },   /* mirroring */
231   { ppu_irq }            /* irq */
222   "gfx1",            /* vrom gfx region */
223   0,               /* gfxlayout num */
224   0,               /* color base */
225   PPU_MIRROR_NONE,   /* mirroring */
226   ppu_irq            /* irq */
232227};
233228
234229static VIDEO_START( cham24 )
235230{
236   ppu2c0x_init(machine, &ppu_interface );
237231}
238232
239233static VIDEO_UPDATE( cham24 )
240234{
241235   /* render the ppu */
242   ppu2c0x_render( 0, bitmap, 0, 0, 0, 0 );
236   ppu2c0x_render( devtag_get_device(screen->machine, "ppu"), bitmap, 0, 0, 0, 0 );
243237   return 0;
244238}
245239
r4499r4500
272266   MDRV_VIDEO_START(cham24)
273267   MDRV_VIDEO_UPDATE(cham24)
274268
269   MDRV_PPU2C04_ADD("ppu", ppu_interface)
270
275271   /* sound hardware */
276272   MDRV_SPEAKER_STANDARD_MONO("mono")
277273
src/mame/drivers/dec8.c
r4499r4500
7979
8080static READ8_HANDLER( gondo_player_1_r )
8181{
82   int val = 1 << input_port_read(space->machine, "AN0");
83
8284   switch (offset) {
8385      case 0: /* Rotary low byte */
84         return ~((1 << (input_port_read(space->machine, "AN0") * 12 / 256))&0xff);
86         return ~(val & 0xff);
8587      case 1: /* Joystick = bottom 4 bits, rotary = top 4 */
86         return ((~((1 << (input_port_read(space->machine, "AN0") * 12 / 256))>>4))&0xf0) | (input_port_read(space->machine, "IN0") & 0xf);
88         return ((~val >> 4) & 0xf0) | (input_port_read(space->machine, "IN0") & 0xf);
8789   }
8890   return 0xff;
8991}
9092
9193static READ8_HANDLER( gondo_player_2_r )
9294{
95   int val = 1 << input_port_read(space->machine, "AN1");
96
9397   switch (offset) {
9498      case 0: /* Rotary low byte */
95         return ~((1 << (input_port_read(space->machine, "AN1") * 12 / 256))&0xff);
99         return ~(val & 0xff);
96100      case 1: /* Joystick = bottom 4 bits, rotary = top 4 */
97         return ((~((1 << (input_port_read(space->machine, "AN1") * 12 / 256))>>4))&0xf0) | (input_port_read(space->machine, "IN1") & 0xf);
101         return ((~val >> 4) & 0xf0) | (input_port_read(space->machine, "IN1") & 0xf);
98102   }
99103   return 0xff;
100104}
r4499r4500
12531257   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
12541258
12551259   PORT_START("AN0")   /* player 1 12-way rotary control */
1256   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE
1260   PORT_BIT( 0x0f, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE PORT_FULL_TURN_COUNT(12)
12571261
12581262   PORT_START("AN1")   /* player 2 12-way rotary control */
1259   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_REVERSE PORT_PLAYER(2)
1263   PORT_BIT( 0x0f, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_PLAYER(2) PORT_REVERSE PORT_FULL_TURN_COUNT(12)
12601264
12611265   PORT_START("DSW0")
12621266   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
src/mame/drivers/atarigt.c
r4499r4500
987987   ROM_LOAD32_BYTE( "0041b", 0x00003, 0x20000, CRC(b71ec759) SHA1(d4bed4bbab2c3bd278da4cd0f53580d7f66d8152) )
988988
989989   ROM_REGION32_LE( 0x200000, "cageboot", 0 )   /* TMS320C31 boot ROM */
990   ROM_LOAD32_BYTE( "0078a", 0x000000, 0x080000, NO_DUMP CRC(a952771c) SHA1(49982ea864a99c07f45886ada7e2c9427a75f775) )
990   ROM_LOAD32_BYTE( "0078a", 0x000000, 0x080000, CRC(314d736f) SHA1(b23946fde6ea47d6a6e3430a9df4b06d453a94c8) )
991991
992992   ROM_REGION32_LE( 0x1000000, "cage", 0 )   /* TMS320C31 sound ROMs */
993993   ROM_LOAD32_WORD( "0077",  0x400000, 0x200000, CRC(8f650f8b) SHA1(e3b48ff4e2093d709134b6bf62cecd101ab5cef4) )
r4499r4500
10421042   ROM_LOAD32_BYTE( "pgm3", 0x00003, 0x20000, CRC(28b0e210) SHA1(7567671beecc7d30e9d4b61cf7d3448bb1dbb072) )
10431043
10441044   ROM_REGION32_LE( 0x200000, "cageboot", 0 )   /* TMS320C31 boot ROM */
1045   ROM_LOAD32_BYTE( "0078a", 0x000000, 0x080000, NO_DUMP CRC(a952771c) SHA1(49982ea864a99c07f45886ada7e2c9427a75f775) )
1045   ROM_LOAD32_BYTE( "0078", 0x000000, 0x080000, NO_DUMP CRC(314d736f) SHA1(b23946fde6ea47d6a6e3430a9df4b06d453a94c8) )
10461046
10471047   ROM_REGION32_LE( 0x1000000, "cage", 0 )   /* TMS320C31 sound ROMs */
10481048   ROM_LOAD32_WORD( "0077",  0x400000, 0x200000, CRC(8f650f8b) SHA1(e3b48ff4e2093d709134b6bf62cecd101ab5cef4) )
src/mame/drivers/asuka.c
r4499r4500
350350   AM_RANGE(0x3a0000, 0x3a0003) AM_WRITE(asuka_spritectrl_w)
351351   AM_RANGE(0x3e0000, 0x3e0001) AM_READNOP AM_WRITE8(taitosound_port_w, 0x00ff)
352352   AM_RANGE(0x3e0002, 0x3e0003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0x00ff)
353   AM_RANGE(0x400000, 0x40000f) AM_READWRITE(TC0220IOC_halfword_r, TC0220IOC_halfword_w)
353   AM_RANGE(0x400000, 0x40000f) AM_READWRITE8(TC0220IOC_r, TC0220IOC_w, 0x00ff)
354354   AM_RANGE(0xc00000, 0xc0ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
355355   AM_RANGE(0xc10000, 0xc103ff) AM_WRITENOP   /* error in Asuka init code */
356356   AM_RANGE(0xc20000, 0xc2000f) AM_READWRITE(TC0100SCN_ctrl_word_0_r, TC0100SCN_ctrl_word_0_w)
r4499r4500
364364   AM_RANGE(0x0c0002, 0x0c0003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0x00ff)
365365   AM_RANGE(0x100000, 0x107fff) AM_RAM
366366   AM_RANGE(0x800000, 0x800fff) AM_RAM   /* network ram */
367   AM_RANGE(0x900000, 0x90000f) AM_READWRITE(TC0220IOC_halfword_r, TC0220IOC_halfword_w)
367   AM_RANGE(0x900000, 0x90000f) AM_READWRITE8(TC0220IOC_r, TC0220IOC_w, 0x00ff)
368368   AM_RANGE(0xa00000, 0xa0000f) AM_READWRITE(TC0110PCR_word_r, TC0110PCR_step1_4bpg_word_w)
369369   AM_RANGE(0xb00000, 0xb03fff) AM_READWRITE(PC090OJ_word_0_r, PC090OJ_word_0_w)   /* sprite ram */
370370   AM_RANGE(0xc00000, 0xc0ffff) AM_READWRITE(TC0100SCN_word_0_r, TC0100SCN_word_0_w)   /* tilemaps */
r4499r4500
375375   AM_RANGE(0x000000, 0x0fffff) AM_ROM
376376   AM_RANGE(0x100000, 0x10000f) AM_READWRITE(TC0110PCR_word_r, TC0110PCR_step1_word_w)
377377   AM_RANGE(0x200000, 0x203fff) AM_RAM
378   AM_RANGE(0x300000, 0x30000f) AM_READWRITE(TC0220IOC_halfword_r, TC0220IOC_halfword_w)
379   AM_RANGE(0x400000, 0x40000f) AM_READ(TC0220IOC_halfword_r)   /* service mode mirror */
378   AM_RANGE(0x300000, 0x30000f) AM_READWRITE8(TC0220IOC_r, TC0220IOC_w, 0x00ff)
379   AM_RANGE(0x400000, 0x40000f) AM_READ8(TC0220IOC_r, 0x00ff)   /* service mode mirror */
380380   AM_RANGE(0x4a0000, 0x4a0003) AM_WRITE(asuka_spritectrl_w)
381381   AM_RANGE(0x4e0000, 0x4e0001) AM_READNOP AM_WRITE8(taitosound_port_w, 0x00ff)
382382   AM_RANGE(0x4e0002, 0x4e0003) AM_READWRITE8(taitosound_comm_r, taitosound_comm_w, 0x00ff)
src/emu/debug/debugvw.c
r4499r4500
12351235   maxvallen = MAX(maxvallen, regdata->reg[view->total.y].vallen);
12361236   view->total.y++;
12371237
1238   /* add a flags entry: flags:xxxxxxxx */
1238   /* add a beam entry: frame:123456 */
12391239   regdata->reg[view->total.y].lastval  =
12401240   regdata->reg[view->total.y].currval  = 0;
12411241   regdata->reg[view->total.y].regnum   = MAX_REGS + 4;
12421242   regdata->reg[view->total.y].tagstart = 0;
12431243   regdata->reg[view->total.y].taglen   = 5;
12441244   regdata->reg[view->total.y].valstart = 6;
1245   regdata->reg[view->total.y].vallen   = 6;
1246   maxtaglen = MAX(maxtaglen, regdata->reg[view->total.y].taglen);
1247   maxvallen = MAX(maxvallen, regdata->reg[view->total.y].vallen);
1248   view->total.y++;
1249
1250   /* add a flags entry: flags:xxxxxxxx */
1251   regdata->reg[view->total.y].lastval  =
1252   regdata->reg[view->total.y].currval  = 0;
1253   regdata->reg[view->total.y].regnum   = MAX_REGS + 5;
1254   regdata->reg[view->total.y].tagstart = 0;
1255   regdata->reg[view->total.y].taglen   = 5;
1256   regdata->reg[view->total.y].valstart = 6;
12451257   regdata->reg[view->total.y].vallen   = (UINT32)strlen(cpu_get_flags_string(regdata->device));
12461258   maxtaglen = MAX(maxtaglen, regdata->reg[view->total.y].taglen);
12471259   maxvallen = MAX(maxvallen, regdata->reg[view->total.y].vallen);
r4499r4500
13551367                  break;
13561368
13571369               case MAX_REGS + 4:
1370                  sprintf(dummy, "frame:%-6d", (UINT32)video_screen_get_frame_number(screen));
1371                  break;
1372
1373               case MAX_REGS + 5:
13581374                  sprintf(dummy, "flags:%s", cpu_get_flags_string(regdata->device));
13591375                  break;
13601376            }
src/emu/cpu/tms32031/tms32031.c
r4499r4500
127127   assert(device != NULL);
128128   assert(device->token != NULL);
129129   assert(device->type == CPU);
130   assert(cpu_get_type(device) == CPU_TMS32031);
130   assert(cpu_get_type(device) == CPU_TMS32031 ||
131         cpu_get_type(device) == CPU_TMS32032);
131132   return (tms32031_state *)device->token;
132133}
133134
src/emu/cpu/mips/psx.c
r4499r4500
198198   assert(device != NULL);
199199   assert(device->token != NULL);
200200   assert(device->type == CPU);
201   assert(cpu_get_type(device) == CPU_PSXCPU);
201   assert(cpu_get_type(device) == CPU_PSXCPU ||
202         cpu_get_type(device) == CPU_CXD8661R);
202203   return (psxcpu_state *)device->token;
203204}
204205
src/emu/uimenu.c
r4499r4500
163163   int               type;
164164   int               min, max;
165165   int               cur;
166   int             defvalue;
166167};
167168
168169
r4499r4500
189190typedef struct _input_menu_state input_menu_state;
190191struct _input_menu_state
191192{
192   const void *      lastref;
193   UINT16             last_sortorder;
193194   const void *      pollingref;
194195   input_item_data *   pollingitem;
195196   UINT8            record_next;
r4499r4500
17781779         /* an item was selected: begin polling */
17791780         case IPT_UI_SELECT:
17801781            menustate->pollingitem = item;
1781            menustate->lastref = item->ref;
1782            menustate->last_sortorder = item->sortorder;
17821783            menustate->starting_seq = item->seq;
17831784            input_seq_poll_start((item->type == INPUT_TYPE_ANALOG) ? ITEM_CLASS_ABSOLUTE : ITEM_CLASS_SWITCH, menustate->record_next ? &item->seq : NULL);
17841785            invalidate = TRUE;
r4499r4500
17931794      }
17941795
17951796      /* if the selection changed, reset the "record next" flag */
1796      if (item->ref != menustate->lastref)
1797      if (item->sortorder != menustate->last_sortorder)
17971798         menustate->record_next = FALSE;
1798      menustate->lastref = item->ref;
1799      menustate->last_sortorder = item->sortorder;
17991800   }
18001801
18011802   /* if the sequence changed, update it */
r4499r4500
22222223      {
22232224         /* if selected, reset to default value */
22242225         case IPT_UI_SELECT:
2225            newval = data->field->defvalue;
2226            newval = data->defvalue;
22262227            break;
22272228
22282229         /* left decrements */
r4499r4500
23312332                        data->min = 0;
23322333                        data->max = 255;
23332334                        data->cur = settings.delta;
2335                        data->defvalue = field->delta;
23342336                        break;
23352337
23362338                     case ANALOG_ITEM_CENTERSPEED:
r4499r4500
23392341                        data->min = 0;
23402342                        data->max = 255;
23412343                        data->cur = settings.centerdelta;
2344                        data->defvalue = field->centerdelta;
23422345                        break;
23432346
23442347                     case ANALOG_ITEM_REVERSE:
r4499r4500
23472350                        data->min = 0;
23482351                        data->max = 1;
23492352                        data->cur = settings.reverse;
2353                        data->defvalue = ((field->flags & ANALOG_FLAG_REVERSE) != 0);
23502354                        break;
23512355
23522356                     case ANALOG_ITEM_SENSITIVITY:
r4499r4500
23552359                        data->min = 1;
23562360                        data->max = 255;
23572361                        data->cur = settings.sensitivity;
2362                        data->defvalue = field->sensitivity;
23582363                        break;
23592364                  }
23602365
r4499r4500
32413246
32423247               /* look for files ending in .png with a name not larger then 9 chars*/
32433248               if ((length > 4) && (length <= CROSSHAIR_PIC_NAME_LENGTH + 4) &&
3244                  tolower(dir->name[length - 4] == '.') &&
3245                  tolower(dir->name[length - 3] == 'p') &&
3246                  tolower(dir->name[length - 2] == 'n') &&
3247                  tolower(dir->name[length - 1] == 'g'))
3249                  dir->name[length - 4] == '.' &&
3250                  tolower(dir->name[length - 3]) == 'p' &&
3251                  tolower(dir->name[length - 2]) == 'n' &&
3252                  tolower(dir->name[length - 1]) == 'g')
32483253
32493254               {
32503255                  /* remove .png from length */
src/emu/audit.c
r4499r4500
2222    FUNCTION PROTOTYPES
2323***************************************************************************/
2424
25static int audit_one_rom(core_options *options, const rom_entry *rom, const char *regiontag, const game_driver *gamedrv, UINT32 validation, audit_record *record);
26static int audit_one_disk(core_options *options, const rom_entry *rom, const game_driver *gamedrv, UINT32 validation, audit_record *record);
25static void audit_one_rom(core_options *options, const rom_entry *rom, const char *regiontag, const game_driver *gamedrv, UINT32 validation, audit_record *record);
26static void audit_one_disk(core_options *options, const rom_entry *rom, const game_driver *gamedrv, UINT32 validation, audit_record *record);
2727static int rom_used_by_parent(const game_driver *gamedrv, const rom_entry *romentry, const game_driver **parent);
2828
2929
r4499r4500
6060   const rom_entry *region, *rom;
6161   const rom_source *source;
6262   audit_record *record;
63   int foundany = FALSE;
63   int anyfound = FALSE;
64   int anyrequired = FALSE;
6465   int allshared = TRUE;
6566   int records;
6667
r4499r4500
7374         for (rom = rom_first_file(region); rom != NULL; rom = rom_next_file(rom))
7475            if (ROMREGION_ISROMDATA(region) || ROMREGION_ISDISKDATA(region))
7576            {
76               if (source_is_gamedrv && allshared && !rom_used_by_parent(gamedrv, rom, NULL))
77                  allshared = FALSE;
77               if (source_is_gamedrv && !ROM_ISOPTIONAL(rom) && !ROM_NOGOODDUMP(rom))
78               {
79                  anyrequired = TRUE;
80
81                  if (allshared && !rom_used_by_parent(gamedrv, rom, NULL))
82                     allshared = FALSE;
83               }
7884               records++;
7985            }
8086   }
r4499r4500
95101            const char *regiontag = ROMREGION_ISLOADBYNAME(region) ? ROM_GETNAME(region) : NULL;
96102            for (rom = rom_first_file(region); rom; rom = rom_next_file(rom))
97103            {
98               int shared = rom_used_by_parent(gamedrv, rom, NULL);
99
100104               /* audit a file */
101105               if (ROMREGION_ISROMDATA(region))
102106               {
103                  if (audit_one_rom(options, rom, regiontag, gamedrv, validation, record++) && source_is_gamedrv && (!shared || allshared))
104                     foundany = TRUE;
107                  audit_one_rom(options, rom, regiontag, gamedrv, validation, record);
105108               }
106109
107110               /* audit a disk */
108111               else if (ROMREGION_ISDISKDATA(region))
109112               {
110                  if (audit_one_disk(options, rom, gamedrv, validation, record++) && source_is_gamedrv && (!shared || allshared))
111                     foundany = TRUE;
113                  audit_one_disk(options, rom, gamedrv, validation, record);
112114               }
115
116               else
117               {
118                  continue;
119               }
120
121               if (source_is_gamedrv && record->status != AUDIT_STATUS_NOT_FOUND && (allshared || !rom_used_by_parent(gamedrv, rom, NULL)))
122                  anyfound = TRUE;
123
124               record++;
113125            }
114126         }
115
116         /* if we found nothing, we don't have the set at all */
117         if (rom_source_is_gamedrv(gamedrv, source) && !foundany)
118         {
119            free(*audit);
120            *audit = NULL;
121            records = 0;
122            break;
123         }
124127      }
125128   }
126129
130   /* if we found nothing, we don't have the set at all */
131   if (!anyfound && anyrequired)
132   {
133      free(*audit);
134      *audit = NULL;
135      records = 0;
136   }
137
127138   machine_config_free(config);
128139   return records;
129140}
r4499r4500
227238int audit_summary(const game_driver *gamedrv, int count, const audit_record *records, int output)
228239{
229240   int overall_status = CORRECT;
230   int notfound = 0;
231241   int recnum;
232242
233   /* no count AND no records means not found, no count only means no ROMs required (= correct) */
243   /* no count AND no records means not found */
234244   if (count == 0 && records == NULL)
235245      return NOTFOUND;
236        else if (count == 0)
237      return CORRECT;
238246
239247   /* loop over records */
240248   for (recnum = 0; recnum < count; recnum++)
r4499r4500
246254      if (record->substatus == SUBSTATUS_GOOD)
247255         continue;
248256
249      /* count the number of missing items */
250      if (record->status == AUDIT_STATUS_NOT_FOUND)
251         notfound++;
252
253257      /* output the game name, file name, and length (if applicable) */
254258      if (output)
255259      {
r4499r4500
316320      overall_status = MAX(overall_status, best_new_status);
317321   }
318322
319   return (notfound == count) ? NOTFOUND : overall_status;
323   return overall_status;
320324}
321325
322326
r4499r4500
329333    audit_one_rom - validate a single ROM entry
330334-------------------------------------------------*/
331335
332static int audit_one_rom(core_options *options, const rom_entry *rom, const char *regiontag, const game_driver *gamedrv, UINT32 validation, audit_record *record)
336static void audit_one_rom(core_options *options, const rom_entry *rom, const char *regiontag, const game_driver *gamedrv, UINT32 validation, audit_record *record)
333337{
334338   const game_driver *drv;
335339   UINT32 crc = 0;
r4499r4500
442446      else
443447         set_status(record, AUDIT_STATUS_GOOD, SUBSTATUS_GOOD);
444448   }
445
446   /* return TRUE if we found anything at all */
447   return (drv != NULL);
448449}
449450
450451
r4499r4500
452453    audit_one_disk - validate a single disk entry
453454-------------------------------------------------*/
454455
455static int audit_one_disk(core_options *options, const rom_entry *rom, const game_driver *gamedrv, UINT32 validation, audit_record *record)
456static void audit_one_disk(core_options *options, const rom_entry *rom, const game_driver *gamedrv, UINT32 validation, audit_record *record)
456457{
457458   mame_file *source_file;
458459   chd_file *source;
r4499r4500
517518      chd_close(source);
518519      mame_fclose(source_file);
519520   }
520
521   /* return TRUE if we found anything at all */
522   return (source != NULL);
523521}
524522
525523
src/emu/inptport.c
r4499r4500
108108#endif /* MESS */
109109
110110
111/* temporary: set this to 1 to enable the originally defined behavior that
112   a field specified via PORT_MODIFY which intersects a previously-defined
113   field completely wipes out the previous definition */
114#define INPUT_PORT_OVERRIDE_FULLY_NUKES_PREVIOUS   1
115
116
111117/***************************************************************************
112118    CONSTANTS
113119***************************************************************************/
r4499r4500
22192225   if (analog->autocenter)
22202226   {
22212227      INT32 center = APPLY_INVERSE_SENSITIVITY(analog->center, analog->sensitivity);
2222      if (!analog->lastdigital && !keypressed)
2228      if (analog->lastdigital && !keypressed)
22232229      {
22242230         /* autocenter from positive values */
22252231         if (analog->accum >= center)
r4499r4500
22442250         }
22452251      }
22462252   }
2247
2248   if (!keypressed)
2253   else if (!keypressed)
22492254      analog->lastdigital = FALSE;
22502255}
22512256
r4499r4500
30663071         config->mask &= ~field->mask;
30673072
30683073         /* if the new entry fully overrides the previous one, we nuke */
3069         if (config->mask == 0)
3074         if (INPUT_PORT_OVERRIDE_FULLY_NUKES_PREVIOUS || config->mask == 0)
30703075         {
30713076            field_config_free((input_field_config **)scanfieldptr);
30723077            scanfieldnextptr = scanfieldptr;
src/emu/crsshair.c
r4499r4500
467467   {
468468      auto_time = xml_get_attribute_int(crosshairnode, "val", CROSSHAIR_VISIBILITY_AUTOTIME_DEFAULT);
469469      if ((auto_time >= CROSSHAIR_VISIBILITY_AUTOTIME_MIN) && (auto_time <= CROSSHAIR_VISIBILITY_AUTOTIME_MAX))
470            global.auto_time = (UINT8)auto_time;
470         global.auto_time = (UINT8)auto_time;
471471   }
472472}
473473
src/mess/includes/nes.h
r4499r4500
1010#define NES_H_
1111
1212
13/***************************************************************************
14    CONSTANTS
15***************************************************************************/
16
1317#define NTSC_CLOCK      N2A03_DEFAULTCLOCK   /* 1.789772 MHz */
1418#define PAL_CLOCK      (26601712.0/16)      /* 1.662607 MHz */
1519
1620
21/***************************************************************************
22    TYPE DEFINITIONS
23***************************************************************************/
24
25typedef struct _nes_state nes_state;
26struct _nes_state
27{
28   const device_config *ppu;
29   const device_config *sound;
30   const device_config *cart;
31};
32
33
1734/*----------- defined in machine/nes.c -----------*/
1835
1936void ppu_mirror_custom (int page, int address);
src/mess/messdriv.c
r4499r4500
6262//   DRIVER( falcon40 )   /* Atari Falcon040 (prototype)                  */
6363
6464   /* NINTENDO */
65   DRIVER( nes )      /* Nintendo Entertainment System               */
66   DRIVER( nespal )   /* Nintendo Entertainment System               */
67   DRIVER( famicom )
68   DRIVER( famitwin )   /* Sharp Famicom Twin System                  */
69   DRIVER( gameboy )   /* Nintendo Game Boy Handheld                  */
70   DRIVER( supergb )   /* Nintendo Super Game Boy SNES Cartridge         */
71   DRIVER( gbpocket )   /* Nintendo Game Boy Pocket Handheld            */
72   DRIVER( gbcolor )   /* Nintendo Game Boy Color Handheld               */
73   DRIVER( snes )      /* Nintendo Super Nintendo NTSC                  */
74   DRIVER( snespal )   /* Nintendo Super Nintendo PAL                  */
75   DRIVER( n64 )      /* Nintendo N64                              */
76   DRIVER( pokemini )   /* Nintendo Pokemon Mini                     */
65//0130u4   DRIVER( nes )      /* Nintendo Entertainment System               */
66//0130u4   DRIVER( nespal )   /* Nintendo Entertainment System               */
67//0130u4   DRIVER( famicom )
68//0130u4   DRIVER( famitwin )   /* Sharp Famicom Twin System                  */
69//0130u4   DRIVER( gameboy )   /* Nintendo Game Boy Handheld                  */
70//0130u4   DRIVER( supergb )   /* Nintendo Super Game Boy SNES Cartridge         */
71//0130u4   DRIVER( gbpocket )   /* Nintendo Game Boy Pocket Handheld            */
72//0130u4   DRIVER( gbcolor )   /* Nintendo Game Boy Color Handheld               */
73//0130u4   DRIVER( snes )      /* Nintendo Super Nintendo NTSC                  */
74//0130u4   DRIVER( snespal )   /* Nintendo Super Nintendo PAL                  */
75//0130u4   DRIVER( n64 )      /* Nintendo N64                              */
76//0130u4   DRIVER( pokemini )   /* Nintendo Pokemon Mini                     */
7777
78   DRIVER( megaduck )   /* Megaduck                                 */
78//0130u4   DRIVER( megaduck )   /* Megaduck                                 */
7979
8080   /* SEGA */
8181   DRIVER( sg1000 )   /* Sega SG-1000 (Japan)                        */
src/mess/machine/nes.c
r4499r4500
6666
6767static const device_config *cartslot_image(running_machine *machine)
6868{
69   return devtag_get_device(machine, "cart");
69   nes_state *state = machine->driver_data;
70   return state->cart;
7071}
7172
7273static void init_nes_core (running_machine *machine)
7374{
75   nes_state *state = machine->driver_data;
7476   const address_space *space = cpu_get_address_space( machine->cpu[0], ADDRESS_SPACE_PROGRAM );
7577
78   state->ppu = devtag_get_device(machine, "ppu");
79   state->sound = devtag_get_device(machine, "nessound");
80   state->cart = devtag_get_device(machine, "cart");
81
7682   /* We set these here in case they weren't set in the cart loader */
7783   nes.rom = memory_region(machine, "maincpu");
7884   nes.vrom = memory_region(machine, "gfx1");
src/mess/machine/nes_mmc.c
r4499r4500
265265   }
266266}
267267
268static void chr8 (int bank)
268static void chr8 (running_machine *machine, int bank)
269269{
270   nes_state *state = machine->driver_data;
270271   bank &= (nes.chr_chunks - 1);
271   ppu2c0x_set_videorom_bank(0, 0, 8, bank, 512);
272   ppu2c0x_set_videorom_bank(state->ppu, 0, 8, bank, 512);
272273}
273274
274static void chr4_0 (int bank)
275static void chr4_0 (running_machine *machine, int bank)
275276{
277   nes_state *state = machine->driver_data;
276278   bank &= ((nes.chr_chunks << 1) - 1);
277   ppu2c0x_set_videorom_bank(0, 0, 4, bank, 256);
279   ppu2c0x_set_videorom_bank(state->ppu, 0, 4, bank, 256);
278280}
279281
280static void chr4_4 (int bank)
282static void chr4_4 (running_machine *machine, int bank)
281283{
284   nes_state *state = machine->driver_data;
282285   bank &= ((nes.chr_chunks << 1) - 1);
283   ppu2c0x_set_videorom_bank(0, 4, 4, bank, 256);
286   ppu2c0x_set_videorom_bank(state->ppu, 4, 4, bank, 256);
284287}
285288
286static void chr2_0 (int bank)
289static void chr2_0 (running_machine *machine, int bank)
287290{
291   nes_state *state = machine->driver_data;
288292   bank &= ((nes.chr_chunks << 2) - 1);
289   ppu2c0x_set_videorom_bank(0, 0, 2, bank, 128);
293   ppu2c0x_set_videorom_bank(state->ppu, 0, 2, bank, 128);
290294}
291295
292static void chr2_2 (int bank)
296static void chr2_2 (running_machine *machine, int bank)
293297{
298   nes_state *state = machine->driver_data;
294299   bank &= ((nes.chr_chunks << 2) - 1);
295   ppu2c0x_set_videorom_bank(0, 2, 2, bank, 128);
300   ppu2c0x_set_videorom_bank(state->ppu, 2, 2, bank, 128);
296301}
297302
298static void chr2_4 (int bank)
303static void chr2_4 (running_machine *machine, int bank)
299304{
305   nes_state *state = machine->driver_data;
300306   bank &= ((nes.chr_chunks << 2) - 1);
301   ppu2c0x_set_videorom_bank(0, 4, 2, bank, 128);
307   ppu2c0x_set_videorom_bank(state->ppu, 4, 2, bank, 128);
302308}
303309
304static void chr2_6 (int bank)
310static void chr2_6 (running_machine *machine, int bank)
305311{
312   nes_state *state = machine->driver_data;
306313   bank &= ((nes.chr_chunks << 2) - 1);
307   ppu2c0x_set_videorom_bank(0, 6, 2, bank, 128);
314   ppu2c0x_set_videorom_bank(state->ppu, 6, 2, bank, 128);
308315}
309static void chr1_0 (int bank)
316static void chr1_0 (running_machine *machine, int bank)
310317{
318   nes_state *state = machine->driver_data;
311319   bank &= ((nes.chr_chunks << 3) - 1);
312   ppu2c0x_set_videorom_bank(0, 0, 1, bank, 64);
320   ppu2c0x_set_videorom_bank(state->ppu, 0, 1, bank, 64);
313321}
314static void chr1_1 (int bank)
322static void chr1_1 (running_machine *machine, int bank)
315323{
324   nes_state *state = machine->driver_data;
316325   bank &= ((nes.chr_chunks << 3) - 1);
317   ppu2c0x_set_videorom_bank(0, 1, 1, bank, 64);
326   ppu2c0x_set_videorom_bank(state->ppu, 1, 1, bank, 64);
318327}
319static void chr1_2 (int bank)
328static void chr1_2 (running_machine *machine, int bank)
320329{
330   nes_state *state = machine->driver_data;
321331   bank &= ((nes.chr_chunks << 3) - 1);
322   ppu2c0x_set_videorom_bank(0, 2, 1, bank, 64);
332   ppu2c0x_set_videorom_bank(state->ppu, 2, 1, bank, 64);
323333}
324static void chr1_3 (int bank)
334static void chr1_3 (running_machine *machine, int bank)
325335{
336   nes_state *state = machine->driver_data;
326337   bank &= ((nes.chr_chunks << 3) - 1);
327   ppu2c0x_set_videorom_bank(0, 3, 1, bank, 64);
338   ppu2c0x_set_videorom_bank(state->ppu, 3, 1, bank, 64);
328339}
329static void chr1_4 (int bank)
340static void chr1_4 (running_machine *machine, int bank)
330341{
342   nes_state *state = machine->driver_data;
331343   bank &= ((nes.chr_chunks << 3) - 1);
332   ppu2c0x_set_videorom_bank(0, 4, 1, bank, 64);
344   ppu2c0x_set_videorom_bank(state->ppu, 4, 1, bank, 64);
333345}
334static void chr1_5 (int bank)
346static void chr1_5 (running_machine *machine, int bank)
335347{
348   nes_state *state = machine->driver_data;
336349   bank &= ((nes.chr_chunks << 3) - 1);
337   ppu2c0x_set_videorom_bank(0, 5, 1, bank, 64);
350   ppu2c0x_set_videorom_bank(state->ppu, 5, 1, bank, 64);
338351}
339static void chr1_6 (int bank)
352static void chr1_6 (running_machine *machine, int bank)
340353{
354   nes_state *state = machine->driver_data;
341355   bank &= ((nes.chr_chunks << 3) - 1);
342   ppu2c0x_set_videorom_bank(0, 6, 1, bank, 64);
356   ppu2c0x_set_videorom_bank(state->ppu, 6, 1, bank, 64);
343357}
344static void chr1_7 (int bank)
358static void chr1_7 (running_machine *machine, int bank)
345359{
360   nes_state *state = machine->driver_data;
346361   bank &= ((nes.chr_chunks << 3) - 1);
347   ppu2c0x_set_videorom_bank(0, 7, 1, bank, 64);
362   ppu2c0x_set_videorom_bank(state->ppu, 7, 1, bank, 64);
348363}
349364
350365
351366static WRITE8_HANDLER( mapper1_w )
352367{
368   nes_state *state = space->machine->driver_data;
353369   int reg;
354370
355371   /* Find which register we are dealing with */
r4499r4500
389405
390406            switch (MMC1_reg & 0x03)
391407            {
392               case 0: ppu2c0x_set_mirroring(0, PPU_MIRROR_LOW); break;
393               case 1: ppu2c0x_set_mirroring(0, PPU_MIRROR_HIGH); break;
394               case 2: ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT); break;
395               case 3: ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ); break;
408               case 0: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_LOW); break;
409               case 1: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HIGH); break;
410               case 2: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT); break;
411               case 3: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ); break;
396412            }
397413
398414            MMC1_SizeVrom_4k = (MMC1_reg & 0x10);
r4499r4500
463479               if (!MMC1_SizeVrom_4k)
464480               {
465481                  int bank = MMC1_reg & ((nes.chr_chunks << 1) - 1);
466                  ppu2c0x_set_videorom_bank(0, 0, 8, bank, 256);
482                  ppu2c0x_set_videorom_bank(state->ppu, 0, 8, bank, 256);
467483                  LOG_MMC(("MMC1 8k VROM switch: %02x\n", MMC1_reg));
468484               }
469485               else
470486               {
471487                  int bank = MMC1_reg & ((nes.chr_chunks << 1) - 1);
472                  ppu2c0x_set_videorom_bank(0, 0, 4, bank, 256);
488                  ppu2c0x_set_videorom_bank(state->ppu, 0, 4, bank, 256);
473489                  LOG_MMC(("MMC1 4k VROM switch (low): %02x\n", MMC1_reg));
474490               }
475491            }
r4499r4500
496512            if (MMC1_SizeVrom_4k)
497513            {
498514               int bank = MMC1_reg & ((nes.chr_chunks << 1) - 1);
499               ppu2c0x_set_videorom_bank(0, 4, 4, bank, 256);
515               ppu2c0x_set_videorom_bank(state->ppu, 4, 4, bank, 256);
500516               LOG_MMC(("MMC1 4k VROM switch (high): %02x\n", MMC1_reg));
501517            }
502518            break;
r4499r4500
579595
580596static WRITE8_HANDLER( mapper3_w )
581597{
582   chr8 (data);
598   chr8 (space->machine, data);
583599}
584600
585601static void mapper4_set_prg ( const address_space *space)
r4499r4500
602618   memory_set_bankptr (space->machine, 4, &nes.rom[(last_bank) * 0x2000 + 0x10000]);
603619}
604620
605static void mapper4_set_chr (void)
621static void mapper4_set_chr (running_machine *machine)
606622{
623   nes_state *state = space->machine->driver_data;
607624   UINT8 chr_page = (MMC3_cmd & 0x80) >> 5;
608   ppu2c0x_set_videorom_bank(0, chr_page ^ 0, 2, MMC3_chr_base * 64 | ( MMC3_chr[0] & ( MMC3_chr_mask * 64 ) ), 1);
609   ppu2c0x_set_videorom_bank(0, chr_page ^ 2, 2, MMC3_chr_base * 64 | ( MMC3_chr[1] & ( MMC3_chr_mask * 64 ) ), 1);
610   ppu2c0x_set_videorom_bank(0, chr_page ^ 4, 1, MMC3_chr_base * 64 | ( MMC3_chr[2] & ( MMC3_chr_mask * 64 ) ), 1);
611   ppu2c0x_set_videorom_bank(0, chr_page ^ 5, 1, MMC3_chr_base * 64 | ( MMC3_chr[3] & ( MMC3_chr_mask * 64 ) ), 1);
612   ppu2c0x_set_videorom_bank(0, chr_page ^ 6, 1, MMC3_chr_base * 64 | ( MMC3_chr[4] & ( MMC3_chr_mask * 64 ) ), 1);
613   ppu2c0x_set_videorom_bank(0, chr_page ^ 7, 1, MMC3_chr_base * 64 | ( MMC3_chr[5] & ( MMC3_chr_mask * 64 ) ), 1);
625   ppu2c0x_set_videorom_bank(state->ppu, chr_page ^ 0, 2, MMC3_chr_base * 64 | ( MMC3_chr[0] & ( MMC3_chr_mask * 64 ) ), 1);
626   ppu2c0x_set_videorom_bank(state->ppu, chr_page ^ 2, 2, MMC3_chr_base * 64 | ( MMC3_chr[1] & ( MMC3_chr_mask * 64 ) ), 1);
627   ppu2c0x_set_videorom_bank(state->ppu, chr_page ^ 4, 1, MMC3_chr_base * 64 | ( MMC3_chr[2] & ( MMC3_chr_mask * 64 ) ), 1);
628   ppu2c0x_set_videorom_bank(state->ppu, chr_page ^ 5, 1, MMC3_chr_base * 64 | ( MMC3_chr[3] & ( MMC3_chr_mask * 64 ) ), 1);
629   ppu2c0x_set_videorom_bank(state->ppu, chr_page ^ 6, 1, MMC3_chr_base * 64 | ( MMC3_chr[4] & ( MMC3_chr_mask * 64 ) ), 1);
630   ppu2c0x_set_videorom_bank(state->ppu, chr_page ^ 7, 1, MMC3_chr_base * 64 | ( MMC3_chr[5] & ( MMC3_chr_mask * 64 ) ), 1);
614631}
615632
616633static void mapper4_irq ( running_machine *machine, int num, int scanline, int vblank, int blanked )
r4499r4500
637654
638655static WRITE8_HANDLER( mapper4_w )
639656{
657   nes_state *state = space->machine->driver_data;
640658   static UINT8 last_bank = 0xff;
641659
642660//   logerror("mapper4_w offset: %04x, data: %02x, scanline: %d\n", offset, data, current_scanline);
r4499r4500
690708      }
691709      case 0x2000: /* $a000 */
692710         if (data & 0x40)
693            ppu2c0x_set_mirroring(0, PPU_MIRROR_HIGH);
711            ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HIGH);
694712         else
695713         {
696714            if (data & 0x01)
697               ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ);
715               ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ);
698716            else
699               ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT);
717               ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT);
700718         }
701719         break;
702720
r4499r4500
785803         LOG_MMC(("     mapper 118 mirroring: %02x\n", data));
786804         switch (data & 0x02)
787805         {
788            case 0x00: ppu2c0x_set_mirroring(0, PPU_MIRROR_LOW); break;
789            case 0x01: ppu2c0x_set_mirroring(0, PPU_MIRROR_LOW); break;
806            case 0x00: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_LOW); break;
807            case 0x01: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_LOW); break;
790808         }
791809         break;
792810
r4499r4500
887905
888906static WRITE8_HANDLER( mapper5_l_w )
889907{
908   nes_state *state = space->machine->driver_data;
909
890910//   static int vrom_next[4];
891911   static int vrom_page_a;
892912   static int vrom_page_b;
r4499r4500
895915   /* Send $5000-$5015 to the sound chip */
896916   if ((offset >= 0xf00) && (offset <= 0xf15))
897917   {
898      nes_psg_w (devtag_get_device(space->machine, "nessound"), offset & 0x1f, data);
918      nes_psg_w (state->sound, offset & 0x1f, data);
899919      return;
900920   }
901921
r4499r4500
10701090               /* 1k switch */
10711091               vrom_bank[0] = data;
10721092//               mapper5_sync_vrom(0);
1073               ppu2c0x_set_videorom_bank(0, 0, 1, vrom_bank[0], 64);
1093               ppu2c0x_set_videorom_bank(state->ppu, 0, 1, vrom_bank[0], 64);
10741094//               nes_vram_sprite[0] = vrom_bank[0] * 64;
10751095//               vrom_next[0] = 4;
10761096//               vrom_page_a = 1;
r4499r4500
10841104         {
10851105            case 0x02:
10861106               /* 2k switch */
1087               chr2_0 (data);
1107               chr2_0 (space->machine, data);
10881108               break;
10891109            case 0x03:
10901110               /* 1k switch */
10911111               vrom_bank[1] = data;
10921112//               mapper5_sync_vrom(0);
1093               ppu2c0x_set_videorom_bank(0, 1, 1, vrom_bank[1], 64);
1113               ppu2c0x_set_videorom_bank(state->ppu, 1, 1, vrom_bank[1], 64);
10941114//               nes_vram_sprite[1] = vrom_bank[0] * 64;
10951115//               vrom_next[1] = 5;
10961116//               vrom_page_a = 1;
r4499r4500
11061126               /* 1k switch */
11071127               vrom_bank[2] = data;
11081128//               mapper5_sync_vrom(0);
1109               ppu2c0x_set_videorom_bank(0, 2, 1, vrom_bank[2], 64);
1129               ppu2c0x_set_videorom_bank(state->ppu, 2, 1, vrom_bank[2], 64);
11101130//               nes_vram_sprite[2] = vrom_bank[0] * 64;
11111131//               vrom_next[2] = 6;
11121132//               vrom_page_a = 1;
r4499r4500
11291149               /* 1k switch */
11301150               vrom_bank[3] = data;
11311151//               mapper5_sync_vrom(0);
1132               ppu2c0x_set_videorom_bank(0, 3, 1, vrom_bank[3], 64);
1152               ppu2c0x_set_videorom_bank(state->ppu, 3, 1, vrom_bank[3], 64);
11331153//               nes_vram_sprite[3] = vrom_bank[0] * 64;
11341154//               vrom_next[3] = 7;
11351155//               vrom_page_a = 1;
r4499r4500
11451165               /* 1k switch */
11461166               vrom_bank[4] = data;
11471167//               mapper5_sync_vrom(0);
1148               ppu2c0x_set_videorom_bank(0, 4, 1, vrom_bank[4], 64);
1168               ppu2c0x_set_videorom_bank(state->ppu, 4, 1, vrom_bank[4], 64);
11491169//               nes_vram_sprite[4] = vrom_bank[0] * 64;
11501170//               vrom_next[0] = 0;
11511171//               vrom_page_a = 0;
r4499r4500
11591179         {
11601180            case 0x02:
11611181               /* 2k switch */
1162               chr2_4 (data);
1182               chr2_4 (space->machine, data);
11631183               break;
11641184            case 0x03:
11651185               /* 1k switch */
11661186               vrom_bank[5] = data;
11671187//               mapper5_sync_vrom(0);
1168               ppu2c0x_set_videorom_bank(0, 5, 1, vrom_bank[5], 64);
1188               ppu2c0x_set_videorom_bank(state->ppu, 5, 1, vrom_bank[5], 64);
11691189//               nes_vram_sprite[5] = vrom_bank[0] * 64;
11701190//               vrom_next[1] = 1;
11711191//               vrom_page_a = 0;
r4499r4500
11811201               /* 1k switch */
11821202               vrom_bank[6] = data;
11831203//               mapper5_sync_vrom(0);
1184               ppu2c0x_set_videorom_bank(0, 6, 1, vrom_bank[6], 64);
1204               ppu2c0x_set_videorom_bank(state->ppu, 6, 1, vrom_bank[6], 64);
11851205//               nes_vram_sprite[6] = vrom_bank[0] * 64;
11861206//               vrom_next[2] = 2;
11871207//               vrom_page_a = 0;
r4499r4500
11951215         {
11961216            case 0x00:
11971217               /* 8k switch */
1198               chr8 (data);
1218               chr8 (space->machine, data);
11991219               break;
12001220            case 0x01:
12011221               /* 4k switch */
1202               chr4_4 (data);
1222               chr4_4 (space->machine, data);
12031223               break;
12041224            case 0x02:
12051225               /* 2k switch */
1206               chr2_6 (data);
1226               chr2_6 (space->machine, data);
12071227               break;
12081228            case 0x03:
12091229               /* 1k switch */
12101230               vrom_bank[7] = data;
12111231//               mapper5_sync_vrom(0);
1212               ppu2c0x_set_videorom_bank(0, 7, 1, vrom_bank[7], 64);
1232               ppu2c0x_set_videorom_bank(state->ppu, 7, 1, vrom_bank[7], 64);
12131233//               nes_vram_sprite[7] = vrom_bank[0] * 64;
12141234//               vrom_next[3] = 3;
12151235//               vrom_page_a = 0;
r4499r4500
12271247//               nes_vram[vrom_next[0]] = data * 64;
12281248//               nes_vram[0 + (vrom_page_a*4)] = data * 64;
12291249//               nes_vram[0] = data * 64;
1230               ppu2c0x_set_videorom_bank(0, 4, 1, data, 64);
1250               ppu2c0x_set_videorom_bank(state->ppu, 4, 1, data, 64);
12311251//               mapper5_sync_vrom(1);
12321252               if (!vrom_page_b)
12331253               {
r4499r4500
12431263         {
12441264            case 0x02:
12451265               /* 2k switch */
1246               chr2_0 (data);
1247               chr2_4 (data);
1266               chr2_0 (space->machine, data);
1267               chr2_4 (space->machine, data);
12481268               break;
12491269            case 0x03:
12501270               /* 1k switch */
r4499r4500
12521272//               nes_vram[vrom_next[1]] = data * 64;
12531273//               nes_vram[1 + (vrom_page_a*4)] = data * 64;
12541274//               nes_vram[1] = data * 64;
1255               ppu2c0x_set_videorom_bank(0, 5, 1, data, 64);
1275               ppu2c0x_set_videorom_bank(state->ppu, 5, 1, data, 64);
12561276//               mapper5_sync_vrom(1);
12571277               if (!vrom_page_b)
12581278               {
r4499r4500
12721292//               nes_vram[vrom_next[2]] = data * 64;
12731293//               nes_vram[2 + (vrom_page_a*4)] = data * 64;
12741294//               nes_vram[2] = data * 64;
1275               ppu2c0x_set_videorom_bank(0, 6, 1, data, 64);
1295               ppu2c0x_set_videorom_bank(state->ppu, 6, 1, data, 64);
12761296//               mapper5_sync_vrom(1);
12771297               if (!vrom_page_b)
12781298               {
r4499r4500
12881308         {
12891309            case 0x00:
12901310               /* 8k switch */
1291               chr8 (data);
1311               chr8 (space->machine, data);
12921312               break;
12931313            case 0x01:
12941314               /* 4k switch */
1295               chr4_0 (data);
1296               chr4_4 (data);
1315               chr4_0 (space->machine, data);
1316               chr4_4 (space->machine, data);
12971317               break;
12981318            case 0x02:
12991319               /* 2k switch */
1300               chr2_2 (data);
1301               chr2_6 (data);
1320               chr2_2 (space->machine, data);
1321               chr2_6 (space->machine, data);
13021322               break;
13031323            case 0x03:
13041324               /* 1k switch */
r4499r4500
13061326//               nes_vram[vrom_next[3]] = data * 64;
13071327//               nes_vram[3 + (vrom_page_a*4)] = data * 64;
13081328//               nes_vram[3] = data * 64;
1309               ppu2c0x_set_videorom_bank(0, 7, 1, data, 64);
1329               ppu2c0x_set_videorom_bank(state->ppu, 7, 1, data, 64);
13101330//               mapper5_sync_vrom(1);
13111331               if (!vrom_page_b)
13121332               {
r4499r4500
13471367static WRITE8_HANDLER( mapper7_w )
13481368{
13491369   if (data & 0x10)
1350      ppu2c0x_set_mirroring(0, PPU_MIRROR_HIGH);
1370      ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HIGH);
13511371   else
1352      ppu2c0x_set_mirroring(0, PPU_MIRROR_LOW);
1372      ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_LOW);
13531373
13541374   prg32 (space, data);
13551375}
r4499r4500
13671387}
13681388
13691389
1370static void mapper9_latch (offs_t offset)
1390static void mapper9_latch (running_machine *machine, offs_t offset)
13711391{
13721392   if ((offset & 0x3ff0) == 0x0fd0)
13731393   {
13741394      logerror ("mapper9 vrom latch switch (bank 0 low): %02x\n", MMC2_bank0);
13751395      MMC2_bank0_latch = 0xfd;
1376      chr4_0 (MMC2_bank0);
1396      chr4_0 (machine, MMC2_bank0);
13771397   }
13781398   else if ((offset & 0x3ff0) == 0x0fe0)
13791399   {
13801400      logerror ("mapper9 vrom latch switch (bank 0 high): %02x\n", MMC2_bank0_hi);
13811401      MMC2_bank0_latch = 0xfe;
1382      chr4_0 (MMC2_bank0_hi);
1402      chr4_0 (machine, MMC2_bank0_hi);
13831403   }
13841404   else if ((offset & 0x3ff0) == 0x1fd0)
13851405   {
13861406      logerror ("mapper9 vrom latch switch (bank 1 low): %02x\n", MMC2_bank1);
13871407      MMC2_bank1_latch = 0xfd;
1388      chr4_4 (MMC2_bank1);
1408      chr4_4 (machine, MMC2_bank1);
13891409   }
13901410   else if ((offset & 0x3ff0) == 0x1fe0)
13911411   {
13921412      logerror ("mapper9 vrom latch switch (bank 0 high): %02x\n", MMC2_bank1_hi);
13931413      MMC2_bank1_latch = 0xfe;
1394      chr4_4 (MMC2_bank1_hi);
1414      chr4_4 (machine, MMC2_bank1_hi);
13951415   }
13961416}
13971417
r4499r4500
14291449         break;
14301450      case 0x7000:
14311451         if (data&1)
1432            ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ);
1452            ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ);
14331453         else
1434            ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT);
1454            ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT);
14351455         break;
14361456      default:
14371457         logerror("MMC2 uncaught w: %04x:%02x\n", offset, data);
r4499r4500
15021522         break;
15031523      case 0x7000:
15041524         if (data&1)
1505            ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ);
1525            ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ);
15061526         else
1507            ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT);
1527            ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT);
15081528         break;
15091529      default:
15101530         logerror("MMC4 uncaught w: %04x:%02x\n", offset, data);
r4499r4500
15401560   {
15411561      case 0x0000:
15421562         if (data & 0x40)
1543            ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ);
1563            ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ);
15441564         else
1545            ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT);
1565            ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT);
15461566         memory_set_bankptr (space->machine, 1, &nes.rom[bank + base]);
15471567         memory_set_bankptr (space->machine, 2, &nes.rom[bank + (base ^ 0x2000)]);
15481568         memory_set_bankptr (space->machine, 3, &nes.rom[bank + (base ^ 0x4000)]);
r4499r4500
15631583
15641584      case 0x0003:
15651585         if (data & 0x40)
1566            ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ);
1586            ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ);
15671587         else
1568            ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT);
1588            ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT);
15691589         memory_set_bankptr (space->machine, 3, &nes.rom[bank + base]);
15701590         memory_set_bankptr (space->machine, 4, &nes.rom[bank + (base ^ 0x2000)]);
15711591           break;
r4499r4500
15951615   {
15961616      //use new utility functions for bounds checks!
15971617      case 0:
1598         chr1_0(data);
1618         chr1_0(space->machine, data);
15991619         break;
16001620      case 1:
1601         chr1_1(data);
1621         chr1_1(space->machine, data);
16021622         break;
16031623      case 2:
1604         chr1_2(data);
1624         chr1_2(space->machine, data);
16051625         break;
16061626      case 3:
1607         chr1_3(data);
1627         chr1_3(space->machine, data);
16081628         break;
16091629      case 4:
1610         chr1_4(data);
1630         chr1_4(space->machine, data);
16111631         break;
16121632      case 5:
1613         chr1_5(data);
1633         chr1_5(space->machine, data);
16141634         break;
16151635      case 6:
1616         chr1_6(data);
1636         chr1_6(space->machine, data);
16171637         break;
16181638      case 7:
1619         chr1_7(data);
1639         chr1_7(space->machine, data);
16201640         break;
16211641      case 8:
16221642         /* Switch 16k bank at $8000 */
r4499r4500
16261646         switch (data & 0x03)
16271647         {
16281648            case 0:
1629               ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ);
1649               ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ);
16301650               break;
16311651            case 1:
1632               ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT);
1652               ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT);
16331653               break;
16341654            case 2:
1635               ppu2c0x_set_mirroring(0, PPU_MIRROR_LOW);
1655               ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_LOW);
16361656               break;
16371657            case 3:
1638               ppu2c0x_set_mirroring(0, PPU_MIRROR_HIGH);
1658               ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HIGH);
16391659               break;
16401660         }
16411661         break;
r4499r4500
16631683      /* $42fe - mirroring */
16641684      case 0x1fe:
16651685         if (data & 0x10)
1666            ppu2c0x_set_mirroring(0, PPU_MIRROR_LOW);
1686            ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_LOW);
16671687         else
1668            ppu2c0x_set_mirroring(0, PPU_MIRROR_HIGH);
1688            ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HIGH);
16691689         break;
16701690      /* $42ff - mirroring */
16711691      case 0x1ff:
16721692         if (data & 0x10)
1673            ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ);
1693            ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ);
16741694         else
1675            ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT);
1695            ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT);
16761696         break;
16771697      /* $4501 - $4503 */
16781698//      case 0x401:
r4499r4500
16991719      case 0x416:
17001720      case 0x417:
17011721         data &= ((nes.chr_chunks << 3) - 1);
1702         ppu2c0x_set_videorom_bank(0, offset & 0x07, 1, data, 64);
1722         ppu2c0x_set_videorom_bank(state->ppu, offset & 0x07, 1, data, 64);
17031723         break;
17041724      default:
17051725         logerror("** uncaught mapper 17 write, offset: %04x, data: %02x\n", offset, data);
r4499r4500
18001820         /* Switch 1k vrom at $0000 - low 4 bits */
18011821         vrom_bank[0] = (vrom_bank[0] & 0xf0) | (data & 0x0f);
18021822         vrom_bank[0] &= ((nes.chr_chunks << 3) - 1);
1803         ppu2c0x_set_videorom_bank(0, 0, 1, vrom_bank[0], 64);
1823         ppu2c0x_set_videorom_bank(state->ppu, 0, 1, vrom_bank[0], 64);
18041824         break;
18051825      case 0x2001:
18061826         /* Switch 1k vrom at $0000 - high 4 bits */
18071827         vrom_bank[0] = (vrom_bank[0] & 0x0f) | (data << 4);
18081828         vrom_bank[0] &= ((nes.chr_chunks << 3) - 1);
1809         ppu2c0x_set_videorom_bank(0, 0, 1, vrom_bank[0], 64);
1829         ppu2c0x_set_videorom_bank(state->ppu, 0, 1, vrom_bank[0], 64);
18101830         break;
18111831      case 0x2002:
18121832         /* Switch 1k vrom at $0400 - low 4 bits */
18131833         vrom_bank[1] = (vrom_bank[1] & 0xf0) | (data & 0x0f);
18141834         vrom_bank[1] &= ((nes.chr_chunks << 3) - 1);
1815         ppu2c0x_set_videorom_bank(0, 1, 1, vrom_bank[1], 64);
1835         ppu2c0x_set_videorom_bank(state->ppu, 1, 1, vrom_bank[1], 64);
18161836         break;
18171837      case 0x2003:
18181838         /* Switch 1k vrom at $0400 - high 4 bits */
18191839         vrom_bank[1] = (vrom_bank[1] & 0x0f) | (data << 4);
18201840         vrom_bank[1] &= ((nes.chr_chunks << 3) - 1);
1821         ppu2c0x_set_videorom_bank(0, 1, 1, vrom_bank[1], 64);
1841         ppu2c0x_set_videorom_bank(state->ppu, 1, 1, vrom_bank[1], 64);
18221842         break;
18231843      case 0x3000:
18241844         /* Switch 1k vrom at $0800 - low 4 bits */
18251845         vrom_bank[2] = (vrom_bank[2] & 0xf0) | (data & 0x0f);
18261846         vrom_bank[2] &= ((nes.chr_chunks << 3) - 1);
1827         ppu2c0x_set_videorom_bank(0, 2, 1, vrom_bank[2], 64);
1847         ppu2c0x_set_videorom_bank(state->ppu, 2, 1, vrom_bank[2], 64);
18281848         break;
18291849      case 0x3001:
18301850         /* Switch 1k vrom at $0800 - high 4 bits */
18311851         vrom_bank[2] = (vrom_bank[2] & 0x0f) | (data << 4);
18321852         vrom_bank[2] &= ((nes.chr_chunks << 3) - 1);
1833         ppu2c0x_set_videorom_bank(0, 2, 1, vrom_bank[2], 64);
1853         ppu2c0x_set_videorom_bank(state->ppu, 2, 1, vrom_bank[2], 64);
18341854         break;
18351855      case 0x3002:
18361856         /* Switch 1k vrom at $0c00 - low 4 bits */
18371857         vrom_bank[3] = (vrom_bank[3] & 0xf0) | (data & 0x0f);
18381858         vrom_bank[3] &= ((nes.chr_chunks << 3) - 1);
1839         ppu2c0x_set_videorom_bank(0, 3, 1, vrom_bank[3], 64);
1859         ppu2c0x_set_videorom_bank(state->ppu, 3, 1, vrom_bank[3], 64);
18401860         break;
18411861      case 0x3003:
18421862         /* Switch 1k vrom at $0c00 - high 4 bits */
18431863         vrom_bank[3] = (vrom_bank[3] & 0x0f) | (data << 4);
18441864         vrom_bank[3] &= ((nes.chr_chunks << 3) - 1);
1845         ppu2c0x_set_videorom_bank(0, 3, 1, vrom_bank[3], 64);
1865         ppu2c0x_set_videorom_bank(state->ppu, 3, 1, vrom_bank[3], 64);
18461866         break;
18471867      case 0x4000:
18481868         /* Switch 1k vrom at $1000 - low 4 bits */
18491869         vrom_bank[4] = (vrom_bank[4] & 0xf0) | (data & 0x0f);
18501870         vrom_bank[4] &= ((nes.chr_chunks << 3) - 1);
1851         ppu2c0x_set_videorom_bank(0, 4, 1, vrom_bank[4], 64);
1871         ppu2c0x_set_videorom_bank(state->ppu, 4, 1, vrom_bank[4], 64);
18521872         break;
18531873      case 0x4001:
18541874         /* Switch 1k vrom at $1000 - high 4 bits */
18551875         vrom_bank[4] = (vrom_bank[4] & 0x0f) | (data << 4);
18561876         vrom_bank[4] &= ((nes.chr_chunks << 3) - 1);
1857         ppu2c0x_set_videorom_bank(0, 4, 1, vrom_bank[4], 64);
1877         ppu2c0x_set_videorom_bank(state->ppu, 4, 1, vrom_bank[4], 64);
18581878         break;
18591879      case 0x4002:
18601880         /* Switch 1k vrom at $1400 - low 4 bits */
18611881         vrom_bank[5] = (vrom_bank[5] & 0xf0) | (data & 0x0f);
18621882         vrom_bank[5] &= ((nes.chr_chunks << 3) - 1);
1863         ppu2c0x_set_videorom_bank(0, 5, 1, vrom_bank[5], 64);
1883         ppu2c0x_set_videorom_bank(state->ppu, 5, 1, vrom_bank[5], 64);
18641884         break;
18651885      case 0x4003:
18661886         /* Switch 1k vrom at $1400 - high 4 bits */
18671887         vrom_bank[5] = (vrom_bank[5] & 0x0f) | (data << 4);
18681888         vrom_bank[5] &= ((nes.chr_chunks << 3) - 1);
1869         ppu2c0x_set_videorom_bank(0, 5, 1, vrom_bank[5], 64);
1889         ppu2c0x_set_videorom_bank(state->ppu, 5, 1, vrom_bank[5], 64);
18701890         break;
18711891      case 0x5000:
18721892         /* Switch 1k vrom at $1800 - low 4 bits */
18731893         vrom_bank[6] = (vrom_bank[6] & 0xf0) | (data & 0x0f);
18741894         vrom_bank[6] &= ((nes.chr_chunks << 3) - 1);
1875         ppu2c0x_set_videorom_bank(0, 6, 1, vrom_bank[6], 64);
1895         ppu2c0x_set_videorom_bank(state->ppu, 6, 1, vrom_bank[6], 64);
18761896         break;
18771897      case 0x5001:
18781898         /* Switch 1k vrom at $1800 - high 4 bits */
18791899         vrom_bank[6] = (vrom_bank[6] & 0x0f) | (data << 4);
18801900         vrom_bank[6] &= ((nes.chr_chunks << 3) - 1);
1881         ppu2c0x_set_videorom_bank(0, 6, 1, vrom_bank[6], 64);
1901         ppu2c0x_set_videorom_bank(state->ppu, 6, 1, vrom_bank[6], 64);
18821902         break;
18831903      case 0x5002:
18841904         /* Switch 1k vrom at $1c00 - low 4 bits */
18851905         vrom_bank[7] = (vrom_bank[7] & 0xf0) | (data & 0x0f);
18861906         vrom_bank[7] &= ((nes.chr_chunks << 3) - 1);
1887         ppu2c0x_set_videorom_bank(0, 7, 1, vrom_bank[7], 64);
1907         ppu2c0x_set_videorom_bank(state->ppu, 7, 1, vrom_bank[7], 64);
18881908         break;
18891909      case 0x5003:
18901910         /* Switch 1k vrom at $1c00 - high 4 bits */
18911911         vrom_bank[7] = (vrom_bank[7] & 0x0f) | (data << 4);
18921912         vrom_bank[7] &= ((nes.chr_chunks << 3) - 1);
1893         ppu2c0x_set_videorom_bank(0, 7, 1, vrom_bank[7], 64);
1913         ppu2c0x_set_videorom_bank(state->ppu, 7, 1, vrom_bank[7], 64);
18941914         break;
18951915
18961916/* LBO - these are unverified */
r4499r4500
19311951      case 0x7002: /* Misc */
19321952         switch (data & 0x03)
19331953         {
1934            case 0: ppu2c0x_set_mirroring(0, PPU_MIRROR_LOW); break;
1935            case 1: ppu2c0x_set_mirroring(0, PPU_MIRROR_HIGH); break;
1936            case 2: ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT); break;
1937            case 3: ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ); break;
1954            case 0: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_LOW); break;
1955            case 1: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HIGH); break;
1956            case 2: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT); break;
1957            case 3: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ); break;
19381958         }
19391959         break;
19401960
r4499r4500
19882008      case 0x3000:
19892009      case 0x3800:
19902010         /* Switch 1k VROM at $0000-$1c00 */
1991         ppu2c0x_set_videorom_bank(0, offset / 0x800, 1, data, 64);
2011         ppu2c0x_set_videorom_bank(state->ppu, offset / 0x800, 1, data, 64);
19922012         break;
19932013
19942014      case 0x6000:
r4499r4500
21092129         if (data & 0x02) nes_fds.head_position = 0;
21102130         nes_fds.read_mode = data & 0x04;
21112131         if (data & 0x08)
2112            ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ);
2132            ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ);
21132133         else
2114            ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT);
2134            ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT);
21152135         if ((!(data & 0x40)) && (nes_fds.write_reg & 0x40))
21162136            nes_fds.head_position -= 2; // ???
21172137         IRQ_enable_latch = data & 0x80;
r4499r4500
21482168         case 0x1000:
21492169            switch (data & 0x03)
21502170            {
2151               case 0x00: ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT); break;
2152               case 0x01: ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ); break;
2153               case 0x02: ppu2c0x_set_mirroring(0, PPU_MIRROR_LOW); break;
2154               case 0x03: ppu2c0x_set_mirroring(0, PPU_MIRROR_HIGH); break;
2171               case 0x00: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT); break;
2172               case 0x01: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ); break;
2173               case 0x02: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_LOW); break;
2174               case 0x03: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HIGH); break;
21552175            }
21562176            break;
21572177
r4499r4500
21822202            int bank = (offset & 0x7000) / 0x0800 + (offset & 0x0001);
21832203            vrom_bank[bank] = data >> 1;
21842204            vrom_bank[bank] &= ((nes.chr_chunks << 3) - 1);
2185            ppu2c0x_set_videorom_bank(0, bank, 1, vrom_bank[bank], 64);
2205            ppu2c0x_set_videorom_bank(state->ppu, bank, 1, vrom_bank[bank], 64);
21862206         }
21872207         break;
21882208
r4499r4500
22262246         case 0x1000:
22272247            switch (data & 0x03)
22282248            {
2229               case 0x00: ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT); break;
2230               case 0x01: ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ); break;
2231               case 0x02: ppu2c0x_set_mirroring(0, PPU_MIRROR_LOW); break;
2232               case 0x03: ppu2c0x_set_mirroring(0, PPU_MIRROR_HIGH); break;
2249               case 0x00: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT); break;
2250               case 0x01: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ); break;
2251               case 0x02: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_LOW); break;
2252               case 0x03: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HIGH); break;
22332253            }
22342254            break;
22352255
r4499r4500
22562276         /* Switch 1k vrom at $0000 - low 4 bits */
22572277         vrom_bank[0] = (vrom_bank[0] & 0xf0) | (data & 0x0f);
22582278         vrom_bank[0] &= ((nes.chr_chunks << 3) - 1);
2259         ppu2c0x_set_videorom_bank(0, 0, 1, vrom_bank[0], 64);
2279         ppu2c0x_set_videorom_bank(state->ppu, 0, 1, vrom_bank[0], 64);
22602280         break;
22612281      case 0x3001:
22622282         /* Switch 1k vrom at $0000 - high 4 bits */
22632283         vrom_bank[0] = (vrom_bank[0] & 0x0f) | (data << 4);
22642284         vrom_bank[0] &= ((nes.chr_chunks << 3) - 1);
2265         ppu2c0x_set_videorom_bank(0, 0, 1, vrom_bank[0], 64);
2285         ppu2c0x_set_videorom_bank(state->ppu, 0, 1, vrom_bank[0], 64);
22662286         break;
22672287      case 0x3002:
22682288         /* Switch 1k vrom at $0400 - low 4 bits */
22692289         vrom_bank[1] = (vrom_bank[1] & 0xf0) | (data & 0x0f);
22702290         vrom_bank[1] &= ((nes.chr_chunks << 3) - 1);
2271         ppu2c0x_set_videorom_bank(0, 1, 1, vrom_bank[1], 64);
2291         ppu2c0x_set_videorom_bank(state->ppu, 1, 1, vrom_bank[1], 64);
22722292         break;
22732293      case 0x3003:
22742294         /* Switch 1k vrom at $0400 - high 4 bits */
22752295         vrom_bank[1] = (vrom_bank[1] & 0x0f) | (data << 4);
22762296         vrom_bank[1] &= ((nes.chr_chunks << 3) - 1);
2277         ppu2c0x_set_videorom_bank(0, 1, 1, vrom_bank[1], 64);
2297         ppu2c0x_set_videorom_bank(state->ppu, 1, 1, vrom_bank[1], 64);
22782298         break;
22792299      case 0x4000:
22802300         /* Switch 1k vrom at $0800 - low 4 bits */
22812301         vrom_bank[2] = (vrom_bank[2] & 0xf0) | (data & 0x0f);
22822302         vrom_bank[2] &= ((nes.chr_chunks << 3) - 1);
2283         ppu2c0x_set_videorom_bank(0, 2, 1, vrom_bank[2], 64);
2303         ppu2c0x_set_videorom_bank(state->ppu, 2, 1, vrom_bank[2], 64);
22842304         break;
22852305      case 0x4001:
22862306         /* Switch 1k vrom at $0800 - high 4 bits */
22872307         vrom_bank[2] = (vrom_bank[2] & 0x0f) | (data << 4);
22882308         vrom_bank[2] &= ((nes.chr_chunks << 3) - 1);
2289         ppu2c0x_set_videorom_bank(0, 2, 1, vrom_bank[2], 64);
2309         ppu2c0x_set_videorom_bank(state->ppu, 2, 1, vrom_bank[2], 64);
22902310         break;
22912311      case 0x4002:
22922312         /* Switch 1k vrom at $0c00 - low 4 bits */
22932313         vrom_bank[3] = (vrom_bank[3] & 0xf0) | (data & 0x0f);
22942314         vrom_bank[3] &= ((nes.chr_chunks << 3) - 1);
2295         ppu2c0x_set_videorom_bank(0, 3, 1, vrom_bank[3], 64);
2315         ppu2c0x_set_videorom_bank(state->ppu, 3, 1, vrom_bank[3], 64);
22962316         break;
22972317      case 0x4003:
22982318         /* Switch 1k vrom at $0c00 - high 4 bits */
22992319         vrom_bank[3] = (vrom_bank[3] & 0x0f) | (data << 4);
23002320         vrom_bank[3] &= ((nes.chr_chunks << 3) - 1);
2301         ppu2c0x_set_videorom_bank(0, 3, 1, vrom_bank[3], 64);
2321         ppu2c0x_set_videorom_bank(state->ppu, 3, 1, vrom_bank[3], 64);
23022322         break;
23032323      case 0x5000:
23042324         /* Switch 1k vrom at $1000 - low 4 bits */
23052325         vrom_bank[4] = (vrom_bank[4] & 0xf0) | (data & 0x0f);
23062326         vrom_bank[4] &= ((nes.chr_chunks << 3) - 1);
2307         ppu2c0x_set_videorom_bank(0, 4, 1, vrom_bank[4], 64);
2327         ppu2c0x_set_videorom_bank(state->ppu, 4, 1, vrom_bank[4], 64);
23082328         break;
23092329      case 0x5001:
23102330         /* Switch 1k vrom at $1000 - high 4 bits */
23112331         vrom_bank[4] = (vrom_bank[4] & 0x0f) | (data << 4);
23122332         vrom_bank[4] &= ((nes.chr_chunks << 3) - 1);
2313         ppu2c0x_set_videorom_bank(0, 4, 1, vrom_bank[4], 64);
2333         ppu2c0x_set_videorom_bank(state->ppu, 4, 1, vrom_bank[4], 64);
23142334         break;
23152335      case 0x5002:
23162336         /* Switch 1k vrom at $1400 - low 4 bits */
23172337         vrom_bank[5] = (vrom_bank[5] & 0xf0) | (data & 0x0f);
23182338         vrom_bank[5] &= ((nes.chr_chunks << 3) - 1);
2319         ppu2c0x_set_videorom_bank(0, 5, 1, vrom_bank[5], 64);
2339         ppu2c0x_set_videorom_bank(state->ppu, 5, 1, vrom_bank[5], 64);
23202340         break;
23212341      case 0x5003:
23222342         /* Switch 1k vrom at $1400 - high 4 bits */
23232343         vrom_bank[5] = (vrom_bank[5] & 0x0f) | (data << 4);
23242344         vrom_bank[5] &= ((nes.chr_chunks << 3) - 1);
2325         ppu2c0x_set_videorom_bank(0, 5, 1, vrom_bank[5], 64);
2345         ppu2c0x_set_videorom_bank(state->ppu, 5, 1, vrom_bank[5], 64);
23262346         break;
23272347      case 0x6000:
23282348         /* Switch 1k vrom at $1800 - low 4 bits */
23292349         vrom_bank[6] = (vrom_bank[6] & 0xf0) | (data & 0x0f);
23302350         vrom_bank[6] &= ((nes.chr_chunks << 3) - 1);
2331         ppu2c0x_set_videorom_bank(0, 6, 1, vrom_bank[6], 64);
2351         ppu2c0x_set_videorom_bank(state->ppu, 6, 1, vrom_bank[6], 64);
23322352         break;
23332353      case 0x6001:
23342354         /* Switch 1k vrom at $1800 - high 4 bits */
23352355         vrom_bank[6] = (vrom_bank[6] & 0x0f) | (data << 4);
23362356         vrom_bank[6] &= ((nes.chr_chunks << 3) - 1);
2337         ppu2c0x_set_videorom_bank(0, 6, 1, vrom_bank[6], 64);
2357         ppu2c0x_set_videorom_bank(state->ppu, 6, 1, vrom_bank[6], 64);
23382358         break;
23392359      case 0x6002:
23402360         /* Switch 1k vrom at $1c00 - low 4 bits */
23412361         vrom_bank[7] = (vrom_bank[7] & 0xf0) | (data & 0x0f);
23422362         vrom_bank[7] &= ((nes.chr_chunks << 3) - 1);
2343         ppu2c0x_set_videorom_bank(0, 7, 1, vrom_bank[7], 64);
2363         ppu2c0x_set_videorom_bank(state->ppu, 7, 1, vrom_bank[7], 64);
23442364         break;
23452365      case 0x6003:
23462366         /* Switch 1k vrom at $1c00 - high 4 bits */
23472367         vrom_bank[7] = (vrom_bank[7] & 0x0f) | (data << 4);
23482368         vrom_bank[7] &= ((nes.chr_chunks << 3) - 1);
2349         ppu2c0x_set_videorom_bank(0, 7, 1, vrom_bank[7], 64);
2369         ppu2c0x_set_videorom_bank(state->ppu, 7, 1, vrom_bank[7], 64);
23502370         break;
23512371      case 0x7000:
23522372         /* Set low 4 bits of latch */
r4499r4500
23822402      case 0x1000:
23832403         switch (data & 0x03)
23842404         {
2385            case 0x00: ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT); break;
2386            case 0x01: ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ); break;
2387            case 0x02: ppu2c0x_set_mirroring(0, PPU_MIRROR_LOW); break;
2388            case 0x03: ppu2c0x_set_mirroring(0, PPU_MIRROR_HIGH); break;
2405            case 0x00: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT); break;
2406            case 0x01: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ); break;
2407            case 0x02: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_LOW); break;
2408            case 0x03: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HIGH); break;
23892409         }
23902410         break;
23912411
r4499r4500
24002420         /* Switch 1k vrom at $0000 - low 4 bits */
24012421         vrom_bank[0] = (vrom_bank[0] & 0xf0) | (data & 0x0f);
24022422         vrom_bank[0] &= ((nes.chr_chunks << 3) - 1);
2403         ppu2c0x_set_videorom_bank(0, 0, 1, vrom_bank[0], 64);
2423         ppu2c0x_set_videorom_bank(state->ppu, 0, 1, vrom_bank[0], 64);
24042424         break;
24052425      case 0x3002:
24062426         /* Switch 1k vrom at $0000 - high 4 bits */
24072427         vrom_bank[0] = (vrom_bank[0] & 0x0f) | (data << 4);
24082428         vrom_bank[0] &= ((nes.chr_chunks << 3) - 1);
2409         ppu2c0x_set_videorom_bank(0, 0, 1, vrom_bank[0], 64);
2429         ppu2c0x_set_videorom_bank(state->ppu, 0, 1, vrom_bank[0], 64);
24102430         break;
24112431      case 0x3001:
24122432      case 0x3004:
24132433         /* Switch 1k vrom at $0400 - low 4 bits */
24142434         vrom_bank[1] = (vrom_bank[1] & 0xf0) | (data & 0x0f);
24152435         vrom_bank[1] &= ((nes.chr_chunks << 3) - 1);
2416         ppu2c0x_set_videorom_bank(0, 1, 1, vrom_bank[1], 64);
2436         ppu2c0x_set_videorom_bank(state->ppu, 1, 1, vrom_bank[1], 64);
24172437         break;
24182438      case 0x3003:
24192439      case 0x3006:
24202440         /* Switch 1k vrom at $0400 - high 4 bits */
24212441         vrom_bank[1] = (vrom_bank[1] & 0x0f) | (data << 4);
24222442         vrom_bank[1] &= ((nes.chr_chunks << 3) - 1);
2423         ppu2c0x_set_videorom_bank(0, 1, 1, vrom_bank[1], 64);
2443         ppu2c0x_set_videorom_bank(state->ppu, 1, 1, vrom_bank[1], 64);
24242444         break;
24252445      case 0x4000:
24262446         /* Switch 1k vrom at $0800 - low 4 bits */
24272447         vrom_bank[2] = (vrom_bank[2] & 0xf0) | (data & 0x0f);
24282448         vrom_bank[2] &= ((nes.chr_chunks << 3) - 1);
2429         ppu2c0x_set_videorom_bank(0, 2, 1, vrom_bank[2], 64);
2449         ppu2c0x_set_videorom_bank(state->ppu, 2, 1, vrom_bank[2], 64);
24302450         break;
24312451      case 0x4002:
24322452         /* Switch 1k vrom at $0800 - high 4 bits */
24332453         vrom_bank[2] = (vrom_bank[2] & 0x0f) | (data << 4);
24342454         vrom_bank[2] &= ((nes.chr_chunks << 3) - 1);
2435         ppu2c0x_set_videorom_bank(0, 2, 1, vrom_bank[2], 64);
2455         ppu2c0x_set_videorom_bank(state->ppu, 2, 1, vrom_bank[2], 64);
24362456         break;
24372457      case 0x4001:
24382458      case 0x4004:
24392459         /* Switch 1k vrom at $0c00 - low 4 bits */
24402460         vrom_bank[3] = (vrom_bank[3] & 0xf0) | (data & 0x0f);
24412461         vrom_bank[3] &= ((nes.chr_chunks << 3) - 1);
2442         ppu2c0x_set_videorom_bank(0, 3, 1, vrom_bank[3], 64);
2462         ppu2c0x_set_videorom_bank(state->ppu, 3, 1, vrom_bank[3], 64);
24432463         break;
24442464      case 0x4003:
24452465      case 0x4006:
24462466         /* Switch 1k vrom at $0c00 - high 4 bits */
24472467         vrom_bank[3] = (vrom_bank[3] & 0x0f) | (data << 4);
24482468         vrom_bank[3] &= ((nes.chr_chunks << 3) - 1);
2449         ppu2c0x_set_videorom_bank(0, 3, 1, vrom_bank[3], 64);
2469         ppu2c0x_set_videorom_bank(state->ppu, 3, 1, vrom_bank[3], 64);
24502470         break;
24512471      case 0x5000:
24522472         /* Switch 1k vrom at $1000 - low 4 bits */
24532473         vrom_bank[4] = (vrom_bank[4] & 0xf0) | (data & 0x0f);
24542474         vrom_bank[4] &= ((nes.chr_chunks << 3) - 1);
2455         ppu2c0x_set_videorom_bank(0, 4, 1, vrom_bank[4], 64);
2475         ppu2c0x_set_videorom_bank(state->ppu, 4, 1, vrom_bank[4], 64);
24562476         break;
24572477      case 0x5002:
24582478         /* Switch 1k vrom at $1000 - high 4 bits */
24592479         vrom_bank[4] = (vrom_bank[4] & 0x0f) | (data << 4);
24602480         vrom_bank[4] &= ((nes.chr_chunks << 3) - 1);
2461         ppu2c0x_set_videorom_bank(0, 4, 1, vrom_bank[4], 64);
2481         ppu2c0x_set_videorom_bank(state->ppu, 4, 1, vrom_bank[4], 64);
24622482         break;
24632483      case 0x5001:
24642484      case 0x5004:
24652485         /* Switch 1k vrom at $1400 - low 4 bits */
24662486         vrom_bank[5] = (vrom_bank[5] & 0xf0) | (data & 0x0f);
24672487         vrom_bank[5] &= ((nes.chr_chunks << 3) - 1);
2468         ppu2c0x_set_videorom_bank(0, 5, 1, vrom_bank[5], 64);
2488         ppu2c0x_set_videorom_bank(state->ppu, 5, 1, vrom_bank[5], 64);
24692489         break;
24702490      case 0x5003:
24712491      case 0x5006:
24722492         /* Switch 1k vrom at $1400 - high 4 bits */
24732493         vrom_bank[5] = (vrom_bank[5] & 0x0f) | (data << 4);
24742494         vrom_bank[5] &= ((nes.chr_chunks << 3) - 1);
2475         ppu2c0x_set_videorom_bank(0, 5, 1, vrom_bank[5], 64);
2495         ppu2c0x_set_videorom_bank(state->ppu, 5, 1, vrom_bank[5], 64);
24762496         break;
24772497      case 0x6000:
24782498         /* Switch 1k vrom at $1800 - low 4 bits */
24792499         vrom_bank[6] = (vrom_bank[6] & 0xf0) | (data & 0x0f);
24802500         vrom_bank[6] &= ((nes.chr_chunks << 3) - 1);
2481         ppu2c0x_set_videorom_bank(0, 6, 1, vrom_bank[6], 64);
2501         ppu2c0x_set_videorom_bank(state->ppu, 6, 1, vrom_bank[6], 64);
24822502         break;
24832503      case 0x6002:
24842504         /* Switch 1k vrom at $1800 - high 4 bits */
24852505         vrom_bank[6] = (vrom_bank[6] & 0x0f) | (data << 4);
24862506         vrom_bank[6] &= ((nes.chr_chunks << 3) - 1);
2487         ppu2c0x_set_videorom_bank(0, 6, 1, vrom_bank[6], 64);
2507         ppu2c0x_set_videorom_bank(state->ppu, 6, 1, vrom_bank[6], 64);
24882508         break;
24892509      case 0x6001:
24902510      case 0x6004:
24912511         /* Switch 1k vrom at $1c00 - low 4 bits */
24922512         vrom_bank[7] = (vrom_bank[7] & 0xf0) | (data & 0x0f);
24932513         vrom_bank[7] &= ((nes.chr_chunks << 3) - 1);
2494         ppu2c0x_set_videorom_bank(0, 7, 1, vrom_bank[7], 64);
2514         ppu2c0x_set_videorom_bank(state->ppu, 7, 1, vrom_bank[7], 64);
24952515         break;
24962516      case 0x6003:
24972517      case 0x6006:
24982518         /* Switch 1k vrom at $1c00 - high 4 bits */
24992519         vrom_bank[7] = (vrom_bank[7] & 0x0f) | (data << 4);
25002520         vrom_bank[7] &= ((nes.chr_chunks << 3) - 1);
2501         ppu2c0x_set_videorom_bank(0, 7, 1, vrom_bank[7], 64);
2521         ppu2c0x_set_videorom_bank(state->ppu, 7, 1, vrom_bank[7], 64);
25022522         break;
25032523      case 0x7000:
25042524         /* Set low 4 bits of latch */
r4499r4500
25532573      case 0x3003:
25542574         switch (data & 0x0c)
25552575         {
2556            case 0x00: ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT); break;
2557            case 0x04: ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ); break;
2558            case 0x08: ppu2c0x_set_mirroring(0, PPU_MIRROR_LOW); break;
2559            case 0x0c: ppu2c0x_set_mirroring(0, PPU_MIRROR_HIGH); break;
2576            case 0x00: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT); break;
2577            case 0x04: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ); break;
2578            case 0x08: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_LOW); break;
2579            case 0x0c: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HIGH); break;
25602580         }
25612581         break;
25622582      case 0x4000: case 0x4001: case 0x4002: case 0x4003:
r4499r4500
25682588      case 0x5002:
25692589      case 0x5003:
25702590         /* switch 1k VROM at $0000-$0c00 */
2571         ppu2c0x_set_videorom_bank(0, (offset & 3) + 0, 1, data, 64);
2591         ppu2c0x_set_videorom_bank(state->ppu, (offset & 3) + 0, 1, data, 64);
25722592         break;
25732593
25742594      case 0x6000:
r4499r4500
25762596      case 0x6002:
25772597      case 0x6003:
25782598         /* switch 1k VROM at $1000-$1c00 */
2579         ppu2c0x_set_videorom_bank(0, (offset & 3) + 4, 1, data, 64);
2599         ppu2c0x_set_videorom_bank(state->ppu, (offset & 3) + 4, 1, data, 64);
25802600         break;
25812601
25822602      case 0x7000:
r4499r4500
26162636      case 0x3003:
26172637         switch (data & 0x0c)
26182638         {
2619            case 0x00: ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT); break;
2620            case 0x04: ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ); break;
2621            case 0x08: ppu2c0x_set_mirroring(0, PPU_MIRROR_LOW); break;
2622            case 0x0c: ppu2c0x_set_mirroring(0, PPU_MIRROR_HIGH); break;
2639            case 0x00: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT); break;
2640            case 0x04: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ); break;
2641            case 0x08: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_LOW); break;
2642            case 0x0c: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HIGH); break;
26232643         }
26242644         break;
26252645      case 0x4000: case 0x4001: case 0x4002: case 0x4003:
r4499r4500
26282648         break;
26292649      case 0x5000:
26302650         /* Switch 1k VROM at $0000 */
2631         ppu2c0x_set_videorom_bank(0, 0, 1, data, 64);
2651         ppu2c0x_set_videorom_bank(state->ppu, 0, 1, data, 64);
26322652         break;
26332653      case 0x5002:
26342654         /* Switch 1k VROM at $0400 */
2635         ppu2c0x_set_videorom_bank(0, 1, 1, data, 64);
2655         ppu2c0x_set_videorom_bank(state->ppu, 1, 1, data, 64);
26362656         break;
26372657      case 0x5001:
26382658         /* Switch 1k VROM at $0800 */
2639         ppu2c0x_set_videorom_bank(0, 2, 1, data, 64);
2659         ppu2c0x_set_videorom_bank(state->ppu, 2, 1, data, 64);
26402660         break;
26412661      case 0x5003:
26422662         /* Switch 1k VROM at $0c00 */
2643         ppu2c0x_set_videorom_bank(0, 3, 1, data, 64);
2663         ppu2c0x_set_videorom_bank(state->ppu, 3, 1, data, 64);
26442664         break;
26452665      case 0x6000:
26462666         /* Switch 1k VROM at $1000 */
2647         ppu2c0x_set_videorom_bank(0, 4, 1, data, 64);
2667         ppu2c0x_set_videorom_bank(state->ppu, 4, 1, data, 64);
26482668         break;
26492669      case 0x6002:
26502670         /* Switch 1k VROM at $1400 */
2651         ppu2c0x_set_videorom_bank(0, 5, 1, data, 64);
2671         ppu2c0x_set_videorom_bank(state->ppu, 5, 1, data, 64);
26522672         break;
26532673      case 0x6001:
26542674         /* Switch 1k VROM at $1800 */
2655         ppu2c0x_set_videorom_bank(0, 6, 1, data, 64);
2675         ppu2c0x_set_videorom_bank(state->ppu, 6, 1, data, 64);
26562676         break;
26572677      case 0x6003:
26582678         /* Switch 1k VROM at $1c00 */
2659         ppu2c0x_set_videorom_bank(0, 7, 1, data, 64);
2679         ppu2c0x_set_videorom_bank(state->ppu, 7, 1, data, 64);
26602680         break;
26612681      case 0x7000:
26622682         IRQ_count_latch = data;
r4499r4500
26942714      case 0x1000:
26952715         bankSel = data & 0x02;
26962716         if (data & 0x01)
2697            ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ);
2717            ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ);
26982718         else
2699            ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT);
2719            ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT);
27002720         break;
27012721      case 0x2000:
27022722         /* Switch 8k bank at $A000 */
r4499r4500
27042724         break;
27052725      case 0x3000:
27062726         /* Switch 1k VROM at $1000 */
2707         ppu2c0x_set_videorom_bank(0, offset & 0x07, 1, data, 64);
2727         ppu2c0x_set_videorom_bank(state->ppu, offset & 0x07, 1, data, 64);
27082728         break;
27092729      default:
27102730         logerror("Uncaught mapper 32 write, addr: %04x value: %02x\n", offset + 0x8000, data);
r4499r4500
27312751         break;
27322752      case 0x0002:
27332753         /* Switch 2k VROM at $0000 */
2734         ppu2c0x_set_videorom_bank(0, 0, 2, data, 128);
2754         ppu2c0x_set_videorom_bank(state->ppu, 0, 2, data, 128);
27352755         break;
27362756      case 0x0003:
27372757         /* Switch 2k VROM at $0800 */
2738         ppu2c0x_set_videorom_bank(0, 2, 2, data, 128);
2758         ppu2c0x_set_videorom_bank(state->ppu, 2, 2, data, 128);
27392759         break;
27402760      case 0x2000:
27412761         /* Switch 1k VROM at $1000 */
2742         ppu2c0x_set_videorom_bank(0, 4, 1, data, 64);
2762         ppu2c0x_set_videorom_bank(state->ppu, 4, 1, data, 64);
27432763         break;
27442764      case 0x2001:
27452765         /* Switch 1k VROM at $1400 */
2746         ppu2c0x_set_videorom_bank(0, 5, 1, data, 64);
2766         ppu2c0x_set_videorom_bank(state->ppu, 5, 1, data, 64);
27472767         break;
27482768      case 0x2002:
27492769         /* Switch 1k VROM at $1800 */
2750         ppu2c0x_set_videorom_bank(0, 6, 1, data, 64);
2770         ppu2c0x_set_videorom_bank(state->ppu, 6, 1, data, 64);
27512771         break;
27522772      case 0x2003:
27532773         /* Switch 1k VROM at $1c00 */
2754         ppu2c0x_set_videorom_bank(0, 7, 1, data, 64);
2774         ppu2c0x_set_videorom_bank(state->ppu, 7, 1, data, 64);
27552775         break;
27562776      default:
27572777         logerror("Uncaught mapper 33 write, addr: %04x value: %02x\n", offset + 0x8000, data);
r4499r4500
28242844
28252845static WRITE8_HANDLER( mapper41_m_w )
28262846{
2847   nes_state *state = space->machine->driver_data;
2848
28272849   LOG_MMC(("mapper41_m_w, offset: %04x, data: %02x\n", offset, data));
28282850
28292851   if (offset & 0x20)
2830      ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ);
2852      ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ);
28312853   else
2832      ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT);
2854      ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT);
28332855
28342856   mapper41_reg2 = offset & 0x04;
28352857   mapper41_chr &= ~0x0c;
r4499r4500
28392861
28402862static WRITE8_HANDLER( mapper41_w )
28412863{
2864   nes_state *state = space->machine->driver_data;
2865
28422866   LOG_MMC(("mapper41_w, offset: %04x, data: %02x\n", offset, data));
28432867
28442868   if (mapper41_reg2)
28452869   {
28462870      mapper41_chr &= ~0x03;
28472871      mapper41_chr |= data & 0x03;
2848      chr8(mapper41_chr);
2872      chr8(space->machine, mapper41_chr);
28492873   }
28502874}
28512875
28522876static WRITE8_HANDLER( mapper42_w )
28532877{
2878   nes_state *state = space->machine->driver_data;
2879
28542880   LOG_MMC(("mapper42_w, offset: %04x, data: %02x\n", offset, data));
28552881
28562882   if ( offset >= 0x7000 )
r4499r4500
28612887         memory_set_bankptr (space->machine, 5, &nes.rom[( data & ( ( nes.prg_chunks << 1 ) -1 ) ) * 0x2000 + 0x10000]);
28622888         break;
28632889      case 0x01:
2864         ppu2c0x_set_mirroring( 0, ( data & 0x08 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
2890         ppu2c0x_set_mirroring( state->ppu, ( data & 0x08 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
28652891         break;
28662892      case 0x02:
28672893         /* Check if IRQ is being enabled */
r4499r4500
28842910
28852911   LOG_MMC(("mapper43_w, offset: %04x, data: %02x\n", offset, data));
28862912
2887   ppu2c0x_set_mirroring( 0, ( offset & 0x2000 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
2913   ppu2c0x_set_mirroring( state->ppu, ( offset & 0x2000 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
28882914
28892915   if ( offset & 0x0800 )
28902916   {
r4499r4500
30363062}
30373063
30383064static void mapper51_set_banks( const address_space *space ) {
3039   ppu2c0x_set_mirroring( 0, ( MMC1_bank1 == 3 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
3065   ppu2c0x_set_mirroring( state->ppu, ( MMC1_bank1 == 3 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
30403066
30413067   if ( MMC1_bank1 & 0x01 ) {
30423068      prg32( space, MMC1_bank2 );
r4499r4500
30833109      prg16_cdef( space, ( MMC1_bank2 >> 5 ) & 0x03 );
30843110   }
30853111
3086   ppu2c0x_set_mirroring( 0, ( MMC1_bank2 & 0x08 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
3112   ppu2c0x_set_mirroring( state->ppu, ( MMC1_bank2 & 0x08 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
30873113
30883114   chr8( ( MMC1_bank1 & 0x03 ) | ( MMC1_bank2 & 0x07 ) | ( ( MMC1_bank2 & 0x10 ) >> 1 ) );
30893115}
r4499r4500
31023128
31033129      chr8( ( offset & 0x38 ) >> 3 );
31043130
3105      ppu2c0x_set_mirroring( 0, ( data & 0x02 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
3131      ppu2c0x_set_mirroring( state->ppu, ( data & 0x02 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
31063132   }
31073133}
31083134
r4499r4500
31213147      prg16_cdef( space, ( ( offset & 0x0F ) << 1 ) | ( ( offset & 0x20 ) >> 4 ) );
31223148      break;
31233149   }
3124   ppu2c0x_set_mirroring( 0, ( offset & 0x80 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
3150   ppu2c0x_set_mirroring( state->ppu, ( offset & 0x80 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
31253151}
31263152
31273153static WRITE8_HANDLER( mapper62_w )
r4499r4500
31373163      prg32( space, ( ( offset & 0x40 ) | ( ( offset >> 8 ) & 0x3F ) ) >> 1 );
31383164   }
31393165
3140   ppu2c0x_set_mirroring( 0, ( offset & 0x80 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
3166   ppu2c0x_set_mirroring( state->ppu, ( offset & 0x80 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
31413167}
31423168
31433169static void mapper64_set_banks( const address_space *space ) {
31443170   if ( mapper64_cmd & 0x20 ) {
3145      chr1_0( mapper64_data[0] );
3146      chr1_2( mapper64_data[1] );
3147      chr1_1( mapper64_data[8] );
3148      chr1_3( mapper64_data[9] );
3171      chr1_0( space->machine, mapper64_data[0] );
3172      chr1_2( space->machine, mapper64_data[1] );
3173      chr1_1( space->machine, mapper64_data[8] );
3174      chr1_3( space->machine, mapper64_data[9] );
31493175   } else {
3150      chr1_0( mapper64_data[0] & 0xFE );
3151      chr1_1( ( mapper64_data[0] & 0xFE ) | 1 );
3152      chr1_2( mapper64_data[1] & 0xFE );
3153      chr1_3( ( mapper64_data[1] & 0xFE ) | 1 );
3176      chr1_0( space->machine, mapper64_data[0] & 0xFE );
3177      chr1_1( space->machine, ( mapper64_data[0] & 0xFE ) | 1 );
3178      chr1_2( space->machine, mapper64_data[1] & 0xFE );
3179      chr1_3( space->machine, ( mapper64_data[1] & 0xFE ) | 1 );
31543180   }
3155   chr1_4( mapper64_data[2] );
3156   chr1_5( mapper64_data[3] );
3157   chr1_6( mapper64_data[4] );
3158   chr1_7( mapper64_data[5] );
3181   chr1_4( space->machine, mapper64_data[2] );
3182   chr1_5( space->machine, mapper64_data[3] );
3183   chr1_6( space->machine, mapper64_data[4] );
3184   chr1_7( space->machine, mapper64_data[5] );
31593185
31603186   prg8_89( space, mapper64_data[6] );
31613187   prg8_ab( space, mapper64_data[7] );
r4499r4500
31903216      case 0x2000:
31913217         /* Not sure if the one-screen mirroring applies to this mapper */
31923218         if (data & 0x40)
3193            ppu2c0x_set_mirroring(0, PPU_MIRROR_HIGH);
3219            ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HIGH);
31943220         else
31953221         {
31963222            if (data & 0x01)
3197               ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ);
3223               ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ);
31983224            else
3199               ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT);
3225               ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT);
32003226         }
32013227         break;
32023228      case 0x4000: /* $c000 - IRQ scanline counter */
r4499r4500
32593285         break;
32603286      case 0x1001:
32613287         if (data & 0x80)
3262            ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ);
3288            ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ);
32633289         else
3264            ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT);
3290            ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT);
32653291         break;
32663292      case 0x1005:
32673293         IRQ_count = data << 1;
r4499r4500
32863312      case 0x3006:
32873313      case 0x3007:
32883314         /* Switch 1k VROM at $0000-$1c00 */
3289         ppu2c0x_set_videorom_bank(0, offset & 7, 1, data, 64);
3315         ppu2c0x_set_videorom_bank(state->ppu, offset & 7, 1, data, 64);
32903316         break;
32913317
32923318      case 0x4000:
r4499r4500
33643390      case 0x6801:
33653391         switch(data&3)
33663392         {
3367            case 0x00: ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT); break;
3368            case 0x01: ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ); break;
3369            case 0x02: ppu2c0x_set_mirroring(0, PPU_MIRROR_LOW); break;
3370            case 0x03: ppu2c0x_set_mirroring(0, PPU_MIRROR_HIGH); break;
3393            case 0x00: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT); break;
3394            case 0x01: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ); break;
3395            case 0x02: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_LOW); break;
3396            case 0x03: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HIGH); break;
33713397         }
33723398         break;
33733399      case 0x7800:
r4499r4500
33883414
33893415   switch (m68_mirror)
33903416   {
3391      case 0x00: ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ); break;
3392      case 0x01: ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT); break;
3393      case 0x02: ppu2c0x_set_mirroring(0, PPU_MIRROR_LOW); break;
3394      case 0x03: ppu2c0x_set_mirroring(0, PPU_MIRROR_HIGH); break;
3417      case 0x00: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ); break;
3418      case 0x01: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT); break;
3419      case 0x02: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_LOW); break;
3420      case 0x03: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HIGH); break;
33953421      case 0x10:
33963422         ppu_mirror_custom_vrom (0, (m0 << 10) + M68_OFFSET);
33973423         ppu_mirror_custom_vrom (1, (m1 << 10) + M68_OFFSET);
r4499r4500
34803506         switch (cmd)
34813507         {
34823508            case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:
3483               ppu2c0x_set_videorom_bank(0, cmd, 1, data, 64);
3509               ppu2c0x_set_videorom_bank(state->ppu, cmd, 1, data, 64);
34843510               break;
34853511
34863512            /* TODO: deal with bankswitching/write-protecting the mid-mapper area */
r4499r4500
35073533            case 12:
35083534               switch (data & 0x03)
35093535               {
3510                  case 0x00: ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT); break;
3511                  case 0x01: ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ); break;
3512                  case 0x02: ppu2c0x_set_mirroring(0, PPU_MIRROR_LOW); break;
3513                  case 0x03: ppu2c0x_set_mirroring(0, PPU_MIRROR_HIGH); break;
3536                  case 0x00: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT); break;
3537                  case 0x01: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ); break;
3538                  case 0x02: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_LOW); break;
3539                  case 0x03: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HIGH); break;
35143540               }
35153541               break;
35163542            case 13:
r4499r4500
35433569
35443570#if 1
35453571   if (data & 0x80)
3546//      ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ);
3547      ppu2c0x_set_mirroring(0, PPU_MIRROR_HIGH);
3572//      ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ);
3573      ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HIGH);
35483574   else
3549//      ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT);
3550      ppu2c0x_set_mirroring(0, PPU_MIRROR_LOW);
3575//      ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT);
3576      ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_LOW);
35513577#endif
35523578}
35533579
r4499r4500
36183644         break;
36193645      case 0x1000: /* TODO: verify */
36203646         if (data & 0x01)
3621            ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ);
3647            ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ);
36223648         else
3623            ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT);
3649            ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT);
36243650         /* vrom banking as well? */
36253651         break;
36263652      case 0x2000:
r4499r4500
36583684         default:logerror("mapper76 unsupported command: %02x, data: %02x\n", cmd, data);break;
36593685         }
36603686      }
3661   case 0x2000: (data&1)?ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ):ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT);break;
3687   case 0x2000: (data&1)?ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ):ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT);break;
36623688   default: logerror("mapper76 unmapped write, offset: %04x, data: %02x\n", offset, data);break;
36633689   }
36643690}
r4499r4500
37523778         break;
37533779      case 0x1ef2:
37543780         /* Switch 1k VROM at $1000 */
3755         ppu2c0x_set_videorom_bank(0, 4, 1, data, 64);
3781         ppu2c0x_set_videorom_bank(state->ppu, 4, 1, data, 64);
37563782         break;
37573783      case 0x1ef3:
37583784         /* Switch 1k VROM at $1400 */
3759         ppu2c0x_set_videorom_bank(0, 5, 1, data, 64);
3785         ppu2c0x_set_videorom_bank(state->ppu, 5, 1, data, 64);
37603786         break;
37613787      case 0x1ef4:
37623788         /* Switch 1k VROM at $1800 */
3763         ppu2c0x_set_videorom_bank(0, 6, 1, data, 64);
3789         ppu2c0x_set_videorom_bank(state->ppu, 6, 1, data, 64);
37643790         break;
37653791      case 0x1ef5:
37663792         /* Switch 1k VROM at $1c00 */
3767         ppu2c0x_set_videorom_bank(0, 7, 1, data, 64);
3793         ppu2c0x_set_videorom_bank(state->ppu, 7, 1, data, 64);
37683794         break;
37693795      case 0x1efa: case 0x1efb:
37703796         /* Switch 8k ROM at $8000 */
r4499r4500
38103836         break;
38113837      case 0x1ef2:
38123838         /* Switch 1k VROM at $1000 */
3813         ppu2c0x_set_videorom_bank(0, 4 ^ vrom_switch, 1, data, 64);
3839         ppu2c0x_set_videorom_bank(state->ppu, 4 ^ vrom_switch, 1, data, 64);
38143840         break;
38153841      case 0x1ef3:
38163842         /* Switch 1k VROM at $1400 */
3817         ppu2c0x_set_videorom_bank(0, 5 ^ vrom_switch, 1, data, 64);
3843         ppu2c0x_set_videorom_bank(state->ppu, 5 ^ vrom_switch, 1, data, 64);
38183844         break;
38193845      case 0x1ef4:
38203846         /* Switch 1k VROM at $1800 */
3821         ppu2c0x_set_videorom_bank(0, 6 ^ vrom_switch, 1, data, 64);
3847         ppu2c0x_set_videorom_bank(state->ppu, 6 ^ vrom_switch, 1, data, 64);
38223848         break;
38233849      case 0x1ef5:
38243850         /* Switch 1k VROM at $1c00 */
3825         ppu2c0x_set_videorom_bank(0, 7 ^ vrom_switch, 1, data, 64);
3851         ppu2c0x_set_videorom_bank(state->ppu, 7 ^ vrom_switch, 1, data, 64);
38263852         break;
38273853      case 0x1ef6:
3828         (data&0x1)?ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT):ppu2c0x_set_mirroring(0,PPU_MIRROR_HORZ);
3854         (data&0x1)?ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT):ppu2c0x_set_mirroring(state->ppu,PPU_MIRROR_HORZ);
38293855         //doc says 1= swapped. Causes in-game issues, but mostly fixes title screen
38303856         vrom_switch = ((data & 0x02) << 1);
38313857         break;
r4499r4500
38633889   prg16_cdef( space, ( mapper83_data[8] & 0x30 ) | 0x0F );
38643890}
38653891
3866static void mapper83_set_chr( void ) {
3867   chr1_0( mapper83_data[0] | ( ( mapper83_data[8] & 0x30 ) << 4 ) );
3868   chr1_1( mapper83_data[1] | ( ( mapper83_data[8] & 0x30 ) << 4 ) );
3869   chr1_2( mapper83_data[2] | ( ( mapper83_data[8] & 0x30 ) << 4 ) );
3870   chr1_3( mapper83_data[3] | ( ( mapper83_data[8] & 0x30 ) << 4 ) );
3871   chr1_4( mapper83_data[4] | ( ( mapper83_data[8] & 0x30 ) << 4 ) );
3872   chr1_5( mapper83_data[5] | ( ( mapper83_data[8] & 0x30 ) << 4 ) );
3873   chr1_6( mapper83_data[6] | ( ( mapper83_data[8] & 0x30 ) << 4 ) );
3874   chr1_7( mapper83_data[7] | ( ( mapper83_data[8] & 0x30 ) << 4 ) );
3892static void mapper83_set_chr( running_machine *machine ) {
3893   chr1_0( machine, mapper83_data[0] | ( ( mapper83_data[8] & 0x30 ) << 4 ) );
3894   chr1_1( machine, mapper83_data[1] | ( ( mapper83_data[8] & 0x30 ) << 4 ) );
3895   chr1_2( machine, mapper83_data[2] | ( ( mapper83_data[8] & 0x30 ) << 4 ) );
3896   chr1_3( machine, mapper83_data[3] | ( ( mapper83_data[8] & 0x30 ) << 4 ) );
3897   chr1_4( machine, mapper83_data[4] | ( ( mapper83_data[8] & 0x30 ) << 4 ) );
3898   chr1_5( machine, mapper83_data[5] | ( ( mapper83_data[8] & 0x30 ) << 4 ) );
3899   chr1_6( machine, mapper83_data[6] | ( ( mapper83_data[8] & 0x30 ) << 4 ) );
3900   chr1_7( machine, mapper83_data[7] | ( ( mapper83_data[8] & 0x30 ) << 4 ) );
38753901}
38763902
38773903static WRITE8_HANDLER( mapper83_w )
38783904{
3905   nes_state *state = space->machine->driver_data;
3906
38793907   LOG_MMC(("mapper83_w, offset: %04x, data: %02x\n", offset, data));
38803908
38813909   switch( offset ) {
r4499r4500
38903918   case 0x0100:
38913919      switch( data & 0x03 ) {
38923920      case 0:
3893         ppu2c0x_set_mirroring( 0, PPU_MIRROR_VERT );
3921         ppu2c0x_set_mirroring( state->ppu, PPU_MIRROR_VERT );
38943922         break;
38953923      case 1:
3896         ppu2c0x_set_mirroring( 0, PPU_MIRROR_HORZ );
3924         ppu2c0x_set_mirroring( state->ppu, PPU_MIRROR_HORZ );
38973925         break;
38983926      case 2:
3899         ppu2c0x_set_mirroring(0, PPU_MIRROR_LOW);
3927         ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_LOW);
39003928         break;
39013929      case 3:
3902         ppu2c0x_set_mirroring(0, PPU_MIRROR_HIGH);
3930         ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HIGH);
39033931         break;
39043932      }
39053933      break;
r4499r4500
39613989
39623990      case 0x2000:
39633991         /* Switch 1k VROM at $0000 */
3964         ppu2c0x_set_videorom_bank(0, 0, 1, data, 64);
3992         ppu2c0x_set_videorom_bank(state->ppu, 0, 1, data, 64);
39653993         break;
39663994      case 0x2008: case 0x2010: case 0x2018:
39673995         /* Switch 1k VROM at $0400 */
3968         ppu2c0x_set_videorom_bank(0, 1, 1, data, 64);
3996         ppu2c0x_set_videorom_bank(state->ppu, 1, 1, data, 64);
39693997         break;
39703998      case 0x3000:
39713999         /* Switch 1k VROM at $0800 */
3972         ppu2c0x_set_videorom_bank(0, 2, 1, data, 64);
4000         ppu2c0x_set_videorom_bank(state->ppu, 2, 1, data, 64);
39734001         break;
39744002      case 0x3008: case 0x3010: case 0x3018:
39754003         /* Switch 1k VROM at $0c00 */
3976         ppu2c0x_set_videorom_bank(0, 3, 1, data, 64);
4004         ppu2c0x_set_videorom_bank(state->ppu, 3, 1, data, 64);
39774005         break;
39784006      case 0x4000:
39794007         /* Switch 1k VROM at $1000 */
3980         ppu2c0x_set_videorom_bank(0, 4, 1, data, 64);
4008         ppu2c0x_set_videorom_bank(state->ppu, 4, 1, data, 64);
39814009         break;
39824010      case 0x4008: case 0x4010: case 0x4018:
39834011         /* Switch 1k VROM at $1400 */
3984         ppu2c0x_set_videorom_bank(0, 5, 1, data, 64);
4012         ppu2c0x_set_videorom_bank(state->ppu, 5, 1, data, 64);
39854013         break;
39864014      case 0x5000:
39874015         /* Switch 1k VROM at $1800 */
3988         ppu2c0x_set_videorom_bank(0, 6, 1, data, 64);
4016         ppu2c0x_set_videorom_bank(state->ppu, 6, 1, data, 64);
39894017         break;
39904018      case 0x5008: case 0x5010: case 0x5018:
39914019         /* Switch 1k VROM at $1c00 */
3992         ppu2c0x_set_videorom_bank(0, 7, 1, data, 64);
4020         ppu2c0x_set_videorom_bank(state->ppu, 7, 1, data, 64);
39934021         break;
39944022
39954023      case 0x6000:
39964024         switch (data & 0x03)
39974025         {
3998            case 0x00: ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT); break;
3999            case 0x01: ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ); break;
4000            case 0x02: ppu2c0x_set_mirroring(0, PPU_MIRROR_LOW); break;
4001            case 0x03: ppu2c0x_set_mirroring(0, PPU_MIRROR_HIGH); break;
4026            case 0x00: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT); break;
4027            case 0x01: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ); break;
4028            case 0x02: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_LOW); break;
4029            case 0x03: ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HIGH); break;
40024030         }
40034031         break;
40044032      case 0x6008: case 0x6010: case 0x6018:
r4499r4500
40494077   prg16_89ab(space, (data>>4)&7);
40504078   chr=(data&7)|((data&0x80)?8:0);
40514079   chr8(chr);
4052   (data&8)?ppu2c0x_set_mirroring(0, PPU_MIRROR_HIGH):ppu2c0x_set_mirroring(0, PPU_MIRROR_LOW);
4080   (data&8)?ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HIGH):ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_LOW);
40534081
40544082}
40554083
r4499r4500
41414169   if(offset&0x4000)
41424170      return;
41434171   if(data&0x80)
4144      ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT);
4145   else ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ);
4172      ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT);
4173   else ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ);
41464174   prg16_cdef(space, data&0x0F);
41474175}
41484176static WRITE8_HANDLER( mapper101_m_w )
r4499r4500
42004228      }
42014229      break;
42024230   case 0x6000:
4203      ppu2c0x_set_mirroring( 0, ( data & 0x01 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
4231      ppu2c0x_set_mirroring( state->ppu, ( data & 0x01 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
42044232      break;
42054233   }
42064234}
r4499r4500
42634291
42644292   switch( offset & 0x7003 ) {
42654293   case 0x0001:
4266      ppu2c0x_set_mirroring( 0, ( data & 0x01 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
4294      ppu2c0x_set_mirroring( state->ppu, ( data & 0x01 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
42674295      break;
42684296   case 0x2000:
42694297      MMC1_bank1 = data;
r4499r4500
43704398   prg16_cdef( space, offset & 0x07 );
43714399   chr8( offset & 0x07 );
43724400   
4373   ppu2c0x_set_mirroring( 0, ( offset & 0x08 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
4401   ppu2c0x_set_mirroring( state->ppu, ( offset & 0x08 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
43744402}
43754403
43764404static WRITE8_HANDLER( mapper201_w )
r4499r4500
43964424   prg16_cdef( space, bank + ( ( ( bank & 0x06 ) == 0x06 ) ? 1 : 0 ) );
43974425   chr8( bank );
43984426
4399   ppu2c0x_set_mirroring( 0, ( offset & 0x01 ) ? PPU_MIRROR_HORZ: PPU_MIRROR_VERT );
4427   ppu2c0x_set_mirroring( state->ppu, ( offset & 0x01 ) ? PPU_MIRROR_HORZ: PPU_MIRROR_VERT );
44004428}
44014429
44024430static WRITE8_HANDLER( mapper203_w )
r4499r4500
44414469      prg32 (space, bank);
44424470
44434471   if (offset & 0x2000)
4444      ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ);
4472      ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ);
44454473   else
4446      ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT);
4474      ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT);
44474475}
44484476
44494477static WRITE8_HANDLER( mapper226_w )
r4499r4500
44674495   hi_bank = reg0 & 0x01;
44684496   size_16 = reg0 & 0x20;
44694497   if (reg0 & 0x40)
4470      ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ);
4498      ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ);
44714499   else
4472      ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT);
4500      ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT);
44734501
44744502   bank = ((reg0 & 0x1e) >> 1) | ((reg1 & 0x01) << 4);
44754503
r4499r4500
45184546   }
45194547
45204548   if (offset & 0x02)
4521      ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ);
4549      ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ);
45224550   else
4523      ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT);
4551      ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT);
45244552}
45254553
45264554static WRITE8_HANDLER( mapper228_w )
r4499r4500
45674595   }
45684596
45694597   if (offset & 0x2000)
4570      ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ);
4598      ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ);
45714599   else
4572      ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT);
4600      ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT);
45734601
45744602   /* Now handle vrom banking */
45754603   chr = (data & 0x03) + ((offset & 0x0f) << 2);
r4499r4500
45814609   LOG_MMC(("mapper229_w, offset: %04x, data: %02x\n", offset, data));
45824610
45834611   if (offset & 0x20)
4584      ppu2c0x_set_mirroring(0, PPU_MIRROR_HORZ);
4612      ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HORZ);
45854613   else
4586      ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT);
4614      ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT);
45874615
45884616   if ((offset & 0x1e) == 0)
45894617   {
r4499r4500
46114639      } else {
46124640         prg32( space, ( ( data & 0x1E ) >> 1 ) + 4 );
46134641      }
4614      ppu2c0x_set_mirroring( 0, ( data & 0x40 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
4642      ppu2c0x_set_mirroring( state->ppu, ( data & 0x40 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
46154643   }
46164644}
46174645
r4499r4500
46714699
46724700   switch( data & 0x03 ) {
46734701   case 0:
4674      ppu2c0x_set_mirroring( 0, PPU_MIRROR_VERT );
4702      ppu2c0x_set_mirroring( state->ppu, PPU_MIRROR_VERT );
46754703      break;
46764704   case 1:
4677      ppu2c0x_set_mirroring( 0, PPU_MIRROR_HORZ );
4705      ppu2c0x_set_mirroring( state->ppu, PPU_MIRROR_HORZ );
46784706      break;
46794707   case 2:
4680      ppu2c0x_set_mirroring(0, PPU_MIRROR_LOW);
4708      ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_LOW);
46814709      break;
46824710   case 3:
4683      ppu2c0x_set_mirroring(0, PPU_MIRROR_HIGH);
4711      ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_HIGH);
46844712      break;
46854713   }
46864714}
r4499r4500
47924820      }
47934821      break;
47944822   case 0x2000:
4795      ppu2c0x_set_mirroring( 0, ( data & 0x01 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
4823      ppu2c0x_set_mirroring( state->ppu, ( data & 0x01 ) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT );
47964824      break;
47974825   case 0x4000:
47984826      IRQ_count_latch = data;
r4499r4500
48474875   const mmc *mapper;
48484876
48494877   /* Set the vram bank-switch values to the default */
4850   ppu2c0x_set_videorom_bank(0, 0, 8, 0, 64);
4878   ppu2c0x_set_videorom_bank(state->ppu, 0, 8, 0, 64);
48514879
48524880   /* Set the mapper irq callback */
48534881   mapper = nes_mapper_lookup(mapperNum);
r4499r4500
49484976         break;
49494977      case 7:
49504978         /* Bankswitches 32k at a time */
4951         ppu2c0x_set_mirroring(0, PPU_MIRROR_LOW);
4979         ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_LOW);
49524980         prg16_89ab (space, 0);
49534981         prg16_cdef (space, nes.prg_chunks-1);
49544982         break;
r4499r4500
51775205      case 89:
51785206         prg16_89ab(space, 0);
51795207         prg16_cdef(space, nes.prg_chunks-1);
5180         ppu2c0x_set_mirroring(0, PPU_MIRROR_LOW);
5208         ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_LOW);
51815209         break;
51825210
51835211      case 91:
5184         ppu2c0x_set_mirroring(0, PPU_MIRROR_VERT);
5212         ppu2c0x_set_mirroring(state->ppu, PPU_MIRROR_VERT);
51855213         prg16_89ab (space, nes.prg_chunks-1);
51865214         prg16_cdef (space, nes.prg_chunks-1);
51875215         break;
src/mess/mess.mak
r4499r4500
300300   $(MESSOBJ)/nascom1.a \
301301   $(MESSOBJ)/nec.a \
302302   $(MESSOBJ)/necpc.a \
303   $(MESSOBJ)/nintendo.a \
304303   $(MESSOBJ)/nokia.a \
305304   $(MESSOBJ)/ondra.a \
306305   $(MESSOBJ)/orion.a \
r4499r4500
357356
358357#   $(MESSOBJ)/amstrad.a \
359358#   $(MESSOBJ)/ascii.a \
359#   $(MESSOBJ)/nintendo.a \
360360#   $(MESSOBJ)/svi.a \
361361
362362
src/ldplayer/ldplayer.c
r4499r4500
106106
107107         /* look for files ending in .chd */
108108         if (length > 4 &&
109            tolower(dir->name[length - 4] == '.') &&
110            tolower(dir->name[length - 3] == 'c') &&
111            tolower(dir->name[length - 2] == 'h') &&
112            tolower(dir->name[length - 1] == 'd'))
109            dir->name[length - 4] == '.' &&
110            tolower(dir->name[length - 3]) == 'c' &&
111            tolower(dir->name[length - 2]) == 'h' &&
112            tolower(dir->name[length - 1]) == 'd')
113113         {
114114            file_error filerr;
115115            chd_error chderr;
docs/messnew.txt
r4499r4500
5555
5656Source Changes:
5757----------------
58- The core is based on MAME 0.130u3.  This incorporates all features of the
58- The core is based on MAME 0.130u4.  This incorporates all features of the
5959  update to this core.  [MAME team]
6060
6161- New tool added (castool) for cassette to wav conversion [Miodrag Milanovic]

Previous 15994 Revisions Next


© 1998-2018 The MESS Team