Previous 15994 Revisions Next

r3233 Thursday 11th September, 2008 at 23:52:28 UTC by Nathan Woods
Updated to MAME 0.127u3 core
[docs]messnew.txt
[src/emu]audit.c cheat.c clifront.c cpuexec.c cpuintrf.c crsshair.c devintrf.c devintrf.h info.c inptport.c inptport.h input.c input.h mame.c mamecore.h mconfig.c mconfig.h memory.c memory.h profiler.c profiler.h render.c render.h rendlay.c rendlay.h romload.c romload.h sound.c sound.h state.c state.h streams.c streams.h timer.c timer.h ui.c uigfx.c uiinput.c uiinput.h uimenu.c uimenu.h validity.c video.c video.h watchdog.c
[src/emu/cpu]drcbex64.c drcbex86.c drcuml.c
[src/emu/cpu/cubeqcpu]cubeqcpu.c
[src/emu/cpu/i8085]i8085.c i8085.h i8085cpu.h
[src/emu/cpu/jaguar]jaguar.c
[src/emu/cpu/mcs48]mcs48.c mcs48.h
[src/emu/cpu/powerpc]drc_ops.c ppcdrc.c
[src/emu/debug]debugcmd.c debugcon.c debugcon.h debugcpu.c express.c
[src/emu/drivers]empty.c
[src/emu/machine]6532riot.c 68681.c 8237dma.c 8255ppi.c 8257dma.c at28c16.c cdp1852.c idectrl.c laserdsc.c laserdsc.h latch8.c ldcore.c ldcore.h ldpr8210.c ldv1000.c msm6242.c pic8259.c pit8253.c smc91c9x.c timekpr.c z80dma.c
[src/emu/sound]c352.c
[src/emu/video]cdp1869.c mc6845.c voodoo.c
[src/ldplayer]ldplayer.c ldplayer.mak
[src/ldplayer/layout]pr8210.lay*
[src/lib/util]corefile.c
[src/mame]mame.mak mamedriv.c
[src/mame/audio]atarijsa.c gottlieb.c mario.c mw8080bw.c namco54.h scramble.c t5182.h
[src/mame/drivers]alg.c amspdwy.c angelkds.c arabian.c arcadia.c astrof.c atarig1.c atarig42.c atarisy1.c atarisy2.c balsente.c bbusters.c bfcobra.c bfm_sc2.c bishjan.c bladestl.c blstroid.c boogwing.c btime.c bzone.c cabal.c cave.c ccastles.c centiped.c champbas.c cidelsa.c cliffhgr.c cntsteer.c combatsc.c compgolf.c cop01.c cosmic.c cps1.c cps3.c crgolf.c cubeqst.c cultures.c darius.c darkhors.c darkmist.c ddenlovr.c dgpix.c djmain.c dlair.c dragrace.c dynax.c eprom.c equites.c esh.c fastfred.c filetto.c firebeat.c foodf.c fromance.c galaga.c gamecstl.c gameplan.c gomoku.c gottlieb.c gpworld.c gridlee.c guab.c halleys.c hitme.c hnayayoi.c homedata.c igs_180.c igs_blit.c istellar.c jack.c jailbrek.c kingpin.c kinst.c konamigv.c konamigx.c ksys573.c laserbat.c lethal.c lethalj.c lgp.c limenko.c lwings.c m72.c m90.c magic10.c mainsnk.c mario.c mazerbla.c mcr68.c mediagx.c megadriv.c megaplay.c megasys1.c megatech.c micro3d.c midvunit.c mirax.c mitchell.c mjkjidai.c mjsister.c model1.c model2.c model3.c mpu4.c mpu4drvr.c multigam.c munchmo.c mustache.c mw8080bw.c namcona1.c namcos21.c naomi.c nbmj8688.c neodrvr.c neogeo.c ninjakd2.c ninjaw.c ojankohs.c orbit.c othunder.c pacland.c panicr.c pasha2.c peplus.c poolshrk.c prehisle.c psikyo.c punchout.c quizdna.c raiden2.c rmhaihai.c rockola.c royalmah.c sbasketb.c scobra.c scramble.c sderby.c seattle.c segac2.c segae.c segag80r.c segahang.c segald.c segaorun.c segas16a.c segas16b.c segas18.c segas24.c segaybd.c seta.c shadfrce.c sidearms.c simpl156.c slapfght.c slapshot.c snk.c snk68.c snowbros.c sprcros2.c sprint8.c srmp2.c srmp6.c sspeedr.c ssrj.c ssv.c stv.c suna16.c suna8.c superdq.c system1.c system18.c taito_h.c taito_x.c taito_z.c taitoair.c taitojc.c taitowlf.c tankbust.c tatsumi.c tceptor.c terracre.c thayers.c tiamc1.c tnzs.c tourtabl.c trackfld.c trvmadns.c tsamurai.c tumbleb.c tx1.c vegas.c videopkr.c warpwarp.c warriorb.c welltris.c wgp.c wiping.c witch.c wwfwfest.c xexex.c yumefuda.c zaccaria.c zn.c zr107.c
[src/mame/includes]mario.h neogeo.h wwfwfest.h
[src/mame/layout]pmroulet.lay* sderby.lay* sgsafari.lay* spacewin.lay*
[src/mame/machine]ajax.c balsente.c bublbobl.c carpolo.c decocass.c fd1089.c fddebug.c galaxold.c harddriv.c leland.c midtunit.c midwunit.c midyunit.c n64.c namco50.h neoboot.c neoprot.c vertigo.c vsnes.c
[src/mame/video]40love.c atarisy1.c combatsc.c dynax.c fastfred.c itech8.c jackal.c lethalj.c lordgun.c m90.c mainsnk.c munchmo.c nbmj8688.c qix.c taitojc.c tceptor.c wwfwfest.c
[src/mess]device.c filemngr.c inputx.c mess.c mess.mak tapectrl.c uimess.c
[src/mess/audio]lmc1992.c
[src/mess/devices]appldriv.c basicdsk.c bitbngr.c cartslot.c cassette.c chd_cd.c coco_vhd.c dsk.c harddriv.c kermit.c mflopimg.c microdrv.c printer.c snapquik.c xmodem.c
[src/mess/drivers]a2600.c advision.c apexc.c gamepock.c glasgow.c
[src/mess/formats]thom_dsk.c
[src/mess/machine]68901mfp.c 8530scc.c 990_tap.c a7800.c adc080x.c advision.c amigafdc.c ap2_lang.c ap2_slot.c applefdc.c ay31015.c c128.c c64.c cbmserb.c cdp1871.c d88.c dgn_beta.c e0516.c gamecom.c gb.c hd63450.c hp48.c ins8154.c ins8250.c intv.c mockngbd.c nc.c ncr5380.c nes.c oric.c pdp1.c pokemini.c serial.c smartmed.c sms.c svi318.c thomson.c ti85.c ti99_4x.c tx0.c vc20.c wswan.c x68k_hdc.c zx8302.c
[src/mess/video]cdp1861.c cdp1864.c crtc_ega.c dgn_beta.c dl1416.c i8275.c m6847.c msm6255.c zx8301.c
[src/osd/windows]debugwin.c drawgdi.c drawnone.c input.c ledutil.c window.c
[src/osd/winui]mui_util.c treeview.c

src/mame/audio/atarijsa.c
r3232r3233
152152
153153   /* initialize JSA III ADPCM */
154154   {
155      static const char *regions[] = { "adpcm", "adcpml", "adpcmr" };
155      static const char *const regions[] = { "adpcm", "adcpml", "adpcmr" };
156156      int rgn;
157157
158158      /* expand the ADPCM data to avoid lots of memcpy's during gameplay */
src/mame/audio/namco54.h
r3232r3233
33
44#include "sound/discrete.h"
55
6#define CPUTAG_54XX "54XX"
6#define CPUTAG_54XX "54xx"
77
88ADDRESS_MAP_EXTERN( namco_54xx_map_program, 8 );
99ADDRESS_MAP_EXTERN( namco_54xx_map_data, 8 );
src/mame/audio/t5182.h
r3232r3233
22#include "sound/2151intf.h"
33
44
5#define CPUTAG_T5182 "T5182"
5#define CPUTAG_T5182 "t5182"
66#define T5182COINPORT "T5182_COIN"
77
88ADDRESS_MAP_EXTERN( t5182_map, 8 );
src/mame/audio/scramble.c
r3232r3233
309309     * static const int prom[16] = {0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00,
310310     *              0x02, 0x00, 0x40, 0x00, 0x04, 0x06, 0x04, 0x84 };
311311     */
312   UINT8 *prom = memory_region(machine, "tms5110_ctrl");
312   UINT8 *prom = memory_region(machine, "5110ctrl");
313313   UINT8 ctrl;
314314
315315   if (param == 0)
src/mame/audio/mario.c
r3232r3233
240240
241241static void set_ea(running_machine *machine, int ea)
242242{
243   mario_state   *state = machine->driver_data;
243244   //printf("ea: %d\n", ea);
244   cputag_set_input_line(machine, "audio", MCS48_INPUT_EA, (ea) ? ASSERT_LINE : CLEAR_LINE);
245   //memory_set_bank(MCS48_INTERNAL_ROMBANK, ea);
245   //cputag_set_input_line(machine, "audio", MCS48_INPUT_EA, (ea) ? ASSERT_LINE : CLEAR_LINE);
246   if (state->eabank != 0)
247      memory_set_bank(state->eabank, ea);
246248}
247249
248250/****************************************************************
r3232r3233
254256static SOUND_START( mario )
255257{
256258   mario_state   *state = machine->driver_data;
259   int audiocpu = mame_find_cpu_index(machine, "audio");
257260#if USE_8039
258261   UINT8 *SND = memory_region(machine, "audio");
259262
260263   SND[0x1001] = 0x01;
261264#endif
262265
263   memory_configure_bank(MCS48_INTERNAL_ROMBANK, 0, 1, memory_region(machine, "audio"), 0);
264    memory_configure_bank(MCS48_INTERNAL_ROMBANK, 1, 1, memory_region(machine, "audio") + 0x1000, 0x800);
266   state->eabank = 0;
267   if (audiocpu != -1 && machine->config->cpu[audiocpu].type != CPU_Z80)
268   {
269      state->eabank = 1;
270      memory_configure_bank(1, 0, 1, memory_region(machine, "audio"), 0);
271       memory_configure_bank(1, 1, 1, memory_region(machine, "audio") + 0x1000, 0x800);
272   }
265273
266274    state_save_register_global(state->last);
267275   state_save_register_global(state->portT);
r3232r3233
418426 *************************************/
419427
420428static ADDRESS_MAP_START( mario_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
421#if USE_8039
422   AM_RANGE(0x0000, 0x07ff) AM_ROMBANK(MCS48_INTERNAL_ROMBANK)
423#endif
429   AM_RANGE(0x0000, 0x07ff) AM_ROMBANK(1) AM_REGION("audio", 0)
424430   AM_RANGE(0x0800, 0x0fff) AM_ROM
425431ADDRESS_MAP_END
426432
src/mame/audio/gottlieb.c
r3232r3233
3737static UINT8 *psg_latch;
3838static UINT8 *sp0250_latch;
3939
40static int score_sample;
41static int random_offset;
4042
43
4144static void gottlieb1_sh_w(const device_config *riot, UINT8 data);
4245static void gottlieb2_sh_w(running_machine *machine, UINT8 data);
4346static void trigger_sample(running_machine *machine, UINT8 data);
r3232r3233
145148
146149static void trigger_sample(running_machine *machine, UINT8 data)
147150{
148   static int score_sample = 7;
149   static int random_offset = 0;
150
151151   /* Reactor samples */
152152   if (strcmp(machine->gamedrv->name, "reactor") == 0)
153153   {
r3232r3233
255255         phonemes[0] = 0;
256256         for (i = 0;i < votrax_queuepos-1;i++)
257257         {
258            static const char *inf[4] = { "[0]", "[1]", "[2]", "[3]" };
258            static const char *const inf[4] = { "[0]", "[1]", "[2]", "[3]" };
259259            int phoneme = votrax_queue[i] & 0x3f;
260260            int inflection = votrax_queue[i] >> 6;
261261            if (inflection != last) strcat(phonemes, inf[inflection]);
r3232r3233
295295
296296static SOUND_START( gottlieb1 )
297297{
298   score_sample = 7;
299   random_offset = 0;
300
298301   state_save_register_global_array(votrax_queue);
299302   state_save_register_global(votrax_queuepos);
300303}
src/mame/audio/mw8080bw.c
r3232r3233
40004000
40014001
40024002MACHINE_DRIVER_START( invad2ct_audio )
4003   MDRV_SPEAKER_STANDARD_STEREO("#1", "#2")
4003   MDRV_SPEAKER_STANDARD_STEREO("spk1", "spk2")
40044004
40054005   MDRV_SOUND_ADD("discrete", DISCRETE, 0)
40064006   MDRV_SOUND_CONFIG_DISCRETE(invad2ct)
4007   MDRV_SOUND_ROUTE(0, "#1", 0.5)
4008   MDRV_SOUND_ROUTE(1, "#2", 0.5)
4007   MDRV_SOUND_ROUTE(0, "spk1", 0.5)
4008   MDRV_SOUND_ROUTE(1, "spk2", 0.5)
40094009
40104010   MDRV_SOUND_ADD("sn1", SN76477, 0)
40114011   MDRV_SOUND_CONFIG(invad2ct_p1_sn76477_interface)
4012   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "#1", 0.3)
4012   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "spk1", 0.3)
40134013
40144014   MDRV_SOUND_ADD("sn2", SN76477, 0)
40154015   MDRV_SOUND_CONFIG(invad2ct_p2_sn76477_interface)
4016   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "#2", 0.3)
4016   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "spk2", 0.3)
40174017MACHINE_DRIVER_END
40184018
40194019
src/mame/machine/fd1089.c
r3232r3233
130130   int s7,s6,s5,s4,s3,s2,s1,s0;
131131};
132132
133static UINT8 basetable_fd1089[0x100] =
133static const UINT8 basetable_fd1089[0x100] =
134134{
135135   0x00,0x1c,0x76,0x6a,0x5e,0x42,0x24,0x38,0x4b,0x67,0xad,0x81,0xe9,0xc5,0x03,0x2f,
136136   0x45,0x69,0xaf,0x83,0xe7,0xcb,0x01,0x2d,0x02,0x1e,0x78,0x64,0x5c,0x40,0x2a,0x36,
r3232r3233
426426
427427void fd1089a_decrypt(running_machine *machine)
428428{
429   sys16_decrypt(machine, memory_region(machine, "fd1089a_key"), FD1089A);
429   sys16_decrypt(machine, memory_region(machine, "fd1089a"), FD1089A);
430430}
431431
432432void fd1089b_decrypt(running_machine *machine)
433433{
434   sys16_decrypt(machine, memory_region(machine, "fd1089b_key"), FD1089B);
434   sys16_decrypt(machine, memory_region(machine, "fd1089b"), FD1089B);
435435}
436436
src/mame/machine/bublbobl.c
r3232r3233
216216WRITE8_HANDLER( bublbobl_mcu_port2_w )
217217{
218218//logerror("%04x: 6801U4 port 2 write %02x\n",activecpu_get_pc(),data);
219   static const char *portnames[] = { "DSW0", "DSW1", "IN1", "IN2" };
219   static const char *const portnames[] = { "DSW0", "DSW1", "IN1", "IN2" };
220220
221221   // bits 0-3: bits 8-11 of shared RAM address
222222
r3232r3233
430430WRITE8_HANDLER( bublbobl_68705_portB_w )
431431{
432432//logerror("%04x: 68705 port B write %02x\n",activecpu_get_pc(),data);
433   static const char *portnames[] = { "DSW0", "DSW1", "IN1", "IN2" };
433   static const char *const portnames[] = { "DSW0", "DSW1", "IN1", "IN2" };
434434
435435   if ((ddrB & 0x01) && (~data & 0x01) && (portB_out & 0x01))
436436   {
src/mame/machine/midyunit.c
r3232r3233
141141
142142READ16_HANDLER( midyunit_input_r )
143143{
144   static const char *portnames[] = { "IN0", "IN1", "IN2", "DSW", "UNK0", "UNK1" };
144   static const char *const portnames[] = { "IN0", "IN1", "IN2", "DSW", "UNK0", "UNK1" };
145145
146146   return input_port_read(machine, portnames[offset]);
147147}
r3232r3233
156156
157157static READ16_HANDLER( term2_input_r )
158158{
159   static const char *portnames[] = { "IN0", "IN1", NULL, "DSW", "UNK0", "UNK1" };
159   static const char *const portnames[] = { "IN0", "IN1", NULL, "DSW", "UNK0", "UNK1" };
160160
161161   if (offset != 2)
162162      return input_port_read(machine, portnames[offset]);
src/mame/machine/decocass.c
r3232r3233
205205READ8_HANDLER( decocass_input_r )
206206{
207207   UINT8 data = 0xff;
208   static const char *portnames[] = { "IN0", "IN1", "IN2" };
208   static const char *const portnames[] = { "IN0", "IN1", "IN2" };
209209
210210   switch (offset & 7)
211211   {
src/mame/machine/leland.c
r3232r3233
293293
294294READ8_HANDLER( ataxx_trackball_r )
295295{
296   static const char *tracknames[] = { "AN0", "AN1", "AN2", "AN3" };
296   static const char *const tracknames[] = { "AN0", "AN1", "AN2", "AN3" };
297297
298298   return dial_compute_value(input_port_read(machine, tracknames[offset]), offset);
299299}
r3232r3233
308308
309309READ8_HANDLER( indyheat_wheel_r )
310310{
311   static const char *tracknames[] = { "AN0", "AN1", "AN2" };
311   static const char *const tracknames[] = { "AN0", "AN1", "AN2" };
312312
313313   return dial_compute_value(input_port_read(machine, tracknames[offset]), offset);
314314}
r3232r3233
337337
338338WRITE8_HANDLER( indyheat_analog_w )
339339{
340   static const char *tracknames[] = { "AN3", "AN4", "AN5" };
340   static const char *const tracknames[] = { "AN3", "AN4", "AN5" };
341341
342342   switch (offset)
343343   {
r3232r3233
11131113
11141114WRITE8_HANDLER( leland_master_analog_key_w )
11151115{
1116   static const char *portnames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5" };
1116   static const char *const portnames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5" };
11171117
11181118   switch (offset)
11191119   {
src/mame/machine/neoboot.c
r3232r3233
135135
136136static UINT16 kof10thExtraRAMB[0x01000];
137137
138static void kof10thBankswitch(UINT16 nBank)
138static void kof10thBankswitch(running_machine *machine, UINT16 nBank)
139139{
140140   UINT32 bank = 0x100000 + ((nBank & 7) << 20);
141141   if (bank >= 0x700000)
142142      bank = 0x100000;
143   neogeo_set_main_cpu_bank_address(bank);
143   neogeo_set_main_cpu_bank_address(machine, bank);
144144}
145145
146146static READ16_HANDLER( kof10th_RAMB_r )
r3232r3233
163163{
164164   if (offset >= 0x5F000) {
165165      if (offset == 0x5FFF8) { // Standard bankswitch
166         kof10thBankswitch(data);
166         kof10thBankswitch(machine, data);
167167      } else if (offset == 0x5FFFC && kof10thExtraRAMB[0xFFC] != data) { // Special bankswitch
168168         UINT8 *src = memory_region( machine, "main" );
169169         memcpy (src + 0x10000,  src + ((data & 1) ? 0x810000 : 0x710000), 0xcffff);
r3232r3233
209209   int i;
210210   UINT16 *rom = (UINT16*)memory_region(machine, "main");
211211   UINT8  *src = memory_region(machine, "main");
212   UINT16 *buf = (UINT16*)memory_region(machine, "audioencrypted");
212   UINT16 *buf = (UINT16*)memory_region(machine, "audiocrypt");
213213   UINT8 *srom = (UINT8*)memory_region(machine, "fixed");
214214   UINT8 *sbuf = malloc_or_die(0x20000);
215215
r3232r3233
421421   if (offset == 0)
422422   {
423423      bankaddress = 0x100000 + cthd2003_banks[data&7]*0x100000;
424      neogeo_set_main_cpu_bank_address(bankaddress);
424      neogeo_set_main_cpu_bank_address(machine, bankaddress);
425425   }
426426}
427427
r3232r3233
647647   if ((offset == 0)&&(data == 0xa0))
648648   {
649649      bankaddress=0xa0;
650      neogeo_set_main_cpu_bank_address(bankaddress);
650      neogeo_set_main_cpu_bank_address(machine, bankaddress);
651651      logerror("offset: %06x PC %06x: set banking %04x\n\n",offset,activecpu_get_pc(),bankaddress);
652652   }
653653   else if(offset == 2)
r3232r3233
655655      data=data>>4;
656656      //data=data&7;
657657      bankaddress=data*0x100000;
658      neogeo_set_main_cpu_bank_address(bankaddress);
658      neogeo_set_main_cpu_bank_address(machine, bankaddress);
659659      logerror("offset: %06x PC %06x: set banking %04x\n\n",offset,activecpu_get_pc(),bankaddress);
660660   }
661661}
r3232r3233
832832{
833833    UINT32 bankaddress = (mv0_bank_ram[ 0 ] >> 8) + (mv0_bank_ram[ 1 ] << 8) + 0x100000;
834834   COMBINE_DATA( &mv0_bank_ram[ offset ] );
835    neogeo_set_main_cpu_bank_address( bankaddress );
835    neogeo_set_main_cpu_bank_address( machine, bankaddress );
836836}
837837#endif
838838
r3232r3233
862862      cr[BYTE_XOR_LE(0x1ff0)] =  0xa0;
863863      cr[BYTE_XOR_LE(0x1ff1)] &= 0xfe;
864864      cr[BYTE_XOR_LE(0x1ff3)] &= 0x7f;
865      neogeo_set_main_cpu_bank_address(address+0x100000);
865      neogeo_set_main_cpu_bank_address(machine, address+0x100000);
866866
867867      mem[BYTE_XOR_LE(0x58196)] = prt;
868868   }
r3232r3233
879879
880880      cr[BYTE_XOR_LE(0x1ff0)] &= 0xfe;
881881      cr[BYTE_XOR_LE(0x1ff3)] &= 0x7f;
882      neogeo_set_main_cpu_bank_address(address+0x100000);
882      neogeo_set_main_cpu_bank_address(machine, address+0x100000);
883883
884884      mem[BYTE_XOR_LE(0x58196)] = prt;
885885   }
src/mame/machine/midtunit.c
r3232r3233
105105
106106READ16_HANDLER( midtunit_input_r )
107107{
108   static const char *portnames[] = { "IN0", "IN1", "IN2", "DSW" };
108   static const char *const portnames[] = { "IN0", "IN1", "IN2", "DSW" };
109109
110110   return input_port_read(machine, portnames[offset]);
111111}
src/mame/machine/carpolo.c
r3232r3233
259259   {
260260      int movement_flip_flop = TTL7474_1F_1 + (2 * player);
261261      int dir_flip_flop      = movement_flip_flop + 1;
262      static const char *portnames[] = { "DIAL0", "DIAL1", "DIAL2", "DIAL3" };
262      static const char *const portnames[] = { "DIAL0", "DIAL1", "DIAL2", "DIAL3" };
263263
264264      port_value = input_port_read(machine, portnames[player]);
265265
src/mame/machine/fddebug.c
r3232r3233
261261
262262static int instruction_hook(offs_t curpc);
263263
264static void execute_fdsave(int ref, int params, const char **param);
265static void execute_fdoutput(int ref, int params, const char **param);
266static void execute_fdseed(int ref, int params, const char **param);
267static void execute_fdlockguess(int ref, int params, const char **param);
268static void execute_fdeliminate(int ref, int params, const char **param);
269static void execute_fdunlock(int ref, int params, const char **param);
270static void execute_fdignore(int ref, int params, const char **param);
271static void execute_fdundo(int ref, int params, const char **param);
272static void execute_fdstatus(int ref, int params, const char **param);
273static void execute_fdstate(int ref, int params, const char **param);
274static void execute_fdpc(int ref, int params, const char **param);
275static void execute_fdsearch(int ref, int params, const char **param);
276static void execute_fddasm(int ref, int params, const char **param);
277static void execute_fdcset(int ref, int params, const char **param);
278static void execute_fdclist(int ref, int params, const char **param);
279static void execute_fdcsearch(int ref, int params, const char **param);
264static void execute_fdsave(running_machine *machine, int ref, int params, const char **param);
265static void execute_fdoutput(running_machine *machine, int ref, int params, const char **param);
266static void execute_fdseed(running_machine *machine, int ref, int params, const char **param);
267static void execute_fdlockguess(running_machine *machine, int ref, int params, const char **param);
268static void execute_fdeliminate(running_machine *machine, int ref, int params, const char **param);
269static void execute_fdunlock(running_machine *machine, int ref, int params, const char **param);
270static void execute_fdignore(running_machine *machine, int ref, int params, const char **param);
271static void execute_fdundo(running_machine *machine, int ref, int params, const char **param);
272static void execute_fdstatus(running_machine *machine, int ref, int params, const char **param);
273static void execute_fdstate(running_machine *machine, int ref, int params, const char **param);
274static void execute_fdpc(running_machine *machine, int ref, int params, const char **param);
275static void execute_fdsearch(running_machine *machine, int ref, int params, const char **param);
276static void execute_fddasm(running_machine *machine, int ref, int params, const char **param);
277static void execute_fdcset(running_machine *machine, int ref, int params, const char **param);
278static void execute_fdclist(running_machine *machine, int ref, int params, const char **param);
279static void execute_fdcsearch(running_machine *machine, int ref, int params, const char **param);
280280
281static fd1094_possibility *try_all_possibilities(int basepc, int offset, int length, UINT8 *instrbuffer, UINT8 *keybuffer, fd1094_possibility *possdata);
281static fd1094_possibility *try_all_possibilities(running_machine *machine, int basepc, int offset, int length, UINT8 *instrbuffer, UINT8 *keybuffer, fd1094_possibility *possdata);
282282static void tag_possibility(fd1094_possibility *possdata, UINT8 status);
283283
284284static void perform_constrained_search(void);
r3232r3233
288288static UINT32 reconstruct_base_seed(int keybaseaddr, UINT32 startseed);
289289
290290static void build_optable(void);
291static int validate_ea(UINT32 pc, UINT8 modereg, const UINT8 *parambase, UINT32 flags);
292static int validate_opcode(UINT32 pc, const UINT8 *opdata, int maxwords);
291static int validate_ea(running_machine *machine, UINT32 pc, UINT8 modereg, const UINT8 *parambase, UINT32 flags);
292static int validate_opcode(running_machine *machine, UINT32 pc, const UINT8 *opdata, int maxwords);
293293
294294
295295
r3232r3233
430430    0=no, 1=yes, 2=unlikely
431431-----------------------------------------------*/
432432
433INLINE int pc_is_valid(UINT32 pc, UINT32 flags)
433INLINE int pc_is_valid(running_machine *machine, UINT32 pc, UINT32 flags)
434434{
435435   /* if we're odd or out of range, fail */
436436   if ((pc & 1) == 1)
437437      return 0;
438438   if (pc & 0xff000000)
439439      return 0;
440   if (memory_get_op_ptr(cpu_getactivecpu(), pc, 0) == NULL)
440   if (memory_get_op_ptr(machine, cpu_getactivecpu(), pc, 0) == NULL)
441441      return 0;
442442   return 1;
443443}
r3232r3233
448448    valid? 0=no, 1=yes, 2=unlikely
449449-----------------------------------------------*/
450450
451INLINE int addr_is_valid(UINT32 addr, UINT32 flags)
451INLINE int addr_is_valid(running_machine *machine, UINT32 addr, UINT32 flags)
452452{
453453   /* if this a JMP, the address is a PC */
454454   if (flags & OF_JMP)
455      return pc_is_valid(addr, flags);
455      return pc_is_valid(machine, addr, flags);
456456
457457   /* if we're odd or out of range, fail */
458458   if ((flags & OF_SIZEMASK) != OF_BYTE && (addr & 1) == 1)
r3232r3233
518518   load_overlay_file(machine);
519519
520520   /* add some commands */
521   debug_console_register_command("fdsave", CMDFLAG_NONE, 0, 0, 0, execute_fdsave);
522   debug_console_register_command("fdoutput", CMDFLAG_NONE, 0, 1, 1, execute_fdoutput);
523   debug_console_register_command("fdseed", CMDFLAG_NONE, 0, 2, 2, execute_fdseed);
524   debug_console_register_command("fdguess", CMDFLAG_NONE, STATUS_GUESS, 1, 1, execute_fdlockguess);
525   debug_console_register_command("fdlock", CMDFLAG_NONE, STATUS_LOCKED, 1, 1, execute_fdlockguess);
526   debug_console_register_command("fdeliminate", CMDFLAG_NONE, 0, 1, 10, execute_fdeliminate);
527   debug_console_register_command("fdunlock", CMDFLAG_NONE, 0, 1, 1, execute_fdunlock);
528   debug_console_register_command("fdignore", CMDFLAG_NONE, 0, 0, 1, execute_fdignore);
529   debug_console_register_command("fdundo", CMDFLAG_NONE, 0, 0, 0, execute_fdundo);
530   debug_console_register_command("fdstatus", CMDFLAG_NONE, 0, 0, 0, execute_fdstatus);
531   debug_console_register_command("fdstate", CMDFLAG_NONE, 0, 0, 1, execute_fdstate);
532   debug_console_register_command("fdpc", CMDFLAG_NONE, 0, 0, 1, execute_fdpc);
533   debug_console_register_command("fdsearch", CMDFLAG_NONE, 0, 0, 0, execute_fdsearch);
534   debug_console_register_command("fddasm", CMDFLAG_NONE, 0, 1, 1, execute_fddasm);
535   debug_console_register_command("fdcset", CMDFLAG_NONE, 0, 2, 4, execute_fdcset);
536   debug_console_register_command("fdclist", CMDFLAG_NONE, 0, 0, 0, execute_fdclist);
537   debug_console_register_command("fdcsearch", CMDFLAG_NONE, 0, 0, 0, execute_fdcsearch);
521   debug_console_register_command(machine, "fdsave", CMDFLAG_NONE, 0, 0, 0, execute_fdsave);
522   debug_console_register_command(machine, "fdoutput", CMDFLAG_NONE, 0, 1, 1, execute_fdoutput);
523   debug_console_register_command(machine, "fdseed", CMDFLAG_NONE, 0, 2, 2, execute_fdseed);
524   debug_console_register_command(machine, "fdguess", CMDFLAG_NONE, STATUS_GUESS, 1, 1, execute_fdlockguess);
525   debug_console_register_command(machine, "fdlock", CMDFLAG_NONE, STATUS_LOCKED, 1, 1, execute_fdlockguess);
526   debug_console_register_command(machine, "fdeliminate", CMDFLAG_NONE, 0, 1, 10, execute_fdeliminate);
527   debug_console_register_command(machine, "fdunlock", CMDFLAG_NONE, 0, 1, 1, execute_fdunlock);
528   debug_console_register_command(machine, "fdignore", CMDFLAG_NONE, 0, 0, 1, execute_fdignore);
529   debug_console_register_command(machine, "fdundo", CMDFLAG_NONE, 0, 0, 0, execute_fdundo);
530   debug_console_register_command(machine, "fdstatus", CMDFLAG_NONE, 0, 0, 0, execute_fdstatus);
531   debug_console_register_command(machine, "fdstate", CMDFLAG_NONE, 0, 0, 1, execute_fdstate);
532   debug_console_register_command(machine, "fdpc", CMDFLAG_NONE, 0, 0, 1, execute_fdpc);
533   debug_console_register_command(machine, "fdsearch", CMDFLAG_NONE, 0, 0, 0, execute_fdsearch);
534   debug_console_register_command(machine, "fddasm", CMDFLAG_NONE, 0, 1, 1, execute_fddasm);
535   debug_console_register_command(machine, "fdcset", CMDFLAG_NONE, 0, 2, 4, execute_fdcset);
536   debug_console_register_command(machine, "fdclist", CMDFLAG_NONE, 0, 0, 0, execute_fdclist);
537   debug_console_register_command(machine, "fdcsearch", CMDFLAG_NONE, 0, 0, 0, execute_fdcsearch);
538538
539539   /* set up the instruction hook */
540540   debug_cpu_set_instruction_hook(0, instruction_hook);
r3232r3233
722722   }
723723
724724   /* try all possible decodings at the current pc */
725   posscount = try_all_possibilities(curpc, 0, 0, instrbuffer, keybuffer, posslist) - posslist;
725   posscount = try_all_possibilities(Machine, curpc, 0, 0, instrbuffer, keybuffer, posslist) - posslist;
726726   if (keydirty)
727727      fd1094_regenerate_key();
728728
r3232r3233
744744    execute_fdsave - handle the 'fdsave' command
745745-----------------------------------------------*/
746746
747static void execute_fdsave(int ref, int params, const char **param)
747static void execute_fdsave(running_machine *machine, int ref, int params, const char **param)
748748{
749   save_overlay_file(Machine);
749   save_overlay_file(machine);
750750   debug_console_printf("File saved\n");
751751}
752752
r3232r3233
756756    to a file
757757-----------------------------------------------*/
758758
759static void execute_fdoutput(int ref, int params, const char **param)
759static void execute_fdoutput(running_machine *machine, int ref, int params, const char **param)
760760{
761761   file_error filerr;
762762   mame_file *file;
r3232r3233
780780    execute_fdseed - handle the 'fdseed' command
781781-----------------------------------------------*/
782782
783static void execute_fdseed(int ref, int params, const char **param)
783static void execute_fdseed(running_machine *machine, int ref, int params, const char **param)
784784{
785785   UINT64 num1, num2;
786786
r3232r3233
807807    and 'fdguess' commands
808808-----------------------------------------------*/
809809
810static void execute_fdlockguess(int ref, int params, const char **param)
810static void execute_fdlockguess(running_machine *machine, int ref, int params, const char **param)
811811{
812812   UINT64 num1;
813813
r3232r3233
836836    'fdeliminate' command
837837-----------------------------------------------*/
838838
839static void execute_fdeliminate(int ref, int params, const char **param)
839static void execute_fdeliminate(running_machine *machine, int ref, int params, const char **param)
840840{
841841   int pnum, posssrc, possdst;
842842   int plist[10];
r3232r3233
887887    command
888888-----------------------------------------------*/
889889
890static void execute_fdunlock(int ref, int params, const char **param)
890static void execute_fdunlock(running_machine *machine, int ref, int params, const char **param)
891891{
892892   int reps = keystatus_words / KEY_SIZE;
893893   int keyaddr, repnum;
r3232r3233
924924    command
925925-----------------------------------------------*/
926926
927static void execute_fdignore(int ref, int params, const char **param)
927static void execute_fdignore(running_machine *machine, int ref, int params, const char **param)
928928{
929929   UINT64 offset;
930930
r3232r3233
957957    command
958958-----------------------------------------------*/
959959
960static void execute_fdundo(int ref, int params, const char **param)
960static void execute_fdundo(running_machine *machine, int ref, int params, const char **param)
961961{
962962   /* copy the undobuffer back and regenerate the key */
963963   memcpy(keystatus, undobuff, keystatus_words * 2);
r3232r3233
971971    command
972972-----------------------------------------------*/
973973
974static void execute_fdstatus(int ref, int params, const char **param)
974static void execute_fdstatus(running_machine *machine, int ref, int params, const char **param)
975975{
976976   int numreps = keystatus_words / KEY_SIZE;
977977   int locked = 4, nomatter = 0, guesses = 0;
r3232r3233
10031003    command
10041004-----------------------------------------------*/
10051005
1006static void execute_fdstate(int ref, int params, const char **param)
1006static void execute_fdstate(running_machine *machine, int ref, int params, const char **param)
10071007{
10081008   UINT64 newstate;
10091009
r3232r3233
10281028    command
10291029-----------------------------------------------*/
10301030
1031static void execute_fdpc(int ref, int params, const char **param)
1031static void execute_fdpc(running_machine *machine, int ref, int params, const char **param)
10321032{
10331033   UINT64 newpc;
10341034
r3232r3233
10491049    command
10501050-----------------------------------------------*/
10511051
1052static void execute_fdsearch(int ref, int params, const char **param)
1052static void execute_fdsearch(running_machine *machine, int ref, int params, const char **param)
10531053{
10541054   int pc = activecpu_get_pc();
10551055   int length, first = TRUE;
r3232r3233
11021102      instrdata[1] = decoded;
11031103
11041104      /* get the opcode */
1105      length = validate_opcode(pc, instrdata, 1);
1105      length = validate_opcode(machine, pc, instrdata, 1);
11061106      if (length < 0)
11071107         length = -length;
11081108      if (length == 0)
r3232r3233
11741174    command
11751175-----------------------------------------------*/
11761176
1177static void execute_fddasm(int ref, int params, const char **param)
1177static void execute_fddasm(running_machine *machine, int ref, int params, const char **param)
11781178{
11791179   int origstate = fd1094_set_state(keyregion, -1);
11801180   const char *filename;
r3232r3233
12621262      if (unknowns > 0)
12631263      {
12641264         UINT8 keybuffer[5];
1265         int posscount = try_all_possibilities(pcaddr * 2, 0, 0, instrbuffer, keybuffer, posslist) - posslist;
1265         int posscount = try_all_possibilities(machine, pcaddr * 2, 0, 0, instrbuffer, keybuffer, posslist) - posslist;
12661266         for (pnum = 0; pnum < posscount; pnum++)
12671267            if (strcmp(disasm, posslist[pnum].dasm) != 0)
12681268            {
r3232r3233
12911291    command
12921292-----------------------------------------------*/
12931293
1294static void execute_fdcset(int ref, int params, const char **param)
1294static void execute_fdcset(running_machine *machine, int ref, int params, const char **param)
12951295{
12961296   UINT64 pc, value, mask = 0xffff, state = FD1094_STATE_RESET;
12971297   int cnum;
r3232r3233
13491349    command
13501350-----------------------------------------------*/
13511351
1352static void execute_fdclist(int ref, int params, const char **param)
1352static void execute_fdclist(running_machine *machine, int ref, int params, const char **param)
13531353{
13541354   int cnum;
13551355
r3232r3233
13681368    command
13691369-----------------------------------------------*/
13701370
1371static void execute_fdcsearch(int ref, int params, const char **param)
1371static void execute_fdcsearch(running_machine *machine, int ref, int params, const char **param)
13721372{
13731373//  debug_console_printf("Searching for possible global keys....\n");
13741374   perform_constrained_search();
r3232r3233
13821382    length
13831383-----------------------------------------------*/
13841384
1385static fd1094_possibility *try_all_possibilities(int basepc, int offset, int length, UINT8 *instrbuffer, UINT8 *keybuffer, fd1094_possibility *possdata)
1385static fd1094_possibility *try_all_possibilities(running_machine *machine, int basepc, int offset, int length, UINT8 *instrbuffer, UINT8 *keybuffer, fd1094_possibility *possdata)
13861386{
13871387   UINT8 keymask, keystat;
13881388   UINT16 possvalue[4];
r3232r3233
14571457         /* first make sure we are a valid instruction */
14581458         if ((possvalue[i] & 0xf000) == 0xa000 || (possvalue[i] & 0xf000) == 0xf000)
14591459            continue;
1460         length = validate_opcode(basepc, instrbuffer, 1);
1460         length = validate_opcode(machine, basepc, instrbuffer, 1);
14611461         if (length == 0)
14621462            continue;
14631463         if (length < 0)
r3232r3233
14661466
14671467      /* if we're not at our target length, recursively call ourselves */
14681468      if (offset < length - 1)
1469         possdata = try_all_possibilities(basepc, offset + 1, length, instrbuffer, keybuffer, possdata);
1469         possdata = try_all_possibilities(machine, basepc, offset + 1, length, instrbuffer, keybuffer, possdata);
14701470
14711471      /* otherwise, output what we have */
14721472      else
r3232r3233
14771477         m68k_disassemble_raw(possdata->dasm, basepc, instrbuffer, instrbuffer, M68K_CPU_TYPE_68000);
14781478
14791479         /* validate the opcode */
1480         tlen = validate_opcode(basepc, instrbuffer, length);
1480         tlen = validate_opcode(machine, basepc, instrbuffer, length);
14811481         if (tlen == 0)
14821482         {
14831483            printf("Eliminated: %s [", possdata->dasm);
r3232r3233
22232223    valid or not, and return the length
22242224-----------------------------------------------*/
22252225
2226static int validate_ea(UINT32 pc, UINT8 modereg, const UINT8 *parambase, UINT32 flags)
2226static int validate_ea(running_machine *machine, UINT32 pc, UINT8 modereg, const UINT8 *parambase, UINT32 flags)
22272227{
22282228   UINT32 addr;
22292229   int valid;
r3232r3233
22562256         {
22572257            case 0:   /* (xxx).W -- make sure it is not odd for word/long */
22582258               addr = (INT16)((parambase[0] << 8) | parambase[1]);
2259               valid = addr_is_valid(addr & 0xffffff, flags);
2259               valid = addr_is_valid(machine, addr & 0xffffff, flags);
22602260               return (valid == 0) ? 1000 : (valid == 2) ? -1 : 1;
22612261
22622262            case 1:   /* (xxx).L -- make sure it is not odd for word/long, and make sure upper byte of addr is 0 */
2263               valid = addr_is_valid((parambase[0] << 24) | (parambase[1] << 16) | (parambase[2] << 8) | parambase[3], flags);
2263               valid = addr_is_valid(machine, (parambase[0] << 24) | (parambase[1] << 16) | (parambase[2] << 8) | parambase[3], flags);
22642264               return (valid == 0) ? 1000 : (valid == 2) ? -2 : 2;
22652265
22662266            case 2:   /* (d16,PC) -- make sure it is not odd for word/long */
2267               valid = addr_is_valid(pc + (INT16)((parambase[0] << 8) | parambase[1]), flags);
2267               valid = addr_is_valid(machine, pc + (INT16)((parambase[0] << 8) | parambase[1]), flags);
22682268               return (valid == 0) ? 1000 : (valid == 2) ? -1 : 1;
22692269
22702270            case 3:   /* (d8,PC,Xn) -- odd displacements are a warning for word/long */
r3232r3233
22932293    the length specified
22942294-----------------------------------------------*/
22952295
2296static int validate_opcode(UINT32 pc, const UINT8 *opdata, int maxwords)
2296static int validate_opcode(running_machine *machine, UINT32 pc, const UINT8 *opdata, int maxwords)
22972297{
22982298   UINT32 immvalue = 0;
22992299   int iffy = FALSE;
r3232r3233
23702370         pc += immvalue;
23712371
23722372      /* if we're odd or out of range, fail */
2373      valid = pc_is_valid(pc, flags);
2373      valid = pc_is_valid(machine, pc, flags);
23742374      if (valid == 0)
23752375         return 0;
23762376      if (valid == 2)
r3232r3233
23812381   if (flags & (OF_EASRC | OF_EADST))
23822382   {
23832383      int modereg = opcode & 0x003f;
2384      int ealen = validate_ea(pc + offset*2, modereg, &opdata[offset*2], flags);
2384      int ealen = validate_ea(machine, pc + offset*2, modereg, &opdata[offset*2], flags);
23852385
23862386      /* if the ea was invalid, forward that result */
23872387      if (ealen == 1000)
r3232r3233
24022402   if (flags & OF_MOVE)
24032403   {
24042404      int modereg = ((opcode & 0x01c0) >> 3) | ((opcode & 0x0e00) >> 9);
2405      int ealen = validate_ea(pc + offset*2, modereg, &opdata[offset*2], flags);
2405      int ealen = validate_ea(machine, pc + offset*2, modereg, &opdata[offset*2], flags);
24062406
24072407      /* if the ea was invalid, forward that result */
24082408      if (ealen == 1000)
src/mame/machine/n64.c
r3232r3233
11731173         UINT16 buttons = 0;
11741174         INT8 x = 0, y = 0;
11751175         /* add here tags for P2, P3 and P4 when implemented */
1176         static const char *portnames[] = { "P1", "P1_ANALOG_X", "P1_ANALOG_Y" };
1176         static const char *const portnames[] = { "P1", "P1_ANALOG_X", "P1_ANALOG_Y" };
11771177
11781178         if (slength != 1 || rlength != 4)
11791179         {
src/mame/machine/balsente.c
r3232r3233
604604INTERRUPT_GEN( balsente_update_analog_inputs )
605605{
606606   int i;
607   static const char *analog[] = { "AN0", "AN1", "AN2", "AN3" };
607   static const char *const analog[] = { "AN0", "AN1", "AN2", "AN3" };
608608
609609   /* the analog input system helpfully scales the value read by the percentage of time */
610610   /* into the current frame we are; unfortunately, this is bad for us, since the analog */
src/mame/machine/vsnes.c
r3232r3233
2121static const UINT8 *remapped_colortable;
2222
2323static int sound_fix=0;
24static UINT8 last_bank;
25
2426/*************************************
2527 *
2628 *  Color Mapping
r3232r3233
220222
221223MACHINE_RESET( vsnes )
222224{
225   last_bank = 0xff;
226   sound_fix = 0;
223227   input_latch[0] = input_latch[1] = 0;
224228   input_latch[2] = input_latch[3] = 0;
225229
r3232r3233
854858
855859static WRITE8_HANDLER( mapper4_w )
856860{
857   static UINT8 last_bank = 0xff;
858
859861   switch (offset & 0x7001)
860862   {
861863      case 0x0000: /* $8000 */
src/mame/machine/vertigo.c
r3232r3233
120120
121121READ16_HANDLER( vertigo_io_convert )
122122{
123   static const char *adcnames[] = { "P1X", "P1Y", "PADDLE" };
123   static const char *const adcnames[] = { "P1X", "P1Y", "PADDLE" };
124124
125125   if (offset > 2)
126126      adc_result = 0;
src/mame/machine/neoprot.c
r3232r3233
213213
214214   bankaddress = 0x100000 + bankoffset[data];
215215
216   neogeo_set_main_cpu_bank_address(bankaddress);
216   neogeo_set_main_cpu_bank_address(machine, bankaddress);
217217}
218218
219219
r3232r3233
250250
251251   bankaddress = 0x100000 + bankoffset[data];
252252
253   neogeo_set_main_cpu_bank_address(bankaddress);
253   neogeo_set_main_cpu_bank_address(machine, bankaddress);
254254}
255255
256256
r3232r3233
289289
290290   bankaddress = 0x100000 + bankoffset[data];
291291
292   neogeo_set_main_cpu_bank_address(bankaddress);
292   neogeo_set_main_cpu_bank_address(machine, bankaddress);
293293}
294294
295295
r3232r3233
325325
326326   bankaddress = 0x100000 + bankoffset[data];
327327
328   neogeo_set_main_cpu_bank_address(bankaddress);
328   neogeo_set_main_cpu_bank_address(machine, bankaddress);
329329}
330330
331331
r3232r3233
357357
358358   bankaddress = 0x100000 + bankoffset[data];
359359
360   neogeo_set_main_cpu_bank_address(bankaddress);
360   neogeo_set_main_cpu_bank_address(machine, bankaddress);
361361}
362362
363363
r3232r3233
490490}
491491
492492
493static void pvc_write_bankswitch( void )
493static void pvc_write_bankswitch( running_machine *machine )
494494{
495495   UINT32 bankaddress;
496496   bankaddress = ((pvc_cartridge_ram[0xff8]>>8)|(pvc_cartridge_ram[0xff9]<<8));
497497   *(((UINT8 *)pvc_cartridge_ram) + BYTE_XOR_LE(0x1ff0)) = 0xa0;
498498   *(((UINT8 *)pvc_cartridge_ram) + BYTE_XOR_LE(0x1ff1)) &= 0xfe;
499499   *(((UINT8 *)pvc_cartridge_ram) + BYTE_XOR_LE(0x1ff3)) &= 0x7f;
500   neogeo_set_main_cpu_bank_address(bankaddress+0x100000);
500   neogeo_set_main_cpu_bank_address(machine, bankaddress+0x100000);
501501}
502502
503503
r3232r3233
512512   COMBINE_DATA( &pvc_cartridge_ram[ offset ] );
513513   if (offset == 0xff0)pvc_prot1();
514514   else if(offset >= 0xff4 && offset <= 0xff5)pvc_prot2();
515   else if(offset >= 0xff8)pvc_write_bankswitch();
515   else if(offset >= 0xff8)pvc_write_bankswitch(machine);
516516}
517517
518518
src/mame/machine/midwunit.c
r3232r3233
179179
180180READ16_HANDLER( midwunit_io_r )
181181{
182   static const char *portnames[] = { "IN0", "IN1", "DSW", "IN2" };
182   static const char *const portnames[] = { "IN0", "IN1", "DSW", "IN2" };
183183
184184   /* apply I/O shuffling */
185185   offset = ioshuffle[offset % 16];
r3232r3233
205205
206206READ16_HANDLER( midxunit_io_r )
207207{
208   static const char *portnames[] = { "IN0", "IN1", "IN2", "DSW" };
208   static const char *const portnames[] = { "IN0", "IN1", "IN2", "DSW" };
209209
210210   offset = (offset / 2) % 8;
211211
r3232r3233
227227
228228READ16_HANDLER( midxunit_analog_r )
229229{
230   static const char *portnames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5" };
230   static const char *const portnames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5" };
231231
232232   return input_port_read(machine, portnames[midxunit_analog_port]);
233233}
src/mame/machine/namco50.h
r3232r3233
11#ifndef NAMCO50_H
22#define NAMCO50_H
33
4#define CPUTAG_50XX "50XX"
5#define CPUTAG_50XX_2 "50XX_2"
4#define CPUTAG_50XX "50xx"
5#define CPUTAG_50XX_2 "50xx_2"
66
77ADDRESS_MAP_EXTERN( namco_50xx_map_program, 8 );
88ADDRESS_MAP_EXTERN( namco_50xx_map_data, 8 );
src/mame/machine/galaxold.c
r3232r3233
248248
249249CUSTOM_INPUT( _4in1_fake_port_r )
250250{
251   static const char *portnames[] = { "FAKE1", "FAKE2", "FAKE3", "FAKE4" };
251   static const char *const portnames[] = { "FAKE1", "FAKE2", "FAKE3", "FAKE4" };
252252   int bit_mask = (FPTR)param;
253253
254254   return (input_port_read(field->port->machine, portnames[_4in1_bank]) & bit_mask) ? 0x01 : 0x00;
src/mame/machine/harddriv.c
r3232r3233
432432
433433WRITE16_HANDLER( hd68k_adc_control_w )
434434{
435   static const char *adc8names[] = { "8BADC0", "8BADC1", "8BADC2", "8BADC3", "8BADC4", "8BADC5", "8BADC6", "8BADC7" };
436   static const char *adc12names[] = { "12BADC0", "12BADC1", "12BADC2", "12BADC3" };
435   static const char *const adc8names[] = { "8BADC0", "8BADC1", "8BADC2", "8BADC3", "8BADC4", "8BADC5", "8BADC6", "8BADC7" };
436   static const char *const adc12names[] = { "12BADC0", "12BADC1", "12BADC2", "12BADC3" };
437437
438438   COMBINE_DATA(&adc_control);
439439
src/mame/machine/ajax.c
r3232r3233
109109READ8_HANDLER( ajax_ls138_f10_r )
110110{
111111   int data = 0, index;
112   static const char *portnames[] = { "SYSTEM", "P1", "DSW1", "DSW2" };
112   static const char *const portnames[] = { "SYSTEM", "P1", "DSW1", "DSW2" };
113113
114114   switch ((offset & 0x01c0) >> 6)
115115   {
src/mame/mamedriv.c
r3232r3233
322322   DRIVER( jumpcoat )   /* (c) 1983 Taito */
323323   DRIVER( boggy84 )   /* bootleg, original is (c)1983 Taito/Kaneko */
324324   DRIVER( redrobin )   /* (c) 1986 Elettronolo */
325   DRIVER( imago )      /* (c) 1983 Acom */
325   DRIVER( imago )      /* (c) 1984 Acom */
326   DRIVER( imagoa )   /* (c) 1983 Acom */
326327   DRIVER( scorpion )   /* (c) 1982 Zaccaria */
327328   DRIVER( scrpiona )   /* (c) 1982 Zaccaria */
328329   DRIVER( scrpionb )   /* (c) 1982 Zaccaria */
r3232r3233
17661767   DRIVER( kabukiz )   /* B50 (c) 1988 Taito Corporation Japan (World) */
17671768   DRIVER( kabukizj )   /* B50 (c) 1988 Taito Corporation (Japan) */
17681769   DRIVER( tnzs )      /* B53 (c) 1988 Taito Corporation Japan (World) (new logo) */
1770   DRIVER( tnzsjn )   /* B53 (c) 1988 Taito Corporation (Japan) (new logo) */
17691771   DRIVER( tnzsj )      /* B53 (c) 1988 Taito Corporation (Japan) (new logo) */
17701772   DRIVER( tnzso )      /* B53?(c) 1988 Taito Corporation Japan (World) (old logo) */
17711773   DRIVER( insectx )   /* B97 (c) 1989 Taito Corporation Japan (World) */
r3232r3233
40764078   DRIVER( dybbnao )
40774079
40784080   DRIVER( naomigd )
4081
4082   DRIVER( gundmgd )
40794083   DRIVER( sfz3ugd )
4084   DRIVER( cvsgd )
4085   DRIVER( gundmxgd )
40804086   DRIVER( cvs2gd )
4087   DRIVER( ikaruga )
4088   DRIVER( ggxx )
4089   DRIVER( chocomk )
4090   DRIVER( quizqgd )
4091   DRIVER( ggxxrl )
4092   DRIVER( shikgam2 )
4093   DRIVER( meltybld )
4094   DRIVER( senko )
4095   DRIVER( ss2005 )
40814096
4097   DRIVER( sprtjam )
4098   DRIVER( slashout )
4099   DRIVER( spkrbtl )
4100   DRIVER( dygolf )
4101   DRIVER( wsbbgd )
4102   DRIVER( vathlete )
4103
40824104   DRIVER( hod2bios )
40834105
40844106   DRIVER( naomi2 )
4107   DRIVER( vstrik3 )
4108   DRIVER( vf4 )
4109   DRIVER( initd )
40854110
40864111   /* Atomiswave (Dreamcast-based) games */
40874112   DRIVER( awbios )
r3232r3233
43804405            /* MBA ?? */
43814406            /* MBB ?? */
43824407            /* MBC ?? */
4383   DRIVER( boogwing )   /* MBD (c) 1992 */
4384   DRIVER( boogwina )   /* MBD (c) 1992 */
4385   DRIVER( ragtime )   /* MBD (c) 1992 */
4408   DRIVER( boogwing )   /* MBD (c) 1992 (Euro) */
4409   DRIVER( boogwina )   /* MBD (c) 1992 (Asia) */
4410   DRIVER( ragtime )   /* MBD (c) 1992 (Japan) */
4411   DRIVER( ragtimea )   /* MBD (c) 1992 (Japan) */
43864412   DRIVER( dblewing )   /* MBE (c) 1993 Mitchell */
43874413   DRIVER( fghthist )   /* MBF (c) 1993 Data East Corporation (World) */
43884414   DRIVER( fghthstu )   /* MBF (c) 1993 Data East Corporation (US) */
r3232r3233
45394565   DRIVER( tp84b )      /* GX388 (c) 1984 */
45404566   DRIVER( hyperspt )   /* GX330 (c) 1984 + Centuri */
45414567   DRIVER( hpolym84 )   /* GX330 (c) 1984 */
4542   DRIVER( sbasketb )   /* GX405 (c) 1984 */
4543   DRIVER( sbasketo )   /* GX405 (c) 1984 */
4544   DRIVER( sbasketu )   /* GX405 (c) 1984 */
4568   DRIVER( sbasketb )   /* GX405 (c) 1984 (Version H, Unprotected) */
4569   DRIVER( sbasketg )   /* GX405 (c) 1984 (Version G, Encrypted) */
4570   DRIVER( sbaskete )   /* GX405 (c) 1984 (Version E, Encrypted) */
45454571   DRIVER( mikie )      /* GX469 (c) 1984 */
45464572   DRIVER( mikiej )   /* GX469 (c) 1984 */
45474573   DRIVER( mikiehs )   /* GX469 (c) 1984 */
r3232r3233
51305156   DRIVER( jedi )      /* 136030           (c) 1984 */
51315157
51325158   /* Atari System 1 games */
5159   DRIVER( atarisy1 )   /* 136033           (c) 1984 */
51335160   DRIVER( peterpak )   /* 136028           (c) 1984 */
51345161   /* Marble Madness */
51355162   DRIVER( marble )   /* 136033           (c) 1984 */
51365163   DRIVER( marble2 )   /* 136033           (c) 1984 */
51375164   DRIVER( marble3 )   /* 136033           (c) 1984 */
51385165   DRIVER( marble4 )   /* 136033           (c) 1984 */
5166    DRIVER( marble5 )   /* 136033           (c) 1984   (LSI Cartridge) */
51395167   /* Indiana Jones and the Temple of Doom */
51405168   DRIVER( indytemp )   /* 136036           (c) 1985 */
51415169   DRIVER( indytem2 )   /* 136036           (c) 1985 */
r3232r3233
54615489   DRIVER( marvins )   /* A2003      (c) 1983 */
54625490   DRIVER( madcrash )   /* A2005      (c) 1984 */
54635491   DRIVER( vangrd2 )   /* A2005      (c) 1984 */
5464   DRIVER( mainsnk )   /* fill in */
5465   DRIVER( canvas )   /*            (c) 1985 */
5492   DRIVER( mainsnk )   /*            (c) 1984 */
5493   DRIVER( canvas )   /* A3008      (c) 1985 */
54665494   DRIVER( jcross )   /* A3006      (c) 1984 */
54675495   DRIVER( sgladiat )   /* A3006      (c) 1984 */
54685496   DRIVER( hal21 )      /* A4031      (c) 1985 */
r3232r3233
70407068   DRIVER( drtomy )   /* (c) 1993 no copyright message (1993 on pcb), some code taken from 'Big Karnak' */
70417069   DRIVER( sderby )   /* (c) 1996 */
70427070   DRIVER( pmroulet )
7071   DRIVER( spacewin )
70437072
70447073   /* Pacific Novelty games */
70457074   DRIVER( sharkatt )   /* (c) 1980 */
r3232r3233
80428071   DRIVER( suprpool )   /* (c) 1997 ABM Games */
80438072   DRIVER( hotslot )   /* (c) 1996 ABM Electronics */
80448073   DRIVER( mcolors )   /* 1999 unknown */
8074   DRIVER( sgsafari )   /* 1996 New Impeuropex Corp. */
80458075   DRIVER( galaxi )   /* (c) 2000 BRL S.R.L. Bologna */
80468076   DRIVER( magjoker )   /* (c) 2000 BRL S.R.L. Bologna */
80478077   DRIVER( dwarfd )   /* (c) 198? Electro-Sports */
src/mame/includes/mario.h
r3232r3233
4040   /* sound state */
4141   UINT8   last;
4242   UINT8   portT;
43   UINT8   eabank;
4344
4445   /* video state */
4546   UINT8   gfx_bank;
src/mame/includes/neogeo.h
r3232r3233
3434void neogeo_set_display_counter_msb(UINT16 data);
3535void neogeo_set_display_counter_lsb(running_machine *machine, UINT16 data);
3636void neogeo_acknowledge_interrupt(running_machine *machine, UINT16 data);
37void neogeo_set_main_cpu_bank_address(UINT32 bank_address);
37void neogeo_set_main_cpu_bank_address(running_machine *machine, UINT32 bank_address);
3838READ16_HANDLER( neogeo_unmapped_r );
3939
4040
src/mame/includes/wwfwfest.h
r3232r3233
11/*----------- defined in video/wwfwfest.c -----------*/
22
33extern UINT16 *wwfwfest_fg0_videoram, *wwfwfest_bg0_videoram, *wwfwfest_bg1_videoram;
4extern int wwfwfest_pri;
5extern int wwfwfest_bg0_scrollx, wwfwfest_bg0_scrolly, wwfwfest_bg1_scrollx, wwfwfest_bg1_scrolly;
4extern UINT16 wwfwfest_pri;
5extern UINT16 wwfwfest_bg0_scrollx, wwfwfest_bg0_scrolly, wwfwfest_bg1_scrollx, wwfwfest_bg1_scrolly;
66
77VIDEO_START( wwfwfest );
88VIDEO_START( wwfwfstb );
src/mame/mame.mak
r3232r3233
17201720
17211721$(DRIVERS)/lucky74.o:   $(LAYOUT)/lucky74.lh
17221722
1723$(DRIVERS)/magic10.o:   $(LAYOUT)/sgsafari.lh
1724
17231725$(DRIVERS)/maxaflex.o:   $(LAYOUT)/maxaflex.lh
17241726
17251727$(DRIVERS)/mpu4.o:      $(LAYOUT)/mpu4.lh \
r3232r3233
17531755
17541756$(DRIVERS)/sbrkout.o:   $(LAYOUT)/sbrkout.lh
17551757
1758$(DRIVERS)/sderby.o:   $(LAYOUT)/sderby.lh \
1759                  $(LAYOUT)/spacewin.lh \
1760                  $(LAYOUT)/pmroulet.lh \
1761
17561762$(DRIVERS)/snookr10.o:   $(LAYOUT)/snookr10.lh
17571763
17581764$(DRIVERS)/sspeedr.o:   $(LAYOUT)/sspeedr.lh
src/mame/video/mainsnk.c
r3232r3233
11#include "driver.h"
22
3static UINT8 bg_color,  old_bg_color;
4#define mainsnk_offset 8
5static tilemap *me_fg_tilemap;
6static tilemap *me_bg_tilemap;
3static tilemap *tx_tilemap;
4static tilemap *bg_tilemap;
75UINT8 *mainsnk_fgram;
86UINT8 *mainsnk_bgram;
9static int me_gfx_ctrl;
107
11WRITE8_HANDLER(mainsnk_c600_w)
8
9
10static TILEMAP_MAPPER( marvins_tx_scan_cols )
1211{
13   bg_color = data&0xf;
14   me_gfx_ctrl=data;
15   tilemap_mark_all_tiles_dirty (me_bg_tilemap);
16   mame_printf_debug("canvas %04x\n",data&=0xf0);
12   // tilemap is 36x28, the central part is from the first RAM page and the
13   // extra 4 columns are from the second page
14   col -= 2;
15   if (col & 0x20)
16      return 0x400 + row + ((col & 0x1f) << 5);
17   else
18      return row + (col << 5);
1719}
1820
19static TILE_GET_INFO( get_me_fg_tile_info )
21static TILE_GET_INFO( get_tx_tile_info )
2022{
21   int code = (mainsnk_fgram[tile_index]);
23   int code = mainsnk_fgram[tile_index];
24   SET_TILE_INFO(0,
25         code,
26         0,
27         tile_index & 0x400 ? TILE_FORCE_LAYER0 : 0);
28}
2229
30static TILE_GET_INFO( get_bg_tile_info )
31{
32   int code = (mainsnk_bgram[tile_index]);
33
2334   SET_TILE_INFO(
2435         0,
2536         code,
26         0x10,
37         0,
2738         0);
2839}
2940
30static void stuff_palette( running_machine *machine, int source_index, int dest_index, int num_colors )
41
42VIDEO_START(mainsnk)
3143{
44   tx_tilemap = tilemap_create(get_tx_tile_info, marvins_tx_scan_cols, 8, 8, 36, 28);
45   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,    8, 8, 32, 32);
3246
47   tilemap_set_transparent_pen(tx_tilemap,15);
48   tilemap_set_scrolldy(tx_tilemap, 8, 8);
3349
50   tilemap_set_scrolldx(bg_tilemap, 16, 16);
51   tilemap_set_scrolldy(bg_tilemap,  8,  8);
52}
3453
35   UINT8 *color_prom = memory_region(machine, "proms") + source_index;
36   int i;
37   for( i=0; i<num_colors; i++ )
38   {
39      int bit0=0,bit1,bit2,bit3;
40      int red, green, blue;
4154
42      bit0 = (color_prom[0x1000] >> 2) & 0x01; // ?
43      bit1 = (color_prom[0x000] >> 1) & 0x01;
44      bit2 = (color_prom[0x000] >> 2) & 0x01;
45      bit3 = (color_prom[0x000] >> 3) & 0x01;
46      red = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
55WRITE8_HANDLER(mainsnk_c600_w)
56{
57   int bank;
4758
48      bit0 = (color_prom[0x1000] >> 1) & 0x01; // ?
49      bit1 = (color_prom[0x800] >> 2) & 0x01;
50      bit2 = (color_prom[0x800] >> 3) & 0x01;
51      bit3 = (color_prom[0x000] >> 0) & 0x01;
52      green = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
59   flip_screen_set(~data & 0x80);
5360
54      bit0 = (color_prom[0x1000] >> 0) & 0x01; // ?
55      bit1 = (color_prom[0x1000] >> 3) & 0x01; // ?
56      bit2 = (color_prom[0x800] >> 0) & 0x01;
57      bit3 = (color_prom[0x800] >> 1) & 0x01;
58      blue = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
61   tilemap_set_palette_offset(bg_tilemap, (data & 0x07) << 4);
62   tilemap_set_palette_offset(tx_tilemap, (data & 0x07) << 4);
5963
60      palette_set_color( machine, dest_index++, MAKE_RGB(red, green, blue) );
61      color_prom++;
62   }
64   bank = 0;
65   if (machine->gfx[0]->total_elements == 0x400)   // mainsnk
66      bank = ((data & 0x30) >> 4);
67   else if (machine->gfx[0]->total_elements == 0x800)   // canvas
68      bank = ((data & 0x40) >> 6) | ((data & 0x30) >> 3);
6369
70   tilemap_set_pen_data_offset(bg_tilemap, (bank << 8) * machine->gfx[0]->char_modulo);
6471}
6572
66static void update_palette( running_machine *machine, int type )
67{
68   if( bg_color!=old_bg_color )
69   {
70      stuff_palette( machine, 256+16*(bg_color&0x7), (0x11-type)*16, 16 );
71      old_bg_color = bg_color;
72   }
73}
74
75
7673WRITE8_HANDLER( mainsnk_fgram_w )
7774{
7875   mainsnk_fgram[offset] = data;
79   tilemap_mark_tile_dirty(me_fg_tilemap,offset);
76   tilemap_mark_tile_dirty(tx_tilemap,offset);
8077}
8178
82
83static TILE_GET_INFO( get_me_bg_tile_info )
84{
85   int code = (mainsnk_bgram[tile_index]);
86
87   SET_TILE_INFO(
88         0,
89         code  + ((me_gfx_ctrl<<4)&0x700),
90         0x10,
91         0);
92}
93
94
9579WRITE8_HANDLER( mainsnk_bgram_w )
9680{
9781   mainsnk_bgram[offset] = data;
98   tilemap_mark_tile_dirty(me_bg_tilemap,offset);
82   tilemap_mark_tile_dirty(bg_tilemap,offset);
9983}
10084
10185
102VIDEO_START(mainsnk)
103{
104   old_bg_color = -1;
105   stuff_palette( machine, 0, 0, 16*8 );
106   stuff_palette( machine, 16*8*3, 16*8, 16*8 );
107   me_fg_tilemap = tilemap_create(get_me_fg_tile_info,tilemap_scan_cols,8,8,32, 32);
108   tilemap_set_transparent_pen(me_fg_tilemap,15);
109   me_bg_tilemap = tilemap_create(get_me_bg_tile_info,tilemap_scan_cols,8,8,32, 32);
110   tilemap_set_scrollx( me_fg_tilemap, 0, -mainsnk_offset );
111   tilemap_set_scrollx( me_bg_tilemap, 0, -mainsnk_offset );
112}
11386
11487static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int scrollx, int scrolly )
11588{
11689   const gfx_element *gfx = machine->gfx[1];
11790   const UINT8 *source, *finish;
11891   source =  spriteram;
119   finish =  source + 0x64;
92   finish =  source + 25*4;
12093
12194   while( source<finish )
12295   {
r3232r3233
12598      int sy = source[0];
12699      int sx = source[2];
127100      int color = attributes&0xf;
101      int flipx = 0;
102      int flipy = 0;
128103      if( sy>240 ) sy -= 256;
129104
130105      tile_number |= attributes<<4 & 0x300;
131106
107      sx = 288-16 - sx;
108      sy += 8;
109
110      if (flip_screen_get())
111      {
112         sx = 288-16 - sx;
113         sy = 224-16 - sy;
114         flipx = !flipx;
115         flipy = !flipy;
116      }
117
132118      drawgfx( bitmap,gfx,
133119         tile_number,
134120         color,
135         0,0,
136         256-sx+mainsnk_offset,sy,
121         flipx,flipy,
122         sx,sy,
137123         cliprect,TRANSPARENCY_PEN,7);
138124
139125      source+=4;
r3232r3233
141127}
142128
143129
144static void draw_status(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect,int dx,int off )
145{
146   const UINT8 *base = mainsnk_fgram+off;
147   const gfx_element *gfx = machine->gfx[0];
148   int row;
149   for( row=0; row<4; row++ )
150   {
151      int sy,sx = (row&1)*8;
152      const UINT8 *source = base + (row&1)*32;
153      if( row>1 )
154      {
155         sx+=256+16;
156      }
157      else
158      {
159         source+=30*32;
160      }
161
162      for( sy=0; sy<256; sy+=8 )
163      {
164         int tile_number = *source++;
165         drawgfx( bitmap, gfx,
166             tile_number, tile_number>>5,
167             0,0,
168             sx+dx,sy,
169             cliprect,
170             TRANSPARENCY_NONE, 0xf );
171      }
172   }
173}
174
175130VIDEO_UPDATE(mainsnk)
176131{
177   rectangle myclip;
178   myclip.min_x = cliprect->min_x+8;
179   myclip.max_x = cliprect->max_x-8;
180   myclip.min_y = cliprect->min_y;
181   myclip.max_y = cliprect->max_y;
182   tilemap_draw(bitmap,&myclip,me_bg_tilemap,0,0);
183   draw_sprites(screen->machine,bitmap,&myclip, 0,0 );
184   tilemap_draw(bitmap,&myclip,me_fg_tilemap,0,0);
185   draw_status(screen->machine,bitmap,cliprect,0,0x400 );
186   draw_status(screen->machine,bitmap,cliprect,32*8,0x40 );
187   update_palette(screen->machine, 1);
188   return 0;
189}
132   tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
133   draw_sprites(screen->machine,bitmap,cliprect, 0,0 );
134   tilemap_draw(bitmap,cliprect,tx_tilemap,0,0);
190135
191VIDEO_UPDATE(canvas)
192{
193   rectangle myclip;
194   myclip.min_x = cliprect->min_x+8;
195   myclip.max_x = cliprect->max_x-8;
196   myclip.min_y = cliprect->min_y;
197   myclip.max_y = cliprect->max_y;
198   tilemap_draw(bitmap,&myclip,me_bg_tilemap,0,0);
199   draw_sprites(screen->machine,bitmap,&myclip, 0,0 );
200//  tilemap_draw(bitmap,&myclip,me_fg_tilemap,0,0);
201//  draw_status(screen->machine,bitmap,cliprect,0,0x400 );
202//  draw_status(screen->machine,bitmap,cliprect,32*8,0x40 );
203   update_palette(screen->machine, 1);
204136   return 0;
205137}
src/mame/video/dynax.c
r3232r3233
250250}
251251
252252
253static const char *gfxregions[] = { "gfx1", "gfx2", "gfx3", "gfx4", "gfx5", "gfx6", "gfx7", "gfx8" };
253static const char *const gfxregions[] = { "gfx1", "gfx2", "gfx3", "gfx4", "gfx5", "gfx6", "gfx7", "gfx8" };
254254
255255WRITE8_HANDLER( dynax_blit_romregion_w )
256256{
src/mame/video/fastfred.c
r3232r3233
260260      if (fastfred_hardware_type == 3)
261261      {
262262         // Imago
263
264         //fastfred_spriteram[offs + 2] & 0xf8 get only set at startup
265         //the code is greater than 0x3f only at startup
266
267         /* TODO: find correct sprites banking */
268
269         code  = (fastfred_spriteram[offs + 1]) & 0x1f;
270
271         code |= fastfred_spriteram[offs + 2]<<5;
272
273         if(fastfred_spriteram[offs + 1] & 0x20)
274            code ^= 0xff;
275
263         code  = (fastfred_spriteram[offs + 1]) & 0x3f;
276264         flipx = 0;
277265         flipy = 0;
278266      }
src/mame/video/jackal.c
r3232r3233
3838
3939   for (i = 0x200; i < 0x300; i++)
4040   {
41      UINT16 ctabentry = (color_prom[i - 0x200] & 0x0f) | 0x10;
41      UINT16 ctabentry = (color_prom[i - 0x100] & 0x0f) | 0x10;
4242      colortable_entry_set_value(machine->colortable, i, ctabentry);
4343   }
4444}
src/mame/video/lethalj.c
r3232r3233
3535
3636INLINE void get_crosshair_xy(running_machine *machine, int player, int *x, int *y)
3737{
38   static const char *gunnames[] = { "LIGHT0_X", "LIGHT0_Y", "LIGHT1_X", "LIGHT1_Y" };
38   static const char *const gunnames[] = { "LIGHT0_X", "LIGHT0_Y", "LIGHT1_X", "LIGHT1_Y" };
3939   const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
4040   int width = visarea->max_x + 1 - visarea->min_x;
4141   int height = visarea->max_y + 1 - visarea->min_y;
src/mame/video/itech8.c
r3232r3233
459459READ8_HANDLER( itech8_blitter_r )
460460{
461461   int result = blitter_data[offset / 2];
462   static const char *portnames[] = { "AN_C", "AN_D", "AN_E", "AN_F" };
462   static const char *const portnames[] = { "AN_C", "AN_D", "AN_E", "AN_F" };
463463
464464   /* debugging */
465465   if (FULL_LOGGING) logerror("%04x:blitter_r(%02x)\n", activecpu_get_previouspc(), offset / 2);
src/mame/video/lordgun.c
r3232r3233
187187};
188188
189189
190static const char *gunnames[] = { "LIGHT0_X", "LIGHT1_X", "LIGHT0_Y", "LIGHT1_Y" };
190static const char *const gunnames[] = { "LIGHT0_X", "LIGHT1_X", "LIGHT0_Y", "LIGHT1_Y" };
191191
192192static void lorddgun_calc_gun_scr(running_machine *machine, int i)
193193{
src/mame/video/taitojc.c
r3232r3233
2525static UINT8 *taitojc_dirty_map;
2626static UINT32 *taitojc_char_ram;
2727static UINT32 *taitojc_tile_ram;
28static int taitojc_char_dirty = 1;
28static int taitojc_char_dirty;
2929static tilemap *taitojc_tilemap;
3030
3131static poly_manager *poly;
r3232r3233
196196{
197197   int width, height;
198198
199   taitojc_char_dirty = 1;
200
199201   poly = poly_alloc(4000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS);
200202   add_exit_callback(machine, taitojc_exit);
201203
src/mame/video/qix.c
r3232r3233
1818 *
1919 *************************************/
2020
21#define MC6845_TAG      ("vid-u18")
21#define MC6845_TAG      ("vid_u18")
2222
2323
2424
r3232r3233
376376   AM_RANGE(0x9400, 0x9400) AM_MIRROR(0x03fc) AM_READWRITE(qix_addresslatch_r, qix_addresslatch_w)
377377   AM_RANGE(0x9402, 0x9403) AM_MIRROR(0x03fc) AM_WRITE(SMH_RAM) AM_BASE_MEMBER(qix_state, videoram_address)
378378   AM_RANGE(0x9800, 0x9800) AM_MIRROR(0x03ff) AM_READ(SMH_RAM) AM_BASE_MEMBER(qix_state, scanline_latch)
379   AM_RANGE(0x9c00, 0x9c00) AM_MIRROR(0x03fe) AM_DEVWRITE(MC6845, "vid-u18", mc6845_address_w)
380   AM_RANGE(0x9c01, 0x9c01) AM_MIRROR(0x03fe) AM_DEVREADWRITE(MC6845, "vid-u18", mc6845_register_r, mc6845_register_w)
379   AM_RANGE(0x9c00, 0x9c00) AM_MIRROR(0x03fe) AM_DEVWRITE(MC6845, "vid_u18", mc6845_address_w)
380   AM_RANGE(0x9c01, 0x9c01) AM_MIRROR(0x03fe) AM_DEVREADWRITE(MC6845, "vid_u18", mc6845_register_r, mc6845_register_w)
381381   AM_RANGE(0xa000, 0xffff) AM_ROM
382382ADDRESS_MAP_END
383383
r3232r3233
394394   AM_RANGE(0x9400, 0x9400) AM_MIRROR(0x03fc) AM_READWRITE(qix_addresslatch_r, qix_addresslatch_w)
395395   AM_RANGE(0x9402, 0x9403) AM_MIRROR(0x03fc) AM_WRITE(SMH_RAM) AM_BASE_MEMBER(qix_state, videoram_address)
396396   AM_RANGE(0x9800, 0x9800) AM_MIRROR(0x03ff) AM_READ(SMH_RAM) AM_BASE_MEMBER(qix_state, scanline_latch)
397   AM_RANGE(0x9c00, 0x9c00) AM_MIRROR(0x03fe) AM_DEVWRITE(MC6845, "vid-u18", mc6845_address_w)
398   AM_RANGE(0x9c01, 0x9c01) AM_MIRROR(0x03fe) AM_DEVREADWRITE(MC6845, "vid-u18", mc6845_register_r, mc6845_register_w)
397   AM_RANGE(0x9c00, 0x9c00) AM_MIRROR(0x03fe) AM_DEVWRITE(MC6845, "vid_u18", mc6845_address_w)
398   AM_RANGE(0x9c01, 0x9c01) AM_MIRROR(0x03fe) AM_DEVREADWRITE(MC6845, "vid_u18", mc6845_register_r, mc6845_register_w)
399399   AM_RANGE(0xa000, 0xbfff) AM_ROMBANK(1)
400400   AM_RANGE(0xc000, 0xffff) AM_ROM
401401ADDRESS_MAP_END
r3232r3233
413413   AM_RANGE(0x9401, 0x9401) AM_MIRROR(0x03fc) AM_WRITE(SMH_RAM) AM_BASE_MEMBER(qix_state, videoram_mask)
414414   AM_RANGE(0x9402, 0x9403) AM_MIRROR(0x03fc) AM_WRITE(SMH_RAM) AM_BASE_MEMBER(qix_state, videoram_address)
415415   AM_RANGE(0x9800, 0x9800) AM_MIRROR(0x03ff) AM_READ(SMH_RAM) AM_BASE_MEMBER(qix_state, scanline_latch)
416   AM_RANGE(0x9c00, 0x9c00) AM_MIRROR(0x03fe) AM_DEVWRITE(MC6845, "vid-u18", mc6845_address_w)
417   AM_RANGE(0x9c01, 0x9c01) AM_MIRROR(0x03fe) AM_DEVREADWRITE(MC6845, "vid-u18", mc6845_register_r, mc6845_register_w)
416   AM_RANGE(0x9c00, 0x9c00) AM_MIRROR(0x03fe) AM_DEVWRITE(MC6845, "vid_u18", mc6845_address_w)
417   AM_RANGE(0x9c01, 0x9c01) AM_MIRROR(0x03fe) AM_DEVREADWRITE(MC6845, "vid_u18", mc6845_register_r, mc6845_register_w)
418418   AM_RANGE(0xa000, 0xffff) AM_ROM
419419ADDRESS_MAP_END
420420
src/mame/video/munchmo.c
r3232r3233
4848}
4949
5050
51READ8_HANDLER( mnchmobl_sprite_xpos_r ){ return mnchmobl_sprite_xpos[offset]; }
52WRITE8_HANDLER( mnchmobl_sprite_xpos_w ){ mnchmobl_sprite_xpos[offset] = data; }
53
54READ8_HANDLER( mnchmobl_sprite_attr_r ){ return mnchmobl_sprite_attr[offset]; }
55WRITE8_HANDLER( mnchmobl_sprite_attr_w ){ mnchmobl_sprite_attr[offset] = data; }
56
57READ8_HANDLER( mnchmobl_sprite_tile_r ){ return mnchmobl_sprite_tile[offset]; }
58WRITE8_HANDLER( mnchmobl_sprite_tile_w ){ mnchmobl_sprite_tile[offset] = data; }
59
6051VIDEO_START( mnchmobl )
6152{
6253   tmpbitmap = auto_bitmap_alloc(512,512,video_screen_get_format(machine->primary_screen));
src/mame/video/atarisy1.c
r3232r3233
656656      return bank_gfx[bpp - 4][bank_index];
657657
658658   /* if the bank is out of range, call it 0 */
659   if (0x80000 * (bank_index - 1) >= memory_region_length(machine, "gfx2"))
659   if (0x80000 * (bank_index - 1) >= memory_region_length(machine, "tiles"))
660660      return 0;
661661
662662   /* don't have one? let's make it ... first find any empty slot */
r3232r3233
683683   default:
684684      fatalerror("Unsupported bpp");
685685   }
686   decodegfx(machine->gfx[gfx_index], &memory_region(machine, "gfx2")[0x80000 * (bank_index - 1)], 0, machine->gfx[gfx_index]->total_elements);
686   decodegfx(machine->gfx[gfx_index], &memory_region(machine, "tiles")[0x80000 * (bank_index - 1)], 0, machine->gfx[gfx_index]->total_elements);
687687
688688   /* set the color information */
689689   machine->gfx[gfx_index]->color_base = 256;
src/mame/video/tceptor.c
r3232r3233
550550   int pri;
551551   int bg_center = 144 - ((((bg1_scroll_x + bg2_scroll_x ) & 0x1ff) - 288) / 2);
552552
553   const device_config *_2d_screen       = device_list_find_by_tag(screen->machine->config->devicelist, VIDEO_SCREEN, "2D");
554   const device_config *_3d_left_screen  = device_list_find_by_tag(screen->machine->config->devicelist, VIDEO_SCREEN, "3D Left");
555   const device_config *_3d_right_screen = device_list_find_by_tag(screen->machine->config->devicelist, VIDEO_SCREEN, "3D Right");
553   const device_config *_2d_screen       = device_list_find_by_tag(screen->machine->config->devicelist, VIDEO_SCREEN, "2d");
554   const device_config *_3d_left_screen  = device_list_find_by_tag(screen->machine->config->devicelist, VIDEO_SCREEN, "3dleft");
555   const device_config *_3d_right_screen = device_list_find_by_tag(screen->machine->config->devicelist, VIDEO_SCREEN, "3dright");
556556
557557   if (screen != _2d_screen)
558558   {
src/mame/video/40love.c
r3232r3233
1111UINT8 *fortyl_video_ctrl;
1212
1313static UINT8 fortyl_flipscreen,fortyl_pix_redraw;
14static UINT8 fortyl_xoffset = 128;
14static const UINT8 fortyl_xoffset = 128;
1515
1616static UINT8 *fortyl_pixram1;
1717static UINT8 *fortyl_pixram2;
src/mame/video/nbmj8688.c
r3232r3233
718718   int x, y, b;
719719
720720   const device_config *main_screen = device_list_find_by_tag(screen->machine->config->devicelist, VIDEO_SCREEN, "main");
721   const device_config *lcd0_screen = device_list_find_by_tag(screen->machine->config->devicelist, VIDEO_SCREEN, "LCD0");
722   const device_config *lcd1_screen = device_list_find_by_tag(screen->machine->config->devicelist, VIDEO_SCREEN, "LCD1");
721   const device_config *lcd0_screen = device_list_find_by_tag(screen->machine->config->devicelist, VIDEO_SCREEN, "lcd0");
722   const device_config *lcd1_screen = device_list_find_by_tag(screen->machine->config->devicelist, VIDEO_SCREEN, "lcd1");
723723
724724   if (screen == main_screen) VIDEO_UPDATE_CALL(mbmj8688);
725725
src/mame/video/m90.c
r3232r3233
1313        Bit 0x04 - Playfield 1 width (0 is 64 tiles, 0x4 is 128 tiles)
1414        Bit 0x10 - Playfield 1 disable
1515        Bit 0x20 - Playfield 1 rowscroll enable
16        Bit 0x40 - Playfield 1 y-offset table enable
1617    12: Playfield 2 control
1718        Bits0x03 - Playfield 2 VRAM base
1819        Bit 0x04 - Playfield 2 width (0 is 64 tiles, 0x4 is 128 tiles)
1920        Bit 0x10 - Playfield 2 disable
2021        Bit 0x20 - Playfield 2 rowscroll enable
22        Bit 0x40 - Playfield 1 y-offset table enable
2123    14: Bits0x03 - Sprite/Tile Priority (related to sprite color)
2224
2325    Emulation by Bryan McPhail, mish@tendril.co.uk, thanks to Chris Hardy!
r3232r3233
262264WRITE16_HANDLER( m90_video_control_w )
263265{
264266   COMBINE_DATA(&m90_video_control_data[offset]);
265//  printf("%04x-%04x ",offset,m90_video_control_data[offset]);
266267}
267268
268269static void markdirty(tilemap *tmap,int page,offs_t offset)
r3232r3233
348349      tilemap_set_scrollx( pf2_wide_layer,0, m90_video_control_data[3]+256-2 );
349350   }
350351
351   tilemap_set_scrolly( pf1_layer,0, m90_video_control_data[0] );
352   tilemap_set_scrolly( pf2_layer,0, m90_video_control_data[2] );
353   tilemap_set_scrolly( pf1_wide_layer,0, m90_video_control_data[0] );
354   tilemap_set_scrolly( pf2_wide_layer,0, m90_video_control_data[2] );
355
356352   fillbitmap(priority_bitmap,0,cliprect);
357353
358354   if (video_enable) {
r3232r3233
361357
362358      if (pf2_enable)
363359      {
364         if (m90_video_control_data[6] & 0x4) {
365            tilemap_draw(bitmap,cliprect,pf2_wide_layer,0,0);
366            tilemap_draw(bitmap,cliprect,pf2_wide_layer,1,1);
367         } else {
368            tilemap_draw(bitmap,cliprect,pf2_layer,0,0);
369            tilemap_draw(bitmap,cliprect,pf2_layer,1,1);
360         // use the playfield 2 y-offset table for each scanline
361         if (m90_video_control_data[6] & 0x40) {
362
363            int line;
364            rectangle clip;
365            clip.min_x = cliprect->min_x;
366            clip.max_x = cliprect->max_x;
367
368            for(line = 0; line < 512; line++)
369            {
370               clip.min_y = clip.max_y = line;
371
372               if (m90_video_control_data[6] & 0x4) {
373                  tilemap_set_scrolly(pf2_wide_layer, 0, m90_video_control_data[2] + m90_video_data[0xfc00/2 + line] + 128);
374                  tilemap_draw(bitmap,&clip,pf2_wide_layer,0,0);
375                  tilemap_draw(bitmap,&clip,pf2_wide_layer,1,1);
376               } else {
377                  tilemap_set_scrolly(pf2_layer, 0, m90_video_control_data[2] + m90_video_data[0xfc00/2 + line] + 128);
378                  tilemap_draw(bitmap,&clip,pf2_layer,0,0);
379                  tilemap_draw(bitmap,&clip,pf2_layer,1,1);
380               }
381            }
370382         }
383         else
384         {
385            if (m90_video_control_data[6] & 0x4) {
386               tilemap_set_scrolly( pf2_wide_layer,0, m90_video_control_data[2] );
387               tilemap_draw(bitmap,cliprect,pf2_wide_layer,0,0);
388               tilemap_draw(bitmap,cliprect,pf2_wide_layer,1,1);
389            } else {
390               tilemap_set_scrolly( pf2_layer,0, m90_video_control_data[2] );
391               tilemap_draw(bitmap,cliprect,pf2_layer,0,0);
392               tilemap_draw(bitmap,cliprect,pf2_layer,1,1);
393            }
394         }
371395      }
372396
373397      if (pf1_enable)
374398      {
375         if (m90_video_control_data[5] & 0x4) {
376            tilemap_draw(bitmap,cliprect,pf1_wide_layer,0,0);
377            tilemap_draw(bitmap,cliprect,pf1_wide_layer,1,1);
378         } else {
379            tilemap_draw(bitmap,cliprect,pf1_layer,0,0);
380            tilemap_draw(bitmap,cliprect,pf1_layer,1,1);
399         // use the playfield 1 y-offset table for each scanline
400         if (m90_video_control_data[5] & 0x40) {
401
402            int line;
403            rectangle clip;
404            clip.min_x = cliprect->min_x;
405            clip.max_x = cliprect->max_x;
406
407            for(line = 0; line < 512; line++)
408            {
409               clip.min_y = clip.max_y = line;
410
411               if (m90_video_control_data[5] & 0x4) {
412                  tilemap_set_scrolly(pf1_wide_layer, 0, m90_video_control_data[0] + m90_video_data[0xf800/2 + line] + 128);
413                  tilemap_draw(bitmap,&clip,pf1_wide_layer,0,0);
414                  tilemap_draw(bitmap,&clip,pf1_wide_layer,1,1);
415               } else {
416                  tilemap_set_scrolly(pf1_layer, 0, m90_video_control_data[0] + m90_video_data[0xf800/2 + line] + 128 );
417                  tilemap_draw(bitmap,&clip,pf1_layer,0,0);
418                  tilemap_draw(bitmap,&clip,pf1_layer,1,1);
419               }
420            }
381421         }
422         else
423         {
424            if (m90_video_control_data[5] & 0x4) {
425               tilemap_set_scrolly( pf1_wide_layer,0, m90_video_control_data[0] );
426               tilemap_draw(bitmap,cliprect,pf1_wide_layer,0,0);
427               tilemap_draw(bitmap,cliprect,pf1_wide_layer,1,1);
428            } else {
429               tilemap_set_scrolly( pf1_layer,0, m90_video_control_data[0] );
430               tilemap_draw(bitmap,cliprect,pf1_layer,0,0);
431               tilemap_draw(bitmap,cliprect,pf1_layer,1,1);
432            }
433         }
382434      }
383435
384436      draw_sprites(screen->machine,bitmap,cliprect);
437
385438   } else {
386439      fillbitmap(bitmap,get_black_pen(screen->machine),cliprect);
387440   }
src/mame/video/combatsc.c
r3232r3233
346346
347347static READ8_HANDLER( combascb_io_r )
348348{
349   static const char *portnames[] = { "IN0", "IN1", "DSW1", "DSW2" };
349   static const char *const portnames[] = { "IN0", "IN1", "DSW1", "DSW2" };
350350
351351   return input_port_read(machine, portnames[offset]);
352352}
src/mame/video/wwfwfest.c
r3232r3233
1010#include "includes/wwfwfest.h"
1111
1212static tilemap *fg0_tilemap, *bg0_tilemap, *bg1_tilemap;
13int wwfwfest_pri;
14int wwfwfest_bg0_scrollx, wwfwfest_bg0_scrolly, wwfwfest_bg1_scrollx, wwfwfest_bg1_scrolly;
13UINT16 wwfwfest_pri;
14UINT16 wwfwfest_bg0_scrollx, wwfwfest_bg0_scrolly, wwfwfest_bg1_scrollx, wwfwfest_bg1_scrolly;
1515UINT16 *wwfwfest_fg0_videoram, *wwfwfest_bg0_videoram, *wwfwfest_bg1_videoram;
16static int sprite_xoff, bg0_dx, bg1_dx[2];
16static UINT16 sprite_xoff, bg0_dx, bg1_dx[2];
1717
1818/*******************************************************************************
1919 Write Handlers
r3232r3233
224224
225225VIDEO_START( wwfwfest )
226226{
227    state_save_register_global(wwfwfest_pri);
228    state_save_register_global(wwfwfest_bg0_scrollx);
229    state_save_register_global(wwfwfest_bg0_scrolly);
230    state_save_register_global(wwfwfest_bg1_scrollx);
231    state_save_register_global(wwfwfest_bg1_scrolly);
232
227233   fg0_tilemap = tilemap_create(get_fg0_tile_info,tilemap_scan_rows, 8, 8,64,32);
228234   bg1_tilemap = tilemap_create(get_bg1_tile_info,tilemap_scan_rows, 16, 16,32,32);
229235   bg0_tilemap = tilemap_create(get_bg0_tile_info,tilemap_scan_rows, 16, 16,32,32);
src/mame/layout/sgsafari.lay
r0r3233
1<?xml version="1.0"?>
2<mamelayout version="2">
3   <element name="L1" defstate="1">
4      <rect state="1">
5         <color red="1.0" green="0.0" blue="0.0" />
6      </rect>
7      <rect state="0">
8         <color red="0.3" green="0.0" blue="0.0" />
9      </rect>
10      <text string="HOLD1">
11         <color red="0.0" green="0.0" blue="0.0" />
12         <bounds x="0" y="0.1" width="1" height="0.8" />
13      </text>
14   </element>
15
16   <element name="L2" defstate="1">
17      <rect state="1">
18         <color red="1.0" green="0.0" blue="0.0" />
19      </rect>
20      <rect state="0">
21         <color red="0.3" green="0.0" blue="0.0" />
22      </rect>
23      <text string="HOLD2">
24         <color red="0.0" green="0.0" blue="0.0" />
25         <bounds x="0" y="0.1" width="1" height="0.8" />
26      </text>
27   </element>
28
29   <element name="L3" defstate="1">
30      <rect state="1">
31         <color red="1.0" green="0.0" blue="0.0" />
32      </rect>
33      <rect state="0">
34         <color red="0.3" green="0.0" blue="0.0" />
35      </rect>
36      <text string="HOLD3">
37         <color red="0.0" green="0.0" blue="0.0" />
38         <bounds x="0" y="0.1" width="1" height="0.8" />
39      </text>
40   </element>
41
42   <element name="L4" defstate="1">
43      <rect state="1">
44         <color red="1.0" green="0.0" blue="0.0" />
45      </rect>
46      <rect state="0">
47         <color red="0.3" green="0.0" blue="0.0" />
48      </rect>
49      <text string="HOLD4">
50         <color red="0.0" green="0.0" blue="0.0" />
51         <bounds x="0" y="0.1" width="1" height="0.8" />
52      </text>
53   </element>
54
55   <element name="L5" defstate="1">
56      <rect state="1">
57         <color red="1.0" green="0.0" blue="0.0" />
58      </rect>
59      <rect state="0">
60         <color red="0.3" green="0.0" blue="0.0" />
61      </rect>
62      <text string="HOLD5">
63         <color red="0.0" green="0.0" blue="0.0" />
64         <bounds x="0" y="0.1" width="1" height="0.8" />
65      </text>
66   </element>
67
68   <element name="L6" defstate="1">
69      <rect state="1">
70         <color red="1.0" green="1.0" blue="1.0" />
71      </rect>
72      <rect state="0">
73         <color red="0.3" green="0.3" blue="0.3" />
74      </rect>
75      <text string="START">
76         <color red="0.0" green="0.0" blue="0.0" />
77         <bounds x="0" y="0.1" width="1" height="0.8" />
78      </text>
79   </element>
80
81   <element name="L7" defstate="1">
82      <rect state="1">
83         <color red="1.0" green="1.0" blue="1.0" />
84      </rect>
85      <rect state="0">
86         <color red="0.3" green="0.3" blue="0.3" />
87      </rect>
88      <text string="BET/TAKE">
89         <color red="0.0" green="0.0" blue="0.0" />
90         <bounds x="0" y="0.1" width="1" height="0.8" />
91      </text>
92   </element>
93
94   <element name="L8" defstate="1">
95      <rect state="1">
96         <color red="1.0" green="1.0" blue="1.0" />
97      </rect>
98      <rect state="0">
99         <color red="0.3" green="0.3" blue="0.3" />
100      </rect>
101      <text string="PAYOUT">
102         <color red="0.0" green="0.0" blue="0.0" />
103         <bounds x="0" y="0.1" width="1" height="0.8" />
104      </text>
105   </element>
106
107   <view name="Button Lamps">
108      <screen index="0">
109         <bounds left="0" top="0" right="4" bottom="3" />
110      </screen>
111      <bezel name="lamp1" element="L1">
112         <bounds x="1.6" y="3.13" width="0.40" height="0.24" />
113      </bezel>
114      <bezel name="lamp2" element="L2">
115         <bounds x="2.1" y="3.13" width="0.40" height="0.24" />
116      </bezel>
117      <bezel name="lamp3" element="L3">
118         <bounds x="2.6" y="3.13" width="0.40" height="0.24" />
119      </bezel>
120      <bezel name="lamp4" element="L4">
121         <bounds x="3.1" y="3.13" width="0.40" height="0.24" />
122      </bezel>
123      <bezel name="lamp5" element="L5">
124         <bounds x="3.6" y="3.13" width="0.40" height="0.24" />
125      </bezel>
126      <bezel name="lamp6" element="L6">
127         <bounds x="0" y="3.13" width="0.40" height="0.24" />
128      </bezel>
129      <bezel name="lamp7" element="L7">
130         <bounds x="0.5" y="3.13" width="0.40" height="0.24" />
131      </bezel>
132      <bezel name="lamp8" element="L8">
133         <bounds x="1.0" y="3.13" width="0.40" height="0.24" />
134      </bezel>
135   </view>
136</mamelayout>
src/mame/layout/spacewin.lay
r0r3233
1<?xml version="1.0"?>
2<mamelayout version="2">
3   <element name="L1" defstate="1">
4      <rect state="1">
5         <color red="1.0" green="0.0" blue="0.0" />
6      </rect>
7      <rect state="0">
8         <color red="0.3" green="0.0" blue="0.0" />
9      </rect>
10      <text string="HOLD1">
11         <color red="0.0" green="0.0" blue="0.0" />
12         <bounds x="0" y="0.1" width="1" height="0.8" />
13      </text>
14   </element>
15
16   <element name="L2" defstate="1">
17      <rect state="1">
18         <color red="1.0" green="0.0" blue="0.0" />
19      </rect>
20      <rect state="0">
21         <color red="0.3" green="0.0" blue="0.0" />
22      </rect>
23      <text string="HOLD2">
24         <color red="0.0" green="0.0" blue="0.0" />
25         <bounds x="0" y="0.1" width="1" height="0.8" />
26      </text>
27   </element>
28
29   <element name="L3" defstate="1">
30      <rect state="1">
31         <color red="1.0" green="0.0" blue="0.0" />
32      </rect>
33      <rect state="0">
34         <color red="0.3" green="0.0" blue="0.0" />
35      </rect>
36      <text string="HOLD3">
37         <color red="0.0" green="0.0" blue="0.0" />
38         <bounds x="0" y="0.1" width="1" height="0.8" />
39      </text>
40   </element>
41
42   <element name="L4" defstate="1">
43      <rect state="1">
44         <color red="1.0" green="0.0" blue="0.0" />
45      </rect>
46      <rect state="0">
47         <color red="0.3" green="0.0" blue="0.0" />
48      </rect>
49      <text string="HOLD4">
50         <color red="0.0" green="0.0" blue="0.0" />
51         <bounds x="0" y="0.1" width="1" height="0.8" />
52      </text>
53   </element>
54
55   <element name="L5" defstate="1">
56      <rect state="1">
57         <color red="1.0" green="0.0" blue="0.0" />
58      </rect>
59      <rect state="0">
60         <color red="0.3" green="0.0" blue="0.0" />
61      </rect>
62      <text string="HOLD5">
63         <color red="0.0" green="0.0" blue="0.0" />
64         <bounds x="0" y="0.1" width="1" height="0.8" />
65      </text>
66   </element>
67
68   <element name="L6" defstate="1">
69      <rect state="1">
70         <color red="1.0" green="1.0" blue="1.0" />
71      </rect>
72      <rect state="0">
73         <color red="0.3" green="0.3" blue="0.3" />
74      </rect>
75      <text string="START">
76         <color red="0.0" green="0.0" blue="0.0" />
77         <bounds x="0" y="0.1" width="1" height="0.8" />
78      </text>
79   </element>
80
81   <element name="L7" defstate="1">
82      <rect state="1">
83         <color red="1.0" green="1.0" blue="1.0" />
84      </rect>
85      <rect state="0">
86         <color red="0.3" green="0.3" blue="0.3" />
87      </rect>
88      <text string="BET">
89         <color red="0.0" green="0.0" blue="0.0" />
90         <bounds x="0" y="0.1" width="1" height="0.8" />
91      </text>
92   </element>
93
94
95   <view name="Button Lamps">
96      <screen index="0">
97         <bounds left="0" top="0" right="4" bottom="3" />
98      </screen>
99      <bezel name="lamp1" element="L1">
100         <bounds x="1.6" y="3.13" width="0.40" height="0.24" />
101      </bezel>
102      <bezel name="lamp2" element="L2">
103         <bounds x="2.1" y="3.13" width="0.40" height="0.24" />
104      </bezel>
105      <bezel name="lamp3" element="L3">
106         <bounds x="2.6" y="3.13" width="0.40" height="0.24" />
107      </bezel>
108      <bezel name="lamp4" element="L4">
109         <bounds x="3.1" y="3.13" width="0.40" height="0.24" />
110      </bezel>
111      <bezel name="lamp5" element="L5">
112         <bounds x="3.6" y="3.13" width="0.40" height="0.24" />
113      </bezel>
114      <bezel name="lamp6" element="L6">
115         <bounds x="0" y="3.13" width="0.40" height="0.24" />
116      </bezel>
117      <bezel name="lamp7" element="L7">
118         <bounds x="0.5" y="3.13" width="0.40" height="0.24" />
119      </bezel>
120   </view>
121</mamelayout>
src/mame/layout/pmroulet.lay
r0r3233
1<?xml version="1.0"?>
2<mamelayout version="2">
3
4   <element name="L1" defstate="1">
5      <rect state="1">
6         <color red="1.0" green="1.0" blue="1.0" />
7      </rect>
8      <rect state="0">
9         <color red="0.3" green="0.3" blue="0.3" />
10      </rect>
11      <text string="START">
12         <color red="0.0" green="0.0" blue="0.0" />
13         <bounds x="0" y="0.1" width="1" height="0.8" />
14      </text>
15   </element>
16
17   <element name="L2" defstate="1">
18      <rect state="1">
19         <color red="1.0" green="1.0" blue="1.0" />
20      </rect>
21      <rect state="0">
22         <color red="0.3" green="0.3" blue="0.3" />
23      </rect>
24      <text string="BET">
25         <color red="0.0" green="0.0" blue="0.0" />
26         <bounds x="0" y="0.1" width="1" height="0.8" />
27      </text>
28   </element>
29
30
31   <view name="Button Lamps">
32      <screen index="0">
33         <bounds left="0" top="0" right="4" bottom="3" />
34      </screen>
35      <bezel name="lamp1" element="L1">
36         <bounds x="0" y="3.13" width="0.40" height="0.24" />
37      </bezel>
38      <bezel name="lamp2" element="L2">
39         <bounds x="0.5" y="3.13" width="0.40" height="0.24" />
40      </bezel>
41   </view>
42</mamelayout>
src/mame/layout/sderby.lay
r0r3233
1<?xml version="1.0"?>
2<mamelayout version="2">
3
4   <element name="L1" defstate="1">
5      <rect state="1">
6         <color red="1.0" green="1.0" blue="1.0" />
7      </rect>
8      <rect state="0">
9         <color red="0.3" green="0.3" blue="0.3" />
10      </rect>
11      <text string="START">
12         <color red="0.0" green="0.0" blue="0.0" />
13         <bounds x="0" y="0.1" width="1" height="0.8" />
14      </text>
15   </element>
16
17   <element name="L2" defstate="1">
18      <rect state="1">
19         <color red="1.0" green="1.0" blue="1.0" />
20      </rect>
21      <rect state="0">
22         <color red="0.3" green="0.3" blue="0.3" />
23      </rect>
24      <text string="BET">
25         <color red="0.0" green="0.0" blue="0.0" />
26         <bounds x="0" y="0.1" width="1" height="0.8" />
27      </text>
28   </element>
29
30   <element name="L3" defstate="1">
31      <rect state="1">
32         <color red="0.0" green="1.0" blue="0.0" />
33      </rect>
34      <rect state="0">
35         <color red="0.0" green="0.3" blue="0.0" />
36      </rect>
37      <text string="END OF RACE">
38         <color red="0.0" green="0.0" blue="0.0" />
39         <bounds x="0" y="0.1" width="1" height="0.8" />
40      </text>
41   </element>
42
43
44   <view name="Button Lamps">
45      <screen index="0">
46         <bounds left="0" top="0" right="4" bottom="3" />
47      </screen>
48      <bezel name="lamp1" element="L1">
49         <bounds x="0" y="3.13" width="0.40" height="0.24" />
50      </bezel>
51      <bezel name="lamp2" element="L2">
52         <bounds x="0.5" y="3.13" width="0.40" height="0.24" />
53      </bezel>
54      <bezel name="lamp3" element="L3">
55         <bounds x="1.6" y="3.13" width="2.00" height="0.24" />
56      </bezel>
57   </view>
58</mamelayout>
src/mame/drivers/bfcobra.c
r3232r3233
122122/*
123123    Function prototypes
124124*/
125INLINE void z80_bank(int num, int data);
125INLINE void z80_bank(running_machine *machine, int num, int data);
126126
127127
128128static void update_irqs(running_machine *machine)
r3232r3233
380380   return 0;
381381}
382382
383INLINE UINT8* blitter_get_addr(UINT32 addr)
383INLINE UINT8* blitter_get_addr(running_machine *machine, UINT32 addr)
384384{
385385   if (addr < 0x10000)
386386   {
387387      /* Is this region fixed? */
388      return (UINT8*)(memory_region(Machine, "user1") + addr);
388      return (UINT8*)(memory_region(machine, "user1") + addr);
389389   }
390390   else if(addr < 0x20000)
391391   {
392392      addr &= 0xffff;
393393      addr += (bank[0] & 1) ? 0x10000 : 0;
394394
395      return (UINT8*)(memory_region(Machine, "user1") + addr + ((bank[0] >> 1) * 0x20000));
395      return (UINT8*)(memory_region(machine, "user1") + addr + ((bank[0] >> 1) * 0x20000));
396396   }
397397   else if (addr >= 0x20000 && addr < 0x40000)
398398   {
r3232r3233
410410    The Flare One blitter is a simpler design with slightly different parameters
411411    and will require hardware tests to figure everything out correctly.
412412*/
413static void RunBlit(void)
413static void RunBlit(running_machine *machine)
414414{
415#define BLITPRG_READ(x)      blitter.x = *(blitter_get_addr(blitter.program.addr++))
415#define BLITPRG_READ(x)      blitter.x = *(blitter_get_addr(machine, blitter.program.addr++))
416416
417417   int cycles_used = 0;
418418
r3232r3233
522522                  blitter.source.addr0 -=blitter.step;
523523               }
524524
525               *blitter_get_addr(blitter.dest.addr) = blitter.pattern;
525               *blitter_get_addr(machine, blitter.dest.addr) = blitter.pattern;
526526               cycles_used++;
527527
528528            } while (--innercnt);
r3232r3233
536536
537537            if (LOOPTYPE == 3 && innercnt == blitter.innercnt)
538538            {
539               srcdata = *(blitter_get_addr(blitter.source.addr & 0xfffff));
539               srcdata = *(blitter_get_addr(machine, blitter.source.addr & 0xfffff));
540540               blitter.source.loword++;
541541               cycles_used++;
542542            }
r3232r3233
546546            {
547547               if (LOOPTYPE == 0 || LOOPTYPE == 1)
548548               {
549                  srcdata = *(blitter_get_addr(blitter.source.addr & 0xfffff));
549                  srcdata = *(blitter_get_addr(machine, blitter.source.addr & 0xfffff));
550550                  cycles_used++;
551551
552552                  if (blitter.modectl & MODE_SSIGN)
r3232r3233
561561            /* Read destination pixel? */
562562            if (LOOPTYPE == 0)
563563            {
564               dstdata = *blitter_get_addr(blitter.dest.addr & 0xfffff);
564               dstdata = *blitter_get_addr(machine, blitter.dest.addr & 0xfffff);
565565               cycles_used++;
566566            }
567567
r3232r3233
630630                            The existing destination pixel is used as a lookup
631631                            into the table and the colours is replaced.
632632                        */
633                  UINT8 dest = *blitter_get_addr(blitter.dest.addr);
634                  UINT8 newcol = *(blitter_get_addr((blitter.source.addr + dest) & 0xfffff));
633                  UINT8 dest = *blitter_get_addr(machine, blitter.dest.addr);
634                  UINT8 newcol = *(blitter_get_addr(machine, (blitter.source.addr + dest) & 0xfffff));
635635
636                  *blitter_get_addr(blitter.dest.addr) = newcol;
636                  *blitter_get_addr(machine, blitter.dest.addr) = newcol;
637637                  cycles_used += 3;
638638               }
639639               else
r3232r3233
652652                  if (blitter.compfunc & CMPFUNC_LOG0)
653653                     final_result |= ~result & ~dstdata;
654654
655                  *blitter_get_addr(blitter.dest.addr) = final_result;
655                  *blitter_get_addr(machine, blitter.dest.addr) = final_result;
656656                  cycles_used++;
657657               }
658658            }
r3232r3233
888888
889889         data &= 0x3f;
890890         bank[offset] = data;
891         z80_bank(offset, data);
891         z80_bank(machine, offset, data);
892892         break;
893893      }
894894
r3232r3233
945945         blitter.command = data;
946946
947947         if (data & CMD_RUN)
948            RunBlit();
948            RunBlit(machine);
949949         else
950950            mame_printf_debug("Blitter stopped by IO.\n");
951951
r3232r3233
963963   }
964964}
965965
966INLINE void z80_bank(int num, int data)
966INLINE void z80_bank(running_machine *machine, int num, int data)
967967{
968968   if (data < 0x08)
969969   {
r3232r3233
976976
977977      UINT32 offset = ((bank[0] >> 1) * 0x20000) + offs_table[bank[0] & 0x1][data];
978978
979      memory_set_bankptr(num, memory_region(Machine, "user1") + offset);
979      memory_set_bankptr(num, memory_region(machine, "user1") + offset);
980980   }
981981   else if (data < 0x10)
982982   {
r3232r3233
991991static WRITE8_HANDLER( rombank_w )
992992{
993993   bank[0] = data;
994   z80_bank(1, bank[1]);
995   z80_bank(2, bank[2]);
996   z80_bank(3, bank[3]);
994   z80_bank(machine, 1, bank[1]);
995   z80_bank(machine, 2, bank[2]);
996   z80_bank(machine, 3, bank[3]);
997997}
998998
999999
r3232r3233
13971397      case 0:
13981398      {
13991399         int changed = mux_outputlatch ^ data;
1400         static const char *port[] = { "STROBE0", "STROBE1", "STROBE2", "STROBE3", "STROBE4", "STROBE5", "STROBE6", "STROBE7" };
1400         static const char *const port[] = { "STROBE0", "STROBE1", "STROBE2", "STROBE3", "STROBE4", "STROBE5", "STROBE6", "STROBE7" };
14011401
14021402         mux_outputlatch = data;
14031403
src/mame/drivers/mitchell.c
r3232r3233
212212static READ8_HANDLER( block_input_r )
213213{
214214   static int dir[2];
215   static const char *dialnames[] = { "DIAL1", "DIAL2" };
216   static const char *portnames[] = { "IN1", "IN2" };
215   static const char *const dialnames[] = { "DIAL1", "DIAL2" };
216   static const char *const portnames[] = { "IN1", "IN2" };
217217
218218   if (dial_selected)
219219   {
r3232r3233
295295
296296static READ8_HANDLER( input_r )
297297{
298   static const char *portnames[] = { "IN0", "IN1", "IN2" };
298   static const char *const portnames[] = { "IN0", "IN1", "IN2" };
299299
300300   switch (input_type)
301301   {
r3232r3233
384384   AM_RANGE(0xe000, 0xffff) AM_WRITE(SMH_RAM)
385385ADDRESS_MAP_END
386386
387static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 )
387static ADDRESS_MAP_START( io_map, ADDRESS_SPACE_IO, 8 )
388388   ADDRESS_MAP_GLOBAL_MASK(0xff)
389   AM_RANGE(0x00, 0x02) AM_READ(input_r)   /* Super Pang needs a kludge to initialize EEPROM.
390                        The Mahjong games and Block Block need special input treatment */
391   AM_RANGE(0x03, 0x03) AM_READ(input_port_12_r)   /* mgakuen only */
392   AM_RANGE(0x04, 0x04) AM_READ(input_port_13_r)   /* mgakuen only */
393   AM_RANGE(0x05, 0x05) AM_READ(pang_port5_r)
394ADDRESS_MAP_END
395
396static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 )
397   ADDRESS_MAP_GLOBAL_MASK(0xff)
398   AM_RANGE(0x00, 0x00) AM_WRITE(pang_gfxctrl_w)    /* Palette bank, layer enable, coin counters, more */
389   AM_RANGE(0x00, 0x00) AM_WRITE(pang_gfxctrl_w)   /* Palette bank, layer enable, coin counters, more */
390   AM_RANGE(0x00, 0x02) AM_READ(input_r)         /* Super Pang needs a kludge to initialize EEPROM.
391                                                       The Mahjong games and Block Block need special input treatment */
399392   AM_RANGE(0x01, 0x01) AM_WRITE(input_w)
400   AM_RANGE(0x02, 0x02) AM_WRITE(pang_bankswitch_w)      /* Code bank register */
401   AM_RANGE(0x03, 0x03) AM_WRITE(ym2413_data_port_0_w)
402   AM_RANGE(0x04, 0x04) AM_WRITE(ym2413_register_port_0_w)
403   AM_RANGE(0x05, 0x05) AM_WRITE(okim6295_data_0_w)
404   AM_RANGE(0x06, 0x06) AM_WRITE(SMH_NOP)   /* watchdog? irq ack? */
405   AM_RANGE(0x07, 0x07) AM_WRITE(pang_video_bank_w)      /* Video RAM bank register */
393   AM_RANGE(0x02, 0x02) AM_WRITE(pang_bankswitch_w)   /* Code bank register */
394   AM_RANGE(0x03, 0x03) AM_READWRITE(input_port_12_r, ym2413_data_port_0_w)      /* mgakuen only */
395   AM_RANGE(0x04, 0x04) AM_READWRITE(input_port_13_r, ym2413_register_port_0_w)   /* mgakuen only */
396   AM_RANGE(0x05, 0x05) AM_READWRITE(pang_port5_r, okim6295_data_0_w)
397   AM_RANGE(0x06, 0x06) AM_WRITE(SMH_NOP)            /* watchdog? irq ack? */
398   AM_RANGE(0x07, 0x07) AM_WRITE(pang_video_bank_w)   /* Video RAM bank register */
406399   AM_RANGE(0x08, 0x08) AM_WRITE(eeprom_cs_w)
407400   AM_RANGE(0x10, 0x10) AM_WRITE(eeprom_clock_w)
408401   AM_RANGE(0x18, 0x18) AM_WRITE(eeprom_serial_w)
409402ADDRESS_MAP_END
410403
411
412404/* spangbl */
413405
414406static ADDRESS_MAP_START( spangb_memmap, ADDRESS_SPACE_PROGRAM, 8 )
r3232r3233
487479extern WRITE8_HANDLER( mstworld_gfxctrl_w );
488480extern WRITE8_HANDLER( mstworld_video_bank_w );
489481
490static ADDRESS_MAP_START( mstworld_readport, ADDRESS_SPACE_IO, 8 )
482static ADDRESS_MAP_START( mstworld_io_map, ADDRESS_SPACE_IO, 8 )
491483   ADDRESS_MAP_GLOBAL_MASK(0xff)
492   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")   /* coins */
493   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")   /* p1 */
494   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2")   /* p2 */
495   AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW1")   /* dips? */
484   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_WRITE(mstworld_gfxctrl_w)   /* Palette bank, layer enable, coin counters, more */
485   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
486   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_WRITE(pang_bankswitch_w)   /* Code bank register */
487   AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW1") AM_WRITE(mstworld_sound_w)   /* write to sound cpu */
496488   AM_RANGE(0x04, 0x04) AM_READ_PORT("DSW2")   /* dips? */
497489   AM_RANGE(0x05, 0x05) AM_READ_PORT("DSW0")   /* special? */
498490   AM_RANGE(0x06, 0x06) AM_READ_PORT("DSW3")   /* dips? */
491   AM_RANGE(0x06, 0x06) AM_WRITE(SMH_NOP)      /* watchdog? irq ack? */
492   AM_RANGE(0x07, 0x07) AM_WRITE(mstworld_video_bank_w)   /* Video RAM bank register */
499493ADDRESS_MAP_END
500494
501static ADDRESS_MAP_START( mstworld_writeport, ADDRESS_SPACE_IO, 8 )
502   ADDRESS_MAP_GLOBAL_MASK(0xff)
503   AM_RANGE(0x00, 0x00) AM_WRITE(mstworld_gfxctrl_w)    /* Palette bank, layer enable, coin counters, more */
504   AM_RANGE(0x02, 0x02) AM_WRITE(pang_bankswitch_w)      /* Code bank register */
505   AM_RANGE(0x03, 0x03) AM_WRITE(mstworld_sound_w)      /* write to sound cpu */
506   AM_RANGE(0x06, 0x06) AM_WRITE(SMH_NOP)   /* watchdog? irq ack? */
507   AM_RANGE(0x07, 0x07) AM_WRITE(mstworld_video_bank_w)      /* Video RAM bank register */
508ADDRESS_MAP_END
509
510495/**** End Monsters World ****/
511496
512497
r3232r3233
11331118   /* basic machine hardware */
11341119   MDRV_CPU_ADD("main", Z80, 6000000)   /* ??? */
11351120   MDRV_CPU_PROGRAM_MAP(mgakuen_readmem,mgakuen_writemem)
1136   MDRV_CPU_IO_MAP(readport,writeport)
1121   MDRV_CPU_IO_MAP(io_map,0)
11371122   MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2)   /* ??? one extra irq seems to be needed for music (see input5_r) */
11381123
11391124   /* video hardware */
r3232r3233
11671152   /* basic machine hardware */
11681153   MDRV_CPU_ADD("main",Z80, 8000000)   /* (verified on pcb) */
11691154   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
1170   MDRV_CPU_IO_MAP(readport,writeport)
1155   MDRV_CPU_IO_MAP(io_map,0)
11711156   MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2)   /* ??? one extra irq seems to be needed for music (see input5_r) */
11721157
11731158   MDRV_NVRAM_HANDLER(mitchell)
r3232r3233
12661251   MDRV_CPU_ADD("main", Z80, 6000000*4)
12671252
12681253   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
1269   MDRV_CPU_IO_MAP(mstworld_readport,mstworld_writeport)
1254   MDRV_CPU_IO_MAP(mstworld_io_map,0)
12701255   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
12711256
12721257   MDRV_CPU_ADD("audio", Z80,6000000)       /* 6 MHz? */
r3232r3233
13001285   /* basic machine hardware */
13011286   MDRV_CPU_ADD("main", Z80, 8000000)   /* Super Pang says 8MHZ ORIGINAL BOARD */
13021287   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
1303   MDRV_CPU_IO_MAP(readport,writeport)
1288   MDRV_CPU_IO_MAP(io_map,0)
13041289   MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,2)   /* ??? one extra irq seems to be needed for music (see input5_r) */
13051290
13061291   MDRV_NVRAM_HANDLER(mitchell)
r3232r3233
22342219GAME( 1991, blockj,   block,    pang,    block,    block,    ROT270, "Capcom", "Block Block (Japan 910910)", 0 )
22352220GAME( 1991, blockjoy, block,    pang,    blockjoy, block,    ROT270, "Capcom", "Block Block (World 911106 Joystick)", 0 )
22362221GAME( 1991, blockbl,  block,    pang,    block,    blockbl,  ROT270, "bootleg", "Block Block (bootleg)", 0 )
2222
src/mame/drivers/pasha2.c
r3232r3233
7777
7878static UINT16 *bitmap0, *bitmap1, *wram;
7979static int vbuffer = 0;
80static int old_bank;
8081
8182static WRITE16_HANDLER( pasha2_misc_w )
8283{
r3232r3233
8485   {
8586      if(data & 0x0800)
8687      {
87         static int old_bank = -1;
8888         int bank = data & 0xf000;
8989
9090         if(bank != old_bank)
r3232r3233
386386   return 0;
387387}
388388
389static MACHINE_RESET( pasha2 )
390{
391   old_bank = -1;
392   vbuffer = 0;
393}
394
389395static MACHINE_DRIVER_START( pasha2 )
390396   MDRV_CPU_ADD("main", E116XT, 20000000*4)      /* 4x internal multiplier */
391397   MDRV_CPU_PROGRAM_MAP(pasha2_map,0)
392398   MDRV_CPU_IO_MAP(pasha2_io,0)
393399   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
394400
401   MDRV_MACHINE_RESET(pasha2)
395402   MDRV_NVRAM_HANDLER(93C46)
396403
397404   /* video hardware */
src/mame/drivers/eprom.c
r3232r3233
8989static READ16_HANDLER( adc_r )
9090{
9191   static int last_offset;
92   static const char *adcnames[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
92   static const char *const adcnames[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
9393   int result = input_port_read(machine, adcnames[last_offset & 3]);
9494
9595   last_offset = offset;
src/mame/drivers/mainsnk.c
r3232r3233
1/* Main Event - SNK 1984
2   Canvas Croquis - SNK 1985
1/*
2Main Event - SNK 1984
3Canvas Croquis - SNK 1985
34
4   driver by    David Haywood
5        Tomasz Slanina
5driver by David Haywood, Tomasz Slanina
66
7  Notes: Main Event
8  -----------------
97
10 ROM doesn't pass its internal checksum
8Notes:
9------
10- canvas doesn't use the tx layer, though the circuitry is presumably still
11  present on the pcb. One gfx ROM socket is left empty which causes the tx layer
12  to be completely transparent.
1113
12 Todo:
13  - fix controls (now you need to press button1 + direction for punch/block ) and DIPs
14  - verify position of status bars
14- neither mainsnk nor canvas pass the ROM test in service mode. This looks like
15  a bug (as in madcrash). SNK obviously didn't pay too much attention to details
16  in those days.
17  Note that in canvas you can't see the error since the tx layer is transparent.
18  Load cc_p9.a2 at 0x0000 to see it.
1519
16  Notes: Canvas Croquis
17  ---------------------
20TODO:
21-----
22- are mainsnk control right? The way the button works is awkward.
1823
19 GFX banking is wrong?
20 Doesn't have the front layer?
21 Doesn't have the status bars?
24- several unknown dip switches
2225
26- the hardware surely supports sprite shadows as most of the games in snk.c, but
27  the feature isn't used by these two games.
28
29- mainsnk doesn't seem to write to the bg/sprite scroll registers? SO I hardcoded
30  scroll values for these two games, even if canvas does seem to write to them.
31
32- canvas writes to several unknown addresses on startup. Most of them should be
33  the scroll registers while others are unknown.
34
35- the bg tilemap is set to 256x256, however it could well be 512x256 as in the
36  other early SNK games in snk.c.
37
2338-----
2439
2540Canvas Croquis
r3232r3233
7186*/
7287
7388#include "driver.h"
89#include "snk.h"
7490#include "sound/ay8910.h"
75#include "sound/snkwave.h"
7691
7792extern UINT8 *mainsnk_fgram;
7893extern UINT8 *mainsnk_bgram;
r3232r3233
8398VIDEO_UPDATE(mainsnk);
8499VIDEO_UPDATE(canvas);
85100
86static int sound_cpu_ready;
87static int sound_command;
88static int sound_fetched;
101static int sound_cpu_busy;
89102
90103
91104static WRITE8_HANDLER( sound_command_w )
92105{
93   if( sound_fetched==0 ){
94      logerror("missed sound command: %02x\n", sound_command );
95   }
96
97   sound_fetched = 0;
98   sound_command = data;
99   sound_cpu_ready = 0;
106   sound_cpu_busy = 1;
107   soundlatch_w(machine, 0, data);
100108   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE);
101109}
102110
103111static READ8_HANDLER( sound_command_r )
104112{
105   sound_fetched = 1;
106   return sound_command;
113   return soundlatch_r(machine, 0);
107114}
108115
109116static READ8_HANDLER( sound_ack_r )
110117{
111   sound_cpu_ready = 1;
118   sound_cpu_busy = 0;
112119   return 0xff;
113120}
114121
115122static CUSTOM_INPUT( mainsnk_sound_r )
116123{
117   return (!sound_cpu_ready) ? 0x01 : 0x00;
124   return (sound_cpu_busy) ? 0x01 : 0x00;
118125}
119126
127
128
120129static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
121130   AM_RANGE(0x0000, 0xbfff) AM_ROM
122   AM_RANGE(0xc000, 0xc000) AM_READ_PORT("SYSTEM")
123   AM_RANGE(0xc100, 0xc100) AM_READ_PORT("P1")
124   AM_RANGE(0xc200, 0xc200) AM_READ_PORT("P2")
125   AM_RANGE(0xc300, 0xc300) AM_READ_PORT("BUTTONS")
126   AM_RANGE(0xc400, 0xc400) AM_READ_PORT("UNK")
127   AM_RANGE(0xc500, 0xc500) AM_READ_PORT("DSW")
131   AM_RANGE(0xc000, 0xc000) AM_READ_PORT("IN0")
132   AM_RANGE(0xc100, 0xc100) AM_READ_PORT("IN1")
133   AM_RANGE(0xc200, 0xc200) AM_READ_PORT("IN2")
134   AM_RANGE(0xc300, 0xc300) AM_READ_PORT("IN3")
135   AM_RANGE(0xc400, 0xc400) AM_READ_PORT("DSW1")
136   AM_RANGE(0xc500, 0xc500) AM_READ_PORT("DSW2")
128137   AM_RANGE(0xc600, 0xc600) AM_WRITE(mainsnk_c600_w)
129138   AM_RANGE(0xc700, 0xc700) AM_WRITE(sound_command_w)
130139   AM_RANGE(0xd800, 0xdbff) AM_RAM_WRITE(mainsnk_bgram_w) AM_BASE(&mainsnk_bgram)
131140   AM_RANGE(0xdc00, 0xe7ff) AM_RAM
132141   AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE(&spriteram)
133   AM_RANGE(0xf000, 0xf3ff) AM_RAM_WRITE(mainsnk_fgram_w) AM_BASE(&mainsnk_fgram)
134   AM_RANGE(0xf400, 0xf7ff) AM_RAM
142   AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(mainsnk_fgram_w) AM_BASE(&mainsnk_fgram)   // + work RAM
135143ADDRESS_MAP_END
136144
137145static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
r3232r3233
141149   AM_RANGE(0xc000, 0xc000) AM_READ(sound_ack_r)
142150   AM_RANGE(0xe000, 0xe000) AM_WRITE(ay8910_control_port_0_w)
143151   AM_RANGE(0xe001, 0xe001) AM_WRITE(ay8910_write_port_0_w)
144   AM_RANGE(0xe002, 0xe007) AM_WRITE(snkwave_w)
152   AM_RANGE(0xe002, 0xe003) AM_WRITENOP   // ? always FFFF, snkwave leftover?
145153   AM_RANGE(0xe008, 0xe008) AM_WRITE(ay8910_control_port_1_w)
146154   AM_RANGE(0xe009, 0xe009) AM_WRITE(ay8910_write_port_1_w)
147155ADDRESS_MAP_END
r3232r3233
151159   AM_RANGE(0x00, 0x00) AM_READNOP
152160ADDRESS_MAP_END
153161
162
163
154164static INPUT_PORTS_START( mainsnk )
155   PORT_START("SYSTEM")
165   PORT_START("IN0")
156166   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
157167   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
158   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 )
159   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
160   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
168   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
169   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START1 )
170   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_START2 )
161171   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(mainsnk_sound_r, NULL)   /* sound CPU status */
162   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
172   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNKNOWN )
173   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_SERVICE )
163174
164   PORT_START("P1")
165   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP)
166   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  )
167   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  )
175   PORT_START("IN1")
176   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
177   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
178   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
168179   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
180   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
181   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
182   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
183   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
169184
170   PORT_START("P2")
185   PORT_START("IN2")
171186   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
172187   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
173188   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
174189   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
190   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
191   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
192   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
193   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
175194
176   PORT_START("BUTTONS")
195   PORT_START("IN3")
177196   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) /* ?? */
197   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
198   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_UNKNOWN )
199   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN )
200   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) /* ?? */
201   PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_UNKNOWN )
202   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNKNOWN )
203   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
178204
179   PORT_START("DSW")
180   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) )
181   PORT_DIPSETTING(    0x01, DEF_STR( 3C_1C ) ) /* also 02,04 */
205   PORT_START("DSW1")
206   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:1")
207   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
208   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
209   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:2")
210   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
211   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
212   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:3")
213   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
214   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
215   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:4")
216   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
217   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
218   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:5")
219   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
220   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
221   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:6")
222   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
223   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
224   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:7")
225   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
226   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
227   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:8")
228   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
229   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
230
231   PORT_START("DSW2")
232   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DSW2:1,2,3")
233//  PORT_DIPSETTING(    0x01, DEF_STR( 3C_1C ) )    // duplicate
234//  PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )    // duplicate
235   PORT_DIPSETTING(    0x04, DEF_STR( 3C_1C ) )
182236   PORT_DIPSETTING(    0x06, DEF_STR( 2C_1C ) )
183237   PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )
184238   PORT_DIPSETTING(    0x03, DEF_STR( 1C_2C ) )
185239   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
186240   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
187   PORT_DIPNAME( 0x60, 0x60, "Game mode" )
188   PORT_DIPSETTING(    0x60, "Demo Sounds Off" )
189   PORT_DIPSETTING(    0x20, "Demo Sounds On" )
190   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
191   PORT_DIPSETTING(    0x00, "Freeze" )
192   PORT_DIPNAME( 0x08, 0x00, "SW 2-3" )
241   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:4")
193242   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
194243   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
195   PORT_DIPNAME( 0x10, 0x00, "SW 2-4" ) /* $1ecf */
244   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:5") /* $1ecf */
196245   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
197246   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
198   PORT_DIPNAME( 0x80, 0x00, "SW 2-7" )
199   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
200   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
201
202   PORT_START("UNK")
247   PORT_DIPNAME( 0x60, 0x20, "Game mode" ) PORT_DIPLOCATION("DSW2:6,7")
248   PORT_DIPSETTING(    0x60, "Demo Sounds Off" )
249   PORT_DIPSETTING(    0x20, "Demo Sounds On" )
250   PORT_DIPSETTING(    0x00, "Freeze" )
251   PORT_DIPSETTING(    0x40, "Endless Game (Cheat)" )
252   PORT_DIPNAME( 0x80, 0x80, "2 Players Game" ) PORT_DIPLOCATION("DSW2:8")
253   PORT_DIPSETTING(    0x80, "1 Credit" )
254   PORT_DIPSETTING(    0x00, "2 Credits" )
203255INPUT_PORTS_END
204256
205257static INPUT_PORTS_START( canvas )
206   PORT_START("SYSTEM")
258   PORT_START("IN0")
207259   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
208260   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
209   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 )
210   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
211   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
212   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* sound CPU status? or vbl? */
213   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
261   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
262   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START1 )
263   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_START2 )
264   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(mainsnk_sound_r, NULL)   /* sound CPU status */
265   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNKNOWN )
266   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_SERVICE )
214267
215   PORT_START("P1")
268   PORT_START("IN1")
216269   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP)
217270   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  )
218271   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  )
219272   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
220   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 )
273   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
221274   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
222   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
223   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
224   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
225   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
226   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
227   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
275   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
276   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
228277
229   PORT_START("P2")
230   PORT_DIPNAME( 0x01, 0x01, "2" )
231   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
232   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
233   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
234   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
235   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
236   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
237   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
238   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
239   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
240   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
241   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
242   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
243   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
244   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
245   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
246   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
247   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
248   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
249   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
250   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
251   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
252   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
253   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
278   PORT_START("IN2")
279   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_COCKTAIL
280   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_COCKTAIL
281   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_COCKTAIL
282   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
283   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
284   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
285   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
286   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
254287
255   PORT_START("BUTTONS")
256   PORT_DIPNAME( 0x01, 0x01, "3" )
257   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
258   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
259   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
260   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
261   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
262   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
263   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
264   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
265   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
266   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
267   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
268   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
269   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
270   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
271   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
272   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
273   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
274   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
275   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
276   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
277   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
278   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
279   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
288   PORT_START("IN3")
289   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
280290
281   PORT_START("DSW")
282   PORT_DIPNAME( 0x01, 0x01, "4" )
291   PORT_START("DSW1")
292   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:1")
283293   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
284294   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
285   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
286   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
287   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
288   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
289   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
290   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
291   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
292   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
293   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
294   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
295   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
296   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
297   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
298   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
299   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
300   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
295   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("DSW1:2")
296   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
297   PORT_DIPSETTING(    0x02, DEF_STR( Cocktail ) )
298   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW1:3")
299   PORT_DIPSETTING(    0x04, "3" )
300   PORT_DIPSETTING(    0x00, "5" )
301   PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DSW1:4,5,6")
302//  PORT_DIPSETTING(    0x08, DEF_STR( 5C_1C ) )    // duplicate
303   PORT_DIPSETTING(    0x10, DEF_STR( 5C_1C ) )
304   PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
305   PORT_DIPSETTING(    0x18, DEF_STR( 2C_1C ) )
306   PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C ) )
307   PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) )
308   PORT_DIPSETTING(    0x28, DEF_STR( 1C_3C ) )
309   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
310   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:7")   // bonus life?
301311   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
302312   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
303   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
313   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:8")   // bonus life?
304314   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
305315   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
306316
307   PORT_START("UNK")
308   PORT_DIPNAME( 0x01, 0x01, "5" )
317   PORT_START("DSW2")
318   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:1")   // bonus life?
309319   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
310320   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
311   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
321   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:2")   // difficulty?
312322   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
313323   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
314   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
324   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:3")   // difficulty?
315325   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
316326   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
317   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
318   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
319   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
320   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
321   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
322   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
323   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
324   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
325   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
326   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
327   PORT_DIPNAME( 0x18, 0x10, "Game mode" ) PORT_DIPLOCATION("DSW2:4,5")
328   PORT_DIPSETTING(    0x18, "Demo Sounds Off" )
329   PORT_DIPSETTING(    0x10, "Demo Sounds On" )
330   PORT_DIPSETTING(    0x00, "Freeze" )
331   PORT_DIPSETTING(    0x08, "Infinite Lives (Cheat)" )
332   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("DSW2:6")
333   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
334   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
335   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:7")
327336   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
328337   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
329   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
338   PORT_DIPNAME( 0x80, 0x00, "Must Be On" ) PORT_DIPLOCATION("DSW2:8")
330339   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
331   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
340   PORT_DIPSETTING(    0x00, DEF_STR( On ) )   // needs to be on otherwise pictures in later levels are wrong
332341INPUT_PORTS_END
333342
334343
r3232r3233
358367
359368
360369static GFXDECODE_START( mainsnk )
361   GFXDECODE_ENTRY( "gfx1", 0x0, tile_layout,   0,  8 )
362   GFXDECODE_ENTRY( "gfx2", 0x0, sprite_layout,   0, 16 )
370   GFXDECODE_ENTRY( "gfx1", 0, tile_layout,   0x100, 0x080>>4 )
371   GFXDECODE_ENTRY( "gfx2", 0, sprite_layout, 0x000, 0x080>>3 )
363372GFXDECODE_END
364373
374
375
365376static MACHINE_DRIVER_START( mainsnk )
366377   MDRV_CPU_ADD("main", Z80, 3360000)
367378   MDRV_CPU_PROGRAM_MAP(main_map,0)
r3232r3233
372383    MDRV_CPU_IO_MAP(sound_portmap,0)
373384   MDRV_CPU_PERIODIC_INT(irq0_line_hold, 244)
374385
375   MDRV_GFXDECODE(mainsnk)
386   /* video hardware */
387   MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS)
376388
377389   MDRV_SCREEN_ADD("main", RASTER)
378   MDRV_SCREEN_REFRESH_RATE(60.606060)
379   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
390   MDRV_SCREEN_REFRESH_RATE(60)
380391   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
381   MDRV_SCREEN_SIZE(34*8, 32*8)
382   MDRV_SCREEN_VISIBLE_AREA(0*8, 34*8-1, 0*8, 27*8-1)
392   MDRV_SCREEN_SIZE(36*8, 28*8)
393   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 1*8, 28*8-1)
383394
384   MDRV_PALETTE_LENGTH((16+2)*16)
395   MDRV_GFXDECODE(mainsnk)
396   MDRV_PALETTE_LENGTH(0x400)
385397
398   MDRV_PALETTE_INIT(tnk3)
386399   MDRV_VIDEO_START(mainsnk)
387400   MDRV_VIDEO_UPDATE(mainsnk)
388401
r3232r3233
393406
394407   MDRV_SOUND_ADD("ay2", AY8910, 2000000)
395408   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.35)
396
397   MDRV_SOUND_ADD("wave", SNKWAVE, 8000000)
398   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.08)
399409MACHINE_DRIVER_END
400410
401static MACHINE_DRIVER_START( canvas )
402411
403   /* basic machine hardware */
404   MDRV_IMPORT_FROM(mainsnk)
405
406   MDRV_SCREEN_MODIFY("main")
407   MDRV_SCREEN_VISIBLE_AREA(2*8, 32*8-1, 0*8, 27*8-1)
408
409   MDRV_VIDEO_UPDATE(canvas)
410MACHINE_DRIVER_END
411
412
413412ROM_START( mainsnk)
414413   ROM_REGION( 0x10000, "main", 0 )
415   ROM_LOAD( "snk.p01",      0x000000, 0x002000, CRC(00db1ca2) SHA1(efe83488cf88adc185e6024b8f6ad5f8ef7f4cfd) )
416   ROM_LOAD( "snk.p02",      0x002000, 0x002000, CRC(df5c86b5) SHA1(e9c854524e3d8231c874314cdff321e66ec7f0c4) )
417   ROM_LOAD( "snk.p03",      0x004000, 0x002000, CRC(5c2b7bca) SHA1(e02c72fcd029999b730abd91f07866418cfe6216) )
418   ROM_LOAD( "snk.p04",      0x006000, 0x002000, CRC(68b4b2a1) SHA1(8f3abc826df93f0748151624066e956b9670bc9d) )
419   ROM_LOAD( "snk.p05",      0x008000, 0x002000, CRC(580a29b4) SHA1(4a96af92d65f86aca7f3a70032b5e4dc29048483) )
420   ROM_LOAD( "snk.p06",      0x00a000, 0x002000, CRC(5f8a60a2) SHA1(88a051e13d6b3bbd3606a4c4cc0395da07e0f109) )
414   ROM_LOAD( "snk.p01",      0x0000, 0x2000, CRC(00db1ca2) SHA1(efe83488cf88adc185e6024b8f6ad5f8ef7f4cfd) )
415   ROM_LOAD( "snk.p02",      0x2000, 0x2000, CRC(df5c86b5) SHA1(e9c854524e3d8231c874314cdff321e66ec7f0c4) )
416   ROM_LOAD( "snk.p03",      0x4000, 0x2000, CRC(5c2b7bca) SHA1(e02c72fcd029999b730abd91f07866418cfe6216) )
417   ROM_LOAD( "snk.p04",      0x6000, 0x2000, CRC(68b4b2a1) SHA1(8f3abc826df93f0748151624066e956b9670bc9d) )
418   ROM_LOAD( "snk.p05",      0x8000, 0x2000, CRC(580a29b4) SHA1(4a96af92d65f86aca7f3a70032b5e4dc29048483) )
419   ROM_LOAD( "snk.p06",      0xa000, 0x2000, CRC(5f8a60a2) SHA1(88a051e13d6b3bbd3606a4c4cc0395da07e0f109) )
421420
422421   ROM_REGION( 0x10000, "audio", 0 )
423   ROM_LOAD( "snk.p07",   0x0000, 0x4000, CRC(4208391e) SHA1(d110ca4ff9d21fe7813f04ec43c2c23471c6517f) )
422   ROM_LOAD( "snk.p07",        0x0000, 0x4000, CRC(4208391e) SHA1(d110ca4ff9d21fe7813f04ec43c2c23471c6517f) )
424423
425424   ROM_REGION( 0x08000, "gfx1", 0 )
426   ROM_LOAD( "snk.p12",      0x000000, 0x002000, CRC(ecf87eb7) SHA1(83b8d19070d5930b306a0309ebba05b04c2abebf) )
427   ROM_LOAD( "snk.p11",      0x002000, 0x002000, CRC(3f6bc5ba) SHA1(02e49f58f5d94117113b59037fa49b8897d05b4b) )
428   ROM_LOAD( "snk.p10",      0x004000, 0x002000, CRC(b5147a96) SHA1(72641fadabd16f2de4f4cf6ff3ef07233de5ddfd) )
429   ROM_LOAD( "snk.p09",      0x006000, 0x002000, CRC(0ebcf837) SHA1(7b93cdffd3b8d768b98bb01956114e4ff012d029) )
425   ROM_LOAD( "snk.p12",      0x0000, 0x2000, CRC(ecf87eb7) SHA1(83b8d19070d5930b306a0309ebba05b04c2abebf) )
426   ROM_LOAD( "snk.p11",      0x2000, 0x2000, CRC(3f6bc5ba) SHA1(02e49f58f5d94117113b59037fa49b8897d05b4b) )
427   ROM_LOAD( "snk.p10",      0x4000, 0x2000, CRC(b5147a96) SHA1(72641fadabd16f2de4f4cf6ff3ef07233de5ddfd) )
428   ROM_LOAD( "snk.p09",      0x6000, 0x2000, CRC(0ebcf837) SHA1(7b93cdffd3b8d768b98bb01956114e4ff012d029) )
430429
431430   ROM_REGION( 0x12000, "gfx2", 0 )
432   ROM_LOAD( "snk.p13",      0x000000, 0x002000, CRC(2eb624a4) SHA1(157d7beb6ff0baa9276e388774a85996dc03821d) )
433   ROM_LOAD( "snk.p16",      0x002000, 0x002000, CRC(dc502869) SHA1(024c868e8cd74c52f4787a19b9ad292b7a9dcc1c) )
434   ROM_LOAD( "snk.p19",      0x004000, 0x002000, CRC(58d566a1) SHA1(1451b223ddb7c975b770f28af6c41775daaf95c1) )
435   ROM_LOAD( "snk.p14",      0x006000, 0x002000, CRC(bb927d82) SHA1(ac7ae1850cf22b73e31c92b6f598fb057470a570) )
436   ROM_LOAD( "snk.p17",      0x008000, 0x002000, CRC(66f60c32) SHA1(7a08d0a2c1804cdaad702a23ff33128d0b6d8084) )
437   ROM_LOAD( "snk.p20",      0x00a000, 0x002000, CRC(d12c6333) SHA1(bed1a0aedaa8f6fe9c33f49b5da00ab1c9045ddd) )
438   ROM_LOAD( "snk.p15",      0x00c000, 0x002000, CRC(d242486d) SHA1(0c24a3fdcb604b6231b75069c99009d68023bb8f) )
439   ROM_LOAD( "snk.p18",      0x00e000, 0x002000, CRC(838b12a3) SHA1(a3444f9b2aeef70caa93e5f642cb6c3b75e88ea4) )
440   ROM_LOAD( "snk.p21",      0x010000, 0x002000, CRC(8961a51e) SHA1(4f9d8358bc76118c4fab631ae73a02ab5aa0c036) )
431   ROM_LOAD( "snk.p13",      0x00000, 0x2000, CRC(2eb624a4) SHA1(157d7beb6ff0baa9276e388774a85996dc03821d) )
432   ROM_LOAD( "snk.p16",      0x02000, 0x2000, CRC(dc502869) SHA1(024c868e8cd74c52f4787a19b9ad292b7a9dcc1c) )
433   ROM_LOAD( "snk.p19",      0x04000, 0x2000, CRC(58d566a1) SHA1(1451b223ddb7c975b770f28af6c41775daaf95c1) )
434   ROM_LOAD( "snk.p14",      0x06000, 0x2000, CRC(bb927d82) SHA1(ac7ae1850cf22b73e31c92b6f598fb057470a570) )
435   ROM_LOAD( "snk.p17",      0x08000, 0x2000, CRC(66f60c32) SHA1(7a08d0a2c1804cdaad702a23ff33128d0b6d8084) )
436   ROM_LOAD( "snk.p20",      0x0a000, 0x2000, CRC(d12c6333) SHA1(bed1a0aedaa8f6fe9c33f49b5da00ab1c9045ddd) )
437   ROM_LOAD( "snk.p15",      0x0c000, 0x2000, CRC(d242486d) SHA1(0c24a3fdcb604b6231b75069c99009d68023bb8f) )
438   ROM_LOAD( "snk.p18",      0x0e000, 0x2000, CRC(838b12a3) SHA1(a3444f9b2aeef70caa93e5f642cb6c3b75e88ea4) )
439   ROM_LOAD( "snk.p21",      0x10000, 0x2000, CRC(8961a51e) SHA1(4f9d8358bc76118c4fab631ae73a02ab5aa0c036) )
441440
442   ROM_REGION( 0x1800, "proms", 0 )
443   ROM_LOAD( "main3.bin",    0x000000, 0x000800, CRC(78b29dde) SHA1(c2f93cde6fd8bc175e9e0d38af41b7710d7f1c82) )
444   ROM_LOAD( "main2.bin",    0x000800, 0x000800, CRC(7c314c93) SHA1(c6bd2a0eaf617448ef65dcbadced313b0d69ab88) )
445   ROM_LOAD( "main1.bin",    0x001000, 0x000800, CRC(deb895c4) SHA1(f1281dcb3471d9627565706ff09ba72f09dc62a4) )
441   ROM_REGION( 0x1000, "proms", 0 )   // overdumps? 2nd half is empty
442   ROM_LOAD( "main3.bin",    0x0000, 0x0800, CRC(78b29dde) SHA1(c2f93cde6fd8bc175e9e0d38af41b7710d7f1c82) )
443   ROM_LOAD( "main2.bin",    0x0400, 0x0800, CRC(7c314c93) SHA1(c6bd2a0eaf617448ef65dcbadced313b0d69ab88) )
444   ROM_LOAD( "main1.bin",    0x0800, 0x0800, CRC(deb895c4) SHA1(f1281dcb3471d9627565706ff09ba72f09dc62a4) )
446445ROM_END
447446
448447ROM_START( canvas )
449448   ROM_REGION( 0x10000, "main", 0 )
450   ROM_LOAD( "cc_p1.a2",      0x000000, 0x002000, CRC(fa7109e1) SHA1(23e31e14af2171ee2fd7290194805b95b0f7b35c) )
451   ROM_LOAD( "cc_p2.a3",      0x002000, 0x002000, CRC(8b8beb34) SHA1(c678ed7ec302eaac3594950f10f0a170353345e5) )
452   ROM_LOAD( "cc_p3.a4",      0x004000, 0x002000, CRC(ea342f87) SHA1(087e1260ba51bf47bf19942b59d21d067515989d) )
453   ROM_LOAD( "cc_p4.a5",      0x006000, 0x002000, CRC(9cf35d98) SHA1(08de7863f1a540b69487c87eb0a493ceeacffa1b) )
454   ROM_LOAD( "cc_p5.a7",      0x008000, 0x002000, CRC(c5ef1eda) SHA1(31cf3e7fe52718bebffdac9b3666454b0956a6d9) )
455   ROM_LOAD( "cc_p6.a8",      0x00a000, 0x002000, CRC(7b1dd7fc) SHA1(1287ab261885d5e9ba957024d7a00c7a0d31235b) )
449   ROM_LOAD( "cc_p1.a2",      0x0000, 0x2000, CRC(fa7109e1) SHA1(23e31e14af2171ee2fd7290194805b95b0f7b35c) )
450   ROM_LOAD( "cc_p2.a3",      0x2000, 0x2000, CRC(8b8beb34) SHA1(c678ed7ec302eaac3594950f10f0a170353345e5) )
451   ROM_LOAD( "cc_p3.a4",      0x4000, 0x2000, CRC(ea342f87) SHA1(087e1260ba51bf47bf19942b59d21d067515989d) )
452   ROM_LOAD( "cc_p4.a5",      0x6000, 0x2000, CRC(9cf35d98) SHA1(08de7863f1a540b69487c87eb0a493ceeacffa1b) )
453   ROM_LOAD( "cc_p5.a7",      0x8000, 0x2000, CRC(c5ef1eda) SHA1(31cf3e7fe52718bebffdac9b3666454b0956a6d9) )
454   ROM_LOAD( "cc_p6.a8",      0xa000, 0x2000, CRC(7b1dd7fc) SHA1(1287ab261885d5e9ba957024d7a00c7a0d31235b) )
456455
457456   ROM_REGION( 0x10000, "audio", 0 )
458   ROM_LOAD( "cc_p7.h2",   0x0000, 0x4000, CRC(029b5ea0) SHA1(88f84b4dd01656ded8d983396ded404c9d8186f1) )
459   ROM_LOAD( "cc_p8.f2",   0x4000, 0x2000, CRC(0f0368ce) SHA1(a02f066ea024285a931b85709822a50a4099e0b0) )
457   ROM_LOAD( "cc_p7.h2",      0x0000, 0x4000, CRC(029b5ea0) SHA1(88f84b4dd01656ded8d983396ded404c9d8186f1) )
458   ROM_LOAD( "cc_p8.f2",      0x4000, 0x2000, CRC(0f0368ce) SHA1(a02f066ea024285a931b85709822a50a4099e0b0) )
460459
461460   ROM_REGION( 0x10000, "gfx1", 0 )
462   ROM_LOAD( "cc_p9.a2",       0x006000, 0x002000, CRC(b58c5f24) SHA1(7026b3d4f8060fd6607eb6d356d6b61cc9cb75c3) ) // ok
463   ROM_CONTINUE( 0xe000,0x2000) // ok
464   ROM_LOAD( "cc_p10.b2",      0x004000, 0x002000, CRC(3c0a4eeb) SHA1(53742a5bef16e71bebefb0e43a175341f5bf0aa6) )
465   ROM_CONTINUE( 0xc000,0x2000)
466   ROM_LOAD( "cc_p11.c2",      0x008000, 0x004000, CRC(4c8c2156) SHA1(7f1d9a1e1c6cab91f24c7fc75d0c7ec2702137af) )
461   ROM_FILL(                  0x0000, 0x4000, 0xff )   // empty, causes tx layer to be fully transparent
462   ROM_LOAD( "cc_p11.c2",     0x4000, 0x4000, CRC(4c8c2156) SHA1(7f1d9a1e1c6cab91f24c7fc75d0c7ec2702137af) )   // banks = 18&58
463   ROM_LOAD( "cc_p10.b2",     0x8000, 0x4000, CRC(3c0a4eeb) SHA1(53742a5bef16e71bebefb0e43a175341f5bf0aa6) )   // banks = 28&68
464   ROM_LOAD( "cc_p9.a2",      0xc000, 0x4000, CRC(b58c5f24) SHA1(7026b3d4f8060fd6607eb6d356d6b61cc9cb75c3) )   // banks = 30&70
467465
468466   ROM_REGION( 0x6000, "gfx2", 0 )
469   ROM_LOAD( "cc_p12.j8",      0x000000, 0x002000, CRC(9003a979) SHA1(f63959a9dc9ee67622865e783d2e501c640a4bed) )
470   ROM_LOAD( "cc_p13.j5",      0x002000, 0x002000, CRC(a52cd549) SHA1(1902b8c107c5156113068ced74349ac576ac047c) )
471   ROM_LOAD( "cc_p14.j2",      0x004000, 0x002000, CRC(edc6a1e8) SHA1(8c948a5f057e13bb9ed9738b66c702f45586fe59) )
467   ROM_LOAD( "cc_p12.j8",     0x0000, 0x2000, CRC(9003a979) SHA1(f63959a9dc9ee67622865e783d2e501c640a4bed) )
468   ROM_LOAD( "cc_p13.j5",     0x2000, 0x2000, CRC(a52cd549) SHA1(1902b8c107c5156113068ced74349ac576ac047c) )
469   ROM_LOAD( "cc_p14.j2",     0x4000, 0x2000, CRC(edc6a1e8) SHA1(8c948a5f057e13bb9ed9738b66c702f45586fe59) )
472470
473   ROM_REGION( 0x1800, "proms", 0 )
474   ROM_LOAD( "cc_bprom3.j8",    0x000000, 0x000400, CRC(21f72498) SHA1(a586c869cb4633fec0df92b5646ece78f99b6f2a) )
475   ROM_LOAD( "cc_bprom2.j9",    0x000800, 0x000400, CRC(19efe7df) SHA1(7e49af8b8b01fb929b87d6285da32fbe4c58606d) )
476   ROM_LOAD( "cc_bprom1.j10",   0x001000, 0x000400, CRC(fbbbf911) SHA1(86394a7f67bc4f89f72b9607ca3733ab3d690289) )
471   ROM_REGION( 0x0c00, "proms", 0 )
472   ROM_LOAD( "cc_bprom3.j8",  0x0000, 0x0400, CRC(21f72498) SHA1(a586c869cb4633fec0df92b5646ece78f99b6f2a) )
473   ROM_LOAD( "cc_bprom2.j9",  0x0400, 0x0400, CRC(19efe7df) SHA1(7e49af8b8b01fb929b87d6285da32fbe4c58606d) )
474   ROM_LOAD( "cc_bprom1.j10", 0x0800, 0x0400, CRC(fbbbf911) SHA1(86394a7f67bc4f89f72b9607ca3733ab3d690289) )
477475ROM_END
478476
479477
480478GAME( 1984, mainsnk,   0,   mainsnk, mainsnk, 0,   ROT0, "SNK", "Main Event (1984)", 0)
481GAME( 1985, canvas,    0,   canvas, canvas,  0,   ROT0, "SNK", "Canvas Croquis", GAME_IMPERFECT_GRAPHICS) // some gfx banks might be wrong...
479GAME( 1985, canvas,    0,   mainsnk, canvas,  0,   ROT0, "SNK", "Canvas Croquis", 0)
src/mame/drivers/hitme.c
r3232r3233
128128
129129static UINT8 read_port_and_t0(running_machine *machine, int port)
130130{
131   static const char *portnames[] = { "IN0", "IN1", "IN2", "IN3" };
131   static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" };
132132
133133   UINT8 val = input_port_read(machine, portnames[port]);
134134   if (attotime_compare(timer_get_time(), timeout_time) > 0)
src/mame/drivers/snowbros.c
r3232r3233
194194   AM_RANGE(0x8000, 0x87ff) AM_WRITE(SMH_RAM)
195195ADDRESS_MAP_END
196196
197static ADDRESS_MAP_START( sound_readport, ADDRESS_SPACE_IO, 8 )
197static ADDRESS_MAP_START( sound_io_map, ADDRESS_SPACE_IO, 8 )
198198   ADDRESS_MAP_GLOBAL_MASK(0xff)
199   AM_RANGE(0x02, 0x02) AM_READ(ym3812_status_port_0_r)
200   AM_RANGE(0x04, 0x04) AM_READ(soundlatch_r)
201ADDRESS_MAP_END
202
203static ADDRESS_MAP_START( sound_writeport, ADDRESS_SPACE_IO, 8 )
204   ADDRESS_MAP_GLOBAL_MASK(0xff)
205   AM_RANGE(0x02, 0x02) AM_WRITE(ym3812_control_port_0_w)
199   AM_RANGE(0x02, 0x02) AM_READWRITE(ym3812_status_port_0_r, ym3812_control_port_0_w)
206200   AM_RANGE(0x03, 0x03) AM_WRITE(ym3812_write_port_0_w)
207   AM_RANGE(0x04, 0x04) AM_WRITE(soundlatch_w)   /* goes back to the main CPU, checked during boot */
201   AM_RANGE(0x04, 0x04) AM_READWRITE(soundlatch_r, soundlatch_w)   /* goes back to the main CPU, checked during boot */
208202ADDRESS_MAP_END
209203
210204/* Winter Bobble - bootleg GFX chip */
r3232r3233
270264   AM_RANGE(0xe010, 0xe010) AM_WRITE(okim6295_data_0_w)
271265   ADDRESS_MAP_END
272266
273static ADDRESS_MAP_START( honeydol_sound_readport, ADDRESS_SPACE_IO, 8 )
267static ADDRESS_MAP_START( honeydol_sound_io_map, ADDRESS_SPACE_IO, 8 )
274268   ADDRESS_MAP_GLOBAL_MASK(0xff)
275   AM_RANGE(0x02, 0x02) AM_READ(ym3812_status_port_0_r) // not connected?
276   AM_RANGE(0x04, 0x04) AM_READ(soundlatch_r)
269   AM_RANGE(0x02, 0x02) AM_READWRITE(ym3812_status_port_0_r, ym3812_control_port_0_w)   // not connected?
270   AM_RANGE(0x03, 0x03) AM_WRITE(ym3812_write_port_0_w)                        // not connected?
271   AM_RANGE(0x04, 0x04) AM_READWRITE(soundlatch_r, soundlatch_w)   /* goes back to the main CPU, checked during boot */
277272ADDRESS_MAP_END
278273
279static ADDRESS_MAP_START( honeydol_sound_writeport, ADDRESS_SPACE_IO, 8 )
280   ADDRESS_MAP_GLOBAL_MASK(0xff)
281   AM_RANGE(0x02, 0x02) AM_WRITE(ym3812_control_port_0_w) // not connected?
282   AM_RANGE(0x03, 0x03) AM_WRITE(ym3812_write_port_0_w) // not connected?
283   AM_RANGE(0x04, 0x04) AM_WRITE(soundlatch_w)   /* goes back to the main CPU, checked during boot */
284ADDRESS_MAP_END
285
286274/* Twin Adventure */
287275
288276static WRITE16_HANDLER( twinadv_68000_sound_w )
r3232r3233
340328   okim6295_set_bank_base(0, bank * 0x40000);
341329}
342330
343static ADDRESS_MAP_START( twinadv_sound_readport, ADDRESS_SPACE_IO, 8 )
331static ADDRESS_MAP_START( twinadv_sound_io_map, ADDRESS_SPACE_IO, 8 )
344332   ADDRESS_MAP_GLOBAL_MASK(0xff)
345   AM_RANGE(0x02, 0x02) AM_READ(soundlatch_r)
346   AM_RANGE(0x06, 0x06) AM_READ(okim6295_status_0_r)
347ADDRESS_MAP_END
348
349static ADDRESS_MAP_START( twinadv_sound_writeport, ADDRESS_SPACE_IO, 8 )
350   ADDRESS_MAP_GLOBAL_MASK(0xff)
351   AM_RANGE(0x02, 0x02) AM_WRITE(soundlatch_w) // back to 68k?
333   AM_RANGE(0x02, 0x02) AM_READWRITE(soundlatch_r, soundlatch_w) // back to 68k?
352334   AM_RANGE(0x04, 0x04) AM_WRITE(twinadv_oki_bank_w) // oki bank?
353   AM_RANGE(0x06, 0x06) AM_WRITE(okim6295_data_0_w)
335   AM_RANGE(0x06, 0x06) AM_READWRITE(okim6295_status_0_r, okim6295_data_0_w)
354336ADDRESS_MAP_END
355337
356338
r3232r3233
15591541
15601542   MDRV_CPU_ADD("sound", Z80, 6000000) /* 6 MHz - confirmed */
15611543   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
1562   MDRV_CPU_IO_MAP(sound_readport,sound_writeport)
1544   MDRV_CPU_IO_MAP(sound_io_map,0)
15631545
15641546   /* video hardware */
15651547   MDRV_SCREEN_ADD("main", RASTER)
r3232r3233
16551637
16561638   MDRV_CPU_ADD("sound", Z80, 4000000)
16571639   MDRV_CPU_PROGRAM_MAP(honeydol_sound_readmem,honeydol_sound_writemem)
1658   MDRV_CPU_IO_MAP(honeydol_sound_readport,honeydol_sound_writeport)
1640   MDRV_CPU_IO_MAP(honeydol_sound_io_map,0)
16591641
16601642   /* video hardware */
16611643   MDRV_SCREEN_ADD("main", RASTER)
r3232r3233
16941676
16951677   MDRV_CPU_ADD("sound", Z80, 4000000)
16961678   MDRV_CPU_PROGRAM_MAP(twinadv_sound_readmem,twinadv_sound_writemem)
1697   MDRV_CPU_IO_MAP(twinadv_sound_readport,twinadv_sound_writeport)
1679   MDRV_CPU_IO_MAP(twinadv_sound_io_map,0)
16981680   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
16991681
17001682   /* video hardware */
r3232r3233
27812763GAME( 2002, 4in1boot, 0,        _4in1,    4in1boot, 4in1boot, ROT0, "K1 Soft", "Puzzle King (includes bootleg of Snow Bros.)" , 0)
27822764GAME( 2002, snowbro3, snowbros, snowbro3, snowbroj, snowbro3, ROT0, "Syrmex (bootleg/hack)", "Snow Brothers 3 - Magical Adventure", GAME_IMPERFECT_SOUND ) // its basically snowbros code?...
27832765GAME( 1993, finalttr, 0,        finalttr, finalttr, 0,        ROT0, "Jeil Computer System", "Final Tetris", 0 )
2766
2767
src/mame/drivers/bzone.c
r3232r3233
793793
794794static WRITE8_HANDLER( analog_select_w )
795795{
796   static const char *analog_port[] = { "AN0", "AN1", "AN2" };
796   static const char *const analog_port[] = { "AN0", "AN1", "AN2" };
797797
798798   if (offset <= 2)
799799      analog_data = input_port_read(machine, analog_port[offset]);
src/mame/drivers/simpl156.c
r3232r3233
501501   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
502502
503503
504   MDRV_SOUND_ADD("OKIM6295_EFFECTS", OKIM6295, 32220000/32)
504   MDRV_SOUND_ADD("okisfx", OKIM6295, 32220000/32)
505505   MDRV_SOUND_CONFIG(okim6295_interface_pin7high)
506506   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.6)
507507   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.6)
508508
509   MDRV_SOUND_ADD("OKIM6295_MUSIC", OKIM6295, 32220000/16)
509   MDRV_SOUND_ADD("okimusic", OKIM6295, 32220000/16)
510510   MDRV_SOUND_CONFIG(okim6295_interface_pin7high)
511511   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.2)
512512   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.2)
r3232r3233
539539   MDRV_CPU_MODIFY("main")
540540   MDRV_CPU_PROGRAM_MAP(mitchell156_map,0)
541541
542   MDRV_SOUND_REPLACE("OKIM6295_MUSIC", OKIM6295, 32220000/32)
542   MDRV_SOUND_REPLACE("okimusic", OKIM6295, 32220000/32)
543543   MDRV_SOUND_CONFIG(okim6295_interface_pin7high)
544544   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.2)
545545   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.2)
r3232r3233
548548
549549static DRIVER_INIT(simpl156)
550550{
551   UINT8 *rom = memory_region(machine, "OKIM6295_MUSIC");
552   int length = memory_region_length(machine, "OKIM6295_MUSIC");
551   UINT8 *rom = memory_region(machine, "okimusic");
552   int length = memory_region_length(machine, "okimusic");
553553   UINT8 *buf1 = malloc_or_die(length);
554554
555555   UINT32 x;
r3232r3233
623623   ROM_LOAD16_BYTE( "mbn01",    0x000001, 0x080000, CRC(a3a37353) SHA1(c4509c8268afb647c20e71b42ae8ebd2bdf075e6) ) /* 03.u11 */
624624   ROM_LOAD16_BYTE( "mbn02",    0x000000, 0x080000, CRC(aa2230c5) SHA1(43b7ac5c69cde1840a5255a8897e1c5d5f89fd7b) ) /* 04.u12 */
625625
626   ROM_REGION( 0x80000, "OKIM6295_EFFECTS", 0 ) /* Oki samples */
626   ROM_REGION( 0x80000, "okisfx", 0 ) /* Oki samples */
627627   ROM_LOAD( "mbn04",    0x00000, 0x40000,  CRC(dcbd4771) SHA1(2a1ab6b0fc372333c7eb17aab077fe1ca5ba1dea) ) /* 07.u46 */
628628
629   ROM_REGION( 0x200000, "OKIM6295_MUSIC", 0 ) /* samples? (banked?) */
629   ROM_REGION( 0x200000, "okimusic", 0 ) /* samples? (banked?) */
630630   ROM_LOAD( "mbn03",    0x00000, 0x200000, CRC(70b71a2a) SHA1(45851b0692de73016fc9b913316001af4690534c) ) /* 06.u45 */
631631ROM_END
632632
r3232r3233
659659   ROM_LOAD16_BYTE( "mbn01",    0x000001, 0x080000, CRC(a3a37353) SHA1(c4509c8268afb647c20e71b42ae8ebd2bdf075e6) )
660660   ROM_LOAD16_BYTE( "mbn02",    0x000000, 0x080000, CRC(aa2230c5) SHA1(43b7ac5c69cde1840a5255a8897e1c5d5f89fd7b) )
661661
662   ROM_REGION( 0x80000, "OKIM6295_EFFECTS", 0 ) /* Oki samples */
662   ROM_REGION( 0x80000, "okisfx", 0 ) /* Oki samples */
663663   ROM_LOAD( "mbn04",    0x00000, 0x40000,  CRC(dcbd4771) SHA1(2a1ab6b0fc372333c7eb17aab077fe1ca5ba1dea) )
664664
665   ROM_REGION( 0x200000, "OKIM6295_MUSIC", 0 ) /* samples? (banked?) */
665   ROM_REGION( 0x200000, "okimusic", 0 ) /* samples? (banked?) */
666666   ROM_LOAD( "mbn03",    0x00000, 0x200000, CRC(70b71a2a) SHA1(45851b0692de73016fc9b913316001af4690534c) )
667667ROM_END
668668
r3232r3233
705705   ROM_LOAD32_BYTE( "u5",    0x000001, 0x080000, CRC(1b6f01ea) SHA1(753fc670707432e317d035b09b0bad0762fea731) )
706706   ROM_LOAD32_BYTE( "u6",    0x000003, 0x080000, CRC(531a56f2) SHA1(89602bb873a3b110bffc216f921ba228e53380f9) )
707707
708   ROM_REGION( 0x80000, "OKIM6295_EFFECTS", 0 ) /* Oki samples */
708   ROM_REGION( 0x80000, "okisfx", 0 ) /* Oki samples */
709709   ROM_LOAD( "mcc-04",    0x00000, 0x40000,  CRC(86ee6ade) SHA1(56ad3f432c7f430f19fcba7c89940c63da165906) )
710710
711   ROM_REGION( 0x200000, "OKIM6295_MUSIC", 0 ) /* samples? (banked?) */
711   ROM_REGION( 0x200000, "okimusic", 0 ) /* samples? (banked?) */
712712   ROM_LOAD( "mcc-03",    0x00000, 0x100000, CRC(da2ebba0) SHA1(96d31dea4c7226ee1d386b286919fa334388c7a1) )
713713ROM_END
714714
r3232r3233
747747   ROM_LOAD16_BYTE( "mcc-01.a13",    0x000001, 0x100000, CRC(13d88745) SHA1(0ce4ec1481f31be860ee80322de6e32f9a566229) )
748748   ROM_LOAD16_BYTE( "mcc-02.a14",    0x000000, 0x100000, CRC(d0f97126) SHA1(3848a6f00d0e57aaf383298c4d111eb63a88b073) )
749749
750   ROM_REGION( 0x80000, "OKIM6295_EFFECTS", 0 ) /* Oki samples */
750   ROM_REGION( 0x80000, "okisfx", 0 ) /* Oki samples */
751751   ROM_LOAD( "mcc-04",    0x00000, 0x40000,  CRC(86ee6ade) SHA1(56ad3f432c7f430f19fcba7c89940c63da165906) )
752752
753   ROM_REGION( 0x200000, "OKIM6295_MUSIC", 0 ) /* samples? (banked?) */
753   ROM_REGION( 0x200000, "okimusic", 0 ) /* samples? (banked?) */
754754   ROM_LOAD( "mcc-03",    0x00000, 0x100000, CRC(da2ebba0) SHA1(96d31dea4c7226ee1d386b286919fa334388c7a1) )
755755
756756   ROM_REGION( 0x80, "user1", 0 ) /* eeprom */
r3232r3233
768768   ROM_LOAD16_BYTE( "mcc-01.a13",    0x000001, 0x100000, CRC(13d88745) SHA1(0ce4ec1481f31be860ee80322de6e32f9a566229) )
769769   ROM_LOAD16_BYTE( "mcc-02.a14",    0x000000, 0x100000, CRC(d0f97126) SHA1(3848a6f00d0e57aaf383298c4d111eb63a88b073) )
770770
771   ROM_REGION( 0x80000, "OKIM6295_EFFECTS", 0 ) /* Oki samples */
771   ROM_REGION( 0x80000, "okisfx", 0 ) /* Oki samples */
772772   ROM_LOAD( "mcc-04",    0x00000, 0x40000,  CRC(86ee6ade) SHA1(56ad3f432c7f430f19fcba7c89940c63da165906) )
773773
774   ROM_REGION( 0x200000, "OKIM6295_MUSIC", 0 ) /* samples? (banked?) */
774   ROM_REGION( 0x200000, "okimusic", 0 ) /* samples? (banked?) */
775775   ROM_LOAD( "mcc-03",    0x00000, 0x100000, CRC(da2ebba0) SHA1(96d31dea4c7226ee1d386b286919fa334388c7a1) )
776776
777777   ROM_REGION( 0x80, "user1", 0 ) /* eeprom */
r3232r3233
834834   ROM_LOAD16_BYTE( "mbr-01.14a",    0x000001, 0x100000, CRC(46c90215) SHA1(152acdeea34ec1db3f761066a0c1ff6e43e47f9d) )
835835   ROM_LOAD16_BYTE( "mbr-03.14h",    0x000000, 0x100000, CRC(c448a68a) SHA1(4b607dfee269abdfeb710b74b73ef87dc2b30e8c) )
836836
837   ROM_REGION( 0x80000, "OKIM6295_EFFECTS", 0 ) /* Oki samples */
837   ROM_REGION( 0x80000, "okisfx", 0 ) /* Oki samples */
838838   ROM_LOAD( "nd01-0.13h",    0x00000, 0x40000,  CRC(635a100a) SHA1(f6ec70890892e7557097ccd519de37247bb8c98d) )
839839
840   ROM_REGION( 0x200000, "OKIM6295_MUSIC", 0 ) /* samples? (banked?) */
840   ROM_REGION( 0x200000, "okimusic", 0 ) /* samples? (banked?) */
841841   ROM_LOAD( "mbr-02.12f",    0x00000, 0x100000, CRC(4f67d333) SHA1(608f921bfa6b7020c0ce72e5229b3f1489208b23) ) // 00, 01, 04, 05
842842ROM_END
843843
r3232r3233
917917   ROM_LOAD16_BYTE( "mcb-01.13a",    0x400001, 0x200000, CRC(06f40a57) SHA1(896f1d373e911dcff7223bf21756ad35b28b4c5d) )
918918   ROM_LOAD16_BYTE( "mcb-03.14d",    0x400000, 0x200000, CRC(0aef73af) SHA1(76cf13f53da5202da80820f98660edee1eef7f1a) )
919919
920   ROM_REGION( 0x80000, "OKIM6295_EFFECTS", 0 ) /* Oki samples */
920   ROM_REGION( 0x80000, "okisfx", 0 ) /* Oki samples */
921921   ROM_LOAD( "pz_01-0.13h",    0x00000, 0x40000,  CRC(8925bce2) SHA1(0ff2d5db7a24a2af30bd753eba274572c32cc2e7) )
922922
923   ROM_REGION( 0x200000, "OKIM6295_MUSIC", 0 ) /* samples? (banked?) */
923   ROM_REGION( 0x200000, "okimusic", 0 ) /* samples? (banked?) */
924924   ROM_LOAD( "mcb-04.12f",    0x00000, 0x200000, CRC(e23d3590) SHA1(dc8418edc525f56e84f26e9334d5576000b14e5f) )
925925ROM_END
926926
r3232r3233
940940   ROM_LOAD16_BYTE( "mcb-01.13a",    0x400001, 0x200000, CRC(06f40a57) SHA1(896f1d373e911dcff7223bf21756ad35b28b4c5d) )
941941   ROM_LOAD16_BYTE( "mcb-03.14d",    0x400000, 0x200000, CRC(0aef73af) SHA1(76cf13f53da5202da80820f98660edee1eef7f1a) )
942942
943   ROM_REGION( 0x80000, "OKIM6295_EFFECTS", 0 ) /* Oki samples */
943   ROM_REGION( 0x80000, "okisfx", 0 ) /* Oki samples */
944944   ROM_LOAD( "rd_01-0.13h",    0x00000, 0x40000,  CRC(70fd18c6) SHA1(368cd8e10c5f5a13eb3813974a7e6b46a4fa6b6c) )
945945
946   ROM_REGION( 0x200000, "OKIM6295_MUSIC", 0 ) /* samples? (banked?) */
946   ROM_REGION( 0x200000, "okimusic", 0 ) /* samples? (banked?) */
947947   ROM_LOAD( "mcb-04.12f",    0x00000, 0x200000, CRC(e23d3590) SHA1(dc8418edc525f56e84f26e9334d5576000b14e5f) )
948948ROM_END
949949
r3232r3233
10021002   ROM_LOAD16_BYTE( "mcf-01.13a",    0x400001, 0x200000, CRC(83881e25) SHA1(ae82cf0f704e6efea94c6c1d276d4e3e5b3ebe43) )
10031003   ROM_LOAD16_BYTE( "mcf-03.14d",    0x400000, 0x200000, CRC(faf1d51d) SHA1(675dbbfe15b8010d54b2b3af26d42cdd753c2ce2) )
10041004
1005   ROM_REGION( 0x80000, "OKIM6295_EFFECTS", 0 ) /* Oki samples */
1005   ROM_REGION( 0x80000, "okisfx", 0 ) /* Oki samples */
10061006   ROM_LOAD( "sa01-0.13h",    0x00000, 0x40000,  CRC(cea8368e) SHA1(1fcc641381fdc29bd50d3a4b23e67647f79e505a))
10071007
1008   ROM_REGION( 0x200000, "OKIM6295_MUSIC", 0 ) /* samples? (banked?) */
1008   ROM_REGION( 0x200000, "okimusic", 0 ) /* samples? (banked?) */
10091009   ROM_LOAD( "mcf-05.12f",    0x00000, 0x200000, CRC(f007d376) SHA1(4ba20e5dabeacc3278b7f30c4462864cbe8f6984) )
10101010ROM_END
10111011
r3232r3233
10271027   ROM_LOAD16_BYTE( "mcf-01.13a",    0x400001, 0x200000, CRC(83881e25) SHA1(ae82cf0f704e6efea94c6c1d276d4e3e5b3ebe43) )
10281028   ROM_LOAD16_BYTE( "mcf-03.14d",    0x400000, 0x200000, CRC(faf1d51d) SHA1(675dbbfe15b8010d54b2b3af26d42cdd753c2ce2) )
10291029
1030   ROM_REGION( 0x80000, "OKIM6295_EFFECTS", 0 ) /* Oki samples */
1030   ROM_REGION( 0x80000, "okisfx", 0 ) /* Oki samples */
10311031   ROM_LOAD( "sa01-0.13h",    0x00000, 0x40000,  CRC(cea8368e) SHA1(1fcc641381fdc29bd50d3a4b23e67647f79e505a))
10321032
1033   ROM_REGION( 0x200000, "OKIM6295_MUSIC", 0 ) /* samples? (banked?) */
1033   ROM_REGION( 0x200000, "okimusic", 0 ) /* samples? (banked?) */
10341034   ROM_LOAD( "mcf-05.12f",    0x00000, 0x200000, CRC(f007d376) SHA1(4ba20e5dabeacc3278b7f30c4462864cbe8f6984) )
10351035ROM_END
10361036
src/mame/drivers/lgp.c
r3232r3233
326326   // IRQ
327327   cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
328328   timer_set(ATTOTIME_IN_USEC(50), NULL, 0, irq_stop);
329
330   laserdisc_vsync(laserdisc);
331329}
332330
333331
r3232r3233
352350
353351   MDRV_MACHINE_START(lgp)
354352
355   MDRV_LASERDISC_ADD("laserdisc", PIONEER_LDV1000)
353   MDRV_LASERDISC_ADD("laserdisc", PIONEER_LDV1000, "main", "ldsound")
356354   MDRV_LASERDISC_OVERLAY(lgp, 256, 256, BITMAP_FORMAT_INDEXED16)
357355
358356   /* video hardware */
r3232r3233
366364   /* sound hardware */
367365   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
368366
369   MDRV_SOUND_ADD("laserdisc", CUSTOM, 0)
367   MDRV_SOUND_ADD("ldsound", CUSTOM, 0)
370368   MDRV_SOUND_CONFIG(laserdisc_custom_interface)
371369   MDRV_SOUND_ROUTE(0, "left", 1.0)
372370   MDRV_SOUND_ROUTE(1, "right", 1.0)
src/mame/drivers/cliffhgr.c
r3232r3233
107107
108108static READ8_HANDLER( cliff_port_r )
109109{
110   static const char *banknames[] = { "BANK0", "BANK1", "BANK2", "BANK3", "BANK4", "BANK5", "BANK6" };
110   static const char *const banknames[] = { "BANK0", "BANK1", "BANK2", "BANK3", "BANK4", "BANK5", "BANK6" };
111111
112112   if ( port_bank < 7 )
113113   {
r3232r3233
172172
173173static INTERRUPT_GEN( cliff_vsync )
174174{
175   /* clock the laserdisc and video chip every 60Hz */
176   laserdisc_vsync(laserdisc);
175   /* clock the video chip every 60Hz */
177176   TMS9928A_interrupt(machine);
178177}
179178
r3232r3233
691690
692691   MDRV_NVRAM_HANDLER(generic_0fill)
693692
694   MDRV_LASERDISC_ADD("laserdisc", PIONEER_PR8210)
693   MDRV_LASERDISC_ADD("laserdisc", PIONEER_PR8210, "main", "ldsound")
695694   MDRV_LASERDISC_OVERLAY(tms9928a, 15+32*8+15, 27+24*8+24, BITMAP_FORMAT_INDEXED16)
696695   MDRV_LASERDISC_OVERLAY_CLIP(15-12, 15+32*8+12-1, 27-9, 27+24*8+9-1)
697696
r3232r3233
705704   /* sound hardware */
706705   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
707706
708   MDRV_SOUND_ADD("laserdisc", CUSTOM, 0)
707   MDRV_SOUND_ADD("ldsound", CUSTOM, 0)
709708   MDRV_SOUND_CONFIG(laserdisc_custom_interface)
710709   MDRV_SOUND_ROUTE(0, "left", 1.0)
711710   MDRV_SOUND_ROUTE(1, "right", 1.0)
src/mame/drivers/cntsteer.c
r3232r3233
922922
923923/***************************************************************************/
924924
925static void zerotrgt_rearrange_gfx(int romsize, int romarea)
925static void zerotrgt_rearrange_gfx(running_machine *machine, int romsize, int romarea)
926926{
927   UINT8 *src = memory_region(Machine, "gfx4");
928   UINT8 *dst = memory_region(Machine, "gfx3");
927   UINT8 *src = memory_region(machine, "gfx4");
928   UINT8 *dst = memory_region(machine, "gfx3");
929929   int rm;
930930   int cnt1;
931931
r3232r3233
952952   RAM[0xc2f1]=0x43;
953953   RAM[0xc2f2]=0x43;
954954
955   zerotrgt_rearrange_gfx(0x02000, 0x10000);
955   zerotrgt_rearrange_gfx(machine, 0x02000, 0x10000);
956956
957957}
958958#endif
r3232r3233
963963   for (i=0; i<ARRAY_LENGTH(newdata); i++)
964964      newdata[i] = -1;
965965
966   zerotrgt_rearrange_gfx(0x02000, 0x10000);
966   zerotrgt_rearrange_gfx(machine, 0x02000, 0x10000);
967967}
968968
969969
src/mame/drivers/arabian.c
r3232r3233
133133   /* alternate CPU's RAM space while the CPU is running. If the CPU is not     */
134134   /* running (i.e., the /SRES line is low), it needs to look like RAM to pass  */
135135   /* the self-tests */
136   static const char *comnames[] = { "COM0", "COM1", "COM2", "COM3", "COM4", "COM5" };
136   static const char *const comnames[] = { "COM0", "COM1", "COM2", "COM3", "COM4", "COM5" };
137137
138138   /* if the CPU reset line is being held down, just return RAM */
139139   if (custom_cpu_reset)
src/mame/drivers/ccastles.c
r3232r3233
290290
291291static READ8_HANDLER( leta_r )
292292{
293   static const char *letanames[] = { "LETA0", "LETA1", "LETA2", "LETA3" };
293   static const char *const letanames[] = { "LETA0", "LETA1", "LETA2", "LETA3" };
294294
295295   return input_port_read(machine, letanames[offset]);
296296}
src/mame/drivers/dragrace.c
r3232r3233
1717static TIMER_CALLBACK( dragrace_frame_callback )
1818{
1919   int i;
20   static const char *portnames[] = { "P1", "P2" };
20   static const char *const portnames[] = { "P1", "P2" };
2121
2222   for (i = 0; i < 2; i++)
2323   {
r3232r3233
118118static READ8_HANDLER( dragrace_input_r )
119119{
120120   int val = input_port_read(machine, "IN2");
121   static const char *portnames[] = { "IN0", "IN1" };
121   static const char *const portnames[] = { "IN0", "IN1" };
122122
123123   UINT8 maskA = 1 << (offset % 8);
124124   UINT8 maskB = 1 << (offset / 8);
r3232r3233
148148{
149149   int bitA[2];
150150   int bitB[2];
151   static const char *dialnames[] = { "DIAL1", "DIAL2" };
151   static const char *const dialnames[] = { "DIAL1", "DIAL2" };
152152
153153   int i;
154154
src/mame/drivers/mediagx.c
r3232r3233
503503static READ32_HANDLER( parallel_port_r )
504504{
505505   UINT32 r = 0;
506//  static const char *portnames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7", "IN8" }; // but parallel_pointer takes values 0 -> 23
506   //static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7", "IN8" }; // but parallel_pointer takes values 0 -> 23
507507
508508   if (ACCESSING_BITS_8_15)
509509   {
r3232r3233
535535
536536static WRITE32_HANDLER( parallel_port_w )
537537{
538   static const char *portnames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7", "IN8" };   // but parallel_pointer takes values 0 -> 23
538   static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7", "IN8" };   // but parallel_pointer takes values 0 -> 23
539539
540540   COMBINE_DATA( &parport );
541541
src/mame/drivers/orbit.c
r3232r3233
295295   MDRV_CPU_PROGRAM_MAP(orbit_map, 0)
296296   MDRV_CPU_VBLANK_INT("main", orbit_interrupt)
297297
298   MDRV_TIMER_ADD_SCANLINE("32V", nmi_32v, "main", 0, 32)
298   MDRV_TIMER_ADD_SCANLINE("32v", nmi_32v, "main", 0, 32)
299299
300300   MDRV_MACHINE_RESET(orbit)
301301
src/mame/drivers/system1.c
r3232r3233
18081808static MACHINE_DRIVER_START( system1 )
18091809
18101810   /* basic machine hardware */
1811   MDRV_CPU_ADD("main", Z80, 4000000)   /* My Hero has 2 OSCs 8 & 20 MHz (Cabbe Info) */
1811   MDRV_CPU_ADD("main", Z80, XTAL_4MHz)   /* My Hero has 2 OSCs 8 & 20 MHz (Cabbe Info) */
18121812   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
18131813   MDRV_CPU_IO_MAP(readport,writeport)
18141814   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
18151815
1816   MDRV_CPU_ADD("sound", Z80, 4000000)
1816   MDRV_CPU_ADD("sound", Z80, XTAL_4MHz)
18171817   MDRV_CPU_PROGRAM_MAP(sound_map,0)
18181818   MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4)       /* NMIs are caused by the main CPU */
18191819
r3232r3233
32433243    Choplifter (Bootleg)
32443244    Year: 1985
32453245    System 2
3246
3247
3248
3249    Small Daughterboard marked 600A
3250
3251      |--------------------------------------------------------|
3252      |                                                        |
3253    A |  74ls244  74ls244  74ls669  74ls669  74ls669  74ls669  |
3254      |                                                        |
3255    B |  74ls240  74ls240  74ls283  74ls283  74ls283  74ls283  |
3256      |                                                        |
3257    C |  74ls10   74ls86   74ls157  74ls157  74ls157  74ls157  |
3258      |                                                        |
3259    D |  74ls157  74ls157  74ls157  74ls139  74ls74            |
3260      |                                                        |
3261    E |  pal16r4  pal16l8  74ls161  74ls161  74ls109           |
3262      |                                                        |
3263    F |  74ls27   74ls08   74ls04   74ls74   74ls00            |
3264      |                                                 600A   |
3265      |--------------------------------------------------------|
3266           1        2        3        4        5        6
3267
3268
3269    Small Daughterboard marked 600B
3270
3271      |--------------------------------------|
3272      |                              600B    |
3273    A |  74ls74            74ls174  pal20r4  |
3274      |                                      |
3275    B |  pal16l8  pal16l8  74ls374  74ls374  |
3276      |                                      |
3277    C |  74ls283  pal16l8  pal16l8  74ls32   |
3278      |                                      |
3279    D |  74ls283  74ls283  74ls85   74ls283  |
3280      |                                      |
3281    E |  74ls04   74ls00   74ls00   74ls32   |
3282      |                                      |
3283      |--------------------------------------|
3284           1        2        3        4
32463285*/
32473286
32483287ROM_START( chplftbl )
r3232r3233
32713310   ROM_LOAD( "pr7117.8",      0x0200, 0x0100, CRC(4124307e) SHA1(cee28d891e6ce732c43a61acb5beeafd2200cf37) ) /* palette blue component */
32723311   ROM_LOAD( "pr5317.28",      0x0300, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
32733312
3274   ROM_REGION( 0x0800, "plds", ROMREGION_DISPOSE )
3313   ROM_REGION( 0x0003, "plds_main", ROMREGION_DISPOSE )
3314    ROM_LOAD( "pal16r4.bin",    0x00000, 0x0001, NO_DUMP ) /* PAL16R4 located at IC13. */
3315    ROM_LOAD( "pal16r4.bin",    0x00000, 0x0001, NO_DUMP ) /* PAL16R4 located at IC14. */
3316    ROM_LOAD( "pal16l8.bin",    0x00000, 0x0001, NO_DUMP ) /* PAL16L8 located at IC62. */
3317
3318   ROM_REGION( 0x0002, "plds_600a", ROMREGION_DISPOSE )
3319    ROM_LOAD( "pal16r4.bin",    0x00000, 0x0001, NO_DUMP ) /* PAL16R4 located at E1. */
3320    ROM_LOAD( "pal16l8.bin",    0x00000, 0x0001, NO_DUMP ) /* PAL16L8 located at E2. */
3321
3322   ROM_REGION( 0x0005, "plds_600b", ROMREGION_DISPOSE )
3323    ROM_LOAD( "pal20r4.bin",    0x00000, 0x0001, NO_DUMP ) /* PAL20R4 located at A4. */
3324    ROM_LOAD( "pal16l8.bin",    0x00000, 0x0001, NO_DUMP ) /* PAL16L8 located at B1. */
3325    ROM_LOAD( "pal16l8.bin",    0x00000, 0x0001, NO_DUMP ) /* PAL16L8 located at B2. */
3326    ROM_LOAD( "pal16l8.bin",    0x00000, 0x0001, NO_DUMP ) /* PAL16L8 located at C2. */
3327    ROM_LOAD( "pal16l8.bin",    0x00000, 0x0001, NO_DUMP ) /* PAL16L8 located at C3. */
3328
3329   ROM_REGION( 0x0410, "plds_unk", ROMREGION_DISPOSE )
3330    /* Do any of these dumps match what's on the physical boards? */
32753331   ROM_LOAD( "pal16r4a.ic9",         0x0000, 0x0104, CRC(dd223015) SHA1(8d70f91b118e8653dda1efee3eaea287ae63809f) )
3276   ROM_LOAD( "pal16r4a.ic10",        0x0200, 0x0104, CRC(2c9229b4) SHA1(9755013afcf89f99d7a399c7e223e027761cf89a) )
3277   ROM_LOAD( "pal16r4a-chopbl1.bin", 0x0400, 0x0104, CRC(e1628a8e) SHA1(6b6df079cfadec71b38a53f107475f0dda428b00) )
3278   ROM_LOAD( "pal16l8a-chopbl2.bin", 0x0600, 0x0104, CRC(afa7425d) SHA1(09d8607b69ecfc0b12c8610751d489500b63c7d6) )
3332   ROM_LOAD( "pal16r4a.ic10",        0x0104, 0x0104, CRC(2c9229b4) SHA1(9755013afcf89f99d7a399c7e223e027761cf89a) )
3333   ROM_LOAD( "pal16r4a-chopbl1.bin", 0x0208, 0x0104, CRC(e1628a8e) SHA1(6b6df079cfadec71b38a53f107475f0dda428b00) )
3334   ROM_LOAD( "pal16l8a-chopbl2.bin", 0x030c, 0x0104, CRC(afa7425d) SHA1(09d8607b69ecfc0b12c8610751d489500b63c7d6) )
32793335ROM_END
32803336
32813337ROM_START( 4dwarrio )
src/mame/drivers/cultures.c
r3232r3233
2020static int video_enable = 0;
2121static int irq_enable = 0;
2222static int bg1_bank = 0, bg2_bank = 0;
23static int old_bank;
2324
2425static TILE_GET_INFO( get_bg1_tile_info )
2526{
r3232r3233
110111
111112static WRITE8_HANDLER( misc_w )
112113{
113   static int old_bank = -1;
114114   int new_bank = data & 0xf;
115115
116116   if(old_bank != new_bank)
r3232r3233
351351      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
352352}
353353
354static MACHINE_RESET( cultures )
355{
356   old_bank = -1;
357}
354358
359
355360static MACHINE_DRIVER_START( cultures )
356361
357362   /* basic machine hardware */
r3232r3233
360365   MDRV_CPU_IO_MAP(cultures_io_map,0)
361366   MDRV_CPU_VBLANK_INT("main", cultures_interrupt)
362367
368   MDRV_MACHINE_RESET( cultures )
369
363370   /* video hardware */
364371   MDRV_SCREEN_ADD("main", RASTER)
365372   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/bfm_sc2.c
r3232r3233
647647static READ8_HANDLER( mux_input_r )
648648{
649649   int result = 0xFF,t1,t2;
650   static const char *port[] = { "STROBE0", "STROBE1", "STROBE2", "STROBE3", "STROBE4", "STROBE5", "STROBE6", "STROBE7", "STROBE8", "STROBE9", "STROBE10", "STROBE11" };
650   static const char *const port[] = { "STROBE0", "STROBE1", "STROBE2", "STROBE3", "STROBE4", "STROBE5", "STROBE6", "STROBE7", "STROBE8", "STROBE9", "STROBE10", "STROBE11" };
651651
652652   if (offset < 8)
653653   {
r3232r3233
22282228   MDRV_NVRAM_HANDLER(bfm_sc2)
22292229   MDRV_DEFAULT_LAYOUT(layout_bfm_sc2)
22302230
2231   MDRV_SCREEN_ADD("ADDER", RASTER)
2231   MDRV_SCREEN_ADD("adder", RASTER)
22322232   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
22332233   MDRV_SCREEN_SIZE( 400, 280)
22342234   MDRV_SCREEN_VISIBLE_AREA(  0, 400-1, 0, 280-1)
r3232r3233
22442244
22452245   MDRV_CPU_ADD("adder2", M6809, MASTER_CLOCK/4 )   // adder2 board 6809 CPU at 2 Mhz
22462246   MDRV_CPU_PROGRAM_MAP(adder2_memmap,0)            // setup adder2 board memorymap
2247   MDRV_CPU_VBLANK_INT("ADDER", adder2_vbl)         // board has a VBL IRQ
2247   MDRV_CPU_VBLANK_INT("adder", adder2_vbl)         // board has a VBL IRQ
22482248
22492249   MDRV_SPEAKER_STANDARD_MONO("mono")
22502250   MDRV_SOUND_ADD("upd", UPD7759, UPD7759_STANDARD_CLOCK)
src/mame/drivers/witch.c
r3232r3233
211211static int scrolly=0;
212212
213213static UINT8 reg_a002=0;
214static int bank=-1;
214static int bank;
215215
216216static TILE_GET_INFO( get_gfx0b_tile_info )
217217{
r3232r3233
853853   memory_set_bankptr(1,&ROM[0x10000+UNBANKED_SIZE]);
854854
855855   memory_install_read8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x7000, 0x700f, 0, 0, prot_read_700x);
856   bank = -1;
856857}
857858
858859GAME( 1992, witch,    0,     witch, witch, witch, ROT0, "Sega / Vic Tokai", "Witch", 0 )
src/mame/drivers/dynax.c
r3232r3233
610610
611611static READ8_HANDLER( yarunara_input_r )
612612{
613   static const char *keynames0[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
614   static const char *keynames1[] = { "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" };
613   static const char *const keynames0[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
614   static const char *const keynames1[] = { "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" };
615615
616616   switch (offset)
617617   {
r3232r3233
966966static READ8_HANDLER( mjelctrn_dsw_r )
967967{
968968   int dsw = (keyb & 0xc0) >> 6;
969   static const char *dswnames[] = { "DSW2", "DSW1", "DSW3", "DSW4" };
969   static const char *const dswnames[] = { "DSW2", "DSW1", "DSW3", "DSW4" };
970970
971971   return input_port_read(machine, dswnames[dsw]);
972972}
r3232r3233
10691069
10701070static READ8_HANDLER( htengoku_input_r )
10711071{
1072   static const char *keynames0[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
1073   static const char *keynames1[] = { "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" };
1072   static const char *const keynames0[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
1073   static const char *const keynames1[] = { "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" };
10741074
10751075   switch( htengoku_select )
10761076   {
r3232r3233
11991199
12001200static READ8_HANDLER( tenkai_ip_r )
12011201{
1202   static const char *keynames0[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
1203//  static const char *keynames1[] = { "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" };
1202   static const char *const keynames0[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
1203   //static const char *const keynames1[] = { "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" };
12041204
12051205   switch (offset)
12061206   {
r3232r3233
12801280   }
12811281}
12821282
1283static void tenkai_update_rombank(void)
1283static void tenkai_update_rombank(running_machine *machine)
12841284{
1285   romptr = memory_region(Machine, "main") + 0x10000 + 0x8000 * rombank;
1285   romptr = memory_region(machine, "main") + 0x10000 + 0x8000 * rombank;
12861286//  logerror("rombank = %02x\n",rombank);
12871287}
12881288
r3232r3233
12931293static WRITE8_HANDLER( tenkai_p3_w )
12941294{
12951295   rombank = ((data & 0x04) << 1) | (rombank & 0x07);
1296   tenkai_update_rombank();
1296   tenkai_update_rombank(machine);
12971297}
12981298static WRITE8_HANDLER( tenkai_p4_w )
12991299{
13001300   rombank = (rombank & 0x08) | ((data & 0x0e) >> 1);
1301   tenkai_update_rombank();
1301   tenkai_update_rombank(machine);
13021302}
13031303// Added by Whistler - START
13041304static READ8_HANDLER( tenkai_p5_r )
r3232r3233
13251325static WRITE8_HANDLER( tenkai_p8_w )
13261326{
13271327   rombank = ((data & 0x08) <<    1) | (rombank & 0x0f);
1328   tenkai_update_rombank();
1328   tenkai_update_rombank(machine);
13291329}
13301330static READ8_HANDLER( tenkai_p8_r )
13311331{
src/mame/drivers/zn.c
r3232r3233
271271   if( ( m_n_znsecsel & 0x80 ) == 0 )
272272   {
273273      psx_sio_install_handler( 0, sio_pad_handler );
274      psx_sio_input( Machine, 0, PSX_SIO_IN_DSR, 0 );
274      psx_sio_input( machine, 0, PSX_SIO_IN_DSR, 0 );
275275   }
276276   else if( ( m_n_znsecsel & 0x08 ) == 0 )
277277   {
278278      znsec_start( 1 );
279279      psx_sio_install_handler( 0, sio_znsec1_handler );
280      psx_sio_input( Machine, 0, PSX_SIO_IN_DSR, 0 );
280      psx_sio_input( machine, 0, PSX_SIO_IN_DSR, 0 );
281281   }
282282   else if( ( m_n_znsecsel & 0x04 ) == 0 )
283283   {
284284      znsec_start( 0 );
285285      psx_sio_install_handler( 0, sio_znsec0_handler );
286      psx_sio_input( Machine, 0, PSX_SIO_IN_DSR, 0 );
286      psx_sio_input( machine, 0, PSX_SIO_IN_DSR, 0 );
287287   }
288288   else
289289   {
r3232r3233
291291      m_b_lastclock = 1;
292292
293293      psx_sio_install_handler( 0, sio_dip_handler );
294      psx_sio_input( Machine, 0, PSX_SIO_IN_DSR, 0 );
294      psx_sio_input( machine, 0, PSX_SIO_IN_DSR, 0 );
295295
296296      timer_adjust_oneshot( dip_timer, ATTOTIME_IN_CYCLES( 100, 0 ), 1 );
297297   }
r3232r3233
301301
302302static TIMER_CALLBACK( dip_timer_fired )
303303{
304   psx_sio_input( Machine, 0, PSX_SIO_IN_DSR, param * PSX_SIO_IN_DSR );
304   psx_sio_input( machine, 0, PSX_SIO_IN_DSR, param * PSX_SIO_IN_DSR );
305305
306306   if( param )
307307   {
r3232r3233
450450
451451static MACHINE_DRIVER_START( zn1_1mb_vram )
452452   /* basic machine hardware */
453   MDRV_CPU_ADD( "MAIN", PSXCPU, XTAL_67_7376MHz )
453   MDRV_CPU_ADD( "main", PSXCPU, XTAL_67_7376MHz )
454454   MDRV_CPU_PROGRAM_MAP( zn_map, 0 )
455455   MDRV_CPU_VBLANK_INT("main", psx_vblank)
456456
r3232r3233
489489
490490static MACHINE_DRIVER_START( zn2 )
491491   /* basic machine hardware */
492   MDRV_CPU_ADD( "MAIN", PSXCPU, XTAL_100MHz )
492   MDRV_CPU_ADD( "main", PSXCPU, XTAL_100MHz )
493493   MDRV_CPU_PROGRAM_MAP( zn_map, 0 )
494494   MDRV_CPU_VBLANK_INT("main", psx_vblank)
495495
r3232r3233
23532353static MACHINE_DRIVER_START( coh1000a_ide )
23542354   MDRV_IMPORT_FROM( zn1_2mb_vram )
23552355
2356   MDRV_CPU_MODIFY( "MAIN" )
2356   MDRV_CPU_MODIFY( "main" )
23572357   MDRV_CPU_VBLANK_INT("main", jdredd_vblank)
23582358
23592359   MDRV_MACHINE_RESET( coh1000a )
src/mame/drivers/balsente.c
r3232r3233
563563   PORT_INCLUDE( sentetst )
564564
565565   PORT_MODIFY("SWH")
566   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Coinage ) )      PORT_DIPLOCATION("H1:1,2")
567   PORT_DIPSETTING(    0x03, DEF_STR( 2C_1C ) )
568   PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )
569   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
570   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
571
566572   PORT_DIPNAME( 0x1c, 0x00, "Bonus Coins" )      PORT_DIPLOCATION("H1:3,4,5")
567573   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
568574   PORT_DIPSETTING(    0x04, "2 Coins = 1 Bonus" )
src/mame/drivers/megadriv.c
r3232r3233
16981698INPUT_PORTS_END
16991699
17001700/* xxx_BUTTONs are used with player = 0, 1, 2, 3 so we need to return 0 for the missing 4th I/O port  */
1701static const char *padnames[] = { "PAD1", "PAD2", "IN0", "UNK" };
1701static const char *const padnames[] = { "PAD1", "PAD2", "IN0", "UNK" };
17021702
17031703#define MODE_BUTTON(player)    ((input_port_read_safe(Machine, padnames[player], 0) & 0x0800) >> 11)
17041704#define Z_BUTTON(player)    ((input_port_read_safe(Machine, padnames[player], 0) & 0x0400) >> 10)
r3232r3233
26172617   if (d & 0x000f) { *dst &= ~0x000f; *dst |= d & 0x000f; }
26182618}
26192619
2620static UINT32 pm_io(int reg, int write, UINT32 d)
2620static UINT32 pm_io(running_machine *machine, int reg, int write, UINT32 d)
26212621{
26222622   if (svp.emu_status & SSP_PMC_SET)
26232623   {
r3232r3233
26722672         int addr = svp.pmac_read[reg]&0xffff;
26732673         if      ((mode & 0xfff0) == 0x0800) // ROM, inc 1, verified to be correct
26742674         {
2675            UINT16 *ROM = (UINT16 *) memory_region(Machine, "main");
2675            UINT16 *ROM = (UINT16 *) memory_region(machine, "main");
26762676            svp.pmac_read[reg] += 1;
26772677            d = ROM[addr|((mode&0xf)<<16)];
26782678         }
r3232r3233
27012701
27022702static READ16_HANDLER( read_PM0 )
27032703{
2704   UINT32 d = pm_io(0, 0, 0);
2704   UINT32 d = pm_io(machine, 0, 0, 0);
27052705   if (d != (UINT32)-1) return d;
27062706   d = svp.XST2;
27072707   svp.XST2 &= ~2; // ?
r3232r3233
27102710
27112711static WRITE16_HANDLER( write_PM0 )
27122712{
2713   UINT32 r = pm_io(0, 1, data);
2713   UINT32 r = pm_io(machine, 0, 1, data);
27142714   if (r != (UINT32)-1) return;
27152715   svp.XST2 = data; // ?
27162716}
27172717
27182718static READ16_HANDLER( read_PM1 )
27192719{
2720   UINT32 r = pm_io(1, 0, 0);
2720   UINT32 r = pm_io(machine, 1, 0, 0);
27212721   if (r != (UINT32)-1) return r;
27222722   logerror("svp: PM1 acces in non PM mode?\n");
27232723   return 0;
r3232r3233
27252725
27262726static WRITE16_HANDLER( write_PM1 )
27272727{
2728   UINT32 r = pm_io(1, 1, data);
2728   UINT32 r = pm_io(machine, 1, 1, data);
27292729   if (r != (UINT32)-1) return;
27302730   logerror("svp: PM1 acces in non PM mode?\n");
27312731}
27322732
27332733static READ16_HANDLER( read_PM2 )
27342734{
2735   UINT32 r = pm_io(2, 0, 0);
2735   UINT32 r = pm_io(machine, 2, 0, 0);
27362736   if (r != (UINT32)-1) return r;
27372737   logerror("svp: PM2 acces in non PM mode?\n");
27382738   return 0;
r3232r3233
27402740
27412741static WRITE16_HANDLER( write_PM2 )
27422742{
2743   UINT32 r = pm_io(2, 1, data);
2743   UINT32 r = pm_io(machine, 2, 1, data);
27442744   if (r != (UINT32)-1) return;
27452745   logerror("svp: PM2 acces in non PM mode?\n");
27462746}
27472747
27482748static READ16_HANDLER( read_XST )
27492749{
2750   UINT32 d = pm_io(3, 0, 0);
2750   UINT32 d = pm_io(machine, 3, 0, 0);
27512751   if (d != (UINT32)-1) return d;
27522752
27532753   return svp.XST;
r3232r3233
27552755
27562756static WRITE16_HANDLER( write_XST )
27572757{
2758   UINT32 r = pm_io(3, 1, data);
2758   UINT32 r = pm_io(machine, 3, 1, data);
27592759   if (r != (UINT32)-1) return;
27602760
27612761   svp.XST2 |= 1;
r3232r3233
27642764
27652765static READ16_HANDLER( read_PM4 )
27662766{
2767   return pm_io(4, 0, 0);
2767   return pm_io(machine, 4, 0, 0);
27682768}
27692769
27702770static WRITE16_HANDLER( write_PM4 )
27712771{
2772   pm_io(4, 1, data);
2772   pm_io(machine, 4, 1, data);
27732773}
27742774
27752775static READ16_HANDLER( read_PMC )
src/mame/drivers/sspeedr.c
r3232r3233
155155   PORT_START("IN1")
156156   /* The gas pedal is adjusted physically so the encoder is at position 2 when the pedal is not pressed. */
157157   /* It also only uses half of the encoder. */
158   PORT_BIT( 0x1f, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(30) PORT_REMAP_TABLE(sspeedr_controller_table + 2) PORT_SENSITIVITY(25) PORT_KEYDELTA(20)
158   PORT_BIT( 0x1f, 0x00, IPT_POSITIONAL_V ) PORT_POSITIONS(30) PORT_REMAP_TABLE(sspeedr_controller_table + 2) PORT_SENSITIVITY(25) PORT_KEYDELTA(20)
159159
160160   PORT_START("DSW")
161161   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) )
src/mame/drivers/filetto.c
r3232r3233
8282static UINT8 video_regs[0x19];
8383static UINT8 *vga_mode;
8484static UINT8 hv_blank;
85
86static int bank;
87static int lastvalue;
88
8589/*Add here Video regs defines...*/
8690
8791
r3232r3233
328332    sets the selected rom that appears in $C0000-$CFFFF
329333
330334*/
331   static int bank = -1;
332   static int lastvalue = -1;
333335   int newbank = 0;
334336
335337   printf("bank %d set to %02X\n", offset,data);
r3232r3233
732734}
733735
734736
737static MACHINE_RESET( filetto )
738{
739   bank = -1;
740   lastvalue = -1;
741   hv_blank = 0;
742}
743
735744static MACHINE_DRIVER_START( filetto )
736745   MDRV_CPU_ADD("main", I8088, 8000000)
737746   MDRV_CPU_PROGRAM_MAP(filetto_map,0)
738747   MDRV_CPU_IO_MAP(filetto_io,0)
739748   MDRV_CPU_VBLANK_INT_HACK(filetto_irq,200)
740749
750   MDRV_MACHINE_RESET( filetto )
751
741752   MDRV_DEVICE_ADD( "pit8253", PIT8253 )
742753   MDRV_DEVICE_CONFIG( pc_pit8253_config )
743754
src/mame/drivers/terracre.c
r3232r3233
263263   AM_RANGE(0xc000, 0xcfff) AM_WRITE(SMH_RAM)
264264ADDRESS_MAP_END
265265
266
267static ADDRESS_MAP_START( sound_readport, ADDRESS_SPACE_IO, 8 )
266static ADDRESS_MAP_START( sound_3526_io_map, ADDRESS_SPACE_IO, 8 )
268267   ADDRESS_MAP_GLOBAL_MASK(0xff)
269   AM_RANGE(0x04, 0x04) AM_READ(soundlatch_clear_r)
270   AM_RANGE(0x06, 0x06) AM_READ(soundlatch_r)
271ADDRESS_MAP_END
272
273static ADDRESS_MAP_START( sound_writeport_3526, ADDRESS_SPACE_IO, 8 )
274   ADDRESS_MAP_GLOBAL_MASK(0xff)
275268   AM_RANGE(0x00, 0x00) AM_WRITE(ym3526_control_port_0_w)
276269   AM_RANGE(0x01, 0x01) AM_WRITE(ym3526_write_port_0_w)
277270   AM_RANGE(0x02, 0x02) AM_WRITE(dac_0_signed_data_w)
278271   AM_RANGE(0x03, 0x03) AM_WRITE(dac_1_signed_data_w)
272   AM_RANGE(0x04, 0x04) AM_READ(soundlatch_clear_r)
273   AM_RANGE(0x06, 0x06) AM_READ(soundlatch_r)
279274ADDRESS_MAP_END
280275
281static ADDRESS_MAP_START( sound_writeport_2203, ADDRESS_SPACE_IO, 8 )
276static ADDRESS_MAP_START( sound_2203_io_map, ADDRESS_SPACE_IO, 8 )
282277   ADDRESS_MAP_GLOBAL_MASK(0xff)
283278   AM_RANGE(0x00, 0x00) AM_WRITE(ym2203_control_port_0_w)
284279   AM_RANGE(0x01, 0x01) AM_WRITE(ym2203_write_port_0_w)
285280   AM_RANGE(0x02, 0x02) AM_WRITE(dac_0_signed_data_w)
286281   AM_RANGE(0x03, 0x03) AM_WRITE(dac_1_signed_data_w)
282   AM_RANGE(0x04, 0x04) AM_READ(soundlatch_clear_r)
283   AM_RANGE(0x06, 0x06) AM_READ(soundlatch_r)
287284ADDRESS_MAP_END
288285
289286static INPUT_PORTS_START( terracre )
r3232r3233
568565
569566   MDRV_CPU_ADD("audio", Z80, 4000000)   /* 4 MHz???? */
570567   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
571   MDRV_CPU_IO_MAP(sound_readport,sound_writeport_3526)
568   MDRV_CPU_IO_MAP(sound_3526_io_map,0)
572569   MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,128)   /* ??? */
573570
574571   MDRV_MACHINE_START(amazon)
r3232r3233
607604
608605   MDRV_CPU_ADD("audio", Z80, 4000000)   /* 4 MHz???? */
609606   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
610   MDRV_CPU_IO_MAP(sound_readport,sound_writeport_3526)
607   MDRV_CPU_IO_MAP(sound_3526_io_map,0)
611608   MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,128)   /* ??? */
612609
613610
r3232r3233
644641
645642   MDRV_CPU_ADD("audio", Z80, 4000000)   /* 4 MHz???? */
646643   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
647   MDRV_CPU_IO_MAP(sound_readport,sound_writeport_2203)
644   MDRV_CPU_IO_MAP(sound_2203_io_map,0)
648645   MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,128)   /* ??? */
649646
650647
r3232r3233
10341031GAME( 1987, horekid,  0,        amazon,  horekid,  horekid,  ROT270,  "Nichibutsu", "Kid no Hore Hore Daisakusen", GAME_SUPPORTS_SAVE )
10351032GAME( 1987, horekidb, horekid,  amazon,  horekid,  horekid,  ROT270,  "bootleg", "Kid no Hore Hore Daisakusen (bootleg)", GAME_SUPPORTS_SAVE )
10361033GAME( 1987, boobhack, horekid,  amazon,  horekid,  horekid,  ROT270,  "bootleg", "Booby Kids (Italian manufactured graphic hack / bootleg of Kid no Hore Hore Daisakusen (bootleg))", GAME_SUPPORTS_SAVE )
1034
src/mame/drivers/superdq.c
r3232r3233
111111
112112static INTERRUPT_GEN( superdq_vblank )
113113{
114   laserdisc_vsync(laserdisc);
115
116114   /* status is read when the STATUS line from the laserdisc
117115       toggles (600usec after the vblank). We could set up a
118116       timer to do that, but this works as well */
r3232r3233
305303   MDRV_MACHINE_START(superdq)
306304   MDRV_MACHINE_RESET(superdq)
307305
308   MDRV_LASERDISC_ADD("laserdisc", PIONEER_LDV1000)
306   MDRV_LASERDISC_ADD("laserdisc", PIONEER_LDV1000, "main", "ldsound")
309307   MDRV_LASERDISC_OVERLAY(superdq, 256, 256, BITMAP_FORMAT_INDEXED16)
310308
311309   /* video hardware */
r3232r3233
323321   MDRV_SOUND_ADD("sn", SN76496, MASTER_CLOCK/8)
324322   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.8)
325323
326   MDRV_SOUND_ADD("laserdisc", CUSTOM, 0)
324   MDRV_SOUND_ADD("ldsound", CUSTOM, 0)
327325   MDRV_SOUND_CONFIG(laserdisc_custom_interface)
328326   MDRV_SOUND_ROUTE(0, "left", 1.0)
329327   MDRV_SOUND_ROUTE(1, "right", 1.0)
src/mame/drivers/trackfld.c
r3232r3233
183183ADDRESS_MAP_END
184184
185185/* Reaktor reads / writes some I/O ports, no idea what they're connected to, if anything */
186static ADDRESS_MAP_START( reaktor_readport, ADDRESS_SPACE_IO, 8 )
186static ADDRESS_MAP_START( reaktor_io_map, ADDRESS_SPACE_IO, 8 )
187187   ADDRESS_MAP_GLOBAL_MASK(0xff)
188   AM_RANGE(0x01, 0x01) AM_READ(SMH_NOP)
189ADDRESS_MAP_END
190
191static ADDRESS_MAP_START( reaktor_writeport, ADDRESS_SPACE_IO, 8 )
192   ADDRESS_MAP_GLOBAL_MASK(0xff)
193188   AM_RANGE(0x00, 0x00) AM_WRITE(SMH_NOP)
194   AM_RANGE(0x01, 0x01) AM_WRITE(SMH_NOP)
189   AM_RANGE(0x01, 0x01) AM_READWRITE(SMH_NOP, SMH_NOP)
195190   AM_RANGE(0x02, 0x02) AM_WRITE(SMH_NOP)
196191   AM_RANGE(0x03, 0x03) AM_WRITE(SMH_NOP)
197192ADDRESS_MAP_END
r3232r3233
903898   MDRV_IMPORT_FROM(trackfld)
904899   MDRV_CPU_REPLACE("main",Z80,18432000/6)
905900   MDRV_CPU_PROGRAM_MAP(reaktor_readmem,reaktor_writemem)
906   MDRV_CPU_IO_MAP(reaktor_readport,reaktor_writeport)
901   MDRV_CPU_IO_MAP(reaktor_io_map,0)
907902   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
908903MACHINE_DRIVER_END
909904
r3232r3233
13071302GAME( 1985, wizzquiz, 0,        wizzquiz, wizzquiz, wizzquiz, ROT0,  "Konami", "Wizz Quiz (Konami version)", 0 )
13081303GAME( 1985, wizzquza, wizzquiz, wizzquiz, wizzquiz, wizzquiz, ROT0,  "Zilec - Zenitone", "Wizz Quiz (version 4)", 0 )
13091304GAME( 1987, reaktor,  0,        reaktor,  reaktor,  0,        ROT90, "Zilec", "Reaktor (Track & Field conversion)", 0 )
1305
src/mame/drivers/fastfred.c
r3232r3233
109109   return 0x00;
110110}
111111
112/*
113    Imago sprites DMA
114*/
112115
116static UINT8 imago_sprites[0x800*3];
117static UINT16 imago_sprites_address;
118static UINT8 imago_sprites_bank = 0;
119
120static WRITE8_HANDLER( imago_dma_irq_w )
121{
122   cpunum_set_input_line(machine, 0, 0, data & 1 ? ASSERT_LINE : CLEAR_LINE);
123}
124
125static WRITE8_HANDLER( imago_sprites_bank_w )
126{
127   imago_sprites_bank = (data & 2) >> 1;
128}
129
130static WRITE8_HANDLER( imago_sprites_dma_w )
131{
132   UINT8 *rom = (UINT8 *)memory_region(machine, "gfx2");
133   UINT8 sprites_data;
134
135   sprites_data = rom[imago_sprites_address + 0x2000*0 + imago_sprites_bank * 0x1000];
136   imago_sprites[offset + 0x800*0] = sprites_data;
137
138   sprites_data = rom[imago_sprites_address + 0x2000*1 + imago_sprites_bank * 0x1000];
139   imago_sprites[offset + 0x800*1] = sprites_data;
140
141   sprites_data = rom[imago_sprites_address + 0x2000*2 + imago_sprites_bank * 0x1000];
142   imago_sprites[offset + 0x800*2] = sprites_data;
143
144   decodechar(machine->gfx[1], offset/32, imago_sprites);
145}
146
147static READ8_HANDLER( imago_sprites_offset_r )
148{
149   imago_sprites_address = offset;
150   return 0xff; //not really used
151}
152
113153static ADDRESS_MAP_START( fastfred_map, ADDRESS_SPACE_PROGRAM, 8 )
114154   AM_RANGE(0x0000, 0xbfff) AM_ROM
115155   AM_RANGE(0xc000, 0xc7ff) AM_RAM
r3232r3233
163203
164204static ADDRESS_MAP_START( imago_map, ADDRESS_SPACE_PROGRAM, 8 )
165205   AM_RANGE(0x0000, 0x0fff) AM_ROM
206   AM_RANGE(0x1000, 0x1fff) AM_READ(imago_sprites_offset_r)
166207   AM_RANGE(0x2000, 0x6fff) AM_ROM
167   AM_RANGE(0xb000, 0xb3ff) AM_RAM
208   AM_RANGE(0xb000, 0xb3ff) AM_RAM // same fg videoram (which one of the 2 is really used?)
209   AM_RANGE(0xb800, 0xbfff) AM_RAM_WRITE(imago_sprites_dma_w)
168210   AM_RANGE(0xc000, 0xc7ff) AM_RAM
169211   AM_RANGE(0xc800, 0xcbff) AM_RAM_WRITE(imago_fg_videoram_w) AM_BASE(&imago_fg_videoram)
170212   AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(fastfred_videoram_w) AM_BASE(&fastfred_videoram)
r3232r3233
177219   AM_RANGE(0xf001, 0xf001) AM_WRITE(interrupt_enable_w)
178220   AM_RANGE(0xf002, 0xf002) AM_WRITE(fastfred_colorbank1_w)
179221   AM_RANGE(0xf003, 0xf003) AM_WRITE(fastfred_colorbank2_w)
180   AM_RANGE(0xf004, 0xf004) AM_WRITE(SMH_NOP) // initialized with 0 then when written always 1
222   AM_RANGE(0xf004, 0xf004) AM_WRITE(imago_dma_irq_w)
181223   AM_RANGE(0xf005, 0xf005) AM_WRITE(imago_charbank_w)
182   AM_RANGE(0xf006, 0xf006) AM_WRITE(fastfred_flip_screen_x_w) // always 0
183   AM_RANGE(0xf007, 0xf007) AM_WRITE(fastfred_flip_screen_y_w) // always 0
224   AM_RANGE(0xf006, 0xf006) AM_WRITE(fastfred_flip_screen_x_w)
225   AM_RANGE(0xf007, 0xf007) AM_WRITE(fastfred_flip_screen_y_w)
226   AM_RANGE(0xf400, 0xf400) AM_WRITENOP // writes 0 or 2
227   AM_RANGE(0xf401, 0xf401) AM_WRITE(imago_sprites_bank_w)
184228   AM_RANGE(0xf800, 0xf800) AM_READWRITE(SMH_NOP, soundlatch_w)
185229ADDRESS_MAP_END
186230
r3232r3233
422466
423467   PORT_MODIFY("BUTTONS")
424468   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
469   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 )
425470   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
426471   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
472
473   PORT_START("DSW")
474   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
475   PORT_DIPSETTING(    0x00, "2" )
476   PORT_DIPSETTING(    0x01, "3" )
477   PORT_DIPSETTING(    0x02, "4" )
478   PORT_DIPSETTING(    0x03, "5" )
479   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
480   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
481   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
482   PORT_DIPNAME( 0x38, 0x00, DEF_STR( Coinage ) )
483   PORT_DIPSETTING(    0x38, DEF_STR( 5C_1C ) )
484   PORT_DIPSETTING(    0x18, DEF_STR( 4C_1C ) )
485   PORT_DIPSETTING(    0x28, DEF_STR( 3C_1C ) )
486   PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
487   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
488   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
489   PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )
490   PORT_DIPSETTING(    0x30, DEF_STR( 1C_4C ) )
491   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
492   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
493   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
494   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
495   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
496   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
497INPUT_PORTS_END
498
499static INPUT_PORTS_START( imagoa )
500   PORT_INCLUDE( common )
501
502   PORT_MODIFY("BUTTONS")
503   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
504   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 )
505   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
506   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
427507   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
428508
429509   PORT_MODIFY("JOYS")
r3232r3233
482562   32*8
483563};
484564
565static const gfx_layout imago_spritelayout =
566{
567   16,16,
568   0x40,
569   3,
570   { 0x800*8*2, 0x800*8*1, 0x800*8*0 },
571   { 0, 1, 2, 3, 4, 5, 6, 7,
572     8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
573   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
574     16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
575   32*8
576};
577
485578static const gfx_layout imago_char_1bpp =
486579{
487580   8,8,
r3232r3233
504597GFXDECODE_END
505598
506599static GFXDECODE_START( imago )
507   GFXDECODE_ENTRY( "gfx1", 0, charlayout,           0, 32 )
508   GFXDECODE_ENTRY( "gfx2", 0, spritelayout,        0, 32 )
509   GFXDECODE_ENTRY( "gfx3", 0, charlayout,          0, 32 )
510   GFXDECODE_ENTRY( "gfx4", 0, imago_char_1bpp, 0x140,  1 )
600   GFXDECODE_ENTRY( "gfx1", 0,       charlayout,         0, 32 )
601   GFXDECODE_ENTRY( NULL,    0xb800, imago_spritelayout,  0, 32 )
602   GFXDECODE_ENTRY( "gfx3", 0,       charlayout,          0, 32 )
603   GFXDECODE_ENTRY( "gfx4", 0,       imago_char_1bpp, 0x140,  1 )
511604GFXDECODE_END
512605
513606#define CLOCK 18432000  /* The crystal is 18.432MHz */
r3232r3233
784877   ROM_LOAD( "imago11.82", 0x0000, 0x1000, CRC(3cce69b4) SHA1(e7d52e388e09e86abb597493f5807ee088cf7a40) )
785878   ROM_CONTINUE(           0x2000, 0x1000 )
786879   ROM_LOAD( "imago12.83", 0x3000, 0x2000, CRC(8dff98c0) SHA1(e7311d9ca4544f1263e894e6d93ca52c87fc83bf) )
880   ROM_LOAD( "13.bin",     0x5000, 0x2000, CRC(ae684602) SHA1(d187abbe62ee58a8190d9f428ded0feeb9484abd) )
881
882   ROM_REGION( 0x10000, "audio", 0 )
883   ROM_LOAD( "imago08.60", 0x0000, 0x1000, CRC(4f77c2c9) SHA1(1e046786fbad7fb8c7c462b7bd5d80152c6b8779) )
884
885   ROM_REGION( 0x3000, "gfx1", ROMREGION_DISPOSE )
886   ROM_LOAD( "1.bin",      0x0000, 0x1000, CRC(f80a0b69) SHA1(2b85179942586316eb61614d8697588aa9d26f9a) )
887   ROM_LOAD( "imago02.40", 0x1000, 0x1000, CRC(71354480) SHA1(f5f5e1cc336cae1778b7f6c744eb1bdc4226f138) )
888   ROM_LOAD( "3.bin",      0x2000, 0x1000, CRC(722fd625) SHA1(6f9a9f4f000cc0b251ca8d496a2ea4a708665dda) )
889
890   ROM_REGION( 0x6000, "gfx2", 0 )
891   ROM_LOAD( "imago04.51", 0x0000, 0x1000, CRC(ed987b3e) SHA1(2f88a0463b4323adb27467fb3d022144a4943793) )
892   ROM_LOAD( "imago05.52", 0x1000, 0x1000, CRC(77ee68ce) SHA1(a47af1bec81977d0f47463bd88e9f526fd2d6611) )
893   ROM_LOAD( "imago07.56", 0x2000, 0x1000, CRC(48b35190) SHA1(3a000264aad03f55fe67eed7c868acf87e804c0f) )
894   ROM_LOAD( "imago06.55", 0x3000, 0x1000, CRC(136990fc) SHA1(f3ecba92db25fbeb7df83c26667b7447c2d03b58) )
895   ROM_LOAD( "imago09.64", 0x4000, 0x1000, CRC(9efb806d) SHA1(504cc27cf071873714ec61835d9da676884fe1c8) )
896   ROM_LOAD( "imago10.65", 0x5000, 0x1000, CRC(801a18d3) SHA1(f798978a47124f50be25ab4e5c6a4974d9003634) )
897
898   ROM_REGION( 0x3000, "gfx3", ROMREGION_DISPOSE )
899   ROM_LOAD( "imago14.170", 0x0000, 0x1000, CRC(eded37f6) SHA1(c2ff5d4c1b001740ec4453467f879035db196a9b) )
900   ROM_FILL(                0x1000, 0x2000, 0 )
901
902   ROM_REGION( 0x1000, "gfx4", ROMREGION_DISPOSE )
903   ROM_LOAD( "imago15.191", 0x0000, 0x1000, CRC(85fcc195) SHA1(a76f24201c037d1e6f909fb0ea4ad59b1d6ddd57) )
904
905   ROM_REGION( 0x0300, "proms", 0 )
906   ROM_LOAD( "imago.96", 0x0000, 0x0100, CRC(5ba81edc) SHA1(b64ebbe054052583688cdf0f064794436c095e7e) )
907   ROM_LOAD( "imago.95", 0x0100, 0x0100, CRC(e2b7aa09) SHA1(f8edfccdd698793d9a9f423953a582b0f7b9b697) )
908   ROM_LOAD( "imago.97", 0x0200, 0x0100, CRC(e28a7f00) SHA1(05b4882c5ea5da332735866d858872bc5eeaca24) )
909ROM_END
910
911/* this set has patched out the code to enable the cocktail mode for 2nd player at $5b24 */
912ROM_START( imagoa )
913   ROM_REGION( 0x10000, "main", 0 )
914   ROM_LOAD( "imago11.82", 0x0000, 0x1000, CRC(3cce69b4) SHA1(e7d52e388e09e86abb597493f5807ee088cf7a40) )
915   ROM_CONTINUE(           0x2000, 0x1000 )
916   ROM_LOAD( "imago12.83", 0x3000, 0x2000, CRC(8dff98c0) SHA1(e7311d9ca4544f1263e894e6d93ca52c87fc83bf) )
787917   ROM_LOAD( "imago13.84", 0x5000, 0x2000, CRC(f0f14b4d) SHA1(92b82080575a9c95df926c404c19875ac66c2b00) )
788918
789919   ROM_REGION( 0x10000, "audio", 0 )
r3232r3233
794924   ROM_LOAD( "imago02.40", 0x1000, 0x1000, CRC(71354480) SHA1(f5f5e1cc336cae1778b7f6c744eb1bdc4226f138) )
795925   ROM_LOAD( "imago03.41", 0x2000, 0x1000, CRC(7aba3d98) SHA1(5d058f39bf1339d523fe015b67083d44ff6a81d4) )
796926
797   ROM_REGION( 0x6000, "gfx2", ROMREGION_DISPOSE )
927   ROM_REGION( 0x6000, "gfx2", 0 )
798928   ROM_LOAD( "imago04.51", 0x0000, 0x1000, CRC(ed987b3e) SHA1(2f88a0463b4323adb27467fb3d022144a4943793) )
799929   ROM_LOAD( "imago05.52", 0x1000, 0x1000, CRC(77ee68ce) SHA1(a47af1bec81977d0f47463bd88e9f526fd2d6611) )
800930   ROM_LOAD( "imago07.56", 0x2000, 0x1000, CRC(48b35190) SHA1(3a000264aad03f55fe67eed7c868acf87e804c0f) )
r3232r3233
815945   ROM_LOAD( "imago.97", 0x0200, 0x0100, CRC(e28a7f00) SHA1(05b4882c5ea5da332735866d858872bc5eeaca24) )
816946ROM_END
817947
948
818949static DRIVER_INIT( flyboy )
819950{
820951   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc085, 0xc099, 0, 0, flyboy_custom1_io_r);
r3232r3233
857988GAME( 1983, jumpcoat, jumpcoas, jumpcoas, jumpcoas, jumpcoas, ROT90, "Taito", "Jump Coaster (Taito)", 0 )
858989GAME( 1983, boggy84,  0,        jumpcoas, boggy84,  boggy84,  ROT90, "bootleg", "Boggy '84", 0 )
859990GAME( 1986, redrobin, 0,        fastfred, redrobin, flyboyb,  ROT90, "Elettronolo", "Red Robin", 0 )
860GAME( 1983, imago,     0,       imago,    imago,    imago,    ROT90, "Acom", "Imago", GAME_IMPERFECT_GRAPHICS )
991GAME( 1984, imago,     0,      imago,    imago,    imago,    ROT90, "Acom", "Imago (cocktail set)", 0 )
992GAME( 1983, imagoa,     imago,   imago,    imagoa,   imago,    ROT90, "Acom", "Imago (no cocktail set)", 0 )
src/mame/drivers/astrof.c
r3232r3233
840840
841841   /* basic machine hardware */
842842   MDRV_CPU_ADD("main", M6502, MAIN_CPU_CLOCK)
843   MDRV_TIMER_ADD_SCANLINE("VBLANK", irq_callback, "main", VBSTART, 0)
843   MDRV_TIMER_ADD_SCANLINE("vblank", irq_callback, "main", VBSTART, 0)
844844
845845   /* video hardware */
846846   MDRV_VIDEO_START(astrof)
src/mame/drivers/lwings.c
r3232r3233
370370   AM_RANGE(0x0000, 0xffff) AM_WRITE(SMH_NOP)
371371ADDRESS_MAP_END
372372
373static ADDRESS_MAP_START( avengers_adpcm_readport, ADDRESS_SPACE_IO, 8 )
373static ADDRESS_MAP_START( avengers_adpcm_io_map, ADDRESS_SPACE_IO, 8 )
374374   ADDRESS_MAP_GLOBAL_MASK(0xff)
375375   AM_RANGE(0x00, 0x00) AM_READ(avengers_adpcm_r)
376   AM_RANGE(0x01, 0x01) AM_WRITE(msm5205_w)
376377ADDRESS_MAP_END
377378
378static ADDRESS_MAP_START( adpcm_readport, ADDRESS_SPACE_IO, 8 )
379static ADDRESS_MAP_START( adpcm_io_map, ADDRESS_SPACE_IO, 8 )
379380   ADDRESS_MAP_GLOBAL_MASK(0xff)
380381   AM_RANGE(0x00, 0x00) AM_READ(soundlatch_r)
381ADDRESS_MAP_END
382
383static ADDRESS_MAP_START( adpcm_writeport, ADDRESS_SPACE_IO, 8 )
384   ADDRESS_MAP_GLOBAL_MASK(0xff)
385382   AM_RANGE(0x01, 0x01) AM_WRITE(msm5205_w)
386383ADDRESS_MAP_END
387384
r3232r3233
806803
807804   MDRV_CPU_ADD("adpcm", Z80, 4000000) // 3.579545 Mhz (?)
808805   MDRV_CPU_PROGRAM_MAP(adpcm_readmem,adpcm_writemem)
809   MDRV_CPU_IO_MAP(adpcm_readport,adpcm_writeport)
806   MDRV_CPU_IO_MAP(adpcm_io_map,0)
810807   MDRV_CPU_PERIODIC_INT(irq0_line_hold, 4000)
811808
812809   /* video hardware */
r3232r3233
829826   MDRV_CPU_VBLANK_INT("main", nmi_line_pulse) // RST 38h triggered by software
830827
831828   MDRV_CPU_MODIFY("adpcm")
832   MDRV_CPU_IO_MAP(avengers_adpcm_readport,adpcm_writeport)
829   MDRV_CPU_IO_MAP(avengers_adpcm_io_map,0)
833830
834831   /* video hardware */
835832   MDRV_VIDEO_START(avengers)
r3232r3233
13331330GAME( 1987, avengers, 0,        avengers, avengers, 0, ROT90, "Capcom", "Avengers (US set 1)", 0 )
13341331GAME( 1987, avenger2, avengers, avengers, avengers, 0, ROT90, "Capcom", "Avengers (US set 2)", 0 )
13351332GAME( 1987, buraiken, avengers, avengers, avengers, 0, ROT90, "Capcom", "Hissatsu Buraiken (Japan)", 0 )
1333
src/mame/drivers/punchout.c
r3232r3233
165165      cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
166166}
167167
168static int prot_mode_sel = -1; /* Mode selector */
168static int prot_mode_sel; /* Mode selector */
169169static int prot_mem[16];
170170
171171static READ8_HANDLER( spunchout_prot_r ) {
r3232r3233
669669   "audio"
670670};
671671
672static MACHINE_RESET( punchout )
673{
674   prot_mode_sel = -1;
675   memset(prot_mem, 0, sizeof(prot_mem));
676}
672677
678
673679static MACHINE_DRIVER_START( punchout )
674680
675681   /* basic machine hardware */
r3232r3233
682688   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
683689   MDRV_CPU_VBLANK_INT("top", nmi_line_pulse)
684690
691   MDRV_MACHINE_RESET(punchout)
685692   MDRV_NVRAM_HANDLER(generic_0fill)
686693
687694   /* video hardware */
src/mame/drivers/vegas.c
r3232r3233
14421442
14431443static WRITE32_HANDLER( analog_port_w )
14441444{
1445   static const char *portnames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5", "AN6", "AN7" };
1445   static const char *const portnames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5", "AN6", "AN7" };
14461446
14471447   if (data < 8 || data > 15)
14481448      logerror("%08X:Unexpected analog port select = %08X\n", activecpu_get_pc(), data);
src/mame/drivers/segaybd.c
r3232r3233
227227
228228static READ16_HANDLER( io_chip_r )
229229{
230   static const char *portnames[] = { "P1", "GENERAL", "PORTC", "PORTD", "PORTE", "DSW", "COINAGE", "PORTH" };
230   static const char *const portnames[] = { "P1", "GENERAL", "PORTC", "PORTD", "PORTE", "DSW", "COINAGE", "PORTH" };
231231   offset &= 0x1f/2;
232232
233233   switch (offset)
src/mame/drivers/segaorun.c
r3232r3233
15451545   ROM_LOAD( "epr-10646.69", 0x30000, 0x08000, CRC(473cc411) SHA1(04ca2d047eb59581cd5d76e0ac6eca8b19eef497) )
15461546   ROM_RELOAD(               0x38000, 0x08000 )
15471547
1548   ROM_REGION( 0x2000, "fd1089b_key", 0 ) /* decryption key */
1548   ROM_REGION( 0x2000, "fd1089b", 0 ) /* decryption key */
15491549   ROM_LOAD( "317-0034.key", 0x0000, 0x2000, CRC(263ca773) SHA1(8e80d69d61cf54fd02b0ca59dd397fa60c713f3d) )
15501550ROM_END
15511551
r3232r3233
16061606   ROM_LOAD( "epr-10646.69", 0x30000, 0x08000, CRC(473cc411) SHA1(04ca2d047eb59581cd5d76e0ac6eca8b19eef497) )
16071607   ROM_RELOAD(               0x38000, 0x08000 )
16081608
1609   ROM_REGION( 0x2000, "fd1089b_key", 0 ) /* decryption key */
1609   ROM_REGION( 0x2000, "fd1089b", 0 ) /* decryption key */
16101610   ROM_LOAD( "317-0034.key", 0x0000, 0x2000, CRC(263ca773) SHA1(8e80d69d61cf54fd02b0ca59dd397fa60c713f3d) )
16111611ROM_END
16121612
r3232r3233
16671667   ROM_LOAD( "epr-10646.69", 0x30000, 0x08000, CRC(473cc411) SHA1(04ca2d047eb59581cd5d76e0ac6eca8b19eef497) )
16681668   ROM_RELOAD(               0x38000, 0x08000 )
16691669
1670   ROM_REGION( 0x2000, "fd1089b_key", 0 ) /* decryption key */
1670   ROM_REGION( 0x2000, "fd1089b", 0 ) /* decryption key */
16711671   ROM_LOAD( "317-0034.key", 0x0000, 0x2000, CRC(263ca773) SHA1(8e80d69d61cf54fd02b0ca59dd397fa60c713f3d) )
16721672ROM_END
16731673
src/mame/drivers/videopkr.c
r3232r3233
232232
233233
234234#include "driver.h"
235#include "cpu/mcs48/mcs48.c"
235#include "cpu/mcs48/mcs48.h"
236236#include "sound/dac.h"
237237
238238#define DATA_NVRAM_SIZE     0x100
r3232r3233
377377         }
378378         break;
379379      }
380      case 0x5f:
380381      case 0xdf:
381382      {
382         n_offs = ((p1 & 0xc0) << 2 ) + offset;
383383         valor = data_ram[offset];
384384         break;
385385      }
386      case 0x5f:
387      {
388         n_offs = ((p1 & 0xc0) << 2 ) + offset;
389         valor = data_ram[offset];
390         break;
391      }
392386      case 0x7c:
393387      case 0x7d:
394388      case 0x7e:
r3232r3233
617611
618612      if (dc_40103 == 0)
619613      {
620         cpunum_set_input_line(machine, 1, 0, 1);
614         cpunum_set_input_line(machine, 1, 0, ASSERT_LINE);
621615      }
622616   }
623617}
src/mame/drivers/mazerbla.c
r3232r3233
435435
436436static READ8_HANDLER( zpu_inputs_r )
437437{
438   static const char *strobenames[] = { "ZPU", "DSW0", "DSW1", "DSW2", "DSW3", "BUTTONS", "STICK0_X", "STICK0_Y", "STICK1_X", "STICK1_Y" };
438   static const char *const strobenames[] = { "ZPU", "DSW0", "DSW1", "DSW2", "DSW3", "BUTTONS", "STICK0_X", "STICK0_Y", "STICK1_X", "STICK1_Y" };
439439   UINT8 ret = 0;
440440
441441   if (bcd_7445<10)
r3232r3233
470470   coin_counter_w(offset, (data&0x40)>>6 );
471471}
472472
473static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 )
473static ADDRESS_MAP_START( io_map, ADDRESS_SPACE_IO, 8 )
474474   ADDRESS_MAP_GLOBAL_MASK(0xff)
475   AM_RANGE(0x4c, 0x4f) AM_READ(ls670_1_r)
476   AM_RANGE(0x62, 0x62) AM_READ(zpu_inputs_r)
477ADDRESS_MAP_END
478
479static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 )
480   ADDRESS_MAP_GLOBAL_MASK(0xff)
481   AM_RANGE(0x4c, 0x4f) AM_WRITE(ls670_0_w)
475   AM_RANGE(0x4c, 0x4f) AM_READWRITE(ls670_1_r, ls670_0_w)
482476   AM_RANGE(0x60, 0x60) AM_WRITE(zpu_bcd_decoder_w)
477   AM_RANGE(0x62, 0x62) AM_READ(zpu_inputs_r)
483478   AM_RANGE(0x68, 0x68) AM_WRITE(zpu_coin_counter_w)
484479   AM_RANGE(0x6a, 0x6a) AM_WRITE(zpu_lamps_w)
485480   AM_RANGE(0x6e, 0x6f) AM_WRITE(zpu_led_w)
r3232r3233
512507}
513508
514509
515static ADDRESS_MAP_START( readport_cpu2, ADDRESS_SPACE_IO, 8 )
510static ADDRESS_MAP_START( cpu2_io_map, ADDRESS_SPACE_IO, 8 )
516511   ADDRESS_MAP_GLOBAL_MASK(0xff)
517   AM_RANGE(0x80, 0x83) AM_READ(ls670_0_r)
518ADDRESS_MAP_END
519
520static ADDRESS_MAP_START( writeport_cpu2, ADDRESS_SPACE_IO, 8 )
521   ADDRESS_MAP_GLOBAL_MASK(0xff)
522512   AM_RANGE(0x00, 0x00) AM_WRITE(vsb_ls273_audio_control_w)
523   AM_RANGE(0x80, 0x83) AM_WRITE(ls670_1_w)
513   AM_RANGE(0x80, 0x83) AM_READWRITE(ls670_0_r, ls670_1_w)
524514ADDRESS_MAP_END
525515
526516static ADDRESS_MAP_START( readmem_cpu2, ADDRESS_SPACE_PROGRAM, 8 )
r3232r3233
623613   return (port02_status);
624614}
625615
626static ADDRESS_MAP_START( readport_cpu3, ADDRESS_SPACE_IO, 8 )
627   ADDRESS_MAP_GLOBAL_MASK(0xff)
628   AM_RANGE(0x02, 0x02) AM_READ(cfb_port_02_r)   /* VCU status ? */
629ADDRESS_MAP_END
630616
631static ADDRESS_MAP_START( writeport_cpu3_mb, ADDRESS_SPACE_IO, 8 )
617static ADDRESS_MAP_START( cpu3_io_map, ADDRESS_SPACE_IO, 8 )
632618   ADDRESS_MAP_GLOBAL_MASK(0xff)
633619   AM_RANGE(0x01, 0x01) AM_WRITE(cfb_backgnd_color_w)
634   AM_RANGE(0x02, 0x02) AM_WRITE(cfb_led_w)
620   AM_RANGE(0x02, 0x02) AM_READWRITE(cfb_port_02_r, cfb_led_w)   /* Read = VCU status ? */
635621   AM_RANGE(0x03, 0x03) AM_WRITE(cfb_zpu_int_req_set_w)
636622   AM_RANGE(0x04, 0x04) AM_WRITE(cfb_rom_bank_sel_w)
637623   AM_RANGE(0x05, 0x05) AM_WRITE(cfb_vbank_w)   //visible/writable videopage select?
638624ADDRESS_MAP_END
639
640625/* Great Guns has a little different banking layout */
641static ADDRESS_MAP_START( writeport_cpu3_gg, ADDRESS_SPACE_IO, 8 )
626
627static ADDRESS_MAP_START( gg_cpu3_io_map, ADDRESS_SPACE_IO, 8 )
642628   ADDRESS_MAP_GLOBAL_MASK(0xff)
643629   AM_RANGE(0x00, 0x00) AM_WRITE(SMH_NOP)
644630   AM_RANGE(0x01, 0x01) AM_WRITE(cfb_backgnd_color_w)
645   AM_RANGE(0x02, 0x02) AM_WRITE(cfb_led_w)
631   AM_RANGE(0x02, 0x02) AM_READWRITE(cfb_port_02_r, cfb_led_w)   /* Read = VCU status ? */
646632   AM_RANGE(0x03, 0x03) AM_WRITE(cfb_zpu_int_req_set_w)
647633   AM_RANGE(0x04, 0x04) AM_WRITE(cfb_rom_bank_sel_w_gg)
648634   AM_RANGE(0x05, 0x05) AM_WRITE(cfb_vbank_w)   //visible/writable videopage select?
649635ADDRESS_MAP_END
650636
651637
652
653638static UINT8 VCU_video_reg[4];
654639static WRITE8_HANDLER( VCU_video_reg_w )
655640{
r3232r3233
10891074}
10901075
10911076
1092static ADDRESS_MAP_START( gg_readport, ADDRESS_SPACE_IO, 8 )
1077static ADDRESS_MAP_START( gg_io_map, ADDRESS_SPACE_IO, 8 )
10931078   ADDRESS_MAP_GLOBAL_MASK(0xff)
1094   AM_RANGE(0x62, 0x62) AM_READ(zpu_inputs_r)
1095ADDRESS_MAP_END
1096static ADDRESS_MAP_START( gg_writeport, ADDRESS_SPACE_IO, 8 )
1097   ADDRESS_MAP_GLOBAL_MASK(0xff)
10981079   AM_RANGE(0x4c, 0x4c) AM_WRITE(main_sound_w)
10991080   AM_RANGE(0x60, 0x60) AM_WRITE(zpu_bcd_decoder_w)
1081   AM_RANGE(0x62, 0x62) AM_READ(zpu_inputs_r)
11001082   AM_RANGE(0x66, 0x66) AM_WRITE(SMH_NOP)
11011083   AM_RANGE(0x68, 0x68) AM_WRITE(SMH_NOP)
1102
11031084   AM_RANGE(0x6e, 0x6f) AM_WRITE(zpu_led_w)
11041085ADDRESS_MAP_END
11051086
11061087
1107
1108
11091088/* frequency is 14.318 MHz/16/16/16/16 */
11101089static INTERRUPT_GEN( sound_interrupt )
11111090{
r3232r3233
14951474   /* basic machine hardware */
14961475   MDRV_CPU_ADD("main", Z80, 4000000)   /* 4 MHz, no NMI, IM2 - vectors at 0xf8, 0xfa, 0xfc */
14971476   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
1498   MDRV_CPU_IO_MAP(readport,writeport)
1477   MDRV_CPU_IO_MAP(io_map,0)
14991478
15001479   MDRV_CPU_ADD("sub", Z80, 4000000)   /* 4 MHz, NMI, IM1 INT */
15011480   MDRV_CPU_PROGRAM_MAP(readmem_cpu2,writemem_cpu2)
1502   MDRV_CPU_IO_MAP(readport_cpu2,writeport_cpu2)
1481   MDRV_CPU_IO_MAP(cpu2_io_map,0)
15031482//MDRV_CPU_PERIODIC_INT(irq0_line_hold, 400 ) /* frequency in Hz */
15041483
15051484   MDRV_CPU_ADD("sub2", Z80, 4000000)   /* 4 MHz, no  NMI, IM1 INT */
15061485   MDRV_CPU_PROGRAM_MAP(readmem_cpu3,writemem_cpu3)
1507   MDRV_CPU_IO_MAP(readport_cpu3,writeport_cpu3_mb)
1486   MDRV_CPU_IO_MAP(cpu3_io_map,0)
15081487/* (vblank related ??) int generated by a custom video processor
15091488and cleared on ANY port access.
15101489but handled differently for now
r3232r3233
15381517   /* basic machine hardware */
15391518   MDRV_CPU_ADD("main", Z80, 4000000)   /* 4 MHz, no NMI, IM2 - vectors at 0xf8, 0xfa, 0xfc */
15401519   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
1541   MDRV_CPU_IO_MAP(gg_readport,gg_writeport)
1520   MDRV_CPU_IO_MAP(gg_io_map,0)
15421521
15431522   MDRV_CPU_ADD("sub", Z80, 14318000 / 4)   /* 3.579500 MHz, NMI - caused by sound command write, periodic INT */
15441523   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
r3232r3233
15461525
15471526   MDRV_CPU_ADD("sub2", Z80, 4000000)   /* 4 MHz, no  NMI, IM1 INT */
15481527   MDRV_CPU_PROGRAM_MAP(readmem_cpu3,writemem_cpu3)
1549   MDRV_CPU_IO_MAP(readport_cpu3,writeport_cpu3_gg)
1528   MDRV_CPU_IO_MAP(gg_cpu3_io_map,0)
15501529/* (vblank related ??) int generated by a custom video processor
15511530and cleared on ANY port access.
15521531but handled differently for now
r3232r3233
16821661GAME( 1983, mazerbla, 0,        mazerbla,  mazerbla, 0, ROT0, "Stern", "Mazer Blazer (set 1)", GAME_IMPERFECT_GRAPHICS |GAME_NO_SOUND | GAME_NOT_WORKING )
16831662GAME( 1983, mzrblzra, mazerbla, mazerbla,  mazerbla, 0, ROT0, "Stern", "Mazer Blazer (set 2)", GAME_IMPERFECT_GRAPHICS |GAME_NO_SOUND | GAME_NOT_WORKING )
16841663GAME( 1983, greatgun, 0,        greatgun,  greatgun, 0, ROT0, "Stern", "Great Guns", GAME_IMPERFECT_GRAPHICS )
1664
1665
src/mame/drivers/foodf.c
r3232r3233
194194
195195static READ16_HANDLER( analog_r )
196196{
197   static const char *portnames[] = { "STICK0_X", "STICK1_X", "STICK0_Y", "STICK1_Y" };
197   static const char *const portnames[] = { "STICK0_X", "STICK1_X", "STICK0_Y", "STICK1_Y" };
198198
199199   return input_port_read(machine, portnames[whichport]);
200200}
src/mame/drivers/namcona1.c
r3232r3233
506506   int i;
507507   UINT16 data;
508508   UINT8 poll_coins;
509   static const char *portnames[] = { "P1", "P2", "P3", "P4" };
509   static const char *const portnames[] = { "P1", "P2", "P3", "P4" };
510510
511511   namcona1_workram[0xf60/2] = 0x0000; /* mcu ready */
512512
src/mame/drivers/ddenlovr.c
r3232r3233
360360    06 blit_pen_mode (replace values stored in ROM)
361361*/
362362
363static int blit_draw(int src,int sx)
363static int blit_draw(running_machine *machine, int src,int sx)
364364{
365   UINT8 *src_data = memory_region(Machine, "gfx1");
366   int src_len = memory_region_length(Machine, "gfx1");
365   UINT8 *src_data = memory_region(machine, "gfx1");
366   int src_len = memory_region_length(machine, "gfx1");
367367   int bit_addr = (src & 0xffffff) * ddenlovr_blit_rom_bits;   /* convert to bit address */
368368   int pen_size, arg_size, cmd;
369369   int x;
r3232r3233
712712            case 0x14:   blit_fill_xy(ddenlovr_blit_x, ddenlovr_blit_y);
713713                     break;
714714
715            case 0x10:   ddenlovr_blit_address = blit_draw(ddenlovr_blit_address,ddenlovr_blit_x);
715            case 0x10:   ddenlovr_blit_address = blit_draw(machine,ddenlovr_blit_address,ddenlovr_blit_x);
716716                     break;
717717
718718            case 0x13:   blit_horiz_line();
r3232r3233
879879//              case 0x14:  blit_fill_xy(ddenlovr_blit_x, ddenlovr_blit_y);
880880//                          break;
881881
882            case 0x00/*0x10*/:   ddenlovr_blit_address = blit_draw(ddenlovr_blit_address,ddenlovr_blit_x);
882            case 0x00/*0x10*/:   ddenlovr_blit_address = blit_draw(machine,ddenlovr_blit_address,ddenlovr_blit_x);
883883                     break;
884884
885885            case 0x0b:   // same as 03? see the drawing of the R in "cRoss hatch" (key test)
r3232r3233
10791079            case 0x14:   blit_fill_xy(ddenlovr_blit_x, ddenlovr_blit_y);
10801080                     break;
10811081
1082            case 0x10:   ddenlovr_blit_address = blit_draw(ddenlovr_blit_address,ddenlovr_blit_x);
1082            case 0x10:   ddenlovr_blit_address = blit_draw(machine,ddenlovr_blit_address,ddenlovr_blit_x);
10831083                     break;
10841084
10851085            case 0x13:   blit_horiz_line();
r3232r3233
12321232   ddenlovr_blit_pen_mode = 0;
12331233   ddenlovr_blit_y = 5;
12341234   ddenlovr_clip_ctrl = 0x0f;
1235   next = blit_draw(base,0);
1235   next = blit_draw(screen->machine,base,0);
12361236   popmessage("GFX %06x",base);
12371237   if (input_code_pressed(KEYCODE_S)) base = next;
12381238   if (input_code_pressed_once(KEYCODE_X)) base = next;
r3232r3233
24952495
24962496static UINT8 mjchuuka_romdata[2];
24972497
2498static void mjchuuka_get_romdata(void)
2498static void mjchuuka_get_romdata(running_machine *machine)
24992499{
2500   UINT8 *rom   =   memory_region( Machine, "gfx1" );
2501   size_t size      =   memory_region_length( Machine, "gfx1" );
2500   UINT8 *rom   =   memory_region( machine, "gfx1" );
2501   size_t size      =   memory_region_length( machine, "gfx1" );
25022502   int address      =   (ddenlovr_blit_address & 0xffffff) * 2;
25032503
25042504   if (address >= size)
r3232r3233
25132513
25142514static READ8_HANDLER( mjchuuka_gfxrom_0_r )
25152515{
2516   mjchuuka_get_romdata();
2516   mjchuuka_get_romdata(machine);
25172517   ddenlovr_blit_address++;
25182518   return mjchuuka_romdata[0];
25192519}
r3232r3233
28302830
28312831static READ8_HANDLER( hginga_input_r )
28322832{
2833   static const char *keynames0[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
2834   static const char *keynames1[] = { "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" };
2833   static const char *const keynames0[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
2834   static const char *const keynames1[] = { "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" };
28352835
28362836   switch( hginga_select )
28372837   {
r3232r3233
30433043
30443044static READ8_HANDLER( hparadis_input_r )
30453045{
3046   static const char *keynames0[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
3047   static const char *keynames1[] = { "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" };
3046   static const char *const keynames0[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
3047   static const char *const keynames1[] = { "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" };
30483048
30493049   switch (hginga_select)
30503050   {
src/mame/drivers/mpu4.c
r3232r3233
949949/* IC8, Inputs, TRIACS, alpha clock */
950950static READ8_HANDLER( pia_ic8_porta_r )
951951{
952   static const char *portnames[] = { "ORANGE1", "ORANGE2", "BLACK1", "BLACK2", "ORANGE1", "ORANGE2", "DIL1", "DIL2" };
952   static const char *const portnames[] = { "ORANGE1", "ORANGE2", "BLACK1", "BLACK2", "ORANGE1", "ORANGE2", "DIL1", "DIL2" };
953953
954954   LOG_IC8(("%04x IC8 PIA Read of Port A (MUX input data)\n", activecpu_get_previouspc()));
955955/* The orange inputs are polled twice as often as the black ones, for reasons of efficiency.
r3232r3233
14211421   MDRV_CPU_ADD("main", M6809, MPU4_MASTER_CLOCK/4)
14221422   MDRV_CPU_PROGRAM_MAP(mod2_memmap,0)
14231423
1424   MDRV_TIMER_ADD_PERIODIC("50HZ",gen_50hz, HZ(100))
1424   MDRV_TIMER_ADD_PERIODIC("50hz",gen_50hz, HZ(100))
14251425
14261426   MDRV_SPEAKER_STANDARD_MONO("mono")
1427   MDRV_SOUND_ADD("AY8913",AY8913, MPU4_MASTER_CLOCK/4)
1427   MDRV_SOUND_ADD("ay8913",AY8913, MPU4_MASTER_CLOCK/4)
14281428   MDRV_SOUND_CONFIG(ay8910_config)
14291429   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
14301430
src/mame/drivers/limenko.c
r3232r3233
2424*/
2525
2626#include "driver.h"
27#include "machine/eeprom.h"
2728#include "sound/okim6295.h"
28#include "machine/eeprom.h"
2929
3030static tilemap *bg_tilemap, *md_tilemap, *fg_tilemap;
3131static UINT32 *bg_videoram, *md_videoram, *fg_videoram, *limenko_videoreg;
3232
3333static UINT32 *mainram;
34static int spriteram_bit;
3435
36static bitmap_t *sprites_bitmap;
37static bitmap_t *sprites_bitmap_pri;
38
39static int prev_sprites_count = 0;
40
41static void draw_sprites(running_machine *machine, UINT32 *sprites, const rectangle *cliprect, int count);
42
3543/*****************************************************************************************************
3644  MISC FUNCTIONS
3745*****************************************************************************************************/
r3232r3233
9199   soundlatch_w(machine, 0, (data >> 16) & 0xff);
92100}
93101
102static CUSTOM_INPUT( spriteram_bit_r )
103{
104   return spriteram_bit;
105}
106
107static WRITE32_HANDLER( spriteram_buffer_w )
108{
109   rectangle clip;
110   clip.min_x = 0;
111   clip.max_x = 383;
112   clip.min_y = 0;
113   clip.max_y = 239;
114
115   fillbitmap(sprites_bitmap_pri,0,&clip);
116   fillbitmap(sprites_bitmap,0,&clip);
117
118   // toggle spriterams location in the memory map
119   spriteram_bit ^= 1;
120
121   if(spriteram_bit)
122   {
123      // draw the sprites to the frame buffer
124      draw_sprites(machine,spriteram32_2,&clip,prev_sprites_count);
125   }
126   else
127   {
128      // draw the sprites to the frame buffer
129      draw_sprites(machine,spriteram32,&clip,prev_sprites_count);
130   }
131
132   // buffer the next number of sprites to draw
133   prev_sprites_count = (limenko_videoreg[0] & 0x1ff0000) >> 16;
134}
135
94136/*****************************************************************************************************
95137  MEMORY MAPS
96138*****************************************************************************************************/
r3232r3233
101143   AM_RANGE(0x80000000, 0x80007fff) AM_RAM_WRITE(fg_videoram_w) AM_BASE(&fg_videoram)
102144   AM_RANGE(0x80008000, 0x8000ffff) AM_RAM_WRITE(md_videoram_w) AM_BASE(&md_videoram)
103145   AM_RANGE(0x80010000, 0x80017fff) AM_RAM_WRITE(bg_videoram_w) AM_BASE(&bg_videoram)
104   AM_RANGE(0x80018000, 0x80018fff) AM_RAM AM_BASE(&spriteram32)
146   AM_RANGE(0x80018000, 0x80018fff) AM_RAM AM_BASE(&spriteram32) AM_SIZE(&spriteram_size)
105147   AM_RANGE(0x80019000, 0x80019fff) AM_RAM AM_BASE(&spriteram32_2)
106148   AM_RANGE(0x8001c000, 0x8001dfff) AM_RAM_WRITE(limenko_paletteram_w) AM_BASE(&paletteram32)
107149   AM_RANGE(0x8001e000, 0x8001ebff) AM_RAM // ? not used
108150   AM_RANGE(0x8001ffec, 0x8001ffff) AM_RAM AM_BASE(&limenko_videoreg)
109   AM_RANGE(0x8003e000, 0x8003e003) AM_WRITENOP // video reg? background pen?
151   AM_RANGE(0x8003e000, 0x8003e003) AM_WRITE(spriteram_buffer_w)
110152   AM_RANGE(0xffe00000, 0xffffffff) AM_ROM AM_REGION("user1",0)
111153ADDRESS_MAP_END
112154
r3232r3233
128170   AM_RANGE(0x80000000, 0x80007fff) AM_RAM_WRITE(fg_videoram_w) AM_BASE(&fg_videoram)
129171   AM_RANGE(0x80008000, 0x8000ffff) AM_RAM_WRITE(md_videoram_w) AM_BASE(&md_videoram)
130172   AM_RANGE(0x80010000, 0x80017fff) AM_RAM_WRITE(bg_videoram_w) AM_BASE(&bg_videoram)
131   AM_RANGE(0x80018000, 0x80018fff) AM_RAM AM_BASE(&spriteram32)
173   AM_RANGE(0x80018000, 0x80018fff) AM_RAM AM_BASE(&spriteram32) AM_SIZE(&spriteram_size)
132174   AM_RANGE(0x80019000, 0x80019fff) AM_RAM AM_BASE(&spriteram32_2)
133175   AM_RANGE(0x8001c000, 0x8001dfff) AM_RAM_WRITE(limenko_paletteram_w) AM_BASE(&paletteram32)
134176   AM_RANGE(0x8001e000, 0x8001ebff) AM_RAM // ? not used
135177   AM_RANGE(0x8001ffec, 0x8001ffff) AM_RAM AM_BASE(&limenko_videoreg)
136   AM_RANGE(0x8003e000, 0x8003e003) AM_WRITENOP // video reg? background pen?
178   AM_RANGE(0x8003e000, 0x8003e003) AM_WRITE(spriteram_buffer_w)
137179   AM_RANGE(0xfff00000, 0xffffffff) AM_ROM AM_REGION("user1",0)
138180ADDRESS_MAP_END
139181
r3232r3233
150192   AM_RANGE(0x0000, 0x0fff) AM_ROM
151193ADDRESS_MAP_END
152194
195static UINT8 spotty_sound_cmd=0;
196static WRITE8_HANDLER( spotty_sound_cmd_w )
197{
198   spotty_sound_cmd = data;
199}
200
201static READ8_HANDLER( spotty_sound_cmd_r )
202{
203   return 0; //??? some status bit? if set it executes a jump in the code
204}
205
206static READ8_HANDLER( spotty_sound_r )
207{
208   // check spotty_sound_cmd bits...
209
210   if(spotty_sound_cmd == 0xf7)
211      return soundlatch_r(machine,0);
212   else
213      return okim6295_status_0_r(machine,0);
214}
215
153216static ADDRESS_MAP_START( spotty_sound_io_map, ADDRESS_SPACE_IO, 8 )
154   AM_RANGE(0x0001, 0x0001) AM_READ(soundlatch_r)
155   AM_RANGE(0x0003, 0x0003) AM_READ(okim6295_status_0_r)
156   AM_RANGE(0x0001, 0x0001) AM_WRITE(okim6295_data_0_w)
157   AM_RANGE(0x0003, 0x0003) AM_WRITENOP
217   AM_RANGE(0x0001, 0x0001) AM_READWRITE(spotty_sound_r, okim6295_data_0_w) //? sound latch and ?
218   AM_RANGE(0x0003, 0x0003) AM_READWRITE(spotty_sound_cmd_r, spotty_sound_cmd_w) //not sure about anything...
158219ADDRESS_MAP_END
159220
160221/*****************************************************************************************************
r3232r3233
182243   SET_TILE_INFO(0,tile,color,0);
183244}
184245
246static void draw_single_sprite(bitmap_t *dest_bmp,const gfx_element *gfx,
247      UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
248      const rectangle *clip,int priority)
249{
250   int pal_base = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors);
251   UINT8 *source_base = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo;
252
253   int sprite_screen_height = ((1<<16)*gfx->height+0x8000)>>16;
254   int sprite_screen_width = ((1<<16)*gfx->width+0x8000)>>16;
255
256   if (sprite_screen_width && sprite_screen_height)
257   {
258      /* compute sprite increment per screen pixel */
259      int dx = (gfx->width<<16)/sprite_screen_width;
260      int dy = (gfx->height<<16)/sprite_screen_height;
261
262      int ex = sx+sprite_screen_width;
263      int ey = sy+sprite_screen_height;
264
265      int x_index_base;
266      int y_index;
267
268      if( flipx )
269      {
270         x_index_base = (sprite_screen_width-1)*dx;
271         dx = -dx;
272      }
273      else
274      {
275         x_index_base = 0;
276      }
277
278      if( flipy )
279      {
280         y_index = (sprite_screen_height-1)*dy;
281         dy = -dy;
282      }
283      else
284      {
285         y_index = 0;
286      }
287
288      if( clip )
289      {
290         if( sx < clip->min_x)
291         { /* clip left */
292            int pixels = clip->min_x-sx;
293            sx += pixels;
294            x_index_base += pixels*dx;
295         }
296         if( sy < clip->min_y )
297         { /* clip top */
298            int pixels = clip->min_y-sy;
299            sy += pixels;
300            y_index += pixels*dy;
301         }
302         /* NS 980211 - fixed incorrect clipping */
303         if( ex > clip->max_x+1 )
304         { /* clip right */
305            int pixels = ex-clip->max_x-1;
306            ex -= pixels;
307         }
308         if( ey > clip->max_y+1 )
309         { /* clip bottom */
310            int pixels = ey-clip->max_y-1;
311            ey -= pixels;
312         }
313      }
314
315      if( ex>sx )
316      { /* skip if inner loop doesn't draw anything */
317         int y;
318
319         for( y=sy; y<ey; y++ )
320         {
321            UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
322            UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
323            UINT8 *pri = BITMAP_ADDR8(sprites_bitmap_pri, y, 0);
324
325            int x, x_index = x_index_base;
326            for( x=sx; x<ex; x++ )
327            {
328               int c = source[x_index>>16];
329               if( c != 0 )
330               {
331                  if (pri[x]<priority)
332                     dest[x] = pal_base+c;
333
334                  pri[x] = priority;
335
336               }
337               x_index += dx;
338            }
339
340            y_index += dy;
341         }
342      }
343   }
344}
345
185346// sprites aren't tile based (except for 8x8 ones)
186static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
347static void draw_sprites(running_machine *machine, UINT32 *sprites, const rectangle *cliprect, int count)
187348{
188349   int i;
189   int sprites_on_screen = (limenko_videoreg[0] & 0x1ff0000) >> 16;
190350
191351   UINT8 *base_gfx   = memory_region(machine, "gfx1");
192352   UINT8 *gfx_max   = base_gfx + memory_region_length(machine, "gfx1");
r3232r3233
194354   UINT8 *gfxdata;
195355   gfx_element gfx;
196356
197   for(i = 0; i <= sprites_on_screen*2; i += 2)
357   for(i = 0; i <= count*2; i += 2)
198358   {
199359      int x, width, flipx, y, height, flipy, code, color, pri;
200360
201      if(~spriteram32[i] & 0x80000000) continue;
361      if(~sprites[i] & 0x80000000) continue;
202362
203      x = ((spriteram32[i] & 0x1ff0000) >> 16) - 1;
204      width = (((spriteram32[i] & 0xe000000) >> 25) + 1) * 8;
205      flipx = spriteram32[i] & 0x10000000;
206      y = (spriteram32[i] & 0x1ff) + 1;
207      height = (((spriteram32[i] & 0xe00) >> 9) + 1) * 8;
208      flipy = spriteram32[i] & 0x1000;
209      code = spriteram32[i + 1] & 0x7ffff;
210      color = (spriteram32[i + 1] & 0xf0000000) >> 28;
363      x = ((sprites[i] & 0x1ff0000) >> 16);
364      width = (((sprites[i] & 0xe000000) >> 25) + 1) * 8;
365      flipx = sprites[i] & 0x10000000;
366      y = sprites[i] & 0x1ff;
367      height = (((sprites[i] & 0xe00) >> 9) + 1) * 8;
368      flipy = sprites[i] & 0x1000;
369      code = sprites[i + 1] & 0x7ffff;
370      color = (sprites[i + 1] & 0xf0000000) >> 28;
211371
212      if(spriteram32[i + 1] & 0x04000000)
213         pri = 0xfffe; // below fg
372      if(sprites[i + 1] & 0x04000000)
373      {
374         // below fg
375         pri = 1;
376      }
214377      else
215         pri = 0; // above everything
378      {
379         // above everything
380         pri = 2;
381      }
216382
217      gfxdata   = base_gfx + (64*8/8) * code;
383      gfxdata   = base_gfx + 64 * code;
218384
219385      /* prepare GfxElement on the fly */
220386      gfx.width = width;
r3232r3233
234400      if ( (gfxdata + width * height - 1) >= gfx_max )
235401         continue;
236402
237      pdrawgfx(bitmap,&gfx,
238             0,
239             color,
240             flipx,flipy,
241             x,y,
242             cliprect,TRANSPARENCY_PEN,0,pri);
403      draw_single_sprite(sprites_bitmap,&gfx,0,color,flipx,flipy,x,y,cliprect,pri);
243404
405      // wrap around x
406      draw_single_sprite(sprites_bitmap,&gfx,0,color,flipx,flipy,x-512,y,cliprect,pri);
407
244408      // wrap around y
245      pdrawgfx(bitmap,&gfx,
246             0,
247             color,
248             flipx,flipy,
249             x,y - 512,
250             cliprect,TRANSPARENCY_PEN,0,pri);
409      draw_single_sprite(sprites_bitmap,&gfx,0,color,flipx,flipy,x,y-512,cliprect,pri);
251410
252      // wrap around x
253      pdrawgfx(bitmap,&gfx,
254             0,
255             color,
256             flipx,flipy,
257             x - 512,y,
258             cliprect,TRANSPARENCY_PEN,0,pri);
259
260411      // wrap around x and y
261      pdrawgfx(bitmap,&gfx,
262             0,
263             color,
264             flipx,flipy,
265             x - 512,y - 512,
266             cliprect,TRANSPARENCY_PEN,0,pri);
412      draw_single_sprite(sprites_bitmap,&gfx,0,color,flipx,flipy,x-512,y-512,cliprect,pri);
267413   }
268414}
269415
416static void copy_sprites(running_machine *machine, bitmap_t *bitmap, bitmap_t *sprites_bitmap, const rectangle *cliprect)
417{
418   int y;
419   for( y=cliprect->min_y; y<=cliprect->max_y; y++ )
420   {
421      UINT16 *source = BITMAP_ADDR16(sprites_bitmap, y, 0);
422      UINT16 *dest = BITMAP_ADDR16(bitmap, y, 0);
423      UINT8 *dest_pri = BITMAP_ADDR8(priority_bitmap, y, 0);
424      UINT8 *source_pri = BITMAP_ADDR8(sprites_bitmap_pri, y, 0);
425
426      int x;
427      for( x=cliprect->min_x; x<=cliprect->max_x; x++ )
428      {
429         if( source[x]!= 0 )
430         {
431            if(dest_pri[x] < source_pri[x])
432               dest[x] = source[x];
433         }
434      }
435   }
436}
437
270438static VIDEO_START( limenko )
271439{
272440   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,8,8,128,64);
r3232r3233
275443
276444   tilemap_set_transparent_pen(md_tilemap,0);
277445   tilemap_set_transparent_pen(fg_tilemap,0);
446
447   sprites_bitmap     = auto_bitmap_alloc(384,240,BITMAP_FORMAT_INDEXED16);
448   sprites_bitmap_pri = auto_bitmap_alloc(384,240,BITMAP_FORMAT_INDEXED8);
278449}
279450
280451static VIDEO_UPDATE( limenko )
281452{
453   // limenko_videoreg[4] ???? It always has this value: 0xffeffff8 (2 signed bytes? values: -17 and -8 ?)
454
282455   fillbitmap(priority_bitmap,0,cliprect);
283456
284457   tilemap_set_enable(bg_tilemap, limenko_videoreg[0] & 4);
r3232r3233
298471   tilemap_draw(bitmap,cliprect,fg_tilemap,0,1);
299472
300473   if(limenko_videoreg[0] & 8)
301      draw_sprites(screen->machine, bitmap, cliprect);
474      copy_sprites(screen->machine, bitmap, sprites_bitmap, cliprect);
302475
303476   return 0;
304477}
r3232r3233
363536   PORT_DIPNAME( 0x20000000, 0x00000000, "Sound Enable" )
364537   PORT_DIPSETTING(          0x20000000, DEF_STR( Off ) )
365538   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
366   PORT_BIT( 0x80000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) //changes spriteram location, pointing to spriteram32_2
539   PORT_BIT( 0x80000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(spriteram_bit_r, NULL) //changes spriteram location
367540   PORT_BIT( 0x4000ffff, IP_ACTIVE_LOW, IPT_UNUSED )
368541INPUT_PORTS_END
369542
r3232r3233
401574   PORT_DIPNAME( 0x20000000, 0x00000000, "Sound Enable" )
402575   PORT_DIPSETTING(          0x20000000, DEF_STR( Off ) )
403576   PORT_DIPSETTING(          0x00000000, DEF_STR( On ) )
404   PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_SPECIAL ) //changes spriteram location, pointing to spriteram32_2
577   PORT_BIT( 0x80000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(spriteram_bit_r, NULL) //changes spriteram location
405578   PORT_BIT( 0x5f10ffff, IP_ACTIVE_LOW, IPT_UNUSED )
406579INPUT_PORTS_END
407580
r3232r3233
432605   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_START1 )
433606   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_UNUSED )
434607   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_COIN1 )
435   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_UNUSED )
608   PORT_BIT( 0x00080000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(spriteram_bit_r, NULL) //changes spriteram location
436609   PORT_SERVICE_NO_TOGGLE( 0x00200000, IP_ACTIVE_LOW )
437   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_UNUSED )
610   PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_SPECIAL ) //security bit
438611   PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL) //eeprom
439612   PORT_DIPNAME( 0x20000000, 0x20000000, DEF_STR( Demo_Sounds ) )
440613   PORT_DIPSETTING(          0x00000000, DEF_STR( Off ) )
r3232r3233
8401013static DRIVER_INIT( dynabomb )
8411014{
8421015   memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe2784, 0xe2787, 0, 0, dynabomb_speedup_r );
1016
1017   spriteram_bit = 1;
8431018}
8441019
8451020static DRIVER_INIT( legendoh )
8461021{
8471022   memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x32ab0, 0x32ab3, 0, 0, legendoh_speedup_r );
1023
1024   spriteram_bit = 1;
8481025}
8491026
8501027static DRIVER_INIT( sb2003 )
8511028{
8521029   memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x135800, 0x135803, 0, 0, sb2003_speedup_r );
1030
1031   spriteram_bit = 1;
8531032}
8541033
8551034static DRIVER_INIT( spotty )
r3232r3233
8681047   }
8691048
8701049   memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6626c, 0x6626f, 0, 0, spotty_speedup_r );
1050
1051   spriteram_bit = 1;
8711052}
8721053
8731054GAME( 2000, dynabomb, 0,      limenko, sb2003,   dynabomb, ROT0, "Limenko", "Dynamite Bomber (Korea, Rev 1.5)",   GAME_NO_SOUND )
r3232r3233
8761057GAME( 2003, sb2003a,  sb2003, limenko, sb2003,   sb2003,   ROT0, "Limenko", "Super Bubble 2003 (Asia, Ver 1.0)",  GAME_NO_SOUND )
8771058
8781059// this game only use the same graphics chip used in limenko's system
879GAME( 2001, spotty,   0,      spotty,  spotty,   spotty,   ROT0, "Prince Co.", "Spotty (Ver. 2.0.2)",              GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND )
1060GAME( 2001, spotty,   0,      spotty,  spotty,   spotty,   ROT0, "Prince Co.", "Spotty (Ver. 2.0.2)",             GAME_NO_SOUND )
src/mame/drivers/prehisle.c
r3232r3233
2222
2323extern UINT16 *prehisle_bg_videoram16;
2424
25static UINT16 *prehisle_ram16;
26
2725/******************************************************************************/
2826
2927static WRITE16_HANDLER( prehisle_sound16_w )
r3232r3233
3432
3533/*******************************************************************************/
3634
37static ADDRESS_MAP_START( prehisle_readmem, ADDRESS_SPACE_PROGRAM, 16 )
38   AM_RANGE(0x000000, 0x03ffff) AM_READ(SMH_ROM)
39   AM_RANGE(0x070000, 0x073fff) AM_READ(SMH_RAM)
40   AM_RANGE(0x090000, 0x0907ff) AM_READ(SMH_RAM)
41   AM_RANGE(0x0a0000, 0x0a07ff) AM_READ(SMH_RAM)
42   AM_RANGE(0x0b0000, 0x0b3fff) AM_READ(SMH_RAM)
43   AM_RANGE(0x0d0000, 0x0d07ff) AM_READ(SMH_RAM)
35static ADDRESS_MAP_START( prehisle_map, ADDRESS_SPACE_PROGRAM, 16 )
36   AM_RANGE(0x000000, 0x03ffff) AM_ROM
37   AM_RANGE(0x070000, 0x073fff) AM_RAM
38   AM_RANGE(0x090000, 0x0907ff) AM_RAM_WRITE(prehisle_fg_videoram16_w) AM_BASE(&videoram16)
39   AM_RANGE(0x0a0000, 0x0a07ff) AM_RAM AM_BASE(&spriteram16)
40   AM_RANGE(0x0b0000, 0x0b3fff) AM_RAM_WRITE(prehisle_bg_videoram16_w) AM_BASE(&prehisle_bg_videoram16)
41   AM_RANGE(0x0d0000, 0x0d07ff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
4442   AM_RANGE(0x0e0000, 0x0e00ff) AM_READ(prehisle_control16_r)
45ADDRESS_MAP_END
46
47static ADDRESS_MAP_START( prehisle_writemem, ADDRESS_SPACE_PROGRAM, 16 )
48   AM_RANGE(0x000000, 0x03ffff) AM_WRITE(SMH_ROM)
49   AM_RANGE(0x070000, 0x073fff) AM_WRITE(SMH_RAM) AM_BASE(&prehisle_ram16)
50   AM_RANGE(0x090000, 0x0907ff) AM_WRITE(prehisle_fg_videoram16_w) AM_BASE(&videoram16)
51   AM_RANGE(0x0a0000, 0x0a07ff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16)
52   AM_RANGE(0x0b0000, 0x0b3fff) AM_WRITE(prehisle_bg_videoram16_w) AM_BASE(&prehisle_bg_videoram16)
53   AM_RANGE(0x0d0000, 0x0d07ff) AM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
5443   AM_RANGE(0x0f0070, 0x0ff071) AM_WRITE(prehisle_sound16_w)
5544   AM_RANGE(0x0f0000, 0x0ff0ff) AM_WRITE(prehisle_control16_w)
5645ADDRESS_MAP_END
r3232r3233
6453   upd7759_start_w (0,1);
6554}
6655
67static ADDRESS_MAP_START( prehisle_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
68   AM_RANGE(0x0000, 0xefff) AM_READ(SMH_ROM)
69   AM_RANGE(0xf000, 0xf7ff) AM_READ(SMH_RAM)
56static ADDRESS_MAP_START( prehisle_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
57   AM_RANGE(0x0000, 0xefff) AM_ROM
58   AM_RANGE(0xf000, 0xf7ff) AM_RAM
7059   AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_r)
60   AM_RANGE(0xf800, 0xf800) AM_WRITENOP   // ???
7161ADDRESS_MAP_END
7262
73static ADDRESS_MAP_START( prehisle_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
74   AM_RANGE(0x0000, 0xefff) AM_WRITE(SMH_ROM)
75   AM_RANGE(0xf000, 0xf7ff) AM_WRITE(SMH_RAM)
76   AM_RANGE(0xf800, 0xf800) AM_WRITE(SMH_NOP)   // ???
77ADDRESS_MAP_END
78
7963static ADDRESS_MAP_START( prehisle_sound_io_map, ADDRESS_SPACE_IO, 8 )
8064   ADDRESS_MAP_GLOBAL_MASK(0xff)
8165   AM_RANGE(0x00, 0x00) AM_READWRITE(ym3812_status_port_0_r, ym3812_control_port_0_w)
r3232r3233
225209
226210   /* basic machine hardware */
227211   MDRV_CPU_ADD("main", M68000, XTAL_18MHz/2)    /* verified on pcb */
228   MDRV_CPU_PROGRAM_MAP(prehisle_readmem,prehisle_writemem)
212   MDRV_CPU_PROGRAM_MAP(prehisle_map,0)
229213   MDRV_CPU_VBLANK_INT("main", irq4_line_hold)
230214
231215   MDRV_CPU_ADD("audio", Z80, XTAL_4MHz)   /* verified on pcb */
232   MDRV_CPU_PROGRAM_MAP(prehisle_sound_readmem,prehisle_sound_writemem)
216   MDRV_CPU_PROGRAM_MAP(prehisle_sound_map,0)
233217   MDRV_CPU_IO_MAP(prehisle_sound_io_map,0)
234218
235219   /* video hardware */
src/mame/drivers/model1.c
r3232r3233
642642
643643static READ16_HANDLER( io_r )
644644{
645   static const char *analognames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5", "AN6", "AN7" };
646   static const char *inputnames[] = { "IN0", "IN1", "IN2" };
645   static const char *const analognames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5", "AN6", "AN7" };
646   static const char *const inputnames[] = { "IN0", "IN1", "IN2" };
647647
648648   if(offset < 0x8)
649649      return input_port_read_safe(machine, analognames[offset], 0x00);
src/mame/drivers/mw8080bw.c
r3232r3233
21602160   MDRV_WATCHDOG_TIME_INIT(UINT64_ATTOTIME_IN_USEC(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)))
21612161
21622162   /* timers */
2163   MDRV_TIMER_ADD_PERIODIC("STROBE_ON", spcenctr_strobe_timer_callback, HZ(SPCENCTR_STROBE_FREQ))
2163   MDRV_TIMER_ADD_PERIODIC("strobeon", spcenctr_strobe_timer_callback, HZ(SPCENCTR_STROBE_FREQ))
21642164   MDRV_TIMER_PARAM(TRUE)   /* indicates strobe ON */
21652165
2166   MDRV_TIMER_ADD_PERIODIC("STROBE_OFF", spcenctr_strobe_timer_callback, HZ(SPCENCTR_STROBE_FREQ))
2166   MDRV_TIMER_ADD_PERIODIC("strobeoff", spcenctr_strobe_timer_callback, HZ(SPCENCTR_STROBE_FREQ))
21672167   MDRV_TIMER_START_DELAY(HZ(SPCENCTR_STROBE_FREQ * 100 / SPCENCTR_STROBE_DUTY_CYCLE))
21682168   MDRV_TIMER_PARAM(FALSE)   /* indicates strobe OFF */
21692169
src/mame/drivers/suna8.c
r3232r3233
554554   AM_RANGE(0xe000, 0xffff) AM_WRITE(suna8_spriteram_w) AM_BASE(&spriteram   )   // Sprites
555555ADDRESS_MAP_END
556556
557static ADDRESS_MAP_START( hardhead_readport, ADDRESS_SPACE_IO, 8 )
557
558static ADDRESS_MAP_START( hardhead_io_map, ADDRESS_SPACE_IO, 8 )
558559   ADDRESS_MAP_GLOBAL_MASK(0xff)
559560   AM_RANGE(0x00, 0x00) AM_READ(SMH_NOP   )   // ? IRQ Ack
560561ADDRESS_MAP_END
561562
562static ADDRESS_MAP_START( hardhead_writeport, ADDRESS_SPACE_IO, 8 )
563   ADDRESS_MAP_GLOBAL_MASK(0xff)
564ADDRESS_MAP_END
565
566
567563/***************************************************************************
568564                                Rough Ranger
569565***************************************************************************/
r3232r3233
629625   AM_RANGE(0xe000, 0xffff) AM_WRITE(suna8_spriteram_w) AM_BASE(&spriteram   )   // Sprites
630626ADDRESS_MAP_END
631627
632static ADDRESS_MAP_START( rranger_readport, ADDRESS_SPACE_IO, 8 )
628
629static ADDRESS_MAP_START( rranger_io_map, ADDRESS_SPACE_IO, 8 )
633630   ADDRESS_MAP_GLOBAL_MASK(0xff)
634631   AM_RANGE(0x00, 0x00) AM_READ(SMH_NOP   )   // ? IRQ Ack
635632ADDRESS_MAP_END
636633
637static ADDRESS_MAP_START( rranger_writeport, ADDRESS_SPACE_IO, 8 )
638   ADDRESS_MAP_GLOBAL_MASK(0xff)
639ADDRESS_MAP_END
640
641
642634/***************************************************************************
643635                                Brick Zone
644636***************************************************************************/
r3232r3233
720712   AM_RANGE(0xe000, 0xffff) AM_WRITE(suna8_banked_spriteram_w      )   // Sprites (Banked)
721713ADDRESS_MAP_END
722714
723static ADDRESS_MAP_START( brickzn_readport, ADDRESS_SPACE_IO, 8 )
724   ADDRESS_MAP_GLOBAL_MASK(0xff)
725ADDRESS_MAP_END
726715
727static ADDRESS_MAP_START( brickzn_writeport, ADDRESS_SPACE_IO, 8 )
728   ADDRESS_MAP_GLOBAL_MASK(0xff)
729ADDRESS_MAP_END
730
731
732716/***************************************************************************
733717                                Hard Head 2
734718***************************************************************************/
r3232r3233
895879   AM_RANGE(0xe000, 0xffff) AM_WRITE(suna8_banked_spriteram_w      )   // Sprites (Banked)
896880ADDRESS_MAP_END
897881
898static ADDRESS_MAP_START( starfigh_readport, ADDRESS_SPACE_IO, 8 )
899   ADDRESS_MAP_GLOBAL_MASK(0xff)
900ADDRESS_MAP_END
901882
902static ADDRESS_MAP_START( starfigh_writeport, ADDRESS_SPACE_IO, 8 )
903   ADDRESS_MAP_GLOBAL_MASK(0xff)
904ADDRESS_MAP_END
905
906
907883/***************************************************************************
908884                                Spark Man
909885***************************************************************************/
r3232r3233
1021997   AM_RANGE(0xa003, 0xa003) AM_WRITE(ay8910_write_port_0_w      )
1022998ADDRESS_MAP_END
1023999
1024static ADDRESS_MAP_START( hardhead_sound_readport, ADDRESS_SPACE_IO, 8 )
1000
1001static ADDRESS_MAP_START( hardhead_sound_io_map, ADDRESS_SPACE_IO, 8 )
10251002   ADDRESS_MAP_GLOBAL_MASK(0xff)
10261003   AM_RANGE(0x01, 0x01) AM_READ(SMH_NOP   )   // ? IRQ Ack
10271004ADDRESS_MAP_END
10281005
1029static ADDRESS_MAP_START( hardhead_sound_writeport, ADDRESS_SPACE_IO, 8 )
1030   ADDRESS_MAP_GLOBAL_MASK(0xff)
1031ADDRESS_MAP_END
10321006
1033
1034
10351007/***************************************************************************
10361008                                Rough Ranger
10371009***************************************************************************/
r3232r3233
10521024   AM_RANGE(0xa003, 0xa003) AM_WRITE(ym2203_write_port_1_w      )
10531025ADDRESS_MAP_END
10541026
1055static ADDRESS_MAP_START( rranger_sound_readport, ADDRESS_SPACE_IO, 8 )
1056   ADDRESS_MAP_GLOBAL_MASK(0xff)
1057ADDRESS_MAP_END
10581027
1059static ADDRESS_MAP_START( rranger_sound_writeport, ADDRESS_SPACE_IO, 8 )
1060   ADDRESS_MAP_GLOBAL_MASK(0xff)
1061ADDRESS_MAP_END
1062
1063
10641028/***************************************************************************
10651029                                Brick Zone
10661030***************************************************************************/
r3232r3233
10811045   AM_RANGE(0xf000, 0xf000) AM_WRITE(soundlatch2_w            )   // To PCM CPU
10821046ADDRESS_MAP_END
10831047
1084static ADDRESS_MAP_START( brickzn_sound_readport, ADDRESS_SPACE_IO, 8 )
1085   ADDRESS_MAP_GLOBAL_MASK(0xff)
1086ADDRESS_MAP_END
10871048
1088static ADDRESS_MAP_START( brickzn_sound_writeport, ADDRESS_SPACE_IO, 8 )
1089   ADDRESS_MAP_GLOBAL_MASK(0xff)
1090ADDRESS_MAP_END
1091
1092
10931049/* PCM Z80 , 4 DACs (4 bits per sample), NO RAM !! */
10941050
10951051static ADDRESS_MAP_START( brickzn_pcm_readmem, ADDRESS_SPACE_PROGRAM, 8 )
r3232r3233
11051061   dac_signed_data_w( offset, (data & 0xf) * 0x11 );
11061062}
11071063
1108static ADDRESS_MAP_START( brickzn_pcm_readport, ADDRESS_SPACE_IO, 8 )
1064
1065static ADDRESS_MAP_START( brickzn_pcm_io_map, ADDRESS_SPACE_IO, 8 )
11091066   ADDRESS_MAP_GLOBAL_MASK(0xff)
11101067   AM_RANGE(0x00, 0x00) AM_READ(soundlatch2_r      )   // From Sound CPU
1068   AM_RANGE(0x00, 0x03) AM_WRITE(brickzn_pcm_w      )   // 4 x DAC
11111069ADDRESS_MAP_END
1112static ADDRESS_MAP_START( brickzn_pcm_writeport, ADDRESS_SPACE_IO, 8 )
1113   ADDRESS_MAP_GLOBAL_MASK(0xff)
1114   AM_RANGE(0x00, 0x03) AM_WRITE(brickzn_pcm_w         )   // 4 x DAC
1115ADDRESS_MAP_END
11161070
1117
1118
11191071/***************************************************************************
11201072
11211073
r3232r3233
15541506   /* basic machine hardware */
15551507   MDRV_CPU_ADD("main", Z80, 24000000 / 4)         /* ? */
15561508   MDRV_CPU_PROGRAM_MAP(hardhead_readmem,hardhead_writemem)
1557   MDRV_CPU_IO_MAP(hardhead_readport,hardhead_writeport)
1509   MDRV_CPU_IO_MAP(hardhead_io_map,0)
15581510   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)   /* No NMI */
15591511
15601512   MDRV_CPU_ADD("audio", Z80, 24000000 / 4)               /* ? */
15611513   MDRV_CPU_PROGRAM_MAP(hardhead_sound_readmem,hardhead_sound_writemem)
1562   MDRV_CPU_IO_MAP(hardhead_sound_readport,hardhead_sound_writeport)
1514   MDRV_CPU_IO_MAP(hardhead_sound_io_map,0)
15631515   MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4)   /* No NMI */
15641516
15651517   /* video hardware */
r3232r3233
16081560   /* basic machine hardware */
16091561   MDRV_CPU_ADD("main", Z80, 24000000 / 4)               /* ? */
16101562   MDRV_CPU_PROGRAM_MAP(rranger_readmem,rranger_writemem)
1611   MDRV_CPU_IO_MAP(rranger_readport,rranger_writeport)
1563   MDRV_CPU_IO_MAP(rranger_io_map,0)
16121564   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)   /* IRQ & NMI ! */
16131565
16141566   MDRV_CPU_ADD("audio", Z80, 24000000 / 4)               /* ? */
16151567   MDRV_CPU_PROGRAM_MAP(rranger_sound_readmem,rranger_sound_writemem)
1616   MDRV_CPU_IO_MAP(rranger_sound_readport,rranger_sound_writeport)
16171568   MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4)   /* NMI = retn */
16181569
16191570   /* video hardware */
r3232r3233
16651616   /* basic machine hardware */
16661617   MDRV_CPU_ADD("main", Z80, 24000000 / 4)      /* SUNA PROTECTION BLOCK */
16671618   MDRV_CPU_PROGRAM_MAP(brickzn_readmem,brickzn_writemem)
1668   MDRV_CPU_IO_MAP(brickzn_readport,brickzn_writeport)
16691619//  MDRV_CPU_VBLANK_INT_HACK(brickzn_interrupt, 2)
16701620   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)   // nmi breaks ramtest but is needed!
16711621
16721622   MDRV_CPU_ADD("sound", Z80, 24000000 / 4)   /* Z0840006PSC */
16731623   MDRV_CPU_PROGRAM_MAP(brickzn_sound_readmem,brickzn_sound_writemem)
1674   MDRV_CPU_IO_MAP(brickzn_sound_readport,brickzn_sound_writeport)
16751624
16761625   MDRV_CPU_ADD("pcm", Z80, 24000000 / 4)   /* Z0840006PSC */
16771626   MDRV_CPU_PROGRAM_MAP(brickzn_pcm_readmem,brickzn_pcm_writemem)
1678   MDRV_CPU_IO_MAP(brickzn_pcm_readport,brickzn_pcm_writeport)
1627   MDRV_CPU_IO_MAP(brickzn_pcm_io_map,0)
16791628
16801629   /* video hardware */
16811630   MDRV_SCREEN_ADD("main", RASTER)
r3232r3233
17681717   /* basic machine hardware */
17691718   MDRV_CPU_ADD("main", Z80, 24000000 / 4)               /* ? */
17701719   MDRV_CPU_PROGRAM_MAP(starfigh_readmem,starfigh_writemem)
1771   MDRV_CPU_IO_MAP(starfigh_readport,starfigh_writeport)
17721720   MDRV_CPU_VBLANK_INT_HACK(brickzn_interrupt,2)   /* IRQ & NMI */
17731721
17741722   /* The sound section is identical to that of hardhead */
17751723   MDRV_CPU_ADD("audio", Z80, 24000000 / 4)               /* ? */
17761724   MDRV_CPU_PROGRAM_MAP(hardhead_sound_readmem,hardhead_sound_writemem)
1777   MDRV_CPU_IO_MAP(hardhead_sound_readport,hardhead_sound_writeport)
1725   MDRV_CPU_IO_MAP(hardhead_sound_io_map,0)
17781726   MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4)   /* No NMI */
17791727
17801728   /* video hardware */
r3232r3233
18321780
18331781   MDRV_CPU_ADD("audio", Z80, 24000000 / 4)            /* ? */
18341782   MDRV_CPU_PROGRAM_MAP(hardhead_sound_readmem,hardhead_sound_writemem)
1835   MDRV_CPU_IO_MAP(hardhead_sound_readport,hardhead_sound_writeport)
1783   MDRV_CPU_IO_MAP(hardhead_sound_io_map,0)
18361784   MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4)   /* No NMI */
18371785
18381786   /* video hardware */
r3232r3233
24122360GAME( 1990, starfigh, 0,       starfigh, hardhea2, starfigh, ROT90, "SunA",    "Star Fighter (v1)",             GAME_NOT_WORKING )
24132361GAME( 1992, brickzn,  0,       brickzn,  brickzn,  brickzn,  ROT90, "SunA",    "Brick Zone (v5.0)",             GAME_NOT_WORKING )
24142362GAME( 1992, brickzn3, brickzn, brickzn,  brickzn,  brickzn3, ROT90, "SunA",    "Brick Zone (v4.0)",             GAME_NOT_WORKING )
2363
src/mame/drivers/btime.c
r3232r3233
8181}
8282
8383
84static void btime_decrypt(void)
84static void btime_decrypt(running_machine *machine)
8585{
8686   UINT8 *src, *src1;
8787   int addr, addr1;
r3232r3233
9898   /* however if the previous instruction was JSR (which caused a write to */
9999   /* the stack), fetch the address of the next instruction. */
100100   addr1 = activecpu_get_previouspc();
101   src1 = (addr1 < 0x9000) ? rambase : memory_region(Machine, "main");
101   src1 = (addr1 < 0x9000) ? rambase : memory_region(machine, "main");
102102   if (decrypted[addr1] == 0x20)   /* JSR $xxxx */
103103      addr = src1[addr1+1] + 256 * src1[addr1+2];
104104
105105   /* If the address of the next instruction is xxxx xxx1 xxxx x1xx, decode it. */
106   src = (addr < 0x9000) ? rambase : memory_region(Machine, "main");
106   src = (addr < 0x9000) ? rambase : memory_region(machine, "main");
107107   if ((addr & 0x0104) == 0x0104)
108108   {
109109      /* 76543210 -> 65342710 bit rotation */
r3232r3233
162162
163163   rambase[offset] = data;
164164
165   btime_decrypt();
165   btime_decrypt(machine);
166166}
167167
168168static WRITE8_HANDLER( zoar_w )
r3232r3233
180180
181181   rambase[offset] = data;
182182
183   btime_decrypt();
183   btime_decrypt(machine);
184184}
185185
186186static WRITE8_HANDLER( disco_w )
r3232r3233
194194
195195   rambase[offset] = data;
196196
197   btime_decrypt();
197   btime_decrypt(machine);
198198}
199199
200200
r3232r3233
16401640   ROM_LOAD( "ao_04.10f",   0x1000, 0x1000, CRC(921952af) SHA1(4e9248f3493a5f4651278f27c11f507571242317) )
16411641ROM_END
16421642
1643static void decrypt_C10707_cpu(int cpu, const char *cputag)
1643static void decrypt_C10707_cpu(running_machine *machine, int cpu, const char *cputag)
16441644{
16451645   UINT8 *decrypt = auto_malloc(0x10000);
1646   UINT8 *rom = memory_region(Machine, cputag);
1646   UINT8 *rom = memory_region(machine, cputag);
16471647   offs_t addr;
16481648
16491649   memory_set_decrypted_region(cpu, 0x0000, 0xffff, decrypt);
r3232r3233
16691669   return RAM[0xc15f];
16701670}
16711671
1672static void init_rom1(void)
1672static void init_rom1(running_machine *machine)
16731673{
1674   UINT8 *rom = memory_region(Machine, "main");
1674   UINT8 *rom = memory_region(machine, "main");
16751675
16761676   decrypted = auto_malloc(0x10000);
16771677   memory_set_decrypted_region(0, 0x0000, 0xffff, decrypted);
r3232r3233
16841684
16851685static DRIVER_INIT( btime )
16861686{
1687   init_rom1();
1687   init_rom1(machine);
16881688}
16891689
16901690static DRIVER_INIT( zoar )
r3232r3233
16971697       I'm NOPing it out for now. */
16981698   memset(&rom[0xd50a],0xea,8);
16991699
1700   init_rom1();
1700   init_rom1(machine);
17011701}
17021702
17031703static DRIVER_INIT( lnc )
17041704{
1705   decrypt_C10707_cpu(0, "main");
1705   decrypt_C10707_cpu(machine, 0, "main");
17061706}
17071707
17081708static DRIVER_INIT( cookrace )
17091709{
17101710   memcpy(&audio_rambase[0x200], memory_region(machine, "audio") + 0xf200, 0x200);
1711   decrypt_C10707_cpu(0, "main");
1711   decrypt_C10707_cpu(machine, 0, "main");
17121712}
17131713
17141714static DRIVER_INIT( wtennis )
17151715{
17161716   memcpy(&audio_rambase[0x200], memory_region(machine, "audio") + 0xf200, 0x200);
17171717   memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc15f, 0xc15f, 0, 0, wtennis_reset_hack_r);
1718   decrypt_C10707_cpu(0, "main");
1718   decrypt_C10707_cpu(machine, 0, "main");
17191719}
17201720
17211721static DRIVER_INIT( sdtennis )
17221722{
1723   decrypt_C10707_cpu(0, "main");
1724   decrypt_C10707_cpu(1, "audio");
1723   decrypt_C10707_cpu(machine, 0, "main");
1724   decrypt_C10707_cpu(machine, 1, "audio");
17251725}
17261726
17271727
src/mame/drivers/cps1.c
r3232r3233
29982998   ROM_LOAD( "lw-03u.14c", 0x00000, 0x20000, CRC(807d051f) SHA1(720e4733787b9b11f4d1cdce0892b69475802844) )
29992999   ROM_LOAD( "lw-04u.13c", 0x20000, 0x20000, CRC(e6cd098e) SHA1(667f6e5736f76a1c4c450c4e2035574ea89d7910) )
30003000
3001   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
3001   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
30023002   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
30033003   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
30043004   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
30663066   ROM_LOAD( "lw-03u.12e", 0x00000, 0x20000, CRC(807d051f) SHA1(720e4733787b9b11f4d1cdce0892b69475802844) )   // == lw-03u.14c
30673067   ROM_LOAD( "lw-04u.13e", 0x20000, 0x20000, CRC(e6cd098e) SHA1(667f6e5736f76a1c4c450c4e2035574ea89d7910) )   // == lw-04u.13c
30683068
3069   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
3069   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
30703070   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
30713071   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
30723072   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
31043104   ROM_LOAD( "lw-03.14c",  0x00000, 0x20000, CRC(ce2159e7) SHA1(77d564f8b768c1cbd6e5b334f7ee86c4c3f9d62e) )
31053105   ROM_LOAD( "lw-04.13c",  0x20000, 0x20000, CRC(39305536) SHA1(ad24d7b6df2dc5e84a35aecb9ba9b0aaa27ab6e5) )
31063106
3107   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
3107   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
31083108   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
31093109   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
31103110   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
31473147   ROM_LOAD( "dm_26.10a", 0x00000, 0x08000, CRC(3692f6e5) SHA1(61b8438d60a39b4cf5062dff0a53228e8a4e4b5f) )
31483148   ROM_CONTINUE(          0x10000, 0x08000 )
31493149
3150   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
3150   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
31513151   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
31523152   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
31533153   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
31543154   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
31553155   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
31563156
3157   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
3157   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
31583158   ROM_LOAD( "dm620.2a",     0x0000, 0x0117, CRC(f6e5f727) SHA1(8d38c458721347272ccc14b2c0e9885c4f891477) )
31593159   ROM_LOAD( "lwio.8i",      0x0000, 0x0117, CRC(ad52b90c) SHA1(f0fd6aeea515ee449320fe15684e6b3ab7f97bf4) )
31603160ROM_END
r3232r3233
31943194   ROM_LOAD( "dm_26.10a", 0x00000, 0x08000, CRC(3692f6e5) SHA1(61b8438d60a39b4cf5062dff0a53228e8a4e4b5f) )
31953195   ROM_CONTINUE(          0x10000, 0x08000 )
31963196
3197   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
3197   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
31983198   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
31993199   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
32003200   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
32013201   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
32023202   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
32033203
3204   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
3204   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
32053205   ROM_LOAD( "dm620.2a",     0x0000, 0x0117, CRC(f6e5f727) SHA1(8d38c458721347272ccc14b2c0e9885c4f891477) )
32063206   ROM_LOAD( "lwio.8i",      0x0000, 0x0117, CRC(ad52b90c) SHA1(f0fd6aeea515ee449320fe15684e6b3ab7f97bf4) )
32073207ROM_END
r3232r3233
32573257   ROM_LOAD( "dm_37.13c",  0x00000, 0x08000, CRC(3692f6e5) SHA1(61b8438d60a39b4cf5062dff0a53228e8a4e4b5f) )   // == dm_26.10a
32583258   ROM_CONTINUE(           0x10000, 0x08000 )
32593259
3260   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
3260   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
32613261   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
32623262   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
32633263   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
32643264   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
32653265   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
32663266
3267   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
3267   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
32683268   ROM_LOAD( "dm22a.1a",     0x0000, 0x0117, NO_DUMP )
32693269   ROM_LOAD( "lwio.12c",     0x0000, 0x0117, CRC(ad52b90c) SHA1(f0fd6aeea515ee449320fe15684e6b3ab7f97bf4) )
32703270ROM_END
r3232r3233
32923292   ROM_LOAD( "dam_09.12a",   0x00000, 0x08000, CRC(0656ff53) SHA1(063a8124dbe73d014b11f72007f1b877afd1a661) )   // == dm_26.10a + garbage
32933293   ROM_CONTINUE(             0x10000, 0x18000 )   // second half of ROM is unused, not mapped in memory
32943294
3295   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
3295   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
32963296   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
32973297   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
32983298   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
32993299   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
33003300   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
33013301
3302   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
3302   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
33033303   ROM_LOAD( "dam63b.1a",    0x0000, 0x0117, CRC(474b3c8a) SHA1(da364581685067fc955ed43b982a7aa7a2648286) )
33043304   ROM_LOAD( "iob1.12d",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
33053305   ROM_LOAD( "bprg1.11d",    0x0000, 0x0117, CRC(31793da7) SHA1(400fa7ac517421c978c1ee7773c30b9ed0c5d3f3) )
33063306
3307   ROM_REGION( 0x0200, "c-board plds", ROMREGION_DISPOSE )
3307   ROM_REGION( 0x0200, "cboardplds", ROMREGION_DISPOSE )
33083308   ROM_LOAD( "ioc1.ic7",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
33093309   ROM_LOAD( "c632.ic1",     0x0000, 0x0117, CRC(0fbd9270) SHA1(d7e737b20c44d41e29ca94be56114b31934dde81) )
33103310ROM_END
r3232r3233
33393339   ROM_LOAD( "strider.18",   0x00000, 0x20000, CRC(4386bc80) SHA1(fb2b261995aeacfa13e7ee40b1a973dfb178f015) )
33403340   ROM_LOAD( "strider.19",   0x20000, 0x20000, CRC(444536d7) SHA1(a14f5de2f6b5b29ae5161dca1f8c08c566301a91) )
33413341
3342   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
3342   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
33433343   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
33443344   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
33453345   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
33463346   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
33473347   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
33483348
3349   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
3349   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
33503350   ROM_LOAD( "st24m1.1a",    0x0000, 0x0117, CRC(a80d357e) SHA1(4cb79c99c62c8300e694f4cd26f41dab7818f17f) )
33513351   ROM_LOAD( "lwio.11e",     0x0000, 0x0117, CRC(ad52b90c) SHA1(f0fd6aeea515ee449320fe15684e6b3ab7f97bf4) )
33523352ROM_END
r3232r3233
33813381   ROM_LOAD( "strider.18",   0x00000, 0x20000, CRC(4386bc80) SHA1(fb2b261995aeacfa13e7ee40b1a973dfb178f015) )
33823382   ROM_LOAD( "strider.19",   0x20000, 0x20000, CRC(444536d7) SHA1(a14f5de2f6b5b29ae5161dca1f8c08c566301a91) )
33833383
3384   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
3384   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
33853385   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
33863386   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
33873387   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
33883388   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
33893389   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
33903390
3391   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
3391   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
33923392   ROM_LOAD( "st24m1.1a",    0x0000, 0x0117, CRC(a80d357e) SHA1(4cb79c99c62c8300e694f4cd26f41dab7818f17f) )
33933393   ROM_LOAD( "lwio.11e",     0x0000, 0x0117, CRC(ad52b90c) SHA1(f0fd6aeea515ee449320fe15684e6b3ab7f97bf4) )
33943394ROM_END
r3232r3233
34253425   ROM_LOAD( "strider.18",   0x00000, 0x20000, CRC(4386bc80) SHA1(fb2b261995aeacfa13e7ee40b1a973dfb178f015) )
34263426   ROM_LOAD( "strider.19",   0x20000, 0x20000, CRC(444536d7) SHA1(a14f5de2f6b5b29ae5161dca1f8c08c566301a91) )
34273427
3428   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
3428   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
34293429   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
34303430   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
34313431   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
34903490   ROM_LOAD( "sth30.bin",    0x00000, 0x20000, CRC(4386bc80) SHA1(fb2b261995aeacfa13e7ee40b1a973dfb178f015) )   // == strider.18
34913491   ROM_LOAD( "sth31.bin",    0x20000, 0x20000, CRC(444536d7) SHA1(a14f5de2f6b5b29ae5161dca1f8c08c566301a91) )   // == strider.19
34923492
3493   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
3493   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
34943494   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
34953495   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
34963496   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
35253525   ROM_LOAD( "tke_18.11c", 0x00000, 0x20000, CRC(ac6e307d) SHA1(b490ce625bb7ce0904b0fd121fbfbd5252790f7a) )
35263526   ROM_LOAD( "tke_19.12c", 0x20000, 0x20000, CRC(068741db) SHA1(ab48aff639a7ac218b7d5304145e10e92d61fd9f) )
35273527
3528   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
3528   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
35293529   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
35303530   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
35313531   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
35873587   ROM_LOAD( "30",  0x00000, 0x20000, CRC(ac6e307d) SHA1(b490ce625bb7ce0904b0fd121fbfbd5252790f7a) )   // == tke_18.11c
35883588   ROM_LOAD( "31",  0x20000, 0x20000, CRC(068741db) SHA1(ab48aff639a7ac218b7d5304145e10e92d61fd9f) )   // == tke_19.12c
35893589
3590   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
3590   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
35913591   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
35923592   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
35933593   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
36513651   ROM_LOAD( "30.bin",       0x00000, 0x20000, CRC(7e5f6cb4) SHA1(c7b6b7d6dfe5f9f0e1521e7ce990229f480cf68d) )
36523652   ROM_LOAD( "31.bin",       0x20000, 0x20000, CRC(4a30c737) SHA1(426eb90f2edf73eb468c94b4a094da3d46acbab2) )
36533653
3654   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
3654   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
36553655   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
36563656   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
36573657   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
36903690   ROM_LOAD( "wl_18.rom",    0x00000, 0x20000, CRC(bde23d4d) SHA1(d1fee2f99c858dfb07edcd600da491c7b656afe0) )
36913691   ROM_LOAD( "wl_19.rom",    0x20000, 0x20000, CRC(683898f5) SHA1(316a77b663d78c8b9ff6d85756cb05aaaeef4003) )
36923692
3693   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
3693   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
36943694   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
36953695   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
36963696   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
36973697   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
36983698   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
36993699
3700   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
3700   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
37013701   ROM_LOAD( "wl24b.1a",     0x0000, 0x0117, CRC(7101cdf1) SHA1(c848f109d09641b3159dbbb2d2ee49cf30bc9e9c) )
37023702   ROM_LOAD( "lwio.11e",     0x0000, 0x0117, CRC(ad52b90c) SHA1(f0fd6aeea515ee449320fe15684e6b3ab7f97bf4) )
37033703ROM_END
r3232r3233
37353735   ROM_LOAD( "wl30.bin",    0x00000, 0x20000, CRC(bde23d4d) SHA1(d1fee2f99c858dfb07edcd600da491c7b656afe0) )   // == wl_18.rom
37363736   ROM_LOAD( "wl32.bin",    0x20000, 0x20000, CRC(683898f5) SHA1(316a77b663d78c8b9ff6d85756cb05aaaeef4003) )   // == wl_19.rom
37373737
3738   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
3738   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
37393739   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
37403740   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
37413741   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
37423742   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
37433743   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
37443744
3745   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
3745   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
37463746   ROM_LOAD( "wl22b.1a",     0x0000, 0x0117, NO_DUMP )
37473747   ROM_LOAD( "lwio.12c",     0x0000, 0x0117, CRC(ad52b90c) SHA1(f0fd6aeea515ee449320fe15684e6b3ab7f97bf4) )
37483748ROM_END
r3232r3233
37783778   ROM_LOAD( "wl_18.rom",    0x00000, 0x20000, CRC(bde23d4d) SHA1(d1fee2f99c858dfb07edcd600da491c7b656afe0) )
37793779   ROM_LOAD( "wl_19.rom",    0x20000, 0x20000, CRC(683898f5) SHA1(316a77b663d78c8b9ff6d85756cb05aaaeef4003) )
37803780
3781   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
3781   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
37823782   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
37833783   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
37843784   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
37853785   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
37863786   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
37873787
3788   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
3788   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
37893789   ROM_LOAD( "wl24b.1a",     0x0000, 0x0117, CRC(7101cdf1) SHA1(c848f109d09641b3159dbbb2d2ee49cf30bc9e9c) )
37903790   ROM_LOAD( "lwio.11e",     0x0000, 0x0117, CRC(ad52b90c) SHA1(f0fd6aeea515ee449320fe15684e6b3ab7f97bf4) )
37913791ROM_END
r3232r3233
38133813   ROM_LOAD( "ar_18.11c", 0x00000, 0x20000, CRC(584b43a9) SHA1(7820815c8c67d484baf2fdad7e55d8c14b98b860) )
38143814   /* 20000-3ffff empty */
38153815
3816   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
3816   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
38173817   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
38183818   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
38193819   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
38203820   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
38213821   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
38223822
3823   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
3823   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
38243824   ROM_LOAD( "ar24b.1a",     0x0000, 0x0117, CRC(09a51271) SHA1(147f53f426f258ad127157967fa59d4098e5ed16) )
38253825   ROM_LOAD( "lwio.11e",     0x0000, 0x0117, CRC(ad52b90c) SHA1(f0fd6aeea515ee449320fe15684e6b3ab7f97bf4) )
38263826ROM_END
r3232r3233
38633863   ROM_LOAD( "ar_30.12e",  0x00000, 0x20000, CRC(584b43a9) SHA1(7820815c8c67d484baf2fdad7e55d8c14b98b860) )   // == ar_18.11c
38643864   /* 20000-3ffff empty */
38653865
3866   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
3866   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
38673867   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
38683868   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
38693869   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
38703870   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
38713871   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
38723872
3873   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
3873   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
38743874   ROM_LOAD( "ar22b.1a",     0x0000, 0x0117, CRC(f1db9030) SHA1(85a6eefb93e7bf7c7d3980737365a425c5324c08) )
38753875   ROM_LOAD( "lwio.12c",     0x0000, 0x0117, CRC(ad52b90c) SHA1(f0fd6aeea515ee449320fe15684e6b3ab7f97bf4) )
38763876ROM_END
r3232r3233
38993899   ROM_LOAD( "ff_18.11c",  0x00000, 0x20000, CRC(375c66e7) SHA1(36189e23209ce4ae5d9cbabd1574540d0591e7b3) )
39003900   ROM_LOAD( "ff_19.12c",  0x20000, 0x20000, CRC(1ef137f9) SHA1(974b5e72aa28b87ebfa7438efbdfeda769dedf5e) )
39013901
3902   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
3902   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
39033903   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
39043904   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
39053905   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
39063906   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
39073907   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
39083908
3909   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
3909   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
39103910   ROM_LOAD( "s224b.1a",     0x0000, 0x0117, CRC(4e85b158) SHA1(0476840361fb8bcfacc60a213dbbc58bf242431e) )
39113911   ROM_LOAD( "iob1.11e",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
39123912ROM_END
r3232r3233
39343934   ROM_LOAD( "ff_18.11c",  0x00000, 0x20000, CRC(375c66e7) SHA1(36189e23209ce4ae5d9cbabd1574540d0591e7b3) )
39353935   ROM_LOAD( "ff_19.12c",  0x20000, 0x20000, CRC(1ef137f9) SHA1(974b5e72aa28b87ebfa7438efbdfeda769dedf5e) )
39363936
3937   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
3937   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
39383938   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
39393939   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
39403940   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
39413941   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
39423942   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
39433943
3944   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
3944   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
39453945   ROM_LOAD( "s224b.1a",     0x0000, 0x0117, CRC(4e85b158) SHA1(0476840361fb8bcfacc60a213dbbc58bf242431e) )
39463946   ROM_LOAD( "iob1.11e",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
39473947ROM_END
r3232r3233
39733973   ROM_LOAD( "ff_18.11c",  0x00000, 0x20000, CRC(375c66e7) SHA1(36189e23209ce4ae5d9cbabd1574540d0591e7b3) )
39743974   ROM_LOAD( "ff_19.12c",  0x20000, 0x20000, CRC(1ef137f9) SHA1(974b5e72aa28b87ebfa7438efbdfeda769dedf5e) )
39753975
3976   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
3976   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
39773977   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
39783978   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
39793979   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
39803980   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
39813981   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
39823982
3983   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
3983   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
39843984   ROM_LOAD( "s224b.1a",     0x0000, 0x0117, CRC(4e85b158) SHA1(0476840361fb8bcfacc60a213dbbc58bf242431e) )
39853985   ROM_LOAD( "iob1.11e",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
39863986ROM_END
r3232r3233
40254025   ROM_LOAD( "ff_18.11c",  0x00000, 0x20000, CRC(375c66e7) SHA1(36189e23209ce4ae5d9cbabd1574540d0591e7b3) )
40264026   ROM_LOAD( "ff_19.12c",  0x20000, 0x20000, CRC(1ef137f9) SHA1(974b5e72aa28b87ebfa7438efbdfeda769dedf5e) )
40274027
4028   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
4028   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
40294029   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
40304030   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
40314031   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
40324032   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
40334033   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
40344034
4035   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
4035   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
40364036   ROM_LOAD( "s224b.1a",     0x0000, 0x0117, CRC(4e85b158) SHA1(0476840361fb8bcfacc60a213dbbc58bf242431e) )
40374037   ROM_LOAD( "iob1.11e",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
40384038ROM_END
r3232r3233
40754075   ROM_LOAD( "ffj_30.12e",  0x00000, 0x20000, CRC(375c66e7) SHA1(36189e23209ce4ae5d9cbabd1574540d0591e7b3) )   // == ff_18.11c
40764076   ROM_LOAD( "ffj_31.13e",  0x20000, 0x20000, CRC(1ef137f9) SHA1(974b5e72aa28b87ebfa7438efbdfeda769dedf5e) )   // == ff_19.12c
40774077
4078   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
4078   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
40794079   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
40804080   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
40814081   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
40824082   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
40834083   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
40844084
4085   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
4085   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
40864086   ROM_LOAD( "s222b.1a",     0x0000, 0x0117, NO_DUMP )
40874087   ROM_LOAD( "lwio.12c",     0x0000, 0x0117, CRC(ad52b90c) SHA1(f0fd6aeea515ee449320fe15684e6b3ab7f97bf4) )
40884088ROM_END
r3232r3233
41254125   ROM_LOAD( "ffj_30.12e",  0x00000, 0x20000, CRC(375c66e7) SHA1(36189e23209ce4ae5d9cbabd1574540d0591e7b3) )   // == ff_18.11c
41264126   ROM_LOAD( "ffj_31.13e",  0x20000, 0x20000, CRC(1ef137f9) SHA1(974b5e72aa28b87ebfa7438efbdfeda769dedf5e) )   // == ff_19.12c
41274127
4128   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
4128   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
41294129   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
41304130   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
41314131   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
41324132   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
41334133   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
41344134
4135   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
4135   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
41364136   ROM_LOAD( "s222b.1a",     0x0000, 0x0117, NO_DUMP )
41374137   ROM_LOAD( "lwio.12c",     0x0000, 0x0117, CRC(ad52b90c) SHA1(f0fd6aeea515ee449320fe15684e6b3ab7f97bf4) )
41384138ROM_END
r3232r3233
41754175   ROM_LOAD( "ffj_30.12e",  0x00000, 0x20000, CRC(375c66e7) SHA1(36189e23209ce4ae5d9cbabd1574540d0591e7b3) )   // == ff_18.11c
41764176   ROM_LOAD( "ffj_31.13e",  0x20000, 0x20000, CRC(1ef137f9) SHA1(974b5e72aa28b87ebfa7438efbdfeda769dedf5e) )   // == ff_19.12c
41774177
4178   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
4178   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
41794179   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
41804180   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
41814181   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
41824182   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
41834183   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
41844184
4185   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
4185   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
41864186   ROM_LOAD( "s222b.1a",     0x0000, 0x0117, NO_DUMP )
41874187   ROM_LOAD( "lwio.12c",     0x0000, 0x0117, CRC(ad52b90c) SHA1(f0fd6aeea515ee449320fe15684e6b3ab7f97bf4) )
41884188ROM_END
r3232r3233
42064206   ROM_LOAD( "41_09.rom",     0x00000, 0x08000, CRC(0f9d8527) SHA1(3a00dd5772f38081fde11d8d61ba467379e2a636) )
42074207   ROM_CONTINUE(              0x10000, 0x08000 )
42084208
4209   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
4209   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
42104210   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
42114211   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
42124212   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
42424242   ROM_LOAD( "41_18.rom",    0x00000, 0x20000, CRC(d1f15aeb) SHA1(88089383f2d54fc97026a67f067d448eee5bd0c2) )
42434243   ROM_LOAD( "41_19.rom",    0x20000, 0x20000, CRC(15aec3a6) SHA1(8153c03aba005bab62bf0e8b3d15ec1c346326fd) )
42444244
4245   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
4245   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
42464246   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
42474247   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
42484248   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
42814281   ROM_LOAD( "so2_18.11c",  0x00000, 0x20000, CRC(bbea1643) SHA1(d43d68a120550067bf0b181f88687ad230cd7908) )
42824282   ROM_LOAD( "so2_19.12c",  0x20000, 0x20000, CRC(ac58aa71) SHA1(93102272e358bc49d3936302efdc5bb68df84d68) )
42834283
4284   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
4284   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
42854285   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
42864286   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
42874287   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
42884288   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
42894289   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
42904290
4291   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
4291   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
42924292   ROM_LOAD( "o224b.1a",     0x0000, 0x0117, CRC(c211c8cd) SHA1(d9464792e663549e6ad20aac6484622298f88a78) )
42934293   ROM_LOAD( "iob1.11e",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
42944294
4295   ROM_REGION( 0x0200, "c-board plds", ROMREGION_DISPOSE )
4295   ROM_REGION( 0x0200, "cboardplds", ROMREGION_DISPOSE )
42964296   ROM_LOAD( "c628",         0x0000, 0x0117, NO_DUMP )
42974297ROM_END
42984298
r3232r3233
43274327   ROM_LOAD( "so2_18.11c",  0x00000, 0x20000, CRC(bbea1643) SHA1(d43d68a120550067bf0b181f88687ad230cd7908) )
43284328   ROM_LOAD( "so2_19.12c",  0x20000, 0x20000, CRC(ac58aa71) SHA1(93102272e358bc49d3936302efdc5bb68df84d68) )
43294329
4330   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
4330   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
43314331   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
43324332   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
43334333   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
43344334   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
43354335   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
43364336
4337   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
4337   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
43384338   ROM_LOAD( "o224b.1a",     0x0000, 0x0117, CRC(c211c8cd) SHA1(d9464792e663549e6ad20aac6484622298f88a78) )
43394339   ROM_LOAD( "iob1.11e",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
43404340
4341   ROM_REGION( 0x0200, "c-board plds", ROMREGION_DISPOSE )
4341   ROM_REGION( 0x0200, "cboardplds", ROMREGION_DISPOSE )
43424342   ROM_LOAD( "c628",         0x0000, 0x0117, NO_DUMP )
43434343ROM_END
43444344
r3232r3233
43734373   ROM_LOAD( "so2_18.11c",  0x00000, 0x20000, CRC(bbea1643) SHA1(d43d68a120550067bf0b181f88687ad230cd7908) )
43744374   ROM_LOAD( "so2_19.12c",  0x20000, 0x20000, CRC(ac58aa71) SHA1(93102272e358bc49d3936302efdc5bb68df84d68) )
43754375
4376   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
4376   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
43774377   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
43784378   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
43794379   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
43804380   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
43814381   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
43824382
4383   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
4383   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
43844384   ROM_LOAD( "o224b.1a",     0x0000, 0x0117, CRC(c211c8cd) SHA1(d9464792e663549e6ad20aac6484622298f88a78) )
43854385   ROM_LOAD( "iob1.11e",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
43864386
4387   ROM_REGION( 0x0200, "c-board plds", ROMREGION_DISPOSE )
4387   ROM_REGION( 0x0200, "cboardplds", ROMREGION_DISPOSE )
43884388   ROM_LOAD( "c628",         0x0000, 0x0117, NO_DUMP )
43894389ROM_END
43904390
r3232r3233
44344434   ROM_LOAD( "so2_30.bin",  0x00000, 0x20000, CRC(bbea1643) SHA1(d43d68a120550067bf0b181f88687ad230cd7908) )   // == so2_18.11c
44354435   ROM_LOAD( "so2_31.bin",  0x20000, 0x20000, CRC(ac58aa71) SHA1(93102272e358bc49d3936302efdc5bb68df84d68) )   // == so2_19.12c
44364436
4437   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
4437   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
44384438   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
44394439   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
44404440   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
44414441   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
44424442   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
44434443
4444   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
4444   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
44454445   ROM_LOAD( "o222b.1a",     0x0000, 0x0117, NO_DUMP )
44464446   ROM_LOAD( "iob1.12c",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )   // could be LWIO, and 12E if board is 89625B
44474447
4448   ROM_REGION( 0x0200, "c-board plds", ROMREGION_DISPOSE )
4448   ROM_REGION( 0x0200, "cboardplds", ROMREGION_DISPOSE )
44494449   ROM_LOAD( "c628",         0x0000, 0x0117, NO_DUMP )
44504450ROM_END
44514451
r3232r3233
44724472   ROM_LOAD( "ch_18.12b", 0x00000, 0x20000, CRC(f909e8de) SHA1(2dd5bd4076e7d5ded98b72919f868ea700df2e4f) )
44734473   ROM_LOAD( "ch_19.12c", 0x20000, 0x20000, CRC(fc158cf7) SHA1(294b93d0aea60663ffe96364671552e944a1264b) )
44744474
4475   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
4475   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
44764476   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
44774477   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
44784478   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
45184518   ROM_LOAD( "ch_30.bin",    0x00000, 0x20000, CRC(f909e8de) SHA1(2dd5bd4076e7d5ded98b72919f868ea700df2e4f) )   // == ch_18.12b
45194519   ROM_LOAD( "ch_31.bin",    0x20000, 0x20000, CRC(fc158cf7) SHA1(294b93d0aea60663ffe96364671552e944a1264b) )   // == ch_19.12c
45204520
4521   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
4521   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
45224522   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
45234523   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
45244524   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
45494549   ROM_LOAD( "ms_18.11c", 0x00000, 0x20000, CRC(fb64e90d) SHA1(d1a596ce2f8ac14a80b34335b173369a14b45f55) )
45504550   ROM_LOAD( "ms_19.12c", 0x20000, 0x20000, CRC(74f892b9) SHA1(bf48db5c438154e7b96fd31fde1be4aad5cf25eb) )
45514551
4552   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
4552   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
45534553   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
45544554   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
45554555   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
45564556   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
45574557   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
45584558
4559   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
4559   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
45604560   ROM_LOAD( "ms24b.1a",     0x0000, 0x0117, CRC(636dbe6d) SHA1(6622a2294f82e70e9eb5ff24f84e0dc13e9168b5) )
45614561   ROM_LOAD( "iob1.11e",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
45624562ROM_END
r3232r3233
45844584   ROM_LOAD( "ms_18.11c", 0x00000, 0x20000, CRC(fb64e90d) SHA1(d1a596ce2f8ac14a80b34335b173369a14b45f55) )
45854585   ROM_LOAD( "ms_19.12c", 0x20000, 0x20000, CRC(74f892b9) SHA1(bf48db5c438154e7b96fd31fde1be4aad5cf25eb) )
45864586
4587   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
4587   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
45884588   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
45894589   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
45904590   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
45914591   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
45924592   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
45934593
4594   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
4594   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
45954595   ROM_LOAD( "ms24b.1a",     0x0000, 0x0117, CRC(636dbe6d) SHA1(6622a2294f82e70e9eb5ff24f84e0dc13e9168b5) )
45964596   ROM_LOAD( "iob1.11e",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
45974597ROM_END
r3232r3233
46194619   ROM_LOAD( "ms_18.11c", 0x00000, 0x20000, CRC(fb64e90d) SHA1(d1a596ce2f8ac14a80b34335b173369a14b45f55) )
46204620   ROM_LOAD( "ms_19.12c", 0x20000, 0x20000, CRC(74f892b9) SHA1(bf48db5c438154e7b96fd31fde1be4aad5cf25eb) )
46214621
4622   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
4622   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
46234623   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
46244624   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
46254625   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
46264626   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
46274627   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
46284628
4629   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
4629   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
46304630   ROM_LOAD( "ms24b.1a",     0x0000, 0x0117, CRC(636dbe6d) SHA1(6622a2294f82e70e9eb5ff24f84e0dc13e9168b5) )
46314631   ROM_LOAD( "iob1.11e",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
46324632ROM_END
r3232r3233
46694669   ROM_LOAD( "ms_30.12c",  0x00000, 0x20000, CRC(fb64e90d) SHA1(d1a596ce2f8ac14a80b34335b173369a14b45f55) )   // == ms_18.11c
46704670   ROM_LOAD( "ms_31.13c",  0x20000, 0x20000, CRC(74f892b9) SHA1(bf48db5c438154e7b96fd31fde1be4aad5cf25eb) )   // == ms_19.12c
46714671
4672   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
4672   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
46734673   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
46744674   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
46754675   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
46764676   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
46774677   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
46784678
4679   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
4679   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
46804680   ROM_LOAD( "ms22b.1a",     0x0000, 0x0117, NO_DUMP )
46814681   ROM_LOAD( "iob1.12e",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
46824682ROM_END
r3232r3233
47044704   ROM_LOAD( "ca_18.11c", 0x00000, 0x20000, CRC(4a613a2c) SHA1(06e10644fc60925b85d2ca0888c9fa057bfe996a) )
47054705   ROM_LOAD( "ca_19.12c", 0x20000, 0x20000, CRC(74584493) SHA1(5cfb15f1b9729323707972646313aee8ab3ac4eb) )
47064706
4707   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
4707   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
47084708   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
47094709   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
47104710   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
47354735   ROM_LOAD( "ca_18.11c", 0x00000, 0x20000, CRC(4a613a2c) SHA1(06e10644fc60925b85d2ca0888c9fa057bfe996a) )
47364736   ROM_LOAD( "ca_19.12c", 0x20000, 0x20000, CRC(74584493) SHA1(5cfb15f1b9729323707972646313aee8ab3ac4eb) )
47374737
4738   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
4738   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
47394739   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
47404740   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
47414741   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
47664766   ROM_LOAD( "ca_18.11c", 0x00000, 0x20000, CRC(4a613a2c) SHA1(06e10644fc60925b85d2ca0888c9fa057bfe996a) )
47674767   ROM_LOAD( "ca_19.12c", 0x20000, 0x20000, CRC(74584493) SHA1(5cfb15f1b9729323707972646313aee8ab3ac4eb) )
47684768
4769   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
4769   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
47704770   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
47714771   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
47724772   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
48124812   ROM_LOAD( "caj_30.12c",  0x00000, 0x20000, CRC(4a613a2c) SHA1(06e10644fc60925b85d2ca0888c9fa057bfe996a) )   // == ca_18.11c
48134813   ROM_LOAD( "caj_31.13c",  0x20000, 0x20000, CRC(74584493) SHA1(5cfb15f1b9729323707972646313aee8ab3ac4eb) )   // == ca_19.12c
48144814
4815   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
4815   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
48164816   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
48174817   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
48184818   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
48434843   ROM_LOAD( "nm_18.11c", 0x00000, 0x20000, CRC(bab333d4) SHA1(c1d0fb61ec46f17eb7edf69e1ad5ac91b5d51daa) )
48444844   ROM_LOAD( "nm_19.12c", 0x20000, 0x20000, CRC(2650a0a8) SHA1(e9e8cc1b27a2cb3e87124061fabcf42982f0611f) )
48454845
4846   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
4846   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
48474847   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
48484848   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
48494849   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
48504850   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
48514851   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
48524852
4853   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
4853   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
48544854   ROM_LOAD( "nm24b.1a",     0x0000, 0x0117, CRC(7b25bac6) SHA1(fa0083c59c8d6da07798cb3a4fc25d388065b7cd) )
48554855   ROM_LOAD( "iob1.11e",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
48564856ROM_END
r3232r3233
48934893   ROM_LOAD( "nm_30.12c",  0x00000, 0x20000, CRC(bab333d4) SHA1(c1d0fb61ec46f17eb7edf69e1ad5ac91b5d51daa) )   // == nm_18.11c
48944894   ROM_LOAD( "nm_31.13c",  0x20000, 0x20000, CRC(2650a0a8) SHA1(e9e8cc1b27a2cb3e87124061fabcf42982f0611f) )   // == nm_19.12c
48954895
4896   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
4896   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
48974897   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
48984898   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
48994899   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
49004900   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
49014901   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
49024902
4903   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
4903   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
49044904   ROM_LOAD( "nm22b.1a",     0x0000, 0x0117, NO_DUMP )
49054905   ROM_LOAD( "iob1.12e",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
49064906ROM_END
r3232r3233
49734973   ROM_LOAD( "sf2_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
49744974   ROM_LOAD( "sf2_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
49754975
4976   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
4976   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
49774977   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
49784978   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
49794979   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
50145014   ROM_LOAD( "sf2_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
50155015   ROM_LOAD( "sf2_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
50165016
5017   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
5017   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
50185018   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
50195019   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
50205020   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
50555055   ROM_LOAD( "sf2_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
50565056   ROM_LOAD( "sf2_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
50575057
5058   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
5058   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
50595059   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
50605060   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
50615061   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
50965096   ROM_LOAD( "sf2_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
50975097   ROM_LOAD( "sf2_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
50985098
5099   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
5099   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
51005100   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
51015101   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
51025102   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
51375137   ROM_LOAD( "sf2_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
51385138   ROM_LOAD( "sf2_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
51395139
5140   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
5140   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
51415141   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
51425142   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
51435143   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
51785178   ROM_LOAD( "sf2_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
51795179   ROM_LOAD( "sf2_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
51805180
5181   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
5181   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
51825182   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
51835183   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
51845184   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
52195219   ROM_LOAD( "sf2_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
52205220   ROM_LOAD( "sf2_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
52215221
5222   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
5222   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
52235223   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
52245224   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
52255225   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
52605260   ROM_LOAD( "sf2_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
52615261   ROM_LOAD( "sf2_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
52625262
5263   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
5263   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
52645264   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
52655265   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
52665266   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
53015301   ROM_LOAD( "sf2_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
53025302   ROM_LOAD( "sf2_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
53035303
5304   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
5304   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
53055305   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
53065306   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
53075307   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
53425342   ROM_LOAD( "sf2_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
53435343   ROM_LOAD( "sf2_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
53445344
5345   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
5345   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
53465346   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
53475347   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
53485348   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
53835383   ROM_LOAD( "sf2_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
53845384   ROM_LOAD( "sf2_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
53855385
5386   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
5386   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
53875387   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
53885388   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
53895389   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
54245424   ROM_LOAD( "sf2_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
54255425   ROM_LOAD( "sf2_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
54265426
5427   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
5427   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
54285428   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
54295429   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
54305430   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
54625462   ROM_LOAD( "rt_18.11c",  0x00000, 0x20000, CRC(26b211ab) SHA1(0ea03fdd9edff41eacfc52aa9e0421c10968356b) )
54635463   ROM_LOAD( "rt_19.12c",  0x20000, 0x20000, CRC(dbe64ad0) SHA1(09f2ad522fe75d7bcca094b8c6696c3733b539d5) )
54645464
5465   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
5465   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
54665466   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
54675467   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
54685468   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
54695469   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
54705470   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
54715471
5472   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
5472   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
54735473   ROM_LOAD( "rt24b.1a",     0x0000, 0x0117, CRC(54b85159) SHA1(c6f4fb5d747a215f4f50e4f2258e35d3f9bdbb2e) )
54745474   ROM_LOAD( "iob1.11e",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
54755475
5476   ROM_REGION( 0x0200, "c-board plds", ROMREGION_DISPOSE )
5476   ROM_REGION( 0x0200, "cboardplds", ROMREGION_DISPOSE )
54775477   ROM_LOAD( "ioc1.ic1",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
54785478ROM_END
54795479
r3232r3233
55075507   ROM_LOAD( "rt_18.11c",  0x00000, 0x20000, CRC(26b211ab) SHA1(0ea03fdd9edff41eacfc52aa9e0421c10968356b) )
55085508   ROM_LOAD( "rt_19.12c",  0x20000, 0x20000, CRC(dbe64ad0) SHA1(09f2ad522fe75d7bcca094b8c6696c3733b539d5) )
55095509
5510   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
5510   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
55115511   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
55125512   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
55135513   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
55145514   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
55155515   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
55165516
5517   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
5517   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
55185518   ROM_LOAD( "rt24b.1a",     0x0000, 0x0117, CRC(54b85159) SHA1(c6f4fb5d747a215f4f50e4f2258e35d3f9bdbb2e) )
55195519   ROM_LOAD( "iob1.11e",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
55205520
5521   ROM_REGION( 0x0200, "c-board plds", ROMREGION_DISPOSE )
5521   ROM_REGION( 0x0200, "cboardplds", ROMREGION_DISPOSE )
55225522   ROM_LOAD( "ioc1.ic1",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
55235523ROM_END
55245524
r3232r3233
55765576   ROM_LOAD( "rt_30.12c",  0x00000, 0x20000, CRC(26b211ab) SHA1(0ea03fdd9edff41eacfc52aa9e0421c10968356b) )   // == rt_18.11c
55775577   ROM_LOAD( "rt_31.13c",  0x20000, 0x20000, CRC(dbe64ad0) SHA1(09f2ad522fe75d7bcca094b8c6696c3733b539d5) )   // == rt_19.12c
55785578
5579   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
5579   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
55805580   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
55815581   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
55825582   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
55835583   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
55845584   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
55855585
5586   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
5586   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
55875587   ROM_LOAD( "rt22b.1a",     0x0000, 0x0117, CRC(89560d6a) SHA1(0f88920536eb131948339becb14557d77e02b9f8) )
55885588   ROM_LOAD( "iob1.12e",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
55895589
5590   ROM_REGION( 0x0200, "c-board plds", ROMREGION_DISPOSE )
5590   ROM_REGION( 0x0200, "cboardplds", ROMREGION_DISPOSE )
55915591   ROM_LOAD( "ioc1.ic1",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
55925592ROM_END
55935593
r3232r3233
56215621   ROM_LOAD( "kod18.rom",     0x00000, 0x20000, CRC(69ecb2c8) SHA1(fadf266b6b20bd6329a3e638918c5a3106413476) )
56225622   ROM_LOAD( "kod19.rom",     0x20000, 0x20000, CRC(02d851c1) SHA1(c959a6fc3e7d893557f319debae91f28471f4be2) )
56235623
5624   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
5624   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
56255625   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
56265626   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
56275627   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
56595659   ROM_LOAD( "kd18.bin",      0x00000, 0x20000, CRC(4c63181d) SHA1(270f27534a95cb0be3ff3f9ca71c502320d8090b) )
56605660   ROM_LOAD( "kd19.bin",      0x20000, 0x20000, CRC(92941b80) SHA1(5fa7c2793e6febee54a83042d118ddd4f2b7d127) )
56615661
5662   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
5662   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
56635663   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
56645664   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
56655665   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
56945694   ROM_LOAD( "kd18.bin",      0x00000, 0x20000, CRC(4c63181d) SHA1(270f27534a95cb0be3ff3f9ca71c502320d8090b) )
56955695   ROM_LOAD( "kd19.bin",      0x20000, 0x20000, CRC(92941b80) SHA1(5fa7c2793e6febee54a83042d118ddd4f2b7d127) )
56965696
5697   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
5697   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
56985698   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
56995699   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
57005700   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
57305730   ROM_LOAD( "cc_18.rom",     0x00000, 0x20000, CRC(6de2c2db) SHA1(9a1eaba8d104f59a5e61f89679bb5de0c0c64364) )
57315731   ROM_LOAD( "cc_19.rom",     0x20000, 0x20000, CRC(b99091ae) SHA1(b19197c7ad3aeaf5f41c26bf853b0c9b502ecfca) )
57325732
5733   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
5733   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
57345734   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
57355735   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
57365736   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
57375737   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
57385738   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
57395739
5740   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
5740   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
57415741   ROM_LOAD( "cc63b.1a",     0x0000, 0x0117, CRC(cae8f0f9) SHA1(eadbd45e184195b2d170cd71a68e5caed64b69f7) )
57425742   ROM_LOAD( "iob1.12d",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
57435743   ROM_LOAD( "ccprg.11d",    0x0000, 0x0117, CRC(e1c225c4) SHA1(97146451ca9aa3cecd443cc6881151ed8df47fbf) )
57445744
5745   ROM_REGION( 0x0200, "c-board plds", ROMREGION_DISPOSE )
5745   ROM_REGION( 0x0200, "cboardplds", ROMREGION_DISPOSE )
57465746   ROM_LOAD( "ioc1.ic7",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
57475747   ROM_LOAD( "c632.ic1",     0x0000, 0x0117, CRC(0fbd9270) SHA1(d7e737b20c44d41e29ca94be56114b31934dde81) )
57485748ROM_END
r3232r3233
57735773   ROM_LOAD( "cc_18.rom",     0x00000, 0x20000, CRC(6de2c2db) SHA1(9a1eaba8d104f59a5e61f89679bb5de0c0c64364) )
57745774   ROM_LOAD( "cc_19.rom",     0x20000, 0x20000, CRC(b99091ae) SHA1(b19197c7ad3aeaf5f41c26bf853b0c9b502ecfca) )
57755775
5776   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
5776   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
57775777   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
57785778   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
57795779   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
57805780   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
57815781   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
57825782
5783   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
5783   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
57845784   ROM_LOAD( "cc63b.1a",     0x0000, 0x0117, CRC(cae8f0f9) SHA1(eadbd45e184195b2d170cd71a68e5caed64b69f7) )
57855785   ROM_LOAD( "iob1.12d",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
57865786   ROM_LOAD( "ccprg.11d",    0x0000, 0x0117, CRC(e1c225c4) SHA1(97146451ca9aa3cecd443cc6881151ed8df47fbf) )
57875787
5788   ROM_REGION( 0x0200, "c-board plds", ROMREGION_DISPOSE )
5788   ROM_REGION( 0x0200, "cboardplds", ROMREGION_DISPOSE )
57895789   ROM_LOAD( "ioc1.ic7",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
57905790   ROM_LOAD( "c632.ic1",     0x0000, 0x0117, CRC(0fbd9270) SHA1(d7e737b20c44d41e29ca94be56114b31934dde81) )
57915791ROM_END
r3232r3233
58165816   ROM_LOAD( "cc_18.rom",     0x00000, 0x20000, CRC(6de2c2db) SHA1(9a1eaba8d104f59a5e61f89679bb5de0c0c64364) )
58175817   ROM_LOAD( "cc_19.rom",     0x20000, 0x20000, CRC(b99091ae) SHA1(b19197c7ad3aeaf5f41c26bf853b0c9b502ecfca) )
58185818
5819   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
5819   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
58205820   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
58215821   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
58225822   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
58235823   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
58245824   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
58255825
5826   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
5826   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
58275827   ROM_LOAD( "cc63b.1a",     0x0000, 0x0117, CRC(cae8f0f9) SHA1(eadbd45e184195b2d170cd71a68e5caed64b69f7) )
58285828   ROM_LOAD( "iob1.12d",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
58295829   ROM_LOAD( "ccprg.11d",    0x0000, 0x0117, CRC(e1c225c4) SHA1(97146451ca9aa3cecd443cc6881151ed8df47fbf) )
58305830
5831   ROM_REGION( 0x0200, "c-board plds", ROMREGION_DISPOSE )
5831   ROM_REGION( 0x0200, "cboardplds", ROMREGION_DISPOSE )
58325832   ROM_LOAD( "ioc1.ic7",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
58335833   ROM_LOAD( "c632.ic1",     0x0000, 0x0117, CRC(0fbd9270) SHA1(d7e737b20c44d41e29ca94be56114b31934dde81) )
58345834ROM_END
r3232r3233
59165916   ROM_LOAD( "kr_18.rom",     0x00000, 0x20000, CRC(da69d15f) SHA1(9616207e693bae85705f786cef60b9f6951b5067) )
59175917   ROM_LOAD( "kr_19.rom",     0x20000, 0x20000, CRC(bfc654e9) SHA1(01b3d92e4dedf55ea3933d387c7ddb9ba2549773) )
59185918
5919   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
5919   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
59205920   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
59215921   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
59225922   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
59235923   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
59245924   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
59255925
5926   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
5926   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
59275927   ROM_LOAD( "kr63b.1a",     0x0000, 0x0117, CRC(fd5b6522) SHA1(5e6ebb2d736415402920a30d331d4b6dab557e5e) )
59285928   ROM_LOAD( "iob1.12d",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
59295929   ROM_LOAD( "bprg1.11d",    0x0000, 0x0117, CRC(31793da7) SHA1(400fa7ac517421c978c1ee7773c30b9ed0c5d3f3) )
59305930
5931   ROM_REGION( 0x0200, "c-board plds", ROMREGION_DISPOSE )
5931   ROM_REGION( 0x0200, "cboardplds", ROMREGION_DISPOSE )
59325932   ROM_LOAD( "ioc1.ic7",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
59335933   ROM_LOAD( "c632.ic1",     0x0000, 0x0117, CRC(0fbd9270) SHA1(d7e737b20c44d41e29ca94be56114b31934dde81) )
59345934ROM_END
r3232r3233
59575957   ROM_LOAD( "kr_18.rom",     0x00000, 0x20000, CRC(da69d15f) SHA1(9616207e693bae85705f786cef60b9f6951b5067) )
59585958   ROM_LOAD( "kr_19.rom",     0x20000, 0x20000, CRC(bfc654e9) SHA1(01b3d92e4dedf55ea3933d387c7ddb9ba2549773) )
59595959
5960   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
5960   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
59615961   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
59625962   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
59635963   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
59645964   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
59655965   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
59665966
5967   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
5967   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
59685968   ROM_LOAD( "kr63b.1a",     0x0000, 0x0117, CRC(fd5b6522) SHA1(5e6ebb2d736415402920a30d331d4b6dab557e5e) )
59695969   ROM_LOAD( "iob1.12d",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
59705970   ROM_LOAD( "bprg1.11d",    0x0000, 0x0117, CRC(31793da7) SHA1(400fa7ac517421c978c1ee7773c30b9ed0c5d3f3) )
59715971
5972   ROM_REGION( 0x0200, "c-board plds", ROMREGION_DISPOSE )
5972   ROM_REGION( 0x0200, "cboardplds", ROMREGION_DISPOSE )
59735973   ROM_LOAD( "ioc1.ic7",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
59745974   ROM_LOAD( "c632.ic1",     0x0000, 0x0117, CRC(0fbd9270) SHA1(d7e737b20c44d41e29ca94be56114b31934dde81) )
59755975ROM_END
r3232r3233
60026002   ROM_LOAD( "kr_18.rom",     0x00000, 0x20000, CRC(da69d15f) SHA1(9616207e693bae85705f786cef60b9f6951b5067) )
60036003   ROM_LOAD( "kr_19.rom",     0x20000, 0x20000, CRC(bfc654e9) SHA1(01b3d92e4dedf55ea3933d387c7ddb9ba2549773) )
60046004
6005   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
6005   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
60066006   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
60076007   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
60086008   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
60386038   ROM_LOAD( "s92_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
60396039   ROM_LOAD( "s92_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
60406040
6041   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
6041   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
60426042   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
60436043   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
60446044   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
60746074   ROM_LOAD( "s92_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
60756075   ROM_LOAD( "s92_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
60766076
6077   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
6077   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
60786078   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
60796079   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
60806080   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
61106110   ROM_LOAD( "s92_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
61116111   ROM_LOAD( "s92_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
61126112
6113   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
6113   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
61146114   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
61156115   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
61166116   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
61466146   ROM_LOAD( "s92_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
61476147   ROM_LOAD( "s92_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
61486148
6149   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
6149   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
61506150   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
61516151   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
61526152   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
61826182   ROM_LOAD( "s92_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
61836183   ROM_LOAD( "s92_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
61846184
6185   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
6185   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
61866186   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
61876187   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
61886188   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
66906690   ROM_LOAD( "va_18.11c", 0x00000, 0x20000, CRC(de30510e) SHA1(8e878696192606b76a3a0e53553e638d9621cff7) )
66916691   ROM_LOAD( "va_19.12c", 0x20000, 0x20000, CRC(0610a4ac) SHA1(3da02ea6a7a56c85de898806d2a1cf6bc526c1b3) )
66926692
6693   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
6693   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
66946694   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
66956695   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
66966696   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
67246724   ROM_LOAD( "va_18.11c", 0x00000, 0x20000, CRC(de30510e) SHA1(8e878696192606b76a3a0e53553e638d9621cff7) )
67256725   ROM_LOAD( "va_19.12c", 0x20000, 0x20000, CRC(0610a4ac) SHA1(3da02ea6a7a56c85de898806d2a1cf6bc526c1b3) )
67266726
6727   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
6727   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
67286728   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
67296729   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
67306730   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
67526752   ROM_LOAD( "va_18.bin", 0x00000, 0x20000, CRC(de30510e) SHA1(8e878696192606b76a3a0e53553e638d9621cff7) )
67536753   ROM_LOAD( "va_19.bin", 0x20000, 0x20000, CRC(0610a4ac) SHA1(3da02ea6a7a56c85de898806d2a1cf6bc526c1b3) )
67546754
6755   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
6755   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
67566756   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
67576757   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
67586758   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
67986798   ROM_LOAD( "va_30.12e", 0x00000, 0x20000, CRC(de30510e) SHA1(8e878696192606b76a3a0e53553e638d9621cff7) )   // == va_18.bin
67996799   ROM_LOAD( "va_31.13e", 0x20000, 0x20000, CRC(0610a4ac) SHA1(3da02ea6a7a56c85de898806d2a1cf6bc526c1b3) )   // == va_19.bin
68006800
6801   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
6801   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
68026802   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
68036803   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
68046804   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
68056805   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
68066806   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
68076807
6808   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
6808   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
68096809   ROM_LOAD( "va22b.1a",     0x0000, 0x0117, CRC(bd7cd574) SHA1(00e49631aceb2871e9313f40264fa55eaaa3538c) )
68106810   ROM_LOAD( "lwio.12c",     0x0000, 0x0117, CRC(ad52b90c) SHA1(f0fd6aeea515ee449320fe15684e6b3ab7f97bf4) )
68116811
6812   ROM_REGION( 0x0200, "c-board plds", ROMREGION_DISPOSE )
6812   ROM_REGION( 0x0200, "cboardplds", ROMREGION_DISPOSE )
68136813   ROM_LOAD( "ioc1.ic1",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
68146814ROM_END
68156815
r3232r3233
68516851   ROM_LOAD( "q530.bin",      0x00000, 0x20000, CRC(d10c1b68) SHA1(2423241f3340d8ab1b6bf9514ca8c3bba1273873) )
68526852   ROM_LOAD( "q531.bin",      0x20000, 0x20000, CRC(7d17e496) SHA1(a274b94ec4f042dddc239ecb9ac2e1e2375f5eb2) )
68536853
6854   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
6854   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
68556855   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
68566856   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
68576857   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
68856885   ROM_LOAD( "tk2_q3.rom",     0x100000, 0x80000, CRC(bfcf6f52) SHA1(2a85ff3fc89b4cbabd20779ec12da2e116333c7c) )
68866886   ROM_LOAD( "tk2_q4.rom",     0x180000, 0x80000, CRC(36642e88) SHA1(8ab25b19e2b67215a5cb1f3aa81b9d26009cfeb8) )
68876887
6888   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
6888   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
68896889   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
68906890   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
68916891   ROM_LOAD( "prg2",         0x0000, 0x0117, CRC(4386879a) SHA1(c36896d169d8c78393609acbbe4397931292a033) )
68926892   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
68936893
6894   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
6894   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
68956895   ROM_LOAD( "tk263b.1a",    0x0000, 0x0117, CRC(c4b0349b) SHA1(b4873dd5ad8735048deb3475222dde3c0b67eaaf) )
68966896   ROM_LOAD( "iob1.12d",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
68976897   ROM_LOAD( "bprg1.11d",    0x0000, 0x0117, CRC(31793da7) SHA1(400fa7ac517421c978c1ee7773c30b9ed0c5d3f3) )
68986898
6899   ROM_REGION( 0x0200, "c-board plds", ROMREGION_DISPOSE )
6899   ROM_REGION( 0x0200, "cboardplds", ROMREGION_DISPOSE )
69006900   ROM_LOAD( "ioc1.ic7",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
69016901ROM_END
69026902
r3232r3233
69266926   ROM_LOAD( "tk2_q3.rom",     0x100000, 0x80000, CRC(bfcf6f52) SHA1(2a85ff3fc89b4cbabd20779ec12da2e116333c7c) )
69276927   ROM_LOAD( "tk2_q4.rom",     0x180000, 0x80000, CRC(36642e88) SHA1(8ab25b19e2b67215a5cb1f3aa81b9d26009cfeb8) )
69286928
6929   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
6929   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
69306930   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
69316931   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
69326932   ROM_LOAD( "prg2",         0x0000, 0x0117, CRC(4386879a) SHA1(c36896d169d8c78393609acbbe4397931292a033) )
69336933   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
69346934
6935   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
6935   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
69366936   ROM_LOAD( "tk263b.1a",    0x0000, 0x0117, CRC(c4b0349b) SHA1(b4873dd5ad8735048deb3475222dde3c0b67eaaf) )
69376937   ROM_LOAD( "iob1.12d",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
69386938   ROM_LOAD( "bprg1.11d",    0x0000, 0x0117, CRC(31793da7) SHA1(400fa7ac517421c978c1ee7773c30b9ed0c5d3f3) )
69396939
6940   ROM_REGION( 0x0200, "c-board plds", ROMREGION_DISPOSE )
6940   ROM_REGION( 0x0200, "cboardplds", ROMREGION_DISPOSE )
69416941   ROM_LOAD( "ioc1.ic7",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
69426942ROM_END
69436943
r3232r3233
69676967   ROM_LOAD( "tk2_q3.rom",     0x100000, 0x80000, CRC(bfcf6f52) SHA1(2a85ff3fc89b4cbabd20779ec12da2e116333c7c) )
69686968   ROM_LOAD( "tk2_q4.rom",     0x180000, 0x80000, CRC(36642e88) SHA1(8ab25b19e2b67215a5cb1f3aa81b9d26009cfeb8) )
69696969
6970   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
6970   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
69716971   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
69726972   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
69736973   ROM_LOAD( "prg2",         0x0000, 0x0117, CRC(4386879a) SHA1(c36896d169d8c78393609acbbe4397931292a033) )
69746974   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
69756975
6976   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
6976   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
69776977   ROM_LOAD( "tk263b.1a",    0x0000, 0x0117, CRC(c4b0349b) SHA1(b4873dd5ad8735048deb3475222dde3c0b67eaaf) )
69786978   ROM_LOAD( "iob1.12d",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
69796979   ROM_LOAD( "bprg1.11d",    0x0000, 0x0117, CRC(31793da7) SHA1(400fa7ac517421c978c1ee7773c30b9ed0c5d3f3) )
69806980
6981   ROM_REGION( 0x0200, "c-board plds", ROMREGION_DISPOSE )
6981   ROM_REGION( 0x0200, "cboardplds", ROMREGION_DISPOSE )
69826982   ROM_LOAD( "ioc1.ic7",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
69836983ROM_END
69846984
r3232r3233
70087008   ROM_LOAD( "tk2_q3.rom",     0x100000, 0x80000, CRC(bfcf6f52) SHA1(2a85ff3fc89b4cbabd20779ec12da2e116333c7c) )
70097009   ROM_LOAD( "tk2_q4.rom",     0x180000, 0x80000, CRC(36642e88) SHA1(8ab25b19e2b67215a5cb1f3aa81b9d26009cfeb8) )
70107010
7011   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
7011   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
70127012   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
70137013   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
70147014   ROM_LOAD( "prg2",         0x0000, 0x0117, CRC(4386879a) SHA1(c36896d169d8c78393609acbbe4397931292a033) )
70157015   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
70167016
7017   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
7017   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
70187018   ROM_LOAD( "tk263b.1a",    0x0000, 0x0117, CRC(c4b0349b) SHA1(b4873dd5ad8735048deb3475222dde3c0b67eaaf) )
70197019   ROM_LOAD( "iob1.12d",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
70207020   ROM_LOAD( "bprg1.11d",    0x0000, 0x0117, CRC(31793da7) SHA1(400fa7ac517421c978c1ee7773c30b9ed0c5d3f3) )
70217021
7022   ROM_REGION( 0x0200, "c-board plds", ROMREGION_DISPOSE )
7022   ROM_REGION( 0x0200, "cboardplds", ROMREGION_DISPOSE )
70237023   ROM_LOAD( "ioc1.ic7",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
70247024ROM_END
70257025
r3232r3233
70787078   ROM_LOAD( "s92_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
70797079   ROM_LOAD( "s92_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
70807080
7081   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
7081   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
70827082   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
70837083   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
70847084   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
71147114   ROM_LOAD( "s92_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
71157115   ROM_LOAD( "s92_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
71167116
7117   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
7117   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
71187118   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
71197119   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
71207120   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
71507150   ROM_LOAD( "s92_18.bin",    0x00000, 0x20000, CRC(7f162009) SHA1(346bf42992b4c36c593e21901e22c87ae4a7d86d) )
71517151   ROM_LOAD( "s92_19.bin",    0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) )
71527152
7153   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
7153   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
71547154   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
71557155   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
71567156   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
71857185   ROM_LOAD( "cd_q3.rom",      0x100000, 0x80000, CRC(2f273ffc) SHA1(f0de462f6c4d251911258e0ebd886152c14d1586) )
71867186   ROM_LOAD( "cd_q4.rom",      0x180000, 0x80000, CRC(2c67821d) SHA1(6e2528d0b22508300a6a142a796dd3bf53a66946) )
71877187
7188   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
7188   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
71897189   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
71907190   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
71917191   ROM_LOAD( "prg2",         0x0000, 0x0117, CRC(4386879a) SHA1(c36896d169d8c78393609acbbe4397931292a033) )
r3232r3233
72197219   ROM_LOAD( "cd_q3.rom",      0x100000, 0x80000, CRC(2f273ffc) SHA1(f0de462f6c4d251911258e0ebd886152c14d1586) )
72207220   ROM_LOAD( "cd_q4.rom",      0x180000, 0x80000, CRC(2c67821d) SHA1(6e2528d0b22508300a6a142a796dd3bf53a66946) )
72217221
7222   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
7222   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
72237223   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
72247224   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
72257225   ROM_LOAD( "prg2",         0x0000, 0x0117, CRC(4386879a) SHA1(c36896d169d8c78393609acbbe4397931292a033) )
r3232r3233
72537253   ROM_LOAD( "cd_q3.rom",      0x100000, 0x80000, CRC(2f273ffc) SHA1(f0de462f6c4d251911258e0ebd886152c14d1586) )
72547254   ROM_LOAD( "cd_q4.rom",      0x180000, 0x80000, CRC(2c67821d) SHA1(6e2528d0b22508300a6a142a796dd3bf53a66946) )
72557255
7256   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
7256   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
72577257   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
72587258   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
72597259   ROM_LOAD( "prg2",         0x0000, 0x0117, CRC(4386879a) SHA1(c36896d169d8c78393609acbbe4397931292a033) )
r3232r3233
74007400   ROM_LOAD( "ps_q3.rom",      0x100000, 0x80000, CRC(0dd44491) SHA1(903cea1d7f3120545ea3229d30fbd687d11ad68f) )
74017401   ROM_LOAD( "ps_q4.rom",      0x180000, 0x80000, CRC(bed42f03) SHA1(21302f7e75f9c795392a3b34e16a959fc5f6e4e9) )
74027402
7403   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
7403   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
74047404   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
74057405   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
74067406   ROM_LOAD( "prg2",         0x0000, 0x0117, CRC(4386879a) SHA1(c36896d169d8c78393609acbbe4397931292a033) )
r3232r3233
74407440   ROM_LOAD( "ps_q3.rom",      0x100000, 0x80000, CRC(0dd44491) SHA1(903cea1d7f3120545ea3229d30fbd687d11ad68f) )
74417441   ROM_LOAD( "ps_q4.rom",      0x180000, 0x80000, CRC(bed42f03) SHA1(21302f7e75f9c795392a3b34e16a959fc5f6e4e9) )
74427442
7443   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
7443   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
74447444   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
74457445   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
74467446   ROM_LOAD( "prg2",         0x0000, 0x0117, CRC(4386879a) SHA1(c36896d169d8c78393609acbbe4397931292a033) )
r3232r3233
74747474   ROM_LOAD( "ps_q3.rom",      0x100000, 0x80000, CRC(0dd44491) SHA1(903cea1d7f3120545ea3229d30fbd687d11ad68f) )
74757475   ROM_LOAD( "ps_q4.rom",      0x180000, 0x80000, CRC(bed42f03) SHA1(21302f7e75f9c795392a3b34e16a959fc5f6e4e9) )
74767476
7477   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
7477   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
74787478   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
74797479   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
74807480   ROM_LOAD( "prg2",         0x0000, 0x0117, CRC(4386879a) SHA1(c36896d169d8c78393609acbbe4397931292a033) )
r3232r3233
76557655   ROM_LOAD( "mb_q7.bin",      0x300000, 0x80000, CRC(041e49ba) SHA1(3220b033a5c0cfbbe75c0c113cf2db39fb093a7e) )
76567656   ROM_LOAD( "mb_q8.bin",      0x380000, 0x80000, CRC(59fe702a) SHA1(807178dfc6d864e49fd7aabb5c4895835cf0e85b) )
76577657
7658   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
7658   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
76597659   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
76607660   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
76617661   ROM_LOAD( "prg2",         0x0000, 0x0117, CRC(4386879a) SHA1(c36896d169d8c78393609acbbe4397931292a033) )
r3232r3233
77047704   ROM_LOAD( "mb_q7.bin",      0x300000, 0x80000, CRC(041e49ba) SHA1(3220b033a5c0cfbbe75c0c113cf2db39fb093a7e) )
77057705   ROM_LOAD( "mb_q8.bin",      0x380000, 0x80000, CRC(59fe702a) SHA1(807178dfc6d864e49fd7aabb5c4895835cf0e85b) )
77067706
7707   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
7707   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
77087708   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
77097709   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
77107710   ROM_LOAD( "prg2",         0x0000, 0x0117, CRC(4386879a) SHA1(c36896d169d8c78393609acbbe4397931292a033) )
r3232r3233
77537753   ROM_LOAD( "mb_q7.bin",      0x300000, 0x80000, CRC(041e49ba) SHA1(3220b033a5c0cfbbe75c0c113cf2db39fb093a7e) )
77547754   ROM_LOAD( "mb_q8.bin",      0x380000, 0x80000, CRC(59fe702a) SHA1(807178dfc6d864e49fd7aabb5c4895835cf0e85b) )
77557755
7756   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
7756   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
77577757   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
77587758   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
77597759   ROM_LOAD( "prg2",         0x0000, 0x0117, CRC(4386879a) SHA1(c36896d169d8c78393609acbbe4397931292a033) )
r3232r3233
78027802   ROM_LOAD( "mb_q7.bin",      0x300000, 0x80000, CRC(041e49ba) SHA1(3220b033a5c0cfbbe75c0c113cf2db39fb093a7e) )
78037803   ROM_LOAD( "mb_q8.bin",      0x380000, 0x80000, CRC(59fe702a) SHA1(807178dfc6d864e49fd7aabb5c4895835cf0e85b) )
78047804
7805   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
7805   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
78067806   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
78077807   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
78087808   ROM_LOAD( "prg2",         0x0000, 0x0117, CRC(4386879a) SHA1(c36896d169d8c78393609acbbe4397931292a033) )
r3232r3233
78517851   ROM_LOAD( "mb_q7.bin",      0x300000, 0x80000, CRC(041e49ba) SHA1(3220b033a5c0cfbbe75c0c113cf2db39fb093a7e) )
78527852   ROM_LOAD( "mb_q8.bin",      0x380000, 0x80000, CRC(59fe702a) SHA1(807178dfc6d864e49fd7aabb5c4895835cf0e85b) )
78537853
7854   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
7854   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
78557855   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
78567856   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
78577857   ROM_LOAD( "prg2",         0x0000, 0x0117, CRC(4386879a) SHA1(c36896d169d8c78393609acbbe4397931292a033) )
r3232r3233
78907890   ROM_LOAD( "pnij24.bin",    0x00000, 0x20000, CRC(5092257d) SHA1(95dc9d10940653b2fb37baf5c1ed27145b02104e) )
78917891   ROM_LOAD( "pnij25.bin",    0x20000, 0x20000, CRC(22109aaa) SHA1(cf21e75674d81b2daae2083d02f9f4b6e52722c6) )
78927892
7893   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
7893   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
78947894   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
78957895   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
78967896   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
79247924   ROM_LOAD( "qdu_30.12c", 0x00000, 0x20000, CRC(f190da84) SHA1(d5cd4c69b5d135a2f2fea8ca9631251c9da79e70) )
79257925   ROM_LOAD( "qdu_31.13c", 0x20000, 0x20000, CRC(b7583f73) SHA1(3896e0fcf375e9e5d9ba70cc1ed001cd702f9ff7) )
79267926
7927   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
7927   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
79287928   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
79297929   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
79307930   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
79317931   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
79327932   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
79337933
7934   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
7934   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
79357935   ROM_LOAD( "qd22b.1a",     0x0000, 0x0117, CRC(783c53ab) SHA1(1bf87e5fe7e7cbcec0d76ed094dcac823e45af14) )
79367936   ROM_LOAD( "iob1.12e",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
79377937
7938   ROM_REGION( 0x0200, "c-board plds", ROMREGION_DISPOSE )
7938   ROM_REGION( 0x0200, "cboardplds", ROMREGION_DISPOSE )
79397939   ROM_LOAD( "ioc1.ic1",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
79407940ROM_END
79417941
r3232r3233
79597959   ROM_LOAD( "qad18.bin",     0x00000, 0x20000, CRC(2bfe6f6a) SHA1(b2a98ac034c65b7ac8167431f05f35d4799032ea) )
79607960   ROM_LOAD( "qad19.bin",     0x20000, 0x20000, CRC(13d3236b) SHA1(785d49de484e9ac6971eaceebebfecb8e58563f6) )
79617961
7962   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
7962   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
79637963   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
79647964   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
79657965   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
79967996   ROM_LOAD( "tn2j-18.11c", 0x00000, 0x20000, CRC(a40bf9a7) SHA1(07cb1076262a281e31a621cbcc10be0cae883175) )
79977997   ROM_LOAD( "tn2j-19.12c", 0x20000, 0x20000, CRC(5b3b931e) SHA1(cf28891f84814cbfaa3adaade8bb08b1e0546a3d) )
79987998
7999   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
7999   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
80008000   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
80018001   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
80028002   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
80238023   ROM_LOAD( "pa3-05.10d",  0x00000, 0x20000, CRC(73a10d5d) SHA1(999465e4fbc35a34746d2db61ad49f61403d5af7) )
80248024   ROM_LOAD( "pa3-06.11d",  0x20000, 0x20000, CRC(affa4f82) SHA1(27b9292bbc121cf585f53297a79fe8f0d0a729ae) )
80258025
8026   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
8026   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
80278027   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
80288028   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
80298029   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
80508050   ROM_LOAD( "pa3-05.10d",  0x00000, 0x20000, CRC(73a10d5d) SHA1(999465e4fbc35a34746d2db61ad49f61403d5af7) )
80518051   ROM_LOAD( "pa3-06.11d",  0x20000, 0x20000, CRC(affa4f82) SHA1(27b9292bbc121cf585f53297a79fe8f0d0a729ae) )
80528052
8053   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
8053   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
80548054   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
80558055   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
80568056   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
r3232r3233
80918091   ROM_LOAD( "rcm_18.rom",    0x00000, 0x20000, CRC(80f1f8aa) SHA1(4a5b7b2a6941ad68da7472c63362c7bcd353fa54) )
80928092   ROM_LOAD( "rcm_19.rom",    0x20000, 0x20000, CRC(f257dbe1) SHA1(967def6b6f93039dbc46373caabeb3301577be75) )
80938093
8094   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
8094   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
80958095   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
80968096   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
80978097   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
80988098   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
80998099   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
81008100
8101   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
8101   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
81028102   ROM_LOAD( "rcm63b.1a",    0x0000, 0x0117, CRC(84acd494) SHA1(20c861714c8c68bc8cf3bde9d051969807e9b3a3) )
81038103   ROM_LOAD( "iob1.12d",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
81048104   ROM_LOAD( "bprg1.11d",    0x0000, 0x0117, CRC(31793da7) SHA1(400fa7ac517421c978c1ee7773c30b9ed0c5d3f3) )
81058105
8106   ROM_REGION( 0x0200, "c-board plds", ROMREGION_DISPOSE )
8106   ROM_REGION( 0x0200, "cboardplds", ROMREGION_DISPOSE )
81078107   ROM_LOAD( "ioc1.ic7",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
81088108   ROM_LOAD( "c632.ic1",     0x0000, 0x0117, CRC(0fbd9270) SHA1(d7e737b20c44d41e29ca94be56114b31934dde81) )
81098109ROM_END
r3232r3233
81418141   ROM_LOAD( "rcm_18.rom",    0x00000, 0x20000, CRC(80f1f8aa) SHA1(4a5b7b2a6941ad68da7472c63362c7bcd353fa54) )
81428142   ROM_LOAD( "rcm_19.rom",    0x20000, 0x20000, CRC(f257dbe1) SHA1(967def6b6f93039dbc46373caabeb3301577be75) )
81438143
8144   ROM_REGION( 0x0200, "a-board plds", ROMREGION_DISPOSE )
8144   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
81458145   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
81468146   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
81478147   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
81488148   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
81498149   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
81508150
8151   ROM_REGION( 0x0200, "b-board plds", ROMREGION_DISPOSE )
8151   ROM_REGION( 0x0200, "bboardplds", ROMREGION_DISPOSE )
81528152   ROM_LOAD( "rcm63b.1a",    0x0000, 0x0117, CRC(84acd494) SHA1(20c861714c8c68bc8cf3bde9d051969807e9b3a3) )
81538153   ROM_LOAD( "iob1.12d",     0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
81548154   ROM_LOAD( "bprg1.11d",    0x0000, 0x0117, CRC(31793da7) SHA1(400fa7ac517421c978c1ee7773c30b9ed0c5d3f3) )
81558155
8156   ROM_REGION( 0x0200, "c-board plds", ROMREGION_DISPOSE )
8156   ROM_REGION( 0x0200, "cboardplds", ROMREGION_DISPOSE )
81578157   ROM_LOAD( "ioc1.ic7",     0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
81588158   ROM_LOAD( "c632.ic1",     0x0000, 0x0117, CRC(0fbd9270) SHA1(d7e737b20c44d41e29ca94be56114b31934dde81) )
81598159ROM_END
src/mame/drivers/scobra.c
r3232r3233
403403ADDRESS_MAP_END
404404
405405
406static ADDRESS_MAP_START( scobra_sound_readport, ADDRESS_SPACE_IO, 8 )
406static ADDRESS_MAP_START( scobra_sound_io_map, ADDRESS_SPACE_IO, 8 )
407407   ADDRESS_MAP_GLOBAL_MASK(0xff)
408   AM_RANGE(0x20, 0x20) AM_READ(ay8910_read_port_0_r)
409   AM_RANGE(0x80, 0x80) AM_READ(ay8910_read_port_1_r)
410ADDRESS_MAP_END
411
412static ADDRESS_MAP_START( scobra_sound_writeport, ADDRESS_SPACE_IO, 8 )
413   ADDRESS_MAP_GLOBAL_MASK(0xff)
414408   AM_RANGE(0x10, 0x10) AM_WRITE(ay8910_control_port_0_w)
415   AM_RANGE(0x20, 0x20) AM_WRITE(ay8910_write_port_0_w)
409   AM_RANGE(0x20, 0x20) AM_READWRITE(ay8910_read_port_0_r, ay8910_write_port_0_w)
416410   AM_RANGE(0x40, 0x40) AM_WRITE(ay8910_control_port_1_w)
417   AM_RANGE(0x80, 0x80) AM_WRITE(ay8910_write_port_1_w)
411   AM_RANGE(0x80, 0x80) AM_READWRITE(ay8910_read_port_1_r, ay8910_write_port_1_w)
418412ADDRESS_MAP_END
419413
420414static ADDRESS_MAP_START( hustler_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
r3232r3233
428422    AM_RANGE(0x6000, 0x6fff) AM_WRITE(frogger_filter_w)
429423ADDRESS_MAP_END
430424
431
432static ADDRESS_MAP_START( hustler_sound_readport, ADDRESS_SPACE_IO, 8 )
425static ADDRESS_MAP_START( hustler_sound_io_map, ADDRESS_SPACE_IO, 8 )
433426   ADDRESS_MAP_GLOBAL_MASK(0xff)
434   AM_RANGE(0x40, 0x40) AM_READ(ay8910_read_port_0_r)
435ADDRESS_MAP_END
436
437static ADDRESS_MAP_START( hustler_sound_writeport, ADDRESS_SPACE_IO, 8 )
438   ADDRESS_MAP_GLOBAL_MASK(0xff)
439   AM_RANGE(0x40, 0x40) AM_WRITE(ay8910_write_port_0_w)
427   AM_RANGE(0x40, 0x40) AM_READWRITE(ay8910_read_port_0_r, ay8910_write_port_0_w)
440428   AM_RANGE(0x80, 0x80) AM_WRITE(ay8910_control_port_0_w)
441429ADDRESS_MAP_END
442430
443static ADDRESS_MAP_START( hustlerb_sound_readport, ADDRESS_SPACE_IO, 8 )
444   ADDRESS_MAP_GLOBAL_MASK(0xff)
445   AM_RANGE(0x80, 0x80) AM_READ(ay8910_read_port_0_r)
446ADDRESS_MAP_END
447431
448static ADDRESS_MAP_START( hustlerb_sound_writeport, ADDRESS_SPACE_IO, 8 )
432static ADDRESS_MAP_START( hustlerb_sound_io_map, ADDRESS_SPACE_IO, 8 )
449433   ADDRESS_MAP_GLOBAL_MASK(0xff)
450434   AM_RANGE(0x40, 0x40) AM_WRITE(ay8910_control_port_0_w)
451   AM_RANGE(0x80, 0x80) AM_WRITE(ay8910_write_port_0_w)
435   AM_RANGE(0x80, 0x80) AM_READWRITE(ay8910_read_port_0_r, ay8910_write_port_0_w)
452436ADDRESS_MAP_END
453437
454438static INPUT_PORTS_START( scobra )
r3232r3233
11031087
11041088   MDRV_CPU_ADD("audio", Z80,14318000/8)   /* 1.78975 MHz */
11051089   MDRV_CPU_PROGRAM_MAP(scobra_sound_readmem,scobra_sound_writemem)
1106   MDRV_CPU_IO_MAP(scobra_sound_readport,scobra_sound_writeport)
1090   MDRV_CPU_IO_MAP(scobra_sound_io_map,0)
11071091
11081092   MDRV_MACHINE_RESET(scramble)
11091093
r3232r3233
12411225
12421226   MDRV_CPU_ADD("audio",Z80,14318000/8)   /* 1.78975 MHz */
12431227   MDRV_CPU_PROGRAM_MAP(hustler_sound_readmem,hustler_sound_writemem)
1244   MDRV_CPU_IO_MAP(hustler_sound_readport,hustler_sound_writeport)
1228   MDRV_CPU_IO_MAP(hustler_sound_io_map,0)
12451229
12461230   MDRV_MACHINE_RESET(scramble)
12471231
r3232r3233
12841268
12851269   MDRV_CPU_MODIFY("audio")
12861270   MDRV_CPU_PROGRAM_MAP(scobra_sound_readmem,hustlerb_sound_writemem)
1287   MDRV_CPU_IO_MAP(hustlerb_sound_readport,hustlerb_sound_writeport)
1271   MDRV_CPU_IO_MAP(hustlerb_sound_io_map,0)
12881272MACHINE_DRIVER_END
12891273
12901274
r3232r3233
18001784GAME( 1981, hustlerb, hustler,  hustlerb, hustler,  scramble_ppi, ROT90,  "bootleg", "Video Hustler (bootleg)", GAME_SUPPORTS_SAVE )
18011785GAME( 198?, mimonkey, 0,      mimonkey, mimonkey,   mimonkey,     ROT90,  "Universal Video Games", "Mighty Monkey", GAME_SUPPORTS_SAVE )
18021786GAME( 198?, mimonsco, mimonkey, mimonkey, mimonsco, mimonsco,     ROT90,  "bootleg", "Mighty Monkey (bootleg on Super Cobra hardware)", GAME_SUPPORTS_SAVE )
1787
src/mame/drivers/lethalj.c
r3232r3233
5858Note 1: Some PCBs use a 11.2896MHz OSC instead of the 11.0592MHz
5959Note 2: Some PCBs use a TMS34010FNL-40 instead of the TMS34010FNL-50
6060
61                Egg Venture & Lethal Justice JAMMA Pinout
62
63                          Main Jamma Connector
64            Solder Side          |             Parts Side
65------------------------------------------------------------------
66             GND             | A | 1 |             GND
67             GND             | B | 2 |             GND
68             +5              | C | 3 |             +5
69             +5              | D | 4 |             +5
70             -5              | E | 5 |             -5
71             +12             | F | 6 |             +12
72------------ KEY ------------| H | 7 |------------ KEY -----------
73                             | J | 8 |      Coin Counter # 1
74                             | K | 9 |
75        L Speaker (-)        | L | 10|        L Speaker (+)
76        R Speaker (-)        | M | 11|        R Speaker (+)
77        Video Green          | N | 12|        Video Red
78        Video Sync           | P | 13|        Video Blue
79       Service Switch        | R | 14|        Video GND
80                             | S | 15|
81        Coin Switch 2        | T | 16|         Coin Switch 1
82       Start Player 2        | U | 17|        Start Player 1
83                             | V | 18|
84                             | W | 19|
85                             | X | 20|
86                             | Y | 21|
87                             | Z | 22|
88                             | a | 23|
89                             | b | 24|
90                             | c | 25|
91                             | d | 26|
92             GND             | e | 27|             GND
93             GND             | f | 28|             GND
94
95
96 Gun Connector Pinout
97
98   1| +5 Volts
99   2| Gun OPTO Player 1
100   3| Gun OPTO Player 2
101   4| NOT USED
102   5| Gun Trigger Player 1
103   6| NOT USED
104   7| Gun Trigger Player 2
105   8| KEY
106   9| Ground
107
108+5v and GND are wired to both player 1 & 2
109
110
111The Egg Venture/Lethal Justice PCB does NOT supply an amplified
112sound signal.  An external sound AMP is required
113
114Addition information for Sound & AMP hookup:
115
116                 Power AMP                 /|
117           +-------------------+          / |
118           |                   |   -------| | Right Speaker
119          [| Volume/Gain       |   |  ----| |
120           |                 R+|]--|  |   \ |
121          [| BASS            R-|]-----|    \|
122           |                   |
123          [| Treble          L+|]-----|    /|
124           |                 L-|]--|  |   / |
125           |                   |   |  ----| | Left Speaker
126Pin #L (-) |                   |   -------| |
127 --------->|\                  |          \ |
128Pin #10(+) | | L I             |           \|
129 --------->|/    N             |
130           |     P             |
131Pin #M (-) |     U             |
132 --------->|\    T             |
133Pin #11(+) | | R               |
134 --------->|/               RMT|]--|           +12 Volts
135           |                +12|]--+----------- To Power Source
136           |                GND|]--------------
137           +-------------------+               Ground
138
61139***************************************************************************/
62140
63141#include "driver.h"
r3232r3233
67145#include "sound/okim6295.h"
68146
69147
70#define MASTER_CLOCK      XTAL_40MHz
71#define SOUND_CLOCK         XTAL_2MHz
148#define MASTER_CLOCK            XTAL_40MHz
149#define SOUND_CLOCK             XTAL_2MHz
72150
73#define VIDEO_CLOCK         XTAL_11_289MHz
74#define VIDEO_CLOCK_LETHALJ   XTAL_11_0592MHz
151#define VIDEO_CLOCK             XTAL_11_289MHz
152#define VIDEO_CLOCK_LETHALJ     XTAL_11_0592MHz
75153
76154
77155
r3232r3233
174252   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
175253   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 )
176254   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN2 )
177   PORT_DIPNAME( 0x00c0, 0x0000, DEF_STR( Coinage ))
178   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ))
179   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ))
180   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ))
181   PORT_DIPSETTING(      0x00c0, DEF_STR( Free_Play ))
182   PORT_DIPNAME( 0x0300, 0x0100, DEF_STR( Lives ))
255   PORT_DIPNAME( 0x00c0, 0x0000, DEF_STR( Coinage ) )
256   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ) )
257   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ) )
258   PORT_DIPSETTING(      0x0080, DEF_STR( 1C_2C ) )
259   PORT_DIPSETTING(      0x00c0, DEF_STR( Free_Play ) )
260   PORT_DIPNAME( 0x0300, 0x0100, DEF_STR( Lives ) )
183261   PORT_DIPSETTING(      0x0000, "2" )
184262   PORT_DIPSETTING(      0x0100, "3" )
185263   PORT_DIPSETTING(      0x0200, "4" )
r3232r3233
229307   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
230308   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 )
231309   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN2 )
232   PORT_DIPNAME( 0x0070, 0x0000, DEF_STR( Coinage ))
233   PORT_DIPSETTING(      0x0040, DEF_STR( 8C_1C ))
234   PORT_DIPSETTING(      0x0030, DEF_STR( 4C_1C ))
235   PORT_DIPSETTING(      0x0020, DEF_STR( 3C_1C ))
236   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ))
237   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ))
238   PORT_DIPSETTING(      0x0050, DEF_STR( 1C_2C ))
239   PORT_DIPSETTING(      0x0060, DEF_STR( 1C_4C ))
240   PORT_DIPSETTING(      0x0070, DEF_STR( Free_Play ))
310   PORT_DIPNAME( 0x0070, 0x0000, DEF_STR( Coinage ) )
311   PORT_DIPSETTING(      0x0040, DEF_STR( 8C_1C ) )
312   PORT_DIPSETTING(      0x0030, DEF_STR( 4C_1C ) )
313   PORT_DIPSETTING(      0x0020, DEF_STR( 3C_1C ) )
314   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )
315   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ) )
316   PORT_DIPSETTING(      0x0050, DEF_STR( 1C_2C ) )
317   PORT_DIPSETTING(      0x0060, DEF_STR( 1C_4C ) )
318   PORT_DIPSETTING(      0x0070, DEF_STR( Free_Play ) )
241319   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
242320   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) // Verified Correct
243321   PORT_DIPSETTING(      0x0000, "3" )
r3232r3233
283361   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
284362   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 )
285363   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN2 )
286   PORT_DIPNAME( 0x0070, 0x0000, DEF_STR( Coinage ))
287   PORT_DIPSETTING(      0x0040, DEF_STR( 8C_1C ))
288   PORT_DIPSETTING(      0x0030, DEF_STR( 4C_1C ))
289   PORT_DIPSETTING(      0x0020, DEF_STR( 3C_1C ))
290   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ))
291   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ))
292   PORT_DIPSETTING(      0x0050, DEF_STR( 1C_2C ))
293   PORT_DIPSETTING(      0x0060, DEF_STR( 1C_4C ))
294   PORT_DIPSETTING(      0x0070, DEF_STR( Free_Play ))
364   PORT_DIPNAME( 0x0070, 0x0000, DEF_STR( Coinage ) )
365   PORT_DIPSETTING(      0x0040, DEF_STR( 8C_1C ) )
366   PORT_DIPSETTING(      0x0030, DEF_STR( 4C_1C ) )
367   PORT_DIPSETTING(      0x0020, DEF_STR( 3C_1C ) )
368   PORT_DIPSETTING(      0x0010, DEF_STR( 2C_1C ) )
369   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ) )
370   PORT_DIPSETTING(      0x0050, DEF_STR( 1C_2C ) )
371   PORT_DIPSETTING(      0x0060, DEF_STR( 1C_4C ) )
372   PORT_DIPSETTING(      0x0070, DEF_STR( Free_Play ) )
295373   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
296374   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Lives ) ) // Verified Correct
297375   PORT_DIPSETTING(      0x0000, "3" )
r3232r3233
346424   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
347425   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
348426   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
349   PORT_DIPNAME( 0x00c0, 0x0000, DEF_STR( Coinage ))
350   PORT_DIPSETTING(      0x0080, DEF_STR( 3C_1C ))
351   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ))
352   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ))
353   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ))
427   PORT_DIPNAME( 0x00c0, 0x0000, DEF_STR( Coinage ) )
428   PORT_DIPSETTING(      0x0080, DEF_STR( 3C_1C ) )
429   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ) )
430   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ) )
431   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ) )
354432   PORT_DIPNAME( 0x0700, 0x0200, "Starting Jackpot" )
355433   PORT_DIPSETTING(      0x0000, "0" )
356434   PORT_DIPSETTING(      0x0100, "5" )
r3232r3233
383461   PORT_SERVICE_NO_TOGGLE( 0x0002, IP_ACTIVE_HIGH )
384462   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 )
385463   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
386    PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
387    PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
388    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
389    PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
390    PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
391    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
392   PORT_DIPNAME( 0x00c0, 0x0000, DEF_STR( Coinage ))
393   PORT_DIPSETTING(      0x0080, DEF_STR( 3C_1C ))
394   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ))
395   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ))
396   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ))
397    PORT_DIPNAME( 0x0700, 0x0300, "Starting Jackpot" )
398    PORT_DIPSETTING(      0x0000, "0" )
399    PORT_DIPSETTING(      0x0100, "5" )
400    PORT_DIPSETTING(      0x0200, "8" )
401    PORT_DIPSETTING(      0x0300, "10" )
402    PORT_DIPSETTING(      0x0400, "12" )
403    PORT_DIPSETTING(      0x0500, "15" )
404    PORT_DIPSETTING(      0x0600, "18" )
405    PORT_DIPSETTING(      0x0700, "20" )
406    PORT_DIPNAME( 0x1800, 0x1800, DEF_STR( Unknown ) )
407    PORT_DIPSETTING(      0x0000, "0" )
408    PORT_DIPSETTING(      0x0800, "1" )
409    PORT_DIPSETTING(      0x1000, "2" )
410    PORT_DIPSETTING(      0x1800, "3" )
411    PORT_DIPNAME( 0xe000, 0x8000, "Eggs per Ticket" )
412    PORT_DIPSETTING(      0xe000, "1" )
413    PORT_DIPSETTING(      0xc000, "2" )
414    PORT_DIPSETTING(      0xa000, "3" )
415    PORT_DIPSETTING(      0x8000, "4" )
416    PORT_DIPSETTING(      0x6000, "5" )
417    PORT_DIPSETTING(      0x4000, "6" )
418    PORT_DIPSETTING(      0x2000, "8" )
419    PORT_DIPSETTING(      0x0000, "10" )
464   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
465   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
466   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
467   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
468   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
469   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
470   PORT_DIPNAME( 0x00c0, 0x0000, DEF_STR( Coinage ) )
471   PORT_DIPSETTING(      0x0080, DEF_STR( 3C_1C ) )
472   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ) )
473   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ) )
474   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ) )
475   PORT_DIPNAME( 0x0700, 0x0300, "Starting Jackpot" )
476   PORT_DIPSETTING(      0x0000, "0" )
477   PORT_DIPSETTING(      0x0100, "5" )
478   PORT_DIPSETTING(      0x0200, "8" )
479   PORT_DIPSETTING(      0x0300, "10" )
480   PORT_DIPSETTING(      0x0400, "12" )
481   PORT_DIPSETTING(      0x0500, "15" )
482   PORT_DIPSETTING(      0x0600, "18" )
483   PORT_DIPSETTING(      0x0700, "20" )
484   PORT_DIPNAME( 0x1800, 0x1800, DEF_STR( Unknown ) )
485   PORT_DIPSETTING(      0x0000, "0" )
486   PORT_DIPSETTING(      0x0800, "1" )
487   PORT_DIPSETTING(      0x1000, "2" )
488   PORT_DIPSETTING(      0x1800, "3" )
489   PORT_DIPNAME( 0xe000, 0x8000, "Eggs per Ticket" )
490   PORT_DIPSETTING(      0xe000, "1" )
491   PORT_DIPSETTING(      0xc000, "2" )
492   PORT_DIPSETTING(      0xa000, "3" )
493   PORT_DIPSETTING(      0x8000, "4" )
494   PORT_DIPSETTING(      0x6000, "5" )
495   PORT_DIPSETTING(      0x4000, "6" )
496   PORT_DIPSETTING(      0x2000, "8" )
497   PORT_DIPSETTING(      0x0000, "10" )
420498
421499   PORT_START("IN1")
422500   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(ticket_status, NULL)
r3232r3233
434512   PORT_SERVICE_NO_TOGGLE( 0x0002, IP_ACTIVE_HIGH )
435513   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 )
436514   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
437    PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
438    PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
439    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
440    PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
441    PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
442    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
443   PORT_DIPNAME( 0x00c0, 0x0000, DEF_STR( Coinage ))
444   PORT_DIPSETTING(      0x0080, DEF_STR( 3C_1C ))
445   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ))
446   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ))
447   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ))
448    PORT_DIPNAME( 0x0700, 0x0700, "Starting Jackpot" )
449    PORT_DIPSETTING(      0x0000, "0" )
450    PORT_DIPSETTING(      0x0100, "2" )
451    PORT_DIPSETTING(      0x0200, "5" )
452    PORT_DIPSETTING(      0x0300, "8" )
453    PORT_DIPSETTING(      0x0400, "10" )
454    PORT_DIPSETTING(      0x0500, "15" )
455    PORT_DIPSETTING(      0x0600, "20" )
456    PORT_DIPSETTING(      0x0700, "30" )
457    PORT_DIPNAME( 0x1800, 0x1800, DEF_STR( Unknown ) )
458    PORT_DIPSETTING(      0x0000, "0" )
459    PORT_DIPSETTING(      0x0800, "1" )
460    PORT_DIPSETTING(      0x1000, "2" )
461    PORT_DIPSETTING(      0x1800, "3" )
462    PORT_DIPNAME( 0xe000, 0x8000, "Points per Ticket" )
463    PORT_DIPSETTING(      0xe000, "700" )
464    PORT_DIPSETTING(      0xc000, "900" )
465    PORT_DIPSETTING(      0xa000, "1200" )
466    PORT_DIPSETTING(      0x8000, "1500" )
467    PORT_DIPSETTING(      0x6000, "1800" )
468    PORT_DIPSETTING(      0x4000, "2100" )
469    PORT_DIPSETTING(      0x2000, "2400" )
470    PORT_DIPSETTING(      0x0000, "3000" )
515   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
516   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
517   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
518   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
519   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
520   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
521   PORT_DIPNAME( 0x00c0, 0x0000, DEF_STR( Coinage ) )
522   PORT_DIPSETTING(      0x0080, DEF_STR( 3C_1C ) )
523   PORT_DIPSETTING(      0x0040, DEF_STR( 2C_1C ) )
524   PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ) )
525   PORT_DIPSETTING(      0x00c0, DEF_STR( 1C_2C ) )
526   PORT_DIPNAME( 0x0700, 0x0700, "Starting Jackpot" )
527   PORT_DIPSETTING(      0x0000, "0" )
528   PORT_DIPSETTING(      0x0100, "2" )
529   PORT_DIPSETTING(      0x0200, "5" )
530   PORT_DIPSETTING(      0x0300, "8" )
531   PORT_DIPSETTING(      0x0400, "10" )
532   PORT_DIPSETTING(      0x0500, "15" )
533   PORT_DIPSETTING(      0x0600, "20" )
534   PORT_DIPSETTING(      0x0700, "30" )
535   PORT_DIPNAME( 0x1800, 0x1800, DEF_STR( Unknown ) )
536   PORT_DIPSETTING(      0x0000, "0" )
537   PORT_DIPSETTING(      0x0800, "1" )
538   PORT_DIPSETTING(      0x1800, "3" )
539   PORT_DIPNAME( 0xe000, 0x8000, "Points per Ticket" )
540   PORT_DIPSETTING(      0xe000, "700" )
541   PORT_DIPSETTING(      0xc000, "900" )
542   PORT_DIPSETTING(      0xa000, "1200" )
543   PORT_DIPSETTING(      0x8000, "1500" )
544   PORT_DIPSETTING(      0x6000, "1800" )
545   PORT_DIPSETTING(      0x4000, "2100" )
546   PORT_DIPSETTING(      0x2000, "2400" )
547   PORT_DIPSETTING(      0x0000, "3000" )
471548
472549   PORT_START("IN1")
473550   PORT_BIT( 0x0f0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(cclownz_paddle, NULL)
r3232r3233
590667   ROM_LOAD( "sound1.u20", 0x00000, 0x40000, CRC(7d93ca66) SHA1(9e1dc0efa5d0f770c7e1f10de56fbf5620dea437) )
591668
592669   ROM_REGION( 0x40000, "oki2", 0 )            /* sound data */
593   ROM_LOAD( "sound1.u21",    0x00000, 0x40000, CRC(7d3beae0) SHA1(5ec753c5fd5ca0f9492c9e274703a1aa758062a7) )
670   ROM_LOAD( "sound1.u21", 0x00000, 0x40000, CRC(7d3beae0) SHA1(5ec753c5fd5ca0f9492c9e274703a1aa758062a7) )
594671
595672   ROM_REGION( 0x40000, "oki3", 0 )            /* sound data */
596673   ROM_LOAD( "sound1.u18", 0x00000, 0x40000, CRC(7d93ca66) SHA1(9e1dc0efa5d0f770c7e1f10de56fbf5620dea437) )
src/mame/drivers/bbusters.c
r3232r3233
260260
261261static READ16_HANDLER( control_3_r )
262262{
263   static const char *port[] = { "GUNX1", "GUNY1", "GUNX2", "GUNY2", "GUNX3", "GUNY3" };
263   static const char *const port[] = { "GUNX1", "GUNY1", "GUNX2", "GUNY2", "GUNX3", "GUNY3" };
264264
265265   return input_port_read(machine, port[gun_select]);
266266}
src/mame/drivers/snk.c
r3232r3233
44
55various SNK triple Z80 games
66
7ay8910x2 + "SNK wave"
8Marvin's Maze, Vanguard II, Mad Crasher
9
710ay8910x2
811Jumping Cross, Gladiator 1984, HAL21
912
r3232r3233
6770- the I/O area (C000-CFFF) is probably mirrored in large part on the two main
6871  CPUs, however I mapped only the addresses actually used by the games.
6972
73- marvins: the fg and bg tilemaps are set to be 512x256 like in madcrash and
74  vangrd2, but they could be 256x256.
75
7076- the Flip Screen dip switch in madcrash doesn't work correctly, the screen is
7177  inverted but the bg and sprite positions are wrong. This is a bug in the game;
7278  the Cocktail dip switch works correctly and the screen is properly flipped
r3232r3233
712718{
713719   static int last_value[2] = {0, 0};
714720   static int cp_count[2] = {0, 0};
715   static const char *ports[] = { "P1ROT", "P2ROT" };
721   static const char *const ports[] = { "P1ROT", "P2ROT" };
716722   int which = (int)(FPTR)param;
717723   int value = input_port_read(field->port->machine, ports[which]);
718724
r3232r3233
15221528static INPUT_PORTS_START( vangrd2 )
15231529   PORT_START("IN0")
15241530   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1525   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1526   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1531   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
1532   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_UNKNOWN )
15271533   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START1 )
15281534   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_START2 )
15291535   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(marvins_sound_busy, NULL) /* sound CPU status */
r3232r3233
16071613   PORT_START("IN0")
16081614   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
16091615   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1610   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 )
1616   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
16111617   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START1 )
16121618   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_START2 )
16131619   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(marvins_sound_busy, NULL) /* sound CPU status */
r3232r3233
16691675   PORT_DIPNAME( 0x18, 0x10, "Game mode" )               PORT_DIPLOCATION("DSW2:4,5")
16701676   PORT_DIPSETTING(    0x18, "Demo Sounds Off" )
16711677   PORT_DIPSETTING(    0x10, "Demo Sounds On" )
1678   PORT_DIPSETTING(    0x00, "Freeze" )
16721679   PORT_DIPSETTING(    0x08, "Infinite Lives (Cheat)")
1673   PORT_DIPSETTING(    0x00, "Freeze" )
16741680   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )      PORT_DIPLOCATION("DSW2:6")
16751681   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
16761682   PORT_DIPSETTING(    0x00, DEF_STR( On ) )            /* Check the "Non Bugs" page */
r3232r3233
16831689
16841690static INPUT_PORTS_START( jcross )
16851691   PORT_START("IN0")
1686   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1687   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1688   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1689   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
1690   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
1692   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_COIN1 )
1693   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
1694   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_UNKNOWN )
1695   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START1 )
1696   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_START2 )
16911697   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
1692   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1693   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1698   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNKNOWN )
1699   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
16941700
16951701   PORT_START("IN1")
16961702   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_8WAY
r3232r3233
17681774
17691775static INPUT_PORTS_START( sgladiat )
17701776   PORT_START("IN0")
1771   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1772   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1773   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1774   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
1775   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
1777   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1778   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
1779   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
1780   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START1 )
1781   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_START2 )
17761782   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
1777   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1778   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE )            /* code at 0x054e */
1783   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNKNOWN )
1784   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_SERVICE )            /* code at 0x054e */
17791785
17801786   PORT_START("IN1")
17811787   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_8WAY
r3232r3233
18521858
18531859static INPUT_PORTS_START( hal21 )
18541860   PORT_START("IN0")
1855   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1856   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1857   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1858   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
1859   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
1861   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1862   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
1863   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
1864   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START1 )
1865   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_START2 )
18601866   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
1861   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1862   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1867   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNKNOWN )
1868   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
18631869
18641870   PORT_START("IN1")
18651871   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_8WAY PORT_PLAYER(1)
r3232r3233
19351941
19361942static INPUT_PORTS_START( aso )
19371943   PORT_START("IN0")
1938   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1939   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1940   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )           /* uses "Coinage" settings - code at 0x2e04 */
1941   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
1942   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
1944   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1945   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
1946   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )           /* uses "Coinage" settings - code at 0x2e04 */
1947   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START1 )
1948   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_START2 )
19431949   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
1944   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1945   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1950   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNKNOWN )
1951   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
19461952
19471953   PORT_START("IN1")
19481954   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_8WAY
r3232r3233
20222028
20232029static INPUT_PORTS_START( alphamis )
20242030   PORT_START("IN0")
2025   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
2026   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
2027   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )           /* uses "Coin A" settings - code at 0x2e17 */
2028   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
2029   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
2031   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
2032   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
2033   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )           /* uses "Coin A" settings - code at 0x2e17 */
2034   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START1 )
2035   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_START2 )
20302036   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
2031   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
2032   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
2037   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2038   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
20332039
20342040   PORT_START("IN1")
20352041   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_8WAY
r3232r3233
21042110
21052111static INPUT_PORTS_START( tnk3 )
21062112   PORT_START("IN0")
2107   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
2108   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
2109   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
2110   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
2111   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
2113   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
2114   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2115   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
2116   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START1 )
2117   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_START2 )
21122118   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
2113   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
2114   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
2119   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2120   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
21152121
21162122   PORT_START("IN1")
21172123   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_8WAY
r3232r3233
21942200static INPUT_PORTS_START( athena )
21952201   PORT_START("IN0")
21962202   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
2197   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )           /* uses "Coin A" settings - code at 0x09d4 */
2198   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
2199   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2200   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
2201   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
2202   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
2203   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
2203   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )           /* uses "Coin A" settings - code at 0x09d4 */
2204   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2205   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2206   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )
2207   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
2208   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START2 )
2209   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_START1 )
22042210
22052211   PORT_START("IN1")
22062212   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_8WAY
r3232r3233
22792285static INPUT_PORTS_START( fitegolf )
22802286   PORT_START("IN0")
22812287   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
2282   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )           /* uses "Coin A" settings - code at 0x045b */
2283   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )               /* reset */
2284   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE )           /* same as the dip switch */
2285   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
2286   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
2287   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
2288   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
2288   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )           /* uses "Coin A" settings - code at 0x045b */
2289   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_TILT )               /* reset */
2290   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_SERVICE )           /* same as the dip switch */
2291   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )
2292   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
2293   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START2 )
2294   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_START1 )
22892295
22902296   PORT_START("IN1")
22912297   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_8WAY PORT_PLAYER(1)
r3232r3233
23642370static INPUT_PORTS_START( countryc )
23652371   PORT_START("IN0")
23662372   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
2367   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )           /* uses "Coin A" settings - code at 0x0450 */
2368   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )               /* reset */
2369   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE )           /* same as the dip switch */
2370   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
2371   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
2372   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
2373   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
2373   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )           /* uses "Coin A" settings - code at 0x0450 */
2374   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_TILT )               /* reset */
2375   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_SERVICE )           /* same as the dip switch */
2376   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )
2377   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
2378   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START2 )
2379   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_START1 )
23742380
23752381   PORT_START("IN1")
23762382   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(countryc_trackball_x, 0)
r3232r3233
24462452static INPUT_PORTS_START( ikari )
24472453   PORT_START("IN0")
24482454   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
2449   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
2450   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
2451   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2452   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
2453   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
2454   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
2455   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
2455   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
2456   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2457   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2458   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )
2459   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
2460   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START2 )
2461   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_START1 )
24562462
24572463   PORT_START("IN1")
24582464   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
r3232r3233
25332539   // non-JAMMA system inputs
25342540
25352541   PORT_MODIFY("IN0")
2536   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
2537   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
2538   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
2539   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
2540   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
2542   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
2543   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
2544   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
2545   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_START1 )
2546   PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_START2 )
25412547   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
2542   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
2543   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_TILT )  /* reset */
2548   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2549   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_TILT )  /* reset */
25442550INPUT_PORTS_END
25452551
25462552
r3232r3233
25802586static INPUT_PORTS_START( victroad )
25812587   PORT_START("IN0")
25822588   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
2583   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
2584   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )  /* reset */
2585   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2586   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
2587   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
2588   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
2589   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
2589   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
2590   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_TILT )  /* reset */
2591   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2592   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )
2593   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
2594   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START2 )
2595   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_START1 )
25902596
25912597   PORT_START("IN1")
25922598   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
r3232r3233
26822688static INPUT_PORTS_START( bermudat )
26832689   PORT_START("IN0")
26842690   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
2685   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
2686   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* tilt? */
2687   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2688   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
2689   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
2690   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
2691   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
2691   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
2692   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_TILT ) /* tilt? */
2693   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2694   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )
2695   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
2696   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START2 )
2697   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_START1 )
26922698
26932699   PORT_START("IN1")
26942700   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
r3232r3233
28032809static INPUT_PORTS_START( gwar )
28042810   PORT_START("IN0")
28052811   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
2806   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
2807   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )   /* tilt? causes reset */
2808   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE )
2809   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
2810   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
2811   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
2812   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
2812   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
2813   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_TILT )   /* tilt? causes reset */
2814   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_SERVICE )
2815   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )
2816   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
2817   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START2 )
2818   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_START1 )
28132819
28142820   PORT_START("IN1")
28152821   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
r3232r3233
29072913static INPUT_PORTS_START( psychos )
29082914   PORT_START("IN0")
29092915   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
2910   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
2911   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )  /* reset */
2912   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2913   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
2914   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
2915   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
2916   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
2916   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2917   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_TILT )  /* reset */
2918   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN )
2919   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )
2920   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
2921   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START2 )
2922   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_START1 )
29172923
29182924   PORT_START("IN1")
29192925   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
r3232r3233
29892995static INPUT_PORTS_START( chopper )
29902996   PORT_START("IN0")
29912997   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
2992   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
2993   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )  /* Reset */
2994   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE )
2995   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
2996   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
2997   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
2998   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
2998   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
2999   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_TILT )  /* Reset */
3000   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_SERVICE )
3001   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 )
3002   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
3003   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START2 )
3004   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_START1 )
29993005
30003006   PORT_START("IN1")
30013007   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
r3232r3233
31013107
31023108static INPUT_PORTS_START( tdfever )
31033109   PORT_START("IN0")
3104   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
3105   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE )
3106   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
3110   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_UNKNOWN )
3111   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_SERVICE )
3112   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
31073113   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
3108   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
3109   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
3110   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start Game A")
3111   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Start Game B")
3114   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN1 )
3115   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
3116   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START1 ) PORT_NAME("Start Game A")
3117   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_START2 ) PORT_NAME("Start Game B")
31123118
31133119   PORT_START("IN1")
31143120   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
r3232r3233
32423248
32433249static INPUT_PORTS_START( fsoccer )
32443250   PORT_START("IN0")
3245   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
3246   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE )   // same as the dip switch
3247   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
3251   PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_UNKNOWN )
3252   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_SERVICE )   // same as the dip switch
3253   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 )
32483254   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snk_sound_busy, 0)
3249   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
3250   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
3251   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start Game A")
3252   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Start Game B")
3255   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN1 )
3256   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
3257   PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START1 ) PORT_NAME("Start Game A")
3258   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_START2 ) PORT_NAME("Start Game B")
32533259
32543260   PORT_START("IN1")
32553261   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
src/mame/drivers/dgpix.c
r3232r3233
5656
5757static int flash_roms;
5858static UINT32 flash_cmd = 0;
59static INT32 first_offset;
5960
6061static READ32_HANDLER( flash_r )
6162{
r3232r3233
9091
9192static WRITE32_HANDLER( flash_w )
9293{
93   static INT32 first_offset = -1;
94
9594   if(flash_cmd == 0x20200000)
9695   {
9796      // erase game settings
r3232r3233
295294   return 0;
296295}
297296
297static MACHINE_RESET( dgpix )
298{
299   vbuffer = 0;
300   flash_cmd = 0;
301   first_offset = -1;
302}
303
304
298305static MACHINE_DRIVER_START( dgpix )
299306   MDRV_CPU_ADD("main", E132XT, 20000000*4)   /* 4x internal multiplier */
300307   MDRV_CPU_PROGRAM_MAP(cpu_map,0)
r3232r3233
305312    running at 16.9MHz
306313*/
307314
315   MDRV_MACHINE_RESET(dgpix)
308316   MDRV_NVRAM_HANDLER(flashroms)
309317
310318   /* video hardware */
src/mame/drivers/cosmic.c
r3232r3233
263263   return pixel_clock;
264264}
265265
266static CUSTOM_INPUT( crtc_r )
266static READ8_HANDLER( cosmicg_port_0_r )
267267{
268268   /* The top four address lines from the CRTC are bits 0-3 */
269   return (video_screen_get_vpos(field->port->machine->primary_screen) & 0xf0) >> 4;
269
270   return (input_port_read(machine, "IN0") & 0xf0) | ((video_screen_get_vpos(machine->primary_screen) & 0xf0) >> 4);
270271}
271272
272273static READ8_HANDLER( magspot_coinage_dip_r )
r3232r3233
357358   AM_RANGE(0x2000, 0x3fff) AM_WRITE(SMH_RAM) AM_BASE(&videoram) AM_SIZE(&videoram_size)
358359ADDRESS_MAP_END
359360
360static ADDRESS_MAP_START( cosmicg_readport, ADDRESS_SPACE_IO, 8 )
361   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
361static ADDRESS_MAP_START( cosmicg_io_map, ADDRESS_SPACE_IO, 8 )
362   AM_RANGE(0x00, 0x00) AM_READ(cosmicg_port_0_r)
362363   AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1")
363ADDRESS_MAP_END
364
365static ADDRESS_MAP_START( cosmicg_writeport, ADDRESS_SPACE_IO, 8 )
366364   AM_RANGE(0x00, 0x15) AM_WRITE(cosmicg_output_w)
367365   AM_RANGE(0x16, 0x17) AM_WRITE(cosmic_color_register_w)
368366ADDRESS_MAP_END
r3232r3233
503501
504502static INPUT_PORTS_START( cosmicg )
505503   PORT_START("IN0")   /* 4-7 */
506   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(crtc_r, NULL)   /* pixel clock */
504   PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_SPECIAL )   /* pixel clock */
507505   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
508506   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
509507   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 )
r3232r3233
966964            fed to the tms9904 or tms9980.  Also, I have never heard of a tms9900/9980 operating under
967965            1.5MHz.  So, if someone can check this... */
968966   MDRV_CPU_PROGRAM_MAP(cosmicg_readmem,cosmicg_writemem)
969   MDRV_CPU_IO_MAP(cosmicg_readport,cosmicg_writeport)
967   MDRV_CPU_IO_MAP(cosmicg_io_map,0)
970968   MDRV_CPU_VBLANK_INT("main", cosmicg_interrupt)
971969
972970   /* video hardware */
r3232r3233
14211419GAME( 1980, panicger, panic,   panic,    panic,    0,       ROT270, "Universal (ADP Automaten license)", "Space Panic (German)", 0 )
14221420GAME( 1980, devzone,  0,       devzone,  devzone,  devzone, ROT270, "Universal", "Devil Zone", GAME_IMPERFECT_SOUND )
14231421GAME( 1980, devzone2, devzone, devzone,  devzone2, devzone, ROT270, "Universal", "Devil Zone (easier)", GAME_IMPERFECT_SOUND )
1422
src/mame/drivers/model2.c
r3232r3233
473473   UINT32 iptval=0x00ff;
474474   if(analog_channel<4)
475475   {
476      static const char *ports[] = { "ANA0", "ANA1", "ANA2", "ANA3" };
476      static const char *const ports[] = { "ANA0", "ANA1", "ANA2", "ANA3" };
477477      iptval=input_port_read_safe(machine, ports[analog_channel], 0);
478478      ++analog_channel;
479479   }
src/mame/drivers/wiping.c
r3232r3233
7474static READ8_HANDLER( ports_r )
7575{
7676   int i,res;
77   static const char *port[] = { "P1", "P2", "IN2", "IN3", "IN4", "IN5", "SYSTEM", "DSW" };
77   static const char *const portnames[] = { "P1", "P2", "IN2", "IN3", "IN4", "IN5", "SYSTEM", "DSW" };
7878
7979   res = 0;
8080   for (i = 0; i < 8; i++)
81      res |= ((input_port_read(machine, port[i]) >> offset) & 1) << i;
81      res |= ((input_port_read(machine, portnames[i]) >> offset) & 1) << i;
8282
8383   return res;
8484}
src/mame/drivers/compgolf.c
r3232r3233
2222extern VIDEO_START  ( compgolf );
2323extern VIDEO_UPDATE ( compgolf );
2424
25static int bank;
26
2527static WRITE8_HANDLER( compgolf_scrollx_lo_w )
2628{
2729   compgolf_scrollx_lo = data;
r3232r3233
3638{
3739   /* bit 4 and 6 are always set */
3840
39   static int bank = -1;
4041   int new_bank = (data & 4) >> 2;
4142
4243   if( bank != new_bank )
r3232r3233
304305
305306static DRIVER_INIT( compgolf )
306307{
308   bank = -1;
307309   compgolf_expand_bg(machine);
308310}
309311
src/mame/drivers/tiamc1.c
r3232r3233
297297   /* sound hardware */
298298   MDRV_SPEAKER_STANDARD_MONO("mono")
299299
300   MDRV_SOUND_ADD("2 x 8253", CUSTOM, 16000000/9)
300   MDRV_SOUND_ADD("2x8253", CUSTOM, 16000000/9)
301301   MDRV_SOUND_CONFIG(tiamc1_custom_interface)
302302   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
303303MACHINE_DRIVER_END
src/mame/drivers/segag80r.c
r3232r3233
14061406 *
14071407 *************************************/
14081408
1409static void monsterb_expand_gfx(const char *region)
1409static void monsterb_expand_gfx(running_machine *machine, const char *region)
14101410{
14111411   UINT8 *temp, *dest;
14121412   int i;
14131413
14141414   /* expand the background ROMs; A11/A12 of each ROM is independently controlled via */
14151415   /* banking */
1416   dest = memory_region(Machine, region);
1416   dest = memory_region(machine, region);
14171417   temp = malloc_or_die(0x4000);
14181418   memcpy(temp, dest, 0x4000);
14191419
r3232r3233
14881488
14891489   /* configure video */
14901490   segag80r_background_pcb = G80_BACKGROUND_MONSTERB;
1491   monsterb_expand_gfx("gfx1");
1491   monsterb_expand_gfx(machine, "gfx1");
14921492
14931493   /* install background board handlers */
14941494   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0xb8, 0xbd, 0, 0, monsterb_back_port_w);
r3232r3233
15041504
15051505   /* configure video */
15061506   segag80r_background_pcb = G80_BACKGROUND_PIGNEWT;
1507   monsterb_expand_gfx("gfx1");
1507   monsterb_expand_gfx(machine, "gfx1");
15081508
15091509   /* install background board handlers */
15101510   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0xb4, 0xb5, 0, 0, pignewt_back_color_w);
r3232r3233
15201520
15211521   /* configure video */
15221522   segag80r_background_pcb = G80_BACKGROUND_PIGNEWT;
1523   monsterb_expand_gfx("gfx1");
1523   monsterb_expand_gfx(machine, "gfx1");
15241524
15251525   /* install background board handlers */
15261526   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0xb4, 0xb5, 0, 0, pignewt_back_color_w);
src/mame/drivers/magic10.c
r3232r3233
99
1010    Supported games:
1111
12    Magic's 10 (ver. 16.15)    (c) 1995 AWP Games
13    Magic's 10 (ver. 16.45)    (c) 1995 AWP Games
14    Magic's 10 (ver. 16.55)    (c) 1995 AWP Games
15    Magic's 10 2               (c) 1997 ABM Games
16    Super Pool (9743 rev.01)   (c) 1997 ABM Games
17    Hot Slot (ver. 05.01)      (c) 1996 ABM Electronics
18    Magic Colors (ver. 1.7a)       1999 Unknown
12    Magic's 10 (ver. 16.15),       1995, AWP Games.
13    Magic's 10 (ver. 16.45),       1995, AWP Games.
14    Magic's 10 (ver. 16.55),       1995, AWP Games.
15    Magic's 10 2,                  1997, ABM Games.
16    Super Pool (9743 rev.01),      1997, ABM Games.
17    Hot Slot (ver. 05.01),         1996, ABM Electronics.
18    Magic Colors (ver. 1.7a),      1999, Unknown.
19    Super Gran Safari (ver 3.11),  1996, New Impeuropex Corp.
1920
2021
2122*****************************************************************************
2223
2324
24    Magic's 10 instruction for the 1st boot:
25    Game Notes
26    ==========
2527
28
29    * Magic's 10
30
31    First time boot instructions:
32
2633    - Switch "Disable Free Play" to ON
2734    - Enter a coin
2835    - Press Collect to get the 1st game over
2936
3037
38
39    * Super Gran Safari
40
41    There is a input sequence to initialize the game.
42
43    The code expects a mask of 0x4c00 in the DIP switches port to allow
44    enter the sequence, so DIP switches must be on default position.
45
46    When you see the black screen, enter the following sequence:
47    HOLD 4 (key V), HOLD 2 (key X), HOLD 5 (key B), START (key 1).
48
49    The code is checking for a 5th entry. In fact expects HOLD 3 as the first
50    entry, then the rest listed above. I don't know why bypass the first one.
51    Input port bits are checked in the following order: 2, 3, 1, 4, 5.
52
53    The player can play the "Super Game" to grab the points.
54    In this subgame, you must to hit the lion to get the prize.
55    For now, you must miss the shot till hopper & ticket dispenser are properly emulated.
56
57
58*****************************************************************************
59
60
3161    TODO:
3262
33    - ticket / coin dispenser
34    - some unknown writes
35    - finish magic10_2 (association coin - credits handling its inputs
63    - Ticket / Hopper support.
64    - Some unknown writes
65    - Finish magic10_2 (association coin - credits handling its inputs
3666      and some reads that drive the note displayed?)
37    - protection (suprpool, hotslot, mcolors)
67    - protection (magic102, suprpool, hotslot, mcolors).
3868
3969
4070****************************************************************************/
r3232r3233
4272
4373#include "driver.h"
4474#include "sound/okim6295.h"
75#include "sgsafari.lh"
4576
4677static tilemap *layer0_tilemap, *layer1_tilemap, *layer2_tilemap;
4778static UINT16 *layer0_videoram, *layer1_videoram, *layer2_videoram;
4879static int layer2_offset[2];
4980
81
82/***************************
83*      Video Hardware      *
84***************************/
85
5086static WRITE16_HANDLER( layer0_videoram_w )
5187{
5288   COMBINE_DATA(&layer0_videoram[offset]);
53   tilemap_mark_tile_dirty(layer0_tilemap,offset>>1);
89   tilemap_mark_tile_dirty( layer0_tilemap, offset >> 1);
5490}
5591
5692static WRITE16_HANDLER( layer1_videoram_w )
5793{
5894   COMBINE_DATA(&layer1_videoram[offset]);
59   tilemap_mark_tile_dirty(layer1_tilemap,offset>>1);
95   tilemap_mark_tile_dirty( layer1_tilemap, offset >> 1);
6096}
6197
6298static WRITE16_HANDLER( layer2_videoram_w )
6399{
64100   COMBINE_DATA(&layer2_videoram[offset]);
65   tilemap_mark_tile_dirty(layer2_tilemap,offset>>1);
101   tilemap_mark_tile_dirty( layer2_tilemap, offset >> 1);
66102}
67103
68104static WRITE16_HANDLER( paletteram_w )
r3232r3233
71107   palette_set_color_rgb( machine, offset, pal4bit(data >> 4), pal4bit(data >> 0), pal4bit(data >> 8));
72108}
73109
74static WRITE16_HANDLER( magic10_misc_w )
110
111static TILE_GET_INFO( get_layer0_tile_info )
75112{
76/*
77    lamps:
78    1 -> data & 0x01
79    2 -> data & 0x02
80    3 -> data & 0x04
81    4 -> data & 0x08
82    5 -> data & 0x10
83    6 -> data & 0x20
84    7 -> data & 0x40
85*/
113   SET_TILE_INFO
114   (
115      1,
116      layer0_videoram[tile_index * 2],
117      layer0_videoram[tile_index * 2 + 1] & 0x0f,
118      TILE_FLIPYX((layer0_videoram[tile_index * 2 + 1] & 0xc0) >> 6)
119   );
120}
86121
87/*
88    data & 0x0180 toggles
89    data & 0x2000 ? written with 0x400 when coin1 is inserted
90*/
122static TILE_GET_INFO( get_layer1_tile_info )
123{
124   SET_TILE_INFO
125   (
126      1,
127      layer1_videoram[tile_index * 2],
128      layer1_videoram[tile_index * 2 + 1] & 0x0f,
129      TILE_FLIPYX((layer1_videoram[tile_index * 2 + 1] & 0xc0) >> 6)
130   );
131}
91132
92   coin_counter_w(0, data & 0x400);
133static TILE_GET_INFO( get_layer2_tile_info )
134{
135   SET_TILE_INFO
136   (
137      0,
138      layer2_videoram[tile_index * 2],
139      layer2_videoram[tile_index * 2 + 1] & 0x0f,
140      0
141   );
93142}
94143
144
145static VIDEO_START( magic10 )
146{
147   layer0_tilemap = tilemap_create(get_layer0_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
148   layer1_tilemap = tilemap_create(get_layer1_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
149   layer2_tilemap = tilemap_create(get_layer2_tile_info, tilemap_scan_rows, 8, 8, 64, 64);
150
151   tilemap_set_transparent_pen(layer1_tilemap, 0);
152   tilemap_set_transparent_pen(layer2_tilemap, 0);
153
154   tilemap_set_scrollx(layer2_tilemap, 0, layer2_offset[0]);
155   tilemap_set_scrolly(layer2_tilemap, 0, layer2_offset[1]);
156}
157
158static VIDEO_UPDATE( magic10 )
159{
160   tilemap_draw(bitmap, cliprect, layer0_tilemap, 0, 0);
161   tilemap_draw(bitmap, cliprect, layer1_tilemap, 0, 0);
162   tilemap_draw(bitmap, cliprect, layer2_tilemap, 0, 0);
163
164   tilemap_set_scrollx(layer2_tilemap, 0, layer2_offset[0]);
165   tilemap_set_scrolly(layer2_tilemap, 0, layer2_offset[1]);
166
167   return 0;
168}
169
170
171/***************************
172*       R/W Handlers       *
173***************************/
174
95175static READ16_HANDLER( magic102_r )
96176{
97177   static UINT16 ret = 0;
r3232r3233
110190   logerror("Writting to copro: %d \n", data);
111191}
112192
113static WRITE16_HANDLER( vid_reg_1_w )   // layer pos control
193static WRITE16_HANDLER( magic10_out_w )
114194{
195/*
196  ----------------------------------------------
197  --- Super Gran Safari & Magic's 10 Outputs ---
198  ----------------------------------------------
199
200  0x0000 - Normal State (lamps off).
201  0x0001 - Hold 1 lamp.
202  0x0002 - Hold 2 lamp.
203  0x0004 - Hold 3 lamp.
204  0x0008 - Hold 4 lamp.
205  0x0010 - Hold 5 lamp.
206  0x0020 - Start lamp.
207  0x0040 - Play (Bet/Take/Cancel) lamp.
208  0x0100 - Payout lamp.
209  0x0400 - Coin counter.
210
211
212    - Lbits -
213    7654 3210
214    =========
215    ---- ---x  Hold1 lamp.
216    ---- --x-  Hold2 lamp.
217    ---- -x--  Hold3 lamp.
218    ---- x---  Hold4 lamp.
219    ---x ----  Hold5 lamp.
220    --x- ----  Start lamp.
221    -x-- ----  Play (Bet/Take/Cancel) lamp.
222
223    - Hbits -
224    7654 3210
225    =========
226    ---- ---x  Payout lamp.
227    ---- -x--  Coin counter.
228
229*/
230
231//  popmessage("lamps: %02X", data);
232
233   output_set_lamp_value(1, (data & 1));         /* Lamp 1 - HOLD 1 */
234   output_set_lamp_value(2, (data >> 1) & 1);      /* Lamp 2 - HOLD 2 */
235   output_set_lamp_value(3, (data >> 2) & 1);      /* Lamp 3 - HOLD 3 */
236   output_set_lamp_value(4, (data >> 3) & 1);      /* Lamp 4 - HOLD 4 */
237   output_set_lamp_value(5, (data >> 4) & 1);      /* Lamp 5 - HOLD 5 */
238   output_set_lamp_value(6, (data >> 5) & 1);      /* Lamp 6 - START  */
239   output_set_lamp_value(7, (data >> 6) & 1);      /* Lamp 7 - PLAY (BET/TAKE/CANCEL) */
240   output_set_lamp_value(8, (data >> 8) & 1);      /* Lamp 8 - PAYOUT/SUPERGAME */
241
242   coin_counter_w(0, data & 0x400);
243}
244
245static WRITE16_HANDLER( vid_reg_1_w )   /* layer pos control */
246{
115247   layer2_offset[0] = -(data - 5);
116248}
117249
250
251/***************************
252*       Memory Maps        *
253***************************/
254
118255static ADDRESS_MAP_START( magic10_map, ADDRESS_SPACE_PROGRAM, 16 )
119256   AM_RANGE(0x000000, 0x03ffff) AM_ROM
120257   AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(layer1_videoram_w) AM_BASE(&layer1_videoram)
r3232r3233
124261   AM_RANGE(0x300000, 0x3001ff) AM_RAM_WRITE(paletteram_w) AM_BASE(&paletteram16)
125262   AM_RANGE(0x400000, 0x400001) AM_READ_PORT("INPUTS")
126263   AM_RANGE(0x400002, 0x400003) AM_READ_PORT("DSW")
127   AM_RANGE(0x400008, 0x400009) AM_WRITE(magic10_misc_w)
264   AM_RANGE(0x400008, 0x400009) AM_WRITE(magic10_out_w)
128265   AM_RANGE(0x40000a, 0x40000b) AM_READWRITE(okim6295_status_0_lsb_r, okim6295_data_0_lsb_w)
129266   AM_RANGE(0x40000e, 0x40000f) AM_WRITENOP
130267   AM_RANGE(0x400080, 0x400087) AM_WRITENOP   // video registers?
r3232r3233
140277   AM_RANGE(0x300000, 0x3001ff) AM_RAM_WRITE(paletteram_w) AM_BASE(&paletteram16)
141278   AM_RANGE(0x500000, 0x500001) AM_READ_PORT("INPUTS")
142279   AM_RANGE(0x500002, 0x500003) AM_READ_PORT("DSW")
143   AM_RANGE(0x500008, 0x500009) AM_WRITE(magic10_misc_w)
280   AM_RANGE(0x500008, 0x500009) AM_WRITE(magic10_out_w)
144281   AM_RANGE(0x50000a, 0x50000b) AM_READWRITE(okim6295_status_0_lsb_r, okim6295_data_0_lsb_w)
145282   AM_RANGE(0x50000e, 0x50000f) AM_WRITENOP
146283   AM_RANGE(0x500080, 0x500087) AM_WRITENOP   // video registers?
r3232r3233
188325   AM_RANGE(0x700086, 0x700087) AM_WRITENOP         // video registers
189326ADDRESS_MAP_END
190327
328static ADDRESS_MAP_START( sgsafari_map, ADDRESS_SPACE_PROGRAM, 16 )
329   AM_RANGE(0x000000, 0x03ffff) AM_ROM
330   AM_RANGE(0x100000, 0x100fff) AM_RAM_WRITE(layer1_videoram_w) AM_BASE(&layer1_videoram)
331   AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(layer0_videoram_w) AM_BASE(&layer0_videoram)
332   AM_RANGE(0x102000, 0x103fff) AM_RAM_WRITE(layer2_videoram_w) AM_BASE(&layer2_videoram)
333   AM_RANGE(0x200000, 0x203fff) AM_RAM AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size)
334   AM_RANGE(0x300000, 0x3001ff) AM_RAM_WRITE(paletteram_w) AM_BASE(&paletteram16)
335   AM_RANGE(0x500002, 0x500003) AM_READ_PORT("DSW1")
336   AM_RANGE(0x500008, 0x500009) AM_WRITE(magic10_out_w)
337   AM_RANGE(0x50000a, 0x50000b) AM_READWRITE(okim6295_status_0_lsb_r, okim6295_data_0_lsb_w)
338   AM_RANGE(0x50000e, 0x50000f) AM_READ_PORT("IN0")
339   AM_RANGE(0x600000, 0x603fff) AM_RAM
340ADDRESS_MAP_END
341/*
191342
343  SGSafari unimplemented writes:
192344
345  0x500000 - 0x500007 ; unknown.
346  0x50000c - 0x50007f ; unknown.
347  0x500080 - 0x500083 ; video registers (layer scroll)
348  0x500084 - 0x500087 ; video registers (unknown)
349  0x500088 - 0x5000ff ; unknown.
350
351*/
352
353/***************************
354*       Input Ports        *
355***************************/
356
193357static INPUT_PORTS_START( magic10 )
194358   PORT_START("INPUTS")
195359   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Hold 1") PORT_CODE(KEYCODE_Z)
r3232r3233
198362   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Hold 4") PORT_CODE(KEYCODE_V)
199363   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Hold 5") PORT_CODE(KEYCODE_B)
200364   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START1 )
201   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Play") PORT_CODE(KEYCODE_A)
365   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Play (Bet/Take)") PORT_CODE(KEYCODE_A)
202366   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Lots FC") PORT_CODE(KEYCODE_S)
203367   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 )
204368   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("Note A")
r3232r3233
207371   PORT_SERVICE_NO_TOGGLE( 0x1000, IP_ACTIVE_LOW )
208372   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Out Hole") PORT_CODE(KEYCODE_D)
209373   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN5 ) PORT_NAME("Note D") PORT_CODE(KEYCODE_9)
210   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Collect") PORT_CODE(KEYCODE_M)
374   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Collect") PORT_CODE(KEYCODE_M)
211375
212376   PORT_START("DSW")
213377   PORT_DIPNAME( 0x0001, 0x0001, "Display Logo" )
r3232r3233
386550    PORT_DIPSETTING(   0x80, "Tickets Only" )
387551    PORT_DIPSETTING(   0xc0, "Tickets & Tokens" )
388552    PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNUSED )
389
390553INPUT_PORTS_END
391554
392static TILE_GET_INFO( get_layer0_tile_info )
393{
394   SET_TILE_INFO(1,layer0_videoram[tile_index*2],layer0_videoram[tile_index*2+1] & 0xf,TILE_FLIPYX((layer0_videoram[tile_index*2+1] & 0xc0) >> 6));
395}
555static INPUT_PORTS_START( sgsafari )
556   PORT_START("IN0")
557   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Hold 1")               PORT_CODE(KEYCODE_Z)
558   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Hold 2 / Head")        PORT_CODE(KEYCODE_X)
559   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Hold 3")               PORT_CODE(KEYCODE_C)
560   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Hold 4 / Tail")        PORT_CODE(KEYCODE_V)
561   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Hold 5 / Half Gamble") PORT_CODE(KEYCODE_B)
562   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START1 )  PORT_NAME("Start")
563   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Play (Bet/Take/Cancel)") PORT_CODE(KEYCODE_A)
564   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
396565
397static TILE_GET_INFO( get_layer1_tile_info )
398{
399   SET_TILE_INFO(1,layer1_videoram[tile_index*2],layer1_videoram[tile_index*2+1] & 0xf,TILE_FLIPYX((layer1_videoram[tile_index*2+1] & 0xc0) >> 6));
400}
566   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 )   PORT_NAME("Coin 1")
567   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 )   PORT_NAME("Coin 2")
568   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN3 )   PORT_NAME("Note B")
569   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_COIN4 )   PORT_NAME("Note C")
570   PORT_SERVICE_NO_TOGGLE( 0x1000, IP_ACTIVE_LOW )
571   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
572   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN5 )   PORT_NAME("Note D")               PORT_CODE(KEYCODE_9)
573   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Payout / Super Game")  PORT_CODE(KEYCODE_W)
401574
402static TILE_GET_INFO( get_layer2_tile_info )
403{
404   SET_TILE_INFO(0,layer2_videoram[tile_index*2],layer2_videoram[tile_index*2+1] & 0xf,0);
405}
575    PORT_START("DSW1")
576    PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNUSED )
577    PORT_DIPNAME( 0x0300,   0x0000, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW1:1,2")
578    PORT_DIPSETTING(      0x0300, DEF_STR( Easy ) )
579    PORT_DIPSETTING(      0x0200, DEF_STR( Normal ) )
580    PORT_DIPSETTING(      0x0100, DEF_STR( Hard ) )
581    PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
582    PORT_DIPNAME( 0x0c00,   0x0c00, DEF_STR( Coinage ) )
583    PORT_DIPSETTING(      0x0c00, DEF_STR( 1C_1C ) )      PORT_DIPLOCATION("SW1:3,4")
584    PORT_DIPSETTING(      0x0800, DEF_STR( 1C_2C ) )
585    PORT_DIPSETTING(      0x0400, DEF_STR( 1C_4C ) )
586    PORT_DIPSETTING(      0x0000, "1 Coin/10 Credits" )
587    PORT_DIPNAME( 0x3000,   0x0000, "Payout Options" )      PORT_DIPLOCATION("SW1:5,6")
588    PORT_DIPSETTING(      0x3000, "Pay at 100 points" )
589    PORT_DIPSETTING(      0x2000, "Pay at 200 points" )
590    PORT_DIPSETTING(      0x1000, "Pay at 400 points" )
591    PORT_DIPSETTING(      0x0000, "Pay at 500 points" )
592    PORT_DIPNAME( 0x4000,   0x4000, "Tickets" )            PORT_DIPLOCATION("SW1:7")
593    PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
594    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
595    PORT_DIPNAME( 0x8000,   0x0000, "Hopper" )            PORT_DIPLOCATION("SW1:8")
596    PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
597    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
598INPUT_PORTS_END
406599
407600
408static VIDEO_START( magic10 )
409{
410   layer0_tilemap = tilemap_create(get_layer0_tile_info,tilemap_scan_rows,16,16,32,32);
411   layer1_tilemap = tilemap_create(get_layer1_tile_info,tilemap_scan_rows,16,16,32,32);
412   layer2_tilemap = tilemap_create(get_layer2_tile_info,tilemap_scan_rows, 8, 8,64,64);
601/****************************
602*     Graphics Layouts      *
603****************************/
413604
414   tilemap_set_transparent_pen(layer1_tilemap,0);
415   tilemap_set_transparent_pen(layer2_tilemap,0);
416
417   tilemap_set_scrollx(layer2_tilemap,0,layer2_offset[0]);
418   tilemap_set_scrolly(layer2_tilemap,0,layer2_offset[1]);
419}
420
421static VIDEO_UPDATE( magic10 )
422{
423   tilemap_draw(bitmap,cliprect,layer0_tilemap,0,0);
424   tilemap_draw(bitmap,cliprect,layer1_tilemap,0,0);
425   tilemap_draw(bitmap,cliprect,layer2_tilemap,0,0);
426
427   tilemap_set_scrollx(layer2_tilemap,0,layer2_offset[0]);
428   tilemap_set_scrolly(layer2_tilemap,0,layer2_offset[1]);
429
430   return 0;
431}
432
433605static const gfx_layout tiles8x8_layout =
434606{
435607   8,8,
436608   RGN_FRAC(1,4),
437609   4,
438   { RGN_FRAC(3,4),RGN_FRAC(2,4),RGN_FRAC(1,4),RGN_FRAC(0,4) },
610   { RGN_FRAC(3,4), RGN_FRAC(2,4), RGN_FRAC(1,4), RGN_FRAC(0,4) },
439611   { 0, 1, 2, 3, 4, 5, 6, 7 },
440612   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
441613   8*8
r3232r3233
454626   32*8
455627};
456628
629
630/****************************
631*      Graphics Decode      *
632****************************/
633
457634static GFXDECODE_START( magic10 )
458635   GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout,   0, 16 )
459636   GFXDECODE_ENTRY( "gfx1", 0, tiles16x16_layout, 0, 16 )
460637GFXDECODE_END
461638
639
640/****************************
641*      Machine Drivers      *
642****************************/
643
462644static MACHINE_DRIVER_START( magic10 )
645   /* basic machine hardware */
463646   MDRV_CPU_ADD("cpu", M68000, 10000000) // ?
464647   MDRV_CPU_PROGRAM_MAP(magic10_map,0)
465648   MDRV_CPU_VBLANK_INT("main", irq1_line_hold)
466649
467650   MDRV_NVRAM_HANDLER(generic_0fill)
468651
469
470652   MDRV_SCREEN_ADD("main", RASTER)
471653   MDRV_SCREEN_REFRESH_RATE(60)
472654   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
r3232r3233
480662   MDRV_VIDEO_START(magic10)
481663   MDRV_VIDEO_UPDATE(magic10)
482664
665   /* sound hardware */
483666   MDRV_SPEAKER_STANDARD_MONO("mono")
484
485667   MDRV_SOUND_ADD("oki", OKIM6295, 1056000)
486   MDRV_SOUND_CONFIG(okim6295_interface_pin7high) // clock frequency & pin 7 not verified
668   MDRV_SOUND_CONFIG(okim6295_interface_pin7high)   /* clock frequency & pin 7 not verified */
487669   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
488670MACHINE_DRIVER_END
489671
672
490673static MACHINE_DRIVER_START( magic10a )
491
492674   /* basic machine hardware */
493675   MDRV_IMPORT_FROM(magic10)
494676   MDRV_CPU_MODIFY("cpu")
495677   MDRV_CPU_PROGRAM_MAP(magic10a_map,0)
496678MACHINE_DRIVER_END
497679
680
498681static MACHINE_DRIVER_START( magic102 )
499
500682   /* basic machine hardware */
501683   MDRV_IMPORT_FROM(magic10)
502684   MDRV_CPU_MODIFY("cpu")
r3232r3233
506688   MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 0*8, 30*8-1)
507689MACHINE_DRIVER_END
508690
691
509692static MACHINE_DRIVER_START( hotslot )
510
511693   /* basic machine hardware */
512694   MDRV_IMPORT_FROM(magic10)
513695   MDRV_CPU_MODIFY("cpu")
r3232r3233
517699   MDRV_SCREEN_VISIBLE_AREA(8*8, 56*8-1, 2*8, 32*8-1)
518700MACHINE_DRIVER_END
519701
702
703static MACHINE_DRIVER_START( sgsafari )
704   /* basic machine hardware */
705   MDRV_IMPORT_FROM(magic10)
706   MDRV_CPU_MODIFY("cpu")
707   MDRV_CPU_PROGRAM_MAP(sgsafari_map,0)
708   MDRV_CPU_VBLANK_INT("main", irq2_line_hold)   /* L1 interrupts */
709
710   MDRV_SCREEN_MODIFY("main")
711   MDRV_SCREEN_VISIBLE_AREA(0*8, 44*8-1, 0*8, 30*8-1)
712MACHINE_DRIVER_END
713
714
715/****************************
716*        Rom Loads          *
717****************************/
718
520719/*
521720
522721Magic 10 (videopoker)
r3232r3233
5307291x Dallas Ds1220y-200 Nonvolatile ram
531730
532731*/
533
534732ROM_START( magic10 )
535   ROM_REGION( 0x40000, "cpu", 0 ) /* 68000 Code */
733   ROM_REGION( 0x40000, "cpu", 0 ) /* 68000 code */
536734   ROM_LOAD16_BYTE( "u3.bin", 0x000000, 0x20000, CRC(191a46f4) SHA1(65bc22cdcc4b2f102d3eef595626819af709cacb) )
537735   ROM_LOAD16_BYTE( "u2.bin", 0x000001, 0x20000, CRC(a03a80bc) SHA1(a21da8912f1d2c8c2fa4a8d3ce4d43da8a934e21) )
538736
539   ROM_REGION( 0x80000, "gfx1", ROMREGION_DISPOSE ) /* Tiles */
737   ROM_REGION( 0x80000, "gfx1", ROMREGION_DISPOSE ) /* tiles */
540738   ROM_LOAD( "u25.bin", 0x00000, 0x20000, CRC(7abb8136) SHA1(1d4daf6a4477853d89d08afb524516ef79f60dd6) )
541739   ROM_LOAD( "u26.bin", 0x20000, 0x20000, CRC(fd0b912d) SHA1(1cd15fa3459e7fece9fc37595f2b6848c00ffa43) )
542740   ROM_LOAD( "u27.bin", 0x40000, 0x20000, CRC(8178c907) SHA1(8c3440769ed4e113d84d1f8f9079783497791859) )
543741   ROM_LOAD( "u28.bin", 0x60000, 0x20000, CRC(dfd41aab) SHA1(82248c7fa4febb1c453f35a0e4cfae062c5da2d5) )
544742
545   ROM_REGION( 0x40000, "oki", 0 ) /* Samples */
743   ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */
546744   ROM_LOAD( "u22.bin", 0x00000, 0x40000, CRC(98885246) SHA1(752d549e6248074f2a7f6c5cc4d0bbc44c7fa4c3) )
547745ROM_END
548746
549747ROM_START( magic10a )
550   ROM_REGION( 0x40000, "cpu", 0 ) /* 68000 Code */
748   ROM_REGION( 0x40000, "cpu", 0 ) /* 68000 code */
551749   ROM_LOAD16_BYTE( "u3_1645.bin",  0x00000, 0x20000, CRC(7f2549e4) SHA1(6578ad29273c357faae7c6be3fa1b49087e088a2) )
552750   ROM_LOAD16_BYTE( "u2_1645.bin",  0x00001, 0x20000, CRC(c075234e) SHA1(d9bc38f0b984082a77088fbb52b02c8f5c49846c) )
553751
554   ROM_REGION( 0x80000, "gfx1", ROMREGION_DISPOSE ) /* Tile */
752   ROM_REGION( 0x80000, "gfx1", ROMREGION_DISPOSE ) /* tiles */
555753   ROM_LOAD( "u25.bin", 0x00000, 0x20000, CRC(7abb8136) SHA1(1d4daf6a4477853d89d08afb524516ef79f60dd6) )
556754   ROM_LOAD( "u26.bin", 0x20000, 0x20000, CRC(fd0b912d) SHA1(1cd15fa3459e7fece9fc37595f2b6848c00ffa43) )
557755   ROM_LOAD( "u27.bin", 0x40000, 0x20000, CRC(8178c907) SHA1(8c3440769ed4e113d84d1f8f9079783497791859) )
558756   ROM_LOAD( "u28.bin", 0x60000, 0x20000, CRC(dfd41aab) SHA1(82248c7fa4febb1c453f35a0e4cfae062c5da2d5) )
559757
560   ROM_REGION( 0x40000, "oki", 0 ) /* Samples */
758   ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */
561759   ROM_LOAD( "u22.bin", 0x00000, 0x40000, CRC(98885246) SHA1(752d549e6248074f2a7f6c5cc4d0bbc44c7fa4c3) )
562760ROM_END
563761
r3232r3233
5947921x battery
595793
596794*/
597
598795ROM_START( magic10b )
599   ROM_REGION( 0x40000, "cpu", 0 ) /* 68000 Code */
796   ROM_REGION( 0x40000, "cpu", 0 ) /* 68000 code */
600797   ROM_LOAD16_BYTE( "2.u3", 0x000000, 0x20000, CRC(32c12ad6) SHA1(93340df2c0f4c260837bd6649008e26a17a22015) )
601798   ROM_LOAD16_BYTE( "3.u2", 0x000001, 0x20000, CRC(a9945aaa) SHA1(97d4f6441b96618f2e3ce14095ffc5628cb14f0e) )
602799
603   ROM_REGION( 0x80000, "gfx1", ROMREGION_DISPOSE ) /* Tiles */
800   ROM_REGION( 0x80000, "gfx1", ROMREGION_DISPOSE ) /* tiles */
604801   ROM_LOAD( "6.u25", 0x00000, 0x20000, CRC(7abb8136) SHA1(1d4daf6a4477853d89d08afb524516ef79f60dd6) )
605802   ROM_LOAD( "4.u26", 0x20000, 0x20000, CRC(fd0b912d) SHA1(1cd15fa3459e7fece9fc37595f2b6848c00ffa43) )
606803   ROM_LOAD( "5.u27", 0x40000, 0x20000, CRC(8178c907) SHA1(8c3440769ed4e113d84d1f8f9079783497791859) )
607804   ROM_LOAD( "7.u28", 0x60000, 0x20000, CRC(dfd41aab) SHA1(82248c7fa4febb1c453f35a0e4cfae062c5da2d5) )
608805
609   ROM_REGION( 0x40000, "oki", 0 ) /* Samples */
806   ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */
610807   ROM_LOAD( "1.u22", 0x00000, 0x40000, CRC(98885246) SHA1(752d549e6248074f2a7f6c5cc4d0bbc44c7fa4c3) )
611808ROM_END
612809
r3232r3233
6248211x oki6295
625822
626823*/
627
628824ROM_START( magic102 )
629   ROM_REGION( 0x40000, "cpu", 0 )      /* 68000 Code */
825   ROM_REGION( 0x40000, "cpu", 0 )      /* 68000 code */
630826   ROM_LOAD16_BYTE( "2.u3",  0x00000, 0x20000, CRC(6fc55fe4) SHA1(392ad92e55aeac9bf5235cceb6b0b415942105a4) )
631827   ROM_LOAD16_BYTE( "1.u2",  0x00001, 0x20000, CRC(501507af) SHA1(ceed50c9380a9838cd3d171d2387334edfeff77f) )
632828
633   ROM_REGION( 0x80000, "gfx1", ROMREGION_DISPOSE ) /* Tiles */
829   ROM_REGION( 0x80000, "gfx1", ROMREGION_DISPOSE ) /* tiles */
634830   ROM_LOAD( "3.u35",        0x00000, 0x20000, CRC(df47bb12) SHA1(b8bcbc9ab764d3159344d93776d13a14c9154086) )
635831   ROM_LOAD( "4.u36",        0x20000, 0x20000, CRC(dc242034) SHA1(6a2983c79776df07f29b77f23799fef6f20df24f) )
636832   ROM_LOAD( "5.u37",        0x40000, 0x20000, CRC(a048e26e) SHA1(788c28470298896902120e74fd8b9b283b8e9b79) )
637833   ROM_LOAD( "6.u38",        0x60000, 0x20000, CRC(469efb34) SHA1(b16646fb0c4757132e272b3877cf546b6f616786) )
638834
639   ROM_REGION( 0x40000, "oki", 0 ) /* Samples */
835   ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM samples */
640836   ROM_LOAD( "7.u32",        0x00000, 0x40000, CRC(47804af7) SHA1(602dc0361869b52532e2adcb0de3cbdd042761b3) )
641837ROM_END
642838
r3232r3233
681877  Fixed layers = yes.
682878
683879*/
684
685880ROM_START( suprpool )
686   ROM_REGION( 0x40000, "cpu", 0 ) /* 68000 Code */
881   ROM_REGION( 0x40000, "cpu", 0 ) /* 68000 code */
687882   ROM_LOAD16_BYTE( "2-1.22a.u3", 0x00000, 0x20000,CRC(5d15037a) SHA1(74cab79a1b08910267262a4c6b501126a4df6cda) )
688883   ROM_LOAD16_BYTE( "3-1.22a.u2", 0x00001, 0x20000,CRC(c762cd1c) SHA1(ee05a9e8147d613eb14333e6e7b743fc05982e7c) )
689884
690   ROM_REGION( 0x80000, "gfx1", 0 ) /* Sprites */
885   ROM_REGION( 0x80000, "gfx1", 0 ) /* graphics */
691886   ROM_LOAD( "7.u35", 0x00000, 0x20000,  CRC(357d145f) SHA1(9fea0d0c5d6c27bf520c4f81eb0f48a65ff60142) )
692887   ROM_LOAD( "6.u36", 0x20000, 0x20000,  CRC(c4448813) SHA1(6e168eb8503b852179f2d743f1cba935592e0a60) )
693888   ROM_LOAD( "5.u37", 0x40000, 0x20000,  CRC(6e99af07) SHA1(85e7a76724fd9ce8d07b5088cb6e0d933fd95692) )
694889   ROM_LOAD( "4.u38", 0x60000, 0x20000,  CRC(0660a169) SHA1(1cb34b3da4b144028519a3c5b32ef7da44af0624) )
695890
696   ROM_REGION( 0x080000, "oki", 0 ) /* Samples */
891   ROM_REGION( 0x080000, "oki", 0 ) /* ADPCM samples */
697892   ROM_LOAD( "1.u32", 0x00000, 0x40000, CRC(47804af7) SHA1(602dc0361869b52532e2adcb0de3cbdd042761b3) )
698893ROM_END
699894
r3232r3233
752947  Fixed layers = yes.
753948
754949*/
755
756950ROM_START( hotslot )
757   ROM_REGION( 0x40000, "cpu", 0 ) /* 68000 Code */
951   ROM_REGION( 0x40000, "cpu", 0 ) /* 68000 code */
758952   ROM_LOAD16_BYTE( "hotslot2.u3", 0x00000, 0x20000, CRC(676cbe32) SHA1(78721326f3334fcdfdaffb72dbcacfb8bb591d51) )
759953   ROM_LOAD16_BYTE( "hotslot3.u2", 0x00001, 0x20000, CRC(2c362765) SHA1(c41741c97fe8e5b3a66eb08ebf68d24c6c771ba8) )
760954
761   ROM_REGION( 0x100000, "gfx1", 0 ) /* Sprites */
955   ROM_REGION( 0x100000, "gfx1", 0 ) /* graphics */
762956   ROM_LOAD( "hotslot7.u35", 0x00000, 0x40000, CRC(715073c2) SHA1(39085871fee182a9b22c3e042211e76da0ee3024) )
763957   ROM_LOAD( "hotslot6.u36", 0x40000, 0x40000, CRC(8ef2e25a) SHA1(d4a3288878fabab7ea193d5dadde1fe9fea6bc8a) )
764958   ROM_LOAD( "hotslot5.u37", 0x80000, 0x40000, CRC(98375b25) SHA1(2167f3374bdfc5e1fef7b9ec4361bc68223876b8) )
765959   ROM_LOAD( "hotslot4.u38", 0xc0000, 0x40000, CRC(cc8a241a) SHA1(8c6ea51d5f7475be79775df0b976ffddc5a960ed) )
766960
767   ROM_REGION( 0x080000, "oki", 0 ) /* Samples */
961   ROM_REGION( 0x080000, "oki", 0 ) /* ADPCM samples */
768962   ROM_LOAD( "hotslot1.u32", 0x00000, 0x40000, CRC(ae880970) SHA1(3c302b3f6f6bbf72a522889592add3b6ef8ce1b0) )
769963ROM_END
770964
r3232r3233
8071001  Fixed layers = yes.
8081002
8091003*/
810
8111004ROM_START( mcolors )
812   ROM_REGION( 0x40000, "cpu", 0 ) /* 68000 Code */
1005   ROM_REGION( 0x40000, "cpu", 0 ) /* 68000 code */
8131006   ROM_LOAD16_BYTE( "m.colors1.7a-2.u3", 0x00000, 0x20000, CRC(02ce6aab) SHA1(349cb639024a818cb88e911788a0146f48d25333) )
8141007   ROM_LOAD16_BYTE( "m.colors1.7a-3.u2", 0x00001, 0x20000, CRC(076b9680) SHA1(856d1cfaca886d78a36e129a7b41455362932e66) )
8151008
816   ROM_REGION( 0x80000, "gfx1", 0 ) /* Sprites */
1009   ROM_REGION( 0x80000, "gfx1", 0 ) /* graphics */
8171010   ROM_LOAD( "m.colors1.7-7.u35", 0x00000, 0x20000, CRC(ec44b289) SHA1(269c965112f0ba308bb5f02d965e32df70310b2c) )
8181011   ROM_LOAD( "m.colors1.7-6.u36", 0x20000, 0x20000, CRC(44e550e2) SHA1(abfc05b386efb0f9ad7479ff53079e6ecbaec137) )
8191012   ROM_LOAD( "m.colors1.7-5.u37", 0x40000, 0x20000, CRC(ec363d0d) SHA1(283f0bf3e3d76d64389f0abdffbeaa3d538b8991) )
8201013   ROM_LOAD( "m.colors1.7-4.u38", 0x60000, 0x20000, CRC(7845667d) SHA1(66b1409b8b661b95e2658385da9c2662430d8030) )
8211014
822   ROM_REGION( 0x080000, "oki", 0 ) /* Samples */
1015   ROM_REGION( 0x080000, "oki", 0 ) /* ADPCM samples */
8231016   ROM_LOAD( "m.color1.u32", 0x00000, 0x40000, CRC(db8d6769) SHA1(2ab7730fd8ae9522e5452fe1f535002e11db5e7b) )
8241017ROM_END
8251018
1019/*
8261020
1021Super Gran Safari
10221996 - New Impeuropex Corp.
1023
1024CPU:
10251x MC68000P12 (main)
10262x A1020B-PL84C (not dumped)
1027
10281x M6295 (sound)
10291x TDA2002 (sound)
10301x GL324 (sound)
1031
10321x oscillator 30.000MHz
1033
1034ROMs:
10352x M27C512 (1,2)
10361x M27C2001 (3)
10374x M27C1001 (4,5,6,7)
1038
1039Note:
10401x JAMMA edge connector
10411x 12 legs connector (j2)
10421x 8x2 switches dip
10431x 4 legs jumper (j3)
10441x 2 legs jumper (j4)
10451x trimmer (volume)
1046
1047
1048  STATUS:
1049
1050  Memory map = done.
1051  Inputs =     done.
1052  Machine =    done.
1053
1054  OKI 6295 =     ok.
1055  Screen size =  ok.
1056  Fixed layers = yes.
1057
1058*/
1059ROM_START( sgsafari )
1060   ROM_REGION( 0x40000, "cpu", 0 ) /* 68000 code */
1061   ROM_LOAD16_BYTE( "2.u7", 0x00000, 0x10000, CRC(797ceeac) SHA1(19055b6700f8523785790992adfeb67faa2358e0) )
1062   ROM_LOAD16_BYTE( "1.u2", 0x00001, 0x10000, CRC(549872f5) SHA1(2228c51541e3b059d5b16f50387e4215b82f78f6) )
1063
1064   ROM_REGION( 0x80000, "gfx1", 0 ) /* graphics */
1065   ROM_LOAD( "4.u15", 0x00000, 0x20000, CRC(f9233481) SHA1(1d1aca9a61f0285a6f6f12f6169d9cfc2c5e6991) )
1066   ROM_LOAD( "5.u18", 0x20000, 0x20000, CRC(9561aa47) SHA1(140e0d9104c677de911d4d12ff617d84449d907b) )
1067   ROM_LOAD( "6.u16", 0x40000, 0x20000, CRC(91c22541) SHA1(e419a2d5e71b6c64992a08fa9bd82718350ca7da) )
1068   ROM_LOAD( "7.u19", 0x60000, 0x20000, CRC(3e3a5fbd) SHA1(c3511b488ecb4759a5fdea478007a4a1c2b5f9e0) )
1069
1070   ROM_REGION( 0x040000, "oki", 0 ) /* ADPCM samples */
1071   ROM_LOAD( "3.u39", 0x00000, 0x40000, CRC(43257bb5) SHA1(993fbeb6ee0a8a4da185303ec24eee8424b90cd0) )
1072ROM_END
1073
1074
1075/****************************
1076*       Driver Init         *
1077****************************/
1078
8271079static DRIVER_INIT( magic10 )
8281080{
8291081   layer2_offset[0] = 32;
r3232r3233
8511103   layer2_offset[1] = 0;   // Y offset.
8521104}
8531105
1106static DRIVER_INIT( sgsafari )
1107{
1108   layer2_offset[0] = 16;
1109   layer2_offset[1] = 20;
1110}
8541111
855GAME( 1995, magic10,   0,       magic10,   magic10,   magic10,   ROT0, "A.W.P. Games",    "Magic's 10 (ver. 16.55)",  0 )
856GAME( 1995, magic10a,  magic10, magic10a,  magic10,   magic10,   ROT0, "A.W.P. Games",    "Magic's 10 (ver. 16.45)",  0 )
857GAME( 1995, magic10b,  magic10, magic10a,  magic10,   magic10,   ROT0, "A.W.P. Games",    "Magic's 10 (ver. 16.15)",  0 )
858GAME( 1997, magic102,  0,       magic102,  magic102,  magic102,  ROT0, "ABM Games",       "Magic's 10 2 (ver 1.1)",   GAME_NOT_WORKING )
859GAME( 1997, suprpool,  0,       magic102,  magic102,  suprpool,  ROT0, "ABM Games",       "Super Pool (9743 rev.01)", GAME_NOT_WORKING )
860GAME( 1996, hotslot,   0,       hotslot,   hotslot,   hotslot,   ROT0, "ABM Electronics", "Hot Slot (ver. 05.01)",     GAME_NOT_WORKING )
861GAME( 1999, mcolors,   0,       magic102,  magic102,  magic102,  ROT0, "unknown",         "Magic Colors (ver. 1.7a)",  GAME_NOT_WORKING )
1112
1113/******************************
1114*        Game Drivers         *
1115******************************/
1116
1117/*     YEAR  NAME      PARENT    MACHINE   INPUT     INIT      ROT    COMPANY                 FULLNAME                       FLAGS            LAYOUT  */
1118GAMEL( 1995, magic10,  0,        magic10,  magic10,  magic10,  ROT0, "A.W.P. Games",         "Magic's 10 (ver. 16.55)",      0,               layout_sgsafari )
1119GAMEL( 1995, magic10a, magic10,  magic10a, magic10,  magic10,  ROT0, "A.W.P. Games",         "Magic's 10 (ver. 16.45)",      0,               layout_sgsafari )
1120GAMEL( 1995, magic10b, magic10,  magic10a, magic10,  magic10,  ROT0, "A.W.P. Games",         "Magic's 10 (ver. 16.15)",      0,               layout_sgsafari )
1121GAME(  1997, magic102, 0,        magic102, magic102, magic102, ROT0, "ABM Games",            "Magic's 10 2 (ver 1.1)",       GAME_NOT_WORKING                 )
1122GAME(  1997, suprpool, 0,        magic102, magic102, suprpool, ROT0, "ABM Games",            "Super Pool (9743 rev.01)",     GAME_NOT_WORKING                 )
1123GAME(  1996, hotslot,  0,        hotslot,  hotslot,  hotslot,  ROT0, "ABM Electronics",      "Hot Slot (ver. 05.01)",        GAME_NOT_WORKING                 )
1124GAME(  1999, mcolors,  0,        magic102, magic102, magic102, ROT0, "unknown",              "Magic Colors (ver. 1.7a)",     GAME_NOT_WORKING                 )
1125GAMEL( 1996, sgsafari, 0,        sgsafari, sgsafari, sgsafari, ROT0, "New Impeuropex Corp.", "Super Gran Safari (ver 3.11)", 0,               layout_sgsafari )
src/mame/drivers/hnayayoi.c
r3232r3233
5454{
5555   int res = 0x3f;
5656   int i;
57   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
57   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
5858
5959   for (i = 0;i < 5;i++)
6060      if (~keyb & (1 << i)) res &= input_port_read(machine, keynames[i]);
src/mame/drivers/raiden2.c
r3232r3233
146146
147147static tilemap *background_layer,*midground_layer,*foreground_layer,*text_layer;
148148static UINT16 *back_data,*fore_data,*mid_data, *w1ram;
149static int bg_bank=0, fg_bank=6, mid_bank=1, bg_col=0, fg_col=1, mid_col=2;
149static int bg_bank, fg_bank, mid_bank;
150static int bg_col, fg_col, mid_col;
150151
151152static int tick;
152153static UINT16 *mainram;
r3232r3233
812813}
813814#endif
814815
816static void common_reset(void)
817{
818   bg_bank=0;
819   fg_bank=6;
820   mid_bank=1;
821   bg_col=0;
822   fg_col=1;
823   mid_col=2;
824}
825
815826static MACHINE_RESET(raiden2)
816827{
828   common_reset();
817829   sprcpt_init();
818830   MACHINE_RESET_CALL(seibu_sound);
819831
r3232r3233
20412053   logerror("VSYNC\n");
20422054}
20432055
2056static MACHINE_RESET( rdx_v33 )
2057{
2058   common_reset();
2059}
2060
20442061static MACHINE_DRIVER_START( rdx_v33 )
20452062
20462063   /* basic machine hardware */
r3232r3233
20482065   MDRV_CPU_PROGRAM_MAP(rdx_v33_map, 0)
20492066   MDRV_CPU_VBLANK_INT("main", rdx_v33_interrupt)
20502067
2068   MDRV_MACHINE_RESET(rdx_v33)
20512069   MDRV_NVRAM_HANDLER(rdx_v33)
20522070
20532071   /* video hardware */
src/mame/drivers/scramble.c
r3232r3233
408408   AM_RANGE(0xe800, 0xebff) AM_RAM
409409ADDRESS_MAP_END
410410
411static ADDRESS_MAP_START( triplep_readport, ADDRESS_SPACE_IO, 8 )
411static ADDRESS_MAP_START( triplep_io_map, ADDRESS_SPACE_IO, 8 )
412412   ADDRESS_MAP_GLOBAL_MASK(0xff)
413   AM_RANGE(0x01, 0x01) AM_READ(ay8910_read_port_0_r)
413   AM_RANGE(0x00, 0x00) AM_WRITE(ay8910_write_port_0_w)
414   AM_RANGE(0x01, 0x01) AM_READWRITE(ay8910_read_port_0_r, ay8910_control_port_0_w)
414415   AM_RANGE(0x02, 0x02) AM_READ(triplep_pip_r)
415416   AM_RANGE(0x03, 0x03) AM_READ(triplep_pap_r)
416417ADDRESS_MAP_END
417418
418static ADDRESS_MAP_START( triplep_writeport, ADDRESS_SPACE_IO, 8 )
419static ADDRESS_MAP_START( hotshock_sound_io_map, ADDRESS_SPACE_IO, 8 )
419420   ADDRESS_MAP_GLOBAL_MASK(0xff)
420   AM_RANGE(0x00, 0x00) AM_WRITE(ay8910_write_port_0_w)
421   AM_RANGE(0x01, 0x01) AM_WRITE(ay8910_control_port_0_w)
422ADDRESS_MAP_END
423
424
425static ADDRESS_MAP_START( hotshock_sound_readport, ADDRESS_SPACE_IO, 8 )
426   ADDRESS_MAP_GLOBAL_MASK(0xff)
427   AM_RANGE(0x20, 0x20) AM_READ(ay8910_read_port_0_r)
428   AM_RANGE(0x40, 0x40) AM_READ(ay8910_read_port_1_r)
429ADDRESS_MAP_END
430
431static ADDRESS_MAP_START( hotshock_sound_writeport, ADDRESS_SPACE_IO, 8 )
432   ADDRESS_MAP_GLOBAL_MASK(0xff)
433421   AM_RANGE(0x10, 0x10) AM_WRITE(ay8910_control_port_0_w)
434   AM_RANGE(0x20, 0x20) AM_WRITE(ay8910_write_port_0_w)
435   AM_RANGE(0x40, 0x40) AM_WRITE(ay8910_write_port_1_w)
422   AM_RANGE(0x20, 0x20) AM_READWRITE(ay8910_read_port_0_r, ay8910_write_port_0_w)
423   AM_RANGE(0x40, 0x40) AM_READWRITE(ay8910_read_port_1_r, ay8910_write_port_1_w)
436424   AM_RANGE(0x80, 0x80) AM_WRITE(ay8910_control_port_1_w)
437425ADDRESS_MAP_END
438426
r3232r3233
18451833   AM_RANGE(0x9000, 0x9fff) AM_WRITE(scramble_filter_w)
18461834ADDRESS_MAP_END
18471835
1848static ADDRESS_MAP_START( scramble_sound_readport, ADDRESS_SPACE_IO, 8 )
1836static ADDRESS_MAP_START( scramble_sound_io_map, ADDRESS_SPACE_IO, 8 )
18491837   ADDRESS_MAP_GLOBAL_MASK(0xff)
1850   AM_RANGE(0x20, 0x20) AM_READ(ay8910_read_port_0_r)
1851   AM_RANGE(0x80, 0x80) AM_READ(ay8910_read_port_1_r)
1852ADDRESS_MAP_END
1853
1854static ADDRESS_MAP_START( scramble_sound_writeport, ADDRESS_SPACE_IO, 8 )
1855   ADDRESS_MAP_GLOBAL_MASK(0xff)
18561838   AM_RANGE(0x10, 0x10) AM_WRITE(ay8910_control_port_0_w)
1857   AM_RANGE(0x20, 0x20) AM_WRITE(ay8910_write_port_0_w)
1839   AM_RANGE(0x20, 0x20) AM_READWRITE(ay8910_read_port_0_r, ay8910_write_port_0_w)
18581840   AM_RANGE(0x40, 0x40) AM_WRITE(ay8910_control_port_1_w)
1859   AM_RANGE(0x80, 0x80) AM_WRITE(ay8910_write_port_1_w)
1841   AM_RANGE(0x80, 0x80) AM_READWRITE(ay8910_read_port_1_r, ay8910_write_port_1_w)
18601842ADDRESS_MAP_END
18611843
1862
18631844static MACHINE_DRIVER_START( scramble )
18641845
18651846   /* basic machine hardware */
r3232r3233
18681849
18691850   MDRV_CPU_ADD("audio", Z80, 14318000/8)   /* 1.78975 MHz */
18701851   MDRV_CPU_PROGRAM_MAP(scramble_sound_readmem,scramble_sound_writemem)
1871   MDRV_CPU_IO_MAP(scramble_sound_readport,scramble_sound_writeport)
1852   MDRV_CPU_IO_MAP(scramble_sound_io_map,0)
18721853
18731854   MDRV_MACHINE_RESET(scramble)
18741855
r3232r3233
20832064   MDRV_DEVICE_REMOVE( "ppi8255_1", PPI8255 )
20842065
20852066   MDRV_CPU_MODIFY("audio")
2086   MDRV_CPU_IO_MAP(hotshock_sound_readport,hotshock_sound_writeport)
2067   MDRV_CPU_IO_MAP(hotshock_sound_io_map,0)
20872068
20882069   MDRV_MACHINE_RESET(galaxold)
20892070
r3232r3233
21332114   /* basic machine hardware */
21342115   MDRV_IMPORT_FROM(scramble)
21352116   MDRV_CPU_MODIFY("main")
2136   MDRV_CPU_IO_MAP(triplep_readport,triplep_writeport)
2117   MDRV_CPU_IO_MAP(triplep_io_map,0)
21372118
21382119   MDRV_CPU_REMOVE("audio")
21392120
r3232r3233
29272908   ROM_REGION( 0x0020, "proms", 0 )
29282909   ROM_LOAD( "prom-am27s19dc.1m", 0x0000, 0x0020, CRC(2759aebd) SHA1(644fd2c95ca49cbbc0ee1b88ca2563451ddd4fe0) )
29292910
2930   ROM_REGION( 0x0020, "tms5110_ctrl", 0 ) /* data to program TMS5110 speech chip 3x Reset 1x speak */
2911   ROM_REGION( 0x0020, "5110ctrl", 0 ) /* data to program TMS5110 speech chip 3x Reset 1x speak */
29312912   ROM_LOAD( "prom-sn74s188.8a",  0x0000, 0x0020, BAD_DUMP CRC(c58a4f6a) SHA1(35ef244b3e94032df2610aa594ea5670b91e1449) )
29322913ROM_END
29332914
r3232r3233
29992980GAME( 198?, mimonscr, mimonkey, mimonscr, mimonscr, mimonscr,     ROT90, "bootleg", "Mighty Monkey (bootleg on Scramble hardware)", GAME_SUPPORTS_SAVE )
30002981GAME( 1983, ad2083,   0,        ad2083,   ad2083,   ad2083,       ROT90, "Midcoin", "A. D. 2083", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE)
30012982GAME( 1981, turpins,  turtles,  turpins,  turpins,  0,            ROT90, "[Sega] (bootleg)", "Turpin (bootleg on Scramble hardware)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) // haven't hooked up the sound CPU yet
2983
src/mame/drivers/system18.c
r3232r3233
257257   AM_RANGE(0xe000, 0xffff) AM_WRITE(SMH_RAM)
258258ADDRESS_MAP_END
259259
260static ADDRESS_MAP_START( shdancbl_sound_readport, ADDRESS_SPACE_IO, 8 )
260static ADDRESS_MAP_START( shdancbl_sound_io_map, ADDRESS_SPACE_IO, 8 )
261261   ADDRESS_MAP_GLOBAL_MASK(0xff)
262   AM_RANGE(0xa0, 0xbf) AM_WRITE(SMH_NOP)
262263   AM_RANGE(0xc0, 0xdf) AM_READ(SMH_NOP)
263264ADDRESS_MAP_END
264265
265static ADDRESS_MAP_START( shdancbl_sound_writeport, ADDRESS_SPACE_IO, 8 )
266   ADDRESS_MAP_GLOBAL_MASK(0xff)
267   AM_RANGE(0xa0, 0xbf) AM_WRITE(SMH_NOP)
268ADDRESS_MAP_END
269
270266/***************************************************************************/
271267
272268static UINT8 *sys18_SoundMemBank;
r3232r3233
306302   else sys18_SoundMemBank = NULL;
307303}
308304
309
310static ADDRESS_MAP_START( sound_readport_18, ADDRESS_SPACE_IO, 8 )
305static ADDRESS_MAP_START( sound_18_io_map, ADDRESS_SPACE_IO, 8 )
311306   ADDRESS_MAP_GLOBAL_MASK(0xff)
312   AM_RANGE(0x80, 0x80) AM_READ(ym3438_status_port_0_a_r)
313//  AM_RANGE(0x82, 0x82) AM_READ(ym3438_status_port_0_b_r)
314//  AM_RANGE(0x90, 0x90) AM_READ(ym3438_status_port_1_a_r)
315//  AM_RANGE(0x92, 0x92) AM_READ(ym3438_status_port_1_b_r)
316   AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_r)
317ADDRESS_MAP_END
318
319static ADDRESS_MAP_START( sound_writeport_18, ADDRESS_SPACE_IO, 8 )
320   ADDRESS_MAP_GLOBAL_MASK(0xff)
321   AM_RANGE(0x80, 0x80) AM_WRITE(ym3438_control_port_0_a_w)
307   AM_RANGE(0x80, 0x80) AM_READWRITE(ym3438_status_port_0_a_r, ym3438_control_port_0_a_w)
322308   AM_RANGE(0x81, 0x81) AM_WRITE(ym3438_data_port_0_a_w)
309//  AM_RANGE(0x82, 0x82) AM_READ(ym3438_status_port_0_b_r)
323310   AM_RANGE(0x82, 0x82) AM_WRITE(ym3438_control_port_0_b_w)
324311   AM_RANGE(0x83, 0x83) AM_WRITE(ym3438_data_port_0_b_w)
312//  AM_RANGE(0x90, 0x90) AM_READ(ym3438_status_port_1_a_r)
325313   AM_RANGE(0x90, 0x90) AM_WRITE(ym3438_control_port_1_a_w)
326314   AM_RANGE(0x91, 0x91) AM_WRITE(ym3438_data_port_1_a_w)
315//  AM_RANGE(0x92, 0x92) AM_READ(ym3438_status_port_1_b_r)
327316   AM_RANGE(0x92, 0x92) AM_WRITE(ym3438_control_port_1_b_w)
328317   AM_RANGE(0x93, 0x93) AM_WRITE(ym3438_data_port_1_b_w)
329318   AM_RANGE(0xa0, 0xa0) AM_WRITE(sys18_soundbank_w)
319   AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_r)
330320ADDRESS_MAP_END
331321
332322static WRITE16_HANDLER( sound_command_nmi_w ){
r3232r3233
10951085
10961086   MDRV_CPU_ADD("sound", Z80, 8000000)
10971087   MDRV_CPU_PROGRAM_MAP(sound_readmem_18,sound_writemem_18)
1098   MDRV_CPU_IO_MAP(sound_readport_18,sound_writeport_18)
1088   MDRV_CPU_IO_MAP(sound_18_io_map,0)
10991089
11001090   /* video hardware */
11011091   MDRV_SCREEN_ADD("main", RASTER)
r3232r3233
11631153
11641154   MDRV_CPU_MODIFY("sound")
11651155   MDRV_CPU_PROGRAM_MAP(shdancbl_sound_readmem,shdancbl_sound_writemem)
1166   MDRV_CPU_IO_MAP(shdancbl_sound_readport,shdancbl_sound_writeport)
1156   MDRV_CPU_IO_MAP(shdancbl_sound_io_map,0)
11671157   MDRV_SOUND_REMOVE("5c68")
11681158
11691159   MDRV_SOUND_ADD("5205", MSM5205, 200000)
r3232r3233
15451535GAME( 1990, mwalkbl,  mwalk,    mwalkbl,  mwalkbl,  mwalkbl,  ROT0, "bootleg", "Michael Jackson's Moonwalker (bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
15461536
15471537GAME( 1989, shdancbl, shdancer, shdancbl, mwalkbl,  shdancbl, ROT0, "bootleg", "Shadow Dancer (bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1538
src/mame/drivers/taitojc.c
r3232r3233
745745}
746746#endif
747747
748static int first_dsp_reset = 1;
748static int first_dsp_reset;
749749static WRITE32_HANDLER(dsp_shared_w)
750750{
751751   //mame_printf_debug("dsp_shared_ram: %08X, %04X at %08X\n", offset, data >> 16, activecpu_get_pc());
r3232r3233
866866
867867static READ8_HANDLER(hc11_analog_r)
868868{
869   static const char *portnames[] = { "ANALOG1", "ANALOG2", "ANALOG3", "ANALOG4",
869   static const char *const portnames[] = { "ANALOG1", "ANALOG2", "ANALOG3", "ANALOG4",
870870                              "ANALOG5", "ANALOG6", "ANALOG7", "ANALOG8" };
871871
872872   return input_port_read_safe(machine, portnames[offset], 0);
r3232r3233
12521252
12531253static MACHINE_RESET( taitojc )
12541254{
1255   first_dsp_reset = 1;
1256
1257   mcu_comm_main = 0;
1258   mcu_comm_hc11 = 0;
1259   mcu_data_main = 0;
1260   mcu_data_hc11 = 0;
1261
1262   texture_x = 0;
1263   texture_y = 0;
1264
1265   dsp_rom_pos = 0;
1266   dsp_tex_address = 0;
1267   dsp_tex_offset = 0;
1268
1269   projected_point_x = 0;
1270   projected_point_y = 0;
1271
1272   memset(viewport_data, 0, sizeof(viewport_data));
1273   memset(projection_data, 0, sizeof(projection_data));
1274   memset(intersection_data, 0, sizeof(intersection_data));
1275
12551276   taito_f3_soundsystem_reset(machine);
12561277
12571278   f3_68681_reset();
src/mame/drivers/psikyo.c
r3232r3233
414414   AM_RANGE(0x8000, 0xffff) AM_WRITE(SMH_ROM      )   // Banked ROM
415415ADDRESS_MAP_END
416416
417
418static ADDRESS_MAP_START( sngkace_sound_readport, ADDRESS_SPACE_IO, 8 )
417static ADDRESS_MAP_START( sngkace_sound_io_map, ADDRESS_SPACE_IO, 8 )
419418   ADDRESS_MAP_GLOBAL_MASK(0xff)
420   AM_RANGE(0x00, 0x00) AM_READ(ym2610_status_port_0_a_r      )
421   AM_RANGE(0x02, 0x02) AM_READ(ym2610_status_port_0_b_r      )
422   AM_RANGE(0x08, 0x08) AM_READ(psikyo_soundlatch_r         )
419   AM_RANGE(0x00, 0x00) AM_READWRITE(ym2610_status_port_0_a_r, ym2610_control_port_0_a_w   )
420   AM_RANGE(0x01, 0x01) AM_WRITE(ym2610_data_port_0_a_w                           )
421   AM_RANGE(0x02, 0x02) AM_READWRITE(ym2610_status_port_0_b_r, ym2610_control_port_0_b_w   )
422   AM_RANGE(0x03, 0x03) AM_WRITE(ym2610_data_port_0_b_w                           )
423   AM_RANGE(0x04, 0x04) AM_WRITE(sngkace_sound_bankswitch_w                        )
424   AM_RANGE(0x08, 0x08) AM_READ(psikyo_soundlatch_r                              )
425   AM_RANGE(0x0c, 0x0c) AM_WRITE(psikyo_clear_nmi_w                              )
423426ADDRESS_MAP_END
424427
425static ADDRESS_MAP_START( sngkace_sound_writeport, ADDRESS_SPACE_IO, 8 )
426   ADDRESS_MAP_GLOBAL_MASK(0xff)
427   AM_RANGE(0x00, 0x00) AM_WRITE(ym2610_control_port_0_a_w      )
428   AM_RANGE(0x01, 0x01) AM_WRITE(ym2610_data_port_0_a_w      )
429   AM_RANGE(0x02, 0x02) AM_WRITE(ym2610_control_port_0_b_w      )
430   AM_RANGE(0x03, 0x03) AM_WRITE(ym2610_data_port_0_b_w      )
431   AM_RANGE(0x04, 0x04) AM_WRITE(sngkace_sound_bankswitch_w   )
432   AM_RANGE(0x0c, 0x0c) AM_WRITE(psikyo_clear_nmi_w         )
433ADDRESS_MAP_END
434
435
436428/***************************************************************************
437429                                Gun Bird
438430***************************************************************************/
r3232r3233
460452   AM_RANGE(0x8200, 0xffff) AM_WRITE(SMH_ROM      )   // Banked ROM
461453ADDRESS_MAP_END
462454
463
464static ADDRESS_MAP_START( gunbird_sound_readport, ADDRESS_SPACE_IO, 8 )
455static ADDRESS_MAP_START( gunbird_sound_io_map, ADDRESS_SPACE_IO, 8 )
465456   ADDRESS_MAP_GLOBAL_MASK(0xff)
466   AM_RANGE(0x04, 0x04) AM_READ(ym2610_status_port_0_a_r      )
467   AM_RANGE(0x06, 0x06) AM_READ(ym2610_status_port_0_b_r      )
468   AM_RANGE(0x08, 0x08) AM_READ(psikyo_soundlatch_r         )
457   AM_RANGE(0x00, 0x00) AM_WRITE(gunbird_sound_bankswitch_w                        )
458   AM_RANGE(0x04, 0x04) AM_READWRITE(ym2610_status_port_0_a_r, ym2610_control_port_0_a_w   )
459   AM_RANGE(0x05, 0x05) AM_WRITE(ym2610_data_port_0_a_w                           )
460   AM_RANGE(0x06, 0x06) AM_READWRITE(ym2610_status_port_0_b_r, ym2610_control_port_0_b_w   )
461   AM_RANGE(0x07, 0x07) AM_WRITE(ym2610_data_port_0_b_w                           )
462   AM_RANGE(0x08, 0x08) AM_READ(psikyo_soundlatch_r                              )
463   AM_RANGE(0x0c, 0x0c) AM_WRITE(psikyo_clear_nmi_w                              )
469464ADDRESS_MAP_END
470465
471static ADDRESS_MAP_START( gunbird_sound_writeport, ADDRESS_SPACE_IO, 8 )
472   ADDRESS_MAP_GLOBAL_MASK(0xff)
473   AM_RANGE(0x00, 0x00) AM_WRITE(gunbird_sound_bankswitch_w   )
474   AM_RANGE(0x04, 0x04) AM_WRITE(ym2610_control_port_0_a_w      )
475   AM_RANGE(0x05, 0x05) AM_WRITE(ym2610_data_port_0_a_w      )
476   AM_RANGE(0x06, 0x06) AM_WRITE(ym2610_control_port_0_b_w      )
477   AM_RANGE(0x07, 0x07) AM_WRITE(ym2610_data_port_0_b_w      )
478   AM_RANGE(0x0c, 0x0c) AM_WRITE(psikyo_clear_nmi_w         )
479ADDRESS_MAP_END
480
481
482466/***************************************************************************
483467                        Strikers 1945 / Tengai
484468***************************************************************************/
485469
486static ADDRESS_MAP_START( s1945_sound_readport, ADDRESS_SPACE_IO, 8 )
470static ADDRESS_MAP_START( s1945_sound_io_map, ADDRESS_SPACE_IO, 8 )
487471   ADDRESS_MAP_GLOBAL_MASK(0xff)
488   AM_RANGE(0x08, 0x08) AM_READ(ymf278b_status_port_0_r      )
489   AM_RANGE(0x10, 0x10) AM_READ(psikyo_soundlatch_r         )
472   AM_RANGE(0x00, 0x00) AM_WRITE(gunbird_sound_bankswitch_w                        )
473   AM_RANGE(0x02, 0x03) AM_WRITE(SMH_NOP                                       )
474   AM_RANGE(0x08, 0x08) AM_READWRITE(ymf278b_status_port_0_r, ymf278b_control_port_0_a_w   )
475   AM_RANGE(0x09, 0x09) AM_WRITE(ymf278b_data_port_0_a_w                           )
476   AM_RANGE(0x0a, 0x0a) AM_WRITE(ymf278b_control_port_0_b_w                        )
477   AM_RANGE(0x0b, 0x0b) AM_WRITE(ymf278b_data_port_0_b_w                           )
478   AM_RANGE(0x0c, 0x0c) AM_WRITE(ymf278b_control_port_0_c_w                        )
479   AM_RANGE(0x0d, 0x0d) AM_WRITE(ymf278b_data_port_0_c_w                           )
480   AM_RANGE(0x10, 0x10) AM_READ(psikyo_soundlatch_r                              )
481   AM_RANGE(0x18, 0x18) AM_WRITE(psikyo_clear_nmi_w                              )
490482ADDRESS_MAP_END
491483
492static ADDRESS_MAP_START( s1945_sound_writeport, ADDRESS_SPACE_IO, 8 )
493   ADDRESS_MAP_GLOBAL_MASK(0xff)
494   AM_RANGE(0x00, 0x00) AM_WRITE(gunbird_sound_bankswitch_w   )
495   AM_RANGE(0x02, 0x03) AM_WRITE(SMH_NOP                  )
496   AM_RANGE(0x08, 0x08) AM_WRITE(ymf278b_control_port_0_a_w   )
497   AM_RANGE(0x09, 0x09) AM_WRITE(ymf278b_data_port_0_a_w      )
498   AM_RANGE(0x0a, 0x0a) AM_WRITE(ymf278b_control_port_0_b_w   )
499   AM_RANGE(0x0b, 0x0b) AM_WRITE(ymf278b_data_port_0_b_w      )
500   AM_RANGE(0x0c, 0x0c) AM_WRITE(ymf278b_control_port_0_c_w   )
501   AM_RANGE(0x0d, 0x0d) AM_WRITE(ymf278b_data_port_0_c_w      )
502   AM_RANGE(0x18, 0x18) AM_WRITE(psikyo_clear_nmi_w         )
503ADDRESS_MAP_END
504
505
506484/***************************************************************************
507485
508486
r3232r3233
12521230
12531231   MDRV_CPU_ADD("audio", Z80, 4000000)   /* ? */
12541232   MDRV_CPU_PROGRAM_MAP(sngkace_sound_readmem,sngkace_sound_writemem)
1255   MDRV_CPU_IO_MAP(sngkace_sound_readport,sngkace_sound_writeport)
1233   MDRV_CPU_IO_MAP(sngkace_sound_io_map,0)
12561234
12571235   MDRV_MACHINE_RESET(psikyo)
12581236
r3232r3233
13031281
13041282   MDRV_CPU_ADD("audio", Z80, 4000000)   /* ! LZ8420M (Z80 core) ! */
13051283   MDRV_CPU_PROGRAM_MAP(gunbird_sound_readmem,gunbird_sound_writemem)
1306   MDRV_CPU_IO_MAP(gunbird_sound_readport,gunbird_sound_writeport)
1284   MDRV_CPU_IO_MAP(gunbird_sound_io_map,0)
13071285
13081286   MDRV_MACHINE_RESET(psikyo)
13091287
r3232r3233
13631341
13641342   MDRV_CPU_ADD("audio", Z80, 4000000)   /* ! LZ8420M (Z80 core) ! */
13651343   MDRV_CPU_PROGRAM_MAP(gunbird_sound_readmem,gunbird_sound_writemem)
1366   MDRV_CPU_IO_MAP(s1945_sound_readport,s1945_sound_writeport)
1344   MDRV_CPU_IO_MAP(s1945_sound_io_map,0)
13671345
13681346   /* MCU should go here */
13691347
r3232r3233
20572035GAME( 1995, s1945jn,  s1945,    gunbird,  s1945j,   s1945jn,  ROT270, "Psikyo", "Strikers 1945 (Japan, unprotected)", 0 )
20582036GAME( 1995, s1945k,   s1945,    s1945,    s1945j,   s1945,    ROT270, "Psikyo", "Strikers 1945 (Korea)", 0 )
20592037GAME( 1996, tengai,   0,        s1945,    tengai,   tengai,   ROT0,   "Psikyo", "Tengai / Sengoku Blade: Sengoku Ace Episode II", 0 )
2038
src/mame/drivers/model3.c
r3232r3233
11151115      case 7:
11161116         if (ACCESSING_BITS_24_31)      /* ADC Data read */
11171117         {
1118            static const char *adcnames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5", "AN6", "AN7" };
1118            static const char *const adcnames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5", "AN6", "AN7" };
11191119            UINT8 adc_data = input_port_read_safe(machine, adcnames[adc_channel], 0);
11201120            adc_channel++;
11211121            adc_channel &= 0x7;
src/mame/drivers/namcos21.c
r3232r3233
343343} *mpDspState;
344344
345345static INT32
346ReadPointROMData( unsigned offset )
346ReadPointROMData( running_machine *machine, unsigned offset )
347347{
348   const INT32 *pPointData = (INT32 *)memory_region( Machine, "user2" );
348   const INT32 *pPointData = (INT32 *)memory_region( machine, "user2" );
349349   INT32 result = pPointData[offset];
350350   return result;
351351}
r3232r3233
426426} /* TransmitWordToSlave */
427427
428428static void
429TransferDspData( void )
429TransferDspData( running_machine *machine )
430430{
431431   UINT16 addr = mpDspState->masterSourceAddr;
432432   int mode = addr&0x8000;
r3232r3233
479479         }
480480         else
481481         {
482            INT32 masterAddr = ReadPointROMData(code);
482            INT32 masterAddr = ReadPointROMData(machine, code);
483483            logerror( "OBJ TFR(0x%x)\n", code );
484484            {
485485               UINT16 len = namcos21_dspram16[addr++];
486486               for(;;)
487487               {
488                  int subAddr = ReadPointROMData(masterAddr++);
488                  int subAddr = ReadPointROMData(machine, masterAddr++);
489489                  if( subAddr==0xffffff )
490490                  {
491491                     break;
492492                  }
493493                  else
494494                  {
495                     int primWords = (UINT16)ReadPointROMData(subAddr++);
495                     int primWords = (UINT16)ReadPointROMData(machine, subAddr++);
496496                     if( primWords>2 )
497497                     {
498498                        TransmitWordToSlave( 0 ); /* pad1 */
r3232r3233
505505                        TransmitWordToSlave( primWords+1 );
506506                        for( i=0; i<primWords; i++ )
507507                        {
508                           TransmitWordToSlave( (UINT16)ReadPointROMData(subAddr+i) );
508                           TransmitWordToSlave( (UINT16)ReadPointROMData(machine, subAddr+i) );
509509                        }
510510                     }
511511                     else
r3232r3233
603603         offset == 1+(mpDspState->masterSourceAddr&0x7fff) )
604604      {
605605         logerror( "IDC-CONTINUE\n" );
606         TransferDspData();
606         TransferDspData(machine);
607607      }
608608      else if( namcos2_gametype == NAMCOS21_SOLVALOU &&
609609               offset == 0x103 &&
r3232r3233
617617/************************************************************************************/
618618
619619static int
620InitDSP( void )
620InitDSP( running_machine *machine )
621621{
622   UINT16 *pMem = (UINT16 *)memory_region(Machine, "dspmaster");
622   UINT16 *pMem = (UINT16 *)memory_region(machine, "dspmaster");
623623   /**
624624     * DSP BIOS tests "CPU ID" on startup
625625     * "JAPAN (C)1990 NAMCO LTD. by H.F "
r3232r3233
643643
644644static READ16_HANDLER( dsp_port0_r )
645645{
646   INT32 data = ReadPointROMData(pointrom_idx++);
646   INT32 data = ReadPointROMData(machine, pointrom_idx++);
647647   mPointRomMSB = (UINT8)(data>>16);
648648   mbPointRomDataAvailable = 1;
649649   return (UINT16)data;
r3232r3233
678678{
679679   logerror( "IDC ADDR INIT(0x%04x)\n", data );
680680   mpDspState->masterSourceAddr = data;
681   TransferDspData();
681   TransferDspData(machine);
682682} /* dsp_port2_w */
683683
684684static READ16_HANDLER( dsp_port3_idc_rcv_enable_r )
r3232r3233
21962196   ROM_LOAD("avo3.11e",0x080000,0x80000,CRC(76e22f92) SHA1(0e1b8d35a5b9c20cc3192d935f0c9da1e69679d2) )
21972197ROM_END
21982198
2199static void namcos21_init( int game_type )
2199static void namcos21_init( running_machine *machine, int game_type )
22002200{
22012201   namcos2_gametype = game_type;
22022202   pointram = auto_malloc(PTRAM_SIZE);
2203   mpDataROM = (UINT16 *)memory_region( Machine, "user1" );
2204   InitDSP();
2203   mpDataROM = (UINT16 *)memory_region( machine, "user1" );
2204   InitDSP(machine);
22052205   mbNeedsKickstart = 20;
22062206   if( game_type==NAMCOS21_CYBERSLED )
22072207   {
r3232r3233
22272227
22282228static DRIVER_INIT( aircombt )
22292229{
2230   namcos21_init( NAMCOS21_AIRCOMBAT );
2230   namcos21_init( machine, NAMCOS21_AIRCOMBAT );
22312231}
22322232
22332233static DRIVER_INIT( starblad )
22342234{
2235   namcos21_init( NAMCOS21_STARBLADE );
2235   namcos21_init( machine, NAMCOS21_STARBLADE );
22362236}
22372237
22382238
22392239static DRIVER_INIT( cybsled )
22402240{
2241   namcos21_init( NAMCOS21_CYBERSLED );
2241   namcos21_init( machine, NAMCOS21_CYBERSLED );
22422242}
22432243
22442244static DRIVER_INIT( solvalou )
r3232r3233
22492249   mem[0x20cf4/2+1] = 0x4e71;
22502250   mem[0x20cf4/2+2] = 0x4e71;
22512251
2252   namcos21_init( NAMCOS21_SOLVALOU );
2252   namcos21_init( machine, NAMCOS21_SOLVALOU );
22532253}
22542254
22552255static DRIVER_INIT( driveyes )
src/mame/drivers/gameplan.c
r3232r3233
9595
9696static READ8_HANDLER( io_port_r )
9797{
98   static const char *portnames[] = { "IN0", "IN1", "IN2", "IN3", "DSW0", "DSW1" };
98   static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3", "DSW0", "DSW1" };
9999   gameplan_state *state = machine->driver_data;
100100
101101   return input_port_read(machine, portnames[state->current_port]);
src/mame/drivers/darius.c
r3232r3233
292292                        SOUND
293293*****************************************************/
294294
295static INT32 banknum = -1;
295static INT32 banknum;
296296static UINT8 adpcm_command = 0;
297297static UINT8 nmi_enable = 0;
298298
r3232r3233
884884
885885   MDRV_SOUND_ADD("ym1", YM2203, 4000000)
886886   MDRV_SOUND_CONFIG(ym2203_interface_1)
887   MDRV_SOUND_ROUTE(0, "filter.2203.0.0l", 0.08)
888   MDRV_SOUND_ROUTE(0, "filter.2203.0.0r", 0.08)
889   MDRV_SOUND_ROUTE(1, "filter.2203.0.1l", 0.08)
890   MDRV_SOUND_ROUTE(1, "filter.2203.0.1r", 0.08)
891   MDRV_SOUND_ROUTE(2, "filter.2203.0.2l", 0.08)
892   MDRV_SOUND_ROUTE(2, "filter.2203.0.2r", 0.08)
893   MDRV_SOUND_ROUTE(3, "filter.2203.0.3l", 0.60)
894   MDRV_SOUND_ROUTE(3, "filter.2203.0.3r", 0.60)
887   MDRV_SOUND_ROUTE(0, "filter0.0l", 0.08)
888   MDRV_SOUND_ROUTE(0, "filter0.0r", 0.08)
889   MDRV_SOUND_ROUTE(1, "filter0.1l", 0.08)
890   MDRV_SOUND_ROUTE(1, "filter0.1r", 0.08)
891   MDRV_SOUND_ROUTE(2, "filter0.2l", 0.08)
892   MDRV_SOUND_ROUTE(2, "filter0.2r", 0.08)
893   MDRV_SOUND_ROUTE(3, "filter0.3l", 0.60)
894   MDRV_SOUND_ROUTE(3, "filter0.3r", 0.60)
895895
896896   MDRV_SOUND_ADD("ym2", YM2203, 4000000)
897897   MDRV_SOUND_CONFIG(ym2203_interface_2)
898   MDRV_SOUND_ROUTE(0, "filter.2203.1.0l", 0.08)
899   MDRV_SOUND_ROUTE(0, "filter.2203.1.0r", 0.08)
900   MDRV_SOUND_ROUTE(1, "filter.2203.1.1l", 0.08)
901   MDRV_SOUND_ROUTE(1, "filter.2203.1.1r", 0.08)
902   MDRV_SOUND_ROUTE(2, "filter.2203.1.2l", 0.08)
903   MDRV_SOUND_ROUTE(2, "filter.2203.1.2r", 0.08)
904   MDRV_SOUND_ROUTE(3, "filter.2203.1.3l", 0.60)
905   MDRV_SOUND_ROUTE(3, "filter.2203.1.3r", 0.60)
898   MDRV_SOUND_ROUTE(0, "filter1.0l", 0.08)
899   MDRV_SOUND_ROUTE(0, "filter1.0r", 0.08)
900   MDRV_SOUND_ROUTE(1, "filter1.1l", 0.08)
901   MDRV_SOUND_ROUTE(1, "filter1.1r", 0.08)
902   MDRV_SOUND_ROUTE(2, "filter1.2l", 0.08)
903   MDRV_SOUND_ROUTE(2, "filter1.2r", 0.08)
904   MDRV_SOUND_ROUTE(3, "filter1.3l", 0.60)
905   MDRV_SOUND_ROUTE(3, "filter1.3r", 0.60)
906906
907907   MDRV_SOUND_ADD("msm", MSM5205, 384000)
908908   MDRV_SOUND_CONFIG(msm5205_config)
909909   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "msm5205.l", 1.0)
910910   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "msm5205.r", 1.0)
911911
912   MDRV_SOUND_ADD("filter.2203.0.0l", FILTER_VOLUME, 0)
912   MDRV_SOUND_ADD("filter0.0l", FILTER_VOLUME, 0)
913913   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.0)
914   MDRV_SOUND_ADD("filter.2203.0.0r", FILTER_VOLUME, 0)
914   MDRV_SOUND_ADD("filter0.0r", FILTER_VOLUME, 0)
915915   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0)
916   MDRV_SOUND_ADD("filter.2203.0.1l", FILTER_VOLUME, 0)
916   MDRV_SOUND_ADD("filter0.1l", FILTER_VOLUME, 0)
917917   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.0)
918   MDRV_SOUND_ADD("filter.2203.0.1r", FILTER_VOLUME, 0)
918   MDRV_SOUND_ADD("filter0.1r", FILTER_VOLUME, 0)
919919   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0)
920   MDRV_SOUND_ADD("filter.2203.0.2l", FILTER_VOLUME, 0)
920   MDRV_SOUND_ADD("filter0.2l", FILTER_VOLUME, 0)
921921   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.0)
922   MDRV_SOUND_ADD("filter.2203.0.2r", FILTER_VOLUME, 0)
922   MDRV_SOUND_ADD("filter0.2r", FILTER_VOLUME, 0)
923923   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0)
924   MDRV_SOUND_ADD("filter.2203.0.3l", FILTER_VOLUME, 0)
924   MDRV_SOUND_ADD("filter0.3l", FILTER_VOLUME, 0)
925925   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.0)
926   MDRV_SOUND_ADD("filter.2203.0.3r", FILTER_VOLUME, 0)
926   MDRV_SOUND_ADD("filter0.3r", FILTER_VOLUME, 0)
927927   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0)
928928
929   MDRV_SOUND_ADD("filter.2203.1.0l", FILTER_VOLUME, 0)
929   MDRV_SOUND_ADD("filter1.0l", FILTER_VOLUME, 0)
930930   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.0)
931   MDRV_SOUND_ADD("filter.2203.1.0r", FILTER_VOLUME, 0)
931   MDRV_SOUND_ADD("filter1.0r", FILTER_VOLUME, 0)
932932   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0)
933   MDRV_SOUND_ADD("filter.2203.1.1l", FILTER_VOLUME, 0)
933   MDRV_SOUND_ADD("filter1.1l", FILTER_VOLUME, 0)
934934   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.0)
935   MDRV_SOUND_ADD("filter.2203.1.1r", FILTER_VOLUME, 0)
935   MDRV_SOUND_ADD("filter1.1r", FILTER_VOLUME, 0)
936936   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0)
937   MDRV_SOUND_ADD("filter.2203.1.2l", FILTER_VOLUME, 0)
937   MDRV_SOUND_ADD("filter1.2l", FILTER_VOLUME, 0)
938938   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.0)
939   MDRV_SOUND_ADD("filter.2203.1.2r", FILTER_VOLUME, 0)
939   MDRV_SOUND_ADD("filter1.2r", FILTER_VOLUME, 0)
940940   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0)
941   MDRV_SOUND_ADD("filter.2203.1.3l", FILTER_VOLUME, 0)
941   MDRV_SOUND_ADD("filter1.3l", FILTER_VOLUME, 0)
942942   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.0)
943   MDRV_SOUND_ADD("filter.2203.1.3r", FILTER_VOLUME, 0)
943   MDRV_SOUND_ADD("filter1.3r", FILTER_VOLUME, 0)
944944   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0)
945945
946946   MDRV_SOUND_ADD("msm5205.l", FILTER_VOLUME, 0)
r3232r3233
11831183{
11841184//  taitosnd_setz80_soundcpu( 2 );
11851185
1186   cpua_ctrl = 0xff;
1187
1188   banknum = -1;
11891186}
11901187
11911188
r3232r3233
11971194
11981195static MACHINE_START( darius )
11991196{
1197   cpua_ctrl = 0xff;
1198   banknum = -1;
1199   adpcm_command = 0;
1200   nmi_enable = 0;
1201
12001202   state_save_register_global(cpua_ctrl);
12011203
12021204   // (there are other sound vars that may need saving too) //
src/mame/drivers/kinst.c
r3232r3233
326326static READ32_HANDLER( kinst_control_r )
327327{
328328   UINT32 result;
329   static const char *portnames[] = { "P1", "P2", "VOLUME", "UNUSED", "DSW" };
329   static const char *const portnames[] = { "P1", "P2", "VOLUME", "UNUSED", "DSW" };
330330
331331   /* apply shuffling */
332332   offset = control_map[offset / 2];
src/mame/drivers/sbasketb.c
r3232r3233
13133800-39ff Sprite RAM
14146000-ffff ROM
1515
16
17Konami designated Super Basketball with the label of GX405.
18
19Super Basketball is composed of two boards.  A Sound board with the
20label PWB(B)3000288A and a CPU/Video board with the label
21PWB(A)2000177C silked screened onto them.  All Konami custom chips have
22had their labels scratched off.
23
24Sound Board Parts:
25
26    VLM5030 @ 11e (According to the schematics, part number scratched off)
27    Z80 @ 6a (According to the schematics, part number scratched off)
28    14.31818MHz @ x1
29    3.579545MHz @ x2
30    SN76489AN @ 8d (According to the schematics, part number scratched off)
31    4118 or 6116 @ 10a (According to the schematics pins match these two types of sram, part number scratched off)
32
33
34CPU/Video Board Parts:
35
36    18.432000MHz @ 1f
37    M2BC200 (CR2032) Battery @ 19j
38
1639***************************************************************************/
1740
1841#include "driver.h"
r3232r3233
130153   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3  ) PORT_COCKTAIL
131154   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
132155
133   PORT_START("DSW1")
134   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Game_Time ) )
156   PORT_START("DSW2")
157   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Game_Time ) )   PORT_DIPLOCATION( "SW2:1,2" )
135158   PORT_DIPSETTING(    0x03, "30" )
136159   PORT_DIPSETTING(    0x01, "40" )
137160   PORT_DIPSETTING(    0x02, "50" )
138161   PORT_DIPSETTING(    0x00, "60" )
139   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )
162   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )     PORT_DIPLOCATION( "SW2:3" )
140163   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
141164   PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) )
142   PORT_DIPNAME( 0x08, 0x08, "Starting Score" )
165   PORT_DIPNAME( 0x08, 0x08, "Starting Score" )       PORT_DIPLOCATION( "SW2:4" )
143166   PORT_DIPSETTING(    0x08, "70-78" )
144167   PORT_DIPSETTING(    0x00, "100-115" )
145   PORT_DIPNAME( 0x10, 0x00, "Ranking" )
168   PORT_DIPNAME( 0x10, 0x00, "Ranking" )              PORT_DIPLOCATION( "SW2:5" )
146169   PORT_DIPSETTING(    0x00, "Data Remaining" )
147170   PORT_DIPSETTING(    0x10, "Data Initialized" )
148   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) )
171   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) )  PORT_DIPLOCATION( "SW2:6,7" )
149172   PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
150173   PORT_DIPSETTING(    0x40, DEF_STR( Medium ) )
151174   PORT_DIPSETTING(    0x20, DEF_STR( Hard ) )
152175   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
153   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
176   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION( "SW2:8" )
154177   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
155178   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
156179
157   PORT_START("DSW2")
158   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
180   PORT_START("DSW1")
181   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )      PORT_DIPLOCATION( "SW1:1,2,3,4" )
159182   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
160183   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
161184   PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
r3232r3233
172195   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
173196   PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) )
174197   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
175   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )
198   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )      PORT_DIPLOCATION( "SW1:5,6,7,8" )
176199   PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )
177200   PORT_DIPSETTING(    0x50, DEF_STR( 3C_1C ) )
178201   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
r3232r3233
188211   PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
189212   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
190213   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
191   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
214   PORT_DIPSETTING(    0x00, "Invalid" )
192215INPUT_PORTS_END
193216
194217
r3232r3233
233256   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
234257   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
235258
236   MDRV_CPU_ADD("audio", Z80,14318000/4)   /* 3.5795 MHz */
259   MDRV_CPU_ADD("audio", Z80, XTAL_14_31818MHz / 4)   /* 3.5795 MHz */
237260   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
238261
239262   /* video hardware */
r3232r3233
257280   MDRV_SOUND_ADD("dac", DAC, 0)
258281   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
259282
260   MDRV_SOUND_ADD("sn", SN76496, 14318180/8)
283   MDRV_SOUND_ADD("sn", SN76489, XTAL_14_31818MHz / 8)
261284   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
262285
263   MDRV_SOUND_ADD("vlm", VLM5030, 3580000)
286   MDRV_SOUND_ADD("vlm", VLM5030, XTAL_3_579545MHz) /* Schematics say 3.58MHz, but board uses 3.579545MHz xtal */
264287   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
265288MACHINE_DRIVER_END
266289
r3232r3233
272295
273296***************************************************************************/
274297
298/*
299    Super Basketball (version H, unprotected)
300
301    Jumper Settings for CPU/Video Board
302
303        JP6 set to 27128 with a null resistor
304        JP5 set to A with a null resistor
305        JP4 set to 27128 with a null resistor
306        JP3 connected with a solder blob
307        JP2 connected
308
309    Jumper Settings for Sound Board
310
311        J1 connected with a null resistor
312*/
313
275314ROM_START( sbasketb )
276   ROM_REGION( 0x10000, "main", 0 )
277   ROM_LOAD( "405g05",  0x6000, 0x2000, CRC(336dc0ab) SHA1(0fe47fdbf183683c569785fc6b980337a9cfde95) )
278   ROM_LOAD( "405g04",  0x8000, 0x2000, CRC(f064a9bc) SHA1(4f1b94a880385c6ba74cc0883b24f6fec934e35d) )
279   ROM_LOAD( "405g03",  0xa000, 0x2000, CRC(b9de7d53) SHA1(5a4e5491ff3511992d949367fd7b5d383c2727db) )
280   ROM_LOAD( "405g02",  0xc000, 0x2000, CRC(e98470a0) SHA1(79af25af941fe357a8c9f0a2f11e5558670b8027) )
281   ROM_LOAD( "405g01",  0xe000, 0x2000, CRC(1bd0cd2e) SHA1(d162f9b989f718d9882a02a8c64743adf3d8e239) )
315   ROM_REGION( 0x10000, "main", 0 ) /* roms located on the CPU/Video board */
316   ROM_LOAD( "405h05.14j", 0x6000, 0x2000, CRC(263ec36b) SHA1(b445b600726ba4935623311e1a178aeb4a356b0a) )
317   ROM_LOAD( "405h03.11j", 0x8000, 0x4000, CRC(0a4d7a82) SHA1(2e0153b41e23284427881258a44bd55be3570eb2) )
318   ROM_LOAD( "405h01.9j",  0xc000, 0x4000, CRC(4f9dd9a0) SHA1(97f4c208509d50a7ce4c1ebe8a3f643ad75e833b) )
282319
283   ROM_REGION( 0x10000, "audio", 0 )
284   ROM_LOAD( "405e13",       0x0000, 0x2000, CRC(1ec7458b) SHA1(a015b982bff5f9e7ece33f2e69ff8c6c2174e710) )
320   ROM_REGION( 0x10000, "audio", 0 ) /* roms located on Sound Board  */
321   ROM_LOAD( "405e13.7a",  0x0000, 0x2000, CRC(1ec7458b) SHA1(a015b982bff5f9e7ece33f2e69ff8c6c2174e710) )
285322
286   ROM_REGION( 0x04000, "gfx1", ROMREGION_DISPOSE )
287   ROM_LOAD( "405e12",       0x0000, 0x4000, CRC(e02c54da) SHA1(2fa19f3bce894ef05820f95e0b88428e4f946a35) )
323   ROM_REGION( 0x04000, "gfx1", ROMREGION_DISPOSE ) /* roms located on the CPU/Video board */
324   ROM_LOAD( "405e12.22f", 0x0000, 0x4000, CRC(e02c54da) SHA1(2fa19f3bce894ef05820f95e0b88428e4f946a35) )
288325
289   ROM_REGION( 0x0c000, "gfx2", ROMREGION_DISPOSE )
290   ROM_LOAD( "405e06",       0x0000, 0x2000, CRC(7e2f5bb2) SHA1(e22008c0ef7ae000dcca7f43a386d43064aaea62) )
291   ROM_LOAD( "405e07",       0x2000, 0x2000, CRC(963a44f9) SHA1(03cd7699668b010f27af025ba6bd44509526ec7b) )
292   ROM_LOAD( "405e08",       0x4000, 0x2000, CRC(63901deb) SHA1(c65d896298846ed8b70a4d38b32820746214fa5c) )
293   ROM_LOAD( "405e09",       0x6000, 0x2000, CRC(e1873677) SHA1(19788e43cc1a6cf5ab375cbc2c745bb6cc8c163d) )
294   ROM_LOAD( "405e10",       0x8000, 0x2000, CRC(824815e8) SHA1(470e9d74fa2c397605a74e0bf173a6d9db4cc721) )
295   ROM_LOAD( "405e11",       0xa000, 0x2000, CRC(dca9b447) SHA1(12d7e85dc2fc6bd4ea7ad9035ae0b7487e4bc4bc) )
326   ROM_REGION( 0x0c000, "gfx2", ROMREGION_DISPOSE ) /* roms located on the CPU/Video board */
327   ROM_LOAD( "405h06.14g", 0x0000, 0x4000, CRC(cfbbff07) SHA1(39b19866b21372524933b5eef511bb5b7ad92556) )
328   ROM_LOAD( "405h08.17g", 0x4000, 0x4000, CRC(c75901b6) SHA1(4ff87123228da068f0c0ffffa4a3f03765eccd8d) )
329   ROM_LOAD( "405h10.20g", 0x8000, 0x4000, CRC(95bc5942) SHA1(55bf35283385d0ae768210706720a3b289ebd9a2) )
296330
297   ROM_REGION( 0x0500, "proms", 0 )
298   ROM_LOAD( "405e17",       0x0000, 0x0100, CRC(b4c36d57) SHA1(c4a63f57edce2b9588e2394ff54a28f91213d550) ) /* palette red component */
299   ROM_LOAD( "405e16",       0x0100, 0x0100, CRC(0b7b03b8) SHA1(81297cb2b0b28b0fc0939a37ff30844d69fb65ac) ) /* palette green component */
300   ROM_LOAD( "405e18",       0x0200, 0x0100, CRC(9e533bad) SHA1(611e7af6813caaf2bc36c311ae48a5efd30e6f0c) ) /* palette blue component */
301   ROM_LOAD( "405e20",       0x0300, 0x0100, CRC(8ca6de2f) SHA1(67d29708d1a07d17c5dc5793a3293e7ace3a4e19) ) /* character lookup table */
302   ROM_LOAD( "405e19",       0x0400, 0x0100, CRC(e0bc782f) SHA1(9f71e696d11a60f771535f6837ecad6132047b0a) ) /* sprite lookup table */
331   ROM_REGION( 0x0500, "proms", 0 ) /* roms located on the CPU/Video board */
332   ROM_LOAD( "405e17.5a",  0x0000, 0x0100, CRC(b4c36d57) SHA1(c4a63f57edce2b9588e2394ff54a28f91213d550) ) /* palette red component */
333   ROM_LOAD( "405e16.4a",  0x0100, 0x0100, CRC(0b7b03b8) SHA1(81297cb2b0b28b0fc0939a37ff30844d69fb65ac) ) /* palette green component */
334   ROM_LOAD( "405e18.6a",  0x0200, 0x0100, CRC(9e533bad) SHA1(611e7af6813caaf2bc36c311ae48a5efd30e6f0c) ) /* palette blue component */
335   ROM_LOAD( "405e20.19d", 0x0300, 0x0100, CRC(8ca6de2f) SHA1(67d29708d1a07d17c5dc5793a3293e7ace3a4e19) ) /* character lookup table */
336   ROM_LOAD( "405e19.16d", 0x0400, 0x0100, CRC(e0bc782f) SHA1(9f71e696d11a60f771535f6837ecad6132047b0a) ) /* sprite lookup table */
303337
304   ROM_REGION( 0x10000, "vlm", 0 )     /* 64k for speech rom */
305   ROM_LOAD( "405e15",       0x0000, 0x2000, CRC(01bb5ce9) SHA1(f48477b4011befba13c8bcd83e0c9f7deb14a1e1) )
338   ROM_REGION( 0x10000, "vlm", 0 ) /* 64k for speech rom, located on Sound Board */
339   ROM_LOAD( "405e15.11f", 0x0000, 0x2000, CRC(01bb5ce9) SHA1(f48477b4011befba13c8bcd83e0c9f7deb14a1e1) )
306340ROM_END
307341
308ROM_START( sbasketo )
309   ROM_REGION( 0x10000, "main", 0 )
310   ROM_LOAD( "405e05",  0x6000, 0x2000, CRC(32ea5b71) SHA1(d917c31d2c9a7229396e4a930e8d27394329533a) )
311   ROM_LOAD( "405e04",  0x8000, 0x2000, CRC(7abf3087) SHA1(fbaaaaae0b8bed1bc6ad7f2da267c2ef8bd75b15) )
312   ROM_LOAD( "405e03",  0xa000, 0x2000, CRC(9c6fcdcd) SHA1(a644ec98f49f84311829149c181aba25e7681793) )
313   ROM_LOAD( "405e02",  0xc000, 0x2000, CRC(0f145648) SHA1(2e238eb0663295887bf6b4905f1fd386db16d82a) )
314   ROM_LOAD( "405e01",  0xe000, 0x2000, CRC(6a27f1b1) SHA1(38c0be98fb122a7a6ed833af011bda5663a06510) )
315342
316   ROM_REGION( 0x10000, "audio", 0 )
317   ROM_LOAD( "405e13",       0x0000, 0x2000, CRC(1ec7458b) SHA1(a015b982bff5f9e7ece33f2e69ff8c6c2174e710) )
343/*
344    Super Basketball (version G, encrypted)
345*/
318346
319   ROM_REGION( 0x04000, "gfx1", ROMREGION_DISPOSE )
320   ROM_LOAD( "405e12",       0x0000, 0x4000, CRC(e02c54da) SHA1(2fa19f3bce894ef05820f95e0b88428e4f946a35) )
347ROM_START( sbasketg )
348   ROM_REGION( 0x10000, "main", 0 ) /* roms located on the CPU/Video board */
349   ROM_LOAD( "405g05",     0x6000, 0x2000, CRC(336dc0ab) SHA1(0fe47fdbf183683c569785fc6b980337a9cfde95) )
350   ROM_LOAD( "405g04",     0x8000, 0x2000, CRC(f064a9bc) SHA1(4f1b94a880385c6ba74cc0883b24f6fec934e35d) )
351   ROM_LOAD( "405g03",     0xa000, 0x2000, CRC(b9de7d53) SHA1(5a4e5491ff3511992d949367fd7b5d383c2727db) )
352   ROM_LOAD( "405g02",     0xc000, 0x2000, CRC(e98470a0) SHA1(79af25af941fe357a8c9f0a2f11e5558670b8027) )
353   ROM_LOAD( "405g01",     0xe000, 0x2000, CRC(1bd0cd2e) SHA1(d162f9b989f718d9882a02a8c64743adf3d8e239) )
321354
322   ROM_REGION( 0x0c000, "gfx2", ROMREGION_DISPOSE )
323   ROM_LOAD( "405e06",       0x0000, 0x2000, CRC(7e2f5bb2) SHA1(e22008c0ef7ae000dcca7f43a386d43064aaea62) )
324   ROM_LOAD( "405e07",       0x2000, 0x2000, CRC(963a44f9) SHA1(03cd7699668b010f27af025ba6bd44509526ec7b) )
325   ROM_LOAD( "405e08",       0x4000, 0x2000, CRC(63901deb) SHA1(c65d896298846ed8b70a4d38b32820746214fa5c) )
326   ROM_LOAD( "405e09",       0x6000, 0x2000, CRC(e1873677) SHA1(19788e43cc1a6cf5ab375cbc2c745bb6cc8c163d) )
327   ROM_LOAD( "405e10",       0x8000, 0x2000, CRC(824815e8) SHA1(470e9d74fa2c397605a74e0bf173a6d9db4cc721) )
328   ROM_LOAD( "405e11",       0xa000, 0x2000, CRC(dca9b447) SHA1(12d7e85dc2fc6bd4ea7ad9035ae0b7487e4bc4bc) )
355   ROM_REGION( 0x10000, "audio", 0 ) /* roms located on Sound Board  */
356   ROM_LOAD( "405e13.7a",  0x0000, 0x2000, CRC(1ec7458b) SHA1(a015b982bff5f9e7ece33f2e69ff8c6c2174e710) )
329357
330   ROM_REGION( 0x0500, "proms", 0 )
331   ROM_LOAD( "405e17",       0x0000, 0x0100, CRC(b4c36d57) SHA1(c4a63f57edce2b9588e2394ff54a28f91213d550) ) /* palette red component */
332   ROM_LOAD( "405e16",       0x0100, 0x0100, CRC(0b7b03b8) SHA1(81297cb2b0b28b0fc0939a37ff30844d69fb65ac) ) /* palette green component */
333   ROM_LOAD( "405e18",       0x0200, 0x0100, CRC(9e533bad) SHA1(611e7af6813caaf2bc36c311ae48a5efd30e6f0c) ) /* palette blue component */
334   ROM_LOAD( "405e20",       0x0300, 0x0100, CRC(8ca6de2f) SHA1(67d29708d1a07d17c5dc5793a3293e7ace3a4e19) ) /* character lookup table */
335   ROM_LOAD( "405e19",       0x0400, 0x0100, CRC(e0bc782f) SHA1(9f71e696d11a60f771535f6837ecad6132047b0a) ) /* sprite lookup table */
358   ROM_REGION( 0x04000, "gfx1", ROMREGION_DISPOSE ) /* roms located on the CPU/Video board */
359   ROM_LOAD( "405e12.22f", 0x0000, 0x4000, CRC(e02c54da) SHA1(2fa19f3bce894ef05820f95e0b88428e4f946a35) )
336360
337   ROM_REGION( 0x10000, "vlm", 0 )     /* 64k for speech rom */
338   ROM_LOAD( "405e15",       0x0000, 0x2000, CRC(01bb5ce9) SHA1(f48477b4011befba13c8bcd83e0c9f7deb14a1e1) )
361   ROM_REGION( 0x0c000, "gfx2", ROMREGION_DISPOSE ) /* roms located on the CPU/Video board */
362   ROM_LOAD( "405e06",     0x0000, 0x2000, CRC(7e2f5bb2) SHA1(e22008c0ef7ae000dcca7f43a386d43064aaea62) )
363   ROM_LOAD( "405e07",     0x2000, 0x2000, CRC(963a44f9) SHA1(03cd7699668b010f27af025ba6bd44509526ec7b) )
364   ROM_LOAD( "405e08",     0x4000, 0x2000, CRC(63901deb) SHA1(c65d896298846ed8b70a4d38b32820746214fa5c) )
365   ROM_LOAD( "405e09",     0x6000, 0x2000, CRC(e1873677) SHA1(19788e43cc1a6cf5ab375cbc2c745bb6cc8c163d) )
366   ROM_LOAD( "405e10",     0x8000, 0x2000, CRC(824815e8) SHA1(470e9d74fa2c397605a74e0bf173a6d9db4cc721) )
367   ROM_LOAD( "405e11",     0xa000, 0x2000, CRC(dca9b447) SHA1(12d7e85dc2fc6bd4ea7ad9035ae0b7487e4bc4bc) )
368
369   ROM_REGION( 0x0500, "proms", 0 ) /* roms located on the CPU/Video board */
370   ROM_LOAD( "405e17.5a",  0x0000, 0x0100, CRC(b4c36d57) SHA1(c4a63f57edce2b9588e2394ff54a28f91213d550) ) /* palette red component */
371   ROM_LOAD( "405e16.4a",  0x0100, 0x0100, CRC(0b7b03b8) SHA1(81297cb2b0b28b0fc0939a37ff30844d69fb65ac) ) /* palette green component */
372   ROM_LOAD( "405e18.6a",  0x0200, 0x0100, CRC(9e533bad) SHA1(611e7af6813caaf2bc36c311ae48a5efd30e6f0c) ) /* palette blue component */
373   ROM_LOAD( "405e20.19d", 0x0300, 0x0100, CRC(8ca6de2f) SHA1(67d29708d1a07d17c5dc5793a3293e7ace3a4e19) ) /* character lookup table */
374   ROM_LOAD( "405e19.16d", 0x0400, 0x0100, CRC(e0bc782f) SHA1(9f71e696d11a60f771535f6837ecad6132047b0a) ) /* sprite lookup table */
375
376   ROM_REGION( 0x10000, "vlm", 0 ) /* 64k for speech rom, located on Sound Board */
377   ROM_LOAD( "405e15.11f", 0x0000, 0x2000, CRC(01bb5ce9) SHA1(f48477b4011befba13c8bcd83e0c9f7deb14a1e1) )
339378ROM_END
340379
341ROM_START( sbasketu )
342   ROM_REGION( 0x10000, "main", 0 )
343   ROM_LOAD( "sbb_j13.bin",  0x6000, 0x2000, CRC(263ec36b) SHA1(b445b600726ba4935623311e1a178aeb4a356b0a) )
344   ROM_LOAD( "sbb_j11.bin",  0x8000, 0x4000, CRC(0a4d7a82) SHA1(2e0153b41e23284427881258a44bd55be3570eb2) )
345   ROM_LOAD( "sbb_j09.bin",  0xc000, 0x4000, CRC(4f9dd9a0) SHA1(97f4c208509d50a7ce4c1ebe8a3f643ad75e833b) )
346380
347   ROM_REGION( 0x10000, "audio", 0 )
348   ROM_LOAD( "405e13",       0x0000, 0x2000, CRC(1ec7458b) SHA1(a015b982bff5f9e7ece33f2e69ff8c6c2174e710) )
381/*
382    Super Basketball (version E, encrypted)
383*/
349384
350   ROM_REGION( 0x04000, "gfx1", ROMREGION_DISPOSE )
351   ROM_LOAD( "405e12",       0x0000, 0x4000, CRC(e02c54da) SHA1(2fa19f3bce894ef05820f95e0b88428e4f946a35) )
385ROM_START( sbaskete )
386   ROM_REGION( 0x10000, "main", 0 ) /* roms located on the CPU/Video board */
387   ROM_LOAD( "405e05",     0x6000, 0x2000, CRC(32ea5b71) SHA1(d917c31d2c9a7229396e4a930e8d27394329533a) )
388   ROM_LOAD( "405e04",     0x8000, 0x2000, CRC(7abf3087) SHA1(fbaaaaae0b8bed1bc6ad7f2da267c2ef8bd75b15) )
389   ROM_LOAD( "405e03",     0xa000, 0x2000, CRC(9c6fcdcd) SHA1(a644ec98f49f84311829149c181aba25e7681793) )
390   ROM_LOAD( "405e02",     0xc000, 0x2000, CRC(0f145648) SHA1(2e238eb0663295887bf6b4905f1fd386db16d82a) )
391   ROM_LOAD( "405e01",     0xe000, 0x2000, CRC(6a27f1b1) SHA1(38c0be98fb122a7a6ed833af011bda5663a06510) )
352392
353   ROM_REGION( 0x0c000, "gfx2", ROMREGION_DISPOSE )
354   ROM_LOAD( "405e06",       0x0000, 0x2000, CRC(7e2f5bb2) SHA1(e22008c0ef7ae000dcca7f43a386d43064aaea62) )
355   ROM_LOAD( "405e07",       0x2000, 0x2000, CRC(963a44f9) SHA1(03cd7699668b010f27af025ba6bd44509526ec7b) )
356   ROM_LOAD( "405e08",       0x4000, 0x2000, CRC(63901deb) SHA1(c65d896298846ed8b70a4d38b32820746214fa5c) )
357   ROM_LOAD( "405e09",       0x6000, 0x2000, CRC(e1873677) SHA1(19788e43cc1a6cf5ab375cbc2c745bb6cc8c163d) )
358   ROM_LOAD( "405e10",       0x8000, 0x2000, CRC(824815e8) SHA1(470e9d74fa2c397605a74e0bf173a6d9db4cc721) )
359   ROM_LOAD( "405e11",       0xa000, 0x2000, CRC(dca9b447) SHA1(12d7e85dc2fc6bd4ea7ad9035ae0b7487e4bc4bc) )
393   ROM_REGION( 0x10000, "audio", 0 ) /* roms located on Sound Board  */
394   ROM_LOAD( "405e13.7a",  0x0000, 0x2000, CRC(1ec7458b) SHA1(a015b982bff5f9e7ece33f2e69ff8c6c2174e710) )
360395
361   ROM_REGION( 0x0500, "proms", 0 )
362   ROM_LOAD( "405e17",       0x0000, 0x0100, CRC(b4c36d57) SHA1(c4a63f57edce2b9588e2394ff54a28f91213d550) ) /* palette red component */
363   ROM_LOAD( "405e16",       0x0100, 0x0100, CRC(0b7b03b8) SHA1(81297cb2b0b28b0fc0939a37ff30844d69fb65ac) ) /* palette green component */
364   ROM_LOAD( "405e18",       0x0200, 0x0100, CRC(9e533bad) SHA1(611e7af6813caaf2bc36c311ae48a5efd30e6f0c) ) /* palette blue component */
365   ROM_LOAD( "405e20",       0x0300, 0x0100, CRC(8ca6de2f) SHA1(67d29708d1a07d17c5dc5793a3293e7ace3a4e19) ) /* character lookup table */
366   ROM_LOAD( "405e19",       0x0400, 0x0100, CRC(e0bc782f) SHA1(9f71e696d11a60f771535f6837ecad6132047b0a) ) /* sprite lookup table */
396   ROM_REGION( 0x04000, "gfx1", ROMREGION_DISPOSE ) /* roms located on the CPU/Video board */
397   ROM_LOAD( "405e12.22f", 0x0000, 0x4000, CRC(e02c54da) SHA1(2fa19f3bce894ef05820f95e0b88428e4f946a35) )
367398
368   ROM_REGION( 0x10000, "vlm", 0 )     /* 64k for speech rom */
369   ROM_LOAD( "405e15",       0x0000, 0x2000, CRC(01bb5ce9) SHA1(f48477b4011befba13c8bcd83e0c9f7deb14a1e1) )
399   ROM_REGION( 0x0c000, "gfx2", ROMREGION_DISPOSE ) /* roms located on the CPU/Video board */
400   ROM_LOAD( "405e06",     0x0000, 0x2000, CRC(7e2f5bb2) SHA1(e22008c0ef7ae000dcca7f43a386d43064aaea62) )
401   ROM_LOAD( "405e07",     0x2000, 0x2000, CRC(963a44f9) SHA1(03cd7699668b010f27af025ba6bd44509526ec7b) )
402   ROM_LOAD( "405e08",     0x4000, 0x2000, CRC(63901deb) SHA1(c65d896298846ed8b70a4d38b32820746214fa5c) )
403   ROM_LOAD( "405e09",     0x6000, 0x2000, CRC(e1873677) SHA1(19788e43cc1a6cf5ab375cbc2c745bb6cc8c163d) )
404   ROM_LOAD( "405e10",     0x8000, 0x2000, CRC(824815e8) SHA1(470e9d74fa2c397605a74e0bf173a6d9db4cc721) )
405   ROM_LOAD( "405e11",     0xa000, 0x2000, CRC(dca9b447) SHA1(12d7e85dc2fc6bd4ea7ad9035ae0b7487e4bc4bc) )
406
407   ROM_REGION( 0x0500, "proms", 0 ) /* roms located on the CPU/Video board */
408   ROM_LOAD( "405e17.5a",  0x0000, 0x0100, CRC(b4c36d57) SHA1(c4a63f57edce2b9588e2394ff54a28f91213d550) ) /* palette red component */
409   ROM_LOAD( "405e16.4a",  0x0100, 0x0100, CRC(0b7b03b8) SHA1(81297cb2b0b28b0fc0939a37ff30844d69fb65ac) ) /* palette green component */
410   ROM_LOAD( "405e18.6a",  0x0200, 0x0100, CRC(9e533bad) SHA1(611e7af6813caaf2bc36c311ae48a5efd30e6f0c) ) /* palette blue component */
411   ROM_LOAD( "405e20.19d", 0x0300, 0x0100, CRC(8ca6de2f) SHA1(67d29708d1a07d17c5dc5793a3293e7ace3a4e19) ) /* character lookup table */
412   ROM_LOAD( "405e19.16d", 0x0400, 0x0100, CRC(e0bc782f) SHA1(9f71e696d11a60f771535f6837ecad6132047b0a) ) /* sprite lookup table */
413
414   ROM_REGION( 0x10000, "vlm", 0 ) /* 64k for speech rom, located on Sound Board */
415   ROM_LOAD( "405e15.11f", 0x0000, 0x2000, CRC(01bb5ce9) SHA1(f48477b4011befba13c8bcd83e0c9f7deb14a1e1) )
370416ROM_END
371417
372418
r3232r3233
375421   konami1_decode(machine, "main");
376422}
377423
378
379GAME( 1984, sbasketb, 0,        sbasketb, sbasketb, sbasketb, ROT90, "Konami", "Super Basketball (version G)", 0 )
380GAME( 1984, sbasketo, sbasketb, sbasketb, sbasketb, sbasketb, ROT90, "Konami", "Super Basketball (version E)", 0 )
381GAME( 1984, sbasketu, sbasketb, sbasketb, sbasketb, 0,        ROT90, "Konami", "Super Basketball (not encrypted)", 0 )
424GAME( 1984, sbasketb, 0,        sbasketb, sbasketb, 0,        ROT90, "Konami", "Super Basketball (version H, unprotected)", GAME_SUPPORTS_SAVE )
425GAME( 1984, sbasketg, sbasketb, sbasketb, sbasketb, sbasketb, ROT90, "Konami", "Super Basketball (version G, encrypted)",   GAME_SUPPORTS_SAVE )
426GAME( 1984, sbaskete, sbasketb, sbasketb, sbasketb, sbasketb, ROT90, "Konami", "Super Basketball (version E, encrypted)",   GAME_SUPPORTS_SAVE )
src/mame/drivers/xexex.c
r3232r3233
8383static INT32 cur_sound_region, xexex_strip0x1a;
8484static int suspension_active, resume_trigger;
8585static emu_timer *dmadelay_timer;
86static int frame;
8687
8788
8889static const eeprom_interface eeprom_intf =
r3232r3233
147148
148149static void xexex_objdma(running_machine *machine, int limiter)
149150{
150   static int frame = -1;
151
152151   int counter, num_inactive;
153152   UINT16 *src, *dst;
154153
r3232r3233
602601
603602static MACHINE_RESET( xexex )
604603{
604   cur_control2 = 0;
605   init_eeprom_count = 0;
605606   cur_sound_region = 0;
606607   suspension_active = 0;
608   resume_trigger = 0;
609   frame = -1;
607610   k054539_init_flags(0, K054539_REVERSE_STEREO);
608611}
609612
src/mame/drivers/cps3.c
r3232r3233
19731973static UINT32 chardma_other;
19741974
19751975//static UINT8* current_table;
1976static UINT32 current_table_address = -1;
1976static UINT32 current_table_address;
19771977
19781978static int cps3_rle_length = 0;
19791979
r3232r3233
24592459
24602460static MACHINE_RESET( cps3 )
24612461{
2462   current_table_address = -1;
2463
24622464   if (cps3_use_fastboot)
24632465   {
24642466      fastboot_timer = timer_alloc(fastboot_timer_callback, NULL);
src/mame/drivers/mjkjidai.c
r3232r3233
104104static READ8_HANDLER( keyboard_r )
105105{
106106   int res = 0x3f,i;
107   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7", "KEY8", "KEY9", "KEY10", "KEY11" };
107   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7", "KEY8", "KEY9", "KEY10", "KEY11" };
108108
109109//  logerror("%04x: keyboard_r\n", activecpu_get_pc());
110110
src/mame/drivers/jailbrek.c
r3232r3233
55Ernesto Corvi
66ernesto@imagina.com
77
8
9Konami designated Jail Break with the label of GX507.  (There is also
10the label PWB 300394A silk screened onto the board.)
11
12
13Board Parts:
14
15    Konami A082 @ 11a (Encrypted 6809 CPU)
16    VLM5030 @ 6a
17    Konami 005849 @ 8e
18    18.432000MHz @ OSC
19    3.579545MHz @ XTAL
20    SN76489AN @ 6d
21    6301 @ 6f and 7f (PROM's)
22    6331 @ 1f and 2f (PROM's)
23
824***************************************************************************/
925
1026/*
r3232r3233
126142   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
127143
128144   PORT_START("DSW1")      /* $3303 */
129   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
145   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )      PORT_DIPLOCATION( "SW1:4,3,2,1" )
130146   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
131147   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
132148   PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
r3232r3233
143159   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
144160   PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) )
145161   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
146   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )
162   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )      PORT_DIPLOCATION( "SW1:8,7,6,5" )
147163   PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )
148164   PORT_DIPSETTING(    0x50, DEF_STR( 3C_1C ) )
149165   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
r3232r3233
162178   PORT_DIPSETTING(    0x00, "Invalid" )
163179
164180   PORT_START("DSW2")      /* $3100 */
165   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
181   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )       PORT_DIPLOCATION( "SW2:1,2" )
166182   PORT_DIPSETTING(    0x03, "1" )
167183   PORT_DIPSETTING(    0x02, "2" )
168184   PORT_DIPSETTING(    0x01, "3" )
169185   PORT_DIPSETTING(    0x00, "5" )
170   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )
186   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )     PORT_DIPLOCATION( "SW2:3" )
171187   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
172188   PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) )
173   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Bonus_Life ) )
189   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Bonus_Life ) )  PORT_DIPLOCATION( "SW2:4" )
174190   PORT_DIPSETTING(    0x08, "30K 70K+" )
175191   PORT_DIPSETTING(    0x00, "40K 80K+" )
176   PORT_DIPNAME( 0x30, 0x10, DEF_STR( Difficulty ) )
192   PORT_DIPNAME( 0x30, 0x10, DEF_STR( Difficulty ) )  PORT_DIPLOCATION( "SW2:5,6" )
177193   PORT_DIPSETTING(    0x30, DEF_STR( Easy ) )
178194   PORT_DIPSETTING(    0x20, DEF_STR( Normal ) )
179195   PORT_DIPSETTING(    0x10, "Difficult" )
180196   PORT_DIPSETTING(    0x00, "Very Difficult" )
181   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
182   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
197   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )        PORT_DIPLOCATION( "SW2:7" )
198   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION( "SW2:8" )
183199   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
184200   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
185201
186202   PORT_START("DSW3")      /* $3200 */
187   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
203   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION( "SW3:1" )
188204   PORT_DIPSETTING(   0x01, DEF_STR( Off ) )
189205   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
190   PORT_DIPNAME( 0x02, 0x02, "Upright Controls" )
206   PORT_DIPNAME( 0x02, 0x02, "Upright Controls" )     PORT_DIPLOCATION( "SW3:2" )
191207   PORT_DIPSETTING(    0x02, DEF_STR( Single ) )
192208   PORT_DIPSETTING(    0x00, DEF_STR( Dual ) )
193   PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNUSED )
209   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )        PORT_DIPLOCATION( "SW3:3" )
210   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )        PORT_DIPLOCATION( "SW3:4" )
194211INPUT_PORTS_END
195212
196213
r3232r3233
256273   /* sound hardware */
257274   MDRV_SPEAKER_STANDARD_MONO("mono")
258275
259   MDRV_SOUND_ADD("sn", SN76496, MASTER_CLOCK/12)
276   MDRV_SOUND_ADD("sn", SN76489, MASTER_CLOCK/12)
260277   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
261278
262279   MDRV_SOUND_ADD("vlm", VLM5030, VOICE_CLOCK)
r3232r3233
272289
273290ROM_START( jailbrek )
274291    ROM_REGION( 0x10000, "main", 0 )
275   ROM_LOAD( "jailb11d.bin", 0x8000, 0x4000, CRC(a0b88dfd) SHA1(f999e382b9d3b812fca41f4d0da3ea692fef6b19) )
276   ROM_LOAD( "jailb9d.bin",  0xc000, 0x4000, CRC(444b7d8e) SHA1(c708b67c2d249448dae9a3d10c24d13ba6849597) )
292   ROM_LOAD( "507p03.11d", 0x8000, 0x4000, CRC(a0b88dfd) SHA1(f999e382b9d3b812fca41f4d0da3ea692fef6b19) )
293   ROM_LOAD( "507p02.9d",  0xc000, 0x4000, CRC(444b7d8e) SHA1(c708b67c2d249448dae9a3d10c24d13ba6849597) )
277294
278295    ROM_REGION( 0x08000, "gfx1", ROMREGION_DISPOSE )
279   ROM_LOAD( "jailb4f.bin",  0x00000, 0x4000, CRC(e3b7a226) SHA1(c19a02a2def65648bf198fccec98ebbd2fc7c0fb) )   /* characters */
280    ROM_LOAD( "jailb5f.bin",  0x04000, 0x4000, CRC(504f0912) SHA1(b51a45dd5506bccdf0061dd6edd7f49ac86ed0f8) )
296   ROM_LOAD( "507l08.4f",  0x0000, 0x4000, CRC(e3b7a226) SHA1(c19a02a2def65648bf198fccec98ebbd2fc7c0fb) )   /* characters */
297    ROM_LOAD( "507j09.5f",  0x4000, 0x4000, CRC(504f0912) SHA1(b51a45dd5506bccdf0061dd6edd7f49ac86ed0f8) )
281298
282299    ROM_REGION( 0x10000, "gfx2", ROMREGION_DISPOSE )
283    ROM_LOAD( "jailb3e.bin",  0x00000, 0x4000, CRC(0d269524) SHA1(a10ddb405e884bfec521a3c7a29d22f63e535b59) )   /* sprites */
284    ROM_LOAD( "jailb4e.bin",  0x04000, 0x4000, CRC(27d4f6f4) SHA1(c42c064dbd7c5cf0b1d99651367e0bee1728a5b0) )
285    ROM_LOAD( "jailb5e.bin",  0x08000, 0x4000, CRC(717485cb) SHA1(22609489186dcb3d7cd49b7ddfdc6f04d0739354) )
286    ROM_LOAD( "jailb3f.bin",  0x0c000, 0x4000, CRC(e933086f) SHA1(c0fd1e8d23c0f7e14c0b75f629448034420cf8ef) )
300    ROM_LOAD( "507j04.3e",  0x0000, 0x4000, CRC(0d269524) SHA1(a10ddb405e884bfec521a3c7a29d22f63e535b59) )   /* sprites */
301    ROM_LOAD( "507j05.4e",  0x4000, 0x4000, CRC(27d4f6f4) SHA1(c42c064dbd7c5cf0b1d99651367e0bee1728a5b0) )
302    ROM_LOAD( "507j06.5e",  0x8000, 0x4000, CRC(717485cb) SHA1(22609489186dcb3d7cd49b7ddfdc6f04d0739354) )
303    ROM_LOAD( "507j07.3f",  0xc000, 0x4000, CRC(e933086f) SHA1(c0fd1e8d23c0f7e14c0b75f629448034420cf8ef) )
287304
288305   ROM_REGION( 0x0240, "proms", 0 )
289   ROM_LOAD( "jailbbl.cl2",  0x0000, 0x0020, CRC(f1909605) SHA1(91eaa865375b3bc052897732b64b1ff7df3f78f6) ) /* red & green */
290   ROM_LOAD( "jailbbl.cl1",  0x0020, 0x0020, CRC(f70bb122) SHA1(bf77990260e8346faa3d3481718cbe46a4a27150) ) /* blue */
291   ROM_LOAD( "jailbbl.bp2",  0x0040, 0x0100, CRC(d4fe5c97) SHA1(972e9dab6c53722545dd3a43e3ada7921e88708b) ) /* char lookup */
292   ROM_LOAD( "jailbbl.bp1",  0x0140, 0x0100, CRC(0266c7db) SHA1(a8f21e86e6d974c9bfd92a147689d0e7316d66e2) ) /* sprites lookup */
306    ROM_LOAD( "507j10.1f",  0x0000, 0x0020, CRC(f1909605) SHA1(91eaa865375b3bc052897732b64b1ff7df3f78f6) ) /* red & green */
307    ROM_LOAD( "507j11.2f",  0x0020, 0x0020, CRC(f70bb122) SHA1(bf77990260e8346faa3d3481718cbe46a4a27150) ) /* blue */
308    ROM_LOAD( "507j13.7f",  0x0040, 0x0100, CRC(d4fe5c97) SHA1(972e9dab6c53722545dd3a43e3ada7921e88708b) ) /* char lookup */
309    ROM_LOAD( "507j12.6f",  0x0140, 0x0100, CRC(0266c7db) SHA1(a8f21e86e6d974c9bfd92a147689d0e7316d66e2) ) /* sprites lookup */
293310
294   ROM_REGION( 0x2000, "vlm", 0 ) /* speech rom */
295   ROM_LOAD( "jailb8c.bin",  0x0000, 0x2000, CRC(d91d15e3) SHA1(475fe50aafbf8f2fb79880ef0e2c25158eda5270) )
311    ROM_REGION( 0x4000, "vlm", 0 ) /* speech rom */
312    ROM_LOAD( "507l01.8c",  0x0000, 0x4000, CRC(0c8a3605) SHA1(d886b66d3861c3a90a1825ccf5bf0011831ca366) )
296313ROM_END
297314
298315ROM_START( manhatan )
299316    ROM_REGION( 0x10000, "main", 0 )
300    ROM_LOAD( "507-n03.11d", 0x8000, 0x4000, CRC(e5039f7e) SHA1(0f12484ed40444d978e0405c27bdd027ae2e2a0b) )
301    ROM_LOAD( "507-n02.9d",  0xc000, 0x4000, CRC(143cc62c) SHA1(9520dbb1b6f1fa439e03d4caa9bed96ef8f805f2) )
317    ROM_LOAD( "507n03.11d", 0x8000, 0x4000, CRC(e5039f7e) SHA1(0f12484ed40444d978e0405c27bdd027ae2e2a0b) )
318    ROM_LOAD( "507n02.9d",  0xc000, 0x4000, CRC(143cc62c) SHA1(9520dbb1b6f1fa439e03d4caa9bed96ef8f805f2) )
302319
303320    ROM_REGION( 0x08000, "gfx1", ROMREGION_DISPOSE )
304    ROM_LOAD( "507-j08.4f",  0x00000, 0x4000, CRC(175e1b49) SHA1(4cfe982cdf7729bd05c6da803480571876320bf6) )   /* characters */
305    ROM_LOAD( "507-j09.5f",  0x04000, 0x4000, CRC(504f0912) SHA1(b51a45dd5506bccdf0061dd6edd7f49ac86ed0f8) )
321    ROM_LOAD( "507j08.4f",  0x0000, 0x4000, CRC(175e1b49) SHA1(4cfe982cdf7729bd05c6da803480571876320bf6) )   /* characters */
322    ROM_LOAD( "507j09.5f",  0x4000, 0x4000, CRC(504f0912) SHA1(b51a45dd5506bccdf0061dd6edd7f49ac86ed0f8) )
306323
307324    ROM_REGION( 0x10000, "gfx2", ROMREGION_DISPOSE )
308    ROM_LOAD( "507-j04.3e",  0x00000, 0x4000, CRC(0d269524) SHA1(a10ddb405e884bfec521a3c7a29d22f63e535b59) )   /* sprites */
309    ROM_LOAD( "507-j05.4e",  0x04000, 0x4000, CRC(27d4f6f4) SHA1(c42c064dbd7c5cf0b1d99651367e0bee1728a5b0) )
310    ROM_LOAD( "507-j06.5e",  0x08000, 0x4000, CRC(717485cb) SHA1(22609489186dcb3d7cd49b7ddfdc6f04d0739354) )
311    ROM_LOAD( "507-j07.3f",  0x0c000, 0x4000, CRC(e933086f) SHA1(c0fd1e8d23c0f7e14c0b75f629448034420cf8ef) )
325    ROM_LOAD( "507j04.3e",  0x0000, 0x4000, CRC(0d269524) SHA1(a10ddb405e884bfec521a3c7a29d22f63e535b59) )   /* sprites */
326    ROM_LOAD( "507j05.4e",  0x4000, 0x4000, CRC(27d4f6f4) SHA1(c42c064dbd7c5cf0b1d99651367e0bee1728a5b0) )
327    ROM_LOAD( "507j06.5e",  0x8000, 0x4000, CRC(717485cb) SHA1(22609489186dcb3d7cd49b7ddfdc6f04d0739354) )
328    ROM_LOAD( "507j07.3f",  0xc000, 0x4000, CRC(e933086f) SHA1(c0fd1e8d23c0f7e14c0b75f629448034420cf8ef) )
312329
313330   ROM_REGION( 0x0240, "proms", 0 )
314    ROM_LOAD( "507j10.1f",   0x0000, 0x0020, CRC(f1909605) SHA1(91eaa865375b3bc052897732b64b1ff7df3f78f6) ) /* red & green */
315    ROM_LOAD( "507j11.2f",   0x0020, 0x0020, CRC(f70bb122) SHA1(bf77990260e8346faa3d3481718cbe46a4a27150) ) /* blue */
316    ROM_LOAD( "507j13.7f",   0x0040, 0x0100, CRC(d4fe5c97) SHA1(972e9dab6c53722545dd3a43e3ada7921e88708b) ) /* char lookup */
317    ROM_LOAD( "507j12.6f",   0x0140, 0x0100, CRC(0266c7db) SHA1(a8f21e86e6d974c9bfd92a147689d0e7316d66e2) ) /* sprites lookup */
331    ROM_LOAD( "507j10.1f",  0x0000, 0x0020, CRC(f1909605) SHA1(91eaa865375b3bc052897732b64b1ff7df3f78f6) ) /* red & green */
332    ROM_LOAD( "507j11.2f",  0x0020, 0x0020, CRC(f70bb122) SHA1(bf77990260e8346faa3d3481718cbe46a4a27150) ) /* blue */
333    ROM_LOAD( "507j13.7f",  0x0040, 0x0100, CRC(d4fe5c97) SHA1(972e9dab6c53722545dd3a43e3ada7921e88708b) ) /* char lookup */
334    ROM_LOAD( "507j12.6f",  0x0140, 0x0100, CRC(0266c7db) SHA1(a8f21e86e6d974c9bfd92a147689d0e7316d66e2) ) /* sprites lookup */
318335
319336    ROM_REGION( 0x4000, "vlm", 0 ) /* speech rom */
320    ROM_LOAD( "507-p01.8c",   0x0000, 0x4000, CRC(973fa351) SHA1(ac360d05ed4d03334e00c80e70d5ae939d93af5f) )
337    ROM_LOAD( "507p01.8c",  0x0000, 0x4000, CRC(973fa351) SHA1(ac360d05ed4d03334e00c80e70d5ae939d93af5f) )
321338ROM_END
322339
323340/*
src/mame/drivers/tankbust.c
r3232r3233
184184}
185185#endif
186186
187static int variable_data=0x11;
187static UINT8 variable_data;
188188static READ8_HANDLER( some_changing_input )
189189{
190   variable_data = (variable_data+8) & 0xff;
190   variable_data += 8;
191191   return variable_data;
192192}
193193
r3232r3233
333333   NULL
334334};
335335
336static MACHINE_RESET( tankbust )
337{
338   variable_data = 0x11;
339}
340
341
336342static MACHINE_DRIVER_START( tankbust )
337343
338344   /* basic machine hardware */
r3232r3233
346352
347353   MDRV_INTERLEAVE(100)
348354
349//MDRV_MACHINE_RESET( ... )
355   MDRV_MACHINE_RESET( tankbust )
350356
351357   /* video hardware */
352358   MDRV_SCREEN_ADD("main", RASTER)
src/mame/drivers/seattle.c
r3232r3233
13961396
13971397static WRITE32_HANDLER( analog_port_w )
13981398{
1399   static const char *portnames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5", "AN6", "AN7" };
1399   static const char *const portnames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5", "AN6", "AN7" };
14001400
14011401   if (data < 8 || data > 15)
14021402      logerror("%08X:Unexpected analog port select = %08X\n", activecpu_get_pc(), data);
src/mame/drivers/munchmo.c
r3232r3233
3030VIDEO_START( mnchmobl );
3131WRITE8_HANDLER( mnchmobl_palette_bank_w );
3232WRITE8_HANDLER( mnchmobl_flipscreen_w );
33READ8_HANDLER( mnchmobl_sprite_xpos_r );
34WRITE8_HANDLER( mnchmobl_sprite_xpos_w );
35READ8_HANDLER( mnchmobl_sprite_attr_r );
36WRITE8_HANDLER( mnchmobl_sprite_attr_w );
37READ8_HANDLER( mnchmobl_sprite_tile_r );
38WRITE8_HANDLER( mnchmobl_sprite_tile_w );
3933VIDEO_UPDATE( mnchmobl );
4034
4135
r3232r3233
6761   cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, CLEAR_LINE);
6862}
6963
70static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
71   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
72   AM_RANGE(0x8000, 0x83ff) AM_READ(SMH_RAM) /* working RAM */
73   AM_RANGE(0xa000, 0xa3ff) AM_READ(SMH_RAM)
74   AM_RANGE(0xa400, 0xa7ff) AM_READ(mnchmobl_sprite_xpos_r) /* mirrored */
75   AM_RANGE(0xa800, 0xabff) AM_READ(SMH_RAM)
76   AM_RANGE(0xac00, 0xafff) AM_READ(mnchmobl_sprite_tile_r) /* mirrored */
77   AM_RANGE(0xb000, 0xb3ff) AM_READ(SMH_RAM)
78   AM_RANGE(0xb400, 0xb7ff) AM_READ(mnchmobl_sprite_attr_r) /* mirrored */
79   AM_RANGE(0xb800, 0xb8ff) AM_MIRROR(0x0100) AM_READ(SMH_RAM)
80   AM_RANGE(0xbe02, 0xbe02) AM_READ_PORT("DSW1")
81   AM_RANGE(0xbe03, 0xbe03) AM_READ_PORT("DSW2")
82   AM_RANGE(0xbf01, 0xbf01) AM_READ_PORT("SYSTEM")
83   AM_RANGE(0xbf02, 0xbf02) AM_READ_PORT("P1")
84   AM_RANGE(0xbf03, 0xbf03) AM_READ_PORT("P2")
85ADDRESS_MAP_END
8664
87static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
88    AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
89   AM_RANGE(0x8000, 0x83ff) AM_WRITE(SMH_RAM) /* working RAM */
90   AM_RANGE(0xa000, 0xa3ff) AM_WRITE(SMH_RAM) AM_BASE(&mnchmobl_sprite_xpos)
91   AM_RANGE(0xa400, 0xa7ff) AM_WRITE(mnchmobl_sprite_xpos_w)
92   AM_RANGE(0xa800, 0xabff) AM_WRITE(SMH_RAM) AM_BASE(&mnchmobl_sprite_tile)
93   AM_RANGE(0xac00, 0xafff) AM_WRITE(mnchmobl_sprite_tile_w)
94   AM_RANGE(0xb000, 0xb3ff) AM_WRITE(SMH_RAM) AM_BASE(&mnchmobl_sprite_attr)
95   AM_RANGE(0xb400, 0xb7ff) AM_WRITE(mnchmobl_sprite_attr_w)
96   AM_RANGE(0xb800, 0xb8ff) AM_MIRROR(0x0100) AM_WRITE(SMH_RAM) AM_BASE(&videoram)
97   AM_RANGE(0xba00, 0xbbff) AM_WRITE(SMH_RAM)
98   AM_RANGE(0xbc00, 0xbc7f) AM_WRITE(SMH_RAM) AM_BASE(&mnchmobl_status_vram)
65static ADDRESS_MAP_START( munchmo_map, ADDRESS_SPACE_PROGRAM, 8 )
66    AM_RANGE(0x0000, 0x3fff) AM_ROM
67   AM_RANGE(0x8000, 0x83ff) AM_RAM
68   AM_RANGE(0xa000, 0xa3ff) AM_MIRROR(0x0400) AM_RAM AM_BASE(&mnchmobl_sprite_xpos)
69   AM_RANGE(0xa800, 0xabff) AM_MIRROR(0x0400) AM_RAM AM_BASE(&mnchmobl_sprite_tile)
70   AM_RANGE(0xb000, 0xb3ff) AM_MIRROR(0x0400) AM_RAM AM_BASE(&mnchmobl_sprite_attr)
71   AM_RANGE(0xb800, 0xb8ff) AM_MIRROR(0x0100) AM_RAM AM_BASE(&videoram)
72   AM_RANGE(0xbaba, 0xbaba) AM_WRITENOP /* ? */
73   AM_RANGE(0xbc00, 0xbc7f) AM_RAM AM_BASE(&mnchmobl_status_vram)
9974   AM_RANGE(0xbe00, 0xbe00) AM_WRITE(mnchmobl_soundlatch_w)
10075   AM_RANGE(0xbe01, 0xbe01) AM_WRITE(mnchmobl_palette_bank_w)
101   AM_RANGE(0xbe11, 0xbe11) AM_WRITE(SMH_RAM) /* ? */
102   AM_RANGE(0xbe21, 0xbe21) AM_WRITE(SMH_RAM) /* ? */
103   AM_RANGE(0xbe31, 0xbe31) AM_WRITE(SMH_RAM) /* ? */
76   AM_RANGE(0xbe02, 0xbe02) AM_READ_PORT("DSW1")
77   AM_RANGE(0xbe03, 0xbe03) AM_READ_PORT("DSW2")
78   AM_RANGE(0xbe11, 0xbe11) AM_WRITENOP /* ? */
79   AM_RANGE(0xbe21, 0xbe21) AM_WRITENOP /* ? */
80   AM_RANGE(0xbe31, 0xbe31) AM_WRITENOP /* ? */
10481   AM_RANGE(0xbe41, 0xbe41) AM_WRITE(mnchmobl_flipscreen_w)
10582   AM_RANGE(0xbe61, 0xbe61) AM_WRITE(mnchmobl_nmi_enable_w) /* ENI 1-10C */
10683   AM_RANGE(0xbf00, 0xbf07) AM_WRITE(SMH_RAM) AM_BASE(&mnchmobl_vreg) /* MY0 1-8C */
84   AM_RANGE(0xbf01, 0xbf01) AM_READ_PORT("SYSTEM")
85   AM_RANGE(0xbf02, 0xbf02) AM_READ_PORT("P1")
86   AM_RANGE(0xbf03, 0xbf03) AM_READ_PORT("P2")
10787ADDRESS_MAP_END
10888
109static ADDRESS_MAP_START( readmem_sound, ADDRESS_SPACE_PROGRAM, 8 )
110   AM_RANGE(0x0000, 0x1fff) AM_READ(SMH_ROM)
89static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
90   AM_RANGE(0x0000, 0x1fff) AM_ROM
11191   AM_RANGE(0x2000, 0x2000) AM_READ(soundlatch_r)
112   AM_RANGE(0xe000, 0xe7ff) AM_READ(SMH_RAM)
113ADDRESS_MAP_END
114
115static ADDRESS_MAP_START( writemem_sound, ADDRESS_SPACE_PROGRAM, 8 )
116   AM_RANGE(0x0000, 0x1fff) AM_WRITE(SMH_ROM)
11792   AM_RANGE(0x4000, 0x4000) AM_WRITE(ay8910_write_port_0_w)
11893   AM_RANGE(0x5000, 0x5000) AM_WRITE(ay8910_control_port_0_w)
11994   AM_RANGE(0x6000, 0x6000) AM_WRITE(ay8910_write_port_1_w)
12095   AM_RANGE(0x7000, 0x7000) AM_WRITE(ay8910_control_port_1_w)
121   AM_RANGE(0x8000, 0x8000) AM_WRITE(SMH_NOP) /* ? */
122   AM_RANGE(0xa000, 0xa000) AM_WRITE(SMH_NOP) /* ? */
96   AM_RANGE(0x8000, 0x8000) AM_WRITENOP /* ? */
97   AM_RANGE(0xa000, 0xa000) AM_WRITENOP /* ? */
12398   AM_RANGE(0xc000, 0xc000) AM_WRITE(sound_nmi_ack_w)
124   AM_RANGE(0xe000, 0xe7ff) AM_WRITE(SMH_RAM)
99   AM_RANGE(0xe000, 0xe7ff) AM_RAM
125100ADDRESS_MAP_END
126101
102
127103static INPUT_PORTS_START( mnchmobl )
128104   PORT_START("SYSTEM")
129105   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
r3232r3233
282258
283259   /* basic machine hardware */
284260   MDRV_CPU_ADD("main", Z80, 3750000) /* ? */
285   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
261   MDRV_CPU_PROGRAM_MAP(munchmo_map,0)
286262   MDRV_CPU_VBLANK_INT_HACK(mnchmobl_interrupt,2)
287263
288264   MDRV_CPU_ADD("audio", Z80, 3750000) /* ? */
289   MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound)
265   MDRV_CPU_PROGRAM_MAP(sound_map,0)
290266   MDRV_CPU_VBLANK_INT("main", nmi_line_assert)
291267
292268   /* video hardware */
src/mame/drivers/rockola.c
r3232r3233
861861   MDRV_SOUND_CONFIG(sasuke_samples_interface)
862862   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.12)
863863
864   MDRV_SOUND_ADD("SN76477.1", SN76477, 0)
864   MDRV_SOUND_ADD("sn76477.1", SN76477, 0)
865865   MDRV_SOUND_CONFIG(sasuke_sn76477_intf_1)
866866   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
867867
868   MDRV_SOUND_ADD("SN76477.2", SN76477, 0)
868   MDRV_SOUND_ADD("sn76477.2", SN76477, 0)
869869   MDRV_SOUND_CONFIG(sasuke_sn76477_intf_2)
870870   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
871871
872   MDRV_SOUND_ADD("SN76477.3", SN76477, 0)
872   MDRV_SOUND_ADD("sn76477.3", SN76477, 0)
873873   MDRV_SOUND_CONFIG(sasuke_sn76477_intf_3)
874874   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
875875MACHINE_DRIVER_END
r3232r3233
890890   MDRV_SOUND_CONFIG(vanguard_samples_interface)
891891   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
892892
893   MDRV_SOUND_REPLACE("SN76477.1", SN76477, 0)
893   MDRV_SOUND_REPLACE("sn76477.1", SN76477, 0)
894894   MDRV_SOUND_CONFIG(satansat_sn76477_intf)
895895   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
896896
897   MDRV_SOUND_REMOVE("SN76477.2")
898   MDRV_SOUND_REMOVE("SN76477.3")
897   MDRV_SOUND_REMOVE("sn76477.2")
898   MDRV_SOUND_REMOVE("sn76477.3")
899899MACHINE_DRIVER_END
900900
901901static MACHINE_DRIVER_START( vanguard )
r3232r3233
936936   MDRV_SOUND_CONFIG(vanguard_samples_interface)
937937   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
938938
939   MDRV_SOUND_ADD("SN76477.1", SN76477, 0)
939   MDRV_SOUND_ADD("sn76477.1", SN76477, 0)
940940   MDRV_SOUND_CONFIG(vanguard_sn76477_intf_1)
941941   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
942942
943   MDRV_SOUND_ADD("SN76477.2", SN76477, 0)
943   MDRV_SOUND_ADD("sn76477.2", SN76477, 0)
944944   MDRV_SOUND_CONFIG(vanguard_sn76477_intf_2)
945945   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
946946MACHINE_DRIVER_END
r3232r3233
956956   MDRV_SOUND_CONFIG(fantasy_samples_interface)
957957   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
958958
959   MDRV_SOUND_REPLACE("SN76477.1", SN76477, 0)
959   MDRV_SOUND_REPLACE("sn76477.1", SN76477, 0)
960960   MDRV_SOUND_CONFIG(fantasy_sn76477_intf)
961961   MDRV_SOUND_ROUTE_EX(0, "discrete", 1.0, 0)
962962
r3232r3233
964964   MDRV_SOUND_CONFIG_DISCRETE(fantasy)
965965   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
966966
967   MDRV_SOUND_REMOVE("SN76477.2")
967   MDRV_SOUND_REMOVE("sn76477.2")
968968MACHINE_DRIVER_END
969969
970970static MACHINE_DRIVER_START( nibbler )
src/mame/drivers/centiped.c
r3232r3233
509509INLINE int read_trackball(running_machine *machine, int idx, int switch_port)
510510{
511511   UINT8 newpos;
512   static const char *portnames[] = { "IN0", "IN1", "IN2" };
513   static const char *tracknames[] = { "TRACK0_X", "TRACK0_Y", "TRACK1_X", "TRACK1_Y" };
512   static const char *const portnames[] = { "IN0", "IN1", "IN2" };
513   static const char *const tracknames[] = { "TRACK0_X", "TRACK0_Y", "TRACK1_X", "TRACK1_Y" };
514514
515515   /* adjust idx if we're cocktail flipped */
516516   if (centiped_flipscreen)
r3232r3233
585585
586586static READ8_HANDLER( mazeinv_input_r )
587587{
588   static const char *sticknames[] = { "STICK0", "STICK1", "STICK2", "STICK3" };
588   static const char *const sticknames[] = { "STICK0", "STICK1", "STICK2", "STICK3" };
589589
590590   return input_port_read(machine, sticknames[control_select]);
591591}
r3232r3233
15891589   MDRV_NVRAM_HANDLER(atari_vg)
15901590
15911591   /* timer */
1592   MDRV_TIMER_ADD_SCANLINE("32V", generate_interrupt, "main", 0, 16)
1592   MDRV_TIMER_ADD_SCANLINE("32v", generate_interrupt, "main", 0, 16)
15931593
15941594   /* video hardware */
15951595   MDRV_SCREEN_ADD("main", RASTER)
src/mame/drivers/atarisy1.c
r3232r3233
11/***************************************************************************
22
3    Atari System 1 hardware
3    Atari System 1 hardware (available in TTL or LSI version)
44
55    driver by Aaron Giles
66
77    Games supported:
8        * Marble Madness (1984) [4 sets]
8        * Marble Madness (1984) [5 sets, available in either a TTL or LSI version]
99        * Peter Packrat (1984)
1010        * Indiana Jones & the Temple of Doom (1985) [6 sets]
1111        * Road Runner (1985) [3 sets]
r3232r3233
198198static READ16_HANDLER( joystick_r )
199199{
200200   int newval = 0xff;
201   static const char *portnames[] = { "IN0", "IN1" };
201   static const char *const portnames[] = { "IN0", "IN1" };
202202
203203   /* digital joystick type */
204204   if (joystick_type == 1)
r3232r3233
660660
661661
662662static GFXDECODE_START( atarisy1 )
663   GFXDECODE_ENTRY( "gfx1", 0x00000, anlayout,       0, 64 )
663   GFXDECODE_ENTRY( "alpha", 0x00000, anlayout,       0, 64 )
664664GFXDECODE_END
665665
666666
r3232r3233
736736 *
737737 *************************************/
738738
739#define ROM_LOAD16_BYTE_BIOS(bios,name,offset,length,hash) \
740   ROMX_LOAD(name, offset, length, hash, ROM_BIOS(bios+1) | ROM_SKIP(1)) /* Note '+1' */
741
742#define ROM_LOAD_BIOS(bios,name,offset,length,hash) \
743   ROMX_LOAD(name, offset, length, hash, ROM_BIOS(bios+1)) /* Note '+1' */
744
745#define MOTHERBOARD_BIOS                                                                                 \
746   ROM_SYSTEM_BIOS( 0, "ttl", "TTL Motherboard (TM277 and SP277 manuals)" )                                        \
747    ROM_LOAD16_BYTE_BIOS(0, "136032.205", 0x00000, 0x04000, CRC(88d0be26) SHA1(d124045eccc562ff0423b23a240e27ad740fa0c9) ) \
748   ROM_LOAD16_BYTE_BIOS(0, "136032.206", 0x00001, 0x04000, CRC(3c79ef05) SHA1(20fdca7131478e1ee12691bdafd2d5bb74cbd16f) ) \
749   ROM_SYSTEM_BIOS( 1, "lsi", "LSI Motherboard (TM286 and SP286 manuals)" )                                        \
750    ROM_LOAD16_BYTE_BIOS(1, "136032.114", 0x00000, 0x04000, CRC(195c54ad) SHA1(d7cda3cd3db4c6f77074ca05e96ae11b62e048b7) ) /* Located at J11 */ \
751   ROM_LOAD16_BYTE_BIOS(1, "136032.115", 0x00001, 0x04000, CRC(7275b4dc) SHA1(0896ab37ea832a1335046353612c1b4c86d8d040) ) /* Located at J10 */
752
753#define MOTHERBOARD_ALPHA                                                                                       \
754    ROM_LOAD_BIOS(0, "136032.107", 0x00000, 0x02000, CRC(7a29dc07) SHA1(72ba464da01bd6d3a91b8d9997d5ac14b6f47aad) ) \
755    ROM_LOAD_BIOS(1, "136028.107", 0x00000, 0x02000, CRC(315e4bea) SHA1(a00ea23fbdbf075f8f3f184275be83387e8ac82b) ) \
756
757
758ROM_START( atarisy1 )
759   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
760    MOTHERBOARD_BIOS
761
762   ROM_REGION( 0x10000, "audio", ROMREGION_ERASE00 )   /* 64k for 6502 code */
763
764   ROM_REGION( 0x2000, "alpha", ROMREGION_DISPOSE )
765    MOTHERBOARD_ALPHA
766
767   ROM_REGION( 0x100000, "tiles", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
768
769   ROM_REGION( 0x400, "proms", ROMREGION_ERASE00 )   /* graphics mapping PROMs */
770ROM_END
771
772
739773ROM_START( marble )
740774   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
741   ROM_LOAD16_BYTE( "136032.205",   0x00000, 0x04000, CRC(88d0be26) SHA1(d124045eccc562ff0423b23a240e27ad740fa0c9) )
742   ROM_LOAD16_BYTE( "136032.206",   0x00001, 0x04000, CRC(3c79ef05) SHA1(20fdca7131478e1ee12691bdafd2d5bb74cbd16f) )
775    MOTHERBOARD_BIOS
743776   ROM_LOAD16_BYTE( "136033.623",   0x10000, 0x04000, CRC(284ed2e9) SHA1(a24d2fd587dffcc8536ef28fcbcf5c964a6b67a9) )
744777   ROM_LOAD16_BYTE( "136033.624",   0x10001, 0x04000, CRC(d541b021) SHA1(978b1565da746f7389eaf7646604990fb28d47ed) )
745778   ROM_LOAD16_BYTE( "136033.625",   0x18000, 0x04000, CRC(563755c7) SHA1(a444b72ff4cdecee3b9dd7e636d658c31ecc186c) )
r3232r3233
755788   ROM_LOAD( "136033.421",   0x8000, 0x4000, CRC(78153dc3) SHA1(d4e68226b87df8834dc3d6daa9d683f17896c32e) )
756789   ROM_LOAD( "136033.422",   0xc000, 0x4000, CRC(2e66300e) SHA1(49acb9443c5d2c1016cde7f489deab2575dd82ca) )
757790
758   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
759   ROM_LOAD( "136032.107",   0x00000, 0x02000, CRC(7a29dc07) SHA1(72ba464da01bd6d3a91b8d9997d5ac14b6f47aad) )  /* alpha font */
791   ROM_REGION( 0x2000, "alpha", ROMREGION_DISPOSE )
792    MOTHERBOARD_ALPHA
760793
761   ROM_REGION( 0x100000, "gfx2", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
794   ROM_REGION( 0x100000, "tiles", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
762795   ROM_LOAD( "136033.137",   0x00000, 0x04000, CRC(7a45f5c1) SHA1(b826a178660ff2e278558e4779586737751dca5e) )  /* bank 1, plane 0 */
763796   ROM_LOAD( "136033.138",   0x04000, 0x04000, CRC(7e954a88) SHA1(238a913529781f424a6f49c3fba1524684d0cbcf) )
764797   ROM_LOAD( "136033.139",   0x10000, 0x04000, CRC(1eb1bb5f) SHA1(987a8289fd4be06b6899bb8c620ddfa4c4b966b0) )  /* bank 1, plane 1 */
r3232r3233
782815
783816ROM_START( marble2 )
784817   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
785   ROM_LOAD16_BYTE( "136032.205",   0x00000, 0x04000, CRC(88d0be26) SHA1(d124045eccc562ff0423b23a240e27ad740fa0c9) )
786   ROM_LOAD16_BYTE( "136032.206",   0x00001, 0x04000, CRC(3c79ef05) SHA1(20fdca7131478e1ee12691bdafd2d5bb74cbd16f) )
818    MOTHERBOARD_BIOS
787819   ROM_LOAD16_BYTE( "136033.401",   0x10000, 0x08000, CRC(ecfc25a2) SHA1(45d98bea8d6bed5ecdcde1049c3a3f6e0fa6ee4c) )
788820   ROM_LOAD16_BYTE( "136033.402",   0x10001, 0x08000, CRC(7ce9bf53) SHA1(0a5761d4856cd055e8a58b36276945e06c01d08d) )
789821   ROM_LOAD16_BYTE( "136033.403",   0x20000, 0x08000, CRC(dafee7a2) SHA1(6e4aa9721b5fd4385422c146a84a5e271124abcb) )
r3232r3233
795827   ROM_LOAD( "136033.421",   0x8000, 0x4000, CRC(78153dc3) SHA1(d4e68226b87df8834dc3d6daa9d683f17896c32e) )
796828   ROM_LOAD( "136033.422",   0xc000, 0x4000, CRC(2e66300e) SHA1(49acb9443c5d2c1016cde7f489deab2575dd82ca) )
797829
798   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
799   ROM_LOAD( "136032.107",   0x00000, 0x02000, CRC(7a29dc07) SHA1(72ba464da01bd6d3a91b8d9997d5ac14b6f47aad) )  /* alpha font */
830   ROM_REGION( 0x2000, "alpha", ROMREGION_DISPOSE )
831    MOTHERBOARD_ALPHA
800832
801   ROM_REGION( 0x100000, "gfx2", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
833   ROM_REGION( 0x100000, "tiles", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
802834   ROM_LOAD( "136033.137",   0x00000, 0x04000, CRC(7a45f5c1) SHA1(b826a178660ff2e278558e4779586737751dca5e) )  /* bank 1, plane 0 */
803835   ROM_LOAD( "136033.138",   0x04000, 0x04000, CRC(7e954a88) SHA1(238a913529781f424a6f49c3fba1524684d0cbcf) )
804836   ROM_LOAD( "136033.139",   0x10000, 0x04000, CRC(1eb1bb5f) SHA1(987a8289fd4be06b6899bb8c620ddfa4c4b966b0) )  /* bank 1, plane 1 */
r3232r3233
822854
823855ROM_START( marble3 )
824856   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
825   ROM_LOAD16_BYTE( "136032.205",   0x00000, 0x04000, CRC(88d0be26) SHA1(d124045eccc562ff0423b23a240e27ad740fa0c9) )
826   ROM_LOAD16_BYTE( "136032.206",   0x00001, 0x04000, CRC(3c79ef05) SHA1(20fdca7131478e1ee12691bdafd2d5bb74cbd16f) )
857    MOTHERBOARD_BIOS
827858   ROM_LOAD16_BYTE( "136033.201",   0x10000, 0x08000, CRC(9395804d) SHA1(7cca2cc85a9678199c7a60c0976f3e0362f8538f) )
828859   ROM_LOAD16_BYTE( "136033.202",   0x10001, 0x08000, CRC(edd313f5) SHA1(f3ec6f5812287e187026446fe286f257b54c426e) )
829860   ROM_LOAD16_BYTE( "136033.403",   0x20000, 0x08000, CRC(dafee7a2) SHA1(6e4aa9721b5fd4385422c146a84a5e271124abcb) )
r3232r3233
835866   ROM_LOAD( "136033.121",   0x8000, 0x4000, CRC(73fe2b46) SHA1(09fceb60c831972f544c92a84c6d0cbc2481b9f5) )
836867   ROM_LOAD( "136033.122",   0xc000, 0x4000, CRC(03bf65c3) SHA1(4f4a4e4b5bd202da2d18c062f585a842082f08db) )
837868
838   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
839   ROM_LOAD( "136032.107",   0x00000, 0x02000, CRC(7a29dc07) SHA1(72ba464da01bd6d3a91b8d9997d5ac14b6f47aad) )  /* alpha font */
869   ROM_REGION( 0x2000, "alpha", ROMREGION_DISPOSE )
870    MOTHERBOARD_ALPHA
840871
841   ROM_REGION( 0x100000, "gfx2", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
872   ROM_REGION( 0x100000, "tiles", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
842873   ROM_LOAD( "136033.137",   0x00000, 0x04000, CRC(7a45f5c1) SHA1(b826a178660ff2e278558e4779586737751dca5e) )  /* bank 1, plane 0 */
843874   ROM_LOAD( "136033.138",   0x04000, 0x04000, CRC(7e954a88) SHA1(238a913529781f424a6f49c3fba1524684d0cbcf) )
844875   ROM_LOAD( "136033.139",   0x10000, 0x04000, CRC(1eb1bb5f) SHA1(987a8289fd4be06b6899bb8c620ddfa4c4b966b0) )  /* bank 1, plane 1 */
r3232r3233
862893
863894ROM_START( marble4 )
864895   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
865   ROM_LOAD16_BYTE( "136032.205",   0x00000, 0x04000, CRC(88d0be26) SHA1(d124045eccc562ff0423b23a240e27ad740fa0c9) )
866   ROM_LOAD16_BYTE( "136032.206",   0x00001, 0x04000, CRC(3c79ef05) SHA1(20fdca7131478e1ee12691bdafd2d5bb74cbd16f) )
896    MOTHERBOARD_BIOS
867897   ROM_LOAD16_BYTE( "136033.323",   0x10000, 0x04000, CRC(4dc2987a) SHA1(abe155f773dfa623aee6c3952941426adb4c8c9c) )
868898   ROM_LOAD16_BYTE( "136033.324",   0x10001, 0x04000, CRC(e22e6e11) SHA1(aedb18f25aad846b82690c70b917e97cdcfbd09e) )
869899   ROM_LOAD16_BYTE( "136033.225",   0x18000, 0x04000, CRC(743f6c5c) SHA1(b69b7dc9923f514b8de207895bbe0c2038dc519d) )
r3232r3233
879909   ROM_LOAD( "136033.257",   0x8000, 0x4000, CRC(2e2e0df8) SHA1(e76f7297a3e78ebbc00e3a4c468149f9f7124b16) )
880910   ROM_LOAD( "136033.258",   0xc000, 0x4000, CRC(1b9655cd) SHA1(deb8728ee9620718e449f1e55a6fe115256c00c9) )
881911
882   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
883   ROM_LOAD( "136032.107",   0x00000, 0x02000, CRC(7a29dc07) SHA1(72ba464da01bd6d3a91b8d9997d5ac14b6f47aad) )  /* alpha font */
912   ROM_REGION( 0x2000, "alpha", ROMREGION_DISPOSE )
913    MOTHERBOARD_ALPHA
884914
885   ROM_REGION( 0x100000, "gfx2", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
915   ROM_REGION( 0x100000, "tiles", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
886916   ROM_LOAD( "136033.137",   0x00000, 0x04000, CRC(7a45f5c1) SHA1(b826a178660ff2e278558e4779586737751dca5e) )  /* bank 1, plane 0 */
887917   ROM_LOAD( "136033.138",   0x04000, 0x04000, CRC(7e954a88) SHA1(238a913529781f424a6f49c3fba1524684d0cbcf) )
888918   ROM_LOAD( "136033.139",   0x10000, 0x04000, CRC(1eb1bb5f) SHA1(987a8289fd4be06b6899bb8c620ddfa4c4b966b0) )  /* bank 1, plane 1 */
r3232r3233
904934ROM_END
905935
906936
937ROM_START( marble5 ) /* LSI Cartridge */
938    ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
939    MOTHERBOARD_BIOS
940   ROM_LOAD16_BYTE( "136033.201", 0x10000, 0x08000, CRC(9395804d) SHA1(7cca2cc85a9678199c7a60c0976f3e0362f8538f) ) /* Located at B10 */
941   ROM_LOAD16_BYTE( "136033.202", 0x10001, 0x08000, CRC(edd313f5) SHA1(f3ec6f5812287e187026446fe286f257b54c426e) ) /* Located at A10 */
942   ROM_LOAD16_BYTE( "136033.203", 0x20000, 0x08000, CRC(dafee7a2) SHA1(6e4aa9721b5fd4385422c146a84a5e271124abcb) ) /* Located at B12 */
943   ROM_LOAD16_BYTE( "136033.204", 0x20001, 0x08000, CRC(4d621731) SHA1(619d74abe750aac61c3425bcb584ffdafdfc809a) ) /* Located at A12 */
944   ROM_LOAD16_BYTE( "136033.107", 0x80000, 0x04000, CRC(f3b8745b) SHA1(4754eac5e6d8547b3ee00f3f48eaa560eb403862) ) /* Located at B16 */
945   ROM_LOAD16_BYTE( "136033.108", 0x80001, 0x04000, CRC(e51eecaa) SHA1(37d51a9e9cb33d1156d02a312ac8e202a18d7c20) ) /* Located at A16 */
946
947   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for 6502 code */
948   ROM_LOAD(        "136033.121", 0x08000, 0x04000, CRC(73fe2b46) SHA1(09fceb60c831972f544c92a84c6d0cbc2481b9f5) ) /* Located at D14 */
949   ROM_LOAD(        "136033.122", 0x0c000, 0x04000, CRC(03bf65c3) SHA1(4f4a4e4b5bd202da2d18c062f585a842082f08db) ) /* Located at D16 */
950
951   ROM_REGION( 0x2000, "alpha", ROMREGION_DISPOSE )
952   MOTHERBOARD_ALPHA
953
954   ROM_REGION( 0x100000, "tiles", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
955   ROM_LOAD(        "136033.109", 0x00000, 0x08000, CRC(467208f4) SHA1(a050991bb684fa51720c0ac33b9bf68a373e8856) )  /* bank 1, plane 0 - located at B1 */
956   ROM_LOAD(        "136033.110", 0x10000, 0x08000, CRC(b883ec76) SHA1(ec048e19395fd617f2cd0d3edea728799bdca037) )  /* bank 1, plane 1 - located at B6 */
957   ROM_LOAD(        "136033.111", 0x20000, 0x08000, CRC(c208bd5e) SHA1(e75f7d33c66b58e3c72a83d0dc7a6427a57d0de9) )  /* bank 1, plane 2 - located at C1 */
958   ROM_LOAD(        "136033.112", 0x30000, 0x08000, CRC(042673d4) SHA1(499c1edf82834d5ff6144ee4349b2349db7a57c2) )  /* bank 1, plane 3 - located at C6 */
959    ROM_LOAD(        "136033.113", 0x40000, 0x08000, CRC(b390aef3) SHA1(2cd58071d1c09058af7876c35484c3b571774a06) )  /* bank 1, plane 4 - located at D1 */
960   ROM_LOAD(        "136033.115", 0x84000, 0x04000, CRC(b6658f06) SHA1(e719d956f4f9d703a12e2c5520cac0a2f47ea058) )  /* bank 2, plane 0 - located at B2 */
961   ROM_LOAD(        "136033.116", 0x94000, 0x04000, CRC(84ee1c80) SHA1(5192c0a2887f46b616d130bdbfffbbd5e394e9a3) )  /* bank 2, plane 1 - located at B7 */
962   ROM_LOAD(        "136033.117", 0xa4000, 0x04000, CRC(daa02926) SHA1(33c7a38c66fb4d67a6ee88ef2da2bba091439e0c) )  /* bank 2, plane 2 - located at C7 */
963
964    ROM_REGION( 0x400, "proms", 0 )   /* graphics mapping PROMs */
965   ROM_LOAD(        "136033.118", 0x00000, 0x00200, CRC(2101b0ed) SHA1(e4fb8dfa80ed78847c697f9de2bd8540b0c04889) )  /* remap, located at A7 */
966   ROM_LOAD(        "136033.159", 0x00200, 0x00200, CRC(19f6e767) SHA1(041f24cc03c9043c31c3294c9565dfda9bdada74) )  /* color, located at A5 */
967ROM_END
968
969
907970ROM_START( peterpak )
908971   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
909   ROM_LOAD16_BYTE( "136032.205",   0x00000, 0x04000, CRC(88d0be26) SHA1(d124045eccc562ff0423b23a240e27ad740fa0c9) )
910   ROM_LOAD16_BYTE( "136032.206",   0x00001, 0x04000, CRC(3c79ef05) SHA1(20fdca7131478e1ee12691bdafd2d5bb74cbd16f) )
972    MOTHERBOARD_BIOS
911973   ROM_LOAD16_BYTE( "136028.142",   0x10000, 0x04000, CRC(4f9fc020) SHA1(7e0d5660ea395ded7e0e4c9122bc41f9bb9a483d) )
912974   ROM_LOAD16_BYTE( "136028.143",   0x10001, 0x04000, CRC(9fb257cc) SHA1(5590fc2b4e79a071ae5ba04e23aadb3e35614a73) )
913975   ROM_LOAD16_BYTE( "136028.144",   0x18000, 0x04000, CRC(50267619) SHA1(7aec7e4c8b97313d18c8eb55e078157776e29842) )
r3232r3233
921983   ROM_LOAD( "136028.101",   0x8000, 0x4000, CRC(ff712aa2) SHA1(07beeb51f41d406782965dddb6fe73fdc49529df) )
922984   ROM_LOAD( "136028.102",   0xc000, 0x4000, CRC(89ea21a1) SHA1(a7cb6eceb45d54406d6fc692f50a4e34564d6170) )
923985
924   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
925   ROM_LOAD( "136032.107",   0x00000, 0x02000, CRC(7a29dc07) SHA1(72ba464da01bd6d3a91b8d9997d5ac14b6f47aad) )  /* alpha font */
986   ROM_REGION( 0x2000, "alpha", ROMREGION_DISPOSE )
987    MOTHERBOARD_ALPHA
926988
927   ROM_REGION( 0x180000, "gfx2", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
989   ROM_REGION( 0x180000, "tiles", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
928990   ROM_LOAD( "136028.138",   0x000000, 0x08000, CRC(53eaa018) SHA1(3f9887d4996e6a7c894732e9c9ebe4408fb60192) )  /* bank 1, plane 0 */
929991   ROM_LOAD( "136028.139",   0x010000, 0x08000, CRC(354a19cb) SHA1(84a145d0f1624315923d389b4b746db5fbc672df) )  /* bank 1, plane 1 */
930992   ROM_LOAD( "136028.140",   0x020000, 0x08000, CRC(8d2c4717) SHA1(d7709d5859b5276d46799ff39a375929a48e34ae) )  /* bank 1, plane 2 */
r3232r3233
9481010
9491011ROM_START( indytemp )
9501012   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
951   ROM_LOAD16_BYTE( "136032.205",   0x00000, 0x04000, CRC(88d0be26) SHA1(d124045eccc562ff0423b23a240e27ad740fa0c9) )
952   ROM_LOAD16_BYTE( "136032.206",   0x00001, 0x04000, CRC(3c79ef05) SHA1(20fdca7131478e1ee12691bdafd2d5bb74cbd16f) )
1013    MOTHERBOARD_BIOS
9531014   ROM_LOAD16_BYTE( "136036.432",   0x10000, 0x08000, CRC(d888cdf1) SHA1(c9cbc0d429755611b3749e018d3817d4d7042425) )
9541015   ROM_LOAD16_BYTE( "136036.431",   0x10001, 0x08000, CRC(b7ac7431) SHA1(b062258746ca5f9c3f9cf8a6186eb3c370ac3a77) )
9551016   ROM_LOAD16_BYTE( "136036.434",   0x20000, 0x08000, CRC(802495fd) SHA1(228f48ef067a758fe0d3bfe0508765a52bb579eb) )
r3232r3233
9641025   ROM_LOAD( "136036.154",   0x8000, 0x4000, CRC(cbfc6adb) SHA1(ee132eced924435f1214e2997533e866a3e5364b) )
9651026   ROM_LOAD( "136036.155",   0xc000, 0x4000, CRC(4c8233ac) SHA1(3d2bdb71b8f499a21f0b0e1686be7fe6f23efede) )
9661027
967   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
968   ROM_LOAD( "136032.107",   0x00000, 0x02000, CRC(7a29dc07) SHA1(72ba464da01bd6d3a91b8d9997d5ac14b6f47aad) )  /* alpha font */
1028   ROM_REGION( 0x2000, "alpha", ROMREGION_DISPOSE )
1029    MOTHERBOARD_ALPHA
9691030
970   ROM_REGION( 0x200000, "gfx2", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
1031   ROM_REGION( 0x200000, "tiles", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
9711032   ROM_LOAD( "136036.135",   0x000000, 0x08000, CRC(ffa8749c) SHA1(b0bec9b8364a15606d9f4d11f674dea2ec25279f) )  /* bank 1, plane 0 */
9721033   ROM_LOAD( "136036.139",   0x010000, 0x08000, CRC(b682bfca) SHA1(21625ea29609560b31b28c669b2599cfcdab8ea7) )  /* bank 1, plane 1 */
9731034   ROM_LOAD( "136036.143",   0x020000, 0x08000, CRC(7697da26) SHA1(546b95467ca61fab9ac853635c8972a2dedb6581) )  /* bank 1, plane 2 */
r3232r3233
9961057
9971058ROM_START( indytem2 )
9981059   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
999   ROM_LOAD16_BYTE( "136032.205",   0x00000, 0x04000, CRC(88d0be26) SHA1(d124045eccc562ff0423b23a240e27ad740fa0c9) )
1000   ROM_LOAD16_BYTE( "136032.206",   0x00001, 0x04000, CRC(3c79ef05) SHA1(20fdca7131478e1ee12691bdafd2d5bb74cbd16f) )
1060    MOTHERBOARD_BIOS
10011061   ROM_LOAD16_BYTE( "136036.470",   0x10000, 0x08000, CRC(7fac1dd8) SHA1(043daf709209e76115899a1e301f8fb262b3a749) )
10021062   ROM_LOAD16_BYTE( "136036.471",   0x10001, 0x08000, CRC(e93272fb) SHA1(bb5741419a9d1a54ae16bfd6d2fcf64627e8a5c3) )
10031063   ROM_LOAD16_BYTE( "136036.434",   0x20000, 0x08000, CRC(802495fd) SHA1(228f48ef067a758fe0d3bfe0508765a52bb579eb) )
r3232r3233
10121072   ROM_LOAD( "136036.154",   0x8000, 0x4000, CRC(cbfc6adb) SHA1(ee132eced924435f1214e2997533e866a3e5364b) )
10131073   ROM_LOAD( "136036.155",   0xc000, 0x4000, CRC(4c8233ac) SHA1(3d2bdb71b8f499a21f0b0e1686be7fe6f23efede) )
10141074
1015   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
1016   ROM_LOAD( "136032.107",   0x00000, 0x02000, CRC(7a29dc07) SHA1(72ba464da01bd6d3a91b8d9997d5ac14b6f47aad) )  /* alpha font */
1075   ROM_REGION( 0x2000, "alpha", ROMREGION_DISPOSE )
1076    MOTHERBOARD_ALPHA
10171077
1018   ROM_REGION( 0x200000, "gfx2", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
1078   ROM_REGION( 0x200000, "tiles", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
10191079   ROM_LOAD( "136036.135",   0x000000, 0x08000, CRC(ffa8749c) SHA1(b0bec9b8364a15606d9f4d11f674dea2ec25279f) )  /* bank 1, plane 0 */
10201080   ROM_LOAD( "136036.139",   0x010000, 0x08000, CRC(b682bfca) SHA1(21625ea29609560b31b28c669b2599cfcdab8ea7) )  /* bank 1, plane 1 */
10211081   ROM_LOAD( "136036.143",   0x020000, 0x08000, CRC(7697da26) SHA1(546b95467ca61fab9ac853635c8972a2dedb6581) )  /* bank 1, plane 2 */
r3232r3233
10441104
10451105ROM_START( indytem3 )
10461106   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
1047   ROM_LOAD16_BYTE( "136032.205",   0x00000, 0x04000, CRC(88d0be26) SHA1(d124045eccc562ff0423b23a240e27ad740fa0c9) )
1048   ROM_LOAD16_BYTE( "136032.206",   0x00001, 0x04000, CRC(3c79ef05) SHA1(20fdca7131478e1ee12691bdafd2d5bb74cbd16f) )
1107    MOTHERBOARD_BIOS
10491108   ROM_LOAD16_BYTE( "232.10b",      0x10000, 0x08000, CRC(1e80108f) SHA1(663ef81b865c4d13fd73eca4f82ee64a4bdeaad5) )
10501109   ROM_LOAD16_BYTE( "231.10a",      0x10001, 0x08000, CRC(8ae54c0c) SHA1(c7ab4a2e2af8f2336baa8c7b2a80af7c9bfd0435) )
10511110   ROM_LOAD16_BYTE( "234.12b",      0x20000, 0x08000, CRC(86be7e07) SHA1(b6b0d9c6d81d446dab675c71d60f792f6a657c5b) )
r3232r3233
10601119   ROM_LOAD( "136036.154",   0x8000, 0x4000, CRC(cbfc6adb) SHA1(ee132eced924435f1214e2997533e866a3e5364b) )
10611120   ROM_LOAD( "136036.155",   0xc000, 0x4000, CRC(4c8233ac) SHA1(3d2bdb71b8f499a21f0b0e1686be7fe6f23efede) )
10621121
1063   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
1064   ROM_LOAD( "136032.107",   0x00000, 0x02000, CRC(7a29dc07) SHA1(72ba464da01bd6d3a91b8d9997d5ac14b6f47aad) )  /* alpha font */
1122   ROM_REGION( 0x2000, "alpha", ROMREGION_DISPOSE )
1123    MOTHERBOARD_ALPHA
10651124
1066   ROM_REGION( 0x200000, "gfx2", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
1125   ROM_REGION( 0x200000, "tiles", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
10671126   ROM_LOAD( "136036.135",   0x000000, 0x08000, CRC(ffa8749c) SHA1(b0bec9b8364a15606d9f4d11f674dea2ec25279f) )  /* bank 1, plane 0 */
10681127   ROM_LOAD( "136036.139",   0x010000, 0x08000, CRC(b682bfca) SHA1(21625ea29609560b31b28c669b2599cfcdab8ea7) )  /* bank 1, plane 1 */
10691128   ROM_LOAD( "136036.143",   0x020000, 0x08000, CRC(7697da26) SHA1(546b95467ca61fab9ac853635c8972a2dedb6581) )  /* bank 1, plane 2 */
r3232r3233
10921151
10931152ROM_START( indytem4 )
10941153   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
1095   ROM_LOAD16_BYTE( "136032.205",   0x00000, 0x04000, CRC(88d0be26) SHA1(d124045eccc562ff0423b23a240e27ad740fa0c9) )
1096   ROM_LOAD16_BYTE( "136032.206",   0x00001, 0x04000, CRC(3c79ef05) SHA1(20fdca7131478e1ee12691bdafd2d5bb74cbd16f) )
1154    MOTHERBOARD_BIOS
10971155   ROM_LOAD16_BYTE( "136036.332",   0x10000, 0x08000, CRC(a5563773) SHA1(52701b53e62aae691f7b9483f5e843d805223a0a) )
10981156   ROM_LOAD16_BYTE( "136036.331",   0x10001, 0x08000, CRC(7d562141) SHA1(a2143ed473e40a5a46679e7751fc37475768885f) )
10991157   ROM_LOAD16_BYTE( "136036.334",   0x20000, 0x08000, CRC(e40828e5) SHA1(a5c50693bddcc394711859bdc36d9ff93d02b82e) )
r3232r3233
11081166   ROM_LOAD( "136036.154",   0x8000, 0x4000, CRC(cbfc6adb) SHA1(ee132eced924435f1214e2997533e866a3e5364b) )
11091167   ROM_LOAD( "136036.155",   0xc000, 0x4000, CRC(4c8233ac) SHA1(3d2bdb71b8f499a21f0b0e1686be7fe6f23efede) )
11101168
1111   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
1112   ROM_LOAD( "136032.107",   0x00000, 0x02000, CRC(7a29dc07) SHA1(72ba464da01bd6d3a91b8d9997d5ac14b6f47aad) )  /* alpha font */
1169   ROM_REGION( 0x2000, "alpha", ROMREGION_DISPOSE )
1170    MOTHERBOARD_ALPHA
11131171
1114   ROM_REGION( 0x200000, "gfx2", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
1172   ROM_REGION( 0x200000, "tiles", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
11151173   ROM_LOAD( "136036.135",   0x000000, 0x08000, CRC(ffa8749c) SHA1(b0bec9b8364a15606d9f4d11f674dea2ec25279f) )  /* bank 1, plane 0 */
11161174   ROM_LOAD( "136036.139",   0x010000, 0x08000, CRC(b682bfca) SHA1(21625ea29609560b31b28c669b2599cfcdab8ea7) )  /* bank 1, plane 1 */
11171175   ROM_LOAD( "136036.143",   0x020000, 0x08000, CRC(7697da26) SHA1(546b95467ca61fab9ac853635c8972a2dedb6581) )  /* bank 1, plane 2 */
r3232r3233
11401198
11411199ROM_START( indytemc )
11421200   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
1143   ROM_LOAD16_BYTE( "136032.205",   0x00000, 0x04000, CRC(88d0be26) SHA1(d124045eccc562ff0423b23a240e27ad740fa0c9) )
1144   ROM_LOAD16_BYTE( "136032.206",   0x00001, 0x04000, CRC(3c79ef05) SHA1(20fdca7131478e1ee12691bdafd2d5bb74cbd16f) )
1201    MOTHERBOARD_BIOS
11451202   ROM_LOAD16_BYTE( "136036.632",   0x10000, 0x08000, BAD_DUMP CRC(8af67d9b) SHA1(5777ed2048fe1a58a1cac8276185843396754d38) )
11461203   ROM_LOAD16_BYTE( "136036.631",   0x10001, 0x08000, CRC(9ac96ba8) SHA1(d80adabb4198461b5976577bdd8cc4e650de1c8e) )
11471204   ROM_LOAD16_BYTE( "136036.534",   0x20000, 0x08000, CRC(eae396be) SHA1(6d7a82a2fd43b91c6c1e2c07d33c81487b845bba) )
r3232r3233
11551212   ROM_LOAD( "136036.153",   0x4000, 0x4000, CRC(95294641) SHA1(00f90a0d49d2c77d5288080036f81a74ad31f8bc) )
11561213   ROM_LOAD( "136036.170",   0x8000, 0x8000, BAD_DUMP CRC(8af67d9b) SHA1(5777ed2048fe1a58a1cac8276185843396754d38) )
11571214
1158   ROM_REGION( 0x4000, "gfx1", ROMREGION_DISPOSE )
1215   ROM_REGION( 0x4000, "alpha", ROMREGION_DISPOSE )
11591216   ROM_LOAD( "136032.120",   0x00000, 0x04000, CRC(90a1950d) SHA1(fba32c255850312175d1e3c03d677ffb57e09e07) )  /* alpha font */
11601217
1161   ROM_REGION( 0x200000, "gfx2", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
1218   ROM_REGION( 0x200000, "tiles", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
11621219   ROM_LOAD( "136036.135",   0x000000, 0x08000, CRC(ffa8749c) SHA1(b0bec9b8364a15606d9f4d11f674dea2ec25279f) )  /* bank 1, plane 0 */
11631220   ROM_LOAD( "136036.139",   0x010000, 0x08000, CRC(b682bfca) SHA1(21625ea29609560b31b28c669b2599cfcdab8ea7) )  /* bank 1, plane 1 */
11641221   ROM_LOAD( "136036.143",   0x020000, 0x08000, CRC(7697da26) SHA1(546b95467ca61fab9ac853635c8972a2dedb6581) )  /* bank 1, plane 2 */
r3232r3233
11871244
11881245ROM_START( indytemd )
11891246   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
1190   ROM_LOAD16_BYTE( "136032.205",   0x00000, 0x04000, CRC(88d0be26) SHA1(d124045eccc562ff0423b23a240e27ad740fa0c9) )
1191   ROM_LOAD16_BYTE( "136032.206",   0x00001, 0x04000, CRC(3c79ef05) SHA1(20fdca7131478e1ee12691bdafd2d5bb74cbd16f) )
1247    MOTHERBOARD_BIOS
11921248   ROM_LOAD16_BYTE( "136036.462",   0x10000, 0x08000, CRC(317dc430) SHA1(563f09fb1b096bd40e1a73acb7f11d3809f9f19f) )
11931249   ROM_LOAD16_BYTE( "136036.461",   0x10001, 0x08000, CRC(8c73f974) SHA1(023b55f1d54606f5c51b86b802d417099d775f14) )
11941250   ROM_LOAD16_BYTE( "136036.464",   0x20000, 0x08000, CRC(3fcb199f) SHA1(11a8a17bf0100b5f16e9148669b2ec5bf81b3d62) )
r3232r3233
12031259   ROM_LOAD( "136036.154",   0x8000, 0x4000, CRC(cbfc6adb) SHA1(ee132eced924435f1214e2997533e866a3e5364b) )
12041260   ROM_LOAD( "136036.155",   0xc000, 0x4000, CRC(4c8233ac) SHA1(3d2bdb71b8f499a21f0b0e1686be7fe6f23efede) )
12051261
1206   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
1207   ROM_LOAD( "136032.107",   0x00000, 0x02000, CRC(7a29dc07) SHA1(72ba464da01bd6d3a91b8d9997d5ac14b6f47aad) )  /* alpha font */
1262   ROM_REGION( 0x2000, "alpha", ROMREGION_DISPOSE )
1263    MOTHERBOARD_ALPHA
12081264
1209   ROM_REGION( 0x200000, "gfx2", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
1265   ROM_REGION( 0x200000, "tiles", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
12101266   ROM_LOAD( "136036.135",   0x000000, 0x08000, CRC(ffa8749c) SHA1(b0bec9b8364a15606d9f4d11f674dea2ec25279f) )  /* bank 1, plane 0 */
12111267   ROM_LOAD( "136036.139",   0x010000, 0x08000, CRC(b682bfca) SHA1(21625ea29609560b31b28c669b2599cfcdab8ea7) )  /* bank 1, plane 1 */
12121268   ROM_LOAD( "136036.143",   0x020000, 0x08000, CRC(7697da26) SHA1(546b95467ca61fab9ac853635c8972a2dedb6581) )  /* bank 1, plane 2 */
r3232r3233
12351291
12361292ROM_START( roadrunn )
12371293   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
1238   ROM_LOAD16_BYTE( "136032.205",   0x000000, 0x004000, CRC(88d0be26) SHA1(d124045eccc562ff0423b23a240e27ad740fa0c9) )
1239   ROM_LOAD16_BYTE( "136032.206",   0x000001, 0x004000, CRC(3c79ef05) SHA1(20fdca7131478e1ee12691bdafd2d5bb74cbd16f) )
1294    MOTHERBOARD_BIOS
12401295   ROM_LOAD16_BYTE( "136040-228.11c",  0x010000, 0x008000, CRC(b66c629a) SHA1(94dc13f2f151a4109ee50016bcc1392aef0d5a22) )
12411296   ROM_LOAD16_BYTE( "136040-229.11a",  0x010001, 0x008000, CRC(5638959f) SHA1(486bd13ba151558b72bf29de9ecc14944e56435c) )
12421297   ROM_LOAD16_BYTE( "136040-230.13c",  0x020000, 0x008000, CRC(cd7956a3) SHA1(d72aa90b74a77e5fa49cb34515383c8ab054d654) )
r3232r3233
12541309   ROM_LOAD( "136040-143.15e",  0x008000, 0x004000, CRC(62b9878e) SHA1(db6072a7c8600d85fb70dac3d940a200d0cb5d0a) )
12551310   ROM_LOAD( "136040-144.17e",  0x00c000, 0x004000, CRC(6ef1b804) SHA1(176066c6946090c87945213145960754cd315acb) )
12561311
1257   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
1258   ROM_LOAD( "136032.107",   0x00000, 0x02000, CRC(7a29dc07) SHA1(72ba464da01bd6d3a91b8d9997d5ac14b6f47aad) )  /* alpha font */
1312   ROM_REGION( 0x2000, "alpha", ROMREGION_DISPOSE )
1313    MOTHERBOARD_ALPHA
12591314
1260   ROM_REGION( 0x300000, "gfx2", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
1315   ROM_REGION( 0x300000, "tiles", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
12611316   ROM_LOAD( "136040-101.4b",   0x000000, 0x008000, CRC(26d9f29c) SHA1(e03a03484ede4ea209040faf64e88f0667a0ab40) )  /* bank 1, plane 0 */
12621317   ROM_LOAD( "136040-107.9b",   0x010000, 0x008000, CRC(8aac0ba4) SHA1(67a6412c77d08eab6745db9dff3e32a1bb768901) )  /* bank 1, plane 1 */
12631318   ROM_LOAD( "136040-113.4f",   0x020000, 0x008000, CRC(48b74c52) SHA1(d8328a9ff715247d841be02b1bb7aa043dcb77e1) )  /* bank 1, plane 2 */
r3232r3233
12961351
12971352ROM_START( roadrun2 )
12981353   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
1299   ROM_LOAD16_BYTE( "136032.205",   0x000000, 0x004000, CRC(88d0be26) SHA1(d124045eccc562ff0423b23a240e27ad740fa0c9) )
1300   ROM_LOAD16_BYTE( "136032.206",   0x000001, 0x004000, CRC(3c79ef05) SHA1(20fdca7131478e1ee12691bdafd2d5bb74cbd16f) )
1354    MOTHERBOARD_BIOS
13011355   ROM_LOAD16_BYTE( "136040-x28.11c",  0x010000, 0x008000, CRC(fbd43085) SHA1(57f2f2f01e235f4525507583887d52b09f6267b4) )
13021356   ROM_LOAD16_BYTE( "136040-x29.11a",  0x010001, 0x008000, CRC(f8d8819b) SHA1(dddb44290e3d2728845639611c3a66c3389c8f69) )
13031357   ROM_LOAD16_BYTE( "136040-x30.13c",  0x020000, 0x008000, CRC(6a273375) SHA1(2e222ad4a4d53ec50f848386fca12f74e98814ed) )
r3232r3233
13151369   ROM_LOAD( "136040-143.15e",  0x008000, 0x004000, CRC(62b9878e) SHA1(db6072a7c8600d85fb70dac3d940a200d0cb5d0a) )
13161370   ROM_LOAD( "136040-144.17e",  0x00c000, 0x004000, CRC(6ef1b804) SHA1(176066c6946090c87945213145960754cd315acb) )
13171371
1318   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
1319   ROM_LOAD( "136032.107",   0x00000, 0x02000, CRC(7a29dc07) SHA1(72ba464da01bd6d3a91b8d9997d5ac14b6f47aad) )  /* alpha font */
1372   ROM_REGION( 0x2000, "alpha", ROMREGION_DISPOSE )
1373    MOTHERBOARD_ALPHA
13201374
1321   ROM_REGION( 0x300000, "gfx2", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
1375   ROM_REGION( 0x300000, "tiles", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
13221376   ROM_LOAD( "136040-101.4b",   0x000000, 0x008000, CRC(26d9f29c) SHA1(e03a03484ede4ea209040faf64e88f0667a0ab40) )  /* bank 1, plane 0 */
13231377   ROM_LOAD( "136040-107.9b",   0x010000, 0x008000, CRC(8aac0ba4) SHA1(67a6412c77d08eab6745db9dff3e32a1bb768901) )  /* bank 1, plane 1 */
13241378   ROM_LOAD( "136040-113.4f",   0x020000, 0x008000, CRC(48b74c52) SHA1(d8328a9ff715247d841be02b1bb7aa043dcb77e1) )  /* bank 1, plane 2 */
r3232r3233
13571411
13581412ROM_START( roadrun1 )
13591413   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
1360   ROM_LOAD16_BYTE( "136032.205",   0x000000, 0x004000, CRC(88d0be26) SHA1(d124045eccc562ff0423b23a240e27ad740fa0c9) )
1361   ROM_LOAD16_BYTE( "136032.206",   0x000001, 0x004000, CRC(3c79ef05) SHA1(20fdca7131478e1ee12691bdafd2d5bb74cbd16f) )
1414    MOTHERBOARD_BIOS
13621415   ROM_LOAD16_BYTE( "136040-128.11c",  0x010000, 0x008000, CRC(5e39d540) SHA1(69fae4c7db247062dffda0138a6e3bfb697f17bf) )
13631416   ROM_LOAD16_BYTE( "136040-129.11a",  0x010001, 0x008000, CRC(d79bfea1) SHA1(eb265ff5f3f08bbdb3b19f9c7dece7e58dd2c6ba) )
13641417   ROM_LOAD16_BYTE( "136040-130.13c",  0x020000, 0x008000, CRC(66453b37) SHA1(cb467a9c8109475bbc6d24b4a3559fa2f2edc887) )
r3232r3233
13761429   ROM_LOAD( "136040-143.15e",  0x008000, 0x004000, CRC(62b9878e) SHA1(db6072a7c8600d85fb70dac3d940a200d0cb5d0a) )
13771430   ROM_LOAD( "136040-144.17e",  0x00c000, 0x004000, CRC(6ef1b804) SHA1(176066c6946090c87945213145960754cd315acb) )
13781431
1379   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
1380   ROM_LOAD( "136032.107",   0x00000, 0x02000, CRC(7a29dc07) SHA1(72ba464da01bd6d3a91b8d9997d5ac14b6f47aad) )  /* alpha font */
1432   ROM_REGION( 0x2000, "alpha", ROMREGION_DISPOSE )
1433    MOTHERBOARD_ALPHA
13811434
1382   ROM_REGION( 0x300000, "gfx2", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
1435   ROM_REGION( 0x300000, "tiles", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
13831436   ROM_LOAD( "136040-101.4b",   0x000000, 0x008000, CRC(26d9f29c) SHA1(e03a03484ede4ea209040faf64e88f0667a0ab40) )  /* bank 1, plane 0 */
13841437   ROM_LOAD( "136040-107.9b",   0x010000, 0x008000, CRC(8aac0ba4) SHA1(67a6412c77d08eab6745db9dff3e32a1bb768901) )  /* bank 1, plane 1 */
13851438   ROM_LOAD( "136040-113.4f",   0x020000, 0x008000, CRC(48b74c52) SHA1(d8328a9ff715247d841be02b1bb7aa043dcb77e1) )  /* bank 1, plane 2 */
r3232r3233
14181471
14191472ROM_START( roadblst )
14201473   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
1421   ROM_LOAD16_BYTE( "136032.205",   0x000000, 0x004000, CRC(88d0be26) SHA1(d124045eccc562ff0423b23a240e27ad740fa0c9) )
1422   ROM_LOAD16_BYTE( "136032.206",   0x000001, 0x004000, CRC(3c79ef05) SHA1(20fdca7131478e1ee12691bdafd2d5bb74cbd16f) )
1474    MOTHERBOARD_BIOS
14231475   ROM_LOAD16_BYTE( "136048-1157.11c", 0x010000, 0x008000, CRC(6d9ad91e) SHA1(15815d3777be5377e053a39c1cef20eb101d9b92) )
14241476   ROM_LOAD16_BYTE( "136048-1158.11a", 0x010001, 0x008000, CRC(7d4cf151) SHA1(979006149906638b942a3157b237112acc16183d) )
14251477   ROM_LOAD16_BYTE( "136048-1159.13c", 0x020000, 0x008000, CRC(921c0e34) SHA1(bcc90a73baaecc551e1065037681a79e260905ff) )
r3232r3233
14381490   ROM_LOAD( "136048-1169.1516e", 0x8000, 0x4000, CRC(ee318052) SHA1(f66ff39499697b7439dc62567e727fec769c1505) )
14391491   ROM_LOAD( "136048-1170.17e",   0xc000, 0x4000, CRC(75dfec33) SHA1(3092348b98419bb23181d21406733d5d21cd3d82) )
14401492
1441   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
1442   ROM_LOAD( "136032.107",   0x00000, 0x02000, CRC(7a29dc07) SHA1(72ba464da01bd6d3a91b8d9997d5ac14b6f47aad) )  /* alpha font */
1493   ROM_REGION( 0x2000, "alpha", ROMREGION_DISPOSE )
1494    MOTHERBOARD_ALPHA
14431495
1444   ROM_REGION( 0x380000, "gfx2", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
1496   ROM_REGION( 0x380000, "tiles", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
14451497   ROM_LOAD( "136048-1101.2s",  0x000000, 0x008000, CRC(fe342d27) SHA1(72deac16ab9b6b811f49d70d700d6bc3a904f9d5) )  /* bank 1, plane 0 */
14461498   ROM_LOAD( "136048-1102.2r",  0x010000, 0x008000, CRC(17c7e780) SHA1(675a2fe5ac55c97d54153eacabf863a525e4b71f) )  /* bank 1, plane 1 */
14471499   ROM_LOAD( "136048-1103.2n",  0x020000, 0x008000, CRC(39688e01) SHA1(1b273e26b48a2f69b0895c29c9b3e762c686661d) )  /* bank 1, plane 2 */
r3232r3233
14841536
14851537ROM_START( roadblsg )
14861538   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
1487   ROM_LOAD16_BYTE( "136032.205",   0x000000, 0x004000, CRC(88d0be26) SHA1(d124045eccc562ff0423b23a240e27ad740fa0c9) )
1488   ROM_LOAD16_BYTE( "136032.206",   0x000001, 0x004000, CRC(3c79ef05) SHA1(20fdca7131478e1ee12691bdafd2d5bb74cbd16f) )
1539    MOTHERBOARD_BIOS
14891540   ROM_LOAD16_BYTE( "136048-2257.11c", 0x010000, 0x008000, CRC(6e9de790) SHA1(348d4953b63f577b2b1ad747c6fb32c8ec55d310) )
14901541   ROM_LOAD16_BYTE( "136048-2258.11a", 0x010001, 0x008000, CRC(5160c69e) SHA1(a4aa4ae0cf24f0d3c768186332b4b0f8e55d2700) )
14911542   ROM_LOAD16_BYTE( "136048-2259.13c", 0x020000, 0x008000, CRC(62f10976) SHA1(e3c832304ad9163ed43d128aa68c321af655958d) )
r3232r3233
15041555   ROM_LOAD( "136048-1169.1516e", 0x8000, 0x4000, CRC(ee318052) SHA1(f66ff39499697b7439dc62567e727fec769c1505) )
15051556   ROM_LOAD( "136048-1170.17e",   0xc000, 0x4000, CRC(75dfec33) SHA1(3092348b98419bb23181d21406733d5d21cd3d82) )
15061557
1507   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
1508   ROM_LOAD( "136032.107",   0x00000, 0x02000, CRC(7a29dc07) SHA1(72ba464da01bd6d3a91b8d9997d5ac14b6f47aad) )  /* alpha font */
1558   ROM_REGION( 0x2000, "alpha", ROMREGION_DISPOSE )
1559    MOTHERBOARD_ALPHA
15091560
1510   ROM_REGION( 0x380000, "gfx2", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
1561   ROM_REGION( 0x380000, "tiles", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
15111562   ROM_LOAD( "136048-1101.2s",  0x000000, 0x008000, CRC(fe342d27) SHA1(72deac16ab9b6b811f49d70d700d6bc3a904f9d5) )  /* bank 1, plane 0 */
15121563   ROM_LOAD( "136048-1102.2r",  0x010000, 0x008000, CRC(17c7e780) SHA1(675a2fe5ac55c97d54153eacabf863a525e4b71f) )  /* bank 1, plane 1 */
15131564   ROM_LOAD( "136048-1103.2n",  0x020000, 0x008000, CRC(39688e01) SHA1(1b273e26b48a2f69b0895c29c9b3e762c686661d) )  /* bank 1, plane 2 */
r3232r3233
15501601
15511602ROM_START( roadbls3 )
15521603   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
1553   ROM_LOAD16_BYTE( "136032.205",   0x000000, 0x004000, CRC(88d0be26) SHA1(d124045eccc562ff0423b23a240e27ad740fa0c9) )
1554   ROM_LOAD16_BYTE( "136032.206",   0x000001, 0x004000, CRC(3c79ef05) SHA1(20fdca7131478e1ee12691bdafd2d5bb74cbd16f) )
1604    MOTHERBOARD_BIOS
15551605   ROM_LOAD16_BYTE( "136048-3157.11c", 0x010000, 0x008000, CRC(ce88fe34) SHA1(72a311e7e2e5f588226168e048905281f71f0aef) )
15561606   ROM_LOAD16_BYTE( "136048-3158.11a", 0x010001, 0x008000, CRC(03bf2879) SHA1(27f2622b9e2a3f823557fd231a8b0e3234fea5cb) )
15571607   ROM_LOAD16_BYTE( "136048-3159.13c", 0x020000, 0x008000, CRC(4305d74a) SHA1(618e0c638efb4110daf0954e89368c7b68a2a155) )
r3232r3233
15701620   ROM_LOAD( "136048-1169.1516e", 0x8000, 0x4000, CRC(ee318052) SHA1(f66ff39499697b7439dc62567e727fec769c1505) )
15711621   ROM_LOAD( "136048-1170.17e",   0xc000, 0x4000, CRC(75dfec33) SHA1(3092348b98419bb23181d21406733d5d21cd3d82) )
15721622
1573   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
1574   ROM_LOAD( "136032.107",   0x00000, 0x02000, CRC(7a29dc07) SHA1(72ba464da01bd6d3a91b8d9997d5ac14b6f47aad) )  /* alpha font */
1623   ROM_REGION( 0x2000, "alpha", ROMREGION_DISPOSE )
1624    MOTHERBOARD_ALPHA
15751625
1576   ROM_REGION( 0x380000, "gfx2", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
1626   ROM_REGION( 0x380000, "tiles", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
15771627   ROM_LOAD( "136048-1101.2s",  0x000000, 0x008000, CRC(fe342d27) SHA1(72deac16ab9b6b811f49d70d700d6bc3a904f9d5) )  /* bank 1, plane 0 */
15781628   ROM_LOAD( "136048-1102.2r",  0x010000, 0x008000, CRC(17c7e780) SHA1(675a2fe5ac55c97d54153eacabf863a525e4b71f) )  /* bank 1, plane 1 */
15791629   ROM_LOAD( "136048-1103.2n",  0x020000, 0x008000, CRC(39688e01) SHA1(1b273e26b48a2f69b0895c29c9b3e762c686661d) )  /* bank 1, plane 2 */
r3232r3233
16161666
16171667ROM_START( roadblg2 )
16181668   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
1619   ROM_LOAD16_BYTE( "136032.205",   0x000000, 0x004000, CRC(88d0be26) SHA1(d124045eccc562ff0423b23a240e27ad740fa0c9) )
1620   ROM_LOAD16_BYTE( "136032.206",   0x000001, 0x004000, CRC(3c79ef05) SHA1(20fdca7131478e1ee12691bdafd2d5bb74cbd16f) )
1669    MOTHERBOARD_BIOS
16211670   ROM_LOAD16_BYTE( "136048-1239.11c", 0x010000, 0x008000, CRC(3b2bb14b) SHA1(e5eac61a4249a644fbc27908b443a3830d4488e6) )
16221671   ROM_CONTINUE(                       0x050000, 0x008000 )
16231672   ROM_LOAD16_BYTE( "136048-1240.11a", 0x010001, 0x008000, CRC(2a5ab597) SHA1(3bdd27c67b05a426bd57e03a5c71948b6b57a40a) )
r3232r3233
16361685   ROM_LOAD( "136048-1169.1516e", 0x8000, 0x4000, CRC(ee318052) SHA1(f66ff39499697b7439dc62567e727fec769c1505) )
16371686   ROM_LOAD( "136048-1170.17e",   0xc000, 0x4000, CRC(75dfec33) SHA1(3092348b98419bb23181d21406733d5d21cd3d82) )
16381687
1639   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
1640   ROM_LOAD( "136032.107",   0x00000, 0x02000, CRC(7a29dc07) SHA1(72ba464da01bd6d3a91b8d9997d5ac14b6f47aad) )  /* alpha font */
1688   ROM_REGION( 0x2000, "alpha", ROMREGION_DISPOSE )
1689    MOTHERBOARD_ALPHA
16411690
1642   ROM_REGION( 0x380000, "gfx2", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
1691   ROM_REGION( 0x380000, "tiles", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
16431692   ROM_LOAD( "136048-1101.2s",  0x000000, 0x008000, CRC(fe342d27) SHA1(72deac16ab9b6b811f49d70d700d6bc3a904f9d5) )  /* bank 1, plane 0 */
16441693   ROM_LOAD( "136048-1102.2r",  0x010000, 0x008000, CRC(17c7e780) SHA1(675a2fe5ac55c97d54153eacabf863a525e4b71f) )  /* bank 1, plane 1 */
16451694   ROM_LOAD( "136048-1103.2n",  0x020000, 0x008000, CRC(39688e01) SHA1(1b273e26b48a2f69b0895c29c9b3e762c686661d) )  /* bank 1, plane 2 */
r3232r3233
16821731
16831732ROM_START( roadbls2 )
16841733   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
1685   ROM_LOAD16_BYTE( "136032.205",   0x000000, 0x004000, CRC(88d0be26) SHA1(d124045eccc562ff0423b23a240e27ad740fa0c9) )
1686   ROM_LOAD16_BYTE( "136032.206",   0x000001, 0x004000, CRC(3c79ef05) SHA1(20fdca7131478e1ee12691bdafd2d5bb74cbd16f) )
1734    MOTHERBOARD_BIOS
16871735   ROM_LOAD16_BYTE( "136048-1139.11c", 0x010000, 0x008000, CRC(b73c1bd5) SHA1(c4de0267a75225db22c771bec14b8da2fc9f06bf) )
16881736   ROM_CONTINUE(                       0x050000, 0x008000 )
16891737   ROM_LOAD16_BYTE( "136048-1140.11a", 0x010001, 0x008000, CRC(6305429b) SHA1(c4180f6438a539ddc34c12529e5ac6d59c107728) )
r3232r3233
17021750   ROM_LOAD( "136048-1169.1516e", 0x8000, 0x4000, CRC(ee318052) SHA1(f66ff39499697b7439dc62567e727fec769c1505) )
17031751   ROM_LOAD( "136048-1170.17e",   0xc000, 0x4000, CRC(75dfec33) SHA1(3092348b98419bb23181d21406733d5d21cd3d82) )
17041752
1705   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
1706   ROM_LOAD( "136032.107",   0x00000, 0x02000, CRC(7a29dc07) SHA1(72ba464da01bd6d3a91b8d9997d5ac14b6f47aad) )  /* alpha font */
1753   ROM_REGION( 0x2000, "alpha", ROMREGION_DISPOSE )
1754    MOTHERBOARD_ALPHA
17071755
1708   ROM_REGION( 0x380000, "gfx2", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
1756   ROM_REGION( 0x380000, "tiles", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
17091757   ROM_LOAD( "136048-1101.2s",  0x000000, 0x008000, CRC(fe342d27) SHA1(72deac16ab9b6b811f49d70d700d6bc3a904f9d5) )  /* bank 1, plane 0 */
17101758   ROM_LOAD( "136048-1102.2r",  0x010000, 0x008000, CRC(17c7e780) SHA1(675a2fe5ac55c97d54153eacabf863a525e4b71f) )  /* bank 1, plane 1 */
17111759   ROM_LOAD( "136048-1103.2n",  0x020000, 0x008000, CRC(39688e01) SHA1(1b273e26b48a2f69b0895c29c9b3e762c686661d) )  /* bank 1, plane 2 */
r3232r3233
17481796
17491797ROM_START( roadblg1 )
17501798   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
1751   ROM_LOAD16_BYTE( "136032.205",   0x000000, 0x004000, CRC(88d0be26) SHA1(d124045eccc562ff0423b23a240e27ad740fa0c9) )
1752   ROM_LOAD16_BYTE( "136032.206",   0x000001, 0x004000, CRC(3c79ef05) SHA1(20fdca7131478e1ee12691bdafd2d5bb74cbd16f) )
1799    MOTHERBOARD_BIOS
17531800   ROM_LOAD16_BYTE( "136048-1251.11c", 0x010000, 0x008000, CRC(7e94d6a2) SHA1(985b7537dc484975b458a9ae5780e32a5f742d1c) )
17541801   ROM_CONTINUE(                       0x050000, 0x008000 )
17551802   ROM_LOAD16_BYTE( "136048-1252.11a", 0x010001, 0x008000, CRC(d7a66215) SHA1(f9797384f2d01b0dda2ff47c3560ca3489a7a38c) )
r3232r3233
17681815   ROM_LOAD( "136048-1169.1516e", 0x8000, 0x4000, CRC(ee318052) SHA1(f66ff39499697b7439dc62567e727fec769c1505) )
17691816   ROM_LOAD( "136048-1170.17e",   0xc000, 0x4000, CRC(75dfec33) SHA1(3092348b98419bb23181d21406733d5d21cd3d82) )
17701817
1771   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
1772   ROM_LOAD( "136032.107",   0x00000, 0x02000, CRC(7a29dc07) SHA1(72ba464da01bd6d3a91b8d9997d5ac14b6f47aad) )  /* alpha font */
1818   ROM_REGION( 0x2000, "alpha", ROMREGION_DISPOSE )
1819    MOTHERBOARD_ALPHA
17731820
1774   ROM_REGION( 0x380000, "gfx2", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
1821   ROM_REGION( 0x380000, "tiles", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
17751822   ROM_LOAD( "136048-1101.2s",  0x000000, 0x008000, CRC(fe342d27) SHA1(72deac16ab9b6b811f49d70d700d6bc3a904f9d5) )  /* bank 1, plane 0 */
17761823   ROM_LOAD( "136048-1102.2r",  0x010000, 0x008000, CRC(17c7e780) SHA1(675a2fe5ac55c97d54153eacabf863a525e4b71f) )  /* bank 1, plane 1 */
17771824   ROM_LOAD( "136048-1103.2n",  0x020000, 0x008000, CRC(39688e01) SHA1(1b273e26b48a2f69b0895c29c9b3e762c686661d) )  /* bank 1, plane 2 */
r3232r3233
18141861
18151862ROM_START( roadbls1 )
18161863   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
1817   ROM_LOAD16_BYTE( "136032.205",   0x000000, 0x004000, CRC(88d0be26) SHA1(d124045eccc562ff0423b23a240e27ad740fa0c9) )
1818   ROM_LOAD16_BYTE( "136032.206",   0x000001, 0x004000, CRC(3c79ef05) SHA1(20fdca7131478e1ee12691bdafd2d5bb74cbd16f) )
1864    MOTHERBOARD_BIOS
18191865   ROM_LOAD16_BYTE( "136048-2151.11c", 0x010000, 0x008000, CRC(ea6b3060) SHA1(0786f2e528c6a77ad7422ae199d06b7261cb4f2c) )
18201866   ROM_CONTINUE(                       0x050000, 0x008000 )
18211867   ROM_LOAD16_BYTE( "136048-2152.11a", 0x010001, 0x008000, CRC(f5c1fbe0) SHA1(1917f2110a8021198b0cdadbaeab44c71b3bb0b5) )
r3232r3233
18341880   ROM_LOAD( "136048-1169.1516e", 0x8000, 0x4000, CRC(ee318052) SHA1(f66ff39499697b7439dc62567e727fec769c1505) )
18351881   ROM_LOAD( "136048-1170.17e",   0xc000, 0x4000, CRC(75dfec33) SHA1(3092348b98419bb23181d21406733d5d21cd3d82) )
18361882
1837   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
1838   ROM_LOAD( "136032.107",   0x00000, 0x02000, CRC(7a29dc07) SHA1(72ba464da01bd6d3a91b8d9997d5ac14b6f47aad) )  /* alpha font */
1883   ROM_REGION( 0x2000, "alpha", ROMREGION_DISPOSE )
1884    MOTHERBOARD_ALPHA
18391885
1840   ROM_REGION( 0x380000, "gfx2", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
1886   ROM_REGION( 0x380000, "tiles", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
18411887   ROM_LOAD( "136048-1101.2s",  0x000000, 0x008000, CRC(fe342d27) SHA1(72deac16ab9b6b811f49d70d700d6bc3a904f9d5) )  /* bank 1, plane 0 */
18421888   ROM_LOAD( "136048-1102.2r",  0x010000, 0x008000, CRC(17c7e780) SHA1(675a2fe5ac55c97d54153eacabf863a525e4b71f) )  /* bank 1, plane 1 */
18431889   ROM_LOAD( "136048-1103.2n",  0x020000, 0x008000, CRC(39688e01) SHA1(1b273e26b48a2f69b0895c29c9b3e762c686661d) )  /* bank 1, plane 2 */
r3232r3233
18801926
18811927ROM_START( roadblsc )
18821928   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
1883   ROM_LOAD16_BYTE( "136032.205",   0x000000, 0x004000, CRC(88d0be26) SHA1(d124045eccc562ff0423b23a240e27ad740fa0c9) )
1884   ROM_LOAD16_BYTE( "136032.206",   0x000001, 0x004000, CRC(3c79ef05) SHA1(20fdca7131478e1ee12691bdafd2d5bb74cbd16f) )
1929    MOTHERBOARD_BIOS
18851930   ROM_LOAD16_BYTE( "136048-1179.7p",  0x010000, 0x008000, CRC(ef448f96) SHA1(238a6c435e317383a1983702ef0a1f2b757ebe8c) )
18861931   ROM_LOAD16_BYTE( "136048-1180.8p",  0x010001, 0x008000, CRC(bdb368d5) SHA1(9c79b053708ff619a2733664f881abb849ae2371) )
18871932   ROM_LOAD16_BYTE( "136048-1181.7r",  0x020000, 0x008000, CRC(d52581da) SHA1(d0a475f9d8199bc7c0ce6e6a663f214df9bffc39) )
r3232r3233
19001945   ROM_LOAD( "136048-1169.1516e", 0x8000, 0x4000, CRC(ee318052) SHA1(f66ff39499697b7439dc62567e727fec769c1505) )
19011946   ROM_LOAD( "136048-1170.17e",   0xc000, 0x4000, CRC(75dfec33) SHA1(3092348b98419bb23181d21406733d5d21cd3d82) )
19021947
1903   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
1904   ROM_LOAD( "136032.107",   0x00000, 0x02000, CRC(7a29dc07) SHA1(72ba464da01bd6d3a91b8d9997d5ac14b6f47aad) )  /* alpha font */
1948   ROM_REGION( 0x2000, "alpha", ROMREGION_DISPOSE )
1949    MOTHERBOARD_ALPHA
19051950
1906   ROM_REGION( 0x380000, "gfx2", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
1951   ROM_REGION( 0x380000, "tiles", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
19071952   ROM_LOAD( "136048-1101.2s",  0x000000, 0x008000, CRC(fe342d27) SHA1(72deac16ab9b6b811f49d70d700d6bc3a904f9d5) )  /* bank 1, plane 0 */
19081953   ROM_LOAD( "136048-1102.2r",  0x010000, 0x008000, CRC(17c7e780) SHA1(675a2fe5ac55c97d54153eacabf863a525e4b71f) )  /* bank 1, plane 1 */
19091954   ROM_LOAD( "136048-1103.2n",  0x020000, 0x008000, CRC(39688e01) SHA1(1b273e26b48a2f69b0895c29c9b3e762c686661d) )  /* bank 1, plane 2 */
r3232r3233
19461991
19471992ROM_START( roadblcg )
19481993   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
1949   ROM_LOAD16_BYTE( "136032.205",   0x000000, 0x004000, CRC(88d0be26) SHA1(d124045eccc562ff0423b23a240e27ad740fa0c9) )
1950   ROM_LOAD16_BYTE( "136032.206",   0x000001, 0x004000, CRC(3c79ef05) SHA1(20fdca7131478e1ee12691bdafd2d5bb74cbd16f) )
1994    MOTHERBOARD_BIOS
19511995   ROM_LOAD16_BYTE( "136048-1235.7p",  0x010000, 0x008000, CRC(58b2998f) SHA1(7e9f4ca2b15cf60c61e0615f214f9fcc518cb194) )
19521996   ROM_LOAD16_BYTE( "136048-1236.8p",  0x010001, 0x008000, CRC(02e23a40) SHA1(6525351669e95dab869c7adc7d992d12d9313aee) )
19531997   ROM_LOAD16_BYTE( "136048-1237.7r",  0x020000, 0x008000, CRC(5e0a7c5d) SHA1(fb3688fbadc05f96980c67f5446ccb250d20b1a3) )
r3232r3233
19662010   ROM_LOAD( "136048-1169.1516e", 0x8000, 0x4000, CRC(ee318052) SHA1(f66ff39499697b7439dc62567e727fec769c1505) )
19672011   ROM_LOAD( "136048-1170.17e",   0xc000, 0x4000, CRC(75dfec33) SHA1(3092348b98419bb23181d21406733d5d21cd3d82) )
19682012
1969   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
1970   ROM_LOAD( "136032.107",   0x00000, 0x02000, CRC(7a29dc07) SHA1(72ba464da01bd6d3a91b8d9997d5ac14b6f47aad) )  /* alpha font */
2013   ROM_REGION( 0x2000, "alpha", ROMREGION_DISPOSE )
2014    MOTHERBOARD_ALPHA
19712015
1972   ROM_REGION( 0x380000, "gfx2", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
2016   ROM_REGION( 0x380000, "tiles", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
19732017   ROM_LOAD( "136048-1101.2s",  0x000000, 0x008000, CRC(fe342d27) SHA1(72deac16ab9b6b811f49d70d700d6bc3a904f9d5) )  /* bank 1, plane 0 */
19742018   ROM_LOAD( "136048-1102.2r",  0x010000, 0x008000, CRC(17c7e780) SHA1(675a2fe5ac55c97d54153eacabf863a525e4b71f) )  /* bank 1, plane 1 */
19752019   ROM_LOAD( "136048-1103.2n",  0x020000, 0x008000, CRC(39688e01) SHA1(1b273e26b48a2f69b0895c29c9b3e762c686661d) )  /* bank 1, plane 2 */
r3232r3233
20122056
20132057ROM_START( roadblc1 )
20142058   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
2015   ROM_LOAD16_BYTE( "136032.205",   0x000000, 0x004000, CRC(88d0be26) SHA1(d124045eccc562ff0423b23a240e27ad740fa0c9) )
2016   ROM_LOAD16_BYTE( "136032.206",   0x000001, 0x004000, CRC(3c79ef05) SHA1(20fdca7131478e1ee12691bdafd2d5bb74cbd16f) )
2059    MOTHERBOARD_BIOS
20172060   ROM_LOAD16_BYTE( "136048-2135.7p",  0x010000, 0x008000, CRC(c0ef86df) SHA1(7dd4d2acba55dc001e009c37fae5a97a53ea1e66) )
20182061   ROM_LOAD16_BYTE( "136048-2136.8p",  0x010001, 0x008000, CRC(9637e2f0) SHA1(86257e1316356c1a7d86bcf7b57bcaff33ac3df5) )
20192062   ROM_LOAD16_BYTE( "136048-2137.7r",  0x020000, 0x008000, CRC(5382ab85) SHA1(1511dfaf8537980e506e4180a23ffcfcfec81451) )
r3232r3233
20322075   ROM_LOAD( "136048-1169.1516e", 0x8000, 0x4000, CRC(ee318052) SHA1(f66ff39499697b7439dc62567e727fec769c1505) )
20332076   ROM_LOAD( "136048-1170.17e",   0xc000, 0x4000, CRC(75dfec33) SHA1(3092348b98419bb23181d21406733d5d21cd3d82) )
20342077
2035   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
2036   ROM_LOAD( "136032.107",   0x00000, 0x02000, CRC(7a29dc07) SHA1(72ba464da01bd6d3a91b8d9997d5ac14b6f47aad) )  /* alpha font */
2078   ROM_REGION( 0x2000, "alpha", ROMREGION_DISPOSE )
2079    MOTHERBOARD_ALPHA
20372080
2038   ROM_REGION( 0x380000, "gfx2", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
2081   ROM_REGION( 0x380000, "tiles", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
20392082   ROM_LOAD( "136048-1101.2s",  0x000000, 0x008000, CRC(fe342d27) SHA1(72deac16ab9b6b811f49d70d700d6bc3a904f9d5) )  /* bank 1, plane 0 */
20402083   ROM_LOAD( "136048-1102.2r",  0x010000, 0x008000, CRC(17c7e780) SHA1(675a2fe5ac55c97d54153eacabf863a525e4b71f) )  /* bank 1, plane 1 */
20412084   ROM_LOAD( "136048-1103.2n",  0x020000, 0x008000, CRC(39688e01) SHA1(1b273e26b48a2f69b0895c29c9b3e762c686661d) )  /* bank 1, plane 2 */
r3232r3233
21622205 *
21632206 *************************************/
21642207
2165GAME( 1984, marble,   0,        atarisy1, marble,   marble,   ROT0, "Atari Games", "Marble Madness (set 1)", 0 )
2208GAME( 1984, atarisy1, 0,        atarisy1, peterpak, peterpak, ROT0, "Atari Games", "Atari System 1 BIOS", GAME_IS_BIOS_ROOT )
2209
2210GAME( 1984, marble,   atarisy1, atarisy1, marble,   marble,   ROT0, "Atari Games", "Marble Madness (set 1)", 0 )
21662211GAME( 1984, marble2,  marble,   atarisy1, marble,   marble,   ROT0, "Atari Games", "Marble Madness (set 2)", 0 )
21672212GAME( 1984, marble3,  marble,   atarisy1, marble,   marble,   ROT0, "Atari Games", "Marble Madness (set 3)", 0 )
21682213GAME( 1984, marble4,  marble,   atarisy1, marble,   marble,   ROT0, "Atari Games", "Marble Madness (set 4)", 0 )
2214GAME( 1984, marble5,  marble,   atarisy1, marble,   marble,   ROT0, "Atari Games", "Marble Madness (set 5 - LSI Cartridge)", 0 )
21692215
2170GAME( 1984, peterpak, 0,        atarisy1, peterpak, peterpak, ROT0, "Atari Games", "Peter Pack-Rat", 0 )
2216GAME( 1984, peterpak, atarisy1, atarisy1, peterpak, peterpak, ROT0, "Atari Games", "Peter Pack-Rat", 0 )
21712217
2172GAME( 1985, indytemp, 0,        atarisy1, indytemp, indytemp, ROT0, "Atari Games", "Indiana Jones and the Temple of Doom (set 1)", 0 )
2218GAME( 1985, indytemp, atarisy1, atarisy1, indytemp, indytemp, ROT0, "Atari Games", "Indiana Jones and the Temple of Doom (set 1)", 0 )
21732219GAME( 1985, indytem2, indytemp, atarisy1, indytemp, indytemp, ROT0, "Atari Games", "Indiana Jones and the Temple of Doom (set 2)", 0 )
21742220GAME( 1985, indytem3, indytemp, atarisy1, indytemp, indytemp, ROT0, "Atari Games", "Indiana Jones and the Temple of Doom (set 3)", 0 )
21752221GAME( 1985, indytem4, indytemp, atarisy1, indytemp, indytemp, ROT0, "Atari Games", "Indiana Jones and the Temple of Doom (set 4)", 0 )
21762222GAME( 1985, indytemd, indytemp, atarisy1, indytemp, indytemp, ROT0, "Atari Games", "Indiana Jones and the Temple of Doom (German)", 0 )
21772223GAME( 1985, indytemc, indytemp, atarisy1, indytemp, indytemp, ROT0, "Atari Games", "Indiana Jones and the Temple of Doom (Cocktail)", 0 )
21782224
2179GAME( 1985, roadrunn, 0,        atarisy1, roadrunn, roadrunn, ROT0, "Atari Games", "Road Runner (rev 2)", 0 )
2225GAME( 1985, roadrunn, atarisy1, atarisy1, roadrunn, roadrunn, ROT0, "Atari Games", "Road Runner (rev 2)", 0 )
21802226GAME( 1985, roadrun2, roadrunn, atarisy1, roadrunn, roadrunn, ROT0, "Atari Games", "Road Runner (rev 1+)", 0 )
21812227GAME( 1985, roadrun1, roadrunn, atarisy1, roadrunn, roadrunn, ROT0, "Atari Games", "Road Runner (rev 1)", 0 )
21822228
2183GAME( 1987, roadblst, 0,        atarisy1, roadblst, roadb110, ROT0, "Atari Games", "Road Blasters (upright, rev 4)", 0 )
2229GAME( 1987, roadblst, atarisy1, atarisy1, roadblst, roadb110, ROT0, "Atari Games", "Road Blasters (upright, rev 4)", 0 )
21842230GAME( 1987, roadblsg, roadblst, atarisy1, roadblst, roadb109, ROT0, "Atari Games", "Road Blasters (upright, German, rev 3)", 0 )
21852231GAME( 1987, roadbls3, roadblst, atarisy1, roadblst, roadb109, ROT0, "Atari Games", "Road Blasters (upright, rev 3)", 0 )
21862232GAME( 1987, roadblg2, roadblst, atarisy1, roadblst, roadb110, ROT0, "Atari Games", "Road Blasters (upright, German, rev 2)", 0 )
src/mame/drivers/wgp.c
r3232r3233
415415READ16_HANDLER ( wgp_piv_ctrl_word_r );
416416WRITE16_HANDLER( wgp_piv_ctrl_word_w );
417417
418static UINT16 cpua_ctrl = 0xff;
418static UINT16 cpua_ctrl;
419419static UINT16 port_sel=0;
420420extern UINT16 wgp_rotate_ctrl[8];
421421
r3232r3233
619619                          SOUND
620620**********************************************************/
621621
622static INT32 banknum = -1;
622static INT32 banknum;
623623
624624static void reset_sound_region(running_machine *machine)   /* assumes Z80 sandwiched between the 68Ks */
625625{
r3232r3233
938938   reset_sound_region(machine);
939939}
940940
941static MACHINE_RESET( wgp )
942{
943   banknum = -1;
944   cpua_ctrl = 0xff;
945   port_sel=0;
946}
947
941948static MACHINE_START( wgp )
942949{
943950   state_save_register_global(cpua_ctrl);
r3232r3233
960967   MDRV_CPU_VBLANK_INT("main", wgp_cpub_interrupt)
961968
962969   MDRV_MACHINE_START(wgp)
970   MDRV_MACHINE_RESET(wgp)
963971
964972   MDRV_INTERLEAVE(250)
965973
r3232r3233
12131221#endif
12141222
12151223//  taitosnd_setz80_soundcpu( 2 );
1216   cpua_ctrl = 0xff;
12171224}
12181225
12191226static DRIVER_INIT( wgp2 )
r3232r3233
12221229   UINT16 *ROM = (UINT16 *)memory_region(machine, "sub");
12231230   ROM[0x8008 / 2] = 0x0;
12241231   ROM[0x8010 / 2] = 0x0;
1225
1226   cpua_ctrl = 0xff;
12271232}
12281233
12291234/* Working Games with some graphics problems - e.g. missing rotation */
src/mame/drivers/welltris.c
r3232r3233
764764
765765ROM_START( welltris )
766766   ROM_REGION( 0x180000, "main", 0 )   /* 68000 code */
767   ROM_LOAD16_BYTE( "j2u.8", 0x000000, 0x20000, BAD_DUMP CRC(00a382a4) SHA1(b6a7e1b360e3cefc582983c8dff6aa28a7c77124) )
768   ROM_LOAD16_BYTE( "j1u.7", 0x000001, 0x20000, BAD_DUMP CRC(abcb008b) SHA1(c71ed431cbd8aea0b4396029203a7b735a8fdac3) )
767   ROM_LOAD16_BYTE( "j2u.8", 0x000000, 0x20000, CRC(7488fe94) SHA1(41874366e2ab763cd827ff712b76ea2da0f9af6a) )
768   ROM_LOAD16_BYTE( "j1u.7", 0x000001, 0x20000, CRC(571413ac) SHA1(5eb9387efb9c1597005abff4d79f4b32aa7c93b2) )
769769   /* Space */
770770   ROM_LOAD16_BYTE( "lh532j10.10", 0x100000, 0x40000, CRC(1187c665) SHA1(c6c55016e46805694348b386e521a3ef1a443621) )
771771   ROM_LOAD16_BYTE( "lh532j11.9",  0x100001, 0x40000, CRC(18eda9e5) SHA1(c01d1dc6bfde29797918490947c89440b58d5372) )
src/mame/drivers/sprint8.c
r3232r3233
2828static TIMER_CALLBACK( input_callback )
2929{
3030   static UINT8 dial[8];
31   static const char *dialnames[] = { "DIAL1", "DIAL2", "DIAL3", "DIAL4", "DIAL5", "DIAL6", "DIAL7", "DIAL8" };
31   static const char *const dialnames[] = { "DIAL1", "DIAL2", "DIAL3", "DIAL4", "DIAL5", "DIAL6", "DIAL7", "DIAL8" };
3232
3333   int i;
3434
r3232r3233
7171
7272static READ8_HANDLER( sprint8_input_r )
7373{
74   static const char *portnames[] = { "P1", "P2", "P3", "P4", "P5", "P6", "P7", "P8" };
74   static const char *const portnames[] = { "P1", "P2", "P3", "P4", "P5", "P6", "P7", "P8" };
7575   UINT8 val = input_port_read(machine, portnames[offset]);
7676
7777   if (steer_dir[offset])
src/mame/drivers/ssv.c
r3232r3233
491491
492492static READ16_HANDLER( gdfs_eeprom_r )
493493{
494   static const char *gunnames[] = { "GUNX1", "GUNY1", "GUNX2", "GUNY2" };
494   static const char *const gunnames[] = { "GUNX1", "GUNY1", "GUNX2", "GUNY2" };
495495
496496   return (((gdfs_lightgun_select & 1) ? 0 : 0xff) ^ input_port_read(machine, gunnames[gdfs_lightgun_select])) | (eeprom_read_bit() << 8);
497497}
src/mame/drivers/taitoair.c
r3232r3233
341341}
342342
343343
344static INT32 banknum = -1;
344static INT32 banknum;
345345
346346static void reset_sound_region(running_machine *machine)
347347{
r3232r3233
362362static MACHINE_START( taitoair )
363363{
364364   dsp_HOLD_signal = ASSERT_LINE;
365   banknum = -1;
365366
366367   state_save_register_global(banknum);
367368   state_save_register_postload(machine, taitoair_postload, NULL);
src/mame/drivers/atarig42.c
r3232r3233
8484
8585static WRITE16_HANDLER( a2d_select_w )
8686{
87   static const char *portnames[] = { "A2D0", "A2D1" };
87   static const char *const portnames[] = { "A2D0", "A2D1" };
8888
8989   analog_data = input_port_read(machine, portnames[offset != 0]);
9090}
src/mame/drivers/tceptor.c
r3232r3233
319319
320320   PORT_MODIFY("DSW2")
321321   PORT_DIPNAME( 0x04, 0x04, "MODE" )
322   PORT_DIPSETTING(    0x00, "2D" )
322   PORT_DIPSETTING(    0x00, "2d" )
323323   PORT_DIPSETTING(    0x04, "3D" )
324324   PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN )
325325INPUT_PORTS_END
r3232r3233
383383   /* basic machine hardware */
384384   MDRV_CPU_ADD("main", M6809, 49152000/32)
385385   MDRV_CPU_PROGRAM_MAP(m6809_map,0)
386   MDRV_CPU_VBLANK_INT("2D", m6809_vb_interrupt)
386   MDRV_CPU_VBLANK_INT("2d", m6809_vb_interrupt)
387387
388388   MDRV_CPU_ADD("audio", M65C02, 49152000/24)
389389   MDRV_CPU_PROGRAM_MAP(m6502_a_map,0)
r3232r3233
393393
394394   MDRV_CPU_ADD("sub", M68000, 49152000/4)
395395   MDRV_CPU_PROGRAM_MAP(m68k_map,0)
396   MDRV_CPU_VBLANK_INT("2D", m68k_vb_interrupt)
396   MDRV_CPU_VBLANK_INT("2d", m68k_vb_interrupt)
397397
398398   MDRV_CPU_ADD("mcu", HD63701, 49152000/8)   /* or compatible 6808 with extra instructions */
399399   MDRV_CPU_PROGRAM_MAP(mcu_map,0)
400400   MDRV_CPU_IO_MAP(mcu_io_map,0)
401   MDRV_CPU_VBLANK_INT("2D", mcu_vb_interrupt)
401   MDRV_CPU_VBLANK_INT("2d", mcu_vb_interrupt)
402402
403403   MDRV_INTERLEAVE(100)
404404
r3232r3233
412412   MDRV_PALETTE_LENGTH(4096)
413413   MDRV_DEFAULT_LAYOUT(layout_horizont)
414414
415   MDRV_SCREEN_ADD("2D", RASTER)
415   MDRV_SCREEN_ADD("2d", RASTER)
416416   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
417417   MDRV_SCREEN_REFRESH_RATE(60.606060)
418418   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
419419   MDRV_SCREEN_SIZE(38*8, 32*8)
420420   MDRV_SCREEN_VISIBLE_AREA(2*8, 34*8-1 + 2*8, 0*8, 28*8-1 + 0)
421421
422   MDRV_SCREEN_ADD("3D Left", RASTER)
422   MDRV_SCREEN_ADD("3dleft", RASTER)
423423   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
424424   MDRV_SCREEN_REFRESH_RATE(60.606060)
425425   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
426426   MDRV_SCREEN_SIZE(38*8, 32*8)
427427   MDRV_SCREEN_VISIBLE_AREA(2*8, 34*8-1 + 2*8, 0*8, 28*8-1 + 0)
428428
429   MDRV_SCREEN_ADD("3D Right", RASTER)
429   MDRV_SCREEN_ADD("3dright", RASTER)
430430   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
431431   MDRV_SCREEN_REFRESH_RATE(60.606060)
432432   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
src/mame/drivers/cop01.c
r3232r3233
114114   AM_RANGE(0xf000, 0xf3ff) AM_WRITE(cop01_foreground_w) AM_BASE(&cop01_fgvideoram)
115115ADDRESS_MAP_END
116116
117static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 )
117static ADDRESS_MAP_START( io_map, ADDRESS_SPACE_IO, 8 )
118118   ADDRESS_MAP_GLOBAL_MASK(0xff)
119119   AM_RANGE(0x00, 0x00) AM_READ_PORT("P1")
120120   AM_RANGE(0x01, 0x01) AM_READ_PORT("P2")
121121   AM_RANGE(0x02, 0x02) AM_READ_PORT("SYSTEM")
122122   AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW1")
123123   AM_RANGE(0x04, 0x04) AM_READ_PORT("DSW2")
124   AM_RANGE(0x40, 0x43) AM_WRITE(cop01_vreg_w)
125   AM_RANGE(0x44, 0x44) AM_WRITE(cop01_sound_command_w)
126   AM_RANGE(0x45, 0x45) AM_WRITE(watchdog_reset_w) /* ? */
124127ADDRESS_MAP_END
125128
126static ADDRESS_MAP_START( mightguy_readport, ADDRESS_SPACE_IO, 8 )
129static ADDRESS_MAP_START( mightguy_io_map, ADDRESS_SPACE_IO, 8 )
127130   ADDRESS_MAP_GLOBAL_MASK(0xff)
128131   AM_RANGE(0x00, 0x00) AM_READ_PORT("P1")
129132   AM_RANGE(0x01, 0x01) AM_READ_PORT("P2")
130133   AM_RANGE(0x02, 0x02) AM_READ_PORT("SYSTEM")
131134   AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW1")
132135   AM_RANGE(0x04, 0x04) AM_READ_PORT("DSW2")
133ADDRESS_MAP_END
134
135static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 )
136   ADDRESS_MAP_GLOBAL_MASK(0xff)
137136   AM_RANGE(0x40, 0x43) AM_WRITE(cop01_vreg_w)
138137   AM_RANGE(0x44, 0x44) AM_WRITE(cop01_sound_command_w)
139138   AM_RANGE(0x45, 0x45) AM_WRITE(watchdog_reset_w) /* ? */
r3232r3233
150149   AM_RANGE(0xc000, 0xc7ff) AM_WRITE(SMH_RAM)
151150ADDRESS_MAP_END
152151
153static ADDRESS_MAP_START( sound_readport, ADDRESS_SPACE_IO, 8 )
152static ADDRESS_MAP_START( audio_io_map, ADDRESS_SPACE_IO, 8 )
154153   ADDRESS_MAP_GLOBAL_MASK(0xff)
155   AM_RANGE(0x06, 0x06) AM_READ(cop01_sound_command_r)
156ADDRESS_MAP_END
157
158static ADDRESS_MAP_START( sound_writeport, ADDRESS_SPACE_IO, 8 )
159   ADDRESS_MAP_GLOBAL_MASK(0xff)
160154   AM_RANGE(0x00, 0x00) AM_WRITE(ay8910_control_port_0_w)
161155   AM_RANGE(0x01, 0x01) AM_WRITE(ay8910_write_port_0_w)
162156   AM_RANGE(0x02, 0x02) AM_WRITE(ay8910_control_port_1_w)
163157   AM_RANGE(0x03, 0x03) AM_WRITE(ay8910_write_port_1_w)
164158   AM_RANGE(0x04, 0x04) AM_WRITE(ay8910_control_port_2_w)
165159   AM_RANGE(0x05, 0x05) AM_WRITE(ay8910_write_port_2_w)
160   AM_RANGE(0x06, 0x06) AM_READ(cop01_sound_command_r)
166161ADDRESS_MAP_END
167162
163
168164/* this just gets some garbage out of the YM3526 */
169165static READ8_HANDLER( kludge ) { static int timer; return timer++; }
170166
171static ADDRESS_MAP_START( mightguy_sound_readport, ADDRESS_SPACE_IO, 8 )
167static ADDRESS_MAP_START( mightguy_audio_io_map, ADDRESS_SPACE_IO, 8 )
172168   ADDRESS_MAP_GLOBAL_MASK(0xff)
173   AM_RANGE(0x03, 0x03) AM_READ(kludge)      /* 1412M2? */
174   AM_RANGE(0x06, 0x06) AM_READ(cop01_sound_command_r)
175ADDRESS_MAP_END
176
177static ADDRESS_MAP_START( mightguy_sound_writeport, ADDRESS_SPACE_IO, 8 )
178   ADDRESS_MAP_GLOBAL_MASK(0xff)
179169   AM_RANGE(0x00, 0x00) AM_WRITE(ym3526_control_port_0_w)
180170   AM_RANGE(0x01, 0x01) AM_WRITE(ym3526_write_port_0_w)
181171   AM_RANGE(0x02, 0x02) AM_WRITE(SMH_NOP)   /* 1412M2? */
182172   AM_RANGE(0x03, 0x03) AM_WRITE(SMH_NOP)   /* 1412M2? */
173   AM_RANGE(0x03, 0x03) AM_READ(kludge)   /* 1412M2? */
174   AM_RANGE(0x06, 0x06) AM_READ(cop01_sound_command_r)
183175ADDRESS_MAP_END
184176
185177
r3232r3233
407399   /* basic machine hardware */
408400   MDRV_CPU_ADD("main", Z80, 4000000)   /* ???? */
409401   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
410   MDRV_CPU_IO_MAP(readport,writeport)
402   MDRV_CPU_IO_MAP(io_map,0)
411403   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
412404
413405   MDRV_CPU_ADD("audio", Z80, 3000000)   /* ???? */
414406   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
415   MDRV_CPU_IO_MAP(sound_readport,sound_writeport)
407   MDRV_CPU_IO_MAP(audio_io_map,0)
416408
417409   /* video hardware */
418410   MDRV_SCREEN_ADD("main", RASTER)
r3232r3233
447439   /* basic machine hardware */
448440   MDRV_CPU_ADD("main", Z80, 4000000)   /* ???? */
449441   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
450   MDRV_CPU_IO_MAP(mightguy_readport,writeport)
442   MDRV_CPU_IO_MAP(mightguy_io_map,0)
451443   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
452444
453445   MDRV_CPU_ADD("audio", Z80, 3000000)   /* ???? */
454446   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
455   MDRV_CPU_IO_MAP(mightguy_sound_readport,mightguy_sound_writeport)
447   MDRV_CPU_IO_MAP(mightguy_audio_io_map,0)
456448
457449   /* video hardware */
458450   MDRV_SCREEN_ADD("main", RASTER)
src/mame/drivers/mpu4drvr.c
r3232r3233
668668static UINT8 scn2674_display_enabled;
669669static UINT8 scn2674_cursor_enabled;
670670
671static void scn2674_write_command(UINT8 data)
671static void scn2674_write_command(running_machine *machine, UINT8 data)
672672{
673673   UINT8 oprand;
674674   int i;
r3232r3233
777777      {
778778         scn2674_irq_state = 1;
779779      }
780      update_mpu68_interrupts(Machine);
780      update_mpu68_interrupts(machine);
781781   }
782782   if ((data&0xe0)==0x80)
783783   {
r3232r3233
803803            scn2674_irq_state = 1;
804804         }
805805      }
806      update_mpu68_interrupts(Machine);
806      update_mpu68_interrupts(machine);
807807
808808   }
809809
r3232r3233
828828            scn2674_irq_state = 1;
829829         }
830830      }
831      update_mpu68_interrupts(Machine);
831      update_mpu68_interrupts(machine);
832832   }
833833
834834   /* Delayed Commands */
r3232r3233
962962         break;
963963
964964      case 1:
965         scn2674_write_command(data);
965         scn2674_write_command(machine, data);
966966         break;
967967
968968      case 2: scn2674_screen1_l = data; break;
r3232r3233
16551655static MACHINE_DRIVER_START( mpu4_vid )
16561656   MDRV_CPU_ADD("main", M6809, MPU4_MASTER_CLOCK/4 )
16571657   MDRV_CPU_PROGRAM_MAP(mpu4_6809_map,0)
1658   MDRV_TIMER_ADD_PERIODIC("50HZ",gen_50hz, HZ(100))
1658   MDRV_TIMER_ADD_PERIODIC("50hz",gen_50hz, HZ(100))
16591659
16601660   MDRV_NVRAM_HANDLER(generic_0fill)            /* confirm */
16611661
r3232r3233
16801680   MDRV_PALETTE_LENGTH(16)
16811681
16821682   MDRV_SPEAKER_STANDARD_MONO("mono")
1683   MDRV_SOUND_ADD("AY8913",AY8913, MPU4_MASTER_CLOCK/4)
1683   MDRV_SOUND_ADD("ay8913",AY8913, MPU4_MASTER_CLOCK/4)
16841684   MDRV_SOUND_CONFIG(ay8910_config)
16851685   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
16861686
r3232r3233
17041704   MDRV_CPU_ADD("main", M6809, MPU4_MASTER_CLOCK/4)
17051705   MDRV_CPU_PROGRAM_MAP(dealem_memmap,0)
17061706
1707   MDRV_TIMER_ADD_PERIODIC("50HZ",gen_50hz, HZ(100))
1707   MDRV_TIMER_ADD_PERIODIC("50hz",gen_50hz, HZ(100))
17081708
17091709   MDRV_SPEAKER_STANDARD_MONO("mono")
1710   MDRV_SOUND_ADD("AY8913",AY8913, MPU4_MASTER_CLOCK/4)
1710   MDRV_SOUND_ADD("ay8913",AY8913, MPU4_MASTER_CLOCK/4)
17111711   MDRV_SOUND_CONFIG(ay8910_config)
17121712   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
17131713
src/mame/drivers/angelkds.c
r3232r3233
181181static READ8_HANDLER( angelkds_input_r )
182182{
183183   int fake;
184   static const char *portnames[] = { "I81", "I82" };
185   static const char *fakenames[] = { "FAKE1", "FAKE2" };
184   static const char *const portnames[] = { "I81", "I82" };
185   static const char *const fakenames[] = { "FAKE1", "FAKE2" };
186186
187187   fake = input_port_read(machine, fakenames[offset]);
188188
r3232r3233
193193
194194static READ8_HANDLER( angelkds_input_r )
195195{
196   static const char *portnames[] = { "I81", "I82" };
196   static const char *const portnames[] = { "I81", "I82" };
197197
198198   return input_port_read(machine, portnames[offset]);
199199}
src/mame/drivers/midvunit.c
r3232r3233
150150
151151static WRITE32_HANDLER( midvunit_adc_w )
152152{
153   static const char *adcnames[] = { "WHEEL", "ACCEL", "BRAKE" };
153   static const char *const adcnames[] = { "WHEEL", "ACCEL", "BRAKE" };
154154
155155   if (!(control_data & 0x20))
156156   {
src/mame/drivers/kingpin.c
r3232r3233
9191   AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
9292ADDRESS_MAP_END
9393
94static ADDRESS_MAP_START( kingpin_readport, ADDRESS_SPACE_IO, 8 )
94static ADDRESS_MAP_START( kingpin_io_map, ADDRESS_SPACE_IO, 8 )
9595   ADDRESS_MAP_GLOBAL_MASK(0xff)
9696   AM_RANGE(0x00, 0x00) AM_READ(io_read_missing_dips)
9797   AM_RANGE(0x01, 0x01) AM_READ_PORT("DSW")
9898/*  AM_RANGE(0x02, 0x02) AM_READ(io_read_missing_dips) */
99/*  AM_RANGE(0x02, 0x02) AM_WRITE(NO IDEA) */
99100   AM_RANGE(0x10, 0x10) AM_READ_PORT("IN0")
100101   AM_RANGE(0x11, 0x11) AM_READ_PORT("IN1")
101   AM_RANGE(0x20, 0x20) AM_READ(TMS9928A_vram_r)
102   AM_RANGE(0x21, 0x21) AM_READ(TMS9928A_register_r)
103ADDRESS_MAP_END
104
105static ADDRESS_MAP_START( kingpin_writeport, ADDRESS_SPACE_IO, 8 )
106   ADDRESS_MAP_GLOBAL_MASK(0xff)
107/*  AM_RANGE(0x02, 0x02) AM_WRITE(NO IDEA) */
108102/*  AM_RANGE(0x12, 0x12) AM_WRITE(NO IDEA) */
109103/*  AM_RANGE(0x13, 0x13) AM_WRITE(NO IDEA) */
110   AM_RANGE(0x20, 0x20) AM_WRITE(TMS9928A_vram_w)
111   AM_RANGE(0x21, 0x21) AM_WRITE(TMS9928A_register_w)
104   AM_RANGE(0x20, 0x20) AM_READWRITE(TMS9928A_vram_r, TMS9928A_vram_w)
105   AM_RANGE(0x21, 0x21) AM_READWRITE(TMS9928A_register_r, TMS9928A_register_w)
112106/*  AM_RANGE(0x30, 0x30) AM_WRITE(LIKELY LIGHTS) */
113107/*  AM_RANGE(0x40, 0x40) AM_WRITE(LIKELY LIGHTS) */
114108/*  AM_RANGE(0x50, 0x50) AM_WRITE(LIKELY LIGHTS) */
r3232r3233
147141/*  MAIN CPU */
148142   MDRV_CPU_ADD("main", Z80, 3579545)
149143   MDRV_CPU_PROGRAM_MAP(kingpin_program_map,0)
150   MDRV_CPU_IO_MAP(kingpin_readport,kingpin_writeport)
144   MDRV_CPU_IO_MAP(kingpin_io_map,0)
151145   MDRV_CPU_VBLANK_INT("main", kingpin_video_interrupt)
152146
153147/*  SOUND CPU */
154148   MDRV_CPU_ADD("audio", Z80, 3579545)
155149   MDRV_CPU_PROGRAM_MAP(kingpin_sound_map,0)
156   /*MDRV_CPU_IO_MAP(readport2,writeport2)*/
150   /*MDRV_CPU_IO_MAP(sound_io_map,0)*/
157151
158152/*  VIDEO */
159153   MDRV_IMPORT_FROM(tms9928a)
src/mame/drivers/suna16.c
r3232r3233
385385   dac_data_w( 2 + (offset & 1), (data & 0xf) * 0x11 );
386386}
387387
388
389
390static ADDRESS_MAP_START( bssoccer_pcm_1_readport, ADDRESS_SPACE_IO, 8 )
388static ADDRESS_MAP_START( bssoccer_pcm_1_io_map, ADDRESS_SPACE_IO, 8 )
391389   ADDRESS_MAP_GLOBAL_MASK(0xff)
392   AM_RANGE(0x00, 0x00) AM_READ(soundlatch2_r             )   // From The Sound Z80
393ADDRESS_MAP_END
394static ADDRESS_MAP_START( bssoccer_pcm_1_writeport, ADDRESS_SPACE_IO, 8 )
395   ADDRESS_MAP_GLOBAL_MASK(0xff)
390   AM_RANGE(0x00, 0x00) AM_READ(soundlatch2_r                )   // From The Sound Z80
396391   AM_RANGE(0x00, 0x01) AM_WRITE(bssoccer_DAC_1_w            )   // 2 x DAC
397392   AM_RANGE(0x03, 0x03) AM_WRITE(bssoccer_pcm_1_bankswitch_w   )   // Rom Bank
398393ADDRESS_MAP_END
399394
400static ADDRESS_MAP_START( bssoccer_pcm_2_readport, ADDRESS_SPACE_IO, 8 )
395static ADDRESS_MAP_START( bssoccer_pcm_2_io_map, ADDRESS_SPACE_IO, 8 )
401396   ADDRESS_MAP_GLOBAL_MASK(0xff)
402   AM_RANGE(0x00, 0x00) AM_READ(soundlatch3_r             )   // From The Sound Z80
403ADDRESS_MAP_END
404static ADDRESS_MAP_START( bssoccer_pcm_2_writeport, ADDRESS_SPACE_IO, 8 )
405   ADDRESS_MAP_GLOBAL_MASK(0xff)
397   AM_RANGE(0x00, 0x00) AM_READ(soundlatch3_r                )   // From The Sound Z80
406398   AM_RANGE(0x00, 0x01) AM_WRITE(bssoccer_DAC_2_w            )   // 2 x DAC
407399   AM_RANGE(0x03, 0x03) AM_WRITE(bssoccer_pcm_2_bankswitch_w   )   // Rom Bank
408400ADDRESS_MAP_END
409401
410402
411
412403/***************************************************************************
413404                                Ultra Balloon
414405***************************************************************************/
r3232r3233
426417/* Memory maps: Yes, *no* RAM */
427418
428419static ADDRESS_MAP_START( uballoon_pcm_1_readmem, ADDRESS_SPACE_PROGRAM, 8 )
429   AM_RANGE(0x0000, 0x03ff) AM_READ(SMH_ROM         )   // ROM
420   AM_RANGE(0x0000, 0x03ff) AM_READ(SMH_ROM      )   // ROM
430421   AM_RANGE(0x0400, 0xffff) AM_READ(SMH_BANK1       )   // Banked ROM
431422ADDRESS_MAP_END
423
432424static ADDRESS_MAP_START( uballoon_pcm_1_writemem, ADDRESS_SPACE_PROGRAM, 8 )
433   AM_RANGE(0x0000, 0xffff) AM_WRITE(SMH_ROM         )   // ROM
425   AM_RANGE(0x0000, 0xffff) AM_WRITE(SMH_ROM      )   // ROM
434426ADDRESS_MAP_END
435427
436
437static ADDRESS_MAP_START( uballoon_pcm_1_readport, ADDRESS_SPACE_IO, 8 )
428static ADDRESS_MAP_START( uballoon_pcm_1_io_map, ADDRESS_SPACE_IO, 8 )
438429   ADDRESS_MAP_GLOBAL_MASK(0xff)
439   AM_RANGE(0x00, 0x00) AM_READ(soundlatch2_r             )   // From The Sound Z80
440ADDRESS_MAP_END
441static ADDRESS_MAP_START( uballoon_pcm_1_writeport, ADDRESS_SPACE_IO, 8 )
442   ADDRESS_MAP_GLOBAL_MASK(0xff)
430   AM_RANGE(0x00, 0x00) AM_READ(soundlatch2_r                )   // From The Sound Z80
443431   AM_RANGE(0x00, 0x01) AM_WRITE(bssoccer_DAC_1_w            )   // 2 x DAC
444432   AM_RANGE(0x03, 0x03) AM_WRITE(uballoon_pcm_1_bankswitch_w   )   // Rom Bank
445433ADDRESS_MAP_END
446434
447
448435static MACHINE_RESET(uballoon)
449436{
450437   uballoon_pcm_1_bankswitch_w(machine, 0, 0);
r3232r3233
859846
860847   MDRV_CPU_ADD("pcm1", Z80, 5000000)      /* Z80B */
861848   MDRV_CPU_PROGRAM_MAP(bssoccer_pcm_1_readmem,bssoccer_pcm_1_writemem)
862   MDRV_CPU_IO_MAP(bssoccer_pcm_1_readport,bssoccer_pcm_1_writeport)
849   MDRV_CPU_IO_MAP(bssoccer_pcm_1_io_map,0)
863850
864851   MDRV_CPU_ADD("pcm2", Z80, 5000000)      /* Z80B */
865852   MDRV_CPU_PROGRAM_MAP(bssoccer_pcm_2_readmem,bssoccer_pcm_2_writemem)
866   MDRV_CPU_IO_MAP(bssoccer_pcm_2_readport,bssoccer_pcm_2_writeport)
853   MDRV_CPU_IO_MAP(bssoccer_pcm_2_io_map,0)
867854
868855   MDRV_INTERLEAVE(100)
869856
r3232r3233
919906
920907   MDRV_CPU_ADD("pcm", Z80, 5000000)   /* ? */
921908   MDRV_CPU_PROGRAM_MAP(uballoon_pcm_1_readmem,uballoon_pcm_1_writemem)
922   MDRV_CPU_IO_MAP(uballoon_pcm_1_readport,uballoon_pcm_1_writeport)
909   MDRV_CPU_IO_MAP(uballoon_pcm_1_io_map,0)
923910
924911   /* 2nd PCM Z80 missing */
925912
r3232r3233
970957
971958   MDRV_CPU_ADD("pcm", Z80, 24000000/4)      /* Z80B */
972959   MDRV_CPU_PROGRAM_MAP(bssoccer_pcm_1_readmem,bssoccer_pcm_1_writemem)
973   MDRV_CPU_IO_MAP(bssoccer_pcm_1_readport,bssoccer_pcm_1_writeport)
960   MDRV_CPU_IO_MAP(bssoccer_pcm_1_io_map,0)
974961
975962   /* 2nd PCM Z80 missing */
976963
r3232r3233
13451332GAME( 1994, sunaq,    0, sunaq,    sunaq,    0,        ROT0, "SunA", "SunA Quiz 6000 Academy (940620-6)", 0 )   // Date/Version on-screen is 940620-6, but in the program rom it's 1994,6,30  K.H.T  V6.00
13461333GAME( 1996, bssoccer, 0, bssoccer, bssoccer, 0,        ROT0, "SunA", "Back Street Soccer", 0 )
13471334GAME( 1996, uballoon, 0, uballoon, uballoon, uballoon, ROT0, "SunA", "Ultra Balloon", 0 )
1335
src/mame/drivers/zaccaria.c
r3232r3233
7878
7979static READ8_HANDLER( zaccaria_dsw_r )
8080{
81   static const char *dswnames[] = { "IN0", "DSW0", "DSW1" };
81   static const char *const dswnames[] = { "IN0", "DSW0", "DSW1" };
8282
8383   return input_port_read(machine, dswnames[dsw]);
8484}
src/mame/drivers/shadfrce.c
r3232r3233
99  - As for some other M68000 Technos games (or games running on similar hardware
1010    such as 'mugsmash'), the Inputs and the Dip Switches are mangled, so you need
1111    a specific read handler so end-uers can see them in a "standard" order.
12    IMO you should set the USE_SHADFRCE_FAKE_INPUT_PORTS macro to 1.
1312
1413 01-Sept-2008 - Pierpaolo Prazzoli
1514 - Added irqs ack
r3232r3233
188187
189188*/
190189
191#define USE_SHADFRCE_FAKE_INPUT_PORTS   1
192190
193#if USE_SHADFRCE_FAKE_INPUT_PORTS
194
195191static READ16_HANDLER( shadfrce_input_ports_r )
196192{
197193   UINT16 data = 0xffff;
r3232r3233
215211   return (data);
216212}
217213
218#else
219214
220static READ16_HANDLER( shadfrce_input_ports_3_r )
221{
222   return (input_port_read(machine, "IN3") & ~0x0400) | (vblank << 8);
223}
224
225#endif
226
227215static WRITE16_HANDLER ( shadfrce_sound_brt_w )
228216{
229217   if (ACCESSING_BITS_8_15)
r3232r3233
321309   AM_RANGE(0x1d0012, 0x1d0013) AM_WRITENOP /* ?? */
322310   AM_RANGE(0x1d0014, 0x1d0015) AM_WRITENOP /* ?? */
323311   AM_RANGE(0x1d0016, 0x1d0017) AM_WRITE(watchdog_reset16_w)
324#if USE_SHADFRCE_FAKE_INPUT_PORTS
325312   AM_RANGE(0x1d0020, 0x1d0027) AM_READ(shadfrce_input_ports_r)
326#else
327   AM_RANGE(0x1d0020, 0x1d0021) AM_READ_PORT("IN0")
328   AM_RANGE(0x1d0022, 0x1d0023) AM_READ_PORT("IN1")
329   AM_RANGE(0x1d0024, 0x1d0025) AM_READ_PORT("IN2")
330   AM_RANGE(0x1d0026, 0x1d0027) AM_READ(shadfrce_input_ports_3_r)
331#endif
332313   AM_RANGE(0x1f0000, 0x1fffff) AM_RAM
333314ADDRESS_MAP_END
334315
r3232r3233
365346   PORT_BIT( 0x0080, IP_ACTIVE_LOW, start )
366347
367348
368#if USE_SHADFRCE_FAKE_INPUT_PORTS
369349static INPUT_PORTS_START( shadfrce )
370350   PORT_START("P1")   /* Fake IN0 (player 1 inputs) */
371351   SHADFRCE_PLAYER_INPUT( 1, IPT_START1 )
r3232r3233
444424   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
445425   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
446426INPUT_PORTS_END
447#else
448static INPUT_PORTS_START( shadfrce )
449   PORT_START("IN0")   /* IN0 - $1d0020.w */
450   SHADFRCE_PLAYER_INPUT( 1, IPT_START1 )
451   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 )
452   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 )                 /* only in "test mode" ? */
453   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_SERVICE1 )              /* only in "test mode" ? */
454   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED )
455   PORT_DIPNAME( 0x1000, 0x1000, "Unused DIP 2-7" )
456   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
457   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
458   PORT_DIPNAME( 0x2000, 0x2000, "Unused DIP 2-8" )
459   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
460   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
461   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )
462   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
463427
464   PORT_START("IN1")   /* IN1 - $1d0022.w */
465   SHADFRCE_PLAYER_INPUT( 2, IPT_START2 )
466   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Difficulty ) )
467   PORT_DIPSETTING(      0x0100, DEF_STR( Easy ) )
468   PORT_DIPSETTING(      0x0300, DEF_STR( Normal ) )
469   PORT_DIPSETTING(      0x0200, DEF_STR( Hard ) )              /* "Advanced" */
470   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )           /* "Expert" */
471   PORT_DIPNAME( 0x0c00, 0x0c00, "Stage Clear Energy Regain" )
472   PORT_DIPSETTING(      0x0400, "50%" )
473   PORT_DIPSETTING(      0x0c00, "25%" )
474   PORT_DIPSETTING(      0x0800, "10%" )
475   PORT_DIPSETTING(      0x0000, "0%" )
476   PORT_DIPNAME( 0x1000, 0x1000, "Unused DIP 2-5" )
477   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
478   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
479   PORT_DIPNAME( 0x2000, 0x2000, "Unused DIP 2-6" )
480   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
481   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
482   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )
483   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
484
485   PORT_START("IN2")   /* IN2 - $1d0024.w */
486   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
487   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
488   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1)
489   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
490   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
491   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
492   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
493   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
494   PORT_DIPNAME( 0x0100, 0x0100, "Unused DIP 1-1" )
495   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
496   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
497   PORT_DIPNAME( 0x0600, 0x0600, DEF_STR( Coinage ) )
498   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) )
499   PORT_DIPSETTING(      0x0200, DEF_STR( 2C_1C ) )
500   PORT_DIPSETTING(      0x0600, DEF_STR( 1C_1C ) )
501   PORT_DIPSETTING(      0x0400, DEF_STR( 1C_2C ) )
502   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Continue_Price ) )
503   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
504   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
505   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Free_Play ) )
506   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
507   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
508   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Flip_Screen ) )
509   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
510   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
511   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )
512   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
513
514   PORT_START("IN3")   /* IN3 - $1d0026.w */
515   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNUSED )
516   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNUSED )
517   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )
518   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
519   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED )
520   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
521   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
522   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
523   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Demo_Sounds ) )
524   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
525   PORT_DIPSETTING(      0x0100, DEF_STR( On ) )
526   PORT_SERVICE( 0x0200, IP_ACTIVE_LOW )
527   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_SPECIAL )             /* guess */
528   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_VBLANK )                /* guess */
529   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED )
530   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )               /* must be ACTIVE_LOW or 'shadfrcj' jumps to the end (code at 0x04902e) */
531   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNUSED )
532   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )
533   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
534INPUT_PORTS_END
535#endif
536
537428/* Graphic Decoding */
538429
539430static const gfx_layout fg8x8x4_layout =
src/mame/drivers/yumefuda.c
r3232r3233
5757#include "sound/ay8910.h"
5858
5959static tilemap *bg_tilemap;
60static UINT8 mux_data;
61static int bank;
62static UINT8 *cus_ram;
63static UINT8 prot_lock;
6064
65
66
6167static TILE_GET_INFO( y_get_bg_tile_info )
6268{
6369   int code = videoram[tile_index];
r3232r3233
114120   tilemap_mark_tile_dirty(bg_tilemap,offset);
115121}
116122
117static UINT8 *cus_ram;
118static UINT8 prot_lock;
119
120123/*Custom RAM (Protection)*/
121124static READ8_HANDLER( custom_ram_r )
122125{
r3232r3233
155158   return ((~eeprom_read_bit() & 0x01)<<6) | (0xff & ~0x40);
156159}
157160
158static UINT8 mux_data;
159
160161static READ8_HANDLER( mux_r )
161162{
162163   switch(mux_data)
r3232r3233
175176
176177static WRITE8_HANDLER( mux_w )
177178{
178   static int bank=-1;
179
180179   int new_bank = (data&0xc0)>>6;
181180
182181   //0x10000 service mode
r3232r3233
220219   AM_RANGE(0xc0, 0xc0) AM_WRITE(port_c0_w) /*watchdog write?*/
221220ADDRESS_MAP_END
222221
222static MACHINE_RESET( yumefuda )
223{
224   mux_data = 0;
225   bank = -1;
226   prot_lock = 0;
227}
228
223229static MACHINE_DRIVER_START( yumefuda )
224230
225231   /* basic machine hardware */
r3232r3233
228234   MDRV_CPU_IO_MAP(port_map,0)
229235   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
230236
237   MDRV_MACHINE_RESET(yumefuda)
231238   MDRV_NVRAM_HANDLER(93C46)
232239
233240   /* video hardware */
src/mame/drivers/firebeat.c
r3232r3233
14811481static TIMER_CALLBACK( keyboard_timer_callback )
14821482{
14831483   static const int kb_uart_channel[2] = { 1, 0 };
1484   static const char *keynames[] = { "KEYBOARD_P1", "KEYBOARD_P2" };
1484   static const char *const keynames[] = { "KEYBOARD_P1", "KEYBOARD_P2" };
14851485   int keyboard;
14861486   int i;
14871487
src/mame/drivers/atarisy2.c
r3232r3233
423423
424424static READ16_HANDLER( adc_r )
425425{
426   static const char *adcnames[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
426   static const char *const adcnames[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
427427
428428   if (which_adc < pedal_count)
429429      return ~input_port_read(machine, adcnames[which_adc]);
r3232r3233
434434
435435static READ8_HANDLER( leta_r )
436436{
437   static const char *letanames[] = { "LETA0", "LETA1", "LETA2", "LETA3" };
437   static const char *const letanames[] = { "LETA0", "LETA1", "LETA2", "LETA3" };
438438
439439    if (pedal_count == -1)   /* 720 */
440440   {
src/mame/drivers/mjsister.c
r3232r3233
134134static READ8_HANDLER( mjsister_keys_r )
135135{
136136   int p,i,ret = 0;
137   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5" };
137   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5" };
138138
139139   p = mjsister_input_sel1 & 0x3f;
140140//  p |= ((mjsister_input_sel2 & 8) << 4) | ((mjsister_input_sel2 & 0x20) << 1);
src/mame/drivers/ninjakd2.c
r3232r3233
971971   MDRV_SOUND_ROUTE(2, "mono", 0.10)
972972   MDRV_SOUND_ROUTE(3, "mono", 0.50)
973973
974   MDRV_SOUND_ADD("PCM", SAMPLES, 0)
974   MDRV_SOUND_ADD("pcm", SAMPLES, 0)
975975   MDRV_SOUND_CONFIG(ninjakd2_samples_interface)
976976   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
977977MACHINE_DRIVER_END
r3232r3233
988988   MDRV_VIDEO_START(mnight)
989989
990990   /* sound hardware */
991   MDRV_SOUND_REMOVE("PCM")
991   MDRV_SOUND_REMOVE("pcm")
992992MACHINE_DRIVER_END
993993
994994static MACHINE_DRIVER_START( robokid )
src/mame/drivers/warpwarp.c
r3232r3233
144144static READ8_HANDLER( geebee_in_r )
145145{
146146   int res;
147   static const char *portnames[] = { "SW0", "SW1", "DSW2", "PLACEHOLDER" };   // "IN1" & "IN2" are read separately when offset==3
147   static const char *const portnames[] = { "SW0", "SW1", "DSW2", "PLACEHOLDER" };   // "IN1" & "IN2" are read separately when offset==3
148148
149149   offset &= 3;
150150   res = input_port_read_safe(machine, portnames[offset], 0);
src/mame/drivers/ojankohs.c
r3232r3233
280280ADDRESS_MAP_END
281281
282282
283static ADDRESS_MAP_START( readport_ojankohs, ADDRESS_SPACE_IO, 8 )
283static ADDRESS_MAP_START( ojankohs_io_map, ADDRESS_SPACE_IO, 8 )
284284   ADDRESS_MAP_GLOBAL_MASK(0xff)
285   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
286   AM_RANGE(0x01, 0x01) AM_READ(ojankohs_keymatrix_r)
287   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN1")
288   AM_RANGE(0x06, 0x06) AM_READ(ay8910_read_port_0_r)
289ADDRESS_MAP_END
290
291static ADDRESS_MAP_START( writeport_ojankohs, ADDRESS_SPACE_IO, 8 )
292   ADDRESS_MAP_GLOBAL_MASK(0xff)
293   AM_RANGE(0x00, 0x00) AM_WRITE(ojankohs_portselect_w)
294   AM_RANGE(0x01, 0x01) AM_WRITE(ojankohs_rombank_w)
295   AM_RANGE(0x02, 0x02) AM_WRITE(ojankohs_gfxreg_w)
285   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_WRITE(ojankohs_portselect_w)
286   AM_RANGE(0x01, 0x01) AM_READWRITE(ojankohs_keymatrix_r, ojankohs_rombank_w)
287   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN1") AM_WRITE(ojankohs_gfxreg_w)
296288   AM_RANGE(0x03, 0x03) AM_WRITE(ojankohs_adpcm_reset_w)
297289   AM_RANGE(0x04, 0x04) AM_WRITE(ojankohs_flipscreen_w)
298290   AM_RANGE(0x05, 0x05) AM_WRITE(ojankohs_msm5205_w)
299   AM_RANGE(0x06, 0x06) AM_WRITE(ay8910_write_port_0_w)
291   AM_RANGE(0x06, 0x06) AM_READWRITE(ay8910_read_port_0_r, ay8910_write_port_0_w)
300292   AM_RANGE(0x07, 0x07) AM_WRITE(ay8910_control_port_0_w)
301293   AM_RANGE(0x10, 0x10) AM_WRITE(SMH_NOP)            // unknown
302294   AM_RANGE(0x11, 0x11) AM_WRITE(SMH_NOP)            // unknown
303295ADDRESS_MAP_END
304296
305static ADDRESS_MAP_START( writeport_ojankoy, ADDRESS_SPACE_IO, 8 )
297static ADDRESS_MAP_START( ojankoy_io_map, ADDRESS_SPACE_IO, 8 )
306298   ADDRESS_MAP_GLOBAL_MASK(0xff)
307   AM_RANGE(0x00, 0x00) AM_WRITE(ojankohs_portselect_w)
308   AM_RANGE(0x01, 0x01) AM_WRITE(ojankoy_rombank_w)
309   AM_RANGE(0x02, 0x02) AM_WRITE(ojankoy_coinctr_w)
299   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_WRITE(ojankohs_portselect_w)
300   AM_RANGE(0x01, 0x01) AM_READWRITE(ojankohs_keymatrix_r, ojankoy_rombank_w)
301   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN1") AM_WRITE(ojankoy_coinctr_w)
310302   AM_RANGE(0x04, 0x04) AM_WRITE(ojankohs_flipscreen_w)
311303   AM_RANGE(0x05, 0x05) AM_WRITE(ojankohs_msm5205_w)
312   AM_RANGE(0x06, 0x06) AM_WRITE(ay8910_write_port_0_w)
304   AM_RANGE(0x06, 0x06) AM_READWRITE(ay8910_read_port_0_r, ay8910_write_port_0_w)
313305   AM_RANGE(0x07, 0x07) AM_WRITE(ay8910_control_port_0_w)
314306ADDRESS_MAP_END
315307
316static ADDRESS_MAP_START( readport_ccasino, ADDRESS_SPACE_IO, 8 )
308static ADDRESS_MAP_START( ccasino_io_map, ADDRESS_SPACE_IO, 8 )
317309   ADDRESS_MAP_GLOBAL_MASK(0xff)
318   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0")
319   AM_RANGE(0x01, 0x01) AM_READ(ojankohs_keymatrix_r)
320   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN1")
321   AM_RANGE(0x03, 0x03) AM_READ(ccasino_dipsw3_r)
322   AM_RANGE(0x04, 0x04) AM_READ(ccasino_dipsw4_r)
323   AM_RANGE(0x06, 0x06) AM_READ(ay8910_read_port_0_r)
324ADDRESS_MAP_END
325
326static ADDRESS_MAP_START( writeport_ccasino, ADDRESS_SPACE_IO, 8 )
327   ADDRESS_MAP_GLOBAL_MASK(0xff)
328   AM_RANGE(0x00, 0x00) AM_WRITE(ojankohs_portselect_w)
329   AM_RANGE(0x01, 0x01) AM_WRITE(ojankohs_rombank_w)
330   AM_RANGE(0x02, 0x02) AM_WRITE(ccasino_coinctr_w)
331   AM_RANGE(0x03, 0x03) AM_WRITE(ojankohs_adpcm_reset_w)
332   AM_RANGE(0x04, 0x04) AM_WRITE(ojankohs_flipscreen_w)
310   AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_WRITE(ojankohs_portselect_w)
311   AM_RANGE(0x01, 0x01) AM_READWRITE(ojankohs_keymatrix_r, ojankohs_rombank_w)
312   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN1") AM_WRITE(ccasino_coinctr_w)
313   AM_RANGE(0x03, 0x03) AM_READWRITE(ccasino_dipsw3_r, ojankohs_adpcm_reset_w)
314   AM_RANGE(0x04, 0x04) AM_READWRITE(ccasino_dipsw4_r, ojankohs_flipscreen_w)
333315   AM_RANGE(0x05, 0x05) AM_WRITE(ojankohs_msm5205_w)
334   AM_RANGE(0x06, 0x06) AM_WRITE(ay8910_write_port_0_w)
316   AM_RANGE(0x06, 0x06) AM_READWRITE(ay8910_read_port_0_r, ay8910_write_port_0_w)
335317   AM_RANGE(0x07, 0x07) AM_WRITE(ay8910_control_port_0_w)
336318   AM_RANGE(0x08, 0x0f) AM_WRITE(ccasino_palette_w)      // 16bit address access
337319   AM_RANGE(0x10, 0x10) AM_WRITE(SMH_NOP)
338320   AM_RANGE(0x11, 0x11) AM_WRITE(SMH_NOP)
339321ADDRESS_MAP_END
340322
341static ADDRESS_MAP_START( readport_ojankoc, ADDRESS_SPACE_IO, 8 )
323static ADDRESS_MAP_START( ojankoc_io_map, ADDRESS_SPACE_IO, 8 )
342324   ADDRESS_MAP_GLOBAL_MASK(0xff)
343   AM_RANGE(0xfc, 0xfd) AM_READ(ojankoc_keymatrix_r)
344   AM_RANGE(0xff, 0xff) AM_READ(ay8910_read_port_0_r)
345ADDRESS_MAP_END
346
347static ADDRESS_MAP_START( writeport_ojankoc, ADDRESS_SPACE_IO, 8 )
348   ADDRESS_MAP_GLOBAL_MASK(0xff)
349325   AM_RANGE(0x00, 0x1f) AM_WRITE(ojankoc_palette_w)
350326   AM_RANGE(0xf9, 0xf9) AM_WRITE(ojankohs_msm5205_w)
351327   AM_RANGE(0xfb, 0xfb) AM_WRITE(ojankoc_ctrl_w)
328   AM_RANGE(0xfc, 0xfd) AM_READ(ojankoc_keymatrix_r)
352329   AM_RANGE(0xfd, 0xfd) AM_WRITE(ojankohs_portselect_w)
353330   AM_RANGE(0xfe, 0xfe) AM_WRITE(ay8910_write_port_0_w)
354   AM_RANGE(0xff, 0xff) AM_WRITE(ay8910_control_port_0_w)
331   AM_RANGE(0xff, 0xff) AM_READWRITE(ay8910_read_port_0_r, ay8910_control_port_0_w)
355332ADDRESS_MAP_END
356333
334
357335static INPUT_PORTS_START( mahjong_p1 )
358336   PORT_START("KEY0")   /* PORT 1-0 */
359337   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A )
r3232r3233
876854   /* basic machine hardware */
877855   MDRV_CPU_ADD("main", Z80,12000000/2)      /* 6.00 MHz ? */
878856   MDRV_CPU_PROGRAM_MAP(readmem_ojankohs,writemem_ojankohs)
879   MDRV_CPU_IO_MAP(readport_ojankohs,writeport_ojankohs)
857   MDRV_CPU_IO_MAP(ojankohs_io_map,0)
880858   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
881859
882860   MDRV_MACHINE_RESET(ojankohs)
r3232r3233
913891   /* basic machine hardware */
914892   MDRV_CPU_ADD("main", Z80,12000000/2)      /* 6.00 MHz ? */
915893   MDRV_CPU_PROGRAM_MAP(readmem_ojankoy,writemem_ojankoy)
916   MDRV_CPU_IO_MAP(readport_ojankohs,writeport_ojankoy)
894   MDRV_CPU_IO_MAP(ojankoy_io_map,0)
917895   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
918896
919897   MDRV_MACHINE_RESET(ojankohs)
r3232r3233
951929   /* basic machine hardware */
952930   MDRV_CPU_ADD("main", Z80,12000000/2)      /* 6.00 MHz ? */
953931   MDRV_CPU_PROGRAM_MAP(readmem_ojankoy,writemem_ojankoy)
954   MDRV_CPU_IO_MAP(readport_ccasino,writeport_ccasino)
932   MDRV_CPU_IO_MAP(ccasino_io_map,0)
955933   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
956934
957935   MDRV_MACHINE_RESET(ojankohs)
r3232r3233
988966   /* basic machine hardware */
989967   MDRV_CPU_ADD("main", Z80,8000000/2)         /* 4.00 MHz */
990968   MDRV_CPU_PROGRAM_MAP(readmem_ojankoc,writemem_ojankoc)
991   MDRV_CPU_IO_MAP(readport_ojankoc,writeport_ojankoc)
969   MDRV_CPU_IO_MAP(ojankoc_io_map,0)
992970   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
993971
994972   MDRV_MACHINE_RESET(ojankohs)
src/mame/drivers/seta.c
r3232r3233
19661966
19671967static READ16_HANDLER( zombraid_gun_r ) // Serial interface
19681968{
1969   static const char *portnames[] = { "GUNX1", "GUNY1", "GUNX2", "GUNY2" };
1969   static const char *const portnames[] = { "GUNX1", "GUNY1", "GUNX2", "GUNY2" };
19701970
19711971   int data = input_port_read(machine, portnames[gun_input_src]);   // Input Ports 5-8
19721972   return (data >> gun_input_bit) & 1;
r3232r3233
26042604{
26052605   int row_select = kiwame_nvram_r( machine,0x10a/2,0x00ff ) & 0x1f;
26062606   int i;
2607   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
2607   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
26082608
26092609   for(i = 0; i < 5; i++)
26102610      if (row_select & (1<<i))   break;
src/mame/drivers/laserbat.c
r3232r3233
8989
9090static READ8_HANDLER( laserbat_input_r )
9191{
92   static const char *portnames[] = { "IN0", "IN1", "IN2", "IN3" };
92   static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" };
9393
9494   return input_port_read(machine, portnames[laserbat_input_mux]);
9595}
src/mame/drivers/tnzs.c
r3232r3233
511511   AM_RANGE(0xe000, 0xffff) AM_RAM
512512ADDRESS_MAP_END
513513
514static ADDRESS_MAP_START( tnzsb_readport, ADDRESS_SPACE_IO, 8 )
514static ADDRESS_MAP_START( tnzsb_io_map, ADDRESS_SPACE_IO, 8 )
515515   ADDRESS_MAP_GLOBAL_MASK(0xff)
516   AM_RANGE(0x00, 0x00) AM_READ(ym2203_status_port_0_r)
516   AM_RANGE(0x00, 0x00) AM_READWRITE(ym2203_status_port_0_r, ym2203_control_port_0_w)
517   AM_RANGE(0x01, 0x01) AM_WRITE(ym2203_write_port_0_w)
517518   AM_RANGE(0x02, 0x02) AM_READ(soundlatch_r)
518519ADDRESS_MAP_END
519520
520static ADDRESS_MAP_START( tnzsb_writeport, ADDRESS_SPACE_IO, 8 )
521   ADDRESS_MAP_GLOBAL_MASK(0xff)
522   AM_RANGE(0x00, 0x00) AM_WRITE(ym2203_control_port_0_w)
523   AM_RANGE(0x01, 0x01) AM_WRITE(ym2203_write_port_0_w)
524ADDRESS_MAP_END
525521
526
527522static ADDRESS_MAP_START( i8742_readmem, ADDRESS_SPACE_PROGRAM, 8 )
528523   AM_RANGE(0x0000, 0x07ff) AM_READ(SMH_ROM)
529524   AM_RANGE(0x0800, 0x08ff) AM_RAM            /* Internal i8742 RAM */
r3232r3233
534529   AM_RANGE(0x0800, 0x08ff) AM_WRITE(SMH_RAM)   /* Internal i8742 RAM */
535530ADDRESS_MAP_END
536531
537static ADDRESS_MAP_START( i8742_readport, ADDRESS_SPACE_IO, 8 )
532static ADDRESS_MAP_START( i8742_io_map, ADDRESS_SPACE_IO, 8 )
533   AM_RANGE(0x02, 0x02) AM_WRITE(tnzs_port2_w)
538534   AM_RANGE(I8X41_p1, I8X41_p1) AM_READ(tnzs_port1_r)
539535   AM_RANGE(I8X41_p2, I8X41_p2) AM_READ(tnzs_port2_r)
540536   AM_RANGE(I8X41_t0, I8X41_t0) AM_READ_PORT("COIN1")
541537   AM_RANGE(I8X41_t1, I8X41_t1) AM_READ_PORT("COIN2")
542538ADDRESS_MAP_END
543539
544static ADDRESS_MAP_START( i8742_writeport, ADDRESS_SPACE_IO, 8 )
545   AM_RANGE(0x02, 0x02) AM_WRITE(tnzs_port2_w)
546ADDRESS_MAP_END
547540
548
549541static WRITE8_HANDLER( jpopnics_palette_w )
550542{
551543   int r,g,b;
r3232r3233
14711463
14721464   MDRV_CPU_ADD("mcu", I8X41,12000000/2)   /* 400KHz ??? - Main board Crystal is 12MHz */
14731465   MDRV_CPU_PROGRAM_MAP(i8742_readmem,i8742_writemem)
1474   MDRV_CPU_IO_MAP(i8742_readport,i8742_writeport)
1466   MDRV_CPU_IO_MAP(i8742_io_map,0)
14751467   MDRV_CPU_CONFIG( i8042_config )
14761468
14771469   MDRV_INTERLEAVE(100)
r3232r3233
15971589
15981590   MDRV_CPU_ADD("audio", Z80, XTAL_12MHz/2) /* verified on pcb */
15991591   MDRV_CPU_PROGRAM_MAP(tnzsb_cpu2_map,0)
1600   MDRV_CPU_IO_MAP(tnzsb_readport,tnzsb_writeport)
1592   MDRV_CPU_IO_MAP(tnzsb_io_map,0)
16011593
16021594   MDRV_INTERLEAVE(100)
16031595
r3232r3233
22152207      All ROMs are 27010 (DIP32)
22162208*/
22172209
2210/* tnzs - new style PCB sets */
2211
22182212ROM_START( tnzs )
22192213   ROM_REGION( 0x30000, "main", 0 )   /* 64k + bankswitch areas for the first CPU */
22202214   ROM_LOAD( "b53-24.1",   0x00000, 0x08000, CRC(d66824c6) SHA1(fd381ac0dc52ce670c3fde320ea60a209e288a52) )
r3232r3233
22272221   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for the third CPU */
22282222   ROM_LOAD( "b53-26.34",  0x00000, 0x10000, CRC(cfd5649c) SHA1(4f6afccd535d39b41661dc3ccd17af125bfac015) )
22292223
2230   ROM_REGION( 0x100000, "gfx1", ROMREGION_DISPOSE )
2231   ROM_LOAD( "b53-08.8",   0x00000, 0x20000, CRC(c3519c2a) SHA1(30fe7946fbc95ab6b3ccb6944fb24bf47bf3d743) )   // b53-16
2232   ROM_LOAD( "b53-07.7",   0x20000, 0x20000, CRC(2bf199e8) SHA1(4ed73e4f00ae2f5f4028a0ea5ae3cd238863a370) )   // b53-17
2233   ROM_LOAD( "b53-06.6",   0x40000, 0x20000, CRC(92f35ed9) SHA1(5fdd8d6ddbb7be9887af3c8dea9ad3b58c4e86f9) )   // b53-18
2234   ROM_LOAD( "b53-05.5",   0x60000, 0x20000, CRC(edbb9581) SHA1(539396a01ca0b69455f000d446759b232530b542) )   // b53-19
2235   ROM_LOAD( "b53-04.4",   0x80000, 0x20000, CRC(59d2aef6) SHA1(b657b7603c3eb5f169000d38497ebb93f26f7832) )   // b53-22
2236   ROM_LOAD( "b53-03.3",   0xa0000, 0x20000, CRC(74acfb9b) SHA1(90b544ed7ede7565660bdd13c94c15c54423cda9) )   // b53-23
2237   ROM_LOAD( "b53-02.2",   0xc0000, 0x20000, CRC(095d0dc0) SHA1(ced2937d0594fa00ae344a4e3a3cba23772dc160) )   // b53-20
2238   ROM_LOAD( "b53-01.1",   0xe0000, 0x20000, CRC(9800c54d) SHA1(761647177d621ac2cdd8b009876eed35809f3c92) )   // b53-21
2224   ROM_REGION( 0x100000, "gfx1", ROMREGION_DISPOSE ) /* the newer PCBs have updated GFX rom labels, content is the same */
2225   ROM_LOAD( "b53-16.8",   0x00000, 0x20000, CRC(c3519c2a) SHA1(30fe7946fbc95ab6b3ccb6944fb24bf47bf3d743) )
2226   ROM_LOAD( "b53-17.7",   0x20000, 0x20000, CRC(2bf199e8) SHA1(4ed73e4f00ae2f5f4028a0ea5ae3cd238863a370) )
2227   ROM_LOAD( "b53-18.6",   0x40000, 0x20000, CRC(92f35ed9) SHA1(5fdd8d6ddbb7be9887af3c8dea9ad3b58c4e86f9) )
2228   ROM_LOAD( "b53-19.5",   0x60000, 0x20000, CRC(edbb9581) SHA1(539396a01ca0b69455f000d446759b232530b542) )
2229   ROM_LOAD( "b53-22.4",   0x80000, 0x20000, CRC(59d2aef6) SHA1(b657b7603c3eb5f169000d38497ebb93f26f7832) )
2230   ROM_LOAD( "b53-23.3",   0xa0000, 0x20000, CRC(74acfb9b) SHA1(90b544ed7ede7565660bdd13c94c15c54423cda9) )
2231   ROM_LOAD( "b53-20.2",   0xc0000, 0x20000, CRC(095d0dc0) SHA1(ced2937d0594fa00ae344a4e3a3cba23772dc160) )
2232   ROM_LOAD( "b53-21.1",   0xe0000, 0x20000, CRC(9800c54d) SHA1(761647177d621ac2cdd8b009876eed35809f3c92) )
22392233ROM_END
22402234
2235ROM_START( tnzsjn )
2236   ROM_REGION( 0x30000, "main", 0 )   /* 64k + bankswitch areas for the first CPU */
2237   ROM_LOAD( "b53-24.1",   0x00000, 0x08000, CRC(d66824c6) SHA1(fd381ac0dc52ce670c3fde320ea60a209e288a52) )
2238   ROM_CONTINUE(           0x18000, 0x18000 )      /* banked at 8000-bfff */
2239
2240   ROM_REGION( 0x18000, "sub", 0 )   /* 64k for the second CPU */
2241   ROM_LOAD( "b53-27.u3",   0x00000, 0x08000, CRC(b3415fc3) SHA1(a12b1788509e2ac2b05a083f432eecdce00769f6) )
2242   ROM_CONTINUE(           0x10000, 0x08000 )      /* banked at 8000-9fff */
2243
2244   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for the third CPU */
2245   ROM_LOAD( "b53-26.34",  0x00000, 0x10000, CRC(cfd5649c) SHA1(4f6afccd535d39b41661dc3ccd17af125bfac015) )
2246
2247   ROM_REGION( 0x100000, "gfx1", ROMREGION_DISPOSE ) /* the newer PCBs have updated GFX rom labels, content is the same */
2248   ROM_LOAD( "b53-16.8",   0x00000, 0x20000, CRC(c3519c2a) SHA1(30fe7946fbc95ab6b3ccb6944fb24bf47bf3d743) )
2249   ROM_LOAD( "b53-17.7",   0x20000, 0x20000, CRC(2bf199e8) SHA1(4ed73e4f00ae2f5f4028a0ea5ae3cd238863a370) )
2250   ROM_LOAD( "b53-18.6",   0x40000, 0x20000, CRC(92f35ed9) SHA1(5fdd8d6ddbb7be9887af3c8dea9ad3b58c4e86f9) )
2251   ROM_LOAD( "b53-19.5",   0x60000, 0x20000, CRC(edbb9581) SHA1(539396a01ca0b69455f000d446759b232530b542) )
2252   ROM_LOAD( "b53-22.4",   0x80000, 0x20000, CRC(59d2aef6) SHA1(b657b7603c3eb5f169000d38497ebb93f26f7832) )
2253   ROM_LOAD( "b53-23.3",   0xa0000, 0x20000, CRC(74acfb9b) SHA1(90b544ed7ede7565660bdd13c94c15c54423cda9) )
2254   ROM_LOAD( "b53-20.2",   0xc0000, 0x20000, CRC(095d0dc0) SHA1(ced2937d0594fa00ae344a4e3a3cba23772dc160) )
2255   ROM_LOAD( "b53-21.1",   0xe0000, 0x20000, CRC(9800c54d) SHA1(761647177d621ac2cdd8b009876eed35809f3c92) )
2256ROM_END
2257
2258/* tnzs - old style PCB sets */
2259
22412260ROM_START( tnzsj )
22422261   ROM_REGION( 0x30000, "main", 0 )   /* 64k + bankswitch areas for the first CPU */
22432262   ROM_LOAD( "b53-10.32", 0x00000, 0x08000, CRC(a73745c6) SHA1(73eb38e75e08312d752332f988dc655084b4a86d) )
r3232r3233
24012420GAME( 1988, chukatai, 0,        tnzs,     chukatai, chukatai, ROT0,   "Taito Corporation Japan", "Chuka Taisen (World)", 0 ) /* Possible region hack */
24022421GAME( 1988, chukatau, chukatai, tnzs,     chukatau, chukatai, ROT0,   "Taito America Corporation", "Chuka Taisen (US)", 0 ) /* Possible region hack */
24032422GAME( 1988, chukataj, chukatai, tnzs,     chukatau, chukatai, ROT0,   "Taito Corporation", "Chuka Taisen (Japan)", 0 )
2404GAME( 1988, tnzs,     0,        tnzsb,    tnzsb,    tnzsb,    ROT0,   "Taito Corporation Japan", "The NewZealand Story (World, newer)", 0 )
2405GAME( 1988, tnzsj,    tnzs,     tnzs,     tnzs,     tnzs,     ROT0,   "Taito Corporation", "The NewZealand Story (Japan)", 0 )
2406GAME( 1988, tnzso,    tnzs,     tnzs,     tnzs2,    tnzs,     ROT0,   "Taito Corporation Japan", "The NewZealand Story (World, older)", 0 )
2423GAME( 1988, tnzs,     0,        tnzsb,    tnzsb,    tnzsb,    ROT0,   "Taito Corporation Japan", "The NewZealand Story (World, newer) (newer PCB)", 0 )
2424GAME( 1988, tnzsjn,   tnzs,     tnzsb,    tnzsb,    tnzsb,    ROT0,   "Taito Corporation", "The NewZealand Story (Japan) (newer PCB)", 0 )
2425GAME( 1988, tnzsj,    tnzs,     tnzs,     tnzs,     tnzs,     ROT0,   "Taito Corporation", "The NewZealand Story (Japan) (older PCB)", 0 )
2426GAME( 1988, tnzso,    tnzs,     tnzs,     tnzs2,    tnzs,     ROT0,   "Taito Corporation Japan", "The NewZealand Story (World, older) (older PCB)", 0 )
24072427GAME( 1988, kabukiz,  0,        kabukiz,  kabukiz,  kabukiz,  ROT0,   "Taito Corporation Japan", "Kabuki-Z (World)", 0 )
24082428GAME( 1988, kabukizj, kabukiz,  kabukiz,  kabukiz,  kabukiz,  ROT0,   "Taito Corporation", "Kabuki-Z (Japan)", 0 )
24092429GAME( 1989, insectx,  0,        insectx,  insectx,  insectx,  ROT0,   "Taito Corporation Japan", "Insector X (World)", 0 )
24102430GAME( 1992, jpopnics, 0,        jpopnics, jpopnics, 0,        ROT0,   "Nics", "Jumping Pop (Nics, Korean bootleg of Plump Pop)", GAME_IMPERFECT_GRAPHICS )
2431
src/mame/drivers/naomi.c
r3232r3233
11761176*/
11771177
11781178#define NAOMI2_BIOS \
1179   ROM_REGION( 0x200000, "main", 0) \
11791180   ROM_SYSTEM_BIOS( 0, "bios0", "epr-23608b (Export)" ) \
11801181   ROM_LOAD16_WORD_SWAP_BIOS( 0, "epr-23608b.bin",   0x000000, 0x200000, CRC(a554b1e3) SHA1(343b727a3619d1c75a9b6d4cc156a9050447f155) ) \
11811182   ROM_SYSTEM_BIOS( 1, "bios1", "epr-23608 (Export)"  ) \
r3232r3233
11951196#define AW_BIOS \
11961197   ROM_SYSTEM_BIOS( 0, "bios0", "Atomiswave BIOS" ) \
11971198   ROM_LOAD16_WORD_SWAP_BIOS( 0, "bios.ic23_l",                         0x000000, 0x010000, BAD_DUMP CRC(e5693ce3) SHA1(1bde3ed87af64b0f675ebd47f12a53e1fc5709c1) ) /* Might be bad.. especially. bytes 0x0000, 0x6000, 0x8000 which gave different reads */ \
1198   ROM_LOAD16_WORD_SWAP_BIOS( 0, "bios.ic23_h-dolhpin_blue_settings",   0x010000, 0x010000, BAD_DUMP CRC(5d5687c7) SHA1(2600ce09c44872d1793f6b55bf44342673da5ad1) ) /* it appears to flash settings game data here */ /* this is one flashrom, however the second half looks like it's used for game settings, may differ between dumps, and may not be needed / could be blanked */
1199   ROM_LOAD16_WORD_SWAP_BIOS( 0, "bios.ic23_h-dolphin_blue_settings",   0x010000, 0x010000, BAD_DUMP CRC(5d5687c7) SHA1(2600ce09c44872d1793f6b55bf44342673da5ad1) ) /* it appears to flash settings game data here */ /* this is one flashrom, however the second half looks like it's used for game settings, may differ between dumps, and may not be needed / could be blanked */
11991200
12001201
12011202ROM_START( naomi )
r3232r3233
12191220ROM_END
12201221
12211222ROM_START( naomi2 )
1222   ROM_REGION( 0x200000, "main", 0)
12231223   NAOMI2_BIOS
12241224
12251225   ROM_REGION( 0x8400000, "user1", ROMREGION_ERASE)
r3232r3233
27922792
27932793
27942794}
2795
2796ROM_START( sfz3ugd )
2797   NAOMIGD_BIOS
2798
2799   ROM_REGION( 0xac00000, "user1", ROMREGION_ERASE) // this is the 'rom' file from the GDROM DISC, once the GDROM is emulated this won't be loaded
2800   ROM_LOAD_OPTIONAL("zero3rom.bin", 0x0000000, 0xac00000, CRC(4eabda58) SHA1(e70db0e93c821838c77510fd47c91f0c4cfb09c9) )
2801
2802   /* GD-ROM dump, this will be replaced once an appropriate CHD format has been decided upon for the GD images*/
2803   ROM_REGION( 0x3d8ab000, "user3", ROMREGION_ERASE)
2804   ROM_LOAD("track.txt",  0x0000000, 0x000000ad, CRC(bf017e1d) SHA1(0345310b6982f818a07dec8739efe1709281f1e6) )
2805   ROM_LOAD("track01.iso",0x0000000, 0x000e1000, CRC(8af2e370) SHA1(0f359d423f72055e6a5c81e7075df1ffd3ccfa5c) )
2806   ROM_LOAD("track02.raw",0x0000000, 0x004c8cf0, CRC(c5628df6) SHA1(0d1a24e6271c3b0ef92c55ec9d63e2326892f1d8) )
2807   ROM_LOAD("track03.iso",0x0000000, 0x3d8ab000, CRC(195f0d93) SHA1(183412704bd90750355e7af019b78541328fe633) )
2808
2809
2810   ROM_REGION( 0x50, "pic_response", ROMREGION_ERASE)
2811   ROM_LOAD("317-5072-com.data", 0x00, 0x50, CRC(6d2992b9) SHA1(88e6dc6711f9f883362ba1217a3350d452a70896) )
2812ROM_END
2813
28142795extern void naomi_game_decrypt(UINT64 key, UINT8* region, int length);
28152796
2816DRIVER_INIT( cvs2gd )
2817{
2818   // get from key file instead
2819   naomi_game_decrypt( 0x2f3226165b9e407cULL, memory_region(machine,"user1"), memory_region_length(machine,"user1"));
2820}
28212797
2822DRIVER_INIT( sfz3ugd )
2823{
2824   // get from key file instead
2825   naomi_game_decrypt( 0x4FF16D1A9E0BFBCDULL, memory_region(machine,"user1"), memory_region_length(machine,"user1"));
2826//  naomi_write_keyfile();
2827}
28282798
28292799
28302800
2831ROM_START( cvs2gd )
2832   NAOMIGD_BIOS
28332801
2834   ROM_REGION( 0x9800000, "user1", ROMREGION_ERASE) // this is the 'rom' file from the GDROM DISC, once the GDROM is emulated this won't be loaded
2835   ROM_LOAD("snkgd_sl.bin", 0x0000000, 0x9800000,  CRC(f153421d) SHA1(0c2b935ae3cfb6c85410a209fec4eab497066d84) )
28362802
2837   /* GD-ROM dump, this will be replaced once an appropriate CHD format has been decided upon for the GD images*/
2838   ROM_REGION( 0x26ad4620, "user3", ROMREGION_ERASE)
2839   ROM_LOAD("capcom_vs_snk2.txt",  0x0000000, 0x00000141, CRC(0db478be) SHA1(a18f87b76139e4a845ecc1456b6195574110e30c) )
2840   ROM_LOAD("track01.bin",0x0000000, 0x00ac440,  CRC(d48bd072) SHA1(2fc840586c655dee2686ee3b520c7760bd3b8dcb) )
2841   ROM_LOAD("track02.raw",0x0000000, 0x004c8cf0, CRC(3b3a2e7b) SHA1(fd8e5cac5bd387229f4ffbe05d1bf2fabf7ea3f9) )
2842   ROM_LOAD("track03.bin",0x0000000, 0x26ad4620, CRC(670d2182) SHA1(a99ceb7bb74e4a0fe6ae80b33cd2963465ae9d14) )
2843   ROM_CONTINUE(0x0000000, 0x20000000)
28442803
2845   ROM_REGION( 0x50, "pic_response", ROMREGION_ERASE)
2846   ROM_LOAD("317-5078-com.data", 0x00, 0x50, CRC(1c8d94ee) SHA1(bec4a6901f62dc8f76f7b9d72284b3eaac340bf3) )
2847ROM_END
2848
2849
2850
28512804/* All games have the regional titles at the start of the IC22 rom in the following order
28522805
28532806  JAPAN
r3232r3233
29032856/* HOTD2 isn't dumped */
29042857
29052858
2906/* No GD-Rom Sets Supported */
2907GAME( 2001, naomigd,   0,        naomi,    naomi,    0, ROT0, "Sega",            "Naomi GD-ROM Bios", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT )
2908GAME( 2001, sfz3ugd,   naomigd,  naomi,    naomi,    sfz3ugd, ROT0, "Capcom",          "Street Fighter Zero 3 Upper", GAME_NO_SOUND|GAME_NOT_WORKING )
2909GAME( 2001, cvs2gd,    naomigd,  naomi,    naomi,    cvs2gd, ROT0, "Capcom",          "Capcom Vs. SNK 2", GAME_NO_SOUND|GAME_NOT_WORKING )
29102859
2860DRIVER_INIT( ngdkey )
2861{
2862   UINT8* picdata = memory_region(machine,"picreturn");
2863   UINT64 key;
29112864
2865   key =(((UINT64)picdata[0x31] << 56) |
2866        ((UINT64)picdata[0x32] << 48) |
2867        ((UINT64)picdata[0x33] << 40) |
2868        ((UINT64)picdata[0x34] << 32) |
2869        ((UINT64)picdata[0x35] << 24) |
2870        ((UINT64)picdata[0x36] << 16) |
2871        ((UINT64)picdata[0x37] << 8)  |
2872        ((UINT64)picdata[0x29] << 0));
2873
2874   printf("key is %08x%08x\n", (UINT32)((key & 0xffffffff00000000ULL)>>32), (UINT32)(key & 0x00000000ffffffffULL));
2875
2876   naomi_game_decrypt( key, memory_region(machine,"user1"), memory_region_length(machine,"user1"));
2877}
2878
2879
2880ROM_START( gundmgd )
2881   NAOMIGD_BIOS
2882
2883   ROM_REGION( 0xa000000, "user1", ROMREGION_ERASE) // this is the 'rom' file from the GDROM DISC, once the GDROM is emulated this won't be loaded
2884   ROM_LOAD_OPTIONAL("gdmgd_sl.bin", 0x0000000,  0xa000000, CRC(d07ee020) SHA1(751033d48e021908958757125cf3b96a89d0e765) )
2885
2886   DISK_REGION( "gdrom" )
2887   DISK_IMAGE_READONLY( "gdl-0001", 0, SHA1(f525111e2762e5895fd0016a9bd41210c1125499) MD5(dcba598e76646a5a6b6e6da70552a7c5) )
2888
2889   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
2890   //PIC16C622A (317-5069-COM)
2891   //(sticker 253-5509-5069)
2892   ROM_LOAD("317-5069-com.data", 0x00, 0x50, CRC(8e2f0cbd) SHA1(a5f3a990a03bfa50a1a742593c5ec07645c8718d) )
2893ROM_END
2894
2895
2896ROM_START( sfz3ugd )
2897   NAOMIGD_BIOS
2898
2899   ROM_REGION( 0xac00000, "user1", ROMREGION_ERASE) // this is the 'rom' file from the GDROM DISC, once the GDROM is emulated this won't be loaded
2900   ROM_LOAD_OPTIONAL("zero3rom.bin", 0x0000000, 0xac00000, CRC(4eabda58) SHA1(e70db0e93c821838c77510fd47c91f0c4cfb09c9) )
2901
2902   DISK_REGION( "gdrom" )
2903   DISK_IMAGE_READONLY( "gdl-0002", 0, SHA1(6e7cb0df5feea41ae0b5eb72a92adcd8966595dc) MD5(6340b2527673a8cf387dcda52ecae0ca) )
2904
2905   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
2906   //PIC16C622A (317-5072-COM)
2907   //(sticker 253-5509-5072)
2908   ROM_LOAD("317-5072-com.data", 0x00, 0x50, CRC(6d2992b9) SHA1(88e6dc6711f9f883362ba1217a3350d452a70896) )
2909ROM_END
2910
2911ROM_START( cvsgd )
2912   NAOMIGD_BIOS
2913
2914   ROM_REGION( 0x7800000, "user1", ROMREGION_ERASE) // this is the 'rom' file from the GDROM DISC, once the GDROM is emulated this won't be loaded
2915   ROM_LOAD_OPTIONAL("snkgd_sl.bin", 0x0000000, 0x7800000, CRC(83ec3894) SHA1(d07271d964bf6421ea9f13e10ecec57c6e995b2e) )
2916
2917   DISK_REGION( "gdrom" )
2918   DISK_IMAGE_READONLY( "gdl-0004", 0,  SHA1(8f8651527463aa01d40c280c0d9b03b7a0650a32) MD5(2d17eaf881c06bd95847e54878bc2ba9) )
2919
2920   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
2921   //PIC16C622A (317-5076-JPN)
2922   //(sticker 253-5509-5076J)
2923   ROM_LOAD("317-5076-jpn.data", 0x00, 0x50, CRC(5004161b) SHA1(8b2cdfec12ffd9160bc74659e08d07cbc46a4011) )
2924ROM_END
2925
2926
2927ROM_START( gundmxgd )
2928   NAOMIGD_BIOS
2929
2930   ROM_REGION( 0xc800000, "user1", ROMREGION_ERASE) // this is the 'rom' file from the GDROM DISC, once the GDROM is emulated this won't be loaded
2931   ROM_LOAD_OPTIONAL("gdmgd_sl.bin", 0x0000000, 0xc800000, CRC(322e503c) SHA1(10a0e3e079d9724e6bc2d4916a4f64384d00d202) )
2932
2933   DISK_REGION( "gdrom" )
2934   DISK_IMAGE_READONLY( "gdl-0006", 0, SHA1(b95bc07e61e57a62e276ba7fef0ae9a5c19667d9) MD5(90b1980605e7f53b38292ae32d547c8b) )
2935
2936   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
2937   //PIC16C622A (317-5079-COM)
2938   //(sticker 253-5509-5079)
2939   ROM_LOAD("317-5079-com.data", 0x00, 0x50, CRC(e6abe978) SHA1(700e610d84e517793a22d6cabd1aef9c3b8bc092) )
2940ROM_END
2941
2942
2943ROM_START( cvs2gd )
2944   NAOMIGD_BIOS
2945
2946   ROM_REGION( 0x9800000, "user1", ROMREGION_ERASE) // this is the 'rom' file from the GDROM DISC, once the GDROM is emulated this won't be loaded
2947   ROM_LOAD("snkgd_sl.bin", 0x0000000, 0x9800000,  CRC(f153421d) SHA1(0c2b935ae3cfb6c85410a209fec4eab497066d84) )
2948
2949   DISK_REGION( "gdrom" )
2950   DISK_IMAGE_READONLY( "gdl-0007a", 0, SHA1(e8f199f2743a63765bcbcd533bbe5eed82f959a8) MD5(1f434e6f610987987d1d130e454f5c74) )
2951
2952   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
2953   //PIC16C622A (317-5078-COM)
2954   //(sticker 253-5509-5078)
2955   ROM_LOAD("317-5078-com.data", 0x00, 0x50, CRC(1c8d94ee) SHA1(bec4a6901f62dc8f76f7b9d72284b3eaac340bf3) )
2956ROM_END
2957
2958ROM_START( ikaruga )
2959   NAOMIGD_BIOS
2960
2961   ROM_REGION( 0x9800000, "user1", ROMREGION_ERASE) // this is the 'rom' file from the GDROM DISC, once the GDROM is emulated this won't be loaded
2962   ROM_LOAD("ikaruga.bin", 0x0000000, 0x2000000, CRC(e0369676) SHA1(87f1d01ed81a612b44ed2e1bc48098c3ba92c238) )
2963
2964   DISK_REGION( "gdrom" )
2965   DISK_IMAGE_READONLY( "gdl-0010", 0, SHA1(3b853be7208f523100690e12a661173d023af9c1) MD5(83f1877b979b0e5fd77ebfa1ddd9fd56) )
2966
2967   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
2968   //PIC16C622A (317-5081-JPN)
2969   //(sticker 253-5509-5081J)
2970   ROM_LOAD("317-5081-jpn.data", 0x00, 0x50, CRC(d4cc5c8c) SHA1(44c0c5c2744fbd419b684cbc36f01973487bafbc) )
2971ROM_END
2972
2973
2974ROM_START( ggxx )
2975   NAOMIGD_BIOS
2976
2977   ROM_REGION( 0xf000000, "user1", ROMREGION_ERASE) // this is the 'rom' file from the GDROM DISC, once the GDROM is emulated this won't be loaded
2978   ROM_LOAD("ggx2.bin", 0x0000000, 0xf000000, CRC(666676ee) SHA1(24302e6f10e0d4d41f432cabf9d2743c0aa8fa7c) )
2979
2980   DISK_REGION( "gdrom" )
2981   DISK_IMAGE_READONLY( "gdl-0011", 0, SHA1(c08a19acb5641d2fd14b54cc149459c345dae013) MD5(25ab6d42bf07dd26e7033cf201322d9c) )
2982
2983   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
2984   //PIC16C622A (317-5082-COM)
2985   //(sticker 253-5509-5082)
2986   ROM_LOAD("317-5082-com.data", 0x00, 0x50, CRC(fa31209d) SHA1(bb18e6412a02510832f7200a06a3179ef1695ef2) )
2987ROM_END
2988
2989
2990ROM_START( chocomk )
2991   NAOMIGD_BIOS
2992
2993   ROM_REGION( 0x3f1f000, "user1", ROMREGION_ERASE) // this is the 'rom' file from the GDROM DISC, once the GDROM is emulated this won't be loaded
2994   ROM_LOAD("typ.bin", 0x0000000, 0x3f1f000,  CRC(d3976ae9) SHA1(764675d0b612b856dab95caa3000b31206439db4) )
2995
2996   DISK_REGION( "gdrom" )
2997   DISK_IMAGE_READONLY( "gdl-0014a", 0, SHA1(ee71e76f136b1a25855233a614d5c60a6a3e587d) MD5(1e5a028b0ae5cf3c5602cdc657fa2bc4) )
2998
2999   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3000   //PIC16C622A (317-5085-JPN)
3001   //(sticker 253-5509-5085J)
3002   ROM_LOAD("317-5085-jpn.data", 0x00, 0x50, CRC(eecd8140) SHA1(471fb6b242eff646173265df891109e3e0a37a7d) )
3003ROM_END
3004
3005
3006ROM_START( quizqgd )
3007   NAOMIGD_BIOS
3008
3009   ROM_REGION( 0x9000000, "user1", ROMREGION_ERASE) // this is the 'rom' file from the GDROM DISC, once the GDROM is emulated this won't be loaded
3010   ROM_LOAD("game.bin", 0x0000000, 0x9000000,  CRC(0075dd46) SHA1(8f0cb3f8bce492c8d2bdec607a4b95d36ddea404) )
3011
3012   DISK_REGION( "gdrom" )
3013   DISK_IMAGE_READONLY( "gdl-0017", 0, SHA1(b6f3fbc81d9aea18551134b93ba3b612254bbc43) MD5(af4be08bf65cbddf2177ccf838c0df20) )
3014
3015   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3016   //PIC16C622A (317-5090-JPN)
3017   //(sticker 253-5509-5090J)
3018   ROM_LOAD("317-5090-jpn.data", 0x00, 0x50, CRC(b4dd88f6) SHA1(c9aacd79c1088225fa5a69b7bd31a7c1286160e1) )
3019ROM_END
3020
3021ROM_START( ggxxrl )
3022   NAOMIGD_BIOS
3023
3024   ROM_REGION( 0xf000000, "user1", ROMREGION_ERASE) // this is the 'rom' file from the GDROM DISC, once the GDROM is emulated this won't be loaded
3025   ROM_LOAD("ggx2.bin", 0x0000000,  0xf000000,  CRC(96ee0174) SHA1(3063682aa31b983fc8dcc2a86bf57dc50da5d904) )
3026
3027   DISK_REGION( "gdrom" )
3028   DISK_IMAGE_READONLY( "gdl-0019a", 0, SHA1(50ec9bba5a7ba71f8543763cb139bab46dc487a5) MD5(b09c865e3e06e6e4467acf45b04e9caa) )
3029
3030   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3031   //PIC16C622A (317-5092-JPN)
3032   //(sticker 253-5509-5092J)
3033   ROM_LOAD("317-5092-jpn.data", 0x00, 0x50, CRC(7c8cca4b) SHA1(92c5a0fd8916744eefc023e64daea69803573928) )
3034ROM_END
3035
3036ROM_START( shikgam2 )
3037   NAOMIGD_BIOS
3038
3039   ROM_REGION( 0x704e000, "user1", ROMREGION_ERASE) // this is the 'rom' file from the GDROM DISC, once the GDROM is emulated this won't be loaded
3040   ROM_LOAD("game.bin", 0x0000000, 0x704e000,  CRC(f658311f) SHA1(d4b780d5954dd41bfe6ceff5fb358d94bc836126) )
3041
3042   DISK_REGION( "gdrom" )
3043   DISK_IMAGE_READONLY( "gdl-0021", 0, SHA1(ca6a9f78b2f6b18be3fb926ebcd20c2e90923882) MD5(ba448900dd5cbc9f1f75f285f5d72231) )
3044
3045   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3046   //PIC16C622A (317-5095-JPN)
3047   //(sticker 253-5509-5095J)
3048   ROM_LOAD("317-5095-jpn.data", 0x00, 0x50, CRC(6033ec89) SHA1(9e99a8ad43fa29296dbf2e13b3a3d4552130b4e8) )
3049ROM_END
3050
3051
3052ROM_START( meltybld )
3053   NAOMIGD_BIOS
3054
3055   ROM_REGION( 0xdc2c000, "user1", ROMREGION_ERASE) // this is the 'rom' file from the GDROM DISC, once the GDROM is emulated this won't be loaded
3056   ROM_LOAD("mel.bin", 0x0000000,  0xdc2c000, CRC(2af7db27) SHA1(2569b6f84be411928764fb513503dfe116f957f5) )
3057
3058   DISK_REGION( "gdrom" )
3059   DISK_IMAGE_READONLY( "gdl-0028c", 0, SHA1(bbe95fd6bb39a33e979a0d9d8a63c0f2df1e9e96) MD5(b3318abacfea682605aaa24c756f225d) )
3060
3061   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3062   //PIC16C622A (317-5104-JPN)
3063   //(sticker 253-5509-5104J)
3064   ROM_LOAD("317-5104-jpn.data", 0x00, 0x50, CRC(fedc8305) SHA1(c535545937213f726f25e6aa8eb3746a794e9100) )
3065ROM_END
3066
3067
3068
3069ROM_START( senko )
3070   NAOMIGD_BIOS
3071
3072   ROM_REGION( 0xfe40000, "user1", ROMREGION_ERASE) // this is the 'rom' file from the GDROM DISC, once the GDROM is emulated this won't be loaded
3073   ROM_LOAD("ronde.bin", 0x0000000,  0xfe40000, CRC(49bff4cb) SHA1(bd67522ed781cdd70b4c652cbb1befddb395a4b7) )
3074
3075   DISK_REGION( "gdrom" )
3076   DISK_IMAGE_READONLY( "gdl-0030a", 0,  SHA1(bb9727f69f7e5452e09b151c1198d006a81aeb0e) MD5(12885cd794d8a5a839699aef4769b2dd) )
3077
3078   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3079   //PIC16C622A (317-5107-JPN)
3080   //(sticker 253-5509-5107J)
3081   ROM_LOAD("317-5107-jpn.data", 0x00, 0x50, CRC(7b607409) SHA1(a9946a0637453e4813bef18060d4420355cff800) )
3082ROM_END
3083
3084
3085
3086ROM_START( ss2005 )
3087   NAOMIGD_BIOS
3088
3089   ROM_REGION( 0x5504800, "user1", ROMREGION_ERASE) // this is the 'rom' file from the GDROM DISC, once the GDROM is emulated this won't be loaded
3090   ROM_LOAD("sh2sl.bin", 0x0000000,   0x5504800, CRC(5c1d2394) SHA1(197cb74c00adb2acafa927045a2fa7b5730605c7) )
3091
3092   DISK_REGION( "gdrom" )
3093   DISK_IMAGE_READONLY( "gdl-0031a", 0, SHA1(09a47ce506b9696d7bdf4d7c95aa3182cc0d9efa) MD5(1a83930f2083397868172745d3ab2926) )
3094
3095
3096   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3097   //PIC16C622A (317-5108-JPN)
3098   //(sticker 253-5509-5108J)
3099   ROM_LOAD("317-5108-jpn.data", 0x00, 0x50, CRC(6a2eb334) SHA1(cab407d2e994f33aa921d50f399b17e6fbf98eb0) )
3100ROM_END
3101
3102
3103
3104ROM_START( sprtjam )
3105   NAOMIGD_BIOS
3106
3107   ROM_REGION( 0xb000000, "user1", ROMREGION_ERASE) // this is the 'rom' file from the GDROM DISC, once the GDROM is emulated this won't be loaded
3108   ROM_LOAD("rom.enc", 0x0000000,   0xb000000, CRC(1f6daa8d) SHA1(41c40da36c0448d0a8695fef2fd304b9caaf7562) )
3109
3110   DISK_REGION( "gdrom" )
3111   DISK_IMAGE_READONLY( "gds-0003", 0, SHA1(bfabb0da1d4f0422e0b62d8a7bb67dbcdb0d5954) MD5(3a8d3cbc4067f9b5f50be9b9abdc689b) )
3112
3113   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3114   //PIC16C622A (317-0300-COM)
3115   //(sticker 253-5508-0300)
3116   ROM_LOAD("317-0300-com.data", 0x00, 0x50, CRC(9a08413f) SHA1(d57649dcc3af578d55a93dd7a3f41da62d580f54) )
3117ROM_END
3118
3119
3120ROM_START( slashout )
3121   NAOMIGD_BIOS
3122
3123   ROM_REGION( 0x9000000, "user1", ROMREGION_ERASE) // this is the 'rom' file from the GDROM DISC, once the GDROM is emulated this won't be loaded
3124   ROM_LOAD("slash.bin", 0x0000000,   0x9000000, CRC(e1f9320f) SHA1(09f1a69aee6e401acbe2099e10193d3fb575eeeb) )
3125
3126   DISK_REGION( "gdrom" )
3127   DISK_IMAGE_READONLY( "gds-0004", 0, SHA1(ec1758f5ae359bcb3c66c7ce9ebcb7443c4fd967) MD5(f5228f26e661ab0cb67414f51fe1a5bc) )
3128
3129   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3130   //PIC16C622A (317-0302-COM)
3131   //(sticker 253-5508-0302)
3132   ROM_LOAD("317-0302-com.data", 0x00, 0x50, CRC(4bf6cd62) SHA1(c1fdf12a4d80fa3008170c89d2dc583f19e0450b) )
3133ROM_END
3134
3135
3136ROM_START( spkrbtl )
3137   NAOMIGD_BIOS
3138
3139   ROM_REGION( 0xb000000, "user1", ROMREGION_ERASE) // this is the 'rom' file from the GDROM DISC, once the GDROM is emulated this won't be loaded
3140   ROM_LOAD("spkb.bin", 0x0000000,   0xb000000, CRC(ca11d20e) SHA1(e2e2710a8c69eeb970e131be80e0ec19e91d90c6) )
3141
3142   DISK_REGION( "gdrom" )
3143   DISK_IMAGE_READONLY( "gds-0005", 0, SHA1(ca6e7ed2e161acad8600898e1b83aded9bb31d3b) MD5(a8a05ce6ab7d9ea67e015cd4853a5b80) )
3144
3145   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3146   //PIC16C622A (317-0303-COM)
3147   //(sticker 253-5508-0303)
3148   ROM_LOAD("317-0303-com.data", 0x00, 0x50, CRC(6e7888a3) SHA1(5ca78052bcfd9e9f81934cbddd9c173e88973e0e) )
3149ROM_END
3150
3151
3152ROM_START( dygolf )
3153   NAOMIGD_BIOS
3154
3155   ROM_REGION( 0x6000000, "user1", ROMREGION_ERASE) // this is the 'rom' file from the GDROM DISC, once the GDROM is emulated this won't be loaded
3156   ROM_LOAD("game.enc", 0x0000000,   0x6000000, CRC(ab02d769) SHA1(3d96d43522357950a3928717464ecf854dd6e385) )
3157
3158   DISK_REGION( "gdrom" )
3159   DISK_IMAGE_READONLY( "gds-0009", 0, SHA1(d58a42586c65dcb44282bf930631ea8b663c6aa7) MD5(e553e1811f28b67fd57fa8e34d978d87) )
3160
3161   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3162   //PIC16C622A (317-0308-COM)
3163   //(sticker 253-5508-0308)
3164   ROM_LOAD("317-0308-com.data", 0x00, 0x50,  CRC(56f63af0) SHA1(3c453226fc53d2f700b3634db3ef8ce206d94392) )
3165ROM_END
3166
3167ROM_START( wsbbgd )
3168   NAOMIGD_BIOS
3169
3170   ROM_REGION( 0xa000000, "user1", ROMREGION_ERASE) // this is the 'rom' file from the GDROM DISC, once the GDROM is emulated this won't be loaded
3171   ROM_LOAD("wsb_sl.bin", 0x0000000,   0xa000000, CRC(e61f37f1) SHA1(ba7b97eec6df672b520c57422287f699438267c5) )
3172
3173   DISK_REGION( "gdrom" )
3174   DISK_IMAGE_READONLY( "gds-0010", 0,  SHA1(8ce36c9710a8d55e8c19d7f218500b7074b66dec) MD5(bfb8c5ead5ac9e2a82bca9114390a99f) )
3175
3176   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3177   //PIC16C622A (317-0309-COM)
3178   //(sticker 253-5508-0309)
3179   ROM_LOAD("317-0309-com.data", 0x00, 0x50, CRC(8792c550) SHA1(e8d6d91583d1673d8d3fa9ccb0ab1097c5c5ad08) )
3180ROM_END
3181
3182
3183ROM_START( vathlete )
3184   NAOMIGD_BIOS
3185
3186   ROM_REGION( 0x7000000, "user1", ROMREGION_ERASE) // this is the 'rom' file from the GDROM DISC, once the GDROM is emulated this won't be loaded
3187   ROM_LOAD("va.bin", 0x0000000,   0x7000000, CRC(82992bf8) SHA1(1c36e1d8e5bf392b760c934b358963b92fc716cf) )
3188
3189   DISK_REGION( "gdrom" )
3190   DISK_IMAGE_READONLY( "gds-0019", 0, SHA1(2167bbdde987c16949c5814ab7cff6eefd9f9326) MD5(67499591f2c61cda14fa581db9294315) )
3191
3192   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3193   //PIC16C622A (317-0330-COM)
3194   //(sticker 253-5508-0330)
3195   ROM_LOAD("317-0330-com.data", 0x00, 0x50, CRC(f5e7f7d4) SHA1(3903337e82011d132993e4366475586866bd39b1) )
3196ROM_END
3197
3198/* Naomi GD-Rom Sets */
3199GAME( 2001, naomigd,   0,        naomi,    naomi,    0,       ROT0, "Sega",            "Naomi GD-ROM Bios", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT )
3200
3201// GDL-xxxx (licensed games?)
3202GAME( 200?, gundmgd,   naomigd,  naomi,    naomi,    ngdkey,   ROT0,   "unknown",       "Mobile Suit Gundam: Federation VS Zeon (GDL-0001)", GAME_NO_SOUND|GAME_NOT_WORKING )
3203GAME( 200?, sfz3ugd,   naomigd,  naomi,    naomi,    ngdkey,   ROT0,   "Capcom",        "Street Fighter Zero 3 Upper (GDL-0002)", GAME_NO_SOUND|GAME_NOT_WORKING )
3204GAME( 200?, cvsgd,     naomigd,  naomi,    naomi,    ngdkey,   ROT0,   "Capcom",        "Capcom vs SNK Millenium Fight 2000 Pro (GDL-0004)", GAME_NO_SOUND|GAME_NOT_WORKING )
3205GAME( 200?, gundmxgd,  naomigd,  naomi,    naomi,    ngdkey,   ROT0,   "unknown",       "Mobile Suit Gundam: Federation VS Zeon DX  (GDL-0006)", GAME_NO_SOUND|GAME_NOT_WORKING )
3206GAME( 200?, cvs2gd,    naomigd,  naomi,    naomi,    ngdkey,   ROT0,   "Capcom",        "Capcom vs SNK 2 Millionaire Fighting 2001 (GDL-0007A)", GAME_NO_SOUND|GAME_NOT_WORKING )
3207GAME( 2001, ikaruga,   naomigd,  naomi,    naomi,    ngdkey,   ROT270, "Treasure",      "Ikaruga (GDL-0010)", GAME_NO_SOUND|GAME_NOT_WORKING )
3208GAME( 200?, ggxx,      naomigd,  naomi,    naomi,    ngdkey,   ROT0,   "unknown",       "Guilty Gear XX (GDL-0011)", GAME_NO_SOUND|GAME_NOT_WORKING )
3209GAME( 200?, chocomk,   naomigd,  naomi,    naomi,    ngdkey,   ROT0,   "unknown",       "Musapey's Choco Marker (GDL-0014A)", GAME_NO_SOUND|GAME_NOT_WORKING )
3210GAME( 200?, quizqgd,   naomigd,  naomi,    naomi,    ngdkey,   ROT0,   "unknown",       "Quiz Keitai Q mode (GDL-0017)", GAME_NO_SOUND|GAME_NOT_WORKING )
3211GAME( 200?, ggxxrl,    naomigd,  naomi,    naomi,    ngdkey,   ROT0,   "unknown",       "Guilty Gear XX #Reload (GDL-0019A)", GAME_NO_SOUND|GAME_NOT_WORKING )
3212GAME( 200?, shikgam2,  naomigd,  naomi,    naomi,    ngdkey,   ROT0,   "unknown",       "Shikigami No Shiro II / The Castle of Shikigami II (GDL-0021)", GAME_NO_SOUND|GAME_NOT_WORKING )
3213GAME( 2004, meltybld,  naomigd,  naomi,    naomi,    ngdkey,   ROT0,   "Ecole",         "Melty Blood Act Cadenza (GDL-0028C)", GAME_NO_SOUND|GAME_NOT_WORKING )
3214GAME( 200?, senko,     naomigd,  naomi,    naomi,    ngdkey,   ROT0,   "unknown",       "Senko No Ronde (GDL-0030A)", GAME_NO_SOUND|GAME_NOT_WORKING )
3215GAME( 2005, ss2005,    naomigd,  naomi,    naomi,    ngdkey,   ROT0,   "unknown",       "Super Shanghai 2005 (GDL-0031A)", GAME_NO_SOUND|GAME_NOT_WORKING )
3216
3217// GDS-xxxx (first party games?)
3218GAME( 200?, sprtjam,   naomigd,  naomi,    naomi,    ngdkey,  ROT0, "Sega",          "Sports Jam (GDS-0003)", GAME_NO_SOUND|GAME_NOT_WORKING )
3219GAME( 200?, slashout,  naomigd,  naomi,    naomi,    ngdkey,  ROT0, "Sega",          "Slashout (GDS-0004)", GAME_NO_SOUND|GAME_NOT_WORKING )
3220GAME( 200?, spkrbtl,   naomigd,  naomi,    naomi,    ngdkey,  ROT0, "Sega",          "Spikers Battle (GDS-0005)", GAME_NO_SOUND|GAME_NOT_WORKING )
3221GAME( 200?, dygolf,    naomigd,  naomi,    naomi,    ngdkey,  ROT0, "Sega",          "Virtua Golf / Dynamic Golf (GDS-0009)", GAME_NO_SOUND|GAME_NOT_WORKING )
3222GAME( 200?, wsbbgd,    naomigd,  naomi,    naomi,    ngdkey,  ROT0, "Sega",          "World Series Baseball (GDS-0010)", GAME_NO_SOUND|GAME_NOT_WORKING )
3223GAME( 200?, vathlete,  naomigd,  naomi,    naomi,    ngdkey,  ROT0, "Sega",          "Virtua Athletics / Virtua Athlete (GDS-0019)", GAME_NO_SOUND|GAME_NOT_WORKING )
3224
29123225/* Naomi 2 & Naomi 2 GD-ROM */
3226
3227
3228ROM_START( vstrik3 )
3229   NAOMI2_BIOS
3230
3231   ROM_REGION( 0xb000000, "user1", ROMREGION_ERASE) // this is the 'rom' file from the GDROM DISC, once the GDROM is emulated this won't be loaded
3232   ROM_LOAD("vs3.bin", 0x0000000,   0xb000000, CRC(79d44ff4) SHA1(af0b892531c60999f0ef5db7525de50836764c77) )
3233
3234   DISK_REGION( "gdrom" )
3235   DISK_IMAGE_READONLY( "gds-0006", 0, SHA1(293b84c7f4547060f57598b796b6fc49513cc839) MD5(060d9fef55d8f0fc1986ecc991478942) )
3236
3237   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3238   //PIC16C622A (317-0304-COM)
3239   //(sticker 253-5508-0304)
3240   ROM_LOAD("317-0304-com.data", 0x00, 0x50, CRC(a181c601) SHA1(6a489904941e638ac1069b66e76ee0bcec7d0bab) )
3241ROM_END
3242
3243ROM_START( vf4 )
3244   NAOMI2_BIOS
3245
3246   ROM_REGION( 0xf000000, "user1", ROMREGION_ERASE) // this is the 'rom' file from the GDROM DISC, once the GDROM is emulated this won't be loaded
3247   ROM_LOAD("vf4.bin", 0x0000000,   0xf000000, CRC(a81e3277) SHA1(fb162f34720d6ba49297ecb5e2869b2afffc307b) )
3248
3249   DISK_REGION( "gdrom" )
3250   DISK_IMAGE_READONLY( "gds-0012", 0, SHA1(d68436ee72ea5db40e184b7ff38903a9cadb6df7) MD5(5a18300646a68f2994ed8c81abe9bdd8) )
3251
3252   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3253   // this key is wrong! not for this game
3254   // (it's for game with a BDR.bin file on the GD-ROM, vf4 has BDM.bin)
3255
3256   //PIC16C622A (317-0317-COM)
3257   //(sticker 253-5508-0317)
3258   ROM_LOAD("317-0317-com.data", 0x00, 0x50, BAD_DUMP CRC(66efe433) SHA1(7f7b52202ed9b1e20516aaa7553cc3cc677a70b5) )
3259ROM_END
3260
3261ROM_START( initd )
3262   NAOMI2_BIOS
3263
3264   ROM_REGION( 0xc2ed000, "user1", ROMREGION_ERASE) // this is the 'rom' file from the GDROM DISC, once the GDROM is emulated this won't be loaded
3265   ROM_LOAD("inid.bin", 0x0000000,    0xc2ed000, CRC(524ca451) SHA1(cc8dd06e4fe50e70f277043bd1b817e41c5db8cf) )
3266
3267   DISK_REGION( "gdrom" )
3268   DISK_IMAGE_READONLY( "gds-0020b", 0, SHA1(5f386183e856722fee4a6ddb0146350b73349181) MD5(b085005215e2766e0fc1e3bd16b2fd95) )
3269
3270   ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE)
3271   //PIC16C622A (317-0331-JPN)
3272   //(sticker 253-5508-0331J)
3273   ROM_LOAD("317-0331-jpn.data", 0x00, 0x50, CRC(bb39742e) SHA1(b3100b18aeb80ebfd5312ba5c320e7e647710b55) )
3274ROM_END
3275
29133276GAME( 2001, naomi2,   0,        naomi,    naomi,    0, ROT0, "Sega",            "Naomi 2 Bios", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT )
2914/* No Supported Sets */
3277// GDS-xxxx (first party games?)
3278GAME( 200?, vstrik3, naomi2,  naomi,    naomi,    ngdkey,  ROT0, "Sega",          "Virtua Striker 3 (GDS-0006)", GAME_NO_SOUND|GAME_NOT_WORKING )
3279GAME( 200?, vf4,     naomi2,  naomi,    naomi,    ngdkey,  ROT0, "Sega",          "Virtua Fighter 4 (GDS-0012)", GAME_NO_SOUND|GAME_NOT_WORKING )
3280GAME( 200?, initd,   naomi2,  naomi,    naomi,    ngdkey,  ROT0, "Sega",          "Initial D (GDS-0020b)", GAME_NO_SOUND|GAME_NOT_WORKING )
29153281
3282
29163283/* Atomiswave */
29173284GAME( 2001, awbios,   0,        naomi,    naomi,    0, ROT0, "Sammy",           "Atomiswave Bios", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT )
29183285GAME( 2005, fotns,    awbios,   naomi,    naomi,    fotns, ROT0, "Sammy",           "Fist Of The North Star", GAME_NO_SOUND|GAME_NOT_WORKING )
src/mame/drivers/stv.c
r3232r3233
891891};
892892
893893static UINT8 port_sel,mux_data;
894static int port_i;
894895
895896static READ32_HANDLER ( stv_io_r32 )
896897{
897   static int i= -1;
898898   //if(LOG_IOGA) logerror("(PC=%08X): I/O r %08X & %08X\n", activecpu_get_pc(), offset*4, mem_mask);
899899
900900   switch(offset)
r3232r3233
984984      case 7:
985985      if(LOG_IOGA) logerror("(PC %d=%06x) Warning: READ from PORT_AD\n",cpu_getactivecpu(), activecpu_get_pc());
986986      popmessage("Read from PORT_AD");
987      i++;
988      return port_ad[i & 7];
987      port_i++;
988      return port_ad[port_i & 7];
989989      default:
990990      return ioga[offset];
991991   }
r3232r3233
25772577   NMI_reset = 1;
25782578   smpc_ram[0x21] = (0x80) | ((NMI_reset & 1) << 6);
25792579
2580   port_sel = mux_data = 0;
2581   port_i = -1;
2582
25802583   cpunum_set_clock(machine, 0, MASTER_CLOCK_320/2);
25812584   cpunum_set_clock(machine, 1, MASTER_CLOCK_320/2);
25822585   cpunum_set_clock(machine, 2, MASTER_CLOCK_320/5);
src/mame/drivers/megatech.c
r3232r3233
224224
225225static READ8_HANDLER( megatech_instr_r )
226226{
227   UINT8* instr = memory_region(machine, "megatech_bios")+0x8000;
227   UINT8* instr = memory_region(machine, "mtbios")+0x8000;
228228
229229   return instr[offset/2];
230230//  else
r3232r3233
376376   /* if the regions exist we're fine */
377377   if (game_region && bios_region)
378378   {
379      memcpy(memory_region(machine, "megatech_bios")+0x8000, bios_region, 0x8000);
379      memcpy(memory_region(machine, "mtbios")+0x8000, bios_region, 0x8000);
380380      memcpy(memory_region(machine, "main"), game_region, 0x300000);
381381
382382      // I store an extra byte at the end of the instruction rom region when loading
r3232r3233
413413   //  cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
414414
415415      /* no cart.. */
416      memset(memory_region(machine, "megatech_bios")+0x8000, 0x00, 0x8000);
416      memset(memory_region(machine, "mtbios")+0x8000, 0x00, 0x8000);
417417      memset(memory_region(machine, "main"), 0x00, 0x300000);
418418   }
419419
r3232r3233
438438    if (mt_cart_select_reg==2)
439439    {
440440        printf("game 2 selected\n");
441        memcpy(memory_region(machine, "megatech_bios")+0x8000, memory_region(machine, "inst0"), 0x8000);
441        memcpy(memory_region(machine, "mtbios")+0x8000, memory_region(machine, "inst0"), 0x8000);
442442    }
443443//  else if (mt_cart_select_reg==0)
444444//  {
445445//      printf("game 0 selected\n");
446//      memcpy(memory_region(machine, "megatech_bios")+0x8000, memory_region(machine, "inst2"), 0x8000);
446//      memcpy(memory_region(machine, "mtbios")+0x8000, memory_region(machine, "inst2"), 0x8000);
447447//  }
448448    else if (mt_cart_select_reg==6)
449449    {
450450        printf("game 6 selected\n");
451        memcpy(memory_region(machine, "megatech_bios")+0x8000, memory_region(machine, "user6"), 0x8000);
451        memcpy(memory_region(machine, "mtbios")+0x8000, memory_region(machine, "user6"), 0x8000);
452452    }
453453    else
454454    {
455        memset(memory_region(machine, "megatech_bios")+0x8000, 0x00, 0x8000);
455        memset(memory_region(machine, "mtbios")+0x8000, 0x00, 0x8000);
456456    }
457457*/
458458
r3232r3233
616616   MDRV_IMPORT_FROM(megadriv)
617617
618618   /* Megatech has an extra SMS based bios *and* an additional screen */
619   MDRV_CPU_ADD("megatech_bios", Z80, MASTER_CLOCK / 15) /* ?? */
619   MDRV_CPU_ADD("mtbios", Z80, MASTER_CLOCK / 15) /* ?? */
620620   MDRV_CPU_PROGRAM_MAP(megatech_bios_map, 0)
621621   MDRV_CPU_IO_MAP(megatech_bios_portmap,0)
622622
r3232r3233
657657
658658#define MEGATECH_BIOS \
659659   ROM_REGION( 0x400000, "main", ROMREGION_ERASEFF ) \
660   ROM_REGION( 0x10000, "megatech_bios", 0 ) \
660   ROM_REGION( 0x10000, "mtbios", 0 ) \
661661   ROM_LOAD( "epr12664.20", 0x000000, 0x8000, CRC(f71e9526) SHA1(1c7887541d02c41426992d17f8e3db9e03975953) ) \
662662
663663/* no games */
src/mame/drivers/warriorb.c
r3232r3233
164164                          SOUND
165165***********************************************************/
166166
167static INT32 banknum = -1;
167static INT32 banknum;
168168
169169static void reset_sound_region(running_machine *machine)
170170{
r3232r3233
703703
704704static MACHINE_RESET( taito_dualscreen )
705705{
706   banknum = -1;
707
706708   /**** mixer control enable ****/
707709   sound_global_enable( 1 );   /* mixer enabled */
708710}
src/mame/drivers/igs_blit.c
r3232r3233
351351{                                                                  \
352352   int i;                                                            \
353353   UINT16 ret=0;                                                      \
354   static const char *dipnames[] = { "DSW1", "DSW2", "DSW3", "DSW4", "DSW5" };         \
354   static const char *const dipnames[] = { "DSW1", "DSW2", "DSW3", "DSW4", "DSW5" };   \
355355                                                                  \
356356   for (i = 0; i < NUM; i++)                                             \
357357      if ((~igs_dips_sel) & (1 << i) )                                    \
src/mame/drivers/poolshrk.c
r3232r3233
7171
7272static READ8_HANDLER( poolshrk_input_r )
7373{
74   static const char *portnames[] = { "IN0", "IN1", "IN2", "IN3" };
74   static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" };
7575   UINT8 val = input_port_read(machine, portnames[offset & 3]);
7676
7777   int x = input_port_read(machine, (offset & 1) ? "AN1" : "AN0");
src/mame/drivers/alg.c
r3232r3233
126126
127127static void vsync_callback(void)
128128{
129   /* only clock the disc every other frame */
130   laserdisc_vsync(laserdisc);
131
132129   /* if we have data available, set a timer to read it */
133130   if (!serial_timer_active && laserdisc_line_r(laserdisc, LASERDISC_LINE_DATA_AVAIL) == ASSERT_LINE)
134131   {
r3232r3233
400397   MDRV_MACHINE_RESET(alg)
401398   MDRV_NVRAM_HANDLER(generic_0fill)
402399
403   MDRV_LASERDISC_ADD("laserdisc", SONY_LDP1450)
400   MDRV_LASERDISC_ADD("laserdisc", SONY_LDP1450, "main", "ldsound")
404401   MDRV_LASERDISC_OVERLAY(amiga, 512*2, 262, BITMAP_FORMAT_INDEXED16)
405402   MDRV_LASERDISC_OVERLAY_CLIP((129-8)*2, (449+8-1)*2, 44-8, 244+8-1)
406403
r3232r3233
425422   MDRV_SOUND_ROUTE(2, "right", 0.25)
426423   MDRV_SOUND_ROUTE(3, "left", 0.25)
427424
428   MDRV_SOUND_ADD("laserdisc", CUSTOM, 0)
425   MDRV_SOUND_ADD("ldsound", CUSTOM, 0)
429426   MDRV_SOUND_CONFIG(laserdisc_custom_interface)
430427   MDRV_SOUND_ROUTE(0, "left", 1.0)
431428   MDRV_SOUND_ROUTE(1, "right", 1.0)
r3232r3233
663660
664661   /* set up memory */
665662   memory_configure_bank(1, 0, 1, amiga_chip_ram, 0);
666   memory_configure_bank(1, 1, 1, memory_region(Machine, "user1"), 0);
663   memory_configure_bank(1, 1, 1, memory_region(machine, "user1"), 0);
667664}
668665
669666
src/mame/drivers/gridlee.c
r3232r3233
172172{
173173   int delta, sign, magnitude;
174174   UINT8 newval;
175   static const char *portnames[] = { "TRACK0_Y", "TRACK0_X", "TRACK1_Y", "TRACK1_X" };
175   static const char *const portnames[] = { "TRACK0_Y", "TRACK0_X", "TRACK1_Y", "TRACK1_X" };
176176
177177   /* first read the new trackball value and compute the signed delta */
178178   newval = input_port_read(machine, portnames[offset + 2 * gridlee_cocktail_flip]);
src/mame/drivers/arcadia.c
r3232r3233
631631 *
632632 *************************************/
633633
634INLINE void generic_decode(const char *tag, int bit7, int bit6, int bit5, int bit4, int bit3, int bit2, int bit1, int bit0)
634INLINE void generic_decode(running_machine *machine, const char *tag, int bit7, int bit6, int bit5, int bit4, int bit3, int bit2, int bit1, int bit0)
635635{
636   UINT16 *rom = (UINT16 *)memory_region(Machine, tag);
636   UINT16 *rom = (UINT16 *)memory_region(machine, tag);
637637   int i;
638638
639639   /* only the low byte of ROMs are encrypted in these games */
r3232r3233
671671
672672   /* set up memory */
673673   memory_configure_bank(1, 0, 1, amiga_chip_ram, 0);
674   memory_configure_bank(1, 1, 1, memory_region(Machine, "user1"), 0);
674   memory_configure_bank(1, 1, 1, memory_region(machine, "user1"), 0);
675675
676676   /* OnePlay bios is encrypted, TenPlay is not */
677   biosrom = (UINT16 *)memory_region(Machine, "user2");
677   biosrom = (UINT16 *)memory_region(machine, "user2");
678678   if (biosrom[0] != 0x4afc)
679      generic_decode("user2", 6, 1, 0, 2, 3, 4, 5, 7);
679      generic_decode(machine, "user2", 6, 1, 0, 2, 3, 4, 5, 7);
680680}
681681
682682
r3232r3233
688688 *************************************/
689689
690690static DRIVER_INIT( none )  {                                                arcadia_init(machine); }
691static DRIVER_INIT( airh )  { generic_decode("user3", 5, 0, 2, 4, 7, 6, 1, 3); arcadia_init(machine); }
692static DRIVER_INIT( bowl )  { generic_decode("user3", 7, 6, 0, 1, 2, 3, 4, 5); arcadia_init(machine); }
693static DRIVER_INIT( dart )  { generic_decode("user3", 4, 0, 7, 6, 3, 1, 2, 5); arcadia_init(machine); }
694static DRIVER_INIT( ldrba ) { generic_decode("user3", 2, 3, 4, 1, 0, 7, 5, 6); arcadia_init(machine); }
695static DRIVER_INIT( ninj )  { generic_decode("user3", 1, 6, 5, 7, 4, 2, 0, 3); arcadia_init(machine); }
696static DRIVER_INIT( rdwr )  { generic_decode("user3", 3, 1, 6, 4, 0, 5, 2, 7); arcadia_init(machine); }
697static DRIVER_INIT( sdwr )  { generic_decode("user3", 6, 3, 4, 5, 2, 1, 0, 7); arcadia_init(machine); }
698static DRIVER_INIT( socc )  { generic_decode("user3", 0, 7, 1, 6, 5, 4, 3, 2); arcadia_init(machine); }
699static DRIVER_INIT( sprg )  { generic_decode("user3", 4, 7, 3, 0, 6, 5, 2, 1); arcadia_init(machine); }
700static DRIVER_INIT( xeon )  { generic_decode("user3", 3, 1, 2, 4, 0, 5, 6, 7); arcadia_init(machine); }
691static DRIVER_INIT( airh )  { generic_decode(machine, "user3", 5, 0, 2, 4, 7, 6, 1, 3); arcadia_init(machine); }
692static DRIVER_INIT( bowl )  { generic_decode(machine, "user3", 7, 6, 0, 1, 2, 3, 4, 5); arcadia_init(machine); }
693static DRIVER_INIT( dart )  { generic_decode(machine, "user3", 4, 0, 7, 6, 3, 1, 2, 5); arcadia_init(machine); }
694static DRIVER_INIT( ldrba ) { generic_decode(machine, "user3", 2, 3, 4, 1, 0, 7, 5, 6); arcadia_init(machine); }
695static DRIVER_INIT( ninj )  { generic_decode(machine, "user3", 1, 6, 5, 7, 4, 2, 0, 3); arcadia_init(machine); }
696static DRIVER_INIT( rdwr )  { generic_decode(machine, "user3", 3, 1, 6, 4, 0, 5, 2, 7); arcadia_init(machine); }
697static DRIVER_INIT( sdwr )  { generic_decode(machine, "user3", 6, 3, 4, 5, 2, 1, 0, 7); arcadia_init(machine); }
698static DRIVER_INIT( socc )  { generic_decode(machine, "user3", 0, 7, 1, 6, 5, 4, 3, 2); arcadia_init(machine); }
699static DRIVER_INIT( sprg )  { generic_decode(machine, "user3", 4, 7, 3, 0, 6, 5, 2, 1); arcadia_init(machine); }
700static DRIVER_INIT( xeon )  { generic_decode(machine, "user3", 3, 1, 2, 4, 0, 5, 6, 7); arcadia_init(machine); }
701701
702702
703703
src/mame/drivers/galaga.c
r3232r3233
17051705   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
17061706
17071707   /* discrete circuit on the 54XX outputs */
1708   MDRV_SOUND_ADD("Discrete", DISCRETE, 0)
1708   MDRV_SOUND_ADD("discrete", DISCRETE, 0)
17091709   MDRV_SOUND_CONFIG_DISCRETE(bosco)
17101710   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
17111711MACHINE_DRIVER_END
r3232r3233
17601760   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90 * 10.0 / 16.0)
17611761
17621762   /* discrete circuit on the 54XX outputs */
1763   MDRV_SOUND_ADD("Discrete", DISCRETE, 0)
1763   MDRV_SOUND_ADD("discrete", DISCRETE, 0)
17641764   MDRV_SOUND_CONFIG_DISCRETE(galaga)
17651765   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
17661766MACHINE_DRIVER_END
r3232r3233
17761776   MDRV_CPU_PROGRAM_MAP(readmem4_galaga,writemem4_galaga)
17771777
17781778   /* sound hardware */
1779   MDRV_SOUND_REMOVE("Discrete")
1779   MDRV_SOUND_REMOVE("discrete")
17801780MACHINE_DRIVER_END
17811781
17821782
r3232r3233
18331833   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90 * 10.0 / 16.0)
18341834
18351835   /* discrete circuit on the 54XX outputs */
1836   MDRV_SOUND_ADD("Discrete", DISCRETE, 0)
1836   MDRV_SOUND_ADD("discrete", DISCRETE, 0)
18371837   MDRV_SOUND_CONFIG_DISCRETE(galaga)
18381838   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
18391839MACHINE_DRIVER_END
r3232r3233
18561856   MDRV_PALETTE_INIT(battles)
18571857
18581858   /* sound hardware */
1859   MDRV_SOUND_REMOVE("Discrete")
1859   MDRV_SOUND_REMOVE("discrete")
18601860
18611861   MDRV_SOUND_ADD("samples", SAMPLES, 0)
18621862   MDRV_SOUND_CONFIG(battles_samples_interface)
src/mame/drivers/panicr.c
r3232r3233
393393   ROM_LOAD16_BYTE("2.19m",   0x0f0000, 0x08000, CRC(3d48b0b5) SHA1(a6e8b38971a8964af463c16f32bb7dbd301dd314) )
394394   ROM_LOAD16_BYTE("1.19n",   0x0f0001, 0x08000, CRC(674131b9) SHA1(63499cd5ad39e79e70f3ba7060680f0aa133f095) )
395395
396   ROM_REGION( 0x10000, "T5182", 0 ) /* Toshiba T5182 module */
396   ROM_REGION( 0x10000, "t5182", 0 ) /* Toshiba T5182 module */
397397   ROM_LOAD( "t5182.rom", 0x0000, 0x2000, CRC(d354c8fc) SHA1(a1c9e1ac293f107f69cc5788cf6abc3db1646e33) )
398398   ROM_LOAD( "22d.bin",   0x8000, 0x8000, CRC(eb1a46e1) SHA1(278859ae4bca9f421247e646d789fa1206dcd8fc) )
399399
src/mame/drivers/istellar.c
r3232r3233
315315
316316   /* Interrupt presumably comes from the LDP's status strobe */
317317   cpunum_set_input_line(machine, 2, 0, ASSERT_LINE);
318
319   /* Only do the LDP's sync once */
320   if (cpunum == 0)
321      laserdisc_vsync(laserdisc);
322318}
323319
324320
r3232r3233
342338
343339   MDRV_MACHINE_START(istellar)
344340
345   MDRV_LASERDISC_ADD("laserdisc", PIONEER_LDV1000)
341   MDRV_LASERDISC_ADD("laserdisc", PIONEER_LDV1000, "main", "ldsound")
346342   MDRV_LASERDISC_OVERLAY(istellar, 256, 256, BITMAP_FORMAT_INDEXED16)
347343
348344   /* video hardware */
r3232r3233
356352   /* sound hardware */
357353   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
358354
359   MDRV_SOUND_ADD("laserdisc", CUSTOM, 0)
355   MDRV_SOUND_ADD("ldsound", CUSTOM, 0)
360356   MDRV_SOUND_CONFIG(laserdisc_custom_interface)
361357   MDRV_SOUND_ROUTE(0, "left", 1.0)
362358   MDRV_SOUND_ROUTE(1, "right", 1.0)
src/mame/drivers/nbmj8688.c
r3232r3233
29582958   MDRV_SCREEN_SIZE(512, 256)
29592959   MDRV_SCREEN_VISIBLE_AREA(0, 512-1, 16, 240-1)
29602960
2961   MDRV_SCREEN_ADD("LCD0", RASTER)
2961   MDRV_SCREEN_ADD("lcd0", RASTER)
29622962   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
29632963   MDRV_SCREEN_REFRESH_RATE(60)
29642964   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
29652965   MDRV_SCREEN_SIZE(480, 64)
29662966   MDRV_SCREEN_VISIBLE_AREA(0, 480-1, 0, 64-1)
29672967
2968   MDRV_SCREEN_ADD("LCD1", RASTER)
2968   MDRV_SCREEN_ADD("lcd1", RASTER)
29692969   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
29702970   MDRV_SCREEN_REFRESH_RATE(60)
29712971   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
src/mame/drivers/taito_h.c
r3232r3233
236236}
237237
238238
239static INT32 banknum = -1;
239static INT32 banknum;
240240
241241static void reset_sound_region(running_machine *machine)
242242{
r3232r3233
564564   reset_sound_region(machine);
565565}
566566
567static MACHINE_RESET( taitoh )
568{
569   banknum = -1;
570}
571
567572static MACHINE_START( taitoh )
568573{
569574   state_save_register_global(banknum);
r3232r3233
582587   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
583588
584589   MDRV_MACHINE_START(taitoh)
590   MDRV_MACHINE_RESET(taitoh)
585591
586592   MDRV_INTERLEAVE(10)
587593
r3232r3233
621627   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
622628
623629   MDRV_MACHINE_START(taitoh)
630   MDRV_MACHINE_RESET(taitoh)
624631
625632   MDRV_INTERLEAVE(10)
626633
r3232r3233
660667   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
661668
662669   MDRV_MACHINE_START(taitoh)
670   MDRV_MACHINE_RESET(taitoh)
663671
664672   MDRV_INTERLEAVE(10)
665673
src/mame/drivers/othunder.c
r3232r3233
433433            SOUND
434434*****************************************/
435435
436static INT32 banknum = -1;
436static INT32 banknum;
437437
438438static void reset_sound_region(running_machine *machine)
439439{
r3232r3233
447447
448448static MACHINE_START( othunder )
449449{
450   banknum = -1;
450451   state_save_register_global(banknum);
451452   state_save_register_postload(machine, othunder_postload, NULL);
452453}
src/mame/drivers/slapshot.c
r3232r3233
211211
212212static READ16_HANDLER( opwolf3_adc_r )
213213{
214   static const char *adcnames[] = { "GUN1X", "GUN1Y", "GUN2X", "GUN2Y" };
214   static const char *const adcnames[] = { "GUN1X", "GUN1Y", "GUN2X", "GUN2Y" };
215215
216216   return input_port_read(machine, adcnames[offset]) << 8;
217217}
r3232r3233
226226                SOUND
227227*****************************************************/
228228
229static INT32 banknum = -1;
229static INT32 banknum;
230230
231231static void reset_sound_region(running_machine *machine)
232232{
r3232r3233
240240
241241static MACHINE_START( slapshot )
242242{
243   banknum = -1;
243244   state_save_register_global(banknum);
244245   state_save_register_postload(machine, slapshot_postload, NULL);
245246}
src/mame/drivers/pacland.c
r3232r3233
209209{
210210   int shift = 4 * (offset & 1);
211211   int port = offset & 2;
212   static const char *portnames[] = { "DSWA", "DSWB", "IN0", "IN1" };
212   static const char *const portnames[] = { "DSWA", "DSWB", "IN0", "IN1" };
213213   int r = (input_port_read(machine, portnames[port]) << shift) & 0xf0;
214214   r |= (input_port_read(machine, portnames[port+1]) >> (4-shift)) & 0x0f;
215215
src/mame/drivers/sidearms.c
r3232r3233
7474static READ8_HANDLER( turtship_ports_r )
7575{
7676   int i,res;
77   static const char *portnames[] = { "SYSTEM", "P1", "P2", "DSW0", "DSW1", "NOT_PRESENT", "NOT_PRESENT", "NOT_PRESENT" };   // only inputs 0-4 are present
77   static const char *const portnames[] = { "SYSTEM", "P1", "P2", "DSW0", "DSW1", "NOT_PRESENT", "NOT_PRESENT", "NOT_PRESENT" };   // only inputs 0-4 are present
7878
7979   res = 0;
8080   for (i = 0;i < 8;i++)
r3232r3233
226226   AM_RANGE(0xf800, 0xffff) AM_WRITE(SMH_RAM)
227227ADDRESS_MAP_END
228228
229static ADDRESS_MAP_START( whizz_readport, ADDRESS_SPACE_IO, 8 )
229static ADDRESS_MAP_START( whizz_io_map, ADDRESS_SPACE_IO, 8 )
230230   ADDRESS_MAP_GLOBAL_MASK(0xff)
231   AM_RANGE(0x01, 0x01) AM_READ(ym2151_status_port_0_r)
232   AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_r)
233ADDRESS_MAP_END
234
235static ADDRESS_MAP_START( whizz_writeport, ADDRESS_SPACE_IO, 8 )
236   ADDRESS_MAP_GLOBAL_MASK(0xff)
237231   AM_RANGE(0x00, 0x00) AM_WRITE(ym2151_register_port_0_w)
238   AM_RANGE(0x01, 0x01) AM_WRITE(ym2151_data_port_0_w)
232   AM_RANGE(0x01, 0x01) AM_READWRITE(ym2151_status_port_0_r, ym2151_data_port_0_w)
239233   AM_RANGE(0x40, 0x40) AM_WRITE(SMH_NOP)
234   AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_r)
240235ADDRESS_MAP_END
241236
242237
r3232r3233
814809
815810   MDRV_CPU_ADD("audio", Z80, 4000000)
816811   MDRV_CPU_PROGRAM_MAP(whizz_sound_readmem,whizz_sound_writemem)
817   MDRV_CPU_IO_MAP(whizz_readport,whizz_writeport)
812   MDRV_CPU_IO_MAP(whizz_io_map,0)
818813   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
819814
820815   MDRV_INTERLEAVE(1000)
r3232r3233
12281223GAME( 1989, whizz,    twinfalc, whizz,    whizz,    whizz,    ROT0,   "Philko", "Whizz", 0 )
12291224
12301225
1226
src/mame/drivers/taito_x.c
r3232r3233
393393
394394/**************************************************************************/
395395
396static INT32 banknum = -1;
396static INT32 banknum;
397397
398398static void reset_sound_region(running_machine *machine)
399399{
r3232r3233
986986
987987static MACHINE_START( taitox )
988988{
989   banknum = -1;
989990   state_save_register_global(banknum);
990991   state_save_register_postload(machine, taitox_postload, NULL);
991992}
src/mame/drivers/jack.c
r3232r3233
193193   AM_RANGE(0x6000, 0x6fff) AM_WRITE(SMH_NOP)  /* R/C filter ??? */
194194ADDRESS_MAP_END
195195
196
197static ADDRESS_MAP_START( sound_readport, ADDRESS_SPACE_IO, 8 )
196static ADDRESS_MAP_START( sound_io_map, ADDRESS_SPACE_IO, 8 )
198197   ADDRESS_MAP_GLOBAL_MASK(0xff)
199   AM_RANGE(0x40, 0x40) AM_READ(ay8910_read_port_0_r)
200ADDRESS_MAP_END
201
202static ADDRESS_MAP_START( sound_writeport, ADDRESS_SPACE_IO, 8 )
203   ADDRESS_MAP_GLOBAL_MASK(0xff)
198   AM_RANGE(0x40, 0x40) AM_READWRITE(ay8910_read_port_0_r, ay8910_write_port_0_w)
204199   AM_RANGE(0x80, 0x80) AM_WRITE(ay8910_control_port_0_w)
205   AM_RANGE(0x40, 0x40) AM_WRITE(ay8910_write_port_0_w)
206200ADDRESS_MAP_END
207201
208202
r3232r3233
866860
867861   MDRV_CPU_ADD("audio", Z80,18000000/12)   /* 1.5 MHz */
868862   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
869   MDRV_CPU_IO_MAP(sound_readport,sound_writeport)
863   MDRV_CPU_IO_MAP(sound_io_map,0)
870864
871865   /* video hardware */
872866   MDRV_SCREEN_ADD("main", RASTER)
r3232r3233
13371331ROM_END
13381332
13391333
1340static void treahunt_decode(void)
1334static void treahunt_decode(running_machine *machine)
13411335{
13421336   int A;
1343   UINT8 *rom = memory_region(Machine, "main");
1337   UINT8 *rom = memory_region(machine, "main");
13441338   UINT8 *decrypt = auto_malloc(0x4000);
13451339   int data;
13461340
r3232r3233
13891383static DRIVER_INIT( treahunt )
13901384{
13911385   timer_rate = 128;
1392   treahunt_decode();
1386   treahunt_decode(machine);
13931387}
13941388
13951389static DRIVER_INIT( zzyzzyxx )
r3232r3233
14631457GAME( 1986, joinem,   0,        joinem,  joinem,   zzyzzyxx, ROT90, "Global Corporation", "Joinem", 0 )
14641458GAME( 1983, loverboy, 0,        loverboy,loverboy, loverboy, ROT90, "G.T Enterprise Inc", "Lover Boy", 0 )
14651459GAME( 1985, striv,    0,        jack,    striv,    striv,    ROT270,"Hara Industries", "Super Triv", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_COLORS )
1460
src/mame/drivers/tsamurai.c
r3232r3233
225225   AM_RANGE(0xfc07, 0xfc07) AM_WRITE(tsamurai_textbank2_w)/* Mission 660 uses a bit here */
226226ADDRESS_MAP_END
227227
228static ADDRESS_MAP_START( z80_readport, ADDRESS_SPACE_IO, 8 )
228static ADDRESS_MAP_START( z80_io_map, ADDRESS_SPACE_IO, 8 )
229229   ADDRESS_MAP_GLOBAL_MASK(0xff)
230   AM_RANGE(0x00, 0x00) AM_WRITE(ay8910_control_port_0_w)
231   AM_RANGE(0x01, 0x01) AM_WRITE(ay8910_write_port_0_w)
230232ADDRESS_MAP_END
231233
232static ADDRESS_MAP_START( z80_writeport, ADDRESS_SPACE_IO, 8 )
234static ADDRESS_MAP_START( z80_m660_io_map, ADDRESS_SPACE_IO, 8 )
233235   ADDRESS_MAP_GLOBAL_MASK(0xff)
234   AM_RANGE(0x00, 0x00) AM_WRITE(ay8910_control_port_0_w)
235   AM_RANGE(0x01, 0x01) AM_WRITE(ay8910_write_port_0_w)
236   AM_RANGE(0x00, 0x00) AM_WRITE(SMH_NOP)      /* ? */
237   AM_RANGE(0x01, 0x01) AM_WRITE(SMH_NOP)      /* Written continuously. Increments with level. */
238   AM_RANGE(0x02, 0x02) AM_WRITE(SMH_NOP)      /* Always follows above with 0x01 data */
236239ADDRESS_MAP_END
237240
238static ADDRESS_MAP_START( z80_writeport_m660, ADDRESS_SPACE_IO, 8 )
241static ADDRESS_MAP_START( vsgongf_audio_io_map, ADDRESS_SPACE_IO, 8 )
239242   ADDRESS_MAP_GLOBAL_MASK(0xff)
240   AM_RANGE(0x00, 0x00) AM_WRITE(SMH_NOP)             /* ? */
241   AM_RANGE(0x01, 0x01) AM_WRITE(SMH_NOP)               /* Written continuously. Increments with level. */
242   AM_RANGE(0x02, 0x02) AM_WRITE(SMH_NOP)               /* Always follows above with 0x01 data */
243   AM_RANGE(0x00, 0x00) AM_WRITE(ay8910_control_port_0_w)
244   AM_RANGE(0x01, 0x01) AM_WRITE(ay8910_write_port_0_w)
243245ADDRESS_MAP_END
244246
245247static READ8_HANDLER( sound_command1_r )
r3232r3233
326328
327329/*******************************************************************************/
328330
329static ADDRESS_MAP_START( readport_sound3_m660, ADDRESS_SPACE_IO, 8 )
331static ADDRESS_MAP_START( sound3_m660_io_map, ADDRESS_SPACE_IO, 8 )
330332   ADDRESS_MAP_GLOBAL_MASK(0xff)
331ADDRESS_MAP_END
332
333static ADDRESS_MAP_START( writeport_sound3_m660, ADDRESS_SPACE_IO, 8 )
334   ADDRESS_MAP_GLOBAL_MASK(0xff)
335333   AM_RANGE(0x00, 0x00) AM_WRITE(ay8910_control_port_0_w)
336334   AM_RANGE(0x01, 0x01) AM_WRITE(ay8910_write_port_0_w)
337335ADDRESS_MAP_END
r3232r3233
735733   /* basic machine hardware */
736734   MDRV_CPU_ADD("main", Z80, 4000000)
737735   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
738   MDRV_CPU_IO_MAP(z80_readport,z80_writeport)
736   MDRV_CPU_IO_MAP(z80_io_map,0)
739737   MDRV_CPU_VBLANK_INT("main", samurai_interrupt)
740738
741739   MDRV_CPU_ADD("audio", Z80, 2000000)
r3232r3233
778776   /* basic machine hardware */
779777   MDRV_CPU_ADD("main", Z80, 4000000)
780778   MDRV_CPU_PROGRAM_MAP(readmem_m660,writemem_m660)
781   MDRV_CPU_IO_MAP(z80_readport,z80_writeport_m660)
779   MDRV_CPU_IO_MAP(z80_m660_io_map,0)
782780   MDRV_CPU_VBLANK_INT("main", samurai_interrupt)
783781
784782   MDRV_CPU_ADD("audio", Z80, 2000000)
r3232r3233
789787
790788   MDRV_CPU_ADD("audio3", Z80, 2000000)
791789   MDRV_CPU_PROGRAM_MAP(readmem_sound3_m660,writemem_sound3_m660)
792   MDRV_CPU_IO_MAP(readport_sound3_m660,writeport_sound3_m660)
790   MDRV_CPU_IO_MAP(sound3_m660_io_map,0)
793791   MDRV_CPU_VBLANK_INT("main", nmi_line_pulse)
794792
795793   /* video hardware */
r3232r3233
830828
831829   MDRV_CPU_ADD("audio", Z80, 4000000)
832830   MDRV_CPU_PROGRAM_MAP(readmem_sound_vsgongf,writemem_sound_vsgongf)
833   MDRV_CPU_IO_MAP(0,z80_writeport)
831   MDRV_CPU_IO_MAP(vsgongf_audio_io_map,0)
834832   MDRV_CPU_VBLANK_INT_HACK(vsgongf_sound_interrupt,3)
835833
836834   /* video hardware */
r3232r3233
12731271GAME( 1986, m660j,    m660,     m660,     m660,     0, ROT90, "[Woodplace Inc.] Taito Corporation", "Mission 660 (Japan)", 0 )
12741272GAME( 1986, m660b,    m660,     m660,     m660,     0, ROT90, "bootleg", "Mission 660 (bootleg)", 0 )
12751273GAME( 1986, alphaxz,  m660,     m660,     m660,     0, ROT90, "Ed / Woodplace Inc.", "The Alphax Z (Japan)", 0 )
1274
1275
src/mame/drivers/tx1.c
r3232r3233
740740   MDRV_VIDEO_START(tx1)
741741   MDRV_VIDEO_UPDATE(tx1)
742742
743   MDRV_SPEAKER_STANDARD_STEREO("Front Left", "Front Right")
744//  MDRV_SPEAKER_STANDARD_STEREO("Rear Left", "Rear Right")
743   MDRV_SPEAKER_STANDARD_STEREO("frontleft", "frontright")
744//  MDRV_SPEAKER_STANDARD_STEREO("rearleft", "rearright")
745745
746746   MDRV_SOUND_ADD("ay", AY8910, TX1_PIXEL_CLOCK / 8)
747747   MDRV_SOUND_CONFIG(tx1_ay8910_interface)
748   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "Front Left", 0.1)
749   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "Front Right", 0.1)
748   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "frontleft", 0.1)
749   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "frontright", 0.1)
750750
751751   MDRV_SOUND_ADD("tx1", CUSTOM, 0)
752752   MDRV_SOUND_CONFIG(tx1_custom_interface)
753   MDRV_SOUND_ROUTE(0, "Front Left", 0.2)
754   MDRV_SOUND_ROUTE(1, "Front Right", 0.2)
753   MDRV_SOUND_ROUTE(0, "frontleft", 0.2)
754   MDRV_SOUND_ROUTE(1, "frontright", 0.2)
755755MACHINE_DRIVER_END
756756
757757
r3232r3233
795795   MDRV_VIDEO_START(buggyboy)
796796   MDRV_VIDEO_UPDATE(buggyboy)
797797
798   MDRV_SPEAKER_STANDARD_STEREO("Front Left", "Front Right")
799//  MDRV_SPEAKER_STANDARD_STEREO("Rear Left", "Rear Right")
798   MDRV_SPEAKER_STANDARD_STEREO("frontleft", "frontright")
799//  MDRV_SPEAKER_STANDARD_STEREO("rearleft", "rearright")
800800
801801   MDRV_SOUND_ADD("ym1", YM2149, BUGGYBOY_ZCLK / 4)
802802   MDRV_SOUND_CONFIG(buggyboy_ym2149_interface_1)
803   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "Front Left", 0.15)
803   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "frontleft", 0.15)
804804
805805   MDRV_SOUND_ADD("ym2", YM2149, BUGGYBOY_ZCLK / 4)
806806   MDRV_SOUND_CONFIG(buggyboy_ym2149_interface_2)
807   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "Front Right", 0.15)
807   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "frontright", 0.15)
808808
809809   MDRV_SOUND_ADD("buggyboy", CUSTOM, 0)
810810   MDRV_SOUND_CONFIG(bb_custom_interface)
811   MDRV_SOUND_ROUTE(0, "Front Left", 0.2)
812   MDRV_SOUND_ROUTE(1, "Front Right", 0.2)
811   MDRV_SOUND_ROUTE(0, "frontleft", 0.2)
812   MDRV_SOUND_ROUTE(1, "frontright", 0.2)
813813MACHINE_DRIVER_END
814814
815815
r3232r3233
848848   MDRV_VIDEO_UPDATE(buggybjr)
849849   MDRV_VIDEO_EOF(buggyboy)
850850
851   MDRV_SPEAKER_STANDARD_STEREO("Front Left", "Front Right")
852//  MDRV_SPEAKER_STANDARD_STEREO("Rear Left", "Rear Right")
851   MDRV_SPEAKER_STANDARD_STEREO("frontleft", "frontright")
852//  MDRV_SPEAKER_STANDARD_STEREO("rearleft", "rearright")
853853
854854   MDRV_SOUND_ADD("ym1", YM2149, BUGGYBOY_ZCLK / 4)
855855   MDRV_SOUND_CONFIG(buggyboy_ym2149_interface_1)
856   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "Front Left", 0.15)
856   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "frontleft", 0.15)
857857
858858   MDRV_SOUND_ADD("ym2", YM2149, BUGGYBOY_ZCLK / 4)
859859   MDRV_SOUND_CONFIG(buggyboy_ym2149_interface_2)
860   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "Front Right", 0.15)
860   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "frontright", 0.15)
861861
862862   MDRV_SOUND_ADD("buggyboy", CUSTOM, 0)
863863   MDRV_SOUND_CONFIG(bb_custom_interface)
864   MDRV_SOUND_ROUTE(0, "Front Left", 0.2)
865   MDRV_SOUND_ROUTE(1, "Front Right", 0.2)
864   MDRV_SOUND_ROUTE(0, "frontleft", 0.2)
865   MDRV_SOUND_ROUTE(1, "frontright", 0.2)
866866MACHINE_DRIVER_END
867867
868868/*************************************
src/mame/drivers/thayers.c
r3232r3233
747747   device_set_info_int(laserdisc, LDINFO_INT_TYPE, newtype);
748748}
749749
750static INTERRUPT_GEN( vblank_callback_thayers )
751{
752   laserdisc_vsync(laserdisc);
753}
754
755750/* COP400 Interface */
756751
757752static COP400_INTERFACE( thayers_cop_intf )
r3232r3233
768763   MDRV_CPU_ADD("main", Z80, XTAL_4MHz)
769764   MDRV_CPU_PROGRAM_MAP(thayers_map, 0)
770765   MDRV_CPU_IO_MAP(thayers_io_map, 0)
771   MDRV_CPU_VBLANK_INT("main", vblank_callback_thayers)
772766
773767   MDRV_CPU_ADD("mcu", COP421, XTAL_4MHz/2) // COP421L-PCA/N
774768   MDRV_CPU_PROGRAM_MAP(thayers_cop_map, 0)
r3232r3233
778772   MDRV_MACHINE_START(thayers)
779773   MDRV_MACHINE_RESET(thayers)
780774
781   MDRV_LASERDISC_ADD("laserdisc", PIONEER_PR7820)
775   MDRV_LASERDISC_ADD("laserdisc", PIONEER_PR7820, "main", "ldsound")
782776
783777   /* video hardware */
784778   MDRV_LASERDISC_SCREEN_ADD_NTSC("main", BITMAP_FORMAT_RGB32)
r3232r3233
786780   MDRV_PALETTE_LENGTH(256)
787781
788782   /* sound hardware */
783   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
789784   // SSI 263 @ 2MHz
785
786   MDRV_SOUND_ADD("ldsound", CUSTOM, 0)
787   MDRV_SOUND_CONFIG(laserdisc_custom_interface)
788   MDRV_SOUND_ROUTE(0, "left", 1.0)
789   MDRV_SOUND_ROUTE(1, "right", 1.0)
790790MACHINE_DRIVER_END
791791
792792/* ROMs */
src/mame/drivers/ssrj.c
r3232r3233
4545VIDEO_UPDATE( ssrj );
4646PALETTE_INIT( ssrj );
4747
48static int oldport=0x80;
48static int oldport;
4949
5050static MACHINE_RESET(ssrj)
5151{
src/mame/drivers/blstroid.c
r3232r3233
6262
6363static READ16_HANDLER( inputs_r )
6464{
65   static const char *iptnames[] = { "IN0", "IN1" };
65   static const char *const iptnames[] = { "IN0", "IN1" };
6666   int temp = input_port_read(machine, iptnames[offset & 1]);
6767
6868   if (atarigen_cpu_to_sound_ready) temp ^= 0x0040;
src/mame/drivers/tatsumi.c
r3232r3233
167167
168168static READ16_HANDLER(cyclwarr_input_r)
169169{
170   static const char *port[] = { "SERVICE", "P1", "P2", "DSW3" };
170   static const char *const port[] = { "SERVICE", "P1", "P2", "DSW3" };
171171   return input_port_read(machine, port[offset]);
172172}
173173
174174static READ16_HANDLER(cyclwarr_input2_r)
175175{
176   static const char *port2[] = { "DSW1", "DSW2", "P3", "P4" };
176   static const char *const port2[] = { "DSW1", "DSW2", "P3", "P4" };
177177   return input_port_read(machine, port2[offset]);
178178}
179179
src/mame/drivers/megaplay.c
r3232r3233
561561
562562static READ8_HANDLER( bank_r )
563563{
564   UINT8* bank = memory_region(machine, "megaplay_bios");
564   UINT8* bank = memory_region(machine, "mpbios");
565565   UINT8* game = memory_region(machine, "main");
566566
567567   if(game_banksel == 0x142) // Genesis I/O
r3232r3233
789789
790790   /* The Megaplay has an extra BIOS cpu which drives an SMS VDP
791791       which includes an SN76496 for sound */
792   MDRV_CPU_ADD("megaplay_bios", Z80, MASTER_CLOCK / 15) /* ?? */
792   MDRV_CPU_ADD("mpbios", Z80, MASTER_CLOCK / 15) /* ?? */
793793   MDRV_CPU_PROGRAM_MAP(megaplay_bios_readmem, megaplay_bios_writemem)
794794   MDRV_CPU_IO_MAP(megaplay_bios_io_map,0)
795795   MDRV_CPU_VBLANK_INT_HACK(megaplay_bios_irq, 262)
r3232r3233
822822
823823   ROM_REGION( 0x8000, "user1", ROMREGION_ERASEFF )
824824
825   ROM_REGION( 0x28000, "megaplay_bios", 0 ) /* Bios */
825   ROM_REGION( 0x28000, "mpbios", 0 ) /* Bios */
826826   MEGAPLAY_BIOS
827827ROM_END
828828
r3232r3233
835835   ROM_REGION( 0x8000, "user1", 0 ) /* Game Instructions */
836836   ROM_LOAD( "ep15175-01.ic3", 0x000000, 0x08000, CRC(99246889) SHA1(184aa3b7fdedcf578c5e34edb7ed44f57f832258) )
837837
838   ROM_REGION( 0x28000, "megaplay_bios", 0 ) /* Bios */
838   ROM_REGION( 0x28000, "mpbios", 0 ) /* Bios */
839839   MEGAPLAY_BIOS
840840ROM_END
841841
r3232r3233
851851   ROM_REGION( 0x8000, "user1", 0 ) /* Game Instructions */
852852   ROM_LOAD( "1.ic3", 0x000000, 0x08000,  CRC(dac9bf91) SHA1(0117972a7181f8aaf942a259cc8764b821031253) )
853853
854   ROM_REGION( 0x28000, "megaplay_bios", 0 ) /* Bios */
854   ROM_REGION( 0x28000, "mpbios", 0 ) /* Bios */
855855   MEGAPLAY_BIOS
856856ROM_END
857857
r3232r3233
864864   ROM_REGION( 0x8000, "user1", 0 ) /* Game Instructions */
865865   ROM_LOAD( "ep15175-02b.ic3", 0x000000, 0x08000, CRC(3039b653) SHA1(b19874c74d0fc0cca1169f62e5e74f0e8ca83679) ) // 15175-02b.ic3
866866
867   ROM_REGION( 0x28000, "megaplay_bios", 0 ) /* Bios */
867   ROM_REGION( 0x28000, "mpbios", 0 ) /* Bios */
868868   MEGAPLAY_BIOS
869869ROM_END
870870
r3232r3233
877877   ROM_REGION( 0x8000, "user1", 0 ) /* Game Instructions */
878878   ROM_LOAD( "epr-15175-03.ic3", 0x000000, 0x08000, CRC(70ea1aec) SHA1(0d9d82a1f8aa51d02707f7b343e7cfb6591efccd) ) // 15175-02b.ic3
879879
880   ROM_REGION( 0x28000, "megaplay_bios", 0 ) /* Bios */
880   ROM_REGION( 0x28000, "mpbios", 0 ) /* Bios */
881881   MEGAPLAY_BIOS
882882ROM_END
883883
r3232r3233
891891    ROM_REGION( 0x8000, "user1", 0 ) /* Game Instructions */
892892   ROM_LOAD( "ep15175-04.ic3", 0x000000, 0x08000, CRC(faf7c030) SHA1(16ef405335b4d3ecb0b7d97b088dafc4278d4726) )
893893
894    ROM_REGION( 0x28000, "megaplay_bios", 0 ) /* Bios */
894    ROM_REGION( 0x28000, "mpbios", 0 ) /* Bios */
895895    MEGAPLAY_BIOS
896896ROM_END
897897
r3232r3233
903903   ROM_REGION( 0x8000, "user1", 0 ) /* Game Instructions */
904904   ROM_LOAD( "epr-15175-05.ic2", 0x000000, 0x08000, CRC(1df5347c) SHA1(faced2e875e1914392f61577b5256d006eebeef9) )
905905
906   ROM_REGION( 0x28000, "megaplay_bios", 0 ) /* Bios */
906   ROM_REGION( 0x28000, "mpbios", 0 ) /* Bios */
907907   MEGAPLAY_BIOS
908908ROM_END
909909
r3232r3233
915915   ROM_REGION( 0x8000, "user1", 0 ) /* Game Instructions */
916916   ROM_LOAD( "epr-15175-06.ic2", 0x000000, 0x08000, CRC(1ef64e41) SHA1(13984b714b014ea41963b70de74a5358ed223bc5) )
917917
918   ROM_REGION( 0x28000, "megaplay_bios", 0 ) /* Bios */
918   ROM_REGION( 0x28000, "mpbios", 0 ) /* Bios */
919919   MEGAPLAY_BIOS
920920ROM_END
921921
r3232r3233
927927   ROM_REGION( 0x8000, "user1", 0 ) /* Game Instructions */
928928   ROM_LOAD( "epr-15175-07.ic1", 0x000000, 0x08000, CRC(bb5f67f0) SHA1(33b7a5d14015a5fcf41976a8f648f8f48ce9bb03) )
929929
930   ROM_REGION( 0x28000, "megaplay_bios", 0 ) /* Bios */
930   ROM_REGION( 0x28000, "mpbios", 0 ) /* Bios */
931931   MEGAPLAY_BIOS
932932ROM_END
933933
r3232r3233
939939   ROM_REGION( 0x8000, "user1", 0 ) /* Game Instructions */
940940   ROM_LOAD( "epr-15175-11.ic2", 0x000000, 0x08000, CRC(bb651120) SHA1(81cb736f2732373e260dde162249c1d29a3489c3) )
941941
942   ROM_REGION( 0x28000, "megaplay_bios", 0 ) /* Bios */
942   ROM_REGION( 0x28000, "mpbios", 0 ) /* Bios */
943943   MEGAPLAY_BIOS
944944ROM_END
945945
r3232r3233
951951   ROM_REGION( 0x8000, "user1", 0 ) /* Game Instructions */
952952   ROM_LOAD( "epr-15175-09.ic2", 0x000000, 0x08000, CRC(6254e45a) SHA1(8667922a6eade03c964ce224f7fa39ba871c60a4) )
953953
954   ROM_REGION( 0x28000, "megaplay_bios", 0 ) /* Bios */
954   ROM_REGION( 0x28000, "mpbios", 0 ) /* Bios */
955955   MEGAPLAY_BIOS
956956ROM_END
957957
958958
959959static void megplay_stat(running_machine *machine)
960960{
961   UINT8 *src = memory_region(machine, "megaplay_bios");
961   UINT8 *src = memory_region(machine, "mpbios");
962962   UINT8 *instruction_rom = memory_region(machine, "user1");
963963   UINT8 *game_rom = memory_region(machine, "main");
964964   int offs;
src/mame/drivers/srmp2.c
r3232r3233
288288    ---x xxxx : Key code
289289    --x- ---- : Player 1 and 2 side flag
290290*/
291   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3" };
291   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3" };
292292
293293   if (!ACCESSING_BITS_0_7)
294294   {
r3232r3233
512512   /* Currently I/O port of srmp3 is fully understood. */
513513
514514   int keydata = 0xff;
515   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3" };
515   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3" };
516516
517517   logerror("PC:%04X          srmp3_input_r\n", activecpu_get_pc());
518518
r3232r3233
582582   AM_RANGE(0xe000, 0xffff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram_3)
583583ADDRESS_MAP_END
584584
585static ADDRESS_MAP_START( srmp3_readport, ADDRESS_SPACE_IO, 8 )
585static ADDRESS_MAP_START( srmp3_io_map, ADDRESS_SPACE_IO, 8 )
586586   ADDRESS_MAP_GLOBAL_MASK(0xff)
587   AM_RANGE(0x40, 0x40) AM_READ_PORT("SYSTEM")                     /* coin, service */
588   AM_RANGE(0xa1, 0xa1) AM_READ(srmp3_cchip_status_0_r)            /* custom chip status ??? */
589   AM_RANGE(0xc0, 0xc0) AM_READ(srmp3_input_r)                  /* key matrix */
590   AM_RANGE(0xc1, 0xc1) AM_READ(srmp3_cchip_status_1_r)            /* custom chip status ??? */
591   AM_RANGE(0xe2, 0xe2) AM_READ(ay8910_read_port_0_r)
592ADDRESS_MAP_END
593
594static ADDRESS_MAP_START( srmp3_writeport, ADDRESS_SPACE_IO, 8 )
595   ADDRESS_MAP_GLOBAL_MASK(0xff)
596   AM_RANGE(0x20, 0x20) AM_WRITE(SMH_NOP)                     /* elapsed interrupt signal */
597   AM_RANGE(0x40, 0x40) AM_WRITE(srmp3_flags_w)                  /* GFX bank, counter, lockout */
598   AM_RANGE(0x60, 0x60) AM_WRITE(srmp3_rombank_w)               /* ROM bank select */
587   AM_RANGE(0x20, 0x20) AM_WRITE(SMH_NOP)                        /* elapsed interrupt signal */
588   AM_RANGE(0x40, 0x40) AM_READ_PORT("SYSTEM")   AM_WRITE(srmp3_flags_w)   /* coin, service | GFX bank, counter, lockout */
589   AM_RANGE(0x60, 0x60) AM_WRITE(srmp3_rombank_w)                  /* ROM bank select */
599590   AM_RANGE(0xa0, 0xa0) AM_WRITE(srmp3_adpcm_code_w)               /* ADPCM number */
600   AM_RANGE(0xc0, 0xc0) AM_WRITE(srmp3_input_1_w)               /* I/O ??? */
601   AM_RANGE(0xc1, 0xc1) AM_WRITE(srmp3_input_2_w)               /* I/O ??? */
591   AM_RANGE(0xa1, 0xa1) AM_READ(srmp3_cchip_status_0_r)            /* custom chip status ??? */
592   AM_RANGE(0xc0, 0xc0) AM_READWRITE(srmp3_input_r, srmp3_input_1_w)   /* key matrix | I/O ??? */
593   AM_RANGE(0xc1, 0xc1) AM_READWRITE(srmp3_cchip_status_1_r, srmp3_input_2_w)   /* custom chip status ??? | I/O ??? */
602594   AM_RANGE(0xe0, 0xe0) AM_WRITE(ay8910_control_port_0_w)
603595   AM_RANGE(0xe1, 0xe1) AM_WRITE(ay8910_write_port_0_w)
596   AM_RANGE(0xe2, 0xe2) AM_READ(ay8910_read_port_0_r)
604597ADDRESS_MAP_END
605598
606599
r3232r3233
11071100   MDRV_CPU_ADD("main", Z80, 3500000)      /* 3.50 MHz ? */
11081101   //      4000000,                /* 4.00 MHz ? */
11091102   MDRV_CPU_PROGRAM_MAP(srmp3_readmem,srmp3_writemem)
1110   MDRV_CPU_IO_MAP(srmp3_readport,srmp3_writeport)
1103   MDRV_CPU_IO_MAP(srmp3_io_map,0)
11111104   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
11121105
11131106   MDRV_MACHINE_RESET(srmp3)
r3232r3233
13761369GAME( 1990, mjyuugia,  mjyuugi,  mjyuugi,  mjyuugi,  0,       ROT0, "Visco", "Mahjong Yuugi (Japan set 2)",        0 )
13771370GAME( 1991, ponchin,   0,        mjyuugi,  ponchin,  0,       ROT0, "Visco", "Mahjong Pon Chin Kan (Japan set 1)", 0 )
13781371GAME( 1991, ponchina,  ponchin,  mjyuugi,  ponchin,  0,       ROT0, "Visco", "Mahjong Pon Chin Kan (Japan set 2)", 0 )
1372
1373
src/mame/drivers/m72.c
r3232r3233
620620static READ16_HANDLER( poundfor_trackball_r )
621621{
622622   static int prev[4],diff[4];
623   static const char *axisnames[] = { "TRACK0_X", "TRACK0_Y", "TRACK1_X", "TRACK1_Y" };
623   static const char *const axisnames[] = { "TRACK0_X", "TRACK0_Y", "TRACK1_X", "TRACK1_Y" };
624624
625625   if (offset == 0)
626626   {
src/mame/drivers/snk68.c
r3232r3233
102102
103103static READ16_HANDLER( protcontrols_r )
104104{
105   static const char *portnames[] = { "P1", "P2", "SYSTEM" };
105   static const char *const portnames[] = { "P1", "P2", "SYSTEM" };
106106   return input_port_read(machine, portnames[offset]) ^ invert_controls;
107107}
108108
src/mame/drivers/igs_180.c
r3232r3233
262262                                Decryption
263263***************************************************************************/
264264
265static void decrypt_program_rom(int mask, int a7, int a6, int a5, int a4, int a3, int a2, int a1, int a0)
265static void decrypt_program_rom(running_machine *machine, int mask, int a7, int a6, int a5, int a4, int a3, int a2, int a1, int a0)
266266{
267   int length = memory_region_length(Machine, "main");
268   UINT8 *rom = memory_region(Machine, "main");
267   int length = memory_region_length(machine, "main");
268   UINT8 *rom = memory_region(machine, "main");
269269   UINT8 *tmp = auto_malloc(length);
270270   int i;
271271
r3232r3233
342342
343343static DRIVER_INIT( iqblocka )
344344{
345   decrypt_program_rom(0x11, 7, 6, 5, 4, 3, 2, 1, 0);
345   decrypt_program_rom(machine, 0x11, 7, 6, 5, 4, 3, 2, 1, 0);
346346   iqblocka_patch_rom(machine);
347347
348348   expand_sprites(machine);
r3232r3233
352352
353353static DRIVER_INIT( iqblockf )
354354{
355   decrypt_program_rom(0x11, 7, 6, 5, 4, 3, 2, 1, 0);
355   decrypt_program_rom(machine, 0x11, 7, 6, 5, 4, 3, 2, 1, 0);
356356//  iqblockf_patch_rom(machine);
357357
358358   expand_sprites(machine);
r3232r3233
398398
399399static DRIVER_INIT( tjsb )
400400{
401   decrypt_program_rom(0x05, 7, 6, 3, 2, 5, 4, 1, 0);
401   decrypt_program_rom(machine, 0x05, 7, 6, 3, 2, 5, 4, 1, 0);
402402   tjsb_patch_rom(machine);
403403
404404   tjsb_decrypt_sprites(machine);
src/mame/drivers/konamigv.c
r3232r3233
517517      int axis;
518518      UINT16 diff;
519519      UINT16 value;
520      static const char *axisnames[] = { "TRACK0_X", "TRACK0_Y" };
520      static const char *const axisnames[] = { "TRACK0_X", "TRACK0_Y" };
521521
522522      for( axis = 0; axis < 2; axis++ )
523523      {
r3232r3233
602602      int axis;
603603      UINT16 diff;
604604      UINT16 value;
605      static const char *axisnames[] = { "TRACK0_X", "TRACK0_Y", "TRACK1_X", "TRACK1_Y" };
605      static const char *const axisnames[] = { "TRACK0_X", "TRACK0_Y", "TRACK1_X", "TRACK1_Y" };
606606
607607      for( axis = 0; axis < 4; axis++ )
608608      {
src/mame/drivers/crgolf.c
r3232r3233
8383
8484static READ8_HANDLER( switch_input_r )
8585{
86   static const char *portnames[] = { "IN0", "IN1", "P1", "P2", "DSW", "UNUSED0", "UNUSED1" };
86   static const char *const portnames[] = { "IN0", "IN1", "P1", "P2", "DSW", "UNUSED0", "UNUSED1" };
8787
8888   return input_port_read(machine, portnames[port_select]);
8989}
src/mame/drivers/rmhaihai.c
r3232r3233
7474
7575static READ8_HANDLER( keyboard_r )
7676{
77   static const char *keynames[] = { "KEY0", "KEY1" };
77   static const char *const keynames[] = { "KEY0", "KEY1" };
7878
7979   logerror("%04x: keyboard_r\n",activecpu_get_pc());
8080   switch(activecpu_get_pc())
r3232r3233
198198   AM_RANGE(0xe000, 0xffff) AM_WRITE(SMH_ROM)   /* rmhaisei only */
199199ADDRESS_MAP_END
200200
201static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 )
201static ADDRESS_MAP_START( io_map, ADDRESS_SPACE_IO, 8 )
202202   AM_RANGE(0x0000, 0x7fff) AM_READ(samples_r)
203   AM_RANGE(0x8000, 0x8000) AM_READ(keyboard_r)
204   AM_RANGE(0x8001, 0x8001) AM_READ(SMH_NOP)   // ??
205   AM_RANGE(0x8020, 0x8020) AM_READ(ay8910_read_port_0_r)
206ADDRESS_MAP_END
207
208static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 )
209   AM_RANGE(0x8000, 0x8000) AM_WRITE(SMH_NOP)   // ??
210   AM_RANGE(0x8001, 0x8001) AM_WRITE(keyboard_w)
211   AM_RANGE(0x8020, 0x8020) AM_WRITE(ay8910_control_port_0_w)
203   AM_RANGE(0x8000, 0x8000) AM_READWRITE(keyboard_r, SMH_NOP)   // ??
204   AM_RANGE(0x8001, 0x8001) AM_READWRITE(SMH_NOP, keyboard_w)   // ??
205   AM_RANGE(0x8020, 0x8020) AM_READWRITE(ay8910_read_port_0_r, ay8910_control_port_0_w)
212206   AM_RANGE(0x8021, 0x8021) AM_WRITE(ay8910_write_port_0_w)
213207   AM_RANGE(0x8040, 0x8040) AM_WRITE(adpcm_w)
214208   AM_RANGE(0x8060, 0x8060) AM_WRITE(ctrl_w)
r3232r3233
217211   AM_RANGE(0xbc0c, 0xbc0c) AM_WRITE(SMH_NOP)   // ??
218212ADDRESS_MAP_END
219213
220
221static ADDRESS_MAP_START( themj_writeport, ADDRESS_SPACE_IO, 8 )
222   AM_RANGE(0x8000, 0x8000) AM_WRITE(SMH_NOP)   // ??
223   AM_RANGE(0x8001, 0x8001) AM_WRITE(keyboard_w)
224   AM_RANGE(0x8020, 0x8020) AM_WRITE(ay8910_control_port_0_w)
214static ADDRESS_MAP_START( themj_io_map, ADDRESS_SPACE_IO, 8 )
215   AM_RANGE(0x0000, 0x7fff) AM_READ(samples_r)
216   AM_RANGE(0x8000, 0x8000) AM_READWRITE(keyboard_r, SMH_NOP)   // ??
217   AM_RANGE(0x8001, 0x8001) AM_READWRITE(SMH_NOP, keyboard_w)   // ??
218   AM_RANGE(0x8020, 0x8020) AM_READWRITE(ay8910_read_port_0_r, ay8910_control_port_0_w)
225219   AM_RANGE(0x8021, 0x8021) AM_WRITE(ay8910_write_port_0_w)
226220   AM_RANGE(0x8040, 0x8040) AM_WRITE(adpcm_w)
227221   AM_RANGE(0x8060, 0x8060) AM_WRITE(ctrl_w)
r3232r3233
451445   /* basic machine hardware */
452446   MDRV_CPU_ADD("main",Z80,20000000/4)   /* 5 MHz ??? */
453447   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
454   MDRV_CPU_IO_MAP(readport,writeport)
448   MDRV_CPU_IO_MAP(io_map,0)
455449   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
456450
457451   /* video hardware */
r3232r3233
498492
499493   MDRV_CPU_MODIFY("main")
500494   MDRV_CPU_PROGRAM_MAP(themj_readmem,writemem)
501   MDRV_CPU_IO_MAP(readport,themj_writeport)
495   MDRV_CPU_IO_MAP(themj_io_map,0)
502496
503497   MDRV_MACHINE_RESET(themj)
504498
src/mame/drivers/zr107.c
r3232r3233
309309static READ8_HANDLER( sysreg_r )
310310{
311311   UINT32 r = 0;
312   static const char *portnames[] = { "IN0", "IN1", "IN2", "IN3" };
312   static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" };
313313
314314   switch (offset)
315315   {
src/mame/drivers/amspdwy.c
r3232r3233
4646static READ8_HANDLER( amspdwy_wheel_##_n_##_r ) \
4747{ \
4848   static UINT8 wheel_old, ret; \
49   static const char *portnames[] = { "WHEEL1", "WHEEL2", "AN1", "AN2" };\
49   static const char *const portnames[] = { "WHEEL1", "WHEEL2", "AN1", "AN2" };\
5050   UINT8 wheel; \
5151   wheel = input_port_read(machine, portnames[2 + _n_]); \
5252   if (wheel != wheel_old) \
src/mame/drivers/segae.c
r3232r3233
343343//  AM_RANGE(0xc000 , 0xdfff) AM_WRITE(SMH_RAM) AM_MIRROR(0x2000)
344344ADDRESS_MAP_END
345345
346static ADDRESS_MAP_START( sms_readport, ADDRESS_SPACE_IO, 8 )
346static ADDRESS_MAP_START( sms_io_map, ADDRESS_SPACE_IO, 8 )
347347   ADDRESS_MAP_GLOBAL_MASK(0xff)
348348ADDRESS_MAP_END
349349
350static ADDRESS_MAP_START( sms_writeport, ADDRESS_SPACE_IO, 8 )
351   ADDRESS_MAP_GLOBAL_MASK(0xff)
352ADDRESS_MAP_END
353
354350/* Precalculated tables for H/V counters.  Note the position the counter 'jumps' is marked with with
355351   an empty comment */
356352static const UINT8 hc_256[] =
r3232r3233
20522048static MACHINE_DRIVER_START( systeme )
20532049   MDRV_CPU_ADD("z80", Z80, 10738600/2) /* correct for hangonjr, and astroflash/transformer at least  */
20542050   MDRV_CPU_PROGRAM_MAP(systeme_readmem,systeme_writemem)
2055   MDRV_CPU_IO_MAP(sms_readport,sms_writeport)
2051   MDRV_CPU_IO_MAP(sms_io_map,0)
20562052
20572053   /* IRQ handled via the timers */
20582054   MDRV_MACHINE_RESET(systeme)
r3232r3233
23792375GAME( 1987, opaopa,   0,        systeme, opaopa,   opaopa,   ROT0,  "Sega", "Opa Opa (MC-8123, 317-0042)", 0 )
23802376GAME( 1988, fantzn2,  0,        systeme, fantzn2,  fantzn2,  ROT0,  "Sega", "Fantasy Zone 2 (MC-8123, 317-0057)", 0 )
23812377GAME( 1988, tetrisse, 0,        systeme, tetrisse, segasyse, ROT0,  "Sega", "Tetris (Japan, System E)", 0 )
2378
src/mame/drivers/ksys573.c
r3232r3233
255255static int chiptype[ 2 ];
256256static int has_ds2401[ 2 ];
257257
258static const char *diskregions[] = { "cdrom0", "cdrom1" };
258static const char *const diskregions[] = { "cdrom0", "cdrom1" };
259259
260260/* EEPROM handlers */
261261
src/mame/drivers/atarig1.c
r3232r3233
116116
117117static READ16_HANDLER( a2d_data_r )
118118{
119   static const char *adcnames[] = { "ADC0", "ADC1", "ADC2" };
119   static const char *const adcnames[] = { "ADC0", "ADC1", "ADC2" };
120120
121121   /* Pit Fighter has no A2D, just another input port */
122122   if (atarig1_pitfight)
src/mame/drivers/bladestl.c
r3232r3233
5555{
5656   static int last[4];
5757   int curr,delta;
58   static const char *port[] = { "TRACKBALL_P1_1", "TRACKBALL_P1_2", "TRACKBALL_P2_1", "TRACKBALL_P1_2" };
58   static const char *const port[] = { "TRACKBALL_P1_1", "TRACKBALL_P1_2", "TRACKBALL_P2_1", "TRACKBALL_P1_2" };
5959
6060   curr = input_port_read(machine, port[offset]);
6161   delta = (curr - last[offset]) & 0xff;
src/mame/drivers/mcr68.c
r3232r3233
135135
136136static READ16_HANDLER( spyhunt2_port_0_r )
137137{
138   static const char *portnames[] = { "AN1", "AN2", "AN3", "AN4" };
138   static const char *const portnames[] = { "AN1", "AN2", "AN3", "AN4" };
139139   int result = input_port_read(machine, "IN0");
140140   int which = (control_word >> 3) & 3;
141141   int analog = input_port_read(machine, portnames[which]);
src/mame/drivers/mario.c
r3232r3233
405405   ROM_LOAD( "tma1-c.7d_e-1",     0x4000, 0x2000, CRC(dcceb6c1) SHA1(b19804e69ce2c98cf276c6055c3a250316b96b45) )
406406   ROM_LOAD( "tma1-c.7c_e-3",     0xf000, 0x1000, CRC(0d31bd1c) SHA1(a2e238470ba2ea3c81225fec687f61f047c68c59) )
407407
408   ROM_REGION( 0x2000, "audio", 0 )   /* sound */
408   ROM_REGION( 0x1800, "audio", 0 )   /* sound */
409409   /* internal rom */
410410   ROM_FILL(                 0x0000, 0x0800, 0x00)
411411   /* first half banked */
r3232r3233
436436   ROM_LOAD( "mario.7d",     0x4000, 0x2000, CRC(dcceb6c1) SHA1(b19804e69ce2c98cf276c6055c3a250316b96b45) )
437437   ROM_LOAD( "mario.7c",     0xf000, 0x1000, CRC(4a63d96b) SHA1(b09060b2c84ab77cc540a27b8f932cb60ec8d442) )
438438
439   ROM_REGION( 0x1000, "audio", 0 )   /* sound */
440   ROM_LOAD( "tma1c-a.6k",   0x0000, 0x1000, CRC(06b9ff85) SHA1(111a29bcb9cda0d935675fa26eca6b099a88427f) )
439   ROM_REGION( 0x1800, "audio", 0 )   /* sound */
440   /* internal rom */
441   ROM_FILL(                 0x0000, 0x0800, 0x00)
442   /* first half banked */
443   ROM_LOAD( "tma1c-a.6k",   0x1000, 0x0800, CRC(06b9ff85) SHA1(111a29bcb9cda0d935675fa26eca6b099a88427f) )
444   /* second half always read */
445   ROM_CONTINUE(             0x0800, 0x0800)
441446
442447   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
443448   ROM_LOAD( "mario.3f",     0x0000, 0x1000, CRC(28b0c42c) SHA1(46749568aff88a28c3b6a1ac423abd1b90742a4d) )
r3232r3233
462467   ROM_LOAD( "tma1c-a1.7d",  0x4000, 0x2000, CRC(f8575f31) SHA1(710d0e72fcfce700ed2a22fb9c7c392cc76b250b) )
463468   ROM_LOAD( "tma1c-a2.7c",  0xf000, 0x1000, CRC(a3c11e9e) SHA1(d0612b0f8c2ea4e798f551922a04a324f4ed5f3d) )
464469
465   ROM_REGION( 0x1000, "audio", 0 )   /* sound */
466   ROM_LOAD( "tma1c-a.6k",   0x0000, 0x1000, CRC(06b9ff85) SHA1(111a29bcb9cda0d935675fa26eca6b099a88427f) )
470   ROM_REGION( 0x1800, "audio", 0 )   /* sound */
471   /* internal rom */
472   ROM_FILL(                 0x0000, 0x0800, 0x00)
473   /* first half banked */
474   ROM_LOAD( "tma1c-a.6k",   0x1000, 0x0800, CRC(06b9ff85) SHA1(111a29bcb9cda0d935675fa26eca6b099a88427f) )
475   /* second half always read */
476   ROM_CONTINUE(             0x0800, 0x0800)
467477
468478   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
469479   ROM_LOAD( "tma1v-a.3f",   0x0000, 0x1000, CRC(adf49ee0) SHA1(11fc2cd197bfe3ecb6af55c3c7a326c94988d2bd) )
src/mame/drivers/lethal.c
r3232r3233
176176#define SOUND_CLOCK      XTAL_18_432MHz
177177
178178
179static const char *gunnames[] = { "LIGHT0_X", "LIGHT0_Y", "LIGHT1_X", "LIGHT1_Y" };
179static const char *const gunnames[] = { "LIGHT0_X", "LIGHT0_Y", "LIGHT1_X", "LIGHT1_Y" };
180180
181181/* a = 1, 2 = player # */
182182#define GUNX( a ) (( ( input_port_read(machine, gunnames[2 * (a - 1)]) * 287 ) / 0xff ) + 16)
src/mame/drivers/taitowlf.c
r3232r3233
128128   return mxtc_config_reg[reg];
129129}
130130
131static void mxtc_config_w(int function, int reg, UINT8 data)
131static void mxtc_config_w(running_machine *machine, int function, int reg, UINT8 data)
132132{
133133//  mame_printf_debug("MXTC: write %d, %02X, %02X at %08X\n", function, reg, data, activecpu_get_pc());
134134
r3232r3233
142142         }
143143         else               // disable RAM access (reads go to BIOS ROM)
144144         {
145            memory_set_bankptr(1, memory_region(Machine, "user1") + 0x30000);
145            memory_set_bankptr(1, memory_region(machine, "user1") + 0x30000);
146146         }
147147         break;
148148      }
r3232r3233
187187{
188188   if (ACCESSING_BITS_24_31)
189189   {
190      mxtc_config_w(function, reg + 3, (data >> 24) & 0xff);
190      mxtc_config_w(Machine, function, reg + 3, (data >> 24) & 0xff);
191191   }
192192   if (ACCESSING_BITS_16_23)
193193   {
194      mxtc_config_w(function, reg + 2, (data >> 16) & 0xff);
194      mxtc_config_w(Machine, function, reg + 2, (data >> 16) & 0xff);
195195   }
196196   if (ACCESSING_BITS_8_15)
197197   {
198      mxtc_config_w(function, reg + 1, (data >> 8) & 0xff);
198      mxtc_config_w(Machine, function, reg + 1, (data >> 8) & 0xff);
199199   }
200200   if (ACCESSING_BITS_0_7)
201201   {
202      mxtc_config_w(function, reg + 0, (data >> 0) & 0xff);
202      mxtc_config_w(Machine, function, reg + 0, (data >> 0) & 0xff);
203203   }
204204}
205205
src/mame/drivers/tumbleb.c
r3232r3233
32823282/******************************************************************************/
32833283
32843284#if TUMBLEP_HACK
3285void tumblepb_patch_code(UINT16 offset)
3285void tumblepb_patch_code(running_machine *machine, UINT16 offset)
32863286{
32873287   /* A hack which enables all Dip Switches effects */
3288   UINT16 *RAM = (UINT16 *)memory_region(Machine, "main");
3288   UINT16 *RAM = (UINT16 *)memory_region(machine, "main");
32893289   RAM[(offset + 0)/2] = 0x0240;
32903290   RAM[(offset + 2)/2] = 0xffff;   // andi.w  #$f3ff, D0
32913291}
r3232r3233
33183318   tumblepb_gfx1_rearrange(machine);
33193319
33203320   #if TUMBLEP_HACK
3321   tumblepb_patch_code(0x000132);
3321   tumblepb_patch_code(machine, 0x000132);
33223322   #endif
33233323}
33243324
r3232r3233
33273327   tumblepb_gfx1_rearrange(machine);
33283328
33293329   #if TUMBLEP_HACK
3330   tumblepb_patch_code(0x000132);
3330   tumblepb_patch_code(machine, 0x000132);
33313331   #endif
33323332
33333333   memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x100000, 0x100001, 0, 0, tumbleb2_soundmcu_w );
r3232r3233
33393339   tumblepb_gfx1_rearrange(machine);
33403340
33413341   #if TUMBLEP_HACK
3342   tumblepb_patch_code(0x00013a);
3342   tumblepb_patch_code(machine, 0x00013a);
33433343   #endif
33443344}
33453345
src/mame/drivers/micro3d.c
r3232r3233
9393static int ti_uart_mode_cycle=0;
9494static int ti_uart_sync_cycle=0;
9595
96static void m68901_int_gen(int source);
96static void m68901_int_gen(running_machine *machine, int source);
9797
9898/* 68901 */
9999enum{   TMRB=0,TXERR,TBE,RXERR,RBF,TMRA,GPIP6,GPIP7,     // A Registers
r3232r3233
125125}
126126
127127
128static void changecolor_BBBBBRRRRRGGGGGG(pen_t color,int data)
128static void changecolor_BBBBBRRRRRGGGGGG(running_machine *machine,pen_t color,int data)
129129{
130   palette_set_color_rgb(Machine,color,pal5bit(data >> 6),pal5bit(data >> 1),pal5bit(data >> 11));
130   palette_set_color_rgb(machine,color,pal5bit(data >> 6),pal5bit(data >> 1),pal5bit(data >> 11));
131131}
132132
133133static WRITE16_HANDLER( paletteram16_BBBBBRRRRRGGGGGG_word_w )
134134{
135135   COMBINE_DATA(&paletteram16[offset]);
136   changecolor_BBBBBRRRRRGGGGGG(offset,paletteram16[offset]);
136   changecolor_BBBBBRRRRRGGGGGG(machine,offset,paletteram16[offset]);
137137}
138138
139139
r3232r3233
392392
393393static void tms_interrupt(int state)
394394{
395   m68901_int_gen(GPIP4);
395   m68901_int_gen(Machine, GPIP4);
396396}
397397
398398static INTERRUPT_GEN( micro3d_vblank )
399399{
400   m68901_int_gen(GPIP7);
400   m68901_int_gen(machine, GPIP7);
401401}
402402
403403
r3232r3233
407407{
408408//      timer_set(attotime_mul(ATTOTIME_IN_HZ(M68901_CLK), ((m68901_base[0xf]>>8) & 0xff) * 200),0,timera_int);     // Set the timer again.
409409        timer_set(ATTOTIME_IN_USEC(1000), NULL,0,timera_int);     // Set the timer again.
410        m68901_int_gen(TMRA);           // Fire an interrupt.
410        m68901_int_gen(machine, TMRA);           // Fire an interrupt.
411411}
412412
413413#ifdef UNUSED_FUNCTION
414414static TIMER_CALLBACK( timerb_int )
415415{
416416        timer_set(attotime_mul(ATTOTIME_IN_HZ(M68901_CLK), ((m68901_base[0x10]>>8) & 0xff) * 200),0,timera_int);
417        m68901_int_gen(TMRB);           // Fire an interrupt.
417        m68901_int_gen(machine, TMRB);           // Fire an interrupt.
418418}
419419
420420static TIMER_CALLBACK( timerc_int )
421421{
422422        timer_set(attotime_mul(ATTOTIME_IN_HZ(M68901_CLK), ((m68901_base[0x11]>>8) & 0xff) * 200),0,timera_int);
423        m68901_int_gen(TMRC);           // Fire an interrupt.
423        m68901_int_gen(machine, TMRC);           // Fire an interrupt.
424424}
425425#endif
426426
427427static TIMER_CALLBACK( timerd_int )
428428{
429429        timer_set(ATTOTIME_IN_USEC(250), NULL,0,timerd_int);
430        m68901_int_gen(TMRD);           // Fire an interrupt.
430        m68901_int_gen(machine, TMRD);           // Fire an interrupt.
431431}
432432
433433
434434/* Called by anything that generates a MFD interrupt */
435435/* Requires: MFD line number */
436436
437static void m68901_int_gen(int source)
437static void m68901_int_gen(running_machine *machine, int source)
438438{
439439// logerror("M68901 interrupt %d requested.\n",source);
440440
r3232r3233
451451
452452       if(m68901_base[IMASK_REG] & (bit<<8))              // If interrupt is not masked by MFD, trigger a 68k INT
453453       {
454                cpunum_set_input_line(Machine, 0,4, HOLD_LINE);
454                cpunum_set_input_line(machine, 0,4, HOLD_LINE);
455455            //    logerror("M68901 interrupt %d serviced.\n",source);
456456       }
457457}
src/mame/drivers/m90.c
r3232r3233
120120   AM_RANGE(0xffff0, 0xfffff) AM_ROM
121121ADDRESS_MAP_END
122122
123static ADDRESS_MAP_START( main_cpu_io, ADDRESS_SPACE_IO, 16 )
123static ADDRESS_MAP_START( main_cpu_io_map, ADDRESS_SPACE_IO, 16 )
124124   AM_RANGE(0x00, 0x01) AM_WRITE(m72_sound_command_w)
125125   AM_RANGE(0x00, 0x01) AM_READ_PORT("P1_P2")
126126   AM_RANGE(0x02, 0x03) AM_WRITE(m90_coincounter_w)
r3232r3233
155155   AM_RANGE(0xf000, 0xffff) AM_WRITE(SMH_RAM)
156156ADDRESS_MAP_END
157157
158static ADDRESS_MAP_START( sound_readport, ADDRESS_SPACE_IO, 8 )
158static ADDRESS_MAP_START( sound_io_map, ADDRESS_SPACE_IO, 8 )
159159   ADDRESS_MAP_GLOBAL_MASK(0xff)
160   AM_RANGE(0x01, 0x01) AM_READ(ym2151_status_port_0_r)
161   AM_RANGE(0x80, 0x80) AM_READ(soundlatch_r)
162   AM_RANGE(0x84, 0x84) AM_READ(m72_sample_r)
163ADDRESS_MAP_END
164
165static ADDRESS_MAP_START( sound_writeport, ADDRESS_SPACE_IO, 8 )
166   ADDRESS_MAP_GLOBAL_MASK(0xff)
167160   AM_RANGE(0x00, 0x00) AM_WRITE(ym2151_register_port_0_w)
168   AM_RANGE(0x01, 0x01) AM_WRITE(ym2151_data_port_0_w)
161   AM_RANGE(0x01, 0x01) AM_READWRITE(ym2151_status_port_0_r, ym2151_data_port_0_w)
162   AM_RANGE(0x80, 0x80) AM_READ(soundlatch_r)
169163   AM_RANGE(0x80, 0x81) AM_WRITE(rtype2_sample_addr_w)
170164   AM_RANGE(0x82, 0x82) AM_WRITE(m72_sample_w)
171165   AM_RANGE(0x83, 0x83) AM_WRITE(m72_sound_irq_ack_w)
166   AM_RANGE(0x84, 0x84) AM_READ(m72_sample_r)
172167ADDRESS_MAP_END
173168
174static ADDRESS_MAP_START( bbmanw_sound_readport, ADDRESS_SPACE_IO, 8 )
169static ADDRESS_MAP_START( bbmanw_sound_io_map, ADDRESS_SPACE_IO, 8 )
175170   ADDRESS_MAP_GLOBAL_MASK(0xff)
176   AM_RANGE(0x41, 0x41) AM_READ(ym2151_status_port_0_r)
177   AM_RANGE(0x42, 0x42) AM_READ(soundlatch_r)
178//  AM_RANGE(0x41, 0x41) AM_READ(m72_sample_r)
179ADDRESS_MAP_END
180
181static ADDRESS_MAP_START( bbmanw_sound_writeport, ADDRESS_SPACE_IO, 8 )
182   ADDRESS_MAP_GLOBAL_MASK(0xff)
183171   AM_RANGE(0x40, 0x40) AM_WRITE(ym2151_register_port_0_w)
184   AM_RANGE(0x41, 0x41) AM_WRITE(ym2151_data_port_0_w)
185   AM_RANGE(0x42, 0x42) AM_WRITE(m72_sound_irq_ack_w)
172   AM_RANGE(0x41, 0x41) AM_READWRITE(ym2151_status_port_0_r, ym2151_data_port_0_w)
173   AM_RANGE(0x42, 0x42) AM_READWRITE(soundlatch_r, m72_sound_irq_ack_w)
186174//  AM_RANGE(0x40, 0x41) AM_WRITE(rtype2_sample_addr_w)
175//  AM_RANGE(0x41, 0x41) AM_READ(m72_sample_r)
187176//  AM_RANGE(0x42, 0x42) AM_WRITE(m72_sample_w)
188177ADDRESS_MAP_END
189178
r3232r3233
722711   /* basic machine hardware */
723712   MDRV_CPU_ADD("main", V30,XTAL_32MHz/2/2) /* verified clock on cpu is 16Mhz but probably divided internally by 2 */
724713   MDRV_CPU_PROGRAM_MAP(main_cpu,0)
725   MDRV_CPU_IO_MAP(main_cpu_io,0)
714   MDRV_CPU_IO_MAP(main_cpu_io_map,0)
726715   MDRV_CPU_VBLANK_INT("main", m90_interrupt)
727716
728717   MDRV_CPU_ADD("audio", Z80, XTAL_3_579545MHz) /* verified on pcb */
729718   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
730   MDRV_CPU_IO_MAP(sound_readport,sound_writeport)
719   MDRV_CPU_IO_MAP(sound_io_map,0)
731720   MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,128)   /* clocked by V1? (Vigilante) */
732721                        /* IRQs are generated by main Z80 and YM2151 */
733722
r3232r3233
804793   MDRV_CPU_CONFIG(bomberman_config)
805794
806795   MDRV_CPU_PROGRAM_MAP(main_cpu,0)
807   MDRV_CPU_IO_MAP(main_cpu_io,0)
796   MDRV_CPU_IO_MAP(main_cpu_io_map,0)
808797   MDRV_CPU_VBLANK_INT("main", m90_interrupt)
809798
810799   MDRV_CPU_ADD("audio", Z80, XTAL_3_579545MHz) /* verified on pcb */
811800   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
812   MDRV_CPU_IO_MAP(sound_readport,sound_writeport)
801   MDRV_CPU_IO_MAP(sound_io_map,0)
813802   MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,128)   /* clocked by V1? (Vigilante) */
814803                        /* IRQs are generated by main Z80 and YM2151 */
815804   MDRV_MACHINE_RESET(m72_sound)
r3232r3233
849838   MDRV_CPU_CONFIG(dynablaster_config)
850839
851840   MDRV_CPU_PROGRAM_MAP(main_cpu,0)
852   MDRV_CPU_IO_MAP(main_cpu_io,0)
841   MDRV_CPU_IO_MAP(main_cpu_io_map,0)
853842   MDRV_CPU_VBLANK_INT("main", m90_interrupt)
854843
855844   MDRV_CPU_ADD("audio", Z80, XTAL_3_579545MHz) /* verified on pcb */
856845   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
857   MDRV_CPU_IO_MAP(bbmanw_sound_readport,bbmanw_sound_writeport)
846   MDRV_CPU_IO_MAP(bbmanw_sound_io_map,0)
858847   MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,128)   /* clocked by V1? (Vigilante) */
859848                        /* IRQs are generated by main Z80 and YM2151 */
860849   MDRV_MACHINE_RESET(m72_sound)
r3232r3233
915904
916905   MDRV_CPU_ADD("audio", Z80, XTAL_3_579545MHz)   /* 3.579545 MHz */
917906   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
918   MDRV_CPU_IO_MAP(sound_readport,sound_writeport)
907   MDRV_CPU_IO_MAP(sound_io_map,0)
919908   MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,128)   /* clocked by V1? (Vigilante) */
920909                        /* IRQs are generated by main Z80 and YM2151 */
921910   MDRV_MACHINE_RESET(m72_sound)
r3232r3233
13131302GAME( 1993, gussun,   riskchal, riskchal, riskchal, 0,        ROT0, "Irem", "Gussun Oyoyo (Japan)", GAME_IMPERFECT_GRAPHICS )
13141303GAME( 1993, matchit2, 0,        matchit2, matchit2, 0,        ROT0, "Tamtex", "Match It II", GAME_NO_COCKTAIL )
13151304GAME( 1993, shisen2,  matchit2, matchit2, shisen2,  0,        ROT0, "Tamtex", "Shisensho II", GAME_NO_COCKTAIL )
1305
src/mame/drivers/taito_z.c
r3232r3233
885885READ16_HANDLER ( TC0150ROD_word_r );   /* Road generator */
886886WRITE16_HANDLER( TC0150ROD_word_w );
887887
888static UINT16 cpua_ctrl = 0xff;
888static UINT16 cpua_ctrl;
889889static INT32 sci_int6 = 0;
890890static INT32 dblaxle_int6 = 0;
891891static INT32 ioc220_port = 0;
r3232r3233
14121412                        SOUND
14131413*****************************************************/
14141414
1415static INT32 banknum = -1;
1415static INT32 banknum;
14161416
14171417static void reset_sound_region(running_machine *machine)   /* assumes Z80 sandwiched between 68Ks */
14181418{
r3232r3233
15101510
15111511static MACHINE_START( taitoz )
15121512{
1513   banknum = -1;
1514   cpua_ctrl = 0xff;
1515   sci_int6 = 0;
1516   dblaxle_int6 = 0;
1517   ioc220_port = 0;
1518
15131519   state_save_register_global(cpua_ctrl);
15141520
15151521   /* these are specific to various games: we ought to split the inits */
r3232r3233
47644770static DRIVER_INIT( taitoz )
47654771{
47664772//  taitosnd_setz80_soundcpu( 2 );
4767
4768   cpua_ctrl = 0xff;
47694773}
47704774
47714775static STATE_POSTLOAD( bshark_postload )
r3232r3233
47754779
47764780static DRIVER_INIT( bshark )
47774781{
4778   cpua_ctrl = 0xff;
4782   eep_latch = 0;
47794783   state_save_register_postload(machine, bshark_postload, NULL);
47804784
47814785   state_save_register_global(eep_latch);
src/mame/drivers/slapfght.c
r3232r3233
498498   AM_RANGE(0xf800, 0xffff) AM_WRITE(slapfight_fixcol_w) AM_BASE(&slapfight_colorram)
499499ADDRESS_MAP_END
500500
501static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 )
501static ADDRESS_MAP_START( io_map, ADDRESS_SPACE_IO, 8 )
502502   ADDRESS_MAP_GLOBAL_MASK(0xff)
503   AM_RANGE(0x00, 0x00) AM_READ(slapfight_port_00_r)   /* status register */
503   AM_RANGE(0x00, 0x00) AM_READWRITE(slapfight_port_00_r, slapfight_port_00_w)   /* status register */
504   AM_RANGE(0x01, 0x01) AM_WRITE(slapfight_port_01_w)
505   AM_RANGE(0x02, 0x03) AM_WRITE(slapfight_flipscreen_w)
506//  AM_RANGE(0x04, 0x04) AM_WRITE(getstar_port_04_w)
507   AM_RANGE(0x06, 0x06) AM_WRITE(slapfight_port_06_w)
508   AM_RANGE(0x07, 0x07) AM_WRITE(slapfight_port_07_w)
509   AM_RANGE(0x08, 0x08) AM_WRITE(slapfight_port_08_w)   /* select bank 0 */
510   AM_RANGE(0x09, 0x09) AM_WRITE(slapfight_port_09_w)   /* select bank 1 */
511   AM_RANGE(0x0c, 0x0d) AM_WRITE(slapfight_palette_bank_w)
504512ADDRESS_MAP_END
505513
506514static READ8_HANDLER(tigerh_status_r)
r3232r3233
508516   return (slapfight_port_00_r(machine,0)&0xf9)| ((tigerh_mcu_status_r(machine,0)));
509517}
510518
511static ADDRESS_MAP_START( tigerh_readport, ADDRESS_SPACE_IO, 8 )
519static ADDRESS_MAP_START( tigerh_io_map, ADDRESS_SPACE_IO, 8 )
512520   ADDRESS_MAP_GLOBAL_MASK(0xff)
513   AM_RANGE(0x00, 0x00) AM_READ(tigerh_status_r)   /* status register */
521   AM_RANGE(0x00, 0x00) AM_READWRITE(tigerh_status_r, slapfight_port_00_w)   /* status register */
522   AM_RANGE(0x01, 0x01) AM_WRITE(slapfight_port_01_w)
523   AM_RANGE(0x02, 0x03) AM_WRITE(slapfight_flipscreen_w)
524   AM_RANGE(0x06, 0x06) AM_WRITE(slapfight_port_06_w)
525   AM_RANGE(0x07, 0x07) AM_WRITE(slapfight_port_07_w)
514526ADDRESS_MAP_END
515527
516528static ADDRESS_MAP_START( m68705_readmem, ADDRESS_SPACE_PROGRAM, 8 )
r3232r3233
534546   AM_RANGE(0x0080, 0x07ff) AM_WRITE(SMH_ROM)
535547ADDRESS_MAP_END
536548
537static ADDRESS_MAP_START( tigerh_writeport, ADDRESS_SPACE_IO, 8 )
549static ADDRESS_MAP_START( tigerhb_io_map, ADDRESS_SPACE_IO, 8 )
538550   ADDRESS_MAP_GLOBAL_MASK(0xff)
539   AM_RANGE(0x00, 0x00) AM_WRITE(slapfight_port_00_w)
551   AM_RANGE(0x00, 0x00) AM_READWRITE(slapfight_port_00_r, slapfight_port_00_w)   /* status register */
540552   AM_RANGE(0x01, 0x01) AM_WRITE(slapfight_port_01_w)
541553   AM_RANGE(0x02, 0x03) AM_WRITE(slapfight_flipscreen_w)
542554   AM_RANGE(0x06, 0x06) AM_WRITE(slapfight_port_06_w)
543555   AM_RANGE(0x07, 0x07) AM_WRITE(slapfight_port_07_w)
544556ADDRESS_MAP_END
545557
546static ADDRESS_MAP_START( writeport, ADDRESS_SPACE_IO, 8 )
547   ADDRESS_MAP_GLOBAL_MASK(0xff)
548   AM_RANGE(0x00, 0x00) AM_WRITE(slapfight_port_00_w)
549   AM_RANGE(0x01, 0x01) AM_WRITE(slapfight_port_01_w)
550   AM_RANGE(0x02, 0x03) AM_WRITE(slapfight_flipscreen_w)
551//  AM_RANGE(0x04, 0x04) AM_WRITE(getstar_port_04_w)
552   AM_RANGE(0x06, 0x06) AM_WRITE(slapfight_port_06_w)
553   AM_RANGE(0x07, 0x07) AM_WRITE(slapfight_port_07_w)
554   AM_RANGE(0x08, 0x08) AM_WRITE(slapfight_port_08_w)   /* select bank 0 */
555   AM_RANGE(0x09, 0x09) AM_WRITE(slapfight_port_09_w)   /* select bank 1 */
556   AM_RANGE(0x0c, 0x0d) AM_WRITE(slapfight_palette_bank_w)
557ADDRESS_MAP_END
558
559
560558static ADDRESS_MAP_START( perfrman_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
561559   AM_RANGE(0x0000, 0x1fff) AM_READ(SMH_ROM)
562560   AM_RANGE(0x8800, 0x880f) AM_READ(slapfight_dpram_r)
r3232r3233
926924   /* basic machine hardware */
927925   MDRV_CPU_ADD("main", Z80,16000000/4)         /* 4MHz ???, 16MHz Oscillator */
928926   MDRV_CPU_PROGRAM_MAP(perfrman_readmem,perfrman_writemem)
929   MDRV_CPU_IO_MAP(readport,writeport)
927   MDRV_CPU_IO_MAP(io_map,0)
930928   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
931929
932930   MDRV_CPU_ADD("audio", Z80,16000000/8)         /* 2MHz ???, 16MHz Oscillator */
r3232r3233
973971   /* basic machine hardware */
974972   MDRV_CPU_ADD("main", Z80, 6000000)
975973   MDRV_CPU_PROGRAM_MAP(tigerh_readmem,writemem)
976   MDRV_CPU_IO_MAP(readport,tigerh_writeport)
974   MDRV_CPU_IO_MAP(tigerhb_io_map,0)
977975   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
978976
979977   MDRV_CPU_ADD("audio", Z80, 6000000)
r3232r3233
10191017   /* basic machine hardware */
10201018   MDRV_CPU_ADD("main", Z80, XTAL_36MHz/6) /* verified on pcb */
10211019   MDRV_CPU_PROGRAM_MAP(tigerh_readmem,writemem)
1022   MDRV_CPU_IO_MAP(tigerh_readport,tigerh_writeport)
1020   MDRV_CPU_IO_MAP(tigerh_io_map,0)
10231021   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
10241022
10251023   MDRV_CPU_ADD("audio", Z80, XTAL_36MHz/12) /* verified on pcb */
r3232r3233
10691067   /* basic machine hardware */
10701068   MDRV_CPU_ADD("main",Z80, XTAL_36MHz/6) /* verified on pcb */
10711069   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
1072   MDRV_CPU_IO_MAP(readport,writeport)
1070   MDRV_CPU_IO_MAP(io_map,0)
10731071   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
10741072
10751073   MDRV_CPU_ADD("audio", Z80, XTAL_36MHz/12) /* verified on pcb */
r3232r3233
19261924GAME( 1986, getstarj, getstar,  slapfigh, getstarj, getstarj, ROT0,   "Taito",   "Get Star (Japan)", GAME_NO_COCKTAIL )
19271925GAME( 1986, gtstarb1, getstar,  slapfigh, getstarj, gtstarb1, ROT0,   "bootleg", "Get Star (bootleg set 1)", GAME_NO_COCKTAIL )
19281926GAME( 1986, gtstarb2, getstar,  slapfigh, gtstarb2, gtstarb2, ROT0,   "bootleg", "Get Star (bootleg set 2)", GAME_NO_COCKTAIL )
1927
src/mame/drivers/boogwing.c
r3232r3233
88    Sound: HuC6280A, YM2151, YM3012, OKI M6295 (x2)
99    OSC: 32.220MHz, 28.000MHz
1010    DIPs: 8 position (x2)
11    PALs: (not dumped) VF-01 (PAL16L8)
12                    VF-02 (22CV10P)
13                    VF-03 (PAL16L8)
14                    VF-04 (PAL 16L8)
15                    VF-05 (PAL 16L8)
11    PALs: (not dumped) VF-00 (PAL16L8)
12                       VF-01 (PAL16L8)
13                       VF-02 (22CV10P)
14                       VF-03 (PAL16L8)
15                       VF-04 (PAL16L8)
16                       VF-05 (PAL16L8)
1617
1718    PROM: MB7122 (compatible to 82S137, located near MBD-09)
1819
r3232r3233
340341
341342/**********************************************************************************/
342343
343ROM_START( boogwing )
344ROM_START( boogwing ) /* VER 1.5 EUR 92.12.07 */
344345   ROM_REGION( 0x100000, "main", 0 ) /* DE102 code (encrypted) */
345   ROM_LOAD16_BYTE( "kn00-2.2b",    0x000000, 0x040000, CRC(e38892b9) SHA1(49b5637965a43e0378e1258c5f0a780926f1f283) )
346   ROM_LOAD16_BYTE( "kn02-2.2e",    0x000001, 0x040000, CRC(8426efef) SHA1(2ea33cbd58b638053d75668a484648dbf67dabb8) )
347   ROM_LOAD16_BYTE( "kn01-2.4b",    0x080000, 0x040000, CRC(3ad4b54c) SHA1(5141001768266995078407851b445378b21453de) )
348   ROM_LOAD16_BYTE( "kn03-2.4e",    0x080001, 0x040000, CRC(10b61f4a) SHA1(41d7f670defbd7dae89afafac9839a9e237814d5) )
346   ROM_LOAD16_BYTE( "kn_00-2.2b",    0x000000, 0x040000, CRC(e38892b9) SHA1(49b5637965a43e0378e1258c5f0a780926f1f283) )
347   ROM_LOAD16_BYTE( "kn_02-2.2e",    0x000001, 0x040000, CRC(8426efef) SHA1(2ea33cbd58b638053d75668a484648dbf67dabb8) )
348   ROM_LOAD16_BYTE( "kn_01-2.4b",    0x080000, 0x040000, CRC(3ad4b54c) SHA1(5141001768266995078407851b445378b21453de) )
349   ROM_LOAD16_BYTE( "kn_03-2.4e",    0x080001, 0x040000, CRC(10b61f4a) SHA1(41d7f670defbd7dae89afafac9839a9e237814d5) )
349350
350351   ROM_REGION( 0x10000, "audio", 0 )
351   ROM_LOAD( "kn06.18p",    0x00000, 0x10000, CRC(3e8bc4e1) SHA1(7e4c357afefa47b8f101727e06485eb9ebae635d) )
352   ROM_LOAD( "km06.18p",    0x00000, 0x10000, CRC(3e8bc4e1) SHA1(7e4c357afefa47b8f101727e06485eb9ebae635d) )
352353
353354   ROM_REGION( 0x20000, "tiles1", ROMREGION_DISPOSE ) /* Tiles 1 */
354   ROM_LOAD16_BYTE( "kn05.9e",   0x00000, 0x010000, CRC(d10aef95) SHA1(a611a35ab312caee19c31da079c647679d31673d) )
355   ROM_LOAD16_BYTE( "kn04.8e",   0x00001, 0x010000, CRC(329323a8) SHA1(e2ec7b059301c0a2e052dfc683e044c808ad9b33) )
355   ROM_LOAD16_BYTE( "km05.9e",   0x00000, 0x010000, CRC(d10aef95) SHA1(a611a35ab312caee19c31da079c647679d31673d) )
356   ROM_LOAD16_BYTE( "km04.8e",   0x00001, 0x010000, CRC(329323a8) SHA1(e2ec7b059301c0a2e052dfc683e044c808ad9b33) )
356357
357358   ROM_REGION( 0x300000, "tiles2", ROMREGION_DISPOSE ) /* Tiles 2 */
358359   ROM_LOAD( "mbd-01.9b", 0x000000, 0x100000, CRC(d7de4f4b) SHA1(4747f8795e277ed8106667b6f68e1176d95db684) )
r3232r3233
386387
387388ROM_START( boogwina )
388389   ROM_REGION( 0x100000, "main", 0 ) /* DE102 code (encrypted) */
389   ROM_LOAD16_BYTE( "km00-2.2b",    0x000000, 0x040000, CRC(71ab71c6) SHA1(00bfd71dd9ae5f12c574ab0ecc07d85898930c4b) )
390   ROM_LOAD16_BYTE( "km02-2.2e",    0x000001, 0x040000, CRC(e90f07f9) SHA1(1e8bd3983ed875f4752cbf2ab1c7e748d3df019c) )
391   ROM_LOAD16_BYTE( "km01-2.4b",    0x080000, 0x040000, CRC(7fdce2d3) SHA1(5ce9b8ac26700f1c3bfb3ce4845f890b81241823) )
392   ROM_LOAD16_BYTE( "km03-2.4e",    0x080001, 0x040000, CRC(0b582de3) SHA1(f5c58c7e0e8a227506a81e38c266356596dcda7b) )
390   ROM_LOAD16_BYTE( "km_00-2.2b",    0x000000, 0x040000, CRC(71ab71c6) SHA1(00bfd71dd9ae5f12c574ab0ecc07d85898930c4b) )
391   ROM_LOAD16_BYTE( "km_02-2.2e",    0x000001, 0x040000, CRC(e90f07f9) SHA1(1e8bd3983ed875f4752cbf2ab1c7e748d3df019c) )
392   ROM_LOAD16_BYTE( "km_01-2.4b",    0x080000, 0x040000, CRC(7fdce2d3) SHA1(5ce9b8ac26700f1c3bfb3ce4845f890b81241823) )
393   ROM_LOAD16_BYTE( "km_03-2.4e",    0x080001, 0x040000, CRC(0b582de3) SHA1(f5c58c7e0e8a227506a81e38c266356596dcda7b) )
393394
394395   ROM_REGION( 0x10000, "audio", 0 )
395396   ROM_LOAD( "km06.18p",    0x00000, 0x10000, CRC(3e8bc4e1) SHA1(7e4c357afefa47b8f101727e06485eb9ebae635d) )
396397
397398   ROM_REGION( 0x20000, "tiles1", ROMREGION_DISPOSE ) /* Tiles 1 */
398   ROM_LOAD16_BYTE( "kn05.9e",   0x00000, 0x010000, CRC(d10aef95) SHA1(a611a35ab312caee19c31da079c647679d31673d) )
399   ROM_LOAD16_BYTE( "kn04.8e",   0x00001, 0x010000, CRC(329323a8) SHA1(e2ec7b059301c0a2e052dfc683e044c808ad9b33) )
399   ROM_LOAD16_BYTE( "km05.9e",   0x00000, 0x010000, CRC(d10aef95) SHA1(a611a35ab312caee19c31da079c647679d31673d) )
400   ROM_LOAD16_BYTE( "km04.8e",   0x00001, 0x010000, CRC(329323a8) SHA1(e2ec7b059301c0a2e052dfc683e044c808ad9b33) )
400401
401402   ROM_REGION( 0x300000, "tiles2", ROMREGION_DISPOSE ) /* Tiles 2 */
402403   ROM_LOAD( "mbd-01.9b", 0x000000, 0x100000, CRC(d7de4f4b) SHA1(4747f8795e277ed8106667b6f68e1176d95db684) )
r3232r3233
428429   ROM_LOAD( "kj-00.15n",    0x000000, 0x00400, CRC(add4d50b) SHA1(080e5a8192a146d5141aef5c8d9996ddf8cd3ab4) )
429430ROM_END
430431
431ROM_START( ragtime )
432ROM_START( ragtime ) /* VER 1.5 JPN 92.12.07 */
432433   ROM_REGION( 0x100000, "main", 0 ) /* DE102 code (encrypted) */
433   ROM_LOAD16_BYTE( "kh00-1.2b",    0x000000, 0x040000, CRC(553e179f) SHA1(ab156d9eca4a74084da944989529fd8f5a147dfc) )
434   ROM_LOAD16_BYTE( "kh02-1.2e",    0x000001, 0x040000, CRC(6c759ec0) SHA1(f503d225c31543a7cd975fc599811a31ff729251) )
435   ROM_LOAD16_BYTE( "kh01-1.4b",    0x080000, 0x040000, CRC(12dfee70) SHA1(a7c8fd118f589ef13bcb43a6aa446ff81015f5b3) )
436   ROM_LOAD16_BYTE( "kh03-1.4e",    0x080001, 0x040000, CRC(076fea18) SHA1(342ca71b6d8c8be92dbf221ada717bdbd0061226) )
434   ROM_LOAD16_BYTE( "kh_00-2.2b",    0x000000, 0x040000, CRC(553e179f) SHA1(ab156d9eca4a74084da944989529fd8f5a147dfc) )
435   ROM_LOAD16_BYTE( "kh_02-2.2e",    0x000001, 0x040000, CRC(6c759ec0) SHA1(f503d225c31543a7cd975fc599811a31ff729251) )
436   ROM_LOAD16_BYTE( "kh_01-2.4b",    0x080000, 0x040000, CRC(12dfee70) SHA1(a7c8fd118f589ef13bcb43a6aa446ff81015f5b3) )
437   ROM_LOAD16_BYTE( "kh_03-2.4e",    0x080001, 0x040000, CRC(076fea18) SHA1(342ca71b6d8c8be92dbf221ada717bdbd0061226) )
437438
438439   ROM_REGION( 0x10000, "audio", 0 )
439440   ROM_LOAD( "km06.18p",    0x00000, 0x10000, CRC(3e8bc4e1) SHA1(7e4c357afefa47b8f101727e06485eb9ebae635d) )
440441
441442   ROM_REGION( 0x20000, "tiles1", ROMREGION_DISPOSE ) /* Tiles 1 */
442   ROM_LOAD16_BYTE( "kn05.9e",   0x00000, 0x010000, CRC(d10aef95) SHA1(a611a35ab312caee19c31da079c647679d31673d) )
443   ROM_LOAD16_BYTE( "kn04.8e",   0x00001, 0x010000, CRC(329323a8) SHA1(e2ec7b059301c0a2e052dfc683e044c808ad9b33) )
443   ROM_LOAD16_BYTE( "km05.9e",   0x00000, 0x010000, CRC(d10aef95) SHA1(a611a35ab312caee19c31da079c647679d31673d) )
444   ROM_LOAD16_BYTE( "km04.8e",   0x00001, 0x010000, CRC(329323a8) SHA1(e2ec7b059301c0a2e052dfc683e044c808ad9b33) )
444445
445446   ROM_REGION( 0x300000, "tiles2", ROMREGION_DISPOSE ) /* Tiles 2 */
446447   ROM_LOAD( "mbd-01.9b", 0x000000, 0x100000, CRC(d7de4f4b) SHA1(4747f8795e277ed8106667b6f68e1176d95db684) )
r3232r3233
472473   ROM_LOAD( "kj-00.15n",    0x000000, 0x00400, CRC(add4d50b) SHA1(080e5a8192a146d5141aef5c8d9996ddf8cd3ab4) )
473474ROM_END
474475
476ROM_START( ragtimea ) /* VER 1.3 JPN 92.11.26 */
477   ROM_REGION( 0x100000, "main", 0 ) /* DE102 code (encrypted) */
478   ROM_LOAD16_BYTE( "kh_00-1.2b",    0x000000, 0x040000, CRC(88f0155a) SHA1(6f11cc91e36cd68b7143e3326d92b258f051012e) )
479   ROM_LOAD16_BYTE( "kh_02-1.2e",    0x000001, 0x040000, CRC(8811b41b) SHA1(d395338bcd812add0de3d1554d1dc3e048d0e4c9) )
480   ROM_LOAD16_BYTE( "kh_01-1.4b",    0x080000, 0x040000, CRC(4dab63ad) SHA1(8c6f6e8382bcbba6e1a7ced504397181e7d6e1d1) )
481   ROM_LOAD16_BYTE( "kh_03-1.4e",    0x080001, 0x040000, CRC(8a4cbb18) SHA1(272c8e2b20b0a38ce37552be00130c4117533ea9) )
482
483   ROM_REGION( 0x10000, "audio", 0 )
484   ROM_LOAD( "km06.18p",    0x00000, 0x10000, CRC(3e8bc4e1) SHA1(7e4c357afefa47b8f101727e06485eb9ebae635d) )
485
486   ROM_REGION( 0x20000, "tiles1", ROMREGION_DISPOSE ) /* Tiles 1 */
487   ROM_LOAD16_BYTE( "km05.9e",   0x00000, 0x010000, CRC(d10aef95) SHA1(a611a35ab312caee19c31da079c647679d31673d) )
488   ROM_LOAD16_BYTE( "km04.8e",   0x00001, 0x010000, CRC(329323a8) SHA1(e2ec7b059301c0a2e052dfc683e044c808ad9b33) )
489
490   ROM_REGION( 0x300000, "tiles2", ROMREGION_DISPOSE ) /* Tiles 2 */
491   ROM_LOAD( "mbd-01.9b", 0x000000, 0x100000, CRC(d7de4f4b) SHA1(4747f8795e277ed8106667b6f68e1176d95db684) )
492   ROM_LOAD( "mbd-00.8b", 0x100000, 0x100000, CRC(adb20ba9) SHA1(2ffa1dd19a438a4d2f5743b1050a8037183a3e7d) )
493   /* 0x100000 bytes expanded from mbd-02.10e copied here later */
494
495   ROM_REGION( 0x200000, "tiles3", ROMREGION_DISPOSE ) /* Tiles 3 */
496   ROM_LOAD( "mbd-03.13b",   0x000000, 0x100000, CRC(cf798f2c) SHA1(f484a22679d6a4d4b0dcac820de3f1a37cbc478f) )
497   ROM_LOAD( "mbd-04.14b",   0x100000, 0x100000, CRC(d9764d0b) SHA1(74d6f09d65d073606a6e10556cedf740aa50ff08) )
498
499   ROM_REGION( 0x400000, "sprites1", ROMREGION_DISPOSE ) /* Sprites 1 */
500   ROM_LOAD16_BYTE( "mbd-05.16b",    0x000001, 0x200000, CRC(1768c66a) SHA1(06bf3bb187c65db9dcce959a43a7231e2ac45c17) )
501   ROM_LOAD16_BYTE( "mbd-06.17b",    0x000000, 0x200000, CRC(7750847a) SHA1(358266ed68a9816094e7aab0905d958284c8ce98) )
502
503   ROM_REGION( 0x400000, "sprites2", ROMREGION_DISPOSE ) /* Sprites 2 */
504   ROM_LOAD16_BYTE( "mbd-07.18b",    0x000001, 0x200000, CRC(241faac1) SHA1(588be0cf2647c1d185a99c987a5a20ab7ad8dea8) )
505   ROM_LOAD16_BYTE( "mbd-08.19b",    0x000000, 0x200000, CRC(f13b1e56) SHA1(f8f5e8c4e6c159f076d4e6505bd901ade5c6a0ca) )
506
507   ROM_REGION( 0x0100000, "gfx6", ROMREGION_DISPOSE ) /* 1bpp graphics */
508   ROM_LOAD16_BYTE( "mbd-02.10e",    0x000000, 0x080000, CRC(b25aa721) SHA1(efe800759080bd1dac2da93bd79062a48c5da2b2) )
509
510   ROM_REGION( 0x80000, "oki1", 0 ) /* Oki samples 1 */
511   ROM_LOAD( "mbd-10.17p",    0x000000, 0x080000, CRC(f159f76a) SHA1(0b1ea69fecdd151e2b1fa96a21eade492499691d) )
512
513   ROM_REGION( 0x80000, "oki2", 0 ) /* Oki samples 1 */
514   ROM_LOAD( "mbd-09.16p",    0x000000, 0x080000, CRC(f44f2f87) SHA1(d941520bdfc9e6d88c45462bc1f697c18f33498e) )
515
516   ROM_REGION( 0x000400, "proms", ROMREGION_DISPOSE ) /* Priority (not used) */
517   ROM_LOAD( "kj-00.15n",    0x000000, 0x00400, CRC(add4d50b) SHA1(080e5a8192a146d5141aef5c8d9996ddf8cd3ab4) )
518ROM_END
519
475520static DRIVER_INIT( boogwing )
476521{
477522   const UINT8* src=memory_region(machine, "gfx6");
r3232r3233
488533GAME( 1992, boogwing, 0,        boogwing, boogwing,  boogwing,  ROT0, "Data East Corporation", "Boogie Wings (Euro v1.5, 92.12.07)", 0 )
489534GAME( 1992, boogwina, boogwing, boogwing, boogwing,  boogwing,  ROT0, "Data East Corporation", "Boogie Wings (Asia v1.5, 92.12.07)", 0 )
490535GAME( 1992, ragtime,  boogwing, boogwing, boogwing,  boogwing,  ROT0, "Data East Corporation", "The Great Ragtime Show (Japan v1.5, 92.12.07)", 0 )
536GAME( 1992, ragtimea, boogwing, boogwing, boogwing,  boogwing,  ROT0, "Data East Corporation", "The Great Ragtime Show (Japan v1.3, 92.11.26)", 0 )
src/mame/drivers/quizdna.c
r3232r3233
6666   AM_RANGE(0xf200, 0xffff) AM_WRITE(SMH_RAM)
6767ADDRESS_MAP_END
6868
69static ADDRESS_MAP_START( quizdna_readport, ADDRESS_SPACE_IO, 8 )
69static ADDRESS_MAP_START( quizdna_io_map, ADDRESS_SPACE_IO, 8 )
7070   ADDRESS_MAP_GLOBAL_MASK(0xff)
71   AM_RANGE(0x02, 0x03) AM_WRITE(quizdna_bg_xscroll_w)
72   AM_RANGE(0x04, 0x04) AM_WRITE(quizdna_bg_yscroll_w)
73   AM_RANGE(0x05, 0x06) AM_WRITE(SMH_NOP) /* unknown */
7174   AM_RANGE(0x80, 0x80) AM_READ_PORT("P1")
7275   AM_RANGE(0x81, 0x81) AM_READ_PORT("P2")
7376   AM_RANGE(0x90, 0x90) AM_READ_PORT("SYSTEM")
7477   AM_RANGE(0x91, 0x91) AM_READ_PORT("SERVICE")
75   AM_RANGE(0xe0, 0xe0) AM_READ(ym2203_status_port_0_r)
76   AM_RANGE(0xe1, 0xe1) AM_READ(ym2203_read_port_0_r)
77   AM_RANGE(0xf0, 0xf0) AM_READ(okim6295_status_0_r)
78
79ADDRESS_MAP_END
80
81static ADDRESS_MAP_START( quizdna_writeport, ADDRESS_SPACE_IO, 8 )
82   ADDRESS_MAP_GLOBAL_MASK(0xff)
83   AM_RANGE(0x02, 0x03) AM_WRITE(quizdna_bg_xscroll_w)
84   AM_RANGE(0x04, 0x04) AM_WRITE(quizdna_bg_yscroll_w)
85   AM_RANGE(0x05, 0x06) AM_WRITE(SMH_NOP) /* unknown */
8678   AM_RANGE(0xc0, 0xc0) AM_WRITE(quizdna_rombank_w)
8779   AM_RANGE(0xd0, 0xd0) AM_WRITE(quizdna_screen_ctrl_w)
88   AM_RANGE(0xe0, 0xe0) AM_WRITE(ym2203_control_port_0_w)
89   AM_RANGE(0xe1, 0xe1) AM_WRITE(ym2203_write_port_0_w)
90   AM_RANGE(0xf0, 0xf0) AM_WRITE(okim6295_data_0_w)
80   AM_RANGE(0xe0, 0xe0) AM_READWRITE(ym2203_status_port_0_r, ym2203_control_port_0_w)
81   AM_RANGE(0xe1, 0xe1) AM_READWRITE(ym2203_read_port_0_r, ym2203_write_port_0_w)
82   AM_RANGE(0xf0, 0xf0) AM_READWRITE(okim6295_status_0_r, okim6295_data_0_w)
9183ADDRESS_MAP_END
9284
93static ADDRESS_MAP_START( gakupara_writeport, ADDRESS_SPACE_IO, 8 )
85static ADDRESS_MAP_START( gakupara_io_map, ADDRESS_SPACE_IO, 8 )
9486   ADDRESS_MAP_GLOBAL_MASK(0xff)
9587   AM_RANGE(0x00, 0x01) AM_WRITE(quizdna_bg_xscroll_w)
9688   AM_RANGE(0x02, 0x02) AM_WRITE(quizdna_bg_yscroll_w)
9789   AM_RANGE(0x03, 0x04) AM_WRITE(SMH_NOP) /* unknown */
90   AM_RANGE(0x80, 0x80) AM_READ_PORT("P1")
91   AM_RANGE(0x81, 0x81) AM_READ_PORT("P2")
92   AM_RANGE(0x90, 0x90) AM_READ_PORT("SYSTEM")
93   AM_RANGE(0x91, 0x91) AM_READ_PORT("SERVICE")
9894   AM_RANGE(0xc0, 0xc0) AM_WRITE(quizdna_rombank_w)
9995   AM_RANGE(0xd0, 0xd0) AM_WRITE(quizdna_screen_ctrl_w)
100   AM_RANGE(0xe0, 0xe0) AM_WRITE(ym2203_control_port_0_w)
101   AM_RANGE(0xe1, 0xe1) AM_WRITE(ym2203_write_port_0_w)
102   AM_RANGE(0xf0, 0xf0) AM_WRITE(okim6295_data_0_w)
96   AM_RANGE(0xe0, 0xe0) AM_READWRITE(ym2203_status_port_0_r, ym2203_control_port_0_w)
97   AM_RANGE(0xe1, 0xe1) AM_READWRITE(ym2203_read_port_0_r, ym2203_write_port_0_w)
98   AM_RANGE(0xf0, 0xf0) AM_READWRITE(okim6295_status_0_r, okim6295_data_0_w)
10399ADDRESS_MAP_END
104100
105static ADDRESS_MAP_START( gekiretu_writeport, ADDRESS_SPACE_IO, 8 )
101static ADDRESS_MAP_START( gekiretu_io_map, ADDRESS_SPACE_IO, 8 )
106102   ADDRESS_MAP_GLOBAL_MASK(0xff)
107103   AM_RANGE(0x02, 0x03) AM_WRITE(quizdna_bg_xscroll_w)
108104   AM_RANGE(0x04, 0x04) AM_WRITE(quizdna_bg_yscroll_w)
109105   AM_RANGE(0x05, 0x06) AM_WRITE(SMH_NOP) /* unknown */
106   AM_RANGE(0x80, 0x80) AM_READ_PORT("P1")
107   AM_RANGE(0x81, 0x81) AM_READ_PORT("P2")
108   AM_RANGE(0x90, 0x90) AM_READ_PORT("SYSTEM")
109   AM_RANGE(0x91, 0x91) AM_READ_PORT("SERVICE")
110110   AM_RANGE(0xc0, 0xc0) AM_WRITE(gekiretu_rombank_w)
111111   AM_RANGE(0xd0, 0xd0) AM_WRITE(quizdna_screen_ctrl_w)
112   AM_RANGE(0xe0, 0xe0) AM_WRITE(ym2203_control_port_0_w)
113   AM_RANGE(0xe1, 0xe1) AM_WRITE(ym2203_write_port_0_w)
114   AM_RANGE(0xf0, 0xf0) AM_WRITE(okim6295_data_0_w)
112   AM_RANGE(0xe0, 0xe0) AM_READWRITE(ym2203_status_port_0_r, ym2203_control_port_0_w)
113   AM_RANGE(0xe1, 0xe1) AM_READWRITE(ym2203_read_port_0_r, ym2203_write_port_0_w)
114   AM_RANGE(0xf0, 0xf0) AM_READWRITE(okim6295_status_0_r, okim6295_data_0_w)
115115ADDRESS_MAP_END
116116
117
117118/****************************************************************************/
118119
119120static INPUT_PORTS_START( quizdna )
r3232r3233
462463   /* basic machine hardware */
463464   MDRV_CPU_ADD("main", Z80, MCLK/2) /* 8.000 MHz */
464465   MDRV_CPU_PROGRAM_MAP(quizdna_readmem,quizdna_writemem)
465   MDRV_CPU_IO_MAP(quizdna_readport,quizdna_writeport)
466   MDRV_CPU_IO_MAP(quizdna_io_map,0)
466467   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
467468
468469   /* video hardware */
r3232r3233
500501   MDRV_IMPORT_FROM(quizdna)
501502
502503   MDRV_CPU_MODIFY("main")
503   MDRV_CPU_IO_MAP(quizdna_readport,gakupara_writeport)
504   MDRV_CPU_IO_MAP(gakupara_io_map,0)
504505
505506MACHINE_DRIVER_END
506507
r3232r3233
511512
512513   MDRV_CPU_MODIFY("main")
513514   MDRV_CPU_PROGRAM_MAP(quizdna_readmem,gekiretu_writemem)
514   MDRV_CPU_IO_MAP(quizdna_readport,gekiretu_writeport)
515   MDRV_CPU_IO_MAP(gekiretu_io_map,0)
515516
516517MACHINE_DRIVER_END
517518
r3232r3233
541542
542543   ROM_REGION( 0x00020, "user1", 0 ) /* fg control */
543544   ROM_LOAD( "quiz2.148",    0x000000,  0x000020, CRC(91267e8a) SHA1(ae5bd8efea5322c4d9986d06680a781392f9a642) )
544
545545ROM_END
546546
547547ROM_START( gakupara )
r3232r3233
567567
568568   ROM_REGION( 0x00020, "user1", 0 ) /* fg control */
569569   ROM_LOAD( "u148.bin", 0x000000,  0x000020, CRC(971df9d2) SHA1(280f5b386922b9902ca9211c719642c2bd0ba899) )
570
571570ROM_END
572571
573572ROM_START( gekiretu )
r3232r3233
593592
594593   ROM_REGION( 0x00020, "user1", 0 ) /* fg control */
595594   ROM_LOAD( "quiz3.148",    0x000000,  0x000020, CRC(91267e8a) SHA1(ae5bd8efea5322c4d9986d06680a781392f9a642) )
596
597595ROM_END
598596
599597GAME( 1991, gakupara, 0, gakupara, gakupara, 0, ROT0, "NMK",  "Quiz Gakuen Paradise (Japan)", 0 )
src/mame/drivers/darkhors.c
r3232r3233
295295   // from bit mask to bit number
296296   int bit_p1 = mask_to_bit((input_sel & 0x00ff0000) >> 16);
297297   int bit_p2 = mask_to_bit((input_sel & 0xff000000) >> 24);
298   static const char *portnames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
298   static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
299299
300300   return   (input_port_read(machine, portnames[bit_p1]) & 0x00ffffff) |
301301         (input_port_read(machine, portnames[bit_p2]) & 0xff000000) ;
src/mame/drivers/bishjan.c
r3232r3233
221221{
222222   int i;
223223   UINT16 res = 0xff;
224   static const char *port[] = { "KEYB_0", "KEYB_1", "KEYB_2", "KEYB_3", "KEYB_4" };
224   static const char *const port[] = { "KEYB_0", "KEYB_1", "KEYB_2", "KEYB_3", "KEYB_4" };
225225
226226   for (i = 0; i < 5; i++)
227227      if (bishjan_input & (1 << i))
src/mame/drivers/equites.c
r3232r3233
12951295   ROM_LOAD( "ev3.1k", 0x04000, 0x2000, CRC(10ff140b) SHA1(7c28f988a9c8b2a702d007096199e67b447a183c) )
12961296   ROM_LOAD( "ev4.1h", 0x06000, 0x2000, CRC(b7917264) SHA1(e58345fda088b171fd348959de15082f3cb42514) )
12971297
1298   ROM_REGION( 0x2000, "MCU", 0 )
1298   ROM_REGION( 0x2000, "mcu", 0 )
12991299   ROM_LOAD( "8303.bin", 0x0000, 0x2000, CRC(66adcb37) SHA1(e1c72ecb161129dcbddc0b16dd90e716d0c79311) )
13001300
13011301   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE ) // chars
r3232r3233
13591359   ROM_LOAD( "ev3.1k", 0x04000, 0x2000, CRC(10ff140b) SHA1(7c28f988a9c8b2a702d007096199e67b447a183c) )
13601360   ROM_LOAD( "ev4.1h", 0x06000, 0x2000, CRC(b7917264) SHA1(e58345fda088b171fd348959de15082f3cb42514) )
13611361
1362   ROM_REGION( 0x2000, "MCU", 0 )
1362   ROM_REGION( 0x2000, "mcu", 0 )
13631363   ROM_LOAD( "8303.bin", 0x0000, 0x2000, CRC(66adcb37) SHA1(e1c72ecb161129dcbddc0b16dd90e716d0c79311) )
13641364
13651365   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE ) // chars
r3232r3233
14171417   ROM_LOAD( "hv3vr.bin", 0x04000, 0x2000, CRC(51ee751c) SHA1(60bf848dfdfe313ab05df5a5c05819b0fa87ca50) )
14181418   ROM_LOAD( "hv4vr.bin", 0x06000, 0x2000, CRC(62c7a25b) SHA1(237d3cbdfbf45b33c2f65d30faba151380866a93) )
14191419
1420   ROM_REGION( 0x2000, "MCU", 0 )
1420   ROM_REGION( 0x2000, "mcu", 0 )
14211421   ROM_LOAD( "8303.bin", 0x0000, 0x2000, CRC(66adcb37) SHA1(e1c72ecb161129dcbddc0b16dd90e716d0c79311) )
14221422
14231423   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE ) // chars
r3232r3233
14991499   ROM_LOAD( "hv3vr.bin", 0x04000, 0x2000, CRC(51ee751c) SHA1(60bf848dfdfe313ab05df5a5c05819b0fa87ca50) )
15001500   ROM_LOAD( "hv4vr.bin", 0x06000, 0x2000, CRC(62c7a25b) SHA1(237d3cbdfbf45b33c2f65d30faba151380866a93) )
15011501
1502   ROM_REGION( 0x2000, "MCU", 0 )
1502   ROM_REGION( 0x2000, "mcu", 0 )
15031503   ROM_LOAD( "8303.bin", 0x0000, 0x2000, CRC(66adcb37) SHA1(e1c72ecb161129dcbddc0b16dd90e716d0c79311) )
15041504
15051505   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE ) // chars
r3232r3233
16971697   ROM_LOAD( "3_v.1k", 0x04000, 0x2000, CRC(bbee5346) SHA1(753cb784b04f081fa1f8590dc28056d9918f313b) )
16981698   ROM_LOAD( "4_v.1h", 0x06000, 0x2000, CRC(10f45af4) SHA1(00fa599bad8bf3ba6deee54165f381403096e8f9) )
16991699
1700   ROM_REGION( 0x2000, "MCU", 0 )
1700   ROM_REGION( 0x2000, "mcu", 0 )
17011701   ROM_LOAD( "8303.bin", 0x0000, 0x2000, CRC(66adcb37) SHA1(e1c72ecb161129dcbddc0b16dd90e716d0c79311) )
17021702
17031703   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )   // chars
r3232r3233
18001800/******************************************************************************/
18011801// Initializations
18021802
1803static void unpack_block(const char *region, int offset, int size)
1803static void unpack_block(running_machine *machine, const char *region, int offset, int size)
18041804{
1805   UINT8 *rom = memory_region(Machine, region);
1805   UINT8 *rom = memory_region(machine, region);
18061806   int i;
18071807
18081808   for (i = 0; i < size; ++i)
r3232r3233
18121812   }
18131813}
18141814
1815static void unpack_region(const char *region)
1815static void unpack_region(running_machine *machine, const char *region)
18161816{
1817   unpack_block(region, 0x0000, 0x2000);
1818   unpack_block(region, 0x4000, 0x2000);
1817   unpack_block(machine, region, 0x0000, 0x2000);
1818   unpack_block(machine, region, 0x4000, 0x2000);
18191819}
18201820
18211821
18221822static DRIVER_INIT( equites )
18231823{
1824   unpack_region("gfx2");
1825   unpack_region("gfx3");
1824   unpack_region(machine, "gfx2");
1825   unpack_region(machine, "gfx3");
18261826}
18271827
18281828static DRIVER_INIT( bullfgtr )
18291829{
1830   unpack_region("gfx2");
1831   unpack_region("gfx3");
1830   unpack_region(machine, "gfx2");
1831   unpack_region(machine, "gfx3");
18321832}
18331833
18341834static DRIVER_INIT( kouyakyu )
18351835{
1836   unpack_region("gfx2");
1837   unpack_region("gfx3");
1836   unpack_region(machine, "gfx2");
1837   unpack_region(machine, "gfx3");
18381838}
18391839
18401840static DRIVER_INIT( gekisou )
18411841{
1842   unpack_region("gfx2");
1843   unpack_region("gfx3");
1842   unpack_region(machine, "gfx2");
1843   unpack_region(machine, "gfx3");
18441844
18451845   // install special handlers for unknown device (protection?)
18461846   memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x580000, 0x580001, 0, 0, gekisou_unknown_0_w);
r3232r3233
18491849
18501850static DRIVER_INIT( splndrbt )
18511851{
1852   unpack_region("gfx3");
1852   unpack_region(machine, "gfx3");
18531853}
18541854
18551855static DRIVER_INIT( hvoltage )
18561856{
1857   unpack_region("gfx3");
1857   unpack_region(machine, "gfx3");
18581858
18591859#if HVOLTAGE_DEBUG
18601860   memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x000038, 0x000039, 0, 0, hvoltage_debug_r);
src/mame/drivers/esh.c
r3232r3233
266266   // IRQ
267267   cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
268268   timer_set(ATTOTIME_IN_USEC(50), NULL, 0, irq_stop);
269
270   laserdisc_vsync(laserdisc);
271269}
272270
273271static MACHINE_START( esh )
r3232r3233
289287
290288   MDRV_MACHINE_START(esh)
291289
292   MDRV_LASERDISC_ADD("laserdisc", PIONEER_LDV1000)
290   MDRV_LASERDISC_ADD("laserdisc", PIONEER_LDV1000, "main", "ldsound")
293291   MDRV_LASERDISC_OVERLAY(esh, 256, 256, BITMAP_FORMAT_INDEXED16)
294292
295293   /* video hardware */
r3232r3233
303301   /* sound hardware */
304302   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
305303
306   MDRV_SOUND_ADD("laserdisc", CUSTOM, 0)
304   MDRV_SOUND_ADD("ldsound", CUSTOM, 0)
307305   MDRV_SOUND_CONFIG(laserdisc_custom_interface)
308306   MDRV_SOUND_ROUTE(0, "left", 1.0)
309307   MDRV_SOUND_ROUTE(1, "right", 1.0)
src/mame/drivers/neodrvr.c
r3232r3233
49994999   ROM_LOAD( "sfix.sfx",  0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
50005000
50015001   /* The M1 ROM is encrypted, we load it here for reference and replace it with a decrypted version */
5002   ROM_REGION( 0x40000, "audioencrypted", 0 )
5002   ROM_REGION( 0x40000, "audiocrypt", 0 )
50035003   ROM_LOAD( "257-m1.bin", 0x00000, 0x40000, CRC(4b749113) SHA1(2af2361146edd0ce3966614d90165a5c1afb8de4) )
50045004   NEO_BIOS_AUDIO_256K( "257-m1_decrypted.bin", CRC(d404db70) SHA1(8cd1f3e140a9a367de23544e76371b0491287909) )
50055005
r3232r3233
50365036   ROM_LOAD( "sfix.sfx",  0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
50375037
50385038   /* The M1 ROM is encrypted, we load it here for reference and replace it with a decrypted version */
5039   ROM_REGION( 0x40000, "audioencrypted", 0 )
5039   ROM_REGION( 0x40000, "audiocrypt", 0 )
50405040   ROM_LOAD( "257-m1.bin", 0x00000, 0x40000, CRC(4b749113) SHA1(2af2361146edd0ce3966614d90165a5c1afb8de4) )
50415041   NEO_BIOS_AUDIO_256K( "257-m1_decrypted.bin", CRC(d404db70) SHA1(8cd1f3e140a9a367de23544e76371b0491287909) )
50425042
r3232r3233
52055205   ROM_LOAD( "sfix.sfx",  0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
52065206
52075207   /* The M1 ROM is encrypted, we load it here for reference and replace it with a decrypted version */
5208   ROM_REGION( 0x40000, "audioencrypted", 0 )
5208   ROM_REGION( 0x40000, "audiocrypt", 0 )
52095209   ROM_LOAD( "265-262-m1.bin", 0x00000, 0x40000, CRC(a7f8119f) SHA1(71805b39b8b09c32425cf39f9de59b2f755976c2) ) /* yes it really does have a strange name */
52105210   /* Decrypted */
52115211   NEO_BIOS_AUDIO_256K( "265-262_decrypted-m1.bin", CRC(4bcc537b) SHA1(9fcf1342bcd53d5eec12c46ee41a51bf543256c2) )
r3232r3233
52445244   ROM_LOAD( "sfix.sfx",  0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
52455245
52465246   /* The M1 ROM is encrypted, we load it here for reference and replace it with a decrypted version */
5247   ROM_REGION( 0x40000, "audioencrypted", 0 )
5247   ROM_REGION( 0x40000, "audiocrypt", 0 )
52485248   ROM_LOAD( "265-262-m1.bin", 0x00000, 0x40000, CRC(a7f8119f) SHA1(71805b39b8b09c32425cf39f9de59b2f755976c2) ) /* yes it really does have a strange name */
52495249   /* Decrypted */
52505250   NEO_BIOS_AUDIO_256K( "265-262_decrypted-m1.bin", CRC(4bcc537b) SHA1(9fcf1342bcd53d5eec12c46ee41a51bf543256c2) )
r3232r3233
52835283   ROM_LOAD( "sfix.sfx",  0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
52845284
52855285   /* The M1 ROM is encrypted, we load it here for reference and replace it with a decrypted version */
5286   ROM_REGION( 0x20000, "audioencrypted", 0 )
5286   ROM_REGION( 0x20000, "audiocrypt", 0 )
52875287   ROM_LOAD( "263-m1.bin", 0x00000, 0x20000, CRC(46ac8228) SHA1(5aeea221050c98e4bb0f16489ce772bf1c80f787) )
52885288   /* Decrypted */
52895289   NEO_BIOS_AUDIO_128K( "263-m1_decrypted.bin", CRC(ef5db532) SHA1(4aeba9e206b8f309610eb7e1891644f39aa61830) )
r3232r3233
53445344   ROM_REGION( 0x20000, "fixedbios", 0 )
53455345   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
53465346
5347   ROM_REGION( 0x20000, "audioencrypted", 0 )
5347   ROM_REGION( 0x20000, "audiocrypt", 0 )
53485348   /* Encrypted, we load it here for reference and replace with decrypted ROM */
53495349   ROM_LOAD( "264-m1.bin", 0x00000, 0x20000, CRC(4dbd7b43) SHA1(6b63756b0d2d30bbf13fbd219833c81fd060ef96) )
53505350   /* Decrypted */
r3232r3233
53825382   ROM_REGION( 0x20000, "fixedbios", 0 )
53835383   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
53845384
5385   ROM_REGION( 0x20000, "audioencrypted", 0 )
5385   ROM_REGION( 0x20000, "audiocrypt", 0 )
53865386   /* Encrypted, we load it here for reference and replace with decrypted ROM */
53875387   ROM_LOAD( "265-m1.bin", 0x00000, 0x20000, CRC(85aaa632) SHA1(744fba4ca3bc3a5873838af886efb97a8a316104) )
53885388   /* Decrypted */
r3232r3233
54145414
54155415   NEO_SFIX_128K( "265-s1p.bin", CRC(595e0006) SHA1(ff086bdaa6f40e9ad963e1100a27f44618d684ed) )
54165416
5417   ROM_REGION( 0x20000, "audioencrypted", 0 )
5417   ROM_REGION( 0x20000, "audiocrypt", 0 )
54185418   /* Encrypted, we load it here for reference and replace with decrypted ROM */
54195419   ROM_LOAD( "265-m1.bin", 0x00000, 0x20000, CRC(85aaa632) SHA1(744fba4ca3bc3a5873838af886efb97a8a316104) )
54205420   /* Decrypted */
r3232r3233
54465446
54475447   NEO_SFIX_128K( "265-s1pa.bin",  CRC(1a3ed064) SHA1(9749bb55c750e6b65d651998c2649c5fb68db68e))
54485448
5449   ROM_REGION( 0x20000, "audioencrypted", 0 )
5449   ROM_REGION( 0x20000, "audiocrypt", 0 )
54505450   /* Encrypted, we load it here for reference and replace with decrypted ROM */
54515451   ROM_LOAD( "265-m1.bin", 0x00000, 0x20000, CRC(85aaa632) SHA1(744fba4ca3bc3a5873838af886efb97a8a316104) )
54525452   /* Decrypted */
r3232r3233
55385538   ROM_REGION( 0x20000, "fixedbios", 0 )
55395539   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
55405540
5541   ROM_REGION( 0x20000, "audioencrypted", 0 )
5541   ROM_REGION( 0x20000, "audiocrypt", 0 )
55425542   /* Encrypted, we load it here for reference and replace with decrypted ROM */
55435543   ROM_LOAD( "266-m1.bin", 0x00000, 0x20000, CRC(456c3e6c) SHA1(5a07d0186198a18d2dda1331093cf29b0b9b2984) )
55445544   /* Decrypted */
r3232r3233
55755575   ROM_REGION( 0x20000, "fixedbios", 0 )
55765576   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
55775577
5578   ROM_REGION( 0x80000, "audioencrypted", 0 )
5578   ROM_REGION( 0x80000, "audiocrypt", 0 )
55795579   /* Encrypted, we load it here for reference and replace with decrypted ROM */
55805580   ROM_LOAD( "267-m1.bin", 0x00000, 0x80000, CRC(c7853ccd) SHA1(1b7a4c5093cf0fe3861ce44fd1d3b30c71ad0abe) )
55815581   /* Decrypted */
r3232r3233
56065606   ROM_REGION( 0x20000, "fixedbios", 0 )
56075607   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
56085608
5609   ROM_REGION( 0x80000, "audioencrypted", 0 )
5609   ROM_REGION( 0x80000, "audiocrypt", 0 )
56105610   /* Encrypted, we load it here for reference and replace with decrypted ROM */
56115611   ROM_LOAD( "268-m1.bin", 0x00000, 0x80000, CRC(4a5a6e0e) SHA1(df0f660f2465e1db7be5adfcaf5e88ad61a74a42) )
56125612   /* Decrypted */
r3232r3233
56445644   ROM_REGION( 0x20000, "fixedbios", 0 )
56455645   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
56465646
5647   ROM_REGION( 0x80000, "audioencrypted", 0 )
5647   ROM_REGION( 0x80000, "audiocrypt", 0 )
56485648   /* Encrypted, we load it here for reference and replace with decrypted ROM */
56495649   ROM_LOAD( "268-m1h.bin", 0x00000, 0x80000, CRC(4a5a6e0e) SHA1(df0f660f2465e1db7be5adfcaf5e88ad61a74a42) ) /* Same as MVS above, but different label */
56505650   /* Decrypted */
r3232r3233
57215721   ROM_REGION( 0x20000, "fixedbios", 0 )
57225722   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
57235723
5724   ROM_REGION( 0x80000, "audioencrypted", 0 )
5724   ROM_REGION( 0x80000, "audiocrypt", 0 )
57255725   /* Encrypted, we load it here for reference and replace with decrypted ROM */
57265726   ROM_LOAD( "268-m1.bin", 0x00000, 0x80000, CRC(4a5a6e0e) SHA1(df0f660f2465e1db7be5adfcaf5e88ad61a74a42) )
57275727   /* Decrypted */
r3232r3233
58285828   ROM_REGION( 0x20000, "fixedbios", 0 )
58295829   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
58305830
5831   ROM_REGION( 0x80000, "audioencrypted", 0 )
5831   ROM_REGION( 0x80000, "audiocrypt", 0 )
58325832   /* Encrypted, we load it here for reference and replace with decrypted ROM */
58335833   ROM_LOAD( "269-m1.bin", 0x00000, 0x80000, CRC(f6819d00) SHA1(d3bbe09df502464f104e53501708ac6e2c1832c6) )
58345834   /* Decrypted */
r3232r3233
60206020   ROM_REGION( 0x20000, "fixedbios", 0 )
60216021   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
60226022
6023   ROM_REGION( 0x80000, "audioencrypted", 0 )
6023   ROM_REGION( 0x80000, "audiocrypt", 0 )
60246024   /* Encrypted, we load it here for reference and replace with decrypted ROM */
60256025   ROM_LOAD( "270-m1.bin", 0x00000, 0x80000, CRC(49c9901a) SHA1(2623e9765a0eba58fee2de72851e9dc502344a3d) )
60266026   /* Decrypted */
r3232r3233
60586058   ROM_REGION( 0x20000, "fixedbios", 0 )
60596059   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
60606060
6061   ROM_REGION( 0x80000, "audioencrypted", 0 )
6061   ROM_REGION( 0x80000, "audiocrypt", 0 )
60626062   /* Encrypted, we load it here for reference and replace with decrypted ROM */
60636063   ROM_LOAD( "270-m1.bin", 0x00000, 0x80000, CRC(49c9901a) SHA1(2623e9765a0eba58fee2de72851e9dc502344a3d) )
60646064   /* Decrypted */
r3232r3233
60966096   ROM_REGION( 0x20000, "fixedbios", 0 )
60976097   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
60986098
6099   ROM_REGION( 0x80000, "audioencrypted", 0 )
6099   ROM_REGION( 0x80000, "audiocrypt", 0 )
61006100   /* Encrypted, we load it here for reference and replace with decrypted ROM */
61016101   ROM_LOAD( "270-m1.bin", 0x00000, 0x80000, CRC(49c9901a) SHA1(2623e9765a0eba58fee2de72851e9dc502344a3d) )
61026102   /* Decrypted */
r3232r3233
61746174   ROM_REGION( 0x20000, "fixedbios", 0 )
61756175   ROM_LOAD( "sfix.sfx",  0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
61766176
6177   ROM_REGION( 0x080000, "audioencrypted", 0 )
6177   ROM_REGION( 0x080000, "audiocrypt", 0 )
61786178   /* The M1 ROM is encrypted, we load it here for reference and replace it with a decrypted version */
61796179   ROM_LOAD( "271-m1c.bin", 0x00000, 0x080000, CRC(f5515629) SHA1(7516bf1b0207a3c8d41dc30c478f8d8b1f71304b) )
61806180   /* Decrypted */
r3232r3233
63296329   ROM_REGION( 0x20000, "fixedbios", 0 )
63306330   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
63316331
6332   ROM_REGION( 0x80000, "audioencrypted", 0 )
6332   ROM_REGION( 0x80000, "audiocrypt", 0 )
63336333   /* Encrypted, we load it here for reference and replace with decrypted ROM */
63346334   ROM_LOAD( "272-m1.bin", 0x00000, 0x80000, CRC(adeebf40) SHA1(8cbd63dda3fff4de38060405bf70cd9308c9e66e) )
63356335   /* Decrypted */
r3232r3233
63676367   ROM_REGION( 0x20000, "fixedbios", 0 )
63686368   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
63696369
6370   ROM_REGION( 0x80000, "audioencrypted", 0 )
6370   ROM_REGION( 0x80000, "audiocrypt", 0 )
63716371   /* Encrypted, we load it here for reference and replace with decrypted ROM */
63726372   ROM_LOAD( "272-m1.bin", 0x00000, 0x80000, CRC(adeebf40) SHA1(8cbd63dda3fff4de38060405bf70cd9308c9e66e) )
63736373   /* Decrypted */
r3232r3233
64056405   ROM_REGION( 0x20000, "fixedbios", 0 )
64066406   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
64076407
6408   ROM_REGION( 0x80000, "audioencrypted", 0 )
6408   ROM_REGION( 0x80000, "audiocrypt", 0 )
64096409   /* Encrypted, we load it here for reference and replace with decrypted ROM */
64106410   ROM_LOAD( "272-m1.bin", 0x00000, 0x80000, CRC(adeebf40) SHA1(8cbd63dda3fff4de38060405bf70cd9308c9e66e) )
64116411   /* Decrypted */
r3232r3233
64436443   ROM_REGION( 0x20000, "fixedbios", 0 )
64446444   ROM_LOAD( "sfix.sfx", 0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
64456445
6446   ROM_REGION( 0x80000, "audioencrypted", 0 )
6446   ROM_REGION( 0x80000, "audiocrypt", 0 )
64476447    /* encrypted, we load it here for reference and replace with decrypted ROM */
64486448   ROM_LOAD( "jgp-m1.bin", 0x00000, 0x80000, CRC(d163c690) SHA1(1dfd04d20c5985037f07cd01000d0b04f3a8f4f4) )
64496449   /* Decrypted */
r3232r3233
67226722   ROM_LOAD16_WORD_SWAP( "5008-p2.rom", 0x100000, 0x400000, CRC(a649ec38) SHA1(5c63ed5e5c848940f587c966da4908d04cf1293c) )
67236723   ROM_LOAD16_WORD_SWAP( "5008-p3.rom", 0x500000, 0x200000, CRC(e629e13c) SHA1(6ebe080ce01c51064cb2f4d89315ba98a45ae727) )
67246724
6725   ROM_REGION( 0x200000, "audioencrypted", 0 )
6725   ROM_REGION( 0x200000, "audiocrypt", 0 )
67266726   ROM_LOAD( "5008-p1.rom", 0x000000, 0x200000, CRC(bf5469ba) SHA1(f05236d8fffab5836c0d27becdeeb80def32ee49) )
67276727
67286728   NEO_SFIX_128K( "5008-s1.rom", CRC(92410064) SHA1(1fb800b46341858207d3b6961a760289fbec7faa) )
src/mame/drivers/mirax.c
r3232r3233
6464#include "deprecat.h"
6565#include "sound/ay8910.h"
6666
67static int nSndNum=0x10;
68static int nAyCtrl, nAyData;
67static UINT8 nSndNum;
68static UINT8 nAyCtrl, nAyData;
6969
7070static VIDEO_START(mirax)
7171{
r3232r3233
8585}
8686
8787
88static SOUND_START(mirax)
89{
90   nSndNum = 0x10;
91   nAyCtrl = 0x00;
92   nAyData = 0x00;
93}
94
8895static READ8_HANDLER(snd_read)
8996{
9097   /* bit 6 is used to select AY (1st or 2nd) */
r3232r3233
195202   MDRV_VIDEO_START(mirax)
196203   MDRV_VIDEO_UPDATE(mirax)
197204
205   MDRV_SOUND_START(mirax)
206
198207   MDRV_SPEAKER_STANDARD_MONO("mono")
199208   MDRV_SOUND_ADD("ay1", AY8910, 12000000/6 /* guess */)
200209   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
src/mame/drivers/fromance.c
r3232r3233
326326 *
327327 *************************************/
328328
329static ADDRESS_MAP_START( nekkyoku_readport_sub, ADDRESS_SPACE_IO, 8 )
329static ADDRESS_MAP_START( nekkyoku_sub_io_map, ADDRESS_SPACE_IO, 8 )
330330   ADDRESS_MAP_GLOBAL_MASK(0xff)
331   AM_RANGE(0x12, 0x12) AM_READ(SMH_NOP)            // unknown
332   AM_RANGE(0xe1, 0xe1) AM_READ(fromance_busycheck_sub_r)
333   AM_RANGE(0xe6, 0xe6) AM_READ(fromance_commanddata_r)
334ADDRESS_MAP_END
335
336static ADDRESS_MAP_START( nekkyoku_writeport_sub, ADDRESS_SPACE_IO, 8 )
337   ADDRESS_MAP_GLOBAL_MASK(0xff)
338331   AM_RANGE(0x10, 0x10) AM_WRITE(fromance_crtc_data_w)
339332   AM_RANGE(0x11, 0x11) AM_WRITE(fromance_crtc_register_w)
333   AM_RANGE(0x12, 0x12) AM_READ(SMH_NOP)            // unknown
340334   AM_RANGE(0xe0, 0xe0) AM_WRITE(fromance_rombank_w)
341   AM_RANGE(0xe1, 0xe1) AM_WRITE(fromance_gfxreg_w)
335   AM_RANGE(0xe1, 0xe1) AM_READWRITE(fromance_busycheck_sub_r, fromance_gfxreg_w)
342336   AM_RANGE(0xe2, 0xe5) AM_WRITE(fromance_scroll_w)
343   AM_RANGE(0xe6, 0xe6) AM_WRITE(fromance_busycheck_sub_w)
337   AM_RANGE(0xe6, 0xe6) AM_READWRITE(fromance_commanddata_r, fromance_busycheck_sub_w)
344338   AM_RANGE(0xe7, 0xe7) AM_WRITE(fromance_adpcm_reset_w)
345339   AM_RANGE(0xe8, 0xe8) AM_WRITE(fromance_adpcm_w)
346340   AM_RANGE(0xe9, 0xe9) AM_WRITE(ay8910_write_port_0_w)
347341   AM_RANGE(0xea, 0xea) AM_WRITE(ay8910_control_port_0_w)
348342ADDRESS_MAP_END
349343
350static ADDRESS_MAP_START( fromance_readport_sub, ADDRESS_SPACE_IO, 8 )
344static ADDRESS_MAP_START( idolmj_sub_io_map, ADDRESS_SPACE_IO, 8 )
351345   ADDRESS_MAP_GLOBAL_MASK(0xff)
352   AM_RANGE(0x12, 0x12) AM_READ(SMH_NOP)            // unknown
353   AM_RANGE(0x21, 0x21) AM_READ(fromance_busycheck_sub_r)
354   AM_RANGE(0x26, 0x26) AM_READ(fromance_commanddata_r)
355ADDRESS_MAP_END
356
357static ADDRESS_MAP_START( idolmj_writeport_sub, ADDRESS_SPACE_IO, 8 )
358   ADDRESS_MAP_GLOBAL_MASK(0xff)
359346   AM_RANGE(0x10, 0x10) AM_WRITE(fromance_crtc_data_w)
360347   AM_RANGE(0x11, 0x11) AM_WRITE(fromance_crtc_register_w)
348   AM_RANGE(0x12, 0x12) AM_READ(SMH_NOP)            // unknown
361349   AM_RANGE(0x20, 0x20) AM_WRITE(fromance_rombank_w)
362   AM_RANGE(0x21, 0x21) AM_WRITE(fromance_gfxreg_w)
350   AM_RANGE(0x21, 0x21) AM_READWRITE(fromance_busycheck_sub_r, fromance_gfxreg_w)
363351   AM_RANGE(0x22, 0x25) AM_WRITE(fromance_scroll_w)
364   AM_RANGE(0x26, 0x26) AM_WRITE(fromance_busycheck_sub_w)
352   AM_RANGE(0x26, 0x26) AM_READWRITE(fromance_commanddata_r, fromance_busycheck_sub_w)
365353   AM_RANGE(0x27, 0x27) AM_WRITE(fromance_adpcm_reset_w)
366354   AM_RANGE(0x28, 0x28) AM_WRITE(fromance_adpcm_w)
367355   AM_RANGE(0x29, 0x29) AM_WRITE(ay8910_write_port_0_w)
368356   AM_RANGE(0x2a, 0x2a) AM_WRITE(ay8910_control_port_0_w)
369357ADDRESS_MAP_END
370358
371static ADDRESS_MAP_START( fromance_writeport_sub, ADDRESS_SPACE_IO, 8 )
359static ADDRESS_MAP_START( fromance_sub_io_map, ADDRESS_SPACE_IO, 8 )
372360   ADDRESS_MAP_GLOBAL_MASK(0xff)
373361   AM_RANGE(0x10, 0x10) AM_WRITE(fromance_crtc_data_w)
374362   AM_RANGE(0x11, 0x11) AM_WRITE(fromance_crtc_register_w)
363   AM_RANGE(0x12, 0x12) AM_READ(SMH_NOP)            // unknown
375364   AM_RANGE(0x20, 0x20) AM_WRITE(fromance_rombank_w)
376   AM_RANGE(0x21, 0x21) AM_WRITE(fromance_gfxreg_w)
365   AM_RANGE(0x21, 0x21) AM_READWRITE(fromance_busycheck_sub_r, fromance_gfxreg_w)
377366   AM_RANGE(0x22, 0x25) AM_WRITE(fromance_scroll_w)
378   AM_RANGE(0x26, 0x26) AM_WRITE(fromance_busycheck_sub_w)
367   AM_RANGE(0x26, 0x26) AM_READWRITE(fromance_commanddata_r, fromance_busycheck_sub_w)
379368   AM_RANGE(0x27, 0x27) AM_WRITE(fromance_adpcm_reset_w)
380369   AM_RANGE(0x28, 0x28) AM_WRITE(fromance_adpcm_w)
381370   AM_RANGE(0x2a, 0x2a) AM_WRITE(ym2413_register_port_0_w)
r3232r3233
383372ADDRESS_MAP_END
384373
385374
386
387375/*************************************
388376 *
389377 *  Port definitions
r3232r3233
10321020
10331021   MDRV_CPU_ADD("sub", Z80,12000000/2)      /* 6.00 Mhz ? */
10341022   MDRV_CPU_PROGRAM_MAP(nekkyoku_readmem_sub,nekkyoku_writemem_sub)
1035   MDRV_CPU_IO_MAP(nekkyoku_readport_sub,nekkyoku_writeport_sub)
1023   MDRV_CPU_IO_MAP(nekkyoku_sub_io_map,0)
10361024
10371025   MDRV_MACHINE_RESET(fromance)
10381026
r3232r3233
10701058
10711059   MDRV_CPU_ADD("sub", Z80,12000000/2)      /* 6.00 Mhz ? */
10721060   MDRV_CPU_PROGRAM_MAP(fromance_readmem_sub,fromance_writemem_sub)
1073   MDRV_CPU_IO_MAP(fromance_readport_sub,idolmj_writeport_sub)
1061   MDRV_CPU_IO_MAP(idolmj_sub_io_map,0)
10741062
10751063   MDRV_MACHINE_RESET(fromance)
10761064
r3232r3233
11081096
11091097   MDRV_CPU_ADD("sub", Z80,12000000/2)      /* 6.00 Mhz ? */
11101098   MDRV_CPU_PROGRAM_MAP(fromance_readmem_sub,fromance_writemem_sub)
1111   MDRV_CPU_IO_MAP(fromance_readport_sub,fromance_writeport_sub)
1099   MDRV_CPU_IO_MAP(fromance_sub_io_map,0)
11121100
11131101   MDRV_MACHINE_RESET(fromance)
11141102
r3232r3233
13571345GAME( 1990, daiyogen,        0, fromance, daiyogen, 0, ROT0, "Video System Co.", "Mahjong Daiyogen (Japan)", 0 )
13581346GAME( 1991, nmsengen,        0, fromance, nmsengen, 0, ROT0, "Video System Co.", "Nekketsu Mahjong Sengen! AFTER 5 (Japan)", 0 )
13591347GAME( 1991, fromance,        0, fromance, fromance, 0, ROT0, "Video System Co.", "Idol-Mahjong Final Romance (Japan)", 0 )
1348
src/mame/drivers/dlair.c
r3232r3233
222222
223223static INTERRUPT_GEN( vblank_callback )
224224{
225   /* update the laserdisc */
226   laserdisc_vsync(laserdisc);
227
228225   /* also update the speaker on the European version */
229226   if (sndti_exists(SOUND_BEEP, 0))
230227   {
r3232r3233
727724   MDRV_SOUND_CONFIG(ay8910_config)
728725   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.33)
729726
730   MDRV_SOUND_ADD("laserdisc", CUSTOM, 0)
727   MDRV_SOUND_ADD("ldsound", CUSTOM, 0)
731728   MDRV_SOUND_CONFIG(laserdisc_custom_interface)
732729   MDRV_SOUND_ROUTE(0, "left", 1.0)
733730   MDRV_SOUND_ROUTE(1, "right", 1.0)
r3232r3233
736733
737734static MACHINE_DRIVER_START( dlair_pr7820 )
738735   MDRV_IMPORT_FROM(dlair_base)
739   MDRV_LASERDISC_ADD("laserdisc", PIONEER_PR7820)
736   MDRV_LASERDISC_ADD("laserdisc", PIONEER_PR7820, "main", "ldsound")
740737MACHINE_DRIVER_END
741738
742739
743740static MACHINE_DRIVER_START( dlair_ldv1000 )
744741   MDRV_IMPORT_FROM(dlair_base)
745   MDRV_LASERDISC_ADD("laserdisc", PIONEER_LDV1000)
742   MDRV_LASERDISC_ADD("laserdisc", PIONEER_LDV1000, "main", "ldsound")
746743MACHINE_DRIVER_END
747744
748745
r3232r3233
760757   MDRV_MACHINE_START(dleuro)
761758   MDRV_MACHINE_RESET(dlair)
762759
763   MDRV_LASERDISC_ADD("laserdisc", PHILLIPS_22VP932)
760   MDRV_LASERDISC_ADD("laserdisc", PHILLIPS_22VP932, "main", "ldsound")
764761   MDRV_LASERDISC_OVERLAY(dleuro, 256, 256, BITMAP_FORMAT_INDEXED16)
765762
766763   /* video hardware */
src/mame/drivers/halleys.c
r3232r3233
16051605
16061606static READ8_HANDLER( io_mirror_r )
16071607{
1608   static const char *portnames[] = { "IN0", "IN1", "IN2", "IN3" };
1608   static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" };
16091609
16101610   return input_port_read(machine, portnames[offset]);
16111611}
src/mame/drivers/gomoku.c
r3232r3233
4949static READ8_HANDLER( input_port_r )
5050{
5151   int i, res;
52   static const char *portnames[] = { "IN0", "IN1", "DSW", "UNUSED0", "UNUSED1", "UNUSED2", "UNUSED3", "UNUSED4" };
52   static const char *const portnames[] = { "IN0", "IN1", "DSW", "UNUSED0", "UNUSED1", "UNUSED2", "UNUSED3", "UNUSED4" };
5353
5454   res = 0;
5555   for (i = 0; i < 8; i++)
src/mame/drivers/djmain.c
r3232r3233
287287static READ32_HANDLER( turntable_r )
288288{
289289   UINT32 result = 0;
290   static const char *ttnames[] = { "TT1", "TT2" };
290   static const char *const ttnames[] = { "TT1", "TT2" };
291291
292292   if (ACCESSING_BITS_8_15)
293293   {
src/mame/drivers/peplus.c
r3232r3233
805805
806806   PORT_START("SW1")
807807   PORT_DIPNAME( 0x01, 0x01, "Line Frequency" )
808   PORT_DIPSETTING(    0x01, "60HZ" )
809   PORT_DIPSETTING(    0x00, "50HZ" )
808   PORT_DIPSETTING(    0x01, "60Hz" )
809   PORT_DIPSETTING(    0x00, "50Hz" )
810810   PORT_DIPUNUSED( 0x02, IP_ACTIVE_LOW )
811811   PORT_DIPUNUSED( 0x04, IP_ACTIVE_LOW )
812812   PORT_DIPUNUSED( 0x08, IP_ACTIVE_LOW )
src/mame/drivers/segas24.c
r3232r3233
561561
562562static UINT8 mahmajn_io_r(running_machine *machine, int port)
563563{
564   static const char *keynames[] = { "MJ0", "MJ1", "MJ2", "MJ3", "MJ4", "MJ5", "P1", "P2" };
564   static const char *const keynames[] = { "MJ0", "MJ1", "MJ2", "MJ3", "MJ4", "MJ5", "P1", "P2" };
565565
566566   switch(port)
567567   {
r3232r3233
619619
620620static WRITE16_HANDLER( hotrod3_ctrl_w )
621621{
622   static const char *portnames[] = { "PEDAL1", "PEDAL2", "PEDAL3", "PEDAL4" };
622   static const char *const portnames[] = { "PEDAL1", "PEDAL2", "PEDAL3", "PEDAL4" };
623623
624624   if(ACCESSING_BITS_0_7)
625625   {
src/mame/drivers/mustache.c
r3232r3233
233233   ROM_LOAD( "mustache.h18", 0x0000, 0x8000, CRC(123bd9b8) SHA1(33a7cba5c3a54b0b1a15dd1e24d298b6f7274321) )
234234   ROM_LOAD( "mustache.h16", 0x8000, 0x4000, CRC(62552beb) SHA1(ee10991d7de0596608fa1db48805781cbfbbdb9f) )
235235
236   ROM_REGION( 0x10000, "T5182", 0 ) /* Toshiba T5182 module */
236   ROM_REGION( 0x10000, "t5182", 0 ) /* Toshiba T5182 module */
237237   ROM_LOAD( "t5182.rom",   0x0000, 0x2000, CRC(d354c8fc) SHA1(a1c9e1ac293f107f69cc5788cf6abc3db1646e33) )
238238   ROM_LOAD( "mustache.e5", 0x8000, 0x8000, CRC(efbb1943) SHA1(3320e9eaeb776d09ed63f7dedc79e720674e6718) )
239239
src/mame/drivers/segas16a.c
r3232r3233
19221922   ROM_REGION( 0x10000, "sound", 0 ) /* sound CPU */
19231923   ROM_LOAD( "10284", 0x00000, 0x8000, CRC(8ff09116) SHA1(8b99b6d2499897cfbd037a7e7cf5bc53bce8a63a) )
19241924
1925   ROM_REGION( 0x2000, "fd1089a_key", 0 ) /* decryption key */
1925   ROM_REGION( 0x2000, "fd1089a", 0 ) /* decryption key */
19261926   ROM_LOAD( "317-0018.key", 0x0000, 0x2000, CRC(fee04be8) SHA1(c58d78299ef4cede517be823a8a8a90e46c6ba0d) )
19271927ROM_END
19281928
r3232r3233
20022002   ROM_LOAD( "10435.1", 0x0000, 0x8000, CRC(ad89f6e3) SHA1(812a132142065b0fe13b5f0ac534b6d8830ba102) )
20032003   ROM_LOAD( "10436.2", 0x8000, 0x8000, CRC(96c76613) SHA1(fe3e4e649fd2cb2453eec0c92015bd54b3b9a1b5) )
20042004
2005   ROM_REGION( 0x2000, "fd1089a_key", 0 ) /* decryption key */
2005   ROM_REGION( 0x2000, "fd1089a", 0 ) /* decryption key */
20062006   ROM_LOAD( "317-0021.key", 0x0000, 0x2000, BAD_DUMP CRC(85be8eac) SHA1(3857bf43b3b0ab60c04223e2393d99504a730d73) )
20072007ROM_END
20082008
r3232r3233
20562056   ROM_LOAD( "10707", 0x08000, 0x8000, CRC(800c1d82) SHA1(aac4123bd35f87da09264649f4cf8326b2ba3cb8) )
20572057   ROM_LOAD( "10708", 0x10000, 0x8000, CRC(5921ef52) SHA1(eff9978361692e6e60a9c6caf5740dd6182cfe4a) )
20582058
2059   ROM_REGION( 0x2000, "fd1089b_key", 0 ) /* decryption key */
2059   ROM_REGION( 0x2000, "fd1089b", 0 ) /* decryption key */
20602060   ROM_LOAD( "317-0037.key", 0x0000, 0x2000, CRC(49e882e5) SHA1(29d87af8fc775b22a9a546c112f8f5e7f700ac1a) )
20612061ROM_END
20622062
r3232r3233
21102110   ROM_LOAD( "10707", 0x08000, 0x8000, CRC(800c1d82) SHA1(aac4123bd35f87da09264649f4cf8326b2ba3cb8) )
21112111   ROM_LOAD( "10708", 0x10000, 0x8000, CRC(5921ef52) SHA1(eff9978361692e6e60a9c6caf5740dd6182cfe4a) )
21122112
2113   ROM_REGION( 0x2000, "fd1089a_key", 0 ) /* decryption key */
2113   ROM_REGION( 0x2000, "fd1089a", 0 ) /* decryption key */
21142114   ROM_LOAD( "317-0033.key", 0x0000, 0x2000, CRC(49e882e5) SHA1(29d87af8fc775b22a9a546c112f8f5e7f700ac1a) )
21152115ROM_END
21162116
r3232r3233
21612161   ROM_LOAD( "10707", 0x08000, 0x8000, CRC(800c1d82) SHA1(aac4123bd35f87da09264649f4cf8326b2ba3cb8) )
21622162   ROM_LOAD( "10708", 0x10000, 0x8000, CRC(5921ef52) SHA1(eff9978361692e6e60a9c6caf5740dd6182cfe4a) )
21632163
2164   ROM_REGION( 0x2000, "fd1089a_key", 0 ) /* decryption key */
2164   ROM_REGION( 0x2000, "fd1089a", 0 ) /* decryption key */
21652165   ROM_LOAD( "317-0033.key", 0x0000, 0x2000, CRC(49e882e5) SHA1(29d87af8fc775b22a9a546c112f8f5e7f700ac1a) )
21662166ROM_END
21672167
r3232r3233
26422642   ROM_REGION( 0x10000, "sound", 0 ) /* sound CPU */
26432643   ROM_LOAD( "epr10759.12", 0x0000, 0x8000, CRC(d7f9649f) SHA1(ce4abe7dd7e33da048569d7817063345fab75ea7) )
26442644
2645   ROM_REGION( 0x2000, "fd1089b_key", 0 ) /* decryption key */
2645   ROM_REGION( 0x2000, "fd1089b", 0 ) /* decryption key */
26462646   ROM_LOAD( "317-0027.key", 0x0000, 0x2000, BAD_DUMP CRC(9a5307b2) SHA1(2fcc576ed95b96ff6ea71252c3fab33b8b3fc1f5) )
26472647ROM_END
26482648
r3232r3233
28452845   ROM_LOAD( "epr12230.4", 0x10000, 0x8000, CRC(d0f61fd4) SHA1(e6f29459d7395122f26957f56e38926aebd9004c) )
28462846   ROM_LOAD( "epr12231.5", 0x18000, 0x8000, CRC(780bdc57) SHA1(8c859043bba389292604385b88c743728180f9a9) )
28472847
2848   ROM_REGION( 0x2000, "fd1089b_key", 0 ) /* decryption key */
2848   ROM_REGION( 0x2000, "fd1089b", 0 ) /* decryption key */
28492849   ROM_LOAD( "317-5021.key", 0x0000, 0x2000, BAD_DUMP CRC(4a3422e4) SHA1(69a32a6987ff2481f6d6cbbe399269a2461b8bad) )
28502850ROM_END
28512851
r3232r3233
30143014   ROM_REGION( 0x08000, "n7751data", 0 ) /* 7751 sound data */
30153015   ROM_LOAD( "epr10547.1", 0x0000, 0x8000, CRC(d24ffc4b) SHA1(3b250e1f026664f7a37f65d1c1a07381e88f11e8) )
30163016
3017   ROM_REGION( 0x2000, "fd1089b_key", 0 ) /* decryption key */
3017   ROM_REGION( 0x2000, "fd1089b", 0 ) /* decryption key */
30183018   ROM_LOAD( "317-0024.key", 0x0000, 0x2000, BAD_DUMP CRC(ee42ec18) SHA1(cb65dd681f38ce20440ddcb01a935c2c8eecc77f) )
30193019ROM_END
30203020
r3232r3233
31013101   ROM_REGION( 0x10000, "sound", 0 ) /* sound CPU */
31023102   ROM_LOAD( "epr12089.12", 0x0000, 0x8000, CRC(8321eb0b) SHA1(61cf95833c0aa38e35fc18db39d4ec74e4aaf01e) )
31033103
3104   ROM_REGION( 0x2000, "fd1089a_key", 0 ) /* decryption key */
3104   ROM_REGION( 0x2000, "fd1089a", 0 ) /* decryption key */
31053105   ROM_LOAD( "317-wb35.key", 0x0000, 0x2000, BAD_DUMP CRC(8a2e0575) SHA1(e43a2c8ca102ec38871067685a860da53d748765) )
31063106ROM_END
31073107
src/mame/drivers/neogeo.c
r3232r3233
8080****************************************************************************/
8181
8282#include "driver.h"
83#include "deprecat.h"
8483#include "neogeo.h"
8584#include "machine/pd4990a.h"
8685#include "cpu/z80/z80.h"
r3232r3233
625624}
626625
627626
628void neogeo_set_main_cpu_bank_address(UINT32 bank_address)
627void neogeo_set_main_cpu_bank_address(running_machine *machine, UINT32 bank_address)
629628{
630629   if (LOG_MAIN_CPU_BANKING) logerror("MAIN CPU PC %06x: neogeo_set_main_cpu_bank_address %06x\n", safe_activecpu_get_pc(), bank_address);
631630
632631   main_cpu_bank_address = bank_address;
633632
634   _set_main_cpu_bank_address(Machine);
633   _set_main_cpu_bank_address(machine);
635634}
636635
637636
r3232r3233
652651         bank_address = 0x100000;
653652      }
654653
655      neogeo_set_main_cpu_bank_address(bank_address);
654      neogeo_set_main_cpu_bank_address(machine, bank_address);
656655   }
657656}
658657
r3232r3233
665664
666665   /* set initial main CPU bank */
667666   if (memory_region_length(machine, "main") > 0x100000)
668      neogeo_set_main_cpu_bank_address(0x100000);
667      neogeo_set_main_cpu_bank_address(machine, 0x100000);
669668   else
670      neogeo_set_main_cpu_bank_address(0x000000);
669      neogeo_set_main_cpu_bank_address(machine, 0x000000);
671670}
672671
673672
src/mame/drivers/konamigx.c
r3232r3233
939939   return sync_frame;
940940}
941941
942static int last_prot_op = -1, last_prot_clk;
942static int last_prot_op, last_prot_clk;
943943
944944/*
945945    Run and Gun 2, Rushing Heroes, Winning Spike, and Vs. Net Soccer contain a XILINX FPGA that serves as security.
src/mame/drivers/segahang.c
r3232r3233
158158
159159      case 0x1000/2: /* Input ports and DIP switches */
160160      {
161         static const char *sysports[] = { "SERVICE", "COINAGE", "DSW", "UNKNOWN" };
161         static const char *const sysports[] = { "SERVICE", "COINAGE", "DSW", "UNKNOWN" };
162162         return input_port_read(machine, sysports[offset & 3]);
163163      }
164164
r3232r3233
167167
168168      case 0x3020/2: /* ADC0804 data output */
169169      {
170         static const char *adcports[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
170         static const char *const adcports[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
171171         return input_port_read_safe(machine, adcports[adc_select], 0);
172172      }
173173   }
r3232r3233
209209
210210      case 0x0010/2: /* Input ports and DIP switches */
211211      {
212         static const char *sysports[] = { "SERVICE", "UNKNOWN", "COINAGE", "DSW" };
212         static const char *const sysports[] = { "SERVICE", "UNKNOWN", "COINAGE", "DSW" };
213213         return input_port_read(machine, sysports[offset & 3]);
214214      }
215215
r3232r3233
219219
220220      case 0x0030/2: /* ADC0804 data output */
221221      {
222         static const char *adcports[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
222         static const char *const adcports[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
223223         return input_port_read_safe(machine, adcports[adc_select], 0);
224224      }
225225   }
r3232r3233
14731473   ROM_REGION( 0x2000, "proms", 0 ) /* zoom table */
14741474   ROM_LOAD( "epr-6844.ic123", 0x0000, 0x2000, CRC(e3ec7bd6) SHA1(feec0fe664e16fac0fde61cf64b401b9b0575323) )
14751475
1476   ROM_REGION( 0x2000, "fd1089b_key", 0 ) /* decryption key */
1476   ROM_REGION( 0x2000, "fd1089b", 0 ) /* decryption key */
14771477   ROM_LOAD( "317-0013a.key", 0x0000, 0x2000, CRC(295e6737) SHA1(2eff36f1f24db1154cf970d4c9fd481ae4f9a57c) )
14781478ROM_END
14791479
r3232r3233
15531553   ROM_REGION( 0x2000, "proms", 0 ) /* zoom table */
15541554   ROM_LOAD( "epr-6844.ic123", 0x0000, 0x2000, CRC(e3ec7bd6) SHA1(feec0fe664e16fac0fde61cf64b401b9b0575323) )
15551555
1556   ROM_REGION( 0x2000, "fd1089b_key", 0 ) /* decryption key */
1556   ROM_REGION( 0x2000, "fd1089b", 0 ) /* decryption key */
15571557   ROM_LOAD( "317-0013a.key", 0x0000, 0x2000, CRC(295e6737) SHA1(2eff36f1f24db1154cf970d4c9fd481ae4f9a57c) )
15581558ROM_END
15591559
src/mame/drivers/sprcros2.c
r3232r3233
138138   AM_RANGE(0xf800, 0xffff) AM_WRITE(SMH_RAM) AM_BASE(&sprcros2_sharedram)   //shared with slave cpu
139139ADDRESS_MAP_END
140140
141static ADDRESS_MAP_START( sprcros2_m_readport, ADDRESS_SPACE_IO, 8 )
141static ADDRESS_MAP_START( io_map, ADDRESS_SPACE_IO, 8 )
142142   ADDRESS_MAP_GLOBAL_MASK(0xff)
143   AM_RANGE(0x00, 0x00) AM_READ_PORT("P1")
144   AM_RANGE(0x01, 0x01) AM_READ_PORT("P2")
145   AM_RANGE(0x02, 0x02) AM_READ_PORT("EXTRA")
143   AM_RANGE(0x00, 0x00) AM_READ_PORT("P1") AM_WRITE(sn76496_0_w)
144   AM_RANGE(0x01, 0x01) AM_READ_PORT("P2") AM_WRITE(sn76496_1_w)
145   AM_RANGE(0x02, 0x02) AM_READ_PORT("EXTRA") AM_WRITE(sn76496_2_w)
146146   AM_RANGE(0x04, 0x04) AM_READ_PORT("DSW1")
147147   AM_RANGE(0x05, 0x05) AM_READ_PORT("DSW2")
148ADDRESS_MAP_END
149
150static ADDRESS_MAP_START( sprcros2_m_writeport, ADDRESS_SPACE_IO, 8 )
151   ADDRESS_MAP_GLOBAL_MASK(0xff)
152   AM_RANGE(0x00, 0x00) AM_WRITE(sn76496_0_w)
153   AM_RANGE(0x01, 0x01) AM_WRITE(sn76496_1_w)
154   AM_RANGE(0x02, 0x02) AM_WRITE(sn76496_2_w)
155148   AM_RANGE(0x07, 0x07) AM_WRITE(sprcros2_m_port7_w)
156149ADDRESS_MAP_END
157150
r3232r3233
173166   AM_RANGE(0xf800, 0xffff) AM_WRITE(sprcros2_sharedram_w)
174167ADDRESS_MAP_END
175168
176static ADDRESS_MAP_START( sprcros2_s_writeport, ADDRESS_SPACE_IO, 8 )
169static ADDRESS_MAP_START( audio_io_map, ADDRESS_SPACE_IO, 8 )
177170   ADDRESS_MAP_GLOBAL_MASK(0xff)
178171   AM_RANGE(0x00, 0x00) AM_WRITE(sprcros2_bgscrollx_w)
179172   AM_RANGE(0x01, 0x01) AM_WRITE(sprcros2_bgscrolly_w)
r3232r3233
303296   /* basic machine hardware */
304297   MDRV_CPU_ADD("main", Z80,10000000/2)
305298   MDRV_CPU_PROGRAM_MAP(sprcros2_m_readmem,sprcros2_m_writemem)
306   MDRV_CPU_IO_MAP(sprcros2_m_readport,sprcros2_m_writeport)
299   MDRV_CPU_IO_MAP(io_map,0)
307300   MDRV_CPU_VBLANK_INT_HACK(sprcros2_m_interrupt,2)   //1 nmi + 1 irq
308301
309302   MDRV_CPU_ADD("audio", Z80,10000000/2)
310303   MDRV_CPU_PROGRAM_MAP(sprcros2_s_readmem,sprcros2_s_writemem)
311   MDRV_CPU_IO_MAP(0,sprcros2_s_writeport)
304   MDRV_CPU_IO_MAP(audio_io_map,0)
312305   MDRV_CPU_VBLANK_INT_HACK(sprcros2_s_interrupt,2)   //2 nmis
313306
314307   MDRV_MACHINE_START(sprcros2)
src/mame/drivers/combatsc.c
r3232r3233
167167   if (offset == 0)
168168   {
169169      int i,dir[4];
170      static const char *tracknames[] = { "TRACK0_Y", "TRACK0_X", "TRACK1_Y", "TRACK1_X" };
170      static const char *const tracknames[] = { "TRACK0_Y", "TRACK0_X", "TRACK1_Y", "TRACK1_X" };
171171
172172      for (i = 0; i < 4; i++)
173173      {
src/mame/drivers/segac2.c
r3232r3233
355355
356356static READ16_HANDLER( io_chip_r )
357357{
358   static const char *portnames[] = { "P1", "P2", "PORTC", "PORTD", "SERVICE", "COINAGE", "DSW", "PORTH" };
358   static const char *const portnames[] = { "P1", "P2", "PORTC", "PORTD", "SERVICE", "COINAGE", "DSW", "PORTH" };
359359   offset &= 0x1f/2;
360360
361361   switch (offset)
src/mame/drivers/gottlieb.c
r3232r3233
322322
323323static CUSTOM_INPUT( stooges_joystick_r )
324324{
325   static const char *joyport[] = { "P1JOY", "P2JOY", "P3JOY", NULL };
325   static const char *const joyport[] = { "P1JOY", "P2JOY", "P3JOY", NULL };
326326   return (joyport[joystick_select & 3] != NULL) ? input_port_read(field->port->machine, joyport[joystick_select & 3]) : 0xff;
327327}
328328
r3232r3233
679679   {
680680      bitmap_t *dummy;
681681
682      laserdisc_vsync(laserdisc);
683
684682      /* set the "disc ready" bit, which basically indicates whether or not we have a proper video frame */
685683      if (laserdisc_get_video(laserdisc, &dummy) == 0)
686684         laserdisc_status &= ~0x20;
r3232r3233
18891887   MDRV_IMPORT_FROM(gottlieb_core)
18901888   MDRV_IMPORT_FROM(gottlieb_soundrev2)
18911889
1892   MDRV_LASERDISC_ADD("laserdisc", PIONEER_PR8210)
1890   MDRV_LASERDISC_ADD("laserdisc", PIONEER_PR8210, "main", "ldsound")
18931891   MDRV_LASERDISC_AUDIO(laserdisc_audio_process)
18941892   MDRV_LASERDISC_OVERLAY(gottlieb, GOTTLIEB_VIDEO_HCOUNT, GOTTLIEB_VIDEO_VCOUNT, BITMAP_FORMAT_INDEXED16)
18951893   MDRV_LASERDISC_OVERLAY_CLIP(0, GOTTLIEB_VIDEO_HBLANK-1, 0, GOTTLIEB_VIDEO_VBLANK-8)
r3232r3233
18971895   MDRV_SCREEN_REMOVE("main")
18981896   MDRV_LASERDISC_SCREEN_ADD_NTSC("main", BITMAP_FORMAT_INDEXED16)
18991897
1900   MDRV_SOUND_ADD("laserdisc", CUSTOM, 0)
1898   MDRV_SOUND_ADD("ldsound", CUSTOM, 0)
19011899   MDRV_SOUND_CONFIG(laserdisc_custom_interface)
19021900   MDRV_SOUND_ROUTE(0, "mono", 1.0)
19031901   /* right channel is processed as data */
src/mame/drivers/gpworld.c
r3232r3233
405405   /* The time the IRQ line stays high is set just long enough to happen after the NMI - hacky? */
406406   cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
407407   timer_set(ATTOTIME_IN_USEC(100), NULL, 0, irq_stop);
408
409   laserdisc_vsync(laserdisc);
410408}
411409
412410static const gfx_layout gpworld_tile_layout =
r3232r3233
435433
436434   MDRV_MACHINE_START(gpworld)
437435
438   MDRV_LASERDISC_ADD("laserdisc", PIONEER_LDV1000)
436   MDRV_LASERDISC_ADD("laserdisc", PIONEER_LDV1000, "main", "ldsound")
439437   MDRV_LASERDISC_OVERLAY(gpworld, 512, 256, BITMAP_FORMAT_INDEXED16)
440438
441439   /* video hardware */
r3232r3233
447445   /* sound hardware */
448446   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
449447
450   MDRV_SOUND_ADD("laserdisc", CUSTOM, 0)
448   MDRV_SOUND_ADD("ldsound", CUSTOM, 0)
451449   MDRV_SOUND_CONFIG(laserdisc_custom_interface)
452450   MDRV_SOUND_ROUTE(0, "left", 1.0)
453451   MDRV_SOUND_ROUTE(1, "right", 1.0)
src/mame/drivers/homedata.c
r3232r3233
255255static READ8_HANDLER( mrokumei_keyboard_r )
256256{
257257   int res = 0x3f,i;
258   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
258   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
259259
260260   /* offset 0 is player 1, offset 1 player 2 (not supported) */
261261   if (offset == 0)
r3232r3233
468468
469469static READ8_HANDLER( pteacher_keyboard_r )
470470{
471   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5" };
471   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5" };
472472   int dips = input_port_read(machine, "DSW");
473473
474474//  logerror("%04x: keyboard_r with port A = %02x\n",activecpu_get_pc(),upd7807_porta);
src/mame/drivers/gamecstl.c
r3232r3233
162162   return mxtc_config_reg[reg];
163163}
164164
165static void mxtc_config_w(int function, int reg, UINT8 data)
165static void mxtc_config_w(running_machine *machine, int function, int reg, UINT8 data)
166166{
167167//  mame_printf_debug("MXTC: write %d, %02X, %02X at %08X\n", function, reg, data, activecpu_get_pc());
168168
r3232r3233
176176         }
177177         else               // disable RAM access (reads go to BIOS ROM)
178178         {
179            memory_set_bankptr(1, memory_region(Machine, "user1") + 0x30000);
179            memory_set_bankptr(1, memory_region(machine, "user1") + 0x30000);
180180         }
181181         break;
182182      }
r3232r3233
221221{
222222   if (ACCESSING_BITS_24_31)
223223   {
224      mxtc_config_w(function, reg + 3, (data >> 24) & 0xff);
224      mxtc_config_w(Machine, function, reg + 3, (data >> 24) & 0xff);
225225   }
226226   if (ACCESSING_BITS_16_23)
227227   {
228      mxtc_config_w(function, reg + 2, (data >> 16) & 0xff);
228      mxtc_config_w(Machine, function, reg + 2, (data >> 16) & 0xff);
229229   }
230230   if (ACCESSING_BITS_8_15)
231231   {
232      mxtc_config_w(function, reg + 1, (data >> 8) & 0xff);
232      mxtc_config_w(Machine, function, reg + 1, (data >> 8) & 0xff);
233233   }
234234   if (ACCESSING_BITS_0_7)
235235   {
236      mxtc_config_w(function, reg + 0, (data >> 0) & 0xff);
236      mxtc_config_w(Machine, function, reg + 0, (data >> 0) & 0xff);
237237   }
238238}
239239
src/mame/drivers/segald.c
r3232r3233
321321   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )                                   /* SW15 = nonJAMMA pin W  = unused? */
322322INPUT_PORTS_END
323323
324static INTERRUPT_GEN( vblank_callback_astron )
325{
326   laserdisc_vsync(laserdisc);
327}
328
329324static GFXDECODE_START( segald )
330325    GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x1,  0, 1 )      /* CHARACTERS */
331326   /* SPRITES are apparently non-uniform in width - not straightforward to decode */
r3232r3233
345340   MDRV_CPU_ADD("main", Z80, SCHEMATIC_CLOCK/4)
346341   MDRV_CPU_PROGRAM_MAP(mainmem,0)
347342   MDRV_CPU_IO_MAP(mainport,0)
348   MDRV_CPU_VBLANK_INT("main", vblank_callback_astron)
349343   MDRV_CPU_PERIODIC_INT(nmi_line_pulse, 1000.0/59.94)
350344
351345   MDRV_MACHINE_START(astron)
352346
353   MDRV_LASERDISC_ADD("laserdisc", PIONEER_LDV1000)
347   MDRV_LASERDISC_ADD("laserdisc", PIONEER_LDV1000, "main", "ldsound")
354348   MDRV_LASERDISC_OVERLAY(astron, 256, 256, BITMAP_FORMAT_INDEXED16)
355349
356350   /* video hardware */
r3232r3233
362356   /* sound hardare */
363357   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
364358
365   MDRV_SOUND_ADD("laserdisc", CUSTOM, 0)
359   MDRV_SOUND_ADD("ldsound", CUSTOM, 0)
366360   MDRV_SOUND_CONFIG(laserdisc_custom_interface)
367361   MDRV_SOUND_ROUTE(0, "left", 1.0)
368362   MDRV_SOUND_ROUTE(1, "right", 1.0)
src/mame/drivers/cabal.c
r3232r3233
8888static WRITE16_HANDLER( track_reset_w )
8989{
9090   int i;
91   static const char *track_names[] = { "IN0", "IN1", "IN2", "IN3" };
91   static const char *const track_names[] = { "IN0", "IN1", "IN2", "IN3" };
9292
9393   for (i = 0; i < 4; i++)
9494      last[i] = input_port_read(machine, track_names[i]);
src/mame/drivers/cidelsa.c
r3232r3233
336336ADDRESS_MAP_END
337337
338338static ADDRESS_MAP_START( altair_io_map, ADDRESS_SPACE_IO, 8 )
339   AM_RANGE(0x01, 0x01) AM_DEVREAD(CDP1852, "IC23", cdp1852_data_r) AM_DEVWRITE(CDP1852, "IC26", cdp1852_data_w)
340   AM_RANGE(0x02, 0x02) AM_DEVREAD(CDP1852, "IC24", cdp1852_data_r)
339   AM_RANGE(0x01, 0x01) AM_DEVREAD(CDP1852, "ic23", cdp1852_data_r) AM_DEVWRITE(CDP1852, "ic26", cdp1852_data_w)
340   AM_RANGE(0x02, 0x02) AM_DEVREAD(CDP1852, "ic24", cdp1852_data_r)
341341   AM_RANGE(0x03, 0x03) AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out3_w)
342   AM_RANGE(0x04, 0x04) AM_DEVREAD(CDP1852, "IC25", cdp1852_data_r) AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out4_w)
342   AM_RANGE(0x04, 0x04) AM_DEVREAD(CDP1852, "ic25", cdp1852_data_r) AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out4_w)
343343   AM_RANGE(0x05, 0x05) AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out5_w)
344344   AM_RANGE(0x06, 0x06) AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out6_w)
345345   AM_RANGE(0x07, 0x07) AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out7_w)
r3232r3233
355355ADDRESS_MAP_END
356356
357357static ADDRESS_MAP_START( draco_io_map, ADDRESS_SPACE_IO, 8 )
358   AM_RANGE(0x01, 0x01) AM_DEVREAD(CDP1852, "IC29", cdp1852_data_r) AM_DEVWRITE(CDP1852, "IC32", cdp1852_data_w)
359   AM_RANGE(0x02, 0x02) AM_DEVREAD(CDP1852, "IC30", cdp1852_data_r)
358   AM_RANGE(0x01, 0x01) AM_DEVREAD(CDP1852, "ic29", cdp1852_data_r) AM_DEVWRITE(CDP1852, "ic32", cdp1852_data_w)
359   AM_RANGE(0x02, 0x02) AM_DEVREAD(CDP1852, "ic30", cdp1852_data_r)
360360   AM_RANGE(0x03, 0x03) AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out3_w)
361   AM_RANGE(0x04, 0x04) AM_DEVREAD(CDP1852, "IC31", cdp1852_data_r) AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out4_w)
361   AM_RANGE(0x04, 0x04) AM_DEVREAD(CDP1852, "ic31", cdp1852_data_r) AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out4_w)
362362   AM_RANGE(0x05, 0x05) AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out5_w)
363363   AM_RANGE(0x06, 0x06) AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out6_w)
364364   AM_RANGE(0x07, 0x07) AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out7_w)
r3232r3233
651651
652652   // input/output hardware
653653
654   MDRV_DEVICE_ADD("IC23", CDP1852)
654   MDRV_DEVICE_ADD("ic23", CDP1852)
655655   MDRV_DEVICE_CONFIG(cidelsa_cdp1852_in0_intf)
656656
657   MDRV_DEVICE_ADD("IC24", CDP1852)
657   MDRV_DEVICE_ADD("ic24", CDP1852)
658658   MDRV_DEVICE_CONFIG(cidelsa_cdp1852_in1_intf)
659659
660   MDRV_DEVICE_ADD("IC25", CDP1852)
660   MDRV_DEVICE_ADD("ic25", CDP1852)
661661   MDRV_DEVICE_CONFIG(cidelsa_cdp1852_in2_intf)
662662
663   MDRV_DEVICE_ADD("IC26", CDP1852)
663   MDRV_DEVICE_ADD("ic26", CDP1852)
664664   MDRV_DEVICE_CONFIG(altair_cdp1852_out1_intf)
665665
666666   // video hardware
r3232r3233
696696
697697   // input/output hardware
698698
699   MDRV_DEVICE_ADD("IC29", CDP1852)
699   MDRV_DEVICE_ADD("ic29", CDP1852)
700700   MDRV_DEVICE_CONFIG(cidelsa_cdp1852_in0_intf)
701701
702   MDRV_DEVICE_ADD("IC30", CDP1852)
702   MDRV_DEVICE_ADD("ic30", CDP1852)
703703   MDRV_DEVICE_CONFIG(cidelsa_cdp1852_in1_intf)
704704
705   MDRV_DEVICE_ADD("IC31", CDP1852)
705   MDRV_DEVICE_ADD("ic31", CDP1852)
706706   MDRV_DEVICE_CONFIG(cidelsa_cdp1852_in2_intf)
707707
708   MDRV_DEVICE_ADD("IC32", CDP1852)
708   MDRV_DEVICE_ADD("ic32", CDP1852)
709709   MDRV_DEVICE_CONFIG(draco_cdp1852_out1_intf)
710710
711711   // video hardware
src/mame/drivers/segas16b.c
r3232r3233
34393439   ROM_LOAD( "epr10725.a9",  0x20000, 0x8000, CRC(6a50e08f) SHA1(d34b2ccadb8b07d5ad99cab5c5b5b79642c65574) )
34403440   ROM_LOAD( "epr10726.a10", 0x30000, 0x8000, CRC(d50b7736) SHA1(b1f8e3b0cf2ffee5382098100cfabe21b383cd51) )
34413441
3442   ROM_REGION( 0x2000, "fd1089a_key", 0 ) /* decryption key */
3442   ROM_REGION( 0x2000, "fd1089a", 0 ) /* decryption key */
34433443   ROM_LOAD( "317-0033.key", 0x0000, 0x2000, CRC(49e882e5) SHA1(29d87af8fc775b22a9a546c112f8f5e7f700ac1a) )
34443444ROM_END
34453445
r3232r3233
38683868   ROM_LOAD( "mpr13449.a11", 0x10000, 0x20000, CRC(d3d9aaf9) SHA1(0fb3a8cb11033accceb3a43a691fb424cf8b9619) )
38693869   ROM_RELOAD(               0x30000, 0x20000 )
38703870
3871   ROM_REGION( 0x2000, "fd1089b_key", 0 ) /* decryption key */
3871   ROM_REGION( 0x2000, "fd1089b", 0 ) /* decryption key */
38723872   ROM_LOAD( "317-0168.key", 0x0000, 0x2000, CRC(bc2d1792) SHA1(e66d2582eb74ae35f27715fcc9df3e77aba67509) )
38733873ROM_END
38743874
r3232r3233
39363936   ROM_LOAD( "mpr13449.a11", 0x10000, 0x20000, CRC(d3d9aaf9) SHA1(0fb3a8cb11033accceb3a43a691fb424cf8b9619) )
39373937   ROM_RELOAD(               0x30000, 0x20000 )
39383938
3939   ROM_REGION( 0x2000, "fd1089a_key", 0 ) /* decryption key */
3939   ROM_REGION( 0x2000, "fd1089a", 0 ) /* decryption key */
39403940   ROM_LOAD( "317-0167.key", 0x0000, 0x2000, CRC(bc2d1792) SHA1(e66d2582eb74ae35f27715fcc9df3e77aba67509) )
39413941ROM_END
39423942
r3232r3233
42884288   ROM_LOAD( "epr10475.a9",   0x20000, 0x08000, CRC(17d55e85) SHA1(0c414bafecbfaa82679cc155f15f5255c186358d) )
42894289   ROM_LOAD( "epr10476.a10",  0x30000, 0x08000, CRC(a6be0956) SHA1(fc4d6e25e0b46679f94fddbb1850fb0b02f8d84b) )
42904290
4291   ROM_REGION( 0x2000, "fd1089a_key", 0 ) /* decryption key */
4291   ROM_REGION( 0x2000, "fd1089a", 0 ) /* decryption key */
42924292   ROM_LOAD( "317-0022.key", 0x0000, 0x2000, CRC(4eedc66d) SHA1(50588fa13bf25a2d1322579cdc9937450543c978) )
42934293ROM_END
42944294
r3232r3233
52425242   ROM_REGION( 0x10000, "sound", 0 ) /* sound CPU */
52435243   ROM_LOAD( "10775.a7", 0x0000, 0x8000, CRC(4cbd55a8) SHA1(8af2c52ab61338c8a9f1a74a05470dd3d5e0c42f) )
52445244
5245   ROM_REGION( 0x2000, "fd1089a_key", 0 ) /* decryption key */
5245   ROM_REGION( 0x2000, "fd1089a", 0 ) /* decryption key */
52465246   ROM_LOAD( "317-0028.key", 0x0000, 0x2000, BAD_DUMP CRC(9a5307b2) SHA1(2fcc576ed95b96ff6ea71252c3fab33b8b3fc1f5) )
52475247ROM_END
52485248
r3232r3233
52805280   ROM_REGION( 0x10000, "sound", 0 ) /* sound CPU */
52815281   ROM_LOAD( "10775.a7", 0x0000, 0x8000, CRC(4cbd55a8) SHA1(8af2c52ab61338c8a9f1a74a05470dd3d5e0c42f) )
52825282
5283   ROM_REGION( 0x2000, "fd1089a_key", 0 ) /* decryption key */
5283   ROM_REGION( 0x2000, "fd1089a", 0 ) /* decryption key */
52845284   ROM_LOAD( "317-0028.key", 0x0000, 0x2000, BAD_DUMP CRC(9a5307b2) SHA1(2fcc576ed95b96ff6ea71252c3fab33b8b3fc1f5) )
52855285ROM_END
52865286
r3232r3233
55525552   ROM_LOAD( "epr12247.a10",0x30000, 0x8000, CRC(ef8a64c6) SHA1(525e0d968c72c6dd73df69b55b8626495d154649) )
55535553   ROM_LOAD( "epr12248.a11",0x40000, 0x8000, CRC(d1eabdab) SHA1(f255a66e082353768e8d2bb574e883a4a45f7670) )
55545554
5555   ROM_REGION( 0x2000, "fd1089b_key", 0 ) /* decryption key */
5555   ROM_REGION( 0x2000, "fd1089b", 0 ) /* decryption key */
55565556   ROM_LOAD( "317-5021.key", 0x0000, 0x2000, BAD_DUMP CRC(4a3422e4) SHA1(69a32a6987ff2481f6d6cbbe399269a2461b8bad) )
55575557ROM_END
55585558
src/mame/drivers/wwfwfest.c
r3232r3233
366366static MACHINE_DRIVER_START( wwfwfest )
367367
368368   /* basic machine hardware */
369   MDRV_CPU_ADD("main", M68000, 24000000/2)   /* 24 crystal, 12 rated chip */
369   MDRV_CPU_ADD("main", M68000, XTAL_24MHz / 2)   /* 24 crystal, 12 rated chip */
370370   MDRV_CPU_PROGRAM_MAP(main_map,0)
371371   MDRV_CPU_VBLANK_INT_HACK(wwfwfest_interrupt,2)
372372
373   MDRV_CPU_ADD("audio", Z80, 3579545)
373   MDRV_CPU_ADD("audio", Z80, XTAL_3_579545MHz)
374374   MDRV_CPU_PROGRAM_MAP(sound_map,0)
375375
376376   /* video hardware */
r3232r3233
393393   /* sound hardware */
394394   MDRV_SPEAKER_STANDARD_MONO("mono")
395395
396   MDRV_SOUND_ADD("ym", YM2151, 3579545)
396   MDRV_SOUND_ADD("ym", YM2151, XTAL_3_579545MHz)
397397   MDRV_SOUND_CONFIG(ym2151_config)
398398   MDRV_SOUND_ROUTE(0, "mono", 0.45)
399399   MDRV_SOUND_ROUTE(1, "mono", 0.45)
400400
401401   MDRV_SOUND_ADD("oki", OKIM6295, 1024188)
402   MDRV_SOUND_CONFIG(okim6295_interface_pin7high) // clock frequency & pin 7 not verified
402   MDRV_SOUND_CONFIG(okim6295_interface_pin7high) /* Verified - Pin 7 tied to +5VDC */
403403   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
404404MACHINE_DRIVER_END
405405
r3232r3233
442442  31J8_IC14    TJ-003                31A11-2  M6295   31J10_IC73
443443  31J9_IC15    61C16-35 61C16-35     Z80      YM2151
444444
445
446  Clock Crystals:
447
448  X1 - 28.000 MHz
449  X2 - 3.579545 MHz (for Z80)
450  X3 - 24.000 MHz (for 68000)
451  X4 - 1.056 MHz (not used, initially intended for OKI6295?)
452
453
454  The mask roms at IC1 and IC2 have the same pinouts as a MX27C4100 or M27C400
455  except pin 1 is not A17 but instead not used (not connected).
456
445457*******************************************************************************/
458
446459ROM_START( wwfwfest )
447460   ROM_REGION( 0x80000, "main", 0 ) /* Main CPU  (68000) */
448   ROM_LOAD16_BYTE( "31a13-2.19", 0x00001, 0x40000, CRC(7175bca7) SHA1(992b47a787b5bc2a5a381ec78b8dfaf7d42c614b) )
449   ROM_LOAD16_BYTE( "31a14-2.18", 0x00000, 0x40000, CRC(5d06bfd1) SHA1(39a93da662158aa5a9953dcabfcb47c2fc196dc7) )
461   ROM_LOAD16_BYTE( "31a13-2.ic19", 0x00001, 0x40000, CRC(7175bca7) SHA1(992b47a787b5bc2a5a381ec78b8dfaf7d42c614b) )
462   ROM_LOAD16_BYTE( "31a14-2.ic18", 0x00000, 0x40000, CRC(5d06bfd1) SHA1(39a93da662158aa5a9953dcabfcb47c2fc196dc7) )
450463
451   ROM_REGION( 0x10000, "audio", 0 ) /* Sound CPU (Z80)  */
452   ROM_LOAD( "31a11-2.42",    0x00000, 0x10000, CRC(5ddebfea) SHA1(30073963e965250d94f0dc3bd261a054850adf95) )
464    ROM_REGION( 0x10000, "audio", 0 ) /* Sound CPU (Z80)  */
465   ROM_LOAD( "31a11-2.ic42", 0x00000, 0x10000, CRC(5ddebfea) SHA1(30073963e965250d94f0dc3bd261a054850adf95) )
453466
454   ROM_REGION( 0x80000, "oki", 0 )   /* ADPCM samples */
455   ROM_LOAD( "wf_73a.rom",    0x00000, 0x80000, CRC(6c522edb) SHA1(8005d59c94160638ba2ea7caf4e991fff03003d5) )
467    ROM_REGION( 0x80000, "oki", 0 )   /* ADPCM samples */
468   ROM_LOAD( "31j10.ic73",   0x00000, 0x80000, CRC(6c522edb) SHA1(8005d59c94160638ba2ea7caf4e991fff03003d5) )
456469
457   ROM_REGION( 0x20000, "gfx1", ROMREGION_DISPOSE ) /* FG0 Tiles (8x8) */
458   ROM_LOAD( "31a12-0.33",    0x00000, 0x20000, CRC(d0803e20) SHA1(b68758e9a5522396f831a3972571f8aed54c64de) )
470    ROM_REGION( 0x20000, "gfx1", ROMREGION_DISPOSE ) /* FG0 Tiles (8x8) */
471   ROM_LOAD( "31a12-0.ic33", 0x00000, 0x20000, CRC(d0803e20) SHA1(b68758e9a5522396f831a3972571f8aed54c64de) )
459472
460   ROM_REGION( 0x800000, "gfx2", ROMREGION_DISPOSE ) /* SPR Tiles (16x16) */
461   ROM_LOAD( "wf_09.rom",    0x000000, 0x100000, CRC(e395cf1d) SHA1(241f98145e295993c9b6a44dc087a9b61fbc9a6f) ) /* Tiles 0 */
462   ROM_LOAD( "wf_08.rom",    0x100000, 0x100000, CRC(b5a97465) SHA1(08d82c29a5c02b83fdbd0bad649b74eb35ab7e54) ) /* Tiles 1 */
463   ROM_LOAD( "wf_11.rom",    0x200000, 0x100000, CRC(2ce545e8) SHA1(82173e58a8476a6fe9d2c990fce1f71af117a0ea) ) /* Tiles 0 */
464   ROM_LOAD( "wf_10.rom",    0x300000, 0x100000, CRC(00edb66a) SHA1(926606d1923936b6e75391b1ab03b369d9822d13) ) /* Tiles 1 */
465   ROM_LOAD( "wf_12.rom",    0x400000, 0x100000, CRC(79956cf8) SHA1(52207263620a6b6dde66d3f8749b772577899ea5) ) /* Tiles 0 */
466   ROM_LOAD( "wf_13.rom",    0x500000, 0x100000, CRC(74d774c3) SHA1(a723ac5d481bf91b12e17652fbb2d869c886dec0) ) /* Tiles 1 */
467   ROM_LOAD( "wf_15.rom",    0x600000, 0x100000, CRC(dd387289) SHA1(2cad42d4e7cd1a49346f844058ae18c38bc686a8) ) /* Tiles 0 */
468   ROM_LOAD( "wf_14.rom",    0x700000, 0x100000, CRC(44abe127) SHA1(c723e1dea117534e976d2d383e634faf073cd57b) ) /* Tiles 1 */
473   ROM_REGION( 0x800000, "gfx2", ROMREGION_DISPOSE ) /* SPR Tiles (16x16), 27080 Mask ROM's */
474   ROM_LOAD( "31j3.ic9",     0x000000, 0x100000, CRC(e395cf1d) SHA1(241f98145e295993c9b6a44dc087a9b61fbc9a6f) ) /* Tiles 0 */
475   ROM_LOAD( "31j2.ic8",     0x100000, 0x100000, CRC(b5a97465) SHA1(08d82c29a5c02b83fdbd0bad649b74eb35ab7e54) ) /* Tiles 1 */
476   ROM_LOAD( "31j5.ic11",    0x200000, 0x100000, CRC(2ce545e8) SHA1(82173e58a8476a6fe9d2c990fce1f71af117a0ea) ) /* Tiles 0 */
477   ROM_LOAD( "31j4.ic10",    0x300000, 0x100000, CRC(00edb66a) SHA1(926606d1923936b6e75391b1ab03b369d9822d13) ) /* Tiles 1 */
478   ROM_LOAD( "31j6.ic12",    0x400000, 0x100000, CRC(79956cf8) SHA1(52207263620a6b6dde66d3f8749b772577899ea5) ) /* Tiles 0 */
479   ROM_LOAD( "31j7.ic13",    0x500000, 0x100000, CRC(74d774c3) SHA1(a723ac5d481bf91b12e17652fbb2d869c886dec0) ) /* Tiles 1 */
480   ROM_LOAD( "31j9.ic15",    0x600000, 0x100000, CRC(dd387289) SHA1(2cad42d4e7cd1a49346f844058ae18c38bc686a8) ) /* Tiles 0 */
481   ROM_LOAD( "31j8.ic14",    0x700000, 0x100000, CRC(44abe127) SHA1(c723e1dea117534e976d2d383e634faf073cd57b) ) /* Tiles 1 */
469482
470483   ROM_REGION( 0x80000, "gfx3", ROMREGION_DISPOSE ) /* BG0 / BG1 Tiles (16x16) */
471   ROM_LOAD( "wf_01.rom",    0x40000, 0x40000, CRC(8a12b450) SHA1(2e15c949efcda8bb6f11afe3ff07ba1dee9c771c) ) /* 0,1 */
472   ROM_LOAD( "wf_02.rom",    0x00000, 0x40000, CRC(82ed7155) SHA1(b338e1150ffe3277c11d4d6e801a7d3bd7c58492) ) /* 2,3 */
484   ROM_LOAD( "31j0.ic1",     0x40000, 0x40000, CRC(8a12b450) SHA1(2e15c949efcda8bb6f11afe3ff07ba1dee9c771c) ) /* 0,1 */
485   ROM_LOAD( "31j1.ic2",     0x00000, 0x40000, CRC(82ed7155) SHA1(b338e1150ffe3277c11d4d6e801a7d3bd7c58492) ) /* 2,3 */
473486ROM_END
474487
475488ROM_START( wwfwfsta )
r3232r3233
477490   ROM_LOAD16_BYTE( "wf_18.rom", 0x00000, 0x40000, CRC(933ea1a0) SHA1(61da142cfa7abd3b77ab21979c061a078c0d0c63) )
478491   ROM_LOAD16_BYTE( "wf_19.rom", 0x00001, 0x40000, CRC(bd02e3c4) SHA1(7ae63e48caf9919ce7b63b4c5aa9474ba8c336da) )
479492
480   ROM_REGION( 0x10000, "audio", 0 ) /* Sound CPU (Z80)  */
481   ROM_LOAD( "31a11-2.42",    0x00000, 0x10000, CRC(5ddebfea) SHA1(30073963e965250d94f0dc3bd261a054850adf95) )
493    ROM_REGION( 0x10000, "audio", 0 ) /* Sound CPU (Z80)  */
494   ROM_LOAD( "31a11-2.ic42", 0x00000, 0x10000, CRC(5ddebfea) SHA1(30073963e965250d94f0dc3bd261a054850adf95) )
482495
483   ROM_REGION( 0x80000, "oki", 0 )   /* ADPCM samples */
484   ROM_LOAD( "wf_73a.rom",    0x00000, 0x80000, CRC(6c522edb) SHA1(8005d59c94160638ba2ea7caf4e991fff03003d5) )
496    ROM_REGION( 0x80000, "oki", 0 )   /* ADPCM samples */
497   ROM_LOAD( "31j10.ic73",   0x00000, 0x80000, CRC(6c522edb) SHA1(8005d59c94160638ba2ea7caf4e991fff03003d5) )
485498
486   ROM_REGION( 0x20000, "gfx1", ROMREGION_DISPOSE ) /* FG0 Tiles (8x8) */
499    ROM_REGION( 0x20000, "gfx1", ROMREGION_DISPOSE ) /* FG0 Tiles (8x8) */
487500   ROM_LOAD( "wf_33.rom",    0x00000, 0x20000, CRC(06f22615) SHA1(2e9418e372da85ea597977d912d8b35753655f4e) )
488501
489   ROM_REGION( 0x800000, "gfx2", ROMREGION_DISPOSE ) /* SPR Tiles (16x16) */
490   ROM_LOAD( "wf_09.rom",    0x000000, 0x100000, CRC(e395cf1d) SHA1(241f98145e295993c9b6a44dc087a9b61fbc9a6f) ) /* Tiles 0 */
491   ROM_LOAD( "wf_08.rom",    0x100000, 0x100000, CRC(b5a97465) SHA1(08d82c29a5c02b83fdbd0bad649b74eb35ab7e54) ) /* Tiles 1 */
492   ROM_LOAD( "wf_11.rom",    0x200000, 0x100000, CRC(2ce545e8) SHA1(82173e58a8476a6fe9d2c990fce1f71af117a0ea) ) /* Tiles 0 */
493   ROM_LOAD( "wf_10.rom",    0x300000, 0x100000, CRC(00edb66a) SHA1(926606d1923936b6e75391b1ab03b369d9822d13) ) /* Tiles 1 */
494   ROM_LOAD( "wf_12.rom",    0x400000, 0x100000, CRC(79956cf8) SHA1(52207263620a6b6dde66d3f8749b772577899ea5) ) /* Tiles 0 */
495   ROM_LOAD( "wf_13.rom",    0x500000, 0x100000, CRC(74d774c3) SHA1(a723ac5d481bf91b12e17652fbb2d869c886dec0) ) /* Tiles 1 */
496   ROM_LOAD( "wf_15.rom",    0x600000, 0x100000, CRC(dd387289) SHA1(2cad42d4e7cd1a49346f844058ae18c38bc686a8) ) /* Tiles 0 */
497   ROM_LOAD( "wf_14.rom",    0x700000, 0x100000, CRC(44abe127) SHA1(c723e1dea117534e976d2d383e634faf073cd57b) ) /* Tiles 1 */
502   ROM_REGION( 0x800000, "gfx2", ROMREGION_DISPOSE ) /* SPR Tiles (16x16), 27080 Mask ROM's */
503   ROM_LOAD( "31j3.ic9",     0x000000, 0x100000, CRC(e395cf1d) SHA1(241f98145e295993c9b6a44dc087a9b61fbc9a6f) ) /* Tiles 0 */
504   ROM_LOAD( "31j2.ic8",     0x100000, 0x100000, CRC(b5a97465) SHA1(08d82c29a5c02b83fdbd0bad649b74eb35ab7e54) ) /* Tiles 1 */
505   ROM_LOAD( "31j5.ic11",    0x200000, 0x100000, CRC(2ce545e8) SHA1(82173e58a8476a6fe9d2c990fce1f71af117a0ea) ) /* Tiles 0 */
506   ROM_LOAD( "31j4.ic10",    0x300000, 0x100000, CRC(00edb66a) SHA1(926606d1923936b6e75391b1ab03b369d9822d13) ) /* Tiles 1 */
507   ROM_LOAD( "31j6.ic12",    0x400000, 0x100000, CRC(79956cf8) SHA1(52207263620a6b6dde66d3f8749b772577899ea5) ) /* Tiles 0 */
508   ROM_LOAD( "31j7.ic13",    0x500000, 0x100000, CRC(74d774c3) SHA1(a723ac5d481bf91b12e17652fbb2d869c886dec0) ) /* Tiles 1 */
509   ROM_LOAD( "31j9.ic15",    0x600000, 0x100000, CRC(dd387289) SHA1(2cad42d4e7cd1a49346f844058ae18c38bc686a8) ) /* Tiles 0 */
510   ROM_LOAD( "31j8.ic14",    0x700000, 0x100000, CRC(44abe127) SHA1(c723e1dea117534e976d2d383e634faf073cd57b) ) /* Tiles 1 */
498511
499512   ROM_REGION( 0x80000, "gfx3", ROMREGION_DISPOSE ) /* BG0 / BG1 Tiles (16x16) */
500   ROM_LOAD( "wf_01.rom",    0x40000, 0x40000, CRC(8a12b450) SHA1(2e15c949efcda8bb6f11afe3ff07ba1dee9c771c) ) /* 0,1 */
501   ROM_LOAD( "wf_02.rom",    0x00000, 0x40000, CRC(82ed7155) SHA1(b338e1150ffe3277c11d4d6e801a7d3bd7c58492) ) /* 2,3 */
513   ROM_LOAD( "31j0.ic1",     0x40000, 0x40000, CRC(8a12b450) SHA1(2e15c949efcda8bb6f11afe3ff07ba1dee9c771c) ) /* 0,1 */
514   ROM_LOAD( "31j1.ic2",     0x00000, 0x40000, CRC(82ed7155) SHA1(b338e1150ffe3277c11d4d6e801a7d3bd7c58492) ) /* 2,3 */
502515ROM_END
503516
504517ROM_START( wwfwfstb )
r3232r3233
534547
535548ROM_START( wwfwfstj )
536549   ROM_REGION( 0x80000, "main", 0 ) /* Main CPU  (68000) */
537   ROM_LOAD16_BYTE( "31j13-0.bin", 0x00001, 0x40000, CRC(2147780d) SHA1(9a7a5db06117f3780e084d3f0c7b642ff8a9db55) )
538   ROM_LOAD16_BYTE( "31j14-0.bin", 0x00000, 0x40000, CRC(d76fc747) SHA1(5f6819bc61756d1df4ac0776ac420a59c438cf8a) )
550   ROM_LOAD16_BYTE( "31j13-0.ic19", 0x00001, 0x40000, CRC(2147780d) SHA1(9a7a5db06117f3780e084d3f0c7b642ff8a9db55) )
551   ROM_LOAD16_BYTE( "31j14-0.ic18", 0x00000, 0x40000, CRC(d76fc747) SHA1(5f6819bc61756d1df4ac0776ac420a59c438cf8a) )
539552
540   ROM_REGION( 0x10000, "audio", 0 ) /* Sound CPU (Z80)  */
541   ROM_LOAD( "31a11-2.42",    0x00000, 0x10000, CRC(5ddebfea) SHA1(30073963e965250d94f0dc3bd261a054850adf95) )
553    ROM_REGION( 0x10000, "audio", 0 ) /* Sound CPU (Z80)  */
554   ROM_LOAD( "31a11-2.ic42", 0x00000, 0x10000, CRC(5ddebfea) SHA1(30073963e965250d94f0dc3bd261a054850adf95) )
542555
543   ROM_REGION( 0x80000, "oki", 0 )   /* ADPCM samples */
544   ROM_LOAD( "wf_73a.rom",    0x00000, 0x80000, CRC(6c522edb) SHA1(8005d59c94160638ba2ea7caf4e991fff03003d5) )
556    ROM_REGION( 0x80000, "oki", 0 )   /* ADPCM samples */
557   ROM_LOAD( "31j10.ic73",   0x00000, 0x80000, CRC(6c522edb) SHA1(8005d59c94160638ba2ea7caf4e991fff03003d5) )
545558
546   ROM_REGION( 0x20000, "gfx1", ROMREGION_DISPOSE ) /* FG0 Tiles (8x8) */
547   ROM_LOAD( "31j12-0.bin",    0x00000, 0x20000, CRC(f4821fe0) SHA1(e5faa9860e9d4e75393b64ca85a8bfc4852fd4fd) )
559    ROM_REGION( 0x20000, "gfx1", ROMREGION_DISPOSE ) /* FG0 Tiles (8x8) */
560   ROM_LOAD( "31j12-0.ic33", 0x00000, 0x20000, CRC(f4821fe0) SHA1(e5faa9860e9d4e75393b64ca85a8bfc4852fd4fd) )
548561
549   ROM_REGION( 0x800000, "gfx2", ROMREGION_DISPOSE ) /* SPR Tiles (16x16) */
550   ROM_LOAD( "wf_09.rom",    0x000000, 0x100000, CRC(e395cf1d) SHA1(241f98145e295993c9b6a44dc087a9b61fbc9a6f) ) /* Tiles 0 */
551   ROM_LOAD( "wf_08.rom",    0x100000, 0x100000, CRC(b5a97465) SHA1(08d82c29a5c02b83fdbd0bad649b74eb35ab7e54) ) /* Tiles 1 */
552   ROM_LOAD( "wf_11.rom",    0x200000, 0x100000, CRC(2ce545e8) SHA1(82173e58a8476a6fe9d2c990fce1f71af117a0ea) ) /* Tiles 0 */
553   ROM_LOAD( "wf_10.rom",    0x300000, 0x100000, CRC(00edb66a) SHA1(926606d1923936b6e75391b1ab03b369d9822d13) ) /* Tiles 1 */
554   ROM_LOAD( "wf_12.rom",    0x400000, 0x100000, CRC(79956cf8) SHA1(52207263620a6b6dde66d3f8749b772577899ea5) ) /* Tiles 0 */
555   ROM_LOAD( "wf_13.rom",    0x500000, 0x100000, CRC(74d774c3) SHA1(a723ac5d481bf91b12e17652fbb2d869c886dec0) ) /* Tiles 1 */
556   ROM_LOAD( "wf_15.rom",    0x600000, 0x100000, CRC(dd387289) SHA1(2cad42d4e7cd1a49346f844058ae18c38bc686a8) ) /* Tiles 0 */
557   ROM_LOAD( "wf_14.rom",    0x700000, 0x100000, CRC(44abe127) SHA1(c723e1dea117534e976d2d383e634faf073cd57b) ) /* Tiles 1 */
562   ROM_REGION( 0x800000, "gfx2", ROMREGION_DISPOSE ) /* SPR Tiles (16x16), 27080 Mask ROM's */
563   ROM_LOAD( "31j3.ic9",     0x000000, 0x100000, CRC(e395cf1d) SHA1(241f98145e295993c9b6a44dc087a9b61fbc9a6f) ) /* Tiles 0 */
564   ROM_LOAD( "31j2.ic8",     0x100000, 0x100000, CRC(b5a97465) SHA1(08d82c29a5c02b83fdbd0bad649b74eb35ab7e54) ) /* Tiles 1 */
565   ROM_LOAD( "31j5.ic11",    0x200000, 0x100000, CRC(2ce545e8) SHA1(82173e58a8476a6fe9d2c990fce1f71af117a0ea) ) /* Tiles 0 */
566   ROM_LOAD( "31j4.ic10",    0x300000, 0x100000, CRC(00edb66a) SHA1(926606d1923936b6e75391b1ab03b369d9822d13) ) /* Tiles 1 */
567   ROM_LOAD( "31j6.ic12",    0x400000, 0x100000, CRC(79956cf8) SHA1(52207263620a6b6dde66d3f8749b772577899ea5) ) /* Tiles 0 */
568   ROM_LOAD( "31j7.ic13",    0x500000, 0x100000, CRC(74d774c3) SHA1(a723ac5d481bf91b12e17652fbb2d869c886dec0) ) /* Tiles 1 */
569   ROM_LOAD( "31j9.ic15",    0x600000, 0x100000, CRC(dd387289) SHA1(2cad42d4e7cd1a49346f844058ae18c38bc686a8) ) /* Tiles 0 */
570   ROM_LOAD( "31j8.ic14",    0x700000, 0x100000, CRC(44abe127) SHA1(c723e1dea117534e976d2d383e634faf073cd57b) ) /* Tiles 1 */
558571
559572   ROM_REGION( 0x80000, "gfx3", ROMREGION_DISPOSE ) /* BG0 / BG1 Tiles (16x16) */
560   ROM_LOAD( "wf_01.rom",    0x40000, 0x40000, CRC(8a12b450) SHA1(2e15c949efcda8bb6f11afe3ff07ba1dee9c771c) ) /* 0,1 */
561   ROM_LOAD( "wf_02.rom",    0x00000, 0x40000, CRC(82ed7155) SHA1(b338e1150ffe3277c11d4d6e801a7d3bd7c58492) ) /* 2,3 */
573   ROM_LOAD( "31j0.ic1",     0x40000, 0x40000, CRC(8a12b450) SHA1(2e15c949efcda8bb6f11afe3ff07ba1dee9c771c) ) /* 0,1 */
574   ROM_LOAD( "31j1.ic2",     0x00000, 0x40000, CRC(82ed7155) SHA1(b338e1150ffe3277c11d4d6e801a7d3bd7c58492) ) /* 2,3 */
562575ROM_END
563576
564GAME( 1991, wwfwfest, 0,        wwfwfest, wwfwfest, 0, ROT0, "Technos Japan", "WWF WrestleFest (US set 1)", 0 )
565GAME( 1991, wwfwfsta, wwfwfest, wwfwfest, wwfwfest, 0, ROT0, "Technos Japan (Tecmo license)", "WWF WrestleFest (US Tecmo)", 0 )
566GAME( 1991, wwfwfstb, wwfwfest, wwfwfstb, wwfwfest, 0, ROT0, "bootleg", "WWF WrestleFest (US bootleg)", 0 )
567GAME( 1991, wwfwfstj, wwfwfest, wwfwfest, wwfwfest, 0, ROT0, "Technos Japan", "WWF WrestleFest (Japan)", 0 )
577GAME( 1991, wwfwfest, 0,        wwfwfest, wwfwfest, 0, ROT0, "Technos Japan",                 "WWF WrestleFest (US set 1)",   GAME_SUPPORTS_SAVE )
578GAME( 1991, wwfwfsta, wwfwfest, wwfwfest, wwfwfest, 0, ROT0, "Technos Japan (Tecmo license)", "WWF WrestleFest (US Tecmo)",   GAME_SUPPORTS_SAVE )
579GAME( 1991, wwfwfstb, wwfwfest, wwfwfstb, wwfwfest, 0, ROT0, "bootleg",                       "WWF WrestleFest (US bootleg)", GAME_SUPPORTS_SAVE )
580GAME( 1991, wwfwfstj, wwfwfest, wwfwfest, wwfwfest, 0, ROT0, "Technos Japan",                 "WWF WrestleFest (Japan)",      GAME_SUPPORTS_SAVE )
src/mame/drivers/multigam.c
r3232r3233
203203static int multigam3_mmc3_scanline_latch;
204204static int multigam3_mmc3_banks[2];
205205static int multigam3_mmc3_4screen;
206static int multigam3_mmc3_last_bank = 0xff;
206static int multigam3_mmc3_last_bank;
207207static UINT8* multigmc_mmc3_6000_ram;
208208
209209static void multigam3_mmc3_scanline_cb( int num, int scanline, int vblank, int blanked )
src/mame/drivers/sderby.c
r3232r3233
1/*
1/*******************************************************************************************
2
23  Playmark 'Super Derby' Hardware
4  -------------------------------
35
6  Driver by David Haywood.
7  Additional work by Roberto Fresca.
48
5  Super Derby - Playmark
6  Roulette(?) - Playmark
79
8 Payout / hopper controls not connected
10  Supported games:
911
10 Roulette appears to have some kind of MCU device
11 between the processor and the hopper
12  Super Derby,                  1996, Playmark.
13  Scacco Matto / Space Win,     1996, Playmark.
14  Croupier (Playmark Roulette), 1997, Playmark.
1215
1316
14*/
17********************************************************************************************
1518
19  NOTES:
20  -----
1621
17/*
22  Payout / hopper controls not connected
1823
19Super Derby
20Playmark '96
24  Roulette appears to have some kind of MCU device
25  between the processor and the hopper
2126
22mc 68k 12mhz
23OKI m6295
2427
252x GM 76c88al (8kx8 6264) near program ROMs
262x 6264 near gfx ROMs
2716k nonvolatile SRAM (Dallas 1220Y)
28two FPGA chips - one labelled 'Playmark 010412'
294x hm3-65728bk-5
30--
3121.bin 6F9F2F2B - near OKI (samples?)
28  Working notes: (Relating to SDERBY)
3229
3322.bin A319F1E0 - program code
3423.bin 1D6E2321 /
30  Stephh's notes :
3531
3624.bin 93C917DF  - gfx
3725.bin 7BA485CD
3826.bin BEABE4F7
3927.bin 672CE5DF
4028.bin 39CA3B52
41--
42
43*/
44
45/* working notes: (Relating to SDERBY)
46
47Stephh's notes :
48
4932  - The game is playable, but :
5033
5134      * it isn't possible to decrease the bet (but it might be an ingame "feature")
r3232r3233
5639    input ports.
5740
5841
59EC notes :
42  EC notes :
6043
61Thinks... Those three reads at the beginning - hopper, ticket and note acceptor tests?
62The system certainly performs those before printing the error.
63(There are three different error graphics in the ROM, depending on what is wrong)
64Also, hardware freezes if we try to turn the dispenser or acceptor on, because it's waiting
65for the response back from NOP?
44  Thinks... Those three reads at the beginning - hopper, ticket and note acceptor tests?
45  The system certainly performs those before printing the error.
46  (There are three different error graphics in the ROM, depending on what is wrong)
47  Also, hardware freezes if we try to turn the dispenser or acceptor on, because it's waiting
48  for the response back from NOP?
6649
6750
68TO DO :
51********************************************************************************************
6952
53  TO DO :
54
7055  - figure out the reads from 0x308002.w and 0x30800e.w (see sderby_input_r read handler)
7156  (by default, demo sounds are OFF, so change this in the "test mode")
7257
73*/
7458
59*******************************************************************************************/
60
7561#include "driver.h"
7662#include "sound/okim6295.h"
63#include "sderby.lh"
64#include "spacewin.lh"
65#include "pmroulet.lh"
7766
7867UINT16 *sderby_fg_videoram;
7968UINT16 *sderby_md_videoram;
r3232r3233
8877WRITE16_HANDLER( sderby_scroll_w );
8978
9079
80/***************************
81*       R/W Handlers       *
82***************************/
83
9184static READ16_HANDLER ( sderby_input_r )
9285{
9386   switch (offset)
r3232r3233
107100{
108101   switch (offset)
109102   {
110   case 0x00 >>1:
111      return input_port_read(machine, "IN0");
112   case 0x02 >>1:
113      return input_port_read(machine, "IN1");
114   case 0x04 >>1:
115      return input_port_read(machine, "IN2");
103      case 0x00 >> 1:
104         return input_port_read(machine, "IN0");
105      case 0x02 >> 1:
106         return input_port_read(machine, "IN1");
107      case 0x04 >> 1:
108         return input_port_read(machine, "IN2");
116109   }
110
117111   return 0xffff;
112}
118113
114
115/***************************************************************
116
117    Roulette MCU communication.
118    ---------------------------
119
120    Defeating the 'always win' protection...
121
122    Offset: 0x70800e - 0x70800f.
123
124    Writes to the MCU are always the same values.
125    At begining, the code writes 3 values: 0x53, 0x5a and 0x0d.
126    Then, whith each placed bet the code normally writes 0x4e.
127    After that, there are 2 reads expecting the MCU response.
128
129    Most probably there is a shared RAM there for communication,
130    but for now, I temporarily simulated the MCU response till
131    we can get the MCU decapped.
132
133
134****************************************************************/
135
136static READ16_HANDLER( rprot_r )
137{
138   logerror("rprot_r : offset = %02x\n",activecpu_get_pc());
139
140/* This is the only mask I found that allow a normal play.
141   Using other values, the game hangs waiting for response,
142   or simply throw a deliberated losing number.
143
144   If someone more skilled in 68K code can help to trace it,
145   searching for an accurated response, I'll appreciate.
146*/
147   return mame_rand(machine) & 0x1f;
119148}
120149
121static ADDRESS_MAP_START( sderby_readmem, ADDRESS_SPACE_PROGRAM, 16 )
122   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
123   AM_RANGE(0x100000, 0x103fff) AM_READ(SMH_RAM)
124   AM_RANGE(0x200000, 0x200fff) AM_READ(SMH_RAM)
150static WRITE16_HANDLER( rprot_w )
151{
152   logerror("rprot_w %02x\n", data);
153}
154
155
156/******************************
157*       Outputs / Lamps       *
158******************************/
159
160static WRITE16_HANDLER( sderby_out_w )
161{
162/*
163  ---------------------------
164  --- Super Derby Outputs ---
165  ---------------------------
166
167  0x0000 - Normal State (lamps off).
168  0x0001 - Start lamp.
169  0x0002 - Bet lamp.
170
171  0x0100 - Ticket dispenser out.
172  0x0800 - Unknown (always activated).
173  0x1000 - Hopper out.
174  0x2000 - Coin counter.
175  0x4000 - Unknown.
176  0x8000 - End of Race lamp.
177
178
179    - Lbits -
180    7654 3210
181    =========
182    ---- ---x  Start lamp.
183    ---- --x-  Bet lamp.
184
185    - Hbits -
186    7654 3210
187    =========
188    ---- ---x  Ticket dispenser out.
189    ---- x---  unknown (always activated).
190    ---x ----  Hopper out.
191    --x- ----  Coin counter.
192    -x-- ----  unknown.
193    x--- ----  End of Race lamp.
194
195*/
196   output_set_lamp_value(1, (data & 1));         /* Lamp 1 - START */
197   output_set_lamp_value(2, (data >> 1) & 1);      /* Lamp 2 - BET */
198   output_set_lamp_value(3, (data >> 15) & 1);      /* Lamp 3 - END OF RACE */
199
200   coin_counter_w(0, data & 0x2000);
201}
202
203
204static WRITE16_HANDLER( scmatto_out_w )
205{
206/*
207  ----------------------------------------
208  --- Scacco Matto / Space Win Outputs ---
209  ----------------------------------------
210
211  0x0000 - Normal State (lamps off).
212  0x0001 - Hold 1 lamp.
213  0x0002 - Hold 2 lamp.
214  0x0004 - Hold 3 lamp.
215  0x0008 - Hold 4 lamp.
216  0x0010 - Hold 5 lamp.
217  0x0020 - Start lamp.
218  0x0040 - Bet lamp.
219  0x1000 - Hopper out.
220  0x2000 - Coin counter.
221
222
223    - Lbits -
224    7654 3210
225    =========
226    ---- ---x  Hold1 lamp.
227    ---- --x-  Hold2 lamp.
228    ---- -x--  Hold3 lamp.
229    ---- x---  Hold4 lamp.
230    ---x ----  Hold5 lamp.
231    --x- ----  Start lamp.
232    -x-- ----  Bet lamp.
233
234    - Hbits -
235    7654 3210
236    =========
237    ---x ----  Hopper out.
238    --x- ----  Coin counter.
239
240*/
241   output_set_lamp_value(1, (data & 1));         /* Lamp 1 - HOLD 1 */
242   output_set_lamp_value(2, (data >> 1) & 1);      /* Lamp 2 - HOLD 2 */
243   output_set_lamp_value(3, (data >> 2) & 1);      /* Lamp 3 - HOLD 3 */
244   output_set_lamp_value(4, (data >> 3) & 1);      /* Lamp 4 - HOLD 4 */
245   output_set_lamp_value(5, (data >> 4) & 1);      /* Lamp 5 - HOLD 5 */
246   output_set_lamp_value(6, (data >> 5) & 1);      /* Lamp 6 - START  */
247   output_set_lamp_value(7, (data >> 6) & 1);      /* Lamp 7 - BET    */
248
249   coin_counter_w(0, data & 0x2000);
250}
251
252
253static WRITE16_HANDLER( roulette_out_w )
254{
255/*
256  -----------------------------------
257  --- Croupier (Roulette) Outputs ---
258  -----------------------------------
259
260  0x708006 - 0x708007
261  ===================
262
263  0x0000 - Normal State (lamps off).
264  0x0001 - Start lamp.
265  0x0002 - Bet lamp.
266  0x0008 - Unknown (always activated).
267
268
269    - Lbits -
270    7654 3210
271    =========
272    ---- ---x  Start lamp.
273    ---- --x-  Bet lamp.
274    ---- x---  Unknown (always activated).
275
276*/
277   output_set_lamp_value(1, (data & 1));         /* Lamp 1 - START */
278   output_set_lamp_value(2, (data >> 1) & 1);      /* Lamp 2 - BET   */
279}
280
281
282/***************************
283*       Memory Maps        *
284***************************/
285
286static ADDRESS_MAP_START( sderby_map, ADDRESS_SPACE_PROGRAM, 16 )
287   AM_RANGE(0x000000, 0x07ffff) AM_ROM
288   AM_RANGE(0x100000, 0x100fff) AM_RAM AM_WRITE(sderby_videoram_w) AM_BASE(&sderby_videoram)      /* bg */
289   AM_RANGE(0x101000, 0x101fff) AM_RAM AM_WRITE(sderby_md_videoram_w) AM_BASE(&sderby_md_videoram)   /* mid */
290   AM_RANGE(0x102000, 0x103fff) AM_RAM AM_WRITE(sderby_fg_videoram_w) AM_BASE(&sderby_fg_videoram)   /* fg */
291   AM_RANGE(0x104000, 0x10400b) AM_WRITE(sderby_scroll_w)
292   AM_RANGE(0x10400c, 0x10400d) AM_WRITE(SMH_NOP)   /* ??? - check code at 0x000456 (executed once at startup) */
293   AM_RANGE(0x10400e, 0x10400f) AM_WRITE(SMH_NOP)   /* ??? - check code at 0x000524 (executed once at startup) */
294    AM_RANGE(0x200000, 0x200fff) AM_RAM AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
125295   AM_RANGE(0x308000, 0x30800d) AM_READ(sderby_input_r)
126   AM_RANGE(0x30800e, 0x30800f) AM_READ(okim6295_status_0_lsb_r)
127   AM_RANGE(0xd00000, 0xd001ff) AM_READ(SMH_RAM)
128   AM_RANGE(0xf00000, 0xffffff) AM_READ(SMH_RAM)
296   AM_RANGE(0x308008, 0x308009) AM_WRITE(sderby_out_w)   /* output port */
297   AM_RANGE(0x30800e, 0x30800f) AM_READWRITE(okim6295_status_0_lsb_r, okim6295_data_0_lsb_w)
298   AM_RANGE(0x380000, 0x380fff) AM_WRITE(paletteram16_RRRRRGGGGGBBBBBx_word_w) AM_BASE(&paletteram16)
299   AM_RANGE(0x500000, 0x500001) AM_WRITE(SMH_NOP)   /* unknown... write 0x01 in game, and 0x00 on reset */
300   AM_RANGE(0xd00000, 0xd007ff) AM_RAM AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size)
301   AM_RANGE(0xffc000, 0xffffff) AM_RAM
129302ADDRESS_MAP_END
130303
131static ADDRESS_MAP_START( sderby_writemem, ADDRESS_SPACE_PROGRAM, 16 )
132   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)
133   AM_RANGE(0x100000, 0x100fff) AM_WRITE(sderby_videoram_w) AM_BASE(&sderby_videoram) // bg
134   AM_RANGE(0x101000, 0x101fff) AM_WRITE(sderby_md_videoram_w) AM_BASE(&sderby_md_videoram) // mid
135   AM_RANGE(0x102000, 0x103fff) AM_WRITE(sderby_fg_videoram_w) AM_BASE(&sderby_fg_videoram) // fg
136   AM_RANGE(0x104000, 0x10400b) AM_WRITE(sderby_scroll_w)
137   AM_RANGE(0x10400c, 0x10400d) AM_WRITE(SMH_NOP)   // ??? - check code at 0x000456 (executed once at startup)
138   AM_RANGE(0x10400e, 0x10400f) AM_WRITE(SMH_NOP)   // ??? - check code at 0x000524 (executed once at startup)
139    AM_RANGE(0x200000, 0x200fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
140   AM_RANGE(0x308008, 0x308009) AM_WRITE(SMH_NOP)   // ???
141   AM_RANGE(0x30800e, 0x30800f) AM_WRITE(okim6295_data_0_lsb_w)
304static ADDRESS_MAP_START( spacewin_map, ADDRESS_SPACE_PROGRAM, 16 )
305   AM_RANGE(0x000000, 0x03ffff) AM_ROM
306   AM_RANGE(0x100000, 0x100fff) AM_RAM AM_WRITE(sderby_videoram_w) AM_BASE(&sderby_videoram)      /* bg */
307   AM_RANGE(0x101000, 0x101fff) AM_RAM AM_WRITE(sderby_md_videoram_w) AM_BASE(&sderby_md_videoram)   /* mid */
308   AM_RANGE(0x102000, 0x103fff) AM_RAM AM_WRITE(sderby_fg_videoram_w) AM_BASE(&sderby_fg_videoram)   /* fg */
309   AM_RANGE(0x104000, 0x10400b) AM_WRITE(sderby_scroll_w)   /* tilemaps offset control */
310   AM_RANGE(0x10400c, 0x10400d) AM_WRITE(SMH_NOP)   /* seems another video register. constantly used */
311   AM_RANGE(0x10400e, 0x10400f) AM_WRITE(SMH_NOP)   /* seems another video register. constantly used */
312   AM_RANGE(0x104010, 0x105fff) AM_WRITE(SMH_NOP)   /* unknown */
313   AM_RANGE(0x300000, 0x300001) AM_WRITE(SMH_NOP)   /* unknown... write 0x01 in game, and 0x00 on reset */
314   AM_RANGE(0x308000, 0x30800d) AM_READ(sderby_input_r)
315   AM_RANGE(0x308008, 0x308009) AM_WRITE(scmatto_out_w)   /* output port */
316   AM_RANGE(0x30800e, 0x30800f) AM_READWRITE(okim6295_status_0_lsb_r, okim6295_data_0_lsb_w)
142317   AM_RANGE(0x380000, 0x380fff) AM_WRITE(paletteram16_RRRRRGGGGGBBBBBx_word_w) AM_BASE(&paletteram16)
143   AM_RANGE(0x500000, 0x500001) AM_WRITE(SMH_NOP)   // ??? - check code at 0x00042e (executed once at startup)
144   AM_RANGE(0xd00000, 0xd001ff) AM_WRITE(SMH_RAM)
145   AM_RANGE(0xf00000, 0xffffff) AM_WRITE(SMH_RAM)
318   AM_RANGE(0xd00000, 0xd001ff) AM_RAM
319    AM_RANGE(0x800000, 0x800fff) AM_RAM AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
320   AM_RANGE(0x801000, 0x80100d) AM_WRITE(SMH_NOP)   /* unknown */
321   AM_RANGE(0x8f0000, 0x8f07ff) AM_RAM AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size)   /* 16K Dallas DS1220Y-200 NVRAM */
322   AM_RANGE(0x8fc000, 0x8fffff) AM_RAM
146323ADDRESS_MAP_END
147324
148325static ADDRESS_MAP_START( roulette_map, ADDRESS_SPACE_PROGRAM, 16 )
149326   AM_RANGE(0x000000, 0x03ffff) AM_ROM
150327    AM_RANGE(0x440000, 0x440fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
151   AM_RANGE(0x500000, 0x500fff) AM_RAM_WRITE(sderby_videoram_w) AM_BASE(&sderby_videoram) // bg
152   AM_RANGE(0x501000, 0x501fff) AM_RAM_WRITE(sderby_md_videoram_w) AM_BASE(&sderby_md_videoram) // mid
153   AM_RANGE(0x502000, 0x503fff) AM_RAM_WRITE(sderby_fg_videoram_w) AM_BASE(&sderby_fg_videoram) // fg
328   AM_RANGE(0x500000, 0x500fff) AM_RAM_WRITE(sderby_videoram_w) AM_BASE(&sderby_videoram)         /* bg */
329   AM_RANGE(0x501000, 0x501fff) AM_RAM_WRITE(sderby_md_videoram_w) AM_BASE(&sderby_md_videoram)   /* mid */
330   AM_RANGE(0x502000, 0x503fff) AM_RAM_WRITE(sderby_fg_videoram_w) AM_BASE(&sderby_fg_videoram)   /* fg */
154331   AM_RANGE(0x504000, 0x50400b) AM_RAM_WRITE(sderby_scroll_w)
155   AM_RANGE(0x50400e, 0x50400f) AM_WRITE( SMH_NOP )
332   AM_RANGE(0x50400e, 0x50400f) AM_WRITE(SMH_NOP)
156333
157   AM_RANGE(0x708000, 0x70800d) AM_READ(roulette_input_r) AM_WRITE(SMH_NOP) // what are the writes?
158   AM_RANGE(0x708008, 0x708009) AM_WRITE(SMH_NOP)   // ???
159   AM_RANGE(0x70800e, 0x70800f) AM_READ(okim6295_status_0_lsb_r) AM_WRITE(okim6295_data_0_lsb_w) // ?? it only ever plays 1 sound
334   AM_RANGE(0x708000, 0x708009) AM_READ(roulette_input_r)
335   AM_RANGE(0x708006, 0x708007) AM_WRITE(roulette_out_w)
336   AM_RANGE(0x70800a, 0x70800b) AM_READWRITE(okim6295_status_0_lsb_r, okim6295_data_0_lsb_w)
337   AM_RANGE(0x70800c, 0x70800d) AM_WRITE(SMH_NOP)   /* watchdog?? (0x0003) */
338   AM_RANGE(0x70800e, 0x70800f) AM_READWRITE(rprot_r, rprot_w)   /* MCU communication */
160339   AM_RANGE(0x780000, 0x780fff) AM_WRITE(paletteram16_RRRRRGGGGGBBBBBx_word_w) AM_BASE(&paletteram16)
161340
162   AM_RANGE(0xf00000, 0xffffff) AM_RAM
341   AM_RANGE(0xff0000, 0xff07ff) AM_RAM AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size)
342   AM_RANGE(0xffc000, 0xffffff) AM_RAM
163343ADDRESS_MAP_END
164344
165345
166346
347/***************************
348*       Input Ports        *
349***************************/
350
167351static INPUT_PORTS_START( sderby )
168352   PORT_START("IN0")   /* 0x308000.w */
169353   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
r3232r3233
184368   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
185369INPUT_PORTS_END
186370
371static INPUT_PORTS_START( spacewin )
372   PORT_START("IN0")   /* 0x308000.w */
373   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Hold 1") PORT_CODE(KEYCODE_Z)
374   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Hold 2") PORT_CODE(KEYCODE_X)
375   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Hold 3") PORT_CODE(KEYCODE_C)
376   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Hold 4") PORT_CODE(KEYCODE_V)
377   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Hold 5") PORT_CODE(KEYCODE_B)
378   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START )   PORT_NAME("Start")
379   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Bet") PORT_CODE(KEYCODE_A)
380   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
381   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 )
382   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
383   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
384   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
385   PORT_SERVICE_NO_TOGGLE(0x1000, IP_ACTIVE_LOW)
386   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
387   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
388   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
389INPUT_PORTS_END
390
187391static INPUT_PORTS_START( pmroulet )
188392   PORT_START("IN0")
189   PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNKNOWN ) // ?
190   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK ) // it must be toggled to boot anyway
191   PORT_SERVICE_NO_TOGGLE(0x0020, IP_ACTIVE_LOW) // seems to be ..
192   PORT_BIT( 0x00c0, IP_ACTIVE_LOW, IPT_UNKNOWN ) // ?
193   PORT_BIT( 0x0f00, IP_ACTIVE_LOW, IPT_UNKNOWN ) // ?
194   PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // ?
393   PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNKNOWN )
394   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK ) /* it must be toggled to boot anyway */
395   PORT_SERVICE_NO_TOGGLE(0x0020, IP_ACTIVE_LOW)
396   PORT_BIT( 0x00c0, IP_ACTIVE_LOW, IPT_UNKNOWN )
397   PORT_BIT( 0x0f00, IP_ACTIVE_LOW, IPT_UNKNOWN )
398   PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNKNOWN )
195399
196400   PORT_START("IN1")
197401   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
198   PORT_BIT( 0x000e, IP_ACTIVE_LOW, IPT_UNKNOWN ) // ?
199   PORT_BIT( 0x00f0, IP_ACTIVE_LOW, IPT_UNKNOWN ) // ?
200   PORT_BIT( 0x0f00, IP_ACTIVE_LOW, IPT_UNKNOWN ) // ?
201   PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // ?
402   PORT_BIT( 0x000e, IP_ACTIVE_LOW, IPT_UNKNOWN )
403   PORT_BIT( 0x00f0, IP_ACTIVE_LOW, IPT_UNKNOWN )
404   PORT_BIT( 0x0f00, IP_ACTIVE_LOW, IPT_UNKNOWN )
405   PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNKNOWN )
202406
203407   PORT_START("IN2")
204408   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
r3232r3233
207411   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
208412   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 )
209413   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 )
210   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) // ?
414   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) /* to cancel bets in 3-button mode */
211415   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
212     PORT_BIT( 0x0f00, IP_ACTIVE_LOW, IPT_UNKNOWN ) // ?
213   PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // ?
416   PORT_BIT( 0x0f00, IP_ACTIVE_LOW, IPT_UNKNOWN )
417   PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNKNOWN )
214418INPUT_PORTS_END
215419
420
421/****************************
422*     Graphics Layouts      *
423****************************/
424
216425static const gfx_layout tiles8x8_layout =
217426{
218   8,8,
427   8, 8,
219428   RGN_FRAC(1,5),
220429   5,
221   { RGN_FRAC(4,5),RGN_FRAC(3,5),RGN_FRAC(2,5),RGN_FRAC(1,5),RGN_FRAC(0,5) },
430   { RGN_FRAC(4,5), RGN_FRAC(3,5), RGN_FRAC(2,5), RGN_FRAC(1,5), RGN_FRAC(0,5) },
222431   { 0, 1, 2, 3, 4, 5, 6, 7 },
223432   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
224433   8*8
225434};
226435
227
228436static const gfx_layout tiles16x16_layout =
229437{
230   16,16,
438   16, 16,
231439   RGN_FRAC(1,5),
232440   5,
233   { RGN_FRAC(4,5),RGN_FRAC(3,5),RGN_FRAC(2,5),RGN_FRAC(1,5),RGN_FRAC(0,5) },
441   { RGN_FRAC(4,5), RGN_FRAC(3,5), RGN_FRAC(2,5), RGN_FRAC(1,5), RGN_FRAC(0,5) },
234442   { 0, 1, 2, 3, 4, 5, 6, 7,
235    128+0, 128+1,128+2,128+3,128+4,128+5,128+6,128+7
443    128+0, 128+1, 128+2, 128+3, 128+4, 128+5, 128+6, 128+7
236444   },
237445   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
238   64+0*8,64+1*8,64+2*8,64+3*8,64+4*8,64+5*8,64+6*8,64+7*8
239
240    },
241
446     64+0*8,64+1*8,64+2*8,64+3*8,64+4*8,64+5*8,64+6*8,64+7*8
447   },
242448   256,
243449};
244450
245451
452/****************************
453*      Graphics Decode      *
454****************************/
246455
247456static GFXDECODE_START( sderby )
248457   GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout,   0x000, 256  ) /* sprites */
249   GFXDECODE_ENTRY( "gfx1", 0, tiles16x16_layout,   0x000, 256  ) /* sprites */
250
458   GFXDECODE_ENTRY( "gfx1", 0, tiles16x16_layout, 0x000, 256  ) /* sprites */
251459GFXDECODE_END
252460
461
462/****************************
463*      Machine Drivers      *
464****************************/
465
253466static MACHINE_DRIVER_START( sderby )
254467   MDRV_CPU_ADD("main", M68000, 12000000)
255   MDRV_CPU_PROGRAM_MAP(sderby_readmem,sderby_writemem)
468   MDRV_CPU_PROGRAM_MAP(sderby_map,0)
256469   MDRV_CPU_VBLANK_INT("main", irq2_line_hold)
257470
471   MDRV_NVRAM_HANDLER(generic_0fill)
472
473   MDRV_SCREEN_ADD("main", RASTER)
474   MDRV_SCREEN_REFRESH_RATE(60)
475   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
476   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
477   MDRV_SCREEN_SIZE(64*8, 64*8)
478   MDRV_SCREEN_VISIBLE_AREA(4*8, 44*8-1, 3*8, 33*8-1)
479
258480   MDRV_GFXDECODE(sderby)
481   MDRV_PALETTE_LENGTH(0x1000)
482   MDRV_VIDEO_START(sderby)
483   MDRV_VIDEO_UPDATE(sderby)
259484
485   MDRV_SPEAKER_STANDARD_MONO("mono")
486   MDRV_SOUND_ADD("oki", OKIM6295, 1056000)
487   MDRV_SOUND_CONFIG(okim6295_interface_pin7high) /* clock frequency & pin 7 not verified */
488   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
489MACHINE_DRIVER_END
260490
491static MACHINE_DRIVER_START( spacewin )
492   MDRV_CPU_ADD("main", M68000, 12000000)
493   MDRV_CPU_PROGRAM_MAP(spacewin_map,0)
494   MDRV_CPU_VBLANK_INT("main", irq2_line_hold)
495
496   MDRV_NVRAM_HANDLER(generic_0fill)
497
261498   MDRV_SCREEN_ADD("main", RASTER)
262499   MDRV_SCREEN_REFRESH_RATE(60)
263500   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
r3232r3233
265502   MDRV_SCREEN_SIZE(64*8, 64*8)
266503   MDRV_SCREEN_VISIBLE_AREA(4*8, 44*8-1, 3*8, 33*8-1)
267504
505   MDRV_GFXDECODE(sderby)
268506   MDRV_PALETTE_LENGTH(0x1000)
269
270507   MDRV_VIDEO_START(sderby)
271   MDRV_VIDEO_UPDATE(sderby)
508   MDRV_VIDEO_UPDATE(pmroulet)
272509
273510   MDRV_SPEAKER_STANDARD_MONO("mono")
274
275511   MDRV_SOUND_ADD("oki", OKIM6295, 1056000)
276   MDRV_SOUND_CONFIG(okim6295_interface_pin7high) // clock frequency & pin 7 not verified
512   MDRV_SOUND_CONFIG(okim6295_interface_pin7high) /* clock frequency & pin 7 not verified */
277513   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
278
279514MACHINE_DRIVER_END
280515
281516static MACHINE_DRIVER_START( pmroulet )
r3232r3233
283518   MDRV_CPU_PROGRAM_MAP(roulette_map,0)
284519   MDRV_CPU_VBLANK_INT("main", irq2_line_hold)
285520
286   MDRV_GFXDECODE(sderby)
521   MDRV_NVRAM_HANDLER(generic_0fill)
287522
288
289523   MDRV_SCREEN_ADD("main", RASTER)
290524   MDRV_SCREEN_REFRESH_RATE(60)
291   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
525   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
292526   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
293527   MDRV_SCREEN_SIZE(64*8, 64*8)
294528   MDRV_SCREEN_VISIBLE_AREA(4*8, 44*8-1, 3*8, 33*8-1)
295529
530   MDRV_GFXDECODE(sderby)
296531   MDRV_PALETTE_LENGTH(0x1000)
297
298532   MDRV_VIDEO_START(sderby)
299533   MDRV_VIDEO_UPDATE(pmroulet)
300534
301535   MDRV_SPEAKER_STANDARD_MONO("mono")
302
303536   MDRV_SOUND_ADD("oki", OKIM6295, 1056000)
304   MDRV_SOUND_CONFIG(okim6295_interface_pin7high) // clock frequency & pin 7 not verified
537   MDRV_SOUND_CONFIG(okim6295_interface_pin7high) /* clock frequency & pin 7 not verified */
305538   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
306
307539MACHINE_DRIVER_END
308540
309541
542/****************************
543*        Rom Loads          *
544****************************/
545/*
546
547Super Derby
548Playmark '96
549
550mc 68k 12mhz
551OKI m6295
552
5532x GM 76c88al (8kx8 6264) near program ROMs
5542x 6264 near gfx ROMs
55516k nonvolatile SRAM (Dallas 1220Y)
556two FPGA chips - one labelled 'Playmark 010412'
5574x hm3-65728bk-5
558--
55921.bin 6F9F2F2B - near OKI (samples?)
560
56122.bin A319F1E0 - program code
56223.bin 1D6E2321 /
563
56424.bin 93C917DF  - gfx
56525.bin 7BA485CD
56626.bin BEABE4F7
56727.bin 672CE5DF
56828.bin 39CA3B52
569
570*/
310571ROM_START( sderby )
311572   ROM_REGION( 0x80000, "main", 0 ) /* 68000 Code */
312573   ROM_LOAD16_BYTE( "22.bin", 0x00000, 0x20000, CRC(a319f1e0) SHA1(d932cc7e990aa87308dcd9ffa5af2aaea333aa9a) )
r3232r3233
323584   ROM_LOAD( "28.bin", 0x80000, 0x20000, CRC(39ca3b52) SHA1(9a03e73d88a1551cd3cfe616ab71e67dced1272a) )
324585ROM_END
325586
587/* Scacco Matto / Space Win
588   Playmark, 1996.
326589
590CPU:
5911x MC68000P12 (main)(u24)
592
593Sound:
5941x M6295 (sound)(u146)
5951x TDA2003 (sound)(td1)
5961x 358D (sound)(u155)
597
598PLDs:
5992x A1020B-PL84C (u110,u137)(not dumped)
600
601Xtals:
6021x oscillator 24.000000MHz (xl1)
6031x oscillator 28.000000MHz (xl2)
6041x blu resonator 1000J (sound)(y1)
605
606ROMs:
6071x M27C2001 (1)
6087x M27C1001 (2,3,4,5,6,7,8)
609
6104x PALCE22V10H (not dumped)
6111x PALCE16V8H (not dumped)
6121x DS1220Y-200 (non volatile ram)
613
614Note:
6151x JAMMA edge connector
6161x 12 legs connector
6172x 6 legs connector
6181x pushbutton (cb1)
6191x trimmer (volume)
620
621Title depends on graphics type in test mode.
622
623*/
624ROM_START( spacewin )
625   ROM_REGION( 0x40000, "main", 0 ) /* 68000 Code */
626    ROM_LOAD16_BYTE( "2.u16", 0x00000, 0x20000, CRC(2d17c2ab) SHA1(833ab39081fbc3d114103055e3a3f2ea2a28f158) )
627   ROM_LOAD16_BYTE( "3.u15", 0x00001, 0x20000, CRC(fd6f93ef) SHA1(1dc35fd92a0185434b44aa3c7da47a408fb2ce27) )
628
629   ROM_REGION( 0x080000, "oki", 0 ) /* Samples */
630   ROM_LOAD( "1.u147", 0x00000, 0x40000,  CRC(eedc7090) SHA1(fc8cabf7a11a1de3ccc3b8860afd8f32669608b8) )
631
632   ROM_REGION( 0xa0000, "gfx1", 0 ) /* Sprites */
633   ROM_LOAD( "4.u141", 0x000000, 0x20000, CRC(ce20c599) SHA1(93358c3a891c66ca944eb684bd47e9c25bfcb88d) )
634   ROM_LOAD( "5.u142", 0x020000, 0x20000, CRC(ae4f8e06) SHA1(cb3b941c67ae5c9df005d9f8b2105dc5a114f19f) )
635   ROM_LOAD( "6.u143", 0x040000, 0x20000, CRC(b99afc96) SHA1(589270dbd5022db2d032da85a9813c271fa71a90) )
636   ROM_LOAD( "7.u144", 0x060000, 0x20000, CRC(30f212ad) SHA1(ecafd93b11ff15386ef02e9f6657a52baf7932b4) )
637   ROM_LOAD( "8.u145", 0x080000, 0x20000, CRC(541a73fd) SHA1(fede5e2fcbb18e90cc50995d44e831c3f9b56614) )
638ROM_END
639
327640ROM_START( pmroulet )
328   ROM_REGION( 0x40000, "main", 0 ) /* 68000 Code */
641   ROM_REGION( 0x40000, "main", 0 ) /* 68000 code */
329642    ROM_LOAD16_BYTE( "2.bin", 0x00000, 0x20000, CRC(1677a2de) SHA1(4dcbb3c1ce9b65e06ba7e0cffa00c0c8016538f5))
330643   ROM_LOAD16_BYTE( "3.bin", 0x00001, 0x20000, CRC(11acaac2) SHA1(19e7bbbf4356fc9a866f9f36d0568c42d6a36c07))
331644
332   ROM_REGION( 0x080000, "oki", 0 ) /* Samples */
645   ROM_REGION( 0x080000, "oki", 0 ) /* samples are ok */
333646   ROM_LOAD( "1.bin", 0x00000, 0x40000, CRC(6673de85) SHA1(df390cd6268efc0e743a9020f19bc0cbeb757cfa))
334647
335   ROM_REGION( 0x280000, "gfx1", 0 ) /* Sprites */
648   ROM_REGION( 0x280000, "gfx1", 0 ) /* sprites */
336649   ROM_LOAD( "4.bin", 0x000000, 0x80000, CRC(efcddac9) SHA1(72435ec478b70a067d47f3daf7c224169ee5827a))
337650   ROM_LOAD( "5.bin", 0x080000, 0x80000, CRC(bc75ef8f) SHA1(1f3dc457e5ae143d53cfef0e1fcb4586dceefb67))
338651   ROM_LOAD( "6.bin", 0x100000, 0x80000, CRC(e47d5f55) SHA1(a341e24f98125265cb3986f8c7ce84eedd056b71))
r3232r3233
340653   ROM_LOAD( "8.bin", 0x200000, 0x80000, CRC(d4c2b7da) SHA1(515be861443acc5b911241dbaafa42e02f79985a))
341654ROM_END
342655
343GAME( 1996, sderby, 0, sderby, sderby, 0, ROT0, "Playmark", "Super Derby", 0 )
344GAME( 1997, pmroulet, 0, pmroulet, pmroulet, 0, ROT0, "Playmark", "Croupier (Playmark Roulette)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION )
345656
657/******************************
658*        Game Drivers         *
659******************************/
660
661/*     YEAR  NAME      PARENT  MACHINE   INPUT     INIT   ROT    COMPANY     FULLNAME                       FLAGS                                          LAYOUT  */
662GAMEL( 1996, sderby,   0,      sderby,   sderby,   0,     ROT0, "Playmark", "Super Derby",                  0,                                             layout_sderby   )
663GAMEL( 1996, spacewin, 0,      spacewin, spacewin, 0,     ROT0, "Playmark", "Scacco Matto / Space Win",     0,                                             layout_spacewin )
664GAMEL( 1997, pmroulet, 0,      pmroulet, pmroulet, 0,     ROT0, "Playmark", "Croupier (Playmark Roulette)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING, layout_pmroulet )
665
src/mame/drivers/guab.c
r3232r3233
540540
541541static READ16_HANDLER( io_r )
542542{
543   static const char *portnames[] = { "IN0", "IN1", "IN2" };
543   static const char *const portnames[] = { "IN0", "IN1", "IN2" };
544544
545545   switch (offset)
546546   {
src/mame/drivers/champbas.c
r3232r3233
8585#include "sound/dac.h"
8686
8787
88#define CPUTAG_MCU "MCU"
88#define CPUTAG_MCU "mcu"
8989
9090extern UINT8 *champbas_bg_videoram;
9191
r3232r3233
743743   ROM_LOAD( "15.10i", 0x4000, 0x1000, CRC(0225b7ef) SHA1(9adee4831eb633b0a31580596205a655df94c2b2) )
744744   ROM_LOAD( "16.11i", 0x5000, 0x1000, CRC(1612adf5) SHA1(9adeb21d5d1692f6e31460062f03f2008076b307) )
745745
746   ROM_REGION( 0x2000, "MCU", 0 )
746   ROM_REGION( 0x2000, "mcu", 0 )
747747   ROM_LOAD( "8201.bin", 0x0000, 0x2000, CRC(b77931ac) SHA1(405b02585e80d95a2821455538c5c2c31ce262d1) )
748748
749749   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )   // chars
r3232r3233
790790   ROM_LOAD( "17.2l", 0x2000, 0x2000, CRC(f10b148b) SHA1(d66516d509f6f16e51ee59d27c4867e276064c3f) )
791791   ROM_LOAD( "18.2n", 0x4000, 0x2000, CRC(2dc484dd) SHA1(28bd68c787d7e6989849ca52009948dbd5cdcc79) )
792792
793   ROM_REGION( 0x2000, "MCU", 0 )
793   ROM_REGION( 0x2000, "mcu", 0 )
794794   ROM_LOAD( "8201.bin", 0x0000, 0x2000, CRC(b77931ac) SHA1(405b02585e80d95a2821455538c5c2c31ce262d1) )
795795
796796   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )   // chars + sprites: rearranged by DRIVER_INIT to leave only chars
r3232r3233
839839   ROM_LOAD( "epr5935", 0x4000, 0x2000, CRC(3c911786) SHA1(eea0c467e213d237b5bb9d04b19a418d6090c2dc) )
840840
841841   // the pcb has a 8302 on it, though only the 8201 instructions are used
842   ROM_REGION( 0x2000, "MCU", 0 )
842   ROM_REGION( 0x2000, "mcu", 0 )
843843   ROM_LOAD( "8302.bin", 0x0000, 0x2000, CRC(edabac6c) SHA1(eaf1c51b63023256df526b0d3fd53cffc919c901) )
844844
845845   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )   // chars + sprites: rearranged by DRIVER_INIT to leave only chars
r3232r3233
867867   ROM_LOAD( "epr5935", 0x4000, 0x2000, CRC(3c911786) SHA1(eea0c467e213d237b5bb9d04b19a418d6090c2dc) )
868868
869869   // the pcb has a 8302 on it, though only the 8201 instructions are used
870   ROM_REGION( 0x2000, "MCU", 0 )
870   ROM_REGION( 0x2000, "mcu", 0 )
871871   ROM_LOAD( "8302.bin", 0x0000, 0x2000, CRC(edabac6c) SHA1(eaf1c51b63023256df526b0d3fd53cffc919c901) )
872872
873873   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )   // chars + sprites: rearranged by DRIVER_INIT to leave only chars
r3232r3233
10001000   ROM_LOAD( "7_c6.bin",     0x6000, 0x2000, CRC(6d51521e) SHA1(2809bd2e61f40dcd31d43c62520982bdcfb0a865) )   /* vr.7h */
10011001   ROM_LOAD( "1_a6.bin",     0x8000, 0x1000, CRC(20f2207e) SHA1(b1ed2237d0bd50ddbe593fd2fbff9f1d67c1eb11) )   /* vr.7k */
10021002
1003   ROM_REGION( 0x2000, "MCU", 0 )
1003   ROM_REGION( 0x2000, "mcu", 0 )
10041004   ROM_LOAD( "8303.bin", 0x0000, 0x2000, CRC(66adcb37) SHA1(e1c72ecb161129dcbddc0b16dd90e716d0c79311) )
10051005
10061006   ROM_REGION( 0x04000, "gfx1", ROMREGION_DISPOSE )   // 3bpp chars + sprites: rearranged by DRIVER_INIT to leave only chars
src/mame/drivers/ninjaw.c
r3232r3233
205205VIDEO_START( ninjaw );
206206VIDEO_UPDATE( ninjaw );
207207
208static UINT16 cpua_ctrl = 0xff;
208static UINT16 cpua_ctrl;
209209
210210static void parse_control(running_machine *machine)   /* assumes Z80 sandwiched between 68Ks */
211211{
r3232r3233
232232            SOUND
233233*****************************************/
234234
235static INT32 banknum = -1;
235static INT32 banknum;
236236
237237static void reset_sound_region(running_machine *machine)
238238{
r3232r3233
931931static MACHINE_START( ninjaw )
932932{
933933   cpua_ctrl = 0xff;
934   banknum = -1;
935   memset(ninjaw_pandata, 0, sizeof(ninjaw_pandata));
936
934937   state_save_register_global(cpua_ctrl);
935938   state_save_register_global(banknum);
936939   state_save_register_postload(machine, ninjaw_postload, NULL);
src/mame/drivers/megasys1.c
r3232r3233
528528   AM_RANGE(0xf000, 0xf000) AM_WRITE(SMH_NOP) /* ?? */
529529ADDRESS_MAP_END
530530
531
532static ADDRESS_MAP_START( sound_readport, ADDRESS_SPACE_IO, 8 )
531static ADDRESS_MAP_START( sound_io_map, ADDRESS_SPACE_IO, 8 )
533532   ADDRESS_MAP_GLOBAL_MASK(0xff)
534   AM_RANGE(0x00, 0x00) AM_READ(ym2203_status_port_0_r)
535ADDRESS_MAP_END
536
537static ADDRESS_MAP_START( sound_writeport, ADDRESS_SPACE_IO, 8 )
538   ADDRESS_MAP_GLOBAL_MASK(0xff)
539   AM_RANGE(0x00, 0x00) AM_WRITE(ym2203_control_port_0_w)
533   AM_RANGE(0x00, 0x00) AM_READWRITE(ym2203_status_port_0_r, ym2203_control_port_0_w)
540534   AM_RANGE(0x01, 0x01) AM_WRITE(ym2203_write_port_0_w)
541535ADDRESS_MAP_END
542536
543537
544538
545539
546
547
548
549540static const gfx_layout tilelayout =
550541{
551542   8,8,
r3232r3233
783774
784775   MDRV_CPU_ADD("audio", Z80, 3000000) /* OSC 12MHz divided by 4 ??? */
785776   MDRV_CPU_PROGRAM_MAP(sound_readmem_z80,sound_writemem_z80)
786   MDRV_CPU_IO_MAP(sound_readport,sound_writeport)
777   MDRV_CPU_IO_MAP(sound_io_map,0)
787778
788779   /* video hardware */
789780   MDRV_SCREEN_ADD("main", RASTER)
r3232r3233
40934084GAME( 1993, cybattlr, 0,        system_C,          cybattlr, cybattlr, ROT90,  "Jaleco", "Cybattler", 0 )
40944085GAME( 1993, hayaosi1, 0,        system_B_hayaosi1, hayaosi1, hayaosi1, ROT0,   "Jaleco", "Hayaoshi Quiz Ouza Ketteisen - The King Of Quiz", GAME_IMPERFECT_GRAPHICS )
40954086GAME( 1993, peekaboo, 0,        system_D,          peekaboo, peekaboo, ROT0,   "Jaleco", "Peek-a-Boo!", 0 )
4087
src/mame/drivers/srmp6.c
r3232r3233
9292   8*64
9393};
9494
95static void update_palette(void)
95static void update_palette(running_machine *machine)
9696{
9797   INT8 r, g ,b;
9898   int brg = brightness - 0x60;
r3232r3233
120120         b += ((0x1F - b) * brg) >> 5;
121121         if(b > 0x1F) b = 0x1F;
122122      }
123      palette_set_color(Machine, i, MAKE_RGB(r << 3, g << 3, b << 3));
123      palette_set_color(machine, i, MAKE_RGB(r << 3, g << 3, b << 3));
124124   }
125125}
126126
r3232r3233
147147
148148/* Debug code */
149149#ifdef UNUSED_FUNCTION
150static void srmp6_decode_charram(void)
150static void srmp6_decode_charram(running_machine *machine)
151151{
152152   if(input_code_pressed_once(KEYCODE_Z))
153153   {
154154      int i;
155155      for (i=0;i<(0x100000*16)/0x40;i++)
156156      {
157         decodechar(Machine->gfx[0], i, (UINT8*)tileram);
157         decodechar(machine->gfx[0], i, (UINT8*)tileram);
158158         dirty_tileram[i] = 0;
159159      }
160160   }
r3232r3233
182182
183183#if 0
184184   /* debug */
185   srmp6_decode_charram();
185   srmp6_decode_charram(screen->machine);
186186
187187
188188
r3232r3233
350350         data = (!data)?0x60:(data == 0x5e)?0x60:data;
351351         if(brightness != data) {
352352            brightness = data;
353            update_palette();
353            update_palette(machine);
354354         }
355355         break;
356356
src/mame/drivers/cave.c
r3232r3233
19891989static MACHINE_DRIVER_START( dfeveron )
19901990
19911991   /* basic machine hardware */
1992   MDRV_CPU_ADD("main", M68000, 16000000)
1992   MDRV_CPU_ADD("main", M68000, XTAL_16MHz)
19931993   MDRV_CPU_PROGRAM_MAP(dfeveron_readmem,dfeveron_writemem)
19941994   MDRV_CPU_VBLANK_INT("main", cave_interrupt)
19951995
r3232r3233
20142014   /* sound hardware */
20152015   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
20162016
2017   MDRV_SOUND_ADD("ymz", YMZ280B, 16934400)
2017   MDRV_SOUND_ADD("ymz", YMZ280B, XTAL_16_9344MHz)
20182018   MDRV_SOUND_CONFIG(ymz280b_intf)
20192019   MDRV_SOUND_ROUTE(0, "left", 1.0)
20202020   MDRV_SOUND_ROUTE(1, "right", 1.0)
r3232r3233
20282028static MACHINE_DRIVER_START( ddonpach )
20292029
20302030   /* basic machine hardware */
2031   MDRV_CPU_ADD("main", M68000, 16000000)
2031   MDRV_CPU_ADD("main", M68000, XTAL_16MHz)
20322032   MDRV_CPU_PROGRAM_MAP(ddonpach_readmem,ddonpach_writemem)
20332033   MDRV_CPU_VBLANK_INT("main", cave_interrupt)
20342034
r3232r3233
20532053   /* sound hardware */
20542054   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
20552055
2056   MDRV_SOUND_ADD("ymz", YMZ280B, 16934400)
2056   MDRV_SOUND_ADD("ymz", YMZ280B, XTAL_16_9344MHz)
20572057   MDRV_SOUND_CONFIG(ymz280b_intf)
20582058   MDRV_SOUND_ROUTE(0, "left", 1.0)
20592059   MDRV_SOUND_ROUTE(1, "right", 1.0)
r3232r3233
20672067static MACHINE_DRIVER_START( donpachi )
20682068
20692069   /* basic machine hardware */
2070   MDRV_CPU_ADD("main", M68000, 16000000)
2070   MDRV_CPU_ADD("main", M68000, XTAL_16MHz)
20712071   MDRV_CPU_PROGRAM_MAP(donpachi_readmem,donpachi_writemem)
20722072   MDRV_CPU_VBLANK_INT("main", cave_interrupt)
20732073
r3232r3233
20922092   /* sound hardware */
20932093   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
20942094
2095   MDRV_SOUND_ADD("oki1", OKIM6295, 1056000)
2095   MDRV_SOUND_ADD("oki1", OKIM6295, XTAL_1_056MHz)
20962096   MDRV_SOUND_CONFIG(okim6295_interface_pin7high) // clock frequency & pin 7 not verified
20972097   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.60)
20982098   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.60)
r3232r3233
21112111static MACHINE_DRIVER_START( esprade )
21122112
21132113   /* basic machine hardware */
2114   MDRV_CPU_ADD("main", M68000, 16000000)
2114   MDRV_CPU_ADD("main", M68000, XTAL_16MHz)
21152115   MDRV_CPU_PROGRAM_MAP(esprade_readmem,esprade_writemem)
21162116   MDRV_CPU_VBLANK_INT("main", cave_interrupt)
21172117
r3232r3233
21362136   /* sound hardware */
21372137   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
21382138
2139   MDRV_SOUND_ADD("ymz", YMZ280B, 16934400)
2139   MDRV_SOUND_ADD("ymz", YMZ280B, XTAL_16_9344MHz)
21402140   MDRV_SOUND_CONFIG(ymz280b_intf)
21412141   MDRV_SOUND_ROUTE(0, "left", 1.0)
21422142   MDRV_SOUND_ROUTE(1, "right", 1.0)
r3232r3233
21502150static MACHINE_DRIVER_START( gaia )
21512151
21522152   /* basic machine hardware */
2153   MDRV_CPU_ADD("main", M68000, 16000000)
2153   MDRV_CPU_ADD("main", M68000, XTAL_16MHz)
21542154   MDRV_CPU_PROGRAM_MAP(gaia_readmem,gaia_writemem)
21552155   MDRV_CPU_VBLANK_INT("main", cave_interrupt)
21562156
r3232r3233
21742174   /* sound hardware */
21752175   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
21762176
2177   MDRV_SOUND_ADD("ymz", YMZ280B, 16934400)
2177   MDRV_SOUND_ADD("ymz", YMZ280B, XTAL_16_9344MHz)
21782178   MDRV_SOUND_CONFIG(ymz280b_intf)
21792179   MDRV_SOUND_ROUTE(0, "left", 1.0)
21802180   MDRV_SOUND_ROUTE(1, "right", 1.0)
r3232r3233
21882188static MACHINE_DRIVER_START( guwange )
21892189
21902190   /* basic machine hardware */
2191   MDRV_CPU_ADD("main", M68000, 16000000)
2191   MDRV_CPU_ADD("main", M68000, XTAL_16MHz)
21922192   MDRV_CPU_PROGRAM_MAP(guwange_readmem,guwange_writemem)
21932193   MDRV_CPU_VBLANK_INT("main", cave_interrupt)
21942194
r3232r3233
22132213   /* sound hardware */
22142214   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
22152215
2216   MDRV_SOUND_ADD("ymz", YMZ280B, 16934400)
2216   MDRV_SOUND_ADD("ymz", YMZ280B, XTAL_16_9344MHz)
22172217   MDRV_SOUND_CONFIG(ymz280b_intf)
22182218   MDRV_SOUND_ROUTE(0, "left", 1.0)
22192219   MDRV_SOUND_ROUTE(1, "right", 1.0)
r3232r3233
22262226static MACHINE_DRIVER_START( hotdogst )
22272227
22282228   /* basic machine hardware */
2229   MDRV_CPU_ADD("main", M68000, 16000000)
2229   MDRV_CPU_ADD("main", M68000, XTAL_16MHz)
22302230   MDRV_CPU_PROGRAM_MAP(hotdogst_readmem,hotdogst_writemem)
22312231   MDRV_CPU_VBLANK_INT("main", cave_interrupt)
22322232
2233   MDRV_CPU_ADD("audio", Z80, 4000000)
2233   MDRV_CPU_ADD("audio", Z80, XTAL_4MHz)
22342234   MDRV_CPU_PROGRAM_MAP(hotdogst_sound_readmem,hotdogst_sound_writemem)
22352235   MDRV_CPU_IO_MAP(hotdogst_sound_readport,hotdogst_sound_writeport)
22362236
r3232r3233
22552255   /* sound hardware */
22562256   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
22572257
2258   MDRV_SOUND_ADD("ym", YM2203, 4000000)
2258   MDRV_SOUND_ADD("ym", YM2203, XTAL_4MHz)
22592259   MDRV_SOUND_CONFIG(ym2203_config)
22602260   MDRV_SOUND_ROUTE(0, "left",  0.20)
22612261   MDRV_SOUND_ROUTE(0, "right", 0.20)
r3232r3233
22662266   MDRV_SOUND_ROUTE(3, "left",  0.80)
22672267   MDRV_SOUND_ROUTE(3, "right", 0.80)
22682268
2269   MDRV_SOUND_ADD("oki", OKIM6295, 1056000)
2269   MDRV_SOUND_ADD("oki", OKIM6295, XTAL_1_056MHz)
22702270   MDRV_SOUND_CONFIG(okim6295_interface_pin7high) // clock frequency & pin 7 not verified
22712271   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.0)
22722272   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0)
r3232r3233
22802280static MACHINE_DRIVER_START( korokoro )
22812281
22822282   /* basic machine hardware */
2283   MDRV_CPU_ADD("main", M68000, 16000000)
2283   MDRV_CPU_ADD("main", M68000, XTAL_16MHz)
22842284   MDRV_CPU_PROGRAM_MAP(korokoro_readmem,korokoro_writemem)
22852285   MDRV_CPU_VBLANK_INT("main", cave_interrupt)
22862286
r3232r3233
23052305   /* sound hardware */
23062306   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
23072307
2308   MDRV_SOUND_ADD("ymz", YMZ280B, 16934400)
2308   MDRV_SOUND_ADD("ymz", YMZ280B, XTAL_16_9344MHz)
23092309   MDRV_SOUND_CONFIG(ymz280b_intf)
23102310   MDRV_SOUND_ROUTE(0, "left", 1.0)
23112311   MDRV_SOUND_ROUTE(1, "right", 1.0)
r3232r3233
23192319static MACHINE_DRIVER_START( mazinger )
23202320
23212321   /* basic machine hardware */
2322   MDRV_CPU_ADD("main", M68000, 16000000)
2322   MDRV_CPU_ADD("main", M68000, XTAL_16MHz)
23232323   MDRV_CPU_PROGRAM_MAP(mazinger_readmem,mazinger_writemem)
23242324   MDRV_CPU_VBLANK_INT("main", cave_interrupt)
23252325
2326   MDRV_CPU_ADD("audio", Z80, 4000000) // Bidirectional communication
2326   MDRV_CPU_ADD("audio", Z80, XTAL_4MHz) // Bidirectional communication
23272327   MDRV_CPU_PROGRAM_MAP(mazinger_sound_readmem,mazinger_sound_writemem)
23282328   MDRV_CPU_IO_MAP(mazinger_sound_readport,mazinger_sound_writeport)
23292329
r3232r3233
23502350   /* sound hardware */
23512351   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
23522352
2353   MDRV_SOUND_ADD("ym", YM2203, 4000000)
2353   MDRV_SOUND_ADD("ym", YM2203, XTAL_4MHz)
23542354   MDRV_SOUND_CONFIG(ym2203_config)
23552355   MDRV_SOUND_ROUTE(0, "left",  0.20)
23562356   MDRV_SOUND_ROUTE(0, "right", 0.20)
r3232r3233
23612361   MDRV_SOUND_ROUTE(3, "left",  0.60)
23622362   MDRV_SOUND_ROUTE(3, "right", 0.60)
23632363
2364   MDRV_SOUND_ADD("oki", OKIM6295, 1056000)
2364   MDRV_SOUND_ADD("oki", OKIM6295, XTAL_1_056MHz)
23652365   MDRV_SOUND_CONFIG(okim6295_interface_pin7high) // clock frequency & pin 7 not verified
23662366   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 2.0)
23672367   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 2.0)
r3232r3233
23752375static MACHINE_DRIVER_START( metmqstr )
23762376
23772377   /* basic machine hardware */
2378   MDRV_CPU_ADD("main", M68000,32000000 / 2)
2378   MDRV_CPU_ADD("main", M68000, XTAL_32MHz / 2)
23792379   MDRV_CPU_PROGRAM_MAP(metmqstr_readmem,metmqstr_writemem)
23802380   MDRV_CPU_VBLANK_INT("main", cave_interrupt)
23812381
2382   MDRV_CPU_ADD("audio", Z80,32000000 / 4)
2382   MDRV_CPU_ADD("audio", Z80, XTAL_32MHz / 4)
23832383   MDRV_CPU_PROGRAM_MAP(metmqstr_sound_readmem,metmqstr_sound_writemem)
23842384   MDRV_CPU_IO_MAP(metmqstr_sound_readport,metmqstr_sound_writeport)
23852385
r3232r3233
24062406   /* sound hardware */
24072407   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
24082408
2409   MDRV_SOUND_ADD("ym", YM2151, 16000000/4)
2409   MDRV_SOUND_ADD("ym", YM2151, XTAL_16MHz / 4)
24102410   MDRV_SOUND_CONFIG(ym2151_config)
24112411   MDRV_SOUND_ROUTE(0, "left", 1.20)
24122412   MDRV_SOUND_ROUTE(1, "right", 1.20)
24132413
2414   MDRV_SOUND_ADD("oki1", OKIM6295, 32000000 / 16 )
2414   MDRV_SOUND_ADD("oki1", OKIM6295, XTAL_32MHz / 16 )
24152415   MDRV_SOUND_CONFIG(okim6295_interface_pin7high)
24162416   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.0)
24172417   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0)
24182418
2419   MDRV_SOUND_ADD("oki2", OKIM6295, 32000000 / 16 )
2419   MDRV_SOUND_ADD("oki2", OKIM6295, XTAL_32MHz / 16 )
24202420   MDRV_SOUND_CONFIG(okim6295_interface_pin7high)
24212421   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.0)
24222422   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0)
r3232r3233
24322432static MACHINE_DRIVER_START( pwrinst2 )
24332433
24342434   /* basic machine hardware */
2435   MDRV_CPU_ADD("main", M68000, 16000000)   /* 16 MHz */
2435   MDRV_CPU_ADD("main", M68000, XTAL_16MHz)   /* 16 MHz */
24362436   MDRV_CPU_PROGRAM_MAP(pwrinst2_readmem,pwrinst2_writemem)
24372437   MDRV_CPU_VBLANK_INT("main", cave_interrupt)
24382438
2439   MDRV_CPU_ADD("audio", Z80,16000000 / 2)   /* 8 MHz */
2439   MDRV_CPU_ADD("audio", Z80,XTAL_16MHz / 2)   /* 8 MHz */
24402440   MDRV_CPU_PROGRAM_MAP(pwrinst2_sound_readmem,pwrinst2_sound_writemem)
24412441   MDRV_CPU_IO_MAP(pwrinst2_sound_readport,pwrinst2_sound_writeport)
24422442
r3232r3233
24612461   /* sound hardware */
24622462   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
24632463
2464   MDRV_SOUND_ADD("ym", YM2203, 16000000 / 4)
2464   MDRV_SOUND_ADD("ym", YM2203, XTAL_16MHz / 4)
24652465   MDRV_SOUND_CONFIG(ym2203_config)
24662466   MDRV_SOUND_ROUTE(0, "left",  0.40)
24672467   MDRV_SOUND_ROUTE(0, "right", 0.40)
r3232r3233
24722472   MDRV_SOUND_ROUTE(3, "left",  0.80)
24732473   MDRV_SOUND_ROUTE(3, "right", 0.80)
24742474
2475   MDRV_SOUND_ADD("oki1", OKIM6295, 3000000 )
2475   MDRV_SOUND_ADD("oki1", OKIM6295, XTAL_3MHz )
24762476   MDRV_SOUND_CONFIG(okim6295_interface_pin7low)
24772477   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.80)
24782478   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.80)
24792479
2480   MDRV_SOUND_ADD("oki2", OKIM6295, 3000000 )
2480   MDRV_SOUND_ADD("oki2", OKIM6295, XTAL_3MHz )
24812481   MDRV_SOUND_CONFIG(okim6295_interface_pin7low)
24822482   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.00)
24832483   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.00)
r3232r3233
24912491static MACHINE_DRIVER_START( sailormn )
24922492
24932493   /* basic machine hardware */
2494   MDRV_CPU_ADD("main", M68000, 16000000)
2494   MDRV_CPU_ADD("main", M68000, XTAL_16MHz)
24952495   MDRV_CPU_PROGRAM_MAP(sailormn_readmem,sailormn_writemem)
24962496   MDRV_CPU_VBLANK_INT("main", cave_interrupt)
24972497
2498   MDRV_CPU_ADD("audio", Z80, 8000000) // Bidirectional Communication
2498   MDRV_CPU_ADD("audio", Z80, XTAL_8MHz) // Bidirectional Communication
24992499   MDRV_CPU_PROGRAM_MAP(sailormn_sound_readmem,sailormn_sound_writemem)
25002500   MDRV_CPU_IO_MAP(sailormn_sound_readport,sailormn_sound_writeport)
25012501
r3232r3233
25212521
25222522   /* sound hardware */
25232523   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
2524   MDRV_SOUND_ADD("ym", YM2151, 16000000/4)
2524   MDRV_SOUND_ADD("ym", YM2151, XTAL_16MHz/4)
25252525   MDRV_SOUND_CONFIG(ym2151_config)
25262526   MDRV_SOUND_ROUTE(0, "left", 0.30)
25272527   MDRV_SOUND_ROUTE(1, "right", 0.30)
r3232r3233
25452545static MACHINE_DRIVER_START( uopoko )
25462546
25472547   /* basic machine hardware */
2548   MDRV_CPU_ADD("main", M68000, 16000000)
2548   MDRV_CPU_ADD("main", M68000, XTAL_16MHz)
25492549   MDRV_CPU_PROGRAM_MAP(uopoko_readmem,uopoko_writemem)
25502550   MDRV_CPU_VBLANK_INT("main", cave_interrupt)
25512551
r3232r3233
25692569   /* sound hardware */
25702570   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
25712571
2572   MDRV_SOUND_ADD("ymz", YMZ280B, 16934400)
2572   MDRV_SOUND_ADD("ymz", YMZ280B, XTAL_16_9344MHz)
25732573   MDRV_SOUND_CONFIG(ymz280b_intf)
25742574   MDRV_SOUND_ROUTE(0, "left", 1.0)
25752575   MDRV_SOUND_ROUTE(1, "right", 1.0)
r3232r3233
33203320
33213321   ROM_REGION( 0x400000, "ymz", 0 )   /* Samples */
33223322   ROM_LOAD( "u0462.bin", 0x000000, 0x400000, CRC(b3d75691) SHA1(71d8dae92be1542a3cff50efeec0bf3c14ab59f5) )
3323
3324    ROM_REGION( 0x0004, "plds", ROMREGION_DISPOSE )
3325    ROM_LOAD( "atc05-1.bin", 0x0000, 0x0001, NO_DUMP ) /* GAL16V8D-15LP located at U159 */
3326    ROM_LOAD( "u0259.bin",   0x0000, 0x0001, NO_DUMP ) /* XC9536-15PC44C Located at U0249. (Chip label different then label silk screened onto the board.) */
3327    ROM_LOAD( "u108.bin",    0x0000, 0x0001, NO_DUMP ) /* XC9536-15PC44C Located at U108. */
3328    ROM_LOAD( "u084.bin",    0x0000, 0x0001, NO_DUMP ) /* XC9536-15PC44C Located at U084. */
33233329ROM_END
33243330
33253331
src/mame/drivers/tourtabl.c
r3232r3233
2929
3030static READ16_HANDLER( tourtabl_read_input_port )
3131{
32   static const char *tianames[] = { "PADDLE4", "PADDLE3", "PADDLE2", "PADDLE1", "TIA_IN4", "TIA_IN5" };
32   static const char *const tianames[] = { "PADDLE4", "PADDLE3", "PADDLE2", "PADDLE1", "TIA_IN4", "TIA_IN5" };
3333
3434   return input_port_read(machine, tianames[offset]);
3535}
src/mame/drivers/trvmadns.c
r3232r3233
6666static tilemap *bg_tilemap;
6767static UINT8 *trvmadns_gfxram;
6868static UINT8 *trvmadns_tileram;
69static int old_data;
6970
7071static WRITE8_HANDLER( trvmadns_banking_w )
7172{
72   static int old = -1;
7373
7474   UINT8 *rom;
7575   int address = 0;
r3232r3233
100100   }
101101   else
102102   {
103         if(data != old)
103         if(data != old_data)
104104         {
105            printf("port80 = %02X\n",old=data);
106      //      logerror("port80 = %02X\n",old=data);
105            old_data = data;
106            printf("port80 = %02X\n",data);
107            //logerror("port80 = %02X\n",data);
107108         }
108109
109110      rom = memory_region(machine, "user1");
r3232r3233
277278   return 0;
278279}
279280
281static MACHINE_RESET( trvmadns )
282{
283   old_data = -1;
284}
285
280286static MACHINE_DRIVER_START( trvmadns )
281287   MDRV_CPU_ADD("main", Z80,10000000/2) // ?
282288   MDRV_CPU_PROGRAM_MAP(cpu_map,0)
283289   MDRV_CPU_IO_MAP(io_map,0)
284290   MDRV_CPU_VBLANK_INT("main", nmi_line_pulse)
285291
292   MDRV_MACHINE_RESET(trvmadns)
293
286294   /* video hardware */
287295   MDRV_SCREEN_ADD("main", RASTER)
288296   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/cubeqst.c
r3232r3233
210210   cpunum_set_input_line(machine, MAIN_CPU, int_level, HOLD_LINE);
211211
212212   /* Update the laserdisc */
213   laserdisc_vsync(laserdisc);
214213   video_field ^= 1;
215214}
216215
r3232r3233
534533static const cubeqst_snd_config snd_config =
535534{
536535   sound_dac_w,
537   "sound_proms"
536   "soundproms"
538537};
539538
540539
r3232r3233
577576   MDRV_PALETTE_LENGTH(8192 + 1)
578577   MDRV_PALETTE_INIT(cubeqst)
579578
580   MDRV_LASERDISC_ADD("laserdisc", SIMUTREK_SPECIAL)
579   MDRV_LASERDISC_ADD("laserdisc", SIMUTREK_SPECIAL, "main", "ldsound")
581580   MDRV_LASERDISC_OVERLAY(cubeqst, CUBEQST_HBLANK, CUBEQST_VCOUNT, BITMAP_FORMAT_INDEXED16)
582581   MDRV_LASERDISC_OVERLAY_CLIP(0, 320-1, 0, 256-8)
583582   MDRV_LASERDISC_OVERLAY_POSITION(0.002, -0.018)
584583
585584   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
586585
587   MDRV_SOUND_ADD("laserdisc", CUSTOM, 0)
586   MDRV_SOUND_ADD("ldsound", CUSTOM, 0)
588587   MDRV_SOUND_CONFIG(laserdisc_custom_interface)
589588   MDRV_SOUND_ROUTE(0, "left", 1.0)
590589   MDRV_SOUND_ROUTE(1, "right", 1.0)
r3232r3233
662661    ROM_REGION( 0x10000, "ldp_cpu", 0)
663662    ROM_LOAD( "laser_player_interface_d8748_a308.bin", 0x0000, 0x0400, CRC(eed3e728) SHA1(1eb3467f1c41553375b2c21952cd593b167f5416) )
664663
665   ROM_REGION16_BE( 0x1000, "sound_proms", 0)
664   ROM_REGION16_BE( 0x1000, "soundproms", 0)
666665   ROMX_LOAD( "mother_sounds_82s185.17f", 0x0, 0x800, CRC(0f49d40e) SHA1(40340833ab27ccb5b60baf44ad01930f204f5318), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(1) )
667666   ROMX_LOAD( "mother_sounds_82s185.19f", 0x0, 0x800, CRC(a041ce92) SHA1(9bc92992de22b830e479933c50650c7dc23f5713), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(1) )
668667   ROMX_LOAD( "mother_sounds_82s185.16f", 0x1, 0x800, CRC(75b1749f) SHA1(71da8224e72fb5250e2097666a47314d0a818ee9), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(1) )
669668   ROMX_LOAD( "mother_sounds_82s185.18f", 0x1, 0x800, CRC(ae4c78ae) SHA1(76fdb8eab372065882caaa5b93ce9e21efe54da5), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(1) )
670669
671   ROM_REGION( 0x1000, "video_proms", 0 )
670   ROM_REGION( 0x1000, "videoproms", 0 )
672671   /* Horizontal and vertical video timing PROMs */
673672   ROM_LOAD( "rotate_video_board_82s129.4h", 0x000, 0x100, CRC(6ed1b8d3) SHA1(c392855e1ff8637e551891aefd6c6a3bbcf273a5) )
674673   ROM_LOAD( "rotate_video_board_82s129.5h", 0x100, 0x100, CRC(32d839d4) SHA1(7b82e5c1ea5a351eba60c19560a10e4702ae2c22) )
src/mame/drivers/segas18.c
r3232r3233
215215
216216static READ16_HANDLER( io_chip_r )
217217{
218   static const char *portnames[] = { "P1", "P2", "PORTC", "PORTD", "SERVICE", "COINAGE", "DSW", "PORTH" };
218   static const char *const portnames[] = { "P1", "P2", "PORTC", "PORTD", "SERVICE", "COINAGE", "DSW", "PORTH" };
219219   offset &= 0x1f/2;
220220
221221   switch (offset)
r3232r3233
318318
319319static READ16_HANDLER( misc_io_r )
320320{
321   static const char *portnames[] = { "SERVICE", "COINAGE" };
321   static const char *const portnames[] = { "SERVICE", "COINAGE" };
322322
323323   offset &= 0x1fff;
324324
src/mame/drivers/royalmah.c
r3232r3233
734734   return 0xff;
735735}
736736
737static void mjtensin_update_rombank(void)
737static void mjtensin_update_rombank(running_machine *machine)
738738{
739   memory_set_bankptr( 1, memory_region(Machine, "main") + 0x10000 + rombank * 0x8000 );
739   memory_set_bankptr( 1, memory_region(machine, "main") + 0x10000 + rombank * 0x8000 );
740740}
741741static WRITE8_HANDLER( mjtensin_p4_w )
742742{
743743   rombank = (rombank & 0xf0) | (data & 0x0f);
744   mjtensin_update_rombank();
744   mjtensin_update_rombank(machine);
745745}
746746static WRITE8_HANDLER( mjtensin_6ff3_w )
747747{
748748   rombank = (data << 4) | (rombank & 0x0f);
749   mjtensin_update_rombank();
749   mjtensin_update_rombank(machine);
750750}
751751
752752static ADDRESS_MAP_START( mjtensin_map, ADDRESS_SPACE_PROGRAM, 8 )
r3232r3233
776776                                Mahjong Cafe Time
777777****************************************************************************/
778778
779static void cafetime_update_rombank(void)
779static void cafetime_update_rombank(running_machine *machine)
780780{
781   memory_set_bankptr( 1, memory_region(Machine, "main") + 0x10000 + rombank * 0x8000 );
781   memory_set_bankptr( 1, memory_region(machine, "main") + 0x10000 + rombank * 0x8000 );
782782}
783783static WRITE8_HANDLER( cafetime_p4_w )
784784{
785785   rombank = (rombank & 0xf0) | (data & 0x0f);
786   cafetime_update_rombank();
786   cafetime_update_rombank(machine);
787787}
788788static WRITE8_HANDLER( cafetime_p3_w )
789789{
790790   rombank = (rombank & 0x0f) | ((data & 0x0c) << 2);
791   cafetime_update_rombank();
791   cafetime_update_rombank(machine);
792792}
793793
794794static WRITE8_HANDLER( cafetime_dsw_w )
src/mame/drivers/darkmist.c
r3232r3233
285285
286286   ROM_LOAD( "dm_16.rom", 0x10000, 0x08000, CRC(094579d9) SHA1(2449bc9ba38396912ee9b72dd870ea9fcff95776) )
287287
288   ROM_REGION( 0x10000, "T5182", 0 ) /* Toshiba T5182 module */
288   ROM_REGION( 0x10000, "t5182", 0 ) /* Toshiba T5182 module */
289289   ROM_LOAD( "t5182.rom", 0x0000, 0x2000, CRC(d354c8fc) SHA1(a1c9e1ac293f107f69cc5788cf6abc3db1646e33) )
290290   ROM_LOAD( "dm_17.rom", 0x8000, 0x8000, CRC(7723dcae) SHA1(a0c69e7a7b6fd74f7ed6b9c6419aed94aabcd4b0) )
291291
r3232r3233
414414static void decrypt_snd(running_machine *machine)
415415{
416416   int i;
417   UINT8 *ROM = memory_region(machine, "T5182");
417   UINT8 *ROM = memory_region(machine, "t5182");
418418
419419   for(i=0x8000;i<0x10000;i++)
420420      ROM[i] = BITSWAP8(ROM[i], 7,1,2,3,4,5,6,0);
src/osd/windows/drawnone.c
r3232r3233
1313
1414// MAME headers
1515#include "mamecore.h"
16#include "deprecat.h"
1617
1718// MAMEOS headers
1819#include "window.h"
src/osd/windows/drawgdi.c
r3232r3233
1414// MAME headers
1515#include "mamecore.h"
1616#include "restrack.h"
17#include "deprecat.h"
1718
1819// MAMEOS headers
1920#include "window.h"
src/osd/windows/input.c
r3232r3233
939939         break;
940940
941941      // add the device
942      devinfo->device = input_device_add(DEVICE_CLASS_LIGHTGUN, devinfo->name, devinfo);
942      devinfo->device = input_device_add(machine, DEVICE_CLASS_LIGHTGUN, devinfo->name, devinfo);
943943
944944      // populate the axes
945945      for (axisnum = 0; axisnum < 2; axisnum++)
r3232r3233
13171317      goto exit;
13181318
13191319   // add the device
1320   devinfo->device = input_device_add(DEVICE_CLASS_KEYBOARD, devinfo->name, devinfo);
1320   devinfo->device = input_device_add(Machine, DEVICE_CLASS_KEYBOARD, devinfo->name, devinfo);
13211321   devinfo->poll = dinput_keyboard_poll;
13221322
13231323   // populate it
r3232r3233
13891389   }
13901390
13911391   // add the device
1392   devinfo->device = input_device_add(DEVICE_CLASS_MOUSE, devinfo->name, devinfo);
1392   devinfo->device = input_device_add(Machine, DEVICE_CLASS_MOUSE, devinfo->name, devinfo);
13931393   devinfo->poll = dinput_mouse_poll;
13941394   if (guninfo != NULL)
13951395   {
1396      guninfo->device = input_device_add(DEVICE_CLASS_LIGHTGUN, guninfo->name, guninfo);
1396      guninfo->device = input_device_add(Machine, DEVICE_CLASS_LIGHTGUN, guninfo->name, guninfo);
13971397      guninfo->poll = win32_lightgun_poll;
13981398   }
13991399
r3232r3233
14931493   devinfo->dinput.caps.dwButtons = MIN(devinfo->dinput.caps.dwButtons, 128);
14941494
14951495   // add the device
1496   devinfo->device = input_device_add(DEVICE_CLASS_JOYSTICK, devinfo->name, devinfo);
1496   devinfo->device = input_device_add(Machine, DEVICE_CLASS_JOYSTICK, devinfo->name, devinfo);
14971497   devinfo->poll = dinput_joystick_poll;
14981498
14991499   // populate the axes
r3232r3233
19261926      return;
19271927
19281928   // add the device
1929   devinfo->device = input_device_add(DEVICE_CLASS_KEYBOARD, devinfo->name, devinfo);
1929   devinfo->device = input_device_add(Machine, DEVICE_CLASS_KEYBOARD, devinfo->name, devinfo);
19301930
19311931   // populate it
19321932   for (keynum = 0; keynum < MAX_KEYS; keynum++)
r3232r3233
19991999   }
20002000
20012001   // add the device
2002   devinfo->device = input_device_add(DEVICE_CLASS_MOUSE, devinfo->name, devinfo);
2002   devinfo->device = input_device_add(Machine, DEVICE_CLASS_MOUSE, devinfo->name, devinfo);
20032003   if (guninfo != NULL)
20042004   {
2005      guninfo->device = input_device_add(DEVICE_CLASS_LIGHTGUN, guninfo->name, guninfo);
2005      guninfo->device = input_device_add(Machine, DEVICE_CLASS_LIGHTGUN, guninfo->name, guninfo);
20062006      guninfo->poll = (guninfo == lightgun_list) ? win32_lightgun_poll : NULL;
20072007      guninfo->mouse.partner = &devinfo->mouse;
20082008   }
src/osd/windows/ledutil.c
r3232r3233
382382
383383   // allocate memory
384384   entry = malloc(sizeof(*entry));
385   if (entry == NULL)
386      return 0;
387
385388   string = malloc(strlen(data->string) + 1);
389   if (string == NULL)
390   {
391      free(entry);
392      return 0;
393   }
386394
387395   // if all allocations worked, make a new entry
388   if (entry != NULL && string != NULL)
389   {
390      entry->next = idmaplist;
391      entry->name = string;
392      entry->id = data->id;
396   entry->next = idmaplist;
397   entry->name = string;
398   entry->id = data->id;
393399
394      // copy the string and hook us into the list
395      strcpy(string, data->string);
396      idmaplist = entry;
400   // copy the string and hook us into the list
401   strcpy(string, data->string);
402   idmaplist = entry;
397403
398      DEBUG_PRINTF(("  id %d = '%s'\n", entry->id, entry->name));
399   }
404   DEBUG_PRINTF(("  id %d = '%s'\n", entry->id, entry->name));
400405
401406   return 0;
402407}
src/osd/windows/debugwin.c
r3232r3233
24602460
24612461                  active_address = debug_view_get_property_UINT32(info->view[0].view, DVP_DASM_ACTIVE_ADDRESS);
24622462                  sprintf(command, "go %X", BYTE2ADDR(active_address, cpuinfo, ADDRESS_SPACE_PROGRAM));
2463                  debug_console_execute_command(command, 1);
2463                  debug_console_execute_command(Machine, command, 1);
24642464               }
24652465               return 1;
24662466
r3232r3233
24942494                     sprintf(command, "bpset %X", BYTE2ADDR(active_address, cpuinfo, ADDRESS_SPACE_PROGRAM));
24952495                  else
24962496                     sprintf(command, "bpclear %X", bp_num);
2497                  debug_console_execute_command(command, 1);
2497                  debug_console_execute_command(Machine, command, 1);
24982498               }
24992499               return 1;
25002500         }
r3232r3233
27682768
27692769   // otherwise, just process the command
27702770   else
2771      debug_console_execute_command(string, 1);
2771      debug_console_execute_command(Machine, string, 1);
27722772
27732773   // clear the edit text box
27742774   SendMessage(info->editwnd, WM_SETTEXT, 0, (LPARAM)&buffer);
src/osd/windows/window.c
r3232r3233
134134static void create_window_class(void);
135135static void set_starting_view(running_machine *machine, int index, win_window_info *window, const char *view);
136136
137static void constrain_to_aspect_ratio(win_window_info *window, RECT *rect, int adjustment);
138static void get_min_bounds(win_window_info *window, RECT *bounds, int constrain);
139static void get_max_bounds(win_window_info *window, RECT *bounds, int constrain);
140static void update_minmax_state(win_window_info *window);
141static void minimize_window(win_window_info *window);
142static void maximize_window(win_window_info *window);
137static void constrain_to_aspect_ratio(running_machine *machine, win_window_info *window, RECT *rect, int adjustment);
138static void get_min_bounds(running_machine *mchine, win_window_info *window, RECT *bounds, int constrain);
139static void get_max_bounds(running_machine *machine, win_window_info *window, RECT *bounds, int constrain);
140static void update_minmax_state(running_machine *machine, win_window_info *window);
141static void minimize_window(running_machine *machine, win_window_info *window);
142static void maximize_window(running_machine *machine, win_window_info *window);
143143
144static void adjust_window_position_after_major_change(win_window_info *window);
145static void set_fullscreen(win_window_info *window, int fullscreen);
144static void adjust_window_position_after_major_change(running_machine *machine, win_window_info *window);
145static void set_fullscreen(running_machine *machine, win_window_info *window, int fullscreen);
146146
147147
148148// temporary hacks
r3232r3233
223223         fatalerror("Failed to create window thread ready event");
224224
225225      // create a thread to run the windows from
226      temp = _beginthreadex(NULL, 0, thread_entry, NULL, 0, (unsigned *)&window_threadid);
226      temp = _beginthreadex(NULL, 0, thread_entry, (void*)machine, 0, (unsigned *)&window_threadid);
227227      window_thread = (HANDLE)temp;
228228      if (window_thread == NULL)
229229         fatalerror("Failed to create window thread");
r3232r3233
994994static unsigned __stdcall thread_entry(void *param)
995995{
996996   MSG message;
997   running_machine *machine = (running_machine*)param;
997998
998999   // make a bogus user call to make us a message thread
9991000   PeekMessage(&message, NULL, 0, 0, PM_NOREMOVE);
r3232r3233
10631064            case WM_USER_FINISH_CREATE_WINDOW:
10641065            {
10651066               win_window_info *window = (win_window_info *)message.lParam;
1066               window->init_state = complete_create(Machine, window) ? -1 : 1;
1067               window->init_state = complete_create(machine, window) ? -1 : 1;
10671068               dispatch = FALSE;
10681069               break;
10691070            }
r3232r3233
11371138
11381139   // maximum or minimize as appropriate
11391140   if (window->startmaximized)
1140      maximize_window(window);
1141      maximize_window(machine, window);
11411142   else
1142      minimize_window(window);
1143   adjust_window_position_after_major_change(window);
1143      minimize_window(machine, window);
1144   adjust_window_position_after_major_change(machine, window);
11441145
11451146   // show the window
11461147   if (!window->fullscreen || window->fullscreen_safe)
r3232r3233
11751176   if (window != NULL)
11761177   {
11771178      assert(GetCurrentThreadId() == window_threadid);
1178      update_minmax_state(window);
1179      update_minmax_state(Machine, window);
11791180   }
11801181
11811182   // handle a few messages
r3232r3233
12211222      case WM_LBUTTONDOWN:
12221223      {
12231224         DWORD ticks = GetTickCount();
1224         ui_input_push_mouse_click_event(Machine, window->target, GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam));
1225         ui_input_push_mouse_down_event(Machine, window->target, GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam));
12251226
12261227         // check for a double-click
12271228         if (ticks - window->lastclicktime < GetDoubleClickTime() &&
r3232r3233
12401241         break;
12411242      }
12421243
1244      case WM_LBUTTONUP:
1245         ui_input_push_mouse_up_event(Machine, window->target, GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam));
1246         break;
1247
12431248      case WM_CHAR:
12441249         ui_input_push_char_event(Machine, window->target, (unicode_char) wparam);
12451250         break;
r3232r3233
12731278      {
12741279         RECT *rect = (RECT *)lparam;
12751280         if (video_config.keepaspect && !(GetAsyncKeyState(VK_CONTROL) & 0x8000))
1276            constrain_to_aspect_ratio(window, rect, wparam);
1281            constrain_to_aspect_ratio(Machine, window, rect, wparam);
12771282         InvalidateRect(wnd, NULL, FALSE);
12781283         break;
12791284      }
r3232r3233
12911296         // handle maximize
12921297         if ((wparam & 0xfff0) == SC_MAXIMIZE)
12931298         {
1294            update_minmax_state(window);
1299            update_minmax_state(Machine, window);
12951300            if (window->ismaximized)
1296               minimize_window(window);
1301               minimize_window(Machine, window);
12971302            else
1298               maximize_window(window);
1303               maximize_window(Machine, window);
12991304            break;
13001305         }
13011306         return DefWindowProc(wnd, message, wparam, lparam);
r3232r3233
13411346
13421347      // fullscreen set
13431348      case WM_USER_SET_FULLSCREEN:
1344         set_fullscreen(window, wparam);
1349         set_fullscreen(Machine, window, wparam);
13451350         break;
13461351
13471352      // minimum size set
13481353      case WM_USER_SET_MINSIZE:
1349         minimize_window(window);
1354         minimize_window(Machine, window);
13501355         break;
13511356
13521357      // maximum size set
13531358      case WM_USER_SET_MAXSIZE:
1354         maximize_window(window);
1359         maximize_window(Machine, window);
13551360         break;
13561361
13571362      // set focus: if we're not the primary window, switch back
r3232r3233
14181423//  (window thread)
14191424//============================================================
14201425
1421static void constrain_to_aspect_ratio(win_window_info *window, RECT *rect, int adjustment)
1426static void constrain_to_aspect_ratio(running_machine *machine, win_window_info *window, RECT *rect, int adjustment)
14221427{
14231428   win_monitor_info *monitor = winwindow_video_window_monitor(window, rect);
14241429   INT32 extrawidth = wnd_extra_width(window);
r3232r3233
15341539//  (window thread)
15351540//============================================================
15361541
1537static void get_min_bounds(win_window_info *window, RECT *bounds, int constrain)
1542static void get_min_bounds(running_machine *machine, win_window_info *window, RECT *bounds, int constrain)
15381543{
15391544   INT32 minwidth, minheight;
15401545
r3232r3233
15621567      test1.top = test1.left = 0;
15631568      test1.right = minwidth;
15641569      test1.bottom = 10000;
1565      constrain_to_aspect_ratio(window, &test1, WMSZ_BOTTOMRIGHT);
1570      constrain_to_aspect_ratio(machine, window, &test1, WMSZ_BOTTOMRIGHT);
15661571
15671572      // then constrain with no width limit
15681573      test2.top = test2.left = 0;
15691574      test2.right = 10000;
15701575      test2.bottom = minheight;
1571      constrain_to_aspect_ratio(window, &test2, WMSZ_BOTTOMRIGHT);
1576      constrain_to_aspect_ratio(machine, window, &test2, WMSZ_BOTTOMRIGHT);
15721577
15731578      // pick the larger
15741579      if (rect_width(&test1) > rect_width(&test2))
r3232r3233
15981603//  (window thread)
15991604//============================================================
16001605
1601static void get_max_bounds(win_window_info *window, RECT *bounds, int constrain)
1606static void get_max_bounds(running_machine *machine, win_window_info *window, RECT *bounds, int constrain)
16021607{
16031608   RECT maximum;
16041609
r3232r3233
16241629
16251630   // constrain to fit
16261631   if (constrain)
1627      constrain_to_aspect_ratio(window, &maximum, WMSZ_BOTTOMRIGHT);
1632      constrain_to_aspect_ratio(machine, window, &maximum, WMSZ_BOTTOMRIGHT);
16281633   else
16291634   {
16301635      maximum.right -= wnd_extra_width(window);
r3232r3233
16451650//  (window thread)
16461651//============================================================
16471652
1648static void update_minmax_state(win_window_info *window)
1653static void update_minmax_state(running_machine *machine, win_window_info *window)
16491654{
16501655   assert(GetCurrentThreadId() == window_threadid);
16511656
r3232r3233
16541659      RECT bounds, minbounds, maxbounds;
16551660
16561661      // compare the maximum bounds versus the current bounds
1657      get_min_bounds(window, &minbounds, video_config.keepaspect);
1658      get_max_bounds(window, &maxbounds, video_config.keepaspect);
1662      get_min_bounds(machine, window, &minbounds, video_config.keepaspect);
1663      get_max_bounds(machine, window, &maxbounds, video_config.keepaspect);
16591664      GetWindowRect(window->hwnd, &bounds);
16601665
16611666      // if either the width or height matches, we were maximized
r3232r3233
16781683//  (window thread)
16791684//============================================================
16801685
1681static void minimize_window(win_window_info *window)
1686static void minimize_window(running_machine *machine, win_window_info *window)
16821687{
16831688   RECT newsize;
16841689
16851690   assert(GetCurrentThreadId() == window_threadid);
16861691
1687   get_min_bounds(window, &newsize, video_config.keepaspect);
1692   get_min_bounds(machine, window, &newsize, video_config.keepaspect);
16881693   SetWindowPos(window->hwnd, NULL, newsize.left, newsize.top, rect_width(&newsize), rect_height(&newsize), SWP_NOZORDER);
16891694}
16901695
r3232r3233
16951700//  (window thread)
16961701//============================================================
16971702
1698static void maximize_window(win_window_info *window)
1703static void maximize_window(running_machine *machine, win_window_info *window)
16991704{
17001705   RECT newsize;
17011706
17021707   assert(GetCurrentThreadId() == window_threadid);
17031708
1704   get_max_bounds(window, &newsize, video_config.keepaspect);
1709   get_max_bounds(machine, window, &newsize, video_config.keepaspect);
17051710   SetWindowPos(window->hwnd, NULL, newsize.left, newsize.top, rect_width(&newsize), rect_height(&newsize), SWP_NOZORDER);
17061711}
17071712
r3232r3233
17121717//  (window thread)
17131718//============================================================
17141719
1715static void adjust_window_position_after_major_change(win_window_info *window)
1720static void adjust_window_position_after_major_change(running_machine *machine, win_window_info *window)
17161721{
17171722   RECT oldrect, newrect;
17181723
r3232r3233
17271732      // constrain the existing size to the aspect ratio
17281733      newrect = oldrect;
17291734      if (video_config.keepaspect)
1730         constrain_to_aspect_ratio(window, &newrect, WMSZ_BOTTOMRIGHT);
1735         constrain_to_aspect_ratio(machine, window, &newrect, WMSZ_BOTTOMRIGHT);
17311736   }
17321737
17331738   // in full screen, make sure it covers the primary display
r3232r3233
17601765//  (window thread)
17611766//============================================================
17621767
1763static void set_fullscreen(win_window_info *window, int fullscreen)
1768static void set_fullscreen(running_machine *machine, win_window_info *window, int fullscreen)
17641769{
17651770   assert(GetCurrentThreadId() == window_threadid);
17661771
r3232r3233
17991804      else
18001805      {
18011806         SetWindowPos(window->hwnd, HWND_TOP, 0, 0, MIN_WINDOW_DIM, MIN_WINDOW_DIM, SWP_NOZORDER);
1802         maximize_window(window);
1807         maximize_window(machine, window);
18031808      }
18041809   }
18051810
r3232r3233
18191824   }
18201825
18211826   // adjust the window to compensate for the change
1822   adjust_window_position_after_major_change(window);
1827   adjust_window_position_after_major_change(machine, window);
18231828
18241829   // show ourself
18251830   if (!window->fullscreen || window->fullscreen_safe)
r3232r3233
18311836   }
18321837
18331838   // ensure we're still adjusted correctly
1834   adjust_window_position_after_major_change(window);
1839   adjust_window_position_after_major_change(machine, window);
18351840}
src/osd/winui/mui_util.c
r3232r3233
354354      for (ndriver = 0; ndriver < driver_list_get_count(drivers); ndriver++)
355355      {
356356         const game_driver *gamedrv = drivers[ndriver];
357         const rom_source *source;
357358         struct DriversInfo *gameinfo = &drivers_info[ndriver];
358359         const rom_entry *region, *rom;
359360         machine_config *config;
r3232r3233
368369         gameinfo->supportsSaveState = ((gamedrv->flags & GAME_SUPPORTS_SAVE) != 0);
369370         gameinfo->isHarddisk = FALSE;
370371         gameinfo->isVertical = (gamedrv->flags & ORIENTATION_SWAP_XY) ? TRUE : FALSE;
371         for (region = rom_first_region(gamedrv); region; region = rom_next_region(region))
372         for (source = rom_first_source(gamedrv, config); source != NULL; source = rom_next_source(gamedrv, config, source))
372373         {
373            if (ROMREGION_ISDISKDATA(region))
374               gameinfo->isHarddisk = TRUE;
374            for (region = rom_first_region(gamedrv, source); region != NULL; region = rom_next_region(region))
375            {
376               if (ROMREGION_ISDISKDATA(region))
377                  gameinfo->isHarddisk = TRUE;
378            }
375379         }
376380         gameinfo->hasOptionalBIOS = FALSE;
377381         if (gamedrv->rom != NULL)
r3232r3233
394398         gameinfo->isMultiMon = 0;
395399         gameinfo->isVector = isDriverVector(config); // ((drv.video_attributes & VIDEO_TYPE_VECTOR) != 0);
396400         gameinfo->usesRoms = FALSE;
397         for (region = rom_first_region(gamedrv); region; region = rom_next_region(region))
398            for (rom = rom_first_file(region); rom; rom = rom_next_file(rom))
401         for (source = rom_first_source(gamedrv, config); source != NULL; source = rom_next_source(gamedrv, config, source))
402         {
403            for (region = rom_first_region(gamedrv, source); region; region = rom_next_region(region))
399404            {
400               gameinfo->usesRoms = TRUE;
401               break;
405               for (rom = rom_first_file(region); rom; rom = rom_next_file(rom))
406               {
407                  gameinfo->usesRoms = TRUE;
408                  break;
409               }
402410            }
411         }
403412         gameinfo->usesSamples = FALSE;
404413         
405414         if (HAS_SAMPLES || HAS_VLM5030)
src/osd/winui/treeview.c
r3232r3233
11341134   const rom_entry *region, *rom;
11351135   const char *name;
11361136   const game_driver *gamedrv;
1137   const rom_source *source;
1138   machine_config *config;
11371139
11381140   // create our two subfolders
11391141   LPTREEFOLDER lpBad, lpNo;
r3232r3233
11731175         continue;
11741176      bBadDump = FALSE;
11751177      bNoDump = FALSE;
1176      for (region = rom_first_region(gamedrv); region; region = rom_next_region(region))
1178      config = machine_config_alloc(gamedrv->machine_config);
1179      for (source = rom_first_source(gamedrv, config); source != NULL; source = rom_next_source(gamedrv, config, source))
11771180      {
1178         for (rom = rom_first_file(region); rom; rom = rom_next_file(rom))
1181         for (region = rom_first_region(gamedrv, source); region; region = rom_next_region(region))
11791182         {
1180            if (ROMREGION_ISROMDATA(region) || ROMREGION_ISDISKDATA(region) )
1183            for (rom = rom_first_file(region); rom; rom = rom_next_file(rom))
11811184            {
1182               name = ROM_GETNAME(rom);
1183               if (hash_data_has_info(ROM_GETHASHDATA(rom), HASH_INFO_BAD_DUMP))           
1184                  bBadDump = TRUE;
1185               if (hash_data_has_info(ROM_GETHASHDATA(rom), HASH_INFO_NO_DUMP))           
1186                  bNoDump = TRUE;
1185               if (ROMREGION_ISROMDATA(region) || ROMREGION_ISDISKDATA(region) )
1186               {
1187                  name = ROM_GETNAME(rom);
1188                  if (hash_data_has_info(ROM_GETHASHDATA(rom), HASH_INFO_BAD_DUMP))           
1189                     bBadDump = TRUE;
1190                  if (hash_data_has_info(ROM_GETHASHDATA(rom), HASH_INFO_NO_DUMP))           
1191                     bNoDump = TRUE;
1192               }
11871193            }
11881194         }
11891195      }
1196      machine_config_free(config);
1197      config = NULL;
11901198      if (bBadDump)
11911199      {
11921200         AddGame(lpBad,jj);
src/emu/romload.h
r3232r3233
6868#define      ROMREGION_DATATYPEROM   0x00000000
6969#define      ROMREGION_DATATYPEDISK   0x00004000
7070
71#define ROMREGION_LOADBYNAMEMASK   0x00008000         /* use region name as path to read from */
72#define      ROMREGION_NOLOADBYNAME   0x00000000
73#define      ROMREGION_LOADBYNAME   0x00008000
74
7175#define ROMREGION_ERASEVALMASK      0x00ff0000         /* value to erase the region to */
7276#define      ROMREGION_ERASEVAL(x)   ((((x) & 0xff) << 16) | ROMREGION_ERASE)
7377#define      ROMREGION_ERASE00      ROMREGION_ERASEVAL(0)
r3232r3233
122126    TYPE DEFINITIONS
123127***************************************************************************/
124128
129typedef struct _rom_source rom_source;
130
131
125132typedef struct _rom_entry rom_entry;
126133struct _rom_entry
127134{
r3232r3233
185192#define ROMREGION_GETDATATYPE(r)   (ROMREGION_GETFLAGS(r) & ROMREGION_DATATYPEMASK)
186193#define ROMREGION_ISROMDATA(r)      (ROMREGION_GETDATATYPE(r) == ROMREGION_DATATYPEROM)
187194#define ROMREGION_ISDISKDATA(r)      (ROMREGION_GETDATATYPE(r) == ROMREGION_DATATYPEDISK)
195#define ROMREGION_ISLOADBYNAME(r)   ((ROMREGION_GETFLAGS(r) & ROMREGION_LOADBYNAMEMASK) == ROMREGION_LOADBYNAME)
188196
189197
190198/* ----- per-ROM macros ----- */
r3232r3233
283291void set_disk_handle(const char *region, mame_file *file, chd_file *chd);
284292
285293/* ROM processing */
286void rom_init(running_machine *machine, const rom_entry *romp);
294void rom_init(running_machine *machine);
287295int rom_load_warnings(void);
288const rom_entry *rom_first_region(const game_driver *drv);
296const rom_source *rom_first_source(const game_driver *drv, const machine_config *config);
297const rom_source *rom_next_source(const game_driver *drv, const machine_config *config, const rom_source *previous);
298const rom_entry *rom_first_region(const game_driver *drv, const rom_source *romp);
289299const rom_entry *rom_next_region(const rom_entry *romp);
290300const rom_entry *rom_first_file(const rom_entry *romp);
291301const rom_entry *rom_next_file(const rom_entry *romp);
292302const rom_entry *rom_first_chunk(const rom_entry *romp);
293303const rom_entry *rom_next_chunk(const rom_entry *romp);
294304
305int rom_source_is_gamedrv(const game_driver *drv, const rom_source *source);
306astring *rom_region_name(astring *result, const game_driver *drv, const rom_source *source, const rom_entry *romp);
295307
296308#endif   /* __ROMLOAD_H__ */
src/emu/debug/debugcpu.c
r3232r3233
5959   UINT8         within_instruction_hook;
6060   UINT8         vblank_occurred;
6161   UINT8         memory_modified;
62   UINT8         debugger_access;
6263
6364   int            execution_state;
6465
r3232r3233
9091***************************************************************************/
9192
9293static void debug_cpu_exit(running_machine *machine);
93static void perform_trace(debug_cpu_info *info);
94static void perform_trace(running_machine *machine, debug_cpu_info *info);
9495static void prepare_for_step_overout(debug_cpu_info *info);
95static void process_source_file(void);
96static void breakpoint_check(debug_cpu_info *info, offs_t pc);
96static void process_source_file(running_machine *machine);
97static void breakpoint_check(running_machine *machine, debug_cpu_info *info, offs_t pc);
9798static void watchpoint_check(running_machine *machine, int cpunum, int spacenum, int type, offs_t address, UINT64 value_to_write, UINT64 mem_mask);
9899static void check_hotspots(int cpunum, int spacenum, offs_t address);
99100
r3232r3233
158159    on_vblank - called when a VBLANK hits
159160-------------------------------------------------*/
160161
161static void on_vblank(const device_config *device, int vblank_state)
162static void on_vblank(const device_config *device, void *param, int vblank_state)
162163{
163164   /* just set a global flag to be consumed later */
164165   if (vblank_state)
r3232r3233
300301
301302   /* add callback for breaking on VBLANK */
302303   if (machine->primary_screen != NULL)
303      video_screen_register_vblank_callback(machine->primary_screen, on_vblank);
304      video_screen_register_vblank_callback(machine->primary_screen, on_vblank, NULL);
304305
305306   add_exit_callback(machine, debug_cpu_exit);
306307}
r3232r3233
383384
384385   /* if any of the watchpoint flags are set and we're live, tell the memory system */
385386   if (global.livecpu != NULL && ((info->flags & DEBUG_FLAG_WATCHPOINT) != 0))
386      memory_set_context(-1);
387      memory_set_context(machine, -1);
387388}
388389
389390
r3232r3233
532533
533534   /* are we tracing? */
534535   if (info->flags & DEBUG_FLAG_TRACING_ANY)
535      perform_trace(info);
536      perform_trace(machine, info);
536537
537538   /* per-instruction hook? */
538539   if (global.execution_state != EXECUTION_STATE_STOPPED && (info->flags & DEBUG_FLAG_HOOKED) != 0 && (*info->instrhook)(curpc))
r3232r3233
580581
581582      /* check for execution breakpoints */
582583      else if ((info->flags & DEBUG_FLAG_LIVE_BP) != 0)
583         breakpoint_check(info, curpc);
584         breakpoint_check(machine, info, curpc);
584585   }
585586
586587   /* if we are supposed to halt, do it now */
r3232r3233
612613         }
613614
614615         /* check for commands in the source file */
615         process_source_file();
616         process_source_file(machine);
616617
617618         /* if an event got scheduled, resume */
618619         if (mame_is_scheduled_event_pending(machine))
r3232r3233
975976}
976977
977978
978static void perform_trace(debug_cpu_info *info)
979static void perform_trace(running_machine *machine, debug_cpu_info *info)
979980{
980981   offs_t pc = activecpu_get_pc();
981982   int offset, count, i;
r3232r3233
10051006
10061007      /* execute any trace actions first */
10071008      if (info->trace.action != NULL)
1008         debug_console_execute_command(info->trace.action, 0);
1009         debug_console_execute_command(machine, info->trace.action, 0);
10091010
10101011      /* print the address */
10111012      offset = sprintf(buffer, "%0*X: ", info->space[ADDRESS_SPACE_PROGRAM].logchars, pc);
r3232r3233
10821083    a source file
10831084-------------------------------------------------*/
10841085
1085static void process_source_file(void)
1086static void process_source_file(running_machine *machine)
10861087{
10871088   /* loop until the file is exhausted or until we are executing again */
10881089   while (debug_source_file != NULL && global.execution_state == EXECUTION_STATE_STOPPED)
r3232r3233
11151116
11161117      /* execute the command */
11171118      if (buf[0])
1118         debug_console_execute_command(buf, 1);
1119         debug_console_execute_command(machine, buf, 1);
11191120   }
11201121}
11211122
r3232r3233
11721173    a given CPU
11731174-------------------------------------------------*/
11741175
1175static void breakpoint_check(debug_cpu_info *info, offs_t pc)
1176static void breakpoint_check(running_machine *machine, debug_cpu_info *info, offs_t pc)
11761177{
11771178   debug_cpu_breakpoint *bp;
11781179   UINT64 result;
r3232r3233
11891190
11901191            /* if we hit, evaluate the action */
11911192            if (bp->action != NULL)
1192               debug_console_execute_command(bp->action, 0);
1193               debug_console_execute_command(machine, bp->action, 0);
11931194
11941195            /* print a notification, unless the action made us go again */
11951196            if (global.execution_state == EXECUTION_STATE_STOPPED)
r3232r3233
13611362   UINT64 result;
13621363
13631364   /* if we're within debugger code, don't stop */
1364   if (global.within_instruction_hook)
1365   if (global.within_instruction_hook || global.debugger_access)
13651366      return;
13661367
13671368   global.within_instruction_hook = TRUE;
r3232r3233
14081409
14091410            /* if we hit, evaluate the action */
14101411            if (wp->action != NULL)
1411               debug_console_execute_command(wp->action, 0);
1412               debug_console_execute_command(machine, wp->action, 0);
14121413
14131414            /* print a notification, unless the action made us go again */
14141415            if (global.execution_state == EXECUTION_STATE_STOPPED)
r3232r3233
16421643   address &= info->space[spacenum].logbytemask;
16431644
16441645   /* all accesses from this point on are for the debugger */
1645   memory_set_debugger_access(1);
1646   memory_set_debugger_access(global.debugger_access = TRUE);
16461647
16471648   /* translate if necessary; if not mapped, return 0xff */
16481649   if (apply_translation && info->translate != NULL && !(*info->translate)(spacenum, TRANSLATE_READ_DEBUG, &address))
r3232r3233
16571658      result = (*active_address_space[spacenum].accessors->read_byte)(address);
16581659
16591660   /* no longer accessing via the debugger */
1660   memory_set_debugger_access(0);
1661   memory_set_debugger_access(global.debugger_access = FALSE);
16611662   return result;
16621663}
16631664
r3232r3233
16931694   else
16941695   {
16951696      /* all accesses from this point on are for the debugger */
1696      memory_set_debugger_access(1);
1697      memory_set_debugger_access(global.debugger_access = TRUE);
16971698
16981699      /* translate if necessary; if not mapped, return 0xffff */
16991700      if (apply_translation && info->translate != NULL && !(*info->translate)(spacenum, TRANSLATE_READ_DEBUG, &address))
r3232r3233
17081709         result = (*active_address_space[spacenum].accessors->read_word)(address);
17091710
17101711      /* no longer accessing via the debugger */
1711      memory_set_debugger_access(0);
1712      memory_set_debugger_access(global.debugger_access = FALSE);
17121713   }
17131714
17141715   return result;
r3232r3233
17461747   else
17471748   {
17481749      /* all accesses from this point on are for the debugger */
1749      memory_set_debugger_access(1);
1750      memory_set_debugger_access(global.debugger_access = TRUE);
17501751
17511752      /* translate if necessary; if not mapped, return 0xffffffff */
17521753      if (apply_translation && info->translate != NULL && !(*info->translate)(spacenum, TRANSLATE_READ_DEBUG, &address))
r3232r3233
17611762         result = (*active_address_space[spacenum].accessors->read_dword)(address);
17621763
17631764      /* no longer accessing via the debugger */
1764      memory_set_debugger_access(0);
1765      memory_set_debugger_access(global.debugger_access = FALSE);
17651766   }
17661767
17671768   return result;
r3232r3233
17991800   else
18001801   {
18011802      /* all accesses from this point on are for the debugger */
1802      memory_set_debugger_access(1);
1803      memory_set_debugger_access(global.debugger_access = TRUE);
18031804
18041805      /* translate if necessary; if not mapped, return 0xffffffffffffffff */
18051806      if (apply_translation && info->translate != NULL && !(*info->translate)(spacenum, TRANSLATE_READ_DEBUG, &address))
r3232r3233
18141815         result = (*active_address_space[spacenum].accessors->read_qword)(address);
18151816
18161817      /* no longer accessing via the debugger */
1817      memory_set_debugger_access(0);
1818      memory_set_debugger_access(global.debugger_access = FALSE);
18181819   }
18191820
18201821   return result;
r3232r3233
18341835   address &= info->space[spacenum].logbytemask;
18351836
18361837   /* all accesses from this point on are for the debugger */
1837   memory_set_debugger_access(1);
1838   memory_set_debugger_access(global.debugger_access = TRUE);
18381839
18391840   /* translate if necessary; if not mapped, we're done */
18401841   if (apply_translation && info->translate != NULL && !(*info->translate)(spacenum, TRANSLATE_WRITE_DEBUG, &address))
r3232r3233
18491850      (*active_address_space[spacenum].accessors->write_byte)(address, data);
18501851
18511852   /* no longer accessing via the debugger */
1852   memory_set_debugger_access(0);
1853   memory_set_debugger_access(global.debugger_access = FALSE);
18531854   global.memory_modified = TRUE;
18541855}
18551856
r3232r3233
18851886   else
18861887   {
18871888      /* all accesses from this point on are for the debugger */
1888      memory_set_debugger_access(1);
1889      memory_set_debugger_access(global.debugger_access = TRUE);
18891890
18901891      /* translate if necessary; if not mapped, we're done */
18911892      if (apply_translation && info->translate && !(*info->translate)(spacenum, TRANSLATE_WRITE_DEBUG, &address))
r3232r3233
19001901         (*active_address_space[spacenum].accessors->write_word)(address, data);
19011902
19021903      /* no longer accessing via the debugger */
1903      memory_set_debugger_access(0);
1904      memory_set_debugger_access(global.debugger_access = FALSE);
19041905      global.memory_modified = TRUE;
19051906   }
19061907}
r3232r3233
19371938   else
19381939   {
19391940      /* all accesses from this point on are for the debugger */
1940      memory_set_debugger_access(1);
1941      memory_set_debugger_access(global.debugger_access = TRUE);
19411942
19421943      /* translate if necessary; if not mapped, we're done */
19431944      if (apply_translation && info->translate && !(*info->translate)(spacenum, TRANSLATE_WRITE_DEBUG, &address))
r3232r3233
19521953         (*active_address_space[spacenum].accessors->write_dword)(address, data);
19531954
19541955      /* no longer accessing via the debugger */
1955      memory_set_debugger_access(0);
1956      memory_set_debugger_access(global.debugger_access = FALSE);
19561957      global.memory_modified = TRUE;
19571958   }
19581959}
r3232r3233
19881989   else
19891990   {
19901991      /* all accesses from this point on are for the debugger */
1991      memory_set_debugger_access(1);
1992      memory_set_debugger_access(global.debugger_access = TRUE);
19921993
19931994      /* translate if necessary; if not mapped, we're done */
19941995      if (apply_translation && info->translate && !(*info->translate)(spacenum, TRANSLATE_WRITE_DEBUG, &address))
r3232r3233
20032004         (*active_address_space[spacenum].accessors->write_qword)(address, data);
20042005
20052006      /* no longer accessing via the debugger */
2006      memory_set_debugger_access(0);
2007      memory_set_debugger_access(global.debugger_access = FALSE);
20072008      global.memory_modified = TRUE;
20082009   }
20092010}
r3232r3233
21102111   /* get pointer to data */
21112112   /* note that we query aligned to the bus width, and then add back the low bits */
21122113   lowbits_mask = info->space[ADDRESS_SPACE_PROGRAM].databytes - 1;
2113   ptr = memory_get_op_ptr(cpu_getactivecpu(), address & ~lowbits_mask, arg);
2114   ptr = memory_get_op_ptr(Machine, cpu_getactivecpu(), address & ~lowbits_mask, arg);
21142115   if (!ptr)
21152116      return ~(UINT64)0 & (~(UINT64)0 >> (64 - 8*size));
21162117   ptr = (UINT8 *)ptr + (address & lowbits_mask);
r3232r3233
22642265
22652266         /* get the base of memory, aligned to the address minus the lowbits */
22662267         if (opcode & 1)
2267            base = memory_get_op_ptr(cpuindex, address & ~lowmask, FALSE);
2268            base = memory_get_op_ptr(Machine, cpuindex, address & ~lowmask, FALSE);
22682269         else
22692270            base = memory_get_read_ptr(cpuindex, ADDRESS_SPACE_PROGRAM, address & ~lowmask);
22702271
r3232r3233
24782479
24792480         /* get the base of memory, aligned to the address minus the lowbits */
24802481         if (opcode & 1)
2481            base = memory_get_op_ptr(cpuindex, address & ~lowmask, FALSE);
2482            base = memory_get_op_ptr(Machine, cpuindex, address & ~lowmask, FALSE);
24822483         else
24832484            base = memory_get_read_ptr(cpuindex, ADDRESS_SPACE_PROGRAM, address & ~lowmask);
24842485
src/emu/debug/debugcmd.c
r3232r3233
1818#include "debughlp.h"
1919#include "debugvw.h"
2020#include "render.h"
21#include "deprecat.h"
2221#include <ctype.h>
2322
2423
r3232r3233
6564static UINT64 global_get(void *ref);
6665static void global_set(void *ref, UINT64 value);
6766
68static void execute_help(int ref, int params, const char **param);
69static void execute_print(int ref, int params, const char **param);
70static void execute_printf(int ref, int params, const char **param);
71static void execute_logerror(int ref, int params, const char **param);
72static void execute_tracelog(int ref, int params, const char **param);
73static void execute_quit(int ref, int params, const char **param);
74static void execute_do(int ref, int params, const char **param);
75static void execute_step(int ref, int params, const char **param);
76static void execute_over(int ref, int params, const char **param);
77static void execute_out(int ref, int params, const char **param);
78static void execute_go(int ref, int params, const char **param);
79static void execute_go_vblank(int ref, int params, const char **param);
80static void execute_go_interrupt(int ref, int params, const char **param);
81static void execute_go_time(int ref, int params, const char *param[]);
82static void execute_focus(int ref, int params, const char **param);
83static void execute_ignore(int ref, int params, const char **param);
84static void execute_observe(int ref, int params, const char **param);
85static void execute_next(int ref, int params, const char **param);
86static void execute_comment(int ref, int params, const char **param);
87static void execute_comment_del(int ref, int params, const char **param);
88static void execute_comment_save(int ref, int params, const char **param);
89static void execute_bpset(int ref, int params, const char **param);
90static void execute_bpclear(int ref, int params, const char **param);
91static void execute_bpdisenable(int ref, int params, const char **param);
92static void execute_bplist(int ref, int params, const char **param);
93static void execute_wpset(int ref, int params, const char **param);
94static void execute_wpclear(int ref, int params, const char **param);
95static void execute_wpdisenable(int ref, int params, const char **param);
96static void execute_wplist(int ref, int params, const char **param);
97static void execute_hotspot(int ref, int params, const char **param);
98static void execute_save(int ref, int params, const char **param);
99static void execute_dump(int ref, int params, const char **param);
100static void execute_dasm(int ref, int params, const char **param);
101static void execute_find(int ref, int params, const char **param);
102static void execute_trace(int ref, int params, const char **param);
103static void execute_traceover(int ref, int params, const char **param);
104static void execute_traceflush(int ref, int params, const char **param);
105static void execute_history(int ref, int params, const char **param);
106static void execute_snap(int ref, int params, const char **param);
107static void execute_source(int ref, int params, const char **param);
108static void execute_map(int ref, int params, const char **param);
109static void execute_memdump(int ref, int params, const char **param);
110static void execute_symlist(int ref, int params, const char **param);
111static void execute_softreset(int ref, int params, const char **param);
112static void execute_hardreset(int ref, int params, const char **param);
67static void execute_help(running_machine *machine, int ref, int params, const char **param);
68static void execute_print(running_machine *machine, int ref, int params, const char **param);
69static void execute_printf(running_machine *machine, int ref, int params, const char **param);
70static void execute_logerror(running_machine *machine, int ref, int params, const char **param);
71static void execute_tracelog(running_machine *machine, int ref, int params, const char **param);
72static void execute_quit(running_machine *machine, int ref, int params, const char **param);
73static void execute_do(running_machine *machine, int ref, int params, const char **param);
74static void execute_step(running_machine *machine, int ref, int params, const char **param);
75static void execute_over(running_machine *machine, int ref, int params, const char **param);
76static void execute_out(running_machine *machine, int ref, int params, const char **param);
77static void execute_go(running_machine *machine, int ref, int params, const char **param);
78static void execute_go_vblank(running_machine *machine, int ref, int params, const char **param);
79static void execute_go_interrupt(running_machine *machine, int ref, int params, const char **param);
80static void execute_go_time(running_machine *machine, int ref, int params, const char *param[]);
81static void execute_focus(running_machine *machine, int ref, int params, const char **param);
82static void execute_ignore(running_machine *machine, int ref, int params, const char **param);
83static void execute_observe(running_machine *machine, int ref, int params, const char **param);
84static void execute_next(running_machine *machine, int ref, int params, const char **param);
85static void execute_comment(running_machine *machine, int ref, int params, const char **param);
86static void execute_comment_del(running_machine *machine, int ref, int params, const char **param);
87static void execute_comment_save(running_machine *machine, int ref, int params, const char **param);
88static void execute_bpset(running_machine *machine, int ref, int params, const char **param);
89static void execute_bpclear(running_machine *machine, int ref, int params, const char **param);
90static void execute_bpdisenable(running_machine *machine, int ref, int params, const char **param);
91static void execute_bplist(running_machine *machine, int ref, int params, const char **param);
92static void execute_wpset(running_machine *machine, int ref, int params, const char **param);
93static void execute_wpclear(running_machine *machine, int ref, int params, const char **param);
94static void execute_wpdisenable(running_machine *machine, int ref, int params, const char **param);
95static void execute_wplist(running_machine *machine, int ref, int params, const char **param);
96static void execute_hotspot(running_machine *machine, int ref, int params, const char **param);
97static void execute_save(running_machine *machine, int ref, int params, const char **param);
98static void execute_dump(running_machine *machine, int ref, int params, const char **param);
99static void execute_dasm(running_machine *machine, int ref, int params, const char **param);
100static void execute_find(running_machine *machine, int ref, int params, const char **param);
101static void execute_trace(running_machine *machine, int ref, int params, const char **param);
102static void execute_traceover(running_machine *machine, int ref, int params, const char **param);
103static void execute_traceflush(running_machine *machine, int ref, int params, const char **param);
104static void execute_history(running_machine *machine, int ref, int params, const char **param);
105static void execute_snap(running_machine *machine, int ref, int params, const char **param);
106static void execute_source(running_machine *machine, int ref, int params, const char **param);
107static void execute_map(running_machine *machine, int ref, int params, const char **param);
108static void execute_memdump(running_machine *machine, int ref, int params, const char **param);
109static void execute_symlist(running_machine *machine, int ref, int params, const char **param);
110static void execute_softreset(running_machine *machine, int ref, int params, const char **param);
111static void execute_hardreset(running_machine *machine, int ref, int params, const char **param);
113112
114113
115114
r3232r3233
157156   }
158157
159158   /* add all the commands */
160   debug_console_register_command("help",      CMDFLAG_NONE, 0, 0, 1, execute_help);
161   debug_console_register_command("print",     CMDFLAG_NONE, 0, 1, MAX_COMMAND_PARAMS, execute_print);
162   debug_console_register_command("printf",    CMDFLAG_NONE, 0, 1, MAX_COMMAND_PARAMS, execute_printf);
163   debug_console_register_command("logerror",  CMDFLAG_NONE, 0, 1, MAX_COMMAND_PARAMS, execute_logerror);
164   debug_console_register_command("tracelog",  CMDFLAG_NONE, 0, 1, MAX_COMMAND_PARAMS, execute_tracelog);
165   debug_console_register_command("quit",      CMDFLAG_NONE, 0, 0, 0, execute_quit);
166   debug_console_register_command("do",        CMDFLAG_NONE, 0, 1, 1, execute_do);
167   debug_console_register_command("step",      CMDFLAG_NONE, 0, 0, 1, execute_step);
168   debug_console_register_command("s",         CMDFLAG_NONE, 0, 0, 1, execute_step);
169   debug_console_register_command("over",      CMDFLAG_NONE, 0, 0, 1, execute_over);
170   debug_console_register_command("o",         CMDFLAG_NONE, 0, 0, 1, execute_over);
171   debug_console_register_command("out" ,      CMDFLAG_NONE, 0, 0, 0, execute_out);
172   debug_console_register_command("go",        CMDFLAG_NONE, 0, 0, 1, execute_go);
173   debug_console_register_command("g",         CMDFLAG_NONE, 0, 0, 1, execute_go);
174   debug_console_register_command("gvblank",   CMDFLAG_NONE, 0, 0, 0, execute_go_vblank);
175   debug_console_register_command("gv",        CMDFLAG_NONE, 0, 0, 0, execute_go_vblank);
176   debug_console_register_command("gint",      CMDFLAG_NONE, 0, 0, 1, execute_go_interrupt);
177   debug_console_register_command("gi",        CMDFLAG_NONE, 0, 0, 1, execute_go_interrupt);
178   debug_console_register_command("gtime",     CMDFLAG_NONE, 0, 0, 1, execute_go_time);
179   debug_console_register_command("gt",        CMDFLAG_NONE, 0, 0, 1, execute_go_time);
180   debug_console_register_command("next",      CMDFLAG_NONE, 0, 0, 0, execute_next);
181   debug_console_register_command("n",         CMDFLAG_NONE, 0, 0, 0, execute_next);
182   debug_console_register_command("focus",     CMDFLAG_NONE, 0, 1, 1, execute_focus);
183   debug_console_register_command("ignore",    CMDFLAG_NONE, 0, 0, MAX_COMMAND_PARAMS, execute_ignore);
184   debug_console_register_command("observe",   CMDFLAG_NONE, 0, 0, MAX_COMMAND_PARAMS, execute_observe);
159   debug_console_register_command(machine, "help",      CMDFLAG_NONE, 0, 0, 1, execute_help);
160   debug_console_register_command(machine, "print",     CMDFLAG_NONE, 0, 1, MAX_COMMAND_PARAMS, execute_print);
161   debug_console_register_command(machine, "printf",    CMDFLAG_NONE, 0, 1, MAX_COMMAND_PARAMS, execute_printf);
162   debug_console_register_command(machine, "logerror",  CMDFLAG_NONE, 0, 1, MAX_COMMAND_PARAMS, execute_logerror);
163   debug_console_register_command(machine, "tracelog",  CMDFLAG_NONE, 0, 1, MAX_COMMAND_PARAMS, execute_tracelog);
164   debug_console_register_command(machine, "quit",      CMDFLAG_NONE, 0, 0, 0, execute_quit);
165   debug_console_register_command(machine, "do",        CMDFLAG_NONE, 0, 1, 1, execute_do);
166   debug_console_register_command(machine, "step",      CMDFLAG_NONE, 0, 0, 1, execute_step);
167   debug_console_register_command(machine, "s",         CMDFLAG_NONE, 0, 0, 1, execute_step);
168   debug_console_register_command(machine, "over",      CMDFLAG_NONE, 0, 0, 1, execute_over);
169   debug_console_register_command(machine, "o",         CMDFLAG_NONE, 0, 0, 1, execute_over);
170   debug_console_register_command(machine, "out" ,      CMDFLAG_NONE, 0, 0, 0, execute_out);
171   debug_console_register_command(machine, "go",        CMDFLAG_NONE, 0, 0, 1, execute_go);
172   debug_console_register_command(machine, "g",         CMDFLAG_NONE, 0, 0, 1, execute_go);
173   debug_console_register_command(machine, "gvblank",   CMDFLAG_NONE, 0, 0, 0, execute_go_vblank);
174   debug_console_register_command(machine, "gv",        CMDFLAG_NONE, 0, 0, 0, execute_go_vblank);
175   debug_console_register_command(machine, "gint",      CMDFLAG_NONE, 0, 0, 1, execute_go_interrupt);
176   debug_console_register_command(machine, "gi",        CMDFLAG_NONE, 0, 0, 1, execute_go_interrupt);
177   debug_console_register_command(machine, "gtime",     CMDFLAG_NONE, 0, 0, 1, execute_go_time);
178   debug_console_register_command(machine, "gt",        CMDFLAG_NONE, 0, 0, 1, execute_go_time);
179   debug_console_register_command(machine, "next",      CMDFLAG_NONE, 0, 0, 0, execute_next);
180   debug_console_register_command(machine, "n",         CMDFLAG_NONE, 0, 0, 0, execute_next);
181   debug_console_register_command(machine, "focus",     CMDFLAG_NONE, 0, 1, 1, execute_focus);
182   debug_console_register_command(machine, "ignore",    CMDFLAG_NONE, 0, 0, MAX_COMMAND_PARAMS, execute_ignore);
183   debug_console_register_command(machine, "observe",   CMDFLAG_NONE, 0, 0, MAX_COMMAND_PARAMS, execute_observe);
185184
186   debug_console_register_command("comadd",   CMDFLAG_NONE, 0, 1, 2, execute_comment);
187   debug_console_register_command("//",        CMDFLAG_NONE, 0, 1, 2, execute_comment);
188   debug_console_register_command("comdelete",   CMDFLAG_NONE, 0, 1, 1, execute_comment_del);
189   debug_console_register_command("comsave",    CMDFLAG_NONE, 0, 0, 0, execute_comment_save);
185   debug_console_register_command(machine, "comadd",   CMDFLAG_NONE, 0, 1, 2, execute_comment);
186   debug_console_register_command(machine, "//",        CMDFLAG_NONE, 0, 1, 2, execute_comment);
187   debug_console_register_command(machine, "comdelete",   CMDFLAG_NONE, 0, 1, 1, execute_comment_del);
188   debug_console_register_command(machine, "comsave",    CMDFLAG_NONE, 0, 0, 0, execute_comment_save);
190189
191   debug_console_register_command("bpset",     CMDFLAG_NONE, 0, 1, 3, execute_bpset);
192   debug_console_register_command("bp",        CMDFLAG_NONE, 0, 1, 3, execute_bpset);
193   debug_console_register_command("bpclear",   CMDFLAG_NONE, 0, 0, 1, execute_bpclear);
194   debug_console_register_command("bpdisable", CMDFLAG_NONE, 0, 0, 1, execute_bpdisenable);
195   debug_console_register_command("bpenable",  CMDFLAG_NONE, 1, 0, 1, execute_bpdisenable);
196   debug_console_register_command("bplist",    CMDFLAG_NONE, 0, 0, 0, execute_bplist);
190   debug_console_register_command(machine, "bpset",     CMDFLAG_NONE, 0, 1, 3, execute_bpset);
191   debug_console_register_command(machine, "bp",        CMDFLAG_NONE, 0, 1, 3, execute_bpset);
192   debug_console_register_command(machine, "bpclear",   CMDFLAG_NONE, 0, 0, 1, execute_bpclear);
193   debug_console_register_command(machine, "bpdisable", CMDFLAG_NONE, 0, 0, 1, execute_bpdisenable);
194   debug_console_register_command(machine, "bpenable",  CMDFLAG_NONE, 1, 0, 1, execute_bpdisenable);
195   debug_console_register_command(machine, "bplist",    CMDFLAG_NONE, 0, 0, 0, execute_bplist);
197196
198   debug_console_register_command("wpset",     CMDFLAG_NONE, ADDRESS_SPACE_PROGRAM, 3, 5, execute_wpset);
199   debug_console_register_command("wp",        CMDFLAG_NONE, ADDRESS_SPACE_PROGRAM, 3, 5, execute_wpset);
200   debug_console_register_command("wpdset",    CMDFLAG_NONE, ADDRESS_SPACE_DATA, 3, 5, execute_wpset);
201   debug_console_register_command("wpd",       CMDFLAG_NONE, ADDRESS_SPACE_DATA, 3, 5, execute_wpset);
202   debug_console_register_command("wpiset",    CMDFLAG_NONE, ADDRESS_SPACE_IO, 3, 5, execute_wpset);
203   debug_console_register_command("wpi",       CMDFLAG_NONE, ADDRESS_SPACE_IO, 3, 5, execute_wpset);
204   debug_console_register_command("wpclear",   CMDFLAG_NONE, 0, 0, 1, execute_wpclear);
205   debug_console_register_command("wpdisable", CMDFLAG_NONE, 0, 0, 1, execute_wpdisenable);
206   debug_console_register_command("wpenable",  CMDFLAG_NONE, 1, 0, 1, execute_wpdisenable);
207   debug_console_register_command("wplist",    CMDFLAG_NONE, 0, 0, 0, execute_wplist);
197   debug_console_register_command(machine, "wpset",     CMDFLAG_NONE, ADDRESS_SPACE_PROGRAM, 3, 5, execute_wpset);
198   debug_console_register_command(machine, "wp",        CMDFLAG_NONE, ADDRESS_SPACE_PROGRAM, 3, 5, execute_wpset);
199   debug_console_register_command(machine, "wpdset",    CMDFLAG_NONE, ADDRESS_SPACE_DATA, 3, 5, execute_wpset);
200   debug_console_register_command(machine, "wpd",       CMDFLAG_NONE, ADDRESS_SPACE_DATA, 3, 5, execute_wpset);
201   debug_console_register_command(machine, "wpiset",    CMDFLAG_NONE, ADDRESS_SPACE_IO, 3, 5, execute_wpset);
202   debug_console_register_command(machine, "wpi",       CMDFLAG_NONE, ADDRESS_SPACE_IO, 3, 5, execute_wpset);
203   debug_console_register_command(machine, "wpclear",   CMDFLAG_NONE, 0, 0, 1, execute_wpclear);
204   debug_console_register_command(machine, "wpdisable", CMDFLAG_NONE, 0, 0, 1, execute_wpdisenable);
205   debug_console_register_command(machine, "wpenable",  CMDFLAG_NONE, 1, 0, 1, execute_wpdisenable);
206   debug_console_register_command(machine, "wplist",    CMDFLAG_NONE, 0, 0, 0, execute_wplist);
208207
209   debug_console_register_command("hotspot",   CMDFLAG_NONE, 0, 0, 3, execute_hotspot);
208   debug_console_register_command(machine, "hotspot",   CMDFLAG_NONE, 0, 0, 3, execute_hotspot);
210209
211   debug_console_register_command("save",      CMDFLAG_NONE, ADDRESS_SPACE_PROGRAM, 3, 4, execute_save);
212   debug_console_register_command("saved",     CMDFLAG_NONE, ADDRESS_SPACE_DATA, 3, 4, execute_save);
213   debug_console_register_command("savei",     CMDFLAG_NONE, ADDRESS_SPACE_IO, 3, 4, execute_save);
210   debug_console_register_command(machine, "save",      CMDFLAG_NONE, ADDRESS_SPACE_PROGRAM, 3, 4, execute_save);
211   debug_console_register_command(machine, "saved",     CMDFLAG_NONE, ADDRESS_SPACE_DATA, 3, 4, execute_save);
212   debug_console_register_command(machine, "savei",     CMDFLAG_NONE, ADDRESS_SPACE_IO, 3, 4, execute_save);
214213
215   debug_console_register_command("dump",      CMDFLAG_NONE, ADDRESS_SPACE_PROGRAM, 3, 6, execute_dump);
216   debug_console_register_command("dumpd",     CMDFLAG_NONE, ADDRESS_SPACE_DATA, 3, 6, execute_dump);
217   debug_console_register_command("dumpi",     CMDFLAG_NONE, ADDRESS_SPACE_IO, 3, 6, execute_dump);
214   debug_console_register_command(machine, "dump",      CMDFLAG_NONE, ADDRESS_SPACE_PROGRAM, 3, 6, execute_dump);
215   debug_console_register_command(machine, "dumpd",     CMDFLAG_NONE, ADDRESS_SPACE_DATA, 3, 6, execute_dump);
216   debug_console_register_command(machine, "dumpi",     CMDFLAG_NONE, ADDRESS_SPACE_IO, 3, 6, execute_dump);
218217
219   debug_console_register_command("f",         CMDFLAG_KEEP_QUOTES, ADDRESS_SPACE_PROGRAM, 3, MAX_COMMAND_PARAMS, execute_find);
220   debug_console_register_command("find",      CMDFLAG_KEEP_QUOTES, ADDRESS_SPACE_PROGRAM, 3, MAX_COMMAND_PARAMS, execute_find);
221   debug_console_register_command("fd",        CMDFLAG_KEEP_QUOTES, ADDRESS_SPACE_DATA, 3, MAX_COMMAND_PARAMS, execute_find);
222   debug_console_register_command("findd",     CMDFLAG_KEEP_QUOTES, ADDRESS_SPACE_DATA, 3, MAX_COMMAND_PARAMS, execute_find);
223   debug_console_register_command("fi",        CMDFLAG_KEEP_QUOTES, ADDRESS_SPACE_IO, 3, MAX_COMMAND_PARAMS, execute_find);
224   debug_console_register_command("findi",     CMDFLAG_KEEP_QUOTES, ADDRESS_SPACE_IO, 3, MAX_COMMAND_PARAMS, execute_find);
218   debug_console_register_command(machine, "f",         CMDFLAG_KEEP_QUOTES, ADDRESS_SPACE_PROGRAM, 3, MAX_COMMAND_PARAMS, execute_find);
219   debug_console_register_command(machine, "find",      CMDFLAG_KEEP_QUOTES, ADDRESS_SPACE_PROGRAM, 3, MAX_COMMAND_PARAMS, execute_find);
220   debug_console_register_command(machine, "fd",        CMDFLAG_KEEP_QUOTES, ADDRESS_SPACE_DATA, 3, MAX_COMMAND_PARAMS, execute_find);
221   debug_console_register_command(machine, "findd",     CMDFLAG_KEEP_QUOTES, ADDRESS_SPACE_DATA, 3, MAX_COMMAND_PARAMS, execute_find);
222   debug_console_register_command(machine, "fi",        CMDFLAG_KEEP_QUOTES, ADDRESS_SPACE_IO, 3, MAX_COMMAND_PARAMS, execute_find);
223   debug_console_register_command(machine, "findi",     CMDFLAG_KEEP_QUOTES, ADDRESS_SPACE_IO, 3, MAX_COMMAND_PARAMS, execute_find);
225224
226   debug_console_register_command("dasm",      CMDFLAG_NONE, 0, 3, 5, execute_dasm);
225   debug_console_register_command(machine, "dasm",      CMDFLAG_NONE, 0, 3, 5, execute_dasm);
227226
228   debug_console_register_command("trace",     CMDFLAG_NONE, 0, 1, 3, execute_trace);
229   debug_console_register_command("traceover", CMDFLAG_NONE, 0, 1, 3, execute_traceover);
230   debug_console_register_command("traceflush",CMDFLAG_NONE, 0, 0, 0, execute_traceflush);
227   debug_console_register_command(machine, "trace",     CMDFLAG_NONE, 0, 1, 3, execute_trace);
228   debug_console_register_command(machine, "traceover", CMDFLAG_NONE, 0, 1, 3, execute_traceover);
229   debug_console_register_command(machine, "traceflush",CMDFLAG_NONE, 0, 0, 0, execute_traceflush);
231230
232   debug_console_register_command("history",   CMDFLAG_NONE, 0, 0, 2, execute_history);
231   debug_console_register_command(machine, "history",   CMDFLAG_NONE, 0, 0, 2, execute_history);
233232
234   debug_console_register_command("snap",      CMDFLAG_NONE, 0, 0, 1, execute_snap);
233   debug_console_register_command(machine, "snap",      CMDFLAG_NONE, 0, 0, 1, execute_snap);
235234
236   debug_console_register_command("source",    CMDFLAG_NONE, 0, 1, 1, execute_source);
235   debug_console_register_command(machine, "source",    CMDFLAG_NONE, 0, 1, 1, execute_source);
237236
238   debug_console_register_command("map",      CMDFLAG_NONE, ADDRESS_SPACE_PROGRAM, 1, 1, execute_map);
239   debug_console_register_command("mapd",      CMDFLAG_NONE, ADDRESS_SPACE_DATA, 1, 1, execute_map);
240   debug_console_register_command("mapi",      CMDFLAG_NONE, ADDRESS_SPACE_IO, 1, 1, execute_map);
241   debug_console_register_command("memdump",   CMDFLAG_NONE, 0, 0, 1, execute_memdump);
237   debug_console_register_command(machine, "map",      CMDFLAG_NONE, ADDRESS_SPACE_PROGRAM, 1, 1, execute_map);
238   debug_console_register_command(machine, "mapd",      CMDFLAG_NONE, ADDRESS_SPACE_DATA, 1, 1, execute_map);
239   debug_console_register_command(machine, "mapi",      CMDFLAG_NONE, ADDRESS_SPACE_IO, 1, 1, execute_map);
240   debug_console_register_command(machine, "memdump",   CMDFLAG_NONE, 0, 0, 1, execute_memdump);
242241
243   debug_console_register_command("symlist",   CMDFLAG_NONE, 0, 0, 1, execute_symlist);
242   debug_console_register_command(machine, "symlist",   CMDFLAG_NONE, 0, 0, 1, execute_symlist);
244243
245   debug_console_register_command("softreset",   CMDFLAG_NONE, 0, 0, 1, execute_softreset);
246   debug_console_register_command("hardreset",   CMDFLAG_NONE, 0, 0, 1, execute_hardreset);
244   debug_console_register_command(machine, "softreset",   CMDFLAG_NONE, 0, 0, 1, execute_softreset);
245   debug_console_register_command(machine, "hardreset",   CMDFLAG_NONE, 0, 0, 1, execute_hardreset);
247246
248247   /* ask all the CPUs if they would like to register functions or symbols */
249248   for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++)
r3232r3233
402401    command parameter
403402-------------------------------------------------*/
404403
405static int debug_command_parameter_command(const char *param)
404static int debug_command_parameter_command(running_machine *machine, const char *param)
406405{
407   CMDERR err = debug_console_validate_command(param);
406   CMDERR err = debug_console_validate_command(machine, param);
408407   if (err == CMDERR_NONE)
409408      return 1;
410409   debug_console_printf("Error in command: %s\n", param);
r3232r3233
425424    execute_help - execute the help command
426425-------------------------------------------------*/
427426
428static void execute_help(int ref, int params, const char *param[])
427static void execute_help(running_machine *machine, int ref, int params, const char *param[])
429428{
430429   if (params == 0)
431430      debug_console_printf_wrap(80, "%s\n", debug_get_help(""));
r3232r3233
438437    execute_print - execute the print command
439438-------------------------------------------------*/
440439
441static void execute_print(int ref, int params, const char *param[])
440static void execute_print(running_machine *machine, int ref, int params, const char *param[])
442441{
443442   UINT64 values[MAX_COMMAND_PARAMS];
444443   int i;
r3232r3233
558557    execute_printf - execute the printf command
559558-------------------------------------------------*/
560559
561static void execute_printf(int ref, int params, const char *param[])
560static void execute_printf(running_machine *machine, int ref, int params, const char *param[])
562561{
563562   UINT64 values[MAX_COMMAND_PARAMS];
564563   char buffer[1024];
r3232r3233
579578    execute_logerror - execute the logerror command
580579-------------------------------------------------*/
581580
582static void execute_logerror(int ref, int params, const char *param[])
581static void execute_logerror(running_machine *machine, int ref, int params, const char *param[])
583582{
584583   UINT64 values[MAX_COMMAND_PARAMS];
585584   char buffer[1024];
r3232r3233
600599    execute_tracelog - execute the tracelog command
601600-------------------------------------------------*/
602601
603static void execute_tracelog(int ref, int params, const char *param[])
602static void execute_tracelog(running_machine *machine, int ref, int params, const char *param[])
604603{
605604   FILE *file = debug_get_cpu_info(cpu_getactivecpu())->trace.file;
606605   UINT64 values[MAX_COMMAND_PARAMS];
r3232r3233
626625    execute_quit - execute the quit command
627626-------------------------------------------------*/
628627
629static void execute_quit(int ref, int params, const char *param[])
628static void execute_quit(running_machine *machine, int ref, int params, const char *param[])
630629{
631630   mame_printf_error("Exited via the debugger\n");
632   mame_schedule_exit(Machine);
631   mame_schedule_exit(machine);
633632}
634633
635634
r3232r3233
637636    execute_do - execute the do command
638637-------------------------------------------------*/
639638
640static void execute_do(int ref, int params, const char *param[])
639static void execute_do(running_machine *machine, int ref, int params, const char *param[])
641640{
642641   UINT64 dummy;
643642   debug_command_parameter_number(param[0], &dummy);
r3232r3233
648647    execute_step - execute the step command
649648-------------------------------------------------*/
650649
651static void execute_step(int ref, int params, const char *param[])
650static void execute_step(running_machine *machine, int ref, int params, const char *param[])
652651{
653652   UINT64 steps = 1;
654653
r3232r3233
664663    execute_over - execute the over command
665664-------------------------------------------------*/
666665
667static void execute_over(int ref, int params, const char *param[])
666static void execute_over(running_machine *machine, int ref, int params, const char *param[])
668667{
669668   UINT64 steps = 1;
670669
r3232r3233
680679    execute_out - execute the out command
681680-------------------------------------------------*/
682681
683static void execute_out(int ref, int params, const char *param[])
682static void execute_out(running_machine *machine, int ref, int params, const char *param[])
684683{
685684   debug_cpu_single_step_out();
686685}
r3232r3233
690689    execute_go - execute the go command
691690-------------------------------------------------*/
692691
693static void execute_go(int ref, int params, const char *param[])
692static void execute_go(running_machine *machine, int ref, int params, const char *param[])
694693{
695694   UINT64 addr = ~0;
696695
r3232r3233
707706    command
708707-------------------------------------------------*/
709708
710static void execute_go_vblank(int ref, int params, const char *param[])
709static void execute_go_vblank(running_machine *machine, int ref, int params, const char *param[])
711710{
712711   debug_cpu_go_vblank();
713712}
r3232r3233
717716    execute_go_interrupt - execute the goint command
718717-------------------------------------------------*/
719718
720static void execute_go_interrupt(int ref, int params, const char *param[])
719static void execute_go_interrupt(running_machine *machine, int ref, int params, const char *param[])
721720{
722721   UINT64 irqline = -1;
723722
r3232r3233
733732    execute_go_time - execute the gtime command
734733-------------------------------------------------*/
735734
736static void execute_go_time(int ref, int params, const char *param[])
735static void execute_go_time(running_machine *machine, int ref, int params, const char *param[])
737736{
738737   UINT64 milliseconds = -1;
739738
r3232r3233
749748    execute_next - execute the next command
750749-------------------------------------------------*/
751750
752static void execute_next(int ref, int params, const char *param[])
751static void execute_next(running_machine *machine, int ref, int params, const char *param[])
753752{
754753   debug_cpu_next_cpu();
755754}
r3232r3233
759758    execute_focus - execute the focus command
760759-------------------------------------------------*/
761760
762static void execute_focus(int ref, int params, const char *param[])
761static void execute_focus(running_machine *machine, int ref, int params, const char *param[])
763762{
764763   UINT64 cpuwhich;
765764   int cpunum;
r3232r3233
791790    execute_ignore - execute the ignore command
792791-------------------------------------------------*/
793792
794static void execute_ignore(int ref, int params, const char *param[])
793static void execute_ignore(running_machine *machine, int ref, int params, const char *param[])
795794{
796795   UINT64 cpuwhich[MAX_COMMAND_PARAMS];
797796   int cpunum, paramnum;
r3232r3233
862861    execute_observe - execute the observe command
863862-------------------------------------------------*/
864863
865static void execute_observe(int ref, int params, const char *param[])
864static void execute_observe(running_machine *machine, int ref, int params, const char *param[])
866865{
867866   UINT64 cpuwhich[MAX_COMMAND_PARAMS];
868867   int cpunum, paramnum;
r3232r3233
920919    execute_comment - add a comment to a line
921920-------------------------------------------------*/
922921
923static void execute_comment(int ref, int params, const char *param[])
922static void execute_comment(running_machine *machine, int ref, int params, const char *param[])
924923{
925924   UINT64 address;
926925
r3232r3233
945944    execute_comment_del - remove a comment from an addr
946945--------------------------------------------------------*/
947946
948static void execute_comment_del(int ref, int params, const char *param[])
947static void execute_comment_del(running_machine *machine, int ref, int params, const char *param[])
949948{
950949   UINT64 address;
951950
r3232r3233
964963    execute_comment - add a comment to a line
965964-------------------------------------------------*/
966965
967static void execute_comment_save(int ref, int params, const char *param[])
966static void execute_comment_save(running_machine *machine, int ref, int params, const char *param[])
968967{
969   if (debug_comment_save(Machine))
968   if (debug_comment_save(machine))
970969      debug_console_printf("Comments successfully saved\n");
971970}
972971
r3232r3233
976975    command
977976-------------------------------------------------*/
978977
979static void execute_bpset(int ref, int params, const char *param[])
978static void execute_bpset(running_machine *machine, int ref, int params, const char *param[])
980979{
981980   parsed_expression *condition = NULL;
982981   const char *action = NULL;
r3232r3233
999998      return;
1000999
10011000   /* param 3 is the action */
1002   if (params > 2 && !debug_command_parameter_command(action = param[2]))
1001   if (params > 2 && !debug_command_parameter_command(machine, action = param[2]))
10031002      return;
10041003
10051004   /* set the breakpoint */
1006   bpnum = debug_cpu_breakpoint_set(Machine, cpu_getactivecpu(), address, condition, action);
1005   bpnum = debug_cpu_breakpoint_set(machine, cpu_getactivecpu(), address, condition, action);
10071006   debug_console_printf("Breakpoint %X set\n", bpnum);
10081007}
10091008
r3232r3233
10131012    clear command
10141013-------------------------------------------------*/
10151014
1016static void execute_bpclear(int ref, int params, const char *param[])
1015static void execute_bpclear(running_machine *machine, int ref, int params, const char *param[])
10171016{
10181017   UINT64 bpindex;
10191018
r3232r3233
10291028         {
10301029            debug_cpu_breakpoint *bp;
10311030            while ((bp = cpuinfo->bplist) != NULL)
1032               debug_cpu_breakpoint_clear(Machine, bp->index);
1031               debug_cpu_breakpoint_clear(machine, bp->index);
10331032         }
10341033      }
10351034      debug_console_printf("Cleared all breakpoints\n");
r3232r3233
10401039      return;
10411040   else
10421041   {
1043      int found = debug_cpu_breakpoint_clear(Machine, bpindex);
1042      int found = debug_cpu_breakpoint_clear(machine, bpindex);
10441043      if (found)
10451044         debug_console_printf("Breakpoint %X cleared\n", (UINT32)bpindex);
10461045      else
r3232r3233
10541053    disable/enable commands
10551054-------------------------------------------------*/
10561055
1057static void execute_bpdisenable(int ref, int params, const char *param[])
1056static void execute_bpdisenable(running_machine *machine, int ref, int params, const char *param[])
10581057{
10591058   UINT64 bpindex;
10601059
r3232r3233
10701069         {
10711070            debug_cpu_breakpoint *bp;
10721071            for (bp = cpuinfo->bplist; bp != NULL; bp = bp->next)
1073               debug_cpu_breakpoint_enable(Machine, bp->index, ref);
1072               debug_cpu_breakpoint_enable(machine, bp->index, ref);
10741073         }
10751074      }
10761075      if (ref == 0)
r3232r3233
10841083      return;
10851084   else
10861085   {
1087      int found = debug_cpu_breakpoint_enable(Machine, bpindex, ref);
1086      int found = debug_cpu_breakpoint_enable(machine, bpindex, ref);
10881087      if (found)
10891088         debug_console_printf("Breakpoint %X %s\n", (UINT32)bpindex, ref ? "enabled" : "disabled");
10901089      else
r3232r3233
10981097    command
10991098-------------------------------------------------*/
11001099
1101static void execute_bplist(int ref, int params, const char *param[])
1100static void execute_bplist(running_machine *machine, int ref, int params, const char *param[])
11021101{
11031102   int cpunum, printed = 0;
11041103   char buffer[256];
r3232r3233
11391138    command
11401139-------------------------------------------------*/
11411140
1142static void execute_wpset(int ref, int params, const char *param[])
1141static void execute_wpset(running_machine *machine, int ref, int params, const char *param[])
11431142{
11441143   parsed_expression *condition = NULL;
11451144   const char *action = NULL;
r3232r3233
11731172      return;
11741173
11751174   /* param 5 is the action */
1176   if (params > 4 && !debug_command_parameter_command(action = param[4]))
1175   if (params > 4 && !debug_command_parameter_command(machine, action = param[4]))
11771176      return;
11781177
11791178   /* set the watchpoint */
1180   wpnum = debug_cpu_watchpoint_set(Machine, cpu_getactivecpu(), ref, type, address, length, condition, action);
1179   wpnum = debug_cpu_watchpoint_set(machine, cpu_getactivecpu(), ref, type, address, length, condition, action);
11811180   debug_console_printf("Watchpoint %X set\n", wpnum);
11821181}
11831182
r3232r3233
11871186    clear command
11881187-------------------------------------------------*/
11891188
1190static void execute_wpclear(int ref, int params, const char *param[])
1189static void execute_wpclear(running_machine *machine, int ref, int params, const char *param[])
11911190{
11921191   UINT64 wpindex;
11931192
r3232r3233
12071206            {
12081207               debug_cpu_watchpoint *wp;
12091208               while ((wp = cpuinfo->space[spacenum].wplist) != NULL)
1210                  debug_cpu_watchpoint_clear(Machine, wp->index);
1209                  debug_cpu_watchpoint_clear(machine, wp->index);
12111210            }
12121211         }
12131212      }
r3232r3233
12191218      return;
12201219   else
12211220   {
1222      int found = debug_cpu_watchpoint_clear(Machine, wpindex);
1221      int found = debug_cpu_watchpoint_clear(machine, wpindex);
12231222      if (found)
12241223         debug_console_printf("Watchpoint %X cleared\n", (UINT32)wpindex);
12251224      else
r3232r3233
12331232    disable/enable commands
12341233-------------------------------------------------*/
12351234
1236static void execute_wpdisenable(int ref, int params, const char *param[])
1235static void execute_wpdisenable(running_machine *machine, int ref, int params, const char *param[])
12371236{
12381237   UINT64 wpindex;
12391238
r3232r3233
12531252            {
12541253               debug_cpu_watchpoint *wp;
12551254               for (wp = cpuinfo->space[spacenum].wplist; wp != NULL; wp = wp->next)
1256                  debug_cpu_watchpoint_enable(Machine, wp->index, ref);
1255                  debug_cpu_watchpoint_enable(machine, wp->index, ref);
12571256            }
12581257         }
12591258      }
r3232r3233
12681267      return;
12691268   else
12701269   {
1271      int found = debug_cpu_watchpoint_enable(Machine, wpindex, ref);
1270      int found = debug_cpu_watchpoint_enable(machine, wpindex, ref);
12721271      if (found)
12731272         debug_console_printf("Watchpoint %X %s\n", (UINT32)wpindex, ref ? "enabled" : "disabled");
12741273      else
r3232r3233
12821281    command
12831282-------------------------------------------------*/
12841283
1285static void execute_wplist(int ref, int params, const char *param[])
1284static void execute_wplist(running_machine *machine, int ref, int params, const char *param[])
12861285{
12871286   int cpunum, printed = 0;
12881287   char buffer[256];
r3232r3233
13331332    command
13341333-------------------------------------------------*/
13351334
1336static void execute_hotspot(int ref, int params, const char *param[])
1335static void execute_hotspot(running_machine *machine, int ref, int params, const char *param[])
13371336{
13381337   UINT64 threshhold;
13391338   UINT64 cpunum;
r3232r3233
13511350
13521351         if (cpuinfo->valid && cpuinfo->hotspots)
13531352         {
1354            debug_cpu_hotspot_track(Machine, cpunum, 0, 0);
1353            debug_cpu_hotspot_track(machine, cpunum, 0, 0);
13551354            debug_console_printf("Cleared hotspot tracking on CPU %d\n", (int)cpunum);
13561355            cleared = TRUE;
13571356         }
r3232r3233
13741373      return;
13751374
13761375   /* attempt to install */
1377   if (debug_cpu_hotspot_track(Machine, cpunum, count, threshhold))
1376   if (debug_cpu_hotspot_track(machine, cpunum, count, threshhold))
13781377      debug_console_printf("Now tracking hotspots on CPU %d using %d slots with a threshhold of %d\n", (int)cpunum, (int)count, (int)threshhold);
13791378   else
13801379      debug_console_printf("Error setting up the hotspot tracking\n");
r3232r3233
13851384    execute_save - execute the save command
13861385-------------------------------------------------*/
13871386
1388static void execute_save(int ref, int params, const char *param[])
1387static void execute_save(running_machine *machine, int ref, int params, const char *param[])
13891388{
13901389   UINT64 offset, endoffset, length, cpunum = cpu_getactivecpu();
13911390   const debug_cpu_info *info;
r3232r3233
14331432    execute_dump - execute the dump command
14341433-------------------------------------------------*/
14351434
1436static void execute_dump(int ref, int params, const char *param[])
1435static void execute_dump(running_machine *machine, int ref, int params, const char *param[])
14371436{
14381437   UINT64 offset, endoffset, length, width = 0, ascii = 1, cpunum = cpu_getactivecpu();
14391438   const debug_cpu_info *info;
r3232r3233
16021601    execute_find - execute the find command
16031602-------------------------------------------------*/
16041603
1605static void execute_find(int ref, int params, const char *param[])
1604static void execute_find(running_machine *machine, int ref, int params, const char *param[])
16061605{
16071606   UINT64 offset, endoffset, length, cpunum = cpu_getactivecpu();
16081607   const debug_cpu_info *info;
r3232r3233
17081707    execute_dasm - execute the dasm command
17091708-------------------------------------------------*/
17101709
1711static void execute_dasm(int ref, int params, const char *param[])
1710static void execute_dasm(running_machine *machine, int ref, int params, const char *param[])
17121711{
17131712   UINT64 offset, length, bytes = 1, cpunum = cpu_getactivecpu();
17141713   const debug_cpu_info *info;
r3232r3233
18551854    trace over and trace info
18561855-------------------------------------------------*/
18571856
1858static void execute_trace_internal(int ref, int params, const char *param[], int trace_over)
1857static void execute_trace_internal(running_machine *machine, int ref, int params, const char *param[], int trace_over)
18591858{
18601859   const char *action = NULL, *filename = param[0];
18611860   FILE *f = NULL;
r3232r3233
18671866   /* validate parameters */
18681867   if (params > 1 && !debug_command_parameter_number(param[1], &cpunum))
18691868      return;
1870   if (params > 2 && !debug_command_parameter_command(action = param[2]))
1869   if (params > 2 && !debug_command_parameter_command(machine, action = param[2]))
18711870      return;
18721871
18731872   /* further validation */
r3232r3233
19121911    execute_trace - execute the trace command
19131912-------------------------------------------------*/
19141913
1915static void execute_trace(int ref, int params, const char *param[])
1914static void execute_trace(running_machine *machine, int ref, int params, const char *param[])
19161915{
1917   execute_trace_internal(ref, params, param, 0);
1916   execute_trace_internal(machine, ref, params, param, 0);
19181917}
19191918
19201919
r3232r3233
19221921    execute_traceover - execute the trace over command
19231922-------------------------------------------------*/
19241923
1925static void execute_traceover(int ref, int params, const char *param[])
1924static void execute_traceover(running_machine *machine, int ref, int params, const char *param[])
19261925{
1927   execute_trace_internal(ref, params, param, 1);
1926   execute_trace_internal(machine, ref, params, param, 1);
19281927}
19291928
19301929
r3232r3233
19321931    execute_traceflush - execute the trace flush command
19331932-------------------------------------------------*/
19341933
1935static void execute_traceflush(int ref, int params, const char *param[])
1934static void execute_traceflush(running_machine *machine, int ref, int params, const char *param[])
19361935{
19371936   debug_cpu_flush_traces();
19381937}
r3232r3233
19421941    execute_history - execute the history command
19431942-------------------------------------------------*/
19441943
1945static void execute_history(int ref, int params, const char *param[])
1944static void execute_history(running_machine *machine, int ref, int params, const char *param[])
19461945{
19471946   UINT64 count = DEBUG_HISTORY_SIZE;
19481947   const debug_cpu_info *info;
r3232r3233
19991998    execute_snap - execute the trace over command
20001999-------------------------------------------------*/
20012000
2002static void execute_snap(int ref, int params, const char *param[])
2001static void execute_snap(running_machine *machine, int ref, int params, const char *param[])
20032002{
20042003   /* if no params, use the default behavior */
20052004   if (params == 0)
20062005   {
2007      video_save_active_screen_snapshots(Machine);
2006      video_save_active_screen_snapshots(machine);
20082007      debug_console_printf("Saved snapshot\n");
20092008   }
20102009
r3232r3233
20172016      int scrnum = (params > 1) ? atoi(param[1]) : 0;
20182017      astring *fname;
20192018
2020      const device_config *screen = device_list_find_by_index(Machine->config->devicelist, VIDEO_SCREEN, scrnum);
2019      const device_config *screen = device_list_find_by_index(machine->config->devicelist, VIDEO_SCREEN, scrnum);
20212020
20222021      if ((screen == NULL) || !render_is_live_screen(screen))
20232022      {
r3232r3233
20482047    execute_source - execute the source command
20492048-------------------------------------------------*/
20502049
2051static void execute_source(int ref, int params, const char *param[])
2050static void execute_source(running_machine *machine, int ref, int params, const char *param[])
20522051{
2053   debug_cpu_source_script(Machine, param[0]);
2052   debug_cpu_source_script(machine, param[0]);
20542053}
20552054
20562055
r3232r3233
20582057    execute_map - execute the map command
20592058-------------------------------------------------*/
20602059
2061static void execute_map(int ref, int params, const char *param[])
2060static void execute_map(running_machine *machine, int ref, int params, const char *param[])
20622061{
20632062   UINT64 address, cpunum = cpu_getactivecpu();
20642063   const debug_cpu_info *info;
r3232r3233
20742073   /* do the translation first */
20752074   for (intention = TRANSLATE_READ_DEBUG; intention <= TRANSLATE_FETCH_DEBUG; intention++)
20762075   {
2077      static const char *intnames[] = { "Read", "Write", "Fetch" };
2076      static const char *const intnames[] = { "Read", "Write", "Fetch" };
20782077      taddress = ADDR2BYTE_MASKED(address, info, spacenum);
20792078      if (info->translate != NULL)
20802079      {
r3232r3233
20992098    execute_memdump - execute the memdump command
21002099-------------------------------------------------*/
21012100
2102static void execute_memdump(int ref, int params, const char **param)
2101static void execute_memdump(running_machine *machine, int ref, int params, const char **param)
21032102{
21042103   FILE *file;
21052104   const char *filename;
r3232r3233
21282127   return strcmp(str1, str2);
21292128}
21302129
2131static void execute_symlist(int ref, int params, const char **param)
2130static void execute_symlist(running_machine *machine, int ref, int params, const char **param)
21322131{
21332132   const char *namelist[1000];
21342133   symbol_table *symtable;
r3232r3233
21972196    execute_softreset - execute the softreset command
21982197-------------------------------------------------*/
21992198
2200static void execute_softreset(int ref, int params, const char **param)
2199static void execute_softreset(running_machine *machine, int ref, int params, const char **param)
22012200{
2202   mame_schedule_soft_reset(Machine);
2201   mame_schedule_soft_reset(machine);
22032202}
22042203
22052204
r3232r3233
22072206    execute_hardreset - execute the hardreset command
22082207-------------------------------------------------*/
22092208
2210static void execute_hardreset(int ref, int params, const char **param)
2209static void execute_hardreset(running_machine *machine, int ref, int params, const char **param)
22112210{
2212   mame_schedule_hard_reset(Machine);
2211   mame_schedule_hard_reset(machine);
22132212}
src/emu/debug/debugcon.c
r3232r3233
1515#include "debughlp.h"
1616#include "debugvw.h"
1717#include "textbuf.h"
18#include "deprecat.h"
1918#include "debugger.h"
2019#include <ctype.h>
2120
r3232r3233
4443   char         command[32];
4544   const char *   params;
4645   const char *   help;
47   void         (*handler)(int ref, int params, const char **param);
46   void         (*handler)(running_machine *machine, int ref, int params, const char **param);
4847   void         (*handler_ex)(int ref);
4948   UINT32         flags;
5049   int            ref;
r3232r3233
186185    command
187186-------------------------------------------------*/
188187
189static CMDERR internal_execute_command(int execute, int params, char **param)
188static CMDERR internal_execute_command(running_machine *machine, int execute, int params, char **param)
190189{
191190   debug_command *cmd, *found = NULL;
192191   int i, foundcount = 0;
r3232r3233
248247
249248   /* execute the handler */
250249   if (execute)
251      (*found->handler)(found->ref, params, (const char **)param);
250      (*found->handler)(machine, found->ref, params, (const char **)param);
252251   return CMDERR_NONE;
253252}
254253
r3232r3233
258257    and either executes or just validates it
259258-------------------------------------------------*/
260259
261static CMDERR internal_parse_command(const char *original_command, int execute)
260static CMDERR internal_parse_command(running_machine *machine, const char *original_command, int execute)
262261{
263262   char command[MAX_COMMAND_LENGTH], parens[MAX_COMMAND_LENGTH];
264263   char *params[MAX_COMMAND_PARAMS];
r3232r3233
335334      }
336335      else
337336      {
338         result = internal_execute_command(execute, paramcount, &params[0]);
337         result = internal_execute_command(machine, execute, paramcount, &params[0]);
339338         if (result != CMDERR_NONE)
340339            return MAKE_CMDERR(CMDERR_ERROR_CLASS(result), command_start - command);
341340      }
r3232r3233
349348    command string
350349-------------------------------------------------*/
351350
352CMDERR debug_console_execute_command(const char *command, int echo)
351CMDERR debug_console_execute_command(running_machine *machine, const char *command, int echo)
353352{
354353   CMDERR result;
355354
r3232r3233
358357      debug_console_printf(">%s\n", command);
359358
360359   /* parse and execute */
361   result = internal_parse_command(command, TRUE);
360   result = internal_parse_command(machine, command, TRUE);
362361
363362   /* display errors */
364363   if (result != CMDERR_NONE)
r3232r3233
373372   if (echo)
374373   {
375374      debug_view_update_all();
376      debugger_refresh_display(Machine);
375      debugger_refresh_display(machine);
377376   }
378377   return result;
379378}
r3232r3233
384383    command string
385384-------------------------------------------------*/
386385
387CMDERR debug_console_validate_command(const char *command)
386CMDERR debug_console_validate_command(running_machine *machine, const char *command)
388387{
389   return internal_parse_command(command, FALSE);
388   return internal_parse_command(machine, command, FALSE);
390389}
391390
392391
r3232r3233
395394    command handler
396395-------------------------------------------------*/
397396
398void debug_console_register_command(const char *command, UINT32 flags, int ref, int minparams, int maxparams, void (*handler)(int ref, int params, const char **param))
397void debug_console_register_command(running_machine *machine, const char *command, UINT32 flags, int ref, int minparams, int maxparams, void (*handler)(running_machine *machine, int ref, int params, const char **param))
399398{
400399   debug_command *cmd;
401400
402   assert_always(mame_get_phase(Machine) == MAME_PHASE_INIT, "Can only call debug_console_register_command() at init time!");
403   assert_always((Machine->debug_flags & DEBUG_FLAG_ENABLED) != 0, "Cannot call debug_console_register_command() when debugger is not running");
401   assert_always(mame_get_phase(machine) == MAME_PHASE_INIT, "Can only call debug_console_register_command() at init time!");
402   assert_always((machine->debug_flags & DEBUG_FLAG_ENABLED) != 0, "Cannot call debug_console_register_command() when debugger is not running");
404403
405404   cmd = auto_malloc(sizeof(*cmd));
406405   memset(cmd, 0, sizeof(*cmd));
src/emu/debug/express.c
r3232r3233
816816
817817         default:
818818         {
819            static const char valid[] = "abcdefghijklmnopqrstuvwxyz0123456789_$#.";
819            static const char valid[] = "abcdefghijklmnopqrstuvwxyz0123456789_$#.:";
820820            static const char numbers[] = "0123456789abcdef";
821821            int bufindex = 0, must_be_number = 0, numbase = DEFAULT_BASE;
822822            char buffer[MAX_SYMBOL_LENGTH];
src/emu/debug/debugcon.h
r3232r3233
6262#define MAKE_CMDERR_EXPRESSION_ERROR(x)      MAKE_CMDERR(CMDERR_EXPRESSION_ERROR, (x))
6363
6464
65
6665/***************************************************************************
6766    TYPE DEFINITIONS
6867***************************************************************************/
r3232r3233
8180void            debug_console_exit(running_machine *machine);
8281
8382/* command handling */
84CMDERR            debug_console_execute_command(const char *command, int echo);
85CMDERR            debug_console_validate_command(const char *command);
86void            debug_console_register_command(const char *command, UINT32 flags, int ref, int minparams, int maxparams, void (*handler)(int ref, int params, const char **param));
83CMDERR            debug_console_execute_command(running_machine *machine, const char *command, int echo);
84CMDERR            debug_console_validate_command(running_machine *machine, const char *command);
85void            debug_console_register_command(running_machine *machine, const char *command, UINT32 flags, int ref, int minparams, int maxparams, void (*handler)(running_machine *machine, int ref, int params, const char **param));
8786const char *      debug_cmderr_to_string(CMDERR error);
8887
8988/* console management */
src/emu/cpu/mcs48/mcs48.c
r3232r3233
956956
957957/* FIXME: the memory maps should probably support rom banking for EA */
958958static ADDRESS_MAP_START(program_10bit, ADDRESS_SPACE_PROGRAM, 8)
959   AM_RANGE(0x00, 0x3ff) AM_ROMBANK(MCS48_INTERNAL_ROMBANK)
959   AM_RANGE(0x00, 0x3ff) AM_ROM
960960ADDRESS_MAP_END
961961
962962static ADDRESS_MAP_START(program_11bit, ADDRESS_SPACE_PROGRAM, 8)
963   AM_RANGE(0x00, 0x7ff) AM_ROMBANK(MCS48_INTERNAL_ROMBANK)
963   AM_RANGE(0x00, 0x7ff) AM_ROM
964964ADDRESS_MAP_END
965965
966966static ADDRESS_MAP_START(data_6bit, ADDRESS_SPACE_DATA, 8)
r3232r3233
10161016   {
10171017      /* --- the following bits of info are set as 64-bit signed integers --- */
10181018      case CPUINFO_INT_INPUT_STATE + MCS48_INPUT_IRQ:   mcs48.irq_state = (info->i != CLEAR_LINE);   break;
1019      case CPUINFO_INT_INPUT_STATE + MCS48_INPUT_EA:   mcs48.ea = (info->i != CLEAR_LINE);
1020                                          memory_set_bank(MCS48_INTERNAL_ROMBANK, mcs48.ea);
1021                                          break;
1019      case CPUINFO_INT_INPUT_STATE + MCS48_INPUT_EA:   mcs48.ea = (info->i != CLEAR_LINE);         break;
10221020
10231021      case CPUINFO_INT_PC:
10241022      case CPUINFO_INT_REGISTER + MCS48_PC:         PC = info->i;                        break;
src/emu/cpu/mcs48/mcs48.h
r3232r3233
1818#include "cpuintrf.h"
1919
2020/***************************************************************************
21    DEFINES
22***************************************************************************/
23
24#define MCS48_INTERNAL_ROMBANK      (31)
25
26/***************************************************************************
2721    CONSTANTS
2822***************************************************************************/
2923
src/emu/cpu/cubeqcpu/cubeqcpu.c
r3232r3233
2020***************************************************************************/
2121
2222/* Am2901 Instruction Fields */
23static const char* ins[] =
23static const char *const ins[] =
2424{
2525   "ADD  ",
2626   "SUBR ",
r3232r3233
3232   "EXNOR",
3333};
3434
35static const char* src[] =
35static const char *const src[] =
3636{
3737   "A,Q",
3838   "A,B",
r3232r3233
4444   "D,0",
4545};
4646
47static const char* dst[] =
47static const char *const dst[] =
4848{
4949   "QREG ",
5050   "NOP  ",
r3232r3233
749749
750750static offs_t cquestsnd_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
751751{
752   static const char* jmps[] =
752   static const char *const jmps[] =
753753   {
754754      "JUMP ",
755755      "     ",
r3232r3233
762762   };
763763
764764
765   static const char* latches[] =
765   static const char *const latches[] =
766766   {
767767      "PLTCH  ",
768768      "DAC    ",
r3232r3233
12021202
12031203static offs_t cquestrot_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
12041204{
1205   static const char* jmps[] =
1205   static const char *const jmps[] =
12061206   {
12071207      "       ",
12081208      "JSEQ   ",
r3232r3233
12231223      "JNZERO ",
12241224   };
12251225
1226   static const char* youts[] =
1226   static const char *const youts[] =
12271227   {
12281228      "     ",
12291229      "     ",
r3232r3233
12351235      "Y2D  ",
12361236   };
12371237
1238   static const char* spfs[] =
1238   static const char *const spfs[] =
12391239   {
12401240      "      ",
12411241      "      ",
r3232r3233
17601760
17611761static offs_t cquestlin_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
17621762{
1763   static const char* jmps[] =
1763   static const char *const jmps[] =
17641764   {
17651765      "     ",
17661766      "JMSB ",
r3232r3233
17811781      "?????",
17821782   };
17831783
1784   static const char* latches[] =
1784   static const char *const latches[] =
17851785   {
17861786      "       ",
17871787      "SEQLTCH",
r3232r3233
17931793      "ZLTCH  ",
17941794   };
17951795
1796   static const char* spfs[] =
1796   static const char *const spfs[] =
17971797   {
17981798      "      ",
17991799      "FSTOP ",
src/emu/cpu/drcuml.c
r3232r3233
11371137
11381138void drcuml_disasm(const drcuml_instruction *inst, char *buffer, drcuml_state *drcuml)
11391139{
1140   static const char *conditions[] = { "z", "nz", "s", "ns", "c", "nc", "v", "nv", "u", "nu", "a", "be", "g", "le", "l", "ge" };
1141   static const char *pound_size[] = { "?", "?", "?", "?", "s", "?", "?", "?", "d" };
1142   static const char *bang_size[] = { "?", "b", "h", "?", "", "?", "?", "?", "d" };
1143   static const char *fmods[] = { "trunc", "round", "ceil", "floor", "default" };
1144   static const char *sizes[] = { "byte", "word", "dword", "qword" };
1140   static const char *const conditions[] = { "z", "nz", "s", "ns", "c", "nc", "v", "nv", "u", "nu", "a", "be", "g", "le", "l", "ge" };
1141   static const char *const pound_size[] = { "?", "?", "?", "?", "s", "?", "?", "?", "d" };
1142   static const char *const bang_size[] = { "?", "b", "h", "?", "", "?", "?", "?", "d" };
1143   static const char *const fmods[] = { "trunc", "round", "ceil", "floor", "default" };
1144   static const char *const sizes[] = { "byte", "word", "dword", "qword" };
11451145   const drcuml_opcode_info *opinfo = opcode_info_table[inst->opcode];
11461146   char *dest = buffer;
11471147   const char *opsrc;
src/emu/cpu/drcbex64.c
r3232r3233
173173#include "drcuml.h"
174174#include "drcbeut.h"
175175#include "debugger.h"
176#include "deprecat.h"
176177#include "x86emit.h"
177178#include "eminline.h"
178179#undef REG_SP
r3232r3233
339340static const UINT64 size_to_mask[] = { 0, 0xff, 0xffff, 0, 0xffffffff, 0, 0, 0, U64(0xffffffffffffffff) };
340341
341342/* register mapping tables */
342static UINT8 int_register_map[DRCUML_REG_I_END - DRCUML_REG_I0] =
343static const UINT8 int_register_map[DRCUML_REG_I_END - DRCUML_REG_I0] =
343344{
344345#ifdef X64_WINDOWS_ABI
345346   REG_RBX, REG_RSI, REG_RDI, REG_R12, REG_R13, REG_R14, REG_R15
r3232r3233
354355};
355356
356357/* condition mapping table */
357static UINT8 condition_map[DRCUML_COND_MAX - DRCUML_COND_Z] =
358static const UINT8 condition_map[DRCUML_COND_MAX - DRCUML_COND_Z] =
358359{
359360   COND_Z,      /* DRCUML_COND_Z = 0x80,    requires Z */
360361   COND_NZ,   /* DRCUML_COND_NZ,          requires Z */
src/emu/cpu/jaguar/jaguar.c
r3232r3233
116116static jaguar_regs   jaguar;
117117static UINT16 *      mirror_table;
118118static UINT8 *      condition_table;
119static int         executing_cpu = -1;
119static int         executing_cpu;
120120
121121static const UINT32 convert_zero[32] =
122122{ 32,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 };
r3232r3233
460460{
461461   init_tables();
462462
463   executing_cpu = -1;
463464   jaguar.b0 = jaguar.r;
464465   jaguar.b1 = jaguar.a;
465466
src/emu/cpu/i8085/i8085.h
r3232r3233
88   I8085_PC=1, I8085_SP, I8085_AF ,I8085_BC, I8085_DE, I8085_HL,
99   I8085_HALT, I8085_IM, I8085_IREQ, I8085_ISRV, I8085_VECTOR,
1010   I8085_TRAP_STATE, I8085_INTR_STATE,
11   I8085_RST55_STATE, I8085_RST65_STATE, I8085_RST75_STATE
11   I8085_RST55_STATE, I8085_RST65_STATE, I8085_RST75_STATE, I8085_STATUS
1212};
1313
1414enum
r3232r3233
4141#define I8080_VECTOR         I8085_VECTOR
4242#define I8080_TRAP_STATE      I8085_TRAP_STATE
4343#define I8080_INTR_STATE      I8085_INTR_STATE
44
44#define I8080_STATUS         I8085_STATUS
4545#define I8080_REG_LAYOUT \
4646{   CPU_8080, \
4747   I8080_AF,I8080_BC,I8080_DE,I8080_HL,I8080_SP,I8080_PC, DBG_ROW, \
48   I8080_HALT,I8080_IREQ,I8080_ISRV,I8080_VECTOR, \
48   I8080_HALT,I8080_IREQ,I8080_ISRV,I8080_VECTOR, I8080_STATUS, \
4949    DBG_END }
5050
5151#define I8080_INTR_LINE         I8085_INTR_LINE
src/emu/cpu/i8085/i8085cpu.h
r3232r3233
4141#define M_DCR(R) {UINT8 hc = ((R & 0x0f) == 0x00) ? HF : 0; --R; I.AF.b.l= (I.AF.b.l & CF ) | ZSP[R] | hc | NF; }
4242#define M_MVI(R) R=ARG()
4343
44#define M_ANA(R) { int i = ((I.AF.b.h | R)>>3)&1 * HF; I.AF.b.h&=R; I.AF.b.l=ZSP[I.AF.b.h]; if( I.cputype ) { I.AF.b.l |= HF; } else {I.AF.b.l |= i; } }
44#define M_ANA(R) { int i = (((I.AF.b.h | R)>>3) & 1)*HF; I.AF.b.h&=R; I.AF.b.l=ZSP[I.AF.b.h]; if( I.cputype ) { I.AF.b.l |= HF; } else {I.AF.b.l |= i; } }
4545#define M_ORA(R) I.AF.b.h|=R; I.AF.b.l=ZSP[I.AF.b.h]
4646#define M_XRA(R) I.AF.b.h^=R; I.AF.b.l=ZSP[I.AF.b.h]
4747
r3232r3233
107107}
108108
109109#define M_IN                                       \
110   I.STATUS = 0x42;                                  \
110111   I.XX.d=ARG();                                    \
111112   I.AF.b.h=io_read_byte_8le(I.XX.d);
112113
113114#define M_OUT                                       \
115   I.STATUS = 0x10;                                  \
114116   I.XX.d=ARG();                                    \
115117   io_write_byte_8le(I.XX.d,I.AF.b.h)
116118
r3232r3233
123125}
124126
125127#define M_PUSH(R) {                                             \
126   WM(--I.SP.w.l, I.R.b.h);                           \
127   WM(--I.SP.w.l, I.R.b.l);                           \
128   I.STATUS = 0x04;                                  \
129   program_write_byte_8le(--I.SP.w.l, I.R.b.h);                           \
130   program_write_byte_8le(--I.SP.w.l, I.R.b.l);                           \
128131}
129132
130133#define M_POP(R) {                                    \
131   I.R.b.l = RM(I.SP.w.l++);                           \
132   I.R.b.h = RM(I.SP.w.l++);                           \
134   I.STATUS = 0x86;                                 \
135   I.R.b.l = program_read_byte_8le(I.SP.w.l++);                           \
136   I.R.b.h = program_read_byte_8le(I.SP.w.l++);                           \
133137}
134138
135139#define M_RET(cc)                                    \
src/emu/cpu/i8085/i8085.c
r3232r3233
146146   UINT32   INTR;      /* vector for INTR */
147147   UINT32   IRQ2;      /* scheduled interrupt address */
148148   UINT32   IRQ1;      /* executed interrupt address */
149   UINT8   STATUS;      /* status word */
149150   INT8   irq_state[4];
150151   int    (*irq_callback)(int);
151152   void   (*sod_callback)(int state);
r3232r3233
160161static UINT8 RIM_IEN = 0; //AT: IEN status latch used by the RIM instruction
161162static UINT8 ROP(void)
162163{
164   I.STATUS = 0xa2; // instruction fetch
163165   return cpu_readop(I.PC.w.l++);
164166}
165167
r3232r3233
180182
181183static UINT8 RM(UINT32 a)
182184{
185   I.STATUS = 0x82; // memory read
183186   return program_read_byte_8le(a);
184187}
185188
186189static void WM(UINT32 a, UINT8 v)
187190{
191   I.STATUS = 0x00; // memory write
188192   program_write_byte_8le(a, v);
189193}
190194
r3232r3233
684688      case 0x76: i8085_ICount -= (I.cputype) ? 5 : 7;   /* HLT */
685689         I.PC.w.l--;
686690         I.HALT = 1;
691         I.STATUS = 0x8a; // halt acknowledge
687692         if (i8085_ICount > 0) i8085_ICount = 0;
688693         break;
689694      case 0x77: i8085_ICount -= 7;   /* MOV  M,A */
r3232r3233
12161221         M_RST(7);
12171222         break;
12181223   }
1224   /* For 8080 NF flag is not used but bit is always set */
1225   if(!I.cputype ) {
1226      I.AF.b.l = I.AF.b.l | NF;
1227   }
12191228}
12201229
12211230static void Interrupt(void)
r3232r3233
12251234   {
12261235      I.PC.w.l++;    /* skip HALT instr */
12271236      I.HALT = 0;
1237      I.STATUS = 0x26; // int ack while halt
1238   } else {
1239      I.STATUS = 0x23; // int ack
12281240   }
12291241//AT
12301242   I.IREQ &= ~I.ISRV; // remove serviced IRQ flag
r3232r3233
13671379   state_save_register_item("i8085", index, I.INTR);
13681380   state_save_register_item("i8085", index, I.IRQ2);
13691381   state_save_register_item("i8085", index, I.IRQ1);
1382   state_save_register_item("i8085", index, I.STATUS);
13701383   state_save_register_item_array("i8085", index, I.irq_state);
13711384}
13721385
r3232r3233
16011614   state_save_register_item("i8080", index, I.INTR);
16021615   state_save_register_item("i8080", index, I.IRQ2);
16031616   state_save_register_item("i8080", index, I.IRQ1);
1617   state_save_register_item("i8080", index, I.STATUS);
16041618   state_save_register_item_array("i8080", index, I.irq_state);
16051619}
16061620
r3232r3233
16571671      case CPUINFO_INT_REGISTER + I8085_IREQ:         I.IREQ = info->i;                  break;
16581672      case CPUINFO_INT_REGISTER + I8085_ISRV:         I.ISRV = info->i;                  break;
16591673      case CPUINFO_INT_REGISTER + I8085_VECTOR:      I.INTR = info->i;                  break;
1674      case CPUINFO_INT_REGISTER + I8085_STATUS:      I.STATUS = info->i;                  break;
16601675
16611676      case CPUINFO_INT_I8085_SID:                  if (info->i) I.IM |= IM_SID; else I.IM &= ~IM_SID; break;
16621677
r3232r3233
17191734      case CPUINFO_INT_REGISTER + I8085_IREQ:         info->i = I.IREQ;                  break;
17201735      case CPUINFO_INT_REGISTER + I8085_ISRV:         info->i = I.ISRV;                  break;
17211736      case CPUINFO_INT_REGISTER + I8085_VECTOR:      info->i = I.INTR;                  break;
1737      case CPUINFO_INT_REGISTER + I8085_STATUS:      info->i = I.STATUS;                  break;
17221738
17231739      /* --- the following bits of info are returned as pointers to data or functions --- */
17241740      case CPUINFO_PTR_SET_INFO:                  info->setinfo = i8085_set_info;         break;
r3232r3233
17621778      case CPUINFO_STR_REGISTER + I8085_IREQ:         sprintf(info->s, "IREQ:%02X", I.IREQ);   break;
17631779      case CPUINFO_STR_REGISTER + I8085_ISRV:         sprintf(info->s, "ISRV:%02X", I.ISRV);   break;
17641780      case CPUINFO_STR_REGISTER + I8085_VECTOR:      sprintf(info->s, "VEC:%02X", I.INTR);   break;
1781      case CPUINFO_STR_REGISTER + I8085_STATUS:      sprintf(info->s, "SW:%02X", I.STATUS);   break;
17651782   }
17661783}
17671784
src/emu/cpu/powerpc/ppcdrc.c
r3232r3233
40374037
40384038static void log_register_list(drcuml_state *drcuml, const char *string, const UINT32 *reglist, const UINT32 *regnostarlist)
40394039{
4040   static const char *crtext[4] = { "lt", "gt", "eq", "so" };
4040   static const char *const crtext[4] = { "lt", "gt", "eq", "so" };
40414041   int count = 0;
40424042   int regnum;
40434043   int crnum;
src/emu/cpu/powerpc/drc_ops.c
r3232r3233
132132      address &= ~0x07;
133133   }
134134
135   result = (UINT32 *) memory_get_op_ptr(cpu_getactivecpu(), address, 0);
135   result = (UINT32 *) memory_get_op_ptr(Machine, cpu_getactivecpu(), address, 0);
136136   if (result)
137137      result += offset;
138138   return result;
src/emu/cpu/drcbex86.c
r3232r3233
239239static const UINT64 size_to_mask[] = { 0, 0xff, 0xffff, 0, 0xffffffff, 0, 0, 0, U64(0xffffffffffffffff) };
240240
241241/* register mapping tables */
242static UINT8 int_register_map[DRCUML_REG_I_END - DRCUML_REG_I0] =
242static const UINT8 int_register_map[DRCUML_REG_I_END - DRCUML_REG_I0] =
243243{
244244   REG_EBX, REG_ESI, REG_EDI, REG_EBP
245245};
r3232r3233
249249static UINT32 flags_unmap[0x20];
250250
251251/* condition mapping table */
252static UINT8 condition_map[DRCUML_COND_MAX - DRCUML_COND_Z] =
252static const UINT8 condition_map[DRCUML_COND_MAX - DRCUML_COND_Z] =
253253{
254254   COND_Z,      /* DRCUML_COND_Z = 0x80,    requires Z */
255255   COND_NZ,   /* DRCUML_COND_NZ,          requires Z */
src/emu/streams.c
r3232r3233
565565    tag and index
566566-------------------------------------------------*/
567567
568sound_stream *stream_find_by_tag(void *streamtag, int streamindex)
568sound_stream *stream_find_by_tag(running_machine *machine, void *streamtag, int streamindex)
569569{
570   streams_private *strdata = Machine->streams_data;
570   streams_private *strdata = machine->streams_data;
571571   sound_stream *stream;
572572
573573   /* scan the list looking for the nth stream that matches the tag */
src/emu/uigfx.c
r3232r3233
1515#include "rendfont.h"
1616#include "rendutil.h"
1717#include "uigfx.h"
18#include "deprecat.h"
1918
2019
2120
r3232r3233
8483
8584/* graphics set handling */
8685static void gfxset_handle_keys(running_machine *machine, ui_gfx_state *state, int xcells, int ycells);
87static void gfxset_draw_item(const gfx_element *gfx, int index, bitmap_t *bitmap, int dstx, int dsty, int color, int rotate);
88static void gfxset_update_bitmap(ui_gfx_state *state, int xcells, int ycells, gfx_element *gfx);
86static void gfxset_draw_item(running_machine *machine, const gfx_element *gfx, int index, bitmap_t *bitmap, int dstx, int dsty, int color, int rotate);
87static void gfxset_update_bitmap(running_machine *machine, ui_gfx_state *state, int xcells, int ycells, gfx_element *gfx);
8988static void gfxset_handler(running_machine *machine, ui_gfx_state *state);
9089
9190/* tilemap handling */
9291static void tilemap_handle_keys(running_machine *machine, ui_gfx_state *state, int viswidth, int visheight);
93static void tilemap_update_bitmap(ui_gfx_state *state, int width, int height);
92static void tilemap_update_bitmap(running_machine *machine, ui_gfx_state *state, int width, int height);
9493static void tilemap_handler(running_machine *machine, ui_gfx_state *state);
9594
9695
r3232r3233
570569      }
571570
572571   /* update the bitmap */
573   gfxset_update_bitmap(state, xcells, ycells, gfx);
572   gfxset_update_bitmap(machine, state, xcells, ycells, gfx);
574573
575574   /* add the final quad */
576575   render_ui_add_quad(boxbounds.x0 + 6.0f * chwidth, boxbounds.y0 + 3.5f * chheight,
r3232r3233
681680    graphics view bitmap
682681-------------------------------------------------*/
683682
684static void gfxset_update_bitmap(ui_gfx_state *state, int xcells, int ycells, gfx_element *gfx)
683static void gfxset_update_bitmap(running_machine *machine, ui_gfx_state *state, int xcells, int ycells, gfx_element *gfx)
685684{
686685   int set = state->gfxset.set;
687686   int cellxpix, cellypix;
r3232r3233
737736
738737               /* only render if there is data */
739738               if (index < gfx->total_elements)
740                  gfxset_draw_item(gfx, index, state->bitmap, cellbounds.min_x, cellbounds.min_y, state->gfxset.color[set], state->gfxset.rotate[set]);
739                  gfxset_draw_item(machine, gfx, index, state->bitmap, cellbounds.min_x, cellbounds.min_y, state->gfxset.color[set], state->gfxset.rotate[set]);
741740
742741               /* otherwise, fill with transparency */
743742               else
r3232r3233
762761    the view
763762-------------------------------------------------*/
764763
765static void gfxset_draw_item(const gfx_element *gfx, int index, bitmap_t *bitmap, int dstx, int dsty, int color, int rotate)
764static void gfxset_draw_item(running_machine *machine, const gfx_element *gfx, int index, bitmap_t *bitmap, int dstx, int dsty, int color, int rotate)
766765{
767766   static const pen_t default_palette[] =
768767   {
r3232r3233
771770   };
772771   int width = (rotate & ORIENTATION_SWAP_XY) ? gfx->height : gfx->width;
773772   int height = (rotate & ORIENTATION_SWAP_XY) ? gfx->width : gfx->height;
774   const rgb_t *palette = (Machine->config->total_colors != 0) ? palette_entry_list_raw(Machine->palette) : NULL;
773   const rgb_t *palette = (machine->config->total_colors != 0) ? palette_entry_list_raw(machine->palette) : NULL;
775774   UINT32 rowpixels = bitmap->rowpixels;
776775   UINT32 palette_mask = ~0;
777776   int x, y;
r3232r3233
931930   }
932931
933932   /* update the bitmap */
934   tilemap_update_bitmap(state, mapboxwidth / pixelscale, mapboxheight / pixelscale);
933   tilemap_update_bitmap(machine, state, mapboxwidth / pixelscale, mapboxheight / pixelscale);
935934
936935   /* add the final quad */
937936   render_ui_add_quad(mapboxbounds.x0, mapboxbounds.y0,
r3232r3233
10321031    for the tilemap view
10331032-------------------------------------------------*/
10341033
1035static void tilemap_update_bitmap(ui_gfx_state *state, int width, int height)
1034static void tilemap_update_bitmap(running_machine *machine, ui_gfx_state *state, int width, int height)
10361035{
1037   bitmap_format screen_format = video_screen_get_format(Machine->primary_screen);
1036   bitmap_format screen_format = video_screen_get_format(machine->primary_screen);
10381037   int screen_texformat;
10391038
10401039   /* convert the screen format to a texture format */
src/emu/streams.h
r3232r3233
7878/* ----- stream information and control ----- */
7979
8080/* find a stream using a tag and index */
81sound_stream *stream_find_by_tag(void *streamtag, int streamindex);
81sound_stream *stream_find_by_tag(running_machine *machine, void *streamtag, int streamindex);
8282
8383/* return the number of inputs for a given stream */
8484int stream_get_inputs(sound_stream *stream);
src/emu/video/cdp1869.c
r3232r3233
839839   state_save_register_item(unique_tag, 0, cdp1869->toneamp);
840840   state_save_register_item(unique_tag, 0, cdp1869->wnfreq);
841841   state_save_register_item(unique_tag, 0, cdp1869->wnamp);
842
843   return DEVICE_START_OK;
842844}
843845
844846static DEVICE_SET_INFO( cdp1869 )
src/emu/video/voodoo.c
r3232r3233
46164616
46174617   /* register for save states */
46184618   init_save_state(device);
4619
4620   return DEVICE_START_OK;
46194621}
46204622
46214623
src/emu/video/mc6845.c
r3232r3233
675675
676676
677677/* device interface */
678static void common_start(const device_config *device, int device_type)
678static device_start_err common_start(const device_config *device, int device_type)
679679{
680680   mc6845_t *mc6845 = get_safe_token(device);
681681   char unique_tag[30];
r3232r3233
746746   state_save_register_item(unique_tag, 0, mc6845->light_pen_latched);
747747   state_save_register_item(unique_tag, 0, mc6845->cursor_state);
748748   state_save_register_item(unique_tag, 0, mc6845->cursor_blink_count);
749
750   return DEVICE_START_OK;
749751}
750752
751753static DEVICE_START( mc6845 )
752754{
753   common_start(device, TYPE_MC6845);
755   return common_start(device, TYPE_MC6845);
754756}
755757
756758static DEVICE_START( mc6845_1 )
757759{
758   common_start(device, TYPE_MC6845_1);
760   return common_start(device, TYPE_MC6845_1);
759761}
760762
761763static DEVICE_START( c6545_1 )
762764{
763   common_start(device, TYPE_C6545_1);
765   return common_start(device, TYPE_C6545_1);
764766}
765767
766768static DEVICE_START( r6545_1 )
767769{
768   common_start(device, TYPE_R6545_1);
770   return common_start(device, TYPE_R6545_1);
769771}
770772
771773static DEVICE_START( h46505 )
772774{
773   common_start(device, TYPE_H46505);
775   return common_start(device, TYPE_H46505);
774776}
775777
776778static DEVICE_START( hd6845 )
777779{
778   common_start(device, TYPE_HD6845);
780   return common_start(device, TYPE_HD6845);
779781}
780782
781783static DEVICE_START( sy6545_1 )
782784{
783   common_start(device, TYPE_SY6545_1);
785   return common_start(device, TYPE_SY6545_1);
784786}
785787
786788
src/emu/info.c
r3232r3233
357357    the XML output
358358-------------------------------------------------*/
359359
360static void print_game_rom(FILE *out, const game_driver *game)
360static void print_game_rom(FILE *out, const game_driver *game, const machine_config *config)
361361{
362362   const game_driver *clone_of = driver_get_clone(game);
363363   int rom_type;
364364
365   /* if no roms, just exit early */
366   if (game->rom == NULL)
367      return;
368
369365   /* iterate over 3 different ROM "types": BIOS, ROMs, DISKs */
370366   for (rom_type = 0; rom_type < 3; rom_type++)
371367   {
368      const rom_source *source;
372369      const rom_entry *region;
373370
374      /* iterate first through regions */
375      for (region = rom_first_region(game); region != NULL; region = rom_next_region(region))
376      {
377         int is_disk = ROMREGION_ISDISKDATA(region);
378         const rom_entry *rom;
379
380         /* disk regions only work for disks */
381         if ((is_disk && rom_type != 2) || (!is_disk && rom_type == 2))
382            continue;
383
384         /* iterate through ROM entries */
385         for (rom = rom_first_file(region); rom != NULL; rom = rom_next_file(rom))
371      /* iterate over ROM sources: first the game, then any devices */
372      for (source = rom_first_source(game, config); source != NULL; source = rom_next_source(game, config, source))
373         for (region = rom_first_region(game, source); region != NULL; region = rom_next_region(region))
386374         {
387            int is_bios = ROM_GETBIOSFLAGS(rom);
388            const char *name = ROM_GETNAME(rom);
389            int offset = ROM_GETOFFSET(rom);
390            const rom_entry *parent_rom = NULL;
391            const rom_entry *chunk;
392            char bios_name[100];
393            int length;
375            int is_disk = ROMREGION_ISDISKDATA(region);
376            const rom_entry *rom;
394377
395            /* BIOS ROMs only apply to bioses */
396            if ((is_bios && rom_type != 0) || (!is_bios && rom_type == 0))
378            /* disk regions only work for disks */
379            if ((is_disk && rom_type != 2) || (!is_disk && rom_type == 2))
397380               continue;
398381
399            /* compute the total length of all chunks */
400            length = 0;
401            for (chunk = rom_first_chunk(rom); chunk; chunk = rom_next_chunk(chunk))
402               length += ROM_GETLENGTH(chunk);
403
404            /* if we have a valid ROM and we are a clone, see if we can find the parent ROM */
405            if (!ROM_NOGOODDUMP(rom) && clone_of != NULL)
382            /* iterate through ROM entries */
383            for (rom = rom_first_file(region); rom != NULL; rom = rom_next_file(rom))
406384            {
407               const rom_entry *pregion, *prom;
385               int is_bios = ROM_GETBIOSFLAGS(rom);
386               const char *name = ROM_GETNAME(rom);
387               int offset = ROM_GETOFFSET(rom);
388               const rom_entry *parent_rom = NULL;
389               const rom_entry *chunk;
390               char bios_name[100];
391               int length;
408392
409               /* scan the clone_of ROM for a matching ROM entry */
410               for (pregion = rom_first_region(clone_of); pregion != NULL; pregion = rom_next_region(pregion))
411                  for (prom = rom_first_file(pregion); prom != NULL; prom = rom_next_file(prom))
412                     if (hash_data_is_equal(ROM_GETHASHDATA(rom), ROM_GETHASHDATA(prom), 0))
393               /* BIOS ROMs only apply to bioses */
394               if ((is_bios && rom_type != 0) || (!is_bios && rom_type == 0))
395                  continue;
396
397               /* compute the total length of all chunks */
398               length = 0;
399               for (chunk = rom_first_chunk(rom); chunk; chunk = rom_next_chunk(chunk))
400                  length += ROM_GETLENGTH(chunk);
401
402               /* if we have a valid ROM and we are a clone, see if we can find the parent ROM */
403               if (!ROM_NOGOODDUMP(rom) && clone_of != NULL)
404               {
405                  const rom_entry *pregion, *prom;
406
407                  /* scan the clone_of ROM for a matching ROM entry */
408                  for (pregion = rom_first_region(clone_of, NULL); pregion != NULL; pregion = rom_next_region(pregion))
409                     for (prom = rom_first_file(pregion); prom != NULL; prom = rom_next_file(prom))
410                        if (hash_data_is_equal(ROM_GETHASHDATA(rom), ROM_GETHASHDATA(prom), 0))
411                        {
412                           parent_rom = prom;
413                           break;
414                        }
415               }
416
417               /* scan for a BIOS name */
418               bios_name[0] = 0;
419               if (!is_disk && is_bios)
420               {
421                  const rom_entry *brom;
422
423                  /* scan backwards through the ROM entries */
424                  for (brom = rom - 1; brom != game->rom; brom--)
425                     if (ROMENTRY_ISSYSTEM_BIOS(brom))
413426                     {
414                        parent_rom = prom;
427                        strcpy(bios_name, ROM_GETNAME(brom));
415428                        break;
416429                     }
417            }
430               }
418431
419            /* scan for a BIOS name */
420            bios_name[0] = 0;
421            if (!is_disk && is_bios)
422            {
423               const rom_entry *brom;
432               /* opening tag */
433               if (!is_disk)
434                  fprintf(out, "\t\t<rom");
435               else
436                  fprintf(out, "\t\t<disk");
424437
425               /* scan backwards through the ROM entries */
426               for (brom = rom - 1; brom != game->rom; brom--)
427                  if (ROMENTRY_ISSYSTEM_BIOS(brom))
428                  {
429                     strcpy(bios_name, ROM_GETNAME(brom));
430                     break;
431                  }
432            }
438               /* add name, merge, bios, and size tags */
439               if (name != NULL && name[0] != 0)
440                  fprintf(out, " name=\"%s\"", xml_normalize_string(name));
441               if (parent_rom != NULL)
442                  fprintf(out, " merge=\"%s\"", xml_normalize_string(ROM_GETNAME(parent_rom)));
443               if (bios_name[0] != 0)
444                  fprintf(out, " bios=\"%s\"", xml_normalize_string(bios_name));
445               if (!is_disk)
446                  fprintf(out, " size=\"%d\"", length);
433447
434            /* opening tag */
435            if (!is_disk)
436               fprintf(out, "\t\t<rom");
437            else
438               fprintf(out, "\t\t<disk");
448               /* dump checksum information only if there is a known dump */
449               if (!hash_data_has_info(ROM_GETHASHDATA(rom), HASH_INFO_NO_DUMP))
450               {
451                  char checksum[HASH_BUF_SIZE];
452                  int hashtype;
439453
440            /* add name, merge, bios, and size tags */
441            if (name != NULL && name[0] != 0)
442               fprintf(out, " name=\"%s\"", xml_normalize_string(name));
443            if (parent_rom != NULL)
444               fprintf(out, " merge=\"%s\"", xml_normalize_string(ROM_GETNAME(parent_rom)));
445            if (bios_name[0] != 0)
446               fprintf(out, " bios=\"%s\"", xml_normalize_string(bios_name));
447            if (!is_disk)
448               fprintf(out, " size=\"%d\"", length);
454                  /* iterate over hash function types and print out their values */
455                  for (hashtype = 0; hashtype < HASH_NUM_FUNCTIONS; hashtype++)
456                     if (hash_data_extract_printable_checksum(ROM_GETHASHDATA(rom), 1 << hashtype, checksum))
457                        fprintf(out, " %s=\"%s\"", hash_function_name(1 << hashtype), checksum);
458               }
449459
450            /* dump checksum information only if there is a known dump */
451            if (!hash_data_has_info(ROM_GETHASHDATA(rom), HASH_INFO_NO_DUMP))
452            {
453               char checksum[HASH_BUF_SIZE];
454               int hashtype;
460               /* append a region name */
461               fprintf(out, " region=\"%s\"", ROMREGION_GETTAG(region));
455462
456               /* iterate over hash function types and print out their values */
457               for (hashtype = 0; hashtype < HASH_NUM_FUNCTIONS; hashtype++)
458                  if (hash_data_extract_printable_checksum(ROM_GETHASHDATA(rom), 1 << hashtype, checksum))
459                     fprintf(out, " %s=\"%s\"", hash_function_name(1 << hashtype), checksum);
460            }
463               /* add nodump/baddump flags */
464               if (hash_data_has_info(ROM_GETHASHDATA(rom), HASH_INFO_NO_DUMP))
465                  fprintf(out, " status=\"nodump\"");
466               if (hash_data_has_info(ROM_GETHASHDATA(rom), HASH_INFO_BAD_DUMP))
467                  fprintf(out, " status=\"baddump\"");
461468
462            /* append a region name */
463            fprintf(out, " region=\"%s\"", ROMREGION_GETTAG(region));
469               /* for non-disk entries, print dispose flag and offset */
470               if (!is_disk)
471               {
472                  if (ROMREGION_GETFLAGS(region) & ROMREGION_DISPOSE)
473                     fprintf(out, " dispose=\"yes\"");
474                  fprintf(out, " offset=\"%x\"", offset);
475               }
464476
465            /* add nodump/baddump flags */
466            if (hash_data_has_info(ROM_GETHASHDATA(rom), HASH_INFO_NO_DUMP))
467               fprintf(out, " status=\"nodump\"");
468            if (hash_data_has_info(ROM_GETHASHDATA(rom), HASH_INFO_BAD_DUMP))
469               fprintf(out, " status=\"baddump\"");
470
471            /* for non-disk entries, print dispose flag and offset */
472            if (!is_disk)
473            {
474               if (ROMREGION_GETFLAGS(region) & ROMREGION_DISPOSE)
475                  fprintf(out, " dispose=\"yes\"");
476               fprintf(out, " offset=\"%x\"", offset);
477               /* for disk entries, add the disk index */
478               else
479                  fprintf(out, " index=\"%x\"", DISK_GETINDEX(rom));
480               fprintf(out, "/>\n");
477481            }
478
479            /* for disk entries, add the disk index */
480            else
481               fprintf(out, " index=\"%x\"", DISK_GETINDEX(rom));
482            fprintf(out, "/>\n");
483482         }
484      }
485483   }
486484}
487485
r3232r3233
843841
844842   /* now print various additional information */
845843   print_game_bios(out, game);
846   print_game_rom(out, game);
844   print_game_rom(out, game, config);
847845   print_game_sample(out, game, config);
848846   print_game_chips(out, game, config);
849847   print_game_display(out, game, config);
src/emu/uiinput.c
r3232r3233
4747   render_target *            current_mouse_target;
4848   INT32                  current_mouse_x;
4949   INT32                  current_mouse_y;
50   int                     current_mouse_down;
5051
5152   /* popped states; ring buffer of ui_events */
5253   ui_event               events[EVENT_QUEUE_SIZE];
r3232r3233
143144         }
144145         break;
145146
147      case UI_EVENT_MOUSE_DOWN:
148         uidata->current_mouse_down = TRUE;
149         break;
150
151      case UI_EVENT_MOUSE_UP:
152         uidata->current_mouse_down = FALSE;
153         break;
154
146155      default:
147156         /* do nothing */
148157         break;
r3232r3233
207216    location of the mouse
208217-------------------------------------------------*/
209218
210render_target *ui_input_find_mouse(running_machine *machine, INT32 *x, INT32 *y)
219render_target *ui_input_find_mouse(running_machine *machine, INT32 *x, INT32 *y, int *button)
211220{
212221   ui_input_private *uidata = machine->ui_input_data;
213222   if (x != NULL)
214223      *x = uidata->current_mouse_x;
215224   if (y != NULL)
216225      *y = uidata->current_mouse_y;
226   if (button != NULL)
227      *button = uidata->current_mouse_down;
217228   return uidata->current_mouse_target;
218229}
219230
src/emu/watchdog.c
r3232r3233
8787    timers
8888-------------------------------------------------*/
8989
90static void on_vblank(const device_config *screen, int vblank_state)
90static void on_vblank(const device_config *screen, void *param, int vblank_state)
9191{
9292   /* VBLANK starting */
9393   if (vblank_state && watchdog_enabled)
r3232r3233
121121
122122      /* register a VBLANK callback for the primary screen */
123123      if (machine->primary_screen != NULL)
124         video_screen_register_vblank_callback(machine->primary_screen, on_vblank);
124         video_screen_register_vblank_callback(machine->primary_screen, on_vblank, NULL);
125125   }
126126
127127   /* timer-based watchdog? */
src/emu/uiinput.h
r3232r3233
2828   UI_EVENT_NONE,
2929   UI_EVENT_MOUSE_MOVE,
3030   UI_EVENT_MOUSE_LEAVE,
31   UI_EVENT_MOUSE_CLICK,
31   UI_EVENT_MOUSE_DOWN,
32   UI_EVENT_MOUSE_UP,
3233   UI_EVENT_MOUSE_DOUBLE_CLICK,
3334   UI_EVENT_CHAR
3435};
r3232r3233
7273void ui_input_reset(running_machine *machine);
7374
7475/* retrieves the current location of the mouse */
75render_target *ui_input_find_mouse(running_machine *machine, INT32 *x, INT32 *y);
76render_target *ui_input_find_mouse(running_machine *machine, INT32 *x, INT32 *y, int *button);
7677
7778
7879
r3232r3233
122123
123124
124125/*-------------------------------------------------
125    ui_input_push_mouse_click_event - pushes a mouse
126    click event to the specified render_target
126    ui_input_push_mouse_down_event - pushes a mouse
127    down event to the specified render_target
127128-------------------------------------------------*/
128129
129INLINE void ui_input_push_mouse_click_event(running_machine *machine, render_target *target, INT32 x, INT32 y)
130INLINE void ui_input_push_mouse_down_event(running_machine *machine, render_target *target, INT32 x, INT32 y)
130131{
131132   ui_event event = { UI_EVENT_NONE };
132   event.event_type = UI_EVENT_MOUSE_CLICK;
133   event.event_type = UI_EVENT_MOUSE_DOWN;
133134   event.target = target;
134135   event.mouse_x = x;
135136   event.mouse_y = y;
r3232r3233
138139
139140
140141/*-------------------------------------------------
142    ui_input_push_mouse_down_event - pushes a mouse
143    down event to the specified render_target
144-------------------------------------------------*/
145
146INLINE void ui_input_push_mouse_up_event(running_machine *machine, render_target *target, INT32 x, INT32 y)
147{
148   ui_event event = { UI_EVENT_NONE };
149   event.event_type = UI_EVENT_MOUSE_UP;
150   event.target = target;
151   event.mouse_x = x;
152   event.mouse_y = y;
153   ui_input_push_event(machine, event);
154}
155
156
157/*-------------------------------------------------
141158    ui_input_push_mouse_double_click_event - pushes
142159    a mouse double-click event to the specified
143160    render_target
src/emu/uimenu.c
r3232r3233
1515#include "uiinput.h"
1616#include "uimenu.h"
1717#include "audit.h"
18#include "deprecat.h"
1918#include "eminline.h"
2019
2120#ifdef MESS
r3232r3233
240239static void ui_menu_exit(running_machine *machine);
241240
242241/* internal menu processing */
243static void ui_menu_draw(ui_menu *menu, int customonly);
242static void ui_menu_draw(running_machine *machine, ui_menu *menu, int customonly);
244243static void ui_menu_draw_text_box(ui_menu *menu);
245244static void ui_menu_handle_events(ui_menu *menu);
246245static void ui_menu_handle_keys(ui_menu *menu, UINT32 flags);
r3232r3233
569568    and returning any interesting events
570569-------------------------------------------------*/
571570
572const ui_menu_event *ui_menu_process(ui_menu *menu, UINT32 flags)
571const ui_menu_event *ui_menu_process(running_machine *machine, ui_menu *menu, UINT32 flags)
573572{
574573   /* reset the event */
575574   menu->event.iptkey = IPT_INVALID;
r3232r3233
581580   if (menu->numitems > 1 && (menu->item[0].flags & MENU_FLAG_MULTILINE) != 0)
582581      ui_menu_draw_text_box(menu);
583582   else
584      ui_menu_draw(menu, (flags & UI_MENU_PROCESS_CUSTOM_ONLY) != 0);
583      ui_menu_draw(machine, menu, (flags & UI_MENU_PROCESS_CUSTOM_ONLY) != 0);
585584
586585   /* process input */
587586   if (!(flags & UI_MENU_PROCESS_NOKEYS))
r3232r3233
721720    ui_menu_draw - draw a menu
722721-------------------------------------------------*/
723722
724static void ui_menu_draw(ui_menu *menu, int customonly)
723static void ui_menu_draw(running_machine *machine, ui_menu *menu, int customonly)
725724{
726725   float line_height = ui_get_line_height();
727726   float lr_arrow_width = 0.4f * line_height * render_get_ui_aspect();
r3232r3233
737736   int visible_lines;
738737   int top_line;
739738   int itemnum, linenum;
740   int mouse_hit;
739   int mouse_hit, mouse_button;
741740   render_target *mouse_target;
742741   INT32 mouse_target_x, mouse_target_y;
743742   float mouse_x = -1, mouse_y = -1;
r3232r3233
811810
812811   /* locate mouse */
813812   mouse_hit = FALSE;
813   mouse_button = FALSE;
814814   if (!customonly)
815815   {
816      mouse_target = ui_input_find_mouse(Machine, &mouse_target_x, &mouse_target_y);
816      mouse_target = ui_input_find_mouse(machine, &mouse_target_x, &mouse_target_y, &mouse_button);
817817      if (mouse_target != NULL)
818818         if (render_target_map_point_container(mouse_target, mouse_target_x, mouse_target_y, render_container_get_ui(), &mouse_x, &mouse_y))
819819            mouse_hit = TRUE;
r3232r3233
847847         }
848848
849849         /* else if the mouse is over this item, draw with a different background */
850         else if (menu->hover == itemnum)
850         else if (itemnum == menu->hover)
851851         {
852852            fgcolor = mouseover_fgcolor;
853853            bgcolor = mouseover_bgcolor;
r3232r3233
10671067      switch (event.event_type)
10681068      {
10691069         /* if we are hovering over a valid item, select it with a single click */
1070         case UI_EVENT_MOUSE_CLICK:
1070         case UI_EVENT_MOUSE_DOWN:
10711071            if (menu->hover >= 0 && menu->hover < menu->numitems)
10721072               menu->selected = menu->hover;
10731073            else if (menu->hover == -2)
r3232r3233
13581358    select menu to be visible and inescapable
13591359-------------------------------------------------*/
13601360
1361void ui_menu_force_game_select(void)
1361void ui_menu_force_game_select(running_machine *machine)
13621362{
13631363   char *gamename = (char *)options_get_string(mame_options(), OPTION_GAMENAME);
13641364
13651365   /* reset the menu stack */
1366   ui_menu_stack_reset(Machine);
1366   ui_menu_stack_reset(machine);
13671367
13681368   /* add the quit entry followed by the game select entry */
1369   ui_menu_stack_push(ui_menu_alloc(Machine, menu_quit_game, NULL));
1370   ui_menu_stack_push(ui_menu_alloc(Machine, menu_select_game, gamename));
1369   ui_menu_stack_push(ui_menu_alloc(machine, menu_quit_game, NULL));
1370   ui_menu_stack_push(ui_menu_alloc(machine, menu_select_game, gamename));
13711371
13721372   /* force the menus on */
13731373   ui_show_menu();
13741374
13751375   /* make sure MAME is paused */
1376   mame_pause(Machine, TRUE);
1376   mame_pause(machine, TRUE);
13771377}
13781378
13791379
r3232r3233
14131413      menu_main_populate(machine, menu, state);
14141414
14151415   /* process the menu */
1416   event = ui_menu_process(menu, 0);
1416   event = ui_menu_process(machine, menu, 0);
14171417   if (event != NULL && event->iptkey == IPT_UI_SELECT)
14181418      ui_menu_stack_push(ui_menu_alloc(machine, event->itemref, NULL));
14191419}
r3232r3233
15061506      menu_input_groups_populate(machine, menu, state);
15071507
15081508   /* process the menu */
1509   event = ui_menu_process(menu, 0);
1509   event = ui_menu_process(machine, menu, 0);
15101510   if (event != NULL && event->iptkey == IPT_UI_SELECT)
15111511      ui_menu_stack_push(ui_menu_alloc(machine, menu_input_general, event->itemref));
15121512}
r3232r3233
17061706   }
17071707
17081708   /* process the menu */
1709   event = ui_menu_process(menu, (menustate->pollingitem != NULL) ? UI_MENU_PROCESS_NOKEYS : 0);
1709   event = ui_menu_process(machine, menu, (menustate->pollingitem != NULL) ? UI_MENU_PROCESS_NOKEYS : 0);
17101710
17111711   /* if we are polling, handle as a special case */
17121712   if (menustate->pollingitem != NULL)
r3232r3233
19331933      menu_settings_populate(machine, menu, menustate, type);
19341934
19351935   /* process the menu */
1936   event = ui_menu_process(menu, 0);
1936   event = ui_menu_process(machine, menu, 0);
19371937
19381938   /* handle events */
19391939   if (event != NULL && event->itemref != NULL)
r3232r3233
21742174      menu_analog_populate(machine, menu);
21752175
21762176   /* process the menu */
2177   event = ui_menu_process(menu, UI_MENU_PROCESS_LR_REPEAT);
2177   event = ui_menu_process(machine, menu, UI_MENU_PROCESS_LR_REPEAT);
21782178
21792179   /* handle events */
21802180   if (event != NULL && event->itemref != NULL)
r3232r3233
23652365   }
23662366
23672367   /* process the menu */
2368   ui_menu_process(menu, 0);
2368   ui_menu_process(machine, menu, 0);
23692369}
23702370#endif
23712371
r3232r3233
24322432   }
24332433
24342434   /* process the menu */
2435   ui_menu_process(menu, 0);
2435   ui_menu_process(machine, menu, 0);
24362436}
24372437
24382438
r3232r3233
24492449      menu_cheat_populate(machine, menu);
24502450
24512451   /* process the menu */
2452   event = ui_menu_process(menu, UI_MENU_PROCESS_LR_REPEAT);
2452   event = ui_menu_process(machine, menu, UI_MENU_PROCESS_LR_REPEAT);
24532453
24542454   /* handle events */
24552455   if (event != NULL && event->itemref != NULL)
r3232r3233
24732473      {
24742474         switch (event->iptkey)
24752475         {
2476            /* if selected, reset to default value or activate a oneshot */
2476            /* if selected, activate a oneshot */
24772477            case IPT_UI_SELECT:
2478               changed = cheat_activate(machine, event->itemref);
2479               break;
2480
2481            /* if cleared, reset to default value */
2482            case IPT_UI_CLEAR:
24782483               changed = cheat_select_default_state(machine, event->itemref);
2479               changed |= cheat_activate(machine, event->itemref);
24802484               break;
24812485
24822486            /* left decrements */
r3232r3233
25442548      menu_memory_card_populate(machine, menu, *cardnum);
25452549
25462550   /* process the menu */
2547   event = ui_menu_process(menu, UI_MENU_PROCESS_LR_REPEAT);
2551   event = ui_menu_process(machine, menu, UI_MENU_PROCESS_LR_REPEAT);
25482552
25492553   /* if something was selected, act on it */
25502554   if (event != NULL && event->itemref != NULL)
r3232r3233
26492653      menu_sliders_populate(machine, menu);
26502654
26512655   /* process the menu */
2652   event = ui_menu_process(menu, UI_MENU_PROCESS_LR_REPEAT | (*hidden ? UI_MENU_PROCESS_CUSTOM_ONLY : 0));
2656   event = ui_menu_process(machine, menu, UI_MENU_PROCESS_LR_REPEAT | (*hidden ? UI_MENU_PROCESS_CUSTOM_ONLY : 0));
26532657   if (event != NULL)
26542658   {
26552659      /* handle keys if there is a valid item selected */
r3232r3233
28452849      menu_video_targets_populate(machine, menu);
28462850
28472851   /* process the menu */
2848   event = ui_menu_process(menu, 0);
2852   event = ui_menu_process(machine, menu, 0);
28492853   if (event != NULL && event->iptkey == IPT_UI_SELECT)
28502854      ui_menu_stack_push(ui_menu_alloc(machine, menu_video_options, event->itemref));
28512855}
r3232r3233
28932897      menu_video_options_populate(machine, menu, target);
28942898
28952899   /* process the menu */
2896   event = ui_menu_process(menu, 0);
2900   event = ui_menu_process(machine, menu, 0);
28972901   if (event != NULL && event->itemref != NULL)
28982902   {
28992903      switch ((FPTR)event->itemref)
r3232r3233
30443048   ui_input_pressed(machine, IPT_UI_PAUSE);
30453049
30463050   /* process the menu */
3047   event = ui_menu_process(menu, 0);
3051   event = ui_menu_process(machine, menu, 0);
30483052   if (event != NULL && event->itemref != NULL)
30493053   {
30503054      /* reset the error on any future event */
src/emu/audit.c
r3232r3233
2222    FUNCTION PROTOTYPES
2323***************************************************************************/
2424
25static int audit_one_rom(core_options *options, const rom_entry *rom, const game_driver *gamedrv, UINT32 validation, audit_record *record);
25static int audit_one_rom(core_options *options, const rom_entry *rom, const char *regiontag, const game_driver *gamedrv, UINT32 validation, audit_record *record);
2626static int 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
r3232r3233
5656
5757int audit_images(core_options *options, const game_driver *gamedrv, UINT32 validation, audit_record **audit)
5858{
59   machine_config *config = machine_config_alloc(gamedrv->machine_config);
5960   const rom_entry *region, *rom;
61   const rom_source *source;
6062   audit_record *record;
6163   int foundany = FALSE;
6264   int allshared = TRUE;
r3232r3233
6466
6567   /* determine the number of records we will generate */
6668   records = 0;
67   for (region = rom_first_region(gamedrv); region != NULL; region = rom_next_region(region))
68      for (rom = rom_first_file(region); rom != NULL; rom = rom_next_file(rom))
69         if (ROMREGION_ISROMDATA(region) || ROMREGION_ISDISKDATA(region))
70         {
71            if (allshared && !rom_used_by_parent(gamedrv, rom, NULL))
72               allshared = FALSE;
73            records++;
74         }
69   for (source = rom_first_source(gamedrv, config); source != NULL; source = rom_next_source(gamedrv, config, source))
70   {
71      int source_is_gamedrv = rom_source_is_gamedrv(gamedrv, source);
72      for (region = rom_first_region(gamedrv, source); region != NULL; region = rom_next_region(region))
73         for (rom = rom_first_file(region); rom != NULL; rom = rom_next_file(rom))
74            if (ROMREGION_ISROMDATA(region) || ROMREGION_ISDISKDATA(region))
75            {
76               if (source_is_gamedrv && allshared && !rom_used_by_parent(gamedrv, rom, NULL))
77                  allshared = FALSE;
78               records++;
79            }
80   }
7581
7682   if (records > 0)
7783   {
r3232r3233
8086      memset(*audit, 0, sizeof(**audit) * records);
8187      record = *audit;
8288
83      /* iterate over regions and ROMs */
84      for (region = rom_first_region(gamedrv); region; region = rom_next_region(region))
85         for (rom = rom_first_file(region); rom; rom = rom_next_file(rom))
89      /* iterate over ROM sources and regions */
90      for (source = rom_first_source(gamedrv, config); source != NULL; source = rom_next_source(gamedrv, config, source))
91      {
92         int source_is_gamedrv = rom_source_is_gamedrv(gamedrv, source);
93         for (region = rom_first_region(gamedrv, source); region != NULL; region = rom_next_region(region))
8694         {
87            int shared = rom_used_by_parent(gamedrv, rom, NULL);
88
89            /* audit a file */
90            if (ROMREGION_ISROMDATA(region))
95            const char *regiontag = ROMREGION_ISLOADBYNAME(region) ? ROM_GETNAME(region) : NULL;
96            for (rom = rom_first_file(region); rom; rom = rom_next_file(rom))
9197            {
92               if (audit_one_rom(options, rom, gamedrv, validation, record++) && (!shared || allshared))
93                  foundany = TRUE;
94            }
98               int shared = rom_used_by_parent(gamedrv, rom, NULL);
9599
96            /* audit a disk */
97            else if (ROMREGION_ISDISKDATA(region))
98            {
99               if (audit_one_disk(options, rom, gamedrv, validation, record++) && (!shared || allshared))
100                  foundany = TRUE;
100               /* audit a file */
101               if (ROMREGION_ISROMDATA(region))
102               {
103                  if (audit_one_rom(options, rom, regiontag, gamedrv, validation, record++) && source_is_gamedrv && (!shared || allshared))
104                     foundany = TRUE;
105               }
106
107               /* audit a disk */
108               else if (ROMREGION_ISDISKDATA(region))
109               {
110                  if (audit_one_disk(options, rom, gamedrv, validation, record++) && source_is_gamedrv && (!shared || allshared))
111                     foundany = TRUE;
112               }
101113            }
102114         }
103115
104      /* if we found nothing, we don't have the set at all */
105      if (!foundany)
106      {
107         free(*audit);
108         *audit = NULL;
109         records = 0;
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         }
110124      }
111125   }
126
127   machine_config_free(config);
112128   return records;
113129}
114130
r3232r3233
310326    audit_one_rom - validate a single ROM entry
311327-------------------------------------------------*/
312328
313static int audit_one_rom(core_options *options, const rom_entry *rom, const game_driver *gamedrv, UINT32 validation, audit_record *record)
329static int audit_one_rom(core_options *options, const rom_entry *rom, const char *regiontag, const game_driver *gamedrv, UINT32 validation, audit_record *record)
314330{
315331   const game_driver *drv;
316332   const rom_entry *chunk;
r3232r3233
322338   record->type = AUDIT_FILE_ROM;
323339   record->name = ROM_GETNAME(rom);
324340   record->exphash = ROM_GETHASHDATA(rom);
341   record->length = 0;
325342
326343   /* compute the expected length by summing the chunks */
327344   for (chunk = rom_first_chunk(rom); chunk; chunk = rom_next_chunk(chunk))
r3232r3233
357374      }
358375   }
359376
377   /* if not found, check the region as a backup */
378   if (record->length == 0 && regiontag != NULL)
379   {
380      file_error filerr;
381      mame_file *file;
382      astring *fname;
383
384      /* open the file if we can */
385      fname = astring_assemble_3(astring_alloc(), regiontag, PATH_SEPARATOR, ROM_GETNAME(rom));
386       if (has_crc)
387         filerr = mame_fopen_crc_options(options, SEARCHPATH_ROM, astring_c(fname), crc, OPEN_FLAG_READ, &file);
388      else
389         filerr = mame_fopen_options(options, SEARCHPATH_ROM, astring_c(fname), OPEN_FLAG_READ, &file);
390      astring_free(fname);
391
392      /* if we got it, extract the hash and length */
393      if (filerr == FILERR_NONE)
394      {
395         hash_data_copy(record->hash, mame_fhash(file, validation));
396         record->length = (UINT32)mame_fsize(file);
397         mame_fclose(file);
398      }
399   }
400
360401   /* if we failed to find the file, set the appropriate status */
361   if (drv == NULL)
402   if (record->length == 0)
362403   {
363404      const game_driver *parent;
364405
r3232r3233
496537      const rom_entry *rom;
497538
498539      /* see if the parent has the same ROM or not */
499      for (region = rom_first_region(drv); region; region = rom_next_region(region))
540      for (region = rom_first_region(drv, NULL); region; region = rom_next_region(region))
500541         for (rom = rom_first_file(region); rom; rom = rom_next_file(rom))
501542            if (hash_data_is_equal(ROM_GETHASHDATA(rom), hash, 0))
502543            {
src/emu/video.c
r3232r3233
7979
8080   /* screen specific VBLANK callbacks */
8181   vblank_state_changed_func vblank_callback[MAX_VBLANK_CALLBACKS]; /* the array of callbacks */
82   void *               vblank_callback_param[MAX_VBLANK_CALLBACKS]; /* array of parameters */
8283};
8384
8485
r3232r3233
11401141    VBLANK callback for a specific screen
11411142-------------------------------------------------*/
11421143
1143void video_screen_register_vblank_callback(const device_config *screen, vblank_state_changed_func vblank_callback)
1144void video_screen_register_vblank_callback(const device_config *screen, vblank_state_changed_func vblank_callback, void *param)
11441145{
1146   screen_state *state = get_safe_token(screen);
11451147   int i, found;
1146   screen_state *state = get_safe_token(screen);
11471148
11481149   /* validate arguments */
11491150   assert(vblank_callback != NULL);
r3232r3233
11641165
11651166   /* if not found, register and increment count */
11661167   if (!found)
1168   {
11671169      state->vblank_callback[i] = vblank_callback;
1170      state->vblank_callback_param[i] = param;
1171   }
11681172}
11691173
11701174
r3232r3233
12641268   state_save_register_item(unique_tag, 0, state->vblank_end_time.attoseconds);
12651269   state_save_register_item(unique_tag, 0, state->frame_number);
12661270   state_save_register_postload(device->machine, video_screen_postload, (void *)device);
1271
1272   return DEVICE_START_OK;
12671273}
12681274
12691275
r3232r3233
13661372
13671373   /* call the screen specific callbacks */
13681374   for (i = 0; state->vblank_callback[i] != NULL; i++)
1369      (*state->vblank_callback[i])(screen, TRUE);
1375      (*state->vblank_callback[i])(screen, state->vblank_callback_param[i], TRUE);
13701376
13711377   /* if this is the primary screen and we need to update now */
13721378   if (screen == machine->primary_screen && !(machine->config->video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
r3232r3233
13961402
13971403   /* call the screen specific callbacks */
13981404   for (i = 0; state->vblank_callback[i] != NULL; i++)
1399      (*state->vblank_callback[i])(screen, FALSE);
1405      (*state->vblank_callback[i])(screen, state->vblank_callback_param[i], FALSE);
14001406
14011407   /* if this is the primary screen and we need to update now */
14021408   if (screen == machine->primary_screen && (machine->config->video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
src/emu/uimenu.h
r3232r3233
103103void ui_menu_item_append(ui_menu *menu, const char *text, const char *subtext, UINT32 flags, void *ref);
104104
105105/* process a menu, drawing it and returning any interesting events */
106const ui_menu_event *ui_menu_process(ui_menu *menu, UINT32 flags);
106const ui_menu_event *ui_menu_process(running_machine *machine, ui_menu *menu, UINT32 flags);
107107
108108/* configure the menu for custom rendering */
109109void ui_menu_set_custom_render(ui_menu *menu, ui_menu_custom_func custom, float top, float bottom);
r3232r3233
147147UINT32 ui_slider_ui_handler(running_machine *machine, UINT32 state);
148148
149149/* force game select menu */
150void ui_menu_force_game_select(void);
150void ui_menu_force_game_select(running_machine *machine);
151151int ui_menu_is_force_game_select(void);
152152
153153
src/emu/memory.c
r3232r3233
372372static void memory_init_cpudata(running_machine *machine);
373373static void memory_init_preflight(running_machine *machine);
374374static void memory_init_populate(running_machine *machine);
375static void space_map_range_private(addrspace_data *space, read_or_write readorwrite, int handlerbits, int handlerunitmask, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, genf *handler, void *object, const char *handler_name);
376static void space_map_range(addrspace_data *space, read_or_write readorwrite, int handlerbits, int handlerunitmask, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, genf *handler, void *object, const char *handler_name);
375static void space_map_range_private(running_machine *machine, addrspace_data *space, read_or_write readorwrite, int handlerbits, int handlerunitmask, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, genf *handler, void *object, const char *handler_name);
376static void space_map_range(running_machine *machine, addrspace_data *space, read_or_write readorwrite, int handlerbits, int handlerunitmask, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, genf *handler, void *object, const char *handler_name);
377377static void bank_assign_static(int banknum, int cpunum, int spacenum, read_or_write readorwrite, offs_t bytestart, offs_t byteend);
378378static genf *bank_assign_dynamic(int cpunum, int spacenum, read_or_write readorwrite, offs_t bytestart, offs_t byteend);
379379static UINT8 table_assign_handler(handler_data *table, void *object, genf *handler, const char *handler_name, offs_t bytestart, offs_t byteend, offs_t bytemask);
r3232r3233
779779    memory_set_context - set the memory context
780780-------------------------------------------------*/
781781
782void memory_set_context(int activecpu)
782void memory_set_context(running_machine *machine, int activecpu)
783783{
784784   addrspace_data *space;
785785
r3232r3233
796796   /* program address space */
797797   space = &cpudata[activecpu].space[ADDRESS_SPACE_PROGRAM];
798798   active_address_space[ADDRESS_SPACE_PROGRAM].bytemask = space->bytemask;
799   active_address_space[ADDRESS_SPACE_PROGRAM].readlookup = ((Machine->debug_flags & DEBUG_FLAG_WPR_PROGRAM) != 0) ? wptable : space->read.table;
800   active_address_space[ADDRESS_SPACE_PROGRAM].writelookup = ((Machine->debug_flags & DEBUG_FLAG_WPW_PROGRAM) != 0) ? wptable : space->write.table;
799   active_address_space[ADDRESS_SPACE_PROGRAM].readlookup = ((machine->debug_flags & DEBUG_FLAG_WPR_PROGRAM) != 0) ? wptable : space->read.table;
800   active_address_space[ADDRESS_SPACE_PROGRAM].writelookup = ((machine->debug_flags & DEBUG_FLAG_WPW_PROGRAM) != 0) ? wptable : space->write.table;
801801   active_address_space[ADDRESS_SPACE_PROGRAM].readhandlers = space->read.handlers;
802802   active_address_space[ADDRESS_SPACE_PROGRAM].writehandlers = space->write.handlers;
803803   active_address_space[ADDRESS_SPACE_PROGRAM].accessors = space->accessors;
r3232r3233
807807   {
808808      space = &cpudata[activecpu].space[ADDRESS_SPACE_DATA];
809809      active_address_space[ADDRESS_SPACE_DATA].bytemask = space->bytemask;
810      active_address_space[ADDRESS_SPACE_DATA].readlookup = ((Machine->debug_flags & DEBUG_FLAG_WPR_DATA) != 0) ? wptable : space->read.table;
811      active_address_space[ADDRESS_SPACE_DATA].writelookup = ((Machine->debug_flags & DEBUG_FLAG_WPW_DATA) != 0) ? wptable : space->write.table;
810      active_address_space[ADDRESS_SPACE_DATA].readlookup = ((machine->debug_flags & DEBUG_FLAG_WPR_DATA) != 0) ? wptable : space->read.table;
811      active_address_space[ADDRESS_SPACE_DATA].writelookup = ((machine->debug_flags & DEBUG_FLAG_WPW_DATA) != 0) ? wptable : space->write.table;
812812      active_address_space[ADDRESS_SPACE_DATA].readhandlers = space->read.handlers;
813813      active_address_space[ADDRESS_SPACE_DATA].writehandlers = space->write.handlers;
814814      active_address_space[ADDRESS_SPACE_DATA].accessors = space->accessors;
r3232r3233
819819   {
820820      space = &cpudata[activecpu].space[ADDRESS_SPACE_IO];
821821      active_address_space[ADDRESS_SPACE_IO].bytemask = space->bytemask;
822      active_address_space[ADDRESS_SPACE_IO].readlookup = ((Machine->debug_flags & DEBUG_FLAG_WPR_IO) != 0) ? wptable : space->read.table;
823      active_address_space[ADDRESS_SPACE_IO].writelookup = ((Machine->debug_flags & DEBUG_FLAG_WPW_IO) != 0) ? wptable : space->write.table;
822      active_address_space[ADDRESS_SPACE_IO].readlookup = ((machine->debug_flags & DEBUG_FLAG_WPR_IO) != 0) ? wptable : space->read.table;
823      active_address_space[ADDRESS_SPACE_IO].writelookup = ((machine->debug_flags & DEBUG_FLAG_WPW_IO) != 0) ? wptable : space->write.table;
824824      active_address_space[ADDRESS_SPACE_IO].readhandlers = space->read.handlers;
825825      active_address_space[ADDRESS_SPACE_IO].writehandlers = space->write.handlers;
826826      active_address_space[ADDRESS_SPACE_IO].accessors = space->accessors;
r3232r3233
861861   map = malloc_or_die(sizeof(*map));
862862   memset(map, 0, sizeof(*map));
863863
864   /* start by constructing the internal CPU map */
865   if (internal_map != NULL)
866      address_map_detokenize(map, driver, internal_map);
867
868864   /* construct the standard map */
869865   if (config->cpu[cpunum].address_map[spacenum][0] != NULL)
870866      address_map_detokenize(map, driver, config->cpu[cpunum].address_map[spacenum][0]);
871867   if (config->cpu[cpunum].address_map[spacenum][1] != NULL)
872868      address_map_detokenize(map, driver, config->cpu[cpunum].address_map[spacenum][1]);
873869
870   /* append the internal CPU map (last so it can be overridden) */
871   if (internal_map != NULL)
872      address_map_detokenize(map, driver, internal_map);
873
874874   return map;
875875}
876876
r3232r3233
12881288    CPU and offset
12891289-------------------------------------------------*/
12901290
1291void *memory_get_op_ptr(int cpunum, offs_t byteaddress, int arg)
1291void *memory_get_op_ptr(running_machine *machine, int cpunum, offs_t byteaddress, int arg)
12921292{
12931293   addrspace_data *space = &cpudata[cpunum].space[ADDRESS_SPACE_PROGRAM];
12941294   offs_t byteoffset;
r3232r3233
13021302      opbase_data saved_opbase = opbase;
13031303
13041304      /* query the handler */
1305      offs_t new_byteaddress = (*cpudata[cpunum].opbase_handler)(Machine, byteaddress, &opbase);
1305      offs_t new_byteaddress = (*cpudata[cpunum].opbase_handler)(machine, byteaddress, &opbase);
13061306
13071307      /* if it returns ~0, we use whatever data the handler set */
13081308      if (new_byteaddress == ~0)
r3232r3233
15021502   if (rhandler >= STATIC_COUNT || whandler >= STATIC_COUNT)
15031503      fatalerror("fatal: can only use static banks with memory_install_handler()");
15041504   if (rhandler != 0)
1505      space_map_range(space, ROW_READ, space->dbits, 0, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)rhandler, machine, rhandler_name);
1505      space_map_range(machine, space, ROW_READ, space->dbits, 0, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)rhandler, machine, rhandler_name);
15061506   if (whandler != 0)
1507      space_map_range(space, ROW_WRITE, space->dbits, 0, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)whandler, machine, whandler_name);
1507      space_map_range(machine, space, ROW_WRITE, space->dbits, 0, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)whandler, machine, whandler_name);
15081508   mem_dump();
15091509   return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart));
15101510}
r3232r3233
15131513{
15141514   addrspace_data *space = &cpudata[cpunum].space[spacenum];
15151515   if (rhandler != NULL)
1516      space_map_range(space, ROW_READ, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, machine, rhandler_name);
1516      space_map_range(machine, space, ROW_READ, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, machine, rhandler_name);
15171517   if (whandler != NULL)
1518      space_map_range(space, ROW_WRITE, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, machine, whandler_name);
1518      space_map_range(machine, space, ROW_WRITE, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, machine, whandler_name);
15191519   mem_dump();
15201520   return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart));
15211521}
r3232r3233
15241524{
15251525   addrspace_data *space = &cpudata[cpunum].space[spacenum];
15261526   if (rhandler != NULL)
1527      space_map_range(space, ROW_READ, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, machine, rhandler_name);
1527      space_map_range(machine, space, ROW_READ, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, machine, rhandler_name);
15281528   if (whandler != NULL)
1529      space_map_range(space, ROW_WRITE, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, machine, whandler_name);
1529      space_map_range(machine, space, ROW_WRITE, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, machine, whandler_name);
15301530   mem_dump();
15311531   return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart));
15321532}
r3232r3233
15351535{
15361536   addrspace_data *space = &cpudata[cpunum].space[spacenum];
15371537   if (rhandler != NULL)
1538      space_map_range(space, ROW_READ, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, machine, rhandler_name);
1538      space_map_range(machine, space, ROW_READ, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, machine, rhandler_name);
15391539   if (whandler != NULL)
1540      space_map_range(space, ROW_WRITE, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, machine, whandler_name);
1540      space_map_range(machine, space, ROW_WRITE, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, machine, whandler_name);
15411541   mem_dump();
15421542   return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart));
15431543}
r3232r3233
15461546{
15471547   addrspace_data *space = &cpudata[cpunum].space[spacenum];
15481548   if (rhandler != NULL)
1549      space_map_range(space, ROW_READ, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, machine, rhandler_name);
1549      space_map_range(machine, space, ROW_READ, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, machine, rhandler_name);
15501550   if (whandler != NULL)
1551      space_map_range(space, ROW_WRITE, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, machine, whandler_name);
1551      space_map_range(machine, space, ROW_WRITE, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, machine, whandler_name);
15521552   mem_dump();
15531553   return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart));
15541554}
r3232r3233
15661566   if (rhandler >= STATIC_COUNT || whandler >= STATIC_COUNT)
15671567      fatalerror("fatal: can only use static banks with memory_install_device_handler()");
15681568   if (rhandler != 0)
1569      space_map_range(space, ROW_READ, space->dbits, 0, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)rhandler, (void *)device, rhandler_name);
1569      space_map_range(device->machine, space, ROW_READ, space->dbits, 0, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)rhandler, (void *)device, rhandler_name);
15701570   if (whandler != 0)
1571      space_map_range(space, ROW_WRITE, space->dbits, 0, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)whandler, (void *)device, whandler_name);
1571      space_map_range(device->machine, space, ROW_WRITE, space->dbits, 0, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)whandler, (void *)device, whandler_name);
15721572   mem_dump();
15731573   return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart));
15741574}
r3232r3233
15771577{
15781578   addrspace_data *space = &cpudata[cpunum].space[spacenum];
15791579   if (rhandler != NULL)
1580      space_map_range(space, ROW_READ, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, (void *)device, rhandler_name);
1580      space_map_range(device->machine, space, ROW_READ, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, (void *)device, rhandler_name);
15811581   if (whandler != NULL)
1582      space_map_range(space, ROW_WRITE, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name);
1582      space_map_range(device->machine, space, ROW_WRITE, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name);
15831583   mem_dump();
15841584   return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart));
15851585}
r3232r3233
15881588{
15891589   addrspace_data *space = &cpudata[cpunum].space[spacenum];
15901590   if (rhandler != NULL)
1591      space_map_range(space, ROW_READ, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, (void *)device, rhandler_name);
1591      space_map_range(device->machine, space, ROW_READ, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, (void *)device, rhandler_name);
15921592   if (whandler != NULL)
1593      space_map_range(space, ROW_WRITE, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name);
1593      space_map_range(device->machine, space, ROW_WRITE, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name);
15941594   mem_dump();
15951595   return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart));
15961596}
r3232r3233
15991599{
16001600   addrspace_data *space = &cpudata[cpunum].space[spacenum];
16011601   if (rhandler != NULL)
1602      space_map_range(space, ROW_READ, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, (void *)device, rhandler_name);
1602      space_map_range(device->machine, space, ROW_READ, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, (void *)device, rhandler_name);
16031603   if (whandler != NULL)
1604      space_map_range(space, ROW_WRITE, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name);
1604      space_map_range(device->machine, space, ROW_WRITE, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name);
16051605   mem_dump();
16061606   return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart));
16071607}
r3232r3233
16101610{
16111611   addrspace_data *space = &cpudata[cpunum].space[spacenum];
16121612   if (rhandler != NULL)
1613      space_map_range(space, ROW_READ, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, (void *)device, rhandler_name);
1613      space_map_range(device->machine, space, ROW_READ, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, (void *)device, rhandler_name);
16141614   if (whandler != NULL)
1615      space_map_range(space, ROW_WRITE, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name);
1615      space_map_range(device->machine, space, ROW_WRITE, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name);
16161616   mem_dump();
16171617   return memory_find_base(cpunum, spacenum, ADDR2BYTE(space, addrstart));
16181618}
r3232r3233
18561856                        if (object == NULL)
18571857                           fatalerror("Unidentified object in memory map: type=%s tag=%s\n", devtype_name(entry->read_devtype), entry->read_devtag);
18581858                     }
1859                     space_map_range_private(space, ROW_READ, bits, entry->read_mask, entry->addrstart, entry->addrend, entry->addrmask, entry->addrmirror, rhandler.generic, object, entry->read_name);
1859                     space_map_range_private(machine, space, ROW_READ, bits, entry->read_mask, entry->addrstart, entry->addrend, entry->addrmask, entry->addrmirror, rhandler.generic, object, entry->read_name);
18601860                  }
18611861
18621862                  /* install the write handler if present */
r3232r3233
18701870                        if (object == NULL)
18711871                           fatalerror("Unidentified object in memory map: type=%s tag=%s\n", devtype_name(entry->write_devtype), entry->write_devtag);
18721872                     }
1873                     space_map_range_private(space, ROW_WRITE, bits, entry->write_mask, entry->addrstart, entry->addrend, entry->addrmask, entry->addrmirror, whandler.generic, object, entry->write_name);
1873                     space_map_range_private(machine, space, ROW_WRITE, bits, entry->write_mask, entry->addrstart, entry->addrend, entry->addrmask, entry->addrmirror, whandler.generic, object, entry->write_name);
18741874                  }
18751875               }
18761876            }
r3232r3233
18851885    banks to dynamically assigned banks
18861886-------------------------------------------------*/
18871887
1888static void space_map_range_private(addrspace_data *space, read_or_write readorwrite, int handlerbits, int handlerunitmask, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, genf *handler, void *object, const char *handler_name)
1888static void space_map_range_private(running_machine *machine, addrspace_data *space, read_or_write readorwrite, int handlerbits, int handlerunitmask, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, genf *handler, void *object, const char *handler_name)
18891889{
18901890   /* translate ROM to RAM/UNMAP here */
18911891   if (HANDLER_IS_ROM(handler))
r3232r3233
19091909   }
19101910
19111911   /* then do a normal installation */
1912   space_map_range(space, readorwrite, handlerbits, handlerunitmask, addrstart, addrend, addrmask, addrmirror, handler, object, handler_name);
1912   space_map_range(machine, space, readorwrite, handlerbits, handlerunitmask, addrstart, addrend, addrmask, addrmirror, handler, object, handler_name);
19131913}
19141914
19151915
r3232r3233
19191919    space
19201920-------------------------------------------------*/
19211921
1922static void space_map_range(addrspace_data *space, read_or_write readorwrite, int handlerbits, int handlerunitmask, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, genf *handler, void *object, const char *handler_name)
1922static void space_map_range(running_machine *machine, addrspace_data *space, read_or_write readorwrite, int handlerbits, int handlerunitmask, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, genf *handler, void *object, const char *handler_name)
19231923{
19241924   table_data *tabledata = (readorwrite == ROW_WRITE) ? &space->write : &space->read;
19251925   offs_t bytestart, byteend, bytemask, bytemirror;
r3232r3233
19601960
19611961   /* if this is being installed to a live CPU, update the context */
19621962   if (space->cpunum == cur_context)
1963      memory_set_context(cur_context);
1963      memory_set_context(machine, cur_context);
19641964}
19651965
19661966
r3232r3233
30033003    watchpoint memory handlers
30043004-------------------------------------------------*/
30053005
3006INLINE UINT8 watchpoint_read8(int spacenum, offs_t address)
3006INLINE UINT8 watchpoint_read8(running_machine *machine, int spacenum, offs_t address)
30073007{
30083008   UINT8 result;
3009   debug_cpu_memory_read_hook(Machine, cur_context, spacenum, address, 0xff);
3009   debug_cpu_memory_read_hook(machine, cur_context, spacenum, address, 0xff);
30103010   active_address_space[spacenum].readlookup = cpudata[cur_context].space[spacenum].read.table;
30113011   result = read_byte_generic(spacenum, address);
30123012   active_address_space[spacenum].readlookup = wptable;
30133013   return result;
30143014}
30153015
3016INLINE UINT16 watchpoint_read16(int spacenum, offs_t address, UINT16 mem_mask)
3016INLINE UINT16 watchpoint_read16(running_machine *machine, int spacenum, offs_t address, UINT16 mem_mask)
30173017{
30183018   UINT16 result;
3019   debug_cpu_memory_read_hook(Machine, cur_context, spacenum, address << 1, mem_mask);
3019   debug_cpu_memory_read_hook(machine, cur_context, spacenum, address << 1, mem_mask);
30203020   active_address_space[spacenum].readlookup = cpudata[cur_context].space[spacenum].read.table;
30213021   result = read_word_generic(spacenum, address << 1, mem_mask);
30223022   active_address_space[spacenum].readlookup = wptable;
30233023   return result;
30243024}
30253025
3026INLINE UINT32 watchpoint_read32(int spacenum, offs_t address, UINT32 mem_mask)
3026INLINE UINT32 watchpoint_read32(running_machine *machine, int spacenum, offs_t address, UINT32 mem_mask)
30273027{
30283028   UINT32 result;
3029   debug_cpu_memory_read_hook(Machine, cur_context, spacenum, address << 2, mem_mask);
3029   debug_cpu_memory_read_hook(machine, cur_context, spacenum, address << 2, mem_mask);
30303030   active_address_space[spacenum].readlookup = cpudata[cur_context].space[spacenum].read.table;
30313031   result = read_dword_generic(spacenum, address << 2, mem_mask);
30323032   active_address_space[spacenum].readlookup = wptable;
30333033   return result;
30343034}
30353035
3036INLINE UINT64 watchpoint_read64(int spacenum, offs_t address, UINT64 mem_mask)
3036INLINE UINT64 watchpoint_read64(running_machine *machine, int spacenum, offs_t address, UINT64 mem_mask)
30373037{
30383038   UINT64 result;
3039   debug_cpu_memory_read_hook(Machine, cur_context, spacenum, address << 3, mem_mask);
3039   debug_cpu_memory_read_hook(machine, cur_context, spacenum, address << 3, mem_mask);
30403040   active_address_space[spacenum].readlookup = cpudata[cur_context].space[spacenum].read.table;
30413041   result = read_qword_generic(spacenum, address << 3, mem_mask);
30423042   active_address_space[spacenum].readlookup = wptable;
30433043   return result;
30443044}
30453045
3046INLINE void watchpoint_write8(int spacenum, offs_t address, UINT8 data)
3046INLINE void watchpoint_write8(running_machine *machine, int spacenum, offs_t address, UINT8 data)
30473047{
3048   debug_cpu_memory_write_hook(Machine, cur_context, spacenum, address, data, 0xff);
3048   debug_cpu_memory_write_hook(machine, cur_context, spacenum, address, data, 0xff);
30493049   active_address_space[spacenum].writelookup = cpudata[cur_context].space[spacenum].write.table;
30503050   write_byte_generic(spacenum, address, data);
30513051   active_address_space[spacenum].writelookup = wptable;
30523052}
30533053
3054INLINE void watchpoint_write16(int spacenum, offs_t address, UINT16 data, UINT16 mem_mask)
3054INLINE void watchpoint_write16(running_machine *machine, int spacenum, offs_t address, UINT16 data, UINT16 mem_mask)
30553055{
3056   debug_cpu_memory_write_hook(Machine, cur_context, spacenum, address << 1, data, mem_mask);
3056   debug_cpu_memory_write_hook(machine, cur_context, spacenum, address << 1, data, mem_mask);
30573057   active_address_space[spacenum].writelookup = cpudata[cur_context].space[spacenum].write.table;
30583058   write_word_generic(spacenum, address << 1, data, mem_mask);
30593059   active_address_space[spacenum].writelookup = wptable;
30603060}
30613061
3062INLINE void watchpoint_write32(int spacenum, offs_t address, UINT32 data, UINT32 mem_mask)
3062INLINE void watchpoint_write32(running_machine *machine, int spacenum, offs_t address, UINT32 data, UINT32 mem_mask)
30633063{
3064   debug_cpu_memory_write_hook(Machine, cur_context, spacenum, address << 2, data, mem_mask);
3064   debug_cpu_memory_write_hook(machine, cur_context, spacenum, address << 2, data, mem_mask);
30653065   active_address_space[spacenum].writelookup = cpudata[cur_context].space[spacenum].write.table;
30663066   write_dword_generic(spacenum, address << 2, data, mem_mask);
30673067   active_address_space[spacenum].writelookup = wptable;
30683068}
30693069
3070INLINE void watchpoint_write64(int spacenum, offs_t address, UINT64 data, UINT64 mem_mask)
3070INLINE void watchpoint_write64(running_machine *machine, int spacenum, offs_t address, UINT64 data, UINT64 mem_mask)
30713071{
3072   debug_cpu_memory_write_hook(Machine, cur_context, spacenum, address << 3, data, mem_mask);
3072   debug_cpu_memory_write_hook(machine, cur_context, spacenum, address << 3, data, mem_mask);
30733073   active_address_space[spacenum].writelookup = cpudata[cur_context].space[spacenum].write.table;
30743074   write_qword_generic(spacenum, address << 3, data, mem_mask);
30753075   active_address_space[spacenum].writelookup = wptable;
30763076}
30773077
3078static READ8_HANDLER( mrh8_watchpoint_program )    { return watchpoint_read8 (ADDRESS_SPACE_PROGRAM, offset);           }
3079static READ16_HANDLER( mrh16_watchpoint_program )  { return watchpoint_read16(ADDRESS_SPACE_PROGRAM, offset, mem_mask); }
3080static READ32_HANDLER( mrh32_watchpoint_program )  { return watchpoint_read32(ADDRESS_SPACE_PROGRAM, offset, mem_mask); }
3081static READ64_HANDLER( mrh64_watchpoint_program )  { return watchpoint_read64(ADDRESS_SPACE_PROGRAM, offset, mem_mask); }
3078static READ8_HANDLER( mrh8_watchpoint_program )    { return watchpoint_read8 (machine, ADDRESS_SPACE_PROGRAM, offset);           }
3079static READ16_HANDLER( mrh16_watchpoint_program )  { return watchpoint_read16(machine, ADDRESS_SPACE_PROGRAM, offset, mem_mask); }
3080static READ32_HANDLER( mrh32_watchpoint_program )  { return watchpoint_read32(machine, ADDRESS_SPACE_PROGRAM, offset, mem_mask); }
3081static READ64_HANDLER( mrh64_watchpoint_program )  { return watchpoint_read64(machine, ADDRESS_SPACE_PROGRAM, offset, mem_mask); }
30823082
3083static WRITE8_HANDLER( mwh8_watchpoint_program )   { watchpoint_write8 (ADDRESS_SPACE_PROGRAM, offset, data);           }
3084static WRITE16_HANDLER( mwh16_watchpoint_program ) { watchpoint_write16(ADDRESS_SPACE_PROGRAM, offset, data, mem_mask); }
3085static WRITE32_HANDLER( mwh32_watchpoint_program ) { watchpoint_write32(ADDRESS_SPACE_PROGRAM, offset, data, mem_mask); }
3086static WRITE64_HANDLER( mwh64_watchpoint_program ) { watchpoint_write64(ADDRESS_SPACE_PROGRAM, offset, data, mem_mask); }
3083static WRITE8_HANDLER( mwh8_watchpoint_program )   { watchpoint_write8 (machine, ADDRESS_SPACE_PROGRAM, offset, data);           }
3084static WRITE16_HANDLER( mwh16_watchpoint_program ) { watchpoint_write16(machine, ADDRESS_SPACE_PROGRAM, offset, data, mem_mask); }
3085static WRITE32_HANDLER( mwh32_watchpoint_program ) { watchpoint_write32(machine, ADDRESS_SPACE_PROGRAM, offset, data, mem_mask); }
3086static WRITE64_HANDLER( mwh64_watchpoint_program ) { watchpoint_write64(machine, ADDRESS_SPACE_PROGRAM, offset, data, mem_mask); }
30873087
3088static READ8_HANDLER( mrh8_watchpoint_data )       { return watchpoint_read8 (ADDRESS_SPACE_DATA, offset);           }
3089static READ16_HANDLER( mrh16_watchpoint_data )     { return watchpoint_read16(ADDRESS_SPACE_DATA, offset, mem_mask); }
3090static READ32_HANDLER( mrh32_watchpoint_data )     { return watchpoint_read32(ADDRESS_SPACE_DATA, offset, mem_mask); }
3091static READ64_HANDLER( mrh64_watchpoint_data )     { return watchpoint_read64(ADDRESS_SPACE_DATA, offset, mem_mask); }
3088static READ8_HANDLER( mrh8_watchpoint_data )       { return watchpoint_read8 (machine, ADDRESS_SPACE_DATA, offset);           }
3089static READ16_HANDLER( mrh16_watchpoint_data )     { return watchpoint_read16(machine, ADDRESS_SPACE_DATA, offset, mem_mask); }
3090static READ32_HANDLER( mrh32_watchpoint_data )     { return watchpoint_read32(machine, ADDRESS_SPACE_DATA, offset, mem_mask); }
3091static READ64_HANDLER( mrh64_watchpoint_data )     { return watchpoint_read64(machine, ADDRESS_SPACE_DATA, offset, mem_mask); }
30923092
3093static WRITE8_HANDLER( mwh8_watchpoint_data )      { watchpoint_write8 (ADDRESS_SPACE_DATA, offset, data);           }
3094static WRITE16_HANDLER( mwh16_watchpoint_data )    { watchpoint_write16(ADDRESS_SPACE_DATA, offset, data, mem_mask); }
3095static WRITE32_HANDLER( mwh32_watchpoint_data )    { watchpoint_write32(ADDRESS_SPACE_DATA, offset, data, mem_mask); }
3096static WRITE64_HANDLER( mwh64_watchpoint_data )    { watchpoint_write64(ADDRESS_SPACE_DATA, offset, data, mem_mask); }
3093static WRITE8_HANDLER( mwh8_watchpoint_data )      { watchpoint_write8 (machine, ADDRESS_SPACE_DATA, offset, data);           }
3094static WRITE16_HANDLER( mwh16_watchpoint_data )    { watchpoint_write16(machine, ADDRESS_SPACE_DATA, offset, data, mem_mask); }
3095static WRITE32_HANDLER( mwh32_watchpoint_data )    { watchpoint_write32(machine, ADDRESS_SPACE_DATA, offset, data, mem_mask); }
3096static WRITE64_HANDLER( mwh64_watchpoint_data )    { watchpoint_write64(machine, ADDRESS_SPACE_DATA, offset, data, mem_mask); }
30973097
3098static READ8_HANDLER( mrh8_watchpoint_io )         { return watchpoint_read8 (ADDRESS_SPACE_IO, offset);           }
3099static READ16_HANDLER( mrh16_watchpoint_io )       { return watchpoint_read16(ADDRESS_SPACE_IO, offset, mem_mask); }
3100static READ32_HANDLER( mrh32_watchpoint_io )       { return watchpoint_read32(ADDRESS_SPACE_IO, offset, mem_mask); }
3101static READ64_HANDLER( mrh64_watchpoint_io )       { return watchpoint_read64(ADDRESS_SPACE_IO, offset, mem_mask); }
3098static READ8_HANDLER( mrh8_watchpoint_io )         { return watchpoint_read8 (machine, ADDRESS_SPACE_IO, offset);           }
3099static READ16_HANDLER( mrh16_watchpoint_io )       { return watchpoint_read16(machine, ADDRESS_SPACE_IO, offset, mem_mask); }
3100static READ32_HANDLER( mrh32_watchpoint_io )       { return watchpoint_read32(machine, ADDRESS_SPACE_IO, offset, mem_mask); }
3101static READ64_HANDLER( mrh64_watchpoint_io )       { return watchpoint_read64(machine, ADDRESS_SPACE_IO, offset, mem_mask); }
31023102
3103static WRITE8_HANDLER( mwh8_watchpoint_io )        { watchpoint_write8 (ADDRESS_SPACE_IO, offset, data);           }
3104static WRITE16_HANDLER( mwh16_watchpoint_io )      { watchpoint_write16(ADDRESS_SPACE_IO, offset, data, mem_mask); }
3105static WRITE32_HANDLER( mwh32_watchpoint_io )      { watchpoint_write32(ADDRESS_SPACE_IO, offset, data, mem_mask); }
3106static WRITE64_HANDLER( mwh64_watchpoint_io )      { watchpoint_write64(ADDRESS_SPACE_IO, offset, data, mem_mask); }
3103static WRITE8_HANDLER( mwh8_watchpoint_io )        { watchpoint_write8 (machine, ADDRESS_SPACE_IO, offset, data);           }
3104static WRITE16_HANDLER( mwh16_watchpoint_io )      { watchpoint_write16(machine, ADDRESS_SPACE_IO, offset, data, mem_mask); }
3105static WRITE32_HANDLER( mwh32_watchpoint_io )      { watchpoint_write32(machine, ADDRESS_SPACE_IO, offset, data, mem_mask); }
3106static WRITE64_HANDLER( mwh64_watchpoint_io )      { watchpoint_write64(machine, ADDRESS_SPACE_IO, offset, data, mem_mask); }
31073107
31083108
31093109/*-------------------------------------------------
src/emu/video.h
r3232r3233
8787    in the VBLANK state
8888-------------------------------------------------*/
8989
90typedef void (*vblank_state_changed_func)(const device_config *device, int vblank_state);
90typedef void (*vblank_state_changed_func)(const device_config *device, void *param, int vblank_state);
9191
9292
9393
r3232r3233
209209UINT64 video_screen_get_frame_number(const device_config *screen);
210210
211211/* registers a VBLANK callback for the given screen */
212void video_screen_register_vblank_callback(const device_config *screen, vblank_state_changed_func vblank_callback);
212void video_screen_register_vblank_callback(const device_config *screen, vblank_state_changed_func vblank_callback, void *param);
213213
214214
215215/* ----- video screen device interface ----- */
src/emu/memory.h
r3232r3233
833833void memory_init(running_machine *machine);
834834
835835/* set the current memory context */
836void memory_set_context(int activecpu);
836void memory_set_context(running_machine *machine, int activecpu);
837837
838838/* get a pointer to the set of memory accessor functions based on the address space,
839839   databus width, and endianness */
r3232r3233
870870/* return a base pointer to memory */
871871void *      memory_get_read_ptr(int cpunum, int spacenum, offs_t byteaddress);
872872void *      memory_get_write_ptr(int cpunum, int spacenum, offs_t byteaddress);
873void *      memory_get_op_ptr(int cpunum, offs_t byteaddress, int arg);
873void *      memory_get_op_ptr(running_machine *machine, int cpunum, offs_t byteaddress, int arg);
874874
875875/* memory banking */
876876void      memory_configure_bank(int banknum, int startentry, int numentries, void *base, offs_t stride);
src/emu/mame.c
r3232r3233
552552   if (started_empty && options_get_string(mame_options(), OPTION_GAMENAME)[0] != 0)
553553   {
554554      options_set_string(mame_options(), OPTION_GAMENAME, "", OPTION_PRIORITY_CMDLINE);
555      ui_menu_force_game_select();
555      ui_menu_force_game_select(machine);
556556   }
557557
558558   /* otherwise, exit for real */
r3232r3233
11451145}
11461146
11471147
1148void CLIB_DECL fatalerror_exitcode(int exitcode, const char *text, ...)
1148void CLIB_DECL fatalerror_exitcode(running_machine *machine, int exitcode, const char *text, ...)
11491149{
1150   running_machine *machine = Machine;
11511150   va_list arg;
11521151
11531152   /* dump to the buffer; assume no one writes >2k lines this way */
r3232r3233
15391538
15401539   /* first load ROMs, then populate memory, and finally initialize CPUs */
15411540   /* these operations must proceed in this order */
1542   rom_init(machine, machine->gamedrv->rom);
1541   rom_init(machine);
15431542   memory_init(machine);
15441543   cpuexec_init(machine);
15451544   watchdog_init(machine);
r3232r3233
16471646
16481647   /* set the global time to the current time */
16491648   /* this allows 0-time queued callbacks to run before any CPUs execute */
1650   timer_set_global_time(timer_get_time());
1649   timer_set_global_time(machine, timer_get_time());
16511650}
16521651
16531652
r3232r3233
17341733
17351734      /* write the default tag */
17361735      state_save_push_tag(0);
1737      state_save_save_continue();
1736      state_save_save_continue(machine);
17381737      state_save_pop_tag();
17391738
17401739      /* loop over CPUs */
r3232r3233
17471746
17481747         /* save the CPU data */
17491748         state_save_push_tag(cpunum + 1);
1750         state_save_save_continue();
1749         state_save_save_continue(machine);
17511750         state_save_pop_tag();
17521751
17531752         cpuintrf_pop_context();
17541753      }
17551754
17561755      /* finish and close */
1757      state_save_save_finish();
1756      state_save_save_finish(machine);
17581757      mame_fclose(file);
17591758
17601759      /* pop a warning if the game doesn't support saves */
r3232r3233
18161815
18171816         /* read tag 0 */
18181817         state_save_push_tag(0);
1819         state_save_load_continue();
1818         state_save_load_continue(machine);
18201819         state_save_pop_tag();
18211820
18221821         /* loop over CPUs */
r3232r3233
18291828
18301829            /* load the CPU data */
18311830            state_save_push_tag(cpunum + 1);
1832            state_save_load_continue();
1831            state_save_load_continue(machine);
18331832            state_save_pop_tag();
18341833
18351834            /* make sure banking is set */
src/emu/inptport.c
r3232r3233
9898#include "profiler.h"
9999#include "inputseq.h"
100100#include "ui.h"
101#include "uiinput.h"
101102#include <ctype.h>
102103#include <time.h>
103104#include <stdarg.h>
r3232r3233
480481static void frame_update(running_machine *machine);
481482static void frame_update_digital_joysticks(running_machine *machine);
482483static void frame_update_analog_field(analog_field_state *analog);
483static int frame_get_digital_field_state(const input_field_config *field);
484static int frame_get_digital_field_state(const input_field_config *field, int mouse_down);
484485
485486/* port configuration helpers */
486487static input_port_config *port_config_detokenize(input_port_config *listhead, const input_port_token *ipt, char *errorbuf, int errorbuflen);
r3232r3233
789790}
790791
791792
793/*-------------------------------------------------
794    input_field_by_tag_and_mask - return a pointer
795    to the first field that intersects the given
796    mask on the tagged port
797-------------------------------------------------*/
792798
799const input_field_config *input_field_by_tag_and_mask(const input_port_config *portlist, const char *tag, input_port_value mask)
800{
801   const input_port_config *port = input_port_by_tag(portlist, tag);
802   const input_field_config *field;
803
804   /* if we got the port, look for the field */
805   if (port != NULL)
806      for (field = port->fieldlist; field != NULL; field = field->next)
807         if ((field->mask & mask) != 0)
808            return field;
809
810   return NULL;
811}
812
813
814
793815/***************************************************************************
794816    ACCESSORS FOR INPUT FIELDS
795817***************************************************************************/
r3232r3233
19842006static void frame_update(running_machine *machine)
19852007{
19862008   input_port_private *portdata = machine->input_port_data;
2009   const input_field_config *mouse_field = NULL;
19872010   int ui_visible = ui_is_menu_active();
19882011   attotime curtime = timer_get_time();
19892012   const input_port_config *port;
2013   render_target *mouse_target;
2014   INT32 mouse_target_x;
2015   INT32 mouse_target_y;
2016   int mouse_button;
19902017
19912018profiler_mark(PROFILER_INPUT);
19922019
r3232r3233
20042031   /* compute default values for all the ports */
20052032   input_port_update_defaults(machine);
20062033
2034   /* perform the mouse hit test */
2035   mouse_target = ui_input_find_mouse(machine, &mouse_target_x, &mouse_target_y, &mouse_button);
2036   if (mouse_button)
2037   {
2038      const char *tag = NULL;
2039      input_port_value mask;
2040      if (render_target_map_point_input(mouse_target, mouse_target_x, mouse_target_y, &tag, &mask, NULL, NULL))
2041         mouse_field = input_field_by_tag_and_mask(machine->portconfig, tag, mask);
2042   }
2043
20072044   /* loop over all input ports */
20082045   for (port = machine->portconfig; port != NULL; port = port->next)
20092046   {
r3232r3233
20282065               frame_update_analog_field(field->state->analog);
20292066
20302067            /* handle non-analog types, but only when the UI isn't visible */
2031            else if (!ui_visible && frame_get_digital_field_state(field))
2068            else if (!ui_visible && frame_get_digital_field_state(field, field == mouse_field))
20322069               port->state->digital |= field->mask;
20332070         }
20342071
r3232r3233
22982335    of a digital field
22992336-------------------------------------------------*/
23002337
2301static int frame_get_digital_field_state(const input_field_config *field)
2338static int frame_get_digital_field_state(const input_field_config *field, int mouse_down)
23022339{
2303   int curstate = input_seq_pressed(input_field_seq(field, SEQ_TYPE_STANDARD));
2340   int curstate = mouse_down || input_seq_pressed(input_field_seq(field, SEQ_TYPE_STANDARD));
23042341   int changed = FALSE;
23052342
23062343   /* if the state changed, look for switch down/switch up */
r3232r3233
23512388      curstate = FALSE;
23522389
23532390   /* additional logic to restrict digital joysticks */
2354   if (curstate && field->state->joystick != NULL && field->way != 16)
2391   if (curstate && !mouse_down && field->state->joystick != NULL && field->way != 16)
23552392   {
23562393      UINT8 mask = (field->way == 4) ? field->state->joystick->current4way : field->state->joystick->current;
23572394      if (!(mask & (1 << field->state->joydir)))
src/emu/devintrf.c
r3232r3233
107107   device->class = devtype_get_info_int(type, DEVINFO_INT_CLASS);
108108   device->static_config = NULL;
109109   device->inline_config = (configlen == 0) ? NULL : (device->tag + strlen(tag) + 1);
110   device->started = FALSE;
110111   device->token = NULL;
111112   device->machine = NULL;
113   device->region = NULL;
114   device->regionbytes = 0;
112115   strcpy(device->tag, tag);
113116
114117   /* reset the inline_config to 0 */
r3232r3233
450453void device_list_start(running_machine *machine)
451454{
452455   device_config *device;
456   int numstarted = 0;
457   int devcount = 0;
453458
454459   assert(machine != NULL);
455460
r3232r3233
457462   add_reset_callback(machine, device_list_reset);
458463   add_exit_callback(machine, device_list_stop);
459464
460   /* iterate over devices and start them */
465   /* iterate over devices and allocate memory for them */
461466   for (device = (device_config *)machine->config->devicelist; device != NULL; device = device->next)
462467   {
463468      UINT32 tokenlen;
464469
470      assert(!device->started);
465471      assert(device->token == NULL);
466472      assert(device->type != NULL);
467473      assert(device->start != NULL);
468474
475      devcount++;
476
469477      /* get the size of the token data */
470478      tokenlen = (UINT32)devtype_get_info_int(device->type, DEVINFO_INT_TOKEN_BYTES);
471479      if (tokenlen == 0)
r3232r3233
479487      device->machine = machine;
480488      device->region = memory_region(machine, device->tag);
481489      device->regionbytes = memory_region_length(machine, device->tag);
490   }
482491
483      /* call the start function */
484      (*device->start)(device);
492   /* iterate until we've started everything */
493   while (numstarted < devcount)
494   {
495      int prevstarted = numstarted;
496      numstarted = 0;
497
498      /* iterate over devices and start them */
499      for (device = (device_config *)machine->config->devicelist; device != NULL; device = device->next)
500      {
501         if (!device->started && (*device->start)(device) == DEVICE_START_OK)
502            device->started = TRUE;
503         numstarted += device->started;
504      }
505
506      /* if we didn't start anything new, we're in trouble */
507      if (numstarted == prevstarted)
508         fatalerror("Circular dependency in device startup; unable to start %d/%d devices\n", devcount - numstarted, devcount);
485509   }
486510}
487511
r3232r3233
703727   deviceinfo info;
704728
705729   assert(device != NULL);
706   assert(device->token != NULL);
707730   assert(device->type != NULL);
708731   assert(state >= DEVINFO_PTR_FIRST && state <= DEVINFO_PTR_LAST);
709732
r3232r3233
776799   deviceinfo info;
777800
778801   assert(device != NULL);
779   assert(device->token != NULL);
780802   assert(device->type != NULL);
781803   assert(state >= DEVINFO_STR_FIRST && state <= DEVINFO_STR_LAST);
782804
src/emu/machine/timekpr.c
r3232r3233
339339   timer = timer_alloc( timekeeper_tick, c );
340340   duration = ATTOTIME_IN_SEC(1);
341341   timer_adjust_periodic( timer, duration, 0, duration );
342
343   return DEVICE_START_OK;
342344}
343345
344346static DEVICE_START(m48t02)
r3232r3233
357359   c->offset_flags = -1;
358360   c->size = 0x800;
359361
360   DEVICE_START_CALL( timekeeper );
362   return DEVICE_START_CALL( timekeeper );
361363}
362364
363365static DEVICE_START(m48t35)
r3232r3233
376378   c->offset_flags = -1;
377379   c->size = 0x8000;
378380
379   DEVICE_START_CALL( timekeeper );
381   return DEVICE_START_CALL( timekeeper );
380382}
381383
382384static DEVICE_START(m48t58)
r3232r3233
395397   c->offset_flags = -1;
396398   c->size = 0x2000;
397399
398   DEVICE_START_CALL( timekeeper );
400   return DEVICE_START_CALL( timekeeper );
399401}
400402
401403static DEVICE_START(mk48t08)
r3232r3233
414416   c->offset_flags = 0x1ff0;
415417   c->size = 0x2000;
416418
417   DEVICE_START_CALL( timekeeper );
419   return DEVICE_START_CALL( timekeeper );
418420}
419421
420422/*-------------------------------------------------
src/emu/machine/idectrl.c
r3232r3233
17561756
17571757   state_save_register_item(unique_tag, 0, ide->master_password_enable);
17581758   state_save_register_item(unique_tag, 0, ide->user_password_enable);
1759
1760   return DEVICE_START_OK;
17591761}
17601762
17611763
src/emu/machine/68681.c
r3232r3233
586586   state_save_register_item(unique_tag, 0, duart68681->channel[1].tx_data);
587587   state_save_register_item(unique_tag, 0, duart68681->channel[1].tx_ready);
588588
589   return DEVICE_START_OK;
589590}
590591
591592/*-------------------------------------------------
src/emu/machine/6532riot.c
r3232r3233
467467
468468   state_save_register_item(unique_tag, 0, riot->timershift);
469469   state_save_register_item(unique_tag, 0, riot->timerstate);
470
471   return DEVICE_START_OK;
470472}
471473
472474
src/emu/machine/ldpr8210.c
r3232r3233
1010*************************************************************************/
1111
1212#include "ldcore.h"
13#include "cpu/mcs48/mcs48.h"
1314
1415
1516
r3232r3233
1718    DEBUGGING
1819***************************************************************************/
1920
21#define EMULATE_PR8210_ROM         0
22
2023#define PRINTF_COMMANDS            1
2124#define CMDPRINTF(x)            do { if (PRINTF_COMMANDS) mame_printf_debug x; } while (0)
2225
r3232r3233
2932/* Player-specific states */
3033enum
3134{
32   LDSTATE_STEPPING_BY_PARAMETER = LDSTATE_OTHER
35   LDSTATE_STEPPING_BY_PARAMETER = LDSTATE_OTHER,
36   LDSTATE_STEPPING_BY_PARAMETER_PAUSED
3337};
3438
3539/* Pioneer PR-8210 specific information */
r3232r3233
6973   UINT8            cmdcnt;               /* counter for multi-byte command */
7074   UINT8            cmdbytes[3];         /* storage for multi-byte command */
7175   void            (*cmd_ack_callback)(void); /* callback to clear game command write flag */
76
77   /* low-level emulation data */
78   int               cpunum;
79   UINT8             pia[0x100];
80   UINT8            vsync;
81   UINT8             porta;
82   UINT8             portb;
83   UINT8             pia_porta;
84   UINT8             pia_portb;
7285};
7386
7487
r3232r3233
8194static void pr8210_soft_reset(laserdisc_state *ld);
8295static void pr8210_update_squelch(laserdisc_state *ld);
8396static int pr8210_switch_state(laserdisc_state *ld, UINT8 newstate, INT32 stateparam);
97static INT32 pr8210_hle_update(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime);
98#if (EMULATE_PR8210_ROM)
99static void pr8210_vsync(laserdisc_state *ld);
84100static INT32 pr8210_update(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime);
85static void pr8210_command(laserdisc_state *ld);
101#else
102static void pr8210_hle_command(laserdisc_state *ld);
103#endif
86104static void pr8210_control_w(laserdisc_state *ld, UINT8 prev, UINT8 data);
87105
88106static void simutrek_init(laserdisc_state *ld);
r3232r3233
92110
93111
94112/***************************************************************************
113    ROM AND MACHINE INTERFACES
114***************************************************************************/
115
116MACHINE_DRIVER_EXTERN( pr8210 );
117
118#if EMULATE_PR8210_ROM
119ROM_START( pr8210 )
120   ROM_REGION( 0x800, "pr8210", ROMREGION_LOADBYNAME )
121   ROM_LOAD( "pr-8210_mcu_ud6005a.bin", 0x000, 0x800, CRC(120fa83b) SHA1(b514326ca1f52d6d89056868f9d17eabd4e3f31d) )
122ROM_END
123#endif
124
125
126
127/***************************************************************************
95128    INTERFACES
96129***************************************************************************/
97130
r3232r3233
100133   LASERDISC_TYPE_PIONEER_PR8210,            /* type of the player */
101134   sizeof(ldplayer_data),                  /* size of the state */
102135   "Pioneer PR-8210",                     /* name of the player */
136#if EMULATE_PR8210_ROM
137   rom_pr8210,                           /* pointer to ROM region information */
138   machine_config_pr8210,                  /* pointer to machine configuration */
103139   pr8210_init,                        /* initialization callback */
140   pr8210_vsync,                        /* vsync callback */
104141   pr8210_update,                        /* update callback */
142#else
143   NULL,                              /* pointer to ROM region information */
144   NULL,                              /* pointer to machine configuration */
145   pr8210_init,                        /* initialization callback */
146   NULL,                              /* vsync callback */
147   pr8210_hle_update,                     /* update callback */
148#endif
105149   NULL,                              /* parallel data write */
106150   {                                 /* single line write: */
107151      NULL,                           /*    LASERDISC_LINE_ENTER */
r3232r3233
122166   LASERDISC_TYPE_SIMUTREK_SPECIAL,         /* type of the player */
123167   sizeof(ldplayer_data),                  /* size of the state */
124168   "Simutrek Modified PR-8210",            /* name of the player */
169   NULL,                              /* pointer to ROM region information */
170   NULL,                              /* pointer to machine configuration */
125171   simutrek_init,                        /* initialization callback */
126   pr8210_update,                        /* update callback */
172   NULL,                              /* vsync callback */
173   pr8210_hle_update,                     /* update callback */
127174   simutrek_data_w,                     /* parallel data write */
128175   {                                 /* single line write: */
129176      NULL,                           /*    LASERDISC_LINE_ENTER */
r3232r3233
141188
142189
143190/***************************************************************************
144    PIONEER PR-8210 IMPLEMENTATION
191    INLINE FUNCTIONS
145192***************************************************************************/
146193
147194/*-------------------------------------------------
r3232r3233
156203}
157204
158205
206/*-------------------------------------------------
207    requires_state_save - returns TRUE if the
208    given state will return to the previous
209    state when done
210-------------------------------------------------*/
159211
212INLINE void update_audio_squelch(laserdisc_state *ld)
213{
214   ldplayer_data *player = ld->player;
215   ldcore_set_audio_squelch(ld, (player->porta & 0x40) || !(player->pia_portb & 0x01), (player->porta & 0x40) || !(player->pia_portb & 0x02));
216}
217
218
219
220
160221/***************************************************************************
161222    PIONEER PR-8210 IMPLEMENTATION
162223***************************************************************************/
r3232r3233
168229
169230static void pr8210_init(laserdisc_state *ld)
170231{
232   astring *tempstring = astring_alloc();
233
234   /* find our CPU */
235   astring_printf(tempstring, "%s:%s", ld->device->tag, "pr8210");
236   ld->player->cpunum = mame_find_cpu_index(ld->device->machine, astring_c(tempstring));
237   astring_free(tempstring);
238
171239   /* do a soft reset */
172240   pr8210_soft_reset(ld);
173241}
r3232r3233
247315
248316      /* Simutrek: stepping by parameter with explicit audio squelch controls */
249317      case LDSTATE_STEPPING_BY_PARAMETER:
318      case LDSTATE_STEPPING_BY_PARAMETER_PAUSED:
250319         ldcore_set_video_squelch(ld, FALSE);
251320         break;
252321   }
r3232r3233
306375
307376
308377/*-------------------------------------------------
378    pr8210_vsync - Start of VSYNC callback
379-------------------------------------------------*/
380
381#if (EMULATE_PR8210_ROM)
382static TIMER_CALLBACK( vsync_off )
383{
384   ldplayer_data *player = ptr;
385   player->vsync = FALSE;
386}
387
388static void pr8210_vsync(laserdisc_state *ld)
389{
390   ldplayer_data *player = ld->player;
391   player->vsync = TRUE;
392   timer_set(attotime_mul(video_screen_get_scan_period(ld->screen), 4), player, 0, vsync_off);
393}
394#endif
395
396
397/*-------------------------------------------------
309398    pr8210_update - Pioneer PR-8210-specific
310    update callback
399    update callback when using a ROM
311400-------------------------------------------------*/
312401
402#if (EMULATE_PR8210_ROM)
403
313404static INT32 pr8210_update(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime)
314405{
406   ldplayer_data *player = ld->player;
407   UINT8 focus_on = !(player->porta & 0x08);
408   UINT8 laser_on = !(player->portb & 0x01);
409   UINT8 spdl_on = !(player->porta & 0x10);
410   INT32 advanceby = 0;
411   int frame, chapter;
412
413   /* update PIA registers based on vbi code */
414   frame = frame_from_metadata(vbi);
415   chapter = chapter_from_metadata(vbi);
416   if (focus_on && laser_on && !(player->pia[0x80] & 1))
417   {
418      if (frame == FRAME_LEAD_IN)
419         player->pia[0xc0] = 0x10; /* or 0x12 */
420      else if (frame == FRAME_LEAD_OUT)
421         player->pia[0xc0] = 0x11;
422      else if (frame != FRAME_NOT_PRESENT)
423      {
424         player->pia[0xc0] = 0x02;   /* bit 0x02 must be set for forward scanning to work */
425         player->pia[0x22] = 0xf0 | ((frame / 10000) % 10);
426         player->pia[0x23] = 0xf0 | ((frame / 1000) % 10);
427         player->pia[0x24] = 0xf0 | ((frame / 100) % 10);
428         player->pia[0x25] = 0xf0 | ((frame / 10) % 10);
429         player->pia[0x26] = 0xf0 | ((frame / 1) % 10);
430printf("Frame:%05d\n", frame);
431      }
432      else if (chapter != CHAPTER_NOT_PRESENT)
433      {
434         player->pia[0xc0] = 0x13;
435         player->pia[0x20] = 0xf0 | ((chapter / 10) % 10);
436         player->pia[0x21] = 0xf0 | ((chapter / 1) % 10);
437      }
438//      else
439//          player->pia[0xc0] = 0x00;
440   }
441   player->pia[0xc0] |= 12;//4;//fieldnum << 2;
442
443   if (spdl_on)
444      advanceby = fieldnum;
445
446   /* update overlay */
447   if ((player->pia[0x80] & 1) || player->framedisplay)
448   {
449      char buffer[16] = { 0 };
450      int i;
451      for (i = 0; i < 15; i++)
452      {
453         UINT8 c = player->pia[0x22 + i];
454         if (c >= 0xf0 && c <= 0xf9)
455            c = '0' + (c - 0xf0);
456         else if (c < 0x20 || c > 0x7f)
457            c = '?';
458         buffer[i] = c;
459      }
460      popmessage("%s", buffer);
461   }
462   player->framedisplay = 0;
463
464if (advanceby != 0)
465   printf("Advancing by %d\n", advanceby);
466   return advanceby;
467}
468#endif
469
470
471/*-------------------------------------------------
472    pr8210_hle_update - Pioneer PR-8210-specific
473    update callback when using HLE
474-------------------------------------------------*/
475
476static INT32 pr8210_hle_update(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime)
477{
315478   ldplayer_state newstate;
316479   INT32 advanceby = 0;
317480   int frame;
r3232r3233
369532         {
370533            /* note that we switch directly to PAUSED as we are not looking for frames */
371534            advanceby = ld->state.param;
372            pr8210_switch_state(ld, LDSTATE_PAUSED, 0);
535            pr8210_switch_state(ld, LDSTATE_STEPPING_BY_PARAMETER_PAUSED, 0);
373536         }
374537         break;
538
539      case LDSTATE_STEPPING_BY_PARAMETER_PAUSED:
540         /* generic pause behavior */
541         ld->state.state = LDSTATE_PAUSED;
542         advanceby = ldcore_generic_update(ld, vbi, fieldnum, curtime, &newstate);
543         if (newstate.state != LDSTATE_PAUSED)
544            pr8210_switch_state(ld, newstate.state, newstate.param);
545         else
546            ld->state.state = LDSTATE_STEPPING_BY_PARAMETER_PAUSED;
547         break;
375548   }
376549
377550   return advanceby;
378551}
379552
380553
554
381555/*-------------------------------------------------
382    pr8210_command - Pioneer PR-8210-specific
556    pr8210_hle_command - Pioneer PR-8210-specific
383557    command processing
384558-------------------------------------------------*/
385559
386static void pr8210_command(laserdisc_state *ld)
560#if (!EMULATE_PR8210_ROM)
561static void pr8210_hle_command(laserdisc_state *ld)
387562{
388563   ldplayer_data *player = ld->player;
389564   UINT8 cmd = player->lastcommand;
r3232r3233
526701         break;
527702   }
528703}
704#endif
529705
530706
531707/*-------------------------------------------------
r3232r3233
576752
577753//printf("New command = %02X (last=%02X)\n", newcommand, player->lastcommand);
578754
755#if EMULATE_PR8210_ROM
756         printf("Command = %02X\n", newcommand);
757//          player->pia_porta = BITSWAP8(newcommand, 4,3,2,1,0,5,6,7);
758         player->pia_porta = BITSWAP8(newcommand, 0,1,2,3,4,5,6,7);
759#else
579760         /* if we got a double command, act on it */
580761         if (newcommand == player->lastcommand)
581762         {
582            pr8210_command(ld);
763            pr8210_hle_command(ld);
583764            player->lastcommand = 0;
584765         }
585766         else
586767            player->lastcommand = newcommand;
768#endif
587769      }
588770   }
589771}
r3232r3233
702884void simutrek_set_audio_squelch(const device_config *device, int state)
703885{
704886   laserdisc_state *ld = ldcore_get_safe_token(device);
705   int squelch = (state != ASSERT_LINE);
706   ldcore_set_audio_squelch(ld, squelch, squelch);
887   int squelch = (state == 0);
888   if (squelch)
889      ldcore_set_audio_squelch(ld, squelch, squelch);
890   else
891      ldcore_set_audio_squelch(ld, squelch, squelch);
707892}
708893
709894
r3232r3233
720905
721906   player->cmd_ack_callback = callback;
722907}
908
909
910
911/***************************************************************************
912    RE-IMPLEMENTATION USING ACTUAL ROMS
913***************************************************************************/
914
915/*************************************
916 *
917 *  Test PR-8210 ROM emulation
918 *
919 *************************************/
920
921static laserdisc_state *find_pr8210(running_machine *machine)
922{
923   return ldcore_get_safe_token(device_list_first(machine->config->devicelist, LASERDISC));
924}
925
926
927static READ8_HANDLER( pr8210_pia_r )
928{
929   laserdisc_state *ld = find_pr8210(machine);
930   ldplayer_data *player = ld->player;
931   UINT8 result = player->pia[offset];
932   switch (offset)
933   {
934      case 0x22:
935      case 0x23:
936      case 0x24:
937      case 0x25:
938      case 0x26:
939      case 0x27:
940      case 0xc0:
941      case 0xe0:
942         break;
943
944      case 0xa0:
945//          printf("%03X:pia_r(%02X) = %02X\n", activecpu_get_pc(), offset, player->pia_porta);
946         result = player->pia_porta;
947//          player->pia_porta = 0;
948         break;
949
950      default:
951         printf("%03X:pia_r(%02X)\n", activecpu_get_pc(), offset);
952         break;
953   }
954   return result;
955}
956
957static WRITE8_HANDLER( pr8210_pia_w )
958{
959   /*
960       $22-26 (R) = read and copied to memory $23-27
961       $23 (R) = something compared against $F4
962       $22-26 (W) = SRCH. text
963       $27-2B (W) = FRAME/CHAP. text
964       $2C-30 (W) = frame or chapter number
965       $40 (W) = $CF at initialization, tracked by ($78)
966       $60 (W) = port B output, tracked by ($77)
967           $80 = n/c
968           $40 = (out) LED3
969           $20 = (out) LED2
970           $10 = (out) LED1
971                    123 -> LHL = Play
972                        -> HLL = Slow fwd
973                        -> LLL = Slow rev
974                        -> HHL = Still
975                        -> LLH = Pause
976                        -> HHH = all off
977           $08 = (out) CAV LED
978           $04 = (out) CLV LED
979           $02 = (out) A2 LED/AUDIO 2
980           $01 = (out) A1 LED/AUDIO 1
981       $80 (W) = 0 or 1
982       $A0 (R) = port A input
983       $C0 (R) = stored to ($2E)
984       $E0 (R) = stored to ($2F)
985    */
986   laserdisc_state *ld = find_pr8210(machine);
987   ldplayer_data *player = ld->player;
988   if (player->pia[offset] != data)
989   {
990      switch (offset)
991      {
992         case 0x40:
993            if (!(data & 0x02) && (player->pia[offset] & 0x02))
994               player->framedisplay = 1;
995            printf("%03X:pia_w(%02X) = %02X\n", activecpu_get_pc(), offset, data);
996            break;
997
998         case 0x60:
999            printf("%03X:pia_w(%02X) = %02X (PORT B LEDS:", activecpu_get_pc(), offset, data);
1000            output_set_value("pr8210_audio1", (data & 0x01) != 0);
1001            output_set_value("pr8210_audio2", (data & 0x02) != 0);
1002            output_set_value("pr8210_clv", (data & 0x04) != 0);
1003            output_set_value("pr8210_cav", (data & 0x08) != 0);
1004            output_set_value("pr8210_led1", (data & 0x10) == 0);
1005            output_set_value("pr8210_led2", (data & 0x20) == 0);
1006            output_set_value("pr8210_led3", (data & 0x40) == 0);
1007            if (!(data & 0x80)) printf(" ???");
1008            printf(")\n");
1009            player->pia_portb = data;
1010            update_audio_squelch(ld);
1011            break;
1012
1013         default:
1014            printf("%03X:pia_w(%02X) = %02X\n", activecpu_get_pc(), offset, data);
1015            break;
1016      }
1017      player->pia[offset] = data;
1018   }
1019}
1020
1021static READ8_HANDLER( pr8210_bus_r )
1022{
1023   /*
1024       $80 = n/c
1025       $40 = (in) slider pot interrupt source (slider position limit detector, inside and outside)
1026       $20 = n/c
1027       $10 = (in) /FOCUS LOCK
1028       $08 = (in) /SPDL LOCK
1029       $04 = (in) SIZE 8/12
1030       $02 = (in) FG via op-amp (spindle motor stop detector)
1031       $01 = (in) SLOW TIMER OUT
1032    */
1033   laserdisc_state *ld = find_pr8210(machine);
1034   ldplayer_data *player = ld->player;
1035   slider_position sliderpos = ldcore_get_slider_position(ld);
1036   UINT8 focus_on = !(player->porta & 0x08);
1037   UINT8 spdl_on = !(player->porta & 0x10);
1038   UINT8 result = 0x00;
1039
1040   /* bus bit 6: slider position limit detector, inside and outside */
1041   if (sliderpos != SLIDER_MINIMUM && sliderpos != SLIDER_MAXIMUM)
1042      result |= 0x40;
1043
1044   /* bus bit 4: /FOCUS LOCK */
1045   if (!focus_on)
1046      result |= 0x10;
1047
1048   /* bus bit 3: /SPDL LOCK */
1049   if (!spdl_on)
1050      result |= 0x08;
1051
1052   /* bus bit 1: spindle motor stop detector */
1053   if (!spdl_on)
1054      result |= 0x02;
1055
1056   /* loop at beginning waits for $40=0, $02=1 */
1057   return result;
1058}
1059
1060static WRITE8_HANDLER( pr8210_porta_w )
1061{
1062   /*
1063       $80 = (out) SCAN C (F/R)
1064       $40 = (out) AUDIO SQ
1065       $20 = (out) VIDEO SQ
1066       $10 = (out) /SPDL ON
1067       $08 = (out) /FOCUS ON
1068       $04 = (out) SCAN B (L/H)
1069       $02 = (out) SCAN A (/SCAN)
1070       $01 = (out) JUMP TRG (jump back trigger, clock on high->low)
1071    */
1072   laserdisc_state *ld = find_pr8210(machine);
1073   ldplayer_data *player = ld->player;
1074   if ((data & 0xfe) != (player->porta & 0xfe))
1075   {
1076      int direction = (data & 0x80) ? 1 : -1;
1077
1078      printf("%03X:porta_w = %02X", activecpu_get_pc(), data);
1079      if (!(data & 0x01) && (player->porta & 0x01))
1080         ldcore_advance_slider(ld, direction);
1081      if (!(data & 0x02))
1082         printf(" SCAN:%c:%c", (data & 0x80) ? 'F' : 'R', (data & 0x04) ? 'L' : 'H');
1083      if (!(data & 0x08)) printf(" /FOCUSON");
1084      if (!(data & 0x10)) printf(" /SPDLON");
1085      if (data & 0x20) printf(" VIDEOSQ");
1086      if (data & 0x40) printf(" AUDIOSQ");
1087      printf("\n");
1088      player->porta = data;
1089
1090      ldcore_set_video_squelch(ld, (data & 0x20) != 0);
1091      update_audio_squelch(ld);
1092      if (!(data & 0x02))
1093      {
1094         int delta = (data & 0x04) ? PR8210_SCAN_SPEED : PR8210_SEEK_FAST_SPEED;
1095         ldcore_set_slider_speed(ld, delta * direction);
1096      }
1097      else
1098         ldcore_set_slider_speed(ld, 0);
1099   }
1100}
1101
1102static WRITE8_HANDLER( pr8210_portb_w )
1103{
1104   /*
1105       $80 = (out) /CS on PIA
1106       $40 = (out) 0 to self-generate IRQ
1107       $20 = (out) SLOW TRG
1108       $10 = (out) STANDBY LED
1109       $08 = (out) TP2
1110       $04 = (out) TP1
1111       $02 = (out) ???
1112       $01 = (out) LASER ON
1113    */
1114   laserdisc_state *ld = find_pr8210(machine);
1115   ldplayer_data *player = ld->player;
1116   cpunum_set_input_line(machine, player->cpunum, 0, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
1117   if ((data & 0x7f) != (player->portb & 0x7f))
1118   {
1119      printf("%03X:portb_w = %02X", activecpu_get_pc(), data);
1120      if (!(data & 0x01)) printf(" LASERON");
1121      if (!(data & 0x02)) printf(" ???");
1122      if (!(data & 0x04)) printf(" TP1");
1123      if (!(data & 0x08)) printf(" TP2");
1124      output_set_value("pr8210_standby", !(data & 0x10));
1125      if (!(data & 0x20)) printf(" SLOWTRG");
1126      if (!(data & 0x40)) printf(" IRQGEN");
1127//      if (data & 0x80) printf(" PIASEL");
1128      printf("\n");
1129      player->portb = data;
1130   }
1131}
1132
1133
1134static READ8_HANDLER( pr8210_t0_r )
1135{
1136   /* returns VSYNC state */
1137   laserdisc_state *ld = find_pr8210(machine);
1138   return !ld->player->vsync;
1139}
1140
1141
1142static READ8_HANDLER( pr8210_t1_r )
1143{
1144   /* must return 1 or else it tries to jump to an external ROM */
1145   return 1;
1146}
1147
1148
1149static ADDRESS_MAP_START( pr8210_map, ADDRESS_SPACE_PROGRAM, 8 )
1150   AM_RANGE(0x000, 0x7ff) AM_ROM
1151ADDRESS_MAP_END
1152
1153
1154static ADDRESS_MAP_START( pr8210_portmap, ADDRESS_SPACE_IO, 8 )
1155   AM_RANGE(0x00, 0xff) AM_READWRITE(pr8210_pia_r, pr8210_pia_w)
1156   AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ(pr8210_bus_r)
1157   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(pr8210_porta_w)
1158   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(pr8210_portb_w)
1159   AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(pr8210_t0_r)
1160   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(pr8210_t1_r)
1161ADDRESS_MAP_END
1162
1163
1164MACHINE_DRIVER_START( pr8210 )
1165   MDRV_CPU_ADD("pr8210", I8049, XTAL_4_41MHz)
1166   MDRV_CPU_PROGRAM_MAP(pr8210_map,0)
1167   MDRV_CPU_IO_MAP(pr8210_portmap,0)
1168MACHINE_DRIVER_END
src/emu/machine/z80dma.c
r3232r3233
447447   state_save_register_item(unique_tag, 0, z80dma->is_read);
448448   state_save_register_item(unique_tag, 0, z80dma->cur_cycle);
449449   state_save_register_item(unique_tag, 0, z80dma->latch);
450
451   return DEVICE_START_OK;
450452}
451453
452454
src/emu/machine/8255ppi.c
r3232r3233
537537   state_save_register_item_array(unique_tag, 0, ppi8255->out_mask);
538538   state_save_register_item_array(unique_tag, 0, ppi8255->read);
539539   state_save_register_item_array(unique_tag, 0, ppi8255->latch);
540
541   return DEVICE_START_OK;
540542}
541543
542544
src/emu/machine/smc91c9x.c
r3232r3233
539539   state_save_register_item_array(unique_tag, 0, smc->tx);
540540   state_save_register_item(unique_tag, 0, smc->sent);
541541   state_save_register_item(unique_tag, 0, smc->recd);
542
543   return DEVICE_START_OK;
542544}
543545
544546
src/emu/machine/8257dma.c
r3232r3233
389389   state_save_register_item(unique_tag, 0, dma8257->drq);
390390   state_save_register_item(unique_tag, 0, dma8257->status);
391391
392   return DEVICE_START_OK;
392393}
393394
394395
src/emu/machine/msm6242.c
r3232r3233
153153   msm6242->reg[1] = 0;
154154   msm6242->reg[2] = 0;
155155   memset(&msm6242->hold_time, 0, sizeof(mame_system_time));
156
157   return DEVICE_START_OK;
156158}
157159
158160
src/emu/machine/laserdsc.c
r3232r3233
19631963
19641964   /* register callbacks */
19651965   config_register(device->machine, "laserdisc", configuration_load, configuration_save);
1966
1967   return DEVICE_START_OK;
19661968}
19671969
19681970
src/emu/machine/pic8259.c
r3232r3233
372372   pic8259_t   *pic8259 = get_safe_token(device);
373373
374374   pic8259->intf = device->static_config;
375
376   return DEVICE_START_OK;
375377}
376378
377379
src/emu/machine/laserdsc.h
r3232r3233
2929   LASERDISC_TYPE_PIONEER_PR8210,         /* Pioneer PR-8210 / LD-V1100 */
3030   LASERDISC_TYPE_SIMUTREK_SPECIAL,      /* Pioneer PR-8210 with mods */
3131   LASERDISC_TYPE_PIONEER_LDV1000,         /* Pioneer LD-V1000 */
32   LASERDISC_TYPE_PHILLIPS_22VP931,      /* Phillips 22VP931 */
3233   LASERDISC_TYPE_PHILLIPS_22VP932,      /* Phillips 22VP932 (PAL) */
3334   LASERDISC_TYPE_SONY_LDP1450            /* Sony LDP-1450 */
3435};
r3232r3233
7172{
7273   UINT32               type;
7374   laserdisc_audio_func   audio;
74
75   /* rendering information */
75   const char *         sound;
7676   const char *         screen;
7777
7878   /* overlay information */
r3232r3233
8989    DEVICE CONFIGURATION MACROS
9090***************************************************************************/
9191
92#define MDRV_LASERDISC_ADD(_tag, _type) \
92#define MDRV_LASERDISC_ADD(_tag, _type, _screen, _sound) \
9393   MDRV_DEVICE_ADD(_tag, LASERDISC) \
94   MDRV_DEVICE_CONFIG_DATA32(laserdisc_config, type, LASERDISC_TYPE_##_type)
94   MDRV_DEVICE_CONFIG_DATA32(laserdisc_config, type, LASERDISC_TYPE_##_type) \
95   MDRV_DEVICE_CONFIG_DATAPTR(laserdisc_config, screen, _screen) \
96   MDRV_DEVICE_CONFIG_DATAPTR(laserdisc_config, sound, _sound) \
9597
9698#define MDRV_LASERDISC_AUDIO(_func) \
9799   MDRV_DEVICE_CONFIG_DATAPTR(laserdisc_config, audio, _func)
98100
99#define MDRV_LASERDISC_SCREEN(_tag) \
100   MDRV_DEVICE_CONFIG_DATAPTR(laserdisc_config, screen, _tag)
101
102101#define MDRV_LASERDISC_OVERLAY(_update, _width, _height, _format) \
103102   MDRV_DEVICE_CONFIG_DATAPTR(laserdisc_config, overupdate, video_update_##_update) \
104103   MDRV_DEVICE_CONFIG_DATA32(laserdisc_config, overwidth, _width) \
r3232r3233
158157
159158/* ----- core control and status ----- */
160159
161/* call this once per field (i.e., 59.94 times/second for NTSC) */
162void laserdisc_vsync(const device_config *device);
163
164160/* get a bitmap for the current frame (and the frame number) */
165161UINT32 laserdisc_get_video(const device_config *device, bitmap_t **bitmap);
166162
src/emu/machine/ldcore.c
r3232r3233
3333
3434/* we simulate extra lead-in and lead-out tracks */
3535#define VIRTUAL_LEAD_IN_TRACKS      200
36#define MAX_TOTAL_TRACKS         54000
3637#define VIRTUAL_LEAD_OUT_TRACKS      200
3738
3839
r3232r3233
5051
5152   /* disc parameters */
5253   chd_file *         disc;               /* handle to the disc itself */
54   int               width;               /* width of video */
55   int               height;               /* height of video */
56   UINT32            fps_times_1million;      /* frame rate of video */
57   int               samplerate;            /* audio samplerate */
58   UINT8            readpending;         /* true if a read is pending */
59   UINT32            chdtracks;            /* number of tracks in the CHD */
5360   av_codec_decompress_config avconfig;      /* decompression configuration */
54   UINT8            readpending;         /* true if a read is pending */
55   UINT32            maxtrack;            /* maximum track number */
5661
5762   /* core states */
5863   UINT8            audiosquelch;         /* audio squelch state: bit 0 = audio 1, bit 1 = audio 2 */
5964   UINT8            videosquelch;         /* video squelch state: bit 0 = on/off */
6065   UINT8            fieldnum;            /* field number (0 or 1) */
61   INT32            curtrack;            /* current track */
66   INT32            curtrack;            /* current track at this end of this vsync */
67   UINT32            maxtrack;            /* maximum track number */
68   attoseconds_t      attospertrack;         /* attoseconds per track, or 0 if not moving */
69   attotime         sliderupdate;         /* time of last slider update */
6270
6371   /* video data */
6472   bitmap_t *         videoframe[3];         /* currently cached frames */
r3232r3233
7785   UINT32            audiocursamples;      /* current samples this track */
7886   UINT32            audiomaxsamples;      /* maximum samples per track */
7987   int               audiocustom;         /* custom sound index */
80   int               samplerate;            /* playback samplerate */
8188
8289   /* metadata */
8390   vbi_metadata      metadata[2];         /* metadata parsed from the stream, for each field */
r3232r3233
261268
262269
263270/*-------------------------------------------------
264    audio_channel_active - return TRUE if the
265    given audio channel should be output
271    update_audio - update the audio stream to the
272    current time
266273-------------------------------------------------*/
267274
268INLINE int audio_channel_active(ldcore_data *ldcore, int channel)
275INLINE void update_audio(ldcore_data *ldcore)
269276{
270   return (~ldcore->audiosquelch >> channel) & 1;
277   if (ldcore->audiocustom != -1)
278   {
279      sound_token *token = custom_get_token(ldcore->audiocustom);
280      stream_update(token->stream);
281   }
271282}
272283
273284
274285/*-------------------------------------------------
275    video_active - return TRUE if the video should
276    be output
286    add_and_clamp_track - add a delta to the
287    current track and clamp to minimum/maximum
288    values
277289-------------------------------------------------*/
278290
279INLINE int video_active(ldcore_data *ldcore)
291INLINE void add_and_clamp_track(ldcore_data *ldcore, INT32 delta)
280292{
281   return !ldcore->videosquelch;
282}
283
284
285/*-------------------------------------------------
286    add_to_current_track - add a value to the
287    current track, stopping if we hit the min or
288    max
289-------------------------------------------------*/
290
291INLINE int add_to_current_track(ldcore_data *ldcore, INT32 delta)
292{
293293   ldcore->curtrack += delta;
294   if (ldcore->curtrack < 1)
295   {
296      ldcore->curtrack = 1;
297      return TRUE;
298   }
299   else if (ldcore->curtrack >= ldcore->maxtrack - 1)
300   {
301      ldcore->curtrack = ldcore->maxtrack - 1;
302      return TRUE;
303   }
304   return FALSE;
294   ldcore->curtrack = MAX(ldcore->curtrack, 1);
295   ldcore->curtrack = MIN(ldcore->curtrack, ldcore->maxtrack - 1);
305296}
306297
307298
r3232r3233
335326***************************************************************************/
336327
337328/*-------------------------------------------------
338    laserdisc_vsync - call this once per field
339    on the VSYNC signal
329    update_slider_pos - based on the current
330    speed and elapsed time, update the current
331    track position
340332-------------------------------------------------*/
341333
342void laserdisc_vsync(const device_config *device)
334static void update_slider_pos(ldcore_data *ldcore, attotime curtime)
343335{
336   /* if not moving, update to now */
337   if (ldcore->attospertrack == 0)
338      ldcore->sliderupdate = curtime;
339
340   /* otherwise, compute the number of tracks covered */
341   else
342   {
343      attoseconds_t delta = attotime_to_attoseconds(attotime_sub(curtime, ldcore->sliderupdate));
344      INT32 tracks_covered;
345
346      /* determine how many tracks we covered and advance */
347      if (ldcore->attospertrack >= 0)
348      {
349         tracks_covered = delta / ldcore->attospertrack;
350         add_and_clamp_track(ldcore, tracks_covered);
351         if (tracks_covered != 0)
352            ldcore->sliderupdate = attotime_add_attoseconds(ldcore->sliderupdate, tracks_covered * ldcore->attospertrack);
353      }
354      else
355      {
356         tracks_covered = delta / -ldcore->attospertrack;
357         add_and_clamp_track(ldcore, -tracks_covered);
358         if (tracks_covered != 0)
359            ldcore->sliderupdate = attotime_add_attoseconds(ldcore->sliderupdate, tracks_covered * -ldcore->attospertrack);
360      }
361   }
362}
363
364
365/*-------------------------------------------------
366    vblank_state_changed - called on each state
367    change of the VBLANK signal
368-------------------------------------------------*/
369
370static void vblank_state_changed(const device_config *screen, void *param, int vblank_state)
371{
372   const device_config *device = param;
344373   laserdisc_state *ld = get_safe_token(device);
345374   ldcore_data *ldcore = ld->core;
375   attotime curtime = timer_get_time();
346376
377   /* update current track based on slider speed */
378   update_slider_pos(ldcore, curtime);
379
380   /* on rising edge, call the player-specific VSYNC function */
381   if (vblank_state)
382   {
383      if (ldcore->intf.vsync != NULL)
384         (*ldcore->intf.vsync)(ld);
385      return;
386   }
387
388   /* on falling edge, do the bulk of the processing */
347389   /* wait for previous read and decode to finish */
348390   process_track_data(device);
349391
350392   /* update the state */
351393   if (ldcore->intf.update != NULL)
352   {
353      INT32 advanceby = (*ldcore->intf.update)(ld, &ldcore->metadata[ldcore->fieldnum], ldcore->fieldnum, timer_get_time());
354      add_to_current_track(ldcore, advanceby);
355   }
394      add_and_clamp_track(ldcore, (*ldcore->intf.update)(ld, &ldcore->metadata[ldcore->fieldnum], ldcore->fieldnum, curtime));
356395
357396   /* flush any audio before we read more */
358   if (ldcore->audiocustom != -1)
359   {
360      sound_token *token = custom_get_token(ldcore->audiocustom);
361      stream_update(token->stream);
362   }
397   update_audio(ldcore);
363398
364399   /* start reading the track data for the next round */
365400   ldcore->fieldnum ^= 1;
r3232r3233
481516      frameindex = (frameindex + ARRAY_LENGTH(ldcore->videofields) - 1) % ARRAY_LENGTH(ldcore->videofields);
482517
483518   /* if no video present, return the empty frame */
484   if (!video_active(ldcore) || ldcore->videofields[frameindex] < 2)
519   if (ldcore->videosquelch || ldcore->videofields[frameindex] < 2)
485520   {
486521      *bitmap = ldcore->emptyframe;
487522      return 0;
r3232r3233
506541   int field = ldcore->fieldnum ^ 1;
507542
508543   /* if no video present, return */
509   if (!video_active(ldcore))
544   if (ldcore->videosquelch)
510545      return 0;
511546
512547   switch (code)
r3232r3233
551586
552587void ldcore_set_audio_squelch(laserdisc_state *ld, UINT8 squelchleft, UINT8 squelchright)
553588{
589   update_audio(ld->core);
554590   ld->core->audiosquelch = (squelchleft ? 1 : 0) | (squelchright ? 2 : 0);
555591}
556592
r3232r3233
566602}
567603
568604
605/*-------------------------------------------------
606    ldcore_set_slider_speed - dynamically change
607    the slider speed
608-------------------------------------------------*/
569609
610void ldcore_set_slider_speed(laserdisc_state *ld, INT32 tracks_per_vsync)
611{
612   ldcore_data *ldcore = ld->core;
613   attotime vsyncperiod = video_screen_get_frame_period(ld->screen);
614
615   update_slider_pos(ldcore, timer_get_time());
616
617   /* if 0, set the time to 0 */
618   if (tracks_per_vsync == 0)
619      ldcore->attospertrack = 0;
620
621   /* positive values store positive times */
622   else if (tracks_per_vsync > 0)
623      ldcore->attospertrack = attotime_to_attoseconds(attotime_div(vsyncperiod, tracks_per_vsync));
624
625   /* negative values store negative times */
626   else
627      ldcore->attospertrack = -attotime_to_attoseconds(attotime_div(vsyncperiod, -tracks_per_vsync));
628
629printf("Slider speed = %d\n", tracks_per_vsync);
630}
631
632
633/*-------------------------------------------------
634    ldcore_advance_slider - advance the slider by
635    a certain number of tracks
636-------------------------------------------------*/
637
638void ldcore_advance_slider(laserdisc_state *ld, INT32 numtracks)
639{
640   ldcore_data *ldcore = ld->core;
641
642   update_slider_pos(ldcore, timer_get_time());
643   add_and_clamp_track(ldcore, numtracks);
644printf("Advance by %d\n", numtracks);
645}
646
647
648/*-------------------------------------------------
649    ldcore_get_slider_position - get the current
650    slider position
651-------------------------------------------------*/
652
653slider_position ldcore_get_slider_position(laserdisc_state *ld)
654{
655   ldcore_data *ldcore = ld->core;
656
657   /* update the slider position first */
658   update_slider_pos(ldcore, timer_get_time());
659
660   /* return the status */
661   if (ldcore->curtrack == 1)
662      return SLIDER_MINIMUM;
663   else if (ldcore->curtrack < VIRTUAL_LEAD_IN_TRACKS)
664      return SLIDER_VIRTUAL_LEADIN;
665   else if (ldcore->curtrack < VIRTUAL_LEAD_IN_TRACKS + ldcore->chdtracks)
666      return SLIDER_CHD;
667   else if (ldcore->curtrack < VIRTUAL_LEAD_IN_TRACKS + MAX_TOTAL_TRACKS)
668      return SLIDER_OUTSIDE_CHD;
669   else if (ldcore->curtrack < ldcore->maxtrack - 1)
670      return SLIDER_VIRTUAL_LEADOUT;
671   else
672      return SLIDER_MAXIMUM;
673}
674
675
676
570677/***************************************************************************
571678    GENERIC HELPER FUNCTIONS
572679***************************************************************************/
r3232r3233
792899   ldcore->avconfig.maxsamples = ldcore->audiomaxsamples;
793900   ldcore->avconfig.actsamples = &ldcore->audiocursamples;
794901   ldcore->audiocursamples = 0;
795   if (!audio_channel_active(ldcore, 0))
796      ldcore->avconfig.audio[0] = NULL;
797   if (!audio_channel_active(ldcore, 1))
798      ldcore->avconfig.audio[1] = NULL;
799902
800903   /* configure the codec and then read */
801904   if (ldcore->disc != NULL)
r3232r3233
803906      err = chd_codec_config(ldcore->disc, AV_CODEC_DECOMPRESS_CONFIG, &ldcore->avconfig);
804907      if (err == CHDERR_NONE)
805908      {
806         INT32 maxtrack = chd_get_header(ldcore->disc)->totalhunks / 2;
807909         INT32 chdtrack = tracknum - 1 - VIRTUAL_LEAD_IN_TRACKS;
808910
809911         /* clamp the track */
810912         chdtrack = MAX(chdtrack, 0);
811         chdtrack = MIN(chdtrack, maxtrack - 1);
913         chdtrack = MIN(chdtrack, ldcore->chdtracks - 1);
812914         err = chd_read_async(ldcore->disc, chdtrack * 2 + fieldnum, NULL);
813915         ldcore->readpending = TRUE;
814916      }
r3232r3233
10051107   ldcore_data *ldcore = ld->core;
10061108   stream_sample_t *dst0 = outputs[0];
10071109   stream_sample_t *dst1 = outputs[1];
1110   INT16 leftand, rightand;
10081111   int samples_avail = 0;
10091112
1113   /* compute AND values based on the squelch */
1114   leftand = (ldcore->audiosquelch & 1) ? 0x0000 : 0xffff;
1115   rightand = (ldcore->audiosquelch & 2) ? 0x0000 : 0xffff;
1116
10101117   /* see if we have enough samples to fill the buffer; if not, drop out */
10111118   if (ld != NULL)
10121119   {
r3232r3233
10321139      /* copy samples, clearing behind us as we go */
10331140      while (sampout != ldcore->audiobufin && samples-- > 0)
10341141      {
1035         *dst0++ = buffer0[sampout];
1036         *dst1++ = buffer1[sampout];
1142         *dst0++ = buffer0[sampout] & leftand;
1143         *dst1++ = buffer1[sampout] & rightand;
10371144         buffer0[sampout] = 0;
10381145         buffer1[sampout] = 0;
10391146         sampout++;
r3232r3233
10461153      if (samples > 0)
10471154      {
10481155         int sampout = (ldcore->audiobufout == 0) ? ldcore->audiobufsize - 1 : ldcore->audiobufout - 1;
1049         stream_sample_t fill0 = buffer0[sampout];
1050         stream_sample_t fill1 = buffer1[sampout];
1156         stream_sample_t fill0 = buffer0[sampout] & leftand;
1157         stream_sample_t fill1 = buffer1[sampout] & rightand;
10511158
10521159         while (samples-- > 0)
10531160         {
r3232r3233
13081415
13091416
13101417/***************************************************************************
1311    DEVICE INTERFACE
1418    INITIALIZATION
13121419***************************************************************************/
13131420
13141421/*-------------------------------------------------
1315    device start callback
1422    init_disc - initialize the state of the
1423    CHD disc
13161424-------------------------------------------------*/
13171425
1318static DEVICE_START( laserdisc )
1426static void init_disc(const device_config *device)
13191427{
1320   int fps = 30, fpsfrac = 0, width = 720, height = 240, interlaced = 1, channels = 2, rate = 44100;
1321   const laserdisc_config *config = device->inline_config;
13221428   laserdisc_state *ld = get_safe_token(device);
1323   UINT32 fps_times_1million;
1324   ldcore_data *ldcore;
1325   char metadata[256];
1326   int sndnum, index;
1327   int statesize;
1429   ldcore_data *ldcore = ld->core;
13281430   chd_error err;
13291431
1330   /* save a copy of the device pointer */
1331   ld->device = device;
1332
1333   /* allocate memory for the core state */
1334   ld->core = auto_malloc(sizeof(*ld->core));
1335   memset(ld->core, 0, sizeof(*ld->core));
1336   ldcore = ld->core;
1337
1338   /* determine the maximum player-specific state size and allocate it */
1339   statesize = 0;
1340   for (index = 0; index < ARRAY_LENGTH(player_interfaces); index++)
1341      statesize = MAX(statesize, player_interfaces[index]->statesize);
1342   ld->player = auto_malloc(statesize);
1343   memset(ld->player, 0, statesize);
1344
1345   /* copy config data to the live state */
1346   ldcore->config = *config;
1347   if (ldcore->config.overclip.max_x == ldcore->config.overclip.min_x || ldcore->config.overclip.max_y == ldcore->config.overclip.min_y)
1348   {
1349      ldcore->config.overclip.min_x = ldcore->config.overclip.min_y = 0;
1350      ldcore->config.overclip.max_x = ldcore->config.overwidth - 1;
1351      ldcore->config.overclip.max_y = ldcore->config.overheight - 1;
1352   }
1353   if (ldcore->config.overscalex == 0)
1354      ldcore->config.overscalex = 1.0f;
1355   if (ldcore->config.overscaley == 0)
1356      ldcore->config.overscaley = 1.0f;
1357
13581432   /* find the disc */
13591433   ldcore->disc = get_disk_handle(device->tag);
1360   ldcore->audiocustom = 0;
1361   for (sndnum = 0; sndnum < MAX_SOUND; sndnum++)
1362   {
1363      if (device->machine->config->sound[sndnum].tag != NULL && strcmp(device->machine->config->sound[sndnum].tag, device->tag) == 0)
1364         break;
1365      if (device->machine->config->sound[sndnum].type == SOUND_CUSTOM)
1366         ldcore->audiocustom++;
1367   }
1368   if (sndnum == MAX_SOUND)
1369      ldcore->audiocustom = -1;
13701434
1435   /* set default parameters */
1436   ldcore->width = 720;
1437   ldcore->height = 240;
1438   ldcore->fps_times_1million = 59940000;
1439   ldcore->samplerate = 48000;
1440
13711441   /* get the disc metadata and extract the ld */
1442   ldcore->chdtracks = 0;
1443   ldcore->maxtrack = VIRTUAL_LEAD_IN_TRACKS + MAX_TOTAL_TRACKS + VIRTUAL_LEAD_OUT_TRACKS;
13721444   if (ldcore->disc != NULL)
13731445   {
1446      int fps, fpsfrac, interlaced, channels;
1447      char metadata[256];
1448
13741449      /* require the A/V codec */
13751450      if (chd_get_header(ldcore->disc)->compression != CHDCOMPRESSION_AV)
13761451         fatalerror("Laserdisc video must be compressed with the A/V codec!");
13771452
1378      /* read and extract the metadata */
1453      /* read the metadata */
13791454      err = chd_get_metadata(ldcore->disc, AV_METADATA_TAG, 0, metadata, sizeof(metadata), NULL, NULL);
13801455      if (err != CHDERR_NONE)
13811456         fatalerror("Non-A/V CHD file specified");
1382      if (sscanf(metadata, AV_METADATA_FORMAT, &fps, &fpsfrac, &width, &height, &interlaced, &channels, &rate) != 7)
1457
1458      /* extract the metadata */
1459      if (sscanf(metadata, AV_METADATA_FORMAT, &fps, &fpsfrac, &ldcore->width, &ldcore->height, &interlaced, &channels, &ldcore->samplerate) != 7)
13831460         fatalerror("Invalid metadata in CHD file");
1461      else
1462         ldcore->fps_times_1million = fps * 1000000 + fpsfrac;
13841463
13851464      /* require interlaced video */
13861465      if (!interlaced)
13871466         fatalerror("Laserdisc video must be interlaced!");
13881467
13891468      /* determine the maximum track and allocate a frame buffer */
1390      ldcore->maxtrack = chd_get_header(ldcore->disc)->totalhunks / 2;
1469      ldcore->chdtracks = chd_get_header(ldcore->disc)->totalhunks / 2;
13911470   }
1392   else
1393      ldcore->maxtrack = 54000;
1394   ldcore->maxtrack += VIRTUAL_LEAD_IN_TRACKS + VIRTUAL_LEAD_OUT_TRACKS;
1471   ldcore->maxtrack = MAX(ldcore->maxtrack, VIRTUAL_LEAD_IN_TRACKS + VIRTUAL_LEAD_OUT_TRACKS + ldcore->chdtracks);
1472}
13951473
1474
1475/*-------------------------------------------------
1476    init_video - initialize the state of the
1477    video rendering
1478-------------------------------------------------*/
1479
1480static void init_video(const device_config *device)
1481{
1482   laserdisc_state *ld = get_safe_token(device);
1483   ldcore_data *ldcore = ld->core;
1484   int index;
1485
1486   /* register for VBLANK callbacks */
1487   video_screen_register_vblank_callback(ld->screen, vblank_state_changed, (void *)device);
1488
13961489   /* allocate video frames */
13971490   for (index = 0; index < ARRAY_LENGTH(ldcore->videofields); index++)
13981491   {
13991492      /* first allocate a YUY16 bitmap at 2x the height */
1400      ldcore->videoframe[index] = auto_bitmap_alloc(width, height * 2, BITMAP_FORMAT_YUY16);
1493      ldcore->videoframe[index] = auto_bitmap_alloc(ldcore->width, ldcore->height * 2, BITMAP_FORMAT_YUY16);
14011494      fillbitmap_yuy16(ldcore->videoframe[index], 40, 109, 240);
14021495
14031496      /* make a copy of the bitmap that clips out the VBI and horizontal blanking areas */
r3232r3233
14091502   }
14101503
14111504   /* allocate an empty frame of the same size */
1412   ldcore->emptyframe = auto_bitmap_alloc(width, height * 2, BITMAP_FORMAT_YUY16);
1505   ldcore->emptyframe = auto_bitmap_alloc(ldcore->width, ldcore->height * 2, BITMAP_FORMAT_YUY16);
14131506   fillbitmap_yuy16(ldcore->emptyframe, 0, 128, 128);
14141507
1415   /* allocate audio buffers */
1416   fps_times_1million = fps * 1000000 + fpsfrac;
1417   ldcore->audiomaxsamples = ((UINT64)rate * 1000000 + fps_times_1million - 1) / fps_times_1million;
1418   ldcore->audiobufsize = ldcore->audiomaxsamples * 4;
1419   ldcore->audiobuffer[0] = auto_malloc(ldcore->audiobufsize * sizeof(ldcore->audiobuffer[0][0]));
1420   ldcore->audiobuffer[1] = auto_malloc(ldcore->audiobufsize * sizeof(ldcore->audiobuffer[1][0]));
1421   ldcore->samplerate = rate;
1422
14231508   /* allocate texture for rendering */
14241509   ldcore->videoenable = TRUE;
14251510   ldcore->videotex = render_texture_alloc(NULL, NULL);
r3232r3233
14361521      if (ldcore->overtex == NULL)
14371522         fatalerror("Out of memory allocating overlay texture");
14381523   }
1524}
14391525
1526
1527/*-------------------------------------------------
1528    init_audio - initialize the state of the
1529    audio rendering
1530-------------------------------------------------*/
1531
1532static void init_audio(const device_config *device)
1533{
1534   laserdisc_state *ld = get_safe_token(device);
1535   ldcore_data *ldcore = ld->core;
1536   int sndnum;
1537
1538   /* find the custom audio */
1539   ldcore->audiocustom = 0;
1540   for (sndnum = 0; sndnum < MAX_SOUND; sndnum++)
1541   {
1542      if (device->machine->config->sound[sndnum].tag != NULL && strcmp(device->machine->config->sound[sndnum].tag, ldcore->config.sound) == 0)
1543         break;
1544      if (device->machine->config->sound[sndnum].type == SOUND_CUSTOM)
1545         ldcore->audiocustom++;
1546   }
1547   if (sndnum == MAX_SOUND)
1548      ldcore->audiocustom = -1;
1549
1550   /* allocate audio buffers */
1551   ldcore->audiomaxsamples = ((UINT64)ldcore->samplerate * 1000000 + ldcore->fps_times_1million - 1) / ldcore->fps_times_1million;
1552   ldcore->audiobufsize = ldcore->audiomaxsamples * 4;
1553   ldcore->audiobuffer[0] = auto_malloc(ldcore->audiobufsize * sizeof(ldcore->audiobuffer[0][0]));
1554   ldcore->audiobuffer[1] = auto_malloc(ldcore->audiobufsize * sizeof(ldcore->audiobuffer[1][0]));
1555}
1556
1557
1558
1559/***************************************************************************
1560    DEVICE INTERFACE
1561***************************************************************************/
1562
1563/*-------------------------------------------------
1564    device start callback
1565-------------------------------------------------*/
1566
1567static DEVICE_START( laserdisc )
1568{
1569   const laserdisc_config *config = device->inline_config;
1570   laserdisc_state *ld = get_safe_token(device);
1571   ldcore_data *ldcore;
1572   int statesize;
1573   int index;
1574
1575   /* ensure that our screen is started first */
1576   ld->screen = devtag_get_device(device->machine, VIDEO_SCREEN, config->screen);
1577   assert(ld->screen != NULL);
1578   if (!ld->screen->started)
1579      return DEVICE_START_MISSING_DEPENDENCY;
1580
1581   /* save a copy of the device pointer */
1582   ld->device = device;
1583
1584   /* allocate memory for the core state */
1585   ld->core = auto_malloc(sizeof(*ld->core));
1586   memset(ld->core, 0, sizeof(*ld->core));
1587   ldcore = ld->core;
1588
1589   /* determine the maximum player-specific state size and allocate it */
1590   statesize = 0;
1591   for (index = 0; index < ARRAY_LENGTH(player_interfaces); index++)
1592      statesize = MAX(statesize, player_interfaces[index]->statesize);
1593   ld->player = auto_malloc(statesize);
1594   memset(ld->player, 0, statesize);
1595
1596   /* copy config data to the live state */
1597   ldcore->config = *config;
1598   if (ldcore->config.overclip.max_x == ldcore->config.overclip.min_x || ldcore->config.overclip.max_y == ldcore->config.overclip.min_y)
1599   {
1600      ldcore->config.overclip.min_x = ldcore->config.overclip.min_y = 0;
1601      ldcore->config.overclip.max_x = ldcore->config.overwidth - 1;
1602      ldcore->config.overclip.max_y = ldcore->config.overheight - 1;
1603   }
1604   if (ldcore->config.overscalex == 0)
1605      ldcore->config.overscalex = 1.0f;
1606   if (ldcore->config.overscaley == 0)
1607      ldcore->config.overscaley = 1.0f;
1608
1609   /* initialize the various pieces */
1610   init_disc(device);
1611   init_video(device);
1612   init_audio(device);
1613
14401614   /* register callbacks */
14411615   config_register(device->machine, "laserdisc", configuration_load, configuration_save);
1616
1617   return DEVICE_START_OK;
14421618}
14431619
14441620
r3232r3233
14701646static DEVICE_RESET( laserdisc )
14711647{
14721648   laserdisc_state *ld = get_safe_token(device);
1649   attotime curtime = timer_get_time();
14731650   ldcore_data *ldcore = ld->core;
14741651   int pltype, line;
14751652
r3232r3233
14901667   }
14911668
14921669   /* set up the general ld */
1670   ldcore->audiosquelch = 3;
14931671   ldcore->videosquelch = 1;
1494   ldcore->audiosquelch = 3;
1672   ldcore->fieldnum = 0;
1673   ldcore->curtrack = 1;
1674   ldcore->attospertrack = 0;
1675   ldcore->sliderupdate = curtime;
14951676
1496   /* default to track 1 */
1497   ldcore->curtrack = 1;
1677   /* reset metadata */
14981678   ldcore->last_frame = 0;
14991679   ldcore->last_chapter = 0;
15001680
r3232r3233
15381718DEVICE_GET_INFO( laserdisc )
15391719{
15401720   const laserdisc_config *config = NULL;
1721   const ldplayer_interface *intf = NULL;
15411722   int pltype;
15421723
15431724   /* if we have a device, figure out where our config lives */
15441725   if (device != NULL)
15451726   {
15461727      laserdisc_state *ld = device->token;
1547      config = (ld == NULL || ld->core == NULL) ? device->inline_config : &ld->core->config;
1728      config = device->inline_config;
1729      if (ld != NULL && ld->core != NULL)
1730      {
1731         config = &ld->core->config;
1732         intf = &ld->core->intf;
1733      }
15481734   }
15491735
1736   /* if we don't have an interface, but we have a config, look up the interface */
1737   if (intf == NULL && config != NULL)
1738      for (pltype = 0; pltype < ARRAY_LENGTH(player_interfaces); pltype++)
1739         if (player_interfaces[pltype]->type == config->type)
1740         {
1741            intf = player_interfaces[pltype];
1742            break;
1743         }
1744
15501745   switch (state)
15511746   {
15521747      /* --- the following bits of info are returned as 64-bit signed integers --- */
r3232r3233
15551750      case DEVINFO_INT_CLASS:               info->i = DEVICE_CLASS_VIDEO;                  break;
15561751      case LDINFO_INT_TYPE:               info->i = config->type;                        break;
15571752
1753      /* --- the following bits of info are returned as pointers --- */
1754      case DEVINFO_PTR_ROM_REGION:         info->romregion = (intf != NULL) ? intf->romregion : NULL; break;
1755      case DEVINFO_PTR_MACHINE_CONFIG:      info->machine_config = (intf != NULL) ? intf->machine_config : NULL; break;
1756
15581757      /* --- the following bits of info are returned as pointers to data or functions --- */
15591758      case DEVINFO_FCT_SET_INFO:            info->set_info = DEVICE_SET_INFO_NAME(laserdisc);    break;
15601759      case DEVINFO_FCT_START:               info->start = DEVICE_START_NAME(laserdisc);       break;
r3232r3233
15621761      case DEVINFO_FCT_RESET:               info->reset = DEVICE_RESET_NAME(laserdisc);         break;
15631762
15641763      /* --- the following bits of info are returned as NULL-terminated strings --- */
1565      case DEVINFO_STR_NAME:
1566         info->s = "Unknown Laserdisc Player";
1567         for (pltype = 0; pltype < ARRAY_LENGTH(player_interfaces); pltype++)
1568            if (player_interfaces[pltype]->type == config->type)
1569               info->s = player_interfaces[pltype]->name;
1570         break;
1571      case DEVINFO_STR_FAMILY:            info->s = "Laserdisc Player";         break;
1572      case DEVINFO_STR_VERSION:            info->s = "1.0";                  break;
1573      case DEVINFO_STR_SOURCE_FILE:         info->s = __FILE__;                  break;
1764      case DEVINFO_STR_NAME:               info->s = (intf != NULL) ? intf->name : "Unknown Laserdisc Player";   break;
1765      case DEVINFO_STR_FAMILY:            info->s = "Laserdisc Player";                  break;
1766      case DEVINFO_STR_VERSION:            info->s = "1.0";                           break;
1767      case DEVINFO_STR_SOURCE_FILE:         info->s = __FILE__;                           break;
15741768      case DEVINFO_STR_CREDITS:            info->s = "Copyright Nicola Salmoria and the MAME Team"; break;
15751769   }
15761770}
src/emu/machine/ldcore.h
r3232r3233
5555   LDSTATE_OTHER                     /* other states start here */
5656};
5757
58
59/* slider position */
60enum _slider_position
61{
62   SLIDER_MINIMUM,                     /* at the minimum value */
63   SLIDER_VIRTUAL_LEADIN,               /* within the virtual lead-in area */
64   SLIDER_CHD,                        /* within the boundaries of the CHD */
65   SLIDER_OUTSIDE_CHD,                  /* outside of the CHD area but before the virtual lead-out area */
66   SLIDER_VIRTUAL_LEADOUT,               /* within the virtual lead-out area */
67   SLIDER_MAXIMUM                     /* at the maximum value */
68};
69typedef enum _slider_position slider_position;
70
71
5872/* special frame and chapter numbers from VBI conversion */
5973#define FRAME_NOT_PRESENT         -2                  /* no frame number information present */
6074#define FRAME_LEAD_IN            -1                  /* lead-in code detected */
r3232r3233
109123struct _laserdisc_state
110124{
111125   const device_config *   device;               /* pointer to owning device */
126   const device_config *   screen;               /* pointer to the screen device */
112127   ldcore_data *         core;               /* private core data */
113128   ldplayer_data *         player;               /* private player data */
114129
r3232r3233
119134
120135/* player-specific callbacks */
121136typedef void (*laserdisc_init_func)(laserdisc_state *ld);
137typedef void (*laserdisc_vsync_func)(laserdisc_state *ld);
122138typedef INT32 (*laserdisc_update_func)(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime);
123139typedef void (*laserdisc_w_func)(laserdisc_state *ld, UINT8 prev, UINT8 new);
124140typedef UINT8 (*laserdisc_r_func)(laserdisc_state *ld);
r3232r3233
131147   int                  type;               /* type of the player */
132148   size_t               statesize;            /* size of the state */
133149   const char *         name;               /* name of the player */
150   const rom_entry *      romregion;            /* pointer to ROM region information */
151   const machine_config_token *machine_config;      /* pointer to machine configuration */
134152   laserdisc_init_func      init;               /* initialization callback */
135   laserdisc_update_func   update;               /* update callback */
153   laserdisc_vsync_func   vsync;               /* vsync begin callback */
154   laserdisc_update_func   update;               /* update callback (vblank end) */
136155   laserdisc_w_func      writedata;            /* parallel data write */
137156   laserdisc_w_func      writeline[LASERDISC_INPUT_LINES]; /* single line write */
138157   laserdisc_r_func      readdata;            /* parallel data read */
r3232r3233
171190/* set the video squelch state */
172191void ldcore_set_video_squelch(laserdisc_state *ld, UINT8 squelch);
173192
193/* dynamically change the slider speed */
194void ldcore_set_slider_speed(laserdisc_state *ld, INT32 tracks_per_vsync);
174195
196/* advance the slider by a certain number of tracks */
197void ldcore_advance_slider(laserdisc_state *ld, INT32 numtracks);
175198
199/* get the current slider position */
200slider_position ldcore_get_slider_position(laserdisc_state *ld);
201
202
203
176204/* ----- generic implementations ----- */
177205
178206/* generically update in a way that works for most situations */
src/emu/machine/at28c16.c
r3232r3233
156156   state_save_register_item( unique_tag, 0, c->a9_12v );
157157   state_save_register_item( unique_tag, 0, c->oe_12v );
158158   state_save_register_item( unique_tag, 0, c->last_write );
159
160   return DEVICE_START_OK;
159161}
160162
161163/*-------------------------------------------------
src/emu/machine/latch8.c
r3232r3233
223223   state_save_combine_module_and_tag(unique_tag, "latch8", device->tag);
224224
225225   state_save_register_item(unique_tag, 0, latch8->value);
226
227   return DEVICE_START_OK;
226228}
227229
228230
src/emu/machine/8237dma.c
r3232r3233
395395   dma8237_t   *dma8237 = get_safe_token(device);
396396
397397   dma8237->intf = device->static_config;
398
399   return DEVICE_START_OK;
398400}
399401
400402
src/emu/machine/cdp1852.c
r3232r3233
156156   state_save_register_item(unique_tag, 0, cdp1852->next_data);
157157   state_save_register_item(unique_tag, 0, cdp1852->sr);
158158   state_save_register_item(unique_tag, 0, cdp1852->next_sr);
159
160   return DEVICE_START_OK;
159161}
160162
161163static DEVICE_RESET( cdp1852 )
src/emu/machine/pit8253.c
r3232r3233
10441044}
10451045
10461046
1047static void common_start( const device_config *device, int device_type ) {
1047static device_start_err common_start( const device_config *device, int device_type ) {
10481048   pit8253_t   *pit8253 = get_safe_token(device);
10491049   char      unique_tag[30];
10501050   int         timerno;
r3232r3233
10871087      state_save_register_item(unique_tag, timerno, timer->programmed);
10881088      state_save_register_item(unique_tag, timerno, timer->clock);
10891089   }
1090
1091   return DEVICE_START_OK;
10901092}
10911093
10921094
10931095static DEVICE_START( pit8253 ) {
1094   common_start( device, TYPE_PIT8253 );
1096   return common_start( device, TYPE_PIT8253 );
10951097}
10961098
10971099
10981100static DEVICE_START( pit8254 ) {
1099   common_start( device, TYPE_PIT8254 );
1101   return common_start( device, TYPE_PIT8254 );
11001102}
11011103
11021104
src/emu/machine/ldv1000.c
r3232r3233
9999   LASERDISC_TYPE_PIONEER_LDV1000,            /* type of the player */
100100   sizeof(ldplayer_data),                  /* size of the state */
101101   "Pioneer LD-V1000",                     /* name of the player */
102   NULL,                              /* pointer to ROM region information */
103   NULL,                              /* pointer to machine configuration */
102104   ldv1000_init,                        /* initialization callback */
105   NULL,                              /* vsync callback */
103106   ldv1000_update,                        /* update callback */
104107   ldv1000_data_w,                        /* parallel data write */
105108   {                                 /* single line write: */
src/emu/inptport.h
r3232r3233
947947/* return the config that matches the given tag */
948948const input_port_config *input_port_by_index(const input_port_config *portlist, int index);
949949
950/* return the field that matches the given tag and mask */
951const input_field_config *input_field_by_tag_and_mask(const input_port_config *portlist, const char *tag, input_port_value mask);
950952
951953
954
952955/* ----- accessors for input types ----- */
953956
954957/* return TRUE if the given type represents an analog control */
src/emu/devintrf.h
r3232r3233
3737typedef enum _device_class device_class;
3838
3939
40/* device start results */
41enum _device_start_err
42{
43   DEVICE_START_OK = 0,            /* everything is fine */
44   DEVICE_START_MISSING_DEPENDENCY      /* at least one device we depend on is not yet started */
45};
46typedef enum _device_start_err device_start_err;
47
48
4049/* useful in device_list functions for scanning through all devices */
4150#define DEVICE_TYPE_WILDCARD         NULL
4251
r3232r3233
5867   DEVINFO_PTR_FIRST = 0x10000,
5968
6069      DEVINFO_PTR_ROM_REGION = DEVINFO_PTR_FIRST,      /* R/O: pointer to device-specific ROM region */
70      DEVINFO_PTR_MACHINE_CONFIG,                  /* R/O: pointer to device-specific machine config */
6171
6272   DEVINFO_PTR_DEVICE_SPECIFIC = 0x18000,            /* R/W: device-specific values start here */
6373   DEVINFO_PTR_LAST = 0x1ffff,
r3232r3233
103113#define DEVICE_SET_INFO_CALL(name)   DEVICE_SET_INFO_NAME(name)(device, state, info)
104114
105115#define DEVICE_START_NAME(name)      device_start_##name
106#define DEVICE_START(name)         void DEVICE_START_NAME(name)(const device_config *device)
116#define DEVICE_START(name)         device_start_err DEVICE_START_NAME(name)(const device_config *device)
107117#define DEVICE_START_CALL(name)      DEVICE_START_NAME(name)(device)
108118
109119#define DEVICE_STOP_NAME(name)      device_stop_##name
r3232r3233
136146/* device interface function types */
137147typedef void (*device_get_info_func)(const device_config *device, UINT32 state, deviceinfo *info);
138148typedef void (*device_set_info_func)(const device_config *device, UINT32 state, const deviceinfo *info);
139typedef void (*device_start_func)(const device_config *device);
149typedef device_start_err (*device_start_func)(const device_config *device);
140150typedef void (*device_stop_func)(const device_config *device);
141151typedef void (*device_reset_func)(const device_config *device);
142152typedef void (*device_nvram_func)(const device_config *device, mame_file *file, int read_or_write);
r3232r3233
162172   device_validity_check_func validity_check;      /* DEVINFO_FCT_VALIDITY_CHECK */
163173   device_nvram_func      nvram;               /* DEVINFO_FCT_NVRAM */
164174   const rom_entry *      romregion;            /* DEVINFO_PTR_ROM_REGION */
175   const union _machine_config_token *machine_config;/* DEVINFO_PTR_MACHINE_CONFIG */
165176};
166177
167178
r3232r3233
179190   const void *         static_config;         /* static device configuration */
180191   void *               inline_config;         /* inline device configuration */
181192
182   /* these four fields are only valid if the device is live */
193   /* these fields are only valid if the device is live */
194   UINT8               started;            /* TRUE if the start function has succeeded */
183195   void *               token;               /* token if device is live */
184196   running_machine *      machine;            /* machine if device is live */
185197   UINT8 *               region;               /* pointer to region with the device's tag, or NULL */
src/emu/cpuintrf.c
r3232r3233
1010***************************************************************************/
1111
1212#include "driver.h"
13#include "deprecat.h"
1314
1415
1516
r3232r3233
910911 *
911912 *************************************/
912913
913INLINE void set_cpu_context(int cpunum)
914INLINE void set_cpu_context(running_machine *machine, int cpunum)
914915{
915916   int newfamily = cpu[cpunum].family;
916917   int oldcontext = cpu_active_context[newfamily];
r3232r3233
921922
922923   /* swap memory spaces */
923924   activecpu = cpunum;
924   memory_set_context(cpunum);
925   memory_set_context(machine, cpunum);
925926
926927   /* if the new CPU's context is not swapped in, do it now */
927928   if (oldcontext != cpunum)
r3232r3233
946947
947948   /* do the rest only if this isn't the activecpu */
948949   if (cpunum != activecpu && cpunum != -1)
949      set_cpu_context(cpunum);
950      set_cpu_context(Machine, cpunum);
950951
951952   /* this is now the active CPU */
952953   activecpu = cpunum;
r3232r3233
960961
961962   /* do the rest only if this isn't the activecpu */
962963   if (cpunum != activecpu && cpunum != -1)
963      set_cpu_context(cpunum);
964      set_cpu_context(Machine, cpunum);
964965
965966   /* this is now the active CPU */
966967   activecpu = cpunum;
src/emu/cpuexec.c
r3232r3233
332332   }
333333
334334   /* update the global time */
335   timer_set_global_time(target);
335   timer_set_global_time(machine, target);
336336}
337337
338338
r3232r3233
765765    for this screen
766766-------------------------------------------------*/
767767
768static void on_vblank(const device_config *device, int vblank_state)
768static void on_vblank(const device_config *device, void *param, int vblank_state)
769769{
770770   /* VBLANK starting */
771771   if (vblank_state)
r3232r3233
971971
972972         assert(screen != NULL);
973973
974         video_screen_register_vblank_callback(screen, on_vblank);
974         video_screen_register_vblank_callback(screen, on_vblank, NULL);
975975      }
976976
977977      /* periodic interrupts */
src/emu/mamecore.h
r3232r3233
290290
291291/* Used by assert(), so definition here instead of mame.h */
292292DECL_NORETURN void CLIB_DECL fatalerror(const char *text, ...) ATTR_PRINTF(1,2) ATTR_NORETURN;
293DECL_NORETURN void CLIB_DECL fatalerror_exitcode(int exitcode, const char *text, ...) ATTR_PRINTF(2,3) ATTR_NORETURN;
293DECL_NORETURN void CLIB_DECL fatalerror_exitcode(running_machine *machine, int exitcode, const char *text, ...) ATTR_PRINTF(3,4) ATTR_NORETURN;
294294
295295
296296
src/emu/rendlay.c
r3232r3233
5454
5555***************************************************************************/
5656
57#include <ctype.h>
5758#include "render.h"
5859#include "rendfont.h"
5960#include "rendlay.h"
r3232r3233
223224}
224225
225226
226/*-------------------------------------------------
227    view_has_art - true if a render_view contains
228    any non-screen elements
229-------------------------------------------------*/
230227
231#ifdef UNUSED_FUNCTION
232INLINE int view_has_art(layout_view *view)
233{
234   return (view->itemlist[ITEM_LAYER_BACKDROP] != 0 ||
235         view->itemlist[ITEM_LAYER_OVERLAY] != 0 ||
236         view->itemlist[ITEM_LAYER_BEZEL] != 0);
237}
238#endif
239
240
241228/***************************************************************************
242229    LAYOUT VIEWS
243230***************************************************************************/
r3232r3233
14511438   const char *string = xml_get_attribute_string_with_subst(node, attribute, NULL);
14521439   int value;
14531440
1454   if (!string || sscanf(string, "%d", &value) != 1)
1441   if (string == NULL)
14551442      return defvalue;
1456   return value;
1443   if (string[0] == '$')
1444      return (sscanf(&string[1], "%X", &value) == 1) ? value : defvalue;
1445   if (string[0] == '0' && string[1] == 'x')
1446      return (sscanf(&string[2], "%X", &value) == 1) ? value : defvalue;
1447   if (string[0] == '#')
1448      return (sscanf(&string[1], "%d", &value) == 1) ? value : defvalue;
1449   return (sscanf(&string[0], "%d", &value) == 1) ? value : defvalue;
14571450}
14581451
14591452
r3232r3233
15581551      *viewnext = view;
15591552      viewnext = &view->next;
15601553   }
1554
15611555   xml_file_free(rootnode);
15621556   return file;
15631557
r3232r3233
18211815   item = malloc_or_die(sizeof(*item));
18221816   memset(item, 0, sizeof(*item));
18231817
1824   /* allocate a copy of the name */
1825   item->name = copy_string(xml_get_attribute_string_with_subst(itemnode, "name", ""));
1818   /* allocate a copy of the output name */
1819   item->output_name = copy_string(xml_get_attribute_string_with_subst(itemnode, "name", ""));
18261820
1821   /* allocate a copy of the input tag */
1822   item->input_tag = copy_string(xml_get_attribute_string_with_subst(itemnode, "inputtag", ""));
1823
18271824   /* find the associated element */
18281825   name = xml_get_attribute_string_with_subst(itemnode, "element", NULL);
18291826   if (name != NULL)
r3232r3233
18431840
18441841   /* fetch common data */
18451842   item->index = xml_get_attribute_int_with_subst(itemnode, "index", -1);
1846   if (item->name[0] != 0 && item->element != 0)
1847      output_set_value(item->name, item->element->defstate);
1843   item->input_mask = xml_get_attribute_int_with_subst(itemnode, "inputmask", 0);
1844   if (item->output_name[0] != 0 && item->element != 0)
1845      output_set_value(item->output_name, item->element->defstate);
18481846   if (load_bounds(xml_get_sibling(itemnode->child, "bounds"), &item->rawbounds))
18491847      goto error;
18501848   if (load_color(xml_get_sibling(itemnode->child, "color"), &item->color))
r3232r3233
18671865   return item;
18681866
18691867error:
1870   if (item->name != NULL)
1871      free((void *)item->name);
1868   if (item->output_name != NULL)
1869      free((void *)item->output_name);
1870   if (item->input_tag != NULL)
1871      free((void *)item->input_tag);
18721872   free(item);
18731873   return NULL;
18741874}
r3232r3233
20752075      {
20762076         view_item *temp = view->itemlist[layer];
20772077         view->itemlist[layer] = temp->next;
2078         if (temp->name != NULL)
2079            free((void *)temp->name);
2078         if (temp->output_name != NULL)
2079            free((void *)temp->output_name);
2080         if (temp->input_tag != NULL)
2081            free((void *)temp->input_tag);
20802082         free(temp);
20812083      }
20822084
src/emu/rendlay.h
r3232r3233
120120{
121121   view_item *         next;            /* link to next item */
122122   layout_element *   element;         /* pointer to the associated element (non-screens only) */
123   const char *      name;            /* name of this item */
123   const char *      output_name;      /* name of this item */
124   const char *      input_tag;         /* input tag of this item */
125   UINT32            input_mask;         /* input mask of this item */
124126   int               index;            /* index for this item (screens only) */
125127   int               orientation;      /* orientation of this item */
126128   render_bounds      bounds;            /* bounds of the item */
src/emu/sound/c352.c
r3232r3233
3030   C352_FLG_KEYOFF      = 0x2000,   // Keyoff
3131   C352_FLG_LOOPTRG   = 0x1000,   // Loop Trigger
3232   C352_FLG_LOOPHIST   = 0x0800,   // Loop History
33   C352_FLG_FM       = 0x0400,   // Frequency Modulation
33   C352_FLG_FM          = 0x0400,   // Frequency Modulation
3434   C352_FLG_PHASERL   = 0x0200,   // Rear Left invert phase 180 degrees
3535   C352_FLG_PHASEFL   = 0x0100,   // Front Left invert phase 180 degrees
3636   C352_FLG_PHASEFR   = 0x0080,   // invert phase 180 degrees (e.g. flip sign of sample)
r3232r3233
7474   UINT32 c352_rom_length;
7575   int sample_rate_base;
7676
77   INT16 level_table[256];
78
7977   long   channel_l[2048*2];
8078   long   channel_r[2048*2];
8179   long   channel_l2[2048*2];
r3232r3233
535533      state_save_register_item(cname, sndindex, info->c352_ch[i].current_addr);
536534      state_save_register_item(cname, sndindex, info->c352_ch[i].pos);
537535   }
538
539   for (i = 0; i < 256; i++)
540   {
541         double max_level = 255.0;
542
543         info->level_table[255-i] = (int) (pow (10.0, (double) i / 256.0 * -20.0 / 20.0) * max_level);
544   }
545536}
546537
547538static void *c352_start(const char *tag, int sndindex, int clock, const void *config)
src/emu/ui.c
r3232r3233
12091209
12101210   /* draw the profiler if visible */
12111211   if (show_profiler)
1212      ui_draw_text_full(profiler_get_text(), 0.0f, 0.0f, 1.0f, JUSTIFY_LEFT, WRAP_WORD, DRAW_OPAQUE, ARGB_WHITE, ARGB_BLACK, NULL, NULL);
1212      ui_draw_text_full(profiler_get_text(machine), 0.0f, 0.0f, 1.0f, JUSTIFY_LEFT, WRAP_WORD, DRAW_OPAQUE, ARGB_WHITE, ARGB_BLACK, NULL, NULL);
12131213
12141214   /* if we're single-stepping, pause now */
12151215   if (single_step)
r3232r3233
14761476   tailptr = &(*tailptr)->next;
14771477
14781478   /* add per-channel volume */
1479   numitems = sound_get_user_gain_count();
1479   numitems = sound_get_user_gain_count(machine);
14801480   for (item = 0; item < numitems; item++)
14811481   {
14821482      INT32 maxval = 2000;
1483      INT32 defval = sound_get_default_gain(item) * 1000.0f + 0.5f;
1483      INT32 defval = sound_get_default_gain(machine, item) * 1000.0f + 0.5f;
14841484
14851485      if (defval > 1000)
14861486         maxval = 2 * defval;
14871487
1488      astring_printf(string, "%s Volume", sound_get_user_gain_name(item));
1488      astring_printf(string, "%s Volume", sound_get_user_gain_name(machine, item));
14891489      *tailptr = slider_alloc(astring_c(string), 0, defval, maxval, 20, slider_mixervol, (void *)(FPTR)item);
14901490      tailptr = &(*tailptr)->next;
14911491   }
r3232r3233
16411641{
16421642   int which = (FPTR)arg;
16431643   if (newval != SLIDER_NOCHANGE)
1644      sound_set_user_gain(which, (float)newval * 0.001f);
1644      sound_set_user_gain(machine, which, (float)newval * 0.001f);
16451645   if (string != NULL)
1646      astring_printf(string, "%4.2f", sound_get_user_gain(which));
1647   return floor(sound_get_user_gain(which) * 1000.0f + 0.5f);
1646      astring_printf(string, "%4.2f", sound_get_user_gain(machine, which));
1647   return floor(sound_get_user_gain(machine, which) * 1000.0f + 0.5f);
16481648}
16491649
16501650
src/emu/crsshair.c
r3232r3233
121121***************************************************************************/
122122
123123static void crosshair_exit(running_machine *machine);
124static void animate(const device_config *device, int vblank_state);
124static void animate(const device_config *device, void *param, int vblank_state);
125125
126126
127127/***************************************************************************
r3232r3233
212212
213213   /* register the animation callback */
214214   if (machine->primary_screen != NULL)
215      video_screen_register_vblank_callback(machine->primary_screen, animate);
215      video_screen_register_vblank_callback(machine->primary_screen, animate, NULL);
216216}
217217
218218
r3232r3233
272272    animate - animates the crosshair once a frame
273273-------------------------------------------------*/
274274
275static void animate(const device_config *device, int vblank_state)
275static void animate(const device_config *device, void *param, int vblank_state)
276276{
277277   int player;
278278
src/emu/profiler.c
r3232r3233
1212#include "osdepend.h"
1313#include "driver.h"
1414#include "profiler.h"
15#include "deprecat.h"
1615
1716
1817/* in usrintf.c */
r3232r3233
9897   }
9998}
10099
101const char *profiler_get_text(void)
100const char *profiler_get_text(running_machine *machine)
102101{
103102   int i,j;
104103   UINT64 total,normalize;
r3232r3233
174173      }
175174      if (computed || showdelay[i])
176175      {
177         if (computed) showdelay[i] = ATTOSECONDS_TO_HZ(video_screen_get_frame_period(Machine->primary_screen).attoseconds);
176         if (computed) showdelay[i] = ATTOSECONDS_TO_HZ(video_screen_get_frame_period(machine->primary_screen).attoseconds);
178177         showdelay[i]--;
179178
180179         if (i < PROFILER_PROFILER)
src/emu/profiler.h
r3232r3233
7373/* functions called by usrintf.c */
7474void profiler_start(void);
7575void profiler_stop(void);
76const char *profiler_get_text(void);
76const char *profiler_get_text(running_machine *machine);
7777#else
7878#define profiler_mark(type)
7979
8080#define profiler_start()
8181#define profiler_stop()
82#define profiler_get_text() ""
82#define profiler_get_text(machine) ""
8383#endif
8484
8585
src/emu/sound.c
r3232r3233
1414#include "streams.h"
1515#include "config.h"
1616#include "profiler.h"
17#include "deprecat.h"
1817#include "sound/wavwrite.h"
1918
2019
r3232r3233
117116static void sound_load(running_machine *machine, int config_type, xml_data_node *parentnode);
118117static void sound_save(running_machine *machine, int config_type, xml_data_node *parentnode);
119118static TIMER_CALLBACK( sound_update );
120static void start_sound_chips(void);
121static void route_sound(void);
119static void start_sound_chips(running_machine *machine);
120static void route_sound(running_machine *machine);
122121static void mixer_update(void *param, stream_sample_t **inputs, stream_sample_t **buffer, int length);
123122static STATE_POSTLOAD( mixer_postload );
124123
r3232r3233
147146    find_speaker_by_tag - find a tagged speaker
148147-------------------------------------------------*/
149148
150INLINE speaker_info *find_speaker_by_tag(const char *tag)
149INLINE speaker_info *find_speaker_by_tag(running_machine *machine, const char *tag)
151150{
152   const device_config *speaker = device_list_find_by_tag(Machine->config->devicelist, SPEAKER_OUTPUT, tag);
151   const device_config *speaker = device_list_find_by_tag(machine->config->devicelist, SPEAKER_OUTPUT, tag);
153152   return (speaker == NULL) ? NULL : speaker->token;
154153}
155154
r3232r3233
207206
208207   /* now start up the sound chips and tag their streams */
209208   VPRINTF(("start_sound_chips\n"));
210   start_sound_chips();
209   start_sound_chips(machine);
211210
212211   /* finally, do all the routing */
213212   VPRINTF(("route_sound\n"));
214   route_sound();
213   route_sound(machine);
215214
216215   /* open the output WAV file if specified */
217216   filename = options_get_string(mame_options(), OPTION_WAVWRITE);
r3232r3233
264263    and initialize them
265264-------------------------------------------------*/
266265
267static void start_sound_chips(void)
266static void start_sound_chips(running_machine *machine)
268267{
269268   int sndnum;
270269
r3232r3233
274273   /* start up all the sound chips */
275274   for (sndnum = 0; sndnum < MAX_SOUND; sndnum++)
276275   {
277      const sound_config *msound = &Machine->config->sound[sndnum];
276      const sound_config *msound = &machine->config->sound[sndnum];
278277      sound_info *info;
279278      int num_regs;
280279      int index;
r3232r3233
294293      /* start the chip, tagging all its streams */
295294      VPRINTF(("sndnum = %d -- sound_type = %d\n", sndnum, msound->type));
296295      num_regs = state_save_get_reg_count();
297      streams_set_tag(Machine, info);
296      streams_set_tag(machine, info);
298297      if (sndintrf_init_sound(sndnum, msound->tag, msound->type, msound->clock, msound->config) != 0)
299298         fatalerror("Sound chip #%d (%s) failed to initialize!", sndnum, sndnum_name(sndnum));
300299
r3232r3233
303302      if (num_regs == 0)
304303      {
305304         logerror("Sound chip #%d (%s) did not register any state to save!\n", sndnum, sndnum_name(sndnum));
306         if (Machine->gamedrv->flags & GAME_SUPPORTS_SAVE)
305         if (machine->gamedrv->flags & GAME_SUPPORTS_SAVE)
307306            fatalerror("Sound chip #%d (%s) did not register any state to save!", sndnum, sndnum_name(sndnum));
308307      }
309308
r3232r3233
311310      VPRINTF(("Counting outputs\n"));
312311      for (index = 0; ; index++)
313312      {
314         sound_stream *stream = stream_find_by_tag(info, index);
313         sound_stream *stream = stream_find_by_tag(machine, info, index);
315314         if (!stream)
316315            break;
317316         info->outputs += stream_get_outputs(stream);
r3232r3233
329328         info->outputs = 0;
330329         for (index = 0; ; index++)
331330         {
332            sound_stream *stream = stream_find_by_tag(info, index);
331            sound_stream *stream = stream_find_by_tag(machine, info, index);
333332            int outputs, outputnum;
334333
335334            if (!stream)
r3232r3233
354353    inputs
355354-------------------------------------------------*/
356355
357static void route_sound(void)
356static void route_sound(running_machine *machine)
358357{
359358   int sndnum, routenum, outputnum;
360359   const device_config *curspeak;
r3232r3233
372371         sound_info *sound;
373372
374373         /* find the target */
375         speaker = find_speaker_by_tag(mroute->target);
374         speaker = find_speaker_by_tag(machine, mroute->target);
376375         sound = find_sound_by_tag(mroute->target);
377376
378377         /* if neither found, it's fatal */
r3232r3233
391390   }
392391
393392   /* now allocate the mixers and input data */
394   streams_set_tag(Machine, NULL);
395   for (curspeak = speaker_output_first(Machine->config); curspeak != NULL; curspeak = speaker_output_next(curspeak))
393   streams_set_tag(machine, NULL);
394   for (curspeak = speaker_output_first(machine->config); curspeak != NULL; curspeak = speaker_output_next(curspeak))
396395   {
397396      speaker_info *info = curspeak->token;
398397      if (info->inputs != 0)
399398      {
400         info->mixer_stream = stream_create(info->inputs, 1, Machine->sample_rate, info, mixer_update);
401         state_save_register_postload(Machine, mixer_postload, info->mixer_stream);
399         info->mixer_stream = stream_create(info->inputs, 1, machine->sample_rate, info, mixer_update);
400         state_save_register_postload(machine, mixer_postload, info->mixer_stream);
402401         info->input = auto_malloc(info->inputs * sizeof(*info->input));
403402         info->inputs = 0;
404403      }
r3232r3233
419418         sound_info *sound;
420419
421420         /* find the target */
422         speaker = find_speaker_by_tag(mroute->target);
421         speaker = find_speaker_by_tag(machine, mroute->target);
423422         sound = find_sound_by_tag(mroute->target);
424423
425424         /* if it's a speaker, set the input */
r3232r3233
437436                        namebuf[0] = '\0';
438437
439438                        /* speaker name, if more than one speaker */
440                  if (speaker_output_count(Machine->config) > 1)
439                  if (speaker_output_count(machine->config) > 1)
441440                     sprintf(namebuf, "%sSpeaker '%s': ", namebuf, speaker->tag);
442441
443442                        /* device name */
r3232r3233
600599      {
601600         float defvol = xml_get_attribute_float(channelnode, "defvol", -1000.0);
602601         float newvol = xml_get_attribute_float(channelnode, "newvol", -1000.0);
603         if (fabs(defvol - sound_get_default_gain(mixernum)) < 1e-6 && newvol != -1000.0)
604            sound_set_user_gain(mixernum, newvol);
602         if (fabs(defvol - sound_get_default_gain(machine, mixernum)) < 1e-6 && newvol != -1000.0)
603            sound_set_user_gain(machine, mixernum, newvol);
605604      }
606605   }
607606}
r3232r3233
624623   if (parentnode != NULL)
625624      for (mixernum = 0; mixernum < MAX_MIXER_CHANNELS; mixernum++)
626625      {
627         float defvol = sound_get_default_gain(mixernum);
628         float newvol = sound_get_user_gain(mixernum);
626         float defvol = sound_get_default_gain(machine, mixernum);
627         float newvol = sound_get_user_gain(machine, mixernum);
629628
630629         if (defvol != newvol)
631630         {
r3232r3233
822821   /* copy in all the relevant info */
823822   info->speaker = device->inline_config;
824823   info->tag = device->tag;
824
825   return DEVICE_START_OK;
825826}
826827
827828
r3232r3233
924925    a particular input
925926-------------------------------------------------*/
926927
927INLINE speaker_info *index_to_input(int index, int *input)
928INLINE speaker_info *index_to_input(running_machine *machine, int index, int *input)
928929{
929930   const device_config *curspeak;
930931   int count = 0;
931932
932933   /* scan through the speakers until we find the indexed input */
933   for (curspeak = speaker_output_first(Machine->config); curspeak != NULL; curspeak = speaker_output_next(curspeak))
934   for (curspeak = speaker_output_first(machine->config); curspeak != NULL; curspeak = speaker_output_next(curspeak))
934935   {
935936      speaker_info *info = curspeak->token;
936937      if (index < count + info->inputs)
r3232r3233
951952    of user-controllable gain parameters
952953-------------------------------------------------*/
953954
954int sound_get_user_gain_count(void)
955int sound_get_user_gain_count(running_machine *machine)
955956{
956957   const device_config *curspeak;
957958   int count = 0;
958959
959960   /* count up the number of speaker inputs */
960   for (curspeak = speaker_output_first(Machine->config); curspeak != NULL; curspeak = speaker_output_next(curspeak))
961   for (curspeak = speaker_output_first(machine->config); curspeak != NULL; curspeak = speaker_output_next(curspeak))
961962   {
962963      speaker_info *info = curspeak->token;
963964      count += info->inputs;
r3232r3233
971972    value
972973-------------------------------------------------*/
973974
974void sound_set_user_gain(int index, float gain)
975void sound_set_user_gain(running_machine *machine, int index, float gain)
975976{
976977   int inputnum;
977   speaker_info *spk = index_to_input(index, &inputnum);
978   speaker_info *spk = index_to_input(machine, index, &inputnum);
978979
979980   if (spk != NULL)
980981   {
r3232r3233
989990    value
990991-------------------------------------------------*/
991992
992float sound_get_user_gain(int index)
993float sound_get_user_gain(running_machine *machine, int index)
993994{
994995   int inputnum;
995   speaker_info *spk = index_to_input(index, &inputnum);
996   speaker_info *spk = index_to_input(machine, index, &inputnum);
996997   return (spk != NULL) ? spk->input[inputnum].gain : 0;
997998}
998999
r3232r3233
10021003    gain of the nth user value
10031004-------------------------------------------------*/
10041005
1005float sound_get_default_gain(int index)
1006float sound_get_default_gain(running_machine *machine, int index)
10061007{
10071008   int inputnum;
1008   speaker_info *spk = index_to_input(index, &inputnum);
1009   speaker_info *spk = index_to_input(machine, index, &inputnum);
10091010   return (spk != NULL) ? spk->input[inputnum].default_gain : 0;
10101011}
10111012
r3232r3233
10151016    of the nth user value
10161017-------------------------------------------------*/
10171018
1018const char *sound_get_user_gain_name(int index)
1019const char *sound_get_user_gain_name(running_machine *machine, int index)
10191020{
10201021   int inputnum;
1021   speaker_info *spk = index_to_input(index, &inputnum);
1022   speaker_info *spk = index_to_input(machine, index, &inputnum);
10221023   return (spk != NULL) ? spk->input[inputnum].name : NULL;
10231024}
10241025
src/emu/sound.h
r3232r3233
8888void sound_global_enable(int enable);
8989
9090/* user gain controls on speaker inputs for mixing */
91int sound_get_user_gain_count(void);
92void sound_set_user_gain(int index, float gain);
93float sound_get_user_gain(int index);
94float sound_get_default_gain(int index);
95const char *sound_get_user_gain_name(int index);
91int sound_get_user_gain_count(running_machine *machine);
92void sound_set_user_gain(running_machine *machine, int index, float gain);
93float sound_get_user_gain(running_machine *machine, int index);
94float sound_get_default_gain(running_machine *machine, int index);
95const char *sound_get_user_gain_name(running_machine *machine, int index);
9696
9797/* misc helpers */
9898int sound_find_sndnum_by_tag(const char *tag);
src/emu/input.c
r3232r3233
2222#include "mame.h"
2323#include "emuopts.h"
2424#include "profiler.h"
25#include "deprecat.h"
2625
2726
2827
r3232r3233
8281/* a single input device */
8382struct _input_device
8483{
84   running_machine *      machine;            /* machine we are attached to */
8585   astring *            name;               /* string name of device */
8686   input_device_class      devclass;            /* class of this device */
8787   int                  devindex;            /* device index of this device */
r3232r3233
719719    input_device_add - add a new input device
720720-------------------------------------------------*/
721721
722input_device *input_device_add(input_device_class devclass, const char *name, void *internal)
722input_device *input_device_add(running_machine *machine, input_device_class devclass, const char *name, void *internal)
723723{
724724   input_device_list *devlist = &device_list[devclass];
725725   input_device *device;
726726
727   assert_always(mame_get_phase(Machine) == MAME_PHASE_INIT, "Can only call input_device_add at init time!");
727   assert_always(mame_get_phase(machine) == MAME_PHASE_INIT, "Can only call input_device_add at init time!");
728728   assert(name != NULL);
729729   assert(devclass != DEVICE_CLASS_INVALID && devclass < DEVICE_CLASS_MAXIMUM);
730730
r3232r3233
734734   memset(device, 0, sizeof(*device));
735735
736736   /* fill in the data */
737   device->machine = machine;
737738   device->name = astring_cpyc(auto_astring_alloc(), name);
738739   device->devclass = devclass;
739740   device->devindex = devlist->count - 1;
r3232r3233
761762   input_device_item *item;
762763   input_item_id itemid_std = itemid;
763764
764   assert_always(mame_get_phase(Machine) == MAME_PHASE_INIT, "Can only call input_device_item_add at init time!");
765   assert_always(mame_get_phase(device->machine) == MAME_PHASE_INIT, "Can only call input_device_item_add at init time!");
765766   assert(name != NULL);
766767   assert(itemid > ITEM_ID_INVALID && itemid < ITEM_ID_MAXIMUM);
767768   assert(getstate != NULL);
src/emu/input.h
r3232r3233
592592/* ----- OSD configuration and access ----- */
593593
594594/* add a new input device */
595input_device *input_device_add(input_device_class devclass, const char *name, void *internal);
595input_device *input_device_add(running_machine *machine, input_device_class devclass, const char *name, void *internal);
596596
597597/* add a new item to an input device */
598598void input_device_item_add(input_device *device, const char *name, void *internal, input_item_id itemid, item_get_state_func getstate);
src/emu/render.c
r3232r3233
16061606               if (item->element != NULL)
16071607               {
16081608                  int state = 0;
1609                  if (item->name[0] != '\0')
1610                     state = output_get_value(item->name);
1611
1609                  if (item->output_name[0] != 0)
1610                     state = output_get_value(item->output_name);
1611                  else if (item->input_tag[0] != 0)
1612                  {
1613                     const input_field_config *field = input_field_by_tag_and_mask(Machine->portconfig, item->input_tag, item->input_mask);
1614                     if (field != NULL)
1615                        state = ((input_port_read_safe(Machine, item->input_tag, 0) ^ field->defvalue) & item->input_mask) ? 1 : 0;
1616                  }
16121617                  add_element_primitives(target, &target->primlist[listnum], &item_xform, item->element, state, blendmode);
16131618               }
16141619               else
r3232r3233
16731678    logic for mapping points
16741679-------------------------------------------------*/
16751680
1676static int render_target_map_point_internal(render_target *target, INT32 target_x, INT32 target_y,
1677   render_container *container, const char *input_tag, UINT32 input_mask, float *mapped_x, float *mapped_y)
1681static int render_target_map_point_internal(render_target *target, INT32 target_x, INT32 target_y, render_container *container, float *mapped_x, float *mapped_y, view_item **mapped_item)
16781682{
1683   float target_fx, target_fy;
1684   view_item *item;
16791685   int layernum;
1680   view_item *item;
1681   float target_fx, target_fy;
16821686   float dummy;
1683   int hit;
16841687
16851688   /* sanity check */
16861689   if (mapped_x == NULL)
r3232r3233
16881691   if (mapped_y == NULL)
16891692      mapped_y = &dummy;
16901693
1694   /* default to point not mapped */
1695   *mapped_x = -1.0;
1696   *mapped_y = -1.0;
1697
16911698   /* convert target coordinates to float */
16921699   target_fx = (float)target_x / target->width;
16931700   target_fy = (float)target_y / target->height;
16941701
1702   /* explicitly check for the UI container */
16951703   if (container != NULL && container == ui_container)
16961704   {
16971705      /* this hit test went against the UI container */
r3232r3233
17001708         /* this point was successfully mapped */
17011709         *mapped_x = target_fx;
17021710         *mapped_y = target_fy;
1711         *mapped_item = NULL;
17031712         return TRUE;
17041713      }
1714      return FALSE;
17051715   }
1706   else
1716
1717   /* loop through each layer */
1718   for (layernum = 0; layernum < ITEM_LAYER_MAX; layernum++)
17071719   {
1708      /* loop through each layer */
1709      for (layernum = 0; layernum < ITEM_LAYER_MAX; layernum++)
1720      int layer = get_layer_and_blendmode(target->curview, layernum, NULL);
1721      if (target->curview->layenabled[layer])
17101722      {
1711         int layer = get_layer_and_blendmode(target->curview, layernum, NULL);
1712         if (target->curview->layenabled[layer])
1723         /* iterate over items in the layer */
1724         for (item = target->curview->itemlist[layer]; item != NULL; item = item->next)
17131725         {
1714            /* iterate over items in the layer */
1715            for (item = target->curview->itemlist[layer]; item != NULL; item = item->next)
1726            int checkit;
1727
1728            /* if we're looking for a particular container, verify that we have the right one */
1729            if (container != NULL)
1730               checkit = (item->element == NULL && container == get_screen_container_by_index(item->index));
1731
1732            /* otherwise, assume we're looking for an input */
1733            else
1734               checkit = (item->input_tag[0] != 0);
1735
1736            /* this target is worth looking at; now check the point */
1737            if (checkit && target_fx >= item->bounds.x0 && target_fx < item->bounds.x1 && target_fy >= item->bounds.y0 && target_fy < item->bounds.y1)
17161738            {
1717               /* perform the hit test */
1718               if (item->element == NULL && container != NULL)
1719                  hit = (container == get_screen_container_by_index(item->index));
1720               else
1721                  hit = FALSE;
1722
1723               /* is this item the container in which we are interested? */
1724               if (hit)
1725               {
1726                  /* this target contains the specified container; now check the point */
1727                  if (target_fx >= item->bounds.x0 && target_fx < item->bounds.x1 && target_fy >= item->bounds.y0 && target_fy < item->bounds.y1)
1728                  {
1729                     /* point successfully mapped */
1730                     *mapped_x = (target_fx - item->bounds.x0) / (item->bounds.x1 - item->bounds.x0);
1731                     *mapped_y = (target_fy - item->bounds.y0) / (item->bounds.y1 - item->bounds.y0);
1732                     return TRUE;
1733                  }
1734               }
1739               /* point successfully mapped */
1740               *mapped_x = (target_fx - item->bounds.x0) / (item->bounds.x1 - item->bounds.x0);
1741               *mapped_y = (target_fy - item->bounds.y0) / (item->bounds.y1 - item->bounds.y0);
1742               *mapped_item = item;
1743               return TRUE;
17351744            }
17361745         }
17371746      }
17381747   }
1739
1740   /* point not mapped */
1741   *mapped_x = -1.0;
1742   *mapped_y = -1.0;
17431748   return FALSE;
17441749}
17451750
r3232r3233
17521757
17531758int render_target_map_point_container(render_target *target, INT32 target_x, INT32 target_y, render_container *container, float *container_x, float *container_y)
17541759{
1755   return render_target_map_point_internal(target, target_x, target_y, container, NULL, 0, container_x, container_y);
1760   view_item *item;
1761   return render_target_map_point_internal(target, target_x, target_y, container, container_x, container_y, &item);
17561762}
17571763
17581764
17591765/*-------------------------------------------------
1766    render_target_map_point_input - attempts to map
1767    a point on the specified render_target to the
1768    specified container, if possible
1769-------------------------------------------------*/
1770
1771int render_target_map_point_input(render_target *target, INT32 target_x, INT32 target_y, const char **input_tag, UINT32 *input_mask, float *input_x, float *input_y)
1772{
1773   view_item *item = NULL;
1774   int result;
1775
1776   result = render_target_map_point_internal(target, target_x, target_y, NULL, input_x, input_y, &item);
1777   if (result && item != NULL)
1778   {
1779      *input_tag = item->input_tag;
1780      *input_mask = item->input_mask;
1781   }
1782   return result;
1783}
1784
1785
1786/*-------------------------------------------------
17601787    load_layout_files - load layout files for a
17611788    given render target
17621789-------------------------------------------------*/
src/emu/clifront.c
r3232r3233
446446   for (drvindex = 0; drivers[drvindex]; drvindex++)
447447      if (mame_strwildcmp(gamename, drivers[drvindex]->name) == 0)
448448      {
449         machine_config *config = machine_config_alloc(drivers[drvindex]->machine_config);
449450         const rom_entry *region, *rom;
451         const rom_source *source;
450452
451         /* iterate over regions, and then ROMs within the region */
452         for (region = rom_first_region(drivers[drvindex]); region; region = rom_next_region(region))
453            for (rom = rom_first_file(region); rom; rom = rom_next_file(rom))
454            {
455               char hashbuf[HASH_BUF_SIZE];
453         /* iterate over sources, regions, and then ROMs within the region */
454         for (source = rom_first_source(drivers[drvindex], config); source != NULL; source = rom_next_source(drivers[drvindex], config, source))
455            for (region = rom_first_region(drivers[drvindex], source); region; region = rom_next_region(region))
456               for (rom = rom_first_file(region); rom; rom = rom_next_file(rom))
457               {
458                  char hashbuf[HASH_BUF_SIZE];
456459
457               /* if we have a CRC, display it */
458               if (hash_data_extract_printable_checksum(ROM_GETHASHDATA(rom), HASH_CRC, hashbuf))
459                  mame_printf_info("%s %-12s %s\n", hashbuf, ROM_GETNAME(rom), drivers[drvindex]->description);
460            }
460                  /* if we have a CRC, display it */
461                  if (hash_data_extract_printable_checksum(ROM_GETHASHDATA(rom), HASH_CRC, hashbuf))
462                     mame_printf_info("%s %-12s %s\n", hashbuf, ROM_GETNAME(rom), drivers[drvindex]->description);
463               }
461464
462465         count++;
466         machine_config_free(config);
463467      }
464468
465469   /* return an error if none found */
r3232r3233
962966   /* iterate over drivers */
963967   for (drvindex = 0; drivers[drvindex]; drvindex++)
964968   {
969      machine_config *config = machine_config_alloc(drivers[drvindex]->machine_config);
965970      const rom_entry *region, *rom;
971      const rom_source *source;
966972
967      /* iterate over regions and files within the region */
968      for (region = rom_first_region(drivers[drvindex]); region; region = rom_next_region(region))
969         for (rom = rom_first_file(region); rom; rom = rom_next_file(rom))
970            if (hash_data_is_equal(hash, ROM_GETHASHDATA(rom), 0))
971            {
972               int baddump = hash_data_has_info(ROM_GETHASHDATA(rom), HASH_INFO_BAD_DUMP);
973      /* iterate over sources, regions and files within the region */
974      for (source = rom_first_source(drivers[drvindex], config); source != NULL; source = rom_next_source(drivers[drvindex], config, source))
975         for (region = rom_first_region(drivers[drvindex], source); region; region = rom_next_region(region))
976            for (rom = rom_first_file(region); rom; rom = rom_next_file(rom))
977               if (hash_data_is_equal(hash, ROM_GETHASHDATA(rom), 0))
978               {
979                  int baddump = hash_data_has_info(ROM_GETHASHDATA(rom), HASH_INFO_BAD_DUMP);
973980
974               /* output information about the match */
975               if (*found != 0)
976                  mame_printf_info("                    ");
977               mame_printf_info("= %s%-20s  %s\n", baddump ? "(BAD) " : "", ROM_GETNAME(rom), drivers[drvindex]->description);
978               (*found)++;
979            }
981                  /* output information about the match */
982                  if (*found != 0)
983                     mame_printf_info("                    ");
984                  mame_printf_info("= %s%-20s  %s\n", baddump ? "(BAD) " : "", ROM_GETNAME(rom), drivers[drvindex]->description);
985                  (*found)++;
986               }
987
988      machine_config_free(config);
980989   }
981990}
src/emu/state.c
r3232r3233
655655    current tag
656656-------------------------------------------------*/
657657
658void state_save_save_continue(void)
658void state_save_save_continue(running_machine *machine)
659659{
660660   ss_entry *entry;
661661   ss_func *func;
r3232r3233
671671      if (func->tag == ss_current_tag)
672672      {
673673         count++;
674         (*func->func.presave)(Machine, func->param);
674         (*func->func.presave)(machine, func->param);
675675      }
676676   LOG(("    %d functions called\n", count));
677677
r3232r3233
693693    file by writing the header and closing
694694-------------------------------------------------*/
695695
696void state_save_save_finish(void)
696void state_save_save_finish(running_machine *machine)
697697{
698698   UINT32 signature;
699699   UINT8 flags = 0;
r3232r3233
710710   ss_dump_array[8] = SAVE_VERSION;
711711   ss_dump_array[9] = flags;
712712   memset(ss_dump_array+0xa, 0, 10);
713   strcpy((char *)ss_dump_array+0xa, Machine->gamedrv->name);
713   strcpy((char *)ss_dump_array+0xa, machine->gamedrv->name);
714714
715715   /* copy in the signature */
716716   signature = get_signature();
r3232r3233
768768    the current tag
769769-------------------------------------------------*/
770770
771void state_save_load_continue(void)
771void state_save_load_continue(running_machine *machine)
772772{
773773   ss_entry *entry;
774774   ss_func *func;
r3232r3233
801801      if (func->tag == ss_current_tag)
802802      {
803803         count++;
804         (*func->func.postload)(Machine, func->param);
804         (*func->func.postload)(machine, func->param);
805805      }
806806   LOG(("    %d functions called\n", count));
807807}
src/emu/timer.c
r3232r3233
1313#include "driver.h"
1414#include "profiler.h"
1515#include "pool.h"
16#include "deprecat.h"
1716
1817
1918/***************************************************************************
r3232r3233
328327    time; this is also where we fire the timers
329328-------------------------------------------------*/
330329
331void timer_set_global_time(attotime newbase)
330void timer_set_global_time(running_machine *machine, attotime newbase)
332331{
333332   emu_timer *timer;
334333
r3232r3233
357356      {
358357         LOG(("Timer %s:%d[%s] fired (expire=%s)\n", timer->file, timer->line, timer->func, attotime_string(timer->expire, 9)));
359358         profiler_mark(PROFILER_TIMER_CALLBACK);
360         (*timer->callback)(Machine, timer->ptr, timer->param);
359         (*timer->callback)(machine, timer->ptr, timer->param);
361360         profiler_mark(PROFILER_END);
362361      }
363362
r3232r3233
10711070         fatalerror("Unknown timer device type");
10721071         break;
10731072   }
1073
1074   return DEVICE_START_OK;
10741075}
10751076
10761077
src/emu/mconfig.c
r3232r3233
1818    FUNCTION PROTOTYPES
1919***************************************************************************/
2020
21static void machine_config_detokenize(machine_config *config, const machine_config_token *tokens);
21static void machine_config_detokenize(machine_config *config, const machine_config_token *tokens, const char *tagprefix, int depth);
2222
2323
2424
2525/***************************************************************************
26    INLINE FUNCTIONS
27***************************************************************************/
28
29/*-------------------------------------------------
30    create_tag - create a combined tag,
31    allocating strings as necessary
32-------------------------------------------------*/
33
34INLINE const char *create_tag(astring *result, const char *prefix, const char *tag)
35{
36   if (prefix != NULL && prefix[0] != 0)
37      astring_printf(result, "%s:%s", prefix, tag);
38   else
39      astring_cpyc(result, tag);
40   return astring_c(result);
41}
42
43
44
45/***************************************************************************
2646    MACHINE CONFIGURATIONS
2747***************************************************************************/
2848
r3232r3233
4161   memset(config, 0, sizeof(*config));
4262
4363   /* parse tokens into the config */
44   machine_config_detokenize(config, tokens);
64   machine_config_detokenize(config, tokens, "", 0);
4565   return config;
4666}
4767
r3232r3233
5373
5474void machine_config_free(machine_config *config)
5575{
76   int cpunum, soundnum;
77
5678   /* release the device list */
5779   while (config->devicelist != NULL)
5880      device_list_remove(&config->devicelist, config->devicelist->type, config->devicelist->tag);
5981
82   /* release the strings */
83   for (cpunum = 0; cpunum < ARRAY_LENGTH(config->cputag); cpunum++)
84      if (config->cputag[cpunum] != NULL)
85         astring_free(config->cputag[cpunum]);
86   for (soundnum = 0; soundnum < ARRAY_LENGTH(config->soundtag); soundnum++)
87      if (config->soundtag[soundnum] != NULL)
88         astring_free(config->soundtag[soundnum]);
89
6090   /* release the configuration itself */
6191   free(config);
6292}
6393
6494
65
66
6795/*-------------------------------------------------
68    machine_config_add_cpu - add a CPU during machine
69    driver expansion
96    cpu_add - add a CPU during machine driver
97    expansion
7098-------------------------------------------------*/
7199
72cpu_config *machine_config_add_cpu(machine_config *machine, const char *tag, cpu_type type, int cpuclock)
100static cpu_config *cpu_add(machine_config *machine, const char *tag, cpu_type type, int cpuclock)
73101{
74102   int cpunum;
75103
76104   for (cpunum = 0; cpunum < MAX_CPU; cpunum++)
77105      if (machine->cpu[cpunum].type == CPU_DUMMY)
78106      {
79         machine->cpu[cpunum].tag = tag;
107         if (machine->cputag[cpunum] == NULL)
108            machine->cputag[cpunum] = astring_alloc();
109         astring_cpyc(machine->cputag[cpunum], tag);
110         machine->cpu[cpunum].tag = astring_c(machine->cputag[cpunum]);
80111         machine->cpu[cpunum].type = type;
81112         machine->cpu[cpunum].clock = cpuclock;
82113         return &machine->cpu[cpunum];
r3232r3233
88119
89120
90121/*-------------------------------------------------
91    machine_config_find_cpu - find a tagged CPU during
92    machine driver expansion
122    cpu_find - find a tagged CPU during machine
123    driver expansion
93124-------------------------------------------------*/
94125
95cpu_config *machine_config_find_cpu(machine_config *machine, const char *tag)
126static cpu_config *cpu_find(machine_config *machine, const char *tag)
96127{
97128   int cpunum;
98129
r3232r3233
106137
107138
108139/*-------------------------------------------------
109    machine_config_remove_cpu - remove a tagged CPU
110    during machine driver expansion
140    cpu_remove - remove a tagged CPU during
141    machine driver expansion
111142-------------------------------------------------*/
112143
113void machine_config_remove_cpu(machine_config *machine, const char *tag)
144static void cpu_remove(machine_config *machine, const char *tag)
114145{
115146   int cpunum;
116147
117148   for (cpunum = 0; cpunum < MAX_CPU; cpunum++)
118149      if (machine->cpu[cpunum].tag && strcmp(machine->cpu[cpunum].tag, tag) == 0)
119150      {
151         if (machine->cputag[cpunum] != NULL)
152            astring_free(machine->cputag[cpunum]);
120153         memmove(&machine->cpu[cpunum], &machine->cpu[cpunum + 1], sizeof(machine->cpu[0]) * (MAX_CPU - cpunum - 1));
154         memmove(&machine->cputag[cpunum], &machine->cputag[cpunum + 1], sizeof(machine->cputag[0]) * (MAX_CPU - cpunum - 1));
121155         memset(&machine->cpu[MAX_CPU - 1], 0, sizeof(machine->cpu[0]));
156         memset(&machine->cputag[MAX_CPU - 1], 0, sizeof(machine->cputag[0]));
122157         return;
123158      }
124159
r3232r3233
127162
128163
129164/*-------------------------------------------------
130    machine_config_add_sound - add a sound system during
165    sound_add - add a sound system during
131166    machine driver expansion
132167-------------------------------------------------*/
133168
134sound_config *machine_config_add_sound(machine_config *machine, const char *tag, sound_type type, int clock)
169static sound_config *sound_add(machine_config *machine, const char *tag, sound_type type, int clock)
135170{
136171   int soundnum;
137172
138173   for (soundnum = 0; soundnum < MAX_SOUND; soundnum++)
139174      if (machine->sound[soundnum].type == SOUND_DUMMY)
140175      {
141         machine->sound[soundnum].tag = tag;
176         if (machine->soundtag[soundnum] == NULL)
177            machine->soundtag[soundnum] = astring_alloc();
178         astring_cpyc(machine->soundtag[soundnum], tag);
179         machine->sound[soundnum].tag = astring_c(machine->soundtag[soundnum]);
142180         machine->sound[soundnum].type = type;
143181         machine->sound[soundnum].clock = clock;
144182         machine->sound[soundnum].config = NULL;
r3232r3233
152190
153191
154192/*-------------------------------------------------
155    machine_config_find_sound - find a tagged sound
156    system during machine driver expansion
193    sound_find - find a tagged sound system during
194    machine driver expansion
157195-------------------------------------------------*/
158196
159sound_config *machine_config_find_sound(machine_config *machine, const char *tag)
197static sound_config *sound_find(machine_config *machine, const char *tag)
160198{
161199   int soundnum;
162200
r3232r3233
170208
171209
172210/*-------------------------------------------------
173    machine_config_remove_sound - remove a tagged sound
174    system during machine driver expansion
211    sound_remove - remove a tagged sound system
212    during machine driver expansion
175213-------------------------------------------------*/
176214
177void machine_config_remove_sound(machine_config *machine, const char *tag)
215static void sound_remove(machine_config *machine, const char *tag)
178216{
179217   int soundnum;
180218
181219   for (soundnum = 0; soundnum < MAX_SOUND; soundnum++)
182220      if (machine->sound[soundnum].tag && strcmp(machine->sound[soundnum].tag, tag) == 0)
183221      {
222         if (machine->soundtag[soundnum] != NULL)
223            astring_free(machine->soundtag[soundnum]);
184224         memmove(&machine->sound[soundnum], &machine->sound[soundnum + 1], sizeof(machine->sound[0]) * (MAX_SOUND - soundnum - 1));
225         memmove(&machine->soundtag[soundnum], &machine->soundtag[soundnum + 1], sizeof(machine->soundtag[0]) * (MAX_SOUND - soundnum - 1));
185226         memset(&machine->sound[MAX_SOUND - 1], 0, sizeof(machine->sound[0]));
227         memset(&machine->soundtag[MAX_SOUND - 1], 0, sizeof(machine->soundtag[0]));
186228         return;
187229      }
188230
r3232r3233
195237    machine config
196238-------------------------------------------------*/
197239
198static void machine_config_detokenize(machine_config *config, const machine_config_token *tokens)
240static void machine_config_detokenize(machine_config *config, const machine_config_token *tokens, const char *tagprefix, int depth)
199241{
200242   UINT32 entrytype = MCONFIG_TOKEN_INVALID;
243   astring *tempstring = astring_alloc();
201244   device_config *device = NULL;
245   sound_config *sound = NULL;
202246   cpu_config *cpu = NULL;
203   sound_config *sound = NULL;
204247
205248   /* loop over tokens until we hit the end */
206249   while (entrytype != MCONFIG_TOKEN_END)
207250   {
251      int size, offset, type, bits, in, out;
252      UINT32 data32, clock, gain;
208253      device_type devtype;
209254      const char *tag;
210      int size, offset, type, bits, in, out;
211      UINT32 data32, clock, gain;
212255      UINT64 data64;
213256
214257      /* unpack the token from the first entry */
r3232r3233
221264
222265         /* including */
223266         case MCONFIG_TOKEN_INCLUDE:
224            machine_config_detokenize(config, TOKEN_GET_PTR(tokens, tokenptr));
267            machine_config_detokenize(config, TOKEN_GET_PTR(tokens, tokenptr), tagprefix, depth + 1);
225268            break;
226269
227270         /* device management */
228271         case MCONFIG_TOKEN_DEVICE_ADD:
229272            devtype = TOKEN_GET_PTR(tokens, devtype);
230273            tag = TOKEN_GET_STRING(tokens);
231            device = device_list_add(&config->devicelist, devtype, tag);
274            device = device_list_add(&config->devicelist, devtype, create_tag(tempstring, tagprefix, tag));
232275            break;
233276
234277         case MCONFIG_TOKEN_DEVICE_REMOVE:
235278            devtype = TOKEN_GET_PTR(tokens, devtype);
236279            tag = TOKEN_GET_STRING(tokens);
237            device_list_remove(&config->devicelist, devtype, tag);
280            device_list_remove(&config->devicelist, devtype, create_tag(tempstring, tagprefix, tag));
238281            device = NULL;
239282            break;
240283
241284         case MCONFIG_TOKEN_DEVICE_MODIFY:
242285            devtype = TOKEN_GET_PTR(tokens, devtype);
243286            tag = TOKEN_GET_STRING(tokens);
244            device = (device_config *)device_list_find_by_tag(config->devicelist, devtype, tag);
287            device = (device_config *)device_list_find_by_tag(config->devicelist, devtype, create_tag(tempstring, tagprefix, tag));
245288            if (device == NULL)
246               fatalerror("Unable to find device: type=%s tag=%s\n", devtype_name(devtype), tag);
289               fatalerror("Unable to find device: type=%s tag=%s\n", devtype_name(devtype), astring_c(tempstring));
247290            break;
248291
249292         case MCONFIG_TOKEN_DEVICE_CONFIG:
r3232r3233
308351            TOKEN_UNGET_UINT32(tokens);
309352            TOKEN_GET_UINT64_UNPACK3(tokens, entrytype, 8, type, 24, clock, 32);
310353            tag = TOKEN_GET_STRING(tokens);
311            cpu = machine_config_add_cpu(config, tag, type, clock);
354            cpu = cpu_add(config, create_tag(tempstring, tagprefix, tag), type, clock);
312355            break;
313356
314357         case MCONFIG_TOKEN_CPU_MODIFY:
315358            tag = TOKEN_GET_STRING(tokens);
316            cpu = machine_config_find_cpu(config, tag);
359            cpu = cpu_find(config, create_tag(tempstring, tagprefix, tag));
317360            break;
318361
319362         case MCONFIG_TOKEN_CPU_REMOVE:
320363            tag = TOKEN_GET_STRING(tokens);
321            machine_config_remove_cpu(config, tag);
364            cpu_remove(config, create_tag(tempstring, tagprefix, tag));
322365            cpu = NULL;
323366            break;
324367
r3232r3233
326369            TOKEN_UNGET_UINT32(tokens);
327370            TOKEN_GET_UINT64_UNPACK3(tokens, entrytype, 8, type, 24, clock, 32);
328371            tag = TOKEN_GET_STRING(tokens);
329            cpu = machine_config_find_cpu(config, tag);
372            cpu = cpu_find(config, create_tag(tempstring, tagprefix, tag));
330373            if (cpu == NULL)
331               fatalerror("Unable to find CPU: tag=%s\n", tag);
374               fatalerror("Unable to find CPU: tag=%s\n", astring_c(tempstring));
332375            cpu->type = type;
333376            cpu->clock = clock;
334377            break;
r3232r3233
479522            TOKEN_UNGET_UINT32(tokens);
480523            TOKEN_GET_UINT64_UNPACK3(tokens, entrytype, 8, type, 24, clock, 32);
481524            tag = TOKEN_GET_STRING(tokens);
482            sound = machine_config_add_sound(config, tag, type, clock);
525            sound = sound_add(config, create_tag(tempstring, tagprefix, tag), type, clock);
483526            break;
484527
485528         case MCONFIG_TOKEN_SOUND_REMOVE:
486            machine_config_remove_sound(config, TOKEN_GET_STRING(tokens));
529            sound_remove(config, TOKEN_GET_STRING(tokens));
487530            break;
488531
489532         case MCONFIG_TOKEN_SOUND_MODIFY:
490533            tag = TOKEN_GET_STRING(tokens);
491            sound = machine_config_find_sound(config, tag);
534            sound = sound_find(config, create_tag(tempstring, tagprefix, tag));
492535            if (sound == NULL)
493               fatalerror("Unable to find sound: tag=%s\n", tag);
536               fatalerror("Unable to find sound: tag=%s\n", astring_c(tempstring));
494537            sound->routes = 0;
495538            break;
496539
r3232r3233
503546            TOKEN_UNGET_UINT32(tokens);
504547            TOKEN_GET_UINT64_UNPACK3(tokens, entrytype, 8, type, 24, clock, 32);
505548            tag = TOKEN_GET_STRING(tokens);
506            sound = machine_config_find_sound(config, tag);
549            sound = sound_find(config, create_tag(tempstring, tagprefix, tag));
507550            if (sound == NULL)
508               fatalerror("Unable to find sound: tag=%s\n", tag);
551               fatalerror("Unable to find sound: tag=%s\n", astring_c(tempstring));
509552            sound->type = type;
510553            sound->clock = clock;
511554            sound->config = NULL;
r3232r3233
528571            break;
529572      }
530573   }
574
575   /* if we are the outermost level, process any device-specific machine configurations */
576   if (depth == 0)
577      for (device = config->devicelist; device != NULL; device = device->next)
578      {
579         tokens = device_get_info_ptr(device, DEVINFO_PTR_MACHINE_CONFIG);
580         if (tokens != NULL)
581            machine_config_detokenize(config, tokens, create_tag(tempstring, tagprefix, device->tag), depth + 1);
582      }
583
584   astring_free(tempstring);
531585}
src/emu/cheat.c
r3232r3233
1313
1414    <mamecheat version="1">
1515        <cheat desc="blah">
16           <parameter min="minval(0)" max="maxval(numitems)" step="stepval(1)" default="defvalue(minval)">
16           <parameter min="minval(0)" max="maxval(numitems)" step="stepval(1)">
1717              <item value="itemval(previtemval|minval+stepval)">text</item>
1818              ...
1919           </parameter>
r3232r3233
110110   int               maxformat;                  /* format of maximum value */
111111   UINT64            stepval;                  /* step value */
112112   int               stepformat;                  /* format of step value */
113   UINT64            defval;                     /* default value */
114   int               defformat;                  /* format of default value */
115113   UINT64            value;                     /* live value of the parameter */
116114   char            valuestring[32];            /* small space for a value string */
117115   parameter_item *   itemlist;                  /* list of items */
r3232r3233
394392   /* if we have a value parameter, compute it */
395393   else if (cheat->parameter->itemlist == NULL)
396394   {
397      if (state != NULL)
395      if (cheat->state == SCRIPT_STATE_OFF)
398396      {
399         sprintf(cheat->parameter->valuestring, "%d", (UINT32)cheat->parameter->value);
400         *state = cheat->parameter->valuestring;
397         if (state != NULL)
398            *state = "Off";
399         if (flags != NULL)
400            *flags = MENU_FLAG_RIGHT_ARROW;
401401      }
402      if (flags != NULL)
402      else
403403      {
404         *flags = 0;
405         if (cheat->parameter->value > cheat->parameter->minval)
406            *flags |= MENU_FLAG_LEFT_ARROW;
407         if (cheat->parameter->value < cheat->parameter->maxval)
408            *flags |= MENU_FLAG_RIGHT_ARROW;
404         if (state != NULL)
405         {
406            sprintf(cheat->parameter->valuestring, "%d", (UINT32)cheat->parameter->value);
407            *state = cheat->parameter->valuestring;
408         }
409         if (flags != NULL)
410         {
411            *flags = MENU_FLAG_LEFT_ARROW;
412            if (cheat->parameter->value < cheat->parameter->maxval)
413               *flags |= MENU_FLAG_RIGHT_ARROW;
414         }
409415      }
410416   }
411417
412418   /* if we have an item list, pick the index */
413419   else
414420   {
415      parameter_item *item, *prev = NULL;
416
417      for (item = cheat->parameter->itemlist; item != NULL; prev = item, item = item->next)
418         if (item->value == cheat->parameter->value)
419            break;
420      if (state != NULL)
421         *state = (item != NULL) ? astring_c(item->text) : "??Invalid??";
422      if (flags != NULL)
421      if (cheat->state == SCRIPT_STATE_OFF)
423422      {
424         *flags = 0;
425         if (item == NULL || prev != NULL)
426            *flags |= MENU_FLAG_LEFT_ARROW;
427         if (item == NULL || item->next != NULL)
428            *flags |= MENU_FLAG_RIGHT_ARROW;
423         if (state != NULL)
424            *state = "Off";
425         if (flags != NULL)
426            *flags = MENU_FLAG_RIGHT_ARROW;
429427      }
428      else
429      {
430         parameter_item *item = NULL, *prev = NULL;
431
432         for (item = cheat->parameter->itemlist; item != NULL; prev = item, item = item->next)
433            if (item->value == cheat->parameter->value)
434               break;
435         if (state != NULL)
436            *state = (item != NULL) ? astring_c(item->text) : "??Invalid??";
437         if (flags != NULL)
438         {
439            *flags = MENU_FLAG_LEFT_ARROW;
440            if (item == NULL || item->next != NULL)
441               *flags |= MENU_FLAG_RIGHT_ARROW;
442         }
443      }
430444   }
431445
432446   /* return a pointer to this item */
r3232r3233
473487      ;
474488
475489   /* if we have no parameter, it's just on/off; default to off */
476   else if (cheat->parameter == NULL)
490   else
477491   {
478492      if (cheat->state != SCRIPT_STATE_OFF)
479493      {
r3232r3233
482496         changed = TRUE;
483497      }
484498   }
485
486   /* if we have a value parameter, fall back to the default */
487   else
488   {
489      if (cheat->parameter->value != cheat->parameter->defval)
490      {
491         cheat->parameter->value = cheat->parameter->defval;
492         changed = TRUE;
493      }
494   }
495499   return changed;
496500}
497501
r3232r3233
534538         cheat_execute_script(cheatinfo, cheat, SCRIPT_STATE_CHANGE);
535539         changed = TRUE;
536540      }
541      else if (cheat->state != SCRIPT_STATE_OFF)
542      {
543         cheat_execute_script(cheatinfo, cheat, SCRIPT_STATE_OFF);
544         cheat->state = SCRIPT_STATE_OFF;
545         changed = TRUE;
546      }
537547   }
538548
539549   /* if we have an item list, pick the index */
r3232r3233
546556            break;
547557      if (prev != NULL)
548558      {
559         if (cheat->state == SCRIPT_STATE_OFF)
560         {
561            cheat_execute_script(cheatinfo, cheat, SCRIPT_STATE_ON);
562            cheat->state = SCRIPT_STATE_RUN;
563         }
549564         cheat->parameter->value = prev->value;
550565         cheat_execute_script(cheatinfo, cheat, SCRIPT_STATE_CHANGE);
551566         changed = TRUE;
552567      }
568      else if (cheat->state != SCRIPT_STATE_OFF)
569      {
570         cheat_execute_script(cheatinfo, cheat, SCRIPT_STATE_OFF);
571         cheat->state = SCRIPT_STATE_OFF;
572         changed = TRUE;
573      }
553574   }
554575   return changed;
555576}
r3232r3233
584605   /* if we have a value parameter, compute it */
585606   else if (cheat->parameter->itemlist == NULL)
586607   {
587      if (cheat->parameter->value < cheat->parameter->maxval)
608      if (cheat->state == SCRIPT_STATE_OFF)
588609      {
610         cheat_execute_script(cheatinfo, cheat, SCRIPT_STATE_ON);
611         cheat->state = SCRIPT_STATE_RUN;
612         cheat->parameter->value = cheat->parameter->minval;
613         cheat_execute_script(cheatinfo, cheat, SCRIPT_STATE_CHANGE);
614         changed = TRUE;
615      }
616      else if (cheat->parameter->value < cheat->parameter->maxval)
617      {
589618         if (cheat->parameter->value > cheat->parameter->maxval - cheat->parameter->stepval)
590619            cheat->parameter->value = cheat->parameter->maxval;
591620         else
r3232r3233
600629   {
601630      parameter_item *item;
602631
603      for (item = cheat->parameter->itemlist; item != NULL; item = item->next)
604         if (item->value == cheat->parameter->value)
605            break;
606      if (item->next != NULL)
632      if (cheat->state == SCRIPT_STATE_OFF)
607633      {
608         cheat->parameter->value = item->next->value;
634         cheat_execute_script(cheatinfo, cheat, SCRIPT_STATE_ON);
635         cheat->state = SCRIPT_STATE_RUN;
636         cheat->parameter->value = cheat->parameter->itemlist->value;
609637         cheat_execute_script(cheatinfo, cheat, SCRIPT_STATE_CHANGE);
610638         changed = TRUE;
611639      }
640      else
641      {
642         for (item = cheat->parameter->itemlist; item != NULL; item = item->next)
643            if (item->value == cheat->parameter->value)
644               break;
645         if (item->next != NULL)
646         {
647            cheat->parameter->value = item->next->value;
648            cheat_execute_script(cheatinfo, cheat, SCRIPT_STATE_CHANGE);
649            changed = TRUE;
650         }
651      }
612652   }
613653   return changed;
614654}
r3232r3233
9731013   }
9741014
9751015   /* set the initial state */
976   cheat->state = (cheat->parameter != NULL) ? SCRIPT_STATE_RUN : SCRIPT_STATE_OFF;
1016   cheat->state = SCRIPT_STATE_OFF;
9771017   return cheat;
9781018
9791019error:
r3232r3233
10781118   param->maxformat = xml_get_attribute_int_format(paramnode, "max");
10791119   param->stepval = xml_get_attribute_int(paramnode, "step", 1);
10801120   param->stepformat = xml_get_attribute_int_format(paramnode, "step");
1081   param->defval = xml_get_attribute_int(paramnode, "default", param->minval);
1082   param->defformat = xml_get_attribute_int_format(paramnode, "default");
10831121
10841122   /* iterate over items */
10851123   itemtailptr = &param->itemlist;
r3232r3233
11161154      itemtailptr = &curitem->next;
11171155   }
11181156
1119   /* if no default, pick the minimum */
1120   if (xml_get_attribute_string(paramnode, "default", NULL) == NULL)
1121      param->defval = (param->itemlist != NULL) ? param->itemlist->value : param->minval;
1122   param->value = param->defval;
1157   /* start at the minimum */
1158   param->value = param->minval;
11231159
11241160   return param;
11251161
r3232r3233
11501186         mame_fprintf(cheatfile, " max=\"%s\"", format_int(string, param->maxval, param->maxformat));
11511187      if (param->stepval != 1)
11521188         mame_fprintf(cheatfile, " step=\"%s\"", format_int(string, param->stepval, param->stepformat));
1153      mame_fprintf(cheatfile, " default=\"%s\"", format_int(string, param->defval, param->defformat));
11541189      mame_fprintf(cheatfile, "/>\n");
11551190   }
11561191
r3232r3233
11591194   {
11601195      const parameter_item *curitem;
11611196
1162      mame_fprintf(cheatfile, " default=\"%s\">\n", format_int(string, param->defval, param->defformat));
11631197      for (curitem = param->itemlist; curitem != NULL; curitem = curitem->next)
11641198         mame_fprintf(cheatfile, "\t\t\t<item value=\"%s\">%s</item>\n", format_int(string, curitem->value, curitem->valformat), astring_c(curitem->text));
11651199      mame_fprintf(cheatfile, "\t\t</parameter>\n");
src/emu/render.h
r3232r3233
410410/* attempts to map a point on the specified render_target to the specified container, if possible */
411411int render_target_map_point_container(render_target *target, INT32 target_x, INT32 target_y, render_container *container, float *container_x, float *container_y);
412412
413/* attempts to map a point on the specified render_target to the specified container, if possible */
414int render_target_map_point_input(render_target *target, INT32 target_x, INT32 target_y, const char **input_tag, UINT32 *input_mask, float *input_x, float *input_y);
413415
414416
417
415418/* ----- render texture management ----- */
416419
417420/* allocate a new texture */
src/emu/state.h
r3232r3233
112112void state_save_push_tag(int tag);
113113void state_save_pop_tag(void);
114114
115void state_save_save_continue(void);
116void state_save_load_continue(void);
115void state_save_save_continue(running_machine *machine);
116void state_save_load_continue(running_machine *machine);
117117
118void state_save_save_finish(void);
118void state_save_save_finish(running_machine *machine);
119119void state_save_load_finish(void);
120120
121121/* Helper function for creating a unique name */
src/emu/timer.h
r3232r3233
170170attotime timer_next_fire_time(void);
171171
172172/* adjust the global time; this is also where we fire the timers */
173void timer_set_global_time(attotime newbase);
173void timer_set_global_time(running_machine *machine, attotime newbase);
174174
175175
176176
src/emu/validity.c
r3232r3233
5555typedef struct _region_entry region_entry;
5656struct _region_entry
5757{
58   const char *tag;
58   astring *tag;
5959   UINT32 length;
6060};
6161
r3232r3233
151151}
152152
153153
154/*-------------------------------------------------
155    validate_tag - ensure that the given tag
156    meets the general requirements
157-------------------------------------------------*/
154158
159INLINE int validate_tag(const game_driver *driver, const char *object, const char *tag)
160{
161   const char *validchars = "abcdefghijklmnopqrstuvwxyz0123456789_.:";
162   const char *begin = strrchr(tag, ':');
163   const char *p;
164   int error = FALSE;
165
166   for (p = tag; *p != 0; p++)
167   {
168      if (*p != tolower(*p))
169      {
170         mame_printf_error("%s: %s has %s with tag '%s' containing upper-case characters\n", driver->source_file, driver->name, object, tag);
171         error = TRUE;
172         break;
173      }
174      if (*p == ' ')
175      {
176         mame_printf_error("%s: %s has %s with tag '%s' containing spaces\n", driver->source_file, driver->name, object, tag);
177         error = TRUE;
178         break;
179      }
180      if (strchr(validchars, *p) == NULL)
181      {
182         mame_printf_error("%s: %s has %s with tag '%s' containing invalid character '%c'\n", driver->source_file, driver->name, object, tag, *p);
183         error = TRUE;
184         break;
185      }
186   }
187
188   if (begin == NULL)
189      begin = tag;
190   else
191      begin += 1;
192
193   if (strlen(begin) == 0)
194   {
195      mame_printf_error("%s: %s has %s with 0-length tag\n", driver->source_file, driver->name, object);
196      error = TRUE;
197   }
198   if (strlen(begin) > MAX_TAG_LENGTH)
199   {
200      mame_printf_error("%s: %s has %s with tag '%s' > %d characters\n", driver->source_file, driver->name, object, tag, MAX_TAG_LENGTH);
201      error = TRUE;
202   }
203
204   return error;
205}
206
207
208
155209/***************************************************************************
156210    QUARK TABLES
157211***************************************************************************/
r3232r3233
504558static int validate_roms(int drivnum, const machine_config *config, region_info *rgninfo)
505559{
506560   const game_driver *driver = drivers[drivnum];
507   const rom_entry *romp;
561   int bios_flags = 0, last_bios = 0;
508562   const char *last_name = "???";
563   region_entry *currgn = NULL;
564   int items_since_region = 1;
565   const rom_source *source;
509566   int error = FALSE;
510   int items_since_region = 1;
511   int bios_flags = 0, last_bios = 0;
512   region_entry *currgn = NULL;
513567
514   /* reset region info */
515   memset(rgninfo, 0, sizeof(*rgninfo));
568   /* iterate, starting with the driver's ROMs and continuing with device ROMs */
569   for (source = rom_first_source(driver, config); source != NULL; source = rom_next_source(driver, config, source))
570   {
571      const rom_entry *romp;
516572
517   /* scan the ROM entries */
518   for (romp = driver->rom; romp && !ROMENTRY_ISEND(romp); romp++)
519   {
520      /* if this is a region, make sure it's valid, and record the length */
521      if (ROMENTRY_ISREGION(romp))
573      /* scan the ROM entries */
574      for (romp = rom_first_region(driver, source); !ROMENTRY_ISEND(romp); romp++)
522575      {
523         const char *region = ROMREGION_GETTAG(romp);
576         /* if this is a region, make sure it's valid, and record the length */
577         if (ROMENTRY_ISREGION(romp))
578         {
579            const char *regiontag = ROMREGION_GETTAG(romp);
524580
525         /* if we haven't seen any items since the last region, print a warning */
526         if (items_since_region == 0)
527            mame_printf_warning("%s: %s has empty ROM region (warning)\n", driver->source_file, driver->name);
528         items_since_region = (ROMREGION_ISERASE(romp) || ROMREGION_ISDISPOSE(romp) || ROMREGION_ISDISKDATA(romp)) ? 1 : 0;
529         currgn = NULL;
581            /* if we haven't seen any items since the last region, print a warning */
582            if (items_since_region == 0)
583               mame_printf_warning("%s: %s has empty ROM region (warning)\n", driver->source_file, driver->name);
584            items_since_region = (ROMREGION_ISERASE(romp) || ROMREGION_ISDISPOSE(romp) || ROMREGION_ISDISKDATA(romp)) ? 1 : 0;
585            currgn = NULL;
530586
531         /* check for an invalid tag */
532         if (region == NULL || region[0] == 0)
533         {
534            mame_printf_error("%s: %s has duplicate ROM_REGION tag \"%s\"\n", driver->source_file, driver->name, region);
535            error = TRUE;
536         }
587            /* check for a valid tag */
588            if (regiontag == NULL)
589            {
590               mame_printf_error("%s: %s has NULL ROM_REGION tag\n", driver->source_file, driver->name);
591               error = TRUE;
592            }
537593
538         /* find any empty entry, checking for duplicates */
539         else
540         {
541            int rgnnum;
594            /* load by name entries must be 8 characters or less */
595            else if (ROMREGION_ISLOADBYNAME(romp) && strlen(regiontag) > 8)
596            {
597               mame_printf_error("%s: %s has load-by-name region \"%s\" with name >8 characters\n", driver->source_file, driver->name, regiontag);
598               error = TRUE;
599            }
542600
543            /* iterate over all regions found so far */
544            for (rgnnum = 0; rgnnum < ARRAY_LENGTH(rgninfo->entries); rgnnum++)
601            /* find any empty entry, checking for duplicates */
602            else
545603            {
546               /* stop when we hit an empty */
547               if (rgninfo->entries[rgnnum].tag == NULL)
604               astring *fulltag = rom_region_name(astring_alloc(), driver, source, romp);
605               int rgnnum;
606
607               /* iterate over all regions found so far */
608               for (rgnnum = 0; rgnnum < ARRAY_LENGTH(rgninfo->entries); rgnnum++)
548609               {
549                  currgn = &rgninfo->entries[rgnnum];
550                  currgn->tag = region;
551                  currgn->length = ROMREGION_GETLENGTH(romp);
552                  break;
553               }
610                  /* stop when we hit an empty */
611                  if (rgninfo->entries[rgnnum].tag == NULL)
612                  {
613                     currgn = &rgninfo->entries[rgnnum];
614                     currgn->tag = fulltag;
615                     currgn->length = ROMREGION_GETLENGTH(romp);
616                     break;
617                  }
554618
555               /* fail if we hit a duplicate */
556               if (strcmp(rgninfo->entries[rgnnum].tag, region) == 0)
557               {
558                  mame_printf_error("%s: %s has duplicate ROM_REGION type \"%s\"\n", driver->source_file, driver->name, region);
559                  error = TRUE;
560                  break;
619                  /* fail if we hit a duplicate */
620                  if (astring_cmp(fulltag, rgninfo->entries[rgnnum].tag) == 0)
621                  {
622                     mame_printf_error("%s: %s has duplicate ROM_REGION tag \"%s\"\n", driver->source_file, driver->name, astring_c(fulltag));
623                     error = TRUE;
624                     astring_free(fulltag);
625                     break;
626                  }
561627               }
562628            }
629
630            /* validate the region tag */
631            error |= validate_tag(driver, "region", regiontag);
563632         }
564      }
565633
566      /* If this is a system bios, make sure it is using the next available bios number */
567      else if (ROMENTRY_ISSYSTEM_BIOS(romp))
568      {
569         bios_flags = ROM_GETBIOSFLAGS(romp);
570         if (last_bios+1 != bios_flags)
634         /* If this is a system bios, make sure it is using the next available bios number */
635         else if (ROMENTRY_ISSYSTEM_BIOS(romp))
571636         {
572            const char *name = ROM_GETNAME(romp);
573            mame_printf_error("%s: %s has non-sequential bios %s\n", driver->source_file, driver->name, name);
574            error = TRUE;
637            bios_flags = ROM_GETBIOSFLAGS(romp);
638            if (last_bios+1 != bios_flags)
639            {
640               const char *name = ROM_GETNAME(romp);
641               mame_printf_error("%s: %s has non-sequential bios %s\n", driver->source_file, driver->name, name);
642               error = TRUE;
643            }
644            last_bios = bios_flags;
575645         }
576         last_bios = bios_flags;
577      }
578646
579      /* if this is a file, make sure it is properly formatted */
580      else if (ROMENTRY_ISFILE(romp))
581      {
582         const char *hash;
583         const char *s;
647         /* if this is a file, make sure it is properly formatted */
648         else if (ROMENTRY_ISFILE(romp))
649         {
650            const char *hash;
651            const char *s;
584652
585         items_since_region++;
653            items_since_region++;
586654
587         /* track the last filename we found */
588         last_name = ROM_GETNAME(romp);
655            /* track the last filename we found */
656            last_name = ROM_GETNAME(romp);
589657
590         /* make sure it's all lowercase */
591         for (s = last_name; *s; s++)
592            if (tolower(*s) != *s)
658            /* make sure it's all lowercase */
659            for (s = last_name; *s; s++)
660               if (tolower(*s) != *s)
661               {
662                  mame_printf_error("%s: %s has upper case ROM name %s\n", driver->source_file, driver->name, last_name);
663                  error = TRUE;
664                  break;
665               }
666
667            /* if this is a bios rom, make sure it has the same flags as the last system bios entry */
668/*              bios_flags = ROM_GETBIOSFLAGS(romp);
669                if (bios_flags != 0)
670                {
671                    if (bios_flags != last_bios)
672                    {
673                        mame_printf_error("%s: %s has bios rom name %s without preceding matching system bios definition\n", driver->source_file, driver->name, last_name);
674                        error = TRUE;
675                    }
676                }*/
677
678            /* make sure the has is valid */
679            hash = ROM_GETHASHDATA(romp);
680            if (!hash_verify_string(hash))
593681            {
594               mame_printf_error("%s: %s has upper case ROM name %s\n", driver->source_file, driver->name, last_name);
682               mame_printf_error("%s: rom '%s' has an invalid hash string '%s'\n", driver->name, last_name, hash);
595683               error = TRUE;
596               break;
597684            }
685         }
598686
599         /* if this is a bios rom, make sure it has the same flags as the last system bios entry */
600         bios_flags = ROM_GETBIOSFLAGS(romp);
601         if (bios_flags != 0)
687         /* for any non-region ending entries, make sure they don't extend past the end */
688         if (!ROMENTRY_ISREGIONEND(romp) && currgn != NULL)
602689         {
603            if (bios_flags != last_bios)
690            items_since_region++;
691
692            if (ROM_GETOFFSET(romp) + ROM_GETLENGTH(romp) > currgn->length)
604693            {
605               mame_printf_error("%s: %s has bios rom name %s without preceding matching system bios definition\n", driver->source_file, driver->name, last_name);
694               mame_printf_error("%s: %s has ROM %s extending past the defined memory region\n", driver->source_file, driver->name, last_name);
606695               error = TRUE;
607696            }
608697         }
609
610         /* make sure the has is valid */
611         hash = ROM_GETHASHDATA(romp);
612         if (!hash_verify_string(hash))
613         {
614            mame_printf_error("%s: rom '%s' has an invalid hash string '%s'\n", driver->name, last_name, hash);
615            error = TRUE;
616         }
617698      }
618699
619      /* for any non-region ending entries, make sure they don't extend past the end */
620      if (!ROMENTRY_ISREGIONEND(romp) && currgn != NULL)
621      {
622         items_since_region++;
623
624         if (ROM_GETOFFSET(romp) + ROM_GETLENGTH(romp) > currgn->length)
625         {
626            mame_printf_error("%s: %s has ROM %s extending past the defined memory region\n", driver->source_file, driver->name, last_name);
627            error = TRUE;
628         }
629      }
700      /* final check for empty regions */
701      if (items_since_region == 0)
702         mame_printf_warning("%s: %s has empty ROM region (warning)\n", driver->source_file, driver->name);
630703   }
631704
632   /* final check for empty regions */
633   if (items_since_region == 0)
634      mame_printf_warning("%s: %s has empty ROM region (warning)\n", driver->source_file, driver->name);
635
636705   return error;
637706}
638707
r3232r3233
660729         continue;
661730
662731      /* check for valid tag */
663      if (cpu->tag == NULL || cpu->tag[0] == 0)
732      if (cpu->tag == NULL)
664733      {
665         mame_printf_error("%s: %s has NULL or empty CPU tag\n", driver->source_file, driver->name);
734         mame_printf_error("%s: %s has NULL CPU tag\n", driver->source_file, driver->name);
666735         error = TRUE;
667736      }
668737
r3232r3233
677746            }
678747      }
679748
749      /* validate the CPU tag */
750      error |= validate_tag(driver, "CPU", cpu->tag);
751
680752      /* checks to see if this driver is using a dummy CPU */
681753      if (cputype_get_interface(cpu->type)->get_info == dummy_get_info)
682754      {
r3232r3233
788860                  }
789861
790862                  /* if we hit a match, check against the length */
791                  if (strcmp(rgninfo->entries[rgnnum].tag, entry->region) == 0)
863                  if (astring_cmpc(rgninfo->entries[rgnnum].tag, entry->region) == 0)
792864                  {
793865                     offs_t length = rgninfo->entries[rgnnum].length;
794866                     if (entry->rgnoffs + (byteend - bytestart + 1) > length)
r3232r3233
9871059            }
9881060
9891061            /* if we hit a match, check against the length */
990            if (strcmp(rgninfo->entries[rgnnum].tag, region) == 0)
1062            if (astring_cmpc(rgninfo->entries[rgnnum].tag, region) == 0)
9911063            {
9921064               /* if we have a valid region, and we're not using auto-sizing, check the decode against the region length */
9931065               if (!IS_FRAC(total))
r3232r3233
14751547               error = TRUE;
14761548            }
14771549
1550      /* validate the sound tag */
1551      error |= validate_tag(driver, "sound", config->sound[sndnum].tag);
1552
14781553      /* loop over all the routes */
14791554      for (routenum = 0; routenum < config->sound[sndnum].routes; routenum++)
14801555      {
r3232r3233
15201595   for (device = device_list_first(config->devicelist, DEVICE_TYPE_WILDCARD); device != NULL; device = device_list_next(device, DEVICE_TYPE_WILDCARD))
15211596   {
15221597      device_validity_check_func validity_check = (device_validity_check_func) device_get_info_fct(device, DEVINFO_FCT_VALIDITY_CHECK);
1523      if (validity_check != NULL)
1524      {
1525         if ((*validity_check)(driver, device))
1526            error = TRUE;
1527      }
1598
1599      /* validate the device tag */
1600      error |= validate_tag(driver, device_get_info_string(device, DEVINFO_STR_NAME), device->tag);
1601
1602      /* call the device-specific validity check */
1603      if (validity_check != NULL && (*validity_check)(driver, device))
1604         error = TRUE;
15281605   }
15291606   return error;
15301607}
r3232r3233
16041681      const input_port_config *portlist = NULL;
16051682      machine_config *config;
16061683      region_info rgninfo;
1684      int rgnnum;
16071685
1608/* ASG -- trying this for a while to see if submission failures increase */
1609#if 1
16101686      /* non-debug builds only care about games in the same driver */
16111687      if (curdriver != NULL && strcmp(curdriver->source_file, driver->source_file) != 0)
16121688         continue;
1613#endif
1689      memset(&rgninfo, 0, sizeof(rgninfo));
16141690
16151691      /* expand the machine driver */
16161692      expansion -= osd_profiling_ticks();
r3232r3233
16571733      error = validate_devices(drivnum, config) || error;
16581734      device_checks += osd_profiling_ticks();
16591735
1736      for (rgnnum = 0; rgnnum < ARRAY_LENGTH(rgninfo.entries); rgnnum++)
1737         if (rgninfo.entries[rgnnum].tag != NULL)
1738            astring_free(rgninfo.entries[rgnnum].tag);
16601739      if (portlist != NULL)
16611740         input_port_config_free(portlist);
16621741      machine_config_free(config);
src/emu/mconfig.h
r3232r3233
2222    CONSTANTS
2323***************************************************************************/
2424
25/* by convention, tags should all lowercase and this length or less */
26#define MAX_TAG_LENGTH         15
27
28
2529/* token types */
2630enum
2731{
r3232r3233
120124   UINT32               driver_data_size;      /* amount of memory needed for driver_data */
121125
122126   cpu_config            cpu[MAX_CPU];         /* array of CPUs in the system */
127   astring *            cputag[MAX_CPU];      /* allocated strings for each CPU tag */
123128   UINT32               cpu_slices_per_frame;   /* number of times to interleave execution per frame */
124129   INT32               watchdog_vblank_count;   /* number of VBLANKs until the watchdog kills us */
125130   attotime            watchdog_time;         /* length of time until the watchdog kills us */
r3232r3233
142147   video_update_func       video_update;          /* video update callback */
143148
144149   sound_config         sound[MAX_SOUND];      /* array of sound chips in the system */
150   astring *            soundtag[MAX_SOUND];   /* allocated strings for each sound tag */
145151
146152   sound_start_func      sound_start;         /* one-time sound start callback */
147153   sound_reset_func      sound_reset;         /* sound reset callback */
r3232r3233
462468void machine_config_free(machine_config *config);
463469
464470
465
466
467
468cpu_config *machine_config_add_cpu(machine_config *machine, const char *tag, cpu_type type, int cpuclock);
469cpu_config *machine_config_find_cpu(machine_config *machine, const char *tag);
470void machine_config_remove_cpu(machine_config *machine, const char *tag);
471
472sound_config *machine_config_add_sound(machine_config *machine, const char *tag, sound_type type, int clock);
473sound_config *machine_config_find_sound(machine_config *machine, const char *tag);
474void machine_config_remove_sound(machine_config *machine, const char *tag);
475
476
477471#endif   /* __MCONFIG_H__ */
src/emu/drivers/empty.c
r3232r3233
2222static MACHINE_START( empty )
2323{
2424   /* force the UI to show the game select screen */
25   ui_menu_force_game_select();
25   ui_menu_force_game_select(machine);
2626}
2727
2828
src/emu/romload.c
r3232r3233
1616#include "harddisk.h"
1717#include "config.h"
1818#include "ui.h"
19#include "deprecat.h"
2019
2120
2221#define LOG_LOAD 0
r3232r3233
10099***************************************************************************/
101100
102101/*-------------------------------------------------
102    rom_source_is_gamedrv - return TRUE if the
103    given rom_source refers to the game driver
104    itself
105-------------------------------------------------*/
106
107int rom_source_is_gamedrv(const game_driver *drv, const rom_source *source)
108{
109   return ((const game_driver *)source == drv);
110}
111
112
113/*-------------------------------------------------
114    rom_first_source - return pointer to first ROM
115    source
116-------------------------------------------------*/
117
118const rom_source *rom_first_source(const game_driver *drv, const machine_config *config)
119{
120   const device_config *device;
121
122   /* if the driver has a ROM pointer, that's what we want */
123   if (drv->rom != NULL)
124      return (rom_source *)drv;
125
126   /* otherwise, look through devices */
127   if (config != NULL)
128      for (device = config->devicelist; device != NULL; device = device->next)
129      {
130         const rom_entry *devromp = device_get_info_ptr(device, DEVINFO_PTR_ROM_REGION);
131         if (devromp != NULL)
132            return (rom_source *)device;
133      }
134   return NULL;
135}
136
137
138/*-------------------------------------------------
139    rom_next_source - return pointer to next ROM
140    source
141-------------------------------------------------*/
142
143const rom_source *rom_next_source(const game_driver *drv, const machine_config *config, const rom_source *previous)
144{
145   const device_config *device;
146
147   /* if the previous was the driver, we want the first device */
148   if (rom_source_is_gamedrv(drv, previous))
149      device = (config != NULL) ? config->devicelist : NULL;
150   else
151      device = ((const device_config *)previous)->next;
152
153   /* look for further devices with ROM definitions */
154   for ( ; device != NULL; device = device->next)
155   {
156      const rom_entry *devromp = device_get_info_ptr(device, DEVINFO_PTR_ROM_REGION);
157      if (devromp != NULL)
158         return (rom_source *)device;
159   }
160   return NULL;
161}
162
163
164/*-------------------------------------------------
103165    rom_first_region - return pointer to first ROM
104166    region
105167-------------------------------------------------*/
106168
107const rom_entry *rom_first_region(const game_driver *drv)
169const rom_entry *rom_first_region(const game_driver *drv, const rom_source *source)
108170{
109   return (drv->rom != NULL && !ROMENTRY_ISEND(drv->rom)) ? drv->rom : NULL;
171   const rom_entry *romp;
172
173   if (source == NULL || rom_source_is_gamedrv(drv, source))
174      romp = drv->rom;
175   else
176      romp = device_get_info_ptr((const device_config *)source, DEVINFO_PTR_ROM_REGION);
177
178   return (romp != NULL && !ROMENTRY_ISEND(romp)) ? romp : NULL;
110179}
111180
112181
r3232r3233
176245
177246
178247/*-------------------------------------------------
248    rom_region_name - return the appropriate name
249    for a rom region
250-------------------------------------------------*/
251
252astring *rom_region_name(astring *result, const game_driver *drv, const rom_source *source, const rom_entry *romp)
253{
254   if (rom_source_is_gamedrv(drv, source))
255      astring_cpyc(result, ROMREGION_GETTAG(romp));
256   else
257   {
258      const device_config *device = (const device_config *)source;
259      astring_printf(result, "%s:%s", device->tag, ROMREGION_GETTAG(romp));
260   }
261   return result;
262}
263
264
265/*-------------------------------------------------
179266    debugload - log data to a file
180267-------------------------------------------------*/
181268
r3232r3233
247334    that will need to be loaded
248335-------------------------------------------------*/
249336
250static int count_roms(const rom_entry *romp)
337static int count_roms(running_machine *machine)
251338{
252339   const rom_entry *region, *rom;
340   const rom_source *source;
253341   int count = 0;
254342
255343   /* loop over regions, then over files */
256   for (region = romp; region; region = rom_next_region(region))
257      for (rom = rom_first_file(region); rom; rom = rom_next_file(rom))
258      {
259         int bios_flags = ROM_GETBIOSFLAGS(rom);
260         if (!bios_flags || (bios_flags == system_bios)) /* alternate bios sets */
261            count++;
262      }
344   for (source = rom_first_source(machine->gamedrv, machine->config); source != NULL; source = rom_next_source(machine->gamedrv, machine->config, source))
345      for (region = rom_first_region(machine->gamedrv, source); region != NULL; region = rom_next_region(region))
346         for (rom = rom_first_file(region); rom != NULL; rom = rom_next_file(rom))
347         {
348            int bios_flags = ROM_GETBIOSFLAGS(rom);
349            if (!bios_flags || (bios_flags == system_bios)) /* alternate bios sets */
350               count++;
351         }
263352
264353   /* return the total count */
265354   return count;
r3232r3233
271360    random data
272361-------------------------------------------------*/
273362
274static void fill_random(UINT8 *base, UINT32 length)
363static void fill_random(running_machine *machine, UINT8 *base, UINT32 length)
275364{
276365   while (length--)
277      *base++ = mame_rand(Machine);
366      *base++ = mame_rand(machine);
278367}
279368
280369
r3232r3233
412501    messages about ROM loading to the user
413502-------------------------------------------------*/
414503
415static void display_loading_rom_message(const char *name, rom_load_data *romdata)
504static void display_loading_rom_message(running_machine *machine, const char *name, rom_load_data *romdata)
416505{
417506   char buffer[200];
418507
r3232r3233
421510   else
422511      sprintf(buffer, "Loading Complete");
423512
424   ui_set_startup_text(Machine, buffer, FALSE);
513   ui_set_startup_text(machine, buffer, FALSE);
425514}
426515
427516
r3232r3233
430519    results of ROM loading
431520-------------------------------------------------*/
432521
433static void display_rom_load_results(rom_load_data *romdata)
522static void display_rom_load_results(running_machine *machine, rom_load_data *romdata)
434523{
435524   /* final status display */
436   display_loading_rom_message(NULL, romdata);
525   display_loading_rom_message(machine, NULL, romdata);
437526
438527   /* if we had errors, they are fatal */
439528   if (romdata->errors != 0)
r3232r3233
441530      const char *rgntag, *nextrgntag;
442531
443532      /* clean up any regions */
444      for (rgntag = memory_region_next(Machine, NULL); rgntag != NULL; rgntag = nextrgntag)
533      for (rgntag = memory_region_next(machine, NULL); rgntag != NULL; rgntag = nextrgntag)
445534      {
446         nextrgntag = memory_region_next(Machine, rgntag);
447         memory_region_free(Machine, rgntag);
535         nextrgntag = memory_region_next(machine, rgntag);
536         memory_region_free(machine, rgntag);
448537      }
449538
450539      /* create the error message and exit fatally */
451540      strcat(romdata->errorbuf, "ERROR: required files are missing, the "GAMENOUN" cannot be run.");
452      fatalerror_exitcode(MAMERR_MISSING_FILES, "%s", romdata->errorbuf);
541      fatalerror_exitcode(machine, MAMERR_MISSING_FILES, "%s", romdata->errorbuf);
453542   }
454543
455544   /* if we had warnings, output them, but continue */
r3232r3233
510599    up the parent and loading by checksum
511600-------------------------------------------------*/
512601
513static int open_rom_file(rom_load_data *romdata, const rom_entry *romp)
602static int open_rom_file(running_machine *machine, rom_load_data *romdata, const char *regiontag, const rom_entry *romp)
514603{
515604   file_error filerr = FILERR_NOT_FOUND;
516605   const game_driver *drv;
606   int has_crc = FALSE;
607   UINT8 crcbytes[4];
608   UINT32 crc = 0;
517609
610   /* update status display */
518611   ++romdata->romsloaded;
612   display_loading_rom_message(machine, ROM_GETNAME(romp), romdata);
519613
520   /* update status display */
521   display_loading_rom_message(ROM_GETNAME(romp), romdata);
614   /* extract CRC to use for searching */
615   has_crc = hash_data_extract_binary_checksum(ROM_GETHASHDATA(romp), HASH_CRC, crcbytes);
616   if (has_crc)
617      crc = (crcbytes[0] << 24) | (crcbytes[1] << 16) | (crcbytes[2] << 8) | crcbytes[3];
522618
523   /* Attempt reading up the chain through the parents. It automatically also
619   /* attempt reading up the chain through the parents. It automatically also
524620       attempts any kind of load by checksum supported by the archives. */
525621   romdata->file = NULL;
526   for (drv = Machine->gamedrv; !romdata->file && drv; drv = driver_get_clone(drv))
527      if (drv->name && *drv->name)
622   for (drv = machine->gamedrv; romdata->file == NULL && drv != NULL; drv = driver_get_clone(drv))
623      if (drv->name != NULL && *drv->name != 0)
528624      {
529         UINT8 crcs[4];
530         astring *fname;
531
532         fname = astring_assemble_3(astring_alloc(), drv->name, PATH_SEPARATOR, ROM_GETNAME(romp));
533         if (hash_data_extract_binary_checksum(ROM_GETHASHDATA(romp), HASH_CRC, crcs))
534         {
535            UINT32 crc = (crcs[0] << 24) | (crcs[1] << 16) | (crcs[2] << 8) | crcs[3];
625         astring *fname = astring_assemble_3(astring_alloc(), drv->name, PATH_SEPARATOR, ROM_GETNAME(romp));
626         if (has_crc)
536627            filerr = mame_fopen_crc(SEARCHPATH_ROM, astring_c(fname), crc, OPEN_FLAG_READ, &romdata->file);
537         }
538628         else
539629            filerr = mame_fopen(SEARCHPATH_ROM, astring_c(fname), OPEN_FLAG_READ, &romdata->file);
540630         astring_free(fname);
541631      }
542632
633   /* if the region is load by name, load the ROM from there */
634   if (regiontag != NULL)
635   {
636      astring *fname = astring_assemble_3(astring_alloc(), regiontag, PATH_SEPARATOR, ROM_GETNAME(romp));
637      if (has_crc)
638         filerr = mame_fopen_crc(SEARCHPATH_ROM, astring_c(fname), crc, OPEN_FLAG_READ, &romdata->file);
639      else
640         filerr = mame_fopen(SEARCHPATH_ROM, astring_c(fname), OPEN_FLAG_READ, &romdata->file);
641      astring_free(fname);
642   }
643
543644   /* return the result */
544645   return (filerr == FILERR_NONE);
545646}
r3232r3233
550651    random data for a NULL file
551652-------------------------------------------------*/
552653
553static int rom_fread(rom_load_data *romdata, UINT8 *buffer, int length)
654static int rom_fread(running_machine *machine, rom_load_data *romdata, UINT8 *buffer, int length)
554655{
555656   /* files just pass through */
556657   if (romdata->file)
r3232r3233
558659
559660   /* otherwise, fill with randomness */
560661   else
561      fill_random(buffer, length);
662      fill_random(machine, buffer, length);
562663
563664   return length;
564665}
r3232r3233
569670    entry
570671-------------------------------------------------*/
571672
572static int read_rom_data(rom_load_data *romdata, const rom_entry *romp)
673static int read_rom_data(running_machine *machine, rom_load_data *romdata, const rom_entry *romp)
573674{
574675   int datashift = ROM_GETBITSHIFT(romp);
575676   int datamask = ((1 << ROM_GETBITWIDTH(romp)) - 1) << datashift;
r3232r3233
597698
598699   /* special case for simple loads */
599700   if (datamask == 0xff && (groupsize == 1 || !reversed) && skip == 0)
600      return rom_fread(romdata, base, numbytes);
701      return rom_fread(machine, romdata, base, numbytes);
601702
602703   /* chunky reads for complex loads */
603704   skip += groupsize;
r3232r3233
609710
610711      /* read as much as we can */
611712      LOG(("  Reading %X bytes into buffer\n", bytesleft));
612      if (rom_fread(romdata, romdata->tempbuf, bytesleft) != bytesleft)
713      if (rom_fread(machine, romdata, romdata->tempbuf, bytesleft) != bytesleft)
613714         return 0;
614715      numbytes -= bytesleft;
615716
r3232r3233
700801    copy_rom_data - copy a region of ROM space
701802-------------------------------------------------*/
702803
703static void copy_rom_data(rom_load_data *romdata, const rom_entry *romp)
804static void copy_rom_data(running_machine *machine, rom_load_data *romdata, const rom_entry *romp)
704805{
705806   UINT8 *base = romdata->regionbase + ROM_GETOFFSET(romp);
706807   const char *srcrgntag = ROM_GETNAME(romp);
r3232r3233
717818      fatalerror("Error in RomModule definition: COPY has an invalid length\n");
718819
719820   /* make sure the source was valid */
720   srcbase = memory_region(Machine, srcrgntag);
821   srcbase = memory_region(machine, srcrgntag);
721822   if (srcbase == NULL)
722823      fatalerror("Error in RomModule definition: COPY from an invalid region\n");
723824
724825   /* make sure we find within the region space */
725   if (srcoffs + numbytes > memory_region_length(Machine, srcrgntag))
826   if (srcoffs + numbytes > memory_region_length(machine, srcrgntag))
726827      fatalerror("Error in RomModule definition: COPY out of source memory region space\n");
727828
728829   /* fill the data */
r3232r3233
735836    for a region
736837-------------------------------------------------*/
737838
738static void process_rom_entries(rom_load_data *romdata, const rom_entry *romp)
839static void process_rom_entries(running_machine *machine, rom_load_data *romdata, const char *regiontag, const rom_entry *romp)
739840{
740841   UINT32 lastflags = 0;
741842
r3232r3233
760861
761862      /* handle copies */
762863      else if (ROMENTRY_ISCOPY(romp))
763         copy_rom_data(romdata, romp++);
864         copy_rom_data(machine, romdata, romp++);
764865
765866      /* handle files */
766867      else if (ROMENTRY_ISFILE(romp))
r3232r3233
773874
774875            /* open the file */
775876            LOG(("Opening ROM file: %s\n", ROM_GETNAME(romp)));
776            if (!open_rom_file(romdata, romp))
877            if (!open_rom_file(machine, romdata, regiontag, romp))
777878               handle_missing_file(romdata, romp);
778879
779880            /* loop until we run out of reloads */
r3232r3233
795896
796897                  /* attempt to read using the modified entry */
797898                  if (!ROMENTRY_ISIGNORE(&modified_romp))
798                     readresult = read_rom_data(romdata, &modified_romp);
899                     readresult = read_rom_data(machine, romdata, &modified_romp);
799900               }
800901               while (ROMENTRY_ISCONTINUE(romp) || ROMENTRY_ISIGNORE(romp));
801902
r3232r3233
856957{
857958   const game_driver *drv, *searchdrv;
858959   const rom_entry *region, *rom;
960   const rom_source *source;
859961   file_error filerr;
860962   chd_error err;
861963
r3232r3233
889991   /* otherwise, look at our parents for a CHD with an identical checksum */
890992   /* and try to open that */
891993   for (drv = gamedrv; drv != NULL; drv = driver_get_clone(drv))
892      for (region = rom_first_region(drv); region != NULL; region = rom_next_region(region))
893         if (ROMREGION_ISDISKDATA(region))
894            for (rom = rom_first_file(region); rom != NULL; rom = rom_next_file(rom))
994      for (source = rom_first_source(drv, NULL); source != NULL; source = rom_next_source(drv, NULL, source))
995         for (region = rom_first_region(drv, source); region != NULL; region = rom_next_region(region))
996            if (ROMREGION_ISDISKDATA(region))
997               for (rom = rom_first_file(region); rom != NULL; rom = rom_next_file(rom))
895998
896               /* look for a differing name but with the same hash data */
897               if (strcmp(ROM_GETNAME(romp), ROM_GETNAME(rom)) != 0 &&
898                  hash_data_is_equal(ROM_GETHASHDATA(romp), ROM_GETHASHDATA(rom), 0))
899               {
900                  /* attempt to open the properly named file, scanning up through parent directories */
901                  filerr = FILERR_NOT_FOUND;
902                  for (searchdrv = drv; searchdrv != NULL && filerr != FILERR_NONE; searchdrv = driver_get_clone(searchdrv))
999                  /* look for a differing name but with the same hash data */
1000                  if (strcmp(ROM_GETNAME(romp), ROM_GETNAME(rom)) != 0 &&
1001                     hash_data_is_equal(ROM_GETHASHDATA(romp), ROM_GETHASHDATA(rom), 0))
9031002                  {
904                     astring *fname = astring_assemble_4(astring_alloc(), searchdrv->name, PATH_SEPARATOR, ROM_GETNAME(rom), ".chd");
905                     filerr = mame_fopen_options(options, SEARCHPATH_IMAGE, astring_c(fname), OPEN_FLAG_READ, image_file);
906                     astring_free(fname);
907                  }
1003                     /* attempt to open the properly named file, scanning up through parent directories */
1004                     filerr = FILERR_NOT_FOUND;
1005                     for (searchdrv = drv; searchdrv != NULL && filerr != FILERR_NONE; searchdrv = driver_get_clone(searchdrv))
1006                     {
1007                        astring *fname = astring_assemble_4(astring_alloc(), searchdrv->name, PATH_SEPARATOR, ROM_GETNAME(rom), ".chd");
1008                        filerr = mame_fopen_options(options, SEARCHPATH_IMAGE, astring_c(fname), OPEN_FLAG_READ, image_file);
1009                        astring_free(fname);
1010                     }
9081011
909                  /* did the file open succeed? */
910                  if (filerr == FILERR_NONE)
911                  {
912                     /* try to open the CHD */
913                     err = chd_open_file(mame_core_file(*image_file), CHD_OPEN_READ, NULL, image_chd);
914                     if (err == CHDERR_NONE)
915                        return err;
1012                     /* did the file open succeed? */
1013                     if (filerr == FILERR_NONE)
1014                     {
1015                        /* try to open the CHD */
1016                        err = chd_open_file(mame_core_file(*image_file), CHD_OPEN_READ, NULL, image_chd);
1017                        if (err == CHDERR_NONE)
1018                           return err;
9161019
917                     /* close the file on failure */
918                     mame_fclose(*image_file);
919                     *image_file = NULL;
1020                        /* close the file on failure */
1021                        mame_fclose(*image_file);
1022                        *image_file = NULL;
1023                     }
9201024                  }
921               }
9221025
9231026   return err;
9241027}
r3232r3233
9781081    for a region
9791082-------------------------------------------------*/
9801083
981static void process_disk_entries(rom_load_data *romdata, const char *regiontag, const rom_entry *romp)
1084static void process_disk_entries(running_machine *machine, rom_load_data *romdata, const char *regiontag, const rom_entry *romp)
9821085{
9831086   astring *filename = astring_alloc();
9841087
r3232r3233
10011104
10021105         /* first open the source drive */
10031106         LOG(("Opening disk image: %s\n", astring_c(filename)));
1004         err = open_disk_image(Machine->gamedrv, romp, &chd.origfile, &chd.origchd);
1107         err = open_disk_image(machine->gamedrv, romp, &chd.origfile, &chd.origchd);
10051108         if (err != CHDERR_NONE)
10061109         {
10071110            if (err == CHDERR_FILE_NOT_FOUND)
r3232r3233
10401143         if (!DISK_ISREADONLY(romp))
10411144         {
10421145            /* try to open or create the diff */
1043            err = open_disk_diff(Machine->gamedrv, romp, chd.origchd, &chd.difffile, &chd.diffchd);
1146            err = open_disk_diff(machine->gamedrv, romp, chd.origchd, &chd.difffile, &chd.diffchd);
10441147            if (err != CHDERR_NONE)
10451148            {
10461149               sprintf(&romdata->errorbuf[strlen(romdata->errorbuf)], "%s DIFF CHD ERROR: %s\n", astring_c(filename), chd_error_string(err));
r3232r3233
10971200
10981201
10991202/*-------------------------------------------------
1203    process_region_list - process a region list
1204-------------------------------------------------*/
1205
1206static void process_region_list(running_machine *machine, rom_load_data *romdata)
1207{
1208   astring *regiontag = astring_alloc();
1209   const rom_source *source;
1210   const rom_entry *region;
1211
1212   /* loop until we hit the end */
1213   for (source = rom_first_source(machine->gamedrv, machine->config); source != NULL; source = rom_next_source(machine->gamedrv, machine->config, source))
1214      for (region = rom_first_region(machine->gamedrv, source); region != NULL; region = rom_next_region(region))
1215      {
1216         UINT32 regionlength = ROMREGION_GETLENGTH(region);
1217         UINT32 regionflags = ROMREGION_GETFLAGS(region);
1218
1219         rom_region_name(regiontag, machine->gamedrv, source, region);
1220         LOG(("Processing region \"%s\" (length=%X)\n", astring_c(regiontag), regionlength));
1221
1222         /* the first entry must be a region */
1223         assert(ROMENTRY_ISREGION(region));
1224
1225         /* if this is a CPU region, override with the CPU width and endianness */
1226         if (mame_find_cpu_index(machine, astring_c(regiontag)) >= 0)
1227            regionflags = normalize_flags_for_cpu(machine, regionflags, astring_c(regiontag));
1228
1229         /* remember the base and length */
1230         romdata->regionbase = memory_region_alloc(machine, astring_c(regiontag), regionlength, regionflags);
1231         romdata->regionlength = regionlength;
1232         LOG(("Allocated %X bytes @ %p\n", romdata->regionlength, romdata->regionbase));
1233
1234         /* clear the region if it's requested */
1235         if (ROMREGION_ISERASE(region))
1236            memset(romdata->regionbase, ROMREGION_GETERASEVAL(region), romdata->regionlength);
1237
1238         /* or if it's sufficiently small (<= 4MB) */
1239         else if (romdata->regionlength <= 0x400000)
1240            memset(romdata->regionbase, 0, romdata->regionlength);
1241
1242   #ifdef MAME_DEBUG
1243         /* if we're debugging, fill region with random data to catch errors */
1244         else
1245            fill_random(machine, romdata->regionbase, romdata->regionlength);
1246   #endif
1247
1248         /* now process the entries in the region */
1249         if (ROMREGION_ISROMDATA(region))
1250            process_rom_entries(machine, romdata, ROMREGION_ISLOADBYNAME(region) ? ROMREGION_GETTAG(region) : NULL, region + 1);
1251         else if (ROMREGION_ISDISKDATA(region))
1252            process_disk_entries(machine, romdata, ROMREGION_GETTAG(region), region + 1);
1253      }
1254
1255   /* now go back and post-process all the regions */
1256   for (source = rom_first_source(machine->gamedrv, machine->config); source != NULL; source = rom_next_source(machine->gamedrv, machine->config, source))
1257      for (region = rom_first_region(machine->gamedrv, source); region != NULL; region = rom_next_region(region))
1258         region_post_process(machine, romdata, ROMREGION_GETTAG(region));
1259
1260   astring_free(regiontag);
1261}
1262
1263
1264/*-------------------------------------------------
11001265    rom_init - new, more flexible ROM
11011266    loading system
11021267-------------------------------------------------*/
11031268
1104void rom_init(running_machine *machine, const rom_entry *romp)
1269void rom_init(running_machine *machine)
11051270{
11061271   static rom_load_data romdata;
1107   const rom_entry *region;
11081272
1109   /* if no roms, bail */
1110   if (romp == NULL)
1111      return;
1112
11131273   /* make sure we get called back on the way out */
11141274   add_exit_callback(machine, rom_exit);
11151275
r3232r3233
11171277   memset(&romdata, 0, sizeof(romdata));
11181278
11191279   /* determine the correct biosset to load based on OPTION_BIOS string */
1120   system_bios = determine_bios_rom(&romdata, romp);
1280   system_bios = determine_bios_rom(&romdata, machine->gamedrv->rom);
11211281
1122   romdata.romstotal = count_roms(romp);
1282   /* count the total number of ROMs */
1283   romdata.romstotal = count_roms(machine);
11231284
11241285   /* reset the disk list */
11251286   chd_list = NULL;
11261287   chd_list_tailptr = &chd_list;
11271288
1128   /* loop until we hit the end */
1129   for (region = romp; region; region = rom_next_region(region))
1130   {
1131      UINT32 regionlength = ROMREGION_GETLENGTH(region);
1132      UINT32 regionflags = ROMREGION_GETFLAGS(region);
1133      const char *regiontag = ROMREGION_GETTAG(region);
1289   /* process the ROM entries we were passed */
1290   process_region_list(machine, &romdata);
11341291
1135      LOG(("Processing region \"%s\" (length=%X)\n", regiontag, regionlength));
1136
1137      /* the first entry must be a region */
1138      assert(ROMENTRY_ISREGION(region));
1139
1140      /* if this is a CPU region, override with the CPU width and endianness */
1141      if (mame_find_cpu_index(machine, regiontag) >= 0)
1142         regionflags = normalize_flags_for_cpu(machine, regionflags, regiontag);
1143
1144      /* remember the base and length */
1145      romdata.regionbase = memory_region_alloc(machine, regiontag, regionlength, regionflags);
1146      romdata.regionlength = regionlength;
1147      LOG(("Allocated %X bytes @ %p\n", romdata.regionlength, romdata.regionbase));
1148
1149      /* clear the region if it's requested */
1150      if (ROMREGION_ISERASE(region))
1151         memset(romdata.regionbase, ROMREGION_GETERASEVAL(region), romdata.regionlength);
1152
1153      /* or if it's sufficiently small (<= 4MB) */
1154      else if (romdata.regionlength <= 0x400000)
1155         memset(romdata.regionbase, 0, romdata.regionlength);
1156
1157#ifdef MAME_DEBUG
1158      /* if we're debugging, fill region with random data to catch errors */
1159      else
1160         fill_random(romdata.regionbase, romdata.regionlength);
1161#endif
1162
1163      /* now process the entries in the region */
1164      if (ROMREGION_ISROMDATA(region))
1165         process_rom_entries(&romdata, region + 1);
1166      else if (ROMREGION_ISDISKDATA(region))
1167         process_disk_entries(&romdata, regiontag, region + 1);
1168   }
1169
1170   /* now go back and post-process all the regions */
1171   for (region = romp; region != NULL; region = rom_next_region(region))
1172      region_post_process(machine, &romdata, ROMREGION_GETTAG(region));
1173
11741292   /* display the results and exit */
11751293   total_rom_load_warnings = romdata.warnings;
11761294
1177   display_rom_load_results(&romdata);
1295   display_rom_load_results(machine, &romdata);
11781296}
11791297
11801298
src/lib/util/corefile.c
r3232r3233
135135/*-------------------------------------------------
136136    core_fopen_ram_internal - open a RAM-based buffer
137137    for file-like access, possibly copying the data,
138   and return an error code
138    and return an error code
139139-------------------------------------------------*/
140140
141141static file_error core_fopen_ram_internal(const void *data, size_t length, int copy_buffer, UINT32 openflags, core_file **file)
src/mess/uimess.c
r3232r3233
313313   }
314314
315315   /* process the menu */
316   ui_menu_process(menu, 0);
316   ui_menu_process(machine, menu, 0);
317317}
318318
319319
r3232r3233
408408   }
409409
410410   /* process the menu */
411   event = ui_menu_process(menu, 0);
411   event = ui_menu_process(machine, menu, 0);
412412
413413   if (event != NULL)
414414   {
src/mess/mess.c
r3232r3233
3535
3636
3737
38static void ram_init(const game_driver *gamedrv)
38static void ram_init(running_machine *machine, const game_driver *gamedrv)
3939{
4040   int i;
4141   char buffer[1024];
r3232r3233
5050      specified_ram = ram_parse_string(ramsize_string);
5151      if (specified_ram == 0)
5252      {
53         fatalerror_exitcode(MAMERR_DEVICE, "Cannot recognize the RAM option %s\n", ramsize_string);
53         fatalerror_exitcode(machine, MAMERR_DEVICE, "Cannot recognize the RAM option %s\n", ramsize_string);
5454      }
5555
5656      /* is this option actually valid? */
r3232r3233
6363         if (opt_count == 0)
6464         {
6565            /* this driver doesn't support RAM configurations */
66            fatalerror_exitcode(MAMERR_DEVICE, "Driver '%s' does not support RAM configurations\n", gamedrv->name);
66            fatalerror_exitcode(machine, MAMERR_DEVICE, "Driver '%s' does not support RAM configurations\n", gamedrv->name);
6767         }
6868         else
6969         {
r3232r3233
7373            for (i = 0; i < opt_count; i++)
7474               s += sprintf(s, "%s%s",  i ? " or " : "", ram_string(buffer2, ram_option(gamedrv, i)));
7575            s += sprintf(s, ")\n");
76            fatalerror_exitcode(MAMERR_DEVICE, "%s", buffer);
76            fatalerror_exitcode(machine, MAMERR_DEVICE, "%s", buffer);
7777         }
7878      }
7979      mess_ram_size = specified_ram;
r3232r3233
115115   mess_devices_setup((machine_config *) machine->config, machine->gamedrv);
116116
117117   /* initialize RAM code */
118   ram_init(machine->gamedrv);
118   ram_init(machine, machine->gamedrv);
119119}
120120
121121
r3232r3233
152152         /* did the image load fail? */
153153         if (result)
154154         {
155            fatalerror_exitcode(MAMERR_DEVICE, "Device %s load (%s) failed: %s\n",
155            fatalerror_exitcode(machine, MAMERR_DEVICE, "Device %s load (%s) failed: %s\n",
156156               info.name,
157157               osd_basename((char *) image_name),
158158               image_error(image));
r3232r3233
163163         /* no image... must this device be loaded? */
164164         if (info.must_be_loaded)
165165         {
166            fatalerror_exitcode(MAMERR_DEVICE, "Driver requires that device \"%s\" must have an image to load\n", info.instance_name);
166            fatalerror_exitcode(machine, MAMERR_DEVICE, "Driver requires that device \"%s\" must have an image to load\n", info.instance_name);
167167         }
168168      }
169169   }
src/mess/tapectrl.c
r3232r3233
190190   menu_tape_control_populate(machine, menu, state);
191191
192192   /* process the menu */
193   event = ui_menu_process(menu, 0);
193   event = ui_menu_process(machine, menu, 0);
194194   if (event != NULL)
195195   {
196196      switch(event->iptkey)
src/mess/audio/lmc1992.c
r3232r3233
162162   state_save_register_item(unique_tag, 0, lmc1992->fader_lf);
163163   state_save_register_item(unique_tag, 0, lmc1992->fader_rr);
164164   state_save_register_item(unique_tag, 0, lmc1992->fader_lr);
165   return DEVICE_START_OK;
165166}
166167
167168static DEVICE_SET_INFO( lmc1992 )
src/mess/video/dgn_beta.c
r3232r3233
132132static int NoScreen      = 0;
133133
134134/* Debugging commands and handlers. */
135static void ToggleRegLog(int ref, int params, const char *param[]);
135static void execute_beta_vid_log(running_machine *machine, int ref, int params, const char *param[]);
136136static void RegLog(int offset, int data);
137static void FillScreen(int ref, int params, const char *param[]);
138static void ScreenBox(int ref, int params, const char *param[]);
139static void VidToggle(int ref, int params, const char *param[]);
140static void ShowVidLimits(int ref, int params, const char *param[]);
141static void SetClkMax(int ref, int params, const char *param[]);
137static void execute_beta_vid_fill(running_machine *machine, int ref, int params, const char *param[]);
138static void execute_beta_vid_box(running_machine *machine, int ref, int params, const char *param[]);
139static void execute_beta_vid(running_machine *machine, int ref, int params, const char *param[]);
140static void execute_beta_vid_limits(running_machine *machine, int ref, int params, const char *param[]);
141static void execute_beta_vid_clkmax(running_machine *machine, int ref, int params, const char *param[]);
142142
143143static bitmap_t   *bit;
144144static int MinAddr   = 0xFFFF;
r3232r3233
326326   /* setup debug commands */
327327   if (machine->debug_flags & DEBUG_FLAG_ENABLED)
328328   {
329      debug_console_register_command("beta_vid_log", CMDFLAG_NONE, 0, 0, 0,ToggleRegLog);
330      debug_console_register_command("beta_vid_fill", CMDFLAG_NONE, 0, 0, 0,FillScreen);
331      debug_console_register_command("beta_vid_box", CMDFLAG_NONE, 0, 0, 5,ScreenBox);
332      debug_console_register_command("beta_vid", CMDFLAG_NONE, 0, 0, 0,VidToggle);
333      debug_console_register_command("beta_vid_limits", CMDFLAG_NONE, 0, 0, 0,ShowVidLimits);
334      debug_console_register_command("beta_vid_clkmax", CMDFLAG_NONE, 0, 0, 1,SetClkMax);
329      debug_console_register_command(machine, "beta_vid_log", CMDFLAG_NONE, 0, 0, 0, execute_beta_vid_log);
330      debug_console_register_command(machine, "beta_vid_fill", CMDFLAG_NONE, 0, 0, 0, execute_beta_vid_fill);
331      debug_console_register_command(machine, "beta_vid_box", CMDFLAG_NONE, 0, 0, 5, execute_beta_vid_box);
332      debug_console_register_command(machine, "beta_vid", CMDFLAG_NONE, 0, 0, 0, execute_beta_vid);
333      debug_console_register_command(machine, "beta_vid_limits", CMDFLAG_NONE, 0, 0, 0, execute_beta_vid_limits);
334      debug_console_register_command(machine, "beta_vid_clkmax", CMDFLAG_NONE, 0, 0, 1, execute_beta_vid_clkmax);
335335   }
336336   LogRegWrites=0;
337337}
r3232r3233
725725 *
726726 *************************************/
727727
728static void ToggleRegLog(int ref, int params, const char *param[])
728static void execute_beta_vid_log(running_machine *machine, int ref, int params, const char *param[])
729729{
730730   LogRegWrites=!LogRegWrites;
731731
r3232r3233
761761      debug_console_printf("6845 write Reg %s Addr=%3d Data=%3d ($%2.2X) \n",RegName,VidAddr,data,data);
762762}
763763
764static void FillScreen(int ref, int params, const char *param[])
764static void execute_beta_vid_fill(running_machine *machine, int ref, int params, const char *param[])
765765{
766766   int   x;
767767
r3232r3233
772772   NoScreen=1;
773773}
774774
775static void ScreenBox(int ref, int params, const char *param[])
775static void execute_beta_vid_box(running_machine *machine, int ref, int params, const char *param[])
776776{
777777   int   x,y;
778778
r3232r3233
797797}
798798
799799
800static void VidToggle(int ref, int params, const char *param[])
800static void execute_beta_vid(running_machine *machine, int ref, int params, const char *param[])
801801{
802802   NoScreen=!NoScreen;
803803}
804804
805static void ShowVidLimits(int ref, int params, const char *param[])
805static void execute_beta_vid_limits(running_machine *machine, int ref, int params, const char *param[])
806806{
807807   debug_console_printf("Min X     =$%4X, Max X     =$%4X\n",MinX,MaxX);
808808   debug_console_printf("Min Y     =$%4X, Max Y     =$%4X\n",MinY,MaxY);
r3232r3233
818818      debug_console_printf("Gfx4/Text\n");
819819}
820820
821static void SetClkMax(int ref, int params, const char *param[])
821static void execute_beta_vid_clkmax(running_machine *machine, int ref, int params, const char *param[])
822822{
823823   if(params>0)   sscanf(param[0],"%d",&ClkMax);
824824}
src/mess/video/i8275.c
r3232r3233
536536
537537   state_save_register_item(unique_tag, 0, i8275->burst_space_code);
538538   state_save_register_item(unique_tag, 0, i8275->burst_count_code);
539   return DEVICE_START_OK;
539540}
540541
541542static DEVICE_RESET( i8275 )
src/mess/video/m6847.c
r3232r3233
16731673 *************************************/
16741674
16751675
1676static void execute_dumpscanline(int ref, int params, const char **param)
1676static void execute_m6847_dumpscanline(running_machine *machine, int ref, int params, const char **param)
16771677{
16781678   int i;
16791679   int beamx = get_beamx() / 8;
r3232r3233
19151915
19161916   /* setup debug commands */
19171917   if (machine->debug_flags & DEBUG_FLAG_ENABLED)
1918      debug_console_register_command("m6847_dumpscanline", CMDFLAG_NONE, 0, 0, 0, execute_dumpscanline);
1918      debug_console_register_command(machine, "m6847_dumpscanline", CMDFLAG_NONE, 0, 0, 0, execute_m6847_dumpscanline);
19191919}
19201920
19211921
src/mess/video/crtc_ega.c
r3232r3233
772772static DEVICE_START( crtc_ega )
773773{
774774   common_start(device, TYPE_CRTC_EGA);
775   return DEVICE_START_OK;
775776}
776777
777778
src/mess/video/zx8301.c
r3232r3233
269269   state_save_register_item(unique_tag, 0, zx8301->flash);
270270   state_save_register_item(unique_tag, 0, zx8301->vsync);
271271   state_save_register_item(unique_tag, 0, zx8301->vda);
272   return DEVICE_START_OK;
272273}
273274
274275static DEVICE_RESET( zx8301 )
src/mess/video/msm6255.c
r3232r3233
379379
380380   state_save_register_item(unique_tag, 0, msm6255->cursor);
381381   state_save_register_item(unique_tag, 0, msm6255->frame);
382   return DEVICE_START_OK;
382383}
383384
384385static DEVICE_RESET( msm6255 )
src/mess/video/cdp1864.c
r3232r3233
398398   state_save_register_item(unique_tag, 0, cdp1864->incr);
399399
400400   state_save_register_bitmap(unique_tag, 0, "cdp1864->bitmap", cdp1864->bitmap);
401   return DEVICE_START_OK;
401402}
402403
403404static DEVICE_RESET( cdp1864 )
src/mess/video/dl1416.c
r3232r3233
139139   state_save_register_item(unique_tag, 0, dl1416->cursor_enable);
140140   state_save_register_item(unique_tag, 0, dl1416->write_enable);
141141   state_save_register_item_array(unique_tag, 0, dl1416->cursor_ram);
142   return DEVICE_START_OK;
142143}
143144
144145
src/mess/video/cdp1861.c
r3232r3233
218218   state_save_register_item(unique_tag, 0, cdp1861->disp);
219219   state_save_register_item(unique_tag, 0, cdp1861->dmaout);
220220   state_save_register_bitmap(unique_tag, 0, "cdp1861->bitmap", cdp1861->bitmap);
221   return DEVICE_START_OK;
221222}
222223
223224static DEVICE_RESET( cdp1861 )
src/mess/device.c
r3232r3233
182182
183183static DEVICE_START(mess_device)
184184{
185   device_start_err err = DEVICE_START_OK;
186
185187   mess_device_config *mess_device = (mess_device_config *) device->inline_config;
186188   mess_device_token *token = (mess_device_token *) device->token;
187189   device_start_func inner_start;
r3232r3233
192194   /* if present, invoke the start handler */
193195   inner_start = (device_start_func) mess_device_get_info_fct(&mess_device->io_device.devclass, MESS_DEVINFO_PTR_START);
194196   if (inner_start != NULL)
195      (*inner_start)(device);
197      err = (*inner_start)(device);
198
199   return err;
196200}
197201
198202
src/mess/machine/dgn_beta.c
r3232r3233
9090
9191/* Debugging commands and handlers. */
9292static offs_t dgnbeta_dasm_override(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
93static void ToggleDatLog(int ref, int params, const char *param[]);
94static void DumpKeys(int ref, int params, const char *param[]);
93static void execute_beta_dat_log(running_machine *machine, int ref, int params, const char *param[]);
94static void execute_beta_key_dump(running_machine *machine, int ref, int params, const char *param[]);
9595
9696/* Debugging variables */
9797static int LogDatWrites;
r3232r3233
10801080   /* setup debug commands */
10811081   if (machine->debug_flags & DEBUG_FLAG_ENABLED)
10821082   {
1083      debug_console_register_command("beta_dat_log", CMDFLAG_NONE, 0, 0, 0,ToggleDatLog);
1084      debug_console_register_command("beta_key_dump", CMDFLAG_NONE, 0, 0, 0,DumpKeys);
1083      debug_console_register_command(machine, "beta_dat_log", CMDFLAG_NONE, 0, 0, 0, execute_beta_dat_log);
1084      debug_console_register_command(machine, "beta_key_dump", CMDFLAG_NONE, 0, 0, 0, execute_beta_key_dump);
10851085   }
10861086   LogDatWrites=0;
10871087}
r3232r3233
12601260   return result;
12611261}
12621262
1263static void ToggleDatLog(int ref, int params, const char *param[])
1263static void execute_beta_dat_log(running_machine *machine, int ref, int params, const char *param[])
12641264{
12651265   LogDatWrites=!LogDatWrites;
12661266
12671267   debug_console_printf("DAT register write info set : %d\n",LogDatWrites);
12681268}
12691269
1270static void DumpKeys(int ref, int params, const char *param[])
1270static void execute_beta_key_dump(running_machine *machine, int ref, int params, const char *param[])
12711271{
12721272   int Idx;
12731273
src/mess/machine/pdp1.c
r3232r3233
373373
374374DEVICE_START( pdp1_tape )
375375{
376   return DEVICE_START_OK;
376377}
377378
378379
src/mess/machine/applefdc.c
r3232r3233
643643static DEVICE_START(oldfdc)
644644{
645645   applefdc_start(device, APPLEFDC_APPLE2);
646   return DEVICE_START_OK;
646647}
647648
648649
r3232r3233
676677static DEVICE_START(iwm)
677678{
678679   applefdc_start(device, APPLEFDC_IWM);
680   return DEVICE_START_OK;
679681}
680682
681683
r3232r3233
709711static DEVICE_START(swim)
710712{
711713   applefdc_start(device, APPLEFDC_SWIM);
714   return DEVICE_START_OK;
712715}
713716
714717
src/mess/machine/ap2_slot.c
r3232r3233
9696   {
9797      token->slot_device = NULL;
9898   }
99   return DEVICE_START_OK;
99100}
100101
101102
src/mess/machine/hp48.c
r3232r3233
10801080static DEVICE_START( hp48_port )
10811081{
10821082   hp48_unfill_port( device );
1083   return DEVICE_START_OK;
10831084}
10841085
10851086DEVICE_GET_INFO( hp48_port )
src/mess/machine/mockngbd.c
r3232r3233
7676
7777static DEVICE_START(mockingboard)
7878{
79   return DEVICE_START_OK;
7980}
8081
8182
src/mess/machine/ncr5380.c
r3232r3233
440440#if NCR5380_DEVICE_CONVERSION
441441static DEVICE_START( ncr5380 )
442442{
443   return DEVICE_START_OK;
443444}
444445
445446
src/mess/machine/d88.c
r3232r3233
3535DEVICE_START(d88image_floppy)
3636{
3737   floppy_drive_init(device, &d88image_floppy_interface);
38   return DEVICE_START_OK;
3839}
3940
4041/* attempt to insert a disk into the drive specified with id */
src/mess/machine/pokemini.c
r3232r3233
14001400
14011401DEVICE_START( pokemini_cart )
14021402{
1403   return DEVICE_START_OK;
14031404}
14041405
14051406DEVICE_IMAGE_LOAD( pokemini_cart )
src/mess/machine/gb.c
r3232r3233
14051405   CartType = 0;
14061406   ROMMask = 0;
14071407   RAMMask = 0;
1408   return DEVICE_START_OK;
14081409}
14091410
14101411DEVICE_IMAGE_LOAD(gb_cart)
src/mess/machine/gamecom.c
r3232r3233
593593DEVICE_START( gamecom_cart )
594594{
595595   internal_ram = sm8500_internal_ram();
596   return DEVICE_START_OK;
596597}
597598
598599DEVICE_IMAGE_LOAD( gamecom_cart )
src/mess/machine/ins8154.c
r3232r3233
6464   state_save_register_item(unique_tag, 0, ins8154->mdr);
6565   state_save_register_item(unique_tag, 0, ins8154->odra);
6666   state_save_register_item(unique_tag, 0, ins8154->odrb);
67   return DEVICE_START_OK;
6768}
6869
6970
src/mess/machine/smartmed.c
r3232r3233
120120   smartmedia[id].pagereg = NULL;
121121   smartmedia[id].id[0] = smartmedia[id].id[1] = 0;
122122   smartmedia[id].mp_opcode = 0;
123   return DEVICE_START_OK;
123124}
124125
125126/*
src/mess/machine/advision.c
r3232r3233
2929MACHINE_START( advision )
3030{
3131   /* configure EA banking */
32   memory_configure_bank(MCS48_INTERNAL_ROMBANK, 0, 1, memory_region(machine, "bios"), 0);
33   memory_configure_bank(MCS48_INTERNAL_ROMBANK, 1, 1, memory_region(machine, "main"), 0);
32   memory_configure_bank(1, 0, 1, memory_region(machine, "bios"), 0);
33   memory_configure_bank(1, 1, 1, memory_region(machine, "main"), 0);
3434}
3535
3636MACHINE_RESET( advision )
src/mess/machine/serial.c
r3232r3233
639639{
640640   int id = image_index_in_device(device);
641641   memset(&serial_devices[id], 0, sizeof(serial_devices[id]));
642   return DEVICE_START_OK;
642643}
643644
644645DEVICE_IMAGE_LOAD(serial_device)
src/mess/machine/thomson.c
r3232r3233
208208   serial_device_setup( device, 2400, 7, 2, SERIAL_PARITY_NONE ); /* default */
209209   serial_device_set_protocol( device, SERIAL_PROTOCOL_NONE );
210210   serial_device_set_transmit_state( device, 1 );
211   return DEVICE_START_OK;
211212}
212213
213214
src/mess/machine/cdp1871.c
r3232r3233
324324   state_save_register_item(unique_tag, 0, cdp1871->next_da);
325325   state_save_register_item(unique_tag, 0, cdp1871->rpt);
326326   state_save_register_item(unique_tag, 0, cdp1871->next_rpt);
327   return DEVICE_START_OK;
327328}
328329
329330static DEVICE_SET_INFO( cdp1871 )
src/mess/machine/8530scc.c
r3232r3233
6666{
6767   scc8530_t *scc = get_token(device);
6868   memset(scc, 0, sizeof(*scc));
69   return DEVICE_START_OK;
6970}
7071
7172
src/mess/machine/tx0.c
r3232r3233
200200
201201DEVICE_START( tx0_tape )
202202{
203   return DEVICE_START_OK;
203204}
204205
205206
r3232r3233
557558DEVICE_START( tx0_magtape )
558559{
559560   magtape.img = device;
561   return DEVICE_START_OK;
560562}
561563
562564/*
src/mess/machine/c128.c
r3232r3233
552552      {
553553         DBG_LOG (1, "switching to z80",
554554                  ("active %d\n",cpu_getactivecpu()) );
555         memory_set_context(0);
555         memory_set_context(machine, 0);
556556         c128_bankswitch_z80(machine);
557         memory_set_context(1);
557         memory_set_context(machine, 1);
558558         cpunum_set_input_line(machine, 0, INPUT_LINE_HALT, CLEAR_LINE);
559559         cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
560560      }
r3232r3233
562562      {
563563         DBG_LOG (1, "switching to m6502",
564564                  ("active %d\n",cpu_getactivecpu()) );
565         memory_set_context(1);
565         memory_set_context(machine, 1);
566566         c128_bankswitch_128(machine, reset);
567         memory_set_context(0);
567         memory_set_context(machine, 0);
568568         cpunum_set_input_line(machine, 0, INPUT_LINE_HALT, ASSERT_LINE);
569569         cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, CLEAR_LINE);
570570
src/mess/machine/ap2_lang.c
r3232r3233
8989static DEVICE_START(apple2_langcard)
9090{
9191   /* nothing to do */
92   return DEVICE_START_OK;
9293}
9394
9495
src/mess/machine/oric.c
r3232r3233
10871087{
10881088   /* TODO - THIS DOES NOT MULTITASK BETWEEN ORIC BASICDSKs AND MFM DISKS */
10891089   floppy_drive_init(device, NULL);
1090   return DEVICE_START_OK;
10901091}
10911092
10921093
src/mess/machine/68901mfp.c
r3232r3233
14481448   state_save_register_item(unique_tag, 0, mc68901->rxtx_stop);
14491449   state_save_register_item(unique_tag, 0, mc68901->rsr_read);
14501450   state_save_register_item(unique_tag, 0, mc68901->next_rsr);
1451   return DEVICE_START_OK;
14511452}
14521453
14531454static DEVICE_RESET( mc68901 )
src/mess/machine/amigafdc.c
r3232r3233
9595   fdc_side = 1;
9696   fdc_step = 1;
9797   fdc_rdy = 0;
98   return DEVICE_START_OK;
9899}
99100
100101static void check_extended_image( int id )
src/mess/machine/a7800.c
r3232r3233
223223   /* defaults for PAL bios without cart */
224224   a7800_cart_type = 0;
225225   a7800_stick_type = 1;
226   return DEVICE_START_OK;
226227}
227228
228229DEVICE_IMAGE_LOAD( a7800_cart )
src/mess/machine/sms.c
r3232r3233
759759
760760   /* Initially set the vdp to not use sms compatibility mode for GG */
761761   sms_set_ggsmsmode( 0 );
762   return DEVICE_START_OK;
762763}
763764
764765DEVICE_IMAGE_LOAD( sms_cart )
src/mess/machine/ti85.c
r3232r3233
665665{
666666   ti85_free_serial_data_memory(device->machine);
667667   ti85_receive_serial (NULL,0);
668   return DEVICE_START_OK;
668669}
669670
670671DEVICE_IMAGE_LOAD( ti85_serial )
src/mess/machine/svi318.c
r3232r3233
113113{
114114   pcart = NULL;
115115   pcart_rom_size = 0;
116   return DEVICE_START_OK;
116117}
117118
118119DEVICE_IMAGE_LOAD( svi318_cart )
src/mess/machine/wswan.c
r3232r3233
12811281   rtc.minute = 0;
12821282   rtc.second = 0;
12831283   rtc.setting = 0xFF;
1284   return DEVICE_START_OK;
12841285}
12851286
12861287DEVICE_IMAGE_LOAD(wswan_cart)
src/mess/machine/x68k_hdc.c
r3232r3233
5353   sasi->status_port = 0x00;
5454   sasi->phase = SASI_PHASE_BUSFREE;
5555   hd.current_block = 0;
56   return DEVICE_START_OK;
5657}
5758
5859DEVICE_IMAGE_CREATE( sasihd )
src/mess/machine/nc.c
r3232r3233
9797   /* card ram NULL */
9898   nc_card_ram = NULL;
9999   nc_card_size = 0;
100   return DEVICE_START_OK;
100101}
101102
102103/* load pcmcia card */
src/mess/machine/nes.c
r3232r3233
565565
566566   nes_fds.sides = 0;
567567   nes_fds.data = NULL;
568   return DEVICE_START_OK;
568569}
569570
570571
src/mess/machine/990_tap.c
r3232r3233
120120   t->wp = 1;
121121   t->bot = 0;
122122   t->eot = 0;
123   return DEVICE_START_OK;
123124}
124125
125126/*DEVICE_STOP( ti990_tape )
src/mess/machine/adc080x.c
r3232r3233
165165   state_save_register_item(unique_tag, 0, adc080x->sar);
166166   state_save_register_item(unique_tag, 0, adc080x->cycle);
167167   state_save_register_item(unique_tag, 0, adc080x->bit);
168   return DEVICE_START_OK;
168169}
169170
170171static DEVICE_SET_INFO( adc080x )
src/mess/machine/cbmserb.c
r3232r3233
111111   int id = image_index_in_device(device);
112112   if (id == 0)
113113      cbm_drive_open();   /* boy these C64 drivers are butt ugly */
114   return DEVICE_START_OK;
114115}
115116
116117static DEVICE_STOP( cbm_drive )
src/mess/machine/ay31015.c
r3232r3233
158158//   const ay31015_config *config = get_config(device);
159159
160160   ay = get_token(device);
161   return DEVICE_START_OK;
161162}
162163#endif
163164
src/mess/machine/vc20.c
r3232r3233
657657   vc20_rom_4000 = NULL;
658658   vc20_rom_6000 = NULL;
659659   vc20_rom_a000 = NULL;
660   return DEVICE_START_OK;
660661}
661662
662663DEVICE_IMAGE_LOAD(vic20_cart)
src/mess/machine/e0516.c
r3232r3233
216216   state_save_register_item(unique_tag, 0, e0516->dio);
217217
218218   state_save_register_item_array(unique_tag, 0, e0516->reg);
219   return DEVICE_START_OK;
219220}
220221
221222static DEVICE_SET_INFO( e0516 )
src/mess/machine/intv.c
r3232r3233
388388   /* assume keyboard is absent */
389389   memory[0x7000<<1] = 0xff;
390390   memory[(0x7000<<1)+1] = 0xff;
391   return DEVICE_START_OK;
391392}
392393
393394DEVICE_IMAGE_LOAD( intv_cart )
src/mess/machine/ins8250.c
r3232r3233
547547static DEVICE_START( ins8250 )
548548{
549549   common_start( device, TYPE_INS8250 );
550   return DEVICE_START_OK;
550551}
551552
552553
553554static DEVICE_START( ins8250a )
554555{
555556   common_start( device, TYPE_INS8250A );
557   return DEVICE_START_OK;
556558}
557559
558560
559561static DEVICE_START( ns16450 )
560562{
561563   common_start( device, TYPE_NS16450 );
564   return DEVICE_START_OK;
562565}
563566
564567
565568static DEVICE_START( ns16550 )
566569{
567570   common_start( device, TYPE_NS16550 );
571   return DEVICE_START_OK;
568572}
569573
570574
571575static DEVICE_START( ns16550a )
572576{
573577   common_start( device, TYPE_NS16550A );
578   return DEVICE_START_OK;
574579}
575580
576581
577582static DEVICE_START( pc16550d )
578583{
579584   common_start( device, TYPE_PC16550D );
585   return DEVICE_START_OK;
580586}
581587
582588
src/mess/machine/zx8302.c
r3232r3233
637637   
638638   state_save_register_item(unique_tag, 0, zx8302->mdv_motor);
639639   state_save_register_item_array(unique_tag, 0, zx8302->mdv_offset);
640   return DEVICE_START_OK;
640641}
641642
642643static DEVICE_RESET( zx8302 )
src/mess/machine/c64.c
r3232r3233
13541354      cbm_c64_game = -1;
13551355      cbm_c64_exrom = -1;
13561356   }
1357   return DEVICE_START_OK;
13571358}
13581359
13591360/* Hardware Types for C64 carts */
src/mess/machine/hd63450.c
r3232r3233
2727      dmac->reg[x].niv = 0x0f;  // defaults?
2828      dmac->reg[x].eiv = 0x0f;
2929   }
30   return DEVICE_START_OK;
3031}
3132
3233int hd63450_read(const device_config* device, int offset, UINT16 mem_mask)
src/mess/machine/ti99_4x.c
r3232r3233
472472{
473473   int id = image_index_in_device(device);
474474   cartridge_pages[id] = (UINT16 *) (memory_region(device->machine, "main") + offset_cart + (id * 0x2000));
475   return DEVICE_START_OK;
475476}
476477
477478/*
src/mess/mess.mak
r3232r3233
391391   $(MESSOBJ)/jupiter.a \
392392   $(MESSOBJ)/kaypro.a \
393393   $(MESSOBJ)/kim1.a \
394   $(MESSOBJ)/pk8020.a \
395394   $(MESSOBJ)/luxor.a \
396395   $(MESSOBJ)/lviv.a \
397396   $(MESSOBJ)/lynx.a \
r3232r3233
418417   $(MESSOBJ)/pcshare.a \
419418   $(MESSOBJ)/pdp1.a \
420419   $(MESSOBJ)/pel.a \
420   $(MESSOBJ)/pk8020.a \
421421   $(MESSOBJ)/pmd85.a \
422   $(MESSOBJ)/pp01.a \
422423   $(MESSOBJ)/primo.a \
423   $(MESSOBJ)/pp01.a \
424424   $(MESSOBJ)/radio.a \
425425   $(MESSOBJ)/rca.a \
426426   $(MESSOBJ)/rockwell.a \
src/mess/devices/harddriv.c
r3232r3233
274274   harddisk->config = device->static_config;
275275   harddisk->chd = NULL;
276276   harddisk->hard_disk_handle = NULL;
277   return DEVICE_START_OK;
277278}
278279
279280
r3232r3233
334335   /* ide_controller_init_custom(which_bus, intf, NULL); */
335336#endif
336337
337   DEVICE_START_CALL(mess_hd);
338   return DEVICE_START_CALL(mess_hd);
338339}
339340
340341
src/mess/devices/cassette.c
r3232r3233
238238   cassette->config = device->static_config;
239239   cassette->cassette = NULL;
240240   cassette->state = cassette->config->default_state;
241   return DEVICE_START_OK;
241242}
242243
243244
src/mess/devices/microdrv.c
r3232r3233
1111
1212static DEVICE_START(microdrv)
1313{
14   return DEVICE_START_OK;
1415}
1516
1617DEVICE_GET_INFO(microdrv)
src/mess/devices/xmodem.c
r3232r3233
300300   state->conf = (xmodem_config*) device->static_config;
301301   state->machine = device->machine;
302302   state->timer = timer_alloc( xmodem_nak_cb, state );
303   return DEVICE_START_OK;
303304}
304305
305306static DEVICE_RESET( xmodem )
src/mess/devices/kermit.c
r3232r3233
636636   state->machine = device->machine;
637637   state->resend = timer_alloc( kermit_resend_cb, state );
638638   kermit_reset( state );
639   return DEVICE_START_OK;
639640}
640641
641642static DEVICE_RESET( kermit )
src/mess/devices/cartslot.c
r3232r3233
116116
117117static int process_cartridge(const device_config *image, const device_config *file)
118118{
119   const rom_source *source;
119120   const rom_entry *romrgn, *roment;
120121   int position = 0, result;
121122
122   romrgn = rom_first_region(image->machine->gamedrv);
123   while(romrgn)
123   for (source = rom_first_source(image->machine->gamedrv, image->machine->config); source != NULL; source = rom_next_source(image->machine->gamedrv, image->machine->config, source))
124124   {
125      roment = romrgn + 1;
126      while(!ROMENTRY_ISREGIONEND(roment))
125      for (romrgn = rom_first_region(image->machine->gamedrv, source); romrgn != NULL; romrgn = rom_next_region(romrgn))
127126      {
128         if (is_cart_roment(roment))
127         roment = romrgn + 1;
128         while(!ROMENTRY_ISREGIONEND(roment))
129129         {
130            parse_rom_name(roment, &position, NULL);
131            if (position == image_index_in_device(image))
130            if (is_cart_roment(roment))
132131            {
133               result = load_cartridge(image->machine, romrgn, roment, file);
134               if (!result)
135                  return result;
132               parse_rom_name(roment, &position, NULL);
133               if (position == image_index_in_device(image))
134               {
135                  result = load_cartridge(image->machine, romrgn, roment, file);
136                  if (!result)
137                     return result;
138               }
136139            }
140            roment++;
137141         }
138         roment++;
139142      }
140      romrgn = rom_next_region(romrgn);
141143   }
142144   return INIT_PASS;
143145}
r3232r3233
147149static DEVICE_START( cartslot_specified )
148150{
149151   process_cartridge(device, NULL);
152   return DEVICE_START_OK;
150153}
151154
152155static DEVICE_IMAGE_LOAD( cartslot_specified )
r3232r3233
163166
164167void cartslot_device_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
165168{
169   const game_driver *gamedrv = devclass->gamedrv;
170   machine_config *config = machine_config_alloc(gamedrv->machine_config);
171   const rom_source *source;
166172   const rom_entry *romrgn, *roment;
167173   int position, count = 0, must_be_loaded = 0;
168174   const char *file_extensions = "bin";
169175   UINT32 flags;
170176
171177   /* try to find ROM_CART_LOADs in the ROM declaration */
172   romrgn = rom_first_region(devclass->gamedrv);
173   while(romrgn != NULL)
178   for (source = rom_first_source(gamedrv, config); source != NULL; source = rom_next_source(gamedrv, config, source))
174179   {
175      roment = romrgn + 1;
176      while(!ROMENTRY_ISREGIONEND(roment))
180      for (romrgn = rom_first_region(gamedrv, source); romrgn != NULL; romrgn = rom_next_region(romrgn))
177181      {
178         if (is_cart_roment(roment) && !parse_rom_name(roment, &position, &file_extensions))
182         roment = romrgn + 1;
183         while(!ROMENTRY_ISREGIONEND(roment))
179184         {
180            flags = ROM_GETFLAGS(roment);
185            if (is_cart_roment(roment) && !parse_rom_name(roment, &position, &file_extensions))
186            {
187               flags = ROM_GETFLAGS(roment);
181188
182            /* reject any unsupported flags */
183            if (flags & (ROM_GROUPMASK | ROM_SKIPMASK | ROM_REVERSEMASK
184               | ROM_BITWIDTHMASK | ROM_BITSHIFTMASK
185               | ROM_INHERITFLAGSMASK))
186            {
187               fatalerror("Unsupported ROM cart flags 0x%08X", flags);
189               /* reject any unsupported flags */
190               if (flags & (ROM_GROUPMASK | ROM_SKIPMASK | ROM_REVERSEMASK
191                  | ROM_BITWIDTHMASK | ROM_BITSHIFTMASK
192                  | ROM_INHERITFLAGSMASK))
193               {
194                  fatalerror("Unsupported ROM cart flags 0x%08X", flags);
195               }
196
197               count = MAX(position + 1, count);
198               must_be_loaded = (flags & ROM_OPTIONAL) ? 0 : 1;
188199            }
189
190            count = MAX(position + 1, count);
191            must_be_loaded = (flags & ROM_OPTIONAL) ? 0 : 1;
200            roment++;
192201         }
193         roment++;
194202      }
195      romrgn = rom_next_region(romrgn);
196203   }
197204
198205   switch(state)
r3232r3233
219226         strcpy(info->s, file_extensions);
220227         break;
221228   }
229   machine_config_free(config);
222230}
src/mess/devices/chd_cd.c
r3232r3233
138138   dev_cdrom_t   *cdrom = get_safe_token( device );
139139
140140   cdrom->cdrom_handle = NULL;
141   return DEVICE_START_OK;
141142}
142143
143144
src/mess/devices/mflopimg.c
r3232r3233
261261{
262262    image_alloctag(device, FLOPPY_TAG, sizeof(mess_flopimg));
263263   floppy_drive_init(device, &mess_floppy_interface);
264   return DEVICE_START_OK;
264265}
265266
266267
src/mess/devices/dsk.c
r3232r3233
7474static DEVICE_START( dsk_floppy )
7575{
7676   floppy_drive_init(device, NULL);
77   return DEVICE_START_OK;
7778}
7879
7980
src/mess/devices/appldriv.c
r3232r3233
284284
285285   parent_init = (device_start_func) mess_device_get_info_fct(&parent_devclass, MESS_DEVINFO_PTR_START);
286286   parent_init(device);
287   return DEVICE_START_OK;
287288}
288289
289290
src/mess/devices/basicdsk.c
r3232r3233
8787DEVICE_START( basicdsk_floppy )
8888{
8989   floppy_drive_init(device, &basicdsk_floppy_interface);
90   return DEVICE_START_OK;
9091}
9192
9293/* attempt to insert a disk into the drive specified with id */
src/mess/devices/printer.c
r3232r3233
4848
4949static DEVICE_START(printer)
5050{
51   return DEVICE_START_OK;
5152}
5253
5354
src/mess/devices/coco_vhd.c
r3232r3233
9696{
9797   vhd_info *vhd = get_safe_token(device);
9898   vhd->status = VHDSTATUS_NO_VHD_ATTACHED;
99   return DEVICE_START_OK;
99100}
100101
101102
src/mess/devices/bitbngr.c
r3232r3233
9393   bi->value = config->initial_value;
9494   bi->timeout_timer = timer_alloc(bitbanger_overthreshhold, (void *) device);
9595   bi->over_threshhold = 1;
96   return DEVICE_START_OK;
9697}
9798
9899
src/mess/devices/snapquik.c
r3232r3233
105105
106106   /* locate the load function */
107107   token->load = (snapquick_load_func) device_get_info_fct(device, DEVINFO_FCT_SNAPSHOT_QUICKLOAD_LOAD);
108   return DEVICE_START_OK;
108109}
109110
110111
src/mess/inputx.c
r3232r3233
1313#include "inptport.h"
1414#include "mame.h"
1515
16#include "deprecat.h"
1716#include "debug/debugcon.h"
1817
1918
r3232r3233
634633
635634
636635/*  Debugging commands and handlers. */
637static void execute_input(int ref, int params, const char *param[]);
638static void execute_dumpkbd(int ref, int params, const char *param[]);
636static void execute_input(running_machine *machine, int ref, int params, const char *param[]);
637static void execute_dumpkbd(running_machine *machine, int ref, int params, const char *param[]);
639638
640639
641640
r3232r3233
669668
670669   if (machine->debug_flags & DEBUG_FLAG_ENABLED)
671670   {
672      debug_console_register_command("input", CMDFLAG_NONE, 0, 1, 1, execute_input);
673      debug_console_register_command("dumpkbd", CMDFLAG_NONE, 0, 0, 1, execute_dumpkbd);
671      debug_console_register_command(machine, "input", CMDFLAG_NONE, 0, 1, 1, execute_input);
672      debug_console_register_command(machine, "dumpkbd", CMDFLAG_NONE, 0, 0, 1, execute_dumpkbd);
674673   }
675674
676675   /* posting keys directly only makes sense for a computer */
r3232r3233
15111510   natural keyboard input
15121511-------------------------------------------------*/
15131512
1514static void execute_input(int ref, int params, const char *param[])
1513static void execute_input(running_machine *machine, int ref, int params, const char *param[])
15151514{
1516   inputx_post_coded(Machine, param[0]);
1515   inputx_post_coded(machine, param[0]);
15171516}
15181517
15191518
r3232r3233
15231522   keyboard codes
15241523-------------------------------------------------*/
15251524
1526static void execute_dumpkbd(int ref, int params, const char *param[])
1525static void execute_dumpkbd(running_machine *machine, int ref, int params, const char *param[])
15271526{
15281527   const char *filename;
15291528   FILE *file = NULL;
src/mess/filemngr.c
r3232r3233
238238      menu_confirm_save_as_populate(machine, menu, state);
239239
240240   /* process the menu */
241   event = ui_menu_process(menu, 0);
241   event = ui_menu_process(machine, menu, 0);
242242
243243   /* process the event */
244244   if ((event != NULL) && (event->iptkey == IPT_UI_SELECT))
r3232r3233
445445   else
446446   {
447447      /* process the menu */
448      event = ui_menu_process(menu, 0);
448      event = ui_menu_process(machine, menu, 0);
449449   }
450450
451451   /* process the event */
r3232r3233
787787   }
788788
789789   /* process the menu */
790   event = ui_menu_process(menu, 0);
790   event = ui_menu_process(machine, menu, 0);
791791   if (event != NULL && event->itemref != NULL)
792792   {
793793      /* handle selections */
r3232r3233
961961   menustate->selected_device = (const device_config *) ui_menu_get_selection(menu);
962962
963963   /* process the menu */
964   event = ui_menu_process(menu, 0);
964   event = ui_menu_process(machine, menu, 0);
965965   if (event != NULL && event->iptkey == IPT_UI_SELECT)
966966   {
967967      menustate->selected_device = (const device_config *) event->itemref;
src/mess/formats/thom_dsk.c
r3232r3233
787787   thom_qdd_compute_map();
788788   thom_floppy_reset( thom_floppy_drive_of_image( device  ) );
789789   floppy_drive_init( device, &thom_floppy_interface );
790   return DEVICE_START_OK;
790791}
791792
792793
src/mess/drivers/glasgow.c
r3232r3233
619619            {
620620
621621            cursor_field = get_field(my_cursor->rawbounds.x0,my_cursor->rawbounds.y0, MOUSE_MOVE);
622            if ( strcmp((char *)cursor_field.piece, "0") && (strcmp((char *)cursor_field.piece, EMP))  && strcmp(my_cursor->name, (char *)cursor_field.piece ) )
622            if ( strcmp((char *)cursor_field.piece, "0") && (strcmp((char *)cursor_field.piece, EMP))  && strcmp(my_cursor->output_name, (char *)cursor_field.piece ) )
623623               {
624624               update_board(my_target,cursor_field, 0);
625625
r3232r3233
639639            save_y = my_cursor->rawbounds.y0;
640640
641641            cursor_field = get_field(my_cursor->rawbounds.x0,my_cursor->rawbounds.y0, MOUSE_MOVE);
642            if ( strcmp((char *)cursor_field.piece, "0") && strcmp(my_cursor->name, "CURSOR_1") )
642            if ( strcmp((char *)cursor_field.piece, "0") && strcmp(my_cursor->output_name, "CURSOR_1") )
643643               {
644644
645645// Put piece back to board
646646//
647                 strcpy((char *)cursor_field.piece, (char *)my_cursor->name);
647                 strcpy((char *)cursor_field.piece, (char *)my_cursor->output_name);
648648               update_board(my_target,cursor_field, 1);
649649               my_cursor->color.a = 1;
650650
r3232r3233
704704
705705// change cursor to piece
706706//
707        piece = get_non_set_pieces(my_cursor->name);
707        piece = get_non_set_pieces(my_cursor->output_name);
708708
709709      if (strcmp(piece,NO_PIECE))
710710         {
r3232r3233
10281028
10291029 for (; cur_view != NULL; cur_view = cur_view->next)
10301030 {
1031   if (!strcmp(cur_view->name, v_name))
1031   if (!strcmp(cur_view->output_name, v_name))
10321032      {
10331033      return (cur_view);
10341034      }
src/mess/drivers/advision.c
r3232r3233
2525/* Memory Maps */
2626 
2727static ADDRESS_MAP_START( program_map, ADDRESS_SPACE_PROGRAM, 8 )
28   AM_RANGE(0x0000, 0x03ff) AM_ROMBANK(MCS48_INTERNAL_ROMBANK)
28   AM_RANGE(0x0000, 0x03ff) AM_ROMBANK(1)
2929   AM_RANGE(0x0400, 0x0fff) AM_ROM
3030ADDRESS_MAP_END
3131
src/mess/drivers/apexc.c
r3232r3233
171171
172172static DEVICE_START( apexc_tape )
173173{
174   return DEVICE_START_OK;
174175}
175176
176177
src/mess/drivers/a2600.c
r3232r3233
542542static DEVICE_START( a2600_cart )
543543{
544544   banking_mode = 0xFF;
545   return DEVICE_START_OK;
545546}
546547
547548
src/mess/drivers/gamepock.c
r3232r3233
6464
6565static DEVICE_START(gamepock_cart) {
6666   memory_set_bankptr( 1, memory_region(device->machine,  "user1" ) );
67   return DEVICE_START_OK;
6768}
6869
6970static DEVICE_IMAGE_LOAD(gamepock_cart) {
src/ldplayer/ldplayer.mak
r3232r3233
1313LDPSRC = $(SRC)/ldplayer
1414LDPOBJ = $(OBJ)/ldplayer
1515
16LAYOUT = $(LDPOBJ)/layout
17
1618OBJDIRS += \
1719   $(LDPOBJ) \
20   $(LAYOUT) \
1821
1922
2023
r3232r3233
4245DRVLIBS = \
4346   $(LDPOBJ)/ldpdriv.o \
4447   $(LDPOBJ)/ldplayer.o \
48
49
50#-------------------------------------------------
51# layout dependencies
52#-------------------------------------------------
53
54$(LDPOBJ)/ldplayer.o:   $(LAYOUT)/pr8210.lh \
src/ldplayer/layout/pr8210.lay
r0r3233
1<?xml version="1.0"?>
2<mamelayout version="2">
3   <element name="audio1" defstate="0">
4      <text string="AUDIO1" state="0">
5         <color red="0.1" green="0.1" blue="0.1" />
6         <bounds x="0" y="0.1" width="1" height="0.8" />
7      </text>
8      <text string="AUDIO1" state="1">
9         <color red="1.0" green="1.0" blue="1.0" />
10         <bounds x="0" y="0.1" width="1" height="0.8" />
11      </text>
12   </element>
13
14   <element name="audio2" defstate="0">
15      <text string="AUDIO2" state="0">
16         <color red="0.1" green="0.1" blue="0.1" />
17         <bounds x="0" y="0.1" width="1" height="0.8" />
18      </text>
19      <text string="AUDIO2" state="1">
20         <color red="1.0" green="1.0" blue="1.0" />
21         <bounds x="0" y="0.1" width="1" height="0.8" />
22      </text>
23   </element>
24
25   <element name="clv" defstate="0">
26      <text string="CLV" state="0">
27         <color red="0.1" green="0.1" blue="0.1" />
28         <bounds x="0" y="0.1" width="1" height="0.8" />
29      </text>
30      <text string="CLV" state="1">
31         <color red="1.0" green="1.0" blue="1.0" />
32         <bounds x="0" y="0.1" width="1" height="0.8" />
33      </text>
34   </element>
35
36   <element name="cav" defstate="0">
37      <text string="CAV" state="0">
38         <color red="0.1" green="0.1" blue="0.1" />
39         <bounds x="0" y="0.1" width="1" height="0.8" />
40      </text>
41      <text string="CAV" state="1">
42         <color red="1.0" green="1.0" blue="1.0" />
43         <bounds x="0" y="0.1" width="1" height="0.8" />
44      </text>
45   </element>
46
47   <element name="led1" defstate="0">
48      <text string="LED1" state="0">
49         <color red="0.1" green="0.1" blue="0.1" />
50         <bounds x="0" y="0.1" width="1" height="0.8" />
51      </text>
52      <text string="LED1" state="1">
53         <color red="1.0" green="1.0" blue="1.0" />
54         <bounds x="0" y="0.1" width="1" height="0.8" />
55      </text>
56   </element>
57
58   <element name="led2" defstate="0">
59      <text string="LED2" state="0">
60         <color red="0.1" green="0.1" blue="0.1" />
61         <bounds x="0" y="0.1" width="1" height="0.8" />
62      </text>
63      <text string="LED2" state="1">
64         <color red="1.0" green="1.0" blue="1.0" />
65         <bounds x="0" y="0.1" width="1" height="0.8" />
66      </text>
67   </element>
68
69   <element name="led3" defstate="0">
70      <text string="LED3" state="0">
71         <color red="0.1" green="0.1" blue="0.1" />
72         <bounds x="0" y="0.1" width="1" height="0.8" />
73      </text>
74      <text string="LED3" state="1">
75         <color red="1.0" green="1.0" blue="1.0" />
76         <bounds x="0" y="0.1" width="1" height="0.8" />
77      </text>
78   </element>
79
80   <element name="standby" defstate="0">
81      <text string="STANDBY" state="0">
82         <color red="0.1" green="0.1" blue="0.1" />
83         <bounds x="0" y="0.1" width="1" height="0.8" />
84      </text>
85      <text string="STANDBY" state="1">
86         <color red="1.0" green="1.0" blue="1.0" />
87         <bounds x="0" y="0.1" width="1" height="0.8" />
88      </text>
89   </element>
90
91
92   <view name="Lamps">
93      <screen index="0">
94         <bounds left="0" top="0" right="4" bottom="3" />
95      </screen>
96      <bezel name="pr8210_standby" element="standby">
97         <bounds x="0" y="3.1" width="0.4" height="0.1" />
98      </bezel>
99      <bezel name="pr8210_clv" element="clv">
100         <bounds x="0.5" y="3.1" width="0.4" height="0.1" />
101      </bezel>
102      <bezel name="pr8210_cav" element="cav">
103         <bounds x="1.0" y="3.1" width="0.4" height="0.1" />
104      </bezel>
105      <bezel name="pr8210_audio1" element="audio1">
106         <bounds x="1.5" y="3.1" width="0.4" height="0.1" />
107      </bezel>
108      <bezel name="pr8210_audio2" element="audio2">
109         <bounds x="2.0" y="3.1" width="0.4" height="0.1" />
110      </bezel>
111      <bezel name="pr8210_led1" element="led1">
112         <bounds x="2.5" y="3.1" width="0.4" height="0.1" />
113      </bezel>
114      <bezel name="pr8210_led2" element="led2">
115         <bounds x="3.0" y="3.1" width="0.4" height="0.1" />
116      </bezel>
117      <bezel name="pr8210_led3" element="led3">
118         <bounds x="3.5" y="3.1" width="0.4" height="0.1" />
119      </bezel>
120   </view>
121</mamelayout>
src/ldplayer/ldplayer.c
r3232r3233
1515#include "machine/laserdsc.h"
1616#include <ctype.h>
1717
18#include "pr8210.lh"
1819
19#define TEST_PR8210_ROM      0
2020
2121
22
2322/*************************************
2423 *
2524 *  Constants
r3232r3233
6362static UINT8 playing;
6463static UINT8 displaying;
6564
66static UINT8 pr8210_last_was_number;
6765static emu_timer *pr8210_bit_timer;
6866static UINT32 pr8210_command_buffer_in, pr8210_command_buffer_out;
6967static UINT8 pr8210_command_buffer[10];
7068
7169static void (*execute_command)(const device_config *laserdisc, int command);
7270
73#if TEST_PR8210_ROM
7471
75static UINT8 pia[0x100];
76static UINT8 pr8210_porta;
77static UINT8 pr8210_portb;
78static UINT8 pr8210_pia_porta;
79static UINT8 pr8210_pia_portb;
8072
81#endif
82
83
84
8573/*************************************
8674 *
8775 *  Timers and sync
r3232r3233
152140
153141   /* handle commands */
154142   if (!param)
155   {
156143      process_commands(laserdisc);
157144
158      /* update the laserdisc */
159      laserdisc_vsync(laserdisc);
160   }
161
162145   /* set a timer to go off on the next VBLANK */
163146   vblank_scanline = video_screen_get_visible_area(machine->primary_screen)->max_y + 1;
164147   target = video_screen_get_time_until_pos(machine->primary_screen, vblank_scanline, 0);
r3232r3233
241224   else if (bitsleft == 0 && pr8210_command_buffer_in != pr8210_command_buffer_out)
242225   {
243226      data = pr8210_command_buffer[pr8210_command_buffer_out++ % ARRAY_LENGTH(pr8210_command_buffer)];
244#if TEST_PR8210_ROM
245      pr8210_pia_porta = BITSWAP8(data, 0,1,2,3,4,5,6,7);
246#else
247227      bitsleft = 12;
248#endif
249228   }
250229   timer_adjust_oneshot(pr8210_bit_timer, duration, (bitsleft << 16) | data);
251230}
r3232r3233
269248static void pr8210_execute(const device_config *laserdisc, int command)
270249{
271250   static const UINT8 digits[10] = { 0x01, 0x11, 0x09, 0x19, 0x05, 0x15, 0x0d, 0x1d, 0x03, 0x13 };
272   int prev_was_number = pr8210_last_was_number;
273251
274   pr8210_last_was_number = FALSE;
275252   switch (command)
276253   {
277254      case CMD_SCAN_REVERSE:
r3232r3233
311288         break;
312289
313290      case CMD_DISPLAY_ON:
314//          pr8210_add_command(digits[1]);
315//          pr8210_add_command(0xf1);
316         break;
317
318291      case CMD_DISPLAY_OFF:
319//          pr8210_add_command(digits[0]);
320//          pr8210_add_command(0xf1);
292         pr8210_add_command(0x0b);
321293         break;
322294
323295      case CMD_0:
r3232r3233
330302      case CMD_7:
331303      case CMD_8:
332304      case CMD_9:
333         if (!prev_was_number)
334            pr8210_add_command(0x1a);
335305         pr8210_add_command(digits[command - CMD_0]);
336         pr8210_last_was_number = TRUE;
337306         break;
338307
339308      case CMD_SEARCH:
r3232r3233
449418
450419/*************************************
451420 *
452 *  Test PR-8210 ROM emulation
453 *
454 *************************************/
455
456#if TEST_PR8210_ROM
457
458static READ8_HANDLER( pr8210_pia_r )
459{
460   UINT8 result = pia[offset];
461   switch (offset)
462   {
463      case 0xa0:
464//          printf("%03X:pia_r(%02X) = %02X\n", activecpu_get_pc(), offset, pr8210_pia_porta);
465         result = pr8210_pia_porta;
466         pr8210_pia_porta = 0;
467         break;
468
469      default:
470         printf("%03X:pia_r(%02X)\n", activecpu_get_pc(), offset);
471         break;
472   }
473   return result;
474}
475
476static WRITE8_HANDLER( pr8210_pia_w )
477{
478   /*
479       $22-26 (R) = read and copied to memory $23-27
480       $23 (R) = something compared against $F4
481       $22-26 (W) = SRCH. text
482       $27-2B (W) = FRAME/CHAP. text
483       $2C-30 (W) = frame or chapter number
484       $40 (W) = $CF at initialization, tracked by ($78)
485       $60 (W) = port B output, tracked by ($77)
486           $80 = n/c
487           $40 = (out) LED3
488           $20 = (out) LED2
489           $10 = (out) LED1
490                    123 -> LHL = Play
491                        -> HLL = Slow fwd
492                        -> LLL = Slow rev
493                        -> HHL = Still
494                        -> LLH = Pause
495                        -> HHH = all off
496           $08 = (out) CAV LED
497           $04 = (out) CLV LED
498           $02 = (out) A2 LED/AUDIO 2
499           $01 = (out) A1 LED/AUDIO 1
500       $80 (W) = 0 or 1
501       $A0 (R) = port A input
502       $C0 (R) = stored to ($2E)
503       $E0 (R) = stored to ($2F)
504    */
505   if (pia[offset] != data)
506   {
507      switch (offset)
508      {
509         case 0x60:
510            printf("%03X:pia_w(%02X) = %02X (PORT B LEDS:", activecpu_get_pc(), offset, data);
511            if (!(data & 0x01)) printf(" AUDIO1");
512            if (!(data & 0x02)) printf(" AUDIO2");
513            if (!(data & 0x04)) printf(" CLV");
514            if (!(data & 0x08)) printf(" CAV");
515            printf(" LED123=%c%c%c", (data & 0x10) ? 'H' : 'L', (data & 0x20) ? 'H' : 'L', (data & 0x40) ? 'H' : 'L');
516            if (!(data & 0x80)) printf(" ???");
517            printf(")\n");
518            pr8210_pia_portb = data;
519            break;
520
521         default:
522            printf("%03X:pia_w(%02X) = %02X\n", activecpu_get_pc(), offset, data);
523            break;
524      }
525      pia[offset] = data;
526   }
527}
528
529static READ8_HANDLER( pr8210_bus_r )
530{
531   /*
532       $80 = n/c
533       $40 = (in) slide pot interrupt source (slider position limit detector, inside and outside)
534       $20 = n/c
535       $10 = (in) /FOCUS LOCK
536       $08 = (in) /SPDL LOCK
537       $04 = (in) SIZE 8/12
538       $02 = (in) FG via op-amp (spindle motor stop detector)
539       $01 = (in) SLOW TIMER OUT
540    */
541   offs_t pc = activecpu_get_pc();
542   if (pc != 0x11c)
543      printf("%03X:bus_r\n", pc);
544
545   /* loop at beginning waits for $40=0, $02=1 */
546   return 0xff & ~0x40 & ~0x04;
547}
548
549static WRITE8_HANDLER( pr8210_porta_w )
550{
551   /*
552       $80 = (out) SCAN C (F/R)
553       $40 = (out) AUDIO SQ
554       $20 = (out) VIDEO SQ
555       $10 = (out) /SPDL ON
556       $08 = (out) /FOCUS ON
557       $04 = (out) SCAN B (L/H)
558       $02 = (out) SCAN A (/SCAN)
559       $01 = (out) JUMP TRG (jump back trigger, clock on high->low)
560    */
561   if (data != pr8210_porta)
562   {
563      printf("%03X:porta_w = %02X", activecpu_get_pc(), data);
564      if (!(data & 0x01)) printf(" JUMPTRG");
565      if (!(data & 0x02))
566      {
567         printf(" SCAN:%c:%c", (data & 0x80) ? 'F' : 'R', (data & 0x04) ? 'L' : 'H');
568      }
569      if (!(data & 0x08)) printf(" /FOCUSON");
570      if (!(data & 0x10)) printf(" /SPDLON");
571      if (data & 0x20) printf(" VIDEOSQ");
572      if (data & 0x40) printf(" AUDIOSQ");
573      printf("\n");
574      pr8210_porta = data;
575   }
576}
577
578static WRITE8_HANDLER( pr8210_portb_w )
579{
580   /*
581       $80 = (out) /CS on PIA
582       $40 = (out) 0 to self-generate IRQ
583       $20 = (out) SLOW TRG
584       $10 = (out) STANDBY LED
585       $08 = (out) TP2
586       $04 = (out) TP1
587       $02 = (out) ???
588       $01 = (out) LASER ON
589    */
590   cputag_set_input_line(machine, "pr8210", 0, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
591   if ((data & 0x7f) != (pr8210_portb & 0x7f))
592   {
593      printf("%03X:portb_w = %02X", activecpu_get_pc(), data);
594      if (!(data & 0x01)) printf(" LASERON");
595      if (!(data & 0x02)) printf(" ???");
596      if (!(data & 0x04)) printf(" TP1");
597      if (!(data & 0x08)) printf(" TP2");
598      if (!(data & 0x10)) printf(" STANDBYLED");
599      if (!(data & 0x20)) printf(" SLOWTRG");
600      if (!(data & 0x40)) printf(" IRQGEN");
601//      if (data & 0x80) printf(" PIASEL");
602      printf("\n");
603      pr8210_portb = data;
604   }
605}
606
607
608static ADDRESS_MAP_START( pr8210_portmap, ADDRESS_SPACE_IO, 8 )
609   AM_RANGE(0x00, 0xff) AM_READWRITE(pr8210_pia_r, pr8210_pia_w)
610   AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ(pr8210_bus_r)
611   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(pr8210_porta_w)
612   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(pr8210_portb_w)
613ADDRESS_MAP_END
614
615#endif
616
617
618
619/*************************************
620 *
621421 *  Machine drivers
622422 *
623423 *************************************/
r3232r3233
630430   /* audio hardware */
631431   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
632432
633   MDRV_SOUND_ADD("laserdisc", CUSTOM, 0)
433   MDRV_SOUND_ADD("ldsound", CUSTOM, 0)
634434   MDRV_SOUND_CONFIG(laserdisc_custom_interface)
635435   MDRV_SOUND_ROUTE(0, "left", 1.0)
636436   MDRV_SOUND_ROUTE(1, "right", 1.0)
r3232r3233
645445
646446static MACHINE_DRIVER_START( ldv1000 )
647447   MDRV_IMPORT_FROM(ldplayer_ntsc)
648   MDRV_LASERDISC_ADD("laserdisc", PIONEER_LDV1000)
448   MDRV_LASERDISC_ADD("laserdisc", PIONEER_LDV1000, "main", "ldsound")
649449MACHINE_DRIVER_END
650450
651451
r3232r3233
653453   MDRV_IMPORT_FROM(ldplayer_ntsc)
654454   MDRV_MACHINE_START(pr8210)
655455   MDRV_MACHINE_RESET(pr8210)
656   MDRV_LASERDISC_ADD("laserdisc", PIONEER_PR8210)
657
658#if TEST_PR8210_ROM
659   MDRV_CPU_ADD("pr8210", I8049, XTAL_4_41MHz)
660   MDRV_CPU_IO_MAP(pr8210_portmap,0)
661#endif
456   MDRV_LASERDISC_ADD("laserdisc", PIONEER_PR8210, "main", "ldsound")
662457MACHINE_DRIVER_END
663458
664459
r3232r3233
676471
677472ROM_START( pr8210 )
678473   DISK_REGION( "laserdisc" )
679
680#if TEST_PR8210_ROM
681   ROM_REGION( 0x800, "pr8210", 0 )
682   ROM_LOAD( "pr-8210_mcu_ud6005a.bin", 0x000, 0x800, CRC(120fa83b) SHA1(b514326ca1f52d6d89056868f9d17eabd4e3f31d) )
683#endif
684474ROM_END
685475
686476
r3232r3233
766556 *************************************/
767557
768558GAME( 2008, ldv1000, 0, ldv1000, ldplayer, ldv1000, ROT0, "MAME", "Pioneer LDV-1000 Simulator", 0 )
769GAME( 2008, pr8210,  0, pr8210,  ldplayer, pr8210,  ROT0, "MAME", "Pioneer PR-8210 Simulator", 0 )
559GAMEL( 2008, pr8210,  0, pr8210,  ldplayer, pr8210,  ROT0, "MAME", "Pioneer PR-8210 Simulator", 0, layout_pr8210 )
docs/messnew.txt
r3232r3233
140140
141141Source Changes:
142142----------------
143- The core is based on MAME 0.127u2.  This incorporates all features of the
143- The core is based on MAME 0.127u3.  This incorporates all features of the
144144  update to this core.  [MAME team]
145145
146146- Refactored ZIP path code out of src/mess/image.c, made more testable.  [Nate

Previous 15994 Revisions Next


© 1998-2018 The MESS Team