Previous 15994 Revisions Next

r1356 Sunday 2nd December, 2007 at 00:32:40 UTC by Nathan Woods
Updated to MAME 0.121u2 core; some bugginess sighted
[ROOT]makefile makefile.mes
[docs]messnew.txt
[src/emu]attotime.c attotime.h audit.h cheat.c config.h cpuexec.c cpuexec.h cpuint.c driver.h eigccppc.h eigccx86.h mame.c mame.h memory.c memory.h render.h romload.h sound.c timer.c timer.h ui.c uimenu.c video.c video.h
[src/emu/audio]generic.c
[src/emu/cpu/apexc]apexc.c apexc.h
[src/emu/cpu/cp1610]cp1610.c cp1610.h
[src/emu/cpu/e132xs]e132xs.c
[src/emu/cpu/f8]f3853.c
[src/emu/cpu/h83002]h8periph.c
[src/emu/cpu/hd6309]hd6309.c
[src/emu/cpu/i8051]i8051.c i8051.h i8051ops.c
[src/emu/cpu/i8085]i8085.c
[src/emu/cpu/m37710]m37710.c
[src/emu/cpu/m6502]m6502.c
[src/emu/cpu/m6800]m6800.c m6800.h
[src/emu/cpu/m68000]m68kmame.c
[src/emu/cpu/m6805]m6805.c
[src/emu/cpu/mips]dismips.c mips3com.c
[src/emu/cpu/powerpc]ppc.c ppc403.c ppcdrc.c
[src/emu/cpu/rsp]rsp.c rsp.h
[src/emu/cpu/s2650]s2650.c
[src/emu/cpu/sc61860]sc61860.c
[src/emu/cpu/sh2]sh2.c
[src/emu/cpu/sh4]sh4.c
[src/emu/cpu/sm8500]sm8500.c sm8500.h
[src/emu/cpu/spc700]spc700.c spc700.h
[src/emu/cpu/tlcs90]tlcs90.c
[src/emu/cpu/tms34010]tms34010.c
[src/emu/cpu/tms9900]99xxcore.h
[src/emu/cpu/v810]v810.c v810.h
[src/emu/cpu/z80gb]z80gb.c z80gb.h
[src/emu/debug]debugcpu.c
[src/emu/machine]6522via.c 6526cia.c 6532riot.c 6840ptm.c 6850acia.c 74123.c 8042kbdc.c 8237dma.c am53cf96.c ds2401.c ds2404.c generic.c idectrl.c intelfsh.c mb3773.c mc146818.c pc16552d.c pic8259.c pit8253.c rtc65271.c timekpr.c tmp68301.c upd4701.c wd33c93.c x76f041.c x76f100.c z80ctc.c z80sio.c
[src/emu/sound]2203intf.c 2608intf.c 2610intf.c 2612intf.c 262intf.c 3812intf.c es5503.c ics2115.c k053260.c k053260.h k054539.c msm5205.c pokey.c scsp.c sp0250.c upd7759.c ym2151.c ymf271.c ymf278b.c ymz280b.c
[src/emu/video]crtc6845.c rgbvmx.h tms34061.c voodoo.c
[src/mame]mame.mak mamedriv.c
[src/mame/audio]8080bw.c amiga.c cage.c cchasm.c cinemat.c dcs.c dkong.c exidy.c galaxian.c geebee.c gottlieb.c harddriv.c irem.c jaguar.c leland.c m72.c mcr.c n8080.c namco54.c segag80r.c segasnd.c senjyo.c snes.c starwars.c system16.c t5182.c taito_en.c tank8.c turbo.c vicdual.c warpwarp.c williams.c
[src/mame/drivers]40love.c acefruit.c aleck64.c alg.c aquarium.c asterix.c astrocde.c astrof.c asuka.c atarisy1.c atarisy2.c atetris.c beaminv.c beathead.c berzerk.c bfcobra.c bigevglf.c bombjack.c boxer.c btoads.c buggychl.c capbowl.c cave.c cball.c ccastles.c cclimber.c centiped.c cidelsa.c clayshoo.c cliffhgr.c cloud9.c cninja.c cojag.c combatsc.c coolpool.c cps3.c crgolf.c crystal.c deco32.c deco_mlc.c destroyr.c dlair.c dragrace.c enigma2.c eprom.c ertictac.c esh.c espial.c exidy440.c exterm.c f-32.c fgoal.c firebeat.c firetrk.c flstory.c flyball.c foodf.c fromance.c fuukifg2.c fuukifg3.c gaelco3d.c galaga.c gamecstl.c gameplan.c gcpinbal.c genesis.c gijoe.c gpworld.c grchamp.c gridlee.c groundfx.c gunbustr.c halleys.c hng64.c hyperspt.c hyprduel.c itech32.c itech8.c jedi.c jpmimpct.c kinst.c konamigx.c ksys573.c ladyfrog.c lgp.c lkage.c m107.c m92.c magmax.c maxaflex.c mazerbla.c mcatadv.c mcr.c mediagx.c megadriv.c megatech.c merit.c metro.c mgolf.c micro3d.c midvunit.c midzeus.c missile.c mjsister.c model2.c moo.c mpu4.c msisaac.c mustache.c mw8080bw.c namcofl.c namconb1.c namcos11.c namcos22.c naomi.c neodrvr.c neogeo.c nitedrvr.c nycaptor.c othunder.c panicr.c parodius.c peplus.c pgm.c phoenix.c pipedrm.c pipeline.c pkscram.c policetr.c polyplay.c psikyo.c qdrmfgp.c rabbit.c rockola.c rollerg.c rpunch.c runaway.c sbasketb.c sbrkout.c scobra.c scramble.c seattle.c segae.c segahang.c segaorun.c segas16a.c segas16b.c segas18.c segas24.c* segas32.c segaxbd.c segaybd.c seta.c simpsons.c skullxbo.c skykid.c slapshot.c snk.c spacefb.c sprint4.c sprint8.c ssfindo.c sslam.c ssv.c st0016.c starfire.c stv.c supbtime.c superqix.c suprnova.c suprridr.c system1.c system16.c system18.c taito_b.c taito_f2.c taito_f3.c taito_z.c tankbust.c tceptor.c tecmosys.c tehkanwc.c tetrisp2.c thunderj.c thunderx.c tmnt.c toaplan2.c topspeed.c tourtabl.c toypop.c trackfld.c trucocl.c trvquest.c tubep.c tugboat.c turbo.c ultratnk.c undrfire.c unico.c vaportra.c vegas.c vendetta.c vicdual.c victory.c videopin.c wgp.c wheelfir.c wink.c witch.c wolfpack.c xexex.c zaccaria.c
[src/mame/includes]centiped.h eprom.h n64.h segas24.h*
[src/mame/layout]pe_bjack.lay* pe_keno.lay* pe_poker.lay* pe_schip.lay* pe_slots.lay* peplus.lay tceptor2.lay*
[src/mame/machine]amiga.c arkanoid.c asic65.c atarigen.c balsente.c bublbobl.c cubocd32.c dec0.c decocass.c equites.c galaxian.c harddriv.c irobot.c jackal.c konamiic.c leland.c lsasquad.c mcr.c mhavoc.c midwayic.c midwunit.c model1.c mw8080bw.c n64.c namco50.c namcoio.c namcos2.c nb1413m3.c nmk004.c opwolf.c pcshare.c pitnrun.c psx.c qix.c rainbow.c sbrkout.c segas24.c* slikshot.c snes.c stfight.c stvcd.c tait8741.c taitosj.c ticket.c tnzs.c vertigo.c volfied.c williams.c xevious.c
[src/mame/video]astrocde.c atari.c atarimo.c atarirle.c atarisy1.c atarisy2.c avgdvg.c blstroid.c cchasm.c centiped.c changela.c cps1.c dcheese.c dday.c dkong.c eprom.c exctsccr.c exidy.c exidy440.c fromance.c galaxian.c gticlub.c hyhoo.c itech32.c itech8.c jaguar.c kaneko16.c konamiic.c leland.c lethalj.c m92.c malzak.c midtunit.c midvunit.c midyunit.c midzeus.c n8080.c nbmj8688.c nbmj8891.c nbmj8991.c nbmj9195.c neogeo.c niyanpai.c nycaptor.c pastelg.c ppu2c0x.c qix.c rpunch.c segag80r.c segaic16.c segas24.c* segas32.c slapshot.c sprint8.c starcrus.c taito_f2.c tank8.c tceptor.c tickee.c triplhnt.c tubep.c vball.c victory.c
[src/mess]inputx.c
[src/mess/audio]dave.c mea8000.c t6721.c
[src/mess/devices]bitbngr.c flopdrv.c snapquik.c thomflop.c
[src/mess/drivers]a2600.c a310.c abc80.c abc80x.c adam.c amstrad.c atarist.c avigo.c coleco.c crvision.c einstein.c exelv.c exidy.c glasgow.c intv.c ip20.c ip22.c mephisto.c mk1.c mk2.c nc.c pcw.c pcw16.c psx.c ql.c sord.c studio2.c super80.c svision.c thomson.c tm990189.c tmc1800.c tmc2000e.c tutor.c vip.c vtech1.c x68k.c z88.c
[src/mess/machine]6551.c 68901mfp.c 99_dsk.c amigacd.c amigacrt.c amigafdc.c amigakbd.c apple1.c apple2gs.c applefdc.c at29040.c atom.c ay3600.c bbc.c cbmb.c centroni.c coco.c compis.c corvushd.c cybiko.c dai.c electron.c europc.c gamecom.c gb.c geneve.c hd63450.c hp48.c i8271.c ibmpc.c intv.c kc.c kim1.c lisa.c lviv.c lynx.c mac.c matsucd.c mc6843.c mc6846.c mc6854.c mfm.c microtan.c mm58274c.c mz700.c nec765.c nes_mmc.c oric.c osborne1.c pc1251.c pc1350.c pc1401.c pc1403.c pc8801.c pc_hdc.c pc_mouse.c pc_turbo.c pce.c pcf8593.c pdp1.c pet.c pmd85.c pokemini.c rp5c15.c rriot.c serial.c sgi.c sgi.h sms.c tc8521.c thomson.c ti85.c ti990.c ti99_4x.c tms5501.c tms9901.c tms9902.c trs80.c tx0.c upd7002.c vc1541.c vc20tape.c vectrex.c wd17xx.c wswan.c z80dart.c zx.c
[src/mess/tools/messtest]testmess.c
[src/mess/video]911_vdt.c abc80.c aim65.c atarist.c cdp1861.c cdp1864.c coco3.c gb.c m6845.c m6847.c oric.c pc_cga.c pc_vga.c smsvdp.c ted7360.c thomson.c vectrex.c vic4567.c vic6567.c x68k.c zx.c zx8301.c
[src/osd/windows]vconv.c windows.mak winprefix.h winsync.c

makefile.mes
r1355r1356
252252# form the name of the executable
253253#-------------------------------------------------
254254
255# MSVC builds append the 'vc' suffix
256ifdef MSVC_BUILD
257SUFFIX:=$(SUFFIX)vc
258endif
259
260255# unicode builds append the 'u' suffix
261256ifdef UNICODE
262257SUFFIX:=$(SUFFIX)u
r1355r1356
388383# and make all errors into warnings
389384ifneq ($(OPTIMIZE),0)
390385CFLAGS += -Werror $(ARCH) -fno-strict-aliasing
386#CFLAGS += $(ARCH) -fno-strict-aliasing
391387endif
392388
393389# if symbols are on, make sure we have frame pointers
src/mame/audio/cchasm.c
r1355r1356
182182   ctc_intf.baseclock = machine->drv->cpu[1].clock;
183183   z80ctc_init (0, &ctc_intf);
184184
185   timer_pulse(attotime_make(0, machine->screen[0].refresh), 0, cchasm_sh_update);
185   timer_pulse(attotime_make(0, machine->screen[0].refresh), NULL, 0, cchasm_sh_update);
186186}
187187
188188
src/mame/audio/warpwarp.c
r1355r1356
215215
216216   channel = stream_create(0, 1, CLOCK_16H, NULL, warpwarp_sound_update);
217217
218   sound_volume_timer = timer_alloc(sound_volume_decay);
219   music_volume_timer = timer_alloc(music_volume_decay);
218   sound_volume_timer = timer_alloc(sound_volume_decay, NULL);
219   music_volume_timer = timer_alloc(music_volume_decay, NULL);
220220    return auto_malloc(1);
221221}
src/mame/audio/snes.c
r1355r1356
11531153   channel = stream_create( 0, 2, 32000, NULL, snes_sh_update );
11541154
11551155   /* Initialize the timers */
1156   timers[0].timer = timer_alloc( snes_spc_timer );
1156   timers[0].timer = timer_alloc( snes_spc_timer , NULL);
11571157   timer_adjust( timers[0].timer, ATTOTIME_IN_HZ(8000), 0, ATTOTIME_IN_HZ(8000) );
11581158   timer_enable( timers[0].timer, 0 );
1159   timers[1].timer = timer_alloc( snes_spc_timer );
1159   timers[1].timer = timer_alloc( snes_spc_timer , NULL);
11601160   timer_adjust( timers[1].timer, ATTOTIME_IN_HZ(8000), 1, ATTOTIME_IN_HZ(8000) );
11611161   timer_enable( timers[1].timer, 0 );
1162   timers[2].timer = timer_alloc( snes_spc_timer );
1162   timers[2].timer = timer_alloc( snes_spc_timer , NULL);
11631163   timer_adjust( timers[2].timer, ATTOTIME_IN_HZ(64000), 2, ATTOTIME_IN_HZ(64000) );
11641164   timer_enable( timers[2].timer, 0 );
11651165
src/mame/audio/jaguar.c
r1355r1356
285285void cojag_sound_reset(void)
286286{
287287#if ENABLE_SPEEDUP_HACKS
288   serial_timer = timer_alloc(serial_chunky_callback);
288   serial_timer = timer_alloc(serial_chunky_callback, NULL);
289289#else
290   serial_timer = timer_alloc(serial_callback);
290   serial_timer = timer_alloc(serial_callback, NULL);
291291#endif
292292}
293293
src/mame/audio/n8080.c
r1355r1356
3030
3131
3232
33struct SN76477interface sheriff_sn76477_interface =
33static struct SN76477interface sheriff_sn76477_interface =
3434{
3535   RES_K(36)  ,  /* 04 */
3636   RES_K(100) ,  /* 05 */
r1355r1356
5858};
5959
6060
61struct SN76477interface spacefev_sn76477_interface =
61static struct SN76477interface spacefev_sn76477_interface =
6262{
6363   RES_K(36)  ,  /* 04 */
6464   RES_K(150) ,  /* 05 */
r1355r1356
342342
343343WRITE8_HANDLER( n8080_sound_1_w )
344344{
345   timer_call_after_resynch(data, delayed_sound_1_callback); /* force CPUs to sync */
345   timer_call_after_resynch(NULL, data, delayed_sound_1_callback); /* force CPUs to sync */
346346}
347347WRITE8_HANDLER( n8080_sound_2_w )
348348{
349   timer_call_after_resynch(data, delayed_sound_2_callback); /* force CPUs to sync */
349   timer_call_after_resynch(NULL, data, delayed_sound_2_callback); /* force CPUs to sync */
350350}
351351
352352
r1355r1356
470470{
471471   n8080_hardware = 1;
472472
473   timer_pulse(ATTOTIME_IN_HZ(1000), 0, spacefev_vco_voltage_timer);
473   timer_pulse(ATTOTIME_IN_HZ(1000), NULL, 0, spacefev_vco_voltage_timer);
474474
475   sound_timer[0] = timer_alloc(stop_mono_flop_callback);
476   sound_timer[1] = timer_alloc(stop_mono_flop_callback);
477   sound_timer[2] = timer_alloc(stop_mono_flop_callback);
475   sound_timer[0] = timer_alloc(stop_mono_flop_callback, NULL);
476   sound_timer[1] = timer_alloc(stop_mono_flop_callback, NULL);
477   sound_timer[2] = timer_alloc(stop_mono_flop_callback, NULL);
478478
479479   mono_flop[0] = 0;
480480   mono_flop[1] = 0;
r1355r1356
489489{
490490   n8080_hardware = 2;
491491
492   sound_timer[0] = timer_alloc(stop_mono_flop_callback);
493   sound_timer[1] = timer_alloc(stop_mono_flop_callback);
492   sound_timer[0] = timer_alloc(stop_mono_flop_callback, NULL);
493   sound_timer[1] = timer_alloc(stop_mono_flop_callback, NULL);
494494
495495   mono_flop[0] = 0;
496496   mono_flop[1] = 0;
r1355r1356
504504{
505505   n8080_hardware = 3;
506506
507   timer_pulse(ATTOTIME_IN_HZ(1000), 0, helifire_dac_volume_timer);
507   timer_pulse(ATTOTIME_IN_HZ(1000), NULL, 0, helifire_dac_volume_timer);
508508
509509   helifire_dac_volume = 1;
510510   helifire_dac_timing = 0;
src/mame/audio/amiga.c
r1355r1356
241241            /* if we're in manual mode, signal an interrupt once we latch the low byte */
242242            if (!chan->dmaenabled && chan->manualmode && (chan->curlocation & 1))
243243            {
244               signal_irq(Machine, channum);
244               signal_irq(Machine, NULL, channum);
245245               chan->manualmode = FALSE;
246246            }
247247         }
r1355r1356
271271   for (i = 0; i < 4; i++)
272272   {
273273      audio_state->channel[i].index = i;
274      audio_state->channel[i].irq_timer = timer_alloc(signal_irq);
274      audio_state->channel[i].irq_timer = timer_alloc(signal_irq, NULL);
275275   }
276276
277277   /* create the stream */
src/mame/audio/cinemat.c
r1355r1356
14261426
14271427   /* watch for a 0->1 edge on bit 4 ("shift in") to clock in the new data */
14281428   if ((bits_changed & 0x10) && (sound_val & 0x10))
1429      timer_call_after_resynch(sound_val & 0x0f, synced_sound_w);
1429      timer_call_after_resynch(NULL, sound_val & 0x0f, synced_sound_w);
14301430}
14311431
14321432
src/mame/audio/galaxian.c
r1355r1356
363363   sample_set_volume(CHANNEL_LFO+2,0);
364364   sample_start_raw(CHANNEL_LFO+2,backgroundwave,sizeof(backgroundwave)/2,1000,1);
365365
366   noisetimer = timer_alloc(noise_timer_cb);
366   noisetimer = timer_alloc(noise_timer_cb, NULL);
367367   timer_adjust(noisetimer, ATTOTIME_IN_NSEC((155000+22000)/100*693*22), 0, ATTOTIME_IN_NSEC((155000+22000)/100*693*22));
368368
369   lfotimer = timer_alloc(lfo_timer_cb);
369   lfotimer = timer_alloc(lfo_timer_cb, NULL);
370370
371   timer_pulse(attotime_make(0, Machine->screen[0].refresh), 0, galaxian_sh_update);
371   timer_pulse(attotime_make(0, Machine->screen[0].refresh), NULL, 0, galaxian_sh_update);
372372
373373   state_save_register_global(freq);
374374   state_save_register_global(noise_enable);
src/mame/audio/turbo.c
r1355r1356
107107#else
108108
109109   if (((data ^ last_sound_a) & 0x1e) && (last_sound_a & 0x1e) != 0x1e)
110      timer_set(ATTOTIME_IN_HZ(20000), data, update_sound_a);
110      timer_set(ATTOTIME_IN_HZ(20000), NULL, data, update_sound_a);
111111   else
112112      update_sound_a(data);
113113
src/mame/audio/cage.c
r1355r1356
139139 *************************************/
140140
141141static TIMER_CALLBACK( dma_timer_callback );
142static TIMER_CALLBACK( timer_callback );
142static TIMER_CALLBACK( cage_timer_callback );
143143static void update_timer(int which);
144144static WRITE32_HANDLER( speedup_w );
145145
r1355r1356
164164   cage_cpu_clock_period = ATTOTIME_IN_HZ(Machine->drv->cpu[cage_cpu].clock);
165165   cage_cpu_h1_clock_period = attotime_mul(cage_cpu_clock_period, 2);
166166
167   dma_timer = timer_alloc(dma_timer_callback);
168   timer[0] = timer_alloc(timer_callback);
169   timer[1] = timer_alloc(timer_callback);
167   dma_timer = timer_alloc(dma_timer_callback, NULL);
168   timer[0] = timer_alloc(cage_timer_callback, NULL);
169   timer[1] = timer_alloc(cage_timer_callback, NULL);
170170
171171   if (speedup)
172172      speedup_ram = memory_install_write32_handler(cage_cpu, ADDRESS_SPACE_PROGRAM, speedup, speedup, 0, 0, speedup_w);
r1355r1356
276276 *
277277 *************************************/
278278
279static TIMER_CALLBACK( timer_callback )
279static TIMER_CALLBACK( cage_timer_callback )
280280{
281281   int which = param;
282282
r1355r1356
521521{
522522   if (LOG_COMM)
523523      logerror("%06X:Command to CAGE = %04X\n", activecpu_get_pc(), data);
524   timer_call_after_resynch(data, deferred_cage_w);
524   timer_call_after_resynch(NULL, data, deferred_cage_w);
525525}
526526
527527
src/mame/audio/namco54.c
r1355r1356
119119   if (cpunum == -1)
120120      return;
121121
122   timer_call_after_resynch(data, namco_54xx_latch_callback);
122   timer_call_after_resynch(NULL, data, namco_54xx_latch_callback);
123123
124124   cpunum_set_input_line(cpunum, 0, ASSERT_LINE);
125125
r1355r1356
128128   // The input clock to the 06XX interface chip is 64H, that is
129129   // 18432000/6/64 = 48kHz, so it makes sense for the irq line to be
130130   // asserted for one clock cycle ~= 21us.
131   timer_set(ATTOTIME_IN_USEC(21), cpunum, namco_54xx_irq_clear);
131   timer_set(ATTOTIME_IN_USEC(21), NULL, cpunum, namco_54xx_irq_clear);
132132}
src/mame/audio/senjyo.c
r1355r1356
8484   sample_set_volume(0,0);
8585   sample_start_raw(0,_single,SINGLE_LENGTH,single_rate,1);
8686
87   timer_pulse(attotime_make(0, Machine->screen[0].refresh), 0, senjyo_sh_update);
87   timer_pulse(attotime_make(0, Machine->screen[0].refresh), NULL, 0, senjyo_sh_update);
8888}
src/mame/audio/mcr.c
r1355r1356
382382/********* external interfaces ***********/
383383WRITE8_HANDLER( ssio_data_w )
384384{
385   timer_call_after_resynch((offset << 8) | (data & 0xff), ssio_delayed_data_w);
385   timer_call_after_resynch(NULL, (offset << 8) | (data & 0xff), ssio_delayed_data_w);
386386}
387387
388388READ8_HANDLER( ssio_status_r )
r1355r1356
443443
444444
445445/********* sound interfaces ***********/
446struct AY8910interface ssio_ay8910_interface_1 =
446static struct AY8910interface ssio_ay8910_interface_1 =
447447{
448448   0,
449449   0,
r1355r1356
451451   ssio_portb0_w
452452};
453453
454struct AY8910interface ssio_ay8910_interface_2 =
454static struct AY8910interface ssio_ay8910_interface_2 =
455455{
456456   0,
457457   0,
r1355r1356
564564/********* external interfaces ***********/
565565WRITE8_HANDLER( csdeluxe_data_w )
566566{
567   timer_call_after_resynch(data, csdeluxe_delayed_data_w);
567   timer_call_after_resynch(NULL, data, csdeluxe_delayed_data_w);
568568}
569569
570570READ8_HANDLER( csdeluxe_status_r )
r1355r1356
664664/********* external interfaces ***********/
665665WRITE8_HANDLER( soundsgood_data_w )
666666{
667   timer_call_after_resynch(data, soundsgood_delayed_data_w);
667   timer_call_after_resynch(NULL, data, soundsgood_delayed_data_w);
668668}
669669
670670READ8_HANDLER( soundsgood_status_r )
r1355r1356
755755/********* external interfaces ***********/
756756WRITE8_HANDLER( turbocs_data_w )
757757{
758   timer_call_after_resynch(data, turbocs_delayed_data_w);
758   timer_call_after_resynch(NULL, data, turbocs_delayed_data_w);
759759}
760760
761761READ8_HANDLER( turbocs_status_r )
r1355r1356
882882/********* external interfaces ***********/
883883WRITE8_HANDLER( squawkntalk_data_w )
884884{
885   timer_call_after_resynch(data, squawkntalk_delayed_data_w);
885   timer_call_after_resynch(NULL, data, squawkntalk_delayed_data_w);
886886}
887887
888888void squawkntalk_reset_w(int state)
src/mame/audio/t5182.c
r1355r1356
177177
178178WRITE8_HANDLER( t5182_sound_irq_w )
179179{
180   timer_call_after_resynch(CPU_ASSERT,setirq_callback);
180   timer_call_after_resynch(NULL, CPU_ASSERT,setirq_callback);
181181}
182182
183183static WRITE8_HANDLER( t5182_ym2151_irq_ack_w )
184184{
185   timer_call_after_resynch(YM2151_ACK,setirq_callback);
185   timer_call_after_resynch(NULL, YM2151_ACK,setirq_callback);
186186}
187187
188188static WRITE8_HANDLER( t5182_cpu_irq_ack_w )
189189{
190   timer_call_after_resynch(CPU_CLEAR,setirq_callback);
190   timer_call_after_resynch(NULL, CPU_CLEAR,setirq_callback);
191191}
192192
193193static void t5182_ym2151_irq_handler(int irq)
194194{
195195   if (irq)
196      timer_call_after_resynch(YM2151_ASSERT,setirq_callback);
196      timer_call_after_resynch(NULL, YM2151_ASSERT,setirq_callback);
197197   else
198      timer_call_after_resynch(YM2151_CLEAR,setirq_callback);
198      timer_call_after_resynch(NULL, YM2151_CLEAR,setirq_callback);
199199}
200200
201201
src/mame/audio/segasnd.c
r1355r1356
225225
226226WRITE8_HANDLER( sega_speech_data_w )
227227{
228   timer_call_after_resynch(data, delayed_speech_w);
228   timer_call_after_resynch(NULL, data, delayed_speech_w);
229229}
230230
231231
r1355r1356
317317   cpunum_set_input_line(usb.cpunum, INPUT_LINE_RESET, ASSERT_LINE);
318318
319319   /* start the clock timer */
320   timer_pulse(attotime_mul(ATTOTIME_IN_HZ(USB_2MHZ_CLOCK), 256), 0, increment_t1_clock);
320   timer_pulse(attotime_mul(ATTOTIME_IN_HZ(USB_2MHZ_CLOCK), 256), NULL, 0, increment_t1_clock);
321321   usb.t1_clock_mask = t1_clock_mask;
322322}
323323
r1355r1356
360360WRITE8_HANDLER( sega_usb_data_w )
361361{
362362   LOG(("%04X:usb_data_w = %02X\n", activecpu_get_pc(), data));
363   timer_call_after_resynch(data, delayed_usb_data_w);
363   timer_call_after_resynch(NULL, data, delayed_usb_data_w);
364364
365365   /* boost the interleave so that sequences can be sent */
366366   cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(250));
src/mame/audio/vicdual.c
r1355r1356
139139
140140MACHINE_START( frogs_audio )
141141{
142   frogs_croak_timer = timer_alloc(frogs_croak_callback);
142   frogs_croak_timer = timer_alloc(frogs_croak_callback, NULL);
143143}
144144
145145
src/mame/audio/irem.c
r1355r1356
9898}
9999
100100
101struct AY8910interface irem_ay8910_interface_1 =
101static struct AY8910interface irem_ay8910_interface_1 =
102102{
103103   soundlatch_r,
104104   0,
r1355r1356
106106   irem_msm5205_w
107107};
108108
109struct AY8910interface irem_ay8910_interface_2 =
109static struct AY8910interface irem_ay8910_interface_2 =
110110{
111111   0,
112112   0,
r1355r1356
114114   0
115115};
116116
117struct MSM5205interface irem_msm5205_interface_1 =
117static struct MSM5205interface irem_msm5205_interface_1 =
118118{
119119   irem_adpcm_int,      /* interrupt function */
120120   MSM5205_S96_4B      /* default to 4KHz, but can be changed at run time */
121121};
122122
123struct MSM5205interface irem_msm5205_interface_2 =
123static struct MSM5205interface irem_msm5205_interface_2 =
124124{
125125   0,            /* interrupt function */
126126   MSM5205_SEX_4B      /* default to 4KHz, but can be changed at run time, slave */
src/mame/audio/leland.c
r1355r1356
526526   is_redline = 0;
527527
528528   /* create timers here so they stick around */
529   i80186.timer[0].int_timer = timer_alloc(internal_timer_int);
530   i80186.timer[1].int_timer = timer_alloc(internal_timer_int);
531   i80186.timer[2].int_timer = timer_alloc(internal_timer_int);
532   i80186.timer[0].time_timer = timer_alloc(NULL);
533   i80186.timer[1].time_timer = timer_alloc(NULL);
534   i80186.timer[2].time_timer = timer_alloc(NULL);
535   i80186.dma[0].finish_timer = timer_alloc(dma_timer_callback);
536   i80186.dma[1].finish_timer = timer_alloc(dma_timer_callback);
529   i80186.timer[0].int_timer = timer_alloc(internal_timer_int, NULL);
530   i80186.timer[1].int_timer = timer_alloc(internal_timer_int, NULL);
531   i80186.timer[2].int_timer = timer_alloc(internal_timer_int, NULL);
532   i80186.timer[0].time_timer = timer_alloc(NULL, NULL);
533   i80186.timer[1].time_timer = timer_alloc(NULL, NULL);
534   i80186.timer[2].time_timer = timer_alloc(NULL, NULL);
535   i80186.dma[0].finish_timer = timer_alloc(dma_timer_callback, NULL);
536   i80186.dma[1].finish_timer = timer_alloc(dma_timer_callback, NULL);
537537
538538   for (i = 0; i < 9; i++)
539      counter[i].timer = timer_alloc(NULL);
539      counter[i].timer = timer_alloc(NULL, NULL);
540540
541541   return auto_malloc(1);
542542}
r1355r1356
17201720
17211721WRITE8_HANDLER( leland_80186_command_lo_w )
17221722{
1723   timer_call_after_resynch(data, command_lo_sync);
1723   timer_call_after_resynch(NULL, data, command_lo_sync);
17241724}
17251725
17261726
r1355r1356
17751775   if (LOG_COMM) logerror("%04X:Read sound response latch = %02X\n", activecpu_get_previouspc(), sound_response);
17761776
17771777   /* synchronize the response */
1778   timer_call_after_resynch(activecpu_get_previouspc() + 2, delayed_response_r);
1778   timer_call_after_resynch(NULL, activecpu_get_previouspc() + 2, delayed_response_r);
17791779   return sound_response;
17801780}
17811781
src/mame/audio/dkong.c
r1355r1356
7272static UINT8 decay;
7373static UINT8 sh1_count = 0;
7474
75enum {
75enum
76{
7677   WAIT_CMD,
7778   WAIT_WRITE,
7879   WAIT_DONE1,
7980   WAIT_DONE2
80} m58817_states;
81};
8182
8283static UINT8 m58817_state;
8384static UINT8 m58817_drq;
src/mame/audio/taito_en.c
r1355r1356
6868   /* Channels 0, 1, 2, 3 - Unused */
6969}
7070
71static TIMER_CALLBACK( timer_callback )
71static TIMER_CALLBACK( taito_en_timer_callback )
7272{
7373   /* Only cause IRQ if the mask is set to allow it */
7474   if (m68681_imr&8) {
r1355r1356
8080
8181void f3_68681_reset(void)
8282{
83   timer_68681 = timer_alloc(timer_callback);
83   timer_68681 = timer_alloc(taito_en_timer_callback, NULL);
8484}
8585
8686READ16_HANDLER(f3_68681_r)
src/mame/audio/harddriv.c
r1355r1356
110110
111111WRITE16_HANDLER( hd68k_snd_data_w )
112112{
113   timer_call_after_resynch(data, delayed_68k_w);
113   timer_call_after_resynch(NULL, data, delayed_68k_w);
114114   logerror("%06X:main write to sound=%04X\n", activecpu_get_previouspc(), data);
115115}
116116
src/mame/audio/m72.c
r1355r1356
107107
108108MACHINE_RESET( m72_sound )
109109{
110   setvector_callback(machine, VECTOR_INIT);
110   setvector_callback(machine, NULL, VECTOR_INIT);
111111
112112   state_save_register_global(irqvector);
113113   state_save_register_global(sample_addr);
r1355r1356
116116void m72_ym2151_irq_handler(int irq)
117117{
118118   if (irq)
119      timer_call_after_resynch(YM2151_ASSERT,setvector_callback);
119      timer_call_after_resynch(NULL, YM2151_ASSERT,setvector_callback);
120120   else
121      timer_call_after_resynch(YM2151_CLEAR,setvector_callback);
121      timer_call_after_resynch(NULL, YM2151_CLEAR,setvector_callback);
122122}
123123
124124WRITE16_HANDLER( m72_sound_command_w )
r1355r1356
126126   if (ACCESSING_LSB)
127127   {
128128      soundlatch_w(offset,data);
129      timer_call_after_resynch(Z80_ASSERT,setvector_callback);
129      timer_call_after_resynch(NULL, Z80_ASSERT,setvector_callback);
130130   }
131131}
132132
133133WRITE8_HANDLER( m72_sound_command_byte_w )
134134{
135135   soundlatch_w(offset,data);
136   timer_call_after_resynch(Z80_ASSERT,setvector_callback);
136   timer_call_after_resynch(NULL, Z80_ASSERT,setvector_callback);
137137}
138138
139139WRITE8_HANDLER( m72_sound_irq_ack_w )
140140{
141   timer_call_after_resynch(Z80_CLEAR,setvector_callback);
141   timer_call_after_resynch(NULL, Z80_CLEAR,setvector_callback);
142142}
143143
144144
src/mame/audio/geebee.c
r1355r1356
125125   channel = stream_create(0, 1, 18432000 / 3 / 2 / 384, NULL, geebee_sound_update);
126126   vcount = 0;
127127
128   volume_timer = timer_alloc(volume_decay);
128   volume_timer = timer_alloc(volume_decay, NULL);
129129    return auto_malloc(1);
130130}
src/mame/audio/segag80r.c
r1355r1356
579579   sega005_stream = stream_create(0, 1, SEGA005_COUNTER_FREQ, NULL, sega005_stream_update);
580580
581581   /* create a timer for the 555 */
582   sega005_sound_timer = timer_alloc(sega005_auto_timer);
582   sega005_sound_timer = timer_alloc(sega005_auto_timer, NULL);
583583
584584   /* set the initial sound data */
585585   sound_data = 0x00;
src/mame/audio/williams.c
r1355r1356
464464
465465void williams_cvsd_data_w(int data)
466466{
467   timer_call_after_resynch(data, williams_cvsd_delayed_data_w);
467   timer_call_after_resynch(NULL, data, williams_cvsd_delayed_data_w);
468468}
469469
470470
src/mame/audio/system16.c
r1355r1356
3939   if ((data & 0x0f) != 8)
4040   {
4141      cpunum_set_input_line(2, INPUT_LINE_RESET, PULSE_LINE);
42      timer_set(ATTOTIME_IN_USEC(300), data, trigger_7751_sound);
42      timer_set(ATTOTIME_IN_USEC(300), NULL, data, trigger_7751_sound);
4343   }
4444}
4545
src/mame/audio/starwars.c
r1355r1356
158158         /* Should be decrementing every data*1024 6532 clock cycles */
159159         /* 6532 runs at 1.5 MHz */
160160
161         timer_set(attotime_mul(ATTOTIME_IN_HZ(1500000), data * 1024), 0, snd_interrupt);
161         timer_set(attotime_mul(ATTOTIME_IN_HZ(1500000), data * 1024), NULL, 0, snd_interrupt);
162162         return;
163163
164164      default:
r1355r1356
195195
196196WRITE8_HANDLER( starwars_sout_w )
197197{
198   timer_call_after_resynch(data, sound_callback);
198   timer_call_after_resynch(NULL, data, sound_callback);
199199}
200200
201201
r1355r1356
233233
234234WRITE8_HANDLER( starwars_main_wr_w )
235235{
236   timer_call_after_resynch(data, main_callback);
236   timer_call_after_resynch(NULL, data, main_callback);
237237}
238238
239239
src/mame/audio/gottlieb.c
r1355r1356
150150   }
151151
152152   /* generate a NMI after a while to make the CPU continue to send data */
153   timer_set(ATTOTIME_IN_USEC(50),0,gottlieb_nmi_generate);
153   timer_set(ATTOTIME_IN_USEC(50), NULL,0,gottlieb_nmi_generate);
154154}
155155
156156WRITE8_HANDLER( gottlieb_speech_clock_DAC_w )
r1355r1356
209209static TIMER_CALLBACK( nmi_callback );
210210void gottlieb_sound_init(void)
211211{
212   nmi_timer = timer_alloc(nmi_callback);
212   nmi_timer = timer_alloc(nmi_callback, NULL);
213213}
214214
215215void stooges_sp0250_drq(int level)
src/mame/audio/dcs.c
r1355r1356
891891   dcs.sounddata_words = dcs.bootrom_words;
892892
893893   /* create the timers */
894   dcs.internal_timer = timer_alloc(internal_timer_callback);
895   dcs.reg_timer = timer_alloc(dcs_irq);
894   dcs.internal_timer = timer_alloc(internal_timer_callback, NULL);
895   dcs.reg_timer = timer_alloc(dcs_irq, NULL);
896896
897897   /* non-RAM based automatically acks */
898898   dcs.auto_ack = TRUE;
899899
900900   /* reset the system */
901   dcs_reset(Machine, 0);
901   dcs_reset(Machine, NULL, 0);
902902}
903903
904904
r1355r1356
942942   dcs_sram = auto_malloc(0x8000*4);
943943
944944   /* create the timers */
945   dcs.internal_timer = timer_alloc(internal_timer_callback);
946   dcs.reg_timer = timer_alloc(dcs_irq);
947   dcs.sport_timer = timer_alloc(sport0_irq);
945   dcs.internal_timer = timer_alloc(internal_timer_callback, NULL);
946   dcs.reg_timer = timer_alloc(dcs_irq, NULL);
947   dcs.sport_timer = timer_alloc(sport0_irq, NULL);
948948
949949   /* we don't do auto-ack by default */
950950   dcs.auto_ack = FALSE;
r1355r1356
955955
956956   /* allocate a watchdog timer for HLE transfers */
957957   if (HLE_TRANSFERS)
958      transfer.watchdog = timer_alloc(transfer_watchdog_callback);
958      transfer.watchdog = timer_alloc(transfer_watchdog_callback, NULL);
959959
960960   /* reset the system */
961   dcs_reset(Machine, 0);
961   dcs_reset(Machine, NULL, 0);
962962}
963963
964964
r1355r1356
14491449      logerror("%08x: DCS reset = %d\n", safe_activecpu_get_pc(), state);
14501450
14511451      /* just run through the init code again */
1452      timer_call_after_resynch(0, dcs_reset);
1452      timer_call_after_resynch(NULL, 0, dcs_reset);
14531453      cpunum_set_input_line(dcs.cpunum, INPUT_LINE_RESET, ASSERT_LINE);
14541454   }
14551455
r1355r1356
15231523
15241524   /* if we are DCS1, set a timer to latch the data */
15251525   if (!dcs.sport_timer)
1526      timer_call_after_resynch(data, dcs_delayed_data_w_callback);
1526      timer_call_after_resynch(NULL, data, dcs_delayed_data_w_callback);
15271527   else
15281528       dcs_delayed_data_w(data);
15291529}
r1355r1356
15661566{
15671567   if (LOG_DCS_IO)
15681568      logerror("%08X:output_latch_w(%04X) (empty=%d)\n", activecpu_get_pc(), data, IS_OUTPUT_EMPTY());
1569   timer_call_after_resynch(data, latch_delayed_w);
1569   timer_call_after_resynch(NULL, data, latch_delayed_w);
15701570}
15711571
15721572
r1355r1356
15841584
15851585void dcs_ack_w(void)
15861586{
1587   timer_call_after_resynch(0, delayed_ack_w_callback);
1587   timer_call_after_resynch(NULL, 0, delayed_ack_w_callback);
15881588}
15891589
15901590
r1355r1356
16201620{
16211621   if (LOG_DCS_IO)
16221622      logerror("%04X:output_control = %04X\n", activecpu_get_pc(), data);
1623   timer_call_after_resynch(data, output_control_delayed_w);
1623   timer_call_after_resynch(NULL, data, output_control_delayed_w);
16241624}
16251625
16261626
r1355r1356
20452045   /* if the output is full, stall for a usec */
20462046   if (IS_OUTPUT_FULL())
20472047   {
2048      timer_set(ATTOTIME_IN_USEC(1), param, s1_ack_callback2);
2048      timer_set(ATTOTIME_IN_USEC(1), NULL, param, s1_ack_callback2);
20492049      return;
20502050   }
20512051   output_latch_w(0, 0x000a, 0);
r1355r1356
20572057   /* if the output is full, stall for a usec */
20582058   if (IS_OUTPUT_FULL())
20592059   {
2060      timer_set(ATTOTIME_IN_USEC(1), param, s1_ack_callback1);
2060      timer_set(ATTOTIME_IN_USEC(1), NULL, param, s1_ack_callback1);
20612061      return;
20622062   }
20632063   output_latch_w(0, param, 0);
20642064
20652065   /* chain to the next word we need to write back */
2066   timer_set(ATTOTIME_IN_USEC(1), 0, s1_ack_callback2);
2066   timer_set(ATTOTIME_IN_USEC(1), NULL, 0, s1_ack_callback2);
20672067}
20682068
20692069
r1355r1356
21732173
21742174            /* if we're done, start a timer to send the response words */
21752175            if (transfer.state == 0)
2176               timer_set(ATTOTIME_IN_USEC(1), transfer.sum, s1_ack_callback1);
2176               timer_set(ATTOTIME_IN_USEC(1), NULL, transfer.sum, s1_ack_callback1);
21772177            return 1;
21782178         }
21792179         break;
r1355r1356
21872187   /* if the output is full, stall for a usec */
21882188   if (IS_OUTPUT_FULL())
21892189   {
2190      timer_set(ATTOTIME_IN_USEC(1), param, s2_ack_callback);
2190      timer_set(ATTOTIME_IN_USEC(1), NULL, param, s2_ack_callback);
21912191      return;
21922192   }
21932193   output_latch_w(0, param, 0);
r1355r1356
22752275            /* if we're done, start a timer to send the response words */
22762276            if (transfer.state == 0)
22772277            {
2278               timer_set(ATTOTIME_IN_USEC(1), transfer.sum, s2_ack_callback);
2278               timer_set(ATTOTIME_IN_USEC(1), NULL, transfer.sum, s2_ack_callback);
22792279               timer_adjust(transfer.watchdog, attotime_never, 0, attotime_never);
22802280            }
22812281            return 1;
src/mame/audio/exidy.c
r1355r1356
420420   sh6840_LFSR_3 = 0xffffffff;
421421
422422   /* Init 6532 */
423    riot_timer = timer_alloc(riot_interrupt);
423    riot_timer = timer_alloc(riot_interrupt, NULL);
424424    riot_irq_flag = 0;
425425    riot_timer_irq_enable = 0;
426426   riot_porta_data = 0xff;
src/mame/audio/tank8.c
r1355r1356
8686   0  /* VEE */
8787};
8888
89discrete_dac_r1_ladder tank8_dac =
89static discrete_dac_r1_ladder tank8_dac =
9090{
9191   1,
9292   {RES_K(4.7)},   // R89
src/mame/audio/8080bw.c
r1355r1356
882882
883883MACHINE_START( schaser )
884884{
885   schaser_effect_555_timer = timer_alloc(schaser_effect_555_cb);
885   schaser_effect_555_timer = timer_alloc(schaser_effect_555_cb, NULL);
886886
887887   machine_start_mw8080bw(machine);
888888}
src/mame/machine/rainbow.c
r1355r1356
827827
828828   state_save_register_item("cchip", 0, current_bank);
829829
830   timer_pulse(ATTOTIME_IN_HZ(60), 0, cchip_timer);
830   timer_pulse(ATTOTIME_IN_HZ(60), NULL, 0, cchip_timer);
831831}
src/mame/machine/xevious.c
r1355r1356
3636   battles_customio_command_count = 0;
3737   battles_customio_data = 0;
3838   battles_sound_played = 0;
39   nmi_timer = timer_alloc(battles_nmi_generate);
39   nmi_timer = timer_alloc(battles_nmi_generate, NULL);
4040}
4141
4242
src/mame/machine/cubocd32.c
r1355r1356
9494   akiko.cdrom_cmd_resp = 0;
9595   akiko.cdrom = cdrom_open(get_disk_handle(0));
9696   akiko.cdrom_toc = NULL;
97   akiko.dma_timer = timer_alloc(akiko_dma_proc);
98   akiko.frame_timer = timer_alloc(akiko_frame_proc);
97   akiko.dma_timer = timer_alloc(akiko_dma_proc, NULL);
98   akiko.frame_timer = timer_alloc(akiko_frame_proc, NULL);
9999
100100   /* create the TOC table */
101101   if ( akiko.cdrom != NULL && cdrom_get_last_track(akiko.cdrom) )
r1355r1356
679679      {
680680         akiko.cdrom_cmd_start = (akiko.cdrom_cmd_start+3) & 0xff;
681681
682         timer_set( ATTOTIME_IN_MSEC(1), resp[0], akiko_cd_delayed_cmd );
682         timer_set( ATTOTIME_IN_MSEC(1), NULL, resp[0], akiko_cd_delayed_cmd );
683683
684684         break;
685685      }
src/mame/machine/nmk004.c
r1355r1356
8888/* C1CA-C1CB */   UINT16 timer_duration;
8989};
9090
91struct
91static struct
9292{
9393   const UINT8 *rom;   // NMK004 data ROM
9494   UINT8 from_main;   // command from main CPU
r1355r1356
10501050void NMK004_init(void)
10511051{
10521052   /* we have to do this via a timer because we get called before the sound reset */
1053   timer_call_after_resynch(0, real_nmk004_init);
1053   timer_call_after_resynch(NULL, 0, real_nmk004_init);
10541054}
10551055
10561056
src/mame/machine/bublbobl.c
r1355r1356
105105WRITE8_HANDLER( bublbobl_sound_command_w )
106106{
107107   soundlatch_w(offset,data);
108   timer_call_after_resynch(data,nmi_callback);
108   timer_call_after_resynch(NULL, data,nmi_callback);
109109}
110110
111111WRITE8_HANDLER( bublbobl_sh_nmi_disable_w )
src/mame/machine/galaxian.c
r1355r1356
8484   TTL7474_preset_w(1, 0);
8585
8686   /* start a timer to generate interrupts */
87   int_timer = timer_alloc(interrupt_timer);
87   int_timer = timer_alloc(interrupt_timer, NULL);
8888   timer_adjust(int_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
8989}
9090
src/mame/machine/asic65.c
r1355r1356
193193   /* rom-based use a deferred write mechanism */
194194   if (asic65_type == ASIC65_ROMBASED)
195195   {
196      timer_call_after_resynch(data | (offset << 16), m68k_asic65_deferred_w);
196      timer_call_after_resynch(NULL, data | (offset << 16), m68k_asic65_deferred_w);
197197      cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(20));
198198      return;
199199   }
src/mame/machine/tnzs.c
r1355r1356
507507
508508static WRITE8_HANDLER( tnzs_sync_kludge_w )
509509{
510   timer_call_after_resynch(data,kludge_callback);
510   timer_call_after_resynch(NULL, data,kludge_callback);
511511}
512512
513513
src/mame/machine/mhavoc.c
r1355r1356
113113   gamma_irq_clock = 0;
114114
115115   /* set a timer going for the CPU interrupt generators */
116   timer_pulse(ATTOTIME_IN_HZ(MHAVOC_CLOCK_5K), 0, cpu_irq_clock);
116   timer_pulse(ATTOTIME_IN_HZ(MHAVOC_CLOCK_5K), NULL, 0, cpu_irq_clock);
117117
118118   state_save_register_item("misc", 0, alpha_data);
119119   state_save_register_item("misc", 0, alpha_rcvd);
r1355r1356
146146   cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE);
147147
148148   /* the sound CPU needs to reply in 250microseconds (according to Neil Bradley) */
149   timer_set(ATTOTIME_IN_USEC(250), 0, 0);
149   timer_set(ATTOTIME_IN_USEC(250), NULL, 0, 0);
150150}
151151
152152
153153WRITE8_HANDLER( mhavoc_gamma_w )
154154{
155155   logerror("  writing to gamma processor: %02x (%d %d)\n", data, gamma_rcvd, alpha_xmtd);
156   timer_call_after_resynch(data, delayed_gamma_w);
156   timer_call_after_resynch(NULL, data, delayed_gamma_w);
157157}
158158
159159
src/mame/machine/equites.c
r1355r1356
258258   mrulemap = (struct MRULELIST *)byte_ptr; // pointer table to rule lists
259259   mrulepool = (struct MRULE *)(byte_ptr + 0x4000); // rules pool
260260
261   timer_pulse(ATTOTIME_IN_HZ(106), 0, equites_synth_callback); // hand tuned
261   timer_pulse(ATTOTIME_IN_HZ(106), NULL, 0, equites_synth_callback); // hand tuned
262262
263263   seedMT(mame_rand(Machine));
264264}
src/mame/machine/decocass.c
r1355r1356
16571657
16581658   tape_dir = 0;
16591659   tape_speed = 0;
1660   tape_timer = timer_alloc(NULL);
1660   tape_timer = timer_alloc(NULL, NULL);
16611661
16621662   firsttime = 1;
16631663   tape_present = 1;
r1355r1356
17111711
17121712   memset(decocass_quadrature_decoder, 0, sizeof(decocass_quadrature_decoder));
17131713   decocass_sound_ack = 0;
1714   decocass_sound_timer = timer_alloc(decocass_sound_nmi_pulse);
1714   decocass_sound_timer = timer_alloc(decocass_sound_nmi_pulse, NULL);
17151715}
17161716
17171717MACHINE_RESET( decocass )
src/mame/machine/irobot.c
r1355r1356
185185    /* set a callback for the next 32-scanline increment */
186186    scanline += 32;
187187    if (scanline >= 256) scanline = 0;
188    timer_set(video_screen_get_time_until_pos(0, scanline, 0), scanline, scanline_callback);
188    timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, scanline_callback);
189189}
190190
191191static TIMER_CALLBACK( irmb_done_callback );
r1355r1356
201201
202202   irvg_vblank=0;
203203   irvg_running = 0;
204   irvg_timer = timer_alloc(irvg_done_callback);
204   irvg_timer = timer_alloc(irvg_done_callback, NULL);
205205   irmb_running = 0;
206   irmb_timer = timer_alloc(irmb_done_callback);
206   irmb_timer = timer_alloc(irmb_done_callback, NULL);
207207
208208   /* set an initial timer to go off on scanline 0 */
209   timer_set(video_screen_get_time_until_pos(0, 0, 0), 0, scanline_callback);
209   timer_set(video_screen_get_time_until_pos(0, 0, 0), NULL, 0, scanline_callback);
210210
211211   irobot_rom_banksel_w(0,0);
212212   irobot_out0_w(0,0);
src/mame/machine/leland.c
r1355r1356
361361   battery_ram = auto_malloc(LELAND_BATTERY_RAM_SIZE);
362362
363363   /* start scanline interrupts going */
364   master_int_timer = timer_alloc(leland_interrupt_callback);
364   master_int_timer = timer_alloc(leland_interrupt_callback, NULL);
365365}
366366
367367
r1355r1356
414414   extra_tram = auto_malloc(ATAXX_EXTRA_TRAM_SIZE);
415415
416416   /* start scanline interrupts going */
417   master_int_timer = timer_alloc(ataxx_interrupt_callback);
417   master_int_timer = timer_alloc(ataxx_interrupt_callback, NULL);
418418}
419419
420420
src/mame/machine/midwayic.c
r1355r1356
287287
288288   pic.yearoffs = yearoffs;
289289   pic.time_just_written = 0;
290   pic.time_write_timer = timer_alloc(reset_timer);
290   pic.time_write_timer = timer_alloc(reset_timer, NULL);
291291   memset(pic.default_nvram, 0xff, sizeof(pic.default_nvram));
292292   generate_serial_data(upper);
293293}
src/mame/machine/segas24.c
r0r1356
1#include "driver.h"
2#include "system16.h"
3#include "includes/segas24.h"
4
5/* system24temp_ functions / variables are from shared rewrite files,
6   once the rest of the rewrite is complete they can be removed, I
7   just made a copy & renamed them for now to avoid any conflicts
8*/
9
10UINT16 *system24temp_sys16_shared_ram;
11READ16_HANDLER( system24temp_sys16_shared_ram_r )
12{
13   return system24temp_sys16_shared_ram[offset];
14}
15
16WRITE16_HANDLER( system24temp_sys16_shared_ram_w )
17{
18   COMBINE_DATA(system24temp_sys16_shared_ram + offset);
19}
20
21/* The 315-5296
22     8 8bits I/O ports, 3 output-only pins, some protection, and
23     external/daughterboard chip selection on half of the address
24     range
25*/
26
27static UINT8  (*system24temp_sys16_io_io_r)(int port);
28static void   (*system24temp_sys16_io_io_w)(int port, UINT8 data);
29static void   (*system24temp_sys16_io_cnt_w)(UINT8 data);
30static READ16_HANDLER ((*system24temp_sys16_io_iod_r));
31static WRITE16_HANDLER((*system24temp_sys16_io_iod_w));
32static UINT8 system24temp_sys16_io_cnt, system24temp_sys16_io_dir;
33
34void system24temp_sys16_io_set_callbacks(UINT8 (*io_r)(int port),
35                       void  (*io_w)(int port, UINT8 data),
36                       void  (*cnt_w)(UINT8 data),
37                       READ16_HANDLER ((*iod_r)),
38                       WRITE16_HANDLER((*iod_w)))
39{
40   system24temp_sys16_io_io_r = io_r;
41   system24temp_sys16_io_io_w = io_w;
42   system24temp_sys16_io_cnt_w = cnt_w;
43   system24temp_sys16_io_iod_r = iod_r;
44   system24temp_sys16_io_iod_w = iod_w;
45   system24temp_sys16_io_cnt = 0x00;
46   system24temp_sys16_io_dir = 0x00;
47}
48
49READ16_HANDLER ( system24temp_sys16_io_r )
50{
51   //  logerror("IO read %02x (%d:%x)\n", offset, cpu_getactivecpu(), activecpu_get_pc());
52   if(offset < 8)
53      return system24temp_sys16_io_io_r ? system24temp_sys16_io_io_r(offset) : 0xff;
54   else if (offset < 0x20) {
55      switch(offset) {
56      case 0x8:
57         return 'S';
58      case 0x9:
59         return 'E';
60      case 0xa:
61         return 'G';
62      case 0xb:
63         return 'A';
64      case 0xe:
65         return system24temp_sys16_io_cnt;
66      case 0xf:
67         return system24temp_sys16_io_dir;
68      default:
69         logerror("IO control read %02x (%d:%x)\n", offset, cpu_getactivecpu(), activecpu_get_pc());
70         return 0xff;
71      }
72   } else
73      return system24temp_sys16_io_iod_r ? system24temp_sys16_io_iod_r(offset & 0x1f, mem_mask) : 0xff;
74}
75
76READ32_HANDLER(system24temp_sys16_io_dword_r)
77{
78   return system24temp_sys16_io_r(2*offset, mem_mask)|(system24temp_sys16_io_r(2*offset+1, mem_mask>>16)<<16);
79}
80
81
82WRITE16_HANDLER( system24temp_sys16_io_w )
83{
84   if(ACCESSING_LSB) {
85      if(offset < 8) {
86         if(!(system24temp_sys16_io_dir & (1 << offset))) {
87            logerror("IO port write on input-only port (%d, [%02x], %02x, %d:%x)\n", offset, system24temp_sys16_io_dir, data & 0xff, cpu_getactivecpu(), activecpu_get_pc());
88            return;
89         }
90         if(system24temp_sys16_io_io_w)
91            system24temp_sys16_io_io_w(offset, data);
92      } else if (offset < 0x20) {
93         switch(offset) {
94         case 0xe:
95            system24temp_sys16_io_cnt = data;
96            if(system24temp_sys16_io_cnt_w)
97               system24temp_sys16_io_cnt_w(data & 7);
98            break;
99         case 0xf:
100            system24temp_sys16_io_dir = data;
101            break;
102         default:
103            logerror("IO control write %02x, %02x (%d:%x)\n", offset, data & 0xff, cpu_getactivecpu(), activecpu_get_pc());
104         }
105      }
106   }
107   if(offset >= 0x20 && system24temp_sys16_io_iod_w)
108      system24temp_sys16_io_iod_w(offset & 0x1f, data, mem_mask);
109}
src/mame/machine/stvcd.c
r1355r1356
273273      cd_stat = CD_STAT_OPEN;
274274   }
275275
276   sector_timer = timer_alloc(sector_cb);
276   sector_timer = timer_alloc(sector_cb, NULL);
277277   timer_adjust(sector_timer, ATTOTIME_IN_HZ(150), 0, attotime_zero);   // 150 sectors / second = 300kBytes/second
278278}
279279
src/mame/machine/ticket.c
r1355r1356
3232
3333static struct ticket_state dispenser[MAX_DISPENSERS];
3434
35static TIMER_CALLBACK_PTR( ticket_dispenser_toggle );
35static TIMER_CALLBACK( ticket_dispenser_toggle );
3636
3737
3838/***************************************************************************
r1355r1356
5353   {
5454      dispenser[i].status   = ticketnotdispensed;
5555      dispenser[i].power    = 0x00;
56      dispenser[i].timer    = timer_alloc_ptr(ticket_dispenser_toggle, &dispenser[i]);
56      dispenser[i].timer    = timer_alloc(ticket_dispenser_toggle, &dispenser[i]);
5757
5858      state_save_register_item("ticket", i, dispenser[i].status);
5959      state_save_register_item("ticket", i, dispenser[i].power);
r1355r1356
102102#ifdef DEBUG_TICKET
103103         logerror("PC: %04X  Ticket Power On\n", activecpu_get_pc());
104104#endif
105         timer_adjust_ptr(dispenser[0].timer, ATTOTIME_IN_MSEC(time_msec), attotime_zero);
105         timer_adjust(dispenser[0].timer, ATTOTIME_IN_MSEC(time_msec), 0, attotime_zero);
106106         dispenser[0].power = 1;
107107
108108         dispenser[0].status = ticketnotdispensed;
r1355r1356
115115#ifdef DEBUG_TICKET
116116         logerror("PC: %04X  Ticket Power Off\n", activecpu_get_pc());
117117#endif
118         timer_adjust_ptr(dispenser[0].timer, attotime_never, attotime_never);
118         timer_adjust(dispenser[0].timer, attotime_never, 0, attotime_never);
119119         set_led_status(2,0);
120120         dispenser[0].power = 0;
121121      }
r1355r1356
132132#ifdef DEBUG_TICKET
133133         logerror("PC: %04X  Ticket Power On\n", activecpu_get_pc());
134134#endif
135         timer_adjust_ptr(dispenser[1].timer, ATTOTIME_IN_MSEC(time_msec), attotime_zero);
135         timer_adjust(dispenser[1].timer, ATTOTIME_IN_MSEC(time_msec), 0, attotime_zero);
136136         dispenser[1].power = 1;
137137
138138         dispenser[1].status = ticketnotdispensed;
r1355r1356
145145#ifdef DEBUG_TICKET
146146         logerror("PC: %04X  Ticket Power Off\n", activecpu_get_pc());
147147#endif
148         timer_adjust_ptr(dispenser[1].timer, attotime_never, attotime_never);
148         timer_adjust(dispenser[1].timer, attotime_never, 0, attotime_never);
149149         set_led_status(2,0);
150150         dispenser[1].power = 0;
151151      }
r1355r1356
160160  When a ticket dispenses, there is N milliseconds of status = high,
161161  and N milliseconds of status = low (a wait cycle?).
162162***************************************************************************/
163static TIMER_CALLBACK_PTR( ticket_dispenser_toggle )
163static TIMER_CALLBACK( ticket_dispenser_toggle )
164164{
165   struct ticket_state *dispenser = param;
165   struct ticket_state *dispenser = ptr;
166166
167167   /* If we still have power, keep toggling ticket states. */
168168   if (dispenser->power)
r1355r1356
171171#ifdef DEBUG_TICKET
172172      logerror("Ticket Status Changed to %02X\n", status);
173173#endif
174      timer_adjust_ptr(dispenser->timer, ATTOTIME_IN_MSEC(time_msec), attotime_zero);
174      timer_adjust(dispenser->timer, ATTOTIME_IN_MSEC(time_msec), 0, attotime_zero);
175175   }
176176
177177   if (dispenser->status == ticketdispensed)
src/mame/machine/namcoio.c
r1355r1356
794794   if (chipnum < MAX_NAMCOIO && state != CLEAR_LINE && !io[chipnum].reset)
795795   {
796796      /* give the cpu a tiny bit of time to write the command before processing it */
797      timer_set(ATTOTIME_IN_USEC(50), chipnum, namcoio_run);
797      timer_set(ATTOTIME_IN_USEC(50), NULL, chipnum, namcoio_run);
798798   }
799799}
800800
r1355r1356
876876      namcoio_init(4*chipnum + 2, type2, intf2);
877877      namcoio_init(4*chipnum + 3, type3, intf3);
878878      nmi_cpu[chipnum] = cpu;
879      nmi_timer[chipnum] = timer_alloc(nmi_generate);
879      nmi_timer[chipnum] = timer_alloc(nmi_generate, NULL);
880880      namco_06xx_state_save(chipnum);
881881   }
882882}
src/mame/machine/pitnrun.c
r1355r1356
2828
2929READ8_HANDLER( pitnrun_mcu_data_r )
3030{
31   timer_call_after_resynch(0,pitnrun_mcu_real_data_r);
31   timer_call_after_resynch(NULL, 0,pitnrun_mcu_real_data_r);
3232   return toz80;
3333}
3434
r1355r1356
4141
4242WRITE8_HANDLER( pitnrun_mcu_data_w )
4343{
44   timer_call_after_resynch(data,pitnrun_mcu_real_data_w);
44   timer_call_after_resynch(NULL, data,pitnrun_mcu_real_data_w);
45   cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(5));
4546}
4647
4748READ8_HANDLER( pitnrun_mcu_status_r )
4849{
4950   /* mcu synchronization */
50   cpu_yielduntil_time (ATTOTIME_IN_USEC(5));
5151   /* bit 0 = the 68705 has read data from the Z80 */
5252   /* bit 1 = the 68705 has written data for the Z80 */
5353   return ~((zready << 1) | (zaccept << 0));
r1355r1356
108108   if (~data & 0x02)
109109   {
110110      /* 68705 is going to read data from the Z80 */
111      timer_call_after_resynch(0,pitnrun_mcu_data_real_r);
111      timer_call_after_resynch(NULL, 0,pitnrun_mcu_data_real_r);
112112      cpunum_set_input_line(2,0,CLEAR_LINE);
113113      portA_in = fromz80;
114114   }
115115   if (~data & 0x04)
116116   {
117117      /* 68705 is writing data for the Z80 */
118      timer_call_after_resynch(portA_out,pitnrun_mcu_status_real_w);
118      timer_call_after_resynch(NULL, portA_out,pitnrun_mcu_status_real_w);
119119   }
120120   if (~data & 0x10)
121121   {
src/mame/machine/n64.c
r1355r1356
22
33#include "driver.h"
44#include "cpu/mips/mips3.h"
5#include "cpu/rsp/rsp.h"
65#include "sound/custom.h"
76#include "streams.h"
87#include "includes/n64.h"
r1355r1356
225224
226225
227226
228void sp_set_status(UINT32 status)
227static void sp_set_status(UINT32 status)
229228{
230229   if (status & 0x1)
231230   {
r1355r1356
499498   }
500499}
501500
502UINT32 sp_read_reg(UINT32 reg)
503{
504   switch (reg)
505   {
506      //case 4:       return rsp_sp_status;
507      default:   return n64_sp_reg_r(reg, 0x00000000);
508   }
509}
510
511void sp_write_reg(UINT32 reg, UINT32 data)
512{
513   switch (reg)
514   {
515      default:   n64_sp_reg_w(reg, data, 0x00000000); break;
516   }
517}
518
519501// RDP Interface
520502UINT32 dp_start;
521503UINT32 dp_end;
r1355r1356
582564}
583565
584566
567rsp_config n64_rsp_config =
568{
569   n64_dp_reg_r,
570   n64_dp_reg_w,
571   n64_sp_reg_r,
572   n64_sp_reg_w,
573   sp_set_status
574};
585575
576
586577// Video Interface
587578static UINT32 vi_width;
588579UINT32 vi_origin;
r1355r1356
10591050// Serial Interface
10601051static UINT8 pif_ram[0x40];
10611052static UINT8 pif_cmd[0x40];
1062UINT32 si_dram_addr = 0;
1063UINT32 si_pif_addr = 0;
1064UINT32 si_status = 0;
1053static UINT32 si_dram_addr = 0;
1054static UINT32 si_pif_addr = 0;
1055static UINT32 si_status = 0;
10651056
10661057static UINT8 eeprom[512];
10671058static UINT8 mempack[0x8000];
r1355r1356
15171508   }
15181509}
15191510
1520UINT32 cic_status = 0x00000000;
1511static UINT32 cic_status = 0x00000000;
15211512
15221513READ32_HANDLER( n64_pif_ram_r )
15231514{
r1355r1356
15761567   cpunum_set_info_ptr(0, CPUINFO_PTR_MIPS3_FASTRAM_BASE, rdram);
15771568   cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_READONLY, 0);
15781569
1579   audio_timer = timer_alloc(audio_timer_callback);
1570   audio_timer = timer_alloc(audio_timer_callback, NULL);
15801571   timer_adjust(audio_timer, attotime_never, 0, attotime_never);
15811572
15821573   cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE);
src/mame/machine/stfight.c
r1355r1356
108108{
109109    // Do a RST10
110110    cpunum_set_input_line_and_vector(0,0,HOLD_LINE,0xd7);
111      timer_set(ATTOTIME_IN_HZ(120), 0, stfight_interrupt_1);
111      timer_set(ATTOTIME_IN_HZ(120), NULL, 0, stfight_interrupt_1);
112112}
113113
114114/*
src/mame/machine/tait8741.c
r1355r1356
204204            st->txd[0] = st->portHandler ? st->portHandler(0) : 0;
205205            if( sst )
206206            {
207               timer_call_after_resynch(num,taito8741_serial_tx);
207               timer_call_after_resynch(NULL, num, taito8741_serial_tx);
208208               st->serial_out = 0;
209209               st->status |= 0x04;
210210               st->phase = CMD_08;
r1355r1356
445445   if( (i8741[num].sts & 0x02) )
446446   {
447447      /* transmit data */
448      timer_set (ATTOTIME_IN_USEC(1),num,josvolly_8741_tx);
448      timer_set (ATTOTIME_IN_USEC(1), NULL, num, josvolly_8741_tx);
449449   }
450450}
451451
src/mame/machine/volfied.c
r1355r1356
283283};
284284
285285
286static TIMER_CALLBACK( timer_callback )
286static TIMER_CALLBACK( volfied_timer_callback )
287287{
288288   // Palette commands - palette data written to bank 0: $10 - $af
289289   if (current_cmd>=0x1 && current_cmd<0x12)
r1355r1356
392392         // Palette request cmd - verified to take around 122242 68000 cycles to complete
393393         if (current_cmd >= 0x1 && current_cmd < 0x12)
394394         {
395            timer_set(ATTOTIME_IN_CYCLES(122242,0), 0, timer_callback);
395            timer_set(ATTOTIME_IN_CYCLES(122242,0), NULL, 0, volfied_timer_callback);
396396         }
397397         // Unknown cmd - verified to take around 105500 68000 cycles to complete
398398         else if (current_cmd >= 0x81 && current_cmd < 0x92)
399399         {
400            timer_set(ATTOTIME_IN_CYCLES(105500,0), 0, timer_callback);
400            timer_set(ATTOTIME_IN_CYCLES(105500,0), NULL, 0, volfied_timer_callback);
401401         }
402402         else
403403         {
src/mame/machine/balsente.c
r1355r1356
119119   cpunum_set_input_line(0, M6809_IRQ_LINE, ASSERT_LINE);
120120
121121   /* it will turn off on the next HBLANK */
122   timer_set(video_screen_get_time_until_pos(0, param, BALSENTE_HBSTART), 0, irq_off);
122   timer_set(video_screen_get_time_until_pos(0, param, BALSENTE_HBSTART), NULL, 0, irq_off);
123123
124124   /* if this is Grudge Match, update the steering */
125125   if (grudge_steering_result & 0x80)
r1355r1356
155155
156156   /* reset counters; counter 2's gate is tied high */
157157   memset(counter, 0, sizeof(counter));
158   counter[1].timer = timer_alloc(counter_callback);
159   counter[2].timer = timer_alloc(counter_callback);
158   counter[1].timer = timer_alloc(counter_callback, NULL);
159   counter[2].timer = timer_alloc(counter_callback, NULL);
160160   counter[2].gate = 1;
161161
162162   /* reset the manual counter 0 clock */
163163   counter_control = 0x00;
164164   counter_0_ff = 0;
165   counter_0_timer = timer_alloc(clock_counter_0_ff);
165   counter_0_timer = timer_alloc(clock_counter_0_ff, NULL);
166166   counter_0_timer_active = 0;
167167
168168   /* reset the ADC states */
r1355r1356
191191   memory_set_bank(2, 0);
192192
193193   /* start a timer to generate interrupts */
194   scanline_timer = timer_alloc(interrupt_timer);
194   scanline_timer = timer_alloc(interrupt_timer, NULL);
195195   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
196196
197197   /* register for saving */
r1355r1356
525525
526526   /* set a timer for 500usec later to actually transmit the data */
527527   /* (this is very important for several games, esp Snacks'n Jaxson) */
528   timer_set(ATTOTIME_IN_USEC(500), param, m6850_data_ready_callback);
528   timer_set(ATTOTIME_IN_USEC(500), NULL, param, m6850_data_ready_callback);
529529}
530530
531531
r1355r1356
542542
543543   /* output register is at offset 1; set a timer to synchronize the CPUs */
544544   else
545      timer_call_after_resynch(data, m6850_w_callback);
545      timer_call_after_resynch(NULL, data, m6850_w_callback);
546546}
547547
548548
r1355r1356
661661   /* set a timer to go off and read the value after 50us */
662662   /* it's important that we do this for Mini Golf */
663663logerror("adc_select %d\n", offset & 7);
664   timer_set(ATTOTIME_IN_USEC(50), offset & 7, adc_finished);
664   timer_set(ATTOTIME_IN_USEC(50), NULL, offset & 7, adc_finished);
665665}
666666
667667
r1355r1356
909909      {
910910         counter[0].count--;
911911         if (counter[0].count == 0)
912            counter_callback(machine, 0);
912            counter_callback(machine, NULL, 0);
913913      }
914914   }
915915
src/mame/machine/qix.c
r1355r1356
271271INTERRUPT_GEN( qix_vblank_start )
272272{
273273   pia_3_cb1_w(0, 1);
274   timer_set(video_screen_get_time_until_pos(0, 0, 0), 0, vblank_stop);
274   timer_set(video_screen_get_time_until_pos(0, 0, 0), NULL, 0, vblank_stop);
275275}
276276
277277
r1355r1356
372372static WRITE8_HANDLER( sync_pia_4_porta_w )
373373{
374374   /* we need to synchronize this so the sound CPU doesn't drop anything important */
375   timer_call_after_resynch(data, deferred_pia_4_porta_w);
375   timer_call_after_resynch(NULL, data, deferred_pia_4_porta_w);
376376}
377377
378378
r1355r1356
519519{
520520   /* make all the CPUs synchronize, and only AFTER that write the command to the PIA */
521521   /* otherwise the 68705 will miss commands */
522   timer_call_after_resynch(data | (offset << 8), pia_0_w_callback);
522   timer_call_after_resynch(NULL, data | (offset << 8), pia_0_w_callback);
523523}
524524
525525
src/mame/machine/snes.c
r1355r1356
318318   snes_ram[VMAIN] = 0x80;
319319
320320   /* init timers and stop them */
321   snes_scanline_timer = timer_alloc(snes_scanline_tick);
321   snes_scanline_timer = timer_alloc(snes_scanline_tick, NULL);
322322   timer_adjust(snes_scanline_timer, attotime_never, 0, attotime_never);
323   snes_hblank_timer = timer_alloc(snes_hblank_tick);
323   snes_hblank_timer = timer_alloc(snes_hblank_tick, NULL);
324324   timer_adjust(snes_hblank_timer, attotime_never, 0, attotime_never);
325   snes_nmi_timer = timer_alloc(snes_nmi_tick);
325   snes_nmi_timer = timer_alloc(snes_nmi_tick, NULL);
326326   timer_adjust(snes_nmi_timer, attotime_never, 0, attotime_never);
327   snes_hirq_timer = timer_alloc(snes_hirq_tick_callback);
327   snes_hirq_timer = timer_alloc(snes_hirq_tick_callback, NULL);
328328   timer_adjust(snes_hirq_timer, attotime_never, 0, attotime_never);
329329
330330   // SNES hcounter has a 0-339 range.  hblank starts at counter 260.
src/mame/machine/taitosj.c
r1355r1356
132132#if DEBUG_MCU
133133logerror("%04x: protection write %02x\n",activecpu_get_pc(),data);
134134#endif
135   timer_call_after_resynch(data,taitosj_mcu_real_data_w);
135   timer_call_after_resynch(NULL, data,taitosj_mcu_real_data_w);
136136   /* temporarily boost the interleave to sync things up */
137137   cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(10));
138138}
r1355r1356
218218   if (~data & 0x02)
219219   {
220220      /* 68705 is going to read data from the Z80 */
221      timer_call_after_resynch(0,taitosj_mcu_data_real_r);
221      timer_call_after_resynch(NULL, 0,taitosj_mcu_data_real_r);
222222      cpunum_set_input_line(2,0,CLEAR_LINE);
223223      portA_in = fromz80;
224224#if DEBUG_MCU
r1355r1356
235235logerror("%04x: 68705 -> Z80 %02x\n",activecpu_get_pc(),portA_out);
236236#endif
237237      /* 68705 is writing data for the Z80 */
238      timer_call_after_resynch(portA_out,taitosj_mcu_status_real_w);
238      timer_call_after_resynch(NULL, portA_out,taitosj_mcu_status_real_w);
239239   }
240240   if (~data & 0x10)
241241   {
src/mame/machine/amiga.c
r1355r1356
293293   cia_config(1, &cia_intf[1]);
294294
295295   /* setup the timers */
296   amiga_irq_timer = timer_alloc(amiga_irq_proc);
297   amiga_blitter_timer = timer_alloc(amiga_blitter_proc);
296   amiga_irq_timer = timer_alloc(amiga_irq_proc, NULL);
297   amiga_blitter_timer = timer_alloc(amiga_blitter_proc, NULL);
298298}
299299
300300
r1355r1356
13081308         if (amiga_intf->serdat_w != NULL)
13091309            (*amiga_intf->serdat_w)(data);
13101310         CUSTOM_REG(REG_SERDATR) &= ~0x3000;
1311         timer_set(amiga_get_serial_char_period(), 0, finish_serial_write);
1311         timer_set(amiga_get_serial_char_period(), NULL, 0, finish_serial_write);
13121312         break;
13131313
13141314      case REG_BLTSIZE:
src/mame/machine/vertigo.c
r1355r1356
174174WRITE16_HANDLER( vertigo_audio_w )
175175{
176176   if (ACCESSING_LSB)
177      timer_call_after_resynch(data & 0xff, sound_command_w);
177      timer_call_after_resynch(NULL, data & 0xff, sound_command_w);
178178}
179179
180180READ16_HANDLER( vertigo_sio_r )
src/mame/machine/pcshare.c
r1355r1356
503503      pc_page_offset_mask = 0x0F0000;
504504   }
505505
506   pc_keyboard_timer = timer_alloc(pc_keyb_timer);
506   pc_keyboard_timer = timer_alloc(pc_keyb_timer, NULL);
507507}
508508
509509/*
src/mame/machine/atarigen.c
r1355r1356
143143
144144   /* create timers */
145145   for (i = 0; i < ATARIMO_MAX; i++)
146      scanline_timer[i] = timer_alloc(scanline_timer_callback);
146      scanline_timer[i] = timer_alloc(scanline_timer_callback, NULL);
147147
148148   /* create a timer for scanlines */
149   scanline_interrupt_timer = timer_alloc(scanline_interrupt_callback);
149   scanline_interrupt_timer = timer_alloc(scanline_interrupt_callback, NULL);
150150}
151151
152152
r1355r1356
595595
596596WRITE16_HANDLER( atarigen_sound_reset_w )
597597{
598   timer_call_after_resynch(0, delayed_sound_reset);
598   timer_call_after_resynch(NULL, 0, delayed_sound_reset);
599599}
600600
601601
r1355r1356
606606
607607void atarigen_sound_reset(void)
608608{
609   timer_call_after_resynch(1, delayed_sound_reset);
609   timer_call_after_resynch(NULL, 1, delayed_sound_reset);
610610}
611611
612612
r1355r1356
620620WRITE16_HANDLER( atarigen_sound_w )
621621{
622622   if (ACCESSING_LSB)
623      timer_call_after_resynch(data & 0xff, delayed_sound_w);
623      timer_call_after_resynch(NULL, data & 0xff, delayed_sound_w);
624624}
625625
626626WRITE16_HANDLER( atarigen_sound_upper_w )
627627{
628628   if (ACCESSING_MSB)
629      timer_call_after_resynch((data >> 8) & 0xff, delayed_sound_w);
629      timer_call_after_resynch(NULL, (data >> 8) & 0xff, delayed_sound_w);
630630}
631631
632632WRITE32_HANDLER( atarigen_sound_upper32_w )
633633{
634634   if (ACCESSING_MSB32)
635      timer_call_after_resynch((data >> 24) & 0xff, delayed_sound_w);
635      timer_call_after_resynch(NULL, (data >> 24) & 0xff, delayed_sound_w);
636636}
637637
638638
r1355r1356
672672
673673WRITE8_HANDLER( atarigen_6502_sound_w )
674674{
675   timer_call_after_resynch(data, delayed_6502_sound_w);
675   timer_call_after_resynch(NULL, data, delayed_6502_sound_w);
676676}
677677
678678
r1355r1356
936936   atarivc_state.latch1 = atarivc_state.latch2 = -1;
937937   actual_vc_latch0 = actual_vc_latch1 = -1;
938938
939   atarivc_eof_update_timer[scrnum] = timer_alloc(atarivc_eof_update);
939   atarivc_eof_update_timer[scrnum] = timer_alloc(atarivc_eof_update, NULL);
940940
941941   /* start a timer to go off a little before scanline 0 */
942942   if (atarivc_eof_data)
r1355r1356
12971297
12981298   /* halt and set a timer to wake up */
12991299   fraction = (double)(hblank - hpos) / (double)Machine->screen[0].width;
1300   timer_set(double_to_attotime(attotime_to_double(video_screen_get_scan_period(0)) * fraction), 0, unhalt_cpu);
1300   timer_set(double_to_attotime(attotime_to_double(video_screen_get_scan_period(0)) * fraction), NULL, 0, unhalt_cpu);
13011301   cpunum_set_input_line(0, INPUT_LINE_HALT, ASSERT_LINE);
13021302}
13031303
src/mame/machine/midwunit.c
r1355r1356
278278            int temp = midwunit_sound_state_r(0, 0);
279279            result |= (temp & 0x800) >> 9;
280280            result |= (~temp & 0x400) >> 10;
281            timer_call_after_resynch(0, 0);
281            timer_call_after_resynch(NULL, 0, 0);
282282         }
283283         break;
284284
r1355r1356
305305            int temp = midwunit_sound_state_r(0, 0);
306306            result |= (temp & 0x800) >> 11;
307307            result |= (~temp & 0x400) >> 8;
308            timer_call_after_resynch(0, 0);
308            timer_call_after_resynch(NULL, 0, 0);
309309         }
310310         break;
311311
src/mame/machine/namcos2.c
r1355r1356
665665   if( IsSystem21()==0 && namcos2_68k_master_C148[NAMCOS2_C148_POSIRQ] )
666666   {
667667      int scanline = GetPosIRQScanline();
668      timer_set(video_screen_get_time_until_pos(0, scanline, 0), scanline, namcos2_68k_master_posirq );
668      timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, namcos2_68k_master_posirq );
669669   }
670670   cpunum_set_input_line( CPU_MASTER, namcos2_68k_master_C148[NAMCOS2_C148_VBLANKIRQ], HOLD_LINE);
671671}
r1355r1356
681681   if( IsSystem21()==0 && namcos2_68k_slave_C148[NAMCOS2_C148_POSIRQ] )
682682   {
683683      int scanline = GetPosIRQScanline();
684      timer_set(video_screen_get_time_until_pos(0, scanline, 0), scanline, namcos2_68k_slave_posirq );
684      timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, namcos2_68k_slave_posirq );
685685   }
686686   cpunum_set_input_line( CPU_SLAVE, namcos2_68k_slave_C148[NAMCOS2_C148_VBLANKIRQ], HOLD_LINE);
687687}
r1355r1356
699699   if( namcos2_68k_gpu_C148[NAMCOS2_C148_POSIRQ] )
700700   {
701701      int scanline = 0x50+0x89; /* HACK for Winning Run */
702      timer_set(video_screen_get_time_until_pos(0, scanline, 0), scanline, namcos2_68k_gpu_posirq );
702      timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, namcos2_68k_gpu_posirq );
703703   }
704704   cpunum_set_input_line( CPU_GPU, namcos2_68k_gpu_C148[NAMCOS2_C148_VBLANKIRQ], HOLD_LINE);
705705}
src/mame/machine/namco50.c
r1355r1356
266266   // The input clock to the 06XX interface chip is 64H, that is
267267   // 18432000/6/64 = 48kHz, so it makes sense for the irq line to be
268268   // asserted for one clock cycle ~= 21us.
269   timer_set(ATTOTIME_IN_USEC(21), cpunum, namco_50xx_irq_clear);
269   timer_set(ATTOTIME_IN_USEC(21), NULL, cpunum, namco_50xx_irq_clear);
270270}
271271
272272void namco_50xx_write(UINT8 data)
r1355r1356
276276   if (cpunum == -1)
277277      return;
278278
279   timer_call_after_resynch(data, namco_50xx_latch_callback);
279   timer_call_after_resynch(NULL, data, namco_50xx_latch_callback);
280280
281281   namco_50xx_irq_set(cpunum);
282282}
r1355r1356
288288   if (cpunum == -1)
289289      return;
290290
291   timer_call_after_resynch(data, namco_50xx_2_latch_callback);
291   timer_call_after_resynch(NULL, data, namco_50xx_2_latch_callback);
292292
293293   namco_50xx_irq_set(cpunum);
294294}
r1355r1356
301301   if (cpunum == -1)
302302      return;
303303
304   timer_call_after_resynch(0, namco_50xx_readrequest_callback);
304   timer_call_after_resynch(NULL, 0, namco_50xx_readrequest_callback);
305305
306306   namco_50xx_irq_set(cpunum);
307307}
r1355r1356
313313   if (cpunum == -1)
314314      return;
315315
316   timer_call_after_resynch(0, namco_50xx_2_readrequest_callback);
316   timer_call_after_resynch(NULL, 0, namco_50xx_2_readrequest_callback);
317317
318318   namco_50xx_irq_set(cpunum);
319319}
src/mame/machine/mcr.c
r1355r1356
6161static UINT8 v493_irq_state;
6262static UINT8 v493_irq_vector;
6363
64static void (*v493_callback)(running_machine *machine, int param);
64static timer_callback v493_callback;
6565
6666static UINT8 zwackery_sound_data;
6767
r1355r1356
290290   z80sio_init(0, &nflfoot_sio_intf);
291291
292292   /* allocate a timer for the IPU watchdog */
293   ipu_watchdog_timer = timer_alloc(ipu_watchdog_reset);
293   ipu_watchdog_timer = timer_alloc(ipu_watchdog_reset, NULL);
294294}
295295
296296
r1355r1356
319319   {
320320      struct counter_state *m6840 = &m6840_state[i];
321321
322      m6840->timer = timer_alloc(counter_fired_callback);
322      m6840->timer = timer_alloc(counter_fired_callback, NULL);
323323
324324      state_save_register_item("m6840", i, m6840->control);
325325      state_save_register_item("m6840", i, m6840->latch);
r1355r1356
459459   /* also set a timer to generate the 493 signal at a specific time before the next VBLANK */
460460   /* the timing of this is crucial for Blasted and Tri-Sports, which check the timing of */
461461   /* VBLANK and 493 using counter 2 */
462   timer_set(attotime_sub(ATTOTIME_IN_HZ(30), mcr68_timing_factor), 0, v493_callback);
462   timer_set(attotime_sub(ATTOTIME_IN_HZ(30), mcr68_timing_factor), NULL, 0, v493_callback);
463463}
464464
465465
r1355r1356
499499{
500500   v493_irq_state = 1;
501501   update_mcr68_interrupts();
502   timer_set(video_screen_get_scan_period(0), 0, mcr68_493_off_callback);
502   timer_set(video_screen_get_scan_period(0), NULL, 0, mcr68_493_off_callback);
503503   logerror("--- (INT1) ---\n");
504504}
505505
r1355r1356
620620static TIMER_CALLBACK( zwackery_493_callback )
621621{
622622   pia_2_ca1_w(0, 1);
623   timer_set(video_screen_get_scan_period(0), 0, zwackery_493_off_callback);
623   timer_set(video_screen_get_scan_period(0), NULL, 0, zwackery_493_off_callback);
624624}
625625
626626
src/mame/machine/arkanoid.c
r1355r1356
6060
6161WRITE8_HANDLER( arkanoid_Z80_mcu_w )
6262{
63   timer_call_after_resynch(data, test);
63   timer_call_after_resynch(NULL, data, test);
6464   /* boost the interleave for a few usecs to make sure it is read successfully */
6565   cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(10));
6666}
src/mame/machine/konamiic.c
r1355r1356
6363
6464   timer_period = attotime_mul(ATTOTIME_IN_HZ(44100), 128);   // roughly 2.9us
6565
66   K056800_sound_cpu_timer = timer_alloc(K056800_sound_cpu_timer_tick);
66   K056800_sound_cpu_timer = timer_alloc(K056800_sound_cpu_timer_tick, NULL);
6767   timer_adjust(K056800_sound_cpu_timer, timer_period, 0, timer_period);
6868}
6969
src/mame/machine/slikshot.c
r1355r1356
527527
528528WRITE8_HANDLER( slikshot_z80_control_w )
529529{
530   timer_call_after_resynch(data, delayed_z80_control_w);
530   timer_call_after_resynch(NULL, data, delayed_z80_control_w);
531531}
532532
533533
src/mame/machine/harddriv.c
r1355r1356
200200   memset(duart_read_data, 0, sizeof(duart_read_data));
201201   memset(duart_write_data, 0, sizeof(duart_write_data));
202202   duart_output_port = 0;
203   duart_timer = timer_alloc(duart_callback);
203   duart_timer = timer_alloc(duart_callback, NULL);
204204
205205   /* reset the ADSP/DSIII/DSIV boards */
206206   adsp_halt = 1;
r1355r1356
783783
784784   /* if being written from the 68000, synchronize on it */
785785   if (hd34010_host_access)
786      timer_call_after_resynch(newdata | (offset << 16) | (which << 28), stmsp_sync_update);
786      timer_call_after_resynch(NULL, newdata | (offset << 16) | (which << 28), stmsp_sync_update);
787787
788788   /* otherwise, just update */
789789   else
r1355r1356
871871   if (offset == 0x1fff)
872872   {
873873      logerror("%06X:ADSP sync address written (%04X)\n", activecpu_get_previouspc(), data);
874      timer_call_after_resynch(0, 0);
874      timer_call_after_resynch(NULL, 0, 0);
875875      cpu_triggerint(hdcpu_adsp);
876876   }
877877   else
r1355r1356
974974
975975      case 3:
976976         logerror("ADSP bank = %d (deferred)\n", val);
977         timer_call_after_resynch(val, deferred_adsp_bank_switch);
977         timer_call_after_resynch(NULL, val, deferred_adsp_bank_switch);
978978         break;
979979
980980      case 5:
r1355r1356
15711571      COMBINE_DATA(&newdata);
15721572      dataptr[next_msp_sync % MAX_MSP_SYNC] = dptr;
15731573      dataval[next_msp_sync % MAX_MSP_SYNC] = newdata;
1574      timer_call_after_resynch(next_msp_sync++ % MAX_MSP_SYNC, rddsp32_sync_cb);
1574      timer_call_after_resynch(NULL, next_msp_sync++ % MAX_MSP_SYNC, rddsp32_sync_cb);
15751575   }
15761576   else
15771577      COMBINE_DATA(&rddsp32_sync[0][offset]);
r1355r1356
15871587      COMBINE_DATA(&newdata);
15881588      dataptr[next_msp_sync % MAX_MSP_SYNC] = dptr;
15891589      dataval[next_msp_sync % MAX_MSP_SYNC] = newdata;
1590      timer_call_after_resynch(next_msp_sync++ % MAX_MSP_SYNC, rddsp32_sync_cb);
1590      timer_call_after_resynch(NULL, next_msp_sync++ % MAX_MSP_SYNC, rddsp32_sync_cb);
15911591   }
15921592   else
15931593      COMBINE_DATA(&rddsp32_sync[1][offset]);
src/mame/machine/psx.c
r1355r1356
15631563
15641564   for( n = 0; n < 7; n++ )
15651565   {
1566      m_p_timer_dma[ n ] = timer_alloc( dma_finished_callback );
1566      m_p_timer_dma[ n ] = timer_alloc( dma_finished_callback , NULL);
15671567      m_p_fn_dma_read[ n ] = NULL;
15681568      m_p_fn_dma_write[ n ] = NULL;
15691569   }
15701570
15711571   for( n = 0; n < 3; n++ )
15721572   {
1573      m_p_timer_root[ n ] = timer_alloc( root_finished );
1573      m_p_timer_root[ n ] = timer_alloc( root_finished , NULL);
15741574   }
15751575
15761576   for( n = 0; n < 2; n++ )
15771577   {
1578      m_p_timer_sio[ n ] = timer_alloc( sio_clock );
1578      m_p_timer_sio[ n ] = timer_alloc( sio_clock , NULL);
15791579   }
15801580
15811581   for( n = 0; n < 256; n++ )
src/mame/machine/dec0.c
r1355r1356
483483    if (i8751_timer)
484484        logerror("i8751:  Missed a timer!!!\n");
485485    else
486        i8751_timer = timer_call_after_resynch(0, i8751_callback);*/
486        i8751_timer = timer_call_after_resynch(NULL, 0, i8751_callback);*/
487487
488488/* There is a timing problem in Heavy Barrel if the processing time is not
489489simulated - if the interrupt is triggered straight away then HB will reset
src/mame/machine/lsasquad.c
r1355r1356
4141   lsasquad_sound_pending |= 0x01;
4242   sound_cmd = data;
4343//logerror("%04x: sound cmd %02x\n",activecpu_get_pc(),data);
44   timer_call_after_resynch(data,nmi_callback);
44   timer_call_after_resynch(NULL, data,nmi_callback);
4545}
4646
4747READ8_HANDLER( lsasquad_sh_sound_command_r )
src/mame/machine/williams.c
r1355r1356
274274   pia_1_ca1_w(0, 1);
275275
276276   /* set a timer to turn it off once the scanline counter resets */
277   timer_set(video_screen_get_time_until_pos(0, 0, 0), 0, williams_count240_off_callback);
277   timer_set(video_screen_get_time_until_pos(0, 0, 0), NULL, 0, williams_count240_off_callback);
278278
279279   /* set a timer for next frame */
280280   timer_adjust(scan240_timer, video_screen_get_time_until_pos(0, 240, 0), 0, attotime_zero);
r1355r1356
318318   ticket_dispenser_init(70, TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH);
319319
320320   /* set a timer to go off every 16 scanlines, to toggle the VA11 line and update the screen */
321   scanline_timer = timer_alloc(williams_va11_callback);
321   scanline_timer = timer_alloc(williams_va11_callback, NULL);
322322   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
323323
324324   /* also set a timer to go off on scanline 240 */
325   scan240_timer = timer_alloc(williams_count240_callback);
325   scan240_timer = timer_alloc(williams_count240_callback, NULL);
326326   timer_adjust(scan240_timer, video_screen_get_time_until_pos(0, 240, 0), 0, attotime_zero);
327327
328328   state_save_register_global(vram_bank);
r1355r1356
377377   pia_0_ca1_w(0, 0);
378378
379379   /* set a timer to turn it off once the scanline counter resets */
380   timer_set(video_screen_get_time_until_pos(0, 8, 0), 0, williams2_endscreen_off_callback);
380   timer_set(video_screen_get_time_until_pos(0, 8, 0), NULL, 0, williams2_endscreen_off_callback);
381381
382382   /* set a timer for next frame */
383383   timer_adjust(scan254_timer, video_screen_get_time_until_pos(0, 254, 0), 0, attotime_zero);
r1355r1356
410410   williams2_bank_select_w(0, 0);
411411
412412   /* set a timer to go off every 16 scanlines, to toggle the VA11 line and update the screen */
413   scanline_timer = timer_alloc(williams2_va11_callback);
413   scanline_timer = timer_alloc(williams2_va11_callback, NULL);
414414   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
415415
416416   /* also set a timer to go off on scanline 254 */
417   scan254_timer = timer_alloc(williams2_endscreen_callback);
417   scan254_timer = timer_alloc(williams2_endscreen_callback, NULL);
418418   timer_adjust(scan254_timer, video_screen_get_time_until_pos(0, 254, 0), 0, attotime_zero);
419419
420420   state_save_register_global(vram_bank);
r1355r1356
490490WRITE8_HANDLER( williams_snd_cmd_w )
491491{
492492   /* the high two bits are set externally, and should be 1 */
493   timer_call_after_resynch(data | 0xc0, williams_deferred_snd_cmd_w);
493   timer_call_after_resynch(NULL, data | 0xc0, williams_deferred_snd_cmd_w);
494494}
495495
496496WRITE8_HANDLER( playball_snd_cmd_w )
497497{
498   timer_call_after_resynch(data, williams_deferred_snd_cmd_w);
498   timer_call_after_resynch(NULL, data, williams_deferred_snd_cmd_w);
499499}
500500
501501
r1355r1356
506506
507507static WRITE8_HANDLER( williams2_snd_cmd_w )
508508{
509   timer_call_after_resynch(data, williams2_deferred_snd_cmd_w);
509   timer_call_after_resynch(NULL, data, williams2_deferred_snd_cmd_w);
510510}
511511
512512
r1355r1356
915915{
916916   joust2_current_sound_data = (joust2_current_sound_data & ~0xff) | (data & 0xff);
917917   williams_cvsd_data_w(joust2_current_sound_data);
918   timer_call_after_resynch(joust2_current_sound_data, joust2_deferred_snd_cmd_w);
918   timer_call_after_resynch(NULL, joust2_current_sound_data, joust2_deferred_snd_cmd_w);
919919}
src/mame/machine/sbrkout.c
r1355r1356
1212#define SBRKOUT_DOUBLE      0x01
1313#define SBRKOUT_CAVITY      0x02
1414
15int sbrkout_game_switch = SBRKOUT_PROGRESSIVE;
15static int sbrkout_game_switch = SBRKOUT_PROGRESSIVE;
1616
1717
1818/***************************************************************************
src/mame/machine/opwolf.c
r1355r1356
284284};
285285
286286
287static TIMER_CALLBACK( timer_callback )
287static TIMER_CALLBACK( opwolf_timer_callback )
288288{
289289   // Level data command
290290   if (current_cmd==0xf5)
r1355r1356
694694   {
695695      // Simulate time for command to execute (exact timing unknown, this is close)
696696      current_cmd=0xf5;
697      timer_set(ATTOTIME_IN_CYCLES(80000,0), 0, timer_callback);
697      timer_set(ATTOTIME_IN_CYCLES(80000,0), NULL, 0, opwolf_timer_callback);
698698   }
699699   cchip_last_7a=cchip_ram[0x7a];
700700
r1355r1356
747747   cchip_coins_for_credit[1]=1;
748748   cchip_credits_for_coin[1]=1;
749749
750   timer_pulse(ATTOTIME_IN_HZ(60), 0, cchip_timer);
750   timer_pulse(ATTOTIME_IN_HZ(60), NULL, 0, cchip_timer);
751751}
src/mame/machine/nb1413m3.c
r1355r1356
4444#define NB1413M3_TIMER_BASE 20000000
4545static TIMER_CALLBACK( nb1413m3_timer_callback )
4646{
47   timer_set(attotime_mul(ATTOTIME_IN_HZ(NB1413M3_TIMER_BASE), 256), 0, nb1413m3_timer_callback);
47   timer_set(attotime_mul(ATTOTIME_IN_HZ(NB1413M3_TIMER_BASE), 256), NULL, 0, nb1413m3_timer_callback);
4848
4949   nb1413m3_74ls193_counter++;
5050   nb1413m3_74ls193_counter &= 0x0f;
r1355r1356
141141
142142   nb1413m3_74ls193_counter = 0;
143143
144   timer_call_after_resynch(0, nb1413m3_timer_callback);
144   timer_call_after_resynch(NULL, 0, nb1413m3_timer_callback);
145145}
146146
147147WRITE8_HANDLER( nb1413m3_nmi_clock_w )
src/mame/machine/model1.c
r1355r1356
20312031      extern void v60_stall(void);
20322032      v60_stall();
20332033
2034      timer_call_after_resynch(0, NULL);
2034      timer_call_after_resynch(NULL, 0, NULL);
20352035
20362036      return 0;
20372037   }
src/mame/machine/jackal.c
r1355r1356
1515extern UINT8 jackal_interrupt_enable;
1616extern void jackal_mark_tile_dirty(int offset);
1717
18UINT8 *jackal_rambank = 0;
19UINT8 *jackal_spritebank = 0;
18static UINT8 *jackal_rambank = 0;
19static UINT8 *jackal_spritebank = 0;
2020
2121
2222MACHINE_RESET( jackal )
src/mame/machine/mw8080bw.c
r1355r1356
8787
8888static void mw8080bw_create_interrupt_timer(void)
8989{
90   interrupt_timer = timer_alloc(mw8080bw_interrupt_callback);
90   interrupt_timer = timer_alloc(mw8080bw_interrupt_callback, NULL);
9191}
9292
9393
src/mame/mamedriv.c
r1355r1356
550550   DRIVER( vautour2 )   /* bootleg */
551551   DRIVER( griffon )   /* bootleg (Videotron) */
552552   DRIVER( falcona )   /* bootleg */
553   DRIVER( nextfase )   /* bootleg */
553554   DRIVER( pleiads )   /* (c) 1981 Tehkan */
554555   DRIVER( pleiadbl )   /* bootleg */
555556   DRIVER( pleiadce )   /* (c) 1981 Centuri + Tehkan */
r1355r1356
662663   DRIVER( skykid )   /* (c) 1985 */
663664   DRIVER( skykido )   /* (c) 1985 */
664665   DRIVER( skykidd )   /* (c) 1985 */
666   DRIVER( skykids )   /* (c) 1985 */
665667   DRIVER( aliensec )   /* (c) 1985 */
666668   DRIVER( baraduke )   /* (c) 1985 */
667669   DRIVER( metrocrs )   /* (c) 1985 */
r1355r1356
32703272   DRIVER( myherok )   /* 834-5755 (c) 1985 Coreland / Sega (S1) */
32713273   DRIVER( shtngmst )   /* 834-5719/5720 (c) 1985 (S2) */
32723274   DRIVER( shtngmsa )   /* 834-5719/5720 (c) 1985 (S2) */
3275    DRIVER( shtngmsb )   /* 834-5719/5720 (c) 1985 (S2) */
32733276   DRIVER( chplft )   /* 834-5795 (c) 1985, (c) 1982 Dan Gorlin (S2) */
32743277   DRIVER( chplftb )   /* 834-5795 (c) 1985, (c) 1982 Dan Gorlin (S2) */
32753278   DRIVER( chplftbl )   /* bootleg (S2) */
r1355r1356
33383341   DRIVER( enduror1 )   /* (c) 1985 (FD1089B, decrypted) */
33393342   DRIVER( endurob2 )   /* (c) 1985 (Beta bootleg) */
33403343   DRIVER( endurobl )   /* (c) 1985 (Herb bootleg) */
3341   DRIVER( hangon )   /* (c) 1985 */
3344   DRIVER( hangon )   /* (c) 1985 (Rev A)*/
3345   DRIVER( hangon1 )   /* (c) 1985 */
33423346   DRIVER( sharrier )   /* (c) 1985 */
33433347   DRIVER( sharrir1 )   /* (c) 1985 */
33443348   DRIVER( shangupb )   /* (c) 1992 (but bootleg, hangon hw?) */
r1355r1356
41924196   DRIVER( edrandy0 )   /* MAD (c) 1990 Data East Corporation (World) */
41934197   DRIVER( edrandyj )   /* MAD (c) 1990 Data East Corporation (Japan) */
41944198   DRIVER( supbtime )   /* MAE (c) 1990 Data East Corporation (World) */
4199   DRIVER( supbtima )   /* MAE (c) 1990 Data East Corporation (World) */
41954200   DRIVER( supbtimj )   /* MAE (c) 1990 Data East Corporation (Japan) */
41964201   DRIVER( mutantf )   /* MAF (c) 1992 Data East Corporation (World) */
41974202   DRIVER( mutantfa )   /* MAF (c) 1992 Data East Corporation (World) */
r1355r1356
49714976   DRIVER( caterplr )   /* (bootleg) */
49724977   DRIVER( millpac )   /* Valadon */
49734978   DRIVER( magworm )   /* (bootleg) */
4979   DRIVER( mazeinv )    /* (proto)          (c) 1982 */
49744980   DRIVER( milliped )   /* 136013           (c) 1982 */
49754981   DRIVER( qwak )       /* (proto)          (c) 1982 */
49764982   DRIVER( runaway )   /* (proto)          (c) 1982 */
r1355r1356
52195225   /* Escape from the Planet of Robot Monsters */
52205226   DRIVER( eprom )      /* 136069           (c) 1989 */
52215227   DRIVER( eprom2 )   /* 136069           (c) 1989 */
5228   DRIVER( guts )      /* prototype */
52225229   /* Cyberball 2 Player */
52235230   DRIVER( cyberb2p )   /* 136071           (c) 1989 */
52245231   DRIVER( cyberb23 )   /* 136071           (c) 1989 */
r1355r1356
78467853   DRIVER( esha )      /* (c) 1984 Funai / Gakken */
78477854   DRIVER( eshb )      /* (c) 1984 Funai / Gakken */
78487855   DRIVER( comebaby )   /* (c) 2000 ExPotato */
7849   DRIVER( peplus )   /* (c) 1987 IGT - International Gaming Technology */
7856   DRIVER( peset038 )   /* (c) 1987 IGT - International Gaming Technology */
78507857   DRIVER( pepp0158 )   /* (c) 1987 IGT - International Gaming Technology */
78517858   DRIVER( pepp0188 )   /* (c) 1987 IGT - International Gaming Technology */
7852   DRIVER( peset038 )   /* (c) 1987 IGT - International Gaming Technology */
7859   DRIVER( pepp0516 )   /* (c) 1987 IGT - International Gaming Technology */
78537860    DRIVER( pebe0014 )   /* (c) 1994 IGT - International Gaming Technology */
78547861    DRIVER( peke1012 )   /* (c) 1994 IGT - International Gaming Technology */
78557862    DRIVER( peps0615 )   /* (c) 1996 IGT - International Gaming Technology */
src/mame/includes/eprom.h
r1355r1356
99VIDEO_START( eprom );
1010VIDEO_UPDATE( eprom );
1111
12VIDEO_START( guts );
13VIDEO_UPDATE( guts );
14
1215void eprom_scanline_update(running_machine *machine, int scrnum, int scanline);
src/mame/includes/segas24.h
r0r1356
1/*----------- defined in machine/system24.c -----------*/
2
3/* system24temp_ functions / variables are from shared rewrite files,
4   once the rest of the rewrite is complete they can be removed, I
5   just made a copy & renamed them for now to avoid any conflicts
6*/
7
8/* New Code */
9
10extern UINT16 *system24temp_sys16_shared_ram;
11READ16_HANDLER( system24temp_sys16_shared_ram_r );
12WRITE16_HANDLER( system24temp_sys16_shared_ram_w );
13
14void system24temp_sys16_io_set_callbacks(UINT8 (*io_r)(int port),
15                     void  (*io_w)(int port, UINT8 data),
16                     void  (*cnt_w)(UINT8 data),
17                     READ16_HANDLER ((*iod_r)),
18                     WRITE16_HANDLER((*iod_w)));
19READ16_HANDLER ( system24temp_sys16_io_r );
20WRITE16_HANDLER( system24temp_sys16_io_w );
21READ32_HANDLER ( system24temp_sys16_io_dword_r );
22
23/* End New Code */
src/mame/includes/n64.h
r1355r1356
11#ifndef _INCLUDES_N64_H_
22#define _INCLUDES_N64_H_
33
4#include "cpu/rsp/rsp.h"
5
46/*----------- defined in video/n64.c -----------*/
57
68extern VIDEO_START( n64 );
r1355r1356
4042
4143/*----------- defined in machine/n64.c -----------*/
4244
45extern rsp_config n64_rsp_config;
46
4347extern UINT32 *rdram;
4448extern UINT32 *rsp_imem;
4549extern UINT32 *rsp_dmem;
src/mame/includes/centiped.h
r1355r1356
3030WRITE8_HANDLER( bullsdrt_tilesbank_w );
3131WRITE8_HANDLER( bullsdrt_sprites_bank_w );
3232
33WRITE8_HANDLER( mazeinv_paletteram_w );
34
src/mame/mame.mak
r1355r1356
11451145   $(DRIVERS)/segas16a.o $(VIDEO)/segas16a.o \
11461146   $(DRIVERS)/segas16b.o $(VIDEO)/segas16b.o \
11471147   $(DRIVERS)/segas18.o $(VIDEO)/segas18.o \
1148   $(DRIVERS)/segas24.o $(MACHINE)/segas24.o $(VIDEO)/segas24.o \
11481149   $(DRIVERS)/segas32.o $(MACHINE)/segas32.o $(VIDEO)/segas32.o \
11491150   $(DRIVERS)/segae.o $(VIDEO)/segasyse.o \
11501151   $(DRIVERS)/segaxbd.o $(VIDEO)/segaxbd.o \
r1355r1356
11571158   $(DRIVERS)/system1.o $(VIDEO)/system1.o \
11581159   $(DRIVERS)/system16.o $(MACHINE)/system16.o $(VIDEO)/system16.o $(VIDEO)/sys16spr.o \
11591160   $(DRIVERS)/system18.o \
1160   $(DRIVERS)/system24.o $(MACHINE)/system24.o $(VIDEO)/system24.o \
11611161   $(DRIVERS)/topshoot.o \
11621162   $(DRIVERS)/turbo.o $(AUDIO)/turbo.o $(VIDEO)/turbo.o \
11631163   $(DRIVERS)/vicdual.o $(AUDIO)/vicdual.o $(VIDEO)/vicdual.o \
r1355r1356
16841684$(DRIVERS)/nbmj8688.o:   $(LAYOUT)/nbmj8688.lh
16851685
16861686$(DRIVERS)/peplus.o:   $(LAYOUT)/peplus.lh \
1687                  $(LAYOUT)/pepp0158.lh \
1688                  $(LAYOUT)/pepp0188.lh \
1689                  $(LAYOUT)/peset038.lh
1687                  $(LAYOUT)/pe_schip.lh \
1688                  $(LAYOUT)/pe_poker.lh \
1689                  $(LAYOUT)/pe_bjack.lh \
1690                  $(LAYOUT)/pe_keno.lh \
1691                  $(LAYOUT)/pe_slots.lh
16901692
16911693$(DRIVERS)/pmpoker.o:   $(LAYOUT)/pmpoker.lh \
16921694                  $(LAYOUT)/goldnpkr.lh \
r1355r1356
16961698
16971699$(DRIVERS)/sspeedr.o:   $(LAYOUT)/sspeedr.lh
16981700
1701$(DRIVERS)/tceptor.o:   $(LAYOUT)/tceptor2.lh
1702
16991703$(DRIVERS)/tetrisp2.o:   $(LAYOUT)/rocknms.lh
17001704
17011705$(DRIVERS)/turbo.o:      $(LAYOUT)/turbo.lh \
r1355r1356
17161720#-------------------------------------------------
17171721
17181722$(DRIVERS)/neogeo.o:   $(MAMESRC)/drivers/neodrvr.c
1719$(DRIVERS)/mpu4.o:      $(MAMESRC)/drivers/mpu4drvr.c
src/mame/video/nycaptor.c
r1355r1356
88#include "driver.h"
99
1010#ifdef MAME_DEBUG
11 int nycaptor_mask=0;
11static int nycaptor_mask=0;
1212#endif
1313
1414static tilemap *bg_tilemap;
src/mame/video/eprom.c
r1355r1356
3737}
3838
3939
40static TILE_GET_INFO( guts_get_playfield_tile_info )
41{
42   UINT16 data1 = atarigen_playfield[tile_index];
43   UINT16 data2 = atarigen_playfield_upper[tile_index] >> 8;
44   int code = data1 & 0x7fff;
45   int color = 0x10 + (data2 & 0x0f);
46   SET_TILE_INFO(2, code, color, (data1 >> 15) & 1);
47}
4048
49
50
4151/*************************************
4252 *
4353 *  Video system start
r1355r1356
95105}
96106
97107
108VIDEO_START( guts )
109{
110   static const struct atarimo_desc modesc =
111   {
112      0,               /* index to which gfx system */
113      1,               /* number of motion object banks */
114      1,               /* are the entries linked? */
115      0,               /* are the entries split? */
116      0,               /* render in reverse order? */
117      0,               /* render in swapped X/Y order? */
118      0,               /* does the neighbor bit affect the next object? */
119      8,               /* pixels per SLIP entry (0 for no-slip) */
120      0,               /* pixel offset for SLIPs */
121      0,               /* maximum number of links to visit/scanline (0=all) */
98122
123      0x100,            /* base palette entry */
124      0x100,            /* maximum number of colors */
125      0,               /* transparent pen index */
126
127      {{ 0x03ff,0,0,0 }},   /* mask for the link */
128      {{ 0 }},         /* mask for the graphics bank */
129      {{ 0,0x7fff,0,0 }},   /* mask for the code index */
130      {{ 0 }},         /* mask for the upper code index */
131      {{ 0,0,0x000f,0 }},   /* mask for the color */
132      {{ 0,0,0xff80,0 }},   /* mask for the X position */
133      {{ 0,0,0,0xff80 }},   /* mask for the Y position */
134      {{ 0,0,0,0x0070 }},   /* mask for the width, in tiles*/
135      {{ 0,0,0,0x000f }},   /* mask for the height, in tiles */
136      {{ 0,0x8000,0,0 }},   /* mask for the horizontal flip */
137      {{ 0 }},         /* mask for the vertical flip */
138      {{ 0,0,0x0070,0 }},   /* mask for the priority */
139      {{ 0 }},         /* mask for the neighbor */
140      {{ 0 }},         /* mask for absolute coordinates */
141
142      {{ 0 }},         /* mask for the special value */
143      0,               /* resulting value to indicate "special" */
144      0               /* callback routine for special entries */
145   };
146
147   /* initialize the playfield */
148   atarigen_playfield_tilemap = tilemap_create(guts_get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 64,64);
149
150   /* initialize the motion objects */
151   atarimo_init(machine, 0, &modesc);
152
153   /* initialize the alphanumerics */
154   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
155   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
156}
157
158
159
99160/*************************************
100161 *
101162 *  Periodic scanline updater
r1355r1356
268329      }
269330   return 0;
270331}
332
333
334VIDEO_UPDATE( guts )
335{
336   struct atarimo_rect_list rectlist;
337   mame_bitmap *mobitmap;
338   int x, y, r;
339
340   /* draw the playfield */
341   tilemap_draw(bitmap, cliprect, atarigen_playfield_tilemap, 0, 0);
342
343   /* draw and merge the MO */
344   mobitmap = atarimo_render(machine, 0, cliprect, &rectlist);
345   for (r = 0; r < rectlist.numrects; r++, rectlist.rect++)
346      for (y = rectlist.rect->min_y; y <= rectlist.rect->max_y; y++)
347      {
348         UINT16 *mo = (UINT16 *)mobitmap->base + mobitmap->rowpixels * y;
349         UINT16 *pf = (UINT16 *)bitmap->base + bitmap->rowpixels * y;
350         for (x = rectlist.rect->min_x; x <= rectlist.rect->max_x; x++)
351            if (mo[x])
352            {
353               int mopriority = (mo[x] >> ATARIMO_PRIORITY_SHIFT) & 7;
354               int pfpriority = (pf[x] >> 5) & 3;
355
356               /* upper bit of MO priority signals special rendering and doesn't draw anything */
357               if (mopriority & 4)
358                  continue;
359
360               /* check the priority */
361               if (!(pf[x] & 8) || mopriority >= pfpriority)
362                  pf[x] = mo[x] & ATARIMO_DATA_MASK;
363
364               /* don't erase yet -- we need to make another pass later */
365            }
366      }
367
368   /* add the alpha on top */
369   tilemap_draw(bitmap, cliprect, atarigen_alpha_tilemap, 0, 0);
370
371   /* now go back and process the upper bit of MO priority */
372   rectlist.rect -= rectlist.numrects;
373   for (r = 0; r < rectlist.numrects; r++, rectlist.rect++)
374      for (y = rectlist.rect->min_y; y <= rectlist.rect->max_y; y++)
375      {
376         UINT16 *mo = (UINT16 *)mobitmap->base + mobitmap->rowpixels * y;
377         UINT16 *pf = (UINT16 *)bitmap->base + bitmap->rowpixels * y;
378         for (x = rectlist.rect->min_x; x <= rectlist.rect->max_x; x++)
379            if (mo[x])
380            {
381               int mopriority = mo[x] >> ATARIMO_PRIORITY_SHIFT;
382
383               /* upper bit of MO priority might mean palette kludges */
384               if (mopriority & 4)
385               {
386                  /* if bit 2 is set, start setting high palette bits */
387                  if (mo[x] & 2)
388                     thunderj_mark_high_palette(bitmap, pf, mo, x, y);
389               }
390
391               /* erase behind ourselves */
392               mo[x] = 0;
393            }
394      }
395
396   return 0;
397}
src/mame/video/midyunit.c
r1355r1356
580580   }
581581
582582   /* signal we're done */
583   timer_set(ATTOTIME_IN_NSEC(41 * dma_state.width * dma_state.height), 0, dma_callback);
583   timer_set(ATTOTIME_IN_NSEC(41 * dma_state.width * dma_state.height), NULL, 0, dma_callback);
584584
585585   profiler_mark(PROFILER_END);
586586}
r1355r1356
614614      dest[x] = pen_map[src[coladdr++ & 0x1ff]];
615615
616616   /* handle autoerase on the previous line */
617   autoerase_line(machine, params->rowaddr - 1);
617   autoerase_line(machine, NULL, params->rowaddr - 1);
618618
619619   /* if this is the last update of the screen, set a timer to clear out the final line */
620620   /* (since we update one behind) */
621621   if (scanline == machine->screen[0].visarea.max_y)
622      timer_set(video_screen_get_time_until_pos(0, scanline + 1, 0), params->rowaddr, autoerase_line);
622      timer_set(video_screen_get_time_until_pos(0, scanline + 1, 0), NULL, params->rowaddr, autoerase_line);
623623}
src/mame/video/nbmj9195.c
r1355r1356
382382   nb19010_busyflag = 0;
383383
384384   /* 1650ns per count */
385   timer_set(attotime_make(0, nb19010_busyctr * 1650 * ATTOSECONDS_PER_NANOSECOND), 0, blitter_timer_callback);
385   timer_set(ATTOTIME_IN_NSEC(nb19010_busyctr * 1650), NULL, 0, blitter_timer_callback);
386386}
387387
388388/******************************************************************************
src/mame/video/midtunit.c
r1355r1356
4444       UINT8   midtunit_gfx_rom_large;
4545static UINT16   midtunit_control;
4646
47/* palette-related variables */
48static pen_t *   pen_map;
49
5047/* videoram-related variables */
5148static UINT32    gfxbank_offset[2];
5249static UINT16 *   local_videoram;
r1355r1356
8986
9087VIDEO_START( midtunit )
9188{
92   int i;
93
9489   /* allocate memory */
9590   local_videoram = auto_malloc(0x100000);
96   pen_map = auto_malloc(65536 * sizeof(pen_map[0]));
9791
98   /* initialize pen map */
99   for (i = 0; i < 0x10000; i++)
100      pen_map[i] = i & 0x7fff;
101
10292   /* reset all the globals */
10393   gfxbank_offset[0] = 0x000000;
10494   gfxbank_offset[1] = 0x400000;
r1355r1356
804794
805795   /* signal we're done */
806796skipdma:
807   timer_set(ATTOTIME_IN_NSEC(41 * pixels), 0, dma_callback);
797   timer_set(ATTOTIME_IN_NSEC(41 * pixels), NULL, 0, dma_callback);
808798
809799   profiler_mark(PROFILER_END);
810800}
r1355r1356
826816
827817   /* copy the non-blanked portions of this scanline */
828818   for (x = params->heblnk; x < params->hsblnk; x++)
829      dest[x] = pen_map[src[coladdr++ & 0x1ff]];
819      dest[x] = src[coladdr++ & 0x1ff] & 0x7fff;
830820}
831821
832822void midxunit_scanline_update(running_machine *machine, int screen, mame_bitmap *bitmap, int scanline, const tms34010_display_params *params)
r1355r1356
838828
839829   /* copy the non-blanked portions of this scanline */
840830   for (x = params->heblnk; x < params->hsblnk; x++)
841      dest[x] = pen_map[src[fulladdr++ & 0x1ff]];
831      dest[x] = src[fulladdr++ & 0x1ff] & 0x7fff;
842832}
src/mame/video/niyanpai.c
r1355r1356
342342   }
343343
344344   nb19010_busyflag = 0;
345   timer_set(attotime_mul(ATTOTIME_IN_NSEC(1650), nb19010_busyctr), 0, blitter_timer_callback);
345   timer_set(ATTOTIME_IN_NSEC(1650 * nb19010_busyctr), NULL, 0, blitter_timer_callback);
346346}
347347
348348/******************************************************************************
src/mame/video/itech32.c
r1355r1356
231231   /* reset statics */
232232   memset(itech32_video, 0, 0x80);
233233
234   scanline_timer = timer_alloc(scanline_interrupt);
234   scanline_timer = timer_alloc(scanline_interrupt, NULL);
235235   enable_latch[0] = 1;
236236   enable_latch[1] = (itech32_planes > 1) ? 1 : 0;
237237
src/mame/video/malzak.c
r1355r1356
2828#define SAA5050_BLACK   0
2929#define SAA5050_WHITE   7
3030
31struct   {
31static struct
32{
3233   UINT16   saa5050_flags;
3334   UINT8   saa5050_forecol;
3435   UINT8   saa5050_backcol;
src/mame/video/midzeus.c
r1355r1356
5151
5252static poly_manager *poly;
5353
54static UINT32 zeuscmd_buffer[8];
54static UINT32 zeuscmd_buffer[20];
5555static UINT8 zeuscmd_buffer_words;
5656static UINT8 zeuscmd_buffer_expected_words;
5757static INT16 zeus_matrix[3][3];
r1355r1356
6262static UINT32 zeus_texdata;
6363static UINT32 zeus_objdata;
6464
65static UINT32 last_tex[1000][2];
66static int last_tex_index;
67
6865static UINT32 *waveram;
6966
67static UINT8 single_step;
68static poly_extra_data single_step_extra;
69static UINT32 single_step_val1;
70static UINT32 single_step_val2;
71static INT32 single_step_dx, single_step_dy;
72static UINT8 single_step_advance;
7073
7174
75
7276/*************************************
7377 *
7478 *  Function prototypes
r1355r1356
7781
7882static void exit_handler(running_machine *machine);
7983
84static void zeus_write_16bit(offs_t offset, UINT16 data, int logit);
85static void zeus_write_32bit(offs_t offset, UINT32 data, int logit);
86static void zeus_process_write(offs_t offset);
87static void zeuscmd_execute(int words);
88static UINT8 zeuscmd_length(UINT32 word);
8089
8190
91
8292/*************************************
8393 *
8494 *  Inlines
r1355r1356
249259            src += 2;
250260         }
251261      }
262
263      if (single_step)
264      {
265         int texwshift = ((single_step_val2 >> 6) + single_step_dx) & 7;
266         const UINT32 *texbase = &waveram[(single_step_val1 << ((7 + single_step_dy) - texwshift)) & 0x3fffff];
267         int texwidth = 512 >> texwshift;
268         int texdepth = (single_step_val2 & 0x20) ? 8 : 4;
269         int x, y;
270
271         for (y = 0; y < 256; y++)
272         {
273            UINT16 *dest = (UINT16 *)bitmap->base + y * bitmap->rowpixels + 400;
274            for (x = 0; x < 256; x++)
275            {
276               if (x < texwidth)
277                  dest[x] = single_step_extra.palbase[(texdepth == 8) ?
278                           get_texel_8bit(texbase, y, x, texwidth) :
279                           get_texel_4bit(texbase, y, x, texwidth)];
280               else
281                  dest[x] = 0;
282            }
283         }
284
285         popmessage("val1=%08X  val2=%08X\nwidth=%d  depth=%d", single_step_val1, single_step_val2, texwidth, texdepth);
286
287         if (input_code_pressed(KEYCODE_UP)) { single_step_dy--; while (input_code_pressed(KEYCODE_UP)) ; }
288         if (input_code_pressed(KEYCODE_DOWN)) { single_step_dy++; while (input_code_pressed(KEYCODE_DOWN)) ; }
289         if (input_code_pressed(KEYCODE_LEFT)) { single_step_dx--; while (input_code_pressed(KEYCODE_LEFT)) ; }
290         if (input_code_pressed(KEYCODE_RIGHT)) { single_step_dx++; while (input_code_pressed(KEYCODE_RIGHT)) ; }
291         if (input_code_pressed(KEYCODE_LSHIFT)) { single_step_advance = TRUE; while (input_code_pressed(KEYCODE_LSHIFT)) ; }
292      }
252293   }
253294
254295   /* waveram drawing case */
r1355r1356
278319      popmessage("offs = %06X", yoffs << 12);
279320   }
280321
281   if (input_code_pressed(KEYCODE_T) && last_tex_index != 0)
282   {
283      int i;
284      printf("----\n");
285      for (i = 0; i < last_tex_index; i++)
286         printf("%06X %03X (w=%d)\n", last_tex[i][0], last_tex[i][1], 512 >> ((last_tex[i][1] >> 6) & 7));
287      last_tex_index = 0;
288   }
289
290322   return 0;
291323}
292324
293325
294326
295/*
296327
297    New analysis:
298328
299    Offset
300    ------
301329
302    $58  W  Usually written after $5A; after writing, waits for $F6 bit 4 to be cleared
303
304    $5A  W  Usually written first, followed by $58
305
306    $68  W  Written at startup:
307            $00030000 = toggled on then off at startup
308
309    $76  W
310
311    $7C  W
312
313    $80  W  Master control
314
315            $40000000 = set along with $02000000 when enabling FIFO empty interrupt
316            $02000000 = enable internal data FIFO empty interrupt
317            $01000000 = cleared along with $02000000 when disabling FIFO empty interrupt
318            $00020000 = 16-bit (0) or 32-bit (1) mode
319            $00000008 = cleared just before writing to offsets $200-$3FF
320
321    $82  W
322    $84  W
323    $86  W
324    $88  W
325    $8A  W
326    $8C  W
327    $8E  W
328
329    $B0 R/W Data port for direct RAM access
330    $B2 R/W Data port for direct RAM access
331
332    $B4  W  Address for direct RAM access
333
334            $07FF0100 = mask for Y coordinate
335            $000000FF = mask for X coordinate
336
337    $B6  W  Direct RAM access control
338
339            $80000000 = enable writes to wave RAM 0
340            $40000000 = enable writes to wave RAM 1
341            $02000000 = perform access on write to B0(0) or B2(1) ?????
342            $00800000 = enable writes from [$B2] to depth buffer
343            $00400000 = enable writes from [$B0] to depth buffer
344            $00200000 = enable writes from [$B2] to RAM buffer
345            $00100000 = enable writes from [$B0] to RAM buffer
346            $00020000 = auto increment the address
347            $00010000 = perform a read when the address is written
348            $00000001 = enable direct RAM access
349
350            Examples:
351                $80A00000 when writing a single pixel (address written each time)
352                $80A20001 when writing the right pixel of a pair (autoinc assumed)
353                $80F60001 when writing the middle pairs of pixels (autoinc assumed)
354                $80520001 when writing the left pixel of a pair (autoinc assumed)
355                $82F00001 when testing wave RAM page 1 (address written each pair)
356                $42F00001 when testing wave RAM page 0 (address written each pair)
357                $82F60001 when uploading to wave RAM page 1 (autoinc assumed)
358                $42F60001 when uploading to wave RAM page 0 (autoinc assumed)
359
360    $C0  W  Written at startup = $801F2500
361    $C2  W  Written at startup = $0015E591
362    $C4  W  Written at startup = $000C0042 (HSYNC start/HSYNC end?)
363    $C6  W  Written at startup = $0211007F (HTOTAL/HBLANK end?)
364    $C8  W  Written at startup = $010300FF (VSYNC start/VBLANK start?)
365    $CA  W  Written at startup = $01160107 (VTOTAL/VSYNC end?)
366    $CC  W  Written at startup = $00000000
367    $CE  W  Written at startup = $00C87620
368
369    $E0  W  Internal data FIFO
370
371    $F2  R  Looped on until it returns a stable value; must change frequently; PRNG?
372
373    $F4  R  Status register
374
375            $00000800 = VBLANK? code waits for it to clear to 0 and then reset to 1
376            $00000140 = tested together in tight loop until both are 0
377            $00000008 = internal data FIFO full
378            $00000004 = tested in tight loop along with $00000002 until at least one is set
379            $00000002 = tested in tight loop after handling FIFO interrupt until set
380
381    $F6  R  Status register 2
382
383            $00000010 = tested in tight loop after writing 5A/59/58 until set to 0
384
385   $200- W  Unknown, but written in a loop with master control bit $00000008 cleared
386   $3FF     Possible fast buffer clear? One set of writes stores $7F7F to all entries.
387            A second set writes $E00,$25,$E01,$25,...,$E7F,$25. A third set writes
388            $52,$A0000000,...
389
390Notes:
391
392    In 16-bit mode, writes to $E0 are done via $E1 first then $E0
393
394-------------------------------------------------------
395
396Old info:
397
398    offset B7 = control....
399
400        8000 = page 1 enable
401        4000 = page 0 enable
402
403        0080 = 2nd pixel enable (maybe Z buff?)
404        0040 = 1st pixel enable (maybe Z buff?)
405        0020 = 2nd pixel enable
406        0010 = 1st pixel enable
407
408
409    writes 80a2 to write an odd pixel at startup
410    writes 80f6 to write the middle pixels
411    writes 8052 to write an odd pixel at the end
412
413    writes 8050 before writing an odd pixel
414    writes 80a0 before writing an even pixel
415
416    writes 44f1 before reading from page 0 of wave ram
417    writes 84f1 before reading from page 1 of wave ram
418
419    writes 42f0 before writing to page 0 of wave ram
420    writes 82f0 before writing to page 1 of wave ram
421
422*/
423
424330/*
425    zeus data notes:
426
427    Data from $1000-1A20
428    Palettes at $2000,$2200,$2400
429    Data from $2600-27C7
430    Palettes at $27C8,$29C8,$2BC8,$2DC8
431    Palettes up through $5A000
432
433    Interesting data at $5A000-5BFFF
434
435    Common sequence:
436        $8000 xxxx $0C01 $3805
437        x = matches address of next data * 8
438*/
439
440
441
442/*
443331    Control = $80F6 when doing initial screen clear.
444332       Writes 256 consecutive values to $B0, must mean autoincrement
445333       Uses latched value in $B2 (maybe also in $B0)
r1355r1356
473361
474362            $0000C040 = set palette to 'yyyyyyyy'
475363
364        $01rrxxxx = another type of register set?
365         yyyyyyyy
366
367            $01008000 = set object pointer (equivalent to word 2 of command $67)
368            $0100C0B0 = set texture data (equivalent to word 1 of command $67)
369            $0100C09C
370            $0100C0A3
371            $0100C0F0
372            $0100C040 = set palette base
373
476374        $17rrxxxx = 16-bit write 'xxxx' to register 'rr'
477375
478376            $1752xxxx = write 'xxxx' to something that reflects back through $B2
r1355r1356
480378            $1772xxxx = write 'xxxx' to upper 16 bits of Y coordinate
481379            $1774xxxx = write 'xxxx' to upper 16 bits of Z coordinate
482380
483        $18rr0000 = 32-bit write 'xxxxxxxx' to register 'rr'
381        $18rr0000 = 32-bit write 'xxxxxxxx' to register ('rr' & 0x7f)
484382         xxxxxxxx
485383
486384        $1A000000 = pipeline synchronize (guess)
r1355r1356
500398*/
501399
502400/*
401
402MK4:
403
503404Zeus cmd 18 : 18D60000 500A00FF
504405Zeus cmd 00 : 0005C0A5 21001125
505406Zeus cmd 25 : 25000000 007F0018 01000400 B0F60008
r1355r1356
602503                                               08000000 00000000
603504*/
604505
506/*
605507
508Note this sequence:
509Zeus cmd 17 : 1757500A
510Zeus cmd 17 : 175600FF
511Zeus cmd 17 : 176F0032
512Zeus cmd 17 : 176E0031
513Zeus cmd 17 : 176D003B
514Zeus cmd 17 : 176C002F
515
516Appears to do the same thing as:
517Zeus cmd 18 : 18D60000 500A00FF
518Zeus cmd 18 : 18EE0000 00320031
519Zeus cmd 18 : 18EC0000 003B002F
520
521
522
523Also this sequence:
524Zeus cmd 17 : 176940C4
525Zeus cmd 17 : 17681370
526
527Seems to have the same purpose as this part of the command stream:
528    19E80000 40C41370
529
530
531
532Invasion startup:
533
53400CC86:zeus16_w(81) = 0000 [00000000]
53500CC86:zeus16_w(80) = 0000 [00000000]
53600CC86:zeus16_w(4B) = 018F [018F0000]
53700CC86:zeus16_w(4A) = 01FE [018F01FE]
53800CC86:zeus16_w(49) = 018F [018F0000]
53900CC86:zeus16_w(48) = 01FE [018F01FE]
54000CC86:zeus16_w(CE) = 7620 [00007620]
54100CC86:zeus16_w(CD) = 0000 [00000000]
54200CC86:zeus16_w(CC) = 0000 [00000000]
54300CC86:zeus16_w(CB) = 0116 [01160000]
54400CC86:zeus16_w(CA) = 0107 [01160107]
54500CC86:zeus16_w(C9) = 0103 [01030000]
54600CC86:zeus16_w(C8) = 00FF [010300FF]
54700CC86:zeus16_w(C7) = 0211 [02110000]
54800CC86:zeus16_w(C6) = 007F [0211007F]
54900CC86:zeus16_w(C5) = 000C [000C0000]
55000CC86:zeus16_w(C4) = 004C [000C004C]
55100CC86:zeus16_w(C3) = 001F [001F0000]
55200CC86:zeus16_w(C2) = E591 [001FE591]
55300CC86:zeus16_w(C1) = 801F [801F0000]
55400CC86:zeus16_w(C0) = 2500 [801F2500]
55500CC86:zeus16_w(86) = 8003 [00008003]
55600CC86:zeus16_w(80) = 0C05 [00000C05]
55700CC86:zeus16_w(8F) = 0206 [02060000]
55800CC86:zeus16_w(8E) = 0000 [02060000]
55900CC86:zeus16_w(8D) = 0226 [02260000]
56000CC86:zeus16_w(8C) = 0000 [02260000]
56100CC86:zeus16_w(8B) = 0000 [00000000]
56200CC86:zeus16_w(8A) = FAFA [0000FAFA]
56300CC86:zeus16_w(89) = 0000 [00000000]
56400CC86:zeus16_w(88) = FAFA [0000FAFA]
56500CC86:zeus16_w(80) = 0001 [00000001]
56600CC86:zeus16_w(8F) = 0207 [02070000]
56700CC86:zeus16_w(8E) = BFFF [0207BFFF]
56800CC86:zeus16_w(8F) = 0206 [0206BFFF]
56900CC86:zeus16_w(8E) = 0000 [02060000]
57000CC86:zeus16_w(8D) = 0227 [02270000]
57100CC86:zeus16_w(8C) = BFFF [0227BFFF]
57200CC86:zeus16_w(8D) = 0226 [0226BFFF]
57300CC86:zeus16_w(8C) = 0000 [02260000]
57400CC86:zeus16_w(8F) = 0207 [02070000]
57500CC86:zeus16_w(8E) = F020 [0207F020]
57600CC86:zeus16_w(8F) = 0206 [0206F020]
57700CC86:zeus16_w(8E) = 0000 [02060000]
57800CC86:zeus16_w(8D) = 0227 [02270000]
57900CC86:zeus16_w(8C) = F020 [0227F020]
58000CC86:zeus16_w(8D) = 0226 [0226F020]
58100CC86:zeus16_w(8C) = 0000 [02260000]
58200CC86:zeus16_w(8F) = 0207 [02070000]
58300CC86:zeus16_w(8E) = DFFF [0207DFFF]
58400CC86:zeus16_w(8F) = 0206 [0206DFFF]
58500CC86:zeus16_w(8E) = 0000 [02060000]
58600CC86:zeus16_w(8D) = 0227 [02270000]
58700CC86:zeus16_w(8C) = DFFF [0227DFFF]
58800CC86:zeus16_w(8D) = 0226 [0226DFFF]
58900CC86:zeus16_w(8C) = 0000 [02260000]
59000CC86:zeus16_w(8F) = 0207 [02070000]
59100CC86:zeus16_w(8E) = DFFF [0207DFFF]
59200CC86:zeus16_w(8F) = 0206 [0206DFFF]
59300CC86:zeus16_w(8E) = 0000 [02060000]
59400CC86:zeus16_w(8D) = 0227 [02270000]
59500CC86:zeus16_w(8C) = DFFF [0227DFFF]
59600CC86:zeus16_w(8D) = 0226 [0226DFFF]
59700CC86:zeus16_w(8C) = 0000 [02260000]
59800CC86:zeus16_w(8F) = 0206 [02060000]
59900CC86:zeus16_w(8E) = 0000 [02060000]
60000CC86:zeus16_w(8D) = 0226 [02260000]
60100CC86:zeus16_w(8C) = 0000 [02260000]
60200CC86:zeus16_w(8B) = 0000 [0000FAFA]
60300CC86:zeus16_w(8A) = D254 [0000D254]
60400CC86:zeus16_w(89) = 8FFF [8FFFFAFA]
60500CC86:zeus16_w(88) = D794 [8FFFD794]
60600CC86:zeus16_w(85) = 0000 [00000000]
60700CC86:zeus16_w(84) = 0000 [00000000]
60800CC86:zeus16_w(83) = 1F1F [1F1F0000]
60900CC86:zeus16_w(82) = 2011 [1F1F2011]
61000CC86:zeus16_w(69) = 0003 [00030000]
61100CC86:zeus16_w(69) = 0000 [00000000]
61200CC86:zeus16_w(68) = 0100 [00000100]
61300CC92:zeus16_w(200) = 0100 [00000100]
61400CC92:zeus16_w(201) = 0000 [00000100]
61500CC92:zeus16_w(202) = 0000 [00000000]
61600CC92:zeus16_w(203) = 0000 [00000000]
61700CC92:zeus16_w(204) = 00D4 [000000D4]
61800CC92:zeus16_w(205) = 0000 [000000D4]
61900CC92:zeus16_w(206) = 0000 [00000000]
62000CC92:zeus16_w(207) = A000 [A0000000]
62100CC92:zeus16_w(208) = 0050 [00000050]
62200CC92:zeus16_w(209) = 0000 [00000050]
62300CC92:zeus16_w(20A) = 0000 [00000000]
62400CC92:zeus16_w(20B) = A000 [A0000000]
62500CC92:zeus16_w(20C) = 0703 [00000703]
62600CC92:zeus16_w(20D) = 0000 [00000703]
62700CC92:zeus16_w(20E) = 0000 [00000000]
62800CC92:zeus16_w(20F) = 0000 [00000000]
62900CC92:zeus16_w(210) = 0050 [00000050]
63000CC92:zeus16_w(211) = 0000 [00000050]
63100CC92:zeus16_w(212) = 0000 [00000000]
63200CC92:zeus16_w(213) = A000 [A0000000]
63300CC92:zeus16_w(214) = 005A [0000005A]
63400CC92:zeus16_w(215) = 01C0 [01C0005A]
63500CC92:zeus16_w(216) = 0000 [00000000]
63600CC92:zeus16_w(217) = B000 [B0000000]
63700CC92:zeus16_w(218) = 00D8 [000000D8]
63800CC92:zeus16_w(219) = 0000 [000000D8]
63900CC92:zeus16_w(21A) = 0000 [00000000]
64000CC92:zeus16_w(21B) = 9000 [90000000]
64100CC92:zeus16_w(21C) = 0607 [00000607]
64200CC92:zeus16_w(21D) = 0000 [00000607]
64300CC92:zeus16_w(21E) = 0000 [00000000]
64400CC92:zeus16_w(21F) = 0000 [00000000]
64500CC92:zeus16_w(220) = C000 [0000C000]
64600CC92:zeus16_w(221) = 0008 [0008C000]
64700CC92:zeus16_w(222) = 0000 [00000000]
64800CC92:zeus16_w(223) = 003F [003F0000]
64900CC92:zeus16_w(224) = 006A [0000006A]
65000CC92:zeus16_w(225) = 01D0 [01D0006A]
65100CC92:zeus16_w(226) = 0025 [00000025]
65200CC92:zeus16_w(227) = B000 [B0000025]
65300CC92:zeus16_w(228) = 0F00 [00000F00]
65400CC92:zeus16_w(229) = 0000 [00000F00]
65500CC92:zeus16_w(22A) = 0001 [00000001]
65600CC92:zeus16_w(22B) = 0000 [00000001]
65700CC92:zeus16_w(22C) = 0E08 [00000E08]
65800CC92:zeus16_w(22D) = 0000 [00000E08]
65900CC92:zeus16_w(22E) = 0000 [00000000]
66000CC92:zeus16_w(22F) = 0000 [00000000]
66100CC92:zeus16_w(230) = 00D4 [000000D4]
66200CC92:zeus16_w(231) = 0000 [000000D4]
66300CC92:zeus16_w(232) = 0000 [00000000]
66400CC92:zeus16_w(233) = A000 [A0000000]
66500CC92:zeus16_w(234) = 0050 [00000050]
66600CC92:zeus16_w(235) = 0000 [00000050]
66700CC92:zeus16_w(236) = 0000 [00000000]
66800CC92:zeus16_w(237) = A000 [A0000000]
66900CC92:zeus16_w(238) = 070E [0000070E]
67000CC92:zeus16_w(239) = 0000 [0000070E]
67100CC92:zeus16_w(23A) = 0000 [00000000]
67200CC92:zeus16_w(23B) = 0000 [00000000]
67300CC92:zeus16_w(23C) = 0050 [00000050]
67400CC92:zeus16_w(23D) = 0000 [00000050]
67500CC92:zeus16_w(23E) = 0000 [00000000]
67600CC92:zeus16_w(23F) = A000 [A0000000]
67700CC92:zeus16_w(240) = 005A [0000005A]
67800CC92:zeus16_w(241) = 01C0 [01C0005A]
67900CC92:zeus16_w(242) = 0000 [00000000]
68000CC92:zeus16_w(243) = B000 [B0000000]
68100CC92:zeus16_w(244) = 00D8 [000000D8]
68200CC92:zeus16_w(245) = 0000 [000000D8]
68300CC92:zeus16_w(246) = 0000 [00000000]
68400CC92:zeus16_w(247) = 8CC0 [8CC00000]
68500CC92:zeus16_w(248) = 0612 [00000612]
68600CC92:zeus16_w(249) = 0000 [00000612]
68700CC92:zeus16_w(24A) = 0000 [00000000]
68800CC92:zeus16_w(24B) = 0000 [00000000]
68900CC92:zeus16_w(24C) = D000 [0000D000]
69000CC92:zeus16_w(24D) = 0008 [0008D000]
69100CC92:zeus16_w(24E) = 8000 [00008000]
69200CC92:zeus16_w(24F) = 003E [003E8000]
69300CC92:zeus16_w(250) = 006A [0000006A]
69400CC92:zeus16_w(251) = 01D0 [01D0006A]
69500CC92:zeus16_w(252) = 0025 [00000025]
69600CC92:zeus16_w(253) = B000 [B0000025]
69700CC92:zeus16_w(254) = 0F00 [00000F00]
69800CC92:zeus16_w(255) = 0000 [00000F00]
69900CC92:zeus16_w(256) = 0001 [00000001]
70000CC92:zeus16_w(257) = 0000 [00000001]
70100CC92:zeus16_w(258) = 0E13 [00000E13]
70200CC92:zeus16_w(259) = 0000 [00000E13]
70300CC92:zeus16_w(25A) = 0000 [00000000]
70400CC92:zeus16_w(25B) = 0000 [00000000]
70500CC92:zeus16_w(25C) = 0F00 [00000F00]
70600CC92:zeus16_w(25D) = 05C0 [05C00F00]
70700CC92:zeus16_w(25E) = 0000 [00000000]
70800CC92:zeus16_w(25F) = B000 [B0000000]
70900CC92:zeus16_w(260) = 0F80 [00000F80]
71000CC92:zeus16_w(261) = 0400 [04000F80]
71100CC92:zeus16_w(262) = 0000 [00000000]
71200CC92:zeus16_w(263) = 9000 [90000000]
71300CC92:zeus16_w(264) = 0F80 [00000F80]
71400CC92:zeus16_w(265) = 0400 [04000F80]
71500CC92:zeus16_w(266) = 0000 [00000000]
71600CC92:zeus16_w(267) = 8CC0 [8CC00000]
71700CC92:zeus16_w(268) = 011A [0000011A]
71800CC92:zeus16_w(269) = 0000 [0000011A]
71900CC92:zeus16_w(26A) = 0000 [00000000]
72000CC92:zeus16_w(26B) = 0000 [00000000]
72100CC92:zeus16_w(26C) = 0F00 [00000F00]
72200CC92:zeus16_w(26D) = 0000 [00000F00]
72300CC92:zeus16_w(26E) = 0000 [00000000]
72400CC92:zeus16_w(26F) = 0000 [00000000]
72500CC92:zeus16_w(270) = A001 [0000A001]
72600CC92:zeus16_w(271) = 0003 [0003A001]
72700CC92:zeus16_w(272) = 0025 [00000025]
72800CC92:zeus16_w(273) = 0000 [00000025]
72900CC92:zeus16_w(274) = 0000 [00000000]
73000CC92:zeus16_w(275) = 40F3 [40F30000]
73100CC92:zeus16_w(276) = 0000 [00000000]
73200CC92:zeus16_w(277) = 0000 [00000000]
73300CC92:zeus16_w(278) = 4000 [00004000]
73400CC92:zeus16_w(279) = 0803 [08034000]
73500CC92:zeus16_w(27A) = 2000 [00002000]
73600CC92:zeus16_w(27B) = 0013 [00132000]
73700CC92:zeus16_w(27C) = 8000 [00008000]
73800CC92:zeus16_w(27D) = 0003 [00038000]
73900CC92:zeus16_w(27E) = 1000 [00001000]
74000CC92:zeus16_w(27F) = 003E [003E1000]
74100CC92:zeus16_w(280) = 20F0 [000020F0]
74200CC92:zeus16_w(281) = 0001 [000120F0]
74300CC92:zeus16_w(282) = 0000 [00000000]
74400CC92:zeus16_w(283) = 93C0 [93C00000]
74500CC92:zeus16_w(284) = 60F2 [000060F2]
74600CC92:zeus16_w(285) = 0001 [000160F2]
74700CC92:zeus16_w(286) = 0000 [00000000]
74800CC92:zeus16_w(287) = 9380 [93800000]
74900CC92:zeus16_w(288) = FFF4 [0000FFF4]
75000CC92:zeus16_w(289) = 0001 [0001FFF4]
75100CC92:zeus16_w(28A) = 0000 [00000000]
75200CC92:zeus16_w(28B) = 90C0 [90C00000]
75300CC92:zeus16_w(28C) = 0000 [00000000]
75400CC92:zeus16_w(28D) = 0000 [00000000]
75500CC92:zeus16_w(28E) = 0000 [00000000]
75600CC92:zeus16_w(28F) = 0000 [00000000]
75700CC92:zeus16_w(290) = 0000 [00000000]
75800CC92:zeus16_w(291) = 0000 [00000000]
75900CC92:zeus16_w(292) = 0000 [00000000]
76000CC92:zeus16_w(293) = 0000 [00000000]
76100CC92:zeus16_w(294) = 0000 [00000000]
76200CC92:zeus16_w(295) = 0000 [00000000]
76300CC92:zeus16_w(296) = 0000 [00000000]
76400CC92:zeus16_w(297) = 0000 [00000000]
76500CC92:zeus16_w(298) = 0000 [00000000]
76600CC92:zeus16_w(299) = 0000 [00000000]
76700CC92:zeus16_w(29A) = 0000 [00000000]
76800CC92:zeus16_w(29B) = 0000 [00000000]
76900CC92:zeus16_w(29C) = 0000 [00000000]
77000CC92:zeus16_w(29D) = 0000 [00000000]
77100CC92:zeus16_w(29E) = 0000 [00000000]
77200CC92:zeus16_w(29F) = 0000 [00000000]
77300CC92:zeus16_w(2A0) = 0000 [00000000]
77400CC92:zeus16_w(2A1) = 0000 [00000000]
77500CC92:zeus16_w(2A2) = 0000 [00000000]
77600CC92:zeus16_w(2A3) = 0000 [00000000]
77700CC92:zeus16_w(2A4) = 0000 [00000000]
77800CC92:zeus16_w(2A5) = 0000 [00000000]
77900CC92:zeus16_w(2A6) = 0000 [00000000]
78000CC92:zeus16_w(2A7) = 0000 [00000000]
78100CC92:zeus16_w(2A8) = 0000 [00000000]
78200CC92:zeus16_w(2A9) = 0000 [00000000]
78300CC92:zeus16_w(2AA) = 0000 [00000000]
78400CC92:zeus16_w(2AB) = 0000 [00000000]
78500CC92:zeus16_w(2AC) = 0000 [00000000]
78600CC92:zeus16_w(2AD) = 0000 [00000000]
78700CC92:zeus16_w(2AE) = 0000 [00000000]
78800CC92:zeus16_w(2AF) = 0000 [00000000]
78900CC92:zeus16_w(2B0) = 0000 [00000000]
79000CC92:zeus16_w(2B1) = 0000 [00000000]
79100CC92:zeus16_w(2B2) = 0000 [00000000]
79200CC92:zeus16_w(2B3) = 0000 [00000000]
79300CC92:zeus16_w(2B4) = 7F00 [00007F00]
79400CC92:zeus16_w(2B5) = 0001 [00017F00]
79500CC92:zeus16_w(2B6) = 0000 [00000000]
79600CC92:zeus16_w(2B7) = 03C0 [03C00000]
79700CC92:zeus16_w(2B8) = C000 [0000C000]
79800CC92:zeus16_w(2B9) = 0003 [0003C000]
79900CC92:zeus16_w(2BA) = 0000 [00000000]
80000CC92:zeus16_w(2BB) = 0000 [00000000]
80100CC92:zeus16_w(2BC) = EF00 [0000EF00]
80200CC92:zeus16_w(2BD) = 0001 [0001EF00]
80300CC92:zeus16_w(2BE) = 0000 [00000000]
80400CC92:zeus16_w(2BF) = 03C0 [03C00000]
80500CC92:zeus16_w(2C0) = 0007 [00000007]
80600CC86:zeus16_w(68) = 0008 [00000008]
80700CC86:zeus16_w(80) = 0C01 [00000C01]
80800CC86:zeus16_w(80) = 0C1D [00000C1D]
80900CC86:zeus16_w(69) = 0003 [00030008]
81000CC86:zeus16_w(69) = 0000 [00000008]
81100CC86:zeus16_w(80) = 0C01 [00000C01]
81200CC86:zeus16_w(80) = FC1D [0000FC1D]
81300CC86:zeus16_w(81) = 0022 [0022FC1D]
814Zeus cmd 1A : 1A000000
81500CFDC:zeus32_w(86) = 00008020
81600CFE0:zeus32_w(8E) = 0207F440
81700CFE1:zeus32_w(100) = 00000000
81800CFE5:zeus32_w(86) = 00008000
81900CFE7:zeus32_w(8E) = 02060000
82000D0FC:zeus32_w(CE) = 00C97020
82100D09A:zeus32_w(80) = 0022FC3F
82200D104:zeus32_w(CE) = 00C87020
82300D034:zeus32_w(84) = 00000100
82400D0C9:zeus32_w(68) = 00000100
82500D0CA:zeus32_w(00) = 0000C3F0
82600D0CC:zeus32_w(5C) = 00000000
82700D0CE:zeus32_w(06) = FFFF0030
82800D0D0:zeus32_w(02) = 000C0000
82900D0D2:zeus32_w(04) = 00000E01
83000D0D4:zeus32_w(4C) = 00808080
83100D0D5:zeus32_w(4E) = 00808080
83200D0D6:zeus32_w(08) = 00000000
83300D0D7:zeus32_w(0C) = 00FF018F
83400D0DD:zeus32_w(0A) = 0000018F
83500D0E3:zeus32_w(0E) = 00FF0000
83600D0E5:zeus32_w(1E) = FFFFFFFF
83700D0E6:zeus32_w(1C) = FFFFFFFF
83800D0E7:zeus32_w(1A) = FFFFFFFF
83900D0E8:zeus32_w(18) = FFFFFFFF
84000D0EA:zeus32_w(46) = 00000000
84100D0EB:zeus32_w(44) = 00000000
84200D0EC:zeus32_w(42) = 00000000
84300D0ED:zeus32_w(40) = 00000000
84400D0EE:zeus32_w(26) = 00000000
84500D0EF:zeus32_w(24) = 00000000
84600D0F0:zeus32_w(22) = 00000000
84700D0F1:zeus32_w(20) = 00000000
84800D09A:zeus32_w(80) = 0022FCFF
84900D0F6:zeus32_w(60) = 00000001
85000D09A:zeus32_w(80) = 0022FC3F
85100D01E:zeus32_w(76) = F8800000
85200D020:zeus32_w(CC) = 00000000
85300D034:zeus32_w(84) = 00000080
85400D0FC:zeus32_w(CE) = 00C97020
85500D09A:zeus32_w(80) = 0022FC3F
85600D104:zeus32_w(CE) = 00C87020
857Zeus cmd 1A : 1A000000
858Zeus cmd 18 : 187E0000 0000FFFF
859Zeus cmd 18 : 187C0000 FFFFFFE0
860Zeus cmd 18 : 187A0000 00800000
861Zeus cmd 18 : 18780000 000000C7
862Zeus cmd 18 : 18760000 F8800000
863Zeus cmd 17 : 176F0032
864Zeus cmd 17 : 176E0031
865Zeus cmd 17 : 176D003B
866Zeus cmd 17 : 176C002B
867Zeus cmd 18 : 184E0000 00808080
868Zeus cmd 18 : 184C0000 00808080
869Zeus cmd 18 : 184A0000 00FF018E
870Zeus cmd 18 : 18480000 00FF018E
871Zeus cmd 17 : 176940C4
872Zeus cmd 17 : 17681370
873Zeus cmd 17 : 1707FFFF
874Zeus cmd 17 : 17060030
875Zeus cmd 17 : 17010000
876Zeus cmd 2D : 2D007FFF
877Zeus cmd 2E : 2E000800 00000000
878Zeus cmd 17 : 1757500A
879Zeus cmd 17 : 175600FF
880Zeus cmd 17 : 17524321
881Zeus cmd 17 : 1752BCDE
882Zeus cmd 01 : 0100C0B0 3F001059
88300D09A:zeus32_w(80) = 0222FC3F
884....
885Zeus cmd 1A : 1A000000
886Zeus cmd 1A : 1A000000
887....
888Zeus cmd 1A : 1A000000
889Zeus cmd 1A : 1A000000
890....
891Zeus cmd 01 : 0100C0B0 3F001059
89200D09A:zeus32_w(80) = 0222FC3F
893....
894Zeus cmd 1A : 1A000000
895Zeus cmd 1A : 1A000000
896....
89700D09A:zeus32_w(80) = FB22FC3F
89800D01E:zeus32_w(76) = F8800000
89900D020:zeus32_w(CC) = 00800000
90000D034:zeus32_w(84) = 00000000
90100D0C9:zeus32_w(68) = 00000100
90200D0CA:zeus32_w(00) = 00000000
90300D0CC:zeus32_w(5C) = 00000000
90400D0CE:zeus32_w(06) = FFFF0030
90500D0D0:zeus32_w(02) = 000C0000
90600D0D2:zeus32_w(04) = 00000E01
90700D0D4:zeus32_w(4C) = 00808080
90800D0D5:zeus32_w(4E) = 00808080
90900D0D6:zeus32_w(08) = 00000000
91000D0D7:zeus32_w(0C) = 00FF018F
91100D0DD:zeus32_w(0A) = 0000018F
91200D0E3:zeus32_w(0E) = 00FF0000
91300D0E5:zeus32_w(1E) = FFFFFFFF
91400D0E6:zeus32_w(1C) = FFFFFFFF
91500D0E7:zeus32_w(1A) = FFFFFFFF
91600D0E8:zeus32_w(18) = FFFFFFFF
91700D0EA:zeus32_w(46) = 00000000
91800D0EB:zeus32_w(44) = 00000000
91900D0EC:zeus32_w(42) = 00000000
92000D0ED:zeus32_w(40) = 00000000
92100D0EE:zeus32_w(26) = 00000000
92200D0EF:zeus32_w(24) = 00000000
92300D0F0:zeus32_w(22) = 00000000
92400D0F1:zeus32_w(20) = 00000000
92500D09A:zeus32_w(80) = FB22FCFF
92600D0F6:zeus32_w(60) = 00000001
92700D09A:zeus32_w(80) = FB22FC3F
928Zeus cmd 17 : 1757500A
929Zeus cmd 17 : 175600FF
93000D09A:zeus32_w(80) = 0222FC3F
931
932
933*/
606934static void render_poly_4bit(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
607935{
608936   const poly_extra_data *extra = extradata;
r1355r1356
618946   int texwidth = extra->texwidth;
619947   int x;
620948
949if (extra->alpha < 0x80)
950   return;
951
621952   for (x = extent->startx; x < extent->stopx; x++)
622953   {
623954      float z = recip_approx(ooz);
r1355r1356
655986   int texwidth = extra->texwidth;
656987   int x;
657988
989if (extra->alpha < 0x80)
990   return;
991
658992   for (x = extent->startx; x < extent->stopx; x++)
659993   {
660994      float z = recip_approx(ooz);
r1355r1356
6771011}
6781012
6791013
680static void zeus_draw_polys(UINT32 addr_and_count, UINT32 texdata, int logcmd)
1014static void zeus_draw_model(UINT32 addr_and_count, UINT32 texdata, int logcmd)
6811015{
6821016   static UINT32 *loglist[1000];
6831017   static int loglist_last = 0;
r1355r1356
6941028   if (logcmd)
6951029   {
6961030      int texwshift = (val2 >> 6) & 7;
697      logerror("Zeus cmd 67 : %08X %08X %03X %06X (w=%d adj=%03X%03X)\n",
698         zeuscmd_buffer[0], addr_and_count, val2, val1,
1031      logerror(" -- model @ %08X val2=%03X val1=%06X (w=%d bpp=%d adj=%03X%03X)\n",
1032         addr_and_count, val2, val1,
6991033         512 >> texwshift,
1034         (val2 & 0x20) ? 8 : 4,
7001035         ((val1 << (7 - texwshift)) >> 10) & 0xfff,
7011036         ((val1 << (7 - texwshift)) >> 1) & 0x1ff
7021037         );
7031038   }
7041039
705   for (i = 0; i < last_tex_index; i++)
706      if (last_tex[i][0] == val1 && last_tex[i][1] == val2)
707         break;
708   if (i == last_tex_index)
709   {
710      last_tex[i][0] = val1;
711      last_tex[i][1] = val2;
712      last_tex_index++;
713   }
714
7151040   if (logcmd)
7161041   {
7171042      for (i = 0; i < loglist_last; i++)
r1355r1356
7901115               vert[i].y += 128.0f;
7911116            }
7921117
793            val1 <<= 7 - texwshift;
794
7951118            extra = poly_get_extra_data(poly);
7961119            extra->transcolor = 0x100;
797            extra->texbase = &waveram[val1 & 0x3fffff];
1120            extra->texbase = &waveram[(val1 << (7 - texwshift)) & 0x3fffff];
7981121            extra->texwidth = 512 >> texwshift;
7991122            extra->palbase = zeus_palbase;
8001123            extra->alpha = zeus_blend;
1124
1125            if (single_step)
1126            {
1127               single_step_extra = *extra;
1128               single_step_val1 = val1;
1129               single_step_val2 = val2;
1130               single_step_dx = single_step_dy = 0;
1131               single_step_advance = FALSE;
1132            }
1133
8011134            poly_render_quad(poly, NULL, &Machine->screen[0].visarea, callback, 3, &vert[0], &vert[1], &vert[2], &vert[3]);
1135            poly_wait(poly, "Normal");
8021136
803            poly_wait(poly, "Normal");
1137            if (single_step)
1138               while (!single_step_advance) video_frame_update(TRUE);
8041139         }
805         else if (data[datanum] == 0x0c018000)
1140         else if (data[datanum] == 0x0c018000/* mk4 */ || data[datanum] == 0x0c008000/* invasn */)
8061141            next_addr_and_count = data[datanum + 1];
8071142      }
8081143      if (datanum != count)
r1355r1356
8161151}
8171152
8181153
819static void zeuscmd_execute(void)
820{
821   static int colorcount;
822   int logcmd = input_code_pressed(KEYCODE_L);
823   int wordnum;
824
825   switch (zeuscmd_buffer[0] >> 24)
826   {
827      case 0x1c:
828         if (logcmd)
829            logerror("Zeus cmd 1C : ( %04X %04X %04X ) ( %04X %04X %04X ) ( %04X %04X %04X ) %8.2f %8.2f %8.5f\n",
830               zeuscmd_buffer[2] & 0xffff,
831               zeuscmd_buffer[2] >> 16,
832               zeuscmd_buffer[0] & 0xffff,
833               zeuscmd_buffer[3] & 0xffff,
834               zeuscmd_buffer[3] >> 16,
835               zeuscmd_buffer[1] >> 16,
836               zeuscmd_buffer[4] & 0xffff,
837               zeuscmd_buffer[4] >> 16,
838               zeuscmd_buffer[1] & 0xffff,
839               (float)(INT32)zeuscmd_buffer[5] * (1.0f / 65536.0f),
840               (float)(INT32)zeuscmd_buffer[6] * (1.0f / 65536.0f),
841               (float)(INT32)zeuscmd_buffer[7] * (1.0f / (65536.0f * 512.0f)));
842
843         zeus_matrix[0][0] = zeuscmd_buffer[2];
844         zeus_matrix[0][1] = zeuscmd_buffer[2] >> 16;
845         zeus_matrix[0][2] = zeuscmd_buffer[0];
846         zeus_matrix[1][0] = zeuscmd_buffer[3];
847         zeus_matrix[1][1] = zeuscmd_buffer[3] >> 16;
848         zeus_matrix[1][2] = zeuscmd_buffer[1] >> 16;
849         zeus_matrix[2][0] = zeuscmd_buffer[4];
850         zeus_matrix[2][1] = zeuscmd_buffer[4] >> 16;
851         zeus_matrix[2][2] = zeuscmd_buffer[1];
852         zeus_point[0] = zeuscmd_buffer[5];
853         zeus_point[1] = zeuscmd_buffer[6];
854         zeus_point[2] = zeuscmd_buffer[7];
855         break;
856
857      case 0x13:   /* invasn */
858         zeus_draw_polys(zeus_objdata, zeus_texdata, logcmd);
859         break;
860
861      case 0x67:
862         zeus_draw_polys(zeuscmd_buffer[1], zeuscmd_buffer[2], logcmd);
863         break;
864
865      case 0x01:   /* invasn */
866         if (logcmd)
867            logerror("Zeus cmd %02X : %08X %08X\n", zeuscmd_buffer[0] >> 24, zeuscmd_buffer[0], zeuscmd_buffer[1]);
868         if (zeuscmd_buffer[0] == 0x01008000)
869            zeus_objdata = zeuscmd_buffer[1];
870         else if (zeuscmd_buffer[0] == 0x0100c0b0)
871            zeus_texdata = zeuscmd_buffer[1];
872         else if (zeuscmd_buffer[0] == 0x0100C040)
873            zeus_palbase = waveram_ptr_from_addr(zeuscmd_buffer[1]);
874         break;
875
876      default:
877         if ((zeuscmd_buffer[0] >> 16) == 0x1752)
878         {
879            zeusbase[0xb2] = zeuscmd_buffer[0];
880//              zeus_enable_logging = 1;
881         }
882         if ((zeuscmd_buffer[0] >> 16) == 0x1770)
883            zeus_point[0] = zeuscmd_buffer[0] << 16;
884         if ((zeuscmd_buffer[0] >> 16) == 0x1772)
885            zeus_point[1] = zeuscmd_buffer[0] << 16;
886         if ((zeuscmd_buffer[0] >> 16) == 0x1774)
887            zeus_point[2] = zeuscmd_buffer[0] << 16;
888         if ((zeuscmd_buffer[0] >> 16) == 0x18ce)
889            zeus_blend = zeuscmd_buffer[1];
890
891         if (zeuscmd_buffer[0] == 0x0000c040)
892            zeus_palbase = waveram_ptr_from_addr(zeuscmd_buffer[1]);
893
894         if (zeuscmd_buffer[0] == 0x0080C0A5)
895         {
896            /* not right -- just a hack */
897            int x, y;
898            for (y = 0; y <= 255; y++)
899               for (x = 0; x <= 399; x++)
900                  waveram_plot_depth(y, x, 0, 0x7fff);
901            colorcount = 0;
902            last_tex_index = 0;
903         }
904
905         if (logcmd)
906         {
907            logerror("Zeus cmd %02X : %08X", zeuscmd_buffer[0] >> 24, zeuscmd_buffer[0]);
908            for (wordnum = 1; wordnum < zeuscmd_buffer_expected_words; wordnum++)
909               logerror(" %08X", zeuscmd_buffer[wordnum]);
910            logerror("\n");
911         }
912         break;
913   }
914}
915
916
917static UINT8 zeuscmd_length(UINT32 word)
918{
919   switch (word >> 24)
920   {
921      case 0x00:
922      case 0x01:
923         return (word == 0) ? 1 : 2;
924
925      case 0x13:
926      case 0x17:
927      case 0x1a:
928      case 0x2d:      /* invasn */
929      case 0x70:
930         return 1;
931
932      case 0x18:
933      case 0x23:
934      case 0x2e:      /* invasn */
935         return 2;
936
937      case 0x67:
938         return 3;
939
940      case 0x25:
941      case 0x30:      /* invasn */
942         return 4;   /* ??? */
943
944      case 0x1c:
945         return 8;
946
947      default:
948         printf("Unknown command %02X\n", zeusbase[0xe0] >> 24);
949         break;
950   }
951   return 1;
952}
953
954
9551154READ32_HANDLER( zeus_r )
9561155{
9571156   int logit = (offset < 0xb0 || offset > 0xb7);
r1355r1356
10261225{
10271226   int logit = zeus_enable_logging || ((offset < 0xb0 || offset > 0xb7) && (offset < 0xe0 || offset > 0xe1));
10281227
1228   if (logit)
1229      logerror("%06X:zeus_w", activecpu_get_pc());
1230
10291231   /* 32-bit mode */
10301232   if (zeusbase[0x80] & 0x00020000)
1031   {
1032      zeusbase[offset & ~1] = data;
1233      zeus_write_32bit(offset, data, logit);
10331234
1034      if (logit)
1035      {
1036         if (offset & 1)
1037            logerror("%06X:zeus32_w(%02X) = %08X -- unexpected in 32-bit mode\n", activecpu_get_pc(), offset, data);
1038         else if (offset != 0xe0)
1039            logerror("%06X:zeus32_w(%02X) = %08X\n", activecpu_get_pc(), offset, data);
1040         else
1041            logerror("%06X:zeus32_w(%02X) = %08X\n", activecpu_get_pc(), offset, data);
1042      }
1043   }
1044
10451235   /* 16-bit mode */
10461236   else
1237      zeus_write_16bit(offset, data, logit);
1238}
1239
1240
1241READ32_HANDLER( zeus2_r )
1242{
1243   return zeus_r(offset * 2, 0);
1244}
1245
1246
1247WRITE32_HANDLER( zeus2_w )
1248{
1249   zeus_w(offset * 2, data, mem_mask);
1250}
1251
1252
1253static void zeus_write_16bit(offs_t offset, UINT16 data, int logit)
1254{
1255   /* write to high part on odd addresses */
1256   if (offset & 1)
1257      zeusbase[offset & ~1] = (zeusbase[offset & ~1] & 0x0000ffff) | (data << 16);
1258
1259   /* write to low part on event addresses */
1260   else
1261      zeusbase[offset & ~1] = (zeusbase[offset & ~1] & 0xffff0000) | (data & 0xffff);
1262
1263   /* log appropriately */
1264   if (logit)
1265      logerror("(%02X) = %04X [%08X]\n", offset, data & 0xffff, zeusbase[offset & ~1]);
1266
1267   /* handle the update */
1268   if ((offset & 1) == 0)
1269      zeus_process_write(offset);
1270}
1271
1272
1273static void zeus_write_32bit(offs_t offset, UINT32 data, int logit)
1274{
1275   /* always write to low word? */
1276   zeusbase[offset & ~1] = data;
1277
1278   /* log appropriately */
1279   if (logit)
10471280   {
10481281      if (offset & 1)
1049         zeusbase[offset & ~1] = (zeusbase[offset & ~1] & 0x0000ffff) | (data << 16);
1282         logerror("(%02X) = %08X -- unexpected in 32-bit mode\n", offset, data);
1283      else if (offset != 0xe0)
1284         logerror("(%02X) = %08X\n", offset, data);
10501285      else
1051         zeusbase[offset & ~1] = (zeusbase[offset & ~1] & 0xffff0000) | (data & 0xffff);
1052
1053      if (logit)
1054         logerror("%06X:zeus16_w(%02X) = %04X [%08X]\n", activecpu_get_pc(), offset, data & 0xffff, zeusbase[offset & ~1]);
1286         logerror("(%02X) = %08X\n", offset, data);
10551287   }
10561288
1289   /* handle the update */
1290   if ((offset & 1) == 0)
1291      zeus_process_write(offset);
1292}
1293
1294
1295/*
1296
1297    New analysis:
1298
1299    Offset
1300    ------
1301
1302    $06  W  Low 16 bits = texture mode
1303
1304    $58  W  Usually written after $5A; after writing, waits for $F6 bit 4 to be cleared
1305
1306    $5A  W  Usually written first, followed by $58
1307
1308    $68  W  Written at startup:
1309            $00030000 = toggled on then off at startup
1310
1311    $76  W
1312
1313    $7C  W
1314
1315    $80  W  Master control
1316
1317            $40000000 = set along with $02000000 when enabling FIFO empty interrupt
1318            $02000000 = enable internal data FIFO empty interrupt
1319            $01000000 = cleared along with $02000000 when disabling FIFO empty interrupt
1320            $00020000 = 16-bit (0) or 32-bit (1) mode
1321            $00000080 = set just before writing direct command to $60
1322            $00000040 = set just before writing direct command to $60
1323            $00000008 = cleared just before writing to offsets $200-$3FF
1324
1325    $82  W
1326    $84  W
1327
1328            $00000080 = render page? (generally set when $CC is set to $000000 and clear when $CC is set to $800000)
1329
1330    $86  W
1331    $88  W
1332    $8A  W
1333    $8C  W
1334    $8E  W
1335
1336    $B0 R/W Data port for direct RAM access
1337    $B2 R/W Data port for direct RAM access
1338
1339    $B4  W  Address for direct RAM access
1340
1341            $07FF0100 = mask for Y coordinate
1342            $000000FF = mask for X coordinate
1343
1344    $B6  W  Direct RAM access control
1345
1346            $80000000 = enable writes to wave RAM 0
1347            $40000000 = enable writes to wave RAM 1
1348            $02000000 = perform access on write to B0(0) or B2(1) ?????
1349            $00800000 = enable writes from [$B2] to depth buffer
1350            $00400000 = enable writes from [$B0] to depth buffer
1351            $00200000 = enable writes from [$B2] to RAM buffer
1352            $00100000 = enable writes from [$B0] to RAM buffer
1353            $00020000 = auto increment the address
1354            $00010000 = perform a read when the address is written
1355            $00000001 = enable direct RAM access
1356
1357            Examples:
1358                $80A00000 when writing a single pixel (address written each time)
1359                $80A20001 when writing the right pixel of a pair (autoinc assumed)
1360                $80F60001 when writing the middle pairs of pixels (autoinc assumed)
1361                $80520001 when writing the left pixel of a pair (autoinc assumed)
1362                $82F00001 when testing wave RAM page 1 (address written each pair)
1363                $42F00001 when testing wave RAM page 0 (address written each pair)
1364                $82F60001 when uploading to wave RAM page 1 (autoinc assumed)
1365                $42F60001 when uploading to wave RAM page 0 (autoinc assumed)
1366
1367    $C0  W  Written at startup = $801F2500
1368    $C2  W  Written at startup = $0015E591
1369    $C4  W  Written at startup = $000C0042 (HSYNC start/HSYNC end?)
1370    $C6  W  Written at startup = $0211007F (HTOTAL/HBLANK end?)
1371    $C8  W  Written at startup = $010300FF (VSYNC start/VBLANK start?)
1372    $CA  W  Written at startup = $01160107 (VTOTAL/VSYNC end?)
1373    $CC  W  Written at startup = $00000000 (display start address? switches to $00800000)
1374    $CE  W  Written at startup = $00C87620
1375
1376    $E0  W  Internal data FIFO
1377
1378    $F2  R  Looped on until it returns a stable value; must change frequently; PRNG?
1379
1380    $F4  R  Status register
1381
1382            $00000800 = VBLANK? code waits for it to clear to 0 and then reset to 1
1383            $00000140 = tested together in tight loop until both are 0
1384            $00000008 = internal data FIFO full
1385            $00000004 = tested in tight loop along with $00000002 until at least one is set
1386            $00000002 = tested in tight loop after handling FIFO interrupt until set
1387
1388    $F6  R  Status register 2
1389
1390            $00000010 = tested in tight loop after writing 5A/59/58 until set to 0
1391
1392   $200- W  Unknown, but written in a loop with master control bit $00000008 cleared
1393   $3FF     Possible fast buffer clear? One set of writes stores $7F7F to all entries.
1394            A second set writes $E00,$25,$E01,$25,...,$E7F,$25. A third set writes
1395            $52,$A0000000,...
1396
1397Notes:
1398
1399    In 16-bit mode, writes to $E0 are done via $E1 first then $E0
1400
1401-------------------------------------------------------
1402
1403Old info:
1404
1405    offset B7 = control....
1406
1407        8000 = page 1 enable
1408        4000 = page 0 enable
1409
1410        0080 = 2nd pixel enable (maybe Z buff?)
1411        0040 = 1st pixel enable (maybe Z buff?)
1412        0020 = 2nd pixel enable
1413        0010 = 1st pixel enable
1414
1415
1416    writes 80a2 to write an odd pixel at startup
1417    writes 80f6 to write the middle pixels
1418    writes 8052 to write an odd pixel at the end
1419
1420    writes 8050 before writing an odd pixel
1421    writes 80a0 before writing an even pixel
1422
1423    writes 44f1 before reading from page 0 of wave ram
1424    writes 84f1 before reading from page 1 of wave ram
1425
1426    writes 42f0 before writing to page 0 of wave ram
1427    writes 82f0 before writing to page 1 of wave ram
1428
1429*/
1430
1431static void zeus_process_write(offs_t offset)
1432{
10571433   /* handle the writes; only trigger on low accesses */
10581434   switch (offset)
10591435   {
r1355r1356
10611437         /* invasn writes here to execute a command (?) */
10621438         if (zeusbase[0x60] & 1)
10631439         {
1064            if (zeusbase[0x80] == 0x0022FCFF)
1440            if ((zeusbase[0x80] & 0xffffff) == 0x22FCFF)
10651441            {
10661442               int startx, stopx, starty, stopy;
10671443               int x, y;
r1355r1356
10941470               for (y = starty; y <= stopy; y++)
10951471                  for (x = startx; x <= stopx; x++)
10961472                     waveram[(1 * WAVERAM_HEIGHT + (y % WAVERAM_HEIGHT)) * WAVERAM_WIDTH + x] = zeusbase[0x00];
1473   single_step = input_code_pressed(KEYCODE_S);
1474   if (single_step)
1475      popmessage("Single Step");
10971476            }
10981477            else
10991478               logerror("Execute unknown command\n");
r1355r1356
11311510         }
11321511         break;
11331512
1513      case 0x84:
1514         /* MK4: Written in tandem with 0xcc */
1515         /* MK4: Writes either 0x80 (and 0x000000 to 0xcc) or 0x00 (and 0x800000 to 0xcc) */
1516         break;
1517
1518      case 0xcc:
1519         /* see 0x84 above */
1520         break;
1521
1522      case 0x70:
1523         zeus_point[0] = zeusbase[0x70] << 16;
1524         break;
1525
1526      case 0x72:
1527         zeus_point[1] = zeusbase[0x72] << 16;
1528         break;
1529
1530      case 0x74:
1531         zeus_point[2] = zeusbase[0x74] << 16;
1532         break;
1533
1534      case 0x4e:
1535         zeus_blend = zeusbase[0x4e];
1536         break;
1537//          if ((zeuscmd_buffer[0] >> 16) == 0x1770)
1538//              zeus_point[0] = zeuscmd_buffer[0] << 16;
1539//          if ((zeuscmd_buffer[0] >> 16) == 0x1772)
1540//              zeus_point[1] = zeuscmd_buffer[0] << 16;
1541//          if ((zeuscmd_buffer[0] >> 16) == 0x1774)
1542//              zeus_point[2] = zeuscmd_buffer[0] << 16;
1543//          if ((zeuscmd_buffer[0] >> 16) == 0x18ce)
1544//              zeus_blend = zeuscmd_buffer[1];
1545
1546      case 0x52:
1547         zeusbase[0xb2] = zeusbase[0x52];
1548         break;
1549//          if ((zeuscmd_buffer[0] >> 16) == 0x1752)
1550//          {
1551//              zeusbase[0xb2] = zeuscmd_buffer[0];
1552//              zeus_enable_logging = 1;
1553//          }
1554
11341555      case 0xe0:
11351556         zeuscmd_buffer[zeuscmd_buffer_words++] = zeusbase[0xe0];
11361557         if (zeuscmd_buffer_words == 1)
11371558            zeuscmd_buffer_expected_words = zeuscmd_length(zeusbase[0xe0]);
11381559         if (zeuscmd_buffer_words == zeuscmd_buffer_expected_words)
11391560         {
1140            zeuscmd_execute();
1561            zeuscmd_execute(zeuscmd_buffer_expected_words);
11411562            zeuscmd_buffer_words = 0;
11421563         }
11431564         break;
r1355r1356
11451566}
11461567
11471568
1148READ32_HANDLER( zeus2_r )
1569static void log_waveram(UINT32 length_and_base)
11491570{
1150   return zeus_r(offset * 2, 0);
1571   static struct
1572   {
1573      UINT32 lab, checksum;
1574   } recent_entries[100];
1575
1576   UINT32 numoctets = (length_and_base >> 24) + 1;
1577   const UINT32 *ptr = waveram_ptr_from_addr(length_and_base);
1578   UINT32 checksum = length_and_base;
1579   int foundit = FALSE;
1580   int i;
1581
1582   for (i = 0; i < numoctets; i++)
1583      checksum += ptr[i * 2 + 0] + ptr[i * 2 + 1];
1584
1585   for (i = 0; i < ARRAY_LENGTH(recent_entries); i++)
1586      if (recent_entries[i].lab == length_and_base && recent_entries[i].checksum == checksum)
1587      {
1588         foundit = TRUE;
1589         break;
1590      }
1591
1592   if (i == ARRAY_LENGTH(recent_entries))
1593      i--;
1594   if (i != 0)
1595   {
1596      memmove(&recent_entries[1], &recent_entries[0], i * sizeof(recent_entries[0]));
1597      recent_entries[0].lab = length_and_base;
1598      recent_entries[0].checksum = checksum;
1599   }
1600   if (foundit)
1601      return;
1602
1603   for (i = 0; i < numoctets; i++)
1604      logerror("\t%02X: %08X %08X\n", i, ptr[i * 2 + 0], ptr[i * 2 + 1]);
11511605}
11521606
11531607
1154WRITE32_HANDLER( zeus2_w )
1608static void zeuscmd_execute(int words)
11551609{
1156   zeus_w(offset * 2, data, mem_mask);
1610   static int colorcount;
1611   int logcmd = 1;//input_code_pressed(KEYCODE_L);
1612   int wordnum;
1613
1614/* command observations:
1615
1616    0x18800000 | (reg << 16), <data>:
1617
1618        18F80000 00000C88 -- similar to write to $78 = 00000C78
1619        18FA0000 00808000 -- similar to write to $7A = 00800000
1620        18C80000 00FF018E -- similar to write to $48 = 00FF0190
1621        18CA0000 00FF18E0 -- similar to write to $4A = 00FF1900
1622
1623        -- during setup/text screen
1624        187E0000 0000FFFF FF980000
1625        18C80000 01FF01FF 00FF018E
1626        18CA0000 01FF1FF0 00FF18E0
1627        18CC0000 00808080
1628        18CE0000 00000080 00FFFFFF
1629        18D60000 500A00FF
1630        18EC0000 003B002F
1631        18EE0000 00320031
1632        18F80000 00000C88
1633        18FA0000 00808000
1634
1635        -- after text screen
1636        187E0000 0000FFFF FF980000
1637        18CE0000 0000007B(ramp down to 0) 00FFFFFF
1638        18D60000 500A00FF
1639
1640    0x17:
1641
1642        1707FFFF
1643        1752159D
1644        17680070 17681370
1645        176940C4
1646        1770xxxx - set x coordinate
1647        1772yyyy - set y coordinate
1648        1774zzzz - set z coordinate
1649
1650    0x00:
1651
1652        0004C09C 08001026
1653        0002C0E7 0800101C
1654        0003C0F0 00001025
1655        0080C0A5 3F00102F
1656        0005C0A5 21001125
1657        0000C040 0318E132 - set palette base
1658
1659    command 25:
1660
1661        25000000 007F0018 01000400 B0F60008 -- during diagnostics screen
1662        25000080 007F0018 01000400 B0F60008 -- alternate frames during text screen
1663
1664
1665    write to ($60) = 1 after setting up:
1666
1667
1668*/
1669
1670   if (logcmd)
1671   {
1672      logerror("Zeus cmd %02X :", zeuscmd_buffer[0] >> 24);
1673      for (wordnum = 0; wordnum < words; wordnum++)
1674         logerror(" %08X", zeuscmd_buffer[wordnum]);
1675   }
1676
1677   switch (zeuscmd_buffer[0] >> 24)
1678   {
1679      /* 0x00/0x01: set pointer */
1680      /* in model data, this is 0x0C */
1681      case 0x00:
1682      case 0x01:
1683         switch (zeuscmd_buffer[0] & 0xffffff)
1684         {
1685            case 0x008000:
1686            /* in model data, case 0x018000 is a goto */
1687               if (logcmd)
1688                  logerror(" -- setptr(objdata)\n");
1689               zeus_objdata = zeuscmd_buffer[1];
1690               break;
1691
1692            case 0x00c0b0:
1693               if (logcmd)
1694                  logerror(" -- setptr(texdata)\n");
1695               zeus_texdata = zeuscmd_buffer[1];
1696               break;
1697
1698            case 0x00c040:
1699               if (logcmd)
1700                  logerror(" -- setptr(palbase)\n");
1701               zeus_palbase = waveram_ptr_from_addr(zeuscmd_buffer[1]);
1702               break;
1703
1704            case 0x80c0a5:
1705               if (logcmd)
1706                  logerror(" -- setptr(hack clear screen)\n");
1707               {
1708                  /* not right -- just a hack */
1709                  int x, y;
1710                  for (y = 0; y <= 255; y++)
1711                     for (x = 0; x <= 399; x++)
1712                        waveram_plot_depth(y, x, 0, 0x7fff);
1713                  colorcount = 0;
1714               }
1715               break;
1716
1717            default:
1718               if (logcmd)
1719                  logerror(" -- setptr(%06X)\n", zeuscmd_buffer[0] & 0xffffff);
1720               break;
1721         }
1722
1723         if (logcmd)
1724            log_waveram(zeuscmd_buffer[1]);
1725         break;
1726
1727      /* 0x13: render model based on previously set information */
1728      case 0x13:   /* invasn */
1729         zeus_draw_model(zeus_objdata, zeus_texdata, logcmd);
1730         break;
1731
1732      /* 0x17: write 16-bit value to low registers */
1733      case 0x17:
1734         if (logcmd)
1735            logerror(" -- reg16");
1736         zeus_write_16bit((zeuscmd_buffer[0] >> 16) & 0x7f, zeuscmd_buffer[0], logcmd);
1737         break;
1738
1739      /* 0x18: write 32-bit value to low registers */
1740      /* in model data, this is 0x19 */
1741      case 0x18:
1742         if (logcmd)
1743            logerror(" -- reg32");
1744         zeus_write_32bit((zeuscmd_buffer[0] >> 16) & 0x7f, zeuscmd_buffer[1], logcmd);
1745         break;
1746
1747      /* 0x1A: sync pipeline(?) */
1748      case 0x1a:
1749         if (logcmd)
1750            logerror(" -- sync\n");
1751         break;
1752
1753      /* 0x1C: write matrix and translation vector */
1754      case 0x1c:
1755         if (logcmd)
1756            logerror(" -- matrix ( %04X %04X %04X ) ( %04X %04X %04X ) ( %04X %04X %04X ) vector %8.2f %8.2f %8.5f\n",
1757               zeuscmd_buffer[2] & 0xffff,
1758               zeuscmd_buffer[2] >> 16,
1759               zeuscmd_buffer[0] & 0xffff,
1760               zeuscmd_buffer[3] & 0xffff,
1761               zeuscmd_buffer[3] >> 16,
1762               zeuscmd_buffer[1] >> 16,
1763               zeuscmd_buffer[4] & 0xffff,
1764               zeuscmd_buffer[4] >> 16,
1765               zeuscmd_buffer[1] & 0xffff,
1766               (float)(INT32)zeuscmd_buffer[5] * (1.0f / 65536.0f),
1767               (float)(INT32)zeuscmd_buffer[6] * (1.0f / 65536.0f),
1768               (float)(INT32)zeuscmd_buffer[7] * (1.0f / (65536.0f * 512.0f)));
1769
1770         zeus_matrix[0][0] = zeuscmd_buffer[2];
1771         zeus_matrix[0][1] = zeuscmd_buffer[2] >> 16;
1772         zeus_matrix[0][2] = zeuscmd_buffer[0];
1773         zeus_matrix[1][0] = zeuscmd_buffer[3];
1774         zeus_matrix[1][1] = zeuscmd_buffer[3] >> 16;
1775         zeus_matrix[1][2] = zeuscmd_buffer[1] >> 16;
1776         zeus_matrix[2][0] = zeuscmd_buffer[4];
1777         zeus_matrix[2][1] = zeuscmd_buffer[4] >> 16;
1778         zeus_matrix[2][2] = zeuscmd_buffer[1];
1779         zeus_point[0] = zeuscmd_buffer[5];
1780         zeus_point[1] = zeuscmd_buffer[6];
1781         zeus_point[2] = zeuscmd_buffer[7];
1782         break;
1783
1784      /* 0x23: some additional X,Y,Z coordinates */
1785      case 0x23:
1786         if (logcmd)
1787            logerror(" -- additional xyz = %d,%d,%d\n", (INT16)zeuscmd_buffer[0], (INT16)(zeuscmd_buffer[1] >> 16), (INT16)zeuscmd_buffer[1]);
1788         break;
1789
1790      /* 0x25: display control? */
1791      /* 0x30: same for invasn */
1792      case 0x25:
1793      case 0x30:
1794         if (logcmd)
1795            logerror(" -- unknown control\n");
1796         break;
1797
1798      /* 0x67: render model with inline texture info */
1799      case 0x67:
1800         zeus_draw_model(zeuscmd_buffer[1], zeuscmd_buffer[2], logcmd);
1801         break;
1802
1803      default:
1804         if (logcmd)
1805            logerror("\n");
1806         break;
1807   }
11571808}
1809
1810
1811static UINT8 zeuscmd_length(UINT32 word)
1812{
1813   switch (word >> 24)
1814   {
1815      case 0x00:
1816      case 0x01:
1817         return (word == 0) ? 1 : 2;
1818
1819      case 0x13:
1820      case 0x17:
1821      case 0x1a:
1822      case 0x2d:      /* invasn */
1823      case 0x70:
1824         return 1;
1825
1826      case 0x18:
1827      case 0x23:
1828      case 0x2e:      /* invasn */
1829         return 2;
1830
1831      case 0x67:
1832         return 3;
1833
1834      case 0x25:
1835      case 0x30:      /* invasn */
1836         return 4;   /* ??? */
1837
1838      case 0x1c:
1839         if ((word & 0xffffff) == 0x7fff)   /* invasn */
1840            return 8+5;
1841         return 8;
1842
1843      default:
1844         printf("Unknown command %02X\n", zeusbase[0xe0] >> 24);
1845         break;
1846   }
1847   return 1;
1848}
1849
1850
src/mame/video/gticlub.c
r1355r1356
153153static const int decode_x_zr107[8] = {  0, 16, 1, 17, 2, 18, 3, 19 };
154154static const int decode_y_zr107[16] = {  0, 8, 32, 40, 4, 12, 36, 44, 64, 72, 96, 104, 68, 76, 100, 108 };
155155
156UINT32 K001005_status = 0;
156static UINT32 K001005_status = 0;
157157static mame_bitmap *K001005_bitmap[2];
158158static mame_bitmap *K001005_zbuffer;
159159static rectangle K001005_cliprect;
src/mame/video/dkong.c
r1355r1356
820820
821821   bg_bits = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
822822
823    scanline_timer = timer_alloc(scanline_callback);
823    scanline_timer = timer_alloc(scanline_callback, NULL);
824824    timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
825825
826826}
r1355r1356
837837
838838   bg_bits = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
839839
840    scanline_timer = timer_alloc(scanline_callback);
840    scanline_timer = timer_alloc(scanline_callback, NULL);
841841    timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
842842
843843}
src/mame/video/kaneko16.c
r1355r1356
3535#include "kaneko16.h"
3636#include "kan_pand.h"
3737
38UINT16 kaneko16_disp_enable = 1; // default enabled for games not using it
38static UINT16 kaneko16_disp_enable = 1; // default enabled for games not using it
3939
4040
4141static tilemap *kaneko16_tmap_0, *kaneko16_tmap_1;
r1355r1356
4949UINT16* galsnew_fg_pixram;
5050
5151int kaneko16_sprite_type;
52int kaneko16_keep_sprites = 0; // default disabled for games not using it
52static int kaneko16_keep_sprites = 0; // default disabled for games not using it
5353UINT16 kaneko16_sprite_xoffs, kaneko16_sprite_flipx;
5454UINT16 kaneko16_sprite_yoffs, kaneko16_sprite_flipy;
5555UINT16 *kaneko16_sprites_regs;
src/mame/video/atarimo.c
r1355r1356
444444   init_gfxelement(machine, mo, desc->gfxindex);
445445
446446   /* start a timer to update a few times during refresh */
447   force_update_timer = timer_alloc(force_update);
447   force_update_timer = timer_alloc(force_update, NULL);
448448   timer_adjust(force_update_timer,video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
449449
450450   init_savestate(map, mo);
src/mame/video/tank8.c
r1355r1356
267267            }
268268         }
269269
270         timer_set(video_screen_get_time_until_pos(0, y, x), index, tank8_collision_callback);
270         timer_set(video_screen_get_time_until_pos(0, y, x), NULL, index, tank8_collision_callback);
271271
272272         state = 1;
273273      }
src/mame/video/cps1.c
r1355r1356
230230   int kludge;  /* Ghouls n Ghosts sprite kludge */
231231};
232232
233struct CPS1config *cps1_game_config;
233static struct CPS1config *cps1_game_config;
234234
235235/*                 CPSB ID    multiply protection  ctrl     priority masks   unknwn     layer enable masks  */
236236#define CPS_B_01 0x00,0x0000, 0,0,0,0, /* n/a */   0x66,{0x68,0x6a,0x6c,0x6e},0x70, {0x02,0x04,0x08,0x30,0x30}
r1355r1356
601601static int palette_basecolor[6];
602602#define cps1_palette_entries (32*8)  /* Number colour schemes in palette */
603603
604const int cps1_scroll_size =0x4000;   /* scroll1, scroll2, scroll3 */
605const int cps1_obj_size    =0x0800;
606const int cps1_other_size  =0x0800;
607const int cps1_palette_align=0x0800;   /* can't be larger than this, breaks ringdest & batcirc otherwise */
608const int cps1_palette_size=cps1_palette_entries*32; /* Size of palette RAM */
604static const int cps1_scroll_size =0x4000;   /* scroll1, scroll2, scroll3 */
605static const int cps1_obj_size    =0x0800;
606static const int cps1_other_size  =0x0800;
607static const int cps1_palette_align=0x0800;   /* can't be larger than this, breaks ringdest & batcirc otherwise */
608static const int cps1_palette_size=cps1_palette_entries*32; /* Size of palette RAM */
609609
610610static UINT16 *cps1_scroll1;
611611static UINT16 *cps1_scroll2;
r1355r1356
661661static const int stars_rom_size = 0x2000;
662662
663663/* PSL: CPS2 support */
664const int cps2_obj_size    =0x2000;
664static const int cps2_obj_size    =0x2000;
665665UINT16 *cps2_objram1,*cps2_objram2;
666666UINT16 *cps2_output;
667667
src/mame/video/starcrus.c
r1355r1356
3939   audio bits are in the same bytes, and there are so few
4040   samples... */
4141
42int starcrus_engine_sound_playing = 0;
43int starcrus_explode_sound_playing = 0;
44int starcrus_launch1_sound_playing = 0;
45int starcrus_launch2_sound_playing = 0;
42static int starcrus_engine_sound_playing = 0;
43static int starcrus_explode_sound_playing = 0;
44static int starcrus_launch1_sound_playing = 0;
45static int starcrus_launch2_sound_playing = 0;
4646
4747WRITE8_HANDLER( starcrus_s1_x_w ) { s1_x = data^0xff; }
4848WRITE8_HANDLER( starcrus_s1_y_w ) { s1_y = data^0xff; }
src/mame/video/lethalj.c
r1355r1356
161161   if (offset == 7)
162162   {
163163      do_blit();
164      timer_set(ATTOTIME_IN_USEC(10), 0, gen_ext1_int);
164      timer_set(ATTOTIME_IN_USEC(10), NULL, 0, gen_ext1_int);
165165   }
166166
167167   /* clear the IRQ on offset 0 */
src/mame/video/itech8.c
r1355r1356
517517      blit_in_progress = 1;
518518
519519      /* set a timer to go off when we're done */
520      timer_set(attotime_mul(ATTOTIME_IN_HZ(12000000/4), BLITTER_WIDTH * BLITTER_HEIGHT + 12), 0, blitter_done);
520      timer_set(attotime_mul(ATTOTIME_IN_HZ(12000000/4), BLITTER_WIDTH * BLITTER_HEIGHT + 12), NULL, 0, blitter_done);
521521   }
522522
523523   /* debugging */
src/mame/video/galaxian.c
r1355r1356
17311731
17321732   galaxian_stars_on = 0;
17331733   stars_blink_state = 0;
1734   stars_blink_timer = timer_alloc(stars_blink_callback);
1735   stars_scroll_timer = timer_alloc(stars_scroll_callback);
1734   stars_blink_timer = timer_alloc(stars_blink_callback, NULL);
1735   stars_scroll_timer = timer_alloc(stars_scroll_callback, NULL);
17361736   timer_adjusted = 0;
17371737   stars_colors_start = colors_offset;
17381738
src/mame/video/leland.c
r1355r1356
364364{
365365   if (sync_next_write)
366366   {
367      timer_call_after_resynch(0x00000 | (offset << 8) | data, leland_delayed_mvram_w);
367      timer_call_after_resynch(NULL, 0x00000 | (offset << 8) | data, leland_delayed_mvram_w);
368368      sync_next_write = 0;
369369   }
370370   else
r1355r1356
415415   offset = ((offset >> 1) & 0x07) | ((offset << 3) & 0x08) | (offset & 0x10);
416416   if (sync_next_write)
417417   {
418      timer_call_after_resynch(0x00000 | (offset << 8) | data, leland_delayed_mvram_w);
418      timer_call_after_resynch(NULL, 0x00000 | (offset << 8) | data, leland_delayed_mvram_w);
419419      sync_next_write = 0;
420420   }
421421   else
r1355r1356
474474   update_for_scanline(VIDEO_HEIGHT * 8);
475475
476476   /* set a timer to go off at the top of the frame */
477   timer_set(video_screen_get_time_until_pos(0, 0, 0), 0, scanline_reset);
477   timer_set(video_screen_get_time_until_pos(0, 0, 0), NULL, 0, scanline_reset);
478478}
479479
480480
src/mame/video/segag80r.c
r1355r1356
5353   /* set a timer to mimic the 555 timer that drives the EDGINT signal */
5454   /* the 555 is run in monostable mode with R=56000 and C=1000pF */
5555   vblank_latch = 1;
56   timer_set(PERIOD_OF_555_MONOSTABLE(CAP_P(1000), RES_K(56)), 0, vblank_latch_clear);
56   timer_set(PERIOD_OF_555_MONOSTABLE(CAP_P(1000), RES_K(56)), NULL, 0, vblank_latch_clear);
5757
5858   /* latch the current flip state at the same time */
5959   video_flip = video_control & 1;
src/mame/video/segaic16.c
r1355r1356
11781178   }
11791179
11801180   /* set a timer to do this again next frame */
1181   timer_set(video_screen_get_time_until_pos(0, 261, 0), param, segaic16_tilemap_16b_latch_values);
1181   timer_set(video_screen_get_time_until_pos(0, 261, 0), NULL, param, segaic16_tilemap_16b_latch_values);
11821182}
11831183
11841184
11851185static void segaic16_tilemap_16b_reset(struct tilemap_info *info)
11861186{
11871187   /* set a timer to latch values on scanline 261 */
1188   timer_set(video_screen_get_time_until_pos(0, 261, 0), info->index, segaic16_tilemap_16b_latch_values);
1188   timer_set(video_screen_get_time_until_pos(0, 261, 0), NULL, info->index, segaic16_tilemap_16b_latch_values);
11891189}
11901190
11911191
src/mame/video/cchasm.c
r1355r1356
100100      }
101101   }
102102    /* Refresh processor runs with 6 MHz */
103    timer_set (attotime_mul(ATTOTIME_IN_HZ(6000000), total_length), 0, cchasm_refresh_end);
103    timer_set (attotime_mul(ATTOTIME_IN_HZ(6000000), total_length), NULL, 0, cchasm_refresh_end);
104104}
105105
106106
src/mame/video/qix.c
r1355r1356
8484   vram_mask = 0xff;
8585
8686   /* allocate a timer */
87   scanline_timer = timer_alloc(scanline_callback);
87   scanline_timer = timer_alloc(scanline_callback, NULL);
8888   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 1, 0), 1, attotime_zero);
8989
9090   /* set up save states */
src/mame/video/atarirle.c
r1355r1356
118118//UINT16 *atarirle_0_table;
119119//UINT32 *atarirle_0_table32;
120120
121int atarirle_hilite_index = -1;
121static int atarirle_hilite_index = -1;
122122
123123
124124
src/mame/video/pastelg.c
r1355r1356
253253   }
254254
255255   nb1413m3_busyflag = 0;
256   timer_set(attotime_mul(ATTOTIME_IN_HZ(400000), nb1413m3_busyctr), 0, blitter_timer_callback);
256   timer_set(attotime_mul(ATTOTIME_IN_HZ(400000), nb1413m3_busyctr), NULL, 0, blitter_timer_callback);
257257}
258258
259259/******************************************************************************
src/mame/video/centiped.c
r1355r1356
368368}
369369
370370
371WRITE8_HANDLER( mazeinv_paletteram_w )
372{
373   int bit0,bit1,bit2;
374   int r,g,b;
371375
376   paletteram[offset] = data;
377   data = memory_region(REGION_PROMS)[~data & 0x0f];
378
379   /* red component */
380   bit0 = (data >> 5) & 0x01;
381   bit1 = (data >> 6) & 0x01;
382   bit2 = (data >> 7) & 0x01;
383   r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
384
385   /* green component */
386   bit0 = 0;
387   bit1 = (data >> 3) & 0x01;
388   bit2 = (data >> 4) & 0x01;
389   g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
390
391   /* blue component */
392   bit0 = (data >> 0) & 0x01;
393   bit1 = (data >> 1) & 0x01;
394   bit2 = (data >> 2) & 0x01;
395   b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
396
397   palette_set_color(Machine, offset, MAKE_RGB(r, g, b));
398}
399
400
401
372402/*************************************
373403 *
374404 *  Video update
src/mame/video/atarisy1.c
r1355r1356
201201   /* reset the statics */
202202   atarimo_set_yscroll(0, 256);
203203   next_timer_scanline = -1;
204   scanline_timer = timer_alloc(int3_callback);
205   int3off_timer = timer_alloc(int3off_callback);
206   yscroll_reset_timer = timer_alloc(reset_yscroll_callback);
204   scanline_timer = timer_alloc(int3_callback, NULL);
205   int3off_timer = timer_alloc(int3off_callback, NULL);
206   yscroll_reset_timer = timer_alloc(reset_yscroll_callback, NULL);
207207}
208208
209209
src/mame/video/sprint8.c
r1355r1356
150150      {
151151         if (p1[x] != 16 && p2[x] != 16)
152152         {
153            timer_set(video_screen_get_time_until_pos(0, y + 24, x), p1[x], sprint8_collision_callback);
153            timer_set(video_screen_get_time_until_pos(0, y + 24, x), NULL, p1[x], sprint8_collision_callback);
154154         }
155155      }
156156   }
src/mame/video/tceptor.c
r1355r1356
3333
3434static mame_bitmap *temp_bitmap;
3535
36static UINT16 *tceptor_sprite_ram_buffered;
37
3638static int is_mask_spr[1024/16];
3739
3840/*******************************************************************/
r1355r1356
7375   /* color_prom now points to the beginning of the lookup table */
7476
7577   /*
76      color lookup table:
77        0-    +1024 ( 4 * 256) colors: text   (use 0-   256 colors)
78        1024- +1024 (16 *  64) colors: sprite (use 768- 256 colors)
79        2048-  +512 ( 8 *  64) colors: bg     (use 0-   512 colors)
80        3840-  +256 ( 4 *  64) colors: road   (use 512- 256 colors)
81    */
78          color lookup table:
79            0-    +1024 ( 4 * 256) colors: text   (use 0-   256 colors)
80            1024- +1024 (16 *  64) colors: sprite (use 768- 256 colors)
81            2048-  +512 ( 8 *  64) colors: bg     (use 0-   512 colors)
82            3840-  +256 ( 4 *  64) colors: road   (use 512- 256 colors)
83        */
8284
8385   /* tiles lookup table (1024 colors) */
8486   for (i = 0; i < 1024;i++)
r1355r1356
419421{
420422   int gfx_index;
421423
424   tceptor_sprite_ram_buffered = auto_malloc(0x200);
425   memset(tceptor_sprite_ram_buffered, 0, 0x200);
426
422427   /* find first empty slot to decode gfx */
423428   for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++)
424429      if (machine->gfx[gfx_index] == 0)
r1355r1356
450455   bg1_tilemap = tilemap_create(get_bg1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
451456   bg2_tilemap = tilemap_create(get_bg2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
452457
458   state_save_register_global_pointer(tceptor_sprite_ram_buffered, 0x200 / 2);
453459   state_save_register_global(bg1_scroll_x);
454460   state_save_register_global(bg1_scroll_y);
455461   state_save_register_global(bg2_scroll_x);
r1355r1356
484490
485491static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int sprite_priority)
486492{
487   UINT16 *mem1 = &tceptor_sprite_ram[0x000/2];
488   UINT16 *mem2 = &tceptor_sprite_ram[0x100/2];
493   UINT16 *mem1 = &tceptor_sprite_ram_buffered[0x000/2];
494   UINT16 *mem2 = &tceptor_sprite_ram_buffered[0x100/2];
489495   int need_mask = 0;
490496   int i;
491497
r1355r1356
571577   int pri;
572578   int bg_center = 144 - ((((bg1_scroll_x + bg2_scroll_x ) & 0x1ff) - 288) / 2);
573579
580   if (screen)
581   {
582      int frame = cpu_getcurrentframe();
583
584      if ((frame & 1) == 1 && screen == 1)
585         return UPDATE_HAS_NOT_CHANGED;
586      if ((frame & 1) == 0 && screen == 2)
587         return UPDATE_HAS_NOT_CHANGED;
588   }
589
574590   // left background
575591   rect = *cliprect;
576592   rect.max_x = bg_center;
r1355r1356
595611   tilemap_draw(bitmap, cliprect, tx_tilemap, 0, 0);
596612   return 0;
597613}
614
615
616VIDEO_EOF( tceptor )
617{
618   memcpy(tceptor_sprite_ram_buffered, tceptor_sprite_ram, 0x200);
619}
src/mame/video/midvunit.c
r1355r1356
7070
7171VIDEO_START( midvunit )
7272{
73   scanline_timer = timer_alloc(scanline_timer_cb);
73   scanline_timer = timer_alloc(scanline_timer_cb, NULL);
7474   poly = poly_alloc(4000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS);
7575   add_exit_callback(machine, midvunit_exit);
7676}
src/mame/video/atarisy2.c
r1355r1356
133133   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
134134
135135   /* reset the statics */
136   yscroll_reset_timer = timer_alloc(reset_yscroll_callback);
136   yscroll_reset_timer = timer_alloc(reset_yscroll_callback, NULL);
137137   videobank = 0;
138138}
139139
src/mame/video/jaguar.c
r1355r1356
734734
735735   pen_table = auto_malloc(65536 * sizeof(pen_t));
736736
737   vi_timer = timer_alloc(vi_callback);
737   vi_timer = timer_alloc(vi_callback, NULL);
738738
739739   state_save_register_global_pointer(pen_table, 65536);
740740   state_save_register_global_array(blitter_regs);
src/mame/video/n8080.c
r1355r1356
106106
107107VIDEO_START( spacefev )
108108{
109   cannon_timer = timer_alloc(spacefev_stop_red_cannon);
109   cannon_timer = timer_alloc(spacefev_stop_red_cannon, NULL);
110110
111111   flip_screen = 0;
112112
src/mame/video/nbmj8891.c
r1355r1356
479479   }
480480
481481   nb1413m3_busyflag = 0;
482   timer_set(attotime_mul(ATTOTIME_IN_HZ(400000), nb1413m3_busyctr), 0, blitter_timer_callback);
482   timer_set(attotime_mul(ATTOTIME_IN_HZ(400000), nb1413m3_busyctr), NULL, 0, blitter_timer_callback);
483483}
484484
485485/******************************************************************************
src/mame/video/vball.c
r1355r1356
1717UINT8 *vb_videoram;
1818UINT8 *vb_attribram;
1919int vball_gfxset=0;
20int vb_bgprombank=0xff;
21int vb_spprombank=0xff;
20static int vb_bgprombank=0xff;
21static int vb_spprombank=0xff;
2222
2323static tilemap *bg_tilemap;
2424static int scrollx[32];
src/mame/video/astrocde.c
r1355r1356
224224VIDEO_START( astrocde )
225225{
226226   /* allocate a per-scanline timer */
227   scanline_timer = timer_alloc(scanline_callback);
227   scanline_timer = timer_alloc(scanline_callback, NULL);
228228   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 1, 0), 1, attotime_zero);
229229
230230   /* register for save states */
r1355r1356
239239VIDEO_START( profpac )
240240{
241241   /* allocate a per-scanline timer */
242   scanline_timer = timer_alloc(scanline_callback);
242   scanline_timer = timer_alloc(scanline_callback, NULL);
243243   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 1, 0), 1, attotime_zero);
244244
245245   /* allocate videoram */
r1355r1356
444444      else
445445      {
446446         cpunum_set_input_line_and_vector(0, 0, ASSERT_LINE, interrupt_vector & 0xf0);
447         timer_set(ATTOTIME_IN_CYCLES(1, 0), 0, interrupt_off);
447         timer_set(ATTOTIME_IN_CYCLES(1, 0), NULL, 0, interrupt_off);
448448      }
449449
450450      /* latch the feedback registers */
r1355r1356
480480      else
481481      {
482482         cpunum_set_input_line_and_vector(0, 0, ASSERT_LINE, interrupt_vector);
483         timer_set(ATTOTIME_IN_CYCLES(1, 0), 0, interrupt_off);
483         timer_set(ATTOTIME_IN_CYCLES(1, 0), NULL, 0, interrupt_off);
484484      }
485485   }
486486
src/mame/video/nbmj8688.c
r1355r1356
542542   nb1413m3_busyflag = 0;
543543
544544   if (gfxtype == GFXTYPE_8BIT)
545      timer_set(attotime_mul(ATTOTIME_IN_HZ(400000), nb1413m3_busyctr), 0, blitter_timer_callback);
545      timer_set(attotime_mul(ATTOTIME_IN_HZ(400000), nb1413m3_busyctr), NULL, 0, blitter_timer_callback);
546546   else
547      timer_set(attotime_mul(ATTOTIME_IN_HZ(400000), nb1413m3_busyctr), 0, blitter_timer_callback);
547      timer_set(attotime_mul(ATTOTIME_IN_HZ(400000), nb1413m3_busyctr), NULL, 0, blitter_timer_callback);
548548}
549549
550550
src/mame/video/slapshot.c
r1355r1356
2121static int sprites_flipscreen = 0;
2222static UINT16 *spriteram_buffered,*spriteram_delayed;
2323
24INT32 taito_sprite_type = 0;
24static INT32 taito_sprite_type = 0;
2525UINT16 *taito_sprite_ext;
2626size_t taito_spriteext_size;
2727static UINT16 spritebank[8];
src/mame/video/victory.c
r1355r1356
9797   update_complete = 0;
9898   video_control = 0;
9999   memset(&micro, 0, sizeof(micro));
100   micro.timer = timer_alloc(NULL);
100   micro.timer = timer_alloc(NULL, NULL);
101101}
102102
103103
r1355r1356
11801180         int fpix = *fg++;
11811181         int bpix = bg[(x + scrollx) & 255];
11821182         if (fpix && (bpix & bgcollmask) && count++ < 128)
1183            timer_set(video_screen_get_time_until_pos(0, y, x), x | (y << 8), bgcoll_irq_callback);
1183            timer_set(video_screen_get_time_until_pos(0, y, x), NULL, x | (y << 8), bgcoll_irq_callback);
11841184      }
11851185   }
11861186}
r1355r1356
12181218         int bpix = bg[(x + scrollx) & 255];
12191219         scanline[x] = bpix | (fpix << 3);
12201220         if (fpix && (bpix & bgcollmask) && count++ < 128)
1221            timer_set(video_screen_get_time_until_pos(0, y, x), x | (y << 8), bgcoll_irq_callback);
1221            timer_set(video_screen_get_time_until_pos(0, y, x), NULL, x | (y << 8), bgcoll_irq_callback);
12221222      }
12231223
12241224      /* draw the scanline */
src/mame/video/avgdvg.c
r1355r1356
12861286
12871287   flip_x = flip_y = 0;
12881288
1289   vg_halt_timer = timer_alloc(vg_set_halt_callback);
1290   vg_run_timer = timer_alloc(run_state_machine);
1289   vg_halt_timer = timer_alloc(vg_set_halt_callback, NULL);
1290   vg_run_timer = timer_alloc(run_state_machine, NULL);
12911291
12921292   /*
12931293     * The x and y DACs use 10 bit of the counter values which are in
src/mame/video/nbmj8991.c
r1355r1356
287287   }
288288
289289   nb1413m3_busyflag = 0;
290   timer_set(attotime_mul(ATTOTIME_IN_NSEC(1650), nb1413m3_busyctr), 0, blitter_timer_callback);
290   timer_set(attotime_mul(ATTOTIME_IN_NSEC(1650), nb1413m3_busyctr), NULL, 0, blitter_timer_callback);
291291}
292292
293293/******************************************************************************
src/mame/video/exidy440.c
r1355r1356
354354
355355                  /* check the collisions bit */
356356                  if ((palette[2 * pen] & 0x80) && count++ < 128)
357                     timer_set(video_screen_get_time_until_pos(0, yoffs, currx), currx, collide_firq_callback);
357                     timer_set(video_screen_get_time_until_pos(0, yoffs, currx), NULL, currx, collide_firq_callback);
358358               }
359359               currx++;
360360
r1355r1356
367367
368368                  /* check the collisions bit */
369369                  if ((palette[2 * pen] & 0x80) && count++ < 128)
370                     timer_set(video_screen_get_time_until_pos(0, yoffs, currx), currx, collide_firq_callback);
370                     timer_set(video_screen_get_time_until_pos(0, yoffs, currx), NULL, currx, collide_firq_callback);
371371               }
372372               currx++;
373373            }
r1355r1356
456456      time = attotime_sub(video_screen_get_time_until_pos(0, beamy, beamx), attotime_make(0, increment * 6));
457457      for (i = 0; i <= 12; i++)
458458      {
459         timer_set(time, beamx, beam_firq_callback);
459         timer_set(time, NULL, beamx, beam_firq_callback);
460460         time = attotime_add(time, attotime_make(0, increment));
461461      }
462462   }
src/mame/video/blstroid.c
r1355r1356
132132         period_on  = video_screen_get_time_until_pos(scrnum, video_screen_get_vpos(scrnum) + 7, machine->screen[scrnum].width * 0.9);
133133         period_off = video_screen_get_time_until_pos(scrnum, video_screen_get_vpos(scrnum) + 8, machine->screen[scrnum].width * 0.9);
134134
135         timer_set(period_on,  0, irq_on);
136         timer_set(period_off, 0, irq_off);
135         timer_set(period_on, NULL,  0, irq_on);
136         timer_set(period_off, NULL, 0, irq_off);
137137      }
138138}
139139
src/mame/video/konamiic.c
r1355r1356
14431443static int K007342_gfxnum;
14441444static int K007342_int_enabled;
14451445static int K007342_flipscreen;
1446static int K007342_scrollx[2];
1447static int K007342_scrolly[2];
1446static UINT16 K007342_scrollx[2];
1447static UINT8 K007342_scrolly[2];
14481448static UINT8 *K007342_videoram_0,*K007342_colorram_0;
14491449static UINT8 *K007342_videoram_1,*K007342_colorram_1;
1450static int K007342_regs[8];
1450static UINT8 K007342_regs[8];
14511451static void (*K007342_callback)(int tmap, int bank, int *code, int *color, int *flags);
14521452static tilemap *K007342_tilemap[2];
14531453
r1355r1356
15171517
15181518   tilemap_set_transparent_pen(K007342_tilemap[0],0);
15191519   tilemap_set_transparent_pen(K007342_tilemap[1],0);
1520
1521   state_save_register_global_pointer(K007342_ram, 0x2000);
1522   state_save_register_global_pointer(K007342_scroll_ram, 0x0200);
1523   state_save_register_global(K007342_int_enabled);
1524   state_save_register_global(K007342_flipscreen);
1525   state_save_register_global_array(K007342_scrollx);
1526   state_save_register_global_array(K007342_scrolly);
1527   state_save_register_global_array(K007342_regs);
15201528}
15211529
15221530READ8_HANDLER( K007342_r )
r1355r1356
16771685   memset(K007420_ram,0,0x200);
16781686
16791687   K007420_banklimit = -1;
1688
1689   state_save_register_global_pointer(K007420_ram, 0x0200);
1690   state_save_register_global(K007420_banklimit);
16801691}
16811692
16821693READ8_HANDLER( K007420_r )
r1355r1356
24682479   K051960_callback = callback;
24692480   K051960_ram = auto_malloc(0x400);
24702481   memset(K051960_ram,0,0x400);
2482
2483   state_save_register_global(K051960_romoffset);
2484   state_save_register_global(K051960_spriteflip);
2485   state_save_register_global(K051960_readroms);
2486   state_save_register_global_array(K051960_spriterombank);
2487   state_save_register_global_pointer(K051960_ram, 0x400);
2488   state_save_register_global(K051960_irq_enabled);
2489   state_save_register_global(K051960_nmi_enabled);
24712490}
24722491
24732492
r1355r1356
29642983
29652984   memset(K053245_ram[chip],0,K053245_ramsize[chip]);
29662985   memset(K053245_buffer[chip],0,K053245_ramsize[chip]);
2986
2987   state_save_register_item_pointer("K053245", chip, K053245_ram[chip], K053245_ramsize[chip] / 2);
2988   state_save_register_item_pointer("K053245", chip, K053245_buffer[chip], K053245_ramsize[chip] / 2);
2989   state_save_register_item("K053245", chip, K053244_rombank[chip]);
2990   state_save_register_item("K053245", chip, K053245_dx[chip]);
2991   state_save_register_item("K053245", chip, K053245_dy[chip]);
2992   state_save_register_item_array("K053245", chip, K053244_regs[chip]);
29672993}
29682994
29692995void K053245_set_SpriteOffset(int chip,int offsx, int offsy)
r1355r1356
46134639
46144640   K051316_wraparound[chip] = 0;   /* default = no wraparound */
46154641   K051316_offset[chip][0] = K051316_offset[chip][1] = 0;
4642
4643   state_save_register_item_pointer("K051316", chip, K051316_ram[chip], 0x800);
4644   state_save_register_item_array("K051316", chip, K051316_ctrlram[chip]);
4645   state_save_register_item("K051316", chip, K051316_wraparound[chip]);
4646   state_save_register_item("K051316", chip, K051316_offset[chip][0]);
4647   state_save_register_item("K051316", chip, K051316_offset[chip][1]);
46164648}
46174649
46184650void K051316_vh_start_0(running_machine *machine,int gfx_memory_region,int bpp,
src/mame/video/dday.c
r1355r1356
4848{
4949   timer_value = 0;
5050
51   timer_pulse(ATTOTIME_IN_SEC(1), 0, countdown_timer_callback);
51   timer_pulse(ATTOTIME_IN_SEC(1), NULL, 0, countdown_timer_callback);
5252}
5353
5454
src/mame/video/atari.c
r1355r1356
10651065}
10661066#endif
10671067
1068static void after(int cycles, void (*function)(running_machine *machine, int), const char *funcname)
1068static void after(int cycles, timer_callback function, const char *funcname)
10691069{
10701070    attotime duration = attotime_make(0, attotime_to_attoseconds(video_screen_get_scan_period(0)) * cycles / CYCLES_PER_LINE);
10711071    (void)funcname;
10721072   LOG(("           after %3d (%5.1f us) %s\n", cycles, attotime_to_double(duration) * 1.0e6, funcname));
1073   timer_set(duration, 0, function);
1073   timer_set(duration, NULL, 0, function);
10741074}
10751075
10761076static TIMER_CALLBACK( antic_issue_dli )
src/mame/video/segas32.c
r1355r1356
378378{
379379   /* at the end of VBLANK is when automatic sprite rendering happens */
380380   if (!state)
381      timer_set(ATTOTIME_IN_USEC(50), 1, update_sprites);
381      timer_set(ATTOTIME_IN_USEC(50), NULL, 1, update_sprites);
382382}
383383
384384
src/mame/video/fromance.c
r1355r1356
9090   tilemap_set_transparent_pen(fg_tilemap,15);
9191
9292   /* reset the timer */
93   crtc_timer = timer_alloc(crtc_interrupt_gen);
93   crtc_timer = timer_alloc(crtc_interrupt_gen, NULL);
9494
9595   scrollx_ofs = 0x159;
9696   scrolly_ofs = 0x10;
r1355r1356
129129   tilemap_set_transparent_pen(fg_tilemap,15);
130130
131131   /* reset the timer */
132   crtc_timer = timer_alloc(crtc_interrupt_gen);
132   crtc_timer = timer_alloc(crtc_interrupt_gen, NULL);
133133
134134   scrollx_ofs = 0x159;
135135   scrolly_ofs = 0x10;
src/mame/video/segas24.c
r0r1356
1#include "driver.h"
2#include "video/segaic24.h"
3#include "includes/segas24.h"
4
5VIDEO_START(system24)
6{
7   sys24_tile_vh_start(machine, 0xfff);
8   sys24_sprite_vh_start();
9   sys24_mixer_vh_start();
10}
11
12static int layer_cmp(const void *pl1, const void *pl2)
13{
14   static const int default_pri[12] = { 0, 1, 2, 3, 4, 5, 6, 7, -4, -3, -2, -1 };
15   int l1 = *(int *)pl1;
16   int l2 = *(int *)pl2;
17   int p1 = sys24_mixer_get_reg(l1) & 7;
18   int p2 = sys24_mixer_get_reg(l2) & 7;
19   if(p1 != p2)
20      return p1 - p2;
21   return default_pri[l2] - default_pri[l1];
22}
23
24VIDEO_UPDATE(system24)
25{
26   int i, level;
27   int order[12], spri[4];
28
29   if(sys24_mixer_get_reg(13) & 1) {
30      fillbitmap(bitmap, get_black_pen(machine), 0);
31      return 0;
32   }
33
34   sys24_tile_update(machine);
35
36   fillbitmap(priority_bitmap, 0, 0);
37   fillbitmap(bitmap, machine->pens[0], &machine->screen[0].visarea);
38
39   for(i=0; i<12; i++)
40      order[i] = i;
41   qsort(order, 12, sizeof(int), layer_cmp);
42
43   level = 0;
44   for(i=0; i<12; i++)
45      if(order[i] < 8)
46         sys24_tile_draw(machine, bitmap, cliprect, order[i], level, 0);
47      else {
48         spri[order[i]-8] = level;
49         level++;
50      }
51
52   sys24_sprite_draw(bitmap, cliprect, spri);
53   return 0;
54}
src/mame/video/neogeo.c
r1355r1356
256256
257257static void create_auto_animation_timer(void)
258258{
259   auto_animation_timer = timer_alloc(auto_animation_timer_callback);
259   auto_animation_timer = timer_alloc(auto_animation_timer_callback, NULL);
260260}
261261
262262
r1355r1356
678678
679679static void create_sprite_line_timer(void)
680680{
681   sprite_line_timer = timer_alloc(sprite_line_timer_callback);
681   sprite_line_timer = timer_alloc(sprite_line_timer_callback, NULL);
682682}
683683
684684
src/mame/video/ppu2c0x.c
r1355r1356
295295      }
296296
297297      /* initialize the scanline handling portion */
298      chips[i].scanline_timer = timer_alloc(scanline_callback);
299      chips[i].hblank_timer = timer_alloc(hblank_callback);
300      chips[i].nmi_timer = timer_alloc(nmi_callback);
298      chips[i].scanline_timer = timer_alloc(scanline_callback, NULL);
299      chips[i].hblank_timer = timer_alloc(hblank_callback, NULL);
300      chips[i].nmi_timer = timer_alloc(nmi_callback, NULL);
301301      chips[i].scanline = 0;
302302      chips[i].scan_scale = 1;
303303
src/mame/video/taito_f2.c
r1355r1356
3838             tiles are always accessible)
3939************************************************************/
4040
41int f2_sprite_type = 0;
41static int f2_sprite_type = 0;
4242UINT16 *f2_sprite_extension;
4343size_t f2_spriteext_size;
4444
r1355r1356
6767static INT32 f2_tilemap_yoffs = 0;
6868static INT32 f2_text_xoffs = 0;
6969
70int f2_tilemap_col_base = 0;
70static int f2_tilemap_col_base = 0;
7171
7272static INT32 f2_game = 0;
7373static INT32 FOOTCHMP = 1;
src/mame/video/tubep.c
r1355r1356
569569         cpunum_set_input_line(3,0,CLEAR_LINE);
570570
571571         /* 2.assert /SINT again after this time */
572         timer_set( attotime_mul(ATTOTIME_IN_HZ(19968000/8), (XSize+1)*(YSize+1)), 0, sprite_timer_callback);
572         timer_set( attotime_mul(ATTOTIME_IN_HZ(19968000/8), (XSize+1)*(YSize+1)), NULL, 0, sprite_timer_callback);
573573
574574         /* 3.clear of /SINT starts sprite drawing circuit */
575575         draw_sprite();
src/mame/video/exidy.c
r1355r1356
372372
373373            /* if we got one, trigger an interrupt */
374374            if ((collision_mask & exidy_collision_mask) && count++ < 128)
375               timer_set(video_screen_get_time_until_pos(0, org_1_x + sx, org_1_y + sy), collision_mask, collision_irq_callback);
375               timer_set(video_screen_get_time_until_pos(0, org_1_x + sx, org_1_y + sy), NULL, collision_mask, collision_irq_callback);
376376            }
377377            if (*BITMAP_ADDR16(motion_object_2_vid, sy, sx) != 0xff)
378378          {
379379                /* check for background collision (M2CHAR) */
380380            if (((*BITMAP_ADDR16(tmpbitmap, org_2_y + sy, org_2_x + sx) - 4) & bgmask) != 0)
381381               if ((exidy_collision_mask & 0x08) && count++ < 128)
382                  timer_set(video_screen_get_time_until_pos(0, org_2_x + sx, org_2_y + sy), 0x08, collision_irq_callback);
382                  timer_set(video_screen_get_time_until_pos(0, org_2_x + sx, org_2_y + sy), NULL, 0x08, collision_irq_callback);
383383            }
384384      }
385385}
src/mame/video/hyhoo.c
r1355r1356
226226   }
227227
228228   nb1413m3_busyflag = 0;
229   timer_set(attotime_mul(ATTOTIME_IN_HZ(400000), nb1413m3_busyctr), 0, blitter_timer_callback);
229   timer_set(attotime_mul(ATTOTIME_IN_HZ(400000), nb1413m3_busyctr), NULL, 0, blitter_timer_callback);
230230}
231231
232232
src/mame/video/tickee.c
r1355r1356
6464
6565   /* generate interrupts for player 1's gun */
6666   get_crosshair_xy(0, &beamx, &beamy);
67   timer_set(video_screen_get_time_until_pos(0, beamy,     beamx + 50), 0, trigger_gun_interrupt);
68   timer_set(video_screen_get_time_until_pos(0, beamy + 1, beamx + 50), 0, clear_gun_interrupt);
67   timer_set(video_screen_get_time_until_pos(0, beamy,     beamx + 50), NULL, 0, trigger_gun_interrupt);
68   timer_set(video_screen_get_time_until_pos(0, beamy + 1, beamx + 50), NULL, 0, clear_gun_interrupt);
6969
7070   /* generate interrupts for player 2's gun */
7171   get_crosshair_xy(1, &beamx, &beamy);
72   timer_set(video_screen_get_time_until_pos(0, beamy,     beamx + 50), 1, trigger_gun_interrupt);
73   timer_set(video_screen_get_time_until_pos(0, beamy + 1, beamx + 50), 1, clear_gun_interrupt);
72   timer_set(video_screen_get_time_until_pos(0, beamy,     beamx + 50), NULL, 1, trigger_gun_interrupt);
73   timer_set(video_screen_get_time_until_pos(0, beamy + 1, beamx + 50), NULL, 1, clear_gun_interrupt);
7474}
7575
7676
r1355r1356
8484VIDEO_START( tickee )
8585{
8686   /* start a timer going on the first scanline of every frame */
87   setup_gun_timer = timer_alloc(setup_gun_interrupts);
87   setup_gun_timer = timer_alloc(setup_gun_interrupts, NULL);
8888   timer_adjust(setup_gun_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
8989}
9090
src/mame/video/m92.c
r1355r1356
9999      /* Pixel clock is 26.6666 MHz, we have 0x800 bytes, or 0x400 words
100100           to copy from spriteram to the buffer.  It seems safe to assume 1
101101           word can be copied per clock.*/
102      timer_set(attotime_mul(ATTOTIME_IN_HZ(26666000), 0x400), 0, spritebuffer_callback);
102      timer_set(attotime_mul(ATTOTIME_IN_HZ(26666000), 0x400), NULL, 0, spritebuffer_callback);
103103   }
104104//  logerror("%04x: m92_spritecontrol_w %08x %08x\n",activecpu_get_pc(),offset,data);
105105}
src/mame/video/dcheese.c
r1355r1356
111111   dstbitmap = auto_bitmap_alloc(DSTBITMAP_WIDTH, DSTBITMAP_HEIGHT, machine->screen[0].format);
112112
113113   /* create a timer */
114   blitter_timer = timer_alloc(blitter_scanline_callback);
114   blitter_timer = timer_alloc(blitter_scanline_callback, NULL);
115115
116116   /* register for saving */
117117   state_save_register_global_array(blitter_color);
r1355r1356
162162      memset(BITMAP_ADDR16(dstbitmap, y % DSTBITMAP_HEIGHT, 0), 0, DSTBITMAP_WIDTH * 2);
163163
164164   /* signal an IRQ when done (timing is just a guess) */
165   timer_set(video_screen_get_scan_period(0), 1, dcheese_signal_irq_callback);
165   timer_set(video_screen_get_scan_period(0), NULL, 1, dcheese_signal_irq_callback);
166166}
167167
168168
r1355r1356
216216   }
217217
218218   /* signal an IRQ when done (timing is just a guess) */
219   timer_set(attotime_make(0, attotime_to_attoseconds(video_screen_get_scan_period(0)) / 2), 2, dcheese_signal_irq_callback);
219   timer_set(attotime_make(0, attotime_to_attoseconds(video_screen_get_scan_period(0)) / 2), NULL, 2, dcheese_signal_irq_callback);
220220
221221   /* these extra parameters are written but they are always zero, so I don't know what they do */
222222   if (blitter_xparam[8] != 0 || blitter_xparam[9] != 0 || blitter_xparam[10] != 0 || blitter_xparam[11] != 0 ||
src/mame/video/rpunch.c
r1355r1356
9595      memset(rpunch_bitmapram, 0xff, rpunch_bitmapram_size);
9696
9797   /* reset the timer */
98   crtc_timer = timer_alloc(crtc_interrupt_gen);
98   crtc_timer = timer_alloc(crtc_interrupt_gen, NULL);
9999}
100100
101101
src/mame/video/changela.c
r1355r1356
4646   tree0_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
4747   tree1_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
4848
49   changela_scanline_timer = timer_alloc(changela_scanline_callback);
49   changela_scanline_timer = timer_alloc(changela_scanline_callback, NULL);
5050   timer_adjust(changela_scanline_timer, video_screen_get_time_until_pos(0, 30, 0), 30, attotime_zero);
5151
5252   state_save_register_global(slopeROM_bank);
src/mame/video/triplhnt.c
r1355r1356
129129
130130   if (hit_line != 999 && hit_code != 999)
131131   {
132      timer_set(video_screen_get_time_until_pos(0, hit_line, 0), hit_code, triplhnt_hit_callback);
132      timer_set(video_screen_get_time_until_pos(0, hit_line, 0), NULL, hit_code, triplhnt_hit_callback);
133133   }
134134}
135135
src/mame/video/exctsccr.c
r1355r1356
143143   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
144144      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
145145
146   timer_pulse(ATTOTIME_IN_HZ(75), 0, exctsccr_fm_callback); /* updates fm */
146   timer_pulse(ATTOTIME_IN_HZ(75), NULL, 0, exctsccr_fm_callback); /* updates fm */
147147}
148148
149149static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/layout/pe_bjack.lay
r0r1356
1<!-- pe_bjack.lay -->
2
3<mamelayout version="2">
4   <element name="bezel">
5   </element>
6
7   <!-- specific elements to a kind of machine -->
8   <element name="surrender" defstate="1">
9      <rect state="0">
10         <color red="0.5" green="0.5" blue="0.5" />
11      </rect>
12      <rect state="1">
13         <color red="1.0" green="1.0" blue="1.0" />
14      </rect>
15      <text string="SURRENDER">
16         <color red="0.0" green="0.0" blue="0.0" />
17         <bounds x="0" y="0.1" width="1" height="0.8" />
18      </text>
19   </element>
20   <element name="stand" defstate="1">
21      <rect state="0">
22         <color red="0.5" green="0.5" blue="0.5" />
23      </rect>
24      <rect state="1">
25         <color red="1.0" green="1.0" blue="1.0" />
26      </rect>
27      <text string="STAND">
28         <color red="0.0" green="0.0" blue="0.0" />
29         <bounds x="0" y="0.1" width="1" height="0.8" />
30      </text>
31   </element>
32   <element name="insurance" defstate="1">
33      <rect state="0">
34         <color red="0.5" green="0.5" blue="0.5" />
35      </rect>
36      <rect state="1">
37         <color red="1.0" green="1.0" blue="1.0" />
38      </rect>
39      <text string="INSURANCE">
40         <color red="0.0" green="0.0" blue="0.0" />
41         <bounds x="0" y="0.1" width="1" height="0.8" />
42      </text>
43   </element>
44   <element name="double" defstate="1">
45      <rect state="0">
46         <color red="0.5" green="0.5" blue="0.5" />
47      </rect>
48      <rect state="1">
49         <color red="1.0" green="1.0" blue="1.0" />
50      </rect>
51      <text string="DOUBLE">
52         <color red="0.0" green="0.0" blue="0.0" />
53         <bounds x="0" y="0.1" width="1" height="0.8" />
54      </text>
55   </element>
56   <element name="split" defstate="1">
57      <rect state="0">
58         <color red="0.5" green="0.5" blue="0.5" />
59      </rect>
60      <rect state="1">
61         <color red="1.0" green="1.0" blue="1.0" />
62      </rect>
63      <text string="SPLIT">
64         <color red="0.0" green="0.0" blue="0.0" />
65         <bounds x="0" y="0.1" width="1" height="0.8" />
66      </text>
67   </element>
68
69   <!-- change text depending on kind of machine -->
70   <element name="dealspinstart" defstate="1">
71      <rect state="0">
72         <color red="0.5" green="0.5" blue="0.5" />
73      </rect>
74      <rect state="1">
75         <color red="1.0" green="1.0" blue="1.0" />
76      </rect>
77      <text string="DEAL/HIT">
78         <color red="0.0" green="0.0" blue="0.0" />
79         <bounds x="0" y="0.1" width="1" height="0.8" />
80      </text>
81   </element>
82
83   <!-- shared elements by all kinds of machine -->
84   <element name="dooropen" defstate="1">
85      <rect state="0">
86         <color red="0.5" green="0.5" blue="0.5" />
87      </rect>
88      <rect state="1">
89         <color red="1.0" green="1.0" blue="1.0" />
90      </rect>
91      <text string="DOOR OPEN">
92         <color red="0.0" green="0.0" blue="0.0" />
93         <bounds x="0" y="0.1" width="1" height="0.8" />
94      </text>
95   </element>
96   <element name="hopper1" defstate="1">
97      <rect state="0">
98         <color red="0.5" green="0.5" blue="0.5" />
99      </rect>
100      <rect state="1">
101         <color red="1.0" green="1.0" blue="1.0" />
102      </rect>
103      <text string="HOPPER 1">
104         <color red="0.0" green="0.0" blue="0.0" />
105         <bounds x="0" y="0.1" width="1" height="0.8" />
106      </text>
107   </element>
108   <element name="hopper2" defstate="1">
109      <rect state="0">
110         <color red="0.5" green="0.5" blue="0.5" />
111      </rect>
112      <rect state="1">
113         <color red="1.0" green="1.0" blue="1.0" />
114      </rect>
115      <text string="HOPPER 2">
116         <color red="0.0" green="0.0" blue="0.0" />
117         <bounds x="0" y="0.1" width="1" height="0.8" />
118      </text>
119   </element>
120   <element name="change" defstate="1">
121      <rect state="1">
122         <color red="1.0" green="0.0" blue="0.0" />
123      </rect>
124      <rect state="0">
125         <color red="0.5" green="0.0" blue="0.0" />
126      </rect>
127   </element>
128   <element name="changetext" defstate="1">
129      <rect state="1">
130         <color red="1.0" green="0.0" blue="0.0" />
131      </rect>
132      <rect state="0">
133         <color red="0.0" green="0.0" blue="0.0" />
134      </rect>
135      <text string="CHANGE REQUEST ... CALLING ATTENDANT ...">
136         <color red="0.0" green="0.0" blue="0.0" />
137         <bounds x="0" y="0.1" width="1" height="0.8" />
138      </text>
139   </element>
140   <element name="bet1" defstate="1">
141      <rect state="0">
142         <color red="0.5" green="0.5" blue="0.5" />
143      </rect>
144      <rect state="1">
145         <color red="1.0" green="1.0" blue="1.0" />
146      </rect>
147      <text string="BET 1">
148         <color red="0.0" green="0.0" blue="0.0" />
149         <bounds x="0" y="0.1" width="1" height="0.8" />
150      </text>
151   </element>
152   <element name="betmax" defstate="1">
153      <rect state="0">
154         <color red="0.5" green="0.5" blue="0.5" />
155      </rect>
156      <rect state="1">
157         <color red="1.0" green="1.0" blue="1.0" />
158      </rect>
159      <text string="BET MAX">
160         <color red="0.0" green="0.0" blue="0.0" />
161         <bounds x="0" y="0.1" width="1" height="0.8" />
162      </text>
163   </element>
164   <element name="cashout" defstate="1">
165      <rect state="0">
166         <color red="0.5" green="0.5" blue="0.5" />
167      </rect>
168      <rect state="1">
169         <color red="1.0" green="1.0" blue="1.0" />
170      </rect>
171      <text string="CASHOUT">
172         <color red="0.0" green="0.0" blue="0.0" />
173         <bounds x="0" y="0.1" width="1" height="0.8" />
174      </text>
175   </element>
176
177   <view name="Bezel Lamps">
178      <screen index="0">
179         <bounds left="10" top="40" right="330" bottom="240" />
180      </screen>
181      <bezel element="bezel">
182         <bounds left="0" top="0" right="340" bottom="310" />
183      </bezel>
184      <!-- specific bezels to a kind of machine -->
185      <bezel name="pe_bnka7" element="surrender">
186         <bounds x="12" y="250" width="60" height="20" />
187      </bezel>
188      <bezel name="pe_bnka6" element="stand">
189         <bounds x="76" y="250" width="60" height="20" />
190      </bezel>
191      <bezel name="pe_bnkb0" element="insurance">
192         <bounds x="140" y="250" width="60" height="20" />
193      </bezel>
194      <bezel name="pe_bnkb3" element="double">
195         <bounds x="204" y="250" width="60" height="20" />
196      </bezel>
197      <bezel name="pe_bnkb7" element="split">
198         <bounds x="268" y="250" width="60" height="20" />
199      </bezel>
200      <!-- shared bezels by all kinds of machine -->
201      <bezel name="pe_bnkb5" element="changetext">
202         <bounds x="20" y="10" width="300" height="20" />
203      </bezel>
204      <bezel name="pe_bnkb1" element="dealspinstart">
205         <bounds x="10" y="280" width="74" height="20" />
206      </bezel>
207      <bezel name="pe_bnkb4" element="bet1">
208         <bounds x="92" y="280" width="74" height="20" />
209      </bezel>
210      <bezel name="pe_bnkb4" element="betmax">
211         <bounds x="174" y="280" width="74" height="20" />
212      </bezel>
213      <bezel name="pe_bnkb2" element="cashout">
214         <bounds x="256" y="280" width="74" height="20" />
215      </bezel>
216   </view>
217
218   <view name="Debug Lamps">
219      <screen index="0">
220         <bounds left="10" top="40" right="330" bottom="240" />
221      </screen>
222      <bezel element="bezel">
223         <bounds left="0" top="0" right="340" bottom="310" />
224      </bezel>
225      <!-- specific bezels to a kind of machine -->
226      <bezel name="pe_bnka7" element="surrender">
227         <bounds x="12" y="250" width="60" height="20" />
228      </bezel>
229      <bezel name="pe_bnka6" element="stand">
230         <bounds x="76" y="250" width="60" height="20" />
231      </bezel>
232      <bezel name="pe_bnkb0" element="insurance">
233         <bounds x="140" y="250" width="60" height="20" />
234      </bezel>
235      <bezel name="pe_bnkb3" element="double">
236         <bounds x="204" y="250" width="60" height="20" />
237      </bezel>
238      <bezel name="pe_bnkb7" element="split">
239         <bounds x="268" y="250" width="60" height="20" />
240      </bezel>
241      <!-- shared bezels by all kinds of machine -->
242      <bezel name="pe_bnkb6" element="dooropen">
243         <bounds x="10" y="10" width="90" height="20" />
244      </bezel>
245      <bezel name="pe_bnka4" element="hopper1">
246         <bounds x="110" y="10" width="90" height="20" />
247      </bezel>
248      <bezel name="pe_bnka5" element="hopper2">
249         <bounds x="210" y="10" width="90" height="20" />
250      </bezel>
251      <bezel name="pe_bnkb5" element="change">
252         <bounds x="310" y="10" width="20" height="20" />
253      </bezel>
254      <bezel name="pe_bnkb1" element="dealspinstart">
255         <bounds x="10" y="280" width="74" height="20" />
256      </bezel>
257      <bezel name="pe_bnkb4" element="bet1">
258         <bounds x="92" y="280" width="74" height="20" />
259      </bezel>
260      <bezel name="pe_bnkb4" element="betmax">
261         <bounds x="174" y="280" width="74" height="20" />
262      </bezel>
263      <bezel name="pe_bnkb2" element="cashout">
264         <bounds x="256" y="280" width="74" height="20" />
265      </bezel>
266   </view>
267</mamelayout>
src/mame/layout/pe_poker.lay
r0r1356
1<!-- pe_poker.lay -->
2
3<mamelayout version="2">
4   <element name="bezel">
5   </element>
6
7   <!-- specific elements to a kind of machine -->
8   <element name="hold" defstate="1">
9      <rect state="0">
10         <color red="0.5" green="0.5" blue="0.5" />
11      </rect>
12      <rect state="1">
13         <color red="1.0" green="1.0" blue="1.0" />
14      </rect>
15      <text string="HOLD">
16         <color red="0.0" green="0.0" blue="0.0" />
17         <bounds x="0" y="0.1" width="1" height="0.8" />
18      </text>
19   </element>
20
21   <!-- change text depending on kind of machine -->
22   <element name="dealspinstart" defstate="1">
23      <rect state="0">
24         <color red="0.5" green="0.5" blue="0.5" />
25      </rect>
26      <rect state="1">
27         <color red="1.0" green="1.0" blue="1.0" />
28      </rect>
29      <text string="DRAW">
30         <color red="0.0" green="0.0" blue="0.0" />
31         <bounds x="0" y="0.1" width="1" height="0.8" />
32      </text>
33   </element>
34
35   <!-- shared elements by all kinds of machine -->
36   <element name="dooropen" defstate="1">
37      <rect state="0">
38         <color red="0.5" green="0.5" blue="0.5" />
39      </rect>
40      <rect state="1">
41         <color red="1.0" green="1.0" blue="1.0" />
42      </rect>
43      <text string="DOOR OPEN">
44         <color red="0.0" green="0.0" blue="0.0" />
45         <bounds x="0" y="0.1" width="1" height="0.8" />
46      </text>
47   </element>
48   <element name="hopper1" defstate="1">
49      <rect state="0">
50         <color red="0.5" green="0.5" blue="0.5" />
51      </rect>
52      <rect state="1">
53         <color red="1.0" green="1.0" blue="1.0" />
54      </rect>
55      <text string="HOPPER 1">
56         <color red="0.0" green="0.0" blue="0.0" />
57         <bounds x="0" y="0.1" width="1" height="0.8" />
58      </text>
59   </element>
60   <element name="hopper2" defstate="1">
61      <rect state="0">
62         <color red="0.5" green="0.5" blue="0.5" />
63      </rect>
64      <rect state="1">
65         <color red="1.0" green="1.0" blue="1.0" />
66      </rect>
67      <text string="HOPPER 2">
68         <color red="0.0" green="0.0" blue="0.0" />
69         <bounds x="0" y="0.1" width="1" height="0.8" />
70      </text>
71   </element>
72   <element name="change" defstate="1">
73      <rect state="1">
74         <color red="1.0" green="0.0" blue="0.0" />
75      </rect>
76      <rect state="0">
77         <color red="0.5" green="0.0" blue="0.0" />
78      </rect>
79   </element>
80   <element name="changetext" defstate="1">
81      <rect state="1">
82         <color red="1.0" green="0.0" blue="0.0" />
83      </rect>
84      <rect state="0">
85         <color red="0.0" green="0.0" blue="0.0" />
86      </rect>
87      <text string="CHANGE REQUEST ... CALLING ATTENDANT ...">
88         <color red="0.0" green="0.0" blue="0.0" />
89         <bounds x="0" y="0.1" width="1" height="0.8" />
90      </text>
91   </element>
92   <element name="bet1" defstate="1">
93      <rect state="0">
94         <color red="0.5" green="0.5" blue="0.5" />
95      </rect>
96      <rect state="1">
97         <color red="1.0" green="1.0" blue="1.0" />
98      </rect>
99      <text string="BET 1">
100         <color red="0.0" green="0.0" blue="0.0" />
101         <bounds x="0" y="0.1" width="1" height="0.8" />
102      </text>
103   </element>
104   <element name="betmax" defstate="1">
105      <rect state="0">
106         <color red="0.5" green="0.5" blue="0.5" />
107      </rect>
108      <rect state="1">
109         <color red="1.0" green="1.0" blue="1.0" />
110      </rect>
111      <text string="BET MAX">
112         <color red="0.0" green="0.0" blue="0.0" />
113         <bounds x="0" y="0.1" width="1" height="0.8" />
114      </text>
115   </element>
116   <element name="cashout" defstate="1">
117      <rect state="0">
118         <color red="0.5" green="0.5" blue="0.5" />
119      </rect>
120      <rect state="1">
121         <color red="1.0" green="1.0" blue="1.0" />
122      </rect>
123      <text string="CASHOUT">
124         <color red="0.0" green="0.0" blue="0.0" />
125         <bounds x="0" y="0.1" width="1" height="0.8" />
126      </text>
127   </element>
128
129   <view name="Bezel Lamps">
130      <screen index="0">
131         <bounds left="10" top="40" right="330" bottom="240" />
132      </screen>
133      <bezel element="bezel">
134         <bounds left="0" top="0" right="340" bottom="310" />
135      </bezel>
136      <!-- specific bezels to a kind of machine -->
137      <bezel name="pe_bnkb3" element="hold">
138         <bounds x="12" y="250" width="60" height="20" />
139      </bezel>
140      <bezel name="pe_bnkb0" element="hold">
141         <bounds x="76" y="250" width="60" height="20" />
142      </bezel>
143      <bezel name="pe_bnkb0" element="hold">
144         <bounds x="140" y="250" width="60" height="20" />
145      </bezel>
146      <bezel name="pe_bnkb0" element="hold">
147         <bounds x="204" y="250" width="60" height="20" />
148      </bezel>
149      <bezel name="pe_bnkb7" element="hold">
150         <bounds x="268" y="250" width="60" height="20" />
151      </bezel>
152      <!-- shared bezels by all kinds of machine -->
153      <bezel name="pe_bnkb5" element="changetext">
154         <bounds x="20" y="10" width="300" height="20" />
155      </bezel>
156      <bezel name="pe_bnkb1" element="dealspinstart">
157         <bounds x="10" y="280" width="74" height="20" />
158      </bezel>
159      <bezel name="pe_bnkb4" element="bet1">
160         <bounds x="92" y="280" width="74" height="20" />
161      </bezel>
162      <bezel name="pe_bnkb4" element="betmax">
163         <bounds x="174" y="280" width="74" height="20" />
164      </bezel>
165      <bezel name="pe_bnkb2" element="cashout">
166         <bounds x="256" y="280" width="74" height="20" />
167      </bezel>
168   </view>
169
170   <view name="Debug Lamps">
171      <screen index="0">
172         <bounds left="10" top="40" right="330" bottom="240" />
173      </screen>
174      <bezel element="bezel">
175         <bounds left="0" top="0" right="340" bottom="310" />
176      </bezel>
177      <!-- specific bezels to a kind of machine -->
178      <bezel name="pe_bnkb3" element="hold">
179         <bounds x="12" y="250" width="60" height="20" />
180      </bezel>
181      <bezel name="pe_bnkb0" element="hold">
182         <bounds x="76" y="250" width="60" height="20" />
183      </bezel>
184      <bezel name="pe_bnkb0" element="hold">
185         <bounds x="140" y="250" width="60" height="20" />
186      </bezel>
187      <bezel name="pe_bnkb0" element="hold">
188         <bounds x="204" y="250" width="60" height="20" />
189      </bezel>
190      <bezel name="pe_bnkb7" element="hold">
191         <bounds x="268" y="250" width="60" height="20" />
192      </bezel>
193      <!-- shared bezels by all kinds of machine -->
194      <bezel name="pe_bnkb6" element="dooropen">
195         <bounds x="10" y="10" width="90" height="20" />
196      </bezel>
197      <bezel name="pe_bnka4" element="hopper1">
198         <bounds x="110" y="10" width="90" height="20" />
199      </bezel>
200      <bezel name="pe_bnka5" element="hopper2">
201         <bounds x="210" y="10" width="90" height="20" />
202      </bezel>
203      <bezel name="pe_bnkb5" element="change">
204         <bounds x="310" y="10" width="20" height="20" />
205      </bezel>
206      <bezel name="pe_bnkb1" element="dealspinstart">
207         <bounds x="10" y="280" width="74" height="20" />
208      </bezel>
209      <bezel name="pe_bnkb4" element="bet1">
210         <bounds x="92" y="280" width="74" height="20" />
211      </bezel>
212      <bezel name="pe_bnkb4" element="betmax">
213         <bounds x="174" y="280" width="74" height="20" />
214      </bezel>
215      <bezel name="pe_bnkb2" element="cashout">
216         <bounds x="256" y="280" width="74" height="20" />
217      </bezel>
218   </view>
219</mamelayout>
src/mame/layout/peplus.lay
r1355r1356
44   <element name="bezel">
55   </element>
66
7   <element name="hold" defstate="1">
7   <!-- specific elements to a kind of machine -->
8
9   <!-- change text depending on kind of machine -->
10   <element name="dealspinstart" defstate="1">
811      <rect state="0">
912         <color red="0.5" green="0.5" blue="0.5" />
1013      </rect>
1114      <rect state="1">
1215         <color red="1.0" green="1.0" blue="1.0" />
1316      </rect>
14      <text string="HOLD">
17      <text string="START">
1518         <color red="0.0" green="0.0" blue="0.0" />
1619         <bounds x="0" y="0.1" width="1" height="0.8" />
1720      </text>
1821   </element>
1922
20   <element name="change" defstate="1">
23   <!-- shared elements by all kinds of machine -->
24   <element name="dooropen" defstate="1">
25      <rect state="0">
26         <color red="0.5" green="0.5" blue="0.5" />
27      </rect>
2128      <rect state="1">
22         <color red="1.0" green="0.0" blue="0.0" />
29         <color red="1.0" green="1.0" blue="1.0" />
2330      </rect>
31      <text string="DOOR OPEN">
32         <color red="0.0" green="0.0" blue="0.0" />
33         <bounds x="0" y="0.1" width="1" height="0.8" />
34      </text>
35   </element>
36   <element name="hopper1" defstate="1">
2437      <rect state="0">
25         <color red="0.5" green="0.0" blue="0.0" />
38         <color red="0.5" green="0.5" blue="0.5" />
2639      </rect>
40      <rect state="1">
41         <color red="1.0" green="1.0" blue="1.0" />
42      </rect>
43      <text string="HOPPER 1">
44         <color red="0.0" green="0.0" blue="0.0" />
45         <bounds x="0" y="0.1" width="1" height="0.8" />
46      </text>
2747   </element>
28
29   <element name="dooropen" defstate="1">
48   <element name="hopper2" defstate="1">
3049      <rect state="0">
3150         <color red="0.5" green="0.5" blue="0.5" />
3251      </rect>
3352      <rect state="1">
3453         <color red="1.0" green="1.0" blue="1.0" />
3554      </rect>
36      <text string="DOOR OPEN">
55      <text string="HOPPER 2">
3756         <color red="0.0" green="0.0" blue="0.0" />
3857         <bounds x="0" y="0.1" width="1" height="0.8" />
3958      </text>
4059   </element>
41
42   <element name="dealdraw" defstate="1">
60   <element name="change" defstate="1">
61      <rect state="1">
62         <color red="1.0" green="0.0" blue="0.0" />
63      </rect>
4364      <rect state="0">
65         <color red="0.5" green="0.0" blue="0.0" />
66      </rect>
67   </element>
68   <element name="changetext" defstate="1">
69      <rect state="1">
70         <color red="1.0" green="0.0" blue="0.0" />
71      </rect>
72      <rect state="0">
73         <color red="0.0" green="0.0" blue="0.0" />
74      </rect>
75      <text string="CHANGE REQUEST ... CALLING ATTENDANT ...">
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   <element name="bet1" defstate="1">
81      <rect state="0">
4482         <color red="0.5" green="0.5" blue="0.5" />
4583      </rect>
4684      <rect state="1">
4785         <color red="1.0" green="1.0" blue="1.0" />
4886      </rect>
49      <text string="DEAL DRAW">
87      <text string="BET 1">
5088         <color red="0.0" green="0.0" blue="0.0" />
5189         <bounds x="0" y="0.1" width="1" height="0.8" />
5290      </text>
5391   </element>
54
55   <element name="cashout" defstate="1">
92   <element name="betmax" defstate="1">
5693      <rect state="0">
5794         <color red="0.5" green="0.5" blue="0.5" />
5895      </rect>
5996      <rect state="1">
6097         <color red="1.0" green="1.0" blue="1.0" />
6198      </rect>
62      <text string="CASHOUT">
99      <text string="BET MAX">
63100         <color red="0.0" green="0.0" blue="0.0" />
64101         <bounds x="0" y="0.1" width="1" height="0.8" />
65102      </text>
66103   </element>
67
68   <element name="betcredits" defstate="1">
104   <element name="cashout" defstate="1">
69105      <rect state="0">
70106         <color red="0.5" green="0.5" blue="0.5" />
71107      </rect>
72108      <rect state="1">
73109         <color red="1.0" green="1.0" blue="1.0" />
74110      </rect>
75      <text string="BET CREDITS">
111      <text string="CASHOUT">
76112         <color red="0.0" green="0.0" blue="0.0" />
77113         <bounds x="0" y="0.1" width="1" height="0.8" />
78114      </text>
r1355r1356
85121      <bezel element="bezel">
86122         <bounds left="0" top="0" right="340" bottom="310" />
87123      </bezel>
88      <bezel name="lamp3" element="hold">
89         <bounds x="50" y="250" width="40" height="20" />
124      <!-- specific bezels to a kind of machine -->
125      <!-- shared bezels by all kinds of machine -->
126      <bezel name="pe_bnkb5" element="changetext">
127         <bounds x="20" y="10" width="300" height="20" />
90128      </bezel>
91      <bezel name="lamp0" element="hold">
92         <bounds x="100" y="250" width="40" height="20" />
129      <bezel name="pe_bnkb1" element="dealspinstart">
130         <bounds x="10" y="280" width="74" height="20" />
93131      </bezel>
94      <bezel name="lamp0" element="hold">
95         <bounds x="150" y="250" width="40" height="20" />
132      <bezel name="pe_bnkb4" element="bet1">
133         <bounds x="92" y="280" width="74" height="20" />
96134      </bezel>
97      <bezel name="lamp0" element="hold">
98         <bounds x="200" y="250" width="40" height="20" />
135      <bezel name="pe_bnkb4" element="betmax">
136         <bounds x="174" y="280" width="74" height="20" />
99137      </bezel>
100      <bezel name="lamp7" element="hold">
101         <bounds x="250" y="250" width="40" height="20" />
138      <bezel name="pe_bnkb2" element="cashout">
139         <bounds x="256" y="280" width="74" height="20" />
102140      </bezel>
103      <bezel name="lamp5" element="change">
141   </view>
142
143   <view name="Debug Lamps">
144      <screen index="0">
145         <bounds left="10" top="40" right="330" bottom="240" />
146      </screen>
147      <bezel element="bezel">
148         <bounds left="0" top="0" right="340" bottom="310" />
149      </bezel>
150      <!-- specific bezels to a kind of machine -->
151      <!-- shared bezels by all kinds of machine -->
152      <bezel name="pe_bnkb6" element="dooropen">
153         <bounds x="10" y="10" width="90" height="20" />
154      </bezel>
155      <bezel name="pe_bnka4" element="hopper1">
156         <bounds x="110" y="10" width="90" height="20" />
157      </bezel>
158      <bezel name="pe_bnka5" element="hopper2">
159         <bounds x="210" y="10" width="90" height="20" />
160      </bezel>
161      <bezel name="pe_bnkb5" element="change">
104162         <bounds x="310" y="10" width="20" height="20" />
105163      </bezel>
106      <bezel name="lamp6" element="dooropen">
107         <bounds x="10" y="10" width="100" height="20" />
164      <bezel name="pe_bnkb1" element="dealspinstart">
165         <bounds x="10" y="280" width="74" height="20" />
108166      </bezel>
109      <bezel name="lamp1" element="dealdraw">
110         <bounds x="10" y="280" width="100" height="20" />
167      <bezel name="pe_bnkb4" element="bet1">
168         <bounds x="92" y="280" width="74" height="20" />
111169      </bezel>
112      <bezel name="lamp2" element="cashout">
113         <bounds x="120" y="280" width="100" height="20" />
170      <bezel name="pe_bnkb4" element="betmax">
171         <bounds x="174" y="280" width="74" height="20" />
114172      </bezel>
115      <bezel name="lamp4" element="betcredits">
116         <bounds x="230" y="280" width="100" height="20" />
173      <bezel name="pe_bnkb2" element="cashout">
174         <bounds x="256" y="280" width="74" height="20" />
117175      </bezel>
118176   </view>
119177</mamelayout>
src/mame/layout/pe_slots.lay
r0r1356
1<!-- pe_slots.lay -->
2
3<mamelayout version="2">
4   <element name="bezel">
5   </element>
6
7   <!-- specific elements to a kind of machine -->
8   <!-- NONE ! -->
9
10   <!-- change text depending on kind of machine -->
11   <element name="dealspinstart" defstate="1">
12      <rect state="0">
13         <color red="0.5" green="0.5" blue="0.5" />
14      </rect>
15      <rect state="1">
16         <color red="1.0" green="1.0" blue="1.0" />
17      </rect>
18      <text string="SPIN">
19         <color red="0.0" green="0.0" blue="0.0" />
20         <bounds x="0" y="0.1" width="1" height="0.8" />
21      </text>
22   </element>
23
24   <!-- shared elements by all kinds of machine -->
25   <element name="dooropen" defstate="1">
26      <rect state="0">
27         <color red="0.5" green="0.5" blue="0.5" />
28      </rect>
29      <rect state="1">
30         <color red="1.0" green="1.0" blue="1.0" />
31      </rect>
32      <text string="DOOR OPEN">
33         <color red="0.0" green="0.0" blue="0.0" />
34         <bounds x="0" y="0.1" width="1" height="0.8" />
35      </text>
36   </element>
37   <element name="hopper1" defstate="1">
38      <rect state="0">
39         <color red="0.5" green="0.5" blue="0.5" />
40      </rect>
41      <rect state="1">
42         <color red="1.0" green="1.0" blue="1.0" />
43      </rect>
44      <text string="HOPPER 1">
45         <color red="0.0" green="0.0" blue="0.0" />
46         <bounds x="0" y="0.1" width="1" height="0.8" />
47      </text>
48   </element>
49   <element name="hopper2" defstate="1">
50      <rect state="0">
51         <color red="0.5" green="0.5" blue="0.5" />
52      </rect>
53      <rect state="1">
54         <color red="1.0" green="1.0" blue="1.0" />
55      </rect>
56      <text string="HOPPER 2">
57         <color red="0.0" green="0.0" blue="0.0" />
58         <bounds x="0" y="0.1" width="1" height="0.8" />
59      </text>
60   </element>
61   <element name="change" defstate="1">
62      <rect state="1">
63         <color red="1.0" green="0.0" blue="0.0" />
64      </rect>
65      <rect state="0">
66         <color red="0.5" green="0.0" blue="0.0" />
67      </rect>
68   </element>
69   <element name="changetext" defstate="1">
70      <rect state="1">
71         <color red="1.0" green="0.0" blue="0.0" />
72      </rect>
73      <rect state="0">
74         <color red="0.0" green="0.0" blue="0.0" />
75      </rect>
76      <text string="CHANGE REQUEST ... CALLING ATTENDANT ...">
77         <color red="0.0" green="0.0" blue="0.0" />
78         <bounds x="0" y="0.1" width="1" height="0.8" />
79      </text>
80   </element>
81   <element name="bet1" defstate="1">
82      <rect state="0">
83         <color red="0.5" green="0.5" blue="0.5" />
84      </rect>
85      <rect state="1">
86         <color red="1.0" green="1.0" blue="1.0" />
87      </rect>
88      <text string="BET 1">
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   <element name="betmax" defstate="1">
94      <rect state="0">
95         <color red="0.5" green="0.5" blue="0.5" />
96      </rect>
97      <rect state="1">
98         <color red="1.0" green="1.0" blue="1.0" />
99      </rect>
100      <text string="BET MAX">
101         <color red="0.0" green="0.0" blue="0.0" />
102         <bounds x="0" y="0.1" width="1" height="0.8" />
103      </text>
104   </element>
105   <element name="cashout" defstate="1">
106      <rect state="0">
107         <color red="0.5" green="0.5" blue="0.5" />
108      </rect>
109      <rect state="1">
110         <color red="1.0" green="1.0" blue="1.0" />
111      </rect>
112      <text string="CASHOUT">
113         <color red="0.0" green="0.0" blue="0.0" />
114         <bounds x="0" y="0.1" width="1" height="0.8" />
115      </text>
116   </element>
117
118   <view name="Bezel Lamps">
119      <screen index="0">
120         <bounds left="10" top="40" right="330" bottom="240" />
121      </screen>
122      <bezel element="bezel">
123         <bounds left="0" top="0" right="340" bottom="310" />
124      </bezel>
125      <!-- specific bezels to a kind of machine -->
126      <!-- NONE ! -->
127      <!-- shared bezels by all kinds of machine -->
128      <bezel name="pe_bnkb5" element="changetext">
129         <bounds x="20" y="10" width="300" height="20" />
130      </bezel>
131      <bezel name="pe_bnkb1" element="dealspinstart">
132         <bounds x="10" y="280" width="74" height="20" />
133      </bezel>
134      <bezel name="pe_bnkb4" element="bet1">
135         <bounds x="92" y="280" width="74" height="20" />
136      </bezel>
137      <bezel name="pe_bnkb4" element="betmax">
138         <bounds x="174" y="280" width="74" height="20" />
139      </bezel>
140      <bezel name="pe_bnkb2" element="cashout">
141         <bounds x="256" y="280" width="74" height="20" />
142      </bezel>
143   </view>
144
145   <view name="Debug Lamps">
146      <screen index="0">
147         <bounds left="10" top="40" right="330" bottom="240" />
148      </screen>
149      <bezel element="bezel">
150         <bounds left="0" top="0" right="340" bottom="310" />
151      </bezel>
152      <!-- specific bezels to a kind of machine -->
153      <!-- NONE ! -->
154      <!-- shared bezels by all kinds of machine -->
155      <bezel name="pe_bnkb6" element="dooropen">
156         <bounds x="10" y="10" width="90" height="20" />
157      </bezel>
158      <bezel name="pe_bnka4" element="hopper1">
159         <bounds x="110" y="10" width="90" height="20" />
160      </bezel>
161      <bezel name="pe_bnka5" element="hopper2">
162         <bounds x="210" y="10" width="90" height="20" />
163      </bezel>
164      <bezel name="pe_bnkb5" element="change">
165         <bounds x="310" y="10" width="20" height="20" />
166      </bezel>
167      <bezel name="pe_bnkb1" element="dealspinstart">
168         <bounds x="10" y="280" width="74" height="20" />
169      </bezel>
170      <bezel name="pe_bnkb4" element="bet1">
171         <bounds x="92" y="280" width="74" height="20" />
172      </bezel>
173      <bezel name="pe_bnkb4" element="betmax">
174         <bounds x="174" y="280" width="74" height="20" />
175      </bezel>
176      <bezel name="pe_bnkb2" element="cashout">
177         <bounds x="256" y="280" width="74" height="20" />
178      </bezel>
179   </view>
180</mamelayout>
src/mame/layout/tceptor2.lay
r0r1356
1<?xml version="1.0"?>
2<mamelayout version="2">
3   <view name="3D Glasses Side-by-Side">
4      <screen index="1">
5         <bounds x="0" y="0" width="4" height="3" />
6      </screen>
7      <screen index="2">
8         <bounds x="4.03" y="0" width="4" height="3" />
9      </screen>
10   </view>
11   <view name="3D Glasses Left">
12      <screen index="1">
13         <bounds x="0" y="0" width="4" height="3" />
14      </screen>
15   </view>
16   <view name="3D Glasses Right">
17      <screen index="2">
18         <bounds x="0" y="0" width="4" height="3" />
19      </screen>
20   </view>
21</mamelayout>
src/mame/layout/pe_keno.lay
r0r1356
1<!-- pe_keno.lay -->
2
3<mamelayout version="2">
4   <element name="bezel">
5   </element>
6
7   <!-- specific elements to a kind of machine -->
8   <element name="erase" defstate="1">
9      <rect state="0">
10         <color red="0.5" green="0.5" blue="0.5" />
11      </rect>
12      <rect state="1">
13         <color red="1.0" green="1.0" blue="1.0" />
14      </rect>
15      <text string="ERASE">
16         <color red="0.0" green="0.0" blue="0.0" />
17         <bounds x="0" y="0.1" width="1" height="0.8" />
18      </text>
19   </element>
20
21   <!-- change text depending on kind of machine -->
22   <element name="dealspinstart" defstate="1">
23      <rect state="0">
24         <color red="0.5" green="0.5" blue="0.5" />
25      </rect>
26      <rect state="1">
27         <color red="1.0" green="1.0" blue="1.0" />
28      </rect>
29      <text string="START">
30         <color red="0.0" green="0.0" blue="0.0" />
31         <bounds x="0" y="0.1" width="1" height="0.8" />
32      </text>
33   </element>
34
35   <!-- shared elements by all kinds of machine -->
36   <element name="dooropen" defstate="1">
37      <rect state="0">
38         <color red="0.5" green="0.5" blue="0.5" />
39      </rect>
40      <rect state="1">
41         <color red="1.0" green="1.0" blue="1.0" />
42      </rect>
43      <text string="DOOR OPEN">
44         <color red="0.0" green="0.0" blue="0.0" />
45         <bounds x="0" y="0.1" width="1" height="0.8" />
46      </text>
47   </element>
48   <element name="hopper1" defstate="1">
49      <rect state="0">
50         <color red="0.5" green="0.5" blue="0.5" />
51      </rect>
52      <rect state="1">
53         <color red="1.0" green="1.0" blue="1.0" />
54      </rect>
55      <text string="HOPPER 1">
56         <color red="0.0" green="0.0" blue="0.0" />
57         <bounds x="0" y="0.1" width="1" height="0.8" />
58      </text>
59   </element>
60   <element name="hopper2" defstate="1">
61      <rect state="0">
62         <color red="0.5" green="0.5" blue="0.5" />
63      </rect>
64      <rect state="1">
65         <color red="1.0" green="1.0" blue="1.0" />
66      </rect>
67      <text string="HOPPER 2">
68         <color red="0.0" green="0.0" blue="0.0" />
69         <bounds x="0" y="0.1" width="1" height="0.8" />
70      </text>
71   </element>
72   <element name="change" defstate="1">
73      <rect state="1">
74         <color red="1.0" green="0.0" blue="0.0" />
75      </rect>
76      <rect state="0">
77         <color red="0.5" green="0.0" blue="0.0" />
78      </rect>
79   </element>
80   <element name="changetext" defstate="1">
81      <rect state="1">
82         <color red="1.0" green="0.0" blue="0.0" />
83      </rect>
84      <rect state="0">
85         <color red="0.0" green="0.0" blue="0.0" />
86      </rect>
87      <text string="CHANGE REQUEST ... CALLING ATTENDANT ...">
88         <color red="0.0" green="0.0" blue="0.0" />
89         <bounds x="0" y="0.1" width="1" height="0.8" />
90      </text>
91   </element>
92   <element name="bet1" defstate="1">
93      <rect state="0">
94         <color red="0.5" green="0.5" blue="0.5" />
95      </rect>
96      <rect state="1">
97         <color red="1.0" green="1.0" blue="1.0" />
98      </rect>
99      <text string="BET 1">
100         <color red="0.0" green="0.0" blue="0.0" />
101         <bounds x="0" y="0.1" width="1" height="0.8" />
102      </text>
103   </element>
104   <element name="betmax" defstate="1">
105      <rect state="0">
106         <color red="0.5" green="0.5" blue="0.5" />
107      </rect>
108      <rect state="1">
109         <color red="1.0" green="1.0" blue="1.0" />
110      </rect>
111      <text string="BET MAX">
112         <color red="0.0" green="0.0" blue="0.0" />
113         <bounds x="0" y="0.1" width="1" height="0.8" />
114      </text>
115   </element>
116   <element name="cashout" defstate="1">
117      <rect state="0">
118         <color red="0.5" green="0.5" blue="0.5" />
119      </rect>
120      <rect state="1">
121         <color red="1.0" green="1.0" blue="1.0" />
122      </rect>
123      <text string="CASHOUT">
124         <color red="0.0" green="0.0" blue="0.0" />
125         <bounds x="0" y="0.1" width="1" height="0.8" />
126      </text>
127   </element>
128
129   <view name="Bezel Lamps">
130      <screen index="0">
131         <bounds left="10" top="40" right="330" bottom="240" />
132      </screen>
133      <bezel element="bezel">
134         <bounds left="0" top="0" right="340" bottom="310" />
135      </bezel>
136      <!-- specific bezels to a kind of machine -->
137      <bezel name="pe_bnkb7" element="erase">
138         <bounds x="268" y="250" width="60" height="20" />
139      </bezel>
140      <!-- shared bezels by all kinds of machine -->
141      <bezel name="pe_bnkb5" element="changetext">
142         <bounds x="20" y="10" width="300" height="20" />
143      </bezel>
144      <bezel name="pe_bnkb1" element="dealspinstart">
145         <bounds x="10" y="280" width="74" height="20" />
146      </bezel>
147      <bezel name="pe_bnkb4" element="bet1">
148         <bounds x="92" y="280" width="74" height="20" />
149      </bezel>
150      <bezel name="pe_bnkb4" element="betmax">
151         <bounds x="174" y="280" width="74" height="20" />
152      </bezel>
153      <bezel name="pe_bnkb2" element="cashout">
154         <bounds x="256" y="280" width="74" height="20" />
155      </bezel>
156   </view>
157
158   <view name="Debug Lamps">
159      <screen index="0">
160         <bounds left="10" top="40" right="330" bottom="240" />
161      </screen>
162      <bezel element="bezel">
163         <bounds left="0" top="0" right="340" bottom="310" />
164      </bezel>
165      <!-- specific bezels to a kind of machine -->
166      <bezel name="pe_bnkb7" element="erase">
167         <bounds x="268" y="250" width="60" height="20" />
168      </bezel>
169      <!-- shared bezels by all kinds of machine -->
170      <bezel name="pe_bnkb6" element="dooropen">
171         <bounds x="10" y="10" width="90" height="20" />
172      </bezel>
173      <bezel name="pe_bnka4" element="hopper1">
174         <bounds x="110" y="10" width="90" height="20" />
175      </bezel>
176      <bezel name="pe_bnka5" element="hopper2">
177         <bounds x="210" y="10" width="90" height="20" />
178      </bezel>
179      <bezel name="pe_bnkb5" element="change">
180         <bounds x="310" y="10" width="20" height="20" />
181      </bezel>
182      <bezel name="pe_bnkb1" element="dealspinstart">
183         <bounds x="10" y="280" width="74" height="20" />
184      </bezel>
185      <bezel name="pe_bnkb4" element="bet1">
186         <bounds x="92" y="280" width="74" height="20" />
187      </bezel>
188      <bezel name="pe_bnkb4" element="betmax">
189         <bounds x="174" y="280" width="74" height="20" />
190      </bezel>
191      <bezel name="pe_bnkb2" element="cashout">
192         <bounds x="256" y="280" width="74" height="20" />
193      </bezel>
194   </view>
195</mamelayout>
src/mame/layout/pe_schip.lay
r0r1356
1<!-- pe_schip.lay -->
2
3<mamelayout version="2">
4   <element name="bezel">
5   </element>
6
7   <element name="dealspinstart" defstate="1">
8      <rect state="0">
9         <color red="0.5" green="0.5" blue="0.5" />
10      </rect>
11      <rect state="1">
12         <color red="1.0" green="1.0" blue="1.0" />
13      </rect>
14      <text string="DEAL-SPIN-START">
15         <color red="0.0" green="0.0" blue="0.0" />
16         <bounds x="0" y="0.1" width="1" height="0.8" />
17      </text>
18   </element>
19
20   <view name="Set Chip Lamps">
21      <screen index="0">
22         <bounds left="10" top="40" right="330" bottom="240" />
23      </screen>
24      <bezel element="bezel">
25         <bounds left="0" top="0" right="340" bottom="310" />
26      </bezel>
27      <bezel name="pe_bnkb1" element="dealspinstart">
28         <bounds x="10" y="280" width="74" height="20" />
29      </bezel>
30   </view>
31</mamelayout>
src/mame/drivers/bfcobra.c
r1355r1356
138138***************************************************************************/
139139
140140#ifdef MAME_DEBUG
141int DEBUG_BLITTER = 0;
141static int DEBUG_BLITTER = 0;
142142#endif
143143
144144/* Typedefs */
src/mame/drivers/nycaptor.c
r1355r1356
271271static WRITE8_HANDLER( sound_command_w )
272272{
273273   soundlatch_w(0,data);
274   timer_call_after_resynch(data,nmi_callback);
274   timer_call_after_resynch(NULL, data,nmi_callback);
275275}
276276
277277static WRITE8_HANDLER( nmi_disable_w )
src/mame/drivers/mgolf.c
r1355r1356
110110      scanline = 16;
111111   }
112112
113   timer_set(video_screen_get_time_until_pos(0, scanline, 0), scanline, interrupt_callback);
113   timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, interrupt_callback);
114114}
115115
116116
r1355r1356
122122
123123static MACHINE_RESET( mgolf )
124124{
125   timer_set(video_screen_get_time_until_pos(0, 16, 0), 16, interrupt_callback);
125   timer_set(video_screen_get_time_until_pos(0, 16, 0), NULL, 16, interrupt_callback);
126126}
127127
128128
src/mame/drivers/deco_mlc.c
r1355r1356
422422
423423static MACHINE_RESET( mlc )
424424{
425   raster_irq_timer = timer_alloc(interrupt_gen);
425   raster_irq_timer = timer_alloc(interrupt_gen, NULL);
426426}
427427
428428static struct YMZ280Binterface ymz280b_intf =
src/mame/drivers/crystal.c
r1355r1356
593593   Timer2ctrl=0;
594594   Timer3ctrl=0;
595595
596   Timer0=timer_alloc(Timer0cb);
596   Timer0=timer_alloc(Timer0cb, NULL);
597597   timer_adjust(Timer0,attotime_never,0,attotime_never);
598598
599   Timer1=timer_alloc(Timer1cb);
599   Timer1=timer_alloc(Timer1cb, NULL);
600600   timer_adjust(Timer1,attotime_never,0,attotime_never);
601601
602   Timer2=timer_alloc(Timer2cb);
602   Timer2=timer_alloc(Timer2cb, NULL);
603603   timer_adjust(Timer2,attotime_never,0,attotime_never);
604604
605   Timer3=timer_alloc(Timer3cb);
605   Timer3=timer_alloc(Timer3cb, NULL);
606606   timer_adjust(Timer3,attotime_never,0,attotime_never);
607607
608608   VR0_Snd_Set_Areas(textureram,frameram);
src/mame/drivers/eprom.c
r1355r1356
77    Games supported:
88        * Escape From The Planet Of The Robot Monsters (1989) [2 sets]
99        * Klax prototypes [2 sets]
10        * Guts n' Glory (prototype)
1011
1112    Known bugs:
1213        * none at this time
r1355r1356
185186ADDRESS_MAP_END
186187
187188
189static ADDRESS_MAP_START( guts_map, ADDRESS_SPACE_PROGRAM, 16 )
190   AM_RANGE(0x000000, 0x09ffff) AM_ROM
191   AM_RANGE(0x0e0000, 0x0e0fff) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE(&atarigen_eeprom) AM_SIZE(&atarigen_eeprom_size)
192   AM_RANGE(0x16cc00, 0x16cc01) AM_RAM AM_SHARE(2)
193   AM_RANGE(0x160000, 0x16ffff) AM_RAM AM_SHARE(1)
194   AM_RANGE(0x1f0000, 0x1fffff) AM_WRITE(atarigen_eeprom_enable_w)
195   AM_RANGE(0x260000, 0x26000f) AM_READ(input_port_0_word_r)
196   AM_RANGE(0x260010, 0x26001f) AM_READ(special_port1_r)
197   AM_RANGE(0x260020, 0x26002f) AM_READ(adc_r)
198   AM_RANGE(0x260030, 0x260031) AM_READ(atarigen_sound_r)
199   AM_RANGE(0x2e0000, 0x2e0001) AM_WRITE(watchdog_reset16_w)
200   AM_RANGE(0x360000, 0x360001) AM_WRITE(atarigen_video_int_ack_w)
201//  AM_RANGE(0x360010, 0x360011) AM_WRITE(eprom_latch_w)
202   AM_RANGE(0x360020, 0x360021) AM_WRITE(atarigen_sound_reset_w)
203   AM_RANGE(0x360030, 0x360031) AM_WRITE(atarigen_sound_w)
204   AM_RANGE(0x3e0000, 0x3e0fff) AM_READWRITE(MRA16_RAM, paletteram16_IIIIRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16)
205   AM_RANGE(0xff0000, 0xff1fff) AM_WRITE(atarigen_playfield_upper_w) AM_BASE(&atarigen_playfield_upper)
206   AM_RANGE(0xff8000, 0xff9fff) AM_WRITE(atarigen_playfield_w) AM_BASE(&atarigen_playfield)
207   AM_RANGE(0xffa000, 0xffbfff) AM_WRITE(atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram)
208   AM_RANGE(0xffc000, 0xffcf7f) AM_WRITE(atarigen_alpha_w) AM_BASE(&atarigen_alpha)
209   AM_RANGE(0xffcf80, 0xffcfff) AM_WRITE(atarimo_0_slipram_w) AM_BASE(&atarimo_0_slipram)
210   AM_RANGE(0xff0000, 0xff1fff) AM_RAM
211   AM_RANGE(0xff8000, 0xffffff) AM_RAM
212ADDRESS_MAP_END
188213
214
215
189216/*************************************
190217 *
191218 *  Extra CPU memory handlers
r1355r1356
292319INPUT_PORTS_END
293320
294321
322static INPUT_PORTS_START( guts )
323   PORT_START      /* 26000 */
324   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
325   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
326   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
327   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
328   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNUSED )
329   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
330   PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED )
295331
332   PORT_START      /* 26010 */
333   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_VBLANK )
334   PORT_SERVICE( 0x0002, IP_ACTIVE_LOW )
335   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )   /* Input buffer full (@260030) */
336   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) /* Output buffer full (@360030) */
337   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED ) /* ADEOC, end of conversion */
338   PORT_BIT( 0x00e0, IP_ACTIVE_LOW, IPT_UNUSED )
339   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START2 )
340   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
341   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
342   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNUSED )
343   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
344   PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED )
345
346   PORT_START   /* ADC0 @ 0x260020 */
347   PORT_BIT( 0x00ff, 0x0080, IPT_AD_STICK_Y ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(1)
348   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
349
350   PORT_START   /* ADC1 @ 0x260022 */
351   PORT_BIT( 0x00ff, 0x0080, IPT_AD_STICK_X ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(1) PORT_REVERSE
352   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
353
354   PORT_START   /* ADC0 @ 0x260024 */
355   PORT_BIT( 0x00ff, 0x0080, IPT_AD_STICK_Y ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(2)
356   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
357
358   PORT_START   /* ADC1 @ 0x260026 */
359   PORT_BIT( 0x00ff, 0x0080, IPT_AD_STICK_X ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(2) PORT_REVERSE
360   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
361
362   JSA_II_PORT   /* audio board port */
363INPUT_PORTS_END
364
365
366
296367/*************************************
297368 *
298369 *  Graphics definitions
r1355r1356
305376   RGN_FRAC(1,1),
306377   2,
307378   { 0, 4 },
308   { 0, 1, 2, 3, 8, 9, 10, 11 },
309   { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
379   { STEP4(0,1), STEP4(8,1) },
380   { STEP8(0,16) },
310381   8*16
311382};
312383
r1355r1356
317388   RGN_FRAC(1,4),
318389   4,
319390   { RGN_FRAC(0,4), RGN_FRAC(1,4), RGN_FRAC(2,4), RGN_FRAC(3,4) },
320   { 0, 1, 2, 3, 4, 5, 6, 7 },
321   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
391   { STEP8(0,1) },
392   { STEP8(0,8) },
322393   8*8
323394};
324395
r1355r1356
329400GFXDECODE_END
330401
331402
403static GFXDECODE_START( guts )
404   GFXDECODE_ENTRY( REGION_GFX1, 0, pfmolayout,  256, 32 )   /* sprites */
405   GFXDECODE_ENTRY( REGION_GFX2, 0, anlayout,      0, 64 )   /* characters 8x8 */
406   GFXDECODE_ENTRY( REGION_GFX3, 0, pfmolayout,  256, 32 )   /* playfield */
407GFXDECODE_END
332408
409
410
333411/*************************************
334412 *
335413 *  Machine drivers
r1355r1356
401479MACHINE_DRIVER_END
402480
403481
482static MACHINE_DRIVER_START( guts )
483   /* basic machine hardware */
484   MDRV_CPU_ADD_TAG("main", M68000, ATARI_CLOCK_14MHz/2)
485   MDRV_CPU_PROGRAM_MAP(guts_map,0)
486   MDRV_CPU_VBLANK_INT(atarigen_video_int_gen,1)
404487
488   MDRV_INTERLEAVE(10)
489
490   MDRV_MACHINE_RESET(eprom)
491   MDRV_NVRAM_HANDLER(atarigen)
492
493   /* video hardware */
494   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_BEFORE_VBLANK)
495   MDRV_GFXDECODE(guts)
496   MDRV_PALETTE_LENGTH(2048)
497
498   MDRV_SCREEN_ADD("main", 0)
499   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
500   /* note: these parameters are from published specs, not derived */
501   /* the board uses a SYNGEN chip to generate video signals */
502   MDRV_SCREEN_RAW_PARAMS(ATARI_CLOCK_14MHz/2, 456, 0, 336, 262, 0, 240)
503
504   MDRV_VIDEO_START(guts)
505   MDRV_VIDEO_UPDATE(guts)
506
507   /* sound hardware */
508   MDRV_IMPORT_FROM(jsa_ii_mono)
509MACHINE_DRIVER_END
510
511
512
405513/*************************************
406514 *
407515 *  ROM definition(s)
r1355r1356
560668ROM_END
561669
562670
671ROM_START( guts )
672   ROM_REGION( 0xa0000, REGION_CPU1, 0 )   /* 10*64k for 68000 code */
673   ROM_LOAD16_BYTE( "guts-hi0.50a", 0x00000, 0x10000, CRC(3afca24a) SHA1(4910c958ac2124de13d4069420fb2cfd18b12cec) )
674   ROM_LOAD16_BYTE( "guts-lo0.40a", 0x00001, 0x10000, CRC(ce86cf23) SHA1(28504e2e8dcf1eaa96364eed1faf00fec9e98788) )
675   ROM_LOAD16_BYTE( "guts-hi1.50b", 0x20000, 0x10000, CRC(a231f65d) SHA1(9c8ccd265ed0e9f6d7181d216ed41a0c5cc0cd5f) )
676   ROM_LOAD16_BYTE( "guts-lo1.40b", 0x20001, 0x10000, CRC(dbdd4910) SHA1(9ca22321398b6397902aa99a3ef46f1a78ccc438) )
563677
678   ROM_REGION( 0x14000, REGION_CPU2, 0 )   /* 64k + 16k for 6502 code */
679   ROM_LOAD( "guts-snd.10c", 0x10000, 0x4000, CRC(9fe065d7) SHA1(0d202af3d6c62fdcfc3bb2ea95bbf4e37c0d43cf) )
680   ROM_CONTINUE(             0x04000, 0xc000 )
681
682   ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE | ROMREGION_INVERT )
683   ROM_LOAD( "guts-mo0.bin", 0x00000, 0x10000, CRC(b8d8d8da) SHA1(6426607402aa9f1c872290910eefc57a8dd60e17) )
684   ROM_LOAD( "guts-mo1.bin", 0x10000, 0x10000, CRC(d01b5a7f) SHA1(19aead56ddb92e0b1fc78d9065b1f139fe2a5668) )
685   ROM_LOAD( "guts-mo2.bin", 0x20000, 0x10000, CRC(4577b807) SHA1(df0ead177342ab360cfab9b6defb7d0129d921e4) )
686   ROM_LOAD( "guts-mo3.bin", 0x30000, 0x10000, CRC(4ab03c84) SHA1(b37d4abaaa42b9b847cc928a2b40b4e58ba9887f) )
687   ROM_LOAD( "guts-mo4.bin", 0x40000, 0x10000, CRC(04cae4fb) SHA1(1b2cde0a97f687f67836f9eb09a45875a81c994a) )
688   ROM_LOAD( "guts-mo5.bin", 0x50000, 0x10000, CRC(c65322ec) SHA1(0e77fb3db5760e12ee7b321906c2211e60a63ea4) )
689   ROM_LOAD( "guts-mo6.bin", 0x60000, 0x10000, CRC(92602a5f) SHA1(a52376d326368e989cb7c3aa3913b918b4639307) )
690   ROM_LOAD( "guts-mo7.bin", 0x70000, 0x10000, CRC(71a1911d) SHA1(6fd7c8b7a340466672e9db7a44e472e8e078e469) )
691   ROM_LOAD( "guts-mo8.bin", 0x80000, 0x10000, CRC(aa273234) SHA1(41c310d53b4a847323cfd1f2080653cbc19216bf) )
692   ROM_LOAD( "guts-mo9.bin", 0x90000, 0x10000, CRC(e85a12ef) SHA1(cbdb19e2e075c56288b9ed6aec07f03a2f265951) )
693   ROM_LOAD( "guts-moa.bin", 0xa0000, 0x10000, CRC(da1cc76f) SHA1(ba91026464fec3cd94d1625c8780d5b18ecbb6ae) )
694   ROM_LOAD( "guts-mob.bin", 0xb0000, 0x10000, CRC(246e7955) SHA1(cf146be2855d0a9c28c8da926c7fa381d06d5dd4) )
695   ROM_LOAD( "guts-moc.bin", 0xc0000, 0x10000, CRC(1764c272) SHA1(0682fdc20cc1cd9355a50804a3f13c913c33f52b) )
696   ROM_LOAD( "guts-mod.bin", 0xd0000, 0x10000, CRC(8220f2f6) SHA1(8a2900e223c203507c11e0185c2172ddddb0f4ee) )
697   ROM_LOAD( "guts-moe.bin", 0xe0000, 0x10000, CRC(ee372eac) SHA1(bb1248bb3415853e16819a7b6b64ec67f87a2c58) )
698   ROM_LOAD( "guts-mof.bin", 0xf0000, 0x10000, CRC(028ec56e) SHA1(8a95cffe5c00296e4df725335046a810efab533a) )
699
700   ROM_REGION( 0x04000, REGION_GFX2, ROMREGION_DISPOSE )
701   ROM_LOAD( "guts-alpha.bin", 0x00000, 0x04000, CRC(ee965058) SHA1(ccd3f6550bd5b531e8dd70ca88c30cdabf30e1e9) )
702
703   ROM_REGION( 0x100000, REGION_GFX3, ROMREGION_DISPOSE | ROMREGION_INVERT )
704   ROM_LOAD( "guts-pf0.bin", 0x00000, 0x10000, CRC(1669fdb3) SHA1(d8d27b0f5877e215bf3d5343893c979860b1b45f) )
705   ROM_LOAD( "guts-pf1.bin", 0x10000, 0x10000, CRC(135c41bd) SHA1(945ad9edbfcc5fe807cb15aa72b1be9e05974cb2) )
706   ROM_LOAD( "guts-pf2.bin", 0x20000, 0x10000, CRC(c0408d39) SHA1(187ecea51f607c7f2565a9853c728e80118fefb1) )
707   ROM_LOAD( "guts-pf4.bin", 0x40000, 0x10000, CRC(577f25a6) SHA1(3eaa3de6aa7e5b3938d34823f2cccc60e9b211e7) )
708   ROM_LOAD( "guts-pf5.bin", 0x50000, 0x10000, CRC(43cbc0e3) SHA1(51e5f90391ebb402f715f389168baf401e3c03e9) )
709   ROM_LOAD( "guts-pf6.bin", 0x60000, 0x10000, CRC(03c096f4) SHA1(fc0ffd5b61ab8bda37db508ec6dc5c70e1007187) )
710   ROM_LOAD( "guts-pf8.bin", 0x80000, 0x10000, CRC(2f078b09) SHA1(e9b1aba767339d4677c3366d3f2df5a8deb5105e) )
711   ROM_LOAD( "guts-pf9.bin", 0x90000, 0x10000, CRC(7cb7302d) SHA1(9d6ae58f1f64d1e28634dd42daedebb39570cd95) )
712   ROM_LOAD( "guts-pfa.bin", 0xa0000, 0x10000, CRC(a3919dae) SHA1(0eba64afcc35e37322f9eb3a0e254026443ce092) )
713   ROM_LOAD( "guts-pfc.bin", 0xc0000, 0x10000, CRC(7c571ee8) SHA1(044744ca95b2bd7486b0b057f1d7bdbd391958ab) )
714   ROM_LOAD( "guts-pfd.bin", 0xd0000, 0x10000, CRC(979af5b2) SHA1(574a41552eb641668841cf01aeed442ccd3bc8e5) )
715   ROM_LOAD( "guts-pfe.bin", 0xe0000, 0x10000, CRC(bf384e4d) SHA1(c4810b5a3ee754b169efa01f06941a02b50c53a0) )
716
717   ROM_REGION( 0x20000, REGION_SOUND1, 0 )   /* ADPCM data */
718   ROM_LOAD( "guts-adpcm0.1f", 0x00000, 0x10000, CRC(92e9c35d) SHA1(dcc724f915e113bc34f499af9fd7c8ebb6d8ba98) )
719   ROM_LOAD( "guts-adpcm1.1e", 0x10000, 0x10000, CRC(0afddd3a) SHA1(e1a43825ad02325a64869ec8048c8176da01b286) )
720ROM_END
721
722
723
564724/*************************************
565725 *
566726 *  Driver initialization
r1355r1356
587747}
588748
589749
750static DRIVER_INIT( guts )
751{
752   atarigen_eeprom_default = NULL;
753   atarijsa_init(1, 6, 1, 0x0002);
754}
590755
756
757
591758/*************************************
592759 *
593760 *  Game driver(s)
r1355r1356
598765GAME( 1989, eprom2, eprom, eprom, eprom, eprom, ROT0, "Atari Games", "Escape from the Planet of the Robot Monsters (set 2)", GAME_SUPPORTS_SAVE )
599766GAME( 1989, klaxp1, klax,  klaxp, klaxp, klaxp, ROT0, "Atari Games", "Klax (prototype set 1)", GAME_SUPPORTS_SAVE )
600767GAME( 1989, klaxp2, klax,  klaxp, klaxp, klaxp, ROT0, "Atari Games", "Klax (prototype set 2)", GAME_SUPPORTS_SAVE )
768GAME( 1989, guts,   0,     guts,  guts,  guts,  ROT0, "Atari Games", "Guts n' Glory (prototype)", 0 )
src/mame/drivers/fgoal.c
r1355r1356
9999      scanline = 0;
100100   }
101101
102   timer_set(video_screen_get_time_until_pos(0, scanline, 0), 0, interrupt_callback);
102   timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, 0, interrupt_callback);
103103}
104104
105105
106106static MACHINE_RESET( fgoal )
107107{
108   timer_set(video_screen_get_time_until_pos(0, 0, 0), 0, interrupt_callback);
108   timer_set(video_screen_get_time_until_pos(0, 0, 0), NULL, 0, interrupt_callback);
109109}
110110
111111
src/mame/drivers/segaxbd.c
r1355r1356
150150      update_main_irqs();
151151
152152   /* come back in 2 scanlines */
153   timer_set(video_screen_get_time_until_pos(0, next_scanline, 0), next_scanline, scanline_callback);
153   timer_set(video_screen_get_time_until_pos(0, next_scanline, 0), NULL, next_scanline, scanline_callback);
154154}
155155
156156
r1355r1356
178178
179179static void sound_data_w(UINT8 data)
180180{
181   timer_call_after_resynch(data, delayed_sound_data_w);
181   timer_call_after_resynch(NULL, data, delayed_sound_data_w);
182182}
183183
184184
r1355r1356
222222   segaic16_compare_timer_init(1, NULL, NULL);
223223
224224   /* start timers to track interrupts */
225   timer_set(video_screen_get_time_until_pos(0, 1, 0), 1, scanline_callback);
225   timer_set(video_screen_get_time_until_pos(0, 1, 0), NULL, 1, scanline_callback);
226226}
227227
228228
src/mame/drivers/sslam.c
r1355r1356
958958   state_save_register_global(sslam_bar);
959959   state_save_register_global(sslam_snd_bank);
960960
961   music_timer = timer_alloc(music_playback);
961   music_timer = timer_alloc(music_playback, NULL);
962962}
963963
964964static DRIVER_INIT( powerbls )
src/mame/drivers/lgp.c
r1355r1356
333333
334334   // IRQ
335335   cpunum_set_input_line(0, 0, ASSERT_LINE);
336   timer_set(ATTOTIME_IN_USEC(50), 0, irq_stop);
336   timer_set(ATTOTIME_IN_USEC(50), NULL, 0, irq_stop);
337337
338338   laserdisc_vsync(discinfo);
339339}
src/mame/drivers/cliffhgr.c
r1355r1356
264264static MACHINE_START( cliffhgr )
265265{
266266   discinfo = laserdisc_init(LASERDISC_TYPE_PR8210, get_disk_handle(0), 0);
267   irq_timer = timer_alloc(cliff_irq_callback);
267   irq_timer = timer_alloc(cliff_irq_callback, NULL);
268268}
269269
270270static MACHINE_RESET( cliffhgr )
src/mame/drivers/pipedrm.c
r1355r1356
188188
189189static WRITE8_HANDLER( sound_command_w )
190190{
191   timer_call_after_resynch(data | 0x100, delayed_command_w);
191   timer_call_after_resynch(NULL, data | 0x100, delayed_command_w);
192192}
193193
194194
195195static WRITE8_HANDLER( sound_command_nonmi_w )
196196{
197   timer_call_after_resynch(data, delayed_command_w);
197   timer_call_after_resynch(NULL, data, delayed_command_w);
198198}
199199
200200
src/mame/drivers/ccastles.c
r1355r1356
232232   memory_configure_bank(1, 0, 2, memory_region(REGION_CPU1) + 0xa000, 0x6000);
233233
234234   /* create a timer for IRQs and set up the first callback */
235   irq_timer = timer_alloc(clock_irq);
235   irq_timer = timer_alloc(clock_irq, NULL);
236236   irq_state = 0;
237237   schedule_next_irq(0);
238238
src/mame/drivers/exterm.c
r1355r1356
104104
105105static MACHINE_RESET( exterm )
106106{
107   sound_nmi_timer = timer_alloc(master_sound_nmi_callback);
107   sound_nmi_timer = timer_alloc(master_sound_nmi_callback, NULL);
108108}
109109
110110
r1355r1356
222222static WRITE16_HANDLER( sound_latch_w )
223223{
224224   if (ACCESSING_LSB)
225      timer_call_after_resynch(data & 0xff, sound_delayed_w);
225      timer_call_after_resynch(NULL, data & 0xff, sound_delayed_w);
226226}
227227
228228
src/mame/drivers/dragrace.c
r1355r1356
3636
3737static MACHINE_RESET( dragrace )
3838{
39   timer_pulse(video_screen_get_frame_period(0), 0, dragrace_frame_callback);
39   timer_pulse(video_screen_get_frame_period(0), NULL, 0, dragrace_frame_callback);
4040}
4141
4242static void dragrace_update_misc_flags(void)
src/mame/drivers/mediagx.c
r1355r1356
860860   dacl = auto_malloc(65536 * sizeof(INT16));
861861   dacr = auto_malloc(65536 * sizeof(INT16));
862862
863   sound_timer = timer_alloc(sound_timer_callback);
863   sound_timer = timer_alloc(sound_timer_callback, NULL);
864864   timer_adjust(sound_timer, ATTOTIME_IN_MSEC(10), 0, attotime_zero);
865865
866866   dmadac_enable(0, 2, 1);
src/mame/drivers/policetr.c
r1355r1356
128128static INTERRUPT_GEN( irq4_gen )
129129{
130130   cpunum_set_input_line(0, R3000_IRQ4, ASSERT_LINE);
131   timer_set(video_screen_get_time_until_pos(0, 0, 0), 0, irq5_gen);
131   timer_set(video_screen_get_time_until_pos(0, 0, 0), NULL, 0, irq5_gen);
132132}
133133
134134
r1355r1356
269269 *
270270 *************************************/
271271
272struct EEPROM_interface eeprom_interface_policetr =
272static struct EEPROM_interface eeprom_interface_policetr =
273273{
274274   8,            // address bits 8
275275   16,            // data bits    16
src/mame/drivers/coolpool.c
r1355r1356
146146static MACHINE_RESET( amerdart )
147147{
148148   nvram_write_enable = 0;
149   nvram_write_timer = timer_alloc(nvram_write_timeout);
149   nvram_write_timer = timer_alloc(nvram_write_timeout, NULL);
150150}
151151
152152
r1355r1356
154154{
155155   tlc34076_reset(6);
156156   nvram_write_enable = 0;
157   nvram_write_timer = timer_alloc(nvram_write_timeout);
157   nvram_write_timer = timer_alloc(nvram_write_timeout, NULL);
158158}
159159
160160
r1355r1356
277277{
278278   logerror("%08x:IOP write %04x\n", activecpu_get_pc(), data);
279279   COMBINE_DATA(&iop_cmd);
280   timer_set(ATTOTIME_IN_USEC(100), 0, amerdart_iop_response);
280   timer_set(ATTOTIME_IN_USEC(100), NULL, 0, amerdart_iop_response);
281281}
282282
283283
r1355r1356
321321static WRITE16_HANDLER( coolpool_iop_w )
322322{
323323   logerror("%08x:IOP write %04x\n", activecpu_get_pc(), data);
324   timer_call_after_resynch(data, deferred_iop_w);
324   timer_call_after_resynch(NULL, data, deferred_iop_w);
325325}
326326
327327
src/mame/drivers/system1.c
r1355r1356
35373537   ROM_LOAD( "pr-5317.76",      0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
35383538ROM_END
35393539
3540/*
3541    Shooting Master (SEGA) - Set 1, 8751 315-5159
3542    Year: 1985
3543    System 2
3544
3545    Main Board        834-5719
3546    Light Gun Board?  834-5720
3547*/
3548
35403549ROM_START( shtngmst )
35413550   ROM_REGION( 0x20000, REGION_CPU1, 0 )
3542   ROM_LOAD( "epr7100",      0x00000, 0x8000, CRC(45e64431) SHA1(7edf818dc1f65365641e51abc197d13db7a8d4d9) )
3543   ROM_LOAD( "epr7101",      0x10000, 0x8000, CRC(ebf5ff72) SHA1(13ae06e3a81cf00b80ec939d5baf30143d61d480) )
3544   ROM_LOAD( "epr7102",      0x18000, 0x8000, CRC(c890a4ad) SHA1(4b59d37902ace3a69b380ff40652ee37c85f0e9d) )
3551    /* This rom is located on the daughter board .*/
3552   ROM_LOAD( "epr7100.ic18",   0x00000, 0x8000, CRC(45e64431) SHA1(7edf818dc1f65365641e51abc197d13db7a8d4d9) )
3553    /* These roms are located on the main board. */
3554   ROM_LOAD( "epr7101.ic91",   0x10000, 0x8000, CRC(ebf5ff72) SHA1(13ae06e3a81cf00b80ec939d5baf30143d61d480) )
3555   ROM_LOAD( "epr7102.ic92",   0x18000, 0x8000, CRC(c890a4ad) SHA1(4b59d37902ace3a69b380ff40652ee37c85f0e9d) )
35453556
3557    /* This rom is located on the main board. */
35463558   ROM_REGION( 0x10000, REGION_CPU2, 0 )
3547   ROM_LOAD( "epr7043",      0x0000, 0x8000, CRC(99a368ab) SHA1(a9451f39ee2613e5c3e2791d4d8d837b4a3ab666) )
3559   ROM_LOAD( "epr7043.ic126",  0x0000, 0x8000, CRC(99a368ab) SHA1(a9451f39ee2613e5c3e2791d4d8d837b4a3ab666) )
35483560
3561    /* This mcu is located on the main board. */
3562   ROM_REGION( 0x10000, REGION_CPU3, 0 )   /* Internal i8751 MCU code */
3563   ROM_LOAD( "315-5159.ic74", 0x00000, 0x1000, NO_DUMP )
3564
3565    /* These roms are located on the main board. */
35493566   ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE )
3550   ROM_LOAD( "epr7040",      0x00000, 0x8000, CRC(f30769fa) SHA1(366c1fbe4e1c8943b209f6c831c9a6b7e4372105) )
3551   ROM_LOAD( "epr7041",      0x08000, 0x8000, CRC(f3e273f9) SHA1(b8715c528299dc1e4f0c19c50d91ca9861a423a1) )
3552   ROM_LOAD( "epr7042",      0x10000, 0x8000, CRC(6841c917) SHA1(6553843eea0131eb7b5a9aa29dddf641e41d8cc3) )
3567   ROM_LOAD( "epr7040.ic4",    0x00000, 0x8000, CRC(f30769fa) SHA1(366c1fbe4e1c8943b209f6c831c9a6b7e4372105) )
3568   ROM_LOAD( "epr7041.ic5",    0x08000, 0x8000, CRC(f3e273f9) SHA1(b8715c528299dc1e4f0c19c50d91ca9861a423a1) )
3569   ROM_LOAD( "epr7042.ic6",    0x10000, 0x8000, CRC(6841c917) SHA1(6553843eea0131eb7b5a9aa29dddf641e41d8cc3) )
35533570
3571    /* These roms are located on the daughter board. */
35543572   ROM_REGION( 0x40000, REGION_GFX2, ROMREGION_ERASEFF )
3555   ROM_LOAD( "epr7110",      0x00000, 0x8000, CRC(5d1a5048) SHA1(d1626ab1981080451c912df7e4ad7f76c0cb3459) )
3556   ROM_LOAD( "epr7106",      0x08000, 0x8000, CRC(ae7ab7a2) SHA1(153691e468d29d21b95f1fbffb6896a3140d7e14) )
3557   ROM_LOAD( "epr7108",      0x10000, 0x8000, CRC(816180ac) SHA1(a59670ec77d4359041ebf12dae5b74add55d82ac) )
3558   ROM_LOAD( "epr7104",      0x18000, 0x8000, CRC(84a679c5) SHA1(19a21b1b33fc215f606093bfd61d597e4bd0b3d0) )
3559   ROM_LOAD( "epr7109",      0x20000, 0x8000, CRC(097f7481) SHA1(4d93ea01b811af1cd3e136116625e4b8e06358a2) )
3560   ROM_LOAD( "epr7105",      0x28000, 0x8000, CRC(13111729) SHA1(57ca2b945db36b056d0e40a39456fd8bf9d0a3ec) )
3561   ROM_LOAD( "epr7107",      0x30000, 0x8000, CRC(8f50ea24) SHA1(781687e202dedca7b72c9bd5b97d9d46fcfd601c) )
3573   ROM_LOAD( "epr7110.ic26",   0x00000, 0x8000, CRC(5d1a5048) SHA1(d1626ab1981080451c912df7e4ad7f76c0cb3459) )
3574   ROM_LOAD( "epr7106.ic22",   0x08000, 0x8000, CRC(ae7ab7a2) SHA1(153691e468d29d21b95f1fbffb6896a3140d7e14) )
3575   ROM_LOAD( "epr7108.ic24",   0x10000, 0x8000, CRC(816180ac) SHA1(a59670ec77d4359041ebf12dae5b74add55d82ac) )
3576   ROM_LOAD( "epr7104.ic20",   0x18000, 0x8000, CRC(84a679c5) SHA1(19a21b1b33fc215f606093bfd61d597e4bd0b3d0) )
3577   ROM_LOAD( "epr7109.ic25",   0x20000, 0x8000, CRC(097f7481) SHA1(4d93ea01b811af1cd3e136116625e4b8e06358a2) )
3578   ROM_LOAD( "epr7105.ic21",   0x28000, 0x8000, CRC(13111729) SHA1(57ca2b945db36b056d0e40a39456fd8bf9d0a3ec) )
3579   ROM_LOAD( "epr7107.ic23",   0x30000, 0x8000, CRC(8f50ea24) SHA1(781687e202dedca7b72c9bd5b97d9d46fcfd601c) )
35623580
3581    /* These proms are located on the main board. */
35633582   ROM_REGION( 0x0400, REGION_PROMS, 0 )
3564   ROM_LOAD( "epr7113",      0x0000, 0x0100, CRC(5c0e1360) SHA1(2011b3eef2a58f9bd3f3b1bb9e6c201db85727c2) ) /* palette red component */
3565   ROM_LOAD( "epr7112",      0x0100, 0x0100, CRC(46fbd351) SHA1(1fca7fbc5d5f8e13e58bbac735511bd0af392446) ) /* palette green component */
3566   ROM_LOAD( "epr7111",      0x0200, 0x0100, CRC(8123b6b9) SHA1(fb2c5498f0603b5cd270402a738c891a85453666) ) /* palette blue component */
3567   ROM_LOAD( "epr5317",      0x0300, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3583   ROM_LOAD( "epr7113.ic20",   0x00000, 0x0100, CRC(5c0e1360) SHA1(2011b3eef2a58f9bd3f3b1bb9e6c201db85727c2) ) /* palette red component */
3584   ROM_LOAD( "epr7112.ic14",   0x00100, 0x0100, CRC(46fbd351) SHA1(1fca7fbc5d5f8e13e58bbac735511bd0af392446) ) /* palette green component */
3585   ROM_LOAD( "epr7111.ic8",    0x00200, 0x0100, CRC(8123b6b9) SHA1(fb2c5498f0603b5cd270402a738c891a85453666) ) /* palette blue component - N82S129AN */
3586   ROM_LOAD( "epr5317.ic37",   0x00300, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) - N82S129AN */
3587
3588    /* These pld's are located on the main board. */
3589   ROM_REGION( 0x0618, REGION_PLDS, ROMREGION_DISPOSE )
3590   ROM_LOAD( "315-5137.bin",   0x00000, 0x0104, CRC(6ffd9e6f) SHA1(a60a3a2ec5bc256b18bfff0fec0172ee2e4fd955) ) /* TI PAL16R4A-2CN Located at IC10 */
3591   ROM_LOAD( "315-5138.bin",   0x00000, 0x0104, CRC(dd223015) SHA1(8d70f91b118e8653dda1efee3eaea287ae63809f) ) /* TI PAL16R4ACN Located at IC11 */
3592    ROM_LOAD( "315-5139.bin",   0x00000, 0x0104, NO_DUMP ) /* CK2605 located at IC50 */
3593    ROM_LOAD( "315-5155.bin",   0x00000, 0x0104, NO_DUMP ) /* Located at IC7 */
3594    ROM_LOAD( "315-5155.bin",   0x00000, 0x0104, NO_DUMP ) /* Located at IC13 */
3595    ROM_LOAD( "315-5155.bin",   0x00000, 0x0104, NO_DUMP ) /* Located at IC19 */
35683596ROM_END
35693597
35703598/*
3599    Shooting Master (SEGA) - Set 2, 8751 315-5159a
3600    Year: 1985
3601    System 2
35713602
3603    Main Board        834-5719
3604    Light Gun Board?  834-5720
3605*/
3606
3607ROM_START( shtngmsb )
3608   ROM_REGION( 0x20000, REGION_CPU1, 0 )
3609    /* This rom is located on the daughter board .*/
3610   ROM_LOAD( "epr7100a.ic18",  0x00000, 0x8000, CRC(661f0b6e) SHA1(a1d064839c95d8a6f6d89b0894259f666d637ec4) )
3611    /* These roms are located on the main board. */
3612   ROM_LOAD( "epr7101.ic91",   0x10000, 0x8000, CRC(ebf5ff72) SHA1(13ae06e3a81cf00b80ec939d5baf30143d61d480) )
3613   ROM_LOAD( "epr7102.ic92",   0x18000, 0x8000, CRC(c890a4ad) SHA1(4b59d37902ace3a69b380ff40652ee37c85f0e9d) )
3614
3615    /* This rom is located on the main board. */
3616   ROM_REGION( 0x10000, REGION_CPU2, 0 )
3617   ROM_LOAD( "epr7043.ic126",  0x0000, 0x8000, CRC(99a368ab) SHA1(a9451f39ee2613e5c3e2791d4d8d837b4a3ab666) )
3618
3619    /* This mcu is located on the main board. */
3620   ROM_REGION( 0x10000, REGION_CPU3, 0 )   /* Internal i8751 MCU code */
3621   ROM_LOAD( "315-5159a.ic74", 0x00000, 0x1000, NO_DUMP )
3622
3623    /* These roms are located on the main board. */
3624   ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE )
3625   ROM_LOAD( "epr7040.ic4",    0x00000, 0x8000, CRC(f30769fa) SHA1(366c1fbe4e1c8943b209f6c831c9a6b7e4372105) )
3626   ROM_LOAD( "epr7041.ic5",    0x08000, 0x8000, CRC(f3e273f9) SHA1(b8715c528299dc1e4f0c19c50d91ca9861a423a1) )
3627   ROM_LOAD( "epr7042.ic6",    0x10000, 0x8000, CRC(6841c917) SHA1(6553843eea0131eb7b5a9aa29dddf641e41d8cc3) )
3628
3629    /* These roms are located on the daughter board. */
3630   ROM_REGION( 0x40000, REGION_GFX2, ROMREGION_ERASEFF )
3631   ROM_LOAD( "epr7110.ic26",   0x00000, 0x8000, CRC(5d1a5048) SHA1(d1626ab1981080451c912df7e4ad7f76c0cb3459) )
3632   ROM_LOAD( "epr7106.ic22",   0x08000, 0x8000, CRC(ae7ab7a2) SHA1(153691e468d29d21b95f1fbffb6896a3140d7e14) )
3633   ROM_LOAD( "epr7108.ic24",   0x10000, 0x8000, CRC(816180ac) SHA1(a59670ec77d4359041ebf12dae5b74add55d82ac) )
3634   ROM_LOAD( "epr7104.ic20",   0x18000, 0x8000, CRC(84a679c5) SHA1(19a21b1b33fc215f606093bfd61d597e4bd0b3d0) )
3635   ROM_LOAD( "epr7109.ic25",   0x20000, 0x8000, CRC(097f7481) SHA1(4d93ea01b811af1cd3e136116625e4b8e06358a2) )
3636   ROM_LOAD( "epr7105.ic21",   0x28000, 0x8000, CRC(13111729) SHA1(57ca2b945db36b056d0e40a39456fd8bf9d0a3ec) )
3637   ROM_LOAD( "epr7107.ic23",   0x30000, 0x8000, CRC(8f50ea24) SHA1(781687e202dedca7b72c9bd5b97d9d46fcfd601c) )
3638
3639    /* These proms are located on the main board. */
3640   ROM_REGION( 0x0400, REGION_PROMS, 0 )
3641   ROM_LOAD( "epr7113.ic20",   0x00000, 0x0100, CRC(5c0e1360) SHA1(2011b3eef2a58f9bd3f3b1bb9e6c201db85727c2) ) /* palette red component */
3642   ROM_LOAD( "epr7112.ic14",   0x00100, 0x0100, CRC(46fbd351) SHA1(1fca7fbc5d5f8e13e58bbac735511bd0af392446) ) /* palette green component */
3643   ROM_LOAD( "epr7111.ic8",    0x00200, 0x0100, CRC(8123b6b9) SHA1(fb2c5498f0603b5cd270402a738c891a85453666) ) /* palette blue component - N82S129AN */
3644   ROM_LOAD( "epr5317.ic37",   0x00300, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) - N82S129AN */
3645
3646    /* These pld's are located on the main board. */
3647   ROM_REGION( 0x0618, REGION_PLDS, ROMREGION_DISPOSE )
3648   ROM_LOAD( "315-5137.bin",   0x00000, 0x0104, CRC(6ffd9e6f) SHA1(a60a3a2ec5bc256b18bfff0fec0172ee2e4fd955) ) /* TI PAL16R4A-2CN Located at IC10 */
3649   ROM_LOAD( "315-5138.bin",   0x00000, 0x0104, CRC(dd223015) SHA1(8d70f91b118e8653dda1efee3eaea287ae63809f) ) /* TI PAL16R4ACN Located at IC11 */
3650    ROM_LOAD( "315-5139.bin",   0x00000, 0x0104, NO_DUMP ) /* CK2605 located at IC50 */
3651    ROM_LOAD( "315-5155.bin",   0x00000, 0x0104, NO_DUMP ) /* Located at IC7 */
3652    ROM_LOAD( "315-5155.bin",   0x00000, 0x0104, NO_DUMP ) /* Located at IC13 */
3653    ROM_LOAD( "315-5155.bin",   0x00000, 0x0104, NO_DUMP ) /* Located at IC19 */
3654ROM_END
3655
3656/*
3657
35723658Shooting Master (EVG)
35733659Year: 1985
35743660Manufacturer: E.V.G. SRL Milano made in Italy (Sega license)
r1355r1356
36513737   ROM_LOAD( "pal16r4a(315-5137).bin",  0x0200, 0x0104, CRC(6ffd9e6f) SHA1(a60a3a2ec5bc256b18bfff0fec0172ee2e4fd955) )
36523738ROM_END
36533739
3740/*
3741    Choplifter (8751 315-5151)
3742    Year: 1985
3743    System 2
36543744
3745    Main Board 834-5795
3746*/
3747
36553748ROM_START( chplft )
36563749   ROM_REGION( 0x20000, REGION_CPU1, 0 )
3657   ROM_LOAD( "epr-7124.90",   0x00000, 0x8000, CRC(678d5c41) SHA1(7553979f78270c2ddc5b3f3ebf7817ead8e08de7) )
3658   ROM_LOAD( "epr-7125.91",   0x10000, 0x8000, CRC(f5283498) SHA1(1ad40f6d7b4cd18212ee56917240c0796f1a4ec2) )
3659   ROM_LOAD( "epr-7126.92",   0x18000, 0x8000, CRC(dbd192ab) SHA1(03d280c82599a14fc6a2065d57c6241cdc6f1143) )
3750   ROM_LOAD( "epr-7124.ic90",   0x00000, 0x8000, CRC(678d5c41) SHA1(7553979f78270c2ddc5b3f3ebf7817ead8e08de7) )
3751   ROM_LOAD( "epr-7125.ic91",   0x10000, 0x8000, CRC(f5283498) SHA1(1ad40f6d7b4cd18212ee56917240c0796f1a4ec2) )
3752   ROM_LOAD( "epr-7126.ic92",   0x18000, 0x8000, CRC(dbd192ab) SHA1(03d280c82599a14fc6a2065d57c6241cdc6f1143) )
36603753
36613754   ROM_REGION( 0x10000, REGION_CPU2, 0 )
3662   ROM_LOAD( "epr-7130.126",   0x0000, 0x8000, CRC(346af118) SHA1(ef579818a45b8ebb276d5832092b26e232d5a737) )
3755   ROM_LOAD( "epr-7130.ic126",   0x0000, 0x8000, CRC(346af118) SHA1(ef579818a45b8ebb276d5832092b26e232d5a737) )
36633756
3757   ROM_REGION( 0x10000, REGION_CPU3, 0 )   /* Internal i8751 MCU code */
3758   ROM_LOAD( "315-5151.ic74",  0x00000, 0x1000, NO_DUMP )
3759
36643760   ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE )
3665   ROM_LOAD( "epr-7127.4",      0x00000, 0x8000, CRC(1e708f6d) SHA1(b975e13bdc44105e7a15c2694e3ec53b60e23e5e) )
3666   ROM_LOAD( "epr-7128.5",      0x08000, 0x8000, CRC(b922e787) SHA1(16087671ec7de25f749b5fd66409d48ef7b35820) )
3667   ROM_LOAD( "epr-7129.6",      0x10000, 0x8000, CRC(bd3b6e6e) SHA1(c66f21b98cb8fc61a9318041ac1812c13099d974) )
3761   ROM_LOAD( "epr-7127.ic4",   0x00000, 0x8000, CRC(1e708f6d) SHA1(b975e13bdc44105e7a15c2694e3ec53b60e23e5e) )
3762   ROM_LOAD( "epr-7128.ic5",   0x08000, 0x8000, CRC(b922e787) SHA1(16087671ec7de25f749b5fd66409d48ef7b35820) )
3763   ROM_LOAD( "epr-7129.ic6",   0x10000, 0x8000, CRC(bd3b6e6e) SHA1(c66f21b98cb8fc61a9318041ac1812c13099d974) )
36683764
36693765   ROM_REGION( 0x20000, REGION_GFX2, 0 ) /* 128k for sprites data */
3670   ROM_LOAD( "epr-7121.87",   0x00000, 0x8000, CRC(f2b88f73) SHA1(2b06da1beabbea82d502fbe12f6ec3ef26056edd) )
3671   ROM_LOAD( "epr-7120.86",   0x08000, 0x8000, CRC(517d7fd3) SHA1(3fb5c00224920c3f62fb86e82caf0fee2293e1e2) )
3672   ROM_LOAD( "epr-7123.89",   0x10000, 0x8000, CRC(8f16a303) SHA1(5f2465505f001dc052e9de4cf66bc1d53fc8c7da) )
3673   ROM_LOAD( "epr-7122.88",   0x18000, 0x8000, CRC(7c93f160) SHA1(6ab156cad7556808496070f8b02a708ce405c492) )
3766   ROM_LOAD( "epr-7121.ic87",   0x00000, 0x8000, CRC(f2b88f73) SHA1(2b06da1beabbea82d502fbe12f6ec3ef26056edd) )
3767   ROM_LOAD( "epr-7120.ic86",   0x08000, 0x8000, CRC(517d7fd3) SHA1(3fb5c00224920c3f62fb86e82caf0fee2293e1e2) )
3768   ROM_LOAD( "epr-7123.ic89",   0x10000, 0x8000, CRC(8f16a303) SHA1(5f2465505f001dc052e9de4cf66bc1d53fc8c7da) )
3769   ROM_LOAD( "epr-7122.ic88",   0x18000, 0x8000, CRC(7c93f160) SHA1(6ab156cad7556808496070f8b02a708ce405c492) )
36743770
36753771   ROM_REGION( 0x0400, REGION_PROMS, 0 )
3676   ROM_LOAD( "pr7119.20",      0x0000, 0x0100, CRC(b2a8260f) SHA1(36c1debb4b3f2f190a25b18d533319d7380416de) ) /* palette red component */
3677   ROM_LOAD( "pr7118.14",      0x0100, 0x0100, CRC(693e20c7) SHA1(9ebf4bd2c30ddd9648bc4b41c7739cfdf80100da) ) /* palette green component */
3678   ROM_LOAD( "pr7117.8",      0x0200, 0x0100, CRC(4124307e) SHA1(cee28d891e6ce732c43a61acb5beeafd2200cf37) ) /* palette blue component */
3679   ROM_LOAD( "pr5317.28",      0x0300, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3772   ROM_LOAD( "pr7119.ic20",   0x0000, 0x0100, CRC(b2a8260f) SHA1(36c1debb4b3f2f190a25b18d533319d7380416de) ) /* palette red component */
3773   ROM_LOAD( "pr7118.ic14",   0x0100, 0x0100, CRC(693e20c7) SHA1(9ebf4bd2c30ddd9648bc4b41c7739cfdf80100da) ) /* palette green component */
3774   ROM_LOAD( "pr7117.ic8",      0x0200, 0x0100, CRC(4124307e) SHA1(cee28d891e6ce732c43a61acb5beeafd2200cf37) ) /* palette blue component */
3775   ROM_LOAD( "pr5317.ic28",   0x0300, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
36803776
3681   ROM_REGION( 0x0400, REGION_PLDS, ROMREGION_DISPOSE )
3682   ROM_LOAD( "pal16r4a.ic9",  0x0000, 0x0104, CRC(dd223015) SHA1(8d70f91b118e8653dda1efee3eaea287ae63809f) )
3683   ROM_LOAD( "pal16r4a.ic10", 0x0200, 0x0104, CRC(2c9229b4) SHA1(9755013afcf89f99d7a399c7e223e027761cf89a) )
3777   ROM_REGION( 0x0618, REGION_PLDS, ROMREGION_DISPOSE )
3778   ROM_LOAD( "315-5152.bin",   0x00000, 0x0104, CRC(2c9229b4) SHA1(9755013afcf89f99d7a399c7e223e027761cf89a) ) /* PAL16R4A located at IC10. */
3779    ROM_LOAD( "315-5138.bin",   0x00000, 0x0104, CRC(dd223015) SHA1(8d70f91b118e8653dda1efee3eaea287ae63809f) ) /* TI PAL16R4NC located at IC11. */
3780    ROM_LOAD( "315-5139.bin",   0x00000, 0x0104, NO_DUMP ) /* CK2605 located at IC50. */
3781    ROM_LOAD( "315-5025.bin",   0x00000, 0x0104, NO_DUMP ) /* Located at IC7. */
3782    ROM_LOAD( "315-5025.bin",   0x00000, 0x0104, NO_DUMP ) /* Located at IC13. */
3783    ROM_LOAD( "315-5025.bin",   0x00000, 0x0104, NO_DUMP ) /* Located at IC19. */
36843784ROM_END
36853785
3786/*
3787    Choplifter (Unprotected)
3788    Year: 1985
3789    System 2
3790
3791    Main Board 834-5795
3792*/
3793
36863794ROM_START( chplftb )
36873795   ROM_REGION( 0x20000, REGION_CPU1, 0 )
3688   ROM_LOAD( "epr-7152.90",   0x00000, 0x8000, CRC(fe49d83e) SHA1(307be38dd73ed37b275c1b464d266a752cb06132) )
3689   ROM_LOAD( "epr-7153.91",   0x10000, 0x8000, CRC(48697666) SHA1(0f4c6db9558272f5ceb347e742b284474f18b707) )
3690   ROM_LOAD( "epr-7154.92",   0x18000, 0x8000, CRC(56d6222a) SHA1(ad8ccf15fe7f1d6716f78490892da0167d79f678) )
3796   ROM_LOAD( "epr-7152.ic90",   0x00000, 0x8000, CRC(fe49d83e) SHA1(307be38dd73ed37b275c1b464d266a752cb06132) )
3797   ROM_LOAD( "epr-7153.ic91",   0x10000, 0x8000, CRC(48697666) SHA1(0f4c6db9558272f5ceb347e742b284474f18b707) )
3798   ROM_LOAD( "epr-7154.ic92",   0x18000, 0x8000, CRC(56d6222a) SHA1(ad8ccf15fe7f1d6716f78490892da0167d79f678) )
36913799
36923800   ROM_REGION( 0x10000, REGION_CPU2, 0 )
3693   ROM_LOAD( "epr-7130.126",   0x0000, 0x8000, CRC(346af118) SHA1(ef579818a45b8ebb276d5832092b26e232d5a737) )
3801   ROM_LOAD( "epr-7130.ic126",   0x0000, 0x8000, CRC(346af118) SHA1(ef579818a45b8ebb276d5832092b26e232d5a737) )
36943802
36953803   ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE )
3696   ROM_LOAD( "epr-7127.4",      0x00000, 0x8000, CRC(1e708f6d) SHA1(b975e13bdc44105e7a15c2694e3ec53b60e23e5e) )
3697   ROM_LOAD( "epr-7128.5",      0x08000, 0x8000, CRC(b922e787) SHA1(16087671ec7de25f749b5fd66409d48ef7b35820) )
3698   ROM_LOAD( "epr-7129.6",      0x10000, 0x8000, CRC(bd3b6e6e) SHA1(c66f21b98cb8fc61a9318041ac1812c13099d974) )
3804   ROM_LOAD( "epr-7127.ic4",   0x00000, 0x8000, CRC(1e708f6d) SHA1(b975e13bdc44105e7a15c2694e3ec53b60e23e5e) )
3805   ROM_LOAD( "epr-7128.ic5",   0x08000, 0x8000, CRC(b922e787) SHA1(16087671ec7de25f749b5fd66409d48ef7b35820) )
3806   ROM_LOAD( "epr-7129.ic6",   0x10000, 0x8000, CRC(bd3b6e6e) SHA1(c66f21b98cb8fc61a9318041ac1812c13099d974) )
36993807
37003808   ROM_REGION( 0x20000, REGION_GFX2, 0 ) /* 128k for sprites data */
3701   ROM_LOAD( "epr-7121.87",   0x00000, 0x8000, CRC(f2b88f73) SHA1(2b06da1beabbea82d502fbe12f6ec3ef26056edd) )
3702   ROM_LOAD( "epr-7120.86",   0x08000, 0x8000, CRC(517d7fd3) SHA1(3fb5c00224920c3f62fb86e82caf0fee2293e1e2) )
3703   ROM_LOAD( "epr-7123.89",   0x10000, 0x8000, CRC(8f16a303) SHA1(5f2465505f001dc052e9de4cf66bc1d53fc8c7da) )
3704   ROM_LOAD( "epr-7122.88",   0x18000, 0x8000, CRC(7c93f160) SHA1(6ab156cad7556808496070f8b02a708ce405c492) )
3809   ROM_LOAD( "epr-7121.ic87",   0x00000, 0x8000, CRC(f2b88f73) SHA1(2b06da1beabbea82d502fbe12f6ec3ef26056edd) )
3810   ROM_LOAD( "epr-7120.ic86",   0x08000, 0x8000, CRC(517d7fd3) SHA1(3fb5c00224920c3f62fb86e82caf0fee2293e1e2) )
3811   ROM_LOAD( "epr-7123.ic89",   0x10000, 0x8000, CRC(8f16a303) SHA1(5f2465505f001dc052e9de4cf66bc1d53fc8c7da) )
3812   ROM_LOAD( "epr-7122.ic88",   0x18000, 0x8000, CRC(7c93f160) SHA1(6ab156cad7556808496070f8b02a708ce405c492) )
37053813
37063814   ROM_REGION( 0x0400, REGION_PROMS, 0 )
3707   ROM_LOAD( "pr7119.20",      0x0000, 0x0100, CRC(b2a8260f) SHA1(36c1debb4b3f2f190a25b18d533319d7380416de) ) /* palette red component */
3708   ROM_LOAD( "pr7118.14",      0x0100, 0x0100, CRC(693e20c7) SHA1(9ebf4bd2c30ddd9648bc4b41c7739cfdf80100da) ) /* palette green component */
3709   ROM_LOAD( "pr7117.8",      0x0200, 0x0100, CRC(4124307e) SHA1(cee28d891e6ce732c43a61acb5beeafd2200cf37) ) /* palette blue component */
3710   ROM_LOAD( "pr5317.28",      0x0300, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3815   ROM_LOAD( "pr7119.ic20",   0x0000, 0x0100, CRC(b2a8260f) SHA1(36c1debb4b3f2f190a25b18d533319d7380416de) ) /* palette red component */
3816   ROM_LOAD( "pr7118.ic14",   0x0100, 0x0100, CRC(693e20c7) SHA1(9ebf4bd2c30ddd9648bc4b41c7739cfdf80100da) ) /* palette green component */
3817   ROM_LOAD( "pr7117.ic8",      0x0200, 0x0100, CRC(4124307e) SHA1(cee28d891e6ce732c43a61acb5beeafd2200cf37) ) /* palette blue component */
3818   ROM_LOAD( "pr5317.ic28",   0x0300, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */
3819
3820   ROM_REGION( 0x0618, REGION_PLDS, ROMREGION_DISPOSE )
3821   ROM_LOAD( "315-5152.bin",   0x00000, 0x0104, CRC(2c9229b4) SHA1(9755013afcf89f99d7a399c7e223e027761cf89a) ) /* PAL16R4A located at IC10. */
3822    ROM_LOAD( "315-5138.bin",   0x00000, 0x0104, CRC(dd223015) SHA1(8d70f91b118e8653dda1efee3eaea287ae63809f) ) /* TI PAL16R4NC located at IC11. */
3823    ROM_LOAD( "315-5139.bin",   0x00000, 0x0104, NO_DUMP ) /* CK2605 located at IC50. */
3824    ROM_LOAD( "315-5025.bin",   0x00000, 0x0104, NO_DUMP ) /* Located at IC7. */
3825    ROM_LOAD( "315-5025.bin",   0x00000, 0x0104, NO_DUMP ) /* Located at IC13. */
3826    ROM_LOAD( "315-5025.bin",   0x00000, 0x0104, NO_DUMP ) /* Located at IC19. */
37113827ROM_END
37123828
3829/*
3830    Choplifter (Bootleg)
3831    Year: 1985
3832    System 2
3833*/
3834
37133835ROM_START( chplftbl )
37143836   ROM_REGION( 0x20000, REGION_CPU1, 0 )
37153837   ROM_LOAD( "ep7124bl.90",   0x00000, 0x8000, CRC(71a37932) SHA1(72b6f8949d356b3adc5248fdaa13c2a1b9c0fa70) )
r1355r1356
47354857GAME( 1985, sscandal, myhero,   system1,  myhero,   myheroj,  ROT0,   "Coreland / Sega",       "Seishun Scandal (315-5132, Japan)", GAME_SUPPORTS_SAVE )
47364858GAME( 1985, myherok,  myhero,   system1,  myhero,   myherok,  ROT0,   "Coreland / Sega",       "My Hero (Korea)", GAME_SUPPORTS_SAVE )
47374859GAME( 1985, hvymetal, 0,        hvymetal, hvymetal, hvymetal, ROT0,   "Sega",                 "Heavy Metal (315-5135)", GAME_SUPPORTS_SAVE )
4738GAME( 1985, shtngmst, 0,        shtngmst, shtngmst, 0,        ROT0,   "Sega",                 "Shooting Master", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )   /* 8751 protection, mcu = 315-5159 */
4860GAME( 1985, shtngmst, 0,        shtngmst, shtngmst, 0,        ROT0,   "Sega",                 "Shooting Master (set 1, 8751 315-5159)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )   /* 8751 protection, mcu = 315-5159 */
47394861GAME( 1985, shtngmsa, shtngmst, shtngmst, shtngmst, 0,        ROT0,   "Sega [EVG]",            "Shooting Master (EVG)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )   /* 8751 protection, mcu = 315-5159 */
4740GAME( 1985, chplft,   0,        chplft,   chplft,   0,        ROT0,   "Sega",                 "Choplifter", GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )   /* 8751 protection */
4741GAME( 1985, chplftb,  chplft,   chplft,   chplft,   0,        ROT0,   "Sega",                 "Choplifter (alternate)", GAME_SUPPORTS_SAVE )
4862GAME( 1985, shtngmsb, shtngmst, shtngmst, shtngmst, 0,        ROT0,   "Sega",                  "Shooting Master (set 2, 8751 315-5159a)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )   /* 8751 protection, mcu = 315-5159a */
4863GAME( 1985, chplft,   0,        chplft,   chplft,   0,        ROT0,   "Sega",                 "Choplifter (8751 315-5151)", GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )   /* 8751 protection */
4864GAME( 1985, chplftb,  chplft,   chplft,   chplft,   0,        ROT0,   "Sega",                 "Choplifter (unprotected)", GAME_SUPPORTS_SAVE )
47424865GAME( 1985, chplftbl, chplft,   chplft,   chplft,   0,        ROT0,   "bootleg",              "Choplifter (bootleg)", GAME_SUPPORTS_SAVE )
47434866GAME( 1985, 4dwarrio, 0,        system1,  4dwarrio, 4dwarrio, ROT0,   "Coreland / Sega",       "4-D Warriors (315-5162)", GAME_SUPPORTS_SAVE )
47444867GAME( 1986, brain,    0,        brain,    brain,    0,        ROT0,   "Coreland / Sega",       "Brain", GAME_SUPPORTS_SAVE )
src/mame/drivers/jedi.c
r1355r1356
169169static MACHINE_START( jedi )
170170{
171171   /* set a timer to run the interrupts */
172   jedi_timer = timer_alloc(generate_interrupt);
172   jedi_timer = timer_alloc(generate_interrupt, NULL);
173173   timer_adjust(jedi_timer,video_screen_get_time_until_pos(0, 32, 0), 32, attotime_zero);
174174
175175   /* configure the banks */
r1355r1356
236236
237237static WRITE8_HANDLER( sound_latch_w )
238238{
239   timer_call_after_resynch(data, delayed_sound_latch_w);
239   timer_call_after_resynch(NULL, data, delayed_sound_latch_w);
240240}
241241
242242
src/mame/drivers/suprnova.c
r1355r1356
454454
455455static MACHINE_RESET(skns)
456456{
457   timer_pulse(ATTOTIME_IN_MSEC(2), 15, interrupt_callback);
458   timer_pulse(ATTOTIME_IN_MSEC(8), 11, interrupt_callback);
459   timer_pulse(ATTOTIME_IN_CYCLES(1824, 0), 9, interrupt_callback);
457   timer_pulse(ATTOTIME_IN_MSEC(2), NULL, 15, interrupt_callback);
458   timer_pulse(ATTOTIME_IN_MSEC(8), NULL, 11, interrupt_callback);
459   timer_pulse(ATTOTIME_IN_CYCLES(1824, 0), NULL, 9, interrupt_callback);
460460
461461   memory_set_bankptr(1,memory_region(REGION_USER1));
462462}
src/mame/drivers/witch.c
r1355r1356
655655
656656INPUT_PORTS_END
657657
658struct ES8712interface es8712_interface =
658static struct ES8712interface es8712_interface =
659659{
660660   REGION_SOUND1
661661};
src/mame/drivers/namcofl.c
r1355r1356
314314static TIMER_CALLBACK( network_interrupt_callback )
315315{
316316   cpunum_set_input_line(0, I960_IRQ0, ASSERT_LINE);
317   timer_set(video_screen_get_frame_period(0), 0, network_interrupt_callback);
317   timer_set(video_screen_get_frame_period(0), NULL, 0, network_interrupt_callback);
318318}
319319
320320
321321static TIMER_CALLBACK( vblank_interrupt_callback )
322322{
323323   cpunum_set_input_line(0, I960_IRQ2, ASSERT_LINE);
324   timer_set(video_screen_get_frame_period(0), 0, vblank_interrupt_callback);
324   timer_set(video_screen_get_frame_period(0), NULL, 0, vblank_interrupt_callback);
325325}
326326
327327
r1355r1356
335335
336336static MACHINE_START( namcofl )
337337{
338   raster_interrupt_timer = timer_alloc(raster_interrupt_callback);
338   raster_interrupt_timer = timer_alloc(raster_interrupt_callback, NULL);
339339}
340340
341341
342342static MACHINE_RESET( namcofl )
343343{
344   timer_set(video_screen_get_time_until_pos(0, machine->screen[0].visarea.max_y + 3, 0), 0, network_interrupt_callback);
345   timer_set(video_screen_get_time_until_pos(0, machine->screen[0].visarea.max_y + 1, 0), 0, vblank_interrupt_callback);
344   timer_set(video_screen_get_time_until_pos(0, machine->screen[0].visarea.max_y + 3, 0), NULL, 0, network_interrupt_callback);
345   timer_set(video_screen_get_time_until_pos(0, machine->screen[0].visarea.max_y + 1, 0), NULL, 0, vblank_interrupt_callback);
346346}
347347
348348
src/mame/drivers/megadriv.c
r1355r1356
5555/* the same on all systems? */
5656#define MASTER_CLOCK      53693100
5757/* timing details */
58int megadriv_framerate = 60;
59int megadrive_total_scanlines = 262;
60int megadrive_visible_scanlines = 224;
61int megadrive_irq6_scanline = 224;
62int megadrive_irq6_hpos = 320;
63int megadrive_z80irq_scanline = 226;
64int megadrive_z80irq_hpos = 320;
65int megadrive_imode = 0;
66int megadrive_imode_odd_frame = 0;
67int megadrive_vblank_flag = 0;
68int megadrive_irq6_pending = 0;
69int megadrive_irq4_pending = 0;
58static int megadriv_framerate = 60;
59static int megadrive_total_scanlines = 262;
60static int megadrive_visible_scanlines = 224;
61static int megadrive_irq6_scanline = 224;
62//int megadrive_irq6_hpos = 320;
63static int megadrive_z80irq_scanline = 226;
64//int megadrive_z80irq_hpos = 320;
65static int megadrive_imode = 0;
66static int megadrive_imode_odd_frame = 0;
67static int megadrive_vblank_flag = 0;
68static int megadrive_irq6_pending = 0;
69static int megadrive_irq4_pending = 0;
7070
7171INLINE UINT16 get_hposition(void);
7272
r1355r1356
7878static UINT16* megadrive_vdp_palette_lookup_highlight;
7979static UINT8 oldscreenwidth = 3;
8080UINT16* megadrive_ram;
81UINT8 megadrive_vram_fill_pending = 0;
82UINT16 megadrive_vram_fill_length = 0;
83int genesis_scanline_counter = 0;
84int megadrive_sprite_collision = 0;
81static UINT8 megadrive_vram_fill_pending = 0;
82static UINT16 megadrive_vram_fill_length = 0;
83static int genesis_scanline_counter = 0;
84static int megadrive_sprite_collision = 0;
8585static int megadrive_region_export;
8686static int megadrive_region_pal;
8787static int megadrive_max_hposition;
r1355r1356
14261426
14271427static void init_megadri6_io(void)
14281428{
1429   io_timeout[0] = timer_alloc(io_timeout0_timer_callback);
1429   io_timeout[0] = timer_alloc(io_timeout0_timer_callback, NULL);
14301430   io_stage[0] = -1;
14311431
1432   io_timeout[1] = timer_alloc(io_timeout1_timer_callback);
1432   io_timeout[1] = timer_alloc(io_timeout1_timer_callback, NULL);
14331433   io_stage[1] = -1;
14341434
14351435}
r1355r1356
42544254       top-left of the screen.  The first scanline is scanline 0 (we set scanline to -1 in
42554255       VIDEO_EOF) */
42564256
4257   timer_call_after_resynch(0, 0);
4257   timer_call_after_resynch(NULL, 0, 0);
42584258   /* Compensate for some rounding errors
42594259
42604260       When the counter reaches 261 we should have reached the end of the frame, however due
r1355r1356
44064406
44074407   megadrive_init_io(machine);
44084408
4409   frame_timer = timer_alloc(frame_timer_callback);
4410   scanline_timer = timer_alloc(scanline_timer_callback);
4411   render_timer = timer_alloc(render_timer_callback);
4409   frame_timer = timer_alloc(frame_timer_callback, NULL);
4410   scanline_timer = timer_alloc(scanline_timer_callback, NULL);
4411   render_timer = timer_alloc(render_timer_callback, NULL);
44124412
4413   irq6_on_timer = timer_alloc(irq6_on_callback);
4414   irq4_on_timer = timer_alloc(irq4_on_callback);
4413   irq6_on_timer = timer_alloc(irq6_on_callback, NULL);
4414   irq4_on_timer = timer_alloc(irq4_on_callback, NULL);
44154415
44164416   timer_adjust(frame_timer, attotime_zero, 0, attotime_zero);
44174417   timer_adjust(scanline_timer,  attotime_zero, 0, attotime_zero);
src/mame/drivers/itech32.c
r1355r1356
544544static WRITE16_HANDLER( sound_data_w )
545545{
546546   if (ACCESSING_LSB)
547      timer_call_after_resynch(data & 0xff, delayed_sound_data_w);
547      timer_call_after_resynch(NULL, data & 0xff, delayed_sound_data_w);
548548}
549549
550550
r1355r1356
557557static WRITE32_HANDLER( sound_data32_w )
558558{
559559   if (!(mem_mask & 0x00ff0000))
560      timer_call_after_resynch((data >> 16) & 0xff, delayed_sound_data_w);
560      timer_call_after_resynch(NULL, (data >> 16) & 0xff, delayed_sound_data_w);
561561}
562562
563563
src/mame/drivers/undrfire.c
r1355r1356
295295static WRITE32_HANDLER( unknown_int_req_w )
296296{
297297   /* 10000 cycle delay is arbitrary */
298   timer_set(ATTOTIME_IN_CYCLES(10000,0),0, undrfire_interrupt5);
298   timer_set(ATTOTIME_IN_CYCLES(10000,0), NULL, 0, undrfire_interrupt5);
299299}
300300
301301
src/mame/drivers/deco32.c
r1355r1356
18591859
18601860static MACHINE_RESET( deco32 )
18611861{
1862   raster_irq_timer = timer_alloc(interrupt_gen);
1862   raster_irq_timer = timer_alloc(interrupt_gen, NULL);
18631863}
18641864
18651865static INTERRUPT_GEN( deco32_vbl_interrupt )
src/mame/drivers/midzeus.c
r1355r1356
4747
4848   *(UINT32 *)ram_base *= 2;
4949
50   timer[0] = timer_alloc(NULL);
51   timer[1] = timer_alloc(NULL);
50   timer[0] = timer_alloc(NULL, NULL);
51   timer[1] = timer_alloc(NULL, NULL);
5252}
5353
5454
r1355r1356
634634   /* video hardware */
635635   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
636636   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
637   MDRV_SCREEN_SIZE(512, 278)
638   MDRV_SCREEN_VISIBLE_AREA(0, 399, 0, 255)
637   MDRV_SCREEN_SIZE(512/*+256*/, 278/*+256*/)
638   MDRV_SCREEN_VISIBLE_AREA(0, 399/*+256*/, 0, 255/*+256*/)
639639   MDRV_PALETTE_LENGTH(32768)
640640
641641   MDRV_VIDEO_START(midzeus)
src/mame/drivers/grchamp.c
r1355r1356
405405
406406static WRITE8_HANDLER( main_to_sub_comm_w )
407407{
408   timer_call_after_resynch(data | (offset << 8), main_to_sub_comm_sync_w);
408   timer_call_after_resynch(NULL, data | (offset << 8), main_to_sub_comm_sync_w);
409409}
410410
411411
src/mame/drivers/lkage.c
r1355r1356
6262static WRITE8_HANDLER( lkage_sound_command_w )
6363{
6464   soundlatch_w(offset,data);
65   timer_call_after_resynch(data,nmi_callback);
65   timer_call_after_resynch(NULL, data,nmi_callback);
6666}
6767
6868static WRITE8_HANDLER( lkage_sh_nmi_disable_w )
src/mame/drivers/aleck64.c
r1355r1356
167167
168168#include "driver.h"
169169#include "cpu/mips/mips3.h"
170#include "cpu/rsp/rsp.h"
171170#include "streams.h"
172171#include "sound/custom.h"
173172#include "includes/n64.h"
r1355r1356
434433   MDRV_CPU_VBLANK_INT( n64_vblank, 1 )
435434
436435   MDRV_CPU_ADD(RSP, 62500000)
436   MDRV_CPU_CONFIG(n64_rsp_config)
437437   MDRV_CPU_PROGRAM_MAP(rsp_map, 0)
438438
439439   MDRV_MACHINE_RESET( aleck64 )
src/mame/drivers/trackfld.c
r1355r1356
844844GFXDECODE_END
845845
846846
847struct VLM5030interface trackfld_vlm5030_interface =
847static struct VLM5030interface trackfld_vlm5030_interface =
848848{
849849   REGION_SOUND1,   /* memory region  */
850850   0           /* memory size    */
src/mame/drivers/astrof.c
r1355r1356
105105
106106static void create_irq_timer(void)
107107{
108   irq_timer = timer_alloc(irq_callback);
108   irq_timer = timer_alloc(irq_callback, NULL);
109109}
110110
111111
src/mame/drivers/maxaflex.c
r1355r1356
212212   portB_in = portB_out = ddrB   = 0;
213213   portC_in = portC_out = ddrC   = 0;
214214   tdr = tcr = 0;
215   mcu_timer = timer_alloc( mcu_timer_proc );
215   mcu_timer = timer_alloc( mcu_timer_proc , NULL);
216216
217217   output_set_lamp_value(0, 0);
218218   output_set_lamp_value(1, 0);
src/mame/drivers/vegas.c
r1355r1356
499499 *************************************/
500500
501501static void vblank_assert(int state);
502static TIMER_CALLBACK( timer_callback );
502static TIMER_CALLBACK( nile_timer_callback );
503503static void ide_interrupt(int state);
504504static void remap_dynamic_addresses(void);
505505
r1355r1356
576576   cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_READONLY, 1);
577577
578578   /* allocate timers for the NILE */
579   timer[0] = timer_alloc(NULL);
580   timer[1] = timer_alloc(NULL);
581   timer[2] = timer_alloc(timer_callback);
582   timer[3] = timer_alloc(timer_callback);
579   timer[0] = timer_alloc(NULL, NULL);
580   timer[1] = timer_alloc(NULL, NULL);
581   timer[2] = timer_alloc(nile_timer_callback, NULL);
582   timer[3] = timer_alloc(nile_timer_callback, NULL);
583583
584584   /* reset dynamic addressing */
585585   memset(nile_regs, 0, 0x1000);
r1355r1356
952952}
953953
954954
955static TIMER_CALLBACK( timer_callback )
955static TIMER_CALLBACK( nile_timer_callback )
956956{
957957   int which = param;
958958   UINT32 *regs = &nile_regs[NREG_T0CTRL + which * 4];
src/mame/drivers/segaybd.c
r1355r1356
184184
185185static MACHINE_RESET( yboard )
186186{
187    interrupt_timer = timer_alloc(scanline_callback);
187    interrupt_timer = timer_alloc(scanline_callback, NULL);
188188    timer_adjust(interrupt_timer, video_screen_get_time_until_pos(0, 223, 0), 223, attotime_zero);
189189
190190   state_save_register_global_array(misc_io_data);
r1355r1356
217217static WRITE16_HANDLER( sound_data_w )
218218{
219219   if (ACCESSING_LSB)
220      timer_call_after_resynch(data & 0xff, delayed_sound_data_w);
220      timer_call_after_resynch(NULL, data & 0xff, delayed_sound_data_w);
221221}
222222
223223
src/mame/drivers/cclimber.c
r1355r1356
167167
168168   /* we must do this on a timer in order to have it take effect */
169169   /* otherwise, the reset process will override our changes */
170   timer_call_after_resynch(0, disable_interrupts);
170   timer_call_after_resynch(NULL, 0, disable_interrupts);
171171}
172172
173173
src/mame/drivers/enigma2.c
r1355r1356
114114
115115static void create_interrupt_timers(void)
116116{
117   interrupt_clear_timer = timer_alloc(interrupt_clear_callback);
118   interrupt_assert_timer = timer_alloc(interrupt_assert_callback);
117   interrupt_clear_timer = timer_alloc(interrupt_clear_callback, NULL);
118   interrupt_assert_timer = timer_alloc(interrupt_assert_callback, NULL);
119119}
120120
121121
src/mame/drivers/segaorun.c
r1355r1356
128128
129129static void sound_data_w(UINT8 data)
130130{
131   timer_call_after_resynch(data, delayed_sound_data_w);
131   timer_call_after_resynch(NULL, data, delayed_sound_data_w);
132132}
133133
134134
r1355r1356
213213      case 65:
214214      case 129:
215215      case 193:
216         timer_set(video_screen_get_time_until_pos(0, scanline, machine->screen[0].visarea.max_x + 1), 0, irq2_gen);
216         timer_set(video_screen_get_time_until_pos(0, scanline, machine->screen[0].visarea.max_x + 1), NULL, 0, irq2_gen);
217217         next_scanline = scanline + 1;
218218         break;
219219
r1355r1356
244244   update_main_irqs();
245245
246246   /* come back at the next targeted scanline */
247   timer_set(video_screen_get_time_until_pos(0, next_scanline, 0), next_scanline, scanline_callback);
247   timer_set(video_screen_get_time_until_pos(0, next_scanline, 0), NULL, next_scanline, scanline_callback);
248248}
249249
250250
r1355r1356
275275   cpunum_set_info_fct(0, CPUINFO_PTR_M68K_RESET_CALLBACK, (genf *)outrun_reset);
276276
277277   /* start timers to track interrupts */
278   timer_set(video_screen_get_time_until_pos(0, 223, 0), 223, scanline_callback);
278   timer_set(video_screen_get_time_until_pos(0, 223, 0), NULL, 223, scanline_callback);
279279}
280280
281281
src/mame/drivers/mazerbla.c
r1355r1356
335335static READ8_HANDLER( ls670_0_r )
336336{
337337   /* set a timer to force synchronization after the read */
338   timer_call_after_resynch(0, NULL);
338   timer_call_after_resynch(NULL, 0, NULL);
339339
340340   return ls670_0[offset];
341341}
r1355r1356
351351static WRITE8_HANDLER( ls670_0_w )
352352{
353353   /* do this on a timer to let the CPUs synchronize */
354   timer_call_after_resynch((offset<<8) | data, deferred_ls670_0_w);
354   timer_call_after_resynch(NULL, (offset<<8) | data, deferred_ls670_0_w);
355355}
356356
357357
r1355r1356
359359static READ8_HANDLER( ls670_1_r )
360360{
361361   /* set a timer to force synchronization after the read */
362   timer_call_after_resynch(0, NULL);
362   timer_call_after_resynch(NULL, 0, NULL);
363363
364364   return ls670_1[offset];
365365}
r1355r1356
375375static WRITE8_HANDLER( ls670_1_w )
376376{
377377   /* do this on a timer to let the CPUs synchronize */
378   timer_call_after_resynch((offset<<8) | data, deferred_ls670_1_w);
378   timer_call_after_resynch(NULL, (offset<<8) | data, deferred_ls670_1_w);
379379}
380380
381381
r1355r1356
10841084
10851085static WRITE8_HANDLER( main_sound_w )
10861086{
1087   timer_call_after_resynch(data & 0xff, delayed_sound_w);
1087   timer_call_after_resynch(NULL, data & 0xff, delayed_sound_w);
10881088}
10891089
10901090
src/mame/drivers/foodf.c
r1355r1356
153153static MACHINE_START( foodf )
154154{
155155   state_save_register_global(whichport);
156   scanline_timer = timer_alloc(scanline_update);
156   scanline_timer = timer_alloc(scanline_update, NULL);
157157}
158158
159159
src/mame/drivers/acefruit.c
r1355r1356
4848
4949static VIDEO_START( acefruit )
5050{
51   acefruit_refresh_timer = timer_alloc( acefruit_refresh );
51   acefruit_refresh_timer = timer_alloc( acefruit_refresh , NULL);
5252}
5353
5454static INTERRUPT_GEN( acefruit_vblank )
src/mame/drivers/sprint4.c
r1355r1356
122122      cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
123123   }
124124
125   timer_set(video_screen_get_time_until_pos(0, scanline, 0), scanline, nmi_callback);
125   timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, nmi_callback);
126126}
127127
128128
129129static MACHINE_RESET( sprint4 )
130130{
131   timer_set(video_screen_get_time_until_pos(0, 32, 0), 32, nmi_callback);
131   timer_set(video_screen_get_time_until_pos(0, 32, 0), NULL, 32, nmi_callback);
132132
133133   memset(steer_FF1, 0, sizeof steer_FF1);
134134   memset(steer_FF2, 0, sizeof steer_FF2);
src/mame/drivers/mpu4.c
r1355r1356
11971197   pia_config(4,&pia_ic7_intf);
11981198   pia_config(5,&pia_ic8_intf);
11991199
1200   ic24_timer = timer_alloc(ic24_timeout);
1200   ic24_timer = timer_alloc(ic24_timeout, NULL);
12011201   // setup ptm ////////////////////////////////////////////////////////////
12021202   ptm6840_config(0, &ptm_ic2_intf );
12031203}
src/mame/drivers/system16.c
r1355r1356
271271};
272272
273273
274UINT8 *tturfbl_soundbank_ptr = NULL;      /* Pointer to currently selected portion of ROM */
274static UINT8 *tturfbl_soundbank_ptr = NULL;      /* Pointer to currently selected portion of ROM */
275275
276276static READ8_HANDLER( tturfbl_soundbank_r )
277277{
src/mame/drivers/pipeline.c
r1355r1356
209209
210210static WRITE8_HANDLER(protection_w)
211211{
212   timer_call_after_resynch(data, protection_deferred_w);
212   timer_call_after_resynch(NULL, data, protection_deferred_w);
213213   cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100));
214214}
215215
src/mame/drivers/simpsons.c
r1355r1356
8585{
8686//  sound_nmi_enabled = 1;
8787   cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE);
88   timer_set(ATTOTIME_IN_USEC(25),0,nmi_callback);   /* kludge until the K053260 is emulated correctly */
88   timer_set(ATTOTIME_IN_USEC(25), NULL,0,nmi_callback);   /* kludge until the K053260 is emulated correctly */
8989}
9090
9191static ADDRESS_MAP_START( z80_map, ADDRESS_SPACE_PROGRAM, 8 )
r1355r1356
266266      simpsons_objdma();
267267
268268      // 32+256us delay at 8MHz dotclock; artificially shortened since actual V-blank length is unknown
269      timer_set(ATTOTIME_IN_USEC(30), 0, dmaend_callback);
269      timer_set(ATTOTIME_IN_USEC(30), NULL, 0, dmaend_callback);
270270   }
271271
272272   if (K052109_is_IRQ_enabled())
src/mame/drivers/taito_b.c
r1355r1356
216216
217217static INTERRUPT_GEN( rastansaga2_interrupt )
218218{
219   timer_set(ATTOTIME_IN_CYCLES(5000,0),0,rsaga2_interrupt2);
219   timer_set(ATTOTIME_IN_CYCLES(5000,0), NULL, 0, rsaga2_interrupt2);
220220   cpunum_set_input_line(0, 4, HOLD_LINE);
221221}
222222
r1355r1356
228228
229229static INTERRUPT_GEN( crimec_interrupt )
230230{
231   timer_set(ATTOTIME_IN_CYCLES(5000,0),0,crimec_interrupt3);
231   timer_set(ATTOTIME_IN_CYCLES(5000,0), NULL, 0, crimec_interrupt3);
232232   cpunum_set_input_line(0, 5, HOLD_LINE);
233233}
234234
r1355r1356
240240
241241static INTERRUPT_GEN( hitice_interrupt )
242242{
243   timer_set(ATTOTIME_IN_CYCLES(5000,0),0,hitice_interrupt6);
243   timer_set(ATTOTIME_IN_CYCLES(5000,0), NULL, 0, hitice_interrupt6);
244244   cpunum_set_input_line(0, 4, HOLD_LINE);
245245}
246246
r1355r1356
252252
253253static INTERRUPT_GEN( rambo3_interrupt )
254254{
255   timer_set(ATTOTIME_IN_CYCLES(5000,0),0,rambo3_interrupt1);
255   timer_set(ATTOTIME_IN_CYCLES(5000,0), NULL, 0, rambo3_interrupt1);
256256   cpunum_set_input_line(0, 6, HOLD_LINE);
257257}
258258
r1355r1356
264264
265265static INTERRUPT_GEN( pbobble_interrupt )
266266{
267   timer_set(ATTOTIME_IN_CYCLES(5000,0),0,pbobble_interrupt5);
267   timer_set(ATTOTIME_IN_CYCLES(5000,0), NULL, 0, pbobble_interrupt5);
268268   cpunum_set_input_line(0, 3, HOLD_LINE);
269269}
270270
r1355r1356
275275
276276static INTERRUPT_GEN( viofight_interrupt )
277277{
278   timer_set(ATTOTIME_IN_CYCLES(5000,0),0,viofight_interrupt1);
278   timer_set(ATTOTIME_IN_CYCLES(5000,0), NULL, 0, viofight_interrupt1);
279279   cpunum_set_input_line(0, 4, HOLD_LINE);
280280}
281281
r1355r1356
286286
287287static INTERRUPT_GEN( masterw_interrupt )
288288{
289   timer_set(ATTOTIME_IN_CYCLES(5000,0),0,masterw_interrupt4);
289   timer_set(ATTOTIME_IN_CYCLES(5000,0), NULL, 0, masterw_interrupt4);
290290   cpunum_set_input_line(0, 5, HOLD_LINE);
291291}
292292
r1355r1356
297297
298298static INTERRUPT_GEN( silentd_interrupt )
299299{
300   timer_set(ATTOTIME_IN_CYCLES(5000,0),0,silentd_interrupt4);
300   timer_set(ATTOTIME_IN_CYCLES(5000,0), NULL, 0, silentd_interrupt4);
301301   cpunum_set_input_line(0, 6, HOLD_LINE);
302302}
303303
r1355r1356
308308
309309static INTERRUPT_GEN( selfeena_interrupt )
310310{
311   timer_set(ATTOTIME_IN_CYCLES(5000,0),0,selfeena_interrupt4);
311   timer_set(ATTOTIME_IN_CYCLES(5000,0), NULL, 0, selfeena_interrupt4);
312312   cpunum_set_input_line(0, 6, HOLD_LINE);
313313}
314314
r1355r1356
319319
320320static INTERRUPT_GEN( sbm_interrupt )//5
321321{
322   timer_set(ATTOTIME_IN_CYCLES(10000,0),0,sbm_interrupt5);
322   timer_set(ATTOTIME_IN_CYCLES(10000,0), NULL, 0, sbm_interrupt5);
323323   cpunum_set_input_line(0, 4, HOLD_LINE);
324324}
325325
src/mame/drivers/mw8080bw.c
r1355r1356
872872static MACHINE_START( maze )
873873{
874874   /* create astable timer for IC B1 */
875   timer_pulse(MAZE_555_B1_PERIOD, 0, maze_tone_timing_timer_callback);
875   timer_pulse(MAZE_555_B1_PERIOD, NULL, 0, maze_tone_timing_timer_callback);
876876
877877   /* initialize state of Tone Timing FF, IC C1 */
878878   maze_tone_timing_state = 0;
r1355r1356
20482048static MACHINE_START( spcenctr )
20492049{
20502050   /* create timers */
2051   spcenctr_strobe_on_timer = timer_alloc(spcenctr_strobe_timer_callback);
2052   spcenctr_strobe_off_timer = timer_alloc(spcenctr_strobe_timer_callback);
2051   spcenctr_strobe_on_timer = timer_alloc(spcenctr_strobe_timer_callback, NULL);
2052   spcenctr_strobe_off_timer = timer_alloc(spcenctr_strobe_timer_callback, NULL);
20532053
20542054   /* setup for save states */
20552055   state_save_register_global(spcenctr_strobe_state);
src/mame/drivers/vaportra.c
r1355r1356
2727static WRITE16_HANDLER( vaportra_sound_w )
2828{
2929   /* Force synchronisation between CPUs with fake timer */
30   timer_call_after_resynch(0, NULL);
30   timer_call_after_resynch(NULL, 0, NULL);
3131   soundlatch_w(0,data & 0xff);
3232   cpunum_set_input_line(1,0,ASSERT_LINE);
3333}
src/mame/drivers/qdrmfgp.c
r1355r1356
656656   sndram = memory_region(REGION_SOUND1) + 0x100000;
657657
658658   /* sound irq (CCU? 240Hz) */
659   timer_pulse(ATTOTIME_IN_HZ(18432000/76800), 0, gp2_timer_callback);
659   timer_pulse(ATTOTIME_IN_HZ(18432000/76800), NULL, 0, gp2_timer_callback);
660660
661661   /* reset the IDE controller */
662662   gp2_irq_control = 0;
src/mame/drivers/scobra.c
r1355r1356
13731373INPUT_PORTS_END
13741374
13751375
1376struct AY8910interface scobra_ay8910_interface_2 =
1376static struct AY8910interface scobra_ay8910_interface_2 =
13771377{
13781378   soundlatch_r,
13791379   scramble_portB_r
src/mame/drivers/gaelco3d.c
r1355r1356
197197   cpunum_set_info_fct(2, CPUINFO_PTR_ADSP2100_TX_HANDLER, (genf *)adsp_tx_callback);
198198
199199   /* allocate a timer for feeding the autobuffer */
200   adsp_autobuffer_timer = timer_alloc(adsp_autobuffer_irq);
200   adsp_autobuffer_timer = timer_alloc(adsp_autobuffer_irq, NULL);
201201
202202   memory_configure_bank(1, 0, 256, memory_region(REGION_USER1), 0x4000);
203203   memory_set_bank(1, 0);
r1355r1356
315315{
316316   logerror("%06X:sound_data_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask);
317317   if (!(mem_mask & 0xff))
318      timer_call_after_resynch(data & 0xff, delayed_sound_w);
318      timer_call_after_resynch(NULL, data & 0xff, delayed_sound_w);
319319}
320320static WRITE32_HANDLER( sound_data_020_w ) { if ((mem_mask & 0xffff0000) != 0xffff0000) sound_data_w(offset, data >> 16, mem_mask >> 16); }
321321
src/mame/drivers/namcos11.c
r1355r1356
824824   int n_game;
825825   emu_timer *timer;
826826
827   timer = timer_alloc( mcu_timer );
827   timer = timer_alloc( mcu_timer , NULL);
828828   timer_adjust( timer, ATTOTIME_IN_HZ( 600 ), 0, ATTOTIME_IN_HZ( 600 ) );
829829
830830   psx_driver_init();
src/mame/drivers/itech8.c
r1355r1356
622622   machine_start_itech8(machine);
623623
624624   /* we need to update behind the beam as well */
625   timer_set(video_screen_get_time_until_pos(0, 0, 0), 32, behind_the_beam_update);
625   timer_set(video_screen_get_time_until_pos(0, 0, 0), NULL, 32, behind_the_beam_update);
626626}
627627
628628static MACHINE_RESET( itech8 )
r1355r1356
674674   if (scanline >= 256) scanline = 0;
675675
676676   /* set a new timer */
677   timer_set(video_screen_get_time_until_pos(0, scanline, 0), (scanline << 8) + interval, behind_the_beam_update);
677   timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, (scanline << 8) + interval, behind_the_beam_update);
678678}
679679
680680
r1355r1356
786786
787787static WRITE8_HANDLER( sound_data_w )
788788{
789   timer_call_after_resynch(data, delayed_sound_data_w);
789   timer_call_after_resynch(NULL, data, delayed_sound_data_w);
790790}
791791
792792
r1355r1356
797797          ((data & 0x5d) << 1) |
798798          ((data & 0x20) >> 3) |
799799          ((data & 0x02) << 5);
800   timer_call_after_resynch(data, delayed_sound_data_w);
800   timer_call_after_resynch(NULL, data, delayed_sound_data_w);
801801}
802802
803803
src/mame/drivers/snk.c
r1355r1356
236236INTERRUPT_GEN( snk_irq_AB )
237237{
238238   cpunum_set_input_line(0, 0, HOLD_LINE);
239   timer_set(ATTOTIME_IN_USEC(snk_irq_delay), 1, irq_trigger_callback);
239   timer_set(ATTOTIME_IN_USEC(snk_irq_delay), NULL, 1, irq_trigger_callback);
240240}
241241
242242INTERRUPT_GEN( snk_irq_BA )
243243{
244244   cpunum_set_input_line(1, 0, HOLD_LINE);
245   timer_set(ATTOTIME_IN_USEC(snk_irq_delay), 0, irq_trigger_callback);
245   timer_set(ATTOTIME_IN_USEC(snk_irq_delay), NULL, 0, irq_trigger_callback);
246246}
247247
248248// NMI handshakes between CPUs are determined to be much simpler
src/mame/drivers/hyprduel.c
r1355r1356
196196      cpunum_set_input_line(0, 2, HOLD_LINE);
197197      cpunum_set_input_line(1, 1, HOLD_LINE);
198198      /* the duration is a guess */
199      timer_set(ATTOTIME_IN_USEC(2500), 0x20, vblank_end_callback);
199      timer_set(ATTOTIME_IN_USEC(2500), NULL, 0x20, vblank_end_callback);
200200      rastersplit = 0;
201201   } else {
202202      requested_int |= 0x12;      /* hsync */
r1355r1356
367367                       another blit. */
368368               if (b1 == 0)
369369               {
370                  timer_set(ATTOTIME_IN_USEC(500),0,hyprduel_blit_done);
370                  timer_set(ATTOTIME_IN_USEC(500), NULL,0,hyprduel_blit_done);
371371                  return;
372372               }
373373
src/mame/drivers/namconb1.c
r1355r1356
347347   }
348348   if( scanline < NAMCONB1_VBSTART )
349349   {
350      timer_set( video_screen_get_time_until_pos(0, scanline, 0), scanline, namconb2_TriggerPOSIRQ );
350      timer_set( video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, namconb2_TriggerPOSIRQ );
351351   }
352352} /* namconb2_interrupt */
353353static INTERRUPT_GEN( namconb1_interrupt )
r1355r1356
395395   }
396396   if( scanline < NAMCONB1_VBSTART )
397397   {
398      timer_set( video_screen_get_time_until_pos(0, scanline, 0), scanline, namconb1_TriggerPOSIRQ );
398      timer_set( video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, namconb1_TriggerPOSIRQ );
399399   }
400400} /* namconb1_interrupt */
401401
src/mame/drivers/flstory.c
r1355r1356
8787static WRITE8_HANDLER( sound_command_w )
8888{
8989   soundlatch_w(0,data);
90   timer_call_after_resynch(data,nmi_callback);
90   timer_call_after_resynch(NULL, data,nmi_callback);
9191}
9292
9393
src/mame/drivers/f-32.c
r1355r1356
8787   AM_RANGE(0xfff00000, 0xffffffff) AM_ROM AM_REGION(REGION_USER1,0)
8888ADDRESS_MAP_END
8989
90static READ32_HANDLER( f32_input_port_1_r )
91{
92   /* burn a bunch of cycles because this is polled frequently during busy loops */
93   if ((activecpu_get_pc() == 0x000379de) ||
94       (activecpu_get_pc() == 0x000379cc) ) activecpu_adjust_icount(-100);
95   //else printf("PC %08x\n", activecpu_get_pc() );
96   return input_port_1_dword_r(0, 0);
97}
98
99
90100static ADDRESS_MAP_START( mosaicf2_io, ADDRESS_SPACE_IO, 32 )
91101   AM_RANGE(0x4000, 0x4003) AM_READ(oki_32bit_r)
92102   AM_RANGE(0x4810, 0x4813) AM_READ(ym2151_status_32bit_r)
93103   AM_RANGE(0x5000, 0x5003) AM_READ(input_port_0_dword_r)
94   AM_RANGE(0x5200, 0x5203) AM_READ(input_port_1_dword_r)
104   AM_RANGE(0x5200, 0x5203) AM_READ(f32_input_port_1_r)
95105   AM_RANGE(0x5400, 0x5403) AM_READ(eeprom_r)
96106   AM_RANGE(0x6000, 0x6003) AM_WRITE(oki_32bit_w)
97107   AM_RANGE(0x6800, 0x6803) AM_WRITE(ym2151_data_32bit_w)
src/mame/drivers/atetris.c
r1355r1356
8484   scanline += 32;
8585   if (scanline >= 256)
8686      scanline -= 256;
87   timer_set(video_screen_get_time_until_pos(0, scanline, 0), scanline, interrupt_gen);
87   timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, interrupt_gen);
8888}
8989
9090
r1355r1356
109109   memcpy(slapstic_base, &slapstic_source[current_bank * 0x4000], 0x4000);
110110
111111   /* start interrupts going (32V clocked by 16V) */
112   timer_set(video_screen_get_time_until_pos(0, 48, 0), 48, interrupt_gen);
112   timer_set(video_screen_get_time_until_pos(0, 48, 0), NULL, 48, interrupt_gen);
113113}
114114
115115
src/mame/drivers/model2.c
r1355r1356
341341
342342   model2_timerrun[0] = model2_timerrun[1] = model2_timerrun[2] = model2_timerrun[3] = 0;
343343
344   model2_timers[0] = timer_alloc(model2_timer_0_cb);
345   model2_timers[1] = timer_alloc(model2_timer_1_cb);
346   model2_timers[2] = timer_alloc(model2_timer_2_cb);
347   model2_timers[3] = timer_alloc(model2_timer_3_cb);
344   model2_timers[0] = timer_alloc(model2_timer_0_cb, NULL);
345   model2_timers[1] = timer_alloc(model2_timer_1_cb, NULL);
346   model2_timers[2] = timer_alloc(model2_timer_2_cb, NULL);
347   model2_timers[3] = timer_alloc(model2_timer_3_cb, NULL);
348348
349349   timer_adjust(model2_timers[0], attotime_never, 0, attotime_never);
350350   timer_adjust(model2_timers[1], attotime_never, 0, attotime_never);
r1355r1356
621621/* GEO */
622622
623623UINT32 geo_read_start_address = 0;
624UINT32 geo_write_start_address = 0;
624static UINT32 geo_write_start_address = 0;
625625
626626static WRITE32_HANDLER( geo_ctl1_w )
627627{
src/mame/drivers/espial.c
r1355r1356
2424MACHINE_RESET( espial )
2525{
2626   /* we must start with NMI interrupts disabled */
27   timer_call_after_resynch(0, interrupt_disable);
27   timer_call_after_resynch(NULL, 0, interrupt_disable);
2828   sound_nmi_enabled = FALSE;
2929}
3030
src/mame/drivers/hyperspt.c
r1355r1356
450450
451451
452452
453struct VLM5030interface hyperspt_vlm5030_interface =
453static struct VLM5030interface hyperspt_vlm5030_interface =
454454{
455455   REGION_SOUND1,   /* memory region  */
456456   0         /* memory size    */
src/mame/drivers/tmnt.c
r1355r1356
359359{
360360//  sound_nmi_enabled = 1;
361361   cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE);
362   timer_set(ATTOTIME_IN_USEC(50),0,nmi_callback);   /* kludge until the K053260 is emulated correctly */
362   timer_set(ATTOTIME_IN_USEC(50), NULL,0,nmi_callback);   /* kludge until the K053260 is emulated correctly */
363363}
364364
365365
src/mame/drivers/jpmimpct.c
r1355r1356
174174{
175175   memset(&duart_1, 0, sizeof(duart_1));
176176
177   duart_1_timer = timer_alloc(duart_1_timer_event);
177   duart_1_timer = timer_alloc(duart_1_timer_event, NULL);
178178
179179   /* Reset states */
180180   duart_1_irq = tms_irq = 0;
src/mame/drivers/scramble.c
r1355r1356
19441944   sfx_sh_irqtrigger_w
19451945};
19461946
1947struct AY8910interface explorer_ay8910_interface_1 =
1947static struct AY8910interface explorer_ay8910_interface_1 =
19481948{
19491949   scramble_portB_r
19501950};
19511951
1952struct AY8910interface explorer_ay8910_interface_2 =
1952static struct AY8910interface explorer_ay8910_interface_2 =
19531953{
19541954   hotshock_soundlatch_r
19551955};
19561956
1957struct AY8910interface hotshock_ay8910_interface_2 =
1957static struct AY8910interface hotshock_ay8910_interface_2 =
19581958{
19591959   hotshock_soundlatch_r,
19601960   scramble_portB_r
19611961};
19621962
1963struct AY8910interface scorpion_ay8910_interface_1 =
1963static struct AY8910interface scorpion_ay8910_interface_1 =
19641964{
19651965   0,
19661966   0,
r1355r1356
19681968   scorpion_sound_cmd_w,
19691969};
19701970
1971struct AY8910interface triplep_ay8910_interface =
1971static struct AY8910interface triplep_ay8910_interface =
19721972{
19731973   0
19741974};
src/mame/drivers/system18.c
r1355r1356
190190   MSM5205_S48_4B
191191};
192192
193UINT8* shdancbl_soundbank_ptr = NULL;      /* Pointer to currently selected portion of ROM */
193static UINT8* shdancbl_soundbank_ptr = NULL;      /* Pointer to currently selected portion of ROM */
194194
195195static WRITE16_HANDLER( sound_command_irq_w ){
196196   if( ACCESSING_LSB ){
src/mame/drivers/berzerk.c
r1355r1356
170170
171171static void create_irq_timer(void)
172172{
173   irq_timer = timer_alloc(irq_callback);
173   irq_timer = timer_alloc(irq_callback, NULL);
174174}
175175
176176
r1355r1356
247247
248248static void create_nmi_timer(void)
249249{
250   nmi_timer = timer_alloc(nmi_callback);
250   nmi_timer = timer_alloc(nmi_callback, NULL);
251251}
252252
253253
src/mame/drivers/tehkanwc.c
r1355r1356
175175
176176   /* in Gridiron, the sound CPU goes in a tight loop after the self test, */
177177   /* probably waiting to be reset by a watchdog */
178   if (activecpu_get_pc() == 0x08bc) timer_set(ATTOTIME_IN_SEC(1),0,reset_callback);
178   if (activecpu_get_pc() == 0x08bc) timer_set(ATTOTIME_IN_SEC(1), NULL,0,reset_callback);
179179}
180180
181181
src/mame/drivers/suprridr.c
r1355r1356
123123
124124static WRITE8_HANDLER( sound_data_w )
125125{
126   timer_call_after_resynch(data, delayed_sound_w);
126   timer_call_after_resynch(NULL, data, delayed_sound_w);
127127}
128128
129129
src/mame/drivers/psikyo.c
r1355r1356
130130
131131      /* main CPU might be waiting for sound CPU to finish NMI,
132132           so set a timer to give sound CPU a chance to run */
133      timer_call_after_resynch(0, NULL);
133      timer_call_after_resynch(NULL, 0, NULL);
134134//      logerror("PC %06X - Read coin port during Z80 NMI\n", activecpu_get_pc());
135135   }
136136
r1355r1356
171171static WRITE32_HANDLER( psikyo_soundlatch_w )
172172{
173173   if (ACCESSING_LSB32)
174      timer_call_after_resynch(data & 0xff, psikyo_soundlatch_callback);
174      timer_call_after_resynch(NULL, data & 0xff, psikyo_soundlatch_callback);
175175}
176176
177177/***************************************************************************
r1355r1356
181181static WRITE32_HANDLER( s1945_soundlatch_w )
182182{
183183   if (!(mem_mask & 0x00ff0000))
184      timer_call_after_resynch((data >> 16) & 0xff, psikyo_soundlatch_callback);
184      timer_call_after_resynch(NULL, (data >> 16) & 0xff, psikyo_soundlatch_callback);
185185}
186186
187187static UINT8 s1945_table[256] = {
r1355r1356
15521552***************************************************************************/
15531553
15541554
1555struct YM2610interface sngkace_ym2610_interface =
1555static struct YM2610interface sngkace_ym2610_interface =
15561556{
15571557   sound_irq,   /* irq */
15581558   REGION_SOUND1,   /* delta_t */
r1355r1356
16061606***************************************************************************/
16071607
16081608
1609struct YM2610interface gunbird_ym2610_interface =
1609static struct YM2610interface gunbird_ym2610_interface =
16101610{
16111611   sound_irq,   /* irq */
16121612   REGION_SOUND1,   /* delta_t */
src/mame/drivers/pgm.c
r1355r1356
376376
377377#ifdef PGMARM7SPEEDHACK
378378   cpu_trigger(1000);
379   timer_set(ATTOTIME_IN_USEC(50), 0, arm_irq); // i don't know how long..
379   timer_set(ATTOTIME_IN_USEC(50), NULL, 0, arm_irq); // i don't know how long..
380380   cpu_spinuntil_trigger(1002);
381381#else
382382   cpunum_set_input_line(2, ARM7_FIRQ_LINE, PULSE_LINE);
src/mame/drivers/gameplan.c
r1355r1356
262262         /* set a timer for an arbitrarily short period.
263263               The real time it takes to clear to screen is not
264264               important to the software */
265         timer_call_after_resynch(0, clear_screen_done_callback);
265         timer_call_after_resynch(NULL, 0, clear_screen_done_callback);
266266
267267         break;
268268      }
r1355r1356
281281   /* Kaos sits in a tight loop polling the VIA irq flags register, but that register is
282282       cleared by the irq handler. Therefore, I wait a bit before triggering the irq to
283283       leave time for the program to see the flag change. */
284   timer_set(ATTOTIME_IN_USEC(50), state, via_irq_delayed);
284   timer_set(ATTOTIME_IN_USEC(50), NULL, state, via_irq_delayed);
285285}
286286
287287
r1355r1356
319319
320320static void create_via_0_timer(void)
321321{
322   via_0_ca1_timer = timer_alloc(via_0_ca1_timer_callback);
322   via_0_ca1_timer = timer_alloc(via_0_ca1_timer_callback, NULL);
323323}
324324
325325
src/mame/drivers/capbowl.c
r1355r1356
129129   video_screen_update_partial(0, scanline - 1);
130130   scanline += 32;
131131   if (scanline > 240) scanline = 32;
132   timer_set(video_screen_get_time_until_pos(0, scanline, 0), scanline, capbowl_update);
132   timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, capbowl_update);
133133}
134134
135135
136136static MACHINE_RESET( capbowl )
137137{
138   timer_set(video_screen_get_time_until_pos(0, 32, 0), 32, capbowl_update);
138   timer_set(video_screen_get_time_until_pos(0, 32, 0), NULL, 32, capbowl_update);
139139}
140140
141141
src/mame/drivers/kinst.c
r1355r1356
249249static INTERRUPT_GEN( irq0_start )
250250{
251251   cpunum_set_input_line(0, 0, ASSERT_LINE);
252   timer_set(ATTOTIME_IN_USEC(50), 0, irq0_stop);
252   timer_set(ATTOTIME_IN_USEC(50), NULL, 0, irq0_stop);
253253}
254254
255255
r1355r1356
392392      UINT32 r26 = activecpu_get_reg(MIPS3_R26) - *kinst_speedup;
393393      if (r26 < r3)
394394      {
395         timer_set(ATTOTIME_IN_CYCLES((r3 - r26) * 2, 0), 0, end_spin);
395         timer_set(ATTOTIME_IN_CYCLES((r3 - r26) * 2, 0), NULL, 0, end_spin);
396396         cpu_spinuntil_int();
397397      }
398398   }
src/mame/drivers/beathead.c
r1355r1356
156156   update_interrupts();
157157
158158   /* set the timer for the next one */
159   timer_set(double_to_attotime(attotime_to_double(video_screen_get_time_until_pos(0, scanline, 0)) - hblank_offset), scanline, scanline_callback);
159   timer_set(double_to_attotime(attotime_to_double(video_screen_get_time_until_pos(0, scanline, 0)) - hblank_offset), NULL, scanline, scanline_callback);
160160}
161161
162162
r1355r1356
173173
174174   /* compute the timing of the HBLANK interrupt and set the first timer */
175175   hblank_offset = attotime_to_double(video_screen_get_scan_period(0)) * ((455. - 336. - 25.) / 455.);
176   timer_set(double_to_attotime(attotime_to_double(video_screen_get_time_until_pos(0, 0, 0)) - hblank_offset), 0, scanline_callback);
176   timer_set(double_to_attotime(attotime_to_double(video_screen_get_time_until_pos(0, 0, 0)) - hblank_offset), NULL, 0, scanline_callback);
177177
178178   /* reset IRQs */
179179   irq_line_state = CLEAR_LINE;
src/mame/drivers/st0016.c
r1355r1356
105105   if(!offset)
106106      latches[2]|=1;
107107   COMBINE_DATA(&latches[offset]);
108   timer_call_after_resynch(0, NULL);
108   timer_call_after_resynch(NULL, 0, NULL);
109109}
110110
111111static READ8_HANDLER(latch8_r)
r1355r1356
120120   if(!offset)
121121      latches[2]|=2;
122122   latches[offset]=data;
123   timer_call_after_resynch(0, NULL);
123   timer_call_after_resynch(NULL, 0, NULL);
124124}
125125
126126static ADDRESS_MAP_START( v810_mem,ADDRESS_SPACE_PROGRAM, 32 )
src/mame/drivers/sbasketb.c
r1355r1356
227227GFXDECODE_END
228228
229229
230struct VLM5030interface sbasketb_vlm5030_interface =
230static struct VLM5030interface sbasketb_vlm5030_interface =
231231{
232232   REGION_SOUND1,   /* memory region  */
233233   0           /* memory size    */
src/mame/drivers/xexex.c
r1355r1356
633633
634634   resume_trigger = 1000;
635635
636   dmadelay_timer = timer_alloc(dmaend_callback);
636   dmadelay_timer = timer_alloc(dmaend_callback, NULL);
637637}
638638
639639
src/mame/drivers/skullxbo.c
r1355r1356
6363   if (check < &atarigen_alpha[0x7c0] && (*check & 0x8000))
6464   {
6565      attotime period = video_screen_get_time_until_pos(scrnum, video_screen_get_vpos(scrnum) + 6, machine->screen[scrnum].width * 0.9);
66      timer_set(period, 0, irq_gen);
66      timer_set(period, NULL, 0, irq_gen);
6767   }
6868
6969   /* update the playfield and motion objects */
src/mame/drivers/cps3.c
r1355r1356
366366static UINT32* cps3_eeprom;
367367static UINT32* cps3_fullscreenzoom;
368368
369UINT32 cps3_ss_pal_base = 0;
369static UINT32 cps3_ss_pal_base = 0;
370370static UINT32* cps3_colourram;
371371static UINT32 cps3_unk_vidregs[0x20/4];
372UINT32 cps3_ss_bank_base = 0;
372static UINT32 cps3_ss_bank_base = 0;
373373
374374static UINT32 cps3_screenwidth;
375375//cdrom_file* cps3_cd;
r1355r1356
20382038//static UINT8* current_table;
20392039static UINT32 current_table_address = -1;
20402040
2041int cps3_rle_length = 0;
2041static int cps3_rle_length = 0;
20422042
20432043static int last_normal_byte = 0;
20442044
r1355r1356
25152515
25162516   if (cps3_use_fastboot)
25172517   {
2518      fastboot_timer = timer_alloc(fastboot_timer_callback);
2518      fastboot_timer = timer_alloc(fastboot_timer_callback, NULL);
25192519   //  printf("reset\n");
25202520      timer_adjust(fastboot_timer, attotime_zero, 0, attotime_zero);
25212521   }
src/mame/drivers/mcatadv.c
r1355r1356
481481{
482482   cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE);
483483}
484struct YM2610interface mcatadv_ym2610_interface =
484static struct YM2610interface mcatadv_ym2610_interface =
485485{
486486   sound_irq,   /* irq */
487487   REGION_SOUND1,   /* delta_t */
src/mame/drivers/toaplan2.c
r1355r1356
575575static void toaplan2_vblank_irq(int irq_line)
576576{
577577   /* the IRQ appears to fire at line 0xe6 */
578   timer_set(video_screen_get_time_until_pos(0, 0xe6, 0), irq_line, toaplan2_raise_irq);
578   timer_set(video_screen_get_time_until_pos(0, 0xe6, 0), NULL, irq_line, toaplan2_raise_irq);
579579}
580580
581581static INTERRUPT_GEN( toaplan2_vblank_irq1 ) { toaplan2_vblank_irq(1); }
src/mame/drivers/tankbust.c
r1355r1356
4646
4747static WRITE8_HANDLER( tankbust_soundlatch_w )
4848{
49   timer_call_after_resynch(data,soundlatch_callback);
49   timer_call_after_resynch(NULL, data,soundlatch_callback);
5050}
5151
5252static READ8_HANDLER( tankbust_soundlatch_r )
r1355r1356
9595   break;
9696
9797   case 1:   /* 0xe001 (value 0 then 1) written right after the soundlatch_w */
98      timer_call_after_resynch(data,soundirqline_callback);
98      timer_call_after_resynch(NULL, data,soundirqline_callback);
9999   break;
100100
101101   case 2:   /* 0xe002 coin counter */
src/mame/drivers/seattle.c
r1355r1356
541541   cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_READONLY, 1);
542542
543543   /* allocate timers for the galileo */
544   galileo.timer[0].timer = timer_alloc(galileo_timer_callback);
545   galileo.timer[1].timer = timer_alloc(galileo_timer_callback);
546   galileo.timer[2].timer = timer_alloc(galileo_timer_callback);
547   galileo.timer[3].timer = timer_alloc(galileo_timer_callback);
544   galileo.timer[0].timer = timer_alloc(galileo_timer_callback, NULL);
545   galileo.timer[1].timer = timer_alloc(galileo_timer_callback, NULL);
546   galileo.timer[2].timer = timer_alloc(galileo_timer_callback, NULL);
547   galileo.timer[3].timer = timer_alloc(galileo_timer_callback, NULL);
548548   galileo.dma_active = -1;
549549
550550   vblank_irq_num = 0;
src/mame/drivers/btoads.c
r1355r1356
5555   cpu_triggerint(1);
5656
5757   /* use a timer to make long transfers faster */
58   timer_set(ATTOTIME_IN_USEC(50), 0, 0);
58   timer_set(ATTOTIME_IN_USEC(50), NULL, 0, 0);
5959}
6060
6161
6262static WRITE16_HANDLER( main_sound_w )
6363{
6464   if (ACCESSING_LSB)
65      timer_call_after_resynch(data & 0xff, delayed_sound_w);
65      timer_call_after_resynch(NULL, data & 0xff, delayed_sound_w);
6666}
6767
6868
src/mame/drivers/tetrisp2.c
r1355r1356
10241024
10251025static void init_rockn_timer(running_machine *machine)
10261026{
1027   timer_pulse(ATTOTIME_IN_MSEC(32), 0, rockn_timer_level1_callback);
1028   rockn_timer_l4 = timer_alloc(rockn_timer_level4_callback);
1027   timer_pulse(ATTOTIME_IN_MSEC(32), NULL, 0, rockn_timer_level1_callback);
1028   rockn_timer_l4 = timer_alloc(rockn_timer_level4_callback, NULL);
10291029
10301030   state_save_register_global_array(tetrisp2_systemregs);
10311031   state_save_register_global_array(rocknms_sub_systemregs);
r1355r1356
10561056{
10571057   init_rockn_timer(machine);
10581058
1059   timer_pulse(ATTOTIME_IN_MSEC(32), 0, rockn_timer_sub_level1_callback);
1060   rockn_timer_sub_l4 = timer_alloc(rockn_timer_sub_level4_callback);
1059   timer_pulse(ATTOTIME_IN_MSEC(32), NULL, 0, rockn_timer_sub_level1_callback);
1060   rockn_timer_sub_l4 = timer_alloc(rockn_timer_sub_level4_callback, NULL);
10611061
10621062   rockn_protectdata = 3;
10631063
src/mame/drivers/boxer.c
r1355r1356
5757      {
5858         if (mask[i] != 0)
5959         {
60            timer_set(video_screen_get_time_until_pos(0, i, 0), mask[i], pot_interrupt);
60            timer_set(video_screen_get_time_until_pos(0, i, 0), NULL, mask[i], pot_interrupt);
6161         }
6262      }
6363
r1355r1356
7171      scanline = 0;
7272   }
7373
74   timer_set(video_screen_get_time_until_pos(0, scanline, 0), scanline, periodic_callback);
74   timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, periodic_callback);
7575}
7676
7777
r1355r1356
8787
8888static MACHINE_RESET( boxer )
8989{
90   timer_set(video_screen_get_time_until_pos(0, 0, 0), 0, periodic_callback);
90   timer_set(video_screen_get_time_until_pos(0, 0, 0), NULL, 0, periodic_callback);
9191
9292   pot_latch = 0;
9393}
src/mame/drivers/starfire.c
r1355r1356
7474   scanline += SCANLINE_UPDATE_CHUNK;
7575   if (scanline >= machine->screen[0].height)
7676      scanline = 32;
77   timer_set(video_screen_get_time_until_pos(0, scanline + SCANLINE_UPDATE_CHUNK - 1, 0), scanline, update_callback);
77   timer_set(video_screen_get_time_until_pos(0, scanline + SCANLINE_UPDATE_CHUNK - 1, 0), NULL, scanline, update_callback);
7878}
7979
8080
8181static MACHINE_RESET( starfire )
8282{
83   timer_set(video_screen_get_time_until_pos(0, 32 + SCANLINE_UPDATE_CHUNK - 1, 0), 32, update_callback);
83   timer_set(video_screen_get_time_until_pos(0, 32 + SCANLINE_UPDATE_CHUNK - 1, 0), NULL, 32, update_callback);
8484}
8585
8686
src/mame/drivers/namcos22.c
r1355r1356
11831183      { /* SUBCPU enable on System 22 (guessed, but too early crashes Rave Racer so it's a good test) */
11841184         if (data == 0xff00)
11851185         {
1186            timer_set(ATTOTIME_IN_MSEC(50), 0, start_subcpu);
1186            timer_set(ATTOTIME_IN_MSEC(50), NULL, 0, start_subcpu);
11871187         }
11881188      }
11891189   }
src/mame/drivers/flyball.c
r1355r1356
5252   {
5353      if (potsense[i] != 0)
5454      {
55         timer_set(video_screen_get_time_until_pos(0, scanline + i, 0), potsense[i], flyball_joystick_callback);
55         timer_set(video_screen_get_time_until_pos(0, scanline + i, 0), NULL, potsense[i], flyball_joystick_callback);
5656      }
5757   }
5858
5959   scanline += 0x40;
6060   scanline &= 0xff;
6161
62   timer_set(video_screen_get_time_until_pos(0, scanline, 0), scanline, flyball_quarter_callback);
62   timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, flyball_quarter_callback);
6363
6464   flyball_potsense = 0;
6565   flyball_potmask = 0;
r1355r1356
7777   for (i = 0; i < 0x1000; i++)
7878      rombase[i] = ROM[i ^ 0x1ff];
7979
80   timer_set(video_screen_get_time_until_pos(0, 0, 0), 0, flyball_quarter_callback);
80   timer_set(video_screen_get_time_until_pos(0, 0, 0), NULL, 0, flyball_quarter_callback);
8181}
8282
8383
src/mame/drivers/vicdual.c
r1355r1356
9595      cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE);
9696
9797      /* simulate the coin switch being closed for a while */
98      timer_set(double_to_attotime(4 * attotime_to_double(video_screen_get_frame_period(0))), 0, clear_coin_status);
98      timer_set(double_to_attotime(4 * attotime_to_double(video_screen_get_frame_period(0))), NULL, 0, clear_coin_status);
9999   }
100100
101101   last_coin_input = coin_input;
r1355r1356
174174   {
175175      timer_started = 1;
176176
177      timer_pulse(TIMER_HALF_PERIOD, 0, vicdual_timer_callback);
177      timer_pulse(TIMER_HALF_PERIOD, NULL, 0, vicdual_timer_callback);
178178   }
179179
180180   return timer_value;
src/mame/drivers/rockola.c
r1355r1356
188188{
189189   sasuke_counter = 0;
190190
191   sasuke_timer = timer_alloc(sasuke_update_counter);
191   sasuke_timer = timer_alloc(sasuke_update_counter, NULL);
192192   timer_adjust(sasuke_timer, attotime_zero, 0, ATTOTIME_IN_HZ(11289000/8));   // 1.4 MHz
193193}
194194
src/mame/drivers/centiped.c
r1355r1356
66        * Centipede (5 sets)
77        * Warlords
88        * Millipede
9        * Maze Invaders (prototype)
910        * Bulls Eye Darts
1011
1112    Centipede sync-prom added by HIGHWAYMAN.
r1355r1356
450451   if (scanline & 16)
451452      cpunum_set_input_line(0, 0, ((scanline - 1) & 32) ? ASSERT_LINE : CLEAR_LINE);
452453
454   /* do a partial update now to handle sprite multiplexing (Maze Invaders) */
455   video_screen_update_partial(0, scanline);
456
453457   /* call back again after 16 scanlines */
454458   scanline += 16;
455459   if (scanline >= 256)
r1355r1356
469473
470474static MACHINE_RESET( centiped )
471475{
472   interrupt_timer = timer_alloc(generate_interrupt);
476   interrupt_timer = timer_alloc(generate_interrupt, NULL);
473477   timer_adjust(interrupt_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
474478   cpunum_set_input_line(0, 0, CLEAR_LINE);
475479   dsw_select = 0;
r1355r1356
591595   control_select = (data >> 7) & 1;
592596}
593597
598
599static READ8_HANDLER( mazeinv_input_r )
600{
601   return readinputport(6 + control_select);
602}
603
604
605static WRITE8_HANDLER( mazeinv_input_select_w )
606{
607   control_select = offset & 3;
608}
609
594610static READ8_HANDLER( bullsdrt_data_port_r )
595611{
596612   switch (activecpu_get_pc())
r1355r1356
603619   return 0;
604620}
605621
622
623
606624/*************************************
607625 *
608626 *  Output ports
r1355r1356
772790
773791
774792
793/*************************************
794 *
795 *  Maze Invaders CPU memory handlers
796 *
797 *************************************/
798
799static ADDRESS_MAP_START( mazeinv_map, ADDRESS_SPACE_PROGRAM, 8 )
800   ADDRESS_MAP_FLAGS( AMEF_ABITS(15) )
801   AM_RANGE(0x0000, 0x03ff) AM_RAM
802   AM_RANGE(0x0400, 0x040f) AM_READWRITE(pokey1_r, pokey1_w)
803   AM_RANGE(0x0800, 0x080f) AM_READWRITE(pokey2_r, pokey2_w)
804   AM_RANGE(0x1000, 0x13bf) AM_READWRITE(MRA8_RAM, centiped_videoram_w) AM_BASE(&videoram)
805   AM_RANGE(0x13c0, 0x13ff) AM_RAM AM_BASE(&spriteram)
806   AM_RANGE(0x2000, 0x2000) AM_READ(input_port_0_r)
807   AM_RANGE(0x2001, 0x2001) AM_READ(input_port_1_r)
808   AM_RANGE(0x2010, 0x2010) AM_READ(input_port_2_r)
809   AM_RANGE(0x2011, 0x2011) AM_READ(input_port_3_r)
810   AM_RANGE(0x2020, 0x2020) AM_READ(mazeinv_input_r)
811   AM_RANGE(0x2030, 0x2030) AM_READ(atari_vg_earom_r)
812   AM_RANGE(0x2480, 0x249f) AM_WRITE(mazeinv_paletteram_w) AM_BASE(&paletteram)
813   AM_RANGE(0x2500, 0x2502) AM_WRITE(coin_count_w)
814   AM_RANGE(0x2503, 0x2504) AM_WRITE(led_w)
815   AM_RANGE(0x2505, 0x2505) AM_WRITE(input_select_w)
816//  AM_RANGE(0x2506, 0x2507) AM_WRITE(MWA8_NOP) /* ? */
817   AM_RANGE(0x2580, 0x2583) AM_WRITE(mazeinv_input_select_w)
818   AM_RANGE(0x2600, 0x2600) AM_WRITE(irq_ack_w)
819   AM_RANGE(0x2680, 0x2680) AM_WRITE(watchdog_reset_w)
820   AM_RANGE(0x2700, 0x2700) AM_WRITE(atari_vg_earom_ctrl_w)
821   AM_RANGE(0x2780, 0x27bf) AM_WRITE(atari_vg_earom_w)
822   AM_RANGE(0x3000, 0x7fff) AM_ROM
823ADDRESS_MAP_END
824
825
826
775827/****************************************
776828 *
777829 *  Bulls Eye Darts CPU memory handlers
r1355r1356
12831335INPUT_PORTS_END
12841336
12851337
1338static INPUT_PORTS_START( mazeinv )
1339   PORT_START   /* IN0 */
1340   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Language ))
1341   PORT_DIPSETTING(    0x00, DEF_STR( English ))
1342   PORT_DIPSETTING(    0x01, DEF_STR( German ))
1343   PORT_DIPSETTING(    0x02, DEF_STR( French ))
1344   PORT_DIPSETTING(    0x03, DEF_STR( Spanish ))
1345   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ))
1346   PORT_DIPSETTING(    0x00, DEF_STR( Off ))
1347   PORT_DIPSETTING(    0x04, DEF_STR( On ))
1348   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ))
1349   PORT_DIPSETTING(    0x00, DEF_STR( Off ))
1350   PORT_DIPSETTING(    0x08, DEF_STR( On ))
1351   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ))
1352   PORT_DIPSETTING(    0x00, DEF_STR( Off ))
1353   PORT_DIPSETTING(    0x10, DEF_STR( On ))
1354   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ))
1355   PORT_DIPSETTING(    0x00, DEF_STR( Off ))
1356   PORT_DIPSETTING(    0x20, DEF_STR( On ))
1357   PORT_DIPNAME( 0x40, 0x00, "Minimum credits" )
1358   PORT_DIPSETTING(    0x00, "1" )
1359   PORT_DIPSETTING(    0x40, "2" )
1360   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
1361
1362   PORT_START      /* IN1 */
1363   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
1364
1365   PORT_START      /* IN2 */
1366   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1367   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1368   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
1369   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
1370   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 )
1371   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 )
1372   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON4 )
1373   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
1374
1375   PORT_START      /* IN3 */
1376   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1377   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1378   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1379   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
1380   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1381   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1382   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
1383   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
1384
1385   PORT_START   /* IN4 */
1386   PORT_DIPNAME( 0x03, 0x00, "Doors for bonus" )
1387   PORT_DIPSETTING(    0x00, "10" )
1388   PORT_DIPSETTING(    0x01, "12" )
1389   PORT_DIPSETTING(    0x02, "14" )
1390   PORT_DIPSETTING(    0x03, "16" )
1391   PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Lives ))
1392   PORT_DIPSETTING(    0x00, "2" )
1393   PORT_DIPSETTING(    0x04, "3" )
1394   PORT_DIPSETTING(    0x08, "4" )
1395   PORT_DIPSETTING(    0x0c, "5" )
1396   PORT_DIPNAME( 0x30, 0x00, "Extra life at" )
1397   PORT_DIPSETTING(    0x00, "20000" )
1398   PORT_DIPSETTING(    0x10, "25000" )
1399   PORT_DIPSETTING(    0x20, "30000" )
1400   PORT_DIPSETTING(    0x30, "Never" )
1401   PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Difficulty ))
1402   PORT_DIPSETTING(    0x00, DEF_STR( Easier ))
1403   PORT_DIPSETTING(    0x40, DEF_STR( Easy ))
1404   PORT_DIPSETTING(    0x80, DEF_STR( Hard ))
1405   PORT_DIPSETTING(    0xc0, DEF_STR( Harder ))
1406
1407   PORT_START   /* IN5 */
1408   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Coinage ))
1409   PORT_DIPSETTING(    0x03, DEF_STR( 2C_1C ))
1410   PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ))
1411   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ))
1412   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ))
1413   PORT_DIPNAME( 0x0c, 0x00, "Right Coin" )
1414   PORT_DIPSETTING(    0x00, "*1" )
1415   PORT_DIPSETTING(    0x04, "*4" )
1416   PORT_DIPSETTING(    0x08, "*5" )
1417   PORT_DIPSETTING(    0x0c, "*6" )
1418   PORT_DIPNAME( 0x10, 0x00, "Left Coin" )
1419   PORT_DIPSETTING(    0x00, "*1" )
1420   PORT_DIPSETTING(    0x10, "*2" )
1421   PORT_DIPNAME( 0xe0, 0x00, "Bonus Coins" )
1422   PORT_DIPSETTING(    0x00, DEF_STR( None ))
1423   PORT_DIPSETTING(    0x20, "3 credits/2 coins" )
1424   PORT_DIPSETTING(    0x40, "5 credits/4 coins" )
1425   PORT_DIPSETTING(    0x60, "6 credits/4 coins" )
1426   PORT_DIPSETTING(    0x80, "6 credits/5 coins" )
1427
1428   /* IN6-9 fake to control player joysticks */
1429   PORT_START
1430   PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_Y ) PORT_MINMAX(0x40, 0xbf) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(1)
1431
1432   PORT_START
1433
1434   PORT_START
1435   PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_MINMAX(0x40, 0xbf) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(1)
1436
1437   PORT_START
1438INPUT_PORTS_END
1439
1440
12861441static INPUT_PORTS_START( bullsdrt )
12871442   PORT_START   /* IN0 */
12881443   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* trackball data */
r1355r1356
15941749MACHINE_DRIVER_END
15951750
15961751
1752static MACHINE_DRIVER_START( mazeinv )
1753
1754   /* basic machine hardware */
1755   MDRV_IMPORT_FROM(milliped)
1756   MDRV_CPU_MODIFY("main")
1757   MDRV_CPU_PROGRAM_MAP(mazeinv_map,0)
1758   MDRV_VIDEO_UPDATE(centiped)
1759MACHINE_DRIVER_END
1760
1761
15971762static MACHINE_DRIVER_START( bullsdrt )
15981763
15991764   /* basic machine hardware */
r1355r1356
17591924ROM_END
17601925
17611926
1927ROM_START( mazeinv )
1928   ROM_REGION( 0x10000, REGION_CPU1, 0 )   /* 64k for code */
1929   ROM_LOAD( "005.011",      0x3000, 0x1000, CRC(37129536) SHA1(356cb986a40b332100e00fb72194fd4dade2cba7) )
1930   ROM_LOAD( "004.011",      0x4000, 0x1000, CRC(2d0fbf2f) SHA1(9d4c2bc9f80604d1ff5c5bf5a4a78378efdd8b33) )
1931   ROM_LOAD( "003.011",      0x5000, 0x1000, CRC(0ff3747c) SHA1(1a7e1c487c24875dada967fb3a9ceaca25b7e2a7) )
1932   ROM_LOAD( "002.011",      0x6000, 0x1000, CRC(96478e07) SHA1(e99d9970dc12ed36520d91646f1955cce87b55b6) )
1933   ROM_LOAD( "001.011",      0x7000, 0x1000, CRC(d5c29a01) SHA1(5201a6cd42e4954c6cd4298f7b6cee4a8c181248) )
1934
1935   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
1936   ROM_LOAD( "007.011",      0x0000, 0x0800, CRC(16e738f4) SHA1(96335afc4510aae6b4ee6dfd8f5c1b2baa8c2798) )
1937   ROM_LOAD( "006.011",      0x0800, 0x0800, CRC(d4705e4e) SHA1(e099f3df0d2f56d557631e69bc76ae2f09a80b42) )
1938
1939   ROM_REGION( 0x0120, REGION_PROMS, 0 )
1940   ROM_LOAD( "009.011",      0x0000, 0x0020, CRC(dcc48de5) SHA1(5594568dd6a605d6d9d9646b1af645af72a7f53d) )
1941   ROM_LOAD( "008.011",      0x0020, 0x0100, CRC(6fa3093a) SHA1(2b7aeca74c1ae4156bf1878453a047330f96f0a8) )
1942ROM_END
1943
1944
17621945ROM_START( warlords )
17631946   ROM_REGION( 0x10000, REGION_CPU1, 0 )
17641947   ROM_LOAD( "037154.1m",    0x5000, 0x0800, CRC(18006c87) SHA1(6b4aab1b1710819d29f4bbc29269eb9c915626c0) )
r1355r1356
18422025GAME( 1982, milliped, 0,        milliped, milliped, 0,        ROT270, "Atari",   "Millipede", GAME_SUPPORTS_SAVE )
18432026
18442027GAME( 1980, warlords, 0,        warlords, warlords, 0,        ROT0,   "Atari",   "Warlords", GAME_SUPPORTS_SAVE )
2028GAME( 1981, mazeinv,  0,        mazeinv,  mazeinv,  0,        ROT270, "Atari",   "Maze Invaders (prototype)", 0 )
18452029
18462030GAME( 1985, bullsdrt, 0,        bullsdrt, bullsdrt, bullsdrt, ROT270, "Shinkai Inc. (Magic Eletronics Inc. licence)", "Bulls Eye Darts", GAME_IMPERFECT_COLORS | GAME_SUPPORTS_SAVE )
src/mame/drivers/atarisy1.c
r1355r1356
186186
187187   /* reset the joystick parameters */
188188   joystick_value = 0;
189   joystick_timer = timer_alloc(delayed_joystick_int);
189   joystick_timer = timer_alloc(delayed_joystick_int, NULL);
190190   joystick_int = 0;
191191   joystick_int_enable = 0;
192192}
src/mame/drivers/wgp.c
r1355r1356
488488
489489static INTERRUPT_GEN( wgp_cpub_interrupt )
490490{
491   timer_set(ATTOTIME_IN_CYCLES(200000-500,0),0, wgp_cpub_interrupt6);
491   timer_set(ATTOTIME_IN_CYCLES(200000-500,0), NULL, 0, wgp_cpub_interrupt6);
492492   cpunum_set_input_line(2, 4, HOLD_LINE);
493493}
494494
r1355r1356
611611       hardware has got the next a/d conversion ready. We set a token
612612       delay of 10000 cycles although our inputs are always ready. */
613613
614   timer_set(ATTOTIME_IN_CYCLES(10000,0),0, wgp_interrupt6);
614   timer_set(ATTOTIME_IN_CYCLES(10000,0), NULL, 0, wgp_interrupt6);
615615}
616616
617617
src/mame/drivers/sprint8.c
r1355r1356
117117   collision_reset = 0;
118118   collision_index = 0;
119119
120   timer_pulse(video_screen_get_frame_period(0), 0, input_callback);
120   timer_pulse(video_screen_get_frame_period(0), NULL, 0, input_callback);
121121}
122122
123123
src/mame/drivers/ssv.c
r1355r1356
10001000   if(!offset)
10011001      latches[2]|=1;
10021002   COMBINE_DATA(&latches[offset]);
1003   timer_call_after_resynch(0, NULL);
1003   timer_call_after_resynch(NULL, 0, NULL);
10041004}
10051005
10061006static READ16_HANDLER(latch16_r)
r1355r1356
10151015   if(!offset)
10161016      latches[2]|=2;
10171017   latches[offset]=data;
1018   timer_call_after_resynch(0, NULL);
1018   timer_call_after_resynch(NULL, 0, NULL);
10191019}
10201020
10211021static ADDRESS_MAP_START( jsk_readmem, ADDRESS_SPACE_PROGRAM, 16 )
src/mame/drivers/tceptor.c
r1355r1356
1515#include "sound/dac.h"
1616#include "sound/2151intf.h"
1717#include "sound/namco.h"
18#include "rendlay.h"
19#include "tceptor2.lh"
1820
1921extern PALETTE_INIT( tceptor );
2022extern VIDEO_START( tceptor );
2123extern VIDEO_UPDATE( tceptor );
24extern VIDEO_EOF( tceptor );
2225
2326extern READ8_HANDLER( tceptor_tile_ram_r );
2427extern WRITE8_HANDLER( tceptor_tile_ram_w );
r1355r1356
220223   AM_RANGE(0x4f01, 0x4f01) AM_READ(input_port_4_r)      // analog input (accel)
221224   AM_RANGE(0x4f02, 0x4f02) AM_READ(input_port_5_r)      // analog input (left/right)
222225   AM_RANGE(0x4f03, 0x4f03) AM_READ(input_port_6_r)      // analog input (up/down)
223   AM_RANGE(0x6000, 0x7fff) AM_READ(m68k_shared_r)      // COM RAM
226   AM_RANGE(0x6000, 0x7fff) AM_READ(m68k_shared_r)         // COM RAM
224227   AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_ROM)
225228ADDRESS_MAP_END
226229
r1355r1356
234237   AM_RANGE(0x4000, 0x43ff) AM_WRITE(namcos1_cus30_w)
235238   AM_RANGE(0x4800, 0x4800) AM_WRITE(MWA8_NOP)         // 3D scope left/right?
236239   AM_RANGE(0x4f00, 0x4f03) AM_WRITE(MWA8_NOP)         // analog input control?
237   AM_RANGE(0x5000, 0x5006) AM_WRITE(tceptor_bg_scroll_w)   // bg scroll
240   AM_RANGE(0x5000, 0x5006) AM_WRITE(tceptor_bg_scroll_w)      // bg scroll
238241   AM_RANGE(0x6000, 0x7fff) AM_WRITE(m68k_shared_w) AM_BASE(&m68k_shared_ram)
239242   AM_RANGE(0x8000, 0x8000) AM_WRITE(m6809_irq_disable_w)
240243   AM_RANGE(0x8800, 0x8800) AM_WRITE(m6809_irq_enable_w)
r1355r1356
281284
282285
283286static ADDRESS_MAP_START( m68k_readmem, ADDRESS_SPACE_PROGRAM, 16 )
284   AM_RANGE(0x000000, 0x00ffff) AM_READ(MRA16_ROM)      // M68K ERROR 1
285   AM_RANGE(0x100000, 0x10ffff) AM_READ(MRA16_ROM)      // not sure
286   AM_RANGE(0x200000, 0x203fff) AM_READ(MRA16_RAM)      // M68K ERROR 0
287   AM_RANGE(0x000000, 0x00ffff) AM_READ(MRA16_ROM)         // M68K ERROR 1
288   AM_RANGE(0x100000, 0x10ffff) AM_READ(MRA16_ROM)         // not sure
289   AM_RANGE(0x200000, 0x203fff) AM_READ(MRA16_RAM)         // M68K ERROR 0
287290   AM_RANGE(0x700000, 0x703fff) AM_READ(m68k_shared_word_r)
288291ADDRESS_MAP_END
289292
r1355r1356
431434   PORT_DIPSETTING(    0x03, "B" )
432435   PORT_DIPSETTING(    0x01, "C" )
433436   PORT_DIPSETTING(    0x00, "D" )
434   PORT_DIPNAME( 0x04, 0x00, "MODE" )      // set default as 2D mode
437   PORT_DIPNAME( 0x04, 0x04, "MODE" )
435438   PORT_DIPSETTING(    0x00, "2D" )
436439   PORT_DIPSETTING(    0x04, "3D" )
437440   PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN )
r1355r1356
539542   MDRV_CPU_IO_MAP(mcu_readport,mcu_writeport)
540543   MDRV_CPU_VBLANK_INT(mcu_vb_interrupt,1)
541544
542   MDRV_SCREEN_REFRESH_RATE(60.606060)
543   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
544545   MDRV_INTERLEAVE(100)
545546
546547   MDRV_NVRAM_HANDLER(generic_1fill)
r1355r1356
550551
551552   /* video hardware */
552553   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
553   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
554   MDRV_SCREEN_SIZE(38*8, 32*8)
555   MDRV_SCREEN_VISIBLE_AREA(2*8, 34*8-1 + 2*8, 0*8, 28*8-1 + 0)
556554   MDRV_GFXDECODE(tceptor)
557555   MDRV_PALETTE_LENGTH(1024)
558556   MDRV_COLORTABLE_LENGTH(4096)
557   MDRV_DEFAULT_LAYOUT(layout_horizont)
559558
559   MDRV_SCREEN_ADD("2D", 0x000)
560   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
561   MDRV_SCREEN_REFRESH_RATE(60.606060)
562   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
563   MDRV_SCREEN_SIZE(38*8, 32*8)
564   MDRV_SCREEN_VISIBLE_AREA(2*8, 34*8-1 + 2*8, 0*8, 28*8-1 + 0)
565
566   MDRV_SCREEN_ADD("3D Left", 0x000)
567   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
568   MDRV_SCREEN_REFRESH_RATE(60.606060)
569   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
570   MDRV_SCREEN_SIZE(38*8, 32*8)
571   MDRV_SCREEN_VISIBLE_AREA(2*8, 34*8-1 + 2*8, 0*8, 28*8-1 + 0)
572
573   MDRV_SCREEN_ADD("3D Right", 0x000)
574   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
575   MDRV_SCREEN_REFRESH_RATE(60.606060)
576   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
577   MDRV_SCREEN_SIZE(38*8, 32*8)
578   MDRV_SCREEN_VISIBLE_AREA(2*8, 34*8-1 + 2*8, 0*8, 28*8-1 + 0)
579
560580   MDRV_PALETTE_INIT(tceptor)
581
561582   MDRV_VIDEO_START(tceptor)
562583   MDRV_VIDEO_UPDATE(tceptor)
584   MDRV_VIDEO_EOF(tceptor)
563585
564586   /* sound hardware */
565587   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
r1355r1356
694716
695717
696718/*  ( YEAR  NAME      PARENT    MACHINE   INPUT     INIT      MONITOR   COMPANY FULLNAME ) */
697GAME( 1986, tceptor,  0,        tceptor,  tceptor,  0,        ROT0,     "Namco",  "Thunder Ceptor", 0)
698GAME( 1986, tceptor2, tceptor,  tceptor,  tceptor2, 0,        ROT0,     "Namco",  "Thunder Ceptor II", 0)
719GAME ( 1986, tceptor,  0,        tceptor,  tceptor,  0,        ROT0,     "Namco",  "Thunder Ceptor", 0)
720GAMEL( 1986, tceptor2, tceptor,  tceptor,  tceptor2, 0,        ROT0,     "Namco",  "Thunder Ceptor II", 0, layout_tceptor2)
src/mame/drivers/aquarium.c
r1355r1356
5757
5858static int aquarium_snd_ack;
5959
60UINT16 *aquarium_scroll, *aquarium_priority;
60UINT16 *aquarium_scroll;
61//UINT16 *aquarium_priority;
6162UINT16 *aquarium_txt_videoram;
6263UINT16 *aquarium_mid_videoram;
6364UINT16 *aquarium_bak_videoram;
src/mame/drivers/metro.c
r1355r1356
259259         requested_int[0] = 1;
260260         requested_int[5] = 1;   // write the scroll registers
261261         /* the duration is a guess */
262         timer_set(ATTOTIME_IN_USEC(2500), 0, vblank_end_callback);
262         timer_set(ATTOTIME_IN_USEC(2500), NULL, 0, vblank_end_callback);
263263         update_irq_state();
264264         break;
265265
r1355r1356
754754                       another blit. */
755755               if (b1 == 0)
756756               {
757                  timer_set(ATTOTIME_IN_USEC(500),0,metro_blit_done);
757                  timer_set(ATTOTIME_IN_USEC(500), NULL,0,metro_blit_done);
758758                  return;
759759               }
760760
r1355r1356
36793679
36803680***************************************************************************/
36813681
3682UPD7810_CONFIG metro_cpu_config =
3682static UPD7810_CONFIG metro_cpu_config =
36833683{
36843684    TYPE_7810,
36853685    metro_io_callback
r1355r1356
46674667{
46684668   metro_common();
46694669   irq_line = -1;   /* split interrupt handlers */
4670   mouja_irq_timer = timer_alloc(mouja_irq_callback);
4670   mouja_irq_timer = timer_alloc(mouja_irq_callback, NULL);
46714671}
46724672
46734673static DRIVER_INIT( gakusai )
src/mame/drivers/midvunit.c
r1355r1356
6363
6464   memcpy(ram_base, memory_region(REGION_USER1), 0x20000*4);
6565
66   timer[0] = timer_alloc(NULL);
67   timer[1] = timer_alloc(NULL);
66   timer[0] = timer_alloc(NULL, NULL);
67   timer[1] = timer_alloc(NULL, NULL);
6868}
6969
7070
r1355r1356
7575
7676   memcpy(ram_base, memory_region(REGION_USER1), 0x20000*4);
7777
78   timer[0] = timer_alloc(NULL);
79   timer[1] = timer_alloc(NULL);
78   timer[0] = timer_alloc(NULL, NULL);
79   timer[1] = timer_alloc(NULL, NULL);
8080
8181   ide_controller_reset(0);
8282}
r1355r1356
154154      if (which < 0 || which > 2)
155155         logerror("adc_w: unexpected which = %02X\n", which + 4);
156156      adc_data = readinputport(3 + which);
157      timer_set(ATTOTIME_IN_MSEC(1), 0, adc_ready);
157      timer_set(ATTOTIME_IN_MSEC(1), NULL, 0, adc_ready);
158158   }
159159   else
160160      logerror("adc_w without enabling writes!\n");
src/mame/drivers/zaccaria.c
r1355r1356
272272}
273273
274274
275extern game_driver driver_monymony;
275extern const game_driver driver_monymony;
276276
277277static READ8_HANDLER( zaccaria_prot1_r )
278278{
src/mame/drivers/firebeat.c
r1355r1356
22832283static void init_keyboard(void)
22842284{
22852285   // set keyboard timer
2286   keyboard_timer = timer_alloc(keyboard_timer_callback);
2286   keyboard_timer = timer_alloc(keyboard_timer_callback, NULL);
22872287   timer_adjust(keyboard_timer, ATTOTIME_IN_MSEC(10), 0, ATTOTIME_IN_MSEC(10));
22882288}
22892289
src/mame/drivers/clayshoo.c
r1355r1356
120120
121121static void create_analog_timers(void)
122122{
123   analog_timer_1 = timer_alloc(reset_analog_bit);
124   analog_timer_2 = timer_alloc(reset_analog_bit);
123   analog_timer_1 = timer_alloc(reset_analog_bit, NULL);
124   analog_timer_2 = timer_alloc(reset_analog_bit, NULL);
125125}
126126
127127
src/mame/drivers/bigevglf.c
r1355r1356
113113}
114114static WRITE8_HANDLER(beg_fromsound_w)   /* write to D800 sets bit 1 in status */
115115{
116   timer_call_after_resynch((activecpu_get_pc()<<16)|data, from_sound_latch_callback);
116   timer_call_after_resynch(NULL, (activecpu_get_pc()<<16)|data, from_sound_latch_callback);
117117}
118118
119119static READ8_HANDLER(beg_fromsound_r)
120120{
121121   /* set a timer to force synchronization after the read */
122   timer_call_after_resynch(0, NULL);
122   timer_call_after_resynch(NULL, 0, NULL);
123123   return from_sound;
124124}
125125
r1355r1356
127127{
128128   UINT8 ret = sound_state;
129129   /* set a timer to force synchronization after the read */
130   timer_call_after_resynch(0, NULL);
130   timer_call_after_resynch(NULL, 0, NULL);
131131   sound_state &= ~2; /* read from port 21 clears bit 1 in status */
132132   return ret;
133133}
r1355r1356
135135static READ8_HANDLER(soundstate_r)
136136{
137137   /* set a timer to force synchronization after the read */
138   timer_call_after_resynch(0, NULL);
138   timer_call_after_resynch(NULL, 0, NULL);
139139   return sound_state;
140140}
141141
r1355r1356
148148static WRITE8_HANDLER( sound_command_w )   /* write to port 20 clears bit 0 in status */
149149{
150150   for_sound = data;
151   timer_call_after_resynch(data,nmi_callback);
151   timer_call_after_resynch(NULL, data,nmi_callback);
152152}
153153
154154static READ8_HANDLER( sound_command_r )   /* read from D800 sets bit 0 in status */
r1355r1356
184184/* do this on a timer to let the CPUs synchronize */
185185static WRITE8_HANDLER (beg13A_clr_w)
186186{
187   timer_call_after_resynch((0<<8) | 0, deferred_ls74_w);
187   timer_call_after_resynch(NULL, (0<<8) | 0, deferred_ls74_w);
188188}
189189static WRITE8_HANDLER (beg13B_clr_w)
190190{
191   timer_call_after_resynch((1<<8) | 0, deferred_ls74_w);
191   timer_call_after_resynch(NULL, (1<<8) | 0, deferred_ls74_w);
192192}
193193static WRITE8_HANDLER (beg13A_set_w)
194194{
195   timer_call_after_resynch((0<<8) | 1, deferred_ls74_w);
195   timer_call_after_resynch(NULL, (0<<8) | 1, deferred_ls74_w);
196196}
197197static WRITE8_HANDLER (beg13B_set_w)
198198{
199   timer_call_after_resynch((1<<8) | 1, deferred_ls74_w);
199   timer_call_after_resynch(NULL, (1<<8) | 1, deferred_ls74_w);
200200}
201201
202202static READ8_HANDLER( beg_status_r )
r1355r1356
211211
212212*/
213213   /* set a timer to force synchronization after the read */
214   timer_call_after_resynch(0, NULL);
214   timer_call_after_resynch(NULL, 0, NULL);
215215   return (beg13_ls74[0]<<0) | (beg13_ls74[1]<<1);
216216}
217217
src/mame/drivers/atarisy2.c
r1355r1356
285285static WRITE16_HANDLER( int_enable_w )
286286{
287287   if (offset == 0 && ACCESSING_LSB)
288      timer_call_after_resynch(data, delayed_int_enable_w);
288      timer_call_after_resynch(NULL, data, delayed_int_enable_w);
289289}
290290
291291
src/mame/drivers/mjsister.c
r1355r1356
3939   DAC_data_w(0,DACROM[(dac_bank * 0x10000 + dac_adr++) & 0x1ffff]);
4040
4141   if (((dac_adr & 0xff00 ) >> 8) !=  dac_adr_e )
42      timer_set(attotime_mul(ATTOTIME_IN_HZ(MCLK), 1024),0,dac_callback);
42      timer_set(attotime_mul(ATTOTIME_IN_HZ(MCLK), 1024), NULL, 0, dac_callback);
4343   else
4444      dac_busy = 0;
4545}
r1355r1356
5555   dac_adr = dac_adr_s << 8;
5656
5757   if (dac_busy == 0)
58      timer_call_after_resynch(0,dac_callback);
58      timer_call_after_resynch(NULL, 0,dac_callback);
5959
6060   dac_busy = 1;
6161}
src/mame/drivers/spacefb.c
r1355r1356
141141
142142static void create_interrupt_timer(void)
143143{
144   interrupt_timer = timer_alloc(interrupt_callback);
144   interrupt_timer = timer_alloc(interrupt_callback, NULL);
145145}
146146
147147
src/mame/drivers/wheelfir.c
r1355r1356
569569
570570static TIMER_CALLBACK( scanline_timer_callback )
571571{
572   timer_call_after_resynch(0, 0);
572   timer_call_after_resynch(NULL, 0, 0);
573573
574574   if (scanline_counter!=(total_scanlines-1))
575575   {
r1355r1356
612612
613613static MACHINE_RESET(wheelfir)
614614{
615   frame_timer = timer_alloc(frame_timer_callback);
616   scanline_timer = timer_alloc(scanline_timer_callback);
615   frame_timer = timer_alloc(frame_timer_callback, NULL);
616   scanline_timer = timer_alloc(scanline_timer_callback, NULL);
617617   timer_adjust(frame_timer, attotime_zero, 0, attotime_zero);
618618   timer_adjust(scanline_timer,  attotime_zero, 0, attotime_zero);
619619   scanline_counter = -1;
src/mame/drivers/turbo.c
r1355r1356
646646{
647647   /* the port C handshaking signals control the sub CPU IRQ, */
648648   /* so we have to sync whenever we access this PPI */
649   timer_call_after_resynch(((offset & 3) << 8) | (data & 0xff), delayed_ppi8255_w);
649   timer_call_after_resynch(NULL, ((offset & 3) << 8) | (data & 0xff), delayed_ppi8255_w);
650650}
651651
652652
src/mame/drivers/seta.c
r1355r1356
12871287      uPD71054.max[no] = 0xffff;
12881288   }
12891289   for( no = 0; no < USED_TIMER_NUM; no++ ) {
1290      uPD71054.timer[no] = timer_alloc( uPD71054_timer_callback );
1290      uPD71054.timer[no] = timer_alloc( uPD71054_timer_callback , NULL);
12911291   }
12921292}
12931293
src/mame/drivers/trvquest.c
r1355r1356
220220   /* Kaos sits in a tight loop polling the VIA irq flags register, but that register is
221221       cleared by the irq handler. Therefore, I wait a bit before triggering the irq to
222222       leave time for the program to see the flag change. */
223   timer_set(ATTOTIME_IN_USEC(50), state, via_irq_delayed);
223   timer_set(ATTOTIME_IN_USEC(50), NULL, state, via_irq_delayed);
224224}
225225
226226
src/mame/drivers/naomi.c
r1355r1356
443443
444444#define CPU_CLOCK 200000000
445445                                 /* MD2 MD1 MD0 MD6 MD4 MD3 MD5 MD7 MD8 */
446struct sh4_config sh4cpu_config = {  1,  0,  1,  0,  0,  0,  1,  1,  0, CPU_CLOCK };
446static struct sh4_config sh4cpu_config = {  1,  0,  1,  0,  0,  0,  1,  1,  0, CPU_CLOCK };
447447
448448static UINT64 *dc_sound_ram;
449449
src/mame/drivers/magmax.c
r1355r1356
7474static MACHINE_START( magmax )
7575{
7676   /* Create interrupt timer */
77   interrupt_timer = timer_alloc(scanline_callback);
77   interrupt_timer = timer_alloc(scanline_callback, NULL);
7878
7979   /* Set up save state */
8080   state_save_register_global(sound_latch);
src/mame/drivers/stv.c
r1355r1356
26422642
26432643GFXDECODE_END
26442644
2645struct sh2_config sh2_conf_master = { 0 };
2646struct sh2_config sh2_conf_slave  = { 1 };
2645static struct sh2_config sh2_conf_master = { 0 };
2646static struct sh2_config sh2_conf_slave  = { 1 };
26472647
26482648static int scsp_last_line = 0;
26492649
src/mame/drivers/megatech.c
r1355r1356
1919todo: cleanup, fix so that everything works properly
2020      games are marked as NOT WORKING due to
2121      a) incorrect behavior at time out
22      b) they're sms based games which aren't yet supported
22      b) they're sms based games which aren't yet fully supported
2323
2424
2525About MegaTech:
r1355r1356
10571057
10581058#define MEGATECH_GAME04(GAME_REGION, INSTRUCTION_REGION) \
10591059   ROM_REGION( 0x300000, GAME_REGION, 0 ) \
1060   ROM_LOAD( "mp11129f.ic1", 0x000000, 0x020000, CRC(972c75ac) SHA1(2ae74c8563a3cefb27611d17bf3926865b6ebd45) ) \
1060   ROM_LOAD( "mp11129f.ic1", 0x000000, 0x020000, CRC(c6611c84) SHA1(eab0eed872dd26b13bcf0b2dd74fcbbc078812c9) ) \
10611061    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_SMS ) \
10621062   ROM_LOAD( "12368-04.ic2", 0x000000, 0x08000, CRC(62e5579b) SHA1(e1f531be5c40a1216d4192baeda9352384444410) ) \
1063   /* Also known to have the ID# MPR-11128 instead of MPR-11129F, same contents */
10631064
10641065ROM_START( mt_ggolf )
10651066   MEGATECH_BIOS
r1355r1356
12481249/* 01 */ GAME( 1988, mt_beast, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Altered Beast (Mega-Tech)", GAME_NOT_WORKING )
12491250/* 02 */ GAME( 1988, mt_shar2, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Space Harrier II (Mega-Tech)", GAME_NOT_WORKING )
12501251/* 03 */ GAME( 1988, mt_stbld, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Super Thunder Blade (Mega-Tech)", GAME_NOT_WORKING )
1251/* 04 */ GAME( 19??, mt_ggolf, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Great Golf (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! also bad */
1252/* 05 */ GAME( 19??, mt_gsocr, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Great Soccer (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! also bad */
1253/* 06 */ GAME( 1989, mt_orun,  megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Out Run (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! */
1254/* 07 */ GAME( 19??, mt_asyn,  megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Alien Syndrome (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! */
1255/* 08 */ GAME( 19??, mt_shnbi, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Shinobi (Mega-Tech, SMS based)", GAME_NOT_WORKING) /* sms */
1252/* 04 */ GAME( 1987, mt_ggolf, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Great Golf (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! */
1253/* 05 */ GAME( 198?, mt_gsocr, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Great Soccer (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! also bad */
1254/* 06 */ GAME( 1987, mt_orun,  megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Out Run (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! */
1255/* 07 */ GAME( 1987, mt_asyn,  megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Alien Syndrome (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! */
1256/* 08 */ GAME( 1987, mt_shnbi, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Shinobi (Mega-Tech, SMS based)", GAME_NOT_WORKING) /* sms */
12561257/* 09 */ // unknown
1257/* 10 */ GAME( 19??, mt_aftrb, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "After Burner (Mega-Tech, SMS based)", GAME_NOT_WORKING) /* sms */
1258/* 10 */ GAME( 1987, mt_aftrb, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "After Burner (Mega-Tech, SMS based)", GAME_NOT_WORKING) /* sms */
12581259/* 11 */ GAME( 1989, mt_tfor2, megatech, megatech, megatech, mtnew, ROT0, "Tecno Soft / Sega",     "Thunder Force II MD (Mega-Tech)", GAME_NOT_WORKING )
12591260/* 12 */ // unknown
1260/* 13 */ GAME( 19??, mt_astro, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Astro Warrior (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! */
1261/* 13 */ GAME( 1986, mt_astro, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Astro Warrior (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! */
12611262/* 14 */ // unknown
12621263/* 15 */ // unknown
12631264/* 16 */ // unknown
r1355r1356
12661267/* 19 */ // unknown
12671268/* 20 */ GAME( 1989, mt_lastb, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Last Battle (Mega-Tech)", GAME_NOT_WORKING )
12681269/* 21 */ GAME( 1989, mt_wcsoc, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "World Championship Soccer (Mega-Tech)", GAME_NOT_WORKING )
1269/* 22 */ GAME( 19??, mt_tetri, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Tetris (Mega-Tech)", GAME_NOT_WORKING )
1270/* 22 */ GAME( 1989, mt_tetri, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Tetris (Mega-Tech)", GAME_NOT_WORKING )
12701271/* 23 */ GAME( 1989, mt_gng,   megatech, megatech, megatech, mtnew, ROT0, "Capcom / Sega",         "Ghouls'n Ghosts (Mega-Tech)", GAME_NOT_WORKING )
12711272/* 24 */ GAME( 1989, mt_shang, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Super Hang-On (Mega-Tech)", GAME_NOT_WORKING )
12721273/* 25 */ GAME( 1989, mt_gaxe,  megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Golden Axe (Mega-Tech)", GAME_NOT_WORKING )
12731274/* 26 */ GAME( 1989, mt_fwrld, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Forgotten Worlds (Mega-Tech)", GAME_NOT_WORKING )
12741275/* 27 */ GAME( 1989, mt_mystd, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Mystic Defender (Mega-Tech)", GAME_NOT_WORKING )
12751276/* 28 */ GAME( 1989, mt_revsh, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "The Revenge of Shinobi (Mega-Tech)", GAME_NOT_WORKING )
1276/* 29 */ GAME( 19??, mt_parlg, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Parlour Games (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! */
1277/* 29 */ GAME( 1987, mt_parlg, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Parlour Games (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! */
12771278/* 30 */ // unknown
12781279/* 31 */ GAME( 1989, mt_tgolf, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Arnold Palmer Tournament Golf (Mega-Tech)", GAME_NOT_WORKING )
12791280/* 32 */ GAME( 1989, mt_srbb,  megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Super Real Basketball (Mega-Tech)", GAME_NOT_WORKING )
src/mame/drivers/alg.c
r1355r1356
145145static MACHINE_START( alg )
146146{
147147   discinfo = laserdisc_init(LASERDISC_TYPE_LDP1450, get_disk_handle(0), 1);
148   serial_timer = timer_alloc(response_timer);
148   serial_timer = timer_alloc(response_timer, NULL);
149149   serial_timer_active = FALSE;
150150}
151151
src/mame/drivers/bombjack.c
r1355r1356
121121static WRITE8_HANDLER( bombjack_soundlatch_w )
122122{
123123   /* make all the CPUs synchronize, and only AFTER that write the new command to the latch */
124   timer_call_after_resynch(data,soundlatch_callback);
124   timer_call_after_resynch(NULL, data,soundlatch_callback);
125125}
126126
127127static READ8_HANDLER( bombjack_soundlatch_r )
src/mame/drivers/gridlee.c
r1355r1356
119119{
120120   /* next interrupt after scanline 256 is scanline 64 */
121121   if (param == 256)
122      timer_set(video_screen_get_time_until_pos(0, 64, 0), 64, irq_timer);
122      timer_set(video_screen_get_time_until_pos(0, 64, 0), NULL, 64, irq_timer);
123123   else
124      timer_set(video_screen_get_time_until_pos(0, param + 64, 0), param + 64, irq_timer);
124      timer_set(video_screen_get_time_until_pos(0, param + 64, 0), NULL, param + 64, irq_timer);
125125
126126   /* IRQ starts on scanline 0, 64, 128, etc. */
127127   cpunum_set_input_line(0, M6809_IRQ_LINE, ASSERT_LINE);
128128
129129   /* it will turn off on the next HBLANK */
130   timer_set(video_screen_get_time_until_pos(0, param, BALSENTE_HBSTART), 0, irq_off);
130   timer_set(video_screen_get_time_until_pos(0, param, BALSENTE_HBSTART), NULL, 0, irq_off);
131131}
132132
133133
r1355r1356
140140static TIMER_CALLBACK( firq_timer )
141141{
142142   /* same time next frame */
143   timer_set(video_screen_get_time_until_pos(0, FIRQ_SCANLINE, 0), 0, firq_timer);
143   timer_set(video_screen_get_time_until_pos(0, FIRQ_SCANLINE, 0), NULL, 0, firq_timer);
144144
145145   /* IRQ starts on scanline FIRQ_SCANLINE? */
146146   cpunum_set_input_line(0, M6809_FIRQ_LINE, ASSERT_LINE);
147147
148148   /* it will turn off on the next HBLANK */
149   timer_set(video_screen_get_time_until_pos(0, FIRQ_SCANLINE, BALSENTE_HBSTART), 0, firq_off);
149   timer_set(video_screen_get_time_until_pos(0, FIRQ_SCANLINE, BALSENTE_HBSTART), NULL, 0, firq_off);
150150}
151151
152152
153153static MACHINE_RESET( gridlee )
154154{
155155   /* start timers to generate interrupts */
156   timer_set(video_screen_get_time_until_pos(0, 0, 0), 0, irq_timer);
157   timer_set(video_screen_get_time_until_pos(0, FIRQ_SCANLINE, 0), 0, firq_timer);
156   timer_set(video_screen_get_time_until_pos(0, 0, 0), NULL, 0, irq_timer);
157   timer_set(video_screen_get_time_until_pos(0, FIRQ_SCANLINE, 0), NULL, 0, firq_timer);
158158
159159   /* create the polynomial tables */
160160   poly17_init();
src/mame/drivers/trucocl.c
r1355r1356
8282
8383   DAC_data_w( 0, rom[dac_address+cur_dac_address_index] );
8484
85   timer_set( ATTOTIME_IN_HZ( 16000 ), 0, dac_irq );
85   timer_set( ATTOTIME_IN_HZ( 16000 ), NULL, 0, dac_irq );
8686}
8787
8888static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
src/mame/drivers/unico.c
r1355r1356
642642}
643643
644644
645struct EEPROM_interface zeropnt2_eeprom_interface =
645static struct EEPROM_interface zeropnt2_eeprom_interface =
646646{
647647   7,            // address bits 7
648648   8,            // data bits    8
src/mame/drivers/gcpinbal.c
r1355r1356
6464{
6565   /* Unsure of actual sequence */
6666
67   timer_set(ATTOTIME_IN_CYCLES(500,0),0, gcpinbal_interrupt1);
68//  timer_set(ATTOTIME_IN_CYCLES(1000,0),0, gcpinbal_interrupt3);
67   timer_set(ATTOTIME_IN_CYCLES(500,0), NULL, 0, gcpinbal_interrupt1);
68//  timer_set(ATTOTIME_IN_CYCLES(1000,0), NULL, 0, gcpinbal_interrupt3);
6969   cpunum_set_input_line(0, 4, HOLD_LINE);
7070}
7171
src/mame/drivers/astrocde.c
r1355r1356
12001200   0
12011201};
12021202
1203struct Samplesinterface seawolf2_samples_interface =
1203static struct Samplesinterface seawolf2_samples_interface =
12041204{
12051205   10,   /* 5*2 channels */
12061206   seawolf_sample_names
r1355r1356
12261226 *
12271227 *************************************/
12281228
1229struct z80_irq_daisy_chain tenpin_daisy_chain[] =
1229static struct z80_irq_daisy_chain tenpin_daisy_chain[] =
12301230{
12311231   { z80ctc_reset, z80ctc_irq_state, z80ctc_irq_ack, z80ctc_irq_reti, 0 }, /* CTC number 0 */
12321232   { 0, 0, 0, 0, -1 }      /* end mark */
src/mame/drivers/40love.c
r1355r1356
267267static WRITE8_HANDLER( sound_command_w )
268268{
269269   soundlatch_w(0,data);
270   timer_call_after_resynch(data,nmi_callback);
270   timer_call_after_resynch(NULL, data,nmi_callback);
271271}
272272
273273static WRITE8_HANDLER( nmi_disable_w )
src/mame/drivers/galaga.c
r1355r1356
16071607   0   /* end of array */
16081608};
16091609
1610struct Samplesinterface battles_samples_interface =
1610static struct Samplesinterface battles_samples_interface =
16111611{
16121612   1,   /* one channel */
16131613   battles_sample_names
src/mame/drivers/panicr.c
r1355r1356
235235   PORT_BIT( 0xe7, IP_ACTIVE_LOW, IPT_UNKNOWN )
236236
237237   PORT_START_TAG("DSW1")
238   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )
238   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )   PORT_DIPLOCATION("SW1:8,7,6")
239239   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ))
240240   PORT_DIPSETTING(    0x04, DEF_STR( 4C_1C ))
241241   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ))
r1355r1356
244244   PORT_DIPSETTING(    0x03, DEF_STR( 1C_2C ))
245245   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ))
246246   PORT_DIPSETTING(    0x01, DEF_STR( 1C_5C ))
247
248   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coin_B ) )
247   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SW1:5,4")
249248   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ))
250249   PORT_DIPSETTING(    0x18, DEF_STR( 1C_1C ))
251250   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ))
252251   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ))
253
254   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
255   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
256   PORT_DIPNAME( 0x10, 0x10, "DSW1-4" )
257   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
258   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
259
260   PORT_DIPNAME( 0x20, 0x20, "Test Mode" )
261   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
262   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
263   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Allow_Continue ) )
252   PORT_SERVICE_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW1:3" )
253   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW1:2")
264254   PORT_DIPSETTING(    0x40, DEF_STR( No ) )
265255   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
266   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
256   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW1:1")
267257   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
268258   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
269259
270260   PORT_START_TAG("DSW2")
271   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
261   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:8")
272262    PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
273263   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
274   PORT_DIPNAME( 0x06, 0x04, DEF_STR( Difficulty ) )
264   PORT_DIPNAME( 0x06, 0x04, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,6")
275265   PORT_DIPSETTING(    0x06, DEF_STR( Easy ) )
276266   PORT_DIPSETTING(    0x04, DEF_STR( Medium ) )
277267   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
278268   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
279   PORT_DIPNAME( 0x18, 0x0c, "Bonus" )
269   PORT_DIPNAME( 0x18, 0x18, "Bonus" )      PORT_DIPLOCATION("SW2:5,4")
280270   PORT_DIPSETTING(    0x18, "50k & every 1OOk" )
281271   PORT_DIPSETTING(    0x10, "1Ok 20k" )
282272   PORT_DIPSETTING(    0x08, "20k 40k" )
283273   PORT_DIPSETTING(    0x00, "50k 100k" )
284   PORT_DIPNAME( 0x08, 0x08, "DSW2-3" )
285   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
286   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
287   PORT_DIPNAME( 0x10, 0x10, "DSW2-4" )
288   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
289   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
290   PORT_DIPNAME( 0x60, 0x40, "Balls" )
274   PORT_DIPNAME( 0x60, 0x40, "Balls" )      PORT_DIPLOCATION("SW2:3,2")
291275   PORT_DIPSETTING(    0x00, "4" )
292276   PORT_DIPSETTING(    0x20, "2" )
293277   PORT_DIPSETTING(    0x40, "3" )
294278   PORT_DIPSETTING(    0x60, "1" )
295   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) ) //?
279   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) )   PORT_DIPLOCATION("SW2:1")
296280   PORT_DIPSETTING(    0x80, DEF_STR( Upright ) )
297281   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
298282
299283   PORT_START_TAG(T5182COINPORT)
300284   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(2)
301285   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(2)
302
303286INPUT_PORTS_END
304287
305288static const gfx_layout charlayout =
src/mame/drivers/othunder.c
r1355r1356
430430       The ADC60808 clock is 512kHz. Conversion takes between 0 and 8 clock
431431       cycles, so would end in a maximum of 15.625us. We'll use 10. */
432432
433   timer_set(ATTOTIME_IN_USEC(10),0, ad_interrupt);
433   timer_set(ATTOTIME_IN_USEC(10), NULL,0, ad_interrupt);
434434}
435435
436436
src/mame/drivers/slapshot.c
r1355r1356
187187
188188static INTERRUPT_GEN( slapshot_interrupt )
189189{
190   timer_set(ATTOTIME_IN_CYCLES(200000-500,0),0, slapshot_interrupt6);
190   timer_set(ATTOTIME_IN_CYCLES(200000-500,0), NULL, 0, slapshot_interrupt6);
191191   cpunum_set_input_line(0,5,HOLD_LINE);
192192}
193193
src/mame/drivers/ertictac.c
r1355r1356
161161
162162static void startTimer(void)
163163{
164   timer_set(ATTOTIME_IN_USEC( ((T1low&0xff)|((T1high&0xff)<<8))>>4), 0, ertictacTimer);
164   timer_set(ATTOTIME_IN_USEC( ((T1low&0xff)|((T1high&0xff)<<8))>>4), NULL, 0, ertictacTimer);
165165}
166166
167167static WRITE32_HANDLER(T1GO_w)
src/mame/drivers/victory.c
r1355r1356
154154
155155static WRITE8_HANDLER( sound_command_w )
156156{
157   timer_call_after_resynch(data, delayed_command_w);
157   timer_call_after_resynch(NULL, data, delayed_command_w);
158158}
159159
160160
src/mame/drivers/cninja.c
r1355r1356
825825
826826static MACHINE_RESET( cninja )
827827{
828   raster_irq_timer = timer_alloc(interrupt_gen);
828   raster_irq_timer = timer_alloc(interrupt_gen, NULL);
829829   cninja_scanline=0;
830830   cninja_irq_mask=0;
831831}
src/mame/drivers/missile.c
r1355r1356
391391   opcode_base = opcode_arg_base = videoram;
392392
393393   /* create a timer to speed/slow the CPU */
394   cpu_timer = timer_alloc(adjust_cpu_speed);
394   cpu_timer = timer_alloc(adjust_cpu_speed, NULL);
395395   timer_adjust(cpu_timer, video_screen_get_time_until_pos(0, v_to_scanline(0), 0), 0, attotime_zero);
396396
397397   /* create a timer for IRQs and set up the first callback */
398   irq_timer = timer_alloc(clock_irq);
398   irq_timer = timer_alloc(clock_irq, NULL);
399399   irq_state = 0;
400400   schedule_next_irq(-32);
401401
src/mame/drivers/ladyfrog.c
r1355r1356
9797static WRITE8_HANDLER( sound_command_w )
9898{
9999   soundlatch_w(0,data);
100   timer_call_after_resynch(data,nmi_callback);
100   timer_call_after_resynch(NULL, data,nmi_callback);
101101}
102102
103103static WRITE8_HANDLER( nmi_disable_w )
src/mame/drivers/tecmosys.c
r1355r1356
660660   ROM[0x044A/2] = 0x4E71;
661661   ROM[0x04bc/2] = 0x0000;
662662   ROM[0x302c/2] = 0x60a4;
663   timer_set(ATTOTIME_IN_SEC(2),0,reset_callback);
663   timer_set(ATTOTIME_IN_SEC(2), NULL,0,reset_callback);
664664   gametype=0;
665665}
666666
r1355r1356
682682   ROM[0x04822/2] = 0x4E71;
683683   ROM[0x04862/2] = 0x4E71;
684684
685   timer_set(ATTOTIME_IN_SEC(2),0,reset_callback);
685   timer_set(ATTOTIME_IN_SEC(2), NULL,0,reset_callback);
686686   gametype=1;
687687
688688}
src/mame/drivers/polyplay.c
r1355r1356
106106void polyplay_sh_start(void);
107107
108108/* timer handling */
109static TIMER_CALLBACK( timer_callback );
109static TIMER_CALLBACK( polyplay_timer_callback );
110110static emu_timer* polyplay_timer;
111111static WRITE8_HANDLER( polyplay_start_timer2 );
112112static WRITE8_HANDLER( polyplay_sound_channel );
r1355r1356
133133   polyplay_set_channel2(0);
134134   polyplay_play_channel2(0);
135135
136   polyplay_timer = timer_alloc(timer_callback);
136   polyplay_timer = timer_alloc(polyplay_timer_callback, NULL);
137137}
138138
139139
r1355r1356
365365ROM_END
366366
367367
368static TIMER_CALLBACK( timer_callback )
368static TIMER_CALLBACK( polyplay_timer_callback )
369369{
370370   cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0x4c);
371371}
src/mame/drivers/exidy440.c
r1355r1356
446446   switch (offset & 0xe0)
447447   {
448448      case 0x00:                              /* sound command */
449         timer_call_after_resynch(data, delayed_sound_command_w);
449         timer_call_after_resynch(NULL, data, delayed_sound_command_w);
450450         break;
451451
452452      case 0x20:                              /* coin bits I/O1 */
src/mame/drivers/merit.c
r1355r1356
780780   { NULL,      misc_w },      /* Port C write */
781781};
782782
783struct AY8910interface merit_ay8912_interface =
783static struct AY8910interface merit_ay8912_interface =
784784{
785785   0,0,
786786   led2_w,0
src/mame/drivers/supbtime.c
r1355r1356
468468     ROM_LOAD( "gc05.bin",    0x00000, 0x20000, CRC(2f2246ff) SHA1(3fcceb6f5aa5f33187bcf4c59d88327f396fa80d) )
469469ROM_END
470470
471/* is this actually a good dump?, there are no backgrounds ingame! */
472ROM_START( supbtima )
473   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
474   ROM_LOAD16_BYTE( "3.11f", 0x00000, 0x20000, CRC(98b5f263) SHA1(ee4b0d2fcdc95aba0e78d066bd6c4d553a902848) )
475   ROM_LOAD16_BYTE( "4.12f", 0x00001, 0x20000, CRC(937e68b9) SHA1(4779e150518b9014c2154f33d38767c6a7447334) )
476
477   ROM_REGION( 0x10000, REGION_CPU2, 0 )   /* Sound CPU */
478   ROM_LOAD( "gc06.bin",    0x00000, 0x10000, CRC(e0e6c0f4) SHA1(5a8b29752c58ea76d9c7961c5b0d8c94f35037af) )
479
480   ROM_REGION( 0x080000, REGION_GFX1, ROMREGION_DISPOSE )
481   ROM_LOAD( "mae02.bin", 0x000000, 0x80000, CRC(a715cca0) SHA1(0539bba39c60324d85599ac69ff78bb215deb511) ) /* chars */
482
483   ROM_REGION( 0x100000, REGION_GFX2, ROMREGION_DISPOSE )
484     ROM_LOAD16_BYTE( "mae00.bin", 0x000001, 0x80000, CRC(30043094) SHA1(5302cfd9bdaf90c4901fda75407379c4ce1cbdec) ) /* sprites */
485   ROM_LOAD16_BYTE( "mae01.bin", 0x000000, 0x80000, CRC(434af3fb) SHA1(1cfd30d14f03554e826576d6d32ce424f0df3748) )
486
487   ROM_REGION( 0x20000, REGION_SOUND1, 0 )   /* ADPCM samples */
488     ROM_LOAD( "gc05.bin",    0x00000, 0x20000, CRC(2f2246ff) SHA1(3fcceb6f5aa5f33187bcf4c59d88327f396fa80d) )
489ROM_END
490
471491ROM_START( supbtimj )
472492   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
473493   ROM_LOAD16_BYTE( "gc03.bin", 0x00000, 0x20000, CRC(b5621f6a) SHA1(2dfd361e81dc4805bc248cc293d94131162df2d2) )
r1355r1356
508528
509529/******************************************************************************/
510530
511GAME( 1990, supbtime, 0,        supbtime, supbtime, 0, ROT0, "Data East Corporation", "Super Burger Time (World)", 0 )
531GAME( 1990, supbtime, 0,        supbtime, supbtime, 0, ROT0, "Data East Corporation", "Super Burger Time (World, set 1)", 0 )
532GAME( 1990, supbtima, supbtime, supbtime, supbtime, 0, ROT0, "Data East Corporation", "Super Burger Time (World, set 2)", 0 )
512533GAME( 1990, supbtimj, supbtime, supbtime, supbtime, 0, ROT0, "Data East Corporation", "Super Burger Time (Japan)", 0 )
513534GAME( 1991, chinatwn, 0,        chinatwn, chinatwn, 0, ROT0, "Data East Corporation", "China Town (Japan)", 0 )
src/mame/drivers/crgolf.c
r1355r1356
124124
125125static WRITE8_HANDLER( main_to_sound_w )
126126{
127   timer_call_after_resynch(data, main_to_sound_callback);
127   timer_call_after_resynch(NULL, data, main_to_sound_callback);
128128}
129129
130130
r1355r1356
151151
152152static WRITE8_HANDLER( sound_to_main_w )
153153{
154   timer_call_after_resynch(data, sound_to_main_callback);
154   timer_call_after_resynch(NULL, data, sound_to_main_callback);
155155}
156156
157157
src/mame/drivers/topspeed.c
r1355r1356
307307static INTERRUPT_GEN( topspeed_interrupt )
308308{
309309   /* Unsure how many int6's per frame */
310   timer_set(ATTOTIME_IN_CYCLES(200000-500,0),0, topspeed_interrupt6);
310   timer_set(ATTOTIME_IN_CYCLES(200000-500,0), NULL, 0, topspeed_interrupt6);
311311   cpunum_set_input_line(0, 5, HOLD_LINE);
312312}
313313
314314static INTERRUPT_GEN( topspeed_cpub_interrupt )
315315{
316316   /* Unsure how many int6's per frame */
317   timer_set(ATTOTIME_IN_CYCLES(200000-500,0),0, topspeed_cpub_interrupt6);
317   timer_set(ATTOTIME_IN_CYCLES(200000-500,0), NULL, 0, topspeed_cpub_interrupt6);
318318   cpunum_set_input_line(2, 5, HOLD_LINE);
319319}
320320
src/mame/drivers/segae.c
r1355r1356
305305//static UINT8* sms_rom;
306306static UINT8* sms_mainram;
307307//static UINT8* smsgg_backupram;
308static TIMER_CALLBACK_PTR( sms_scanline_timer_callback );
308static TIMER_CALLBACK( sms_scanline_timer_callback );
309309static struct sms_vdp *vdp2;
310310static struct sms_vdp *vdp1;
311311
r1355r1356
729729   chip->writemode = 0;
730730   chip->r_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
731731
732   chip->sms_scanline_timer = timer_alloc_ptr(sms_scanline_timer_callback, chip);
732   chip->sms_scanline_timer = timer_alloc(sms_scanline_timer_callback, chip);
733733
734734   return chip;
735735}
r1355r1356
737737/* stop timer and clear ram.. used on megatech when we switch between genesis and sms mode */
738738void segae_md_sms_stop_scanline_timer(void)
739739{
740   timer_adjust_ptr(md_sms_vdp->sms_scanline_timer,  attotime_never, attotime_never);
740   timer_adjust(md_sms_vdp->sms_scanline_timer,  attotime_never, 0, attotime_never);
741741   memset(md_sms_vdp->vram,0x00,0x4000);
742742}
743743
r1355r1356
12841284}
12851285
12861286
1287static TIMER_CALLBACK_PTR( sms_scanline_timer_callback )
1287static TIMER_CALLBACK( sms_scanline_timer_callback )
12881288{
12891289   /* This function is called at the very start of every scanline starting at the very
12901290       top-left of the screen.  The first scanline is scanline 0 (we set scanline to -1 in
r1355r1356
12991299       The position to get the H position also has to compensate for a few errors
13001300    */
13011301//  printf("num %d\n",num );
1302   struct sms_vdp *chip = param;
1302   struct sms_vdp *chip = ptr;
13031303
13041304   if (chip->sms_scanline_counter<(chip->sms_total_scanlines-1))
13051305   {
13061306      chip->sms_scanline_counter++;
1307      timer_adjust_ptr(chip->sms_scanline_timer, ATTOTIME_IN_HZ(chip->sms_framerate * chip->sms_total_scanlines), attotime_zero);
1307      timer_adjust(chip->sms_scanline_timer, ATTOTIME_IN_HZ(chip->sms_framerate * chip->sms_total_scanlines), 0, attotime_zero);
13081308
13091309      if (chip->sms_scanline_counter>sms_mode_table[chip->screen_mode].sms2_height)
13101310      {
r1355r1356
14691469
14701470   chip->sms_scanline_counter = -1;
14711471   chip->yscroll = chip->regs[0x9]; // this can't change mid-frame
1472   timer_adjust_ptr(chip->sms_scanline_timer, attotime_zero, attotime_zero);
1472   timer_adjust(chip->sms_scanline_timer, attotime_zero, 0, attotime_zero);
14731473}
14741474
14751475#ifdef UNUSED_FUNCTION
r1355r1356
14911491#ifdef UNUSED_FUNCTION
14921492MACHINE_RESET(sms)
14931493{
1494   timer_adjust_ptr(vdp1->sms_scanline_timer, attotime_zero, attotime_zero);
1494   timer_adjust(vdp1->sms_scanline_timer, attotime_zero, 0, attotime_zero);
14951495}
14961496#endif
14971497
r1355r1356
19491949
19501950static MACHINE_RESET(systeme)
19511951{
1952   timer_adjust_ptr(vdp1->sms_scanline_timer, attotime_zero, attotime_zero);
1953   timer_adjust_ptr(vdp2->sms_scanline_timer, attotime_zero, attotime_zero);
1952   timer_adjust(vdp1->sms_scanline_timer, attotime_zero, 0, attotime_zero);
1953   timer_adjust(vdp2->sms_scanline_timer, attotime_zero, 0, attotime_zero);
19541954}
19551955
19561956MACHINE_RESET(megatech_md_sms)
19571957{
1958   timer_adjust_ptr(md_sms_vdp->sms_scanline_timer, attotime_zero, attotime_zero);
1958   timer_adjust(md_sms_vdp->sms_scanline_timer, attotime_zero, 0, attotime_zero);
19591959}
19601960
19611961MACHINE_RESET(megatech_bios)
19621962{
1963   timer_adjust_ptr(vdp1->sms_scanline_timer, attotime_zero, attotime_zero);
1963   timer_adjust(vdp1->sms_scanline_timer, attotime_zero, 0, attotime_zero);
19641964}
19651965
19661966static VIDEO_EOF(systeme)
src/mame/drivers/ksys573.c
r1355r1356
892892   atapi_data_len = 0;
893893   atapi_cdata_wait = 0;
894894
895   atapi_timer = timer_alloc( atapi_xfer_end );
895   atapi_timer = timer_alloc( atapi_xfer_end , NULL);
896896   timer_adjust(atapi_timer, attotime_never, 0, attotime_never);
897897
898898   for( i = 0; i < 2; i++ )
r1355r1356
14831483
14841484   for (i = 0; i < 3; i++)
14851485   {
1486      m_p_timer_root[i] = timer_alloc(root_finished);
1486      m_p_timer_root[i] = timer_alloc(root_finished, NULL);
14871487   }
14881488
14891489   timekeeper_init( 0, TIMEKEEPER_M48T58, memory_region( REGION_USER11 ) );
src/mame/drivers/sbrkout.c
r1355r1356
7777
7878static MACHINE_RESET( sbrkout )
7979{
80   timer_pulse(TIME_4V, 0, sbrkout_tones_4V);
80   timer_pulse(TIME_4V, NULL, 0, sbrkout_tones_4V);
8181}
8282
8383
src/mame/drivers/thunderx.c
r1355r1356
308308      calculate_collisions();
309309
310310      /* 100 cycle delay is arbitrary */
311      timer_set(ATTOTIME_IN_CYCLES(100,0),0, thunderx_firq_callback);
311      timer_set(ATTOTIME_IN_CYCLES(100,0), NULL, 0, thunderx_firq_callback);
312312   }
313313
314314   thunderx_1f98_data = data;
src/mame/drivers/wink.c
r1355r1356
5757{
5858   cpunum_set_input_line(1,0,HOLD_LINE);
5959   //sync with sound cpu (but it still loses some soundlatches...)
60   //timer_call_after_resynch(0, NULL);
60   //timer_call_after_resynch(NULL, 0, NULL);
6161}
6262
6363static ADDRESS_MAP_START( wink_map, ADDRESS_SPACE_PROGRAM, 8 )
src/mame/drivers/videopin.c
r1355r1356
6565      scanline = 32;
6666   }
6767
68   timer_set(video_screen_get_time_until_pos(0, scanline, 0), scanline, interrupt_callback);
68   timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, interrupt_callback);
6969}
7070
7171
7272static MACHINE_RESET( videopin )
7373{
74   timer_set(video_screen_get_time_until_pos(0, 32, 0), 32, interrupt_callback);
74   timer_set(video_screen_get_time_until_pos(0, 32, 0), NULL, 32, interrupt_callback);
7575
7676   /* both output latches are cleared on reset */
7777
src/mame/drivers/runaway.c
r1355r1356
4141      scanline = 16;
4242   }
4343
44   timer_set(video_screen_get_time_until_pos(0, scanline, 0), scanline, interrupt_callback);
44   timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, interrupt_callback);
4545}
4646
4747
4848static MACHINE_RESET( runaway )
4949{
50   timer_set(video_screen_get_time_until_pos(0, 16, 0), 16, interrupt_callback);
50   timer_set(video_screen_get_time_until_pos(0, 16, 0), NULL, 16, interrupt_callback);
5151}
5252
5353
src/mame/drivers/toypop.c
r1355r1356
223223{
224224   /* we must do this on a timer in order to have it take effect */
225225   /* otherwise, the reset process will override our changes */
226   timer_call_after_resynch(0, disable_interrupts);
226   timer_call_after_resynch(NULL, 0, disable_interrupts);
227227}
228228
229229static INTERRUPT_GEN( toypop_m68000_interrupt )
src/mame/drivers/micro3d.c
r1355r1356
406406static TIMER_CALLBACK( timera_int )
407407{
408408//      timer_set(attotime_mul(ATTOTIME_IN_HZ(M68901_CLK), ((m68901_base[0xf]>>8) & 0xff) * 200),0,timera_int);     // Set the timer again.
409        timer_set(ATTOTIME_IN_USEC(1000),0,timera_int);     // Set the timer again.
409        timer_set(ATTOTIME_IN_USEC(1000), NULL,0,timera_int);     // Set the timer again.
410410        m68901_int_gen(TMRA);           // Fire an interrupt.
411411}
412412
r1355r1356
426426
427427static TIMER_CALLBACK( timerd_int )
428428{
429        timer_set(ATTOTIME_IN_USEC(250),0,timerd_int);
429        timer_set(ATTOTIME_IN_USEC(250), NULL,0,timerd_int);
430430        m68901_int_gen(TMRD);           // Fire an interrupt.
431431}
432432
r1355r1356
473473                      break;
474474
475475        case 0x0f:    mame_printf_debug("Timer A Data:%4x\n",value);                                                       // Timer A Data Register
476                     timer_set(ATTOTIME_IN_USEC(1000),0,timera_int);
476                     timer_set(ATTOTIME_IN_USEC(1000), NULL,0,timera_int);
477477                      break;
478478
479479        case 0x10:    mame_printf_debug("Timer B Data:%4x\n",value);                                                           // Timer B Data Register
r1355r1356
485485                      break;
486486
487487        case 0x12:    mame_printf_debug("Timer D Data:%4x\n",value);
488                      timer_set(ATTOTIME_IN_USEC(500),0,timerd_int);                 // Timer D Data Register
488                      timer_set(ATTOTIME_IN_USEC(500), NULL,0,timerd_int);                 // Timer D Data Register
489489                      break;
490490
491491}
src/mame/drivers/ultratnk.c
r1355r1356
6161      cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
6262   }
6363
64   timer_set(video_screen_get_time_until_pos(0, scanline, 0), scanline, nmi_callback);
64   timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, nmi_callback);
6565}
6666
6767
6868static MACHINE_RESET( ultratnk )
6969{
70   timer_set(video_screen_get_time_until_pos(0, 32, 0), 32, nmi_callback);
70   timer_set(video_screen_get_time_until_pos(0, 32, 0), NULL, 32, nmi_callback);
7171}
7272
7373
src/mame/drivers/tugboat.c
r1355r1356
168168static TIMER_CALLBACK( interrupt_gen )
169169{
170170   cpunum_set_input_line(0, 0, HOLD_LINE);
171   timer_set(video_screen_get_frame_period(0), 0, interrupt_gen);
171   timer_set(video_screen_get_frame_period(0), NULL, 0, interrupt_gen);
172172}
173173
174174static MACHINE_START( tugboat )
r1355r1356
180180static MACHINE_RESET( tugboat )
181181{
182182   pia_reset();
183   timer_set(video_screen_get_time_until_pos(0, 30*8+4, 0), 0, interrupt_gen);
183   timer_set(video_screen_get_time_until_pos(0, 30*8+4, 0), NULL, 0, interrupt_gen);
184184}
185185
186186
src/mame/drivers/gunbustr.c
r1355r1356
6969
7070static INTERRUPT_GEN( gunbustr_interrupt )
7171{
72   timer_set(ATTOTIME_IN_CYCLES(200000-500,0),0, gunbustr_interrupt5);
72   timer_set(ATTOTIME_IN_CYCLES(200000-500,0), NULL, 0, gunbustr_interrupt5);
7373   cpunum_set_input_line(0, 4, HOLD_LINE);
7474}
7575
r1355r1356
181181static WRITE32_HANDLER( gunbustr_gun_w )
182182{
183183   /* 10000 cycle delay is arbitrary */
184   timer_set(ATTOTIME_IN_CYCLES(10000,0),0, gunbustr_interrupt5);
184   timer_set(ATTOTIME_IN_CYCLES(10000,0), NULL, 0, gunbustr_interrupt5);
185185}
186186
187187
src/mame/drivers/taito_z.c
r1355r1356
911911   sci_int6 = !sci_int6;
912912
913913   if (sci_int6)
914      timer_set(ATTOTIME_IN_CYCLES(200000-500,0),0, taitoz_interrupt6);
914      timer_set(ATTOTIME_IN_CYCLES(200000-500,0), NULL, 0, taitoz_interrupt6);
915915   cpunum_set_input_line(0, 4, HOLD_LINE);
916916}
917917
r1355r1356
926926   dblaxle_int6 = !dblaxle_int6;
927927
928928   if (dblaxle_int6)
929      timer_set(ATTOTIME_IN_CYCLES(200000-500,0),0, taitoz_interrupt6);
929      timer_set(ATTOTIME_IN_CYCLES(200000-500,0), NULL, 0, taitoz_interrupt6);
930930
931931   cpunum_set_input_line(0, 4, HOLD_LINE);
932932}
r1355r1356
934934static INTERRUPT_GEN( dblaxle_cpub_interrupt )
935935{
936936   // Unsure how many int6's per frame
937   timer_set(ATTOTIME_IN_CYCLES(200000-500,0),0, taitoz_interrupt6);
937   timer_set(ATTOTIME_IN_CYCLES(200000-500,0), NULL,  0, taitoz_interrupt6);
938938   cpunum_set_input_line(2, 4, HOLD_LINE);
939939}
940940
r1355r1356
11751175       but we don't want CPUA to have an int6 before int4 is over (?)
11761176    */
11771177
1178   timer_set(ATTOTIME_IN_CYCLES(10000,0),0, taitoz_interrupt6);
1178   timer_set(ATTOTIME_IN_CYCLES(10000,0), NULL, 0, taitoz_interrupt6);
11791179}
11801180
11811181
r1355r1356
12581258       Four lightgun interrupts happen before the collected coords
12591259       are moved to shared ram where CPUA can use them. */
12601260
1261   timer_set(ATTOTIME_IN_CYCLES(10000,0),0, taitoz_sg_cpub_interrupt5);
1261   timer_set(ATTOTIME_IN_CYCLES(10000,0), NULL, 0, taitoz_sg_cpub_interrupt5);
12621262}
12631263
12641264
src/mame/drivers/phoenix.c
r1355r1356
415415   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
416416INPUT_PORTS_END
417417
418
419static INPUT_PORTS_START( nextfase )
420   PORT_START      /* IN0 */
421   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
422   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )
423   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
424   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
425   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
426   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
427   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
428   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 )
429
430   PORT_START      /* IN1 */
431   PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_SPECIAL )   /* comes from IN0 0-2 */
432   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
433   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
434   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT  ) PORT_2WAY PORT_COCKTAIL
435   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_2WAY PORT_COCKTAIL
436   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2  ) PORT_COCKTAIL
437
438   PORT_START      /* DSW0 */
439   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
440   PORT_DIPSETTING(   0x00, "1" )
441   PORT_DIPSETTING(   0x01, "2" )
442   PORT_DIPSETTING(   0x02, "3" )
443   PORT_DIPSETTING(   0x03, "4" )
444   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )
445   PORT_DIPSETTING(   0x00, "3K 30K" )
446   PORT_DIPSETTING(   0x04, "4K 40K" )
447   PORT_DIPSETTING(   0x08, "5K 50K" )
448   PORT_DIPSETTING(   0x0c, "6K 60K" )
449   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
450   PORT_DIPSETTING(   0x10, DEF_STR( Off ) )
451   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
452   PORT_DIPNAME( 0x60, 0x00, DEF_STR( Coinage ) )
453   PORT_DIPSETTING(   0x00, "1C/1C & 1C/2C" )
454   PORT_DIPSETTING(   0x20, "2C/3C & 1C/3C" )
455   PORT_DIPSETTING(   0x40, "1C/2C & 1C/4C" )
456   PORT_DIPSETTING(   0x60, "2C/5C & 1C/5C" )
457   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
458
459   PORT_START      /* fake port for non-memory mapped dip switch */
460   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
461   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
462   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
463INPUT_PORTS_END
464
465
418466static INPUT_PORTS_START( pleiads )
419467   PORT_START      /* IN0 */
420468   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
r1355r1356
10961144   ROM_LOAD( "mmi6301.ic41",   0x0100, 0x0100, CRC(e176b768) SHA1(e2184dd495ed579f10b6da0b78379e02d7a6229f) )  /* palette high bits */
10971145ROM_END
10981146
1147ROM_START( nextfase )
1148   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1149   ROM_LOAD( "nf01.bin",   0x0000, 0x0800, CRC(b31ce820) SHA1(dfdb17995a14b66d2571c2c8de481d2792f9ce6a) )
1150   ROM_LOAD( "nf02.bin",   0x0800, 0x0800, CRC(891d21e1) SHA1(bea01962c0706c00eae42920bb2b3bfdb7e80d89) )
1151   ROM_LOAD( "nf03.bin",   0x1000, 0x0800, CRC(2ab7389d) SHA1(c0bc0c235cae4a8e880237196ea1718f8c1d0123) )
1152   ROM_LOAD( "nf04.bin",   0x1800, 0x0800, CRC(590d3c36) SHA1(89e87f207cdb9a7f5624170c09626ef85ede3969) )
1153   ROM_LOAD( "nf05.bin",   0x2000, 0x0800, CRC(3527f247) SHA1(0cccbc3e15d7603deaec845581983bfbcc4d4560) )
1154   ROM_LOAD( "nf06.bin",   0x2800, 0x0800, CRC(ac5e9ec1) SHA1(0402e5241d99759d804291998efd43f37ce99917) )
1155   ROM_LOAD( "nf07.bin",   0x3000, 0x0800, CRC(2eab35b4) SHA1(849bf8273317cc869bdd67e50c68399ee8ece81d) )
1156   ROM_LOAD( "nf08.bin",   0x3800, 0x0800, CRC(04c2323f) SHA1(4d820464f57e4f59acc46ea3264dba3cb9c501a1) )
1157
1158   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
1159   ROM_LOAD( "nf11.bin",      0x0000, 0x0800, CRC(3c7e623f) SHA1(e7ff5fc371664af44785c079e92eeb2d8530187b) )
1160   ROM_LOAD( "nf12.bin",      0x0800, 0x0800, CRC(59916d3b) SHA1(71aec70a8e096ed1f0c2297b3ae7dca1b8ecc38d) )
1161
1162   ROM_REGION( 0x1000, REGION_GFX2, ROMREGION_DISPOSE )
1163   ROM_LOAD( "nf09.bin",   0x0000, 0x0800, CRC(bacbfa88) SHA1(bf378a729726db01448f2cc4820f06e17659d674) )
1164   ROM_LOAD( "nf10.bin",   0x0800, 0x0800, CRC(3143a9ee) SHA1(371bb314dc9e4ec6ed469eb81391061296c547ec) )
1165
1166   /* Proms were missing from this dump, these might not be correct */
1167   ROM_REGION( 0x0200, REGION_PROMS, 0 )
1168   ROM_LOAD( "mmi6301.ic40",   0x0000, 0x0100, CRC(79350b25) SHA1(57411be4c1d89677f7919ae295446da90612c8a8) )  /* palette low bits */
1169   ROM_LOAD( "mmi6301.ic41",   0x0100, 0x0100, CRC(e176b768) SHA1(e2184dd495ed579f10b6da0b78379e02d7a6229f) )  /* palette high bits */
1170ROM_END
1171
1172
10991173ROM_START( pleiads )
11001174   ROM_REGION( 0x10000, REGION_CPU1, 0 )
11011175   ROM_LOAD( "ic47.r1",      0x0000, 0x0800, CRC(960212c8) SHA1(52a3232e99920805ce9e195b8a6338ae7044dd18) )
r1355r1356
12391313GAME( 1980, phoenixt, phoenix, phoenix,  phoenixt, 0,        ROT90, "Taito", "Phoenix (Taito)", 0 )
12401314GAME( 1980, phoenix3, phoenix, phoenix,  phoenix3, 0,        ROT90, "bootleg", "Phoenix (T.P.N.)", 0 )
12411315GAME( 1981, phoenixc, phoenix, phoenix,  phoenixt, 0,        ROT90, "bootleg?", "Phoenix (IRECSA, G.G.I Corp)", 0 )
1242GAME( 1981, condor,   phoenix, condor,   condor,   condor,   ROT90, "Sidam", "Condor", 0 )
1316
1317
1318GAME( 1981, condor,   phoenix, condor,   condor,   condor,   ROT90, "Sidam (bootleg)",      "Condor (bootleg of Phoenix)", 0 )
12431319// the following 2 were common bootlegs in england & france respectively
1244GAME( 1980, falcon,   phoenix, phoenix,  phoenixt, 0,        ROT90, "bootleg", "Falcon (bootleg set 1)", 0 )
1245GAME( 1980, vautour,  phoenix, phoenix,  phoenixt, 0,        ROT90, "bootleg", "Vautour (set 1 - Jeutel France)", 0 )
1246GAME( 1980, vautour2, phoenix, condor,   condor,   condor,   ROT90, "bootleg", "Vautour (set 2)", 0 )
1320GAME( 1980, falcon,   phoenix, phoenix,  phoenixt, 0,        ROT90, "bootleg",              "Falcon (bootleg of Phoenix) (set 1)", 0 )
1321GAME( 1980, vautour,  phoenix, phoenix,  phoenixt, 0,        ROT90, "Jeutel (bootleg)",     "Vautour (bootleg of Phoenix) (set 1)", 0 )
1322GAME( 1980, vautour2, phoenix, condor,   condor,   condor,   ROT90, "bootleg",              "Vautour (bootleg of Phoenix) (set 2)", 0 )
12471323// fenix is an italian bootleg based on vautour
1248GAME( 1980, fenix,    phoenix, condor,   condor,   condor,   ROT90, "bootleg", "Fenix", GAME_NOT_WORKING )
1249GAME( 1980, griffon,  phoenix, condor,   condor,   condor,   ROT90, "Videotron", "Griffon", 0 )
1250GAME( 1980, falcona,  phoenix, condor,   falcona,  0,        ROT90, "bootleg", "Falcon (bootleg set 2)", 0 )
1324GAME( 1980, fenix,    phoenix, condor,   condor,   condor,   ROT90, "bootleg",              "Fenix (bootleg of Phoenix)", GAME_NOT_WORKING )
1325GAME( 1980, griffon,  phoenix, condor,   condor,   condor,   ROT90, "Videotron (bootleg)",  "Griffon (bootleg of Phoenix)", 0 )
1326GAME( 1980, falcona,  phoenix, condor,   falcona,  0,        ROT90, "bootleg",              "Falcon (bootleg of Phoenix) (set 2)", 0 )
1327// nextfase is a spanish bootleg
1328GAME( 1981, nextfase, phoenix, phoenix,  nextfase, 0,        ROT90, "Petaco S.A. (bootleg)","Next Fase (bootleg of Phoenix)", 0 )
1329
12511330GAME( 1981, pleiads,  0,       pleiads,  pleiads,  0,        ROT90, "Tehkan", "Pleiads (Tehkan)", GAME_IMPERFECT_COLORS )
12521331GAME( 1981, pleiadbl, pleiads, pleiads,  pleiads,  0,        ROT90, "bootleg", "Pleiads (bootleg)", GAME_IMPERFECT_COLORS )
12531332GAME( 1981, pleiadce, pleiads, pleiads,  pleiadce, 0,        ROT90, "Tehkan (Centuri license)", "Pleiads (Centuri)", GAME_IMPERFECT_COLORS )
src/mame/drivers/msisaac.c
r1355r1356
7070static WRITE8_HANDLER( sound_command_w )
7171{
7272   soundlatch_w(0,data);
73   timer_call_after_resynch(data,nmi_callback);
73   timer_call_after_resynch(NULL, data,nmi_callback);
7474}
7575
7676static WRITE8_HANDLER( nmi_disable_w )
src/mame/drivers/superqix.c
r1355r1356
212212
213213static READ8_HANDLER( mcu_acknowledge_r )
214214{
215   timer_call_after_resynch(0, mcu_acknowledge_callback);
215   timer_call_after_resynch(NULL, 0, mcu_acknowledge_callback);
216216   return 0;
217217}
218218
r1355r1356
419419            break;
420420
421421         case 0x5:   // answer to Z80
422            timer_call_after_resynch(portB_out, delayed_mcu_z80_w);
422            timer_call_after_resynch(NULL, portB_out, delayed_mcu_z80_w);
423423            break;
424424
425425         case 0x6:
r1355r1356
435435
436436static WRITE8_HANDLER( hotsmash_z80_mcu_w )
437437{
438   timer_call_after_resynch(data, delayed_z80_mcu_w);
438   timer_call_after_resynch(NULL, data, delayed_z80_mcu_w);
439439}
440440
441441static READ8_HANDLER(hotsmash_from_mcu_r)
src/mame/drivers/cojag.c
r1355r1356
474474{
475475   /* if a command is still pending, and we haven't maxed out our timer, set a new one */
476476   if (gpu_command_pending && param < 1000)
477      timer_set(ATTOTIME_IN_USEC(50), ++param, gpu_sync_timer);
477      timer_set(ATTOTIME_IN_USEC(50), NULL, ++param, gpu_sync_timer);
478478}
479479
480480
r1355r1356
488488   jaguar_gpu_resume();
489489
490490   /* start the sync timer going, and note that there is a command pending */
491   timer_call_after_resynch(0, gpu_sync_timer);
491   timer_call_after_resynch(NULL, 0, gpu_sync_timer);
492492   gpu_command_pending = 1;
493493}
494494
src/mame/drivers/gijoe.c
r1355r1356
207207{
208208   state_save_register_global(cur_control2);
209209
210   dmadelay_timer = timer_alloc(dmaend_callback);
210   dmadelay_timer = timer_alloc(dmaend_callback, NULL);
211211}
212212
213213
src/mame/drivers/segas32.c
r1355r1356
392392   memset(v60_irq_control, 0xff, sizeof(v60_irq_control));
393393
394394   /* allocate timers */
395   v60_irq_timer[0] = timer_alloc(signal_v60_irq_callback);
396   v60_irq_timer[1] = timer_alloc(signal_v60_irq_callback);
395   v60_irq_timer[0] = timer_alloc(signal_v60_irq_callback, NULL);
396   v60_irq_timer[1] = timer_alloc(signal_v60_irq_callback, NULL);
397397
398398   /* clear IRQ lines */
399399   cpunum_set_input_line(0, 0, CLEAR_LINE);
r1355r1356
571571{
572572   signal_v60_irq(MAIN_IRQ_VBSTART);
573573   system32_set_vblank(1);
574   timer_set(video_screen_get_time_until_pos(0, 0, 0), 0, end_of_vblank_int);
574   timer_set(video_screen_get_time_until_pos(0, 0, 0), NULL, 0, end_of_vblank_int);
575575   if (system32_prot_vblank)
576576      (*system32_prot_vblank)();
577577}
src/mame/drivers/esh.c
r1355r1356
274274{
275275   // IRQ
276276   cpunum_set_input_line(0, 0, ASSERT_LINE);
277   timer_set(ATTOTIME_IN_USEC(50), 0, irq_stop);
277   timer_set(ATTOTIME_IN_USEC(50), NULL, 0, irq_stop);
278278
279279   laserdisc_vsync(discinfo);
280280}
src/mame/drivers/neodrvr.c
r1355r1356
67536753static DRIVER_INIT( svcpcb )
67546754{
67556755   /* start a timer that will check the BIOS select DIP every second */
6756   timer_pulse(ATTOTIME_IN_MSEC(1000), 0, svcpcb_bios_timer_callback);
6757   svcpcb_bios_timer_callback(machine, 0);
6756   timer_pulse(ATTOTIME_IN_MSEC(1000), NULL, 0, svcpcb_bios_timer_callback);
6757   svcpcb_bios_timer_callback(machine, NULL, 0);
67586758
67596759   svcchaos_px_decrypt();
67606760   svcpcb_gfx_decrypt();
src/mame/drivers/fromance.c
r1355r1356
9999static WRITE8_HANDLER( fromance_commanddata_w )
100100{
101101   /* do this on a timer to let the slave CPU synchronize */
102   timer_call_after_resynch(data, deferred_commanddata_w);
102   timer_call_after_resynch(NULL, data, deferred_commanddata_w);
103103}
104104
105105
106106static READ8_HANDLER( fromance_busycheck_main_r )
107107{
108108   /* set a timer to force synchronization after the read */
109   timer_call_after_resynch(0, NULL);
109   timer_call_after_resynch(NULL, 0, NULL);
110110
111111   if (!fromance_directionflag) return 0x00;      // standby
112112   else return 0xff;                        // busy
src/mame/drivers/dlair.c
r1355r1356
133133};
134134
135135
136struct z80_irq_daisy_chain dleuro_daisy_chain[] =
136static struct z80_irq_daisy_chain dleuro_daisy_chain[] =
137137{
138138   { z80sio_reset, z80sio_irq_state, z80sio_irq_ack, z80sio_irq_reti, 0 },
139139   { z80ctc_reset, z80ctc_irq_state, z80ctc_irq_ack, z80ctc_irq_reti, 0 },
src/mame/drivers/skykid.c
r1355r1356
166166   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Demo_Sounds ) )
167167   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
168168   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
169   PORT_DIPNAME( 0x08, 0x08, "Round Select" )
169   PORT_DIPNAME( 0x08, 0x08, "Round Skip" )
170170   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
171171   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
172172   PORT_DIPNAME( 0x04, 0x04, "Freeze" )
r1355r1356
234234   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
235235INPUT_PORTS_END
236236
237static INPUT_PORTS_START( skykids )
238   PORT_START   /* DSW A */
239   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
240   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Coin_A ) )
241   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
242   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
243   PORT_DIPSETTING(    0x60, DEF_STR( 1C_1C ) )
244   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
245   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Demo_Sounds ) )
246   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
247   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
248   PORT_DIPNAME( 0x08, 0x08, "Round Select" )
249   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
250   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
251   PORT_DIPNAME( 0x04, 0x04, "Freeze" )
252   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
253   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
254   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_B ) )
255   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
256   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
257   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
258   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
259
260   PORT_START   /* DSW B */
261   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) )
262   PORT_DIPSETTING(    0x80, "1" )
263   PORT_DIPSETTING(    0x40, "2" )
264   PORT_DIPSETTING(    0xc0, "3" )
265   PORT_DIPSETTING(    0x00, "5" )
266   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
267   PORT_DIPSETTING(    0x00, "30k every 80k" )
268   PORT_DIPSETTING(    0x10, "30k and 80k" )
269   PORT_DIPSETTING(    0x20, "40k every 90k" )
270   PORT_DIPSETTING(    0x30, "40k and 90k" )
271   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
272   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
273   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
274   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
275   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
276   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
277   PORT_DIPNAME( 0x02, 0x02, "Allow Buy In" )
278   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
279   PORT_DIPSETTING(    0x02, DEF_STR( Yes ) )
280   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
281   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
282   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
283
284   PORT_START
285   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
286   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
287   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
288   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
289   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
290
291   PORT_START   /* IN 0 */
292   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 )
293   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 )
294   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
295   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
296   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
297   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
298
299   PORT_START   /* IN 1 */
300   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
301   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
302   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
303   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
304   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
305   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
306
307   PORT_START   /* IN 2 */
308   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
309   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
310   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
311   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
312   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
313   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
314INPUT_PORTS_END
315
237316static INPUT_PORTS_START( drgnbstr )
238317   PORT_START   /* DSW A */
239318   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
r1355r1356
499578   ROM_LOAD( "sk1-5.6n",     0x0500, 0x0200, CRC(161514a4) SHA1(4488ce60d12be6586e4a1ddbbfd06bf4e7dfaceb) )   /* sprites lookup table */
500579ROM_END
501580
581ROM_START( skykids )
582   ROM_REGION( 0x14000, REGION_CPU1, 0 )   /* 6809 code */
583   ROM_LOAD( "sk2a.6c",     0x08000, 0x4000, CRC(68492672) SHA1(3dbe5ec930de5c526d3ef65513993c10f2153a36) )
584   ROM_LOAD( "sk1a.6b",     0x0c000, 0x4000, CRC(e16abe25) SHA1(78e0d30b15fb62c4399d847784ddc61f6819feba) )
585   ROM_LOAD( "sk1_3.6d",     0x10000, 0x4000, CRC(314b8765) SHA1(d90a8a853ce672fe5ee190f07bcb33262c73df3b) )   /* banked ROM */
586
587   ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* MCU code */
588   ROM_LOAD( "sk2_4.3c",       0x8000, 0x2000, CRC(a460d0e0) SHA1(7124ffeb3b84b282940dcbf9421ae4934bcce1c8) )   /* subprogram for the MCU */
589   ROM_LOAD( "cus63-63a1.mcu", 0xf000, 0x1000, CRC(6ef08fb3) SHA1(4842590d60035a0059b0899eb2d5f58ae72c2529) )   /* MCU internal code */
590
591   ROM_REGION( 0x02000, REGION_GFX1, ROMREGION_DISPOSE )
592   ROM_LOAD( "sk1_6.6l",     0x0000, 0x2000, CRC(58b731b9) SHA1(40f7be85914833ce02a734c20d68c0db8b77911d) )   /* chars */
593
594   ROM_REGION( 0x02000, REGION_GFX2, ROMREGION_DISPOSE )
595   ROM_LOAD( "sk1_5.7e",     0x0000, 0x2000, CRC(c33a498e) SHA1(9f89a514888418a9bebbca341a8cc66e41b58acb) )
596
597   ROM_REGION( 0x10000, REGION_GFX3, ROMREGION_DISPOSE )
598   ROM_LOAD( "sk1_8.10n",    0x0000, 0x4000, CRC(44bb7375) SHA1(5b2fa6782671150bab5f3c3ac46b47bc23f3d7e0) )   /* sprites */
599   ROM_LOAD( "sk1_7.10m",    0x4000, 0x4000, CRC(3454671d) SHA1(723b26a0f208addc2a22736457cb4be6ab6c69cc) )
600   /* 0x8000-0xbfff  will be unpacked from 0x4000-0x5fff */
601   ROM_FILL(                 0xc000, 0x4000, 0x00 )   // part of the gfx is 2bpp decoded as 3bpp
602
603   ROM_REGION( 0x0700, REGION_PROMS, 0 )
604   ROM_LOAD( "sk1-1.2n",     0x0000, 0x0100, CRC(0218e726) SHA1(8b766162a4783c058d9a1ecf8741673d7ef955fb) )   /* red component */
605   ROM_LOAD( "sk1-2.2p",     0x0100, 0x0100, CRC(fc0d5b85) SHA1(d1b13e42e735b24594cf0b840dee8110de23369e) )   /* green component */
606   ROM_LOAD( "sk1-3.2r",     0x0200, 0x0100, CRC(d06b620b) SHA1(968a2d62c65e201d521e9efa8fcf6ad15898e4b3) )   /* blue component */
607   ROM_LOAD( "sk1-4.5n",     0x0300, 0x0200, CRC(c697ac72) SHA1(3b79755e6cbb22c14fc4affdbd3f4521da1d90e8) )   /* tiles lookup table */
608   ROM_LOAD( "sk1-5.6n",     0x0500, 0x0200, CRC(161514a4) SHA1(4488ce60d12be6586e4a1ddbbfd06bf4e7dfaceb) )   /* sprites lookup table */
609ROM_END
610
502611ROM_START( drgnbstr )
503612   ROM_REGION( 0x14000, REGION_CPU1, 0 ) /* 6809 code */
504613   ROM_LOAD( "db1_2b.6c",    0x08000, 0x04000, CRC(0f11cd17) SHA1(691d853f4f08898ecf4bccfb70a568de309329f1) )
r1355r1356
551660GAME( 1985, skykid,   0,      skykid, skykid,   skykid,  ROT180, "Namco", "Sky Kid (New Ver.)", GAME_SUPPORTS_SAVE ) /* Uses CUS63 aka 63a1 */
552661GAME( 1985, skykido,  skykid, skykid, skykid,   skykid,  ROT180, "Namco", "Sky Kid (Old Ver.)", GAME_SUPPORTS_SAVE ) /* Uses CUS63 aka 63a1 */
553662GAME( 1985, skykidd,  skykid, skykid, skykid,   skykid,  ROT180, "Namco", "Sky Kid (CUS60 Ver.)", GAME_SUPPORTS_SAVE ) /* Uses CUS60 aka 60a1 */
663
664// no license text is displayed but the PCB was licensed by Namco for production by Sipem (formerly Sidam) with Namco supplying the Custom chips (MCU etc.)
665// the level select is handled in a much more user-friendly way in this set and the dip for it is inverted (although this is displayed incorrectly in the test mode)
666GAME( 1985, skykids,  skykid, skykid, skykids,  skykid,  ROT180, "Namco [Sipem license]", "Sky Kid (Manufactured by Sipem)", GAME_SUPPORTS_SAVE ) /* Uses CUS63 aka 63a1 */
src/mame/drivers/halleys.c
r1355r1356
22282228
22292229   init_common();
22302230
2231   blitter_reset_timer = timer_alloc(blitter_reset);
2231   blitter_reset_timer = timer_alloc(blitter_reset, NULL);
22322232}
22332233
22342234
src/mame/drivers/ssfindo.c
r1355r1356
705705static DRIVER_INIT(ssfindo)
706706{
707707   flashType=0;
708   PS7500timer0 = timer_alloc(PS7500_Timer0_callback);
709   PS7500timer1 = timer_alloc(PS7500_Timer1_callback);
708   PS7500timer0 = timer_alloc(PS7500_Timer0_callback, NULL);
709   PS7500timer1 = timer_alloc(PS7500_Timer1_callback, NULL);
710710}
711711
712712static DRIVER_INIT(ppcar)
713713{
714714   flashType=1;
715   PS7500timer0 = timer_alloc(PS7500_Timer0_callback);
716   PS7500timer1 = timer_alloc(PS7500_Timer1_callback);
715   PS7500timer0 = timer_alloc(PS7500_Timer0_callback, NULL);
716   PS7500timer1 = timer_alloc(PS7500_Timer1_callback, NULL);
717717}
718718
719719GAME( 1999, ssfindo, 0,        ssfindo,  ssfindo,  ssfindo, ROT0, "Icarus", "See See Find Out", GAME_NO_SOUND )
src/mame/drivers/firetrk.c
r1355r1356
102102      scanline = 0;
103103   }
104104
105   timer_set(video_screen_get_time_until_pos(0, scanline, 0), scanline, periodic_callback);
105   timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, periodic_callback);
106106}
107107
108108
r1355r1356
226226
227227static MACHINE_RESET( firetrk )
228228{
229   timer_pulse(video_screen_get_frame_period(0), 0, frame_callback);
229   timer_pulse(video_screen_get_frame_period(0), NULL, 0, frame_callback);
230230
231231   if (GAME_IS_MONTECARLO)
232232   {
r1355r1356
241241      set_firetrk_service(last_service);
242242   }
243243
244   timer_call_after_resynch(0, periodic_callback);
244   timer_call_after_resynch(NULL, 0, periodic_callback);
245245}
246246
247247
src/mame/drivers/peplus.c
r1355r1356
44    PLAYER'S EDGE PLUS (PE+)
55
66    Driver by Jim Stolis.
7    Layouts by Stephh.
78
89    Special thanks to smf for I2C EEPROM support.
910
r1355r1356
3839    periodically update an external eeprom for an even more secure backup.  This eeprom
3940    also holds the current game state in order to recover the player from a full power failure.
4041
42
43Additional notes
44================
45
461) What are "set chips" ?
47
48    They are meant to be used after you have already sucessfully put a new game in your machine.
49    Lets say you have 'pepp0516' installed and you go through the setup. In a real machine,
50    you may want to add a bill validator. The only way to do that is to un-socket the 'pepp0516'
51    chip and put in the 'peset038' chip and then reboot the machine. Then this chip's program
52    runs and you set the options and put the 'pepp0516' chip back in.
53
54    The only way to simulate this is to fire up the 'pepp0516' game and set it up. Then exit the
55    game and copy the pepp0516.nv file to peset038.nv, and then run the 'peset038' program.
56    This is because they have to have the same eeprom and cmos data in memory to work. When you
57    are done with the 'peset038' program, you copy the peset038.nv file back over the pepp0516.nv .
58    'peset038' is just a utility program with one screen and 3 tested inputs.
59
60
612) Initialisation
62
63  - Method 1 :
64      * be sure the door is opened (if not, press 'O' by default)
65      * "CMOS DATA" will be displayed
66      * press the self-test button (default is 'K')
67      * be sure the door is opened (if not, press 'O' by default)
68      * "EEPROM DATA" will be displayed
69      * press the self-test button (default is 'K')
70      * be sure the door is closed (if not, press 'O' by default)
71
72  - Method 2 :
73      * be sure the door is opened (if not, press 'O' by default)
74      * "CMOS DATA" will be displayed
75      * press the self-test button (default is 'K') until a "beep" is heard
76      * be sure the door is closed (if not, press 'O' by default)
77      * press the jackpot reset button (default is 'L')
78      * be sure the door is opened (if not, press 'O' by default)
79      * "EEPROM DATA" will be displayed
80      * press the self-test button (default is 'K')
81      * be sure the door is closed (if not, press 'O' by default)
82
83
84          gamename  method
85          --------  ------
86          pepp0158     2
87          pepp0188     1
88          pepp0516     1
89          pebe0014     1
90          peke1012     1
91          peps0615     2
92          peps0716     2
93          pexp0019     2
94          pexs0006     2
95
96
972) Configuration
98
99  - To configure a game :
100      * be sure the door is opened (if not, press 'O' by default)
101      * press the self-test button (default is 'K')
102      * cycle through the screens with the self-test button (default is 'K')
103      * close the door (default is 'O') to go back to the game and save the settings
104
1052a) What are "set chips" ?
106
107    They are meant to be used after you have already sucessfully put a new game in your machine.
108    Lets say you have 'pepp0516' installed and you go through the setup. In a real machine,
109    you may want to add a bill validator. The only way to do that is to un-socket the 'pepp0516'
110    chip and put in the 'peset038' chip and then reboot the machine. Then this chip's program
111    runs and you set the options and put the 'pepp0516' chip back in.
112
113    The only way to simulate this is to fire up the 'pepp0516' game and set it up. Then exit the
114    game and copy the pepp0516.nv file to peset038.nv, and then run the 'peset038' program.
115    This is because they have to have the same eeprom and cmos data in memory to work. When you
116    are done with the peset038 program, you copy the peset038.nv file back over the pepp0516.nv .
117    'peset038' is just a utility program with one screen.
118
1192b) About the "autohold" feature
120
121    Depending on laws which vary from cities/country, this feature can available or not in the
122    "operator mode". By default, it isn't available. To have this feature available in the
123    "operator mode", a new chip has to be burnt with a bit set and a new checksum (game ID
124    doesn't change though). Once the feature is available, it can be decided to turn the
125    "autohold" option ON or OFF (default is OFF).
126    To avoid having too many clones in MAME, a fake "Enable Autohold Feature" configuration
127    option has been added for (poker) games that support it. If you change this option,
128    you must leave the game, delete the .nv file, initialise and configure the game again.
129
130
131
132Stephh's log (2007.11.28) :
133  - split old peplus.c to peplus.c and pe_drvr.c (same as it was done for the NEOGEO)
134  - Renamed sets :
135      * 'peplus'   -> 'pepp0516' (so we get the game ID as for the other games)
136  - added MACHINE_RESET definition (needed for fake "Enable Autohold Feature" configuration)
137  - added generic/default layout, inputs and outputs
138  - for each kind of game (poker, bjack, keno, slots) :
139      * added two layouts (default is the "Bezel Lamps" for players, the other is "Debug Lamps")
140      * added one INPUT_PORT definition
141  - added fake "Enable Autohold Feature" configuration option for poker games that allow it
142    and added a specific INPUT_PORT definition
143  - for "set chips" :
144      * added one fake layout
145      * added one fake INPUT_PORT definition
146
41147***********************************************************************************/
148
42149#include "driver.h"
43150#include "sound/ay8910.h"
44151#include "cpu/i8051/i8051.h"
45152#include "machine/i2cmem.h"
46153
47154#include "peplus.lh"
48#include "pepp0158.lh"
49#include "pepp0188.lh"
50#include "peset038.lh"
155#include "pe_schip.lh"
156#include "pe_poker.lh"
157#include "pe_bjack.lh"
158#include "pe_keno.lh"
159#include "pe_slots.lh"
51160
161
162static UINT16 autohold_addr; /* address to patch in program RAM to enable autohold feature */
163
52164static tilemap *bg_tilemap;
53165
54166/* Pointers to External RAM */
r1355r1356
241353
242354static WRITE8_HANDLER( peplus_output_bank_a_w )
243355{
244   output_set_value("coinlockout",(data >> 0) & 1); /* Coin Lockout */
245   output_set_value("diverter",(data >> 1) & 1); /* Diverter */
246   output_set_value("bell",(data >> 2) & 1); /* Bell */
247   output_set_value("na1",(data >> 3) & 1); /* N/A */
248   output_set_value("hopper1",(data >> 4) & 1); /* Hopper 1 */
249   output_set_value("hopper2",(data >> 5) & 1); /* Hopper 2 */
250   output_set_value("na2",(data >> 6) & 1); /* N/A */
251   output_set_value("na3",(data >> 7) & 1); /* N/A */
356   output_set_value("pe_bnka0",(data >> 0) & 1); /* Coin Lockout */
357   output_set_value("pe_bnka1",(data >> 1) & 1); /* Diverter */
358   output_set_value("pe_bnka2",(data >> 2) & 1); /* Bell */
359   output_set_value("pe_bnka3",(data >> 3) & 1); /* N/A */
360   output_set_value("pe_bnka4",(data >> 4) & 1); /* Hopper 1 */
361   output_set_value("pe_bnka5",(data >> 5) & 1); /* Hopper 2 */
362   output_set_value("pe_bnka6",(data >> 6) & 1); /* specific to a kind of machine */
363   output_set_value("pe_bnka7",(data >> 7) & 1); /* specific to a kind of machine */
252364
253365    coin_out_state = 0;
254366    if((data >> 4) & 1)
r1355r1356
257369
258370static WRITE8_HANDLER( peplus_output_bank_b_w )
259371{
260   output_set_lamp_value(0,(data >> 0) & 1); /* Hold 2 3 4 Lt */
261   output_set_lamp_value(1,(data >> 1) & 1); /* Deal Draw Lt */
262   output_set_lamp_value(2,(data >> 2) & 1); /* Cash Out Lt */
263   output_set_lamp_value(3,(data >> 3) & 1); /* Hold 1 Lt */
264   output_set_lamp_value(4,(data >> 4) & 1); /* Bet Credits Lt */
265   output_set_lamp_value(5,(data >> 5) & 1); /* Change Request Lt */
266   output_set_lamp_value(6,(data >> 6) & 1); /* Door Open Lt */
267   output_set_lamp_value(7,(data >> 7) & 1); /* Hold 5 Lt */
372   output_set_value("pe_bnkb0",(data >> 0) & 1); /* specific to a kind of machine */
373   output_set_value("pe_bnkb1",(data >> 1) & 1); /* Deal Spin Start */
374   output_set_value("pe_bnkb2",(data >> 2) & 1); /* Cash Out */
375   output_set_value("pe_bnkb3",(data >> 3) & 1); /* specific to a kind of machine */
376   output_set_value("pe_bnkb4",(data >> 4) & 1); /* Bet 1 / Bet Max */
377   output_set_value("pe_bnkb5",(data >> 5) & 1); /* Change Request */
378   output_set_value("pe_bnkb6",(data >> 6) & 1); /* Door Open */
379   output_set_value("pe_bnkb7",(data >> 7) & 1); /* specific to a kind of machine */
268380}
269381
270382static WRITE8_HANDLER( peplus_output_bank_c_w )
271383{
272   output_set_value("coininmeter",(data >> 0) & 1); /* Coin In Meter */
273   output_set_value("coinoutmeter",(data >> 1) & 1); /* Coin Out Meter */
274   output_set_value("coindropmeter",(data >> 2) & 1); /* Coin Drop Meter */
275   output_set_value("jackpotmeter",(data >> 3) & 1); /* Jackpot Meter */
276   output_set_value("billacceptor",(data >> 4) & 1); /* Bill Acceptor Enabled */
277   output_set_value("sdsout",(data >> 5) & 1); /* SDS Out */
278   output_set_value("na4",(data >> 6) & 1); /* N/A */
279   output_set_value("gamemeter",(data >> 7) & 1); /* Game Meter */
384   output_set_value("pe_bnkc0",(data >> 0) & 1); /* Coin In Meter */
385   output_set_value("pe_bnkc1",(data >> 1) & 1); /* Coin Out Meter */
386   output_set_value("pe_bnkc2",(data >> 2) & 1); /* Coin Drop Meter */
387   output_set_value("pe_bnkc3",(data >> 3) & 1); /* Jackpot Meter */
388   output_set_value("pe_bnkc4",(data >> 4) & 1); /* Bill Acceptor Enabled */
389   output_set_value("pe_bnkc5",(data >> 5) & 1); /* SDS Out */
390   output_set_value("pe_bnkc6",(data >> 6) & 1); /* N/A */
391   output_set_value("pe_bnkc7",(data >> 7) & 1); /* Game Meter */
280392}
281393
282394static WRITE8_HANDLER(i2c_nvram_w)
r1355r1356
308420static READ8_HANDLER( peplus_crtc_lpen2_r )
309421{
310422    UINT8 ret_val = 0x00;
311    UINT8 x_val = readinputportbytag("TOUCH_X");
312    UINT8 y_val = (0x19 - readinputportbytag("TOUCH_Y"));
423    UINT8 x_val = readinputportbytag_safe("TOUCH_X",0x00);
424    UINT8 y_val = (0x19 - readinputportbytag_safe("TOUCH_Y",0x00));
313425    UINT16 t_val = y_val * 0x28 + (x_val+1);
314426
315427   switch(vid_register) {
r1355r1356
340452   switch (offset)
341453   {
342454      case 0x00db:
343         if ((readinputportbytag("DOOR") & 0x01) == 0) {
455         if ((readinputportbytag_safe("DOOR",0xff) & 0x01) == 0) {
344456            cmos_ram[offset] = 0x00;
345457         }
346458         break;
347459      case 0x0b8d:
348         if ((readinputportbytag("DOOR") & 0x02) == 1) {
460         if ((readinputportbytag_safe("DOOR",0xff) & 0x02) == 1) {
349461            cmos_ram[offset] = 0x01;
350462         }
351463         break;
r1355r1356
438550      sda = i2cmem_read(0, I2CMEM_SDA);
439551   }
440552
441   if ((readinputportbytag("SENSOR") & 0x01) == 0x01 && coin_state == 0) {
553   if ((readinputportbytag_safe("SENSOR",0x00) & 0x01) == 0x01 && coin_state == 0) {
442554      coin_state = 1; // Start Coin Cycle
443555      last_cycles = activecpu_gettotalcycles();
444556   } else {
r1355r1356
474586   }
475587
476588   if (curr_cycles - last_door > 6000) { // Guessing with 6000
477      if ((readinputportbytag("DOOR") & 0x01) == 0x01) {
589      if ((readinputportbytag_safe("DOOR",0xff) & 0x01) == 0x01) {
478590         door_open = (!door_open & 0x01);
479591      } else {
480592         door_open = 1;
r1355r1356
587699GFXDECODE_END
588700
589701
590/**************
591* Driver Init *
592***************/
593
594static DRIVER_INIT( peplus )
595{
596   /* External RAM callback */
597   i8051_set_eram_iaddr_callback(peplus_external_ram_iaddr);
598
599    /* EEPROM is a X2404P 4K-bit Serial I2C Bus */
600   i2cmem_init(0, I2CMEM_SLAVE_ADDRESS, 8, EEPROM_NVRAM_SIZE, NULL);
601
602   // For testing only, cannot stay in final driver
603   //program_ram[0x5e7e] = 0x01; // Enable Autohold Feature
604   program_ram[0x9a24] = 0x22; // RET - Disable Memory Test
605   program_ram[0xd61d] = 0x22; // RET - Disable Program Checksum
606}
607
608static DRIVER_INIT( pepp0158 )
609{
610   /* External RAM callback */
611   i8051_set_eram_iaddr_callback(peplus_external_ram_iaddr);
612
613    /* EEPROM is a X2404P 4K-bit Serial I2C Bus */
614   i2cmem_init(0, I2CMEM_SLAVE_ADDRESS, 8, EEPROM_NVRAM_SIZE, NULL);
615
616   // For testing only, cannot stay in final driver
617   //program_ram[0x5ffe] = 0x01; // Enable Autohold Feature
618   program_ram[0xa19f] = 0x22; // RET - Disable Memory Test
619   program_ram[0xddea] = 0x22; // RET - Disable Program Checksum
620}
621
622static DRIVER_INIT( pepp0188 )
623{
624   /* External RAM callback */
625   i8051_set_eram_iaddr_callback(peplus_external_ram_iaddr);
626
627    /* EEPROM is a X2404P 4K-bit Serial I2C Bus */
628   i2cmem_init(0, I2CMEM_SLAVE_ADDRESS, 8, EEPROM_NVRAM_SIZE, NULL);
629
630   // For testing only, cannot stay in final driver
631   //program_ram[0x742f] = 0x01; // Enable Autohold Feature
632   program_ram[0x9a8d] = 0x22; // RET - Disable Memory Test
633   program_ram[0xf429] = 0x22; // RET - Disable Program Checksum
634}
635
636static DRIVER_INIT( peset038 )
637{
638   /* External RAM callback */
639   i8051_set_eram_iaddr_callback(peplus_external_ram_iaddr);
640
641    /* EEPROM is a X2404P 4K-bit Serial I2C Bus */
642   i2cmem_init(0, I2CMEM_SLAVE_ADDRESS, 8, EEPROM_NVRAM_SIZE, NULL);
643
644   // For testing only, cannot stay in final driver
645   program_ram[0x302] = 0x22;  // RET - Disable Memory Test
646   program_ram[0x289f] = 0x22; // RET - Disable Program Checksum
647}
648
649static DRIVER_INIT( pebe0014 )
650{
651   /* External RAM callback */
652   i8051_set_eram_iaddr_callback(peplus_external_ram_iaddr);
653
654    /* EEPROM is a X2404P 4K-bit Serial I2C Bus */
655   i2cmem_init(0, I2CMEM_SLAVE_ADDRESS, 8, EEPROM_NVRAM_SIZE, NULL);
656
657   // For testing only, cannot stay in final driver
658   program_ram[0x75e7] = 0x22; // RET - Disable Memory Test
659   program_ram[0xc3ab] = 0x22; // RET - Disable Program Checksum
660}
661
662static DRIVER_INIT( peke1012 )
663{
664   /* External RAM callback */
665   i8051_set_eram_iaddr_callback(peplus_external_ram_iaddr);
666
667    /* EEPROM is a X2404P 4K-bit Serial I2C Bus */
668   i2cmem_init(0, I2CMEM_SLAVE_ADDRESS, 8, EEPROM_NVRAM_SIZE, NULL);
669
670   // For testing only, cannot stay in final driver
671   program_ram[0x59e7] = 0x22; // RET - Disable Memory Test
672   program_ram[0xbe01] = 0x22; // RET - Disable Program Checksum
673}
674
675static DRIVER_INIT( peps0615 )
676{
677   /* External RAM callback */
678   i8051_set_eram_iaddr_callback(peplus_external_ram_iaddr);
679
680    /* EEPROM is a X2404P 4K-bit Serial I2C Bus */
681   i2cmem_init(0, I2CMEM_SLAVE_ADDRESS, 8, EEPROM_NVRAM_SIZE, NULL);
682
683   // For testing only, cannot stay in final driver
684   program_ram[0x84be] = 0x22; // RET - Disable Memory Test
685   program_ram[0xbfd8] = 0x22; // RET - Disable Program Checksum
686}
687
688static DRIVER_INIT( peps0716 )
689{
690   /* External RAM callback */
691   i8051_set_eram_iaddr_callback(peplus_external_ram_iaddr);
692
693    /* EEPROM is a X2404P 4K-bit Serial I2C Bus */
694   i2cmem_init(0, I2CMEM_SLAVE_ADDRESS, 8, EEPROM_NVRAM_SIZE, NULL);
695
696   // For testing only, cannot stay in final driver
697   program_ram[0x7f99] = 0x22; // RET - Disable Memory Test
698   program_ram[0xbaa9] = 0x22; // RET - Disable Program Checksum
699}
700
701static DRIVER_INIT( pexp0019 )
702{
703    UINT8 *super_data = memory_region(REGION_USER1);
704
705    /* Distribute Superboard Data */
706    memcpy(s1000_ram, &super_data[0], 0x1000);
707    memcpy(s3000_ram, &super_data[0x3000], 0x1000);
708    memcpy(s5000_ram, &super_data[0x5000], 0x1000);
709    memcpy(s7000_ram, &super_data[0x7000], 0x1000);
710    memcpy(sb000_ram, &super_data[0xb000], 0x1000);
711    memcpy(sd000_ram, &super_data[0xd000], 0x1000);
712    memcpy(sf000_ram, &super_data[0xf000], 0x1000);
713
714   /* External RAM callback */
715   i8051_set_eram_iaddr_callback(peplus_external_ram_iaddr);
716
717    /* EEPROM is a X2404P 4K-bit Serial I2C Bus */
718   i2cmem_init(0, I2CMEM_SLAVE_ADDRESS, 8, EEPROM_NVRAM_SIZE, NULL);
719
720   // For testing only, cannot stay in final driver
721   program_ram[0xc1e4] = 0x22; // RET - Disable Memory Test
722   program_ram[0xc15f] = 0x22; // RET - Disable Program Checksum
723    program_ram[0xc421] = 0x22; // RET - Disable 2nd Memory Test
724}
725
726static DRIVER_INIT( pexs0006 )
727{
728    UINT8 *super_data = memory_region(REGION_USER1);
729
730    /* Distribute Superboard Data */
731    memcpy(s1000_ram, &super_data[0], 0x1000);
732    memcpy(s3000_ram, &super_data[0x3000], 0x1000);
733    memcpy(s5000_ram, &super_data[0x5000], 0x1000);
734    memcpy(s7000_ram, &super_data[0x7000], 0x1000);
735    memcpy(sb000_ram, &super_data[0xb000], 0x1000);
736    memcpy(sd000_ram, &super_data[0xd000], 0x1000);
737    memcpy(sf000_ram, &super_data[0xf000], 0x1000);
738
739   /* External RAM callback */
740   i8051_set_eram_iaddr_callback(peplus_external_ram_iaddr);
741
742    /* EEPROM is a X2404P 4K-bit Serial I2C Bus */
743   i2cmem_init(0, I2CMEM_SLAVE_ADDRESS, 8, EEPROM_NVRAM_SIZE, NULL);
744
745   // For testing only, cannot stay in final driver
746   program_ram[0x9bd4] = 0x22; // RET - Disable Memory Test
747    program_ram[0x9e9c] = 0x22; // RET - Disable 2nd Memory Test
748}
749
750
751702/*************************
752703* Memory map information *
753704*************************/
r1355r1356
774725
775726   // Sound and Dipswitches
776727   AM_RANGE(0x4000, 0x4000) AM_WRITE(AY8910_control_port_0_w)
777   AM_RANGE(0x4004, 0x4004) AM_READ(input_port_3_r) AM_WRITE(AY8910_write_port_0_w)
728   AM_RANGE(0x4004, 0x4004) AM_READ_PORT("SW1") AM_WRITE(AY8910_write_port_0_w)
778729
779730    // Superboard Data
780731   AM_RANGE(0x5000, 0x5fff) AM_RAM AM_READWRITE(peplus_s5000_r, peplus_s5000_w) AM_BASE(&s5000_ram)
r1355r1356
795746   AM_RANGE(0x9000, 0x9000) AM_READ(peplus_dropdoor_r) AM_WRITE(i2c_nvram_w)
796747
797748   // Input Banks B & C, Output Bank B
798   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r) AM_WRITE(peplus_output_bank_b_w)
749   AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0") AM_WRITE(peplus_output_bank_b_w)
799750
800751    // Superboard Data
801752   AM_RANGE(0xb000, 0xbfff) AM_RAM AM_READWRITE(peplus_sb000_r, peplus_sb000_w) AM_BASE(&sb000_ram)
r1355r1356
820771   AM_RANGE(0x00, 0x03) AM_READ(peplus_io_r) AM_WRITE(peplus_io_w) AM_BASE(&io_port)
821772ADDRESS_MAP_END
822773
774
823775/*************************
824776*      Input ports       *
825777*************************/
826778
827static INPUT_PORTS_START( peplus_poker )
828   PORT_START_TAG("IN0")
829   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Jackpot Reset") PORT_CODE(KEYCODE_L)
830   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Self Test") PORT_CODE(KEYCODE_K)
831   PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Hold 1") PORT_CODE(KEYCODE_Z)
832   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Hold 2") PORT_CODE(KEYCODE_X)
833   PORT_BIT( 0x05, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Hold 3") PORT_CODE(KEYCODE_C)
834   PORT_BIT( 0x06, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Hold 4") PORT_CODE(KEYCODE_V)
835   PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Hold 5") PORT_CODE(KEYCODE_B)
836   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
837   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("Deal-Spin-Start") PORT_CODE(KEYCODE_Q)
838   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Max Bet") PORT_CODE(KEYCODE_W)
839   PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_UNKNOWN )
840   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON12 ) PORT_NAME("Play Credit") PORT_CODE(KEYCODE_R)
841   PORT_BIT( 0x50, IP_ACTIVE_HIGH, IPT_BUTTON13 ) PORT_NAME("Cashout") PORT_CODE(KEYCODE_T)
842   PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_BUTTON14 ) PORT_NAME("Change Request") PORT_CODE(KEYCODE_Y)
843   PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_BUTTON15 ) PORT_NAME("Bill Acceptor") PORT_CODE(KEYCODE_U)
844   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
779static INPUT_PORTS_START( peplus )
780   /* IN0 has to be defined for each kind of game */
845781
846782   PORT_START_TAG("DOOR")
847783   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Upper Door") PORT_CODE(KEYCODE_O) PORT_TOGGLE
r1355r1356
854790   PORT_DIPNAME( 0x01, 0x01, "Line Frequency" )
855791   PORT_DIPSETTING(    0x01, "60HZ" )
856792   PORT_DIPSETTING(    0x00, "50HZ" )
857   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
858   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
859   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
860   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
861   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
862   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
863   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
864   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
865   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
866   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
867   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
868   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
869   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
870   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
871   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
872   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
873   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
874   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
875   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
876   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
877   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
793   PORT_DIPUNUSED( 0x02, IP_ACTIVE_LOW )
794   PORT_DIPUNUSED( 0x04, IP_ACTIVE_LOW )
795   PORT_DIPUNUSED( 0x08, IP_ACTIVE_LOW )
796   PORT_DIPUNUSED( 0x10, IP_ACTIVE_LOW )
797   PORT_DIPUNUSED( 0x20, IP_ACTIVE_LOW )
798   PORT_DIPUNUSED( 0x40, IP_ACTIVE_LOW )
799   PORT_DIPUNUSED( 0x80, IP_ACTIVE_LOW )
878800INPUT_PORTS_END
879801
880static INPUT_PORTS_START( peplus_keno )
802
803/*************************
804*      Input ports       *
805*************************/
806
807/* Fake inputs to only map what is needed */
808static INPUT_PORTS_START( peplus_schip )
881809   PORT_START_TAG("IN0")
882   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Jackpot Reset") PORT_CODE(KEYCODE_L)
883   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Self Test") PORT_CODE(KEYCODE_K)
884   PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_UNKNOWN )
885   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
886   PORT_BIT( 0x05, IP_ACTIVE_HIGH, IPT_UNKNOWN )
887   PORT_BIT( 0x06, IP_ACTIVE_HIGH, IPT_UNKNOWN )
888   PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Erase") PORT_CODE(KEYCODE_B)
889   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("Light Pen") PORT_CODE(KEYCODE_A)
890   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("Deal-Spin-Start") PORT_CODE(KEYCODE_Q)
810   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1  ) PORT_NAME("Jackpot Reset") PORT_CODE(KEYCODE_L)
811   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2  ) PORT_NAME("Self Test") PORT_CODE(KEYCODE_K)
812   PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_UNKNOWN  )
813   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN  )
814   PORT_BIT( 0x05, IP_ACTIVE_HIGH, IPT_UNKNOWN  )
815   PORT_BIT( 0x06, IP_ACTIVE_HIGH, IPT_UNKNOWN  )
816   PORT_BIT( 0x07, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
817   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
818   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON9  ) PORT_NAME("Deal-Spin-Start") PORT_CODE(KEYCODE_Q)
819   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN  )
820   PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_UNKNOWN  )
821   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN  )
822   PORT_BIT( 0x50, IP_ACTIVE_HIGH, IPT_UNKNOWN  )
823   PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_UNKNOWN  )
824   PORT_BIT( 0x70, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
825   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
826
827   PORT_START_TAG("SW1")
828   PORT_DIPNAME( 0x01, 0x01, "Line Frequency" )
829   PORT_DIPSETTING(    0x01, "60HZ" )
830   PORT_DIPSETTING(    0x00, "50HZ" )
831   PORT_DIPUNUSED( 0x02, IP_ACTIVE_LOW )
832   PORT_DIPUNUSED( 0x04, IP_ACTIVE_LOW )
833   PORT_DIPUNUSED( 0x08, IP_ACTIVE_LOW )
834   PORT_DIPUNUSED( 0x10, IP_ACTIVE_LOW )
835   PORT_DIPUNUSED( 0x20, IP_ACTIVE_LOW )
836   PORT_DIPUNUSED( 0x40, IP_ACTIVE_LOW )
837   PORT_DIPUNUSED( 0x80, IP_ACTIVE_LOW )
838INPUT_PORTS_END
839
840static INPUT_PORTS_START( peplus_poker )
841   PORT_INCLUDE(peplus)
842
843   PORT_START_TAG("IN0")
844   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1  ) PORT_NAME("Jackpot Reset") PORT_CODE(KEYCODE_L)
845   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2  ) PORT_NAME("Self Test") PORT_CODE(KEYCODE_K)
846   PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_BUTTON3  ) PORT_NAME("Hold 1") PORT_CODE(KEYCODE_Z)
847   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON4  ) PORT_NAME("Hold 2") PORT_CODE(KEYCODE_X)
848   PORT_BIT( 0x05, IP_ACTIVE_HIGH, IPT_BUTTON5  ) PORT_NAME("Hold 3") PORT_CODE(KEYCODE_C)
849   PORT_BIT( 0x06, IP_ACTIVE_HIGH, IPT_BUTTON6  ) PORT_NAME("Hold 4") PORT_CODE(KEYCODE_V)
850   PORT_BIT( 0x07, IP_ACTIVE_LOW,  IPT_BUTTON7  ) PORT_NAME("Hold 5") PORT_CODE(KEYCODE_B)
851   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
852   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON9  ) PORT_NAME("Deal-Spin-Start") PORT_CODE(KEYCODE_Q)
891853   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Max Bet") PORT_CODE(KEYCODE_W)
892   PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_UNKNOWN )
854   PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_UNKNOWN )
893855   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON12 ) PORT_NAME("Play Credit") PORT_CODE(KEYCODE_R)
894856   PORT_BIT( 0x50, IP_ACTIVE_HIGH, IPT_BUTTON13 ) PORT_NAME("Cashout") PORT_CODE(KEYCODE_T)
895857   PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_BUTTON14 ) PORT_NAME("Change Request") PORT_CODE(KEYCODE_Y)
896   PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_BUTTON15 ) PORT_NAME("Bill Acceptor") PORT_CODE(KEYCODE_U)
897   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
858   PORT_BIT( 0x70, IP_ACTIVE_LOW,  IPT_BUTTON15 ) PORT_NAME("Bill Acceptor") PORT_CODE(KEYCODE_U)
859   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
860INPUT_PORTS_END
898861
899   PORT_START_TAG("DOOR")
900   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Upper Door") PORT_CODE(KEYCODE_O)
901   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Lower Door") PORT_CODE(KEYCODE_I)
862/* same as peplus_poker with additionnal fake option to enable the "Autohold" feature */
863static INPUT_PORTS_START( peplus_pokah )
864   PORT_INCLUDE(peplus_poker)
902865
903   PORT_START_TAG("SENSOR")
904   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Coin In") PORT_IMPULSE(1)
866   /* If you change this option, you'll have to delete the .nv file next time you launch the game ! */
867   PORT_START_TAG("AUTOHOLD")
868   PORT_CONFNAME( 0x01, 0x00, "Enable Autohold Feature" )
869   PORT_CONFSETTING(    0x00, DEF_STR( No ) )
870   PORT_CONFSETTING(    0x01, DEF_STR( Yes ) )
871INPUT_PORTS_END
905872
906   PORT_START_TAG("SW1")
907   PORT_DIPNAME( 0x01, 0x01, "Line Frequency" )
908   PORT_DIPSETTING(    0x01, "60HZ" )
909   PORT_DIPSETTING(    0x00, "50HZ" )
910   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
911   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
912   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
913   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
914   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
915   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
916   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
917   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
918   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
919   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
920   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
921   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
922   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
923   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
924   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
925   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
926   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
927   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
928   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
929   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
930   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
873static INPUT_PORTS_START( peplus_bjack )
874   PORT_INCLUDE(peplus)
931875
876   PORT_START_TAG("IN0")
877   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1  ) PORT_NAME("Jackpot Reset") PORT_CODE(KEYCODE_L)
878   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2  ) PORT_NAME("Self Test") PORT_CODE(KEYCODE_K)
879   PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_BUTTON3  ) PORT_NAME("Surrender") PORT_CODE(KEYCODE_Z)
880   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON4  ) PORT_NAME("Stand") PORT_CODE(KEYCODE_X)
881   PORT_BIT( 0x05, IP_ACTIVE_HIGH, IPT_BUTTON5  ) PORT_NAME("Insurance") PORT_CODE(KEYCODE_C)
882   PORT_BIT( 0x06, IP_ACTIVE_HIGH, IPT_BUTTON6  ) PORT_NAME("Double Down") PORT_CODE(KEYCODE_V)
883   PORT_BIT( 0x07, IP_ACTIVE_LOW,  IPT_BUTTON7  ) PORT_NAME("Split") PORT_CODE(KEYCODE_B)
884   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
885   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON9  ) PORT_NAME("Deal-Spin-Start") PORT_CODE(KEYCODE_Q)
886   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Max Bet") PORT_CODE(KEYCODE_W)
887   PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_UNKNOWN  )
888   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON12 ) PORT_NAME("Play Credit") PORT_CODE(KEYCODE_R)
889   PORT_BIT( 0x50, IP_ACTIVE_HIGH, IPT_BUTTON13 ) PORT_NAME("Cashout") PORT_CODE(KEYCODE_T)
890   PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_BUTTON14 ) PORT_NAME("Change Request") PORT_CODE(KEYCODE_Y)
891   PORT_BIT( 0x70, IP_ACTIVE_LOW,  IPT_BUTTON15 ) PORT_NAME("Bill Acceptor") PORT_CODE(KEYCODE_U)
892   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
893INPUT_PORTS_END
894
895static INPUT_PORTS_START( peplus_keno )
896   PORT_INCLUDE(peplus)
897
898   PORT_START_TAG("IN0")
899   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1  ) PORT_NAME("Jackpot Reset") PORT_CODE(KEYCODE_L)
900   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2  ) PORT_NAME("Self Test") PORT_CODE(KEYCODE_K)
901   PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_UNKNOWN  )
902   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN  )
903   PORT_BIT( 0x05, IP_ACTIVE_HIGH, IPT_UNKNOWN  )
904   PORT_BIT( 0x06, IP_ACTIVE_HIGH, IPT_UNKNOWN  )
905   PORT_BIT( 0x07, IP_ACTIVE_LOW,  IPT_BUTTON7  ) PORT_NAME("Erase") PORT_CODE(KEYCODE_B)
906   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_BUTTON8  ) PORT_NAME("Light Pen") PORT_CODE(KEYCODE_A)
907   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON9  ) PORT_NAME("Deal-Spin-Start") PORT_CODE(KEYCODE_Q)
908   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Max Bet") PORT_CODE(KEYCODE_W)
909   PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_UNKNOWN  )
910   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON12 ) PORT_NAME("Play Credit") PORT_CODE(KEYCODE_R)
911   PORT_BIT( 0x50, IP_ACTIVE_HIGH, IPT_BUTTON13 ) PORT_NAME("Cashout") PORT_CODE(KEYCODE_T)
912   PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_BUTTON14 ) PORT_NAME("Change Request") PORT_CODE(KEYCODE_Y)
913   PORT_BIT( 0x70, IP_ACTIVE_LOW,  IPT_BUTTON15 ) PORT_NAME("Bill Acceptor") PORT_CODE(KEYCODE_U)
914   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
915
932916    PORT_START_TAG("TOUCH_X")
933917    PORT_BIT( 0xff, 0x08, IPT_LIGHTGUN_X ) PORT_MINMAX(0x00, 0x28) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(13)
934918    PORT_START_TAG("TOUCH_Y")
935919   PORT_BIT( 0xff, 0x08, IPT_LIGHTGUN_Y ) PORT_MINMAX(0x00, 0x19) PORT_CROSSHAIR(Y, -1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(13)
936920INPUT_PORTS_END
937921
922static INPUT_PORTS_START( peplus_slots )
923   PORT_INCLUDE(peplus)
924
925   PORT_START_TAG("IN0")
926   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1  ) PORT_NAME("Jackpot Reset") PORT_CODE(KEYCODE_L)
927   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2  ) PORT_NAME("Self Test") PORT_CODE(KEYCODE_K)
928   PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_UNKNOWN  )
929   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN  )
930   PORT_BIT( 0x05, IP_ACTIVE_HIGH, IPT_UNKNOWN  )
931   PORT_BIT( 0x06, IP_ACTIVE_HIGH, IPT_UNKNOWN  )
932   PORT_BIT( 0x07, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
933   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
934   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON9  ) PORT_NAME("Deal-Spin-Start") PORT_CODE(KEYCODE_Q)
935   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Max Bet") PORT_CODE(KEYCODE_W)
936   PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_UNKNOWN  )
937   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON12 ) PORT_NAME("Play Credit") PORT_CODE(KEYCODE_R)
938   PORT_BIT( 0x50, IP_ACTIVE_HIGH, IPT_BUTTON13 ) PORT_NAME("Cashout") PORT_CODE(KEYCODE_T)
939   PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_BUTTON14 ) PORT_NAME("Change Request") PORT_CODE(KEYCODE_Y)
940   PORT_BIT( 0x70, IP_ACTIVE_LOW,  IPT_BUTTON15 ) PORT_NAME("Bill Acceptor") PORT_CODE(KEYCODE_U)
941   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
942INPUT_PORTS_END
943
944
945
938946/*************************
947*     Machine Reset      *
948*************************/
949
950static MACHINE_RESET( peplus )
951{
952   if (autohold_addr)
953      program_ram[autohold_addr] = readinputportbytag_safe("AUTOHOLD",0x00) & 0x01;
954}
955
956
957/*************************
939958*     Machine Driver     *
940959*************************/
941960
r1355r1356
950969   MDRV_SCREEN_REFRESH_RATE(60)
951970   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
952971
972   MDRV_MACHINE_RESET(peplus)
953973   MDRV_NVRAM_HANDLER(peplus)
954974
955975   // video hardware
r1355r1356
971991   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
972992MACHINE_DRIVER_END
973993
994
995/*****************
996* Initialisation *
997*****************/
998
999/* Normal board */
1000static void peplus_init(void)
1001{
1002   /* External RAM callback */
1003   i8051_set_eram_iaddr_callback(peplus_external_ram_iaddr);
1004
1005    /* EEPROM is a X2404P 4K-bit Serial I2C Bus */
1006   i2cmem_init(0, I2CMEM_SLAVE_ADDRESS, 8, EEPROM_NVRAM_SIZE, NULL);
1007
1008   /* default : no address to patch in program RAM to enable autohold feature */
1009   autohold_addr = 0;
1010}
1011
1012/* Superboard */
1013static void peplussb_init(void)
1014{
1015    UINT8 *super_data = memory_region(REGION_USER1);
1016
1017    /* Distribute Superboard Data */
1018    memcpy(s1000_ram, &super_data[0], 0x1000);
1019    memcpy(s3000_ram, &super_data[0x3000], 0x1000);
1020    memcpy(s5000_ram, &super_data[0x5000], 0x1000);
1021    memcpy(s7000_ram, &super_data[0x7000], 0x1000);
1022    memcpy(sb000_ram, &super_data[0xb000], 0x1000);
1023    memcpy(sd000_ram, &super_data[0xd000], 0x1000);
1024    memcpy(sf000_ram, &super_data[0xf000], 0x1000);
1025
1026   peplus_init();
1027}
1028
1029
9741030/*************************
1031*      Driver Init       *
1032*************************/
1033
1034static DRIVER_INIT( peset038 )
1035{
1036   peplus_init();
1037
1038   // For testing only, cannot stay in final driver
1039   program_ram[0x302] = 0x22;  // RET - Disable Memory Test
1040   program_ram[0x289f] = 0x22; // RET - Disable Program Checksum
1041}
1042
1043static DRIVER_INIT( pepp0158 )
1044{
1045   peplus_init();
1046
1047   // For testing only, cannot stay in final driver
1048   program_ram[0xa19f] = 0x22; // RET - Disable Memory Test
1049   program_ram[0xddea] = 0x22; // RET - Disable Program Checksum
1050
1051   autohold_addr = 0x5ffe;
1052}
1053
1054static DRIVER_INIT( pepp0188 )
1055{
1056   peplus_init();
1057
1058   // For testing only, cannot stay in final driver
1059   program_ram[0x9a8d] = 0x22; // RET - Disable Memory Test
1060   program_ram[0xf429] = 0x22; // RET - Disable Program Checksum
1061
1062   autohold_addr = 0x742f;
1063}
1064
1065static DRIVER_INIT( pepp0516 )
1066{
1067   peplus_init();
1068
1069   // For testing only, cannot stay in final driver
1070   program_ram[0x9a24] = 0x22; // RET - Disable Memory Test
1071   program_ram[0xd61d] = 0x22; // RET - Disable Program Checksum
1072
1073   autohold_addr = 0x5e7e;
1074}
1075
1076static DRIVER_INIT( pebe0014 )
1077{
1078   peplus_init();
1079
1080   // For testing only, cannot stay in final driver
1081   program_ram[0x75e7] = 0x22; // RET - Disable Memory Test
1082   program_ram[0xc3ab] = 0x22; // RET - Disable Program Checksum
1083}
1084
1085static DRIVER_INIT( peke1012 )
1086{
1087   peplus_init();
1088
1089   // For testing only, cannot stay in final driver
1090   program_ram[0x59e7] = 0x22; // RET - Disable Memory Test
1091   program_ram[0xbe01] = 0x22; // RET - Disable Program Checksum
1092}
1093
1094static DRIVER_INIT( peps0615 )
1095{
1096   peplus_init();
1097
1098   // For testing only, cannot stay in final driver
1099   program_ram[0x84be] = 0x22; // RET - Disable Memory Test
1100   program_ram[0xbfd8] = 0x22; // RET - Disable Program Checksum
1101}
1102
1103static DRIVER_INIT( peps0716 )
1104{
1105   peplus_init();
1106
1107   // For testing only, cannot stay in final driver
1108   program_ram[0x7f99] = 0x22; // RET - Disable Memory Test
1109   program_ram[0xbaa9] = 0x22; // RET - Disable Program Checksum
1110}
1111
1112static DRIVER_INIT( pexp0019 )
1113{
1114   peplussb_init();
1115
1116   // For testing only, cannot stay in final driver
1117   program_ram[0xc1e4] = 0x22; // RET - Disable Memory Test
1118   program_ram[0xc15f] = 0x22; // RET - Disable Program Checksum
1119    program_ram[0xc421] = 0x22; // RET - Disable 2nd Memory Test
1120}
1121
1122static DRIVER_INIT( pexs0006 )
1123{
1124   peplussb_init();
1125
1126   // For testing only, cannot stay in final driver
1127   program_ram[0x9bd4] = 0x22; // RET - Disable Memory Test
1128    program_ram[0x9e9c] = 0x22; // RET - Disable 2nd Memory Test
1129}
1130
1131
1132/*************************
9751133*        Rom Load        *
9761134*************************/
9771135
978ROM_START( peplus )
1136ROM_START( peset038 )
9791137   ROM_REGION( 0x10000, REGION_CPU1, 0 )
980   ROM_LOAD( "pp0516.u68",   0x00000, 0x10000, CRC(d9da6e13) SHA1(421678d9cb42daaf5b21074cc3900db914dd26cf) )
1138   ROM_LOAD( "set038.u68",   0x00000, 0x10000, CRC(9c4b1d1a) SHA1(8a65cd1d8e2d74c7b66f4dfc73e7afca8458e979) )
9811139
9821140   ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE )
9831141   ROM_LOAD( "mro-cg740.u72",    0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) )
r1355r1356
10171175   ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) )
10181176ROM_END
10191177
1020ROM_START( peset038 )
1178ROM_START( pepp0516 )
10211179   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1022   ROM_LOAD( "set038.u68",   0x00000, 0x10000, CRC(9c4b1d1a) SHA1(8a65cd1d8e2d74c7b66f4dfc73e7afca8458e979) )
1180   ROM_LOAD( "pp0516.u68",   0x00000, 0x10000, CRC(d9da6e13) SHA1(421678d9cb42daaf5b21074cc3900db914dd26cf) )
10231181
10241182   ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE )
10251183   ROM_LOAD( "mro-cg740.u72",    0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) )
r1355r1356
11211279   ROM_LOAD( "cap2361.u43", 0x0000, 0x0100, CRC(051aea66) SHA1(2abf32caaeb821ca50a6398581de69bbfe5930e9) )
11221280ROM_END
11231281
1282
11241283/*************************
11251284*      Game Drivers      *
11261285*************************/
11271286
1128/*    YEAR  NAME      PARENT  MACHINE  INPUT          INIT      ROT    COMPANY                                  FULLNAME                                                      FLAGS   */
1129GAME( 1987, peplus,   0,      peplus,  peplus_poker,  peplus,   ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (PP0516) Double Bonus Poker",             0 )
1130GAME( 1987, pepp0158, 0,      peplus,  peplus_poker,  pepp0158, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (PP0158) 4 of a Kind Bonus Poker",        0 )
1131GAME( 1987, pepp0188, 0,      peplus,  peplus_poker,  pepp0188, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (PP0188) Standard Draw Poker",            0 )
1132GAME( 1987, peset038, 0,      peplus,  peplus_poker,  peset038, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (Set038) Set Chip",                       0 )
1133GAME( 1994, pebe0014, 0,      peplus,  peplus_poker,  pebe0014, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (BE0014) Blackjack",                      0 )
1134GAME( 1994, peke1012, 0,      peplus,  peplus_keno,   peke1012, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (KE1012) Keno",                           0 )
1135GAME( 1996, peps0615, 0,      peplus,  peplus_poker,  peps0615, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (PS0615) Chaos Slots",                    0 )
1136GAME( 1996, peps0716, 0,      peplus,  peplus_poker,  peps0716, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (PS0716) Quarter Mania Slots",            0 )
1137GAME( 1995, pexp0019, 0,      peplus,  peplus_poker,  pexp0019, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (XP000019) Deuces Wild Poker",            0 )
1138GAME( 1997, pexs0006, 0,      peplus,  peplus_poker,  pexs0006, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (XS000006) Triple Triple Diamond Slots",  0 )
1287/*    YEAR  NAME      PARENT  MACHINE   INPUT         INIT      ROT    COMPANY                                  FULLNAME                                                  FLAGS   LAYOUT */
1288
1289/* Set chips */
1290GAMEL(1987, peset038, 0,      peplus,  peplus_schip, peset038, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (Set038) Set Chip",                      0,   layout_pe_schip )
1291
1292/* Normal board : poker */
1293GAMEL(1987, pepp0158, 0,      peplus,  peplus_pokah, pepp0158, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (PP0158) 4 of a Kind Bonus Poker",       0,   layout_pe_poker )
1294GAMEL(1987, pepp0188, 0,      peplus,  peplus_pokah, pepp0188, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (PP0188) Standard Draw Poker",           0,   layout_pe_poker )
1295GAMEL(1987, pepp0516, 0,      peplus,  peplus_pokah, pepp0516, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (PP0516) Double Bonus Poker",            0,   layout_pe_poker )
1296
1297/* Normal board : blackjack */
1298GAMEL(1994, pebe0014, 0,      peplus,  peplus_bjack, pebe0014, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (BE0014) Blackjack",                     0,   layout_pe_bjack )
1299
1300/* Normal board : keno */
1301GAMEL(1994, peke1012, 0,      peplus,  peplus_keno,  peke1012, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (KE1012) Keno",                          0,   layout_pe_keno )
1302
1303/* Normal board : slots machine */
1304GAMEL(1996, peps0615, 0,      peplus,  peplus_slots, peps0615, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (PS0615) Chaos Slots",                   0,   layout_pe_slots )
1305GAMEL(1996, peps0716, 0,      peplus,  peplus_slots, peps0716, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (PS0716) Quarter Mania Slots",           0,   layout_pe_slots )
1306
1307/* Superboard : poker */
1308GAMEL(1995, pexp0019, 0,      peplus,  peplus_poker, pexp0019, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (XP000019) Deuces Wild Poker",           0,   layout_pe_poker )
1309
1310/* Superboard : slots machine */
1311GAMEL(1997, pexs0006, 0,      peplus,  peplus_slots, pexs0006, ROT0,  "IGT - International Gaming Technology", "Player's Edge Plus (XS000006) Triple Triple Diamond Slots", 0,   layout_pe_slots )
src/mame/drivers/segas24.c
r0r1356
1/*
2 * Sega System 24
3 *
4 * Kudos to Charles MacDonald (http://cgfm2.emuviews.com) for his
5 * very useful research
6 *
7 * 3 Player controls for Gain Ground added by 'Unknown'
8 */
9
10/* Missing:
11   - linescroll in special modes (qgh title, mahmajn2/qrouka attract mode)
12   - screen flipping (mix register 13 & 2)
13*/
14
15/*
16Sega System24 Overview
17Sega, 1987-1994
18
19PCB Layout
20----------
21
22Note: The differences in the revisions is just the use of different sized RAMs
23and the quantities of RAM used.
24
25(1st Revision)
26837-6442 SYSTEM 24 (C)SEGA 1987
27|-------------------------------------------------------------------------------|
28| YM2151 DSW1 EPRxxxxx.IC1           --------------------------| TMM41464-10    |
29|          DSW2         EPRxxxxx.IC2 |-------------------------- TMM41464-10    |
30|                                                CN2             TMM41464-10    |
31|                 68000               |---------|                TMM41464-10    |
32|   |---------|  |--------------|     | 315-5295|                TMM41464-10    |
33|   | 315-5296|  |HITACHI FD1094|     |(QFP100) |                TMM41464-10    |
34|-| |(QFP100) |  |317-0xxx-0xx  |     |         |                TMM41464-10    |
35  | |         |  |--------------|     |---------|                TMM41464-10    |
36|-| |---------|                                                  MB81C466-10    |
37|                                                                MB81C466-10    |
38|                                     |---------|                MB81C466-10    |
39|S                        |---------| | 315-5295|                MB81C466-10    |
40|E                 20MHz  | 315-5295| |(QFP100) |                MB81C466-10    |
41|G                        |(QFP100) | |         |                MB81C466-10    |
42|A                        |         | |---------|                MB81C466-10    |
43|                         |---------|                            MB81C466-10    |
44|5                                                               |---------|    |
45|6                       |---------|  |---------|                | 315-5293|    |
46|                        | 315-5294|  | 315-5292|                | (QFP160)|    |
47|                        |(QFP100) |  | (QFP160)|    32MHz       |         |    |
48|            MB81C78A-45 |         |  |         |                |---------|    |
49|-|          MB81C78A-45 |---------|  |---------|M5M4464-12 x4   MB81461-12 x6  |
50  |                                                                             |
51|-|      YM3012                                                                 |
52|            |--------|                                                         |
53|            |315-5242| HM65256 HM65256 HM65256  M5M4464-12 x4   MB81461-12 x6  |
54|            |(QFP44) | HM65256 HM65256 HM65256                                 |
55|------------|--------|---------------------------------------------------------|
56
57
58(2nd Revision)
59837-6442-01 SYSTEM 24 (C) SEGA 1987
60|-------------------------------------------------------------------------------|
61| YM2151 DSW1 EPRxxxxx.IC1           --------------------------| TMM41464-10    |
62|          DSW2         EPRxxxxx.IC2 |-------------------------- TMM41464-10    |
63|                                                CN2             TMM41464-10    |
64|                 68000               |---------|                TMM41464-10    |
65|   |---------|  |--------------|     | 315-5295|                TMM41464-10    |
66|   | 315-5296|  |HITACHI FD1094|     |(QFP100) |                TMM41464-10    |
67|-| |(QFP100) |  |317-0xxx-0xx  |     |         |                TMM41464-10    |
68  | |         |  |--------------|     |---------|                TMM41464-10    |
69|-| |---------|                                                  TMM41464-10    |
70|                                                                TMM41464-10    |
71|                                     |---------|                TMM41464-10    |
72|S                        |---------| | 315-5295|                TMM41464-10    |
73|E                 20MHz  | 315-5295| |(QFP100) |                TMM41464-10    |
74|G                        |(QFP100) | |         |                TMM41464-10    |
75|A                        |         | |---------|                TMM41464-10    |
76|                         |---------|                            TMM41464-10    |
77|5                                                               |---------|    |
78|6                       |---------|  |---------|                | 315-5293|    |
79|                        | 315-5294|  | 315-5292|                | (QFP160)|    |
80|                        |(QFP100) |  | (QFP160)|    32MHz       |         |    |
81|            MB81C78A-45 |         |  |         |                |---------|    |
82|-|          MB81C78A-45 |---------|  |---------|M5M4464-12 x4   MB81461-12 x6  |
83  |                                                                             |
84|-|      YM3012                                (*)                              |
85|            |--------|                                                         |
86|            |315-5242| HM65256 HM65256 HM65256  M5M4464-12 x4   MB81461-12 x6  |
87|            |(QFP44) | HM65256 HM65256 HM65256                                 |
88|------------|--------|---------------------------------------------------------|
89(*) Unpopulated Sockets for MB81C4256 x4
90
91
92(3rd Revision)
93837-6442-02 SYSTEM 24 (C) SEGA 1987
94|-------------------------------------------------------------------------------|
95| YM2151 DSW1 EPRxxxxx.IC1           --------------------------| TC514256-10    |
96|          DSW2         EPRxxxxx.IC2 |-------------------------- TC514256-10    |
97|                                                CN2             TC514256-10    |
98|                 68000               |---------|                TC514256-10    |
99|   |---------|  |--------------|     | 315-5295|                TC514256-10    |
100|   | 315-5296|  |HITACHI FD1094|     |(QFP100) |                TC514256-10    |
101|-| |(QFP100) |  |317-0xxx-0xx  |     |         |                TC514256-10    |
102  | |         |  |--------------|     |---------|                TC514256-10    |
103|-| |---------|                                                                 |
104|                                                                               |
105|                                     |---------|                               |
106|S                        |---------| | 315-5295|                               |
107|E                 20MHz  | 315-5295| |(QFP100) |                               |
108|G                        |(QFP100) | |         |                               |
109|A                        |         | |---------|                               |
110|                         |---------|                                           |
111|5                                                               |---------|    |
112|6                       |---------|  |---------|                | 315-5293|    |
113|                        | 315-5294|  | 315-5292|                | (QFP160)|    |
114|                        |(QFP100) |  | (QFP160)|    32MHz       |         |    |
115|            MB81C78A-45 |         |  |         |                |---------|    |
116|-|          MB81C78A-45 |---------|  |---------|                MB81461-12 x6  |
117  |                                                                             |
118|-|      YM3012                                                                 |
119|            |--------|                                                         |
120|            |315-5242| HM65256 HM65256 TC51832  TC514256-10 x4  MB81461-12 x6  |
121|            |(QFP44) | HM65256 HM65256 TC51832                                 |
122|------------|--------|---------------------------------------------------------|
123Notes:
124               315-5292: Custom Sega IC (QFP160, Tilemap Generator)
125               315-5293: Custom Sega IC (QFP160, Object Generator)
126               315-5294: Custom Sega IC (QFP100, Mixer Chip)
127               315-5295: Custom Sega IC (QFP100, Object Generator)
128               315-5296: Custom Sega IC (QFP100, I/O Chip)
129               315-5242: Custom Sega IC (QFP44, Colour Encoder)
130            68000 clock: 10.000MHz
131   Hitachi FD1094 clock: 10.000MHz
132           YM2151 clock: 4.000MHz
133                  VSync: 58Hz
134                  HSync: 24.33kHz (All System24 games require 24kHz monitor)
135        CN2 (Above PCB): Connector for ROM Board (Not used for floppy-based games)
136        CN2 (Below PCB): Connector for Floppy Controller Board (Not used for ROM-based games)
137        Main PCB Pinout same as System 16
138        Floppy Drive is a standard 1.44 High Density drive, but the controller is custom and
139        the floppy disk format is custom. The floppy disk can be read with "Anadisk"
140        depending on the PC being used and it's floppy controller. Most clone PC's can't read the
141        System 24 floppies even with "Anadisk"[1]. But many brand-name PC's can. It's likely due to the
142        propietry nature of the components used in brand-name PC's. Generally the older and crappier
143        the PC is, the better chance you have of being able to read the floppy ;-)
144
145        [1] Actually, most can _except_ for the Hotrod disks.  Those 8K sectors are deadly.
146
147
148Floppy Controller PCB Layout
149----------------------------
150
151837-6443         ___________
152|---------------|    DATA   |-- ||||---|
153|                               PWR    |
154|     74LS367 74LS05                   |
155|     74LS367 74LS174                  |
156|                     MB4107   74LS05  |
157|                                      |
158|     MB89311         74LS139   8MHz   |
159|                CN1                   |
160|     --------------------------|      |
161|     |--------------------------      |
162|--------------------------------------|
163
164
165I/O Controller PCB Layout
166-------------------------
167
168834-6510
169(sticker 834-6510-01)   ___________
170|----------------------|  IDC 34   |---|
171|                                      |
172|                                      |
173|  D4701          %2                   |
174|                                      |
175|                 %3                   |
176|    %1                       74LS139  |
177|                CN1                   |
178|     --------------------------|      |
179|     |--------------------------      |
180|--------------------------------------|
181Notes:
182      - %1 - Unpopulated position for D4701 IC
183        %2 - Unpopulated position for MSM6253RS IC
184        %3 - Unpopulated position for MSM6253RS IC
185
186      - CN1 is shown for completeness, it's actually underneath the I/O PCB.
187
188      - The custom I/O board plugs into the top connector on the main board and
189        is used for player steering controls. The wiring diagram has 8 pins coming from
190        the connector. Four are labelled 'JST4P 1P (L)', the other four are labelled
191        'JST4P 2P (R)'. I assume this is for an analog wheel or similar for player 1
192        (being on the left) and player 2 (being on the right)
193        The wiring diagram also lists some buttons for both PL1 and PL2 coming from
194        the regular 56-way edge connector....  'Nitro' and 'Accel'
195        The manual shows a controller that looks like a spinner which they call
196        a 'sensor board' with part 839-0138 and has a photo-sensor disc, which looks
197        like it's used for steering.
198        This board is used on Hot Rod, Rough Racer and the Golf games only.
199
200
201ROM Board Layout
202----------------
203
204837-7187-01
205171-5875-01B
206(SYSTEM24) (C)SEGA 1989 . 1991
207|------------------------------------------|
208|                                          |
209|                                          |
210|                                  J1      |
211|CN1    ROM1.IC4      ROM2.IC5     J2      |
212||-|                               J3      |
213|| |                               J4      |
214|| |    ROM3.IC6      ROM4.IC7             |
215|| |                               J5      |
216|| |                               J6      |
217|| |    ROM5.IC8      ROM6.IC9     J7      |
218|| |                               J8      |
219|| |                               J9      |
220|| |    ROM7.IC10     ROM8.IC11            |
221|| |                                       |
222|| |                  74HC4040  74LS139    |
223||-|    EPM5032DC.IC2                      |
224|------------------------------------------|
225Notes:
226      CN1: Connector for joining ROM board to Main Board. This connector is above and below the PCB to allow for chaining of several boards.
227
228      The ROM Daughter board has a protection device on it at location IC2. It's an Erasable Programmable Logic Device; EPLD, like a normal PLD,
229      but uses an EPROM and is erasable and re-programmable. It's type is Altera EPM5032DC. It's part of the Altera MAX 5000 Programmable Logic
230      Device Family and (generally) has it's protection bit set at the factory.
231
232      All jumpers are 2 pins, they're either shorted or not shorted. All ROMs are configured as the same type.
233      See the table below for details.
234      Jumpers to set ROM sizes:
235                               2M (J1, J3, J6, J8)
236                               4M (J2, J3, J7, J9)
237                               8M (J2, J4, J5, J9)
238
239
240FD1094/Floppy/ROM details
241-------------------------
242
243Game                   FD1094         Floppy          ROMs                                                          Other
244-------------------------------------------------------------------------------------------------------------------------------------------------------------
245Hot Rod (3p Turbo)     none           DS3-5000-01D    Main Board:     EPR11338.IC1, EPR11339.IC2                    I/O Controller PCB, Floppy Controller PCB
246
247Hot Rod (4p Rev C)     none           DS3-5000-01A    Main Board:     EPR11338.IC1, EPR11339.IC2                    I/O Controller PCB, Floppy Controller PCB
248                                      Rev C
249
250Hot Rod (4p Japanese   none           DS3-5000-01A    Main Board:     EPR11338.IC1, EPR11339.IC2                    I/O Controller PCB, Floppy Controller PCB
251         Rev B)                       Rev B
252
253Scramble Spirits       none           DS3-5000-02?    Main Board:     EPR12186.IC1, EPR12187.IC2                    Floppy Controller PCB
254
255Scramble Spirits       317-0058-02D   DS3-5000-02D    Main Board:     EPR12186.IC1, EPR12187.IC2                    Floppy Controller PCB
256(Encrypted Version)
257
258Gain Ground (Japan)    317-0058-03B   DS3-5000-03B    Main Board:     EPR12186.IC1, EPR12187.IC2                    Floppy Controller PCB
259
260Gain Ground            317-0058-03D   DS3-5000-03D    Main Board:     EPR12186.IC1, EPR12187.IC2                    Floppy Controller PCB
261
262Crack Down (Japan)     317-0058-04B   DS3-5000-04B    Main Board:     EPR12186.IC1, EPR12187.IC2                    Floppy Controller PCB
263                                      Rev A
264
265Crack Down             317-0058-04D   DS3-5000-04D    Main Board:     EPR12186.IC1, EPR12187.IC2                    Floppy Controller PCB
266
267Super Masters Golf     317-0058-05B   DS3-5000-05B    Main Board:     EPR12186.IC1, EPR12187.IC2                    I/O Controller PCB, Floppy Controller PCB
268Rev B
269
270Super Masters Golf     317-0058-05D   DS3-5000-05D    Main Board:     EPR12186.IC1, EPR12187.IC2                    I/O Controller PCB, Floppy Controller PCB
271Rev D
272
273Rough Racer            317-0058-06B   DS3-5000-06B    Main Board:     EPR12186.IC1, EPR12187.IC2                    I/O Controller PCB, Floppy Controller PCB
274
275Bonanza Bros           none           DS3-5000-07D    Main Board:     EPR12186.IC1, EPR12187.IC2                    Floppy Controller PCB
276                                                      Daughter Board: MPR13187.IC4, MPR13188.IC5, MPR13189.IC6
277                                                                      MPR13190.IC7
278                                                                      EPLD: 317-0156
279
280Quiz Syukudai wo       317-0058-08B   DS3-5000-08B    Main Board:     EPR12186.IC1, EPR12187.IC2                    Floppy Controller PCB
281Wasuremashita
282
283Dynamic Country Club   317-0058-09D   DS3-5000-09D    Main Board:     EPR13947.IC1, EPR13948.IC2                    I/O Controller PCB, Floppy Controller PCB
284(Disk version)
285
286Dynamic Country Club   none           none            Main Board:     EPR13947.IC1, EPR13948.IC2
287(ROM version)                                         Daughter Board: EPR15345.IC4  EPR15344.IC5, MPR14097.IC6
288                                                                      MPR14096.IC7
289                                                                      EPLD: 317-0177
290
291Quiz Mekuromeku Story  none           none            Main Board:     EPR15342.IC1, EPR15343.IC2
292                                                      Daughter Board: EPR15344.IC4, EPR15345.IC5, EPR15346.IC6
293                                                                      EPR15347.IC7, EPR15348.IC8, EPR15349.IC9
294                                                                      EPLD: 317-0205
295
296Tokoro San no          none           none            Main Board:     EPR14812.IC1, EPR14813.IC2
297MahMahjan                                             Daughter Board: MPR14819.IC4, MPR14820.IC5, MPR14821.IC6
298                                                                      MPR14822IC.7, MPR14823.IC8, MPR14824.IC9
299                                                                      MPR14825.IC10, MPR14826.IC11
300                                                                      EPLD: 317-0200
301
302Quiz Rouka Ni          none           none            Main Board:     EPR14484.IC1, EPR14485.IC2
303Tattenasai                                            Daughter Board: EPR14482.IC5, EPR14483.IC7
304                                                                      EPLD: 317-0191
305
306Tokoro San no          none           none            Main Board:     EPR16798.IC1, EPR16799.IC2
307MahMahjan 2                                           Daughter Board: MPR16800.IC4, MPR16801.IC5, MPR16802.IC6
308                                                                      MPR16803.IC7, MPR16804.IC8, MPR16805.IC9
309                                                                      MPR16806.IC10, MPR16807.IC11
310                                                                      EPLD: 317-0220
311
312Quiz Ghost Hunter      none           none            Main Board:     EPR16899B.IC1, EPR16900B.IC2
313                                                      Daughter Board: MPR16901A.IC4, MPR16902A.IC5, MPR16903.IC6
314                                                                      MPR16904.IC7,  MPR16905.IC8,  MPR16906.IC9
315                                                                      MPR16907.IC10,  MPR16908.IC11
316                                                                      EPLD: 317-0226
317
318Notes:
319      A regular 68000-10 is used in position IC3. If used, the Hitachi CPU sits at position IC4.
320      Where FD1094 is listed as 'none', a standard 68000 CPU is used instead at IC4 on the PCB.
321
322      The last 3 digits of the floppy number is also the last part of the Hitachi CPU number....they're a matching pair.
323      So if one had the Hitachi part number and a floppy without a label, it's possible to create the correct floppy disk name from
324      the last 3 digits of the Hitachi FD1094 part number.
325
326*/
327
328
329/* system24temp_ functions / variables are from shared rewrite files,
330   once the rest of the rewrite is complete they can be removed, I
331   just made a copy & renamed them for now to avoid any conflicts
332*/
333
334#include "driver.h"
335#include "cpu/m68000/m68k.h"
336#include "segas24.h"
337#include "system16.h"
338#include "video/segaic24.h"
339#include "sound/ym2151.h"
340#include "sound/dac.h"
341#include "sound/2151intf.h"
342
343UINT16* s24_mainram1;
344
345extern void s24_fd1094_machine_init(void);
346extern void s24_fd1094_driver_init(void);
347
348VIDEO_START(system24);
349VIDEO_UPDATE(system24);
350
351
352// Floppy Fisk Controller
353
354static int fdc_status, fdc_track, fdc_sector, fdc_data;
355static int fdc_phys_track, fdc_irq, fdc_drq, fdc_span, fdc_index_count;
356static UINT8 *fdc_pt;
357static int track_size;
358
359static void fdc_init(void)
360{
361   fdc_status = 0;
362   fdc_track = 0;
363   fdc_sector = 0;
364   fdc_data = 0;
365   fdc_phys_track = 0;
366   fdc_irq = 0;
367   fdc_drq = 0;
368   fdc_index_count = 0;
369}
370
371static READ16_HANDLER( fdc_r )
372{
373   if(!track_size)
374      return 0xffff;
375
376   switch(offset) {
377   case 0:
378      fdc_irq = 0;
379      return fdc_status;
380   case 1:
381      return fdc_track;
382   case 2:
383      return fdc_sector;
384   case 3:
385   default: {
386      int res = fdc_data;
387      if(fdc_drq) {
388         fdc_span--;
389         //          logerror("Read %02x (%d)\n", res, fdc_span);
390         if(fdc_span) {
391            fdc_pt++;
392            fdc_data = *fdc_pt;
393         } else {
394            logerror("FDC: transfert complete\n");
395            fdc_drq = 0;
396            fdc_status = 0;
397            fdc_irq = 1;
398         }
399      } else
400         logerror("FDC: data read with drq down\n");
401      return res;
402   }
403   }
404}
405
406static WRITE16_HANDLER( fdc_w )
407{
408   if(!track_size)
409      return;
410
411   if(ACCESSING_LSB) {
412      data &= 0xff;
413      switch(offset) {
414      case 0:
415         fdc_irq = 0;
416         switch(data >> 4) {
417         case 0x0:
418            logerror("FDC: Restore\n");
419            fdc_phys_track = fdc_track = 0;
420            fdc_irq = 1;
421            fdc_status = 4;
422            break;
423         case 0x1:
424            logerror("FDC: Seek %d\n", fdc_data);
425            fdc_phys_track = fdc_track = fdc_data;
426            fdc_irq = 1;
427            fdc_status = fdc_track ? 0 : 4;
428            break;
429         case 0x9:
430            logerror("Read multiple [%02x] %d..%d side %d track %d\n", data, fdc_sector, fdc_sector+fdc_data-1, data & 8 ? 1 : 0, fdc_phys_track);
431            fdc_pt = memory_region(REGION_USER2) + track_size*(2*fdc_phys_track+(data & 8 ? 1 : 0));
432            fdc_span = track_size;
433            fdc_status = 3;
434            fdc_drq = 1;
435            fdc_data = *fdc_pt;
436            break;
437         case 0xb:
438            logerror("Write multiple [%02x] %d..%d side %d track %d\n", data, fdc_sector, fdc_sector+fdc_data-1, data & 8 ? 1 : 0, fdc_phys_track);
439            fdc_pt = memory_region(REGION_USER2) + track_size*(2*fdc_phys_track+(data & 8 ? 1 : 0));
440            fdc_span = track_size;
441            fdc_status = 3;
442            fdc_drq = 1;
443            break;
444         case 0xd:
445            logerror("FDC: Forced interrupt\n");
446            fdc_span = 0;
447            fdc_drq = 0;
448            fdc_irq = data & 1;
449            fdc_status = 0;
450            break;
451         case 0xf:
452            if(data == 0xfe)
453               logerror("FDC: Assign mode %02x\n", fdc_data);
454            else if(data == 0xfd)
455               logerror("FDC: Assign parameter %02x\n", fdc_data);
456            else
457               logerror("FDC: Unknown command %02x\n", data);
458            break;
459         default:
460            logerror("FDC: Unknown command %02x\n", data);
461            break;
462         }
463         break;
464      case 1:
465         logerror("FDC: Track register %02x\n", data);
466         fdc_track = data;
467         break;
468      case 2:
469         logerror("FDC: Sector register %02x\n", data);
470         fdc_sector = data;
471         break;
472      case 3:
473         if(fdc_drq) {
474            //              logerror("Write %02x (%d)\n", data, fdc_span);
475            *fdc_pt++ = data;
476            fdc_span--;
477            if(!fdc_span) {
478               logerror("FDC: transfert complete\n");
479               fdc_drq = 0;
480               fdc_status = 0;
481               fdc_irq = 1;
482            }
483         } else
484            logerror("FDC: Data register %02x\n", data);
485         fdc_data = data;
486         break;
487      }
488   }
489}
490
491static READ16_HANDLER( fdc_status_r )
492{
493   if(!track_size)
494      return 0xffff;
495
496   return 0x90 | (fdc_irq ? 2 : 0) | (fdc_drq ? 1 : 0) | (fdc_phys_track ? 0x40 : 0) | (fdc_index_count ? 0x20 : 0);
497}
498
499static WRITE16_HANDLER( fdc_ctrl_w )
500{
501   if(ACCESSING_LSB)
502      logerror("FDC control %02x\n", data & 0xff);
503}
504
505
506// I/O Mappers
507
508static UINT8 hotrod_io_r(int port)
509{
510   switch(port) {
511   case 0:
512      return readinputport(0);
513   case 1:
514      return readinputport(1);
515   case 2:
516      return 0xff;
517   case 3:
518      return 0xff;
519   case 4:
520      return readinputport(2);
521   case 5: // Dip switches
522      return readinputport(3);
523   case 6:
524      return readinputport(4);
525   case 7: // DAC
526      return 0xff;
527   }
528   return 0x00;
529}
530
531static UINT8 dcclub_io_r(int port)
532{
533   switch(port) {
534   case 0: {
535      static UINT8 pos[16] = { 0, 1, 3, 2, 6, 4, 12, 8, 9 };
536      return (readinputport(0) & 0xf) | ((~pos[readinputport(5)>>4]<<4) & 0xf0);
537   }
538   case 1:
539      return readinputport(1);
540   case 2:
541      return 0xff;
542   case 3:
543      return 0xff;
544   case 4:
545      return readinputport(2);
546   case 5: // Dip switches
547      return readinputport(3);
548   case 6:
549      return readinputport(4);
550   case 7: // DAC
551      return 0xff;
552   }
553   return 0x00;
554}
555
556static int cur_input_line;
557
558static UINT8 mahmajn_io_r(int port)
559{
560   switch(port) {
561   case 0:
562      return ~(1 << cur_input_line);
563   case 1:
564      return 0xff;
565   case 2:
566      return readinputport(cur_input_line);
567   case 3:
568      return 0xff;
569   case 4:
570      return readinputport(8);
571   case 5: // Dip switches
572      return readinputport(9);
573   case 6:
574      return readinputport(10);
575   case 7: // DAC
576      return 0xff;
577   }
578   return 0x00;
579}
580
581static UINT8 gground_io_r(int port)
582{
583   switch(port) {
584   case 0:
585      return readinputport(0);
586   case 1:
587      return readinputport(1);
588   case 2: // P3 inputs
589      return readinputport(2);
590   case 3:
591      return 0xff;
592   case 4:
593      return readinputport(3);
594   case 5: // Dip switches
595      return readinputport(4);
596   case 6:
597      return readinputport(5);
598   case 7: // DAC
599      return 0xff;
600   }
601   return 0x00;
602}
603
604static void mahmajn_io_w(int port, UINT8 data)
605{
606   switch(port) {
607   case 3:
608      if(data & 4)
609         cur_input_line = (cur_input_line + 1) & 7;
610      break;
611   case 7: // DAC
612      DAC_0_signed_data_w(0, data);
613      break;
614   default:
615      fprintf(stderr, "Port %d : %02x\n", port, data & 0xff);
616   }
617}
618
619static void hotrod_io_w(int port, UINT8 data)
620{
621   switch(port) {
622   case 3: // Lamps
623      break;
624   case 7: // DAC
625      DAC_0_signed_data_w(0, data);
626      break;
627   default:
628      fprintf(stderr, "Port %d : %02x\n", port, data & 0xff);
629   }
630}
631
632static UINT8 hotrod_ctrl_cur;
633
634static WRITE16_HANDLER( hotrod3_ctrl_w )
635{
636   if(ACCESSING_LSB) {
637      data &= 3;
638      hotrod_ctrl_cur = readinputport(9+data);
639   }
640}
641
642static READ16_HANDLER( hotrod3_ctrl_r )
643{
644   if(ACCESSING_LSB) {
645      switch(offset) {
646         // Steering dials
647      case 0:
648         return readinputport(5) & 0xff;
649      case 1:
650         return readinputport(5) >> 8;
651      case 2:
652         return readinputport(6) & 0xff;
653      case 3:
654         return readinputport(6) >> 8;
655      case 4:
656         return readinputport(7) & 0xff;
657      case 5:
658         return readinputport(7) >> 8;
659      case 6:
660         return readinputport(8) & 0xff;
661      case 7:
662         return readinputport(8) >> 8;
663
664      case 8: { // Serial ADCs for the accel
665         int v = hotrod_ctrl_cur & 0x80;
666         hotrod_ctrl_cur <<= 1;
667         return v ? 0xff : 0;
668      }
669      }
670   }
671   return 0;
672}
673
674static READ16_HANDLER( iod_r )
675{
676   logerror("IO daughterboard read %02x (%x)\n", offset, activecpu_get_pc());
677   return 0xffff;
678}
679
680static WRITE16_HANDLER( iod_w )
681{
682   logerror("IO daughterboard write %02x, %04x & %04x (%x)\n", offset, data, mem_mask, activecpu_get_pc());
683}
684
685
686// Cpu #1 reset control
687
688static UINT8 resetcontrol, prev_resetcontrol;
689
690static void reset_reset(void)
691{
692   int changed = resetcontrol ^ prev_resetcontrol;
693   if(changed & 2) {
694      if(resetcontrol & 2) {
695         cpunum_set_input_line(1, INPUT_LINE_HALT, CLEAR_LINE);
696         cpunum_set_input_line(1, INPUT_LINE_RESET, PULSE_LINE);
697//          mame_printf_debug("enable 2nd cpu!\n");
698//          DEBUGGER_BREAK;
699         s24_fd1094_machine_init();
700
701      } else
702         cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE);
703   }
704   if(changed & 4)
705      sndti_reset(SOUND_YM2151, 0);
706   prev_resetcontrol = resetcontrol;
707}
708
709static void resetcontrol_w(UINT8 data)
710{
711   resetcontrol = data;
712   logerror("Reset control %02x (%x:%x)\n", resetcontrol, cpu_getactivecpu(), activecpu_get_pc());
713   reset_reset();
714}
715
716
717// Rom board bank access
718
719static UINT8 curbank;
720
721static void reset_bank(void)
722{
723   if (memory_region(REGION_USER1))
724   {
725      memory_set_bankptr(1, memory_region(REGION_USER1) + curbank * 0x40000);
726      memory_set_bankptr(2, memory_region(REGION_USER1) + curbank * 0x40000);
727   }
728}
729
730static READ16_HANDLER( curbank_r )
731{
732   return curbank;
733}
734
735static WRITE16_HANDLER( curbank_w )
736{
737   if(ACCESSING_LSB) {
738      curbank = data & 0xff;
739      reset_bank();
740   }
741}
742
743
744// YM2151
745
746static READ16_HANDLER( ym_status_r )
747{
748   return YM2151_status_port_0_r(0);
749}
750
751static WRITE16_HANDLER( ym_register_w )
752{
753   if(ACCESSING_LSB)
754      YM2151_register_port_0_w(0, data);
755}
756
757static WRITE16_HANDLER( ym_data_w )
758{
759   if(ACCESSING_LSB)
760      YM2151_data_port_0_w(0, data);
761}
762
763
764// Protection magic latch
765
766static UINT8  mahmajn_mlt[8] = { 5, 1, 6, 2, 3, 7, 4, 0 };
767static UINT8 mahmajn2_mlt[8] = { 6, 0, 5, 3, 1, 4, 2, 7 };
768static UINT8      gqh_mlt[8] = { 3, 7, 4, 0, 2, 6, 5, 1 };
769static UINT8 bnzabros_mlt[8] = { 2, 4, 0, 5, 7, 3, 1, 6 };
770static UINT8   qrouka_mlt[8] = { 1, 6, 4, 7, 0, 5, 3, 2 };
771static UINT8 quizmeku_mlt[8] = { 0, 3, 2, 4, 6, 1, 7, 5 };
772static UINT8   dcclub_mlt[8] = { 4, 3, 7, 0, 2, 6, 1, 5 };
773
774static UINT8 mlatch;
775static const UINT8 *mlatch_table;
776
777static READ16_HANDLER( mlatch_r )
778{
779   return mlatch;
780}
781
782static WRITE16_HANDLER( mlatch_w )
783{
784   if(ACCESSING_LSB) {
785      int i;
786      UINT8 mxor = 0;
787      if(!mlatch_table) {
788         logerror("Protection: magic latch accessed but no table loaded (%d:%x)\n", cpu_getactivecpu(), activecpu_get_pc());
789         return;
790      }
791
792      data &= 0xff;
793
794      if(data != 0xff) {
795         for(i=0; i<8; i++)
796            if(mlatch & (1<<i))
797               mxor |= 1 << mlatch_table[i];
798         mlatch = data ^ mxor;
799         logerror("Magic latching %02x ^ %02x as %02x (%d:%x)\n", data & 0xff, mxor, mlatch, cpu_getactivecpu(), activecpu_get_pc());
800      } else {
801         logerror("Magic latch reset (%d:%x)\n", cpu_getactivecpu(), activecpu_get_pc());
802         mlatch = 0x00;
803      }
804   }
805}
806
807
808// Timers and IRQs
809
810enum {
811   IRQ_YM2151 = 1,
812   IRQ_TIMER  = 2,
813   IRQ_VBLANK = 3,
814   IRQ_SPRITE = 4
815};
816
817static UINT16 irq_timera;
818static UINT8  irq_timerb;
819static UINT8  irq_allow0, irq_allow1;
820static int    irq_timer_pend0, irq_timer_pend1, irq_yms;
821static emu_timer *irq_timer;
822
823static TIMER_CALLBACK( irq_timer_cb )
824{
825   irq_timer_pend0 = irq_timer_pend1 = 1;
826   if(irq_allow0 & (1 << IRQ_TIMER))
827      cpunum_set_input_line(0, IRQ_TIMER+1, ASSERT_LINE);
828   if(irq_allow1 & (1 << IRQ_TIMER))
829      cpunum_set_input_line(1, IRQ_TIMER+1, ASSERT_LINE);
830}
831
832static void irq_init(void)
833{
834   irq_timera = 0;
835   irq_timerb = 0;
836   irq_allow0 = 0;
837   irq_allow1 = 0;
838   irq_timer_pend0 = 0;
839   irq_timer_pend1 = 0;
840   irq_timer = timer_alloc(irq_timer_cb, NULL);
841}
842
843static void irq_timer_reset(void)
844{
845   int freq = (irq_timerb << 12) | irq_timera;
846   freq &= 0x1fff;
847
848   timer_adjust(irq_timer, ATTOTIME_IN_HZ(freq), 0, ATTOTIME_IN_HZ(freq));
849   logerror("New timer frequency: %0d [%02x %04x]\n", freq, irq_timerb, irq_timera);
850}
851
852static WRITE16_HANDLER(irq_w)
853{
854   switch(offset) {
855   case 0: {
856      UINT16 old_ta = irq_timera;
857      COMBINE_DATA(&irq_timera);
858      if(old_ta != irq_timera)
859         irq_timer_reset();
860      break;
861   }
862   case 1:
863      if(ACCESSING_LSB) {
864         UINT8 old_tb = irq_timerb;
865         irq_timerb = data;
866         if(old_tb != irq_timerb)
867            irq_timer_reset();
868      }
869      break;
870   case 2:
871      irq_allow0 = data;
872      cpunum_set_input_line(0, IRQ_TIMER+1, irq_timer_pend0 && (irq_allow0 & (1 << IRQ_TIMER)) ? ASSERT_LINE : CLEAR_LINE);
873      cpunum_set_input_line(0, IRQ_YM2151+1, irq_yms && (irq_allow0 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE);
874      break;
875   case 3:
876      irq_allow1 = data;
877      cpunum_set_input_line(1, IRQ_TIMER+1, irq_timer_pend1 && (irq_allow1 & (1 << IRQ_TIMER)) ? ASSERT_LINE : CLEAR_LINE);
878      cpunum_set_input_line(1, IRQ_YM2151+1, irq_yms && (irq_allow1 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE);
879      break;
880   }
881}
882
883
884static int ggground_kludge;
885/* This IRQ needs to be generated before the others or the GFX
886  don't get uploaded correctly and you see nothing */
887static TIMER_CALLBACK( gground_generate_kludge_irq )
888{
889      cpunum_set_input_line(1, 5, HOLD_LINE);
890}
891
892
893static READ16_HANDLER(irq_r)
894{
895   /* These hacks are for Gain Ground */
896   /* otherwise the interrupt occurs before the correct state has been
897       set and the game crashes before booting */
898   if (!strcmp(Machine->gamedrv->name,"gground"))
899   {
900
901      if (activecpu_get_pc()==0x0084aa)
902      {
903         ggground_kludge = 1;
904         return mame_rand(Machine);
905
906      }
907      if (activecpu_get_pc()==0x084ba)
908      {
909         /* Clear IRQ line so IRQ doesn't happen too early */
910         cpunum_set_input_line(1, 5, CLEAR_LINE);
911
912         /* set a timer to generate an irq at the needed point */
913         if (ggground_kludge == 1)
914         {
915            timer_set(ATTOTIME_IN_USEC(180000), NULL, 0, gground_generate_kludge_irq);
916            ggground_kludge = 0;
917         }
918         return 1;
919      }
920   }
921
922   if (!strcmp(Machine->gamedrv->name,"ggroundj"))
923   {
924
925      if (activecpu_get_pc()==0x0084ac)
926      {
927         ggground_kludge = 1;
928         return mame_rand(Machine);
929
930      }
931      if (activecpu_get_pc()==0x084bc)
932      {
933         /* Clear IRQ line so IRQ doesn't happen too early */
934         cpunum_set_input_line(1, 5, CLEAR_LINE);
935
936         /* set a timer to generate an irq at the needed point */
937         if (ggground_kludge == 1)
938         {
939            timer_set(ATTOTIME_IN_USEC(180000), NULL, 0, gground_generate_kludge_irq);
940            ggground_kludge = 0;
941         }
942         return 1;
943      }
944   }
945
946   switch(offset) {
947   case 2:
948      irq_timer_pend0 = 0;
949      cpunum_set_input_line(0, IRQ_TIMER+1, CLEAR_LINE);
950      break;
951   case 3:
952      irq_timer_pend1 = 0;
953      cpunum_set_input_line(1, IRQ_TIMER+1, CLEAR_LINE);
954      break;
955   }
956   return 0xffff;
957}
958
959static INTERRUPT_GEN(irq_vbl)
960{
961   int irq = cpu_getiloops() ? IRQ_SPRITE : IRQ_VBLANK;
962   int mask = 1 << irq;
963
964   if(irq_allow0 & mask)
965      cpunum_set_input_line(0, 1+irq, HOLD_LINE);
966
967   if(irq_allow1 & mask)
968      cpunum_set_input_line(1, 1+irq, HOLD_LINE);
969
970   if(!cpu_getiloops()) {
971      // Ensure one index pulse every 20 frames
972      // The is some code in bnzabros at 0x852 that makes it crash
973      // if the pulse train is too fast
974      fdc_index_count++;
975      if(fdc_index_count >= 20)
976         fdc_index_count = 0;
977   }
978}
979
980static void irq_ym(int irq)
981{
982   irq_yms = irq;
983   cpunum_set_input_line(0, IRQ_YM2151+1, irq_yms && (irq_allow0 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE);
984   cpunum_set_input_line(1, IRQ_YM2151+1, irq_yms && (irq_allow1 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE);
985}
986
987
988/*
989CPU1:
99000-03 ROM (1)
99104-07 ROM
99208-0f ramlo (2)
99310-13 ROM
99414-17 ROM
995f0-f3 ramprg (3)
996fc-ff ramhi (4)
997
998CPU2:
99900-03 ramprg
100004-07 ROM
100108-0f ramlo
100210-13 ROM
100314-17 ROM
1004f0-f3 ramprg
1005fc-ff ramhi
1006*/
1007
1008/*************************************
1009 *
1010 *  CPU 1 memory handlers
1011 *
1012 *************************************/
1013
1014static ADDRESS_MAP_START( system24_cpu1_map, ADDRESS_SPACE_PROGRAM, 16 )
1015   AM_RANGE(0x000000, 0x03ffff) AM_MIRROR(0x140000) AM_ROM AM_SHARE(1)
1016   AM_RANGE(0x080000, 0x0fffff) AM_RAM AM_SHARE(2)
1017   AM_RANGE(0x200000, 0x20ffff) AM_READWRITE(sys24_tile_r, sys24_tile_w)
1018   AM_RANGE(0x220000, 0x220001) AM_WRITENOP      // Unknown, always 0
1019   AM_RANGE(0x240000, 0x240001) AM_WRITENOP      // Horizontal synchronization register
1020   AM_RANGE(0x260000, 0x260001) AM_WRITENOP      // Vertical synchronization register
1021   AM_RANGE(0x270000, 0x270001) AM_WRITENOP      // Video synchronization switch
1022   AM_RANGE(0x280000, 0x29ffff) AM_READWRITE(sys24_char_r, sys24_char_w)
1023   AM_RANGE(0x400000, 0x403fff) AM_READWRITE(MRA16_RAM, system24temp_sys16_paletteram1_w) AM_BASE(&paletteram16)
1024   AM_RANGE(0x404000, 0x40401f) AM_READWRITE(sys24_mixer_r, sys24_mixer_w)
1025   AM_RANGE(0x600000, 0x63ffff) AM_READWRITE(sys24_sprite_r, sys24_sprite_w)
1026   AM_RANGE(0x800000, 0x80007f) AM_READWRITE(system24temp_sys16_io_r, system24temp_sys16_io_w)
1027   AM_RANGE(0x800100, 0x800101) AM_WRITE(ym_register_w)
1028   AM_RANGE(0x800102, 0x800103) AM_READWRITE(ym_status_r, ym_data_w)
1029   AM_RANGE(0xa00000, 0xa00007) AM_READWRITE(irq_r, irq_w)
1030   AM_RANGE(0xb00000, 0xb00007) AM_READWRITE(fdc_r, fdc_w)
1031   AM_RANGE(0xb00008, 0xb0000f) AM_READWRITE(fdc_status_r, fdc_ctrl_w)
1032   AM_RANGE(0xb80000, 0xbbffff) AM_ROMBANK(1)
1033   AM_RANGE(0xbc0000, 0xbc0001) AM_READWRITE(curbank_r, curbank_w)
1034   AM_RANGE(0xbc0006, 0xbc0007) AM_READWRITE(mlatch_r, mlatch_w)
1035   AM_RANGE(0xc00000, 0xc00011) AM_READWRITE(hotrod3_ctrl_r, hotrod3_ctrl_w)
1036   AM_RANGE(0xc80000, 0xcbffff) AM_ROMBANK(2)
1037   AM_RANGE(0xcc0000, 0xcc0001) AM_READWRITE(curbank_r, curbank_w)
1038   AM_RANGE(0xcc0006, 0xcc0007) AM_READWRITE(mlatch_r, mlatch_w)
1039AM_RANGE(0xd00300, 0xd00301) AM_WRITE(MWA16_NOP)
1040   AM_RANGE(0xf00000, 0xf3ffff) AM_RAM AM_SHARE(3)
1041   AM_RANGE(0xf40000, 0xf7ffff) AM_ROM AM_SHARE(1)
1042   AM_RANGE(0xf80000, 0xffffff) AM_RAM AM_SHARE(2)
1043ADDRESS_MAP_END
1044
1045/*************************************
1046 *
1047 *  CPU 2 memory handlers
1048 *
1049 *************************************/
1050
1051static ADDRESS_MAP_START( system24_cpu2_map, ADDRESS_SPACE_PROGRAM, 16 )
1052   AM_RANGE(0x000000, 0x03ffff) AM_RAM AM_SHARE(3) AM_BASE(&s24_mainram1)         // RAM here overrides the ROM mirror
1053   AM_RANGE(0x040000, 0x07ffff) AM_ROM AM_SHARE(1)
1054   AM_RANGE(0x080000, 0x0fffff) AM_RAM AM_SHARE(2)
1055   AM_RANGE(0x100000, 0x13ffff) AM_MIRROR(0x040000) AM_ROM AM_SHARE(1)
1056   AM_RANGE(0x200000, 0x20ffff) AM_READWRITE(sys24_tile_r, sys24_tile_w)
1057   AM_RANGE(0x220000, 0x220001) AM_WRITENOP      // Unknown, always 0
1058   AM_RANGE(0x240000, 0x240001) AM_WRITENOP      // Horizontal synchronization register
1059   AM_RANGE(0x260000, 0x260001) AM_WRITENOP      // Vertical synchronization register
1060   AM_RANGE(0x270000, 0x270001) AM_WRITENOP      // Video synchronization switch
1061   AM_RANGE(0x280000, 0x29ffff) AM_READWRITE(sys24_char_r, sys24_char_w)
1062   AM_RANGE(0x400000, 0x403fff) AM_READWRITE(MRA16_RAM, system24temp_sys16_paletteram1_w)
1063   AM_RANGE(0x404000, 0x40401f) AM_READWRITE(sys24_mixer_r, sys24_mixer_w)
1064   AM_RANGE(0x600000, 0x63ffff) AM_READWRITE(sys24_sprite_r, sys24_sprite_w)
1065   AM_RANGE(0x800000, 0x80007f) AM_READWRITE(system24temp_sys16_io_r, system24temp_sys16_io_w)
1066   AM_RANGE(0x800100, 0x800101) AM_WRITE(ym_register_w)
1067   AM_RANGE(0x800102, 0x800103) AM_READWRITE(ym_status_r, ym_data_w)
1068   AM_RANGE(0xa00000, 0xa00007) AM_READWRITE(irq_r, irq_w)
1069   AM_RANGE(0xb00000, 0xb00007) AM_READWRITE(fdc_r, fdc_w)
1070   AM_RANGE(0xb00008, 0xb0000f) AM_READWRITE(fdc_status_r, fdc_ctrl_w)
1071   AM_RANGE(0xb80000, 0xbbffff) AM_ROMBANK(1)
1072   AM_RANGE(0xbc0000, 0xbc0001) AM_READWRITE(curbank_r, curbank_w)
1073   AM_RANGE(0xbc0006, 0xbc0007) AM_READWRITE(mlatch_r, mlatch_w)
1074   AM_RANGE(0xc00000, 0xc00011) AM_READWRITE(hotrod3_ctrl_r, hotrod3_ctrl_w)
1075   AM_RANGE(0xc80000, 0xcbffff) AM_ROMBANK(2)
1076   AM_RANGE(0xcc0000, 0xcc0001) AM_READWRITE(curbank_r, curbank_w)
1077   AM_RANGE(0xcc0006, 0xcc0007) AM_READWRITE(mlatch_r, mlatch_w)
1078AM_RANGE(0xd00300, 0xd00301) AM_WRITE(MWA16_NOP)
1079   AM_RANGE(0xf00000, 0xf3ffff) AM_RAM AM_SHARE(3)
1080   AM_RANGE(0xf40000, 0xf7ffff) AM_ROM AM_SHARE(1)
1081   AM_RANGE(0xf80000, 0xffffff) AM_RAM AM_SHARE(2)
1082ADDRESS_MAP_END
1083
1084
1085/*************************************
1086 *
1087 *  Game-specific driver inits
1088 *
1089 *************************************/
1090
1091static DRIVER_INIT(qgh)
1092{
1093   system24temp_sys16_io_set_callbacks(hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w);
1094   mlatch_table = gqh_mlt;
1095   track_size = 0;
1096}
1097
1098static DRIVER_INIT(dcclub)
1099{
1100   system24temp_sys16_io_set_callbacks(dcclub_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w);
1101   mlatch_table = dcclub_mlt;
1102   track_size = 0;
1103}
1104
1105static DRIVER_INIT(qrouka)
1106{
1107   system24temp_sys16_io_set_callbacks(hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w);
1108   mlatch_table = qrouka_mlt;
1109   track_size = 0;
1110}
1111
1112static DRIVER_INIT(quizmeku)
1113{
1114   system24temp_sys16_io_set_callbacks(gground_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w);
1115   mlatch_table = quizmeku_mlt;
1116   track_size = 0;
1117}
1118
1119static DRIVER_INIT(mahmajn)
1120{
1121
1122   system24temp_sys16_io_set_callbacks(mahmajn_io_r, mahmajn_io_w, resetcontrol_w, iod_r, iod_w);
1123   mlatch_table = mahmajn_mlt;
1124   track_size = 0;
1125   cur_input_line = 0;
1126}
1127
1128static DRIVER_INIT(mahmajn2)
1129{
1130
1131   system24temp_sys16_io_set_callbacks(mahmajn_io_r, mahmajn_io_w, resetcontrol_w, iod_r, iod_w);
1132   mlatch_table = mahmajn2_mlt;
1133   track_size = 0;
1134   cur_input_line = 0;
1135}
1136
1137static DRIVER_INIT(hotrod)
1138{
1139   system24temp_sys16_io_set_callbacks(hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w);
1140   mlatch_table = 0;
1141
1142   // Sector  Size
1143   // 1       8192
1144   // 2       1024
1145   // 3       1024
1146   // 4       1024
1147   // 5        512
1148   // 6        256
1149
1150   track_size = 0x2f00;
1151}
1152
1153static DRIVER_INIT(bnzabros)
1154{
1155   system24temp_sys16_io_set_callbacks(hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w);
1156   mlatch_table = bnzabros_mlt;
1157
1158   // Sector  Size
1159   // 1       2048
1160   // 2       2048
1161   // 3       2048
1162   // 4       2048
1163   // 5       2048
1164   // 6       1024
1165   // 7        256
1166
1167   track_size = 0x2d00;
1168}
1169
1170static DRIVER_INIT(sspirits)
1171{
1172   system24temp_sys16_io_set_callbacks(hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w);
1173   mlatch_table = 0;
1174   track_size = 0x2d00;
1175   s24_fd1094_driver_init();
1176
1177}
1178
1179static DRIVER_INIT(sspiritj)
1180{
1181   system24temp_sys16_io_set_callbacks(hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w);
1182   mlatch_table = 0;
1183   track_size = 0x2f00;
1184   s24_fd1094_driver_init();
1185
1186}
1187
1188static DRIVER_INIT(dcclubfd)
1189{
1190   system24temp_sys16_io_set_callbacks(dcclub_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w);
1191   mlatch_table = dcclub_mlt;
1192   track_size = 0x2d00;
1193   s24_fd1094_driver_init();
1194
1195}
1196
1197
1198
1199
1200static DRIVER_INIT(sgmast)
1201{
1202   system24temp_sys16_io_set_callbacks(hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w);
1203   mlatch_table = 0;
1204   track_size = 0x2d00;
1205   s24_fd1094_driver_init();
1206
1207}
1208
1209static DRIVER_INIT(qsww)
1210{
1211   system24temp_sys16_io_set_callbacks(hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w);
1212   mlatch_table = 0;
1213   track_size = 0x2d00;
1214   s24_fd1094_driver_init();
1215}
1216
1217static DRIVER_INIT(gground)
1218{
1219   system24temp_sys16_io_set_callbacks(gground_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w);
1220   mlatch_table = 0;
1221   track_size = 0x2d00;
1222   s24_fd1094_driver_init();
1223}
1224
1225static DRIVER_INIT(crkdown)
1226{
1227   system24temp_sys16_io_set_callbacks(hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w);
1228   mlatch_table = 0;
1229   track_size = 0x2d00;
1230   s24_fd1094_driver_init();
1231}
1232
1233static DRIVER_INIT(roughrac)
1234{
1235   system24temp_sys16_io_set_callbacks(hotrod_io_r, hotrod_io_w, resetcontrol_w, iod_r, iod_w);
1236   mlatch_table = 0;
1237   track_size = 0x2d00;
1238   s24_fd1094_driver_init();
1239}
1240
1241/*************************************
1242 *
1243 *  Generic driver initialization
1244 *
1245 *************************************/
1246
1247static NVRAM_HANDLER(system24)
1248{
1249   if(!track_size || !file)
1250      return;
1251   if(read_or_write)
1252      mame_fwrite(file, memory_region(REGION_USER2), 2*track_size);
1253   else
1254      mame_fread(file, memory_region(REGION_USER2), 2*track_size);
1255}
1256
1257static MACHINE_RESET(system24)
1258{
1259   cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE);
1260   prev_resetcontrol = resetcontrol = 0x06;
1261   fdc_init();
1262   curbank = 0;
1263   reset_bank();
1264   irq_init();
1265   mlatch = 0x00;
1266}
1267
1268/*************************************
1269 *
1270 *  Generic port definitions
1271 *
1272 *************************************/
1273
1274static INPUT_PORTS_START( system24_P1_P2 )
1275   PORT_START_TAG("P1")
1276   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1277    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1278   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1279   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) //enabled with "Separate"
1280   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1281   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1282   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1283   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1284
1285   PORT_START_TAG("P2")
1286   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1287   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1288   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1289   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE3 ) //enabled with "Separate"
1290   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1291   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1292   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1293   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1294INPUT_PORTS_END
1295
1296static INPUT_PORTS_START( system24_Service )
1297   PORT_START_TAG("SERVICE")
1298   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1299   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1300   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE )
1301   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("All Service")
1302   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
1303   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
1304   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN3 )
1305   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN4 )
1306INPUT_PORTS_END
1307
1308static INPUT_PORTS_START( system24_DSW )
1309   PORT_START_TAG("COINAGE")
1310   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:1,2,3,4")
1311   PORT_DIPSETTING(    0x07, DEF_STR( 4C_1C ) )
1312   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
1313   PORT_DIPSETTING(    0x09, DEF_STR( 2C_1C ) )
1314   PORT_DIPSETTING(    0x05, "2 Coins/1 Credit 5/3 6/4" )
1315   PORT_DIPSETTING(    0x04, "2 Coins/1 Credit 4/3" )
1316   PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
1317   PORT_DIPSETTING(    0x01, "1 Coin/1 Credit 2/3" )
1318   PORT_DIPSETTING(    0x02, "1 Coin/1 Credit 4/5" )
1319   PORT_DIPSETTING(    0x03, "1 Coin/1 Credit 5/6" )
1320   PORT_DIPSETTING(    0x06, DEF_STR( 2C_3C ) )
1321   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
1322   PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
1323   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
1324   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
1325   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
1326   PORT_DIPSETTING(    0x00, "Free Play (if Coin B too) or 1/1" )
1327   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SWA:5,6,7,8")
1328   PORT_DIPSETTING(    0x70, DEF_STR( 4C_1C ) )
1329   PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) )
1330   PORT_DIPSETTING(    0x90, DEF_STR( 2C_1C ) )
1331   PORT_DIPSETTING(    0x50, "2 Coins/1 Credit 5/3 6/4" )
1332   PORT_DIPSETTING(    0x40, "2 Coins/1 Credit 4/3" )
1333   PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
1334   PORT_DIPSETTING(    0x10, "1 Coin/1 Credit 2/3" )
1335   PORT_DIPSETTING(    0x20, "1 Coin/1 Credit 4/5" )
1336   PORT_DIPSETTING(    0x30, "1 Coin/1 Credit 5/6" )
1337   PORT_DIPSETTING(    0x60, DEF_STR( 2C_3C ) )
1338   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
1339   PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
1340   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
1341   PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
1342   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
1343   PORT_DIPSETTING(    0x00, "Free Play (if Coin A too) or 1/1" )
1344
1345   PORT_START_TAG("DSW")
1346   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) PORT_DIPLOCATION("SWB:1")
1347   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1348   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1349   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unused ) ) PORT_DIPLOCATION("SWB:2")
1350   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1351   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1352   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) ) PORT_DIPLOCATION("SWB:3")
1353   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1354   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1355   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) ) PORT_DIPLOCATION("SWB:4")
1356   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1357   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1358   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) ) PORT_DIPLOCATION("SWB:5")
1359   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1360   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1361   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) ) PORT_DIPLOCATION("SWB:6")
1362   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1363   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1364   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) ) PORT_DIPLOCATION("SWB:7")
1365   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1366   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1367   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) ) PORT_DIPLOCATION("SWB:8")
1368   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1369   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1370INPUT_PORTS_END
1371
1372static INPUT_PORTS_START( system24_generic )
1373   PORT_INCLUDE( system24_P1_P2 )
1374   PORT_INCLUDE( system24_Service )
1375   PORT_INCLUDE( system24_DSW )
1376INPUT_PORTS_END
1377
1378/*************************************
1379 *
1380 *  Game-specific port definitions
1381 *
1382 *************************************/
1383
1384static INPUT_PORTS_START( hotrod )
1385   PORT_INCLUDE( system24_generic )
1386
1387   PORT_MODIFY("P1")
1388   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1389   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1390   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
1391   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN4 )
1392   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN5 )
1393   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN6 )
1394   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN7 )
1395   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN8 )
1396
1397   PORT_MODIFY("P2")
1398   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
1399   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
1400   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
1401   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
1402   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE2 )
1403   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE3 )
1404   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE4 )
1405   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
1406
1407   PORT_MODIFY("DSW")
1408   PORT_DIPNAME( 0x20, 0x20, "Start Credit" ) PORT_DIPLOCATION("SWB:6")
1409   PORT_DIPSETTING(    0x20, "1" )
1410   PORT_DIPSETTING(    0x00, "2" )
1411   PORT_DIPNAME( 0x40, 0x40, "Coin Chute" ) PORT_DIPLOCATION("SWB:7")
1412   PORT_DIPSETTING(    0x40, "Separate" )
1413   PORT_DIPSETTING(    0x00, "Common" )
1414   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SWB:8")
1415   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1416   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1417
1418   PORT_START
1419   PORT_BIT( 0xfff, 0x000, IPT_DIAL ) PORT_MINMAX(0x000,0xfff) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1)
1420
1421   PORT_START
1422   PORT_BIT( 0xfff, 0x000, IPT_DIAL ) PORT_MINMAX(0x000,0xfff) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(2)
1423
1424   PORT_START
1425   PORT_BIT( 0xfff, 0x000, IPT_DIAL ) PORT_MINMAX(0x000,0xfff) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(3)
1426
1427   PORT_START
1428   PORT_BIT( 0xfff, 0x000, IPT_DIAL ) PORT_MINMAX(0x000,0xfff) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(4)
1429
1430   PORT_START
1431   PORT_BIT( 0xff, 0x01, IPT_PEDAL ) PORT_MINMAX(0x01,0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1)
1432
1433   PORT_START
1434   PORT_BIT( 0xff, 0x01, IPT_PEDAL ) PORT_MINMAX(0x01,0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(2)
1435
1436   PORT_START
1437   PORT_BIT( 0xff, 0x01, IPT_PEDAL ) PORT_MINMAX(0x01,0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(3)
1438
1439   PORT_START
1440   PORT_BIT( 0xff, 0x01, IPT_PEDAL ) PORT_MINMAX(0x01,0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(4)
1441INPUT_PORTS_END
1442
1443static INPUT_PORTS_START( hotrodj )
1444   PORT_INCLUDE( hotrod )
1445
1446   PORT_MODIFY("DSW")
1447   PORT_DIPNAME( 0x04, 0x04, "Start Credit" ) PORT_DIPLOCATION("SWB:3")
1448   PORT_DIPSETTING(    0x04, "1" )
1449   PORT_DIPSETTING(    0x00, "2" )
1450   PORT_DIPNAME( 0x08, 0x08, "Play Mode" ) PORT_DIPLOCATION("SWB:4")
1451   PORT_DIPSETTING(    0x08, "4 Player" )
1452   PORT_DIPSETTING(    0x00, "2 Player" )
1453   PORT_DIPNAME( 0x10, 0x10, "Game Style" ) PORT_DIPLOCATION("SWB:5")
1454   PORT_DIPSETTING(    0x10, "4 Sides" )
1455   PORT_DIPSETTING(    0x00, "2 Sides" )
1456   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Language ) ) PORT_DIPLOCATION("SWB:6")
1457   PORT_DIPSETTING(    0x20, DEF_STR( Japanese ) )
1458   PORT_DIPSETTING(    0x00, DEF_STR( English ) )
1459INPUT_PORTS_END
1460
1461static INPUT_PORTS_START( bnzabros )
1462   PORT_INCLUDE( system24_generic )
1463
1464   PORT_MODIFY("DSW")
1465   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:1")
1466   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1467   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1468   PORT_DIPNAME( 0x02, 0x02, "Start Credit" ) PORT_DIPLOCATION("SWB:2")
1469   PORT_DIPSETTING(    0x02, "1" )
1470   PORT_DIPSETTING(    0x00, "2" )
1471   PORT_DIPNAME( 0x04, 0x04, "Coin Chute" ) PORT_DIPLOCATION("SWB:3")
1472   PORT_DIPSETTING(    0x04, "Common" )
1473   PORT_DIPSETTING(    0x00, "Individual" )
1474   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SWB:4")
1475   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1476   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1477   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:5,6")
1478   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
1479   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
1480   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
1481   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1482   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:7,8")
1483   PORT_DIPSETTING(    0x00, "1" )
1484   PORT_DIPSETTING(    0x40, "2" )
1485   PORT_DIPSETTING(    0xc0, "3" )
1486   PORT_DIPSETTING(    0x80, "4" )
1487INPUT_PORTS_END
1488
1489static INPUT_PORTS_START( crkdown )
1490   PORT_INCLUDE( system24_generic )
1491
1492   PORT_MODIFY("DSW")
1493   PORT_DIPNAME( 0x40, 0x40, "Coin Chute" ) PORT_DIPLOCATION("SWB:7")
1494   PORT_DIPSETTING(    0x40, "Common" )
1495   PORT_DIPSETTING(    0x00, "Separate" )
1496   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SWB:8")
1497   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1498   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1499INPUT_PORTS_END
1500
1501static INPUT_PORTS_START( roughrac )
1502   PORT_INCLUDE( system24_generic )
1503
1504   PORT_MODIFY("DSW")
1505   PORT_DIPNAME( 0x01, 0x01, "Start Credit" ) PORT_DIPLOCATION("SWB:1")
1506   PORT_DIPSETTING(    0x01, "1" )
1507   PORT_DIPSETTING(    0x00, "2" )
1508   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
1509   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1510   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1511   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SWB:3")
1512   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1513   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1514   PORT_DIPNAME( 0x08, 0x08, "Game Instruction" ) PORT_DIPLOCATION("SWB:4")
1515   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1516   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1517   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:5,6")
1518   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
1519   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
1520   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
1521   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1522   PORT_DIPNAME( 0x40, 0x40, "Start Money" ) PORT_DIPLOCATION("SWB:7")
1523   PORT_DIPSETTING(    0x40, "15000" )
1524   PORT_DIPSETTING(    0x00, "20000" )
1525   PORT_DIPNAME( 0x80, 0x80, "Start Intro" ) PORT_DIPLOCATION("SWB:8")
1526   PORT_DIPSETTING(    0x80, "10" )
1527   PORT_DIPSETTING(    0x00, "15" )
1528
1529   PORT_START
1530   PORT_BIT( 0xfff, 0x000, IPT_DIAL ) PORT_MINMAX(0x000,0xfff) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1)
1531
1532   PORT_START
1533   PORT_BIT( 0xfff, 0x000, IPT_DIAL ) PORT_MINMAX(0x000,0xfff) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(2)
1534INPUT_PORTS_END
1535
1536static INPUT_PORTS_START( sspirits )
1537   PORT_INCLUDE( system24_generic )
1538
1539   PORT_MODIFY("DSW")
1540   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SWB:1")
1541   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1542   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1543   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
1544   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1545   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1546   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:3,4")
1547   PORT_DIPSETTING(    0x00, "2" )
1548   PORT_DIPSETTING(    0x0c, "3" )
1549   PORT_DIPSETTING(    0x08, "4" )
1550   PORT_DIPSETTING(    0x04, "5" )
1551   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SWB:5,6")
1552   PORT_DIPSETTING(    0x20, "500K" )
1553   PORT_DIPSETTING(    0x30, "600K" )
1554   PORT_DIPSETTING(    0x10, "800K" )
1555   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
1556   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:7,8")
1557   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
1558   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
1559   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
1560   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1561INPUT_PORTS_END
1562
1563static INPUT_PORTS_START( qgh )
1564   PORT_INCLUDE( system24_generic )
1565
1566   PORT_MODIFY("DSW")
1567   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SWB:1")
1568   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1569   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1570   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
1571   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1572   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1573   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:3,4")
1574   PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
1575   PORT_DIPSETTING(    0x0c, DEF_STR( Normal ) )
1576   PORT_DIPSETTING(    0x04, DEF_STR( Hard ) )
1577   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
1578   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:5,6")
1579   PORT_DIPSETTING(    0x10, "3" )
1580   PORT_DIPSETTING(    0x00, "3" )
1581   PORT_DIPSETTING(    0x20, "4" )
1582   PORT_DIPSETTING(    0x30, "5" )
1583INPUT_PORTS_END
1584
1585static INPUT_PORTS_START( qsww )
1586   PORT_INCLUDE( system24_generic )
1587
1588   PORT_MODIFY("DSW")
1589   PORT_DIPNAME( 0x01, 0x01, "Start Credit" ) PORT_DIPLOCATION("SWB:1")
1590   PORT_DIPSETTING(    0x01, "1" )
1591   PORT_DIPSETTING(    0x00, "2" )
1592   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
1593   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1594   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1595   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SWB:3")
1596   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1597   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1598   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:5,6")
1599   PORT_DIPSETTING(    0x10, "2" )
1600   PORT_DIPSETTING(    0x00, "3" )
1601   PORT_DIPSETTING(    0x30, "4" )
1602   PORT_DIPSETTING(    0x20, "5" )
1603   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:7,8")
1604   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
1605   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
1606   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
1607   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1608INPUT_PORTS_END
1609
1610static INPUT_PORTS_START( dcclub ) /* In the Japan set missing angle input */
1611   PORT_INCLUDE( system24_generic )
1612
1613   PORT_MODIFY("P1")
1614   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1615   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1616   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
1617   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1618
1619   PORT_MODIFY("DSW")
1620   PORT_DIPNAME( 0x01, 0x01, "Start Credit" ) PORT_DIPLOCATION("SWB:1")
1621   PORT_DIPSETTING(    0x01, "1" )
1622   PORT_DIPSETTING(    0x00, "2" )
1623   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SWB:2")
1624   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1625   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1626   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:3")
1627   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1628   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1629   PORT_DIPNAME( 0x08, 0x08, "Timing Meter" ) PORT_DIPLOCATION("SWB:4")
1630   PORT_DIPSETTING(    0x08, DEF_STR( Normal ) )
1631   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
1632   PORT_DIPNAME( 0x10, 0x10, "Initial Balls" ) PORT_DIPLOCATION("SWB:5")
1633   PORT_DIPSETTING(    0x00, "1" )
1634   PORT_DIPSETTING(    0x10, "2" )
1635   PORT_DIPNAME( 0x20, 0x20, "Balls Limit" ) PORT_DIPLOCATION("SWB:6")
1636   PORT_DIPSETTING(    0x00, "3" )
1637   PORT_DIPSETTING(    0x20, "4" )
1638   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:7,8")
1639   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
1640   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
1641   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
1642   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1643
1644   PORT_START
1645   PORT_BIT( 0xff, 0x00, IPT_PADDLE ) PORT_MINMAX(0x00,0x8f) PORT_SENSITIVITY(64) PORT_KEYDELTA(64) PORT_PLAYER(1)
1646INPUT_PORTS_END
1647
1648static INPUT_PORTS_START( sgmast )
1649   PORT_INCLUDE( system24_generic )
1650
1651   PORT_MODIFY("P1")
1652   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1653   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1654   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
1655   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1656   /* For select the power shot rotate the stick from up-left (max power) to up (minimum power) and relese */
1657   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1658   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1659   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1660   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1661
1662   PORT_MODIFY("DSW")
1663   PORT_DIPNAME( 0x01, 0x01, "Start Credit" ) PORT_DIPLOCATION("SWB:1")
1664   PORT_DIPSETTING(    0x01, "1" )
1665   PORT_DIPSETTING(    0x00, "2" )
1666   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:3")
1667   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1668   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1669   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SWB:2")
1670   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1671   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1672   PORT_DIPNAME( 0x08, 0x08, "Gameplay" ) PORT_DIPLOCATION("SWB:4")
1673   PORT_DIPSETTING(    0x08, "1 Hole 1 Credit" )
1674   PORT_DIPSETTING(    0x00, "Lose Ball Game Over" )
1675   PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:6,7,8")
1676   PORT_DIPSETTING(    0x80, DEF_STR( Easiest ) )
1677   PORT_DIPSETTING(    0xa0, DEF_STR( Easier ) )
1678   PORT_DIPSETTING(    0xc0, DEF_STR( Easy ) )
1679   PORT_DIPSETTING(    0xe0, DEF_STR( Normal ) )
1680   PORT_DIPSETTING(    0x60, "Little Hard" )
1681   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
1682   PORT_DIPSETTING(    0x20, DEF_STR( Harder ) )
1683   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1684INPUT_PORTS_END
1685
1686static INPUT_PORTS_START( sgmastj )
1687   PORT_INCLUDE( sgmast )
1688
1689   PORT_MODIFY("DSW")
1690   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) ) PORT_DIPLOCATION("SWB:4")
1691   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1692   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1693
1694   PORT_START
1695   PORT_BIT( 0xfff, 0x000, IPT_DIAL ) PORT_MINMAX(0x000,0xfff) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(2)
1696INPUT_PORTS_END
1697
1698static INPUT_PORTS_START( quizmeku )
1699   PORT_INCLUDE( system24_P1_P2 )
1700
1701   PORT_MODIFY("P1")
1702   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START3 )
1703   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
1704   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
1705
1706   PORT_MODIFY("P2")
1707   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START4 )
1708   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
1709   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
1710
1711   PORT_START_TAG("P3")
1712   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4)
1713   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4)
1714   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
1715   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
1716   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
1717   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
1718   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
1719   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
1720
1721   PORT_INCLUDE( system24_Service )
1722   PORT_INCLUDE( system24_DSW )
1723
1724   PORT_MODIFY("DSW")
1725   PORT_DIPNAME( 0x01, 0x00, "Play Mode" ) PORT_DIPLOCATION("SWB:1")
1726   PORT_DIPSETTING(    0x01, "2 Player" )
1727   PORT_DIPSETTING(    0x00, "4 Player" )
1728   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
1729   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1730   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1731   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:3,4")
1732   PORT_DIPSETTING(    0x08, "2" )
1733   PORT_DIPSETTING(    0x0c, "3" )
1734   PORT_DIPSETTING(    0x04, "4" )
1735   PORT_DIPSETTING(    0x00, "5" )
1736   PORT_DIPNAME( 0x10, 0x10, "Answer Counts" ) PORT_DIPLOCATION("SWB:5")
1737   PORT_DIPSETTING(    0x10, "Every" )
1738   PORT_DIPSETTING(    0x00, "3" )
1739   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SWB:6")
1740   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1741   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1742   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:7,8")
1743   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
1744   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
1745   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
1746   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1747INPUT_PORTS_END
1748
1749static INPUT_PORTS_START( qrouka ) /* Missing stick input for the 3rd & 4th player */
1750   PORT_INCLUDE( system24_generic )
1751
1752   PORT_MODIFY("P1")
1753   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START3 )
1754   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
1755   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
1756
1757   PORT_MODIFY("P2")
1758   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START4 )
1759   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
1760   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
1761
1762   PORT_MODIFY("SERVICE")
1763   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN4 )
1764   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 )
1765   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
1766   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
1767
1768   PORT_MODIFY("DSW")
1769   PORT_DIPNAME( 0x01, 0x00, "Play Mode" ) PORT_DIPLOCATION("SWB:1")
1770   PORT_DIPSETTING(    0x01, "2 Player" )
1771   PORT_DIPSETTING(    0x00, "4 Player" )
1772   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
1773   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1774   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1775   PORT_DIPNAME( 0x08, 0x08, "Coin Chute" ) PORT_DIPLOCATION("SWB:4")
1776   PORT_DIPSETTING(    0x08, "Common" )
1777   PORT_DIPSETTING(    0x00, "Separate" )
1778   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:5,6")
1779   PORT_DIPSETTING(    0x10, "2" )
1780   PORT_DIPSETTING(    0x00, "3" )
1781   PORT_DIPSETTING(    0x30, "4" )
1782   PORT_DIPSETTING(    0x20, "5" )
1783   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:7,8")
1784   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
1785   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
1786   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
1787   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1788INPUT_PORTS_END
1789
1790static INPUT_PORTS_START( mahmajn )
1791   PORT_START_TAG("MJ0")
1792   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("A") PORT_CODE(KEYCODE_A)
1793   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("B") PORT_CODE(KEYCODE_B)
1794   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("C") PORT_CODE(KEYCODE_C)
1795   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("D") PORT_CODE(KEYCODE_D)
1796   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
1797
1798   PORT_START_TAG("MJ1")
1799   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("E") PORT_CODE(KEYCODE_E)
1800   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("F") PORT_CODE(KEYCODE_F)
1801   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("G") PORT_CODE(KEYCODE_G)
1802   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("H") PORT_CODE(KEYCODE_H)
1803   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
1804
1805   PORT_START_TAG("MJ2")
1806   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("I") PORT_CODE(KEYCODE_I)
1807   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("J") PORT_CODE(KEYCODE_J)
1808   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("K") PORT_CODE(KEYCODE_K)
1809   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("L") PORT_CODE(KEYCODE_L)
1810   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
1811
1812   PORT_START_TAG("MJ3")
1813   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("M") PORT_CODE(KEYCODE_M)
1814   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("N") PORT_CODE(KEYCODE_N)
1815   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Chi") PORT_CODE(KEYCODE_SPACE)
1816   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pon") PORT_CODE(KEYCODE_LALT)
1817   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
1818
1819   PORT_START_TAG("MJ4")
1820   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
1821   PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
1822
1823   PORT_START_TAG("MJ5")
1824   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Kan") PORT_CODE(KEYCODE_LCONTROL)
1825   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Reach") PORT_CODE(KEYCODE_LSHIFT)
1826   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Ron") PORT_CODE(KEYCODE_Z)
1827   PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED )
1828
1829   PORT_START_TAG("P1")
1830   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
1831
1832   PORT_START_TAG("P2")
1833   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
1834
1835   PORT_INCLUDE( system24_Service )
1836   PORT_INCLUDE( system24_DSW )
1837
1838   PORT_MODIFY("DSW")
1839   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:1")
1840   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1841   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1842   PORT_DIPNAME( 0x02, 0x02, "Start Score" ) PORT_DIPLOCATION("SWB:2")
1843   PORT_DIPSETTING(    0x00, "2000" )
1844   PORT_DIPSETTING(    0x02, "3000" )
1845   PORT_DIPNAME( 0x0c, 0x0c, "Difficulty (computer)" ) PORT_DIPLOCATION("SWB:3,4")
1846   PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
1847   PORT_DIPSETTING(    0x0c, DEF_STR( Normal ) )
1848   PORT_DIPSETTING(    0x04, DEF_STR( Hard ) )
1849   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1850   PORT_DIPNAME( 0x30, 0x30, "Difficulty (player)" ) PORT_DIPLOCATION("SWB:5,6")
1851   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
1852   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
1853   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
1854   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1855INPUT_PORTS_END
1856
1857static INPUT_PORTS_START( gground )
1858   PORT_INCLUDE( system24_P1_P2 )
1859
1860   PORT_START_TAG("P3")
1861   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 )
1862   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
1863   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
1864   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE4 ) PORT_NAME("P3 Service")
1865    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
1866   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
1867   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
1868   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
1869
1870   PORT_INCLUDE( system24_Service )
1871   PORT_INCLUDE( system24_DSW )
1872
1873   PORT_MODIFY("DSW")
1874   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SWB:1")
1875   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1876   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1877   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:2")
1878   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1879   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1880   PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:3,4,5")
1881   PORT_DIPSETTING(    0x00, DEF_STR( Easiest ) )
1882   PORT_DIPSETTING(    0x10, DEF_STR( Easier ) )
1883   PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
1884   PORT_DIPSETTING(    0x18, "Little Easy" )
1885   PORT_DIPSETTING(    0x1c, DEF_STR( Normal ) )
1886   PORT_DIPSETTING(    0x0c, "Little Hard" )
1887   PORT_DIPSETTING(    0x14, DEF_STR( Hard ) )
1888   PORT_DIPSETTING(    0x04, DEF_STR( Hardest ) )
1889   PORT_DIPNAME( 0x60, 0x60, "Time Limit Per Stage" ) PORT_DIPLOCATION("SWB:6,7")
1890   PORT_DIPSETTING(    0x20, DEF_STR( Easiest ) )
1891   PORT_DIPSETTING(    0x40, DEF_STR( Easy ) )
1892   PORT_DIPSETTING(    0x60, DEF_STR( Normal ) )
1893   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
1894   PORT_DIPNAME( 0x80, 0x80, "Clock Of Time Limit" ) PORT_DIPLOCATION("SWB:8")
1895   PORT_DIPSETTING(    0x80, "1.00 sec" )
1896   PORT_DIPSETTING(    0x00, "0.80 sec" )
1897INPUT_PORTS_END
1898
1899/*************************************
1900 *
1901 *  Sound definitions
1902 *
1903 *************************************/
1904
1905static struct YM2151interface ym2151_interface =
1906{
1907   irq_ym
1908};
1909
1910/*************************************
1911 *
1912 *  Generic machine drivers
1913 *
1914 *************************************/
1915
1916static MACHINE_DRIVER_START( system24 )
1917   MDRV_CPU_ADD(M68000, 10000000)
1918   MDRV_CPU_PROGRAM_MAP(system24_cpu1_map, 0)
1919   MDRV_CPU_VBLANK_INT(irq_vbl, 2)
1920
1921   MDRV_CPU_ADD(M68000, 10000000)
1922   MDRV_CPU_PROGRAM_MAP(system24_cpu2_map, 0)
1923
1924   MDRV_SCREEN_REFRESH_RATE(58)
1925   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(100))
1926   MDRV_INTERLEAVE(4)
1927
1928   MDRV_MACHINE_RESET(system24)
1929   MDRV_NVRAM_HANDLER(system24)
1930
1931   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_UPDATE_AFTER_VBLANK)
1932   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1933   MDRV_SCREEN_SIZE(62*8, 48*8)
1934   MDRV_SCREEN_VISIBLE_AREA(0*8, 62*8-1, 0*8, 48*8-1)
1935   MDRV_PALETTE_LENGTH(8192*2)
1936
1937   MDRV_VIDEO_START(system24)
1938   MDRV_VIDEO_UPDATE(system24)
1939
1940   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
1941
1942   MDRV_SOUND_ADD(YM2151, 4000000)
1943   MDRV_SOUND_CONFIG(ym2151_interface)
1944   MDRV_SOUND_ROUTE(0, "left", 0.50)
1945   MDRV_SOUND_ROUTE(1, "right", 0.50)
1946
1947   MDRV_SOUND_ADD(DAC, 0)
1948   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.50)
1949   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.50)
1950MACHINE_DRIVER_END
1951
1952/*************************************
1953 *
1954 *  ROM definition(s)
1955 *
1956 *************************************/
1957
1958ROM_START( hotrod )
1959   ROM_REGION( 0x100000, REGION_CPU1, 0 ) /* 68000 code */
1960   ROM_LOAD16_BYTE( "epr-11339.ic2", 0x000000, 0x20000, CRC(75130e73) SHA1(e079739f4a3da3807aac570442c5afef1a7d7b0e) )
1961   ROM_LOAD16_BYTE( "epr-11338.ic1", 0x000001, 0x20000, CRC(7d4a7ff3) SHA1(3d3af04d990d232ba0a8fe155de59bc632a0a461) )
1962
1963   ROM_REGION( 0x1d6000, REGION_USER2, 0)
1964   ROM_LOAD( "ds3-5000-01d_3p_turbo.bin", 0x000000, 0x1d6000, CRC(627e8053) SHA1(d1a95f99078f5a29cccacfb1b30c3c9ead7b605c) )
1965ROM_END
1966
1967ROM_START( hotroda )
1968   ROM_REGION( 0x100000, REGION_CPU1, 0 ) /* 68000 code */
1969   ROM_LOAD16_BYTE( "epr-11339.ic2", 0x000000, 0x20000, CRC(75130e73) SHA1(e079739f4a3da3807aac570442c5afef1a7d7b0e) )
1970   ROM_LOAD16_BYTE( "epr-11338.ic1", 0x000001, 0x20000, CRC(7d4a7ff3) SHA1(3d3af04d990d232ba0a8fe155de59bc632a0a461) )
1971
1972   ROM_REGION( 0x1d6000, REGION_USER2, 0)
1973   ROM_LOAD( "ds3-5000-01d.bin", 0x000000, 0x1d6000, CRC(abf67b02) SHA1(f397435eaad691ff5a38d6d1d27840ed95a62df3) ) // World? 3 Playe TURBO
1974ROM_END
1975
1976ROM_START( hotrodj )
1977   ROM_REGION( 0x100000, REGION_CPU1, 0 ) /* 68000 code */
1978   ROM_LOAD16_BYTE( "epr-11339.ic2", 0x000000, 0x20000, CRC(75130e73) SHA1(e079739f4a3da3807aac570442c5afef1a7d7b0e) )
1979   ROM_LOAD16_BYTE( "epr-11338.ic1", 0x000001, 0x20000, CRC(7d4a7ff3) SHA1(3d3af04d990d232ba0a8fe155de59bc632a0a461) )
1980
1981   ROM_REGION( 0x1d6000, REGION_USER2, 0)
1982   ROM_LOAD( "ds3-5000-01a-revb.bin", 0x000000, 0x1d6000, CRC(a39a0c2d) SHA1(ea8104c2266c48f480837aa7679c0a6f0c5e5452) ) // Japanese 4 Player
1983ROM_END
1984
1985ROM_START( qgh )
1986   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
1987   ROM_LOAD16_BYTE( "16900b", 0x000000, 0x20000, CRC(20d7b7d1) SHA1(345b228c27e5f2fef9a2b8b5f619c59450a070f8) )
1988   ROM_LOAD16_BYTE( "16899b", 0x000001, 0x20000, CRC(397b3ba9) SHA1(1773212cd87dcff840f3953ec368be7e2394faf0) )
1989
1990   ROM_REGION16_BE( 0x400000, REGION_USER1, 0)
1991   ROM_LOAD16_BYTE( "16902a", 0x000000, 0x80000, CRC(d35b7706) SHA1(341bca0af6b6d3f326328a88cdc69c7897b83a0d) )
1992   ROM_LOAD16_BYTE( "16901a", 0x000001, 0x80000, CRC(ab4bcb33) SHA1(8acd73096eb485c6dc83da6adfcc47d5d0f5b7f3) )
1993   ROM_LOAD16_BYTE( "16904",  0x100000, 0x80000, CRC(10987c88) SHA1(66f893690565aed613427421958ebe225a20ad0f) )
1994   ROM_LOAD16_BYTE( "16903",  0x100001, 0x80000, CRC(c19f9e46) SHA1(f1275674a8b44957428d79402f240ca21a34f48d) )
1995   ROM_LOAD16_BYTE( "16906",  0x200000, 0x80000, CRC(99c6773e) SHA1(568570b607d2cbbedb39ceae5bbc479478fae4ca) )
1996   ROM_LOAD16_BYTE( "16905",  0x200001, 0x80000, CRC(3922bbe3) SHA1(4378ca900f96138b5e33265ddac56af7b45afbc8) )
1997   ROM_LOAD16_BYTE( "16908",  0x300000, 0x80000, CRC(407ec20f) SHA1(c8a909d8e9ba024a37a5af6b7920fe7023f80d49) )
1998   ROM_LOAD16_BYTE( "16907",  0x300001, 0x80000, CRC(734b0a82) SHA1(d3fb31c55e79b99040beb7c49faaf2e17b95aa87) )
1999ROM_END
2000
2001ROM_START( qrouka )
2002   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
2003   ROM_LOAD16_BYTE( "14485", 0x000000, 0x20000, CRC(fc0085f9) SHA1(0250d1e17e19b541b85198ec4207e55bfbd5c32e) )
2004   ROM_LOAD16_BYTE( "14484", 0x000001, 0x20000, CRC(f51c641c) SHA1(3f2fd0be7d58c75e88565393da5e810655413b53) )
2005
2006   ROM_REGION16_BE( 0x200000, REGION_USER1, 0)
2007   ROM_LOAD16_BYTE( "14482", 0x000000, 0x80000, CRC(7a13dd97) SHA1(bfe9950d2cd41f3f866520923c1ed7b8da1990ec) )
2008   ROM_LOAD16_BYTE( "14483", 0x100000, 0x80000, CRC(f3eb51a0) SHA1(6904830ff5e7aa5f016e115572fb6da678896ede) )
2009ROM_END
2010
2011ROM_START( mahmajn )
2012   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
2013   ROM_LOAD16_BYTE( "epr14813.bin", 0x000000, 0x20000, CRC(ea38cf4b) SHA1(118ab2e0ae20a4db5e619945dfbb3f200de3979c) )
2014   ROM_LOAD16_BYTE( "epr14812.bin", 0x000001, 0x20000, CRC(5a3cb4a7) SHA1(c0f21282140e8e6e927664f5f2b90525ae0207e9) )
2015
2016   ROM_REGION16_BE( 0x400000, REGION_USER1, 0)
2017   ROM_LOAD16_BYTE( "mpr14820.bin", 0x000000, 0x80000, CRC(8d2a03d3) SHA1(b3339bcd101bcfe042e2a1cfdc8baef0a86624df) )
2018   ROM_LOAD16_BYTE( "mpr14819.bin", 0x000001, 0x80000, CRC(e84c4827) SHA1(54741295e1bdca7d0c78eb795a68b92212d43b2e) )
2019   ROM_LOAD16_BYTE( "mpr14822.bin", 0x100000, 0x80000, CRC(7c3dcc51) SHA1(a199c2c71cda44a2c8755074c1007d83c8d45d2d) )
2020   ROM_LOAD16_BYTE( "mpr14821.bin", 0x100001, 0x80000, CRC(bd8dc543) SHA1(fd50b14fa73307a62dc0b522cfedb8b3332c407e) )
2021   ROM_LOAD16_BYTE( "mpr14824.bin", 0x200000, 0x80000, CRC(38311933) SHA1(237d9a8ffe14ba9ec371bb571d7c9e74a93fe1f3) )
2022   ROM_LOAD16_BYTE( "mpr14823.bin", 0x200001, 0x80000, CRC(4c8d4550) SHA1(be8717d4080ce932fc8272ebe54e2b0a60b20edd) )
2023   ROM_LOAD16_BYTE( "mpr14826.bin", 0x300000, 0x80000, CRC(c31b8805) SHA1(b446388c83af2e14300b0c4248470d3a8c504f2c) )
2024   ROM_LOAD16_BYTE( "mpr14825.bin", 0x300001, 0x80000, CRC(191080a1) SHA1(407c1c5fa4c76732e8a444860094542e90a1e8e8) )
2025ROM_END
2026
2027ROM_START( mahmajn2 )
2028   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
2029   ROM_LOAD16_BYTE( "epr16799.bin", 0x000000, 0x20000, CRC(3a34cf75) SHA1(d22bf6334668af29167cf4244d18f9cd2e7ff7d6) )
2030   ROM_LOAD16_BYTE( "epr16798.bin", 0x000001, 0x20000, CRC(662923fa) SHA1(dcd3964d899d3f34dab22ffcd1a5af895804fae1) )
2031
2032   ROM_REGION16_BE( 0x400000, REGION_USER1, 0)
2033   ROM_LOAD16_BYTE( "mpr16801.bin", 0x000000, 0x80000, CRC(74855a17) SHA1(d2d8e7da7b261e7cb64605284d2c78fbd1465b69) )
2034   ROM_LOAD16_BYTE( "mpr16800.bin", 0x000001, 0x80000, CRC(6dbc1e02) SHA1(cce5734243ff171759cecb5c05c12dc743a25c1d) )
2035   ROM_LOAD16_BYTE( "mpr16803.bin", 0x100000, 0x80000, CRC(9b658dd6) SHA1(eaaae289a3555aa6a92f57eea964dbbf48c5c2a4) )
2036   ROM_LOAD16_BYTE( "mpr16802.bin", 0x100001, 0x80000, CRC(b4723225) SHA1(acb8923c7d9908b1112f8d1f2512f18236915e5d) )
2037   ROM_LOAD16_BYTE( "mpr16805.bin", 0x200000, 0x80000, CRC(d15528df) SHA1(bda1dd5c98867c2e7666380bca0bc7eef8022fbc) )
2038   ROM_LOAD16_BYTE( "mpr16804.bin", 0x200001, 0x80000, CRC(a0de08e2) SHA1(2c36b66e74b88fb076e2eaa250c6d06ee0b4ac88) )
2039   ROM_LOAD16_BYTE( "mpr16807.bin", 0x300000, 0x80000, CRC(816188bb) SHA1(76b2690a6156766a1af94f01f6de1209b7756b2c) )
2040   ROM_LOAD16_BYTE( "mpr16806.bin", 0x300001, 0x80000, CRC(54b353d3) SHA1(40632e4571b44ee215b5a1f7aab9d89c460a5c9e) )
2041ROM_END
2042
2043ROM_START( bnzabros )
2044   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
2045   ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
2046   ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
2047
2048   ROM_REGION16_BE( 0x200000, REGION_USER1, 0)
2049   ROM_LOAD16_BYTE( "mpr-13188-h.2",  0x000000, 0x80000, CRC(d3802294) SHA1(7608e71e8ef398ac24dbf851994253bca5ace625) )
2050   ROM_LOAD16_BYTE( "mpr-13187-h.1",  0x000001, 0x80000, CRC(e3d8c5f7) SHA1(5b1e8646debee2f2ef272ddd3320b0a17192fbbe) )
2051   ROM_LOAD16_BYTE( "mpr-13190.4",    0x100000, 0x40000, CRC(0b4df388) SHA1(340478bba82069ab745d6d8703e6801411fd2fc4) )
2052   ROM_RELOAD ( 0x180000, 0x40000)
2053   ROM_LOAD16_BYTE( "mpr-13189.3",    0x100001, 0x40000, CRC(5ea5a2f3) SHA1(514b5446303c50aeb1d6d10d0a3f210da2577e16) )
2054   ROM_RELOAD ( 0x180001, 0x40000)
2055
2056   ROM_REGION( 0x1c2000, REGION_USER2, 0)
2057   ROM_LOAD( "ds3-5000-07d.img",        0x000000, 0x1c2000, CRC(ea7a3302) SHA1(5f92efb2e1135c1f3eeca38ba5789739a22dbd11) ) /* Region letter needs to be verfied */
2058ROM_END
2059
2060ROM_START( bnzabrsj )
2061   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
2062   ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
2063   ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
2064
2065   ROM_REGION16_BE( 0x200000, REGION_USER1, 0)
2066   ROM_LOAD16_BYTE( "mpr-13188-h.2",  0x000000, 0x80000, CRC(d3802294) SHA1(7608e71e8ef398ac24dbf851994253bca5ace625) )
2067   ROM_LOAD16_BYTE( "mpr-13187-h.1",  0x000001, 0x80000, CRC(e3d8c5f7) SHA1(5b1e8646debee2f2ef272ddd3320b0a17192fbbe) )
2068   ROM_LOAD16_BYTE( "mpr-13190.4",    0x100000, 0x40000, CRC(0b4df388) SHA1(340478bba82069ab745d6d8703e6801411fd2fc4) )
2069   ROM_RELOAD ( 0x180000, 0x40000)
2070   ROM_LOAD16_BYTE( "mpr-13189.3",    0x100001, 0x40000, CRC(5ea5a2f3) SHA1(514b5446303c50aeb1d6d10d0a3f210da2577e16) )
2071   ROM_RELOAD ( 0x180001, 0x40000)
2072
2073   ROM_REGION( 0x1c2000, REGION_USER2, 0)
2074   ROM_LOAD( "ds3-5000-07b.img",        0x000000, 0x1c2000, CRC(efa7f2a7) SHA1(eb905bff88fa40324fb92b91ac8a5878648c26e5) )
2075ROM_END
2076
2077ROM_START( quizmeku ) // Quiz Mekuromeku Story
2078    ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
2079    ROM_LOAD16_BYTE( "epr15343.ic2", 0x000000, 0x20000, CRC(c72399a7) SHA1(bfbf0079ea63f89bca4ce9081aed5d5c1d9d169a) )
2080    ROM_LOAD16_BYTE( "epr15342.ic1", 0x000001, 0x20000, CRC(0968ac84) SHA1(4e1170ac123adaec32819754b5075531ff1925fe) )
2081
2082    ROM_REGION16_BE( 0x400000, REGION_USER1, 0)
2083    ROM_LOAD16_BYTE( "epr15345.ic5", 0x000000, 0x80000, CRC(88030b5d) SHA1(d2feeedb9a64c3dc8dd25716209f945d12fa9b53) )
2084    ROM_LOAD16_BYTE( "epr15344.ic4", 0x000001, 0x80000, CRC(dd11b382) SHA1(2b0f49fb307a9aba0f295de64782ee095c557170) )
2085    ROM_LOAD16_BYTE( "mpr15347.ic7", 0x100000, 0x80000, CRC(0472677b) SHA1(93ae57a2817b6b54c99814fca28ef51f7ff5e559) )
2086    ROM_LOAD16_BYTE( "mpr15346.ic6", 0x100001, 0x80000, CRC(746d4d0e) SHA1(7863abe36126684772a4459d5b6f3b24670ec02b) )
2087    ROM_LOAD16_BYTE( "mpr15349.ic9", 0x200000, 0x80000, CRC(770eecf1) SHA1(86cc5b4a325198dc1da1446ecd8e718415b7998a) )
2088    ROM_LOAD16_BYTE( "mpr15348.ic8", 0x200001, 0x80000, CRC(7666e960) SHA1(f3f88d5c8318301a8c73141de60292f8349ac0ce) )
2089ROM_END
2090
2091ROM_START( sspirits )
2092   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
2093   ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
2094   ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
2095
2096   ROM_REGION( 0x1c2000, REGION_USER2, 0)
2097   ROM_LOAD( "ds3-5000-02-.img",         0x000000, 0x1c2000, CRC(cefbda69) SHA1(5b47ae0f1584ce1eb697246273ba761bd9e981c1)  )
2098ROM_END
2099
2100ROM_START( sspiritj )
2101   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
2102   ROM_LOAD16_BYTE( "epr-11339.ic2", 0x000000, 0x20000, CRC(75130e73) SHA1(e079739f4a3da3807aac570442c5afef1a7d7b0e) )
2103   ROM_LOAD16_BYTE( "epr-11338.ic1", 0x000001, 0x20000, CRC(7d4a7ff3) SHA1(3d3af04d990d232ba0a8fe155de59bc632a0a461) )
2104
2105   ROM_REGION( 0x1d6000, REGION_USER2, 0)
2106   ROM_LOAD( "ds3-5000-02-rev-a.img",         0x000000, 0x1d6000, CRC(0385470f) SHA1(62c1bfe3a88b2dee44629809e08b4b8a5770eaab)  )
2107ROM_END
2108
2109ROM_START( sspirtfc )
2110   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
2111   ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
2112   ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
2113
2114   ROM_REGION( 0x2000, REGION_USER3, 0 )   /* decryption key */
2115   ROM_LOAD( "317-0058-02c.key", 0x0000, 0x2000,  CRC(ebae170e) SHA1(b6d1e1b6943a35b96e98e426ecb39bb5a42fb643) )
2116
2117   ROM_REGION( 0x1c2000, REGION_USER2, 0)
2118   ROM_LOAD( "ds3-5000-02c.img",         0x000000, 0x1c2000, NO_DUMP )
2119ROM_END
2120
2121ROM_START( sgmast )
2122   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
2123   ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
2124   ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
2125
2126   ROM_REGION( 0x2000, REGION_USER3, 0 )   /* decryption key */
2127   ROM_LOAD( "317-0058-05d.key", 0x0000, 0x2000, NO_DUMP )
2128
2129   ROM_REGION( 0x1c2000, REGION_USER2, 0)
2130   /* not sure which of these images is best */
2131   ROM_LOAD( "ds3-5000-05d.img",      0x000000, 0x1c2000, CRC(e9a69f93) SHA1(dc15e47ed78373688c1fab72a9605528068ad702) )
2132   ROM_LOAD( "ds3-5000-05d_alt.img",  0x000000, 0x1c2000, CRC(e71a8ebf) SHA1(60feb0af1cfc0508c8d68c8572495eec1763dc93) )
2133   ROM_LOAD( "ds3-5000-05d_alt2.img", 0x000000, 0x1c2000, CRC(460bdcd5) SHA1(49b7384ac5742b45b7369f220f33f04ef955e992) )
2134
2135ROM_END
2136
2137ROM_START( sgmastc )
2138   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
2139   ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
2140   ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
2141
2142   ROM_REGION( 0x2000, REGION_USER3, 0 )   /* decryption key */
2143   ROM_LOAD( "317-0058-05c.key", 0x0000, 0x2000, CRC(ae0eabe5) SHA1(692d7565bf9c5b32cc80bb4bd88c9193aa04cbb0) )
2144
2145   ROM_REGION( 0x1c2000, REGION_USER2, 0)
2146   ROM_LOAD( "ds3-5000-05c.img",      0x000000, 0x1c2000, CRC(06c4f834) SHA1(5e178ed0edff7721c93f76da2e03ae188dc5efa4) )
2147ROM_END
2148
2149ROM_START( sgmastj )
2150   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
2151   ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
2152   ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
2153
2154   ROM_REGION( 0x2000, REGION_USER3, 0 )   /* decryption key */
2155   ROM_LOAD( "317-0058-05b.key", 0x0000, 0x2000, CRC(adc0c83b) SHA1(2328d82d5057062eeb0072fd57f0422218cf24fc) )
2156
2157   ROM_REGION( 0x1c2000, REGION_USER2, 0)
2158   ROM_LOAD( "ds3-5000-05b.img",      0x000000, 0x1c2000,  CRC(a136668c) SHA1(7203f9d11023605a0a4b52a4be330785c8f7b623) )
2159ROM_END
2160
2161ROM_START( qsww )
2162   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
2163   ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
2164   ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
2165
2166   ROM_REGION( 0x2000, REGION_USER3, 0 )   /* decryption key */
2167   ROM_LOAD( "317-0058-08b.key", 0x0000, 0x2000,  CRC(fe0a336a) SHA1(f7a5b2c1a057d0bb8c1ae0453c58aa8f5fb731b9) )
2168
2169   ROM_REGION( 0x1c2000, REGION_USER2, 0)
2170   ROM_LOAD( "ds3-5000-08b.img",    0x000000, 0x1c2000, CRC(5a886d38) SHA1(2e974a9ffe3534da4fb117c579b8b0e61a63542c) )
2171ROM_END
2172
2173ROM_START( gground )
2174   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
2175   ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
2176   ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
2177
2178   ROM_REGION( 0x2000, REGION_USER3, 0 )   /* decryption key */
2179   ROM_LOAD( "317-0058-03c.key", 0x0000, 0x2000,  CRC(e1785bbd) SHA1(b4bebb2829299f1c0815d6a5f317a2526b322f63) ) /* Region letter needs to be verfied */
2180
2181   ROM_REGION( 0x1c2000, REGION_USER2, 0)
2182   ROM_LOAD( "ds3-5000-03c.img",         0x000000, 0x1c2000, CRC(5c5910f2) SHA1(9ed564a03c0d4ca4a207f3ecfb7336c6cbcaa70f) ) /* Region letter needs to be verfied */
2183ROM_END
2184
2185ROM_START( ggroundj )
2186   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
2187   ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
2188   ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
2189
2190   ROM_REGION( 0x2000, REGION_USER3, 0 )   /* decryption key */
2191   ROM_LOAD( "317-0058-03b.key", 0x0000, 0x2000,  CRC(84aecdba) SHA1(ceddf967359a6e76543fe1ab00be53d0a11fe1ab) )
2192
2193   ROM_REGION( 0x1c2000, REGION_USER2, 0)
2194   ROM_LOAD( "ds3-5000-03b.img",         0x000000, 0x1c2000, CRC(7200dac9) SHA1(07cf33bf2a0da36e3852de409959f30128cdbf77) )
2195ROM_END
2196
2197ROM_START( crkdown )
2198   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
2199   ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
2200   ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
2201
2202   ROM_REGION( 0x2000, REGION_USER3, 0 )   /* decryption key */
2203   ROM_LOAD( "317-0058-04c.key", 0x0000, 0x2000,  CRC(16e978cc) SHA1(0e1482b5efa93b732d4cf0990919cb3fc903dca7) )
2204
2205   ROM_REGION( 0x1c2000, REGION_USER2, 0)
2206   ROM_LOAD( "ds3-5000-04c.img",    0x000000, 0x1c2000, CRC(5edc01a5) SHA1(8eb1bf41f533d16c12930f5831f8bccd4d8de4f7) )
2207ROM_END
2208
2209ROM_START( crkdownu )
2210   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
2211   ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
2212   ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
2213
2214   ROM_REGION( 0x2000, REGION_USER3, 0 )   /* decryption key */
2215   ROM_LOAD( "317-0058-04d.key", 0x0000, 0x2000,  CRC(934ac358) SHA1(73418e22c9d201bc3fec5c63284858958c010e05) )
2216
2217   ROM_REGION( 0x1c2000, REGION_USER2, 0)
2218   ROM_LOAD( "ds3-5000-04d.img",    0x000000, 0x1c2000, CRC(8679032c) SHA1(887b245a70652897fbda736b60e81a123866ec12) )
2219ROM_END
2220
2221ROM_START( crkdownj )
2222   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
2223   ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
2224   ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
2225
2226   ROM_REGION( 0x2000, REGION_USER3, 0 )   /* decryption key */
2227   ROM_LOAD( "317-0058-04b.key", 0x0000, 0x2000,  CRC(4a99a202) SHA1(d7375f09e7246ecd60ba0e48f049e9e252af92a8) )
2228
2229   ROM_REGION( 0x1c2000, REGION_USER2, 0)
2230   ROM_LOAD( "ds3-5000-04b.img",    0x000000, 0x1c2000, CRC(5daa1a9a) SHA1(ce2f07b83b607bbbdb70f1ae344c1d897d601809) )
2231ROM_END
2232
2233ROM_START( dcclub )
2234   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
2235   ROM_LOAD16_BYTE( "epr13948.bin", 0x000000, 0x20000, CRC(d6a031c8) SHA1(45b7e3cd2c7412e24f547cd4185166199d3938d5) )
2236   ROM_LOAD16_BYTE( "epr13947.bin", 0x000001, 0x20000, CRC(7e3cff5e) SHA1(ff8cb776d2491796feeb8892c7e644e590438945) )
2237
2238   ROM_REGION16_BE( 0x200000, REGION_USER1, 0)
2239   ROM_LOAD16_BYTE( "epr-15345.2",  0x000000, 0x80000, CRC(d9e120c2) SHA1(b18b76733078d8534c6f0d8950632ab51e6a10ab) )
2240   ROM_LOAD16_BYTE( "epr-15344.1",  0x000001, 0x80000, CRC(8f8b9f74) SHA1(de6b923118bea60197547ad016cb5d5e1a8f372b) )
2241   ROM_LOAD16_BYTE( "mpr-14097-t.4",0x100000, 0x80000, CRC(4bd74cae) SHA1(5aa90bd5d2b8e2338ef0fe41d1f794e8d51321e1) )
2242   ROM_LOAD16_BYTE( "mpr-14096-t.3",0x100001, 0x80000, CRC(38d96502) SHA1(c68b3c5c83fd0839c3f6f81189c310ec19bdf1c4) )
2243ROM_END
2244
2245ROM_START( dcclubj )
2246   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
2247   ROM_LOAD16_BYTE( "epr13948.bin", 0x000000, 0x20000, CRC(d6a031c8) SHA1(45b7e3cd2c7412e24f547cd4185166199d3938d5) )
2248   ROM_LOAD16_BYTE( "epr13947.bin", 0x000001, 0x20000, CRC(7e3cff5e) SHA1(ff8cb776d2491796feeb8892c7e644e590438945) )
2249
2250   ROM_REGION16_BE( 0x200000, REGION_USER1, 0)
2251   ROM_LOAD16_BYTE( "epr-14095a.2", 0x000000, 0x80000, CRC(88d184e9) SHA1(519F3A22E1619DE9D5F13A45B85EBD249EBFA979) )
2252   ROM_LOAD16_BYTE( "epr-14094a.1", 0x000001, 0x80000, CRC(7dd2b7d4) SHA1(C7EAF9E2700E0C55F7E867F5CD3FFAA5AAE97956) )
2253   ROM_LOAD16_BYTE( "mpr-14097-t.4",0x100000, 0x80000, CRC(4bd74cae) SHA1(5aa90bd5d2b8e2338ef0fe41d1f794e8d51321e1) )
2254   ROM_LOAD16_BYTE( "mpr-14096-t.3",0x100001, 0x80000, CRC(38d96502) SHA1(c68b3c5c83fd0839c3f6f81189c310ec19bdf1c4) )
2255ROM_END
2256
2257ROM_START( dcclubfd )
2258   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
2259   ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
2260   ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
2261
2262   ROM_REGION( 0x2000, REGION_USER3, 0 )   /* decryption key */
2263   ROM_LOAD( "317-0058-09d.key", 0x0000, 0x2000, CRC(a91ebffb) SHA1(70b8b4272ca456491f254d115b434bb4ce73f049) )
2264
2265   ROM_REGION( 0x1c2000, REGION_USER2, 0)
2266   ROM_LOAD( "ds3-5000-09d.img", 0x000000, 0x1c2000,  CRC(69870887) SHA1(e47a997c2c783bf6670ab213ebe2ee35492eba34) )
2267ROM_END
2268
2269ROM_START( roughrac )
2270   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* FD1094 code */
2271   ROM_LOAD16_BYTE( "epr-12187.ic2", 0x000000, 0x20000, CRC(e83783f3) SHA1(4b3b32df7de85aef9cd77c8a4ffc17e10466b638) )
2272   ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
2273
2274   ROM_REGION( 0x2000, REGION_USER3, 0 )   /* decryption key */
2275   ROM_LOAD( "317-0058-06b.key",    0x000000, 0x2000, CRC(6a5bf536) SHA1(3fc3e93ce8a47d7ee86da889efad2e7eca6e2ee9) )
2276
2277   ROM_REGION( 0x1c2000, REGION_USER2, 0)
2278   ROM_LOAD( "ds3-5000-06b.img",    0x000000, 0x1c2000, CRC(a7fb2149) SHA1(c04266ae31700b085ab45606aed83019a563de70) )
2279ROM_END
2280
2281/* I think the letter after the disk code is the region
2282           'b' = Japan
2283           'c' = europe?
2284           'd' = US
2285*/
2286
2287/*************************************
2288 *
2289 *  Game driver(s)
2290 *
2291 *************************************/
2292
2293/* Disk Based Games */
2294/* 01 */GAME( 1988, hotrod,   0,        system24, hotrod,   hotrod,   ROT0,   "Sega", "Hot Rod (World, 3 Players, Turbo set 1, Floppy Based)", 0 )
2295/* 01 */GAME( 1988, hotroda,  hotrod,   system24, hotrod,   hotrod,   ROT0,   "Sega", "Hot Rod (World, 3 Players, Turbo set 2, Floppy Based)", GAME_NO_SOUND )
2296/* 01 */GAME( 1988, hotrodj,  hotrod,   system24, hotrodj,  hotrod,   ROT0,   "Sega", "Hot Rod (Japan, 4 Players, Floppy Based)", GAME_NO_SOUND )
2297/* 02 */GAME( 1988, sspirits, 0,        system24, sspirits, sspirits, ROT270, "Sega", "Scramble Spirits (World, Floppy Based)", 0 )
2298/* 02 */GAME( 1988, sspiritj, sspirits, system24, sspirits, sspiritj, ROT270, "Sega", "Scramble Spirits (Japan, Floppy DS3-5000-02-REV-A Based)", 0 )
2299/* 02 */GAME( 1988, sspirtfc, sspirits, system24, sspirits, sspirits, ROT270, "Sega", "Scramble Spirits (World set 2?, Floppy Based, FD1094 317-0058-02c)",GAME_NOT_WORKING ) /* MISSING disk image */
2300/* 03 */GAME( 1988, gground,  0,        system24, gground,  gground,  ROT270, "Sega", "Gain Ground (World, 3 Players, Floppy Based, FD1094 317-0058-03c?)", 0 )
2301/* 03 */GAME( 1988, ggroundj, gground,  system24, gground,  gground,  ROT270, "Sega", "Gain Ground (Japan, 2 Players, Floppy Based, FD1094 317-0058-03b)", 0 )
2302/* 04 */GAME( 1989, crkdown,  0,        system24, crkdown,  crkdown,  ROT0,   "Sega", "Crack Down (World,Floppy Based, FD1094 317-0058-04c)", GAME_IMPERFECT_GRAPHICS ) // clipping probs / solid layer probs? (radar display)
2303/* 04 */GAME( 1989, crkdownu, crkdown,  system24, crkdown,  crkdown,  ROT0,   "Sega", "Crack Down (US,Floppy Based, FD1094 317-0058-04d)", GAME_IMPERFECT_GRAPHICS ) // clipping probs / solid layer probs? (radar display)
2304/* 04 */GAME( 1989, crkdownj, crkdown,  system24, crkdown,  crkdown,  ROT0,   "Sega", "Crack Down (Japan,Floppy Based, FD1094 317-0058-04b)", GAME_IMPERFECT_GRAPHICS ) // clipping probs / solid layer probs? (radar display)
2305/* 05 */GAME( 1989, sgmast,   0,        system24, sgmast,   sgmast,   ROT0,   "Sega", "Super Masters Golf (World?, Floppy Based, FD1094 317-0058-05d?)", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION ) // NOT decrypted
2306/* 05 */GAME( 1989, sgmastc,  sgmast,   system24, sgmast,   sgmast,   ROT0,   "Sega", "Jumbo Ozaki Super Masters Golf (World, Floppy Based, FD1094 317-0058-05c)", GAME_IMPERFECT_GRAPHICS ) // some gfx offset / colour probs?
2307/* 05 */GAME( 1989, sgmastj,  sgmast,   system24, sgmastj,  sgmast,   ROT0,   "Sega", "Jumbo Ozaki Super Masters Golf (Japan, Floppy Based, FD1094 317-0058-05b)", GAME_IMPERFECT_GRAPHICS ) // some gfx offset / colour probs?
2308/* 06 */GAME( 1990, roughrac, 0,        system24, roughrac, roughrac, ROT0,   "Sega", "Rough Racer (Japan, Floppy Based, FD1094 317-0058-06b)", 0 )
2309/* 07 */GAME( 1990, bnzabros, 0,        system24, bnzabros, bnzabros, ROT0,   "Sega", "Bonanza Bros (US, Floppy DS3-5000-07d? Based)", 0 )
2310/* 07 */GAME( 1990, bnzabrsj, bnzabros, system24, bnzabros, bnzabros, ROT0,   "Sega", "Bonanza Bros (Japan, Floppy DS3-5000-07b Based)", 0 )
2311/* 08 */GAME( 1991, qsww,     0,        system24, qsww,     qsww,     ROT0,   "Sega", "Quiz Syukudai wo Wasuremashita (Japan, Floppy Based, FD1094 317-0058-08b)", GAME_IMPERFECT_GRAPHICS ) // wrong bg colour on title
2312/* 09 */GAME( 1991, dcclubfd, dcclub,   system24, dcclub,   dcclubfd, ROT0,   "Sega", "Dynamic Country Club (US, Floppy Based, FD1094 317-0058-09d)", 0 )
2313
2314/* ROM Based */
2315GAME( 1991, dcclub,   0,        system24, dcclub,   dcclub,   ROT0,   "Sega", "Dynamic Country Club (World, ROM Based)", 0 )
2316GAME( 1991, dcclubj,  dcclub,   system24, dcclub,   dcclub,   ROT0,   "Sega", "Dynamic Country Club (Japan, ROM Based)", 0 )
2317GAME( 1992, mahmajn,  0,        system24, mahmajn,  mahmajn,  ROT0,   "Sega", "Tokoro San no MahMahjan (Japan, ROM Based)", 0 )
2318GAME( 1994, qgh,      0,        system24, qgh,      qgh,      ROT0,   "Sega", "Quiz Ghost Hunter (Japan, ROM Based)", 0 )
2319GAME( 1994, quizmeku, 0,        system24, quizmeku, quizmeku, ROT0,   "Sega", "Quiz Mekurumeku Story (Japan, ROM Based)", 0 )
2320GAME( 1994, qrouka,   0,        system24, qrouka,   qrouka,   ROT0,   "Sega", "Quiz Rouka Ni Tattenasai (Japan, ROM Based)", 0 )
2321GAME( 1994, mahmajn2, 0,        system24, mahmajn,  mahmajn2, ROT0,   "Sega", "Tokoro San no MahMahjan 2 (Japan, ROM Based)", 0 )
src/mame/drivers/mustache.c
r1355r1356
189189static void assert_irq(void)
190190{
191191   cpunum_set_input_line(0, 0, ASSERT_LINE);
192   timer_set(ATTOTIME_IN_CYCLES(14288, 0), 0, clear_irq_cb);
192   timer_set(ATTOTIME_IN_CYCLES(14288, 0), NULL, 0, clear_irq_cb);
193193       /* Timing here is an educated GUESS, Z80 /INT must stay high so the irq
194194          fires no less than TWICE per frame, else game doesn't work right.
195195      6000000 / 56.747 = 105732.4616 cycles per frame, we'll call it A
src/mame/drivers/segas16a.c
r1355r1356
240240
241241   /* if we have a fake i8751 handler, disable the actual 8751 */
242242   if (i8751_vblank_hook != NULL)
243      timer_call_after_resynch(0, suspend_i8751);
243      timer_call_after_resynch(NULL, 0, suspend_i8751);
244244}
245245
246246
r1355r1356
285285         /* the port C handshaking signals control the Z80 NMI, */
286286         /* so we have to sync whenever we access this PPI */
287287         if (ACCESSING_LSB)
288            timer_call_after_resynch(((offset & 3) << 8) | (data & 0xff), delayed_ppi8255_w);
288            timer_call_after_resynch(NULL, ((offset & 3) << 8) | (data & 0xff), delayed_ppi8255_w);
289289         return;
290290   }
291291   logerror("%06X:standard_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask ^ 0xffff);
src/mame/drivers/neogeo.c
r1355r1356
272272
273273static void create_interrupt_timers(void)
274274{
275   display_position_interrupt_timer = timer_alloc(display_position_interrupt_callback);
276   display_position_vblank_timer = timer_alloc(display_position_vblank_callback);
277   vblank_interrupt_timer = timer_alloc(vblank_interrupt_callback);
275   display_position_interrupt_timer = timer_alloc(display_position_interrupt_callback, NULL);
276   display_position_vblank_timer = timer_alloc(display_position_vblank_callback, NULL);
277   vblank_interrupt_timer = timer_alloc(vblank_interrupt_callback, NULL);
278278}
279279
280280
src/mame/drivers/konamigx.c
r1355r1356
12681268   16*128
12691269};
12701270
1271gfx_layout t1_charlayout6 =
1271static gfx_layout t1_charlayout6 =
12721272{
12731273   16, 16,
12741274   RGN_FRAC(1,1),
r1355r1356
12801280   16*16*6
12811281};
12821282
1283gfx_layout t1_charlayout8 =
1283static gfx_layout t1_charlayout8 =
12841284{
12851285   16, 16,
12861286   RGN_FRAC(1,1),
r1355r1356
35263526   snd020_hack = 0;
35273527   resume_trigger = 0;
35283528
3529   dmadelay_timer = timer_alloc(dmaend_callback);
3529   dmadelay_timer = timer_alloc(dmaend_callback, NULL);
35303530
35313531   i = match = 0;
35323532   while ((gameDefs[i].cfgport != -1) && (!match))
src/mame/drivers/segahang.c
r1355r1356
111111
112112   /* if we have a fake i8751 handler, disable the actual 8751 */
113113   if (i8751_vblank_hook != NULL)
114      timer_call_after_resynch(0, suspend_i8751);
114      timer_call_after_resynch(NULL, 0, suspend_i8751);
115115
116116   /* reset global state */
117117   adc_select = 0;
r1355r1356
171171         case 0x0000/2: /* PPI @ 4B */
172172            /* the port C handshaking signals control the Z80 NMI, */
173173            /* so we have to sync whenever we access this PPI */
174            timer_call_after_resynch(((offset & 3) << 8) | (data & 0xff), delayed_ppi8255_w);
174            timer_call_after_resynch(NULL, ((offset & 3) << 8) | (data & 0xff), delayed_ppi8255_w);
175175            return;
176176
177177         case 0x3000/2: /* PPI @ 4C */
r1355r1356
217217         case 0x0000/2:
218218            /* the port C handshaking signals control the Z80 NMI, */
219219            /* so we have to sync whenever we access this PPI */
220            timer_call_after_resynch(((offset & 3) << 8) | (data & 0xff), delayed_ppi8255_w);
220            timer_call_after_resynch(NULL, ((offset & 3) << 8) | (data & 0xff), delayed_ppi8255_w);
221221            return;
222222
223223         case 0x0020/2: /* PPI @ 4C */
r1355r1356
890890   MDRV_CPU_PROGRAM_MAP(sound_map_2203,0)
891891   MDRV_CPU_IO_MAP(sound_portmap_2203,0)
892892
893   /* soud hardware */
893   /* sound hardware */
894894   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
895895
896896   MDRV_SOUND_ADD(YM2203, MASTER_CLOCK_8MHz/2)
r1355r1356
918918   MDRV_CPU_PROGRAM_MAP(sound_map_2151,0)
919919   MDRV_CPU_IO_MAP(sound_portmap_2203x2,0)
920920
921   /* soud hardware */
921   /* sound hardware */
922922   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
923923
924924   MDRV_SOUND_ADD(YM2203, MASTER_CLOCK_8MHz/2)
r1355r1356
956956   MDRV_CPU_PROGRAM_MAP(sound_map_2151,0)
957957   MDRV_CPU_IO_MAP(sound_portmap_2151,0)
958958
959   /* soud hardware */
959   /* sound hardware */
960960   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
961961
962962   MDRV_SOUND_ADD(YM2151, MASTER_CLOCK_8MHz/2)
r1355r1356
10331033/**************************************************************************************************************************
10341034 **************************************************************************************************************************
10351035 **************************************************************************************************************************
1036    Hang On
1036    Hang On (Rev A)
10371037    CPU: 68000 (317-????)
10381038
10391039     ASSY CPU BD 834-5704-01
r1355r1356
10441044*/
10451045ROM_START( hangon )
10461046   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
1047   ROM_LOAD16_BYTE( "epr-6918.ic22", 0x000000, 0x8000, CRC(20b1c2b0) SHA1(01b4f5105e2bbeb6ec6dbd18bfb728e3a973e0ca) ) /* Manual shows Rev A roms (Currently not dumped) */
1048   ROM_LOAD16_BYTE( "epr-6916.ic8",  0x000001, 0x8000, CRC(7d9db1bf) SHA1(952ee3e7a0d57ec1bb3385e0e6675890b8378d31) )
1049   ROM_LOAD16_BYTE( "epr-6917.ic20", 0x010000, 0x8000, CRC(fea12367) SHA1(9a1ce5863c562160b657ad948812b43f42d7d0cc) )
1050   ROM_LOAD16_BYTE( "epr-6915.ic6",  0x010001, 0x8000, CRC(ac883240) SHA1(f943341ae13e062f3d12c6221180086ce8bdb8c4) )
1047   ROM_LOAD16_BYTE( "epr-6918a.ic22", 0x000000, 0x8000, CRC(20b1c2b0) SHA1(01b4f5105e2bbeb6ec6dbd18bfb728e3a973e0ca) )
1048   ROM_LOAD16_BYTE( "epr-6916a.ic8",  0x000001, 0x8000, CRC(7d9db1bf) SHA1(952ee3e7a0d57ec1bb3385e0e6675890b8378d31) )
1049   ROM_LOAD16_BYTE( "epr-6917a.ic20", 0x010000, 0x8000, CRC(fea12367) SHA1(9a1ce5863c562160b657ad948812b43f42d7d0cc) )
1050   ROM_LOAD16_BYTE( "epr-6915a.ic6",  0x010001, 0x8000, CRC(ac883240) SHA1(f943341ae13e062f3d12c6221180086ce8bdb8c4) )
10511051
10521052   ROM_REGION( 0x40000, REGION_CPU2, 0 ) /* second 68000 CPU */
10531053   ROM_LOAD16_BYTE( "epr-6920.ic63", 0x0000, 0x8000, CRC(1c95013e) SHA1(8344ac953477279c2c701f984d98292a21dd2f7d) )
r1355r1356
10921092/**************************************************************************************************************************
10931093 **************************************************************************************************************************
10941094 **************************************************************************************************************************
1095    Hang On
1096    CPU: 68000 (317-????)
1097
1098     ASSY CPU BD 834-5704-01
1099     ASSY CONTROL BD 834-5668
1100     ASSY ROM BD 834-5669
1101     ASSY SOUND BD 834-5670
1102
1103*/
1104ROM_START( hangon1 )
1105   ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */
1106   ROM_LOAD16_BYTE( "epr-6918.ic22", 0x000000, 0x8000, CRC(0bf4f2ac) SHA1(26c5bb6fe805644a8d427ad77814f4b0b1128b1a) )
1107   ROM_LOAD16_BYTE( "epr-6916.ic8",  0x000001, 0x8000, CRC(06c21c8a) SHA1(f06f21ff272a803c72e5041534053494f055e466) )
1108   ROM_LOAD16_BYTE( "epr-6917.ic20", 0x010000, 0x8000, CRC(f48a6cbc) SHA1(6437efaeb0e4cb727c03eb83678a9e107d244af1) )
1109   ROM_LOAD16_BYTE( "epr-6915.ic6",  0x010001, 0x8000, CRC(75d3b5ee) SHA1(00948d0610f52b1b554cadde96227428e510e73e) )
1110
1111   ROM_REGION( 0x40000, REGION_CPU2, 0 ) /* second 68000 CPU */
1112   ROM_LOAD16_BYTE( "epr-6920.ic63", 0x0000, 0x8000, CRC(1c95013e) SHA1(8344ac953477279c2c701f984d98292a21dd2f7d) )
1113   ROM_LOAD16_BYTE( "epr-6919.ic51", 0x0001, 0x8000, CRC(6ca30d69) SHA1(ed933351883ebf6d9ef9428a81d09749b609cd60) )
1114
1115   ROM_REGION( 0x18000, REGION_GFX1, ROMREGION_DISPOSE ) /* tiles */
1116   ROM_LOAD( "epr-6841.ic38", 0x00000, 0x08000, CRC(54d295dc) SHA1(ad8cdb281032a2f931c2abbeb966998944683dc3) )
1117   ROM_LOAD( "epr-6842.ic23", 0x08000, 0x08000, CRC(f677b568) SHA1(636ca60bd4be9b5c2be09de8ae49db1063aa6c79) )
1118   ROM_LOAD( "epr-6843.ic7",  0x10000, 0x08000, CRC(a257f0da) SHA1(9828f8ce4ef245ffb8dbad347f9ca74ed81aa998) )
1119
1120   ROM_REGION16_BE( 0x80000, REGION_GFX2, 0 ) /* sprites */
1121   ROM_LOAD16_BYTE( "epr-6819.ic27", 0x000001, 0x8000, CRC(469dad07) SHA1(6d01c0b3506e28832928ad74d518577ff5be323b) )
1122   ROM_LOAD16_BYTE( "epr-6820.ic34", 0x000000, 0x8000, CRC(87cbc6de) SHA1(b64652e062e1b88c6f6ae8dd2ffe4533bb27ba45) )
1123   ROM_LOAD16_BYTE( "epr-6821.ic28", 0x010001, 0x8000, CRC(15792969) SHA1(b061dbf24e8b511116446794753c8b0cc49e2149) )
1124   ROM_LOAD16_BYTE( "epr-6822.ic35", 0x010000, 0x8000, CRC(e9718de5) SHA1(30e3a7d5b33504da03c5780b4a946b977e46098a) )
1125   ROM_LOAD16_BYTE( "epr-6823.ic29", 0x020001, 0x8000, CRC(49422691) SHA1(caee2a4a3f4587ae27dec330214edaa1229012af) )
1126   ROM_LOAD16_BYTE( "epr-6824.ic36", 0x020000, 0x8000, CRC(701deaa4) SHA1(053032ef886b85a4cb4753d17b3c27d228695157) )
1127   ROM_LOAD16_BYTE( "epr-6825.ic30", 0x030001, 0x8000, CRC(6e23c8b4) SHA1(b17fd7d590ed4e6616b7b4d91a47a2820248d8c7) )
1128   ROM_LOAD16_BYTE( "epr-6826.ic37", 0x030000, 0x8000, CRC(77d0de2c) SHA1(83b126ed1d463504b2702391816e6e20dcd04ffc) )
1129   ROM_LOAD16_BYTE( "epr-6827.ic31", 0x040001, 0x8000, CRC(7fa1bfb6) SHA1(a27b54c93613372f59050f0b2182d2984a8d2efe) )
1130   ROM_LOAD16_BYTE( "epr-6828.ic38", 0x040000, 0x8000, CRC(8e880c93) SHA1(8c55deec065daf09a5d1c1c1f3f3f7bc1aeaf563) )
1131   ROM_LOAD16_BYTE( "epr-6829.ic32", 0x050001, 0x8000, CRC(7ca0952d) SHA1(617d73591158ed3fea5174f7dabf0413d28de9b3) )
1132   ROM_LOAD16_BYTE( "epr-6830.ic39", 0x050000, 0x8000, CRC(b1a63aef) SHA1(5db0a1cc2d13c6cfc77044f5d7f6f99d198531ed) )
1133   ROM_LOAD16_BYTE( "epr-6845.ic18", 0x060001, 0x8000, CRC(ba08c9b8) SHA1(65ceaefa18999c468b38576c29101674d1f63e5f) )
1134   ROM_LOAD16_BYTE( "epr-6846.ic25", 0x060000, 0x8000, CRC(f21e57a3) SHA1(92ce0723e722f446c0cef9e23080a008aa9752e7) )
1135
1136   ROM_REGION( 0x8000, REGION_GFX3, 0 ) /* road gfx */
1137   ROM_LOAD( "epr-6840.ic108", 0x0000, 0x8000, CRC(581230e3) SHA1(954eab35059322a12a197bba04bf85f816132f20) )
1138
1139   ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* sound CPU */
1140   ROM_LOAD( "epr-6833.ic73", 0x00000, 0x4000, CRC(3b942f5f) SHA1(4384b5c090954e69de561dde0ef32104aa11399a) )
1141
1142   ROM_REGION( 0x10000, REGION_SOUND1, 0 ) /* Sega PCM sound data */
1143   ROM_LOAD( "epr-6831.ic5", 0x00000, 0x8000, CRC(cfef5481) SHA1(c04b302fee58f0e59a097b2be2b61e5d03df7c91) )
1144   ROM_LOAD( "epr-6832.ic6", 0x08000, 0x8000, CRC(4165aea5) SHA1(be05c6d295807af2f396a1ff72d5a3d2a1e6054d) )
1145
1146   ROM_REGION( 0x2000, REGION_PROMS, 0 ) /* zoom table */
1147   ROM_LOAD( "epr-6844.ic123", 0x0000, 0x2000, CRC(e3ec7bd6) SHA1(feec0fe664e16fac0fde61cf64b401b9b0575323) )
1148ROM_END
1149/**************************************************************************************************************************
1150 **************************************************************************************************************************
1151 **************************************************************************************************************************
10951152    Super Hang On (bootleg upgrade)
10961153    CPU: 68000 (317-????)
10971154*/
r1355r1356
16731730 *
16741731 *************************************/
16751732
1676GAME( 1985, hangon,   0,        hangon,   hangon,   hangon,   ROT0, "Sega",    "Hang-On", 0 )
1733GAME( 1985, hangon,   0,        hangon,   hangon,   hangon,   ROT0, "Sega",    "Hang-On (Rev A)", 0 )
1734GAME( 1985, hangon1,  hangon,   hangon,   hangon,   hangon,   ROT0, "Sega",    "Hang-On", 0 )
16771735GAME( 1992, shangupb, shangon,  shangupb, shangupb, hangon,   ROT0, "bootleg", "Super Hang-On (Hang-On upgrade, bootleg)", 0 )
16781736GAME( 1985, sharrier, 0,        sharrier, sharrier, sharrier, ROT0, "Sega",    "Space Harrier (Rev A, 8751 315-5163A)", 0 )
16791737GAME( 1985, sharrir1, sharrier, sharrier, sharrier, sharrier, ROT0, "Sega",    "Space Harrier (8751 315-5163)", 0 )
src/mame/drivers/thunderj.c
r1355r1356
120120static TIMER_CALLBACK( shared_sync_callback )
121121{
122122   if (--param)
123      timer_set(ATTOTIME_IN_USEC(50), param, shared_sync_callback);
123      timer_set(ATTOTIME_IN_USEC(50), NULL, param, shared_sync_callback);
124124}
125125
126126
r1355r1356
143143         if ((opcode & 0xffc0) == 0x4ac0 ||
144144            ((opcode & 0xffc0) == 0x0080 && rom_base[cpunum][ppc / 2 + 1] == 7))
145145         {
146            timer_call_after_resynch(4, shared_sync_callback);
146            timer_call_after_resynch(NULL, 4, shared_sync_callback);
147147         }
148148      }
149149   }
src/mame/drivers/parodius.c
r1355r1356
122122{
123123//  sound_nmi_enabled = 1;
124124   cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE);
125   timer_set(ATTOTIME_IN_USEC(50),0,nmi_callback);   /* kludge until the K053260 is emulated correctly */
125   timer_set(ATTOTIME_IN_USEC(50), NULL,0,nmi_callback);   /* kludge until the K053260 is emulated correctly */
126126}
127127
128128/********************************************/
src/mame/drivers/combatsc.c
r1355r1356
904904
905905static void combasc_init_common(void)
906906{
907   combasc_interleave_timer = timer_alloc(NULL);
907   combasc_interleave_timer = timer_alloc(NULL, NULL);
908908}
909909
910910static DRIVER_INIT( combasct )
src/mame/drivers/buggychl.c
r1355r1356
132132static WRITE8_HANDLER( sound_command_w )
133133{
134134   soundlatch_w(0,data);
135   timer_call_after_resynch(data,nmi_callback);
135   timer_call_after_resynch(NULL, data,nmi_callback);
136136}
137137
138138static WRITE8_HANDLER( nmi_disable_w )
src/mame/drivers/taito_f2.c
r1355r1356
800800
801801static INTERRUPT_GEN( taitof2_interrupt )
802802{
803   timer_set(ATTOTIME_IN_CYCLES(500,0),0, taitof2_interrupt6);
803   timer_set(ATTOTIME_IN_CYCLES(500,0), NULL, 0, taitof2_interrupt6);
804804   cpunum_set_input_line(0, 5, HOLD_LINE);
805805}
806806
src/mame/drivers/gpworld.c
r1355r1356
408408
409409   /* The time the IRQ line stays high is set just long enough to happen after the NMI - hacky? */
410410   cpunum_set_input_line(0, 0, ASSERT_LINE);
411   timer_set(ATTOTIME_IN_USEC(100), 0, irq_stop);
411   timer_set(ATTOTIME_IN_USEC(100), NULL, 0, irq_stop);
412412
413413   laserdisc_vsync(discinfo);
414414}
src/mame/drivers/asterix.c
r1355r1356
127127static WRITE8_HANDLER( sound_arm_nmi_w )
128128{
129129   cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE);
130   timer_set(ATTOTIME_IN_USEC(5),0,nmi_callback);
130   timer_set(ATTOTIME_IN_USEC(5), NULL,0,nmi_callback);
131131}
132132
133133static WRITE16_HANDLER( sound_irq_w )
src/mame/drivers/tubep.c
r1355r1356
352352static MACHINE_START( tubep )
353353{
354354   /* Create interrupt timer */
355   interrupt_timer = timer_alloc(tubep_scanline_callback);
355   interrupt_timer = timer_alloc(tubep_scanline_callback, NULL);
356356
357357   tubep_setup_save_state();
358358}
r1355r1356
516516static MACHINE_START( rjammer )
517517{
518518   /* Create interrupt timer */
519   interrupt_timer = timer_alloc(rjammer_scanline_callback);
519   interrupt_timer = timer_alloc(rjammer_scanline_callback, NULL);
520520
521521   tubep_setup_save_state();
522522}
src/mame/drivers/hng64.c
r1355r1356
14481448   }
14491449
14501450   cpunum_set_input_line(0, 0, ASSERT_LINE);
1451   timer_set(ATTOTIME_IN_USEC(50), 0, irq_stop);
1451   timer_set(ATTOTIME_IN_USEC(50), NULL, 0, irq_stop);
14521452}
14531453
14541454
src/mame/drivers/moo.c
r1355r1356
178178      moo_objdma(game_type);
179179
180180      // schedule DMA end interrupt (delay shortened to catch up with V-blank)
181      timer_set(ATTOTIME_IN_USEC(MOO_DMADELAY), 0, dmaend_callback);
181      timer_set(ATTOTIME_IN_USEC(MOO_DMADELAY), NULL, 0, dmaend_callback);
182182   }
183183
184184   // trigger V-blank interrupt
r1355r1356
191191   moo_objdma(game_type);
192192
193193   // schedule DMA end interrupt (delay shortened to catch up with V-blank)
194   timer_set(ATTOTIME_IN_USEC(MOO_DMADELAY), 0, dmaend_callback);
194   timer_set(ATTOTIME_IN_USEC(MOO_DMADELAY), NULL, 0, dmaend_callback);
195195
196196   // trigger V-blank interrupt
197197   cpunum_set_input_line(0, 5, HOLD_LINE);
src/mame/drivers/groundfx.c
r1355r1356
221221{
222222   /* One interrupt per input port (4 per frame, though only 2 used).
223223        1000 cycle delay is arbitrary */
224   timer_set(ATTOTIME_IN_CYCLES(1000,0),0, groundfx_interrupt5);
224   timer_set(ATTOTIME_IN_CYCLES(1000,0), NULL, 0, groundfx_interrupt5);
225225}
226226
227227static WRITE32_HANDLER( rotate_control_w )   /* only a guess that it's rotation */
src/mame/drivers/gamecstl.c
r1355r1356
1111    disk image, it's in C:\GH4\GH4.EXE.  It's UPX compressed, so unpack it before doing
1212    any forensics.  The emulator does run on Windows as new as XP Pro SP2 but you can't
1313    control it due to the lack of the custom input.
14
15    Updates 27/11/2007 (Diego Nappino):
16    The COM1 port is opened at 19200 bps, No parity, 8 bit data,1 stop bit.
17    The protocol is based on a 6 bytes frame with a leading byte valued 0x05 and a trailing one at 0x02
18    The four middle bytes are used, in negative logic (0xFF = No button pressed), to implement the inputs.
19    Each bit meaning as follows :
20
21               Byte 1         Byte 2          Byte 3        Byte 4
22       Bit 0    P1-Credit      P1-Button C     P2-Left        UNUSED
23    Bit 1    P1-Start       P1-Button D     P2-Right       UNUSED
24    Bit 2    P1-Down        P1-Button E     P2-Button A    SERVICE
25    Bit 3    P1-Up          TEST            P2-Button B    UNUSED
26    Bit 4    P1-Left        P2-Credit       P2-Button C    UNUSED
27    Bit 5    P1-Right       P2-Start        P2-Button D    UNUSED
28    Bit 6    P1-Button A    P2-Down         P2-Button E    UNUSED
29    Bit 7    P1-Button B    P2-Up           VIDEO-MODE     UNUSED
30
31    The JAMMA adaptor sends a byte frame each time an input changes. So, in example, if the P1-Button A and P1-Button B are both pressed, it will send :
32
33    0x05 0xFC 0xFF 0xFF 0xFF 0x02
34
35    And when the buttons are both released
36
37    0x05 0xFF 0xFF 0xFF 0xFF 0x02
38
1439*/
1540
1641#include "driver.h"
src/mame/drivers/cidelsa.c
r1355r1356
680680{
681681   cdp1869_configure(&destryer_CDP1869_interface);
682682
683   timer_set(ATTOTIME_IN_MSEC(200), 0, set_cpu_mode);
683   timer_set(ATTOTIME_IN_MSEC(200), NULL, 0, set_cpu_mode);
684684}
685685
686686static const CDP1869_interface draco_CDP1869_interface =
r1355r1356
699699
700700   cdp1869_configure(&draco_CDP1869_interface);
701701
702   timer_set(ATTOTIME_IN_MSEC(200), 0, set_cpu_mode);
702   timer_set(ATTOTIME_IN_MSEC(200), NULL, 0, set_cpu_mode);
703703}
704704
705705/* ROMs */
src/mame/drivers/m92.c
r1355r1356
225225   state_save_register_global(bankaddress);
226226   state_save_register_func_postload(set_m92_bank);
227227
228   scanline_timer = timer_alloc(m92_scanline_interrupt);
228   scanline_timer = timer_alloc(m92_scanline_interrupt, NULL);
229229}
230230
231231static MACHINE_RESET( m92 )
r1355r1356
330330
331331static WRITE16_HANDLER( m92_soundlatch_w )
332332{
333   timer_call_after_resynch(V30_ASSERT, setvector_callback);
333   timer_call_after_resynch(NULL, V30_ASSERT, setvector_callback);
334334   soundlatch_w(0, data & 0xff);
335335}
336336
r1355r1356
347347
348348static WRITE16_HANDLER( m92_sound_irq_ack_w )
349349{
350   timer_call_after_resynch(V30_CLEAR, setvector_callback);
350   timer_call_after_resynch(NULL, V30_CLEAR, setvector_callback);
351351}
352352
353353static WRITE16_HANDLER( m92_sound_status_w )
r1355r1356
928928static void sound_irq(int state)
929929{
930930   if (state)
931      timer_call_after_resynch(YM2151_ASSERT, setvector_callback);
931      timer_call_after_resynch(NULL, YM2151_ASSERT, setvector_callback);
932932   else
933      timer_call_after_resynch(YM2151_CLEAR, setvector_callback);
933      timer_call_after_resynch(NULL, YM2151_CLEAR, setvector_callback);
934934}
935935
936936static struct YM2151interface ym2151_interface =
r1355r1356
19201920   m92_irq_vectorbase=0x80;
19211921   m92_sprite_buffer_busy=1;
19221922
1923   setvector_callback(machine, VECTOR_INIT);
1923   setvector_callback(machine, NULL, VECTOR_INIT);
19241924   irem_cpu_decrypt(1,decryption_table);
19251925}
19261926
src/mame/drivers/vendetta.c
r1355r1356
244244{
245245   cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE );
246246
247   timer_set( ATTOTIME_IN_USEC( 25 ), 0, z80_nmi_callback );
247   timer_set( ATTOTIME_IN_USEC( 25 ), NULL, 0, z80_nmi_callback );
248248}
249249
250250static WRITE8_HANDLER( z80_irq_w )
src/mame/drivers/destroyr.c
r1355r1356
4949
5050   /* PCB supports two dials, but cab has only got one */
5151
52   timer_set(video_screen_get_time_until_pos(0, readinputport(3), 0), 0, destroyr_dial_callback);
53   timer_set(video_screen_get_time_until_pos(0, 0, 0), 0, destroyr_frame_callback);
52   timer_set(video_screen_get_time_until_pos(0, readinputport(3), 0), NULL, 0, destroyr_dial_callback);
53   timer_set(video_screen_get_time_until_pos(0, 0, 0), NULL, 0, destroyr_frame_callback);
5454}
5555
5656
5757static MACHINE_RESET( destroyr )
5858{
59   timer_set(video_screen_get_time_until_pos(0, 0, 0), 0, destroyr_frame_callback);
59   timer_set(video_screen_get_time_until_pos(0, 0, 0), NULL, 0, destroyr_frame_callback);
6060}
6161
6262
src/mame/drivers/segas16b.c
r1355r1356
10631063
10641064   /* if we have a fake i8751 handler, disable the actual 8751 */
10651065   if (i8751_vblank_hook != NULL)
1066      timer_call_after_resynch(0, suspend_i8751);
1066      timer_call_after_resynch(NULL, 0, suspend_i8751);
10671067
10681068   /* configure sprite banks */
10691069   for (i = 0; i < 16; i++)
r1355r1356
10801080static MACHINE_RESET( atomicp )
10811081{
10821082   machine_reset_system16b(machine);
1083   timer_pulse(ATTOTIME_IN_HZ(atomicp_sound_rate), 0, atomicp_sound_irq);
1083   timer_pulse(ATTOTIME_IN_HZ(atomicp_sound_rate), NULL, 0, atomicp_sound_irq);
10841084}
10851085
10861086
src/mame/drivers/fuukifg2.c
r1355r1356
524524static TIMER_CALLBACK( level_1_interrupt_callback )
525525{
526526   cpunum_set_input_line(0, 1, PULSE_LINE);
527   timer_set(video_screen_get_time_until_pos(0, 248, 0), 0, level_1_interrupt_callback);
527   timer_set(video_screen_get_time_until_pos(0, 248, 0), NULL, 0, level_1_interrupt_callback);
528528}
529529
530530
531531static TIMER_CALLBACK( vblank_interrupt_callback )
532532{
533533   cpunum_set_input_line(0, 3, PULSE_LINE);   // VBlank IRQ
534   timer_set(video_screen_get_time_until_pos(0, machine->screen[0].visarea.max_y + 1, 0), 0, vblank_interrupt_callback);
534   timer_set(video_screen_get_time_until_pos(0, machine->screen[0].visarea.max_y + 1, 0), NULL, 0, vblank_interrupt_callback);
535535}
536536
537537
r1355r1356
545545
546546static MACHINE_START( fuuki16 )
547547{
548   raster_interrupt_timer = timer_alloc(raster_interrupt_callback);
548   raster_interrupt_timer = timer_alloc(raster_interrupt_callback, NULL);
549549}
550550
551551
552552static MACHINE_RESET( fuuki16 )
553553{
554   timer_set(video_screen_get_time_until_pos(0, 248, 0), 0, level_1_interrupt_callback);
555   timer_set(video_screen_get_time_until_pos(0, machine->screen[0].visarea.max_y + 1, 0), 0, vblank_interrupt_callback);
554   timer_set(video_screen_get_time_until_pos(0, 248, 0), NULL, 0, level_1_interrupt_callback);
555   timer_set(video_screen_get_time_until_pos(0, machine->screen[0].visarea.max_y + 1, 0), NULL, 0, vblank_interrupt_callback);
556556   timer_adjust(raster_interrupt_timer, video_screen_get_time_until_pos(0, 0, machine->screen[0].visarea.max_x + 1), 0, attotime_zero);
557557}
558558
src/mame/drivers/pkscram.c
r1355r1356
274274{
275275   out = 0;
276276   interrupt_line_active=0;
277   scanline_timer = timer_alloc(scanline_callback);
277   scanline_timer = timer_alloc(scanline_callback, NULL);
278278   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, interrupt_scanline, 0), interrupt_scanline, attotime_zero);
279279
280280   state_save_register_global(out);
src/mame/drivers/taito_f3.c
r1355r1356
393393static INTERRUPT_GEN( f3_interrupt2 )
394394{
395395   cpunum_set_input_line(0, 2, HOLD_LINE);   // vblank
396   timer_set( ATTOTIME_IN_CYCLES(10000,0), 0, f3_interrupt3);
396   timer_set( ATTOTIME_IN_CYCLES(10000,0), NULL, 0, f3_interrupt3);
397397}
398398
399399static MACHINE_RESET( f3 )
src/mame/drivers/mcr.c
r1355r1356
14851485   0
14861486};
14871487
1488struct Samplesinterface journey_samples_interface =
1488static struct Samplesinterface journey_samples_interface =
14891489{
14901490   1,
14911491   journey_sample_names
src/mame/drivers/beaminv.c
r1355r1356
9393
9494static void create_interrupt_timer(void)
9595{
96   interrupt_timer = timer_alloc(interrupt_callback);
96   interrupt_timer = timer_alloc(interrupt_callback, NULL);
9797}
9898
9999
src/mame/drivers/m107.c
r1355r1356
4545
4646static MACHINE_START( m107 )
4747{
48   scanline_timer = timer_alloc(m107_scanline_interrupt);
48   scanline_timer = timer_alloc(m107_scanline_interrupt, NULL);
4949}
5050
5151static MACHINE_RESET( m107 )
r1355r1356
119119
120120static WRITE16_HANDLER( m107_soundlatch_w )
121121{
122   timer_call_after_resynch(V30_ASSERT,setvector_callback);
122   timer_call_after_resynch(NULL, V30_ASSERT,setvector_callback);
123123   soundlatch_w(0, data & 0xff);
124124//      logerror("soundlatch_w %02x\n",data);
125125}
r1355r1356
138138
139139static WRITE16_HANDLER( m107_sound_irq_ack_w )
140140{
141   timer_call_after_resynch(V30_CLEAR,setvector_callback);
141   timer_call_after_resynch(NULL, V30_CLEAR,setvector_callback);
142142}
143143
144144static WRITE16_HANDLER( m107_sound_status_w )
r1355r1356
457457static void sound_irq(int state)
458458{
459459   if (state)
460      timer_call_after_resynch(YM2151_ASSERT,setvector_callback);
460      timer_call_after_resynch(NULL, YM2151_ASSERT,setvector_callback);
461461   else
462      timer_call_after_resynch(YM2151_CLEAR,setvector_callback);
462      timer_call_after_resynch(NULL, YM2151_CLEAR,setvector_callback);
463463}
464464
465465static struct YM2151interface ym2151_interface =
src/mame/drivers/cball.c
r1355r1356
6464      scanline = 16;
6565   }
6666
67   timer_set(video_screen_get_time_until_pos(0, scanline, 0), scanline, interrupt_callback);
67   timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, interrupt_callback);
6868}
6969
7070
7171static MACHINE_RESET( cball )
7272{
73   timer_set(video_screen_get_time_until_pos(0, 16, 0), 16, interrupt_callback);
73   timer_set(video_screen_get_time_until_pos(0, 16, 0), NULL, 16, interrupt_callback);
7474}
7575
7676
src/mame/drivers/cave.c
r1355r1356
123123/* Called once/frame to generate the VBLANK interrupt */
124124static INTERRUPT_GEN( cave_interrupt )
125125{
126   timer_set(ATTOTIME_IN_USEC(17376-time_vblank_irq), 0, cave_vblank_start);
127   timer_set(ATTOTIME_IN_USEC(17376-time_vblank_irq + 2000), 0, cave_vblank_end);
126   timer_set(ATTOTIME_IN_USEC(17376-time_vblank_irq), NULL, 0, cave_vblank_start);
127   timer_set(ATTOTIME_IN_USEC(17376-time_vblank_irq + 2000), NULL, 0, cave_vblank_end);
128128}
129129
130130/* Called by the YMZ280B to set the IRQ state */
src/mame/drivers/fuukifg3.c
r1355r1356
539539static TIMER_CALLBACK( level_1_interrupt_callback )
540540{
541541   cpunum_set_input_line(0, 1, PULSE_LINE);
542   timer_set(video_screen_get_time_until_pos(0, 248, 0), 0, level_1_interrupt_callback);
542   timer_set(video_screen_get_time_until_pos(0, 248, 0), NULL, 0, level_1_interrupt_callback);
543543}
544544
545545
546546static TIMER_CALLBACK( vblank_interrupt_callback )
547547{
548548   cpunum_set_input_line(0, 3, PULSE_LINE);   // VBlank IRQ
549   timer_set(video_screen_get_time_until_pos(0, machine->screen[0].visarea.max_y + 1, 0), 0, vblank_interrupt_callback);
549   timer_set(video_screen_get_time_until_pos(0, machine->screen[0].visarea.max_y + 1, 0), NULL, 0, vblank_interrupt_callback);
550550}
551551
552552
r1355r1356
560560
561561static MACHINE_START( fuuki32 )
562562{
563   raster_interrupt_timer = timer_alloc(raster_interrupt_callback);
563   raster_interrupt_timer = timer_alloc(raster_interrupt_callback, NULL);
564564}
565565
566566
567567static MACHINE_RESET( fuuki32 )
568568{
569   timer_set(video_screen_get_time_until_pos(0, 248, 0), 0, level_1_interrupt_callback);
570   timer_set(video_screen_get_time_until_pos(0, machine->screen[0].visarea.max_y + 1, 0), 0, vblank_interrupt_callback);
569   timer_set(video_screen_get_time_until_pos(0, 248, 0), NULL, 0, level_1_interrupt_callback);
570   timer_set(video_screen_get_time_until_pos(0, machine->screen[0].visarea.max_y + 1, 0), NULL, 0, vblank_interrupt_callback);
571571   timer_adjust(raster_interrupt_timer, video_screen_get_time_until_pos(0, 0, machine->screen[0].visarea.max_x + 1), 0, attotime_zero);
572572}
573573
src/mame/drivers/tourtabl.c
r1355r1356
251251ROM_END
252252
253253
254GAME( 1978, tourtabl, 0,        tourtabl, tourtabl, NULL, ROT0, "Atari", "Tournament Table (set 1)", 0 )
255GAME( 1978, tourtab2, tourtabl, tourtabl, tourtabl, NULL, ROT0, "Atari", "Tournament Table (set 2)", 0 )
254GAME( 1978, tourtabl, 0,        tourtabl, tourtabl, 0, ROT0, "Atari", "Tournament Table (set 1)", 0 )
255GAME( 1978, tourtab2, tourtabl, tourtabl, tourtabl, 0, ROT0, "Atari", "Tournament Table (set 2)", 0 )
src/mame/drivers/genesis.c
r1355r1356
103103      {
104104         scanline_int = 1;
105105         update_interrupts();
106         timer_set(video_screen_get_time_until_pos(0, scanline + 1, 0), 0, vdp_int4_off);
106         timer_set(video_screen_get_time_until_pos(0, scanline + 1, 0), NULL, 0, vdp_int4_off);
107107      }
108108
109109   /* advance to the next scanline */
r1355r1356
134134   update_interrupts();
135135
136136   /* set a timer to turn it off */
137   timer_set(video_screen_get_time_until_pos(0, video_screen_get_vpos(0), 22), 0, vdp_int6_off);
137   timer_set(video_screen_get_time_until_pos(0, video_screen_get_vpos(0), 22), NULL, 0, vdp_int6_off);
138138}
139139
140140
r1355r1356
172172   logerror("Machine init\n");
173173
174174   /* set the first scanline 0 timer to go off */
175   scan_timer = timer_alloc(vdp_reload_counter);
175   scan_timer = timer_alloc(vdp_reload_counter, NULL);
176176   timer_adjust(scan_timer, video_screen_get_time_until_pos(0, 0, 320), 0, attotime_zero);
177177}
178178
src/mame/drivers/cloud9.c
r1355r1356
196196   video_screen_configure(0, 320, 256, &visarea, HZ_TO_ATTOSECONDS(PIXEL_CLOCK) * VTOTAL * HTOTAL);
197197
198198   /* create a timer for IRQs and set up the first callback */
199   irq_timer = timer_alloc(clock_irq);
199   irq_timer = timer_alloc(clock_irq, NULL);
200200   irq_state = 0;
201201   schedule_next_irq(0-64);
202202
src/mame/drivers/rpunch.c
r1355r1356
187187static WRITE16_HANDLER( sound_command_w )
188188{
189189   if (ACCESSING_LSB)
190      timer_call_after_resynch(data & 0xff, sound_command_w_callback);
190      timer_call_after_resynch(NULL, data & 0xff, sound_command_w_callback);
191191}
192192
193193
src/mame/drivers/rabbit.c
r1355r1356
656656            if (!blt_amount)
657657            {
658658               if(BLITLOG) mame_printf_debug("end of blit list\n");
659               timer_set(ATTOTIME_IN_USEC(500),0,rabbit_blit_done);
659               timer_set(ATTOTIME_IN_USEC(500), NULL,0,rabbit_blit_done);
660660               return;
661661            }
662662
src/mame/drivers/asuka.c
r1355r1356
241241
242242static INTERRUPT_GEN( cadash_interrupt )
243243{
244   timer_set(ATTOTIME_IN_CYCLES(500,0),0, cadash_interrupt5);
244   timer_set(ATTOTIME_IN_CYCLES(500,0), NULL, 0, cadash_interrupt5);
245245   cpunum_set_input_line(0, 4, HOLD_LINE);  /* interrupt vector 4 */
246246}
247247
src/mame/drivers/rollerg.c
r1355r1356
6767static WRITE8_HANDLER( sound_arm_nmi_w )
6868{
6969   cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE);
70   timer_set(ATTOTIME_IN_USEC(50),0,nmi_callback);   /* kludge until the K053260 is emulated correctly */
70   timer_set(ATTOTIME_IN_USEC(50), NULL,0,nmi_callback);   /* kludge until the K053260 is emulated correctly */
7171}
7272
7373static READ8_HANDLER( pip_r )
src/mame/drivers/wolfpack.c
r1355r1356
4747      scanline = 0;
4848   }
4949
50   timer_set(video_screen_get_time_until_pos(0, scanline, 0), scanline, periodic_callback);
50   timer_set(video_screen_get_time_until_pos(0, scanline, 0), NULL, scanline, periodic_callback);
5151}
5252
5353
5454static MACHINE_RESET( wolfpack )
5555{
56   timer_set(video_screen_get_time_until_pos(0, 0, 0), 0, periodic_callback);
56   timer_set(video_screen_get_time_until_pos(0, 0, 0), NULL, 0, periodic_callback);
5757}
5858
5959
src/mame/drivers/segas18.c
r1355r1356
204204
205205   /* if we are running with a real live 8751, we need to boost the interleave at startup */
206206   if (machine->drv->cpu[2].type == CPU_I8751)
207      timer_call_after_resynch(0, boost_interleave);
207      timer_call_after_resynch(NULL, 0, boost_interleave);
208208}
209209
210210
src/mame/drivers/nitedrvr.c
r1355r1356
154154
155155static MACHINE_RESET( nitedrvr )
156156{
157   timer_pulse(PERIOD_OF_555_ASTABLE(RES_K(180), 330, CAP_U(1)), 0, nitedrvr_crash_toggle_callback);
157   timer_pulse(PERIOD_OF_555_ASTABLE(RES_K(180), 330, CAP_U(1)), NULL, 0, nitedrvr_crash_toggle_callback);
158158   nitedrvr_register_machine_vars();
159159}
160160
src/osd/windows/windows.mak
r1355r1356
8383
8484VCONV = $(WINOBJ)/vconv$(EXE)
8585
86# append a 'v' prefix if nothing specified
87ifndef PREFIX
88PREFIX = v
89endif
90
8691# replace the various compilers with vconv.exe prefixes
8792CC = @$(VCONV) gcc -I.
8893LD = @$(VCONV) ld /profile
r1355r1356
103108endif
104109
105110ifdef PTR64
106CC += /wd4267 /Wp64
111CC += /wd4267
107112endif
108113
109114# add some VC++-specific defines
110DEFS += -D_CRT_SECURE_NO_DEPRECATE -DXML_STATIC -D__inline__=__inline -Dsnprintf=_snprintf -Dvsnprintf=_vsnprintf
115DEFS += -D_CRT_SECURE_NO_DEPRECATE -DXML_STATIC -D__inline__=__inline -Dsnprintf=_snprintf
111116
112117# make msvcprep into a pre-build step
113118# OSPREBUILD = $(VCONV)
src/osd/windows/winprefix.h
r1355r1356
2626#ifdef _MSC_VER
2727void *__cdecl _alloca(size_t);
2828#define alloca _alloca
29#if _MSC_VER < 1400
30#define vsnprintf _vsnprintf
2931#endif
32#endif
3033
3134#ifdef __GNUC__
3235#define alloca   __builtin_alloca
src/osd/windows/winsync.c
r1355r1356
1616
1717// MAME headers
1818#include "osdcore.h"
19#include "osinline.h"
1920
2021
2122//============================================================
src/osd/windows/vconv.c
r1355r1356
8686   { 0,      "-mwindows",         "" },
8787   { 0,      "-mno-cygwin",         "" },
8888   { 0,      "-std=gnu89",         "" },
89   { 0,      "-pipe",            "" },
8990   { 0 }
9091};
9192
src/emu/romload.h
r1355r1356
2424***************************************************************************/
2525
2626/* ----- per-entry constants ----- */
27#define ROMENTRYTYPE_REGION         1               /* this entry marks the start of a region */
28#define ROMENTRYTYPE_END         2               /* this entry marks the end of a region */
29#define ROMENTRYTYPE_RELOAD         3               /* this entry reloads the previous ROM */
30#define ROMENTRYTYPE_CONTINUE      4               /* this entry continues loading the previous ROM */
31#define ROMENTRYTYPE_FILL         5               /* this entry fills an area with a constant value */
32#define ROMENTRYTYPE_COPY         6               /* this entry copies data from another region/offset */
33#define ROMENTRYTYPE_CARTRIDGE      7               /* this entry specifies a cartridge (MESS) */
34#define ROMENTRYTYPE_IGNORE         8               /* this entry continues loading the previous ROM but throws the data away */
35#define ROMENTRYTYPE_SYSTEM_BIOS      9               /* this entry specifies a bios */
36#define ROMENTRYTYPE_COUNT         10
27enum
28{
29   ROMENTRYTYPE_REGION = 1,   /* this entry marks the start of a region */
30   ROMENTRYTYPE_END,      /* this entry marks the end of a region */
31   ROMENTRYTYPE_RELOAD,      /* this entry reloads the previous ROM */
32   ROMENTRYTYPE_CONTINUE,      /* this entry continues loading the previous ROM */
33   ROMENTRYTYPE_FILL,      /* this entry fills an area with a constant value */
34   ROMENTRYTYPE_COPY,      /* this entry copies data from another region/offset */
35   ROMENTRYTYPE_CARTRIDGE,      /* this entry specifies a cartridge (MESS) */
36   ROMENTRYTYPE_IGNORE,      /* this entry continues loading the previous ROM but throws the data away */
37   ROMENTRYTYPE_SYSTEM_BIOS,   /* this entry specifies a bios */
38   ROMENTRYTYPE_COUNT
39};
3740
38
3941/* ----- per-region constants ----- */
4042#define ROMREGION_WIDTHMASK         0x00000003         /* native width of region, as power of 2 */
4143#define      ROMREGION_8BIT         0x00000000         /*    (non-CPU regions only) */
src/emu/debug/debugcpu.c
r1355r1356
530530
531531void debug_refresh_display(void)
532532{
533   video_frame_update();
533   video_frame_update(TRUE);
534534}
535535
536536
src/emu/cpu/m6805/m6805.c
r1355r1356
7878#define EA  ea.w.l
7979
8080/* public globals */
81int m6805_ICount=50000;
81static int m6805_ICount=50000;
8282
8383/* DS -- THESE ARE RE-DEFINED IN m6805.h TO RAM, ROM or FUNCTIONS IN cpuintrf.c */
8484#define RM(Addr)         M6805_RDMEM(Addr)
src/emu/cpu/h83002/h8periph.c
r1355r1356
486486
487487void h8_itu_init(void)
488488{
489   h8.timer[0] = timer_alloc(h8itu_timer_0_cb);
490   h8.timer[1] = timer_alloc(h8itu_timer_1_cb);
491   h8.timer[2] = timer_alloc(h8itu_timer_2_cb);
492   h8.timer[3] = timer_alloc(h8itu_timer_3_cb);
493   h8.timer[4] = timer_alloc(h8itu_timer_4_cb);
489   h8.timer[0] = timer_alloc(h8itu_timer_0_cb, NULL);
490   h8.timer[1] = timer_alloc(h8itu_timer_1_cb, NULL);
491   h8.timer[2] = timer_alloc(h8itu_timer_2_cb, NULL);
492   h8.timer[3] = timer_alloc(h8itu_timer_3_cb, NULL);
493   h8.timer[4] = timer_alloc(h8itu_timer_4_cb, NULL);
494494
495495   h8_itu_reset();
496496
src/emu/cpu/m68000/m68kmame.c
r1355r1356
305305 ****************************************************************************/
306306#if HAS_M68010
307307
308void m68010_init(int index, int clock, const void *config, int (*irqcallback)(int))
308static void m68010_init(int index, int clock, const void *config, int (*irqcallback)(int))
309309{
310310   m68k_init();
311311   m68k_set_cpu_type(M68K_CPU_TYPE_68010);
src/emu/cpu/z80gb/z80gb.h
r1355r1356
33
44#include "cpuintrf.h"
55
6extern int z80gb_ICount;
7
86typedef struct {
97   UINT16   *regs;
108   UINT8   features;
src/emu/cpu/z80gb/z80gb.c
r1355r1356
129129}
130130
131131/* Nr of cycles to run */
132int z80gb_ICount;
132static int z80gb_ICount;
133133
134134static int Cycles[256] =
135135{
src/emu/cpu/tms34010/tms34010.c
r1355r1356
616616      screen_to_cpu[config->scrnum] = index;
617617
618618   /* allocate a scanline timer and set it to go off at the start */
619   state.scantimer = timer_alloc(scanline_callback);
619   state.scantimer = timer_alloc(scanline_callback, NULL);
620620   timer_adjust(state.scantimer, attotime_zero, index, attotime_zero);
621621
622622   /* allocate the shiftreg */
r1355r1356
932932   if (enabled && vcount == SMART_IOREG(DPYINT))
933933   {
934934      /* generate the display interrupt signal */
935      internal_interrupt_callback(machine, cpunum | (TMS34010_DI << 8));
935      internal_interrupt_callback(machine, NULL, cpunum | (TMS34010_DI << 8));
936936   }
937937
938938   /* at the start of VBLANK, load the starting display address */
r1355r1356
11791179
11801180         /* NMI issued? */
11811181         if (data & 0x0100)
1182            timer_call_after_resynch(cpunum, internal_interrupt_callback);
1182            timer_call_after_resynch(NULL, cpunum, internal_interrupt_callback);
11831183         break;
11841184
11851185      case REG_HSTCTLL:
r1355r1356
12141214
12151215         /* input interrupt? (should really be state-based, but the functions don't exist!) */
12161216         if (!(oldreg & 0x0008) && (newreg & 0x0008))
1217            timer_call_after_resynch(cpunum | (TMS34010_HI << 8), internal_interrupt_callback);
1217            timer_call_after_resynch(NULL, cpunum | (TMS34010_HI << 8), internal_interrupt_callback);
12181218         else if ((oldreg & 0x0008) && !(newreg & 0x0008))
12191219            IOREG(REG_INTPEND) &= ~TMS34010_HI;
12201220         break;
r1355r1356
13231323
13241324         /* NMI issued? */
13251325         if (data & 0x0100)
1326            timer_call_after_resynch(cpunum, internal_interrupt_callback);
1326            timer_call_after_resynch(NULL, cpunum, internal_interrupt_callback);
13271327         break;
13281328
13291329      case REG020_HSTCTLL:
r1355r1356
13581358
13591359         /* input interrupt? (should really be state-based, but the functions don't exist!) */
13601360         if (!(oldreg & 0x0008) && (newreg & 0x0008))
1361            timer_call_after_resynch(cpunum | (TMS34010_HI << 8), internal_interrupt_callback);
1361            timer_call_after_resynch(NULL, cpunum | (TMS34010_HI << 8), internal_interrupt_callback);
13621362         else if ((oldreg & 0x0008) && !(newreg & 0x0008))
13631363            IOREG(REG020_INTPEND) &= ~TMS34010_HI;
13641364         break;
src/emu/cpu/m37710/m37710.c
r1355r1356
10541054{
10551055   INT_ACK = irqcallback;
10561056
1057   m37710i_cpu.timers[0] = timer_alloc(m37710_timer_a0_cb);
1058   m37710i_cpu.timers[1] = timer_alloc(m37710_timer_a1_cb);
1059   m37710i_cpu.timers[2] = timer_alloc(m37710_timer_a2_cb);
1060   m37710i_cpu.timers[3] = timer_alloc(m37710_timer_a3_cb);
1061   m37710i_cpu.timers[4] = timer_alloc(m37710_timer_a4_cb);
1062   m37710i_cpu.timers[5] = timer_alloc(m37710_timer_b0_cb);
1063   m37710i_cpu.timers[6] = timer_alloc(m37710_timer_b1_cb);
1064   m37710i_cpu.timers[7] = timer_alloc(m37710_timer_b2_cb);
1057   m37710i_cpu.timers[0] = timer_alloc(m37710_timer_a0_cb, NULL);
1058   m37710i_cpu.timers[1] = timer_alloc(m37710_timer_a1_cb, NULL);
1059   m37710i_cpu.timers[2] = timer_alloc(m37710_timer_a2_cb, NULL);
1060   m37710i_cpu.timers[3] = timer_alloc(m37710_timer_a3_cb, NULL);
1061   m37710i_cpu.timers[4] = timer_alloc(m37710_timer_a4_cb, NULL);
1062   m37710i_cpu.timers[5] = timer_alloc(m37710_timer_b0_cb, NULL);
1063   m37710i_cpu.timers[6] = timer_alloc(m37710_timer_b1_cb, NULL);
1064   m37710i_cpu.timers[7] = timer_alloc(m37710_timer_b2_cb, NULL);
10651065
10661066   state_save_register_item("M377xx", index, m37710i_cpu.a);
10671067   state_save_register_item("M377xx", index, m37710i_cpu.b);
src/emu/cpu/sc61860/sc61860.c
r1355r1356
9494static void sc61860_init(int index, int clock, const void *config, int (*irqcallback)(int))
9595{
9696   sc61860.config = (SC61860_CONFIG *) config;
97   timer_pulse(ATTOTIME_IN_HZ(500), 0, sc61860_2ms_tick);
97   timer_pulse(ATTOTIME_IN_HZ(500), NULL, 0, sc61860_2ms_tick);
9898}
9999
100100static void sc61860_get_context (void *dst)
src/emu/cpu/spc700/spc700.h
r1355r1356
9696/* Pulse the SO (Set Overflow) pin on the CPU */
9797void spc700_pulse_so(void);
9898
99extern int spc700_ICount;            /* cycle count */
100
10199int spc700_execute(int clocks);
102100
103101
src/emu/cpu/spc700/spc700.c
r1355r1356
134134/* Our CPU structure */
135135static spc700i_cpu_struct spc700i_cpu = {0};
136136
137int spc700_ICount = 0;
137static int spc700_ICount = 0;
138138
139139/* Temporary Variables */
140140static uint spc700i_source;
src/emu/cpu/hd6309/hd6309.c
r1355r1356
171171
172172/* 6309 registers */
173173static hd6309_Regs hd6309;
174int hd6309_slapstic = 0;
174//static int hd6309_slapstic = 0;
175175
176176#define pPPC   hd6309.ppc
177177#define pPC    hd6309.pc
src/emu/cpu/tlcs90/tlcs90.c
r1355r1356
24302430         case 2:
24312431            if ( !is16bit )
24322432               if ( (T90.internal_registers[ T90_TCLK - T90_IOBASE ] & (0x03 << (i * 2 + 2))) == 0 )   // T0/T1 match signal clocks T1/T3
2433                  t90_timer_callback(machine, i+1);
2433                  t90_timer_callback(machine, NULL, i+1);
24342434            break;
24352435      }
24362436   }
r1355r1356
24462446         case 0:
24472447         case 2:
24482448            if ( is16bit )   // T0/T1 overflow signal clocks T1/T3
2449               t90_timer_callback(machine, i+1);
2449               t90_timer_callback(machine, NULL, i+1);
24502450            break;
24512451      }
24522452   }
r1355r1356
26622662   // Timers
26632663
26642664   for (i = 0; i < 4; i++)
2665      T90.timer[i] = timer_alloc(t90_timer_callback);
2665      T90.timer[i] = timer_alloc(t90_timer_callback, NULL);
26662666
2667   T90.timer[4] = timer_alloc(t90_timer4_callback);
2667   T90.timer[4] = timer_alloc(t90_timer4_callback, NULL);
26682668}
26692669
26702670static ADDRESS_MAP_START(tmp90840_mem, ADDRESS_SPACE_PROGRAM, 8)
src/emu/cpu/s2650/s2650.c
r1355r1356
2828/* define this to expand all EA calculations inline */
2929#define INLINE_EA   1
3030
31int s2650_ICount = 0;
31static int s2650_ICount = 0;
3232
3333typedef struct {
3434   UINT16   ppc;   /* previous program counter (page + iar) */
src/emu/cpu/e132xs/e132xs.c
r1355r1356
662662      timer_adjust(hyperstone.timer, attotime_never, 0, attotime_never);
663663}
664664
665static TIMER_CALLBACK( timer_callback )
665static TIMER_CALLBACK( e132xs_timer_callback )
666666{
667667   int update = param & 1;
668668   int cpunum = param >> 1;
r1355r1356
15761576   state_save_register_item("E132XS", index, hyperstone.tr_clocks_per_tick);
15771577
15781578   hyperstone.irq_callback = irqcallback;
1579   hyperstone.timer = timer_alloc(timer_callback);
1579   hyperstone.timer = timer_alloc(e132xs_timer_callback, NULL);
15801580   hyperstone.clock_scale_mask = scale_mask;
15811581}
15821582
src/emu/cpu/rsp/rsp.c
r1355r1356
3131#endif
3232
3333
34extern UINT32 sp_read_reg(UINT32 reg);
35extern void sp_write_reg(UINT32 reg, UINT32 data);
36extern READ32_HANDLER( n64_dp_reg_r );
37extern WRITE32_HANDLER( n64_dp_reg_w );
38extern void sp_set_status(UINT32 status);
34static rsp_config *config;
3935
4036
4137typedef struct
r1355r1356
5248   UINT32 r[32];
5349   VECTOR_REG v[32];
5450   UINT16 flag[4];
55    UINT32 sr;
51   UINT32 sr;
5652
5753   INT64 accum[8];
5854   INT32 square_root_res;
r1355r1356
235231{
236232   if (reg >= 0 && reg < 8)
237233   {
238      return sp_read_reg(reg);
234      return (config->sp_reg_r)(reg, 0x00000000);
239235   }
240236   else if (reg >= 8 && reg < 16)
241237   {
242      return n64_dp_reg_r(reg - 8, 0x00000000);
238      return (config->dp_reg_r)(reg - 8, 0x00000000);
243239   }
244240   else
245241   {
r1355r1356
251247{
252248   if (reg >= 0 && reg < 8)
253249   {
254      sp_write_reg(reg, data);
250      (config->sp_reg_w)(reg, data, 0x00000000);
255251   }
256252   else if (reg >= 8 && reg < 16)
257253   {
258      n64_dp_reg_w(reg - 8, data, 0x00000000);
254      (config->dp_reg_w)(reg - 8, data, 0x00000000);
259255   }
260256   else
261257   {
r1355r1356
348344
349345static void rsp_init(int index, int clock, const void *_config, int (*irqcallback)(int))
350346{
351    //int regIdx, accumIdx;
347   //int regIdx, accumIdx;
348   config = (rsp_config *)_config;
349
352350#if LOG_INSTRUCTION_EXECUTION
353351   exec_output = fopen("rsp_execute.txt", "wt");
354352#endif
355353
356354   rsp.irq_callback = irqcallback;
357    /*
358    for(regIdx = 0; regIdx < 32; regIdx++ )
359    {
360        rsp.r[regIdx] = 0;
361        rsp.v[regIdx].d[0] = 0;
362        rsp.v[regIdx].d[1] = 0;
363    }
364    for(accumIdx = 0; accumIdx < 8; accumIdx++ )
365    {
366        rsp.accum[accumIdx] = 0;
367    }
368    rsp.flag[0] = 0;
369    rsp.flag[1] = 0;
370    rsp.flag[2] = 0;
371    rsp.flag[3] = 0;
372    rsp.square_root_res = 0;
373    rsp.square_root_high = 0;
374    rsp.reciprocal_res = 0;
375    rsp.reciprocal_high = 0;
376    */
377    rsp.sr = RSP_STATUS_HALT;
355#if 0
356   for(regIdx = 0; regIdx < 32; regIdx++ )
357   {
358      rsp.r[regIdx] = 0;
359      rsp.v[regIdx].d[0] = 0;
360      rsp.v[regIdx].d[1] = 0;
361   }
362   for(accumIdx = 0; accumIdx < 8; accumIdx++ )
363   {
364      rsp.accum[accumIdx] = 0;
365   }
366   rsp.flag[0] = 0;
367   rsp.flag[1] = 0;
368   rsp.flag[2] = 0;
369   rsp.flag[3] = 0;
370   rsp.square_root_res = 0;
371   rsp.square_root_high = 0;
372   rsp.reciprocal_res = 0;
373   rsp.reciprocal_high = 0;
374#endif
375   rsp.sr = RSP_STATUS_HALT;
378376}
379377
380378static void rsp_exit(void)
r1355r1356
397395#endif
398396#if SAVE_DMEM
399397   {
400      /*int i;
401        FILE *dmem;
402        dmem = fopen("rsp_dmem.txt", "wt");
403
404        for (i=0; i < 0x1000; i+=4)
405        {
406            fprintf(dmem, "%08X: %08X\n", 0x04000000 + i, READ32(0x04000000 + i));
407        }
408        fclose(dmem);*/
409
410398      int i;
411399      FILE *dmem;
400#if 0
401      dmem = fopen("rsp_dmem.txt", "wt");
402
403      for (i=0; i < 0x1000; i+=4)
404      {
405         fprintf(dmem, "%08X: %08X\n", 0x04000000 + i, READ32(0x04000000 + i));
406      }
407      fclose(dmem);
408#endif
412409      dmem = fopen("rsp_dmem.bin", "wb");
413410
414411      for (i=0; i < 0x1000; i++)
r1355r1356
966963         //
967964         // Stores one element from maximum of 8 vectors, while incrementing element index
968965
969         int element, eaoffset;
966         int element;
970967         int vs = dest;
971968         int ve = dest + 8;
972969         if (ve > 32)
r1355r1356
23082305                  i = 0;
23092306               }
23102307            }
2311                rec = (INT32)(0x7fffffff / (double)rec);
2308            rec = (INT32)(0x7fffffff / (double)rec);
23122309            for (i = 31; i > 0; i--)
23132310            {
23142311               if (rec & (1 << i))
r1355r1356
25542551
25552552   rsp.pc = 0x4001000 | (rsp.pc & 0xfff);
25562553
2557    if( rsp.sr & ( RSP_STATUS_HALT | RSP_STATUS_BROKE ) )
2558    {
2559        rsp_icount = 0;
2560    }
2554   if( rsp.sr & ( RSP_STATUS_HALT | RSP_STATUS_BROKE ) )
2555   {
2556      rsp_icount = 0;
2557   }
25612558
25622559   while (rsp_icount > 0)
25632560   {
r1355r1356
25912588               case 0x09:   /* JALR */      JUMP_PC_L(RSVAL, RDREG); break;
25922589               case 0x0d:   /* BREAK */
25932590               {
2594                  sp_set_status(0x3);
2591                  (config->sp_set_status)(0x3);
25952592                  rsp_icount = 1;
25962593
25972594#if LOG_INSTRUCTION_EXECUTION
r1355r1356
27842781
27852782      --rsp_icount;
27862783
2787        if( rsp.sr & RSP_STATUS_SSTEP )
2788        {
2789            rsp.sr |= RSP_STATUS_BROKE;
2790        }
2784      if( rsp.sr & RSP_STATUS_SSTEP )
2785      {
2786         rsp.sr |= RSP_STATUS_BROKE;
2787      }
27912788
2792        if( rsp.sr & ( RSP_STATUS_HALT | RSP_STATUS_BROKE ) )
2793        {
2794            rsp_icount = 0;
2795        }
2789      if( rsp.sr & ( RSP_STATUS_HALT | RSP_STATUS_BROKE ) )
2790      {
2791         rsp_icount = 0;
2792      }
27962793
27972794   }
27982795
r1355r1356
29422939      case CPUINFO_INT_REGISTER + RSP_R30:         info->i = rsp.r[30];               break;
29432940      case CPUINFO_INT_SP:
29442941      case CPUINFO_INT_REGISTER + RSP_R31:         info->i = rsp.r[31];               break;
2945        case CPUINFO_INT_REGISTER + RSP_SR:             info->i = rsp.sr;                       break;
2946        case CPUINFO_INT_REGISTER + RSP_NEXTPC:         info->i = rsp.nextpc;                   break;
2942      case CPUINFO_INT_REGISTER + RSP_SR:             info->i = rsp.sr;                       break;
2943      case CPUINFO_INT_REGISTER + RSP_NEXTPC:         info->i = rsp.nextpc;                   break;
29472944
29482945      /* --- the following bits of info are returned as pointers to data or functions --- */
29492946      case CPUINFO_PTR_GET_CONTEXT:               info->getcontext = rsp_get_context;      break;
r1355r1356
30022999      case CPUINFO_STR_REGISTER + RSP_R29:         sprintf(info->s, "R29: %08X", rsp.r[29]); break;
30033000      case CPUINFO_STR_REGISTER + RSP_R30:         sprintf(info->s, "R30: %08X", rsp.r[30]); break;
30043001      case CPUINFO_STR_REGISTER + RSP_R31:         sprintf(info->s, "R31: %08X", rsp.r[31]); break;
3005        case CPUINFO_STR_REGISTER + RSP_SR:             sprintf(info->s, "SR: %08X",  rsp.sr);    break;
3006        case CPUINFO_STR_REGISTER + RSP_NEXTPC:         sprintf(info->s, "NPC: %08X", rsp.nextpc);break;
3002      case CPUINFO_STR_REGISTER + RSP_SR:             sprintf(info->s, "SR: %08X",  rsp.sr);    break;
3003      case CPUINFO_STR_REGISTER + RSP_NEXTPC:         sprintf(info->s, "NPC: %08X", rsp.nextpc);break;
30073004   }
30083005}
src/emu/cpu/rsp/rsp.h
r1355r1356
11#ifndef _RSP_H
22#define _RSP_H
33
4struct _rsp_config
5{
6   read32_handler dp_reg_r;
7   write32_handler dp_reg_w;
8   read32_handler sp_reg_r;
9   write32_handler sp_reg_w;
10   void (*sp_set_status)(UINT32 status);
11};
12typedef struct _rsp_config rsp_config;
13
414enum
515{
616    RSP_PC = 1,
src/emu/cpu/m6502/m6502.c
r1355r1356
8787
8888}   m6502_Regs;
8989
90int m6502_IntOccured = 0;
91int m6502_ICount = 0;
90static int m6502_IntOccured = 0;
91static int m6502_ICount = 0;
9292
9393static m6502_Regs m6502;
9494
src/emu/cpu/i8085/i8085.c
r1355r1356
150150   void   (*sod_callback)(int state);
151151}   i8085_Regs;
152152
153int i8085_ICount = 0;
153static int i8085_ICount = 0;
154154
155155static i8085_Regs I;
156156static UINT8 ZS[256];
src/emu/cpu/powerpc/ppc.c
r1355r1356
1212#endif
1313#if (HAS_PPC403)
1414void ppc403_exception(int exception);
15UINT8 ppc403_spu_r(UINT32 a);
16void ppc403_spu_w(UINT32 a, UINT8 d);
15static UINT8 ppc403_spu_r(UINT32 a);
16static void ppc403_spu_w(UINT32 a, UINT8 d);
1717#endif
1818
1919#define RD            ((op >> 21) & 0x1F)
r1355r1356
921921   // !!! why is rfci here !!!
922922   optable19[51] = ppc_rfci;
923923
924   ppc.spu.rx_timer = timer_alloc(ppc403_spu_rx_callback);
925   ppc.spu.tx_timer = timer_alloc(ppc403_spu_tx_callback);
924   ppc.spu.rx_timer = timer_alloc(ppc403_spu_rx_callback, NULL);
925   ppc.spu.tx_timer = timer_alloc(ppc403_spu_tx_callback, NULL);
926926
927927   ppc.read8 = ppc403_read8;
928928   ppc.read16 = ppc403_read16;
src/emu/cpu/powerpc/ppc403.c
r1355r1356
678678
679679      case 0x9:
680680         ppc.spu.sptb = d;
681         ppc403_spu_tx_callback(Machine, cpu_getactivecpu());
681         ppc403_spu_tx_callback(Machine, NULL, cpu_getactivecpu());
682682         break;
683683
684684      default:
src/emu/cpu/powerpc/ppcdrc.c
r1355r1356
10741074   optable31[163] = recompile_wrteei;
10751075   optable19[51] = recompile_rfci;
10761076
1077   ppc.spu.rx_timer = timer_alloc(ppc403_spu_rx_callback);
1078   ppc.spu.tx_timer = timer_alloc(ppc403_spu_tx_callback);
1077   ppc.spu.rx_timer = timer_alloc(ppc403_spu_rx_callback, NULL);
1078   ppc.spu.tx_timer = timer_alloc(ppc403_spu_tx_callback, NULL);
10791079
10801080   ppc.is603 = 0;
10811081   ppc.is602 = 0;
src/emu/cpu/sm8500/sm8500.h
r1355r1356
2020#define WDT_INT         9
2121#define NMI_INT         10
2222
23extern int sm8500_icount;
24
2523enum {
2624   /* "main" 16 bit register */
2725        SM8500_PC=1, SM8500_SP, SM8500_PS, SM8500_SYS16, SM8500_RR0, SM8500_RR2, SM8500_RR4, SM8500_RR6, SM8500_RR8, SM8500_RR10,
src/emu/cpu/sm8500/sm8500.c
r1355r1356
5353static sm8500_regs regs;
5454
5555/* nr of cycles to run */
56int sm8500_icount;
56static int sm8500_icount;
5757
5858static UINT8 sm8500_b2w[8] = {
5959        0, 8, 2, 10, 4, 12, 6, 14
src/emu/cpu/sh2/sh2.c
r1355r1356
29332933{
29342934   const struct sh2_config *conf = config;
29352935
2936   sh2.timer = timer_alloc(sh2_timer_callback);
2936   sh2.timer = timer_alloc(sh2_timer_callback, NULL);
29372937   timer_adjust(sh2.timer, attotime_never, 0, attotime_zero);
29382938
2939   sh2.dma_timer[0] = timer_alloc(sh2_dmac_callback);
2939   sh2.dma_timer[0] = timer_alloc(sh2_dmac_callback, NULL);
29402940   timer_adjust(sh2.dma_timer[0], attotime_never, 0, attotime_zero);
29412941
2942   sh2.dma_timer[1] = timer_alloc(sh2_dmac_callback);
2942   sh2.dma_timer[1] = timer_alloc(sh2_dmac_callback, NULL);
29432943   timer_adjust(sh2.dma_timer[1], attotime_never, 0, attotime_zero);
29442944
29452945   sh2.m = auto_malloc(0x200);
src/emu/cpu/sh4/sh4.c
r1355r1356
41214121{
41224122   const struct sh4_config *conf = config;
41234123
4124   sh4.timer0 = timer_alloc(sh4_timer0_callback);
4124   sh4.timer0 = timer_alloc(sh4_timer0_callback, NULL);
41254125   timer_adjust(sh4.timer0, attotime_never, 0, attotime_zero);
4126   sh4.timer1 = timer_alloc(sh4_timer1_callback);
4126   sh4.timer1 = timer_alloc(sh4_timer1_callback, NULL);
41274127   timer_adjust(sh4.timer1, attotime_never, 0, attotime_zero);
4128   sh4.timer2 = timer_alloc(sh4_timer2_callback);
4128   sh4.timer2 = timer_alloc(sh4_timer2_callback, NULL);
41294129   timer_adjust(sh4.timer2, attotime_never, 0, attotime_zero);
41304130
4131   sh4.dma_timer[0] = timer_alloc(sh4_dmac_callback);
4131   sh4.dma_timer[0] = timer_alloc(sh4_dmac_callback, NULL);
41324132   timer_adjust(sh4.dma_timer[0], attotime_never, 0, attotime_zero);
4133   sh4.dma_timer[1] = timer_alloc(sh4_dmac_callback);
4133   sh4.dma_timer[1] = timer_alloc(sh4_dmac_callback, NULL);
41344134   timer_adjust(sh4.dma_timer[1], attotime_never, 0, attotime_zero);
4135   sh4.dma_timer[2] = timer_alloc(sh4_dmac_callback);
4135   sh4.dma_timer[2] = timer_alloc(sh4_dmac_callback, NULL);
41364136   timer_adjust(sh4.dma_timer[2], attotime_never, 0, attotime_zero);
4137   sh4.dma_timer[3] = timer_alloc(sh4_dmac_callback);
4137   sh4.dma_timer[3] = timer_alloc(sh4_dmac_callback, NULL);
41384138   timer_adjust(sh4.dma_timer[3], attotime_never, 0, attotime_zero);
41394139
4140   sh4.refresh_timer = timer_alloc(sh4_refresh_timer_callback);
4140   sh4.refresh_timer = timer_alloc(sh4_refresh_timer_callback, NULL);
41414141   timer_adjust(sh4.refresh_timer, attotime_never, 0, attotime_zero);
41424142   sh4.refresh_timer_base = 0;
41434143
4144   sh4.rtc_timer = timer_alloc(sh4_rtc_timer_callback);
4144   sh4.rtc_timer = timer_alloc(sh4_rtc_timer_callback, NULL);
41454145   timer_adjust(sh4.rtc_timer, attotime_never, 0, attotime_zero);
41464146
41474147   sh4.m = auto_malloc(16384*4);
src/emu/cpu/apexc/apexc.c
r1355r1356
343343
344344static apexc_regs apexc;
345345
346int apexc_ICount;
346static int apexc_ICount;
347347
348348/* decrement ICount by n */
349349#define DELAY(n)   {apexc_ICount -= (n); apexc.current_word = (apexc.current_word + (n)) & 0x1f;}
src/emu/cpu/apexc/apexc.h
r1355r1356
1313                    from the contents of ML and WS */
1414};
1515
16extern int apexc_ICount;
17
1816void apexc_get_info(UINT32 state, cpuinfo *info);
1917
2018#ifndef SUPPORT_ODD_WORD_SIZES
src/emu/cpu/i8051/i8051.c
r1355r1356
173173
174174}   I8051;
175175
176int i8051_icount;
176static int i8051_icount;
177177
178178static I8051 i8051;
179179static I8051_UART uart;
src/emu/cpu/i8051/i8051ops.c
r1355r1356
270270 The carry flag will be set if the result is > 0x99, but not cleared otherwise */
271271
272272 UINT16 new_acc = R_ACC & 0xff;
273 if(GET_AC || (R_ACC & 0x0f) > 0x09)
273 if(GET_AC || (new_acc & 0x0f) > 0x09)
274274    new_acc += 0x06;
275 if(GET_CY || (R_ACC & 0xf0) > 0x90)
275 if(GET_CY || ((new_acc & 0xf0) > 0x90) || (new_acc & ~0xff))
276276    new_acc += 0x60;
277277 SFR_W(ACC,new_acc&0xff);
278278 if(new_acc & ~0xff)
src/emu/cpu/i8051/i8051.h
r1355r1356
9393#define TI_FLAG 1
9494#define RI_FLAG 2
9595
96extern int i8051_icount;                  /* cycle count */
97
9896extern void i8051_init (int index, int clock, const void *config, int (*irqcallback)(int));               /* Initialize save states */
9997extern void i8051_reset (void);         /* Reset registers to the initial values */
10098extern void i8051_exit   (void);             /* Shut down CPU core */
r1355r1356
125123 * 8752 Section
126124 ****************************************************************************/
127125#if (HAS_I8752)
128#define i8752_icount                     i8051_icount
129
130126extern void i8752_init (int index, int clock, const void *config, int (*irqcallback)(int));               /* Initialize save states */
131127extern void i8752_reset (void);         /* Reset registers to the initial values */
132128extern void i8752_exit   (void);             /* Shut down CPU core */
src/emu/cpu/mips/dismips.c
r1355r1356
1010extern unsigned dasmr3k(char *,unsigned, UINT32);
1111extern unsigned dasmmips3(char *,unsigned, UINT32);
1212
13struct
13static struct
1414{
1515   UINT8 id[ 8 ];
1616   UINT32 text;   /* SCE only */
src/emu/cpu/mips/mips3com.c
r1355r1356
118118   mips->tlb_table = auto_malloc(sizeof(mips->tlb_table[0]) * (1 << (MIPS3_MAX_PADDR_SHIFT - MIPS3_MIN_PAGE_SHIFT)));
119119
120120   /* allocate a timer for the compare interrupt */
121   mips->compare_int_timer = timer_alloc(compare_int_callback);
121   mips->compare_int_timer = timer_alloc(compare_int_callback, NULL);
122122
123123   /* reset the state */
124124   mips3com_reset(mips);
src/emu/cpu/f8/f3853.c
r1355r1356
9090
9191   f3853.priority_line=FALSE;
9292   f3853.external_interrupt_line=TRUE;
93   f3853.timer = timer_alloc(f3853_timer_callback);
93   f3853.timer = timer_alloc(f3853_timer_callback, NULL);
9494}
9595
9696void f3853_reset(void)
src/emu/cpu/tms9900/99xxcore.h
r1355r1356
12841284   I.irq_callback = irqcallback;
12851285
12861286#if (TMS99XX_MODEL == TMS9995_ID)
1287   I.timer = timer_alloc(decrementer_callback);
1287   I.timer = timer_alloc(decrementer_callback, NULL);
12881288#endif
12891289
12901290   I.idle_callback = param ? param->idle_callback : NULL;
r1355r1356
18641864               {   /* decrement, then interrupt if reach 0 */
18651865                  if ((-- I.decrementer_count) == 0)
18661866                  {
1867                     decrementer_callback(Machine, 0);
1867                     decrementer_callback(Machine, NULL, 0);
18681868                     I.decrementer_count = I.decrementer_interval;   /* reload */
18691869                  }
18701870               }
src/emu/cpu/v810/v810.c
r1355r1356
3434
3535static v810info v810;
3636
37int v810_ICount;
37static int v810_ICount;
3838
3939#define R0 v810.reg[0]
4040#define R1 v810.reg[1]
src/emu/cpu/v810/v810.h
r1355r1356
33
44#include "cpuintrf.h"
55
6extern int v810_ICount;
7
86void v810_get_info(UINT32, cpuinfo*);
97
108#define R_B(addr) (program_read_byte_32le(addr))
src/emu/cpu/m6800/m6800.h
r1355r1356
8383extern void m6803_get_info(UINT32 state, cpuinfo *info);
8484#endif
8585
86#if (HAS_M6803||HAS_HD63701)
86#if (HAS_M6801||HAS_M6803||HAS_HD63701)
8787/* By default, on a port write port bits which are not set as output in the DDR */
8888/* are set to the value returned by a read from the same port. If you need to */
8989/* know the DDR for e.g. port 1, do m6803_internal_registers_r(M6801_DDR1) */
src/emu/cpu/m6800/m6800.c
r1355r1356
610610/* include the opcode functions */
611611#include "6800ops.c"
612612
613#if (HAS_M6801||HAS_M6803||HAS_HD63701)
613614static void m6800_tx(int value)
614615{
615616   m6800.port2_data = (m6800.port2_data & 0xef) | (value << 4);
r1355r1356
804805      }
805806   }
806807}
808#endif
807809
808810/****************************************************************************
809811 * Reset registers to their initial values
r1355r1356
12741276   m6800.irq_callback = irqcallback;
12751277
12761278   m6800.clock = clock;
1277   m6800_rx_timer = timer_alloc(m6800_rx_tick);
1278   m6800_tx_timer = timer_alloc(m6800_tx_tick);
1279   m6800_rx_timer = timer_alloc(m6800_rx_tick, NULL);
1280   m6800_tx_timer = timer_alloc(m6800_tx_tick, NULL);
12791281
12801282   state_register("m6801", index);
12811283}
r1355r1356
13071309   m6800.irq_callback = irqcallback;
13081310
13091311   m6800.clock = clock;
1310   m6800_rx_timer = timer_alloc(m6800_rx_tick);
1311   m6800_tx_timer = timer_alloc(m6800_tx_tick);
1312   m6800_rx_timer = timer_alloc(m6800_rx_tick, NULL);
1313   m6800_tx_timer = timer_alloc(m6800_tx_tick, NULL);
13121314
13131315   state_register("m6803", index);
13141316}
r1355r1356
16501652   m6800.irq_callback = irqcallback;
16511653
16521654   m6800.clock = clock;
1653   m6800_rx_timer = timer_alloc(m6800_rx_tick);
1654   m6800_tx_timer = timer_alloc(m6800_tx_tick);
1655   m6800_rx_timer = timer_alloc(m6800_rx_tick, NULL);
1656   m6800_tx_timer = timer_alloc(m6800_tx_tick, NULL);
16551657
16561658   state_register("hd63701", index);
16571659}
src/emu/cpu/cp1610/cp1610.h
r1355r1356
3232#define CP1610_RESET      2            /* Non-Maskable */
3333#define CP1610_INT_INTR      INPUT_LINE_NMI   /* Non-Maskable */
3434
35extern int cp1610_icount;             /* cycle count */
3635
37
3836void cp1610_get_info(UINT32 state, cpuinfo *info);
3937
4038#ifdef MAME_DEBUG
src/emu/cpu/cp1610/cp1610.c
r1355r1356
4646   int      mask_interrupts;
4747}   cp1610_Regs;
4848
49int cp1610_icount;
49static int cp1610_icount;
5050
5151static cp1610_Regs cp1610;
5252
src/emu/config.h
r1355r1356
2626 *
2727 *************************************/
2828
29#define CONFIG_TYPE_INIT         0      /* opportunity to initialize things first */
30#define CONFIG_TYPE_CONTROLLER      1      /* loading from controller file */
31#define CONFIG_TYPE_DEFAULT         2      /* loading from default.cfg */
32#define CONFIG_TYPE_GAME         3      /* loading from game.cfg */
33#define CONFIG_TYPE_FINAL         4      /* opportunity to finish initialization */
29enum
30{
31   CONFIG_TYPE_INIT = 0,               /* opportunity to initialize things first */
32   CONFIG_TYPE_CONTROLLER,               /* loading from controller file */
33   CONFIG_TYPE_DEFAULT,               /* loading from default.cfg */
34   CONFIG_TYPE_GAME,               /* loading from game.cfg */
35   CONFIG_TYPE_FINAL               /* opportunity to finish initialization */
36};
3437
3538
3639
src/emu/audio/generic.c
r1355r1356
8585
8686INLINE void latch_w(int which, UINT16 value)
8787{
88   timer_call_after_resynch(which | (value << 8), latch_callback);
88   timer_call_after_resynch(NULL, which | (value << 8), latch_callback);
8989}
9090
9191
src/emu/eigccx86.h
r1355r1356
3333
3434#ifndef __x86_64__
3535#define mul_32x32 _mul_32x32
36INLINE INT64 _mul_32x32(INT32 a, INT32 b)
36INLINE INT64 __attribute__((const, always_inline))
37_mul_32x32(INT32 a, INT32 b)
3738{
38   INT64 result;
39   register INT64 result;
3940
4041   __asm__ (
4142      " imull  %[b] ;"
r1355r1356
5859
5960#ifndef __x86_64__
6061#define mulu_32x32 _mulu_32x32
61INLINE UINT64 _mulu_32x32(UINT32 a, UINT32 b)
62INLINE UINT64 __attribute__((const, always_inline))
63_mulu_32x32(UINT32 a, UINT32 b)
6264{
63   UINT64 result;
65   register UINT64 result;
6466
6567   __asm__ (
6668      " mull  %[b] ;"
r1355r1356
8284-------------------------------------------------*/
8385
8486#define mul_32x32_hi _mul_32x32_hi
85INLINE INT32 _mul_32x32_hi(INT32 a, INT32 b)
87INLINE INT32 __attribute__((const, always_inline))
88_mul_32x32_hi(INT32 a, INT32 b)
8689{
87   INT32 result;
90   register INT32 result;
8891
8992   __asm__ (
9093      " imull  %[b] ;"
r1355r1356
105108-------------------------------------------------*/
106109
107110#define mulu_32x32_hi _mulu_32x32_hi
108INLINE UINT32 _mulu_32x32_hi(UINT32 a, UINT32 b)
111INLINE UINT32 __attribute__((const, always_inline))
112_mulu_32x32_hi(UINT32 a, UINT32 b)
109113{
110   UINT32 result;
114   register UINT32 result;
111115
112116   __asm__ (
113117      " mull  %[b] ;"
r1355r1356
130134
131135#ifndef __x86_64__
132136#define mul_32x32_shift _mul_32x32_shift
133INLINE INT32 _mul_32x32_shift(INT32 a, INT32 b, UINT8 shift)
137INLINE INT32 __attribute__((const, always_inline))
138_mul_32x32_shift(INT32 a, INT32 b, UINT8 shift)
134139{
135   INT32 result;
140   register INT32 result;
136141
142   /* Valid for (0 <= shift <= 31) */
137143   __asm__ (
138144      " imull  %[b]                       ;"
139145      " shrdl  %[shift], %%edx, %[result] ;"
r1355r1356
158164
159165#ifndef __x86_64__
160166#define mulu_32x32_shift _mulu_32x32_shift
161INLINE UINT32 _mulu_32x32_shift(UINT32 a, UINT32 b, UINT8 shift)
167INLINE UINT32 __attribute__((const, always_inline))
168_mulu_32x32_shift(UINT32 a, UINT32 b, UINT8 shift)
162169{
163   UINT32 result;
170   register UINT32 result;
164171
172   /* Valid for (0 <= shift <= 31) */
165173   __asm__ (
166174      " mull   %[b]                       ;"
167175      " shrdl  %[shift], %%edx, %[result] ;"
r1355r1356
184192
185193#ifndef __x86_64__
186194#define div_64x32 _div_64x32
187INLINE INT32 _div_64x32(INT64 a, INT32 b)
195INLINE INT32 __attribute__((const, always_inline))
196_div_64x32(INT64 a, INT32 b)
188197{
189   INT32 result, temp;
198   register INT32 result, temp;
190199
200   /* Throws arithmetic exception if result doesn't fit in 32 bits */
191201   __asm__ (
192202      " idivl  %[b] ;"
193203      : [result] "=a" (result)   /* Result ends up in eax */
r1355r1356
209219
210220#ifndef __x86_64__
211221#define divu_64x32 _divu_64x32
212INLINE UINT32 _divu_64x32(UINT64 a, UINT32 b)
222INLINE UINT32 __attribute__((const, always_inline))
223_divu_64x32(UINT64 a, UINT32 b)
213224{
214   UINT32 result, temp;
225   register UINT32 result, temp;
215226
227   /* Throws arithmetic exception if result doesn't fit in 32 bits */
216228   __asm__ (
217229      " divl  %[b] ;"
218230      : [result] "=a" (result)   /* Result ends up in eax */
r1355r1356
235247
236248#ifndef __x86_64__
237249#define div_64x32_rem _div_64x32_rem
238INLINE INT32 _div_64x32_rem(INT64 dividend, INT32 divisor, INT32 *remainder)
250INLINE INT32 __attribute__((always_inline))
251_div_64x32_rem(INT64 dividend, INT32 divisor, INT32 *remainder)
239252{
240   INT32 quotient;
253   register INT32 quotient;
241254
255   /* Throws arithmetic exception if result doesn't fit in 32 bits */
242256   __asm__ (
243257      " idivl  %[divisor] ;"
244258      : [result]    "=a" (quotient)   /* Quotient ends up in eax */
r1355r1356
261275
262276#ifndef __x86_64__
263277#define divu_64x32_rem _divu_64x32_rem
264INLINE UINT32 _divu_64x32_rem(UINT64 dividend, UINT32 divisor, UINT32 *remainder)
278INLINE UINT32 __attribute__((always_inline))
279_divu_64x32_rem(UINT64 dividend, UINT32 divisor, UINT32 *remainder)
265280{
266   UINT32 quotient;
281   register UINT32 quotient;
267282
283   /* Throws arithmetic exception if result doesn't fit in 32 bits */
268284   __asm__ (
269285      " divl  %[divisor] ;"
270286      : [result]    "=a" (quotient)   /* Quotient ends up in eax */
r1355r1356
287303
288304#ifndef __x86_64__
289305#define div_32x32_shift _div_32x32_shift
290INLINE INT32 _div_32x32_shift(INT32 a, INT32 b, UINT8 shift)
306INLINE INT32 __attribute__((const, always_inline))
307_div_32x32_shift(INT32 a, INT32 b, UINT8 shift)
291308{
292   INT32 result;
309   register INT32 result;
293310
311   /* Valid for (0 <= shift <= 31) */
312   /* Throws arithmetic exception if result doesn't fit in 32 bits */
294313   __asm__ (
295314       " cdq                          ;"
296315       " shldl  %[shift], %[a], %%edx ;"
r1355r1356
316335
317336#ifndef __x86_64__
318337#define divu_32x32_shift _divu_32x32_shift
319INLINE UINT32 _divu_32x32_shift(UINT32 a, UINT32 b, UINT8 shift)
338INLINE UINT32 __attribute__((const, always_inline))
339_divu_32x32_shift(UINT32 a, UINT32 b, UINT8 shift)
320340{
321   INT32 result;
341   register INT32 result;
322342
343   /* Valid for (0 <= shift <= 31) */
344   /* Throws arithmetic exception if result doesn't fit in 32 bits */
323345   __asm__ (
324346       " clr    %%edx                 ;"
325347       " shldl  %[shift], %[a], %%edx ;"
r1355r1356
344366
345367#ifndef __x86_64__
346368#define mod_64x32 _mod_64x32
347INLINE INT32 _mod_64x32(INT64 a, INT32 b)
369INLINE INT32 __attribute__((const, always_inline))
370_mod_64x32(INT64 a, INT32 b)
348371{
349   INT32 result, temp;
372   register INT32 result, temp;
350373
374   /* Throws arithmetic exception if quotient doesn't fit in 32 bits */
351375   __asm__ (
352376      " idivl  %[b] ;"
353377      : [result] "=d" (result)   /* Result ends up in edx */
r1355r1356
369393
370394#ifndef __x86_64__
371395#define modu_64x32 _modu_64x32
372INLINE UINT32 _modu_64x32(UINT64 a, UINT32 b)
396INLINE UINT32 __attribute__((const, always_inline))
397_modu_64x32(UINT64 a, UINT32 b)
373398{
374   UINT32 result, temp;
399   register UINT32 result, temp;
375400
401   /* Throws arithmetic exception if quotient doesn't fit in 32 bits */
376402   __asm__ (
377403      " divl  %[b] ;"
378404      : [result] "=d" (result)   /* Result ends up in edx */
r1355r1356
394420
395421#ifdef __SSE2__
396422#define recip_approx _recip_approx
397INLINE float _recip_approx(float value)
423INLINE float __attribute__((const))
424_recip_approx(float value)
398425{
399426   __m128 value_xmm = _mm_set_ss(value);
400427   __m128 result_xmm = _mm_rcp_ss(value_xmm);
r1355r1356
416443-------------------------------------------------*/
417444
418445#define count_leading_zeros _count_leading_zeros
419INLINE UINT8 _count_leading_zeros(UINT32 value)
446INLINE UINT8 __attribute__((const, always_inline))
447_count_leading_zeros(UINT32 value)
420448{
421   UINT32 result;
449   register UINT32 result;
422450
423451   __asm__ (
424452      "   bsrl  %[value], %[result] ;"
r1355r1356
440468-------------------------------------------------*/
441469
442470#define count_leading_ones _count_leading_ones
443INLINE UINT8 _count_leading_ones(UINT32 value)
471INLINE UINT8 __attribute__((const, always_inline))
472_count_leading_ones(UINT32 value)
444473{
445   UINT32 result;
474   register UINT32 result;
446475
447476   __asm__ (
448477      "   movl  %[value], %[result]  ;"
r1355r1356
473502-------------------------------------------------*/
474503
475504#define compare_exchange32 _compare_exchange32
476INLINE INT32 _compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange)
505INLINE INT32 __attribute__((nonnull(1), always_inline))
506_compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange)
477507{
478508   register INT32 result;
479509
480510   __asm__ __volatile__ (
481      " lock ; cmpxchg  %[exchange], %[ptr] ;"
511      " lock ; cmpxchgl  %[exchange], %[ptr] ;"
482512     : [ptr]      "+m" (*ptr)
483513     , [result]   "=a" (result)
484514     : [compare]  "1"  (compare)
r1355r1356
499529
500530#ifdef __x86_64__
501531#define compare_exchange64 _compare_exchange64
502INLINE INT64 _compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange)
532INLINE INT64 __attribute__((nonnull(1), always_inline))
533_compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange)
503534{
504535   register INT64 result;
505536
506537   __asm__ __volatile__ (
507      " lock ; cmpxchg  %[exchange], %[ptr] ;"
538      " lock ; cmpxchgq  %[exchange], %[ptr] ;"
508539     : [ptr]      "+m" (*ptr)
509540     , [result]   "=a" (result)
510541     : [compare]  "1"  (compare)
r1355r1356
524555-------------------------------------------------*/
525556
526557#define atomic_exchange32 _atomic_exchange32
527INLINE INT32 _atomic_exchange32(INT32 volatile *ptr, INT32 exchange)
558INLINE INT32 __attribute__((nonnull(1), always_inline))
559_atomic_exchange32(INT32 volatile *ptr, INT32 exchange)
528560{
529561   register INT32 result;
530562
531563   __asm__ __volatile__ (
532      " lock ; xchg  %[exchange], %[ptr] ;"
564      " lock ; xchgl  %[exchange], %[ptr] ;"
533565      : [ptr]      "+m" (*ptr)
534566      , [result]   "=r" (result)
535567      : [exchange] "1"  (exchange)
r1355r1356
546578-------------------------------------------------*/
547579
548580#define atomic_add32 _atomic_add32
549INLINE INT32 _atomic_add32(INT32 volatile *ptr, INT32 delta)
581INLINE INT32 __attribute__((nonnull(1), always_inline))
582_atomic_add32(INT32 volatile *ptr, INT32 delta)
550583{
551584   register INT32 result = delta;
552585
553586   __asm__ __volatile__ (
554      " lock ; xadd  %[result], %[ptr] ;"
587      " lock ; xaddl  %[result], %[ptr] ;"
555588     : [ptr]    "+m" (*ptr)
556589     , [result] "+r" (result)
557590     :
r1355r1356
569602-------------------------------------------------*/
570603
571604#define atomic_increment32 _atomic_increment32
572INLINE INT32 _atomic_increment32(INT32 volatile *ptr)
605INLINE INT32 __attribute__((nonnull(1), always_inline))
606_atomic_increment32(INT32 volatile *ptr)
573607{
574608   register INT32 result = 1;
575609
576610   __asm__ __volatile__ (
577      " lock ; xadd  %[result], %[ptr] ;"
611      " lock ; xaddl  %[result], %[ptr] ;"
578612     : [ptr]    "+m" (*ptr)
579613     , [result] "+r" (result)
580614     :
r1355r1356
592626-------------------------------------------------*/
593627
594628#define atomic_decrement32 _atomic_decrement32
595INLINE INT32 _atomic_decrement32(INT32 volatile *ptr)
629INLINE INT32 __attribute__((nonnull(1), always_inline))
630_atomic_decrement32(INT32 volatile *ptr)
596631{
597632   register INT32 result = -1;
598633
599634   __asm__ __volatile__ (
600      " lock ; xadd  %[result], %[ptr] ;"
635      " lock ; xaddl  %[result], %[ptr] ;"
601636     : [ptr]    "+m" (*ptr)
602637     , [result] "+r" (result)
603638     :
src/emu/video/tms34061.c
r1355r1356
117117   tms34061.regs[TMS34061_VERCOUNTER]   = 0x0000;
118118
119119   /* start vertical interrupt timer */
120   tms34061.timer = timer_alloc(tms34061_interrupt);
120   tms34061.timer = timer_alloc(tms34061_interrupt, NULL);
121121}
122122
123123
src/emu/video/voodoo.c
r1355r1356
199199static void soft_reset(voodoo_state *v);
200200static void check_stalled_cpu(voodoo_state *v, attotime current_time);
201201static void flush_fifos(voodoo_state *v, attotime current_time);
202static TIMER_CALLBACK_PTR( stall_cpu_callback );
202static TIMER_CALLBACK( stall_cpu_callback );
203203static void stall_cpu(voodoo_state *v, int state, attotime current_time);
204static TIMER_CALLBACK_PTR( vblank_callback );
204static TIMER_CALLBACK( vblank_callback );
205205static INT32 register_w(voodoo_state *v, offs_t offset, UINT32 data);
206206static INT32 lfb_w(voodoo_state *v, offs_t offset, UINT32 data, UINT32 mem_mask, int forcefront);
207207static INT32 texture_w(voodoo_state *v, offs_t offset, UINT32 data);
r1355r1356
380380   v->pci.fifo.size = 64*2;
381381   v->pci.fifo.in = v->pci.fifo.out = 0;
382382   v->pci.stall_state = NOT_STALLED;
383   v->pci.continue_timer = timer_alloc_ptr(stall_cpu_callback, v);
383   v->pci.continue_timer = timer_alloc(stall_cpu_callback, v);
384384
385385   /* allocate memory */
386386   if (type <= VOODOO_2)
r1355r1356
803803   }
804804
805805   /* allocate a VBLANK timer */
806   f->vblank_timer = timer_alloc_ptr(vblank_callback, v);
806   f->vblank_timer = timer_alloc(vblank_callback, v);
807807   f->vblank = FALSE;
808808
809809   /* initialize the memory FIFO */
r1355r1356
10871087   /* if zero, adjust to next frame, otherwise we may get stuck in an infinite loop */
10881088   if (attotime_compare(vblank_period, attotime_zero) == 0)
10891089      vblank_period = video_screen_get_frame_period(v->scrnum);
1090   timer_adjust_ptr(v->fbi.vblank_timer, vblank_period, attotime_never);
1090   timer_adjust(v->fbi.vblank_timer, vblank_period, 0, attotime_never);
10911091}
10921092
10931093
1094static TIMER_CALLBACK_PTR( vblank_off_callback )
1094static TIMER_CALLBACK( vblank_off_callback )
10951095{
1096   voodoo_state *v = param;
1096   voodoo_state *v = ptr;
10971097
10981098   if (LOG_VBLANK_SWAP) logerror("--- vblank end\n");
10991099
r1355r1356
11071107}
11081108
11091109
1110static TIMER_CALLBACK_PTR( vblank_callback )
1110static TIMER_CALLBACK( vblank_callback )
11111111{
1112   voodoo_state *v = param;
1112   voodoo_state *v = ptr;
11131113
11141114   if (LOG_VBLANK_SWAP) logerror("--- vblank start\n");
11151115
r1355r1356
11351135      swap_buffers(v);
11361136
11371137   /* set a timer for the next off state */
1138   timer_set_ptr(video_screen_get_time_until_pos(v->scrnum, 0, 0), v, vblank_off_callback);
1138   timer_set(video_screen_get_time_until_pos(v->scrnum, 0, 0), v, 0, vblank_off_callback);
11391139
11401140   /* set internal state and call the client */
11411141   v->fbi.vblank = TRUE;
r1355r1356
21392139 *
21402140 *************************************/
21412141
2142static TIMER_CALLBACK_PTR( stall_cpu_callback )
2142static TIMER_CALLBACK( stall_cpu_callback )
21432143{
2144   check_stalled_cpu(param, timer_get_time());
2144   check_stalled_cpu(ptr, timer_get_time());
21452145}
21462146
21472147
r1355r1356
21942194   /* if not, set a timer for the next one */
21952195   else
21962196   {
2197      timer_adjust_ptr(v->pci.continue_timer, attotime_sub(v->pci.op_end_time, current_time), attotime_never);
2197      timer_adjust(v->pci.continue_timer, attotime_sub(v->pci.op_end_time, current_time), 0, attotime_never);
21982198   }
21992199}
22002200
r1355r1356
22152215      cpu_spinuntil_trigger(v->trigger);
22162216
22172217   /* set a timer to clear the stall */
2218   timer_adjust_ptr(v->pci.continue_timer, attotime_sub(v->pci.op_end_time, current_time), attotime_never);
2218   timer_adjust(v->pci.continue_timer, attotime_sub(v->pci.op_end_time, current_time), 0, attotime_never);
22192219}
22202220
22212221
src/emu/video/rgbvmx.h
r1355r1356
1212#ifndef __RGBVMX__
1313#define __RGBVMX__
1414
15#ifndef __APPLE_ALTIVEC__
1516#include <altivec.h>
17#endif
1618
1719
1820/***************************************************************************
src/emu/video/crtc6845.c
r1355r1356
5454static void crtc6845_state_save_postload(void *param);
5555static void configure_screen(crtc6845_state *chip, int postload);
5656static void update_timer(crtc6845_state *chip);
57static TIMER_CALLBACK_PTR( display_enable_changed_timer_cb );
57static TIMER_CALLBACK( display_enable_changed_timer_cb );
5858
5959
6060void crtc6845_init(void)
r1355r1356
9898   /* create the timer if the user is interested in getting display enable
9999       notifications */
100100   if (intf->display_enable_changed)
101      chip->display_enable_changed_timer = timer_alloc_ptr(display_enable_changed_timer_cb, chip);
101      chip->display_enable_changed_timer = timer_alloc(display_enable_changed_timer_cb, chip);
102102}
103103
104104
r1355r1356
334334      else
335335         duration = attotime_never;
336336
337      timer_adjust_ptr(chip->display_enable_changed_timer, duration, attotime_never);
337      timer_adjust(chip->display_enable_changed_timer, duration, 0, attotime_never);
338338   }
339339}
340340
341341
342static TIMER_CALLBACK_PTR( display_enable_changed_timer_cb )
342static TIMER_CALLBACK( display_enable_changed_timer_cb )
343343{
344   crtc6845_state *chip = param;
344   crtc6845_state *chip = ptr;
345345
346346   /* call the callback function -- we know it exists */
347347   chip->intf->display_enable_changed(is_display_enabled(chip));
src/emu/uimenu.c
r1355r1356
229229{
230230   int num = 0;
231231
232   while (dip_switch_model[num].dip_name != NULL && num++ < MAX_PHYSICAL_DIPS)
233      ;
232   while (dip_switch_model[num].dip_name != NULL && num < MAX_PHYSICAL_DIPS)
233      num++;
234234
235235   return num;
236236}
src/emu/video.c
r1355r1356
301301         internal_screen_info *info = &viddata->scrinfo[scrnum];
302302
303303         /* allocate a timer to reset partial updates */
304         info->scanline0_timer = timer_alloc(scanline0_callback);
304         info->scanline0_timer = timer_alloc(scanline0_callback, NULL);
305305
306306         /* make pointers back to the config and state */
307307         info->config = &machine->drv->screen[scrnum];
r1355r1356
10171017    operations
10181018-------------------------------------------------*/
10191019
1020void video_frame_update(void)
1020void video_frame_update(int debug)
10211021{
10221022   attotime current_time = timer_get_time();
10231023   int skipped_it = global.skipping_this_frame;
r1355r1356
10271027#ifdef MAME_DEBUG
10281028   if (phase == MAME_PHASE_RUNNING)
10291029#else
1030   if (phase == MAME_PHASE_RUNNING && !mame_is_paused(Machine))
1030   if (phase == MAME_PHASE_RUNNING && (debug || !mame_is_paused(Machine)))
10311031#endif
10321032   {
10331033      int anything_changed = finish_screen_updates(Machine);
r1355r1356
10451045   ui_update_and_render();
10461046
10471047   /* if we're throttling, synchronize before rendering */
1048   if (!skipped_it && effective_throttle())
1048   if (!debug && !skipped_it && effective_throttle())
10491049      update_throttle(current_time);
10501050
10511051   /* ask the OSD to update */
10521052   profiler_mark(PROFILER_BLIT);
1053   osd_update(skipped_it);
1053   osd_update(!debug && skipped_it);
10541054   profiler_mark(PROFILER_END);
10551055
10561056   /* perform tasks for this frame */
1057   mame_frame_update(Machine);
1057   if (!debug)
1058      mame_frame_update(Machine);
10581059
10591060   /* update frameskipping */
1060   update_frameskip();
1061   if (!debug)
1062      update_frameskip();
10611063
10621064   /* update speed computations */
1063   if (!skipped_it)
1065   if (!debug && !skipped_it)
10641066      recompute_speed(current_time);
10651067
10661068   /* call the end-of-frame callback */
10671069   if (phase == MAME_PHASE_RUNNING)
10681070   {
10691071      /* reset partial updates if we're paused or if the debugger is active */
1070      if (video_screen_exists(0) && (mame_is_paused(Machine) || mame_debug_is_active()))
1071         scanline0_callback(Machine, 0);
1072      if (video_screen_exists(0) && (mame_is_paused(Machine) || debug || mame_debug_is_active()))
1073         scanline0_callback(Machine, NULL, 0);
10721074
10731075      /* otherwise, call the video EOF callback */
10741076      else if (Machine->drv->video_eof != NULL)
src/emu/memory.c
r1355r1356
595595   entry = space->readlookup[LEVEL1_INDEX(pc)];
596596   if (entry >= SUBTABLE_BASE)
597597      entry = space->readlookup[LEVEL2_INDEX(entry,pc)];
598
599   /* if this entry if the current one, no need to go further */
600   if (entry == opcode_entry)
601      return;
602
603   /* keep track of current entry */
598604   opcode_entry = entry;
599605
600606   /* if we don't map to a bank, see if there are any banks we can map to */
src/emu/audit.h
r1355r1356
2828#define AUDIT_VALIDATE_FULL            (HASH_CRC | HASH_SHA)
2929
3030/* return values from audit_verify_roms and audit_verify_samples */
31#define CORRECT                     0
32#define BEST_AVAILABLE               1
33#define INCORRECT                  2
34#define NOTFOUND                  3
31enum
32{
33   CORRECT = 0,
34   BEST_AVAILABLE,
35   INCORRECT,
36   NOTFOUND
37};
3538
3639/* image types for audit_record.type */
37#define AUDIT_FILE_ROM               0
38#define AUDIT_FILE_DISK               1
39#define AUDIT_FILE_SAMPLE            2
40enum
41{
42   AUDIT_FILE_ROM = 0,
43   AUDIT_FILE_DISK,
44   AUDIT_FILE_SAMPLE
45};
4046
4147/* status values for audit_record.status */
42#define AUDIT_STATUS_GOOD            0
43#define AUDIT_STATUS_FOUND_INVALID      1
44#define AUDIT_STATUS_NOT_FOUND         2
45#define AUDIT_STATUS_ERROR            3
48enum
49{
50   AUDIT_STATUS_GOOD = 0,
51   AUDIT_STATUS_FOUND_INVALID,
52   AUDIT_STATUS_NOT_FOUND,
53   AUDIT_STATUS_ERROR
54};
4655
4756/* substatus values for audit_record.substatus */
48#define SUBSTATUS_GOOD               0
49#define SUBSTATUS_GOOD_NEEDS_REDUMP      1
50#define SUBSTATUS_FOUND_NODUMP         2
51#define SUBSTATUS_FOUND_BAD_CHECKSUM   3
52#define SUBSTATUS_FOUND_WRONG_LENGTH   4
53#define SUBSTATUS_NOT_FOUND            5
54#define SUBSTATUS_NOT_FOUND_NODUMP      6
55#define SUBSTATUS_NOT_FOUND_OPTIONAL   7
56#define SUBSTATUS_NOT_FOUND_PARENT      8
57#define SUBSTATUS_NOT_FOUND_BIOS      9
58#define SUBSTATUS_ERROR               100
57enum
58{
59   SUBSTATUS_GOOD = 0,
60   SUBSTATUS_GOOD_NEEDS_REDUMP,
61   SUBSTATUS_FOUND_NODUMP,
62   SUBSTATUS_FOUND_BAD_CHECKSUM,
63   SUBSTATUS_FOUND_WRONG_LENGTH,
64   SUBSTATUS_NOT_FOUND,
65   SUBSTATUS_NOT_FOUND_NODUMP,
66   SUBSTATUS_NOT_FOUND_OPTIONAL,
67   SUBSTATUS_NOT_FOUND_PARENT,
68   SUBSTATUS_NOT_FOUND_BIOS,
69   SUBSTATUS_ERROR = 100
70};
5971
6072
6173
src/emu/video.h
r1355r1356
117117/* ----- global rendering ----- */
118118
119119/* update the screen, handling frame skipping and rendering */
120void video_frame_update(void);
120void video_frame_update(int debug);
121121
122122
123123/* ----- throttling/frameskipping/performance ----- */
src/emu/memory.h
r1355r1356
158158#define AMEF_UNMAP(x)         (((x) << AMEF_UNMAP_SHIFT) | AMEF_SPECIFIES_UNMAP) /* specifies a given unmap value */
159159
160160/* ----- static data access handler constants ----- */
161#define STATIC_INVALID         0                  /* invalid - should never be used */
162#define STATIC_BANK1         1                  /* banked memory #1 */
163#define STATIC_BANK2         2                  /* banked memory #2 */
164#define STATIC_BANK3         3                  /* banked memory #3 */
165#define STATIC_BANK4         4                  /* banked memory #4 */
166#define STATIC_BANK5         5                  /* banked memory #5 */
167#define STATIC_BANK6         6                  /* banked memory #6 */
168#define STATIC_BANK7         7                  /* banked memory #7 */
169#define STATIC_BANK8         8                  /* banked memory #8 */
170#define STATIC_BANK9         9                  /* banked memory #9 */
171#define STATIC_BANK10         10                  /* banked memory #10 */
172#define STATIC_BANK11         11                  /* banked memory #11 */
173#define STATIC_BANK12         12                  /* banked memory #12 */
174#define STATIC_BANK13         13                  /* banked memory #13 */
175#define STATIC_BANK14         14                  /* banked memory #14 */
176#define STATIC_BANK15         15                  /* banked memory #15 */
177#define STATIC_BANK16         16                  /* banked memory #16 */
178#define STATIC_BANK17         17                  /* banked memory #17 */
179#define STATIC_BANK18         18                  /* banked memory #18 */
180#define STATIC_BANK19         19                  /* banked memory #19 */
181#define STATIC_BANK20         20                  /* banked memory #20 */
182#define STATIC_BANK21         21                  /* banked memory #21 */
183#define STATIC_BANK22         22                  /* banked memory #22 */
184#define STATIC_BANK23         23                  /* banked memory #23 */
185#define STATIC_BANK24         24                  /* banked memory #24 */
186#define STATIC_BANK25         25                  /* banked memory #25 */
187#define STATIC_BANK26         26                  /* banked memory #26 */
188#define STATIC_BANK27         27                  /* banked memory #27 */
189#define STATIC_BANK28         28                  /* banked memory #28 */
190#define STATIC_BANK29         29                  /* banked memory #29 */
191#define STATIC_BANK30         30                  /* banked memory #30 */
192#define STATIC_BANK31         31                  /* banked memory #31 */
193#define STATIC_BANK32         32                  /* banked memory #32 */
161enum
162{
163   STATIC_INVALID = 0,   /* invalid - should never be used */
164   STATIC_BANK1,      /* banked memory */
165   STATIC_BANK2,
166   STATIC_BANK3,
167   STATIC_BANK4,
168   STATIC_BANK5,
169   STATIC_BANK6,
170   STATIC_BANK7,
171   STATIC_BANK8,
172   STATIC_BANK9,
173   STATIC_BANK10,
174   STATIC_BANK11,
175   STATIC_BANK12,
176   STATIC_BANK13,
177   STATIC_BANK14,
178   STATIC_BANK15,
179   STATIC_BANK16,
180   STATIC_BANK17,
181   STATIC_BANK18,
182   STATIC_BANK19,
183   STATIC_BANK20,
184   STATIC_BANK21,
185   STATIC_BANK22,
186   STATIC_BANK23,
187   STATIC_BANK24,
188   STATIC_BANK25,
189   STATIC_BANK26,
190   STATIC_BANK27,
191   STATIC_BANK28,
192   STATIC_BANK29,
193   STATIC_BANK30,
194   STATIC_BANK31,
195   STATIC_BANK32,
194196/* entries 33-67 are reserved for dynamically allocated internal banks */
195#define STATIC_RAM            68                  /* RAM - standard reads/writes */
196#define STATIC_ROM            69                  /* ROM - standard reads, no writes */
197#define STATIC_NOP            70                  /* unmapped - all unmapped memory goes here */
198#define STATIC_UNMAP         71                  /* unmapped - all unmapped memory goes here */
199#define STATIC_COUNT         72                  /* total number of static handlers */
197   STATIC_RAM = 68,   /* RAM - standard reads/writes */
198   STATIC_ROM,      /* ROM - standard reads, no writes */
199   STATIC_NOP,
200   STATIC_UNMAP,      /* unmapped - all unmapped memory goes here */
201   STATIC_COUNT      /* total number of static handlers */
202};
200203
201204/* ----- banking constants ----- */
202205#define MAX_BANKS            66                  /* maximum number of banks */
r1355r1356
717720***************************************************************************/
718721
719722/* ----- address spaces ----- */
720#define ADDRESS_SPACES         3                  /* maximum number of address spaces */
721#define ADDRESS_SPACE_PROGRAM   0                  /* program address space */
722#define ADDRESS_SPACE_DATA      1                  /* data address space */
723#define ADDRESS_SPACE_IO      2                  /* I/O address space */
723enum
724{
725   ADDRESS_SPACE_PROGRAM = 0,         /* program address space */
726   ADDRESS_SPACE_DATA,            /* data address space */
727   ADDRESS_SPACE_IO,            /* I/O address space */
728   ADDRESS_SPACES               /* maximum number of address spaces */
729};
724730
725731extern const char *address_space_names[ADDRESS_SPACES];
726732
r1355r1356
11531159INLINE UINT64 cpu_readop_arg64(offs_t A)   { if (address_is_unsafe(A)) { memory_set_opbase(A); } return cpu_readop_arg64_unsafe(A); }
11541160
11551161/* ----- bank switching for CPU cores ----- */
1156#define change_pc(pc)                                                   \
1157do {                                                               \
1158   if (active_address_space[ADDRESS_SPACE_PROGRAM].readlookup[LEVEL1_INDEX((pc) & active_address_space[ADDRESS_SPACE_PROGRAM].addrmask)] != opcode_entry)   \
1159      memory_set_opbase(pc);                                             \
1160} while (0)                                                            \
1162#define change_pc(pc)            memory_set_opbase(pc);
11611163
11621164/* ----- forces the next branch to generate a call to the opbase handler ----- */
11631165#define catch_nextBranch()         (opcode_entry = 0xff)
src/emu/mame.c
r1355r1356
378378         begin_resource_tracking();
379379
380380         /* perform a soft reset -- this takes us to the running phase */
381         soft_reset(machine, 0);
381         soft_reset(machine, NULL, 0);
382382
383383         /* run the CPUs until a reset or exit */
384384         mame->hard_reset_pending = FALSE;
r1355r1356
392392
393393            /* otherwise, just pump video updates through */
394394            else
395               video_frame_update();
395               video_frame_update(FALSE);
396396
397397            /* handle save/load */
398398            if (mame->saveload_schedule_callback)
r1355r1356
15081508   /* initialize the timers and allocate a soft_reset timer */
15091509   /* this must be done before cpu_init so that CPU's can allocate timers */
15101510   timer_init(machine);
1511   mame->soft_reset_timer = timer_alloc(soft_reset);
1511   mame->soft_reset_timer = timer_alloc(soft_reset, NULL);
15121512
15131513   /* init the osd layer */
15141514   osd_init(machine);
src/emu/eigccppc.h
r1355r1356
2323    multiply and return the full 64 bit result
2424-------------------------------------------------*/
2525
26/* TBD */
26/* GCC can do a good job of this. */
2727
2828
2929/*-------------------------------------------------
r1355r1356
3232    result
3333-------------------------------------------------*/
3434
35/* TBD */
35/* GCC can do a good job of this */
3636
3737
3838/*-------------------------------------------------
r1355r1356
4242-------------------------------------------------*/
4343
4444#define mul_32x32_hi _mul_32x32_hi
45INLINE INT32 _mul_32x32_hi(INT32 val1, INT32 val2)
45INLINE INT32 __attribute__((const, always_inline))
46_mul_32x32_hi(INT32 val1, INT32 val2)
4647{
47   INT32 result;
48   register INT32 result;
4849
4950   __asm__ (
5051      " mulhw  %[result], %[val1], %[val2] \n"
r1355r1356
6465-------------------------------------------------*/
6566
6667#define mulu_32x32_hi _mulu_32x32_hi
67INLINE UINT32 _mulu_32x32_hi(UINT32 val1, UINT32 val2)
68INLINE UINT32 __attribute__((const, always_inline))
69_mulu_32x32_hi(UINT32 val1, UINT32 val2)
6870{
69   UINT32 result;
71   register UINT32 result;
7072
7173   __asm__ (
7274      " mulhwu  %[result], %[val1], %[val2] \n"
r1355r1356
8890
8991#if !defined(__ppc64__) && !defined(__PPC64__) && !defined(_ARCH_PPC64)
9092#define mul_32x32_shift _mul_32x32_shift
91INLINE INT32 _mul_32x32_shift(INT32 val1, INT32 val2, UINT8 shift)
93INLINE INT32 __attribute__((const, always_inline))
94_mul_32x32_shift(INT32 val1, INT32 val2, UINT8 shift)
9295{
93   INT32 result;
96   register INT32 result;
9497
98   /* Valid for (0 <= shift <= 32) */
9599   __asm__ (
96100      " mullw   %[result], %[val1], %[val2]    \n"
97101      " mulhw   %[val1], %[val1], %[val2]      \n"
r1355r1356
120124
121125#if !defined(__ppc64__) && !defined(__PPC64__) && !defined(_ARCH_PPC64)
122126#define mulu_32x32_shift _mulu_32x32_shift
123INLINE UINT32 _mulu_32x32_shift(UINT32 val1, UINT32 val2, UINT8 shift)
127INLINE UINT32 __attribute__((const, always_inline))
128_mulu_32x32_shift(UINT32 val1, UINT32 val2, UINT8 shift)
124129{
125   UINT32 result;
130   register UINT32 result;
126131
132   /* Valid for (0 <= shift <= 32) */
127133   __asm__ (
128134      " mullw   %[result], %[val1], %[val2]    \n"
129135      " mulhwu  %[val1], %[val1], %[val2]      \n"
r1355r1356
160166
161167
162168/*-------------------------------------------------
169    div_64x32_rem - perform a signed 64 bit x 32
170    bit divide and return the 32 bit quotient and
171    32 bit remainder
172-------------------------------------------------*/
173
174/* TBD */
175
176
177/*-------------------------------------------------
178    divu_64x32_rem - perform an unsigned 64 bit x
179    32 bit divide and return the 32 bit quotient
180    and 32 bit remainder
181-------------------------------------------------*/
182
183/* TBD */
184
185
186/*-------------------------------------------------
163187    div_32x32_shift - perform a signed divide of
164188    two 32 bit values, shifting the first before
165189    division, and returning the 32 bit quotient
r1355r1356
199223-------------------------------------------------*/
200224
201225#define recip_approx _recip_approx
202INLINE float _recip_approx(float value)
226INLINE float __attribute__((const, always_inline))
227_recip_approx(float value)
203228{
204   float result;
229   register float result;
205230
206231   __asm__ (
207232      " fres  %[result], %[value] \n"
r1355r1356
224249-------------------------------------------------*/
225250
226251#define count_leading_zeros _count_leading_zeros
227INLINE UINT8 _count_leading_zeros(UINT32 value)
252INLINE UINT8 __attribute__((const, always_inline))
253_count_leading_zeros(UINT32 value)
228254{
229   UINT32 result;
255   register UINT32 result;
230256
231257   __asm__ (
232258      " cntlzw  %[result], %[value] \n"
r1355r1356
244270-------------------------------------------------*/
245271
246272#define count_leading_ones _count_leading_ones
247INLINE UINT8 _count_leading_ones(UINT32 value)
273INLINE UINT8 __attribute__((const, always_inline))
274_count_leading_ones(UINT32 value)
248275{
249   UINT32 result;
276   register UINT32 result;
250277
251278   __asm__ (
252279      " not     %[result], %[value]  \n"
r1355r1356
272299-------------------------------------------------*/
273300
274301#define compare_exchange32 _compare_exchange32
275INLINE INT32 _compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange)
302INLINE INT32 __attribute__((nonnull(1), always_inline))
303_compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange)
276304{
277305   register INT32 result;
278306
r1355r1356
284312      "   stwcx. %[exchange], 0, %[ptr] \n"
285313      "   bne-   1b                     \n"
286314      "2:                                 "
287      : [result]   "=&r" (result)
288      : [ptr]      "r"   (ptr)
289      , [exchange] "r"   (exchange)
290      , [compare]  "r"   (compare)
291      : "cr0"
315     : [dummy]    "+m"  (*ptr)   /* Lets GCC know that *ptr will be read/written in case it's not marked volatile */
316     , [result]   "=&r" (result)
317     : [ptr]      "r"   (ptr)
318     , [exchange] "r"   (exchange)
319     , [compare]  "r"   (compare)
320     : "cr0"
292321   );
293322
294323   return result;
r1355r1356
304333
305334#if defined(__ppc64__) || defined(__PPC64__)
306335#define compare_exchange64 _compare_exchange64
307INLINE INT64 _compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange)
336INLINE INT64 __attribute__((nonnull(1), always_inline))
337_compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange)
308338{
309339   register INT64 result;
310340
r1355r1356
315345      "   stdcx. %[exchange], 0, %[ptr] \n"
316346      "   bne--  1b                     \n"
317347      "2:                                 "
318      : [result]   "=&r" (result)
319      : [ptr]      "r"   (ptr)
320      , [exchange] "r"   (exchange)
321      , [compare]  "r"   (compare)
322      : "cr0"
348     : [dummy]    "+m"  (*ptr)   /* Lets GCC know that *ptr will be read/written in case it's not marked volatile */
349     , [result]   "=&r" (result)
350     : [ptr]      "r"   (ptr)
351     , [exchange] "r"   (exchange)
352     , [compare]  "r"   (compare)
353     : "cr0"
323354   );
324355
325356   return result;
r1355r1356
334365-------------------------------------------------*/
335366
336367#define atomic_exchange32 _atomic_exchange32
337INLINE INT32 _atomic_exchange32(INT32 volatile *ptr, INT32 exchange)
368INLINE INT32 __attribute__((nonnull(1), always_inline))
369_atomic_exchange32(INT32 volatile *ptr, INT32 exchange)
338370{
339371   register INT32 result;
340372
r1355r1356
343375      "   sync                          \n"
344376      "   stwcx. %[exchange], 0, %[ptr] \n"
345377      "   bne-   1b                     \n"
346      : [result]   "=&r" (result)
347      : [ptr]      "r"   (ptr)
348      , [exchange] "r"   (exchange)
349      : "cr0"
378     : [dummy]    "+m"  (*ptr)   /* Lets GCC know that *ptr will be read/written in case it's not marked volatile */
379     , [result]   "=&r" (result)
380     : [ptr]      "r"   (ptr)
381     , [exchange] "r"   (exchange)
382     : "cr0"
350383   );
351384
352385   return result;
r1355r1356
360393-------------------------------------------------*/
361394
362395#define atomic_add32 _atomic_add32
363INLINE INT32 _atomic_add32(INT32 volatile *ptr, INT32 delta)
396INLINE INT32 __attribute__((nonnull(1), always_inline))
397_atomic_add32(INT32 volatile *ptr, INT32 delta)
364398{
365399   register INT32 result;
366400
r1355r1356
370404      "   sync                                  \n"
371405      "   stwcx. %[result], 0, %[ptr]           \n"
372406      "   bne-   1b                             \n"
373      : [result] "=&b" (result)
374      : [ptr]    "r"   (ptr)
375      , [delta]  "r"   (delta)
376      : "cr0"
407     : [dummy]  "+m"  (*ptr)   /* Lets GCC know that *ptr will be read/written in case it's not marked volatile */
408     , [result] "=&b" (result)
409     : [ptr]    "r"   (ptr)
410     , [delta]  "r"   (delta)
411     : "cr0"
377412   );
378413
379414   return result;
r1355r1356
387422-------------------------------------------------*/
388423
389424#define atomic_increment32 _atomic_increment32
390INLINE INT32 _atomic_increment32(INT32 volatile *ptr)
425INLINE INT32 __attribute__((nonnull(1), always_inline))
426_atomic_increment32(INT32 volatile *ptr)
391427{
392428   register INT32 result;
393429
r1355r1356
397433      "   sync                            \n"
398434      "   stwcx.  %[result], 0, %[ptr]    \n"
399435      "   bne-    1b                      \n"
400     : [result] "=&b" (result)
436     : [dummy]  "+m"  (*ptr)   /* Lets GCC know that *ptr will be read/written in case it's not marked volatile */
437     , [result] "=&b" (result)
401438     : [ptr]    "r"   (ptr)
402439     : "cr0"
403440   );
r1355r1356
413450-------------------------------------------------*/
414451
415452#define atomic_decrement32 _atomic_decrement32
416INLINE INT32 _atomic_decrement32(INT32 volatile *ptr)
453INLINE INT32 __attribute__((nonnull(1), always_inline))
454_atomic_decrement32(INT32 volatile *ptr)
417455{
418456   register INT32 result;
419457
r1355r1356
423461      "   sync                             \n"
424462      "   stwcx.  %[result], 0, %[ptr]     \n"
425463      "   bne-    1b                       \n"
426     : [result] "=&b" (result)
464     : [dummy]  "+m"  (*ptr)   /* Lets GCC know that *ptr will be read/written in case it's not marked volatile */
465     , [result] "=&b" (result)
427466     : [ptr]    "r"   (ptr)
428467     : "cr0"
429468   );
src/emu/machine/timekpr.c
r1355r1356
3434   int offset_flags;
3535};
3636
37struct timekeeper_chip timekeeper[ MAX_TIMEKEEPER_CHIPS ];
37static struct timekeeper_chip timekeeper[ MAX_TIMEKEEPER_CHIPS ];
3838
3939#define MASK_SECONDS ( 0x7f )
4040#define MASK_MINUTES ( 0x7f )
r1355r1356
139139   c->century = counter_from_ram( c->data, c->offset_century );
140140}
141141
142static TIMER_CALLBACK_PTR( timekeeper_tick )
142static TIMER_CALLBACK( timekeeper_tick )
143143{
144   struct timekeeper_chip *c = param;
144   struct timekeeper_chip *c = ptr;
145145
146146   int carry;
147147
r1355r1356
300300   state_save_register_item( "timekeeper", chip, c->century );
301301   state_save_register_item_pointer( "timekeeper", chip, c->data, c->size );
302302
303   timer = timer_alloc_ptr( timekeeper_tick, c );
303   timer = timer_alloc( timekeeper_tick, c );
304304   duration = ATTOTIME_IN_SEC(1);
305   timer_adjust_ptr( timer, duration, duration );
305   timer_adjust( timer, duration, 0, duration );
306306}
307307
308308static void timekeeper_nvram( int chip, mame_file *file, int read_or_write )
src/emu/machine/x76f100.c
r1355r1356
6060#define SIZE_READ_PASSWORD ( SIZE_WRITE_BUFFER )
6161#define SIZE_DATA ( 112 )
6262
63struct x76f100_chip x76f100[ X76F100_MAXCHIP ];
63static struct x76f100_chip x76f100[ X76F100_MAXCHIP ];
6464
6565#define COMMAND_WRITE ( 0x80 )
6666#define COMMAND_READ ( 0x81 )
src/emu/machine/6526cia.c
r1355r1356
117117 *
118118 *************************************/
119119
120static TIMER_CALLBACK_PTR( cia_timer_proc );
120static TIMER_CALLBACK( cia_timer_proc );
121121static void cia_timer_underflow(cia_state *cia, int timer);
122122static TIMER_CALLBACK( cia_clock_tod_callback );
123123
r1355r1356
171171   for (t = 0; t < (sizeof(cia->timer) / sizeof(cia->timer[0])); t++)
172172   {
173173      cia_timer *timer = &cia->timer[t];
174      timer->timer = timer_alloc_ptr(cia_timer_proc, timer);
174      timer->timer = timer_alloc(cia_timer_proc, timer);
175175      timer->cia = cia;
176176      timer->irq = 0x01 << t;
177177   }
178178
179179   /* setup TOD timer, if appropriate */
180180   if (intf->tod_clock)
181      timer_pulse(ATTOTIME_IN_HZ(intf->tod_clock), which, cia_clock_tod_callback);
181      timer_pulse(ATTOTIME_IN_HZ(intf->tod_clock), NULL, which, cia_clock_tod_callback);
182182
183183   /* special case; for the first CIA, set up an exit handler to clear things out */
184184   if (which == 0)
r1355r1356
323323   {
324324      /* timer is on and is connected to clock */
325325      attotime period = attotime_mul(ATTOTIME_IN_HZ(timer->cia->clock), (timer->count ? timer->count : 0x10000));
326      timer_adjust_ptr(timer->timer, period, attotime_zero);
326      timer_adjust(timer->timer, period, 0, attotime_zero);
327327   }
328328   else
329329   {
330330      /* timer is off or not connected to clock */
331      timer_adjust_ptr(timer->timer, attotime_never, attotime_zero);
331      timer_adjust(timer->timer, attotime_never, 0, attotime_zero);
332332   }
333333}
334334
r1355r1356
401401}
402402
403403
404static TIMER_CALLBACK_PTR( cia_timer_proc )
404static TIMER_CALLBACK( cia_timer_proc )
405405{
406   cia_timer *timer = param;
406   cia_timer *timer = ptr;
407407   cia_state *cia = timer->cia;
408408
409409   cia_timer_underflow(cia, timer - cia->timer);
src/emu/machine/74123.c
r1355r1356
7575}
7676
7777
78static TIMER_CALLBACK_PTR( clear_callback )
78static TIMER_CALLBACK( clear_callback )
7979{
80   TTL74123_state *chip = param;
80   TTL74123_state *chip = ptr;
8181
8282   set_output(chip);
8383}
r1355r1356
9696
9797   chip->intf = intf;
9898   chip->which = which;
99   chip->timer = timer_alloc_ptr(clear_callback, chip);
99   chip->timer = timer_alloc(clear_callback, chip);
100100
101101   /* start with the defaults */
102102   chip->A = intf->A;
r1355r1356
129129
130130      if (attotime_compare(timer_timeelapsed(chip->timer), delay_time) >= 0)
131131      {
132         timer_adjust_ptr(chip->timer, duration, attotime_never);
132         timer_adjust(chip->timer, duration, 0, attotime_never);
133133
134134         if (LOG) logerror("74123 #%d:  Retriggering pulse.  Duration: %f\n", chip->which, attotime_to_double(duration));
135135      }
r1355r1356
141141   else
142142   {
143143      /* starting */
144      timer_adjust_ptr(chip->timer, duration, attotime_never);
144      timer_adjust(chip->timer, duration, 0, attotime_never);
145145
146146      set_output(chip);
147147
r1355r1356
181181   /* clear the output if A=LO, B=HI and falling edge on clear */
182182   if (!data && chip->clear && chip->B && !chip->A && !chip->clear)
183183   {
184      timer_adjust_ptr(chip->timer, attotime_zero, attotime_never);
184      timer_adjust(chip->timer, attotime_zero, 0, attotime_never);
185185
186186      if (LOG) logerror("74123 #%d:  Cleared\n", which);
187187   }
src/emu/machine/6850acia.c
r1355r1356
168168   acia_p->cts_pin = intf->cts_pin;
169169   acia_p->rts_pin = intf->rts_pin;
170170   acia_p->dcd_pin = intf->dcd_pin;
171   acia_p->rx_timer = timer_alloc(receive_event);
172   acia_p->tx_timer = timer_alloc(transmit_event);
171   acia_p->rx_timer = timer_alloc(receive_event, NULL);
172   acia_p->tx_timer = timer_alloc(transmit_event, NULL);
173173   acia_p->int_callback = intf->int_callback;
174174   acia_p->first_reset = 1;
175175   acia_p->status_read = 0;
src/emu/machine/mb3773.c
r1355r1356
3333
3434void mb3773_init( void )
3535{
36   watchdog_timer = timer_alloc( watchdog_timeout );
36   watchdog_timer = timer_alloc( watchdog_timeout , NULL);
3737   reset_timer();
3838   state_save_register_global( ck );
3939}
src/emu/machine/idectrl.c
r1355r1356
186186 *
187187 *************************************/
188188
189static TIMER_CALLBACK_PTR( reset_callback );
189static TIMER_CALLBACK( reset_callback );
190190
191191static void ide_build_features(struct ide_state *ide);
192192
193193static void continue_read(struct ide_state *ide);
194194static void read_sector_done(struct ide_state *ide);
195static TIMER_CALLBACK_PTR( read_sector_done_callback );
195static TIMER_CALLBACK( read_sector_done_callback );
196196static void read_first_sector(struct ide_state *ide);
197197static void read_next_sector(struct ide_state *ide);
198198
r1355r1356
237237 *
238238 *************************************/
239239
240static TIMER_CALLBACK_PTR( delayed_interrupt )
240static TIMER_CALLBACK( delayed_interrupt )
241241{
242   struct ide_state *ide = param;
242   struct ide_state *ide = ptr;
243243   ide->status &= ~IDE_STATUS_BUSY;
244244   signal_interrupt(ide);
245245}
246246
247247
248static TIMER_CALLBACK_PTR( delayed_interrupt_buffer_ready )
248static TIMER_CALLBACK( delayed_interrupt_buffer_ready )
249249{
250   struct ide_state *ide = param;
250   struct ide_state *ide = ptr;
251251   ide->status &= ~IDE_STATUS_BUSY;
252252   ide->status |= IDE_STATUS_BUFFER_READY;
253253   signal_interrupt(ide);
r1355r1356
262262
263263   /* set a timer */
264264   if (buffer_ready)
265      timer_set_ptr(time, ide, delayed_interrupt_buffer_ready);
265      timer_set(time, ide, 0, delayed_interrupt_buffer_ready);
266266   else
267      timer_set_ptr(time, ide, delayed_interrupt);
267      timer_set(time, ide, 0, delayed_interrupt);
268268}
269269
270270
r1355r1356
328328   ide_build_features(ide);
329329
330330   /* create a timer for timing status */
331   ide->last_status_timer = timer_alloc(NULL);
332   ide->reset_timer = timer_alloc_ptr(reset_callback, ide);
331   ide->last_status_timer = timer_alloc(NULL, NULL);
332   ide->reset_timer = timer_alloc(reset_callback, ide);
333333
334334   /* register ide status */
335335   state_save_register_item("ide", which, ide->adapter_control);
r1355r1356
432432}
433433
434434
435static TIMER_CALLBACK_PTR( reset_callback )
435static TIMER_CALLBACK( reset_callback )
436436{
437   ide_controller_reset_ptr(param);
437   ide_controller_reset_ptr(ptr);
438438}
439439
440440
r1355r1356
736736 *
737737 *************************************/
738738
739static TIMER_CALLBACK_PTR( security_error_done )
739static TIMER_CALLBACK( security_error_done )
740740{
741   struct ide_state *ide = param;
741   struct ide_state *ide = ptr;
742742
743743   /* clear error state */
744744   ide->status &= ~IDE_STATUS_ERROR;
r1355r1356
752752   ide->status &= ~IDE_STATUS_DRIVE_READY;
753753
754754   /* just set a timer and mark ourselves error */
755   timer_set_ptr(TIME_SECURITY_ERROR, ide, security_error_done);
755   timer_set(TIME_SECURITY_ERROR, ide, 0, security_error_done);
756756}
757757
758758
r1355r1356
904904}
905905
906906
907static TIMER_CALLBACK_PTR( read_sector_done_callback )
907static TIMER_CALLBACK( read_sector_done_callback )
908908{
909   read_sector_done(param);
909   read_sector_done(ptr);
910910}
911911
912912
r1355r1356
927927         seek_time = TIME_SEEK_MULTISECTOR;
928928
929929      ide->cur_lba = new_lba;
930      timer_set_ptr(seek_time, ide, read_sector_done_callback);
930      timer_set(seek_time, ide, 0, read_sector_done_callback);
931931   }
932932   else
933      timer_set_ptr(TIME_PER_SECTOR, ide, read_sector_done_callback);
933      timer_set(TIME_PER_SECTOR, ide, 0, read_sector_done_callback);
934934}
935935
936936
r1355r1356
946946         read_sector_done(ide);
947947      else
948948         /* just set a timer */
949         timer_set_ptr(ATTOTIME_IN_USEC(1), ide, read_sector_done_callback);
949         timer_set(ATTOTIME_IN_USEC(1), ide, 0, read_sector_done_callback);
950950   }
951951   else
952952      /* just set a timer */
953      timer_set_ptr(TIME_PER_SECTOR, ide, read_sector_done_callback);
953      timer_set(TIME_PER_SECTOR, ide, 0, read_sector_done_callback);
954954}
955955
956956
r1355r1356
962962 *************************************/
963963
964964static void write_sector_done(struct ide_state *ide);
965static TIMER_CALLBACK_PTR( write_sector_done_callback );
965static TIMER_CALLBACK( write_sector_done_callback );
966966
967967static void continue_write(struct ide_state *ide)
968968{
r1355r1356
983983      else
984984      {
985985         /* set a timer to do the write */
986         timer_set_ptr(TIME_PER_SECTOR, ide, write_sector_done_callback);
986         timer_set(TIME_PER_SECTOR, ide, 0, write_sector_done_callback);
987987      }
988988   }
989989   else
990990   {
991991      /* set a timer to do the write */
992      timer_set_ptr(TIME_PER_SECTOR, ide, write_sector_done_callback);
992      timer_set(TIME_PER_SECTOR, ide, 0, write_sector_done_callback);
993993   }
994994}
995995
r1355r1356
11061106}
11071107
11081108
1109static TIMER_CALLBACK_PTR( write_sector_done_callback )
1109static TIMER_CALLBACK( write_sector_done_callback )
11101110{
1111   write_sector_done(param);
1111   write_sector_done(ptr);
11121112}
11131113
11141114
r1355r1356
15631563         {
15641564            ide->status |= IDE_STATUS_BUSY;
15651565            ide->status &= ~IDE_STATUS_DRIVE_READY;
1566            timer_adjust_ptr(ide->reset_timer, ATTOTIME_IN_MSEC(5), attotime_zero);
1566            timer_adjust(ide->reset_timer, ATTOTIME_IN_MSEC(5), 0, attotime_zero);
15671567         }
15681568         break;
15691569   }
src/emu/machine/6532riot.c
r1355r1356
286286
287287   r6532[which].shift = 10;
288288
289   r6532[which].counter_timer = timer_alloc(r6532_irq_timer_callback);
289   r6532[which].counter_timer = timer_alloc(r6532_irq_timer_callback, NULL);
290290
291291   r6532_set_timer( which, 0xFF );
292292
src/emu/machine/6522via.c
r1355r1356
251251      v->shift_counter = (v->shift_counter + 1) % 8;
252252
253253      if (v->shift_counter)
254         timer_set(v_cycles_to_time(v, 2), which, via_shift_callback);
254         timer_set(v_cycles_to_time(v, 2), NULL, which, via_shift_callback);
255255      else
256256      {
257257         if (!(v->ifr & INT_SR))
r1355r1356
365365      v.time2 = via[i].time2;
366366      v.clock = via[i].clock;
367367
368      v.t1 = timer_alloc(via_t1_timeout);
368      v.t1 = timer_alloc(via_t1_timeout, NULL);
369369      v.t1_active = 0;
370      v.t2 = timer_alloc(via_t2_timeout);
370      v.t2 = timer_alloc(via_t2_timeout, NULL);
371371      v.t2_active = 0;
372372
373373      via[i] = v;
r1355r1356
524524      if (SO_O2_CONTROL(v->acr))
525525      {
526526         v->shift_counter=0;
527         timer_set(v_cycles_to_time(v, 2), which,via_shift_callback);
527         timer_set(v_cycles_to_time(v, 2), NULL, which,via_shift_callback);
528528      }
529529      break;
530530
r1355r1356
754754      via_clear_int(which, INT_SR);
755755      if (SO_O2_CONTROL(v->acr))
756756      {
757         timer_set(v_cycles_to_time(v, 2), which,via_shift_callback);
757         timer_set(v_cycles_to_time(v, 2), NULL, which, via_shift_callback);
758758      }
759759      break;
760760
src/emu/machine/wd33c93.c
r1355r1356
351351      }
352352
353353      /* queue up a service request out in the future */
354      timer_set( ATTOTIME_IN_USEC(50), 0, wd33c93_service_request );
354      timer_set( ATTOTIME_IN_USEC(50), NULL, 0, wd33c93_service_request );
355355   }
356356   else
357357   {
r1355r1356
423423         scsi_data.busphase = PHS_MESS_IN;
424424
425425         /* queue up a service request out in the future */
426         timer_set( ATTOTIME_IN_MSEC(50), 0, wd33c93_service_request );
426         timer_set( ATTOTIME_IN_MSEC(50), NULL, 0, wd33c93_service_request );
427427      }
428428   }
429429   else
r1355r1356
453453   scsi_data.regs[WD_AUXILIARY_STATUS] |= ASR_CIP;
454454
455455   /* the command will be completed once the data is transferred */
456   timer_set( ATTOTIME_IN_MSEC(1), 0, wd33c93_deassert_cip );
456   timer_set( ATTOTIME_IN_MSEC(1), NULL, 0, wd33c93_deassert_cip );
457457}
458458
459459/* Command handlers */
r1355r1356
802802   }
803803
804804   /* allocate a timer for commands */
805   scsi_data.cmd_timer = timer_alloc(wd33c93_complete_cb);
805   scsi_data.cmd_timer = timer_alloc(wd33c93_complete_cb, NULL);
806806
807807   scsi_data.temp_input = auto_malloc( TEMP_INPUT_LEN );
808808
src/emu/machine/pic8259.c
r1355r1356
8181
8282   for (i = 0; i < count; i++)
8383   {
84      pic[i].timer = timer_alloc(pic8259_timerproc);
84      pic[i].timer = timer_alloc(pic8259_timerproc, NULL);
8585      pic[i].set_int_line = set_int_line;
8686   }
8787
src/emu/machine/upd4701.c
r1355r1356
2626   int cf;
2727};
2828
29struct uPD4701_chip uPD4701[ UPD4701_MAXCHIP ];
29static struct uPD4701_chip uPD4701[ UPD4701_MAXCHIP ];
3030
3131#define MASK_SWITCHES ( 7 )
3232#define MASK_COUNTER ( 0xfff )
src/emu/machine/intelfsh.c
r1355r1356
4848
4949static struct flash_chip chips[FLASH_CHIPS_MAX];
5050
51static TIMER_CALLBACK_PTR( erase_finished )
51static TIMER_CALLBACK( erase_finished )
5252{
53   struct flash_chip *c = param;
53   struct flash_chip *c = ptr;
5454
5555   switch( c->flash_mode )
5656   {
r1355r1356
131131   c->status = 0x80;
132132   c->flash_mode = FM_NORMAL;
133133   c->flash_master_lock = 0;
134   c->timer = timer_alloc_ptr(erase_finished, c);
134   c->timer = timer_alloc(erase_finished, c);
135135   c->flash_memory = data;
136136
137137   state_save_register_item( "intelfsh", chip, c->status );
r1355r1356
335335         c->status = 1 << 3;
336336         c->flash_mode = FM_ERASEAMD4;
337337
338         timer_adjust_ptr( c->timer, ATTOTIME_IN_SEC( 17 ), attotime_zero );
338         timer_adjust( c->timer, ATTOTIME_IN_SEC( 17 ), 0, attotime_zero );
339339      }
340340      else if( ( data & 0xff ) == 0x30 )
341341      {
r1355r1356
360360         c->status = 1 << 3;
361361         c->flash_mode = FM_ERASEAMD4;
362362
363         timer_adjust_ptr( c->timer, ATTOTIME_IN_SEC( 1 ), attotime_zero );
363         timer_adjust( c->timer, ATTOTIME_IN_SEC( 1 ), 0, attotime_zero );
364364      }
365365      else
366366      {
r1355r1356
429429         c->status = 0x00;
430430         c->flash_mode = FM_READSTATUS;
431431
432         timer_adjust_ptr( c->timer, ATTOTIME_IN_SEC( 1 ), attotime_zero );
432         timer_adjust( c->timer, ATTOTIME_IN_SEC( 1 ), 0, attotime_zero );
433433         break;
434434      }
435435      else
src/emu/machine/ds2401.c
r1355r1356
168168   state_save_register_item( "ds2401", which, c->tx );
169169   state_save_register_item_pointer( "ds2401", which, data, SIZE_DATA );
170170
171   c->timer = timer_alloc( ds2401_tick );
172   c->reset_timer = timer_alloc( ds2401_reset );
171   c->timer = timer_alloc( ds2401_tick , NULL);
172   c->reset_timer = timer_alloc( ds2401_reset , NULL);
173173}
174174
175175void ds2401_write( int which, int data )
src/emu/machine/6840ptm.c
r1355r1356
355355      }
356356   }
357357
358   ptm[which].timer[0] = timer_alloc(ptm6840_t1_timeout);
359   ptm[which].timer[1] = timer_alloc(ptm6840_t2_timeout);
360   ptm[which].timer[2] = timer_alloc(ptm6840_t3_timeout);
358   ptm[which].timer[0] = timer_alloc(ptm6840_t1_timeout, NULL);
359   ptm[which].timer[1] = timer_alloc(ptm6840_t2_timeout, NULL);
360   ptm[which].timer[2] = timer_alloc(ptm6840_t3_timeout, NULL);
361361
362362   for (i = 0; i < 3; i++)
363363      timer_enable(ptm[which].timer[i], FALSE);
src/emu/machine/am53cf96.c
r1355r1356
159159         case 3:   // reset SCSI bus
160160            scsi_regs[REG_INTSTATE] = 4;   // command sent OK
161161            xfer_state = 0;
162            timer_set( ATTOTIME_IN_HZ( 16384 ), 0, am53cf96_irq );
162            timer_set( ATTOTIME_IN_HZ( 16384 ), NULL, 0, am53cf96_irq );
163163            break;
164164         case 0x42:       // select with ATN steps
165            timer_set( ATTOTIME_IN_HZ( 16384 ), 0, am53cf96_irq );
165            timer_set( ATTOTIME_IN_HZ( 16384 ), NULL, 0, am53cf96_irq );
166166            if ((fifo[1] == 0) || (fifo[1] == 0x48) || (fifo[1] == 0x4b))
167167            {
168168               scsi_regs[REG_INTSTATE] = 6;
r1355r1356
192192         case 0x10:   // information transfer (must not change xfer_state)
193193         case 0x11:   // second phase of information transfer
194194         case 0x12:   // message accepted
195            timer_set( ATTOTIME_IN_HZ( 16384 ), 0, am53cf96_irq );
195            timer_set( ATTOTIME_IN_HZ( 16384 ), NULL, 0, am53cf96_irq );
196196            scsi_regs[REG_INTSTATE] = 6;   // command sent OK
197197            break;
198198         default:
src/emu/machine/pc16552d.c
r1355r1356
394394   duart[chip].ch[1].pending_interrupt = 0;
395395
396396   // allocate transmit timers
397   duart[chip].ch[0].tx_fifo_timer = timer_alloc(tx_fifo_timer_callback);
397   duart[chip].ch[0].tx_fifo_timer = timer_alloc(tx_fifo_timer_callback, NULL);
398398   timer_adjust(duart[chip].ch[0].tx_fifo_timer, attotime_never, (chip * 2) + 0, attotime_never);
399399
400   duart[chip].ch[1].tx_fifo_timer = timer_alloc(tx_fifo_timer_callback);
400   duart[chip].ch[1].tx_fifo_timer = timer_alloc(tx_fifo_timer_callback, NULL);
401401   timer_adjust(duart[chip].ch[1].tx_fifo_timer, attotime_never, (chip * 2) + 1, attotime_never);
402402}
403403
src/emu/machine/generic.c
r1355r1356
578578
579579   /* make sure there are no queued interrupts */
580580   if (enabled == 0)
581      timer_call_after_resynch(cpunum, clear_all_lines);
581      timer_call_after_resynch(NULL, cpunum, clear_all_lines);
582582}
583583
584584
src/emu/machine/x76f041.c
r1355r1356
7878#define BCR_Z ( 2 )
7979#define BCR_T ( 1 )
8080
81struct x76f041_chip x76f041[ X76F041_MAXCHIP ];
81static struct x76f041_chip x76f041[ X76F041_MAXCHIP ];
8282
8383#define COMMAND_WRITE ( 0x00 )
8484#define COMMAND_READ ( 0x20 )
src/emu/machine/8042kbdc.c
r1355r1356
280280   kbdc8042.inport = 0xa0;
281281   at_8042_set_outport(0xfe, 1);
282282
283   timer_pulse(ATTOTIME_IN_HZ(60), 0, kbdc8042_time);
283   timer_pulse(ATTOTIME_IN_HZ(60), NULL, 0, kbdc8042_time);
284284}
285285
286286static void at_8042_receive(int data)
r1355r1356
522522         break;
523523      case 0xaa:   /* selftest */
524524         if (Machine->drv->cpu[0].type == CPU_I486)
525            timer_set(ATTOTIME_IN_MSEC(10), 0x55, at_8042_receive_timer); /* HACK */
525            timer_set(ATTOTIME_IN_MSEC(10), NULL, 0x55, at_8042_receive_timer); /* HACK */
526526         else
527527            at_8042_receive(0x55);
528528         break;
src/emu/machine/8237dma.c
r1355r1356
7575   for (which = 0; which < dma_count; which++)
7676   {
7777      dma[which].status = 0x0F;
78      dma[which].timer = timer_alloc(dma8237_timerproc);
79      dma[which].msbflip_timer = timer_alloc(dma8237_msbflip_timerproc);
78      dma[which].timer = timer_alloc(dma8237_timerproc, NULL);
79      dma[which].msbflip_timer = timer_alloc(dma8237_msbflip_timerproc, NULL);
8080      dma[which].eop = 1;
8181   }
8282   return 0;
r1355r1356
406406   int param;
407407
408408   param = (which << 3) | (channel << 1) | (state ? 1 : 0);
409   //timer_call_after_resynch(param, dma8237_drq_write_callback);
409   //timer_call_after_resynch(NULL, param, dma8237_drq_write_callback);
410410   dma8237_drq_write_callback(param);
411411}
412412
src/emu/machine/z80sio.c
r1355r1356
296296
297297   memset(sio, 0, sizeof(*sio));
298298
299   sio->chan[0].receive_timer = timer_alloc(serial_callback);
300   sio->chan[1].receive_timer = timer_alloc(serial_callback);
299   sio->chan[0].receive_timer = timer_alloc(serial_callback, NULL);
300   sio->chan[1].receive_timer = timer_alloc(serial_callback, NULL);
301301
302302   sio->irq_cb = intf->irq_cb;
303303   sio->dtr_changed_cb = intf->dtr_changed_cb;
r1355r1356
587587void z80sio_set_cts(int which, int ch, int state)
588588{
589589   /* operate deferred */
590   timer_call_after_resynch((SIO_RR0_CTS << 8) + (state != 0) * 0x80 + which * 2 + ch, change_input_line);
590   timer_call_after_resynch(NULL, (SIO_RR0_CTS << 8) + (state != 0) * 0x80 + which * 2 + ch, change_input_line);
591591}
592592
593593
r1355r1356
599599void z80sio_set_dcd(int which, int ch, int state)
600600{
601601   /* operate deferred */
602   timer_call_after_resynch((SIO_RR0_DCD << 8) + (state != 0) * 0x80 + which * 2 + ch, change_input_line);
602   timer_call_after_resynch(NULL, (SIO_RR0_DCD << 8) + (state != 0) * 0x80 + which * 2 + ch, change_input_line);
603603}
604604
605605
src/emu/machine/tmp68301.c
r1355r1356
110110{
111111   int i;
112112   for (i = 0; i < 3; i++)
113      tmp68301_timer[i] = timer_alloc(tmp68301_timer_callback);
113      tmp68301_timer[i] = timer_alloc(tmp68301_timer_callback, NULL);
114114
115115   for (i = 0; i < 3; i++)
116116      tmp68301_IE[i] = 0;
src/emu/machine/z80ctc.c
r1355r1356
162162   ctc->period256 = attotime_mul(ATTOTIME_IN_HZ(intf->baseclock), 256);
163163   ctc->notimer = intf->notimer;
164164   ctc->intr = intf->intr;
165   ctc->timer[0] = timer_alloc(timercallback);
166   ctc->timer[1] = timer_alloc(timercallback);
167   ctc->timer[2] = timer_alloc(timercallback);
168   ctc->timer[3] = timer_alloc(timercallback);
165   ctc->timer[0] = timer_alloc(timercallback, NULL);
166   ctc->timer[1] = timer_alloc(timercallback, NULL);
167   ctc->timer[2] = timer_alloc(timercallback, NULL);
168   ctc->timer[3] = timer_alloc(timercallback, NULL);
169169   ctc->zc[0] = intf->zc0;
170170   ctc->zc[1] = intf->zc1;
171171   ctc->zc[2] = intf->zc2;
r1355r1356
391391
392392            /* if we hit zero, do the same thing as for a timer interrupt */
393393            if (!ctc->down[ch])
394               timercallback(Machine, (which << 2) + ch);
394               timercallback(Machine, NULL, (which << 2) + ch);
395395         }
396396      }
397397   }
src/emu/machine/pit8253.c
r1355r1356
781781            timer->outputtimer = NULL;
782782         else
783783         {
784            timer->outputtimer = timer_alloc(outputcallback);
784            timer->outputtimer = timer_alloc(outputcallback, NULL);
785785            timer_adjust(timer->outputtimer, attotime_never, i   | (timerno<<4),   attotime_zero);
786786         }
787787         if (timer->freq_callback ==   NULL)
788788            timer->freqtimer = NULL;
789789         else
790790         {
791            timer->freqtimer = timer_alloc(freqcallback);
791            timer->freqtimer = timer_alloc(freqcallback, NULL);
792792            timer_adjust(timer->freqtimer,   attotime_never,   i |   (timerno<<4), attotime_zero);
793793         }
794794
src/emu/machine/ds2404.c
r1355r1356
305305   ds2404.rtc[ 3 ] = ( current_time >> 16 ) & 0xff;
306306   ds2404.rtc[ 4 ] = ( current_time >> 24 ) & 0xff;
307307
308   timer = timer_alloc( DS2404_tick );
308   timer = timer_alloc( DS2404_tick , NULL);
309309   timer_adjust( timer, ATTOTIME_IN_HZ( 256 ), 0, ATTOTIME_IN_HZ( 256 ) );
310310}
311311
src/emu/machine/mc146818.c
r1355r1356
201201   memset(mc146818, 0, sizeof(*mc146818));
202202   mc146818->type = type;
203203   mc146818->last_refresh = timer_get_time();
204    timer_pulse(ATTOTIME_IN_HZ(1), 0, mc146818_timer);
204    timer_pulse(ATTOTIME_IN_HZ(1), NULL, 0, mc146818_timer);
205205   mc146818_set_base_datetime();
206206}
207207
src/emu/machine/rtc65271.c
r1355r1356
316316
317317   rtc.xram = xram;
318318
319   rtc.update_timer = timer_alloc(rtc_begin_update_callback);
319   rtc.update_timer = timer_alloc(rtc_begin_update_callback, NULL);
320320   timer_adjust(rtc.update_timer, ATTOTIME_IN_SEC(1), 0, ATTOTIME_IN_SEC(1));
321   rtc.SQW_timer = timer_alloc(rtc_SQW_callback);
321   rtc.SQW_timer = timer_alloc(rtc_SQW_callback, NULL);
322322   rtc.interrupt_callback = interrupt_callback;
323323}
324324
r1355r1356
501501      rtc.regs[reg_A] |= reg_A_UIP;
502502
503503      /* schedule end of update cycle */
504      timer_set(UPDATE_CYCLE_TIME, 0, rtc_end_update_callback);
504      timer_set(UPDATE_CYCLE_TIME, NULL, 0, rtc_end_update_callback);
505505   }
506506}
507507
src/emu/mame.h
r1355r1356
245245
246246
247247/***************************************************************************
248    GLOBALS
248    GLOBAL VARAIBLES
249249***************************************************************************/
250250
251251extern running_machine *Machine;
src/emu/attotime.c
r1355r1356
274274}
275275
276276
277/*-------------------------------------------------
278    attotime_min - return the minimum of two
279    attotimes
280-------------------------------------------------*/
277281
282attotime attotime_min(attotime _time1, attotime _time2)
283{
284   if (_time1.seconds > _time2.seconds)
285      return _time2;
286   if (_time1.seconds < _time2.seconds)
287      return _time1;
288   if (_time1.attoseconds > _time2.attoseconds)
289      return _time2;
290   return _time1;
291}
292
293
294/*-------------------------------------------------
295    attotime_max - return the maximum of two
296    attotimes
297-------------------------------------------------*/
298
299attotime attotime_max(attotime _time1, attotime _time2)
300{
301   if (_time1.seconds > _time2.seconds)
302      return _time1;
303   if (_time1.seconds < _time2.seconds)
304      return _time2;
305   if (_time1.attoseconds > _time2.attoseconds)
306      return _time1;
307   return _time2;
308}
309
310
311
278312/***************************************************************************
279313    MISC UTILITIES
280314***************************************************************************/
src/emu/attotime.h
r1355r1356
153153/* compare two attotimes */
154154int attotime_compare(attotime _time1, attotime _time2);
155155
156/* return the minimum of two attotimes */
157attotime attotime_min(attotime _time1, attotime _time2);
156158
159/* return the maximum of two attotimes */
160attotime attotime_max(attotime _time1, attotime _time2);
161
162
157163/* ----- misc utilities ----- */
158164
159165/* return a temporary printable string describing an attotime */
src/emu/cpuexec.c
r1355r1356
9292   INT32    iloops;             /* number of interrupts remaining this frame */
9393
9494   UINT64    totalcycles;         /* total CPU cycles executed */
95   attotime localtime;         /* local time, relative to the timer system's global time */
95   attotime localtime;            /* local time, relative to the timer system's global time */
9696   INT32   clock;               /* current active clock */
9797   double   clockscale;            /* current active clock scale factor */
9898
r1355r1356
202202      machine->screen[0].vblank = (machine->screen[0].refresh / machine->screen[0].height) * (machine->screen[0].height - (machine->screen[0].visarea.max_y + 1 - machine->screen[0].visarea.min_y));
203203
204204   /* allocate vblank and refresh timers, and compute the initial timing */
205   vblank_timer = timer_alloc(cpu_vblankcallback);
206   refresh_timer = timer_alloc(NULL);
205   vblank_timer = timer_alloc(cpu_vblankcallback, NULL);
206   refresh_timer = timer_alloc(NULL, NULL);
207207   cpu_compute_vblank_timing();
208208
209209   /* loop over all our CPUs */
r1355r1356
372372      {
373373         /* Start a time based watchdog. */
374374         if (alloc_new)
375            watchdog_timer = timer_alloc(watchdog_callback);
375            watchdog_timer = timer_alloc(watchdog_callback, NULL);
376376         timer_adjust(watchdog_timer, Machine->drv->watchdog_time, 0, attotime_zero);
377377         watchdog_counter = WATCHDOG_IS_TIMER_BASED;
378378      }
r1355r1356
998998
999999void cpu_triggertime(attotime duration, int trigger)
10001000{
1001   timer_set(duration, trigger, cpu_triggertime_callback);
1001   timer_set(duration, NULL, trigger, cpu_triggertime_callback);
10021002}
10031003
10041004
r1355r1356
10461046   cpu[cpunum].trigger = trigger;
10471047}
10481048
1049void cpu_yielduntil_trigger(int trigger)
1050{
1051   int cpunum = cpu_getexecutingcpu();
10521049
1053   VERIFY_EXECUTINGCPU(cpu_yielduntil_trigger);
10541050
1055   /* suspend the CPU immediately if it's not already */
1056   cpunum_suspend(cpunum, SUSPEND_REASON_TRIGGER, 0);
1057
1058   /* set the trigger */
1059   cpu[cpunum].trigger = trigger;
1060}
1061
1062
1063
10641051/*************************************
10651052 *
10661053 *  Burn/yield CPU cycles until an
r1355r1356
10751062}
10761063
10771064
1078void cpu_yielduntil_int(void)
1079{
1080   VERIFY_EXECUTINGCPU(cpu_yielduntil_int);
1081   cpu_yielduntil_trigger(TRIGGER_INT + activecpu);
1082}
10831065
1084
1085
10861066/*************************************
10871067 *
10881068 *  Burn/yield CPU cycles until the
r1355r1356
10981078
10991079void cpu_yield(void)
11001080{
1101   cpu_yielduntil_trigger(TRIGGER_TIMESLICE);
1081   int cpunum = cpu_getexecutingcpu();
1082
1083   VERIFY_EXECUTINGCPU(cpu_yielduntil_trigger);
1084
1085   /* suspend the CPU immediately if it's not already */
1086   cpunum_suspend(cpunum, SUSPEND_REASON_TRIGGER, 0);
1087
1088   /* set the trigger */
1089   cpu[cpunum].trigger = TRIGGER_TIMESLICE;
11021090}
11031091
11041092
r1355r1356
11201108}
11211109
11221110
1123void cpu_yielduntil_time(attotime duration)
1124{
1125   static int timetrig = 0;
11261111
1127   cpu_yielduntil_trigger(TRIGGER_YIELDTIME + timetrig);
1128   cpu_triggertime(duration, TRIGGER_YIELDTIME + timetrig);
1129   timetrig = (timetrig + 1) & 255;
1130}
1131
1132
1133
11341112#if 0
11351113#pragma mark -
11361114#pragma mark CORE TIMING
r1355r1356
12131191   timer_adjust(vblank_timer, vblank_period, param, vblank_period);
12141192
12151193   /* but we need to call the standard routine as well */
1216   cpu_vblankcallback(machine, param);
1194   cpu_vblankcallback(machine, NULL, param);
12171195}
12181196
12191197
r1355r1356
12711249   {
12721250      /* do we update the screen now? */
12731251      if (!(machine->drv->video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
1274         video_frame_update();
1252         video_frame_update(FALSE);
12751253
12761254      /* Set the timer to update the screen */
12771255      timer_adjust(update_timer, attotime_make(0, machine->screen[0].vblank), 0, attotime_zero);
r1355r1356
13011279{
13021280   /* update the screen if we didn't before */
13031281   if (machine->drv->video_attributes & VIDEO_UPDATE_AFTER_VBLANK)
1304      video_frame_update();
1282      video_frame_update(FALSE);
13051283   vblank = 0;
13061284
13071285   /* update IPT_VBLANK input ports */
r1355r1356
14161394   if (ipf <= 0)
14171395      ipf = 1;
14181396   timeslice_period = attotime_make(0, machine->screen[0].refresh / ipf);
1419   timeslice_timer = timer_alloc(cpu_timeslicecallback);
1397   timeslice_timer = timer_alloc(cpu_timeslicecallback, NULL);
14201398   timer_adjust(timeslice_timer, timeslice_period, 0, timeslice_period);
14211399
14221400   /* allocate timers to handle interleave boosts */
1423   interleave_boost_timer = timer_alloc(NULL);
1424   interleave_boost_timer_end = timer_alloc(end_interleave_boost);
1401   interleave_boost_timer = timer_alloc(NULL, NULL);
1402   interleave_boost_timer_end = timer_alloc(end_interleave_boost, NULL);
14251403
14261404   /*
14271405     *  The following code finds all the CPUs that are interrupting in sync with the VBLANK
r1355r1356
14681446   vblank_countdown = vblank_multiplier;
14691447
14701448   /* allocate an update timer that will be used to time the actual screen updates */
1471   update_timer = timer_alloc(cpu_updatecallback);
1449   update_timer = timer_alloc(cpu_updatecallback, NULL);
14721450
14731451   /*
14741452     *      The following code creates individual timers for each CPU whose interrupts are not
r1355r1356
14831461      /* compute the average number of cycles per interrupt */
14841462      if (ipf <= 0)
14851463         ipf = 1;
1486      cpu[cpunum].vblankint_timer = timer_alloc(NULL);
1464      cpu[cpunum].vblankint_timer = timer_alloc(NULL, NULL);
14871465
14881466      /* see if we need to allocate a CPU timer */
14891467      if (machine->drv->cpu[cpunum].timed_interrupt_period != 0)
14901468      {
14911469         cpu[cpunum].timedint_period = attotime_make(0, machine->drv->cpu[cpunum].timed_interrupt_period);
1492         cpu[cpunum].timedint_timer = timer_alloc(cpu_timedintcallback);
1470         cpu[cpunum].timedint_timer = timer_alloc(cpu_timedintcallback, NULL);
14931471         timer_adjust(cpu[cpunum].timedint_timer, cpu[cpunum].timedint_period, cpunum, cpu[cpunum].timedint_period);
14941472      }
14951473   }
r1355r1356
15001478   first_time = attotime_sub_attoseconds(vblank_period, machine->screen[0].vblank);
15011479   while (attotime_compare(first_time, attotime_zero) < 0)
15021480   {
1503      cpu_vblankcallback(machine, -1);
1481      cpu_vblankcallback(machine, NULL, -1);
15041482      first_time = attotime_add(first_time, vblank_period);
15051483   }
1506   timer_set(first_time, 0, cpu_firstvblankcallback);
1484   timer_set(first_time, NULL, 0, cpu_firstvblankcallback);
15071485
15081486   /* reset the refresh timer to get ourself back in sync */
15091487   timer_adjust(refresh_timer, attotime_never, 0, attotime_never);
src/emu/cpuexec.h
r1355r1356
394394/* burn specified CPU cycles until a timer trigger */
395395void cpunum_spinuntil_trigger(int cpunum, int trigger);
396396
397/* yield our timeslice until a timer trigger */
398void cpu_yielduntil_trigger(int trigger);
399
400397/* burn CPU cycles until the next interrupt */
401398void cpu_spinuntil_int(void);
402399
403/* yield our timeslice until the next interrupt */
404void cpu_yielduntil_int(void);
405
406400/* burn CPU cycles until our timeslice is up */
407401void cpu_spin(void);
408402
r1355r1356
412406/* burn CPU cycles for a specific period of time */
413407void cpu_spinuntil_time(attotime duration);
414408
415/* yield our timeslice for a specific period of time */
416void cpu_yielduntil_time(attotime duration);
417409
418410
419
420411/*************************************
421412 *
422413 *  Core timing
src/emu/sound/2612intf.c
r1355r1356
3434}
3535
3636/* Timer overflow callback from timer.c */
37static TIMER_CALLBACK_PTR( timer_callback_2612_0 )
37static TIMER_CALLBACK( timer_callback_2612_0 )
3838{
39   struct ym2612_info *info = param;
39   struct ym2612_info *info = ptr;
4040   YM2612TimerOver(info->chip,0);
4141}
4242
43static TIMER_CALLBACK_PTR( timer_callback_2612_1 )
43static TIMER_CALLBACK( timer_callback_2612_1 )
4444{
45   struct ym2612_info *info = param;
45   struct ym2612_info *info = ptr;
4646   YM2612TimerOver(info->chip,1);
4747}
4848
r1355r1356
5757   {   /* Start FM Timer */
5858      attotime period = attotime_mul(ATTOTIME_IN_HZ(clock), count);
5959      if (!timer_enable(info->timer[c], 1))
60         timer_adjust_ptr(info->timer[c], period, attotime_zero);
60         timer_adjust(info->timer[c], period, 0, attotime_zero);
6161   }
6262}
6363
r1355r1356
9999
100100   /* FM init */
101101   /* Timer Handler set */
102   info->timer[0] = timer_alloc_ptr(timer_callback_2612_0, info);
103   info->timer[1] = timer_alloc_ptr(timer_callback_2612_1, info);
102   info->timer[0] = timer_alloc(timer_callback_2612_0, info);
103   info->timer[1] = timer_alloc(timer_callback_2612_1, info);
104104
105105   /* stream system initialize */
106106   info->stream = stream_create(0,2,rate,info,ym2612_stream_update);
src/emu/sound/k054539.c
r1355r1356
439439}
440440
441441
442static TIMER_CALLBACK_PTR( K054539_irq )
442static TIMER_CALLBACK( K054539_irq )
443443{
444   struct k054539_info *info = param;
444   struct k054539_info *info = ptr;
445445   if(info->regs[0x22f] & 0x20)
446446      info->intf->irq ();
447447}
r1355r1356
473473      // One or more of the registers must be the timer period
474474      // And anyway, this particular frequency is probably wrong
475475      // 480 hz is TRUSTED by gokuparo disco stage - the looping sample doesn't line up otherwise
476      timer_pulse_ptr(ATTOTIME_IN_HZ(480), info, K054539_irq);
476      timer_pulse(ATTOTIME_IN_HZ(480), info, 0, K054539_irq);
477477
478478   info->stream = stream_create(0, 2, clock, info, K054539_update);
479479
src/emu/sound/msm5205.c
r1355r1356
111111}
112112
113113/* timer callback at VCLK low eddge */
114static TIMER_CALLBACK_PTR( MSM5205_vclk_callback )
114static TIMER_CALLBACK( MSM5205_vclk_callback )
115115{
116   struct MSM5205Voice *voice = param;
116   struct MSM5205Voice *voice = ptr;
117117   int val;
118118   int new_signal;
119119   /* callback user handler and latch next data */
r1355r1356
184184
185185   /* stream system initialize */
186186   voice->stream = stream_create(0,1,clock,voice,MSM5205_update);
187   voice->timer = timer_alloc_ptr(MSM5205_vclk_callback, voice);
187   voice->timer = timer_alloc(MSM5205_vclk_callback, voice);
188188
189189   /* initialize */
190190   msm5205_reset(voice);
r1355r1356
220220      if( voice->vclk != vclk)
221221      {
222222         voice->vclk = vclk;
223         if( !vclk ) MSM5205_vclk_callback(Machine, voice);
223         if( !vclk ) MSM5205_vclk_callback(Machine, voice, 0);
224224      }
225225   }
226226}
r1355r1356
269269      if( prescaler )
270270      {
271271         attotime period = attotime_mul(ATTOTIME_IN_HZ(voice->clock), prescaler);
272         timer_adjust_ptr(voice->timer, period, period);
272         timer_adjust(voice->timer, period, 0, period);
273273      }
274274      else
275         timer_adjust_ptr(voice->timer, attotime_never, attotime_zero);
275         timer_adjust(voice->timer, attotime_never, 0, attotime_zero);
276276   }
277277
278278   if( voice->bitwidth != bitwidth )
src/emu/sound/3812intf.c
r1355r1356
3939   struct ym3812_info *info = param;
4040   if (info->intf->handler) (info->intf->handler)(irq ? ASSERT_LINE : CLEAR_LINE);
4141}
42static TIMER_CALLBACK_PTR( timer_callback_3812_0 )
42static TIMER_CALLBACK( timer_callback_3812_0 )
4343{
44   struct ym3812_info *info = param;
44   struct ym3812_info *info = ptr;
4545   YM3812TimerOver(info->chip,0);
4646}
4747
48static TIMER_CALLBACK_PTR( timer_callback_3812_1 )
48static TIMER_CALLBACK( timer_callback_3812_1 )
4949{
50   struct ym3812_info *info = param;
50   struct ym3812_info *info = ptr;
5151   YM3812TimerOver(info->chip,1);
5252}
5353
r1355r1356
6060   }
6161   else
6262   {   /* Start FM Timer */
63      timer_adjust_ptr(info->timer[c], period, attotime_zero);
63      timer_adjust(info->timer[c], period, 0, attotime_zero);
6464   }
6565}
6666
r1355r1356
101101   YM3812SetIRQHandler   (info->chip, IRQHandler_3812, info);
102102   YM3812SetUpdateHandler(info->chip, _stream_update_3812, info);
103103
104   info->timer[0] = timer_alloc_ptr(timer_callback_3812_0, info);
105   info->timer[1] = timer_alloc_ptr(timer_callback_3812_1, info);
104   info->timer[0] = timer_alloc(timer_callback_3812_0, info);
105   info->timer[1] = timer_alloc(timer_callback_3812_1, info);
106106
107107   return info;
108108}
r1355r1356
209209   if (info->intf->handler) (info->intf->handler)(irq ? ASSERT_LINE : CLEAR_LINE);
210210}
211211/* Timer overflow callback from timer.c */
212static TIMER_CALLBACK_PTR( timer_callback_3526_0 )
212static TIMER_CALLBACK( timer_callback_3526_0 )
213213{
214   struct ym3526_info *info = param;
214   struct ym3526_info *info = ptr;
215215   YM3526TimerOver(info->chip,0);
216216}
217static TIMER_CALLBACK_PTR( timer_callback_3526_1 )
217static TIMER_CALLBACK( timer_callback_3526_1 )
218218{
219   struct ym3526_info *info = param;
219   struct ym3526_info *info = ptr;
220220   YM3526TimerOver(info->chip,1);
221221}
222222/* TimerHandler from fm.c */
r1355r1356
229229   }
230230   else
231231   {   /* Start FM Timer */
232      timer_adjust_ptr(info->timer[c], period, attotime_zero);
232      timer_adjust(info->timer[c], period, 0, attotime_zero);
233233   }
234234}
235235
r1355r1356
269269   YM3526SetIRQHandler   (info->chip, IRQHandler_3526, info);
270270   YM3526SetUpdateHandler(info->chip, _stream_update_3526, info);
271271
272   info->timer[0] = timer_alloc_ptr(timer_callback_3526_0, info);
273   info->timer[1] = timer_alloc_ptr(timer_callback_3526_1, info);
272   info->timer[0] = timer_alloc(timer_callback_3526_0, info);
273   info->timer[1] = timer_alloc(timer_callback_3526_1, info);
274274
275275   return info;
276276}
r1355r1356
375375   struct y8950_info *info = param;
376376   if (info->intf->handler) (info->intf->handler)(irq ? ASSERT_LINE : CLEAR_LINE);
377377}
378static TIMER_CALLBACK_PTR( timer_callback_8950_0 )
378static TIMER_CALLBACK( timer_callback_8950_0 )
379379{
380   struct y8950_info *info = param;
380   struct y8950_info *info = ptr;
381381   Y8950TimerOver(info->chip,0);
382382}
383static TIMER_CALLBACK_PTR( timer_callback_8950_1 )
383static TIMER_CALLBACK( timer_callback_8950_1 )
384384{
385   struct y8950_info *info = param;
385   struct y8950_info *info = ptr;
386386   Y8950TimerOver(info->chip,1);
387387}
388388static void TimerHandler_8950(void *param,int c,attotime period)
r1355r1356
394394   }
395395   else
396396   {   /* Start FM Timer */
397      timer_adjust_ptr(info->timer[c], period, attotime_zero);
397      timer_adjust(info->timer[c], period, 0, attotime_zero);
398398   }
399399}
400400
r1355r1356
475475   Y8950SetIRQHandler   (info->chip, IRQHandler_8950, info);
476476   Y8950SetUpdateHandler(info->chip, _stream_update_8950, info);
477477
478   info->timer[0] = timer_alloc_ptr(timer_callback_8950_0, info);
479   info->timer[1] = timer_alloc_ptr(timer_callback_8950_1, info);
478   info->timer[0] = timer_alloc(timer_callback_8950_0, info);
479   info->timer[1] = timer_alloc(timer_callback_8950_1, info);
480480
481481   return info;
482482}
src/emu/sound/ymz280b.c
r1355r1356
108108static int diff_lookup[16];
109109
110110/* timer callback */
111static TIMER_CALLBACK_PTR( update_irq_state_timer_0 );
112static TIMER_CALLBACK_PTR( update_irq_state_timer_1 );
113static TIMER_CALLBACK_PTR( update_irq_state_timer_2 );
114static TIMER_CALLBACK_PTR( update_irq_state_timer_3 );
115static TIMER_CALLBACK_PTR( update_irq_state_timer_4 );
116static TIMER_CALLBACK_PTR( update_irq_state_timer_5 );
117static TIMER_CALLBACK_PTR( update_irq_state_timer_6 );
118static TIMER_CALLBACK_PTR( update_irq_state_timer_7 );
111static TIMER_CALLBACK( update_irq_state_timer_0 );
112static TIMER_CALLBACK( update_irq_state_timer_1 );
113static TIMER_CALLBACK( update_irq_state_timer_2 );
114static TIMER_CALLBACK( update_irq_state_timer_3 );
115static TIMER_CALLBACK( update_irq_state_timer_4 );
116static TIMER_CALLBACK( update_irq_state_timer_5 );
117static TIMER_CALLBACK( update_irq_state_timer_6 );
118static TIMER_CALLBACK( update_irq_state_timer_7 );
119119
120static void (*update_irq_state_cb[])(running_machine *, void *) =
120static timer_callback update_irq_state_cb[] =
121121{
122122   update_irq_state_timer_0,
123123   update_irq_state_timer_1,
r1355r1356
199199      struct YMZ280BVoice *voice = &chip->voice[j];
200200      update_step(chip, voice);
201201      if(voice->irq_schedule)
202         timer_set_ptr(attotime_zero, chip, update_irq_state_cb[j]);
202         timer_set(attotime_zero, chip, 0, update_irq_state_cb[j]);
203203   }
204204}
205205
r1355r1356
217217   voice->irq_schedule = 0;
218218}
219219
220static TIMER_CALLBACK_PTR( update_irq_state_timer_0 ) { update_irq_state_timer_common(param, 0); }
221static TIMER_CALLBACK_PTR( update_irq_state_timer_1 ) { update_irq_state_timer_common(param, 1); }
222static TIMER_CALLBACK_PTR( update_irq_state_timer_2 ) { update_irq_state_timer_common(param, 2); }
223static TIMER_CALLBACK_PTR( update_irq_state_timer_3 ) { update_irq_state_timer_common(param, 3); }
224static TIMER_CALLBACK_PTR( update_irq_state_timer_4 ) { update_irq_state_timer_common(param, 4); }
225static TIMER_CALLBACK_PTR( update_irq_state_timer_5 ) { update_irq_state_timer_common(param, 5); }
226static TIMER_CALLBACK_PTR( update_irq_state_timer_6 ) { update_irq_state_timer_common(param, 6); }
227static TIMER_CALLBACK_PTR( update_irq_state_timer_7 ) { update_irq_state_timer_common(param, 7); }
220static TIMER_CALLBACK( update_irq_state_timer_0 ) { update_irq_state_timer_common(ptr, 0); }
221static TIMER_CALLBACK( update_irq_state_timer_1 ) { update_irq_state_timer_common(ptr, 1); }
222static TIMER_CALLBACK( update_irq_state_timer_2 ) { update_irq_state_timer_common(ptr, 2); }
223static TIMER_CALLBACK( update_irq_state_timer_3 ) { update_irq_state_timer_common(ptr, 3); }
224static TIMER_CALLBACK( update_irq_state_timer_4 ) { update_irq_state_timer_common(ptr, 4); }
225static TIMER_CALLBACK( update_irq_state_timer_5 ) { update_irq_state_timer_common(ptr, 5); }
226static TIMER_CALLBACK( update_irq_state_timer_6 ) { update_irq_state_timer_common(ptr, 6); }
227static TIMER_CALLBACK( update_irq_state_timer_7 ) { update_irq_state_timer_common(ptr, 7); }
228228
229229
230230/**********************************************************************************************
r1355r1356
575575            voice->playing = 0;
576576
577577            /* set update_irq_state_timer. IRQ is signaled on next CPU execution. */
578            timer_set_ptr(attotime_zero, chip, update_irq_state_cb[v]);
578            timer_set(attotime_zero, chip, 0, update_irq_state_cb[v]);
579579            voice->irq_schedule = 1;
580580         }
581581      }
src/emu/sound/upd7759.c
r1355r1356
522522
523523*************************************************************/
524524
525static TIMER_CALLBACK_PTR( upd7759_slave_update )
525static TIMER_CALLBACK( upd7759_slave_update )
526526{
527   struct upd7759_chip *chip = param;
527   struct upd7759_chip *chip = ptr;
528528   UINT8 olddrq = chip->drq;
529529
530530   /* update the stream */
r1355r1356
540540
541541   /* set a timer to go off when that is done */
542542   if (chip->state != STATE_IDLE)
543      timer_adjust_ptr(chip->timer, attotime_mul(chip->clock_period, chip->clocks_left), attotime_zero);
543      timer_adjust(chip->timer, attotime_mul(chip->clock_period, chip->clocks_left), 0, attotime_zero);
544544}
545545
546546
r1355r1356
575575
576576   /* turn off any timer */
577577   if (chip->timer)
578      timer_adjust_ptr(chip->timer, attotime_never, attotime_zero);
578      timer_adjust(chip->timer, attotime_never, 0, attotime_zero);
579579}
580580
581581
r1355r1356
643643   if (intf->region != 0)
644644      chip->rom = chip->rombase = memory_region(intf->region);
645645   else
646      chip->timer = timer_alloc_ptr(upd7759_slave_update, chip);
646      chip->timer = timer_alloc(upd7759_slave_update, chip);
647647
648648   /* set the DRQ callback */
649649   chip->drqcallback = intf->drqcallback;
r1355r1356
702702
703703      /* for slave mode, start the timer going */
704704      if (chip->timer)
705         timer_adjust_ptr(chip->timer, attotime_zero, attotime_zero);
705         timer_adjust(chip->timer, attotime_zero, 0, attotime_zero);
706706   }
707707}
708708
src/emu/sound/ymf271.c
r1355r1356
13381338   }
13391339}
13401340
1341static TIMER_CALLBACK_PTR( ymf271_timer_a_tick )
1341static TIMER_CALLBACK( ymf271_timer_a_tick )
13421342{
1343   YMF271Chip *chip = param;
1343   YMF271Chip *chip = ptr;
13441344
13451345   chip->status |= 1;
13461346
r1355r1356
13511351   }
13521352}
13531353
1354static TIMER_CALLBACK_PTR( ymf271_timer_b_tick )
1354static TIMER_CALLBACK( ymf271_timer_b_tick )
13551355{
1356   YMF271Chip *chip = param;
1356   YMF271Chip *chip = ptr;
13571357
13581358   chip->status |= 2;
13591359
r1355r1356
14491449               //period = (double)(256.0 - chip->timerAVal ) * ( 384.0 * 4.0 / (double)CLOCK);
14501450               period = attotime_mul(ATTOTIME_IN_HZ(chip->clock), 384 * (1024 - chip->timerAVal));
14511451
1452               timer_adjust_ptr(chip->timA, period, period);
1452               timer_adjust(chip->timA, period, 0, period);
14531453            }
14541454            if (data & 0x20)
14551455            {   // timer B reset
r1355r1356
14601460
14611461               period = attotime_mul(ATTOTIME_IN_HZ(chip->clock), 384 * 16 * (256 - chip->timerBVal));
14621462
1463               timer_adjust_ptr(chip->timB, period, period);
1463               timer_adjust(chip->timB, period, 0, period);
14641464            }
14651465
14661466            break;
r1355r1356
17191719
17201720static void ymf271_init(YMF271Chip *chip, UINT8 *rom, void (*cb)(int), read8_handler ext_read, write8_handler ext_write)
17211721{
1722   chip->timA = timer_alloc_ptr(ymf271_timer_a_tick, chip);
1723   chip->timB = timer_alloc_ptr(ymf271_timer_b_tick, chip);
1722   chip->timA = timer_alloc(ymf271_timer_a_tick, chip);
1723   chip->timB = timer_alloc(ymf271_timer_b_tick, chip);
17241724
17251725   chip->rom = rom;
17261726   chip->irq_callback = cb;
src/emu/sound/pokey.c
r1355r1356
239239#define P9(chip)  chip->poly9[chip->p9]
240240#define P17(chip) chip->poly17[chip->p17]
241241
242static TIMER_CALLBACK_PTR( pokey_timer_expire_1 );
243static TIMER_CALLBACK_PTR( pokey_timer_expire_2 );
244static TIMER_CALLBACK_PTR( pokey_timer_expire_4 );
245static TIMER_CALLBACK_PTR( pokey_pot_trigger_0 );
246static TIMER_CALLBACK_PTR( pokey_pot_trigger_1 );
247static TIMER_CALLBACK_PTR( pokey_pot_trigger_2 );
248static TIMER_CALLBACK_PTR( pokey_pot_trigger_3 );
249static TIMER_CALLBACK_PTR( pokey_pot_trigger_4 );
250static TIMER_CALLBACK_PTR( pokey_pot_trigger_5 );
251static TIMER_CALLBACK_PTR( pokey_pot_trigger_6 );
252static TIMER_CALLBACK_PTR( pokey_pot_trigger_7 );
242static TIMER_CALLBACK( pokey_timer_expire );
243static TIMER_CALLBACK( pokey_pot_trigger );
253244
254245
255246#define SAMPLE   -1
r1355r1356
675666   chip->clockmult = DIV_64;
676667   chip->KBCODE = 0x09;       /* Atari 800 'no key' */
677668   chip->SKCTL = SK_RESET;    /* let the RNG run after reset */
678   chip->rtimer = timer_alloc(NULL);
669   chip->rtimer = timer_alloc(NULL, NULL);
679670
680   chip->timer[0] = timer_alloc_ptr(pokey_timer_expire_1, chip);
681   chip->timer[1] = timer_alloc_ptr(pokey_timer_expire_2, chip);
682   chip->timer[2] = timer_alloc_ptr(pokey_timer_expire_4, chip);
671   chip->timer[0] = timer_alloc(pokey_timer_expire, chip);
672   chip->timer[1] = timer_alloc(pokey_timer_expire, chip);
673   chip->timer[2] = timer_alloc(pokey_timer_expire, chip);
683674
684   chip->ptimer[0] = timer_alloc_ptr(pokey_pot_trigger_0, chip);
685   chip->ptimer[1] = timer_alloc_ptr(pokey_pot_trigger_1, chip);
686   chip->ptimer[2] = timer_alloc_ptr(pokey_pot_trigger_2, chip);
687   chip->ptimer[3] = timer_alloc_ptr(pokey_pot_trigger_3, chip);
688   chip->ptimer[4] = timer_alloc_ptr(pokey_pot_trigger_4, chip);
689   chip->ptimer[5] = timer_alloc_ptr(pokey_pot_trigger_5, chip);
690   chip->ptimer[6] = timer_alloc_ptr(pokey_pot_trigger_6, chip);
691   chip->ptimer[7] = timer_alloc_ptr(pokey_pot_trigger_7, chip);
675   chip->ptimer[0] = timer_alloc(pokey_pot_trigger, chip);
676   chip->ptimer[1] = timer_alloc(pokey_pot_trigger, chip);
677   chip->ptimer[2] = timer_alloc(pokey_pot_trigger, chip);
678   chip->ptimer[3] = timer_alloc(pokey_pot_trigger, chip);
679   chip->ptimer[4] = timer_alloc(pokey_pot_trigger, chip);
680   chip->ptimer[5] = timer_alloc(pokey_pot_trigger, chip);
681   chip->ptimer[6] = timer_alloc(pokey_pot_trigger, chip);
682   chip->ptimer[7] = timer_alloc(pokey_pot_trigger, chip);
692683
693684   chip->pot_r[0] = chip->intf.pot_r[0];
694685   chip->pot_r[1] = chip->intf.pot_r[1];
r1355r1356
710701    return chip;
711702}
712703
713static void pokey_timer_expire_common(struct POKEYregisters *p, int timers)
704static TIMER_CALLBACK( pokey_timer_expire )
714705{
706   struct POKEYregisters *p = ptr;
707   int timers = param;
708
715709   LOG_TIMER(("POKEY #%p timer %d with IRQEN $%02x\n", p, timers, p->IRQEN));
716710
717711    /* check if some of the requested timer interrupts are enabled */
r1355r1356
727721    }
728722}
729723
730static TIMER_CALLBACK_PTR( pokey_timer_expire_1 )
731{
732   struct POKEYregisters *chip = param;
733   pokey_timer_expire_common(chip, chip->timer_param[TIMER1]);
734}
735static TIMER_CALLBACK_PTR( pokey_timer_expire_2 )
736{
737   struct POKEYregisters *chip = param;
738   pokey_timer_expire_common(chip, chip->timer_param[TIMER2]);
739}
740static TIMER_CALLBACK_PTR( pokey_timer_expire_4 )
741{
742   struct POKEYregisters *chip = param;
743   pokey_timer_expire_common(chip, chip->timer_param[TIMER4]);
744}
745
746724#if VERBOSE_SOUND
747725static char *audc2str(int val)
748726{
r1355r1356
795773}
796774#endif
797775
798static TIMER_CALLBACK_PTR( pokey_serin_ready )
776static TIMER_CALLBACK( pokey_serin_ready )
799777{
800   struct POKEYregisters *p = param;
778   struct POKEYregisters *p = ptr;
801779    if( p->IRQEN & IRQ_SERIN )
802780   {
803781      /* set the enabled timer irq status bits */
r1355r1356
808786   }
809787}
810788
811static TIMER_CALLBACK_PTR( pokey_serout_ready )
789static TIMER_CALLBACK( pokey_serout_ready )
812790{
813   struct POKEYregisters *p = param;
791   struct POKEYregisters *p = ptr;
814792    if( p->IRQEN & IRQ_SEROR )
815793   {
816794      p->IRQST |= IRQ_SEROR;
r1355r1356
819797   }
820798}
821799
822static TIMER_CALLBACK_PTR( pokey_serout_complete )
800static TIMER_CALLBACK( pokey_serout_complete )
823801{
824   struct POKEYregisters *p = param;
802   struct POKEYregisters *p = ptr;
825803    if( p->IRQEN & IRQ_SEROC )
826804   {
827805      p->IRQST |= IRQ_SEROC;
r1355r1356
830808   }
831809}
832810
833static void pokey_pot_trigger_common(struct POKEYregisters *p, int pot)
811static TIMER_CALLBACK( pokey_pot_trigger )
834812{
813   struct POKEYregisters *p = ptr;
814   int pot = param;
835815   LOG(("POKEY #%p POT%d triggers after %dus\n", p, pot, (int)(1000000 * attotime_to_double(timer_timeelapsed(p->ptimer[pot])))));
836816   p->ALLPOT &= ~(1 << pot);   /* set the enabled timer irq status bits */
837817}
838818
839static TIMER_CALLBACK_PTR( pokey_pot_trigger_0 ) { pokey_pot_trigger_common(param, 0); }
840static TIMER_CALLBACK_PTR( pokey_pot_trigger_1 ) { pokey_pot_trigger_common(param, 1); }
841static TIMER_CALLBACK_PTR( pokey_pot_trigger_2 ) { pokey_pot_trigger_common(param, 2); }
842static TIMER_CALLBACK_PTR( pokey_pot_trigger_3 ) { pokey_pot_trigger_common(param, 3); }
843static TIMER_CALLBACK_PTR( pokey_pot_trigger_4 ) { pokey_pot_trigger_common(param, 4); }
844static TIMER_CALLBACK_PTR( pokey_pot_trigger_5 ) { pokey_pot_trigger_common(param, 5); }
845static TIMER_CALLBACK_PTR( pokey_pot_trigger_6 ) { pokey_pot_trigger_common(param, 6); }
846static TIMER_CALLBACK_PTR( pokey_pot_trigger_7 ) { pokey_pot_trigger_common(param, 7); }
847
848819#define AD_TIME  ((p->SKCTL & SK_PADDLE) ? p->ad_time_fast : p->ad_time_slow)
849820
850821static void pokey_potgo(struct POKEYregisters *p)
r1355r1356
870841
871842                /* final value */
872843                p->POTx[pot] = r;
873            timer_adjust_ptr(p->ptimer[pot], attotime_mul(AD_TIME, r), attotime_zero);
844            timer_adjust(p->ptimer[pot], attotime_mul(AD_TIME, r), pot, attotime_zero);
874845         }
875846      }
876847   }
r1355r1356
11371108        /* first remove any existing timers */
11381109      LOG_TIMER(("POKEY #%d STIMER $%02x\n", chip, data));
11391110
1140      timer_adjust_ptr(p->timer[TIMER1], attotime_never, attotime_zero);
1141      timer_adjust_ptr(p->timer[TIMER2], attotime_never, attotime_zero);
1142      timer_adjust_ptr(p->timer[TIMER4], attotime_never, attotime_zero);
1111      timer_adjust(p->timer[TIMER1], attotime_never, p->timer_param[TIMER1], attotime_zero);
1112      timer_adjust(p->timer[TIMER2], attotime_never, p->timer_param[TIMER2], attotime_zero);
1113      timer_adjust(p->timer[TIMER4], attotime_never, p->timer_param[TIMER4], attotime_zero);
11431114
11441115        /* reset all counters to zero (side effect) */
11451116      p->polyadjust = 0;
r1355r1356
11571128            /* set timer #1 _and_ #2 event after timer_div clocks of joined CHAN1+CHAN2 */
11581129            p->timer_period[TIMER2] = attotime_mul(p->clock_period, p->divisor[CHAN2]);
11591130            p->timer_param[TIMER2] = (chip<<3)|IRQ_TIMR2|IRQ_TIMR1;
1160            timer_adjust_ptr(p->timer[TIMER2], p->timer_period[TIMER2], p->timer_period[TIMER2]);
1131            timer_adjust(p->timer[TIMER2], p->timer_period[TIMER2], p->timer_param[TIMER2], p->timer_period[TIMER2]);
11611132         }
11621133        }
11631134        else
r1355r1356
11681139            /* set timer #1 event after timer_div clocks of CHAN1 */
11691140            p->timer_period[TIMER1] = attotime_mul(p->clock_period, p->divisor[CHAN1]);
11701141            p->timer_param[TIMER1] = (chip<<3)|IRQ_TIMR1;
1171            timer_adjust_ptr(p->timer[TIMER1], p->timer_period[TIMER1], p->timer_period[TIMER1]);
1142            timer_adjust(p->timer[TIMER1], p->timer_period[TIMER1], p->timer_param[TIMER1], p->timer_period[TIMER1]);
11721143         }
11731144
11741145         if( p->divisor[CHAN2] > 4 )
r1355r1356
11771148            /* set timer #2 event after timer_div clocks of CHAN2 */
11781149            p->timer_period[TIMER2] = attotime_mul(p->clock_period, p->divisor[CHAN2]);
11791150            p->timer_param[TIMER2] = (chip<<3)|IRQ_TIMR2;
1180            timer_adjust_ptr(p->timer[TIMER2], p->timer_period[TIMER2], p->timer_period[TIMER2]);
1151            timer_adjust(p->timer[TIMER2], p->timer_period[TIMER2], p->timer_param[TIMER2], p->timer_period[TIMER2]);
11811152         }
11821153        }
11831154
r1355r1356
11941165               /* set timer #4 event after timer_div clocks of CHAN4 */
11951166               p->timer_period[TIMER4] = attotime_mul(p->clock_period, p->divisor[CHAN4]);
11961167               p->timer_param[TIMER4] = (chip<<3)|IRQ_TIMR4;
1197               timer_adjust_ptr(p->timer[TIMER4], p->timer_period[TIMER4], p->timer_period[TIMER4]);
1168               timer_adjust(p->timer[TIMER4], p->timer_period[TIMER4], p->timer_param[TIMER4], p->timer_period[TIMER4]);
11981169            }
11991170            }
12001171        }
r1355r1356
12061177            /* set timer #4 event after timer_div clocks of CHAN4 */
12071178            p->timer_period[TIMER4] = attotime_mul(p->clock_period, p->divisor[CHAN4]);
12081179            p->timer_param[TIMER4] = (chip<<3)|IRQ_TIMR4;
1209            timer_adjust_ptr(p->timer[TIMER4], p->timer_period[TIMER4], p->timer_period[TIMER4]);
1180            timer_adjust(p->timer[TIMER4], p->timer_period[TIMER4], p->timer_param[TIMER4], p->timer_period[TIMER4]);
12101181         }
12111182        }
12121183
r1355r1356
12361207         * loaders from Ballblazer and Escape from Fractalus
12371208         * The real times are unknown
12381209         */
1239        timer_set_ptr(ATTOTIME_IN_USEC(200), p, pokey_serout_ready);
1210        timer_set(ATTOTIME_IN_USEC(200), p, 0, pokey_serout_ready);
12401211        /* 10 bits (assumption 1 start, 8 data and 1 stop bit) take how long? */
1241        timer_set_ptr(ATTOTIME_IN_USEC(2000), p, pokey_serout_complete);
1212        timer_set(ATTOTIME_IN_USEC(2000), p, 0, pokey_serout_complete);
12421213        break;
12431214
12441215    case IRQEN_C:
r1355r1356
13031274      if( new_val < p->counter[CHAN1] )
13041275         p->counter[CHAN1] = new_val;
13051276      if( p->interrupt_cb && p->timer[TIMER1] )
1306         timer_adjust_ptr(p->timer[TIMER1], attotime_mul(p->clock_period, new_val), p->timer_period[TIMER1]);
1277         timer_adjust(p->timer[TIMER1], attotime_mul(p->clock_period, new_val), p->timer_param[TIMER1], p->timer_period[TIMER1]);
13071278      p->audible[CHAN1] = !(
13081279         (p->AUDC[CHAN1] & VOLUME_ONLY) ||
13091280         (p->AUDC[CHAN1] & VOLUME_MASK) == 0 ||
r1355r1356
13391310      if( new_val < p->counter[CHAN2] )
13401311         p->counter[CHAN2] = new_val;
13411312      if( p->interrupt_cb && p->timer[TIMER2] )
1342         timer_adjust_ptr(p->timer[TIMER2], attotime_mul(p->clock_period, new_val), p->timer_period[TIMER2]);
1313         timer_adjust(p->timer[TIMER2], attotime_mul(p->clock_period, new_val), p->timer_param[TIMER2], p->timer_period[TIMER2]);
13431314      p->audible[CHAN2] = !(
13441315         (p->AUDC[CHAN2] & VOLUME_ONLY) ||
13451316         (p->AUDC[CHAN2] & VOLUME_MASK) == 0 ||
r1355r1356
14041375      if( new_val < p->counter[CHAN4] )
14051376         p->counter[CHAN4] = new_val;
14061377      if( p->interrupt_cb && p->timer[TIMER4] )
1407         timer_adjust_ptr(p->timer[TIMER4], attotime_mul(p->clock_period, new_val), p->timer_period[TIMER4]);
1378         timer_adjust(p->timer[TIMER4], attotime_mul(p->clock_period, new_val), p->timer_param[TIMER4], p->timer_period[TIMER4]);
14081379      p->audible[CHAN4] = !(
14091380         (p->AUDC[CHAN4] & VOLUME_ONLY) ||
14101381         (p->AUDC[CHAN4] & VOLUME_MASK) == 0 ||
r1355r1356
14521423void pokey1_serin_ready(int after)
14531424{
14541425   struct POKEYregisters *p = sndti_token(SOUND_POKEY, 0);
1455   timer_set_ptr(attotime_mul(p->clock_period, after), p, pokey_serin_ready);
1426   timer_set(attotime_mul(p->clock_period, after), p, 0, pokey_serin_ready);
14561427}
14571428
14581429void pokey2_serin_ready(int after)
14591430{
14601431   struct POKEYregisters *p = sndti_token(SOUND_POKEY, 1);
1461   timer_set_ptr(attotime_mul(p->clock_period, after), p, pokey_serin_ready);
1432   timer_set(attotime_mul(p->clock_period, after), p, 0, pokey_serin_ready);
14621433}
14631434
14641435void pokey3_serin_ready(int after)
14651436{
14661437   struct POKEYregisters *p = sndti_token(SOUND_POKEY, 2);
1467   timer_set_ptr(attotime_mul(p->clock_period, after), p, pokey_serin_ready);
1438   timer_set(attotime_mul(p->clock_period, after), p, 0, pokey_serin_ready);
14681439}
14691440
14701441void pokey4_serin_ready(int after)
14711442{
14721443   struct POKEYregisters *p = sndti_token(SOUND_POKEY, 3);
1473   timer_set_ptr(attotime_mul(p->clock_period, after), p, pokey_serin_ready);
1444   timer_set(attotime_mul(p->clock_period, after), p, 0, pokey_serin_ready);
14741445}
14751446
14761447static void pokey_break_w(int chip, int shift)
src/emu/sound/sp0250.c
r1355r1356
117117   sp->playing = 1;
118118}
119119
120static TIMER_CALLBACK_PTR( sp0250_timer_tick )
120static TIMER_CALLBACK( sp0250_timer_tick )
121121{
122   struct sp0250 *sp = param;
122   struct sp0250 *sp = ptr;
123123   stream_update(sp->stream);
124124}
125125
r1355r1356
200200   sp->RNG = 1;
201201   sp->drq = intf->drq_callback;
202202   sp->drq(ASSERT_LINE);
203   timer_pulse_ptr(attotime_mul(ATTOTIME_IN_HZ(clock), CLOCK_DIVIDER), sp, sp0250_timer_tick);
203   timer_pulse(attotime_mul(ATTOTIME_IN_HZ(clock), CLOCK_DIVIDER), sp, 0, sp0250_timer_tick);
204204
205205   sp->stream = stream_create(0, 1, clock / CLOCK_DIVIDER, sp, sp0250_update);
206206
src/emu/sound/ym2151.c
r1355r1356
783783
784784#ifdef USE_MAME_TIMERS
785785
786static TIMER_CALLBACK_PTR( irqAon_callback )
786static TIMER_CALLBACK( irqAon_callback )
787787{
788   YM2151 *chip = param;
788   YM2151 *chip = ptr;
789789   int oldstate = chip->irqlinestate;
790790
791791   chip->irqlinestate |= 1;
r1355r1356
793793   if (oldstate == 0 && chip->irqhandler) (*chip->irqhandler)(1);
794794}
795795
796static TIMER_CALLBACK_PTR( irqBon_callback )
796static TIMER_CALLBACK( irqBon_callback )
797797{
798   YM2151 *chip = param;
798   YM2151 *chip = ptr;
799799   int oldstate = chip->irqlinestate;
800800
801801   chip->irqlinestate |= 2;
r1355r1356
803803   if (oldstate == 0 && chip->irqhandler) (*chip->irqhandler)(1);
804804}
805805
806static TIMER_CALLBACK_PTR( irqAoff_callback )
806static TIMER_CALLBACK( irqAoff_callback )
807807{
808   YM2151 *chip = param;
808   YM2151 *chip = ptr;
809809   int oldstate = chip->irqlinestate;
810810
811811   chip->irqlinestate &= ~1;
r1355r1356
813813   if (oldstate == 1 && chip->irqhandler) (*chip->irqhandler)(0);
814814}
815815
816static TIMER_CALLBACK_PTR( irqBoff_callback )
816static TIMER_CALLBACK( irqBoff_callback )
817817{
818   YM2151 *chip = param;
818   YM2151 *chip = ptr;
819819   int oldstate = chip->irqlinestate;
820820
821821   chip->irqlinestate &= ~2;
r1355r1356
823823   if (oldstate == 2 && chip->irqhandler) (*chip->irqhandler)(0);
824824}
825825
826static TIMER_CALLBACK_PTR( timer_callback_a )
826static TIMER_CALLBACK( timer_callback_a )
827827{
828   YM2151 *chip = param;
829   timer_adjust_ptr(chip->timer_A, chip->timer_A_time[ chip->timer_A_index ], attotime_zero);
828   YM2151 *chip = ptr;
829   timer_adjust(chip->timer_A, chip->timer_A_time[ chip->timer_A_index ], 0, attotime_zero);
830830   chip->timer_A_index_old = chip->timer_A_index;
831831   if (chip->irq_enable & 0x04)
832832   {
833833      chip->status |= 1;
834      timer_set_ptr(attotime_zero,chip,irqAon_callback);
834      timer_set(attotime_zero,chip,0,irqAon_callback);
835835   }
836836   if (chip->irq_enable & 0x80)
837837      chip->csm_req = 2;      /* request KEY ON / KEY OFF sequence */
838838}
839static TIMER_CALLBACK_PTR( timer_callback_b )
839static TIMER_CALLBACK( timer_callback_b )
840840{
841   YM2151 *chip = param;
842   timer_adjust_ptr(chip->timer_B, chip->timer_B_time[ chip->timer_B_index ], attotime_zero);
841   YM2151 *chip = ptr;
842   timer_adjust(chip->timer_B, chip->timer_B_time[ chip->timer_B_index ], 0, attotime_zero);
843843   chip->timer_B_index_old = chip->timer_B_index;
844844   if (chip->irq_enable & 0x08)
845845   {
846846      chip->status |= 2;
847      timer_set_ptr(attotime_zero,chip,irqBon_callback);
847      timer_set(attotime_zero,chip,0,irqBon_callback);
848848   }
849849}
850850#if 0
851static TIMER_CALLBACK_PTR( timer_callback_chip_busy )
851static TIMER_CALLBACK( timer_callback_chip_busy )
852852{
853   YM2151 *chip = param;
853   YM2151 *chip = ptr;
854854   chip->status &= 0x7f;   /* reset busy flag */
855855}
856856#endif
r1355r1356
10561056#if 0
10571057   /* There is no info on what YM2151 really does when busy flag is set */
10581058   if ( chip->status & 0x80 ) return;
1059   timer_set_ptr ( attotime_mul(ATTOTIME_IN_HZ(chip->clock), 64), chip, timer_callback_chip_busy);
1059   timer_set ( attotime_mul(ATTOTIME_IN_HZ(chip->clock), 64), chip, 0, timer_callback_chip_busy);
10601060   chip->status |= 0x80;   /* set busy flag for 64 chip clock cycles */
10611061#endif
10621062
r1355r1356
11071107         {
11081108#ifdef USE_MAME_TIMERS
11091109            chip->status &= ~1;
1110            timer_set_ptr(attotime_zero,chip,irqAoff_callback);
1110            timer_set(attotime_zero,chip,0,irqAoff_callback);
11111111#else
11121112            int oldstate = chip->status & 3;
11131113            chip->status &= ~1;
r1355r1356
11191119         {
11201120#ifdef USE_MAME_TIMERS
11211121            chip->status &= ~2;
1122            timer_set_ptr(attotime_zero,chip,irqBoff_callback);
1122            timer_set(attotime_zero,chip,0,irqBoff_callback);
11231123#else
11241124            int oldstate = chip->status & 3;
11251125            chip->status &= ~2;
r1355r1356
11331133            /* start timer _only_ if it wasn't already started (it will reload time value next round) */
11341134               if (!timer_enable(chip->timer_B, 1))
11351135               {
1136                  timer_adjust_ptr(chip->timer_B, chip->timer_B_time[ chip->timer_B_index ], attotime_zero);
1136                  timer_adjust(chip->timer_B, chip->timer_B_time[ chip->timer_B_index ], 0, attotime_zero);
11371137                  chip->timer_B_index_old = chip->timer_B_index;
11381138               }
11391139            #else
r1355r1356
11581158            /* start timer _only_ if it wasn't already started (it will reload time value next round) */
11591159               if (!timer_enable(chip->timer_A, 1))
11601160               {
1161                  timer_adjust_ptr(chip->timer_A, chip->timer_A_time[ chip->timer_A_index ], attotime_zero);
1161                  timer_adjust(chip->timer_A, chip->timer_A_time[ chip->timer_A_index ], 0, attotime_zero);
11621162                  chip->timer_A_index_old = chip->timer_A_index;
11631163               }
11641164            #else
r1355r1356
15421542
15431543#ifdef USE_MAME_TIMERS
15441544/* this must be done _before_ a call to YM2151ResetChip() */
1545   PSG->timer_A = timer_alloc_ptr(timer_callback_a, PSG);
1546   PSG->timer_B = timer_alloc_ptr(timer_callback_b, PSG);
1545   PSG->timer_A = timer_alloc(timer_callback_a, PSG);
1546   PSG->timer_B = timer_alloc(timer_callback_b, PSG);
15471547#else
15481548   PSG->tim_A      = 0;
15491549   PSG->tim_B      = 0;
src/emu/sound/scsp.c
r1355r1356
308308   CheckPendingIRQ(SCSP);
309309}
310310
311static TIMER_CALLBACK_PTR( timerA_cb )
311static TIMER_CALLBACK( timerA_cb )
312312{
313   struct _SCSP *SCSP = (struct _SCSP *)param;
313   struct _SCSP *SCSP = (struct _SCSP *)ptr;
314314
315315   SCSP->TimCnt[0] = 0xFFFF;
316316   SCSP->udata.data[0x20/2]|=0x40;
r1355r1356
320320   CheckPendingIRQ(SCSP);
321321}
322322
323static TIMER_CALLBACK_PTR( timerB_cb )
323static TIMER_CALLBACK( timerB_cb )
324324{
325   struct _SCSP *SCSP = (struct _SCSP *)param;
325   struct _SCSP *SCSP = (struct _SCSP *)ptr;
326326
327327   SCSP->TimCnt[1] = 0xFFFF;
328328   SCSP->udata.data[0x20/2]|=0x80;
r1355r1356
332332   CheckPendingIRQ(SCSP);
333333}
334334
335static TIMER_CALLBACK_PTR( timerC_cb )
335static TIMER_CALLBACK( timerC_cb )
336336{
337   struct _SCSP *SCSP = (struct _SCSP *)param;
337   struct _SCSP *SCSP = (struct _SCSP *)ptr;
338338
339339   SCSP->TimCnt[2] = 0xFFFF;
340340   SCSP->udata.data[0x20/2]|=0x100;
r1355r1356
524524      }
525525   }
526526
527   SCSP->timerA = timer_alloc_ptr(timerA_cb, SCSP);
528   SCSP->timerB = timer_alloc_ptr(timerB_cb, SCSP);
529   SCSP->timerC = timer_alloc_ptr(timerC_cb, SCSP);
527   SCSP->timerA = timer_alloc(timerA_cb, SCSP);
528   SCSP->timerB = timer_alloc(timerB_cb, SCSP);
529   SCSP->timerC = timer_alloc(timerC_cb, SCSP);
530530
531531   for(i=0;i<0x400;++i)
532532   {
r1355r1356
720720               time = (44100 / SCSP->TimPris[0]) / (255-(SCSP->udata.data[0x18/2]&0xff));
721721               if (time)
722722               {
723                  timer_adjust_ptr(SCSP->timerA, ATTOTIME_IN_HZ(time), attotime_never);
723                  timer_adjust(SCSP->timerA, ATTOTIME_IN_HZ(time), 0, attotime_never);
724724               }
725725            }
726726         }
r1355r1356
739739               time = (44100 / SCSP->TimPris[1]) / (255-(SCSP->udata.data[0x1A/2]&0xff));
740740               if (time)
741741               {
742                  timer_adjust_ptr(SCSP->timerB, ATTOTIME_IN_HZ(time), attotime_never);
742                  timer_adjust(SCSP->timerB, ATTOTIME_IN_HZ(time), 0, attotime_never);
743743               }
744744            }
745745         }
r1355r1356
758758               time = (44100 / SCSP->TimPris[2]) / (255-(SCSP->udata.data[0x1C/2]&0xff));
759759               if (time)
760760               {
761                  timer_adjust_ptr(SCSP->timerC, ATTOTIME_IN_HZ(time), attotime_never);
761                  timer_adjust(SCSP->timerC, ATTOTIME_IN_HZ(time), 0, attotime_never);
762762               }
763763            }
764764         }
src/emu/sound/2610intf.c
r1355r1356
6969}
7070
7171/* Timer overflow callback from timer.c */
72static TIMER_CALLBACK_PTR( timer_callback_0 )
72static TIMER_CALLBACK( timer_callback_0 )
7373{
74   struct ym2610_info *info = param;
74   struct ym2610_info *info = ptr;
7575   YM2610TimerOver(info->chip,0);
7676}
7777
78static TIMER_CALLBACK_PTR( timer_callback_1 )
78static TIMER_CALLBACK( timer_callback_1 )
7979{
80   struct ym2610_info *info = param;
80   struct ym2610_info *info = ptr;
8181   YM2610TimerOver(info->chip,1);
8282}
8383
r1355r1356
9393      attotime period = attotime_mul(ATTOTIME_IN_HZ(clock), count);
9494
9595      if (!timer_enable(info->timer[c], 1))
96         timer_adjust_ptr(info->timer[c], period, attotime_zero);
96         timer_adjust(info->timer[c], period, 0, attotime_zero);
9797   }
9898}
9999
r1355r1356
138138   if (!info->psg) return NULL;
139139
140140   /* Timer Handler set */
141   info->timer[0] = timer_alloc_ptr(timer_callback_0, info);
142   info->timer[1] = timer_alloc_ptr(timer_callback_1, info);
141   info->timer[0] = timer_alloc(timer_callback_0, info);
142   info->timer[1] = timer_alloc(timer_callback_1, info);
143143
144144   /* stream system initialize */
145145   info->stream = stream_create(0,2,rate,info,ym2610_stream_update);
r1355r1356
190190   if (!info->psg) return NULL;
191191
192192   /* Timer Handler set */
193   info->timer[0] =timer_alloc_ptr(timer_callback_0, info);
194   info->timer[1] =timer_alloc_ptr(timer_callback_1, info);
193   info->timer[0] =timer_alloc(timer_callback_0, info);
194   info->timer[1] =timer_alloc(timer_callback_1, info);
195195
196196   /* stream system initialize */
197197   info->stream = stream_create(0,2,rate,info,ym2610b_stream_update);
src/emu/sound/ics2115.c
r1355r1356
164164}
165165
166166
167static TIMER_CALLBACK_PTR( timer_cb_0 )
167static TIMER_CALLBACK( timer_cb_0 )
168168{
169   struct ics2115 *chip = param;
169   struct ics2115 *chip = ptr;
170170   chip->irq_pend |= 1<<0;
171171   recalc_irq(chip);
172172}
173173
174static TIMER_CALLBACK_PTR( timer_cb_1 )
174static TIMER_CALLBACK( timer_cb_1 )
175175{
176   struct ics2115 *chip = param;
176   struct ics2115 *chip = ptr;
177177   chip->irq_pend |= 1<<1;
178178   recalc_irq(chip);
179179}
r1355r1356
195195   if(chip->timer[timer].period != period) {
196196      chip->timer[timer].period = period;
197197      if(period)
198         timer_adjust_ptr(chip->timer[timer].timer, ATTOTIME_IN_NSEC(period), ATTOTIME_IN_NSEC(period));
198         timer_adjust(chip->timer[timer].timer, ATTOTIME_IN_NSEC(period), 0, ATTOTIME_IN_NSEC(period));
199199      else
200         timer_adjust_ptr(chip->timer[timer].timer, attotime_never, attotime_zero);
200         timer_adjust(chip->timer[timer].timer, attotime_never, 0, attotime_zero);
201201   }
202202}
203203
r1355r1356
458458   chip->intf = config;
459459   chip->index = sndindex;
460460   chip->rom = memory_region(chip->intf->region);
461   chip->timer[0].timer = timer_alloc_ptr(timer_cb_0, chip);
462   chip->timer[1].timer = timer_alloc_ptr(timer_cb_1, chip);
461   chip->timer[0].timer = timer_alloc(timer_cb_0, chip);
462   chip->timer[1].timer = timer_alloc(timer_cb_1, chip);
463463   chip->ulaw = auto_malloc(256*sizeof(INT16));
464464   chip->stream = stream_create(0, 2, 33075, chip, update);
465465
r1355r1356
532532   chip->irq_en = 0;
533533   chip->irq_pend = 0;
534534   memset(chip->voice, 0, sizeof(chip->voice));
535   timer_adjust_ptr(chip->timer[0].timer, attotime_never, attotime_zero);
536   timer_adjust_ptr(chip->timer[1].timer, attotime_never, attotime_zero);
535   timer_adjust(chip->timer[0].timer, attotime_never, 0, attotime_zero);
536   timer_adjust(chip->timer[1].timer, attotime_never, 0, attotime_zero);
537537   chip->timer[0].period = 0;
538538   chip->timer[1].period = 0;
539539   recalc_irq(chip);
src/emu/sound/2608intf.c
r1355r1356
6969}
7070
7171/* Timer overflow callback from timer.c */
72static TIMER_CALLBACK_PTR( timer_callback_2608_0 )
72static TIMER_CALLBACK( timer_callback_2608_0 )
7373{
74   struct ym2608_info *info = param;
74   struct ym2608_info *info = ptr;
7575   YM2608TimerOver(info->chip,0);
7676}
7777
78static TIMER_CALLBACK_PTR( timer_callback_2608_1 )
78static TIMER_CALLBACK( timer_callback_2608_1 )
7979{
80   struct ym2608_info *info = param;
80   struct ym2608_info *info = ptr;
8181   YM2608TimerOver(info->chip,1);
8282}
8383
r1355r1356
9292   {   /* Start FM Timer */
9393      attotime period = attotime_mul(ATTOTIME_IN_HZ(clock), count);
9494      if (!timer_enable(info->timer[c], 1))
95         timer_adjust_ptr(info->timer[c], period, attotime_zero);
95         timer_adjust(info->timer[c], period, 0, attotime_zero);
9696   }
9797}
9898
r1355r1356
135135   if (!info->psg) return NULL;
136136
137137   /* Timer Handler set */
138   info->timer[0] = timer_alloc_ptr(timer_callback_2608_0, info);
139   info->timer[1] = timer_alloc_ptr(timer_callback_2608_1, info);
138   info->timer[0] = timer_alloc(timer_callback_2608_0, info);
139   info->timer[1] = timer_alloc(timer_callback_2608_1, info);
140140
141141   /* stream system initialize */
142142   info->stream = stream_create(0,2,rate,info,ym2608_stream_update);
src/emu/sound/ymf278b.c
r1355r1356
352352      chip->irq_callback(chip->irq_line);
353353}
354354
355static TIMER_CALLBACK_PTR( ymf278b_timer_a_tick )
355static TIMER_CALLBACK( ymf278b_timer_a_tick )
356356{
357   YMF278BChip *chip = param;
357   YMF278BChip *chip = ptr;
358358   if(!(chip->enable & 0x40))
359359   {
360360      chip->current_irq |= 0x40;
r1355r1356
362362   }
363363}
364364
365static TIMER_CALLBACK_PTR( ymf278b_timer_b_tick )
365static TIMER_CALLBACK( ymf278b_timer_b_tick )
366366{
367   YMF278BChip *chip = param;
367   YMF278BChip *chip = ptr;
368368   if(!(chip->enable & 0x20))
369369   {
370370      chip->current_irq |= 0x20;
r1355r1356
381381      if (chip->clock != YMF278B_STD_CLOCK)
382382         period = attotime_div(attotime_mul(period, chip->clock), YMF278B_STD_CLOCK);
383383
384      timer_adjust_ptr(chip->timer_a, period, period);
384      timer_adjust(chip->timer_a, period, 0, period);
385385   }
386386   else
387      timer_adjust_ptr(chip->timer_a, attotime_never, attotime_zero);
387      timer_adjust(chip->timer_a, attotime_never, 0, attotime_zero);
388388}
389389
390390static void ymf278b_timer_b_reset(YMF278BChip *chip)
r1355r1356
396396      if (chip->clock != YMF278B_STD_CLOCK)
397397         period = attotime_div(attotime_mul(period, chip->clock), YMF278B_STD_CLOCK);
398398
399      timer_adjust_ptr(chip->timer_a, period, period);
399      timer_adjust(chip->timer_a, period, 0, period);
400400   }
401401   else
402      timer_adjust_ptr(chip->timer_b, attotime_never, attotime_zero);
402      timer_adjust(chip->timer_b, attotime_never, 0, attotime_zero);
403403}
404404
405405static void ymf278b_A_w(YMF278BChip *chip, UINT8 reg, UINT8 data)
r1355r1356
670670{
671671   chip->rom = rom;
672672   chip->irq_callback = cb;
673   chip->timer_a = timer_alloc_ptr(ymf278b_timer_a_tick, chip);
674   chip->timer_b = timer_alloc_ptr(ymf278b_timer_b_tick, chip);
673   chip->timer_a = timer_alloc(ymf278b_timer_a_tick, chip);
674   chip->timer_b = timer_alloc(ymf278b_timer_b_tick, chip);
675675   chip->irq_line = CLEAR_LINE;
676676   chip->clock = clock;
677677
src/emu/sound/k053260.c
r1355r1356
222222
223223   /* setup SH1 timer if necessary */
224224   if ( ic->intf->irq )
225      timer_pulse( attotime_mul(ATTOTIME_IN_HZ(clock), 32), 0, ic->intf->irq );
225      timer_pulse( attotime_mul(ATTOTIME_IN_HZ(clock), 32), NULL, 0, ic->intf->irq );
226226
227227    return ic;
228228}
src/emu/sound/k053260.h
r1355r1356
88
99struct K053260_interface {
1010   int region;               /* memory region of sample ROM(s) */
11   void (*irq)(running_machine *machine, int param );   /* called on SH1 complete cycle ( clock / 32 ) */
11   timer_callback irq;         /* called on SH1 complete cycle ( clock / 32 ) */
1212};
1313
1414
src/emu/sound/2203intf.c
r1355r1356
5555}
5656
5757/* Timer overflow callback from timer.c */
58static TIMER_CALLBACK_PTR( timer_callback_2203_0 )
58static TIMER_CALLBACK( timer_callback_2203_0 )
5959{
60   struct ym2203_info *info = param;
60   struct ym2203_info *info = ptr;
6161   YM2203TimerOver(info->chip,0);
6262}
6363
64static TIMER_CALLBACK_PTR( timer_callback_2203_1 )
64static TIMER_CALLBACK( timer_callback_2203_1 )
6565{
66   struct ym2203_info *info = param;
66   struct ym2203_info *info = ptr;
6767   YM2203TimerOver(info->chip,1);
6868}
6969
r1355r1356
8686   {   /* Start FM Timer */
8787      attotime period = attotime_mul(ATTOTIME_IN_HZ(clock), count);
8888      if (!timer_enable(info->timer[c], 1))
89         timer_adjust_ptr(info->timer[c], period, attotime_zero);
89         timer_adjust(info->timer[c], period, 0, attotime_zero);
9090   }
9191}
9292
r1355r1356
119119   if (!info->psg) return NULL;
120120
121121   /* Timer Handler set */
122   info->timer[0] = timer_alloc_ptr(timer_callback_2203_0, info);
123   info->timer[1] = timer_alloc_ptr(timer_callback_2203_1, info);
122   info->timer[0] = timer_alloc(timer_callback_2203_0, info);
123   info->timer[1] = timer_alloc(timer_callback_2203_1, info);
124124
125125   /* stream system initialize */
126126   info->stream = stream_create(0,1,rate,info,ym2203_stream_update);
src/emu/sound/es5503.c
r1355r1356
132132   }
133133}
134134
135static TIMER_CALLBACK_PTR( es5503_timer_cb )
135static TIMER_CALLBACK( es5503_timer_cb )
136136{
137   ES5503Osc *osc = param;
137   ES5503Osc *osc = ptr;
138138   ES5503Chip *chip = (ES5503Chip *)osc->chip;
139139
140140   stream_update(chip->stream);
r1355r1356
262262      chip->oscillators[osc].irqpend = 0;
263263      chip->oscillators[osc].accumulator = 0;
264264
265      chip->oscillators[osc].timer = timer_alloc_ptr(es5503_timer_cb, &chip->oscillators[osc]);
265      chip->oscillators[osc].timer = timer_alloc(es5503_timer_cb, &chip->oscillators[osc]);
266266      chip->oscillators[osc].chip = (void *)chip;
267267   }
268268
r1355r1356
460460                  // ok, we run for this long
461461                  period = attotime_mul(ATTOTIME_IN_HZ(chip->output_rate), length);
462462
463                  timer_adjust_ptr(chip->oscillators[osc].timer, period, period);
463                  timer_adjust(chip->oscillators[osc].timer, period, 0, period);
464464               }
465465            }
466466            else if (!(chip->oscillators[osc].control & 1) && (data&1))
467467            {
468468               // key off
469               timer_adjust_ptr(chip->oscillators[osc].timer, attotime_never, attotime_never);
469               timer_adjust(chip->oscillators[osc].timer, attotime_never, 0, attotime_never);
470470            }
471471
472472            chip->oscillators[osc].control = data;
src/emu/sound/262intf.c
r1355r1356
2828   if (info->intf->handler) (info->intf->handler)(irq);
2929}
3030
31static TIMER_CALLBACK_PTR( timer_callback_262_0 )
31static TIMER_CALLBACK( timer_callback_262_0 )
3232{
33   struct ymf262_info *info = param;
33   struct ymf262_info *info = ptr;
3434   YMF262TimerOver(info->chip, 0);
3535}
3636
37static TIMER_CALLBACK_PTR( timer_callback_262_1 )
37static TIMER_CALLBACK( timer_callback_262_1 )
3838{
39   struct ymf262_info *info = param;
39   struct ymf262_info *info = ptr;
4040   YMF262TimerOver(info->chip, 1);
4141}
4242
r1355r1356
4949   }
5050   else
5151   {   /* Start FM Timer */
52      timer_adjust_ptr(info->timer[timer], period, attotime_zero);
52      timer_adjust(info->timer[timer], period, 0, attotime_zero);
5353   }
5454}
5555
r1355r1356
8989   YMF262SetIRQHandler   (info->chip, IRQHandler_262, info);
9090   YMF262SetUpdateHandler(info->chip, _stream_update, info);
9191
92   info->timer[0] = timer_alloc_ptr(timer_callback_262_0, info);
93   info->timer[1] = timer_alloc_ptr(timer_callback_262_1, info);
92   info->timer[0] = timer_alloc(timer_callback_262_0, info);
93   info->timer[1] = timer_alloc(timer_callback_262_1, info);
9494
9595   return info;
9696}
src/emu/ui.c
r1355r1356
374374
375375      /* loop while we have a handler */
376376      while (ui_handler_callback != handler_ingame && !mame_is_scheduled_event_pending(Machine) && !ui_menu_is_force_game_select())
377         video_frame_update();
377         video_frame_update(FALSE);
378378
379379      /* clear the handler and force an update */
380380      ui_set_handler(handler_ingame, 0);
381      video_frame_update();
381      video_frame_update(FALSE);
382382   }
383383
384384   /* if we're the empty driver, force the menus on */
r1355r1356
407407   if (force || (curtime - lastupdatetime) > osd_ticks_per_second() / 4)
408408   {
409409      lastupdatetime = curtime;
410      video_frame_update();
410      video_frame_update(FALSE);
411411   }
412412}
413413
src/emu/sound.c
r1355r1356
194194   finalmix = auto_malloc(Machine->sample_rate * sizeof(*finalmix));
195195
196196   /* allocate a global timer for sound timing */
197   sound_update_timer = timer_alloc(sound_update);
197   sound_update_timer = timer_alloc(sound_update, NULL);
198198   timer_adjust(sound_update_timer, update_frequency, 0, update_frequency);
199199
200200   /* initialize the streams engine */
src/emu/driver.h
r1355r1356
3939#define VIDEO_UPDATE(name)      UINT32 video_update_##name(running_machine *machine, int screen, mame_bitmap *bitmap, const rectangle *cliprect)
4040
4141/* NULL versions */
42#define driver_init_NULL      NULL
4342#define nvram_handler_NULL       NULL
4443#define memcard_handler_NULL   NULL
4544#define machine_start_NULL       NULL
r1355r1356
283282
284283#define MDRV_CPU_REPLACE(tag, _type, _clock)                        \
285284   cpu = driver_find_cpu(machine, tag);                        \
286   cpu->type = (CPU_##_type);                              \
287   cpu->clock = (_clock);                                 \
285   cpu->type = (CPU_##_type);                                 \
286   cpu->clock = (_clock);                                    \
288287
289288
290289/* CPU parameters */
291290#define MDRV_CPU_FLAGS(_flags)                                 \
292291   if (cpu)                                             \
293      cpu->flags = (_flags);                              \
292      cpu->flags = (_flags);                                 \
294293
295294#define MDRV_CPU_CONFIG(config)                                 \
296295   if (cpu)                                             \
r1355r1356
508507***************************************************************************/
509508
510509#define GAME(YEAR,NAME,PARENT,MACHINE,INPUT,INIT,MONITOR,COMPANY,FULLNAME,FLAGS)   \
511game_driver driver_##NAME =               \
512{                                 \
513   __FILE__,                        \
514   #PARENT,                        \
515   #NAME,                           \
516   FULLNAME,                        \
517   #YEAR,                           \
518   COMPANY,                        \
519   construct_##MACHINE,               \
520   ipt_##INPUT,                     \
521   driver_init_##INIT,                  \
522   rom_##NAME,                        \
523   (MONITOR)|(FLAGS),                  \
524   NULL                           \
525};
510   GAMEL(YEAR,NAME,PARENT,MACHINE,INPUT,INIT,MONITOR,COMPANY,FULLNAME,FLAGS,((const char *)0))
526511
527512#define GAMEL(YEAR,NAME,PARENT,MACHINE,INPUT,INIT,MONITOR,COMPANY,FULLNAME,FLAGS,LAYOUT)   \
528game_driver driver_##NAME =               \
513const game_driver driver_##NAME =               \
529514{                                 \
530515   __FILE__,                        \
531516   #PARENT,                        \
r1355r1356
552537
553538extern const game_driver * const drivers[];
554539
555extern game_driver driver_empty;
540extern const game_driver driver_empty;
556541
557542
558543/***************************************************************************
src/emu/cpuint.c
r1355r1356
306306      if (event_index >= MAX_INPUT_EVENTS)
307307      {
308308         input_event_index[cpunum][line]--;
309         cpunum_empty_event_queue(Machine, cpunum | (line << 8));
309         cpunum_empty_event_queue(Machine, NULL, cpunum | (line << 8));
310310         event_index = input_event_index[cpunum][line]++;
311311         logerror("Exceeded pending input line event queue on CPU %d!\n", cpunum);
312312      }
r1355r1356
318318
319319         /* if this is the first one, set the timer */
320320         if (event_index == 0)
321            timer_call_after_resynch(cpunum | (line << 8), cpunum_empty_event_queue);
321            timer_call_after_resynch(NULL, cpunum | (line << 8), cpunum_empty_event_queue);
322322      }
323323   }
324324}
src/emu/timer.c
r1355r1356
4545/* in timer.h: typedef struct _emu_timer emu_timer; */
4646struct _emu_timer
4747{
48   emu_timer *   next;
49   emu_timer *   prev;
50   void          (*callback)(running_machine *, int);
51   void         (*callback_ptr)(running_machine *, void *);
52   int          callback_param;
53   void *         callback_ptr_param;
48   emu_timer *      next;
49   emu_timer *      prev;
50   timer_callback   callback;
51   INT32          param;
52   void *         ptr;
5453   const char *   file;
5554   int          line;
5655   const char *   func;
5756   UINT8          enabled;
5857   UINT8          temporary;
59   UINT8         ptr;
6058   attotime       period;
6159   attotime       start;
6260   attotime       expire;
r1355r1356
324322      callback_timer_expire_time = timer->expire;
325323
326324      /* call the callback */
327      if (was_enabled)
325      if (was_enabled && timer->callback != NULL)
328326      {
329         if (!timer->ptr && timer->callback)
330         {
331            LOG(("Timer %s:%d[%s] fired (expire=%s)\n", timer->file, timer->line, timer->func, attotime_string(timer->expire, 9)));
332            profiler_mark(PROFILER_TIMER_CALLBACK);
333            (*timer->callback)(Machine, timer->callback_param);
334            profiler_mark(PROFILER_END);
335         }
336         else if (timer->ptr && timer->callback_ptr)
337         {
338            LOG(("Timer %s:%d[%s] fired (expire=%s)\n", timer->file, timer->line, timer->func, attotime_string(timer->expire, 9)));
339            profiler_mark(PROFILER_TIMER_CALLBACK);
340            (*timer->callback_ptr)(Machine, timer->callback_ptr_param);
341            profiler_mark(PROFILER_END);
342         }
327         LOG(("Timer %s:%d[%s] fired (expire=%s)\n", timer->file, timer->line, timer->func, attotime_string(timer->expire, 9)));
328         profiler_mark(PROFILER_TIMER_CALLBACK);
329         (*timer->callback)(Machine, timer->ptr, timer->param);
330         profiler_mark(PROFILER_END);
343331      }
344332
345333      /* clear the callback timer global */
r1355r1356
392380
393381   /* use different instances to differentiate the bits */
394382   state_save_push_tag(0);
395   state_save_register_item(buf, count, timer->callback_param);
383   state_save_register_item(buf, count, timer->param);
396384   state_save_register_item(buf, count, timer->enabled);
397385   state_save_register_item(buf, count, timer->period.seconds);
398386   state_save_register_item(buf, count, timer->period.attoseconds);
r1355r1356
414402   emu_timer *t;
415403
416404   /* remove all timers and make a private list */
417   while (timer_head)
405   while (timer_head != NULL)
418406   {
419407      t = timer_head;
420408
r1355r1356
432420   }
433421
434422   /* now add them all back in; this effectively re-sorts them by time */
435   while (privlist)
423   while (privlist != NULL)
436424   {
437425      t = privlist;
438426      privlist = t->next;
r1355r1356
474462    isn't primed yet
475463-------------------------------------------------*/
476464
477INLINE emu_timer *_timer_alloc_common(void (*callback)(running_machine *, int), void (*callback_ptr)(running_machine *, void *), void *param, const char *file, int line, const char *func, int temp)
465INLINE emu_timer *_timer_alloc_common(timer_callback callback, void *ptr, const char *file, int line, const char *func, int temp)
478466{
479467   attotime time = get_current_time();
480468   emu_timer *timer = timer_new();
481469
482470   /* fill in the record */
483471   timer->callback = callback;
484   timer->callback_ptr = callback_ptr;
485   timer->callback_param = 0;
486   timer->callback_ptr_param = param;
472   timer->ptr = ptr;
473   timer->param = 0;
487474   timer->enabled = FALSE;
488475   timer->temporary = temp;
489   timer->ptr = (callback_ptr != NULL);
490476   timer->period = attotime_zero;
491477   timer->file = file;
492478   timer->line = line;
r1355r1356
508494   return timer;
509495}
510496
511emu_timer *_timer_alloc(void (*callback)(running_machine *, int), const char *file, int line, const char *func)
497emu_timer *_timer_alloc_internal(timer_callback callback, void *ptr, const char *file, int line, const char *func)
512498{
513   return _timer_alloc_common(callback, NULL, NULL, file, line, func, FALSE);
499   return _timer_alloc_common(callback, ptr, file, line, func, FALSE);
514500}
515501
516emu_timer *_timer_alloc_ptr(void (*callback_ptr)(running_machine *, void *), void *param, const char *file, int line, const char *func)
517{
518   return _timer_alloc_common(NULL, callback_ptr, param, file, line, func, FALSE);
519}
520502
521
522503/*-------------------------------------------------
523504    timer_remove - remove a timer from the
524505    system
r1355r1356
554535    fire periodically
555536-------------------------------------------------*/
556537
557INLINE void timer_adjust_common(emu_timer *which, attotime duration, INT32 param, attotime period)
538void timer_adjust(emu_timer *which, attotime duration, INT32 param, attotime period)
558539{
559540   attotime time = get_current_time();
560541
r1355r1356
563544      callback_timer_modified = TRUE;
564545
565546   /* compute the time of the next firing and insert into the list */
566   which->callback_param = param;
547   which->param = param;
567548   which->enabled = TRUE;
568549
569550   /* clamp negative times to 0 */
r1355r1356
585566      activecpu_abort_timeslice();
586567}
587568
588void timer_adjust(emu_timer *which, attotime duration, INT32 param, attotime period)
589{
590   if (which->ptr)
591      fatalerror("timer_adjust called on a ptr timer!");
592   timer_adjust_common(which, duration, param, period);
593}
594569
595void timer_adjust_ptr(emu_timer *which, attotime duration, attotime period)
596{
597   if (!which->ptr)
598      fatalerror("timer_adjust_ptr called on a non-ptr timer!");
599   timer_adjust_common(which, duration, 0, period);
600}
601570
602
603
604571/***************************************************************************
605572    SIMPLIFIED ANONYMOUS TIMER MANAGEMENT
606573***************************************************************************/
r1355r1356
611578    period
612579-------------------------------------------------*/
613580
614void _timer_pulse(attotime period, INT32 param, void (*callback)(running_machine *, int), const char *file, int line, const char *func)
581void _timer_pulse_internal(attotime period, void *ptr, INT32 param, timer_callback callback, const char *file, int line, const char *func)
615582{
616   emu_timer *timer = _timer_alloc_common(callback, NULL, NULL, file, line, func, FALSE);
617
618   /* adjust to our liking */
583   emu_timer *timer = _timer_alloc_common(callback, ptr, file, line, func, FALSE);
619584   timer_adjust(timer, period, param, period);
620585}
621586
622void _timer_pulse_ptr(attotime period, void *param, void (*callback)(running_machine *, void *), const char *file, int line, const char *func)
623{
624   emu_timer *timer = _timer_alloc_common(NULL, callback, param, file, line, func, FALSE);
625587
626   /* adjust to our liking */
627   timer_adjust_ptr(timer, period, period);
628}
629
630
631588/*-------------------------------------------------
632589    timer_set - allocate a one-shot timer, which
633590    calls the callback after the given duration
634591-------------------------------------------------*/
635592
636void _timer_set(attotime duration, INT32 param, void (*callback)(running_machine *, int), const char *file, int line, const char *func)
593void _timer_set_internal(attotime duration, void *ptr, INT32 param, timer_callback callback, const char *file, int line, const char *func)
637594{
638   emu_timer *timer = _timer_alloc_common(callback, NULL, NULL, file, line, func, TRUE);
639
640   /* adjust to our liking */
595   emu_timer *timer = _timer_alloc_common(callback, ptr, file, line, func, TRUE);
641596   timer_adjust(timer, duration, param, attotime_zero);
642597}
643598
644void _timer_set_ptr(attotime duration, void *param, void (*callback)(running_machine *, void *), const char *file, int line, const char *func)
645{
646   emu_timer *timer = _timer_alloc_common(NULL, callback, param, file, line, func, TRUE);
647599
648   /* adjust to our liking */
649   timer_adjust_ptr(timer, duration, attotime_zero);
650}
651600
652
653
654601/***************************************************************************
655602    MISCELLANEOUS CONTROLS
656603***************************************************************************/
r1355r1356
661608
662609void timer_reset(emu_timer *which, attotime duration)
663610{
664   /* adjust the timer */
665   if (!which->ptr)
666      timer_adjust(which, duration, which->callback_param, which->period);
667   else
668      timer_adjust_ptr(which, duration, which->period);
611   timer_adjust(which, duration, which->param, which->period);
669612}
670613
671614
r1355r1356
708651
709652int timer_get_param(emu_timer *which)
710653{
711   return which->callback_param;
654   return which->param;
712655}
713656
714657
715658void *timer_get_param_ptr(emu_timer *which)
716659{
717   return which->callback_ptr_param;
660   return which->ptr;
718661}
719662
720663
src/emu/render.h
r1355r1356
8787                            LAYER_CONFIG_ENABLE_SCREEN_OVERLAY)
8888
8989/* texture formats */
90#define TEXFORMAT_UNDEFINED         0            /* require a format to be specified */
91#define TEXFORMAT_PALETTE16         1            /* 16bpp palettized, alpha ignored */
92#define TEXFORMAT_PALETTEA16      2            /* 16bpp palettized, alpha respected */
93#define TEXFORMAT_RGB15            3            /* 16bpp 5-5-5 RGB */
94#define TEXFORMAT_RGB32            4            /* 32bpp 8-8-8 RGB */
95#define TEXFORMAT_ARGB32         5            /* 32bpp 8-8-8-8 ARGB */
96#define TEXFORMAT_YUY16            6            /* 16bpp 8-8 Y/Cb, Y/Cr in sequence */
90enum
91{
92   TEXFORMAT_UNDEFINED = 0,            /* require a format to be specified */
93   TEXFORMAT_PALETTE16,            /* 16bpp palettized, alpha ignored */
94   TEXFORMAT_PALETTEA16,            /* 16bpp palettized, alpha respected */
95   TEXFORMAT_RGB15,            /* 16bpp 5-5-5 RGB */
96   TEXFORMAT_RGB32,            /* 32bpp 8-8-8 RGB */
97   TEXFORMAT_ARGB32,            /* 32bpp 8-8-8-8 ARGB */
98   TEXFORMAT_YUY16               /* 16bpp 8-8 Y/Cb, Y/Cr in sequence */
99};
97100
98101/* blending modes */
99#define   BLENDMODE_NONE            0            /* no blending */
100#define   BLENDMODE_ALPHA            1            /* standard alpha blend */
101#define BLENDMODE_RGB_MULTIPLY      2            /* apply source alpha to source pix, then multiply RGB values */
102#define BLENDMODE_ADD            3            /* apply source alpha to source pix, then add to destination */
102enum
103{
104   BLENDMODE_NONE = 0,            /* no blending */
105   BLENDMODE_ALPHA,            /* standard alpha blend */
106   BLENDMODE_RGB_MULTIPLY,            /* apply source alpha to source pix, then multiply RGB values */
107   BLENDMODE_ADD               /* apply source alpha to source pix, then add to destination */
108};
103109
104110
105111/* flags for primitives */
src/emu/cheat.c
r1355r1356
15001500   /* ----- initialize string table ----- */
15011501   InitStringTable();
15021502
1503   periodic_timer = timer_alloc(cheat_periodic);
1503   periodic_timer = timer_alloc(cheat_periodic, NULL);
15041504   timer_adjust(periodic_timer, attotime_make(0, Machine->screen[0].refresh), 0, attotime_make(0, Machine->screen[0].refresh));
15051505
15061506   add_exit_callback(machine, cheat_exit);
src/emu/timer.h
r1355r1356
3737#define PERIOD_OF_555_ASTABLE(r1,r2,c)   ATTOTIME_IN_NSEC((attoseconds_t)( 693000000 * ((double)(r1) + 2.0 * (double)(r2)) * (double)(c)))
3838
3939/* macros that map all allocations to provide file/line/functions to the callee */
40#define timer_alloc(c)               _timer_alloc(c, __FILE__, __LINE__, #c)
41#define timer_alloc_ptr(c,p)         _timer_alloc_ptr(c, p, __FILE__, __LINE__, #c)
42#define timer_pulse(e,p,c)            _timer_pulse(e, p, c, __FILE__, __LINE__, #c)
43#define timer_pulse_ptr(e,p,c)         _timer_pulse_ptr(e, p, c, __FILE__, __LINE__, #c)
44#define timer_set(d,p,c)            _timer_set(d, p, c, __FILE__, __LINE__, #c)
45#define timer_set_ptr(d,p,c)         _timer_set_ptr(d, p, c, __FILE__, __LINE__, #c)
40#define timer_alloc(c,ptr)            _timer_alloc_internal(c, ptr, __FILE__, __LINE__, #c)
41#define timer_pulse(e,ptr,p,c)         _timer_pulse_internal(e, ptr, p, c, __FILE__, __LINE__, #c)
42#define timer_set(d,ptr,p,c)         _timer_set_internal(d, ptr, p, c, __FILE__, __LINE__, #c)
43#define timer_call_after_resynch(ptr,p,c) _timer_set_internal(attotime_zero, ptr, p, c, __FILE__, __LINE__, #c)
4644
4745/* macros for a timer callback functions */
48#define TIMER_CALLBACK(name)         void name(running_machine *machine, int param)
49#define TIMER_CALLBACK_PTR(name)      void name(running_machine *machine, void *param)
46#define TIMER_CALLBACK(name)         void name(running_machine *machine, void *ptr, int param)
5047
5148
5249
r1355r1356
5451    TYPE DEFINITIONS
5552***************************************************************************/
5653
54/* a timer callback looks like this */
55typedef void (*timer_callback)(running_machine *machine, void *ptr, INT32 param);
56
5757/* opaque type for representing a timer */
5858typedef struct _emu_timer emu_timer;
5959
r1355r1356
104104/* ----- core timer management ----- */
105105
106106/* allocate a permament timer that isn't primed yet */
107emu_timer *_timer_alloc(void (*callback)(running_machine *, int), const char *file, int line, const char *func);
108emu_timer *_timer_alloc_ptr(void (*callback)(running_machine *, void *), void *param, const char *file, int line, const char *func);
107emu_timer *_timer_alloc_internal(timer_callback callback, void *param, const char *file, int line, const char *func);
109108
110109/* adjust the time when this timer will fire, and whether or not it will fire periodically */
111110void timer_adjust(emu_timer *which, attotime duration, INT32 param, attotime period);
112void timer_adjust_ptr(emu_timer *which, attotime duration, attotime period);
113111
114112
115113
116114/* ----- anonymous timer management ----- */
117115
118/* allocate a pulse timer, which repeatedly calls the callback using the given period */
119void _timer_pulse(attotime period, INT32 param, void (*callback)(running_machine *, int), const char *file, int line, const char *func);
120void _timer_pulse_ptr(attotime period, void *param, void (*callback)(running_machine *, void *), const char *file, int line, const char *func);
121
122116/* allocate a one-shot timer, which calls the callback after the given duration */
123void _timer_set(attotime duration, INT32 param, void (*callback)(running_machine *, int), const char *file, int line, const char *func);
124void _timer_set_ptr(attotime duration, void *param, void (*callback)(running_machine *, void *), const char *file, int line, const char *func);
117void _timer_set_internal(attotime druation, void *ptr, INT32 param, timer_callback callback, const char *file, int line, const char *func);
125118
119/* allocate a pulse timer, which repeatedly calls the callback using the given period */
120void _timer_pulse_internal(attotime period, void *ptr, INT32 param, timer_callback callback, const char *file, int line, const char *func);
126121
127122
123
128124/* ----- miscellaneous controls ----- */
129125
130126/* reset the timing on a timer */
r1355r1356
160156attotime timer_firetime(emu_timer *which);
161157
162158
163
164
165/***************************************************************************
166    INLINE FUNCTIONS
167***************************************************************************/
168
169/*-------------------------------------------------
170    timer_call_after_resynch - synchs the CPUs
171    and calls the callback immediately
172-------------------------------------------------*/
173
174INLINE void timer_call_after_resynch(INT32 param, void (*callback)(running_machine *, int))
175{
176   timer_set(attotime_zero, param, callback);
177}
178
179INLINE void timer_call_after_resynch_ptr(void *param, void (*callback)(running_machine *, void *))
180{
181   timer_set_ptr(attotime_zero, param, callback);
182}
183
184
185159#endif   /* __TIMER_H__ */
src/mess/devices/flopdrv.c
r1355r1356
2727   return image_lookuptag(img, FLOPDRVTAG);
2828}
2929
30static TIMER_CALLBACK_PTR(floppy_drive_index_callback);
30static TIMER_CALLBACK(floppy_drive_index_callback);
3131
3232/* this is called on device init */
3333int floppy_drive_init(mess_image *img, const floppy_interface *iface)
r1355r1356
4444   pDrive->flags = 0;
4545   pDrive->index_pulse_callback = NULL;
4646   pDrive->ready_state_change_callback = NULL;
47   pDrive->index_timer = timer_alloc_ptr(floppy_drive_index_callback, img);
47   pDrive->index_timer = timer_alloc(floppy_drive_index_callback, img);
4848   pDrive->index = 0;
4949
5050   /* all drives are double-sided 80 track - can be overriden in driver! */
r1355r1356
6565
6666
6767/* index pulses at rpm/60 Hz, and stays high 1/20th of time */
68static TIMER_CALLBACK_PTR(floppy_drive_index_callback)
68static void floppy_drive_index_func(mess_image *img)
6969{
70   mess_image *img = (mess_image *) param;
7170   struct floppy_drive *pDrive = get_drive(img);
7271
7372   double ms = 1000. / (pDrive->rpm / 60.);
r1355r1356
7574   if (pDrive->index)
7675   {
7776      pDrive->index = 0;
78      timer_adjust_ptr(pDrive->index_timer, double_to_attotime(ms*19/20/1000.0), attotime_zero);
77      timer_adjust(pDrive->index_timer, double_to_attotime(ms*19/20/1000.0), 0, attotime_zero);
7978   }
8079   else
8180   {
8281      pDrive->index = 1;
83      timer_adjust_ptr(pDrive->index_timer, double_to_attotime(ms/20/1000.0), attotime_zero);
82      timer_adjust(pDrive->index_timer, double_to_attotime(ms/20/1000.0), 0, attotime_zero);
8483   }
8584
8685   if (pDrive->index_pulse_callback)
r1355r1356
8887}
8988
9089
90
91static TIMER_CALLBACK(floppy_drive_index_callback)
92{
93   mess_image *image = (mess_image *) ptr;
94   floppy_drive_index_func(image);
95}
96
97
98
9199/* set the callback for the index pulse */
92100void floppy_drive_set_index_pulse_callback(mess_image *img, void (*callback)(mess_image *image, int state))
93101{
r1355r1356
209217            /* check it's in range */
210218
211219            /* setup timer to trigger at rpm */
212            floppy_drive_index_callback(Machine, (void*)img);
220            floppy_drive_index_func(img);
213221         }
214222         else
215223         {
216224            /* on->off */
217            timer_adjust_ptr(pDrive->index_timer, attotime_zero, attotime_zero);
225            timer_adjust(pDrive->index_timer, attotime_zero, 0, attotime_zero);
218226         }
219227      }
220228   }
src/mess/devices/bitbngr.c
r1355r1356
4747   bi->last_pulse_time = 0.0;
4848   bi->recorded_pulses = 0;
4949   bi->value = config->initial_value;
50   bi->timeout_timer = timer_alloc(bitbanger_overthreshhold);
50   bi->timeout_timer = timer_alloc(bitbanger_overthreshhold, NULL);
5151   bi->over_threshhold = 1;
5252
5353   bitbangers[id] = bi;
src/mess/devices/thomflop.c
r1355r1356
10361036
10371037
10381038/* complete command (by read, write, or timeout) */
1039static TIMER_CALLBACK( thmfc_floppy_cmd_complete_cb )
1039static void thmfc_floppy_cmd_complete(void)
10401040{
10411041   LOG (( "%f thmfc_floppy_cmd_complete_cb: cmd=%i off=%i/%i/%i\n",
10421042          attotime_to_double(timer_get_time()), thmfc1->op, thmfc1->data_idx,
r1355r1356
10571057
10581058
10591059
1060static TIMER_CALLBACK( thmfc_floppy_cmd_complete_cb )
1061{
1062   thmfc_floppy_cmd_complete();
1063}
1064
1065
1066
10601067/* intelligent read: show just one field, skip header */
10611068static UINT8 thmfc_floppy_read_byte ( void )
10621069{
r1355r1356
10681075          data ));
10691076 
10701077   if ( thmfc1->data_idx >= thmfc1->data_size - 1 )
1071      thmfc_floppy_cmd_complete_cb( Machine, 0 );
1078      thmfc_floppy_cmd_complete();
10721079   else
10731080      thmfc1->data_idx++;
10741081
r1355r1356
12161223   thmfc1->data_raw_size = 0;
12171224   thmfc1->data[ thmfc1->data_idx ] = data;
12181225   if ( thmfc1->data_idx >= thmfc1->data_size - 1 )
1219      thmfc_floppy_cmd_complete_cb( Machine, 0 );
1226      thmfc_floppy_cmd_complete();
12201227   else
12211228      thmfc1->data_idx++;
12221229}
r1355r1356
15651572   thmfc1 = auto_malloc( sizeof( *thmfc1 ) );
15661573   assert( thmfc1 );
15671574
1568   thmfc_floppy_cmd = timer_alloc( thmfc_floppy_cmd_complete_cb );
1575   thmfc_floppy_cmd = timer_alloc( thmfc_floppy_cmd_complete_cb, NULL );
15691576
15701577   state_save_register_global( thmfc1->op );
15711578   state_save_register_global( thmfc1->sector );
r1355r1356
16111618{
16121619   LOG(( "%f ans3\n", attotime_to_double(timer_get_time()) ));
16131620   mc6854_set_cts( 1 );
1614   timer_set(  ATTOTIME_IN_USEC( 100 ), 0, ans4 );
1621   timer_set(  ATTOTIME_IN_USEC( 100 ), NULL, 0, ans4 );
16151622}
16161623
16171624static TIMER_CALLBACK( ans2 )
16181625{
16191626   LOG(( "%f ans2\n", attotime_to_double(timer_get_time()) ));
16201627   mc6854_set_cts( 0 );
1621   timer_set(  ATTOTIME_IN_USEC( 100 ), 0, ans3 );
1628   timer_set(  ATTOTIME_IN_USEC( 100 ), NULL, 0, ans3 );
16221629}
16231630
16241631static TIMER_CALLBACK( ans )
16251632{
16261633   LOG(( "%f ans\n", attotime_to_double(timer_get_time()) ));
16271634   mc6854_set_cts( 1 );
1628   timer_set(  ATTOTIME_IN_USEC( 100 ), 0, ans2 );
1635   timer_set(  ATTOTIME_IN_USEC( 100 ), NULL, 0, ans2 );
16291636}
16301637/* consigne DKBOOT
16311638
r1355r1356
16671674   if ( data[1] == 0xff )
16681675   {
16691676      LOG(( "to7_network_got_frame: %i phones %i\n", data[2], data[0] ));
1670      timer_set(  ATTOTIME_IN_USEC( 100 ), 0, ans  );
1677      timer_set(  ATTOTIME_IN_USEC( 100 ), NULL, 0, ans  );
16711678      mc6854_set_cts( 0 );
16721679   }
16731680   else if ( ! data[1] )
src/mess/devices/snapquik.c
r1355r1356
2323
2424
2525
26static TIMER_CALLBACK_PTR(snapquick_processsnapshot)
26static TIMER_CALLBACK(snapquick_processsnapshot)
2727{
28   struct snapquick_info *si = (struct snapquick_info *) param;
28   struct snapquick_info *si = (struct snapquick_info *) ptr;
2929   snapquick_loadproc loadproc;
3030   const char *file_type;
3131   
r1355r1356
6363
6464   delay = device_get_info_double(&si->dev->devclass, DEVINFO_FLOAT_SNAPSHOT_DELAY);
6565
66   timer_set_ptr(double_to_attotime(delay), si, snapquick_processsnapshot);
66   timer_set(double_to_attotime(delay), si, 0, snapquick_processsnapshot);
6767   return INIT_PASS;
6868}
6969
src/mess/tools/messtest/testmess.c
r1355r1356
791791   if (offset_end == 0)
792792      offset_end = offset_start + verify_data_size - 1;
793793
794   /* what type of memory are we validating? */
794795   region = current_command->u.verify_args.mem_region;
795796   if (region)
796797   {
798      /* we're validating a conventional memory region */
797799      target_data = memory_region(region);
798800      target_data_size = memory_region_length(region);
799801   }
800802   else
801803   {
804      /* we're validating mess_ram */
802805      target_data = mess_ram;
803806      target_data_size = mess_ram_size;
804807   }
r1355r1356
823826      return;
824827   }
825828
829   /* loop through the memory, verifying it byte by byte */
826830   for (offset = offset_start; offset <= offset_end; offset++)
827831   {
828832      if (verify_data[i] != target_data[offset])
src/mess/audio/mea8000.c
r1355r1356
663663   mea8000_init_tables();
664664   mea8000.channel = channel;
665665   mea8000.req_out_func = req_out_func;
666   mea8000.timer = timer_alloc( mea8000_timer_expire );
666   mea8000.timer = timer_alloc( mea8000_timer_expire , NULL);
667667
668668   state_save_register_item( "mea8000", 0, mea8000.state );
669669   state_save_register_item_array( "mea8000", 0, mea8000.buf );
src/mess/audio/dave.c
r1355r1356
167167   dave.one_khz_state = 0;
168168   dave.fifty_hz_count = DAVE_FIFTY_HZ_COUNTER_RELOAD;
169169   dave.one_hz_count = DAVE_ONE_HZ_COUNTER_RELOAD;
170   timer_pulse(ATTOTIME_IN_HZ(1000), 0, dave_1khz_callback);
170   timer_pulse(ATTOTIME_IN_HZ(1000), NULL, 0, dave_1khz_callback);
171171   
172172   for (i=0; i<3; i++)
173173   {
src/mess/audio/t6721.c
r1355r1356
101101void c364_speech_init(void)
102102{
103103   memset(&speech, 0, sizeof(speech));
104   speech.timer = timer_alloc(c364_speech_timer);
104   speech.timer = timer_alloc(c364_speech_timer, NULL);
105105}
106106
107107WRITE8_HANDLER(c364_speech_w)
src/mess/video/zx.c
r1355r1356
145145      y = video_screen_get_vpos(0);
146146
147147      cycles = 4 * (64 - (rreg & 63));
148      timer_set(ATTOTIME_IN_CYCLES(cycles, 0), 0, zx_ula_irq);
148      timer_set(ATTOTIME_IN_CYCLES(cycles, 0), NULL, 0, zx_ula_irq);
149149      ula_irq_active = 1;
150150      scanline = BITMAP_ADDR16(bitmap, y, 0);
151151
r1355r1356
185185
186186VIDEO_START( zx )
187187{
188   ula_nmi = timer_alloc(zx_ula_nmi);
188   ula_nmi = timer_alloc(zx_ula_nmi, NULL);
189189   ula_irq_active = 0;
190190   video_start_generic_bitmapped(machine);
191191}
src/mess/video/911_vdt.c
r1355r1356
237237   else
238238      vdt[unit].cursor_address_mask = 0x7ff;   /* 2 kb of RAM */
239239
240   timer_set(attotime_zero, unit, setup_beep);
240   timer_set(attotime_zero, NULL, unit, setup_beep);
241241
242242   /* set up cursor blink clock.  2Hz frequency -> .25s half-period. */
243   /*vdt[unit].blink_clock =*/ timer_pulse(ATTOTIME_IN_MSEC(250), unit, blink_callback);
243   /*vdt[unit].blink_clock =*/ timer_pulse(ATTOTIME_IN_MSEC(250), NULL, unit, blink_callback);
244244
245245   /* alloc beep timer */
246   vdt[unit].beep_timer = timer_alloc(beep_callback);
246   vdt[unit].beep_timer = timer_alloc(beep_callback, NULL);
247247
248248   return 0;
249249}
src/mess/video/gb.c
r1355r1356
10491049   /* set the scanline update function */
10501050   update_scanline = gb_update_scanline;
10511051
1052   gb_lcd.lcd_timer = timer_alloc( gb_lcd_timer_proc );
1052   gb_lcd.lcd_timer = timer_alloc( gb_lcd_timer_proc , NULL);
10531053   timer_adjust( gb_lcd.lcd_timer, ATTOTIME_IN_CYCLES(456,0), 0, attotime_never );
10541054}
10551055
src/mess/video/pc_vga.c
r1355r1356
11801180   vga.monitor.get_columns = ega_get_crtc_columns;
11811181   vga.monitor.get_sync_lines = vga_get_crtc_sync_lines;
11821182   vga.monitor.get_sync_columns = vga_get_crtc_sync_columns;
1183   timer_pulse(ATTOTIME_IN_HZ(60), 0, vga_timer);
1183   timer_pulse(ATTOTIME_IN_HZ(60), NULL, 0, vga_timer);
11841184   pc_video_start(NULL, pc_ega_choosevideomode, 0);
11851185}
11861186
r1355r1356
11951195   vga.monitor.get_columns=vga_get_crtc_columns;
11961196   vga.monitor.get_sync_lines=vga_get_crtc_sync_lines;
11971197   vga.monitor.get_sync_columns=vga_get_crtc_sync_columns;
1198   timer_pulse(ATTOTIME_IN_HZ(60), 0, vga_timer);
1198   timer_pulse(ATTOTIME_IN_HZ(60), NULL, 0, vga_timer);
11991199   pc_video_start(NULL, pc_vga_choosevideomode, 0);
12001200}
12011201
src/mess/video/vectrex.c
r1355r1356
100100/*********************************************************************
101101  Lightpen
102102 *********************************************************************/
103static TIMER_CALLBACK(lightpen_trigger)
103static void lightpen_trigger(void)
104104{
105105   if (vectrex_lightpen_port & 1)
106106   {
r1355r1356
113113   }
114114}
115115
116static TIMER_CALLBACK(lightpen_trigger_callback)
117{
118   lightpen_trigger();
119}
120
116121static int lightpen_check (void)
117122{
118123   int dx,dy;
r1355r1356
269274
270275   imager_freq = 1;
271276
272   imager_timer = timer_alloc(vectrex_imager_right_eye);
277   imager_timer = timer_alloc(vectrex_imager_right_eye, NULL);
273278   timer_adjust(imager_timer, ATTOTIME_IN_HZ(imager_freq), 2, ATTOTIME_IN_HZ(imager_freq));
274279
275   lp_t = timer_alloc(lightpen_trigger);
280   lp_t = timer_alloc(lightpen_trigger_callback, NULL);
276281
277282   video_start_vector(machine);
278283}
r1355r1356
427432         start_time = time_now;
428433      }
429434      if (data & lightpen_check())
430         lightpen_trigger(Machine, 0);
435         lightpen_trigger();
431436
432437      blank = data;
433438   }
src/mess/video/aim65.c
r1355r1356
122122
123123VIDEO_START( aim65 )
124124{
125   print_timer = timer_alloc(aim65_printer_timer);
125   print_timer = timer_alloc(aim65_printer_timer, NULL);
126126
127127   /*
128128    videoram_size = 600 * 10 * 2;
src/mess/video/m6847.c
r1355r1356
18531853   }
18541854
18551855   /* allocate timers */
1856   m6847->fs_rise_timer = timer_alloc(fs_rise);
1857   m6847->fs_fall_timer = timer_alloc(fs_fall);
1858   m6847->hs_rise_timer = timer_alloc(hs_rise);
1859   m6847->hs_fall_timer = timer_alloc(hs_fall);
1856   m6847->fs_rise_timer = timer_alloc(fs_rise, NULL);
1857   m6847->fs_fall_timer = timer_alloc(fs_fall, NULL);
1858   m6847->hs_rise_timer = timer_alloc(hs_rise, NULL);
1859   m6847->hs_fall_timer = timer_alloc(hs_fall, NULL);
18601860
18611861   /* setup dimensions */
18621862   m6847->top_border_scanlines = v->top_border_scanlines;
src/mess/video/thomson.c
r1355r1356
11621162   state_save_register_global( thom_floppy_rcount );
11631163   output_set_value( "floppy", 0 );
11641164
1165   thom_video_timer = timer_alloc( NULL );
1165   thom_video_timer = timer_alloc( NULL , NULL);
11661166
1167   thom_scanline_timer = timer_alloc( thom_scanline_start );
1167   thom_scanline_timer = timer_alloc( thom_scanline_start , NULL);
11681168
11691169   thom_lightpen_nb = 0;
11701170   thom_lightpen_cb = NULL;
1171   thom_lightpen_timer = timer_alloc( thom_lightpen_step );
1171   thom_lightpen_timer = timer_alloc( thom_lightpen_step , NULL);
11721172   state_save_register_global( thom_lightpen_nb );
11731173
11741174   thom_init_cb = NULL;
1175   thom_init_timer = timer_alloc( thom_set_init );
1175   thom_init_timer = timer_alloc( thom_set_init , NULL);
11761176 
11771177   video_eof_thom(machine);
11781178
src/mess/video/abc80.c
r1355r1356
6161
6262VIDEO_START( abc80 )
6363{
64   abc80_blink_timer = timer_alloc(abc80_blink_tick);
64   abc80_blink_timer = timer_alloc(abc80_blink_tick, NULL);
6565   timer_adjust(abc80_blink_timer, attotime_zero, 0, ATTOTIME_IN_HZ(ABC80_XTAL/2/6/64/312/16));
6666
6767   tx_tilemap = tilemap_create(abc80_get_tile_info, abc80_tilemap_scan,
src/mess/video/x68k.c
r1355r1356
341341      if(data & 0x08)  // text screen raster copy
342342      {
343343         x68k_crtc_text_copy((sys.crtc.reg[22] & 0xff00) >> 8,(sys.crtc.reg[22] & 0x00ff));
344         timer_set(ATTOTIME_IN_MSEC(1),0x02,x68k_crtc_operation_end);  // time taken to do operation is a complete guess.
344         timer_set(ATTOTIME_IN_MSEC(1), NULL, 0x02,x68k_crtc_operation_end);  // time taken to do operation is a complete guess.
345345      }
346346      if(data & 0x02)  // high-speed graphic screen clear
347347      {
r1355r1356
367367         {
368368            fillbitmap(x68k_gfx_3_bitmap_16,0,&rect);
369369         }
370         timer_set(ATTOTIME_IN_MSEC(10),0x02,x68k_crtc_operation_end);  // time taken to do operation is a complete guess.
370         timer_set(ATTOTIME_IN_MSEC(10), NULL, 0x02,x68k_crtc_operation_end);  // time taken to do operation is a complete guess.
371371//         popmessage("CRTC: High-speed gfx screen clear [0x%02x]",sys.crtc.reg[21] & 0x0f);
372372      }
373373      break;
src/mess/video/atarist.c
r1355r1356
703703         if ((data >> 8) & ATARIST_BLITTER_CTRL_BUSY)
704704         {
705705            int nops = BLITTER_NOPS[blitter.op][blitter.hop]; // each NOP takes 4 cycles
706            timer_set(ATTOTIME_IN_HZ((Y2/4)/(4*nops)), 0, atarist_blitter_tick);
706            timer_set(ATTOTIME_IN_HZ((Y2/4)/(4*nops)), NULL, 0, atarist_blitter_tick);
707707         }
708708      }
709709   }
r1355r1356
717717
718718VIDEO_START( atarist )
719719{
720   atarist_shifter_timer = timer_alloc(atarist_shifter_tick);
721   atarist_glue_timer = timer_alloc(atarist_glue_tick);
720   atarist_shifter_timer = timer_alloc(atarist_shifter_tick, NULL);
721   atarist_glue_timer = timer_alloc(atarist_glue_tick, NULL);
722722
723723   timer_adjust(atarist_shifter_timer, video_screen_get_time_until_pos(0,0,0), 0, ATTOTIME_IN_HZ(Y2/4)); // 125 ns
724724   timer_adjust(atarist_glue_timer, video_screen_get_time_until_pos(0,0,0), 0, ATTOTIME_IN_HZ(Y2/16)); // 500 ns
src/mess/video/oric.c
r1355r1356
6868   /* initialise flash timer */
6969   vh_state.flash_count = 0;
7070   vh_state.flash_state = 0;
71   timer_pulse(ATTOTIME_IN_HZ(50), 0, oric_vh_timer_callback);
71   timer_pulse(ATTOTIME_IN_HZ(50), NULL, 0, oric_vh_timer_callback);
7272   /* mode */
7373   oric_vh_update_attribute((1<<3)|(1<<4));
7474}
src/mess/video/vic4567.c
r1355r1356
786786      if (LIGHTPEN_BUTTON)
787787      {
788788         /* lightpen timer starten */
789         timer_set (attotime_make(0, 0), 1, vic2_timer_timeout);
789         timer_set (attotime_make(0, 0), NULL, 1, vic2_timer_timeout);
790790      }
791791      //state_display(vic2.bitmap);
792792   }
src/mess/video/zx8301.c
r1355r1356
110110
111111VIDEO_START( zx8301 )
112112{
113   zx8301_flash_timer = timer_alloc(zx8301_flash_tick);
113   zx8301_flash_timer = timer_alloc(zx8301_flash_tick, NULL);
114114   timer_adjust(zx8301_flash_timer, ATTOTIME_IN_HZ(2), 0, ATTOTIME_IN_HZ(2));
115115
116116   state_save_register_global(zx8301.dispoff);
src/mess/video/coco3.c
r1355r1356
811811   }
812812
813813   /* GIME field sync timer */
814   video->gime_fs_timer = timer_alloc(gime_fs);
814   video->gime_fs_timer = timer_alloc(gime_fs, NULL);
815815
816816   /* initialize the CoCo video code */
817817   memset(&cfg, 0, sizeof(cfg));
src/mess/video/smsvdp.c
r1355r1356
210210
211211   set_display_settings();
212212
213   smsvdp.smsvdp_display_timer = timer_alloc( smsvdp_display_callback );
213   smsvdp.smsvdp_display_timer = timer_alloc( smsvdp_display_callback , NULL);
214214   timer_adjust( smsvdp.smsvdp_display_timer, video_screen_get_time_until_pos( 0, 0, 0 ), 0, video_screen_get_scan_period( 0 ) );
215215   return 0;
216216}
r1355r1356
255255            smsvdp.status |= STATUS_HINT;
256256            if ( smsvdp.reg[0x00] & 0x10 ) {
257257               /* Delay triggering of interrupt to allow software to read the status bit before the irq */
258               timer_set( video_screen_get_time_until_pos( 0, video_screen_get_vpos(0), video_screen_get_hpos(0) + 1 ), 0, smsvdp_set_irq );
258               timer_set( video_screen_get_time_until_pos( 0, video_screen_get_vpos(0), video_screen_get_hpos(0) + 1 ), NULL, 0, smsvdp_set_irq );
259259            }
260260         }
261261
r1355r1356
264264         smsvdp.status |= STATUS_VINT;
265265         if ( smsvdp.reg[0x01] & 0x20 ) {
266266            /* Delay triggering of interrupt to allow software to read the status bit before the irq */
267            timer_set( video_screen_get_time_until_pos( 0, video_screen_get_vpos(0), video_screen_get_hpos(0) + 1 ), 0, smsvdp_set_irq );
267            timer_set( video_screen_get_time_until_pos( 0, video_screen_get_vpos(0), video_screen_get_hpos(0) + 1 ), NULL, 0, smsvdp_set_irq );
268268         }
269269      }
270270      if ( video_skip_this_frame() ) {
r1355r1356
299299         smsvdp.status |= STATUS_HINT;
300300         if ( smsvdp.reg[0x00] & 0x10 ) {
301301            /* Delay triggering of interrupt to allow software to read the status bit before the irq */
302            timer_set( video_screen_get_time_until_pos( 0, video_screen_get_vpos(0), video_screen_get_hpos(0) + 1 ), 0, smsvdp_set_irq );
302            timer_set( video_screen_get_time_until_pos( 0, video_screen_get_vpos(0), video_screen_get_hpos(0) + 1 ), NULL, 0, smsvdp_set_irq );
303303         }
304304      } else {
305305         smsvdp.line_counter -= 1;
src/mess/video/pc_cga.c
r1355r1356
276276   state_save_register_item("pccga", 0, cga.status);
277277   state_save_register_item("pccga", 0, cga.plantronics);
278278
279   timer_pulse(ATTOTIME_IN_USEC(133333), 0, cga_timerproc);
279   timer_pulse(ATTOTIME_IN_USEC(133333), NULL, 0, cga_timerproc);
280280   return 0;
281281}
282282
src/mess/video/cdp1864.c
r1355r1356
196196
197197VIDEO_START( cdp1864 )
198198{
199   cdp1864_int_timer = timer_alloc(cdp1864_int_tick);
200   cdp1864_efx_timer = timer_alloc(cdp1864_efx_tick);
201   cdp1864_dma_timer = timer_alloc(cdp1864_dma_tick);
199   cdp1864_int_timer = timer_alloc(cdp1864_int_tick, NULL);
200   cdp1864_efx_timer = timer_alloc(cdp1864_efx_tick, NULL);
201   cdp1864_dma_timer = timer_alloc(cdp1864_dma_tick, NULL);
202202
203203   /* allocate the temporary bitmap */
204204   cdptmpbitmap = auto_bitmap_alloc(Machine->screen[0].width, Machine->screen[0].height, Machine->screen[0].format);
src/mess/video/vic6567.c
r1355r1356
13191319      if (LIGHTPEN_BUTTON)
13201320      {
13211321         /* lightpen timer starten */
1322         timer_set (attotime_make(0, 0), 1, vic2_timer_timeout);
1322         timer_set (attotime_make(0, 0), NULL, 1, vic2_timer_timeout);
13231323      }
13241324   }
13251325   if (vic2.rasterline == C64_2_RASTERLINE (RASTERLINE))
src/mess/video/m6845.c
r1355r1356
806806
807807   m6845_remove_vsync_set_timer();
808808
809        if (crtc_cycles_to_vsync_start!=-1)
809   if (crtc_cycles_to_vsync_start!=-1)
810810   {
811                m6845_vsync_set_timer = timer_set(ATTOTIME_IN_USEC(crtc_cycles_to_vsync_start), 0, m6845_vsync_set_timer_callback);
811      m6845_vsync_set_timer = timer_set(ATTOTIME_IN_USEC(crtc_cycles_to_vsync_start), NULL, 0, m6845_vsync_set_timer_callback);
812812   }
813813}
814814
r1355r1356
824824
825825   if (crtc_cycles_to_vsync_end!=-1)
826826   {
827                m6845_vsync_clear_timer = timer_set(ATTOTIME_IN_USEC(crtc_cycles_to_vsync_end), 0, m6845_vsync_clear_timer_callback);
827      m6845_vsync_clear_timer = timer_set(ATTOTIME_IN_USEC(crtc_cycles_to_vsync_end), NULL, 0, m6845_vsync_clear_timer_callback);
828828   }
829829}
830830
src/mess/video/ted7360.c
r1355r1356
534534   lines = TED7360_LINES;
535535   chargenaddr = bitmapaddr = videoaddr = 0;
536536   timer1_active = timer2_active = timer3_active = 0;
537   timer1 = timer_alloc(ted7360_timer_timeout);
538   timer2 = timer_alloc(ted7360_timer_timeout);
539   timer3 = timer_alloc(ted7360_timer_timeout);
537   timer1 = timer_alloc(ted7360_timer_timeout, NULL);
538   timer2 = timer_alloc(ted7360_timer_timeout, NULL);
539   timer3 = timer_alloc(ted7360_timer_timeout, NULL);
540540}
541541
542542void ted7360_set_dma (read8_handler dma_read,
src/mess/video/cdp1861.c
r1355r1356
149149
150150VIDEO_START( cdp1861 )
151151{
152   cdp1861_int_timer = timer_alloc(cdp1861_int_tick);
153   cdp1861_efx_timer = timer_alloc(cdp1861_efx_tick);
154   cdp1861_dma_timer = timer_alloc(cdp1861_dma_tick);
152   cdp1861_int_timer = timer_alloc(cdp1861_int_tick, NULL);
153   cdp1861_efx_timer = timer_alloc(cdp1861_efx_tick, NULL);
154   cdp1861_dma_timer = timer_alloc(cdp1861_dma_tick, NULL);
155155
156156   /* allocate the temporary bitmap */
157157   cdptmpbitmap = auto_bitmap_alloc(Machine->screen[0].width, Machine->screen[0].height, Machine->screen[0].format);
src/mess/inputx.c
r1355r1356
582582
583583static void setup_keybuffer(void)
584584{
585   inputx_timer = timer_alloc(inputx_timerproc);
585   inputx_timer = timer_alloc(inputx_timerproc, NULL);
586586   keybuffer = auto_malloc(sizeof(key_buffer));
587587   memset(keybuffer, 0, sizeof(*keybuffer));
588588}
src/mess/machine/wswan.c
r1355r1356
259259
260260   /* Set up RTC timer */
261261   if ( rtc.present ) {
262      timer_pulse( ATTOTIME_IN_SEC(1), 0, wswan_rtc_callback );
262      timer_pulse( ATTOTIME_IN_SEC(1), NULL, 0, wswan_rtc_callback );
263263   }
264264
265265}
src/mess/machine/zx.c
r1355r1356
145145         if ((cassette_input(image_from_devtype_and_index(IO_CASSETTE, 0)) < -0.75) && zx_tape_bit)
146146         {
147147            zx_tape_bit = 0x00;
148            timer_set(ATTOTIME_IN_USEC(362), 0, zx_tape_pulse);
148            timer_set(ATTOTIME_IN_USEC(362), NULL, 0, zx_tape_pulse);
149149         }
150150
151151         data &= ~zx_tape_bit;
r1355r1356
209209         if ((cassette_input(image_from_devtype_and_index(IO_CASSETTE, 0)) < -0.75) && zx_tape_bit)
210210         {
211211            zx_tape_bit = 0x00;
212            timer_set(ATTOTIME_IN_USEC(362), 0, zx_tape_pulse);
212            timer_set(ATTOTIME_IN_USEC(362), NULL, 0, zx_tape_pulse);
213213         }
214214
215215         data &= ~zx_tape_bit;
src/mess/machine/pdp1.c
r1355r1356
164164   pdp1_reset_param.hw_mul_div = (config >> pdp1_config_hw_mul_div_bit) & pdp1_config_hw_mul_div_mask;
165165   pdp1_reset_param.type_20_sbs = (config >> pdp1_config_type_20_sbs_bit) & pdp1_config_type_20_sbs_mask;
166166
167   tape_reader.timer = timer_alloc(reader_callback);
168   tape_puncher.timer = timer_alloc(puncher_callback);
169   typewriter.tyo_timer = timer_alloc(tyo_callback);
170   dpy_timer = timer_alloc(dpy_callback);
167   tape_reader.timer = timer_alloc(reader_callback, NULL);
168   tape_puncher.timer = timer_alloc(puncher_callback, NULL);
169   typewriter.tyo_timer = timer_alloc(tyo_callback, NULL);
170   dpy_timer = timer_alloc(dpy_callback, NULL);
171171
172172   /* reset device state */
173173   tape_reader.rcl = tape_reader.rc = 0;
r1355r1356
10411041
10421042static void parallel_drum_init(void)
10431043{
1044   parallel_drum.rotation_timer = timer_alloc(NULL);
1044   parallel_drum.rotation_timer = timer_alloc(NULL, NULL);
10451045   timer_adjust(parallel_drum.rotation_timer, PARALLEL_DRUM_ROTATION_TIME, 0, PARALLEL_DRUM_ROTATION_TIME);
10461046
1047   parallel_drum.il_timer = timer_alloc(il_timer_callback);
1047   parallel_drum.il_timer = timer_alloc(il_timer_callback, NULL);
10481048   parallel_drum_set_il(0);
10491049}
10501050#endif
src/mess/machine/nec765.c
r1355r1356
316316   timer_reset(fdc.seek_timer, attotime_never);
317317}
318318
319static TIMER_CALLBACK(nec765_timer_callback)
319static void nec765_timer_func(int timer_type)
320320{
321321   /* type 0 = data transfer mode in execution phase */
322322   if (fdc.timer_type == 0)
r1355r1356
333333      }
334334      else
335335      {
336         nec765_timer_callback(machine, fdc.timer_type);
336         nec765_timer_func(fdc.timer_type);
337337      }
338338   }
339339   else if (fdc.timer_type==2)
r1355r1356
384384   }
385385}
386386
387static TIMER_CALLBACK(nec765_timer_callback)
388{
389   nec765_timer_func(param);
390}
391
387392/* after (32-27) the DRQ is set, then 27 us later, the int is set.
388393I don't know if this is correct, but it is required for the PCW driver.
389394In this driver, the first NMI calls the handler function, furthur NMI's are
r1355r1356
400405   }
401406   else
402407   {
403      nec765_timer_callback(Machine, fdc.timer_type);
408      nec765_timer_func(fdc.timer_type);
404409      timer_reset(fdc.timer, attotime_never);
405410   }
406411}
r1355r1356
673678   int i;
674679
675680   fdc.version = version;
676   fdc.timer = timer_alloc(nec765_timer_callback);
677   fdc.seek_timer = timer_alloc(nec765_seek_timer_callback);
678   fdc.command_timer = timer_alloc(nec765_continue_command);
681   fdc.timer = timer_alloc(nec765_timer_callback, NULL);
682   fdc.seek_timer = timer_alloc(nec765_seek_timer_callback, NULL);
683   fdc.command_timer = timer_alloc(nec765_continue_command, NULL);
679684   memset(&nec765_iface, 0, sizeof(nec765_interface));
680685
681686   if (iface)
src/mess/machine/pc1401.c
r1355r1356
292292#endif
293293   for (i=0; i<128; i++) gfx[i]=i;
294294
295   timer_set(ATTOTIME_IN_SEC(1), 0, pc1401_power_up);
295   timer_set(ATTOTIME_IN_SEC(1), NULL, 0, pc1401_power_up);
296296
297297   if (RAM10K)
298298   {
src/mess/machine/apple2gs.c
r1355r1356
17171717
17181718MACHINE_RESET( apple2gs )
17191719{
1720   apple2gs_scanline_timer = timer_alloc(apple2gs_scanline_tick);
1720   apple2gs_scanline_timer = timer_alloc(apple2gs_scanline_tick, NULL);
17211721   timer_adjust(apple2gs_scanline_timer, attotime_never, 0, attotime_never);
17221722
17231723   // fire on scanline zero
src/mess/machine/applefdc.c
r1355r1356
101101{
102102   applefdc_lines = 0;
103103   iwm_mode = 0x1f;   /* default value needed by Lisa 2 - no, I don't know if it is true */
104   motor_timer = timer_alloc(iwm_turnmotor_onoff);
104   motor_timer = timer_alloc(iwm_turnmotor_onoff, NULL);
105105   if (intf)
106106      iwm_intf = *intf;
107107   else
src/mess/machine/hp48.c
r1355r1356
450450   hp48_card1=memory_region(REGION_CPU1)+0x140000;
451451   hp48_card2=memory_region(REGION_CPU1)+0x180000;
452452
453   timer_pulse(ATTOTIME_IN_HZ(8192), 0, hp48_timer);
453   timer_pulse(ATTOTIME_IN_HZ(8192), NULL, 0, hp48_timer);
454454}
455455
456456DRIVER_INIT( hp48g )
r1355r1356
470470   hp48_card1=memory_region(REGION_CPU1)+0x140000;
471471   hp48_card2=memory_region(REGION_CPU1)+0x180000;
472472
473   timer_pulse(ATTOTIME_IN_HZ(8192), 0, hp48_timer);
473   timer_pulse(ATTOTIME_IN_HZ(8192), NULL, 0, hp48_timer);
474474}
475475
476476MACHINE_RESET( hp48 )
src/mess/machine/dai.c
r1355r1356
137137   ppi8255_init(&dai_ppi82555_intf);
138138   pit8253_init(1, &dai_pit8253_intf);
139139
140   timer_set(attotime_zero, 0, dai_bootstrap_callback);
140   timer_set(attotime_zero, NULL, 0, dai_bootstrap_callback);
141141}
142142
143143/***************************************************************************
src/mess/machine/mac.c
r1355r1356
445445   if (kbd_comm == TRUE)
446446   {
447447      kbd_shift_reg = data;
448      timer_set(ATTOTIME_IN_MSEC(1), 0, kbd_clock);
448      timer_set(ATTOTIME_IN_MSEC(1), NULL, 0, kbd_clock);
449449   }
450450}
451451
r1355r1356
456456      /* Mac pulls CB2 down to initiate communication */
457457      kbd_comm = TRUE;
458458      kbd_receive = TRUE;
459      timer_set(ATTOTIME_IN_USEC(100), 0, kbd_clock);
459      timer_set(ATTOTIME_IN_USEC(100), NULL, 0, kbd_clock);
460460   }
461461   if (kbd_comm == TRUE && kbd_receive == TRUE)
462462   {
r1355r1356
13271327   mac_set_sound_buffer(0);
13281328
13291329   if (mac_model == MODEL_MAC_SE)
1330      timer_set(attotime_zero, 0, set_memory_overlay_callback);
1330      timer_set(attotime_zero, NULL, 0, set_memory_overlay_callback);
13311331
1332   mac_scanline_timer = timer_alloc(mac_scanline_tick);
1332   mac_scanline_timer = timer_alloc(mac_scanline_tick, NULL);
13331333   timer_adjust(mac_scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_never);
13341334}
13351335
r1355r1356
13651365   /* setup keyboard */
13661366   keyboard_init();
13671367
1368   inquiry_timeout = timer_alloc(inquiry_timeout_func);
1368   inquiry_timeout = timer_alloc(inquiry_timeout_func, NULL);
13691369
13701370   cpuintrf_set_dasm_override(0, mac_dasm_override);
13711371
src/mess/machine/pcf8593.c
r1355r1356
5656   memset( &rtc, 0, sizeof( rtc));
5757   rtc.size = 16;
5858   rtc.data = malloc( rtc.size);
59   rtc.timer = timer_alloc( pcf8593_timer_callback );
59   rtc.timer = timer_alloc( pcf8593_timer_callback , NULL);
6060   timer_adjust( rtc.timer, ATTOTIME_IN_SEC(1), 0, ATTOTIME_IN_SEC(1));
6161   pcf8593_reset();
6262}
src/mess/machine/cbmb.c
r1355r1356
240240   tpi6525[1].a.output=cbmb_keyboard_line_select_a;
241241   tpi6525[1].b.output=cbmb_keyboard_line_select_b;
242242   tpi6525[1].c.output=cbmb_keyboard_line_select_c;
243   timer_pulse(ATTOTIME_IN_MSEC(10), 0, cbmb_frame_interrupt);
243   timer_pulse(ATTOTIME_IN_MSEC(10), NULL, 0, cbmb_frame_interrupt);
244244
245245   cbm500 = 0;
246246   cbm700 = 0;
src/mess/machine/i8271.c
r1355r1356
6161   {
6262      memcpy(&i8271.fdc_interface, iface, sizeof(i8271_interface));
6363   }
64   i8271.data_timer = timer_alloc(i8271_data_timer_callback);
65   i8271.command_complete_timer = timer_alloc(i8271_timed_command_complete_callback);
64   i8271.data_timer = timer_alloc(i8271_data_timer_callback, NULL);
65   i8271.command_complete_timer = timer_alloc(i8271_timed_command_complete_callback, NULL);
6666   i8271.drive = 0;
6767   i8271.pExecutionPhaseData = temp_buffer;
6868
src/mess/machine/pc1350.c
r1355r1356
160160
161161MACHINE_START( pc1350 )
162162{
163   timer_set(ATTOTIME_IN_SEC(1), 0, pc1350_power_up);
163   timer_set(ATTOTIME_IN_SEC(1), NULL, 0, pc1350_power_up);
164164
165165   memory_install_read8_handler(0,  ADDRESS_SPACE_PROGRAM, 0x6000, 0x6fff, 0, 0, MRA8_BANK1);
166166   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6fff, 0, 0, MWA8_BANK1);
src/mess/machine/pokemini.c
r1355r1356
9393   memset( &vdp, 0, sizeof(vdp) );
9494   memset( &timers, 0, sizeof(timers) );
9595   memset( pokemini_hwreg, 0, sizeof(pokemini_hwreg) );
96   timers.seconds_timer = timer_alloc( pokemini_seconds_timer_callback );
97   timers.hz256_timer = timer_alloc( pokemini_256hz_timer_callback );
98   timers.timer1_timer = timer_alloc( pokemini_timer1_callback );
99   timers.timer2_timer = timer_alloc( pokemini_timer2_callback );
100   timers.timer3_timer = timer_alloc( pokemini_timer3_callback );
96   timers.seconds_timer = timer_alloc( pokemini_seconds_timer_callback , NULL);
97   timers.hz256_timer = timer_alloc( pokemini_256hz_timer_callback , NULL);
98   timers.timer1_timer = timer_alloc( pokemini_timer1_callback , NULL);
99   timers.timer2_timer = timer_alloc( pokemini_timer2_callback , NULL);
100   timers.timer3_timer = timer_alloc( pokemini_timer3_callback , NULL);
101101}
102102
103103WRITE8_HANDLER( pokemini_hwreg_w ) {
src/mess/machine/rp5c15.c
r1355r1356
135135   rtc.test = 0x00;
136136   rtc.pulse_count = 0;
137137   
138   rtc_timer = timer_alloc(rtc_alarm_pulse);
138   rtc_timer = timer_alloc(rtc_alarm_pulse, NULL);
139139   timer_adjust(rtc_timer, attotime_zero, 0, ATTOTIME_IN_HZ(32));
140140}
141141
src/mess/machine/coco.c
r1355r1356
869869   coco3_recalc_irq();
870870}
871871
872static void (*recalc_interrupts)(running_machine *machine, int dummy);
872static timer_callback recalc_interrupts;
873873
874874void coco_set_halt_line(int halt_line)
875875{
876876   cpunum_set_input_line(0, INPUT_LINE_HALT, halt_line);
877877   if (halt_line == CLEAR_LINE)
878      timer_set(ATTOTIME_IN_CYCLES(1,0), 0, recalc_interrupts);
878      timer_set(ATTOTIME_IN_CYCLES(1,0), NULL, 0, recalc_interrupts);
879879}
880880
881881
r1355r1356
20602060
20612061static void coco3_timer_init(void)
20622062{
2063   coco3_gime_timer = timer_alloc(coco3_timer_proc);
2063   coco3_gime_timer = timer_alloc(coco3_timer_proc, NULL);
20642064}
20652065
20662066
r1355r1356
25632563
25642564
25652565/*-------------------------------------------------
2566    coco_cart_timer_proc - call for CART line
2566    coco_cart_timer_w - call for CART line
25672567-------------------------------------------------*/
25682568
2569static TIMER_CALLBACK(coco_cart_timer_proc)
2569static void coco_cart_timer_w(running_machine *machine, int data)
25702570{
2571   int data = param;
25722571   pia_1_cb1_w(0, (data & 0x01) ? ASSERT_LINE : CLEAR_LINE);
25732572
25742573   /* special code for Q state */
r1355r1356
25792578
25802579
25812580/*-------------------------------------------------
2581    coco_cart_timer_proc - call for CART line
2582-------------------------------------------------*/
2583
2584static TIMER_CALLBACK(coco_cart_timer_proc)
2585{
2586   coco_cart_timer_w(machine, param);
2587}
2588
2589
2590
2591/*-------------------------------------------------
25822592    coco3_cart_timer_proc - calls coco_timer_proc and
25832593   in addition will raise the GIME interrupt
25842594-------------------------------------------------*/
r1355r1356
25872597{
25882598   int data = param;
25892599   coco3_raise_interrupt(COCO3_INT_EI0, (data & 0x01) ? ASSERT_LINE : CLEAR_LINE);
2590   coco_cart_timer_proc(machine, data);
2600   coco_cart_timer_w(machine, data);
25912601}
25922602
25932603
r1355r1356
27212731struct _machine_init_interface
27222732{
27232733   const pia6821_interface *piaintf;         /* PIA initializer */
2724   void (*recalc_interrupts_)(running_machine *machine, int dummy);      /* recalculate inturrupts callback */
2734   timer_callback recalc_interrupts_;         /* recalculate inturrupts callback */
27252735   void (*printer_out_)(int data);            /* printer output callback */
2726   void (*cart_timer_proc)(running_machine *machine, int data);         /* cartridge timer proc */
2736   timer_callback cart_timer_proc;            /* cartridge timer proc */
27272737   const char *fdc_cart_hardware;            /* normal cartridge hardware */
27282738   void (*map_memory)(coco_cartridge *cartridge, UINT32 offset, UINT32 mask);
27292739};
r1355r1356
27532763   recalc_interrupts = init->recalc_interrupts_;
27542764
27552765   /* this timer is used to schedule keyboard updating */
2756   update_keyboard_timer = timer_alloc(coco_update_keyboard_timerproc);
2766   update_keyboard_timer = timer_alloc(coco_update_keyboard_timerproc, NULL);
27572767   
27582768   /* these are the timers to delay the MUX switching */
2759   mux_sel1_timer = timer_alloc(coco_update_sel1_timerproc);
2760   mux_sel2_timer = timer_alloc(coco_update_sel2_timerproc);
2769   mux_sel1_timer = timer_alloc(coco_update_sel1_timerproc, NULL);
2770   mux_sel2_timer = timer_alloc(coco_update_sel2_timerproc, NULL);
27612771
27622772   /* setup ROM */
27632773   coco_rom = memory_region(REGION_CPU1);
r1355r1356
27772787   pia_reset();
27782788
27792789   /* cartridge line timers */
2780   cart_timer = timer_alloc(init->cart_timer_proc);
2781   nmi_timer = timer_alloc(nmi_timer_proc);
2782   halt_timer = timer_alloc(halt_timer_proc);
2790   cart_timer = timer_alloc(init->cart_timer_proc, NULL);
2791   nmi_timer = timer_alloc(nmi_timer_proc, NULL);
2792   halt_timer = timer_alloc(halt_timer_proc, NULL);
27832793
27842794   /* determine which cartridge hardware we should be using */
27852795   cart_image = cartslot_image();
src/mess/machine/amigacd.c
r1355r1356
507507   /* initialize the dmac */
508508   memset( &dmac_data, 0, sizeof( dmac_data ) );
509509   
510   dmac_data.dma_timer = timer_alloc(dmac_dma_proc);
511   tp6525_delayed_timer = timer_alloc(tp6525_delayed_irq);
510   dmac_data.dma_timer = timer_alloc(dmac_dma_proc, NULL);
511   tp6525_delayed_timer = timer_alloc(tp6525_delayed_irq, NULL);
512512   
513513   /* initialize the 6525 TPI */
514514   tpi6525_0_reset();
src/mess/machine/mc6854.c
r1355r1356
980980   mc6854 = auto_malloc( sizeof( * mc6854 ) );
981981   assert( mc6854 );
982982   mc6854->iface = iface;
983   mc6854->ttimer = timer_alloc( mc6854_tfifo_cb );
983   mc6854->ttimer = timer_alloc( mc6854_tfifo_cb , NULL);
984984   state_save_register_item( "mc6854", 0, mc6854->cr1 );
985985   state_save_register_item( "mc6854", 0, mc6854->cr2 );
986986   state_save_register_item( "mc6854", 0, mc6854->cr3 );
src/mess/machine/tc8521.c
r1355r1356
297297   memset(&rtc.interface, 0, sizeof(struct tc8521_interface));
298298   if (intf)
299299      memcpy(&rtc.interface, intf, sizeof(struct tc8521_interface));
300   timer_pulse(ATTOTIME_IN_HZ(32), 0, tc8521_timer_callback);
300   timer_pulse(ATTOTIME_IN_HZ(32), NULL, 0, tc8521_timer_callback);
301301}
302302
303303 READ8_HANDLER(tc8521_r)
src/mess/machine/gb.c
r1355r1356
233233   gb_sound_w( 0x16, 0x00 );       /* Initialize sound hardware */
234234
235235   /* Allocate the serial timer, and disable it */
236   gb_serial_timer = timer_alloc( gb_serial_timer_proc );
236   gb_serial_timer = timer_alloc( gb_serial_timer_proc , NULL);
237237   timer_enable( gb_serial_timer, 0 );
238238
239239}
src/mess/machine/kim1.c
r1355r1356
624624   m6530[0].dria = 0xff;
625625   m6530[0].drib = 0xff;
626626   m6530[0].clock = (double) 1000000 / 1;
627   m6530[0].timer = timer_alloc(m6530_timer_cb);
627   m6530[0].timer = timer_alloc(m6530_timer_cb, NULL);
628628   set_chip_clock(0, 255);
629629
630630   m6530[1].dria = 0xff;
631631   m6530[1].drib = 0xff;
632632   m6530[1].clock = (double) 1000000 / 1;
633   m6530[1].timer = timer_alloc(m6530_timer_cb);
633   m6530[1].timer = timer_alloc(m6530_timer_cb, NULL);
634634   set_chip_clock(1, 255);
635635}
636636
src/mess/machine/upd7002.c
r1355r1356
151151      if (uPD7002_status&0x08)
152152      {
153153         // 12 bit conversion takes 10ms
154         timer_set(ATTOTIME_IN_MSEC(10), conversion_counter, uPD7002_conversioncomplete);
154         timer_set(ATTOTIME_IN_MSEC(10), NULL, conversion_counter, uPD7002_conversioncomplete);
155155      } else {
156156         // 8 bit conversion takes 4ms
157         timer_set(ATTOTIME_IN_MSEC(4),  conversion_counter, uPD7002_conversioncomplete);
157         timer_set(ATTOTIME_IN_MSEC(4),  NULL, conversion_counter, uPD7002_conversioncomplete);
158158      }
159159      break;
160160
src/mess/machine/99_dsk.c
r1355r1356
370370
371371   DVENA = 0;
372372   motor_on = 0;
373   motor_on_timer = timer_alloc(motor_on_timer_callback);
373   motor_on_timer = timer_alloc(motor_on_timer_callback, NULL);
374374
375375   ti99_peb_set_card_handlers(0x1100, & fdc_handlers);
376376
r1355r1356
635635
636636   DVENA = 0;
637637   motor_on = 0;
638   motor_on_timer = timer_alloc(motor_on_timer_callback);
638   motor_on_timer = timer_alloc(motor_on_timer_callback, NULL);
639639
640640   ti99_peb_set_card_handlers(0x1100, & ccfdc_handlers);
641641
r1355r1356
854854
855855   DVENA = 0;
856856   motor_on = 0;
857   motor_on_timer = timer_alloc(motor_on_timer_callback);
857   motor_on_timer = timer_alloc(motor_on_timer_callback, NULL);
858858
859859   ti99_peb_set_card_handlers(0x1100, & bwg_handlers);
860860
r1355r1356
12481248
12491249   DVENA = 0;
12501250   motor_on = 0;
1251   motor_on_timer = timer_alloc(motor_on_timer_callback);
1251   motor_on_timer = timer_alloc(motor_on_timer_callback, NULL);
12521252
12531253   ti99_peb_set_card_handlers(0x1100, & hfdc_handlers);
12541254
src/mess/machine/at29040.c
r1355r1356
130130*/
131131void at29c040a_init(int id)
132132{
133   at29c040a[id].programming_timer = timer_alloc(at29c040a_programming_timer_callback);
133   at29c040a[id].programming_timer = timer_alloc(at29c040a_programming_timer_callback, NULL);
134134}
135135
136136/*
src/mess/machine/gamecom.c
r1355r1356
7777
7878   /* should possibly go in a DRIVER_INIT piece? */
7979   if ( gamecom_clock_timer == NULL ) {
80      gamecom_clock_timer = timer_alloc( gamecom_clock_timer_callback );
80      gamecom_clock_timer = timer_alloc( gamecom_clock_timer_callback , NULL);
8181   }
8282   /* intialize the empty dummy bank */
8383   if ( dummy_bank == NULL ) {
src/mess/machine/mz700.c
r1355r1356
8989
9090MACHINE_RESET(mz700)
9191{
92   ne556_timer[0] = timer_alloc(ne556_callback);
92   ne556_timer[0] = timer_alloc(ne556_callback, NULL);
9393   timer_adjust(ne556_timer[0], ATTOTIME_IN_HZ(1.5), 0, ATTOTIME_IN_HZ(1.5));
94   /*timer_pulse(ATTOTIME_IN_HZ(1.5), 0, ne556_callback)*/
95   ne556_timer[1] = timer_alloc(ne556_callback);
94   /*timer_pulse(ATTOTIME_IN_HZ(1.5), NULL, 0, ne556_callback)*/
95   ne556_timer[1] = timer_alloc(ne556_callback, NULL);
9696   timer_adjust(ne556_timer[1], ATTOTIME_IN_HZ(34.5), 1, ATTOTIME_IN_HZ(34.5));
97   /*timer_pulse(ATTOTIME_IN_HZ(34.5), 1, ne556_callback)*/
97   /*timer_pulse(ATTOTIME_IN_HZ(34.5), NULL, 1, ne556_callback)*/
9898}
9999
100100
src/mess/machine/ti990.c
r1355r1356
8484void ti990_hold_load(void)
8585{
8686   cpunum_set_input_line(0, INPUT_LINE_NMI, ASSERT_LINE);
87   timer_set(ATTOTIME_IN_MSEC(100), 0, clear_load);
87   timer_set(ATTOTIME_IN_MSEC(100), NULL, 0, clear_load);
8888}
8989
9090/*
src/mess/machine/serial.c
r1355r1356
118118   serial_devices[id].data_form.word_length = num_data_bits;
119119   serial_devices[id].data_form.stop_bit_count = stop_bit_count;
120120   serial_devices[id].data_form.parity = parity_code;
121   serial_devices[id].timer = timer_alloc(serial_device_baud_rate_callback);
121   serial_devices[id].timer = timer_alloc(serial_device_baud_rate_callback, NULL);
122122
123123   serial_connection_init(&serial_devices[id].connection);
124124   serial_connection_set_in_callback(&serial_devices[id].connection, serial_device_in_callback);
src/mess/machine/vectrex.c
r1355r1356
238238   {
239239      vectrex_imager_status = param;
240240      coffset = param>1?3:0;
241      timer_set (double_to_attotime(rtime * vectrex_imager_angles[0]), imager_colors[coffset+2], vectrex_imager_change_color);
242      timer_set (double_to_attotime(rtime * vectrex_imager_angles[1]), imager_colors[coffset+1], vectrex_imager_change_color);
243      timer_set (double_to_attotime(rtime * vectrex_imager_angles[2]), imager_colors[coffset], vectrex_imager_change_color);
241      timer_set (double_to_attotime(rtime * vectrex_imager_angles[0]), NULL, imager_colors[coffset+2], vectrex_imager_change_color);
242      timer_set (double_to_attotime(rtime * vectrex_imager_angles[1]), NULL, imager_colors[coffset+1], vectrex_imager_change_color);
243      timer_set (double_to_attotime(rtime * vectrex_imager_angles[2]), NULL, imager_colors[coffset], vectrex_imager_change_color);
244244
245245      if (param == 2)
246246      {
247         timer_set (double_to_attotime(rtime * 0.50), 1, vectrex_imager_right_eye);
247         timer_set (double_to_attotime(rtime * 0.50), NULL, 1, vectrex_imager_right_eye);
248248
249249         /* Index hole sensor is connected to IO7 which triggers also CA1 of VIA */
250250         via_0_ca1_w (0, 1);
src/mess/machine/nes_mmc.c
r1355r1356
42194219   ppu2c0x_set_hblank_callback (0, mapper ? mapper->mmc_hblank :  NULL);
42204220
42214221   if (!nes_irq_timer)
4222      nes_irq_timer = timer_alloc(nes_irq_callback);
4222      nes_irq_timer = timer_alloc(nes_irq_callback, NULL);
42234223     
42244224   mapper_warning = 0;
42254225   /* 8k mask */
src/mess/machine/vc1541.c
r1355r1356
634634
635635   logerror("floppy image %s loaded\n", image_filename(image));
636636
637   vc1541->timer = timer_alloc(vc1541_timer);
637   vc1541->timer = timer_alloc(vc1541_timer, NULL);
638638   return INIT_PASS;
639639}
640640
r1355r1356
956956
957957   /* time should be small enough to allow quitting of the irq
958958      line before the next interrupt is triggered */
959   vc1541->drive.c1551.timer = timer_alloc(c1551_timer);
959   vc1541->drive.c1551.timer = timer_alloc(c1551_timer, NULL);
960960   timer_adjust(vc1541->drive.c1551.timer, attotime_zero, 0, ATTOTIME_IN_HZ(60));
961961   return 0;
962962}
src/mess/machine/mc6846.c
r1355r1356
571571void mc6846_config ( const mc6846_interface* iface )
572572{
573573   mc6846.iface = iface;
574   mc6846.interval = timer_alloc( mc6846_timer_expire );
575   mc6846.one_shot = timer_alloc( mc6846_timer_one_shot );
574   mc6846.interval = timer_alloc( mc6846_timer_expire , NULL);
575   mc6846.one_shot = timer_alloc( mc6846_timer_one_shot , NULL);
576576 
577577   state_save_register_item( "mc6846", 0, mc6846.csr );
578578   state_save_register_item( "mc6846", 0, mc6846.pcr );
src/mess/machine/thomson.c
r1355r1356
10081008{
10091009   LOG (( "to7_game_init called\n" ));
10101010   pia_config( THOM_PIA_GAME, &to7_game );
1011   to7_game_timer = timer_alloc( to7_game_update_cb );
1011   to7_game_timer = timer_alloc( to7_game_update_cb , NULL);
10121012   timer_adjust( to7_game_timer, TO7_GAME_POLL_PERIOD, 0, TO7_GAME_POLL_PERIOD );
10131013   state_save_register_global( to7_game_sound );
10141014   state_save_register_global( to7_game_mute );
r1355r1356
19301930   to7_modem_init();
19311931   to7_midi_init();
19321932   to7_rf57932_init();
1933   mo5_periodic_timer = timer_alloc( mo5_periodic_cb );
1933   mo5_periodic_timer = timer_alloc( mo5_periodic_cb , NULL);
19341934   mea8000_config( THOM_SOUND_SPEECH, NULL );
19351935
19361936   /* memory */
r1355r1356
27372737static void to9_kbd_init ( void )
27382738{
27392739   LOG(( "to9_kbd_init called\n" ));
2740   to9_kbd_timer = timer_alloc( to9_kbd_timer_cb );
2740   to9_kbd_timer = timer_alloc( to9_kbd_timer_cb , NULL);
27412741   state_save_register_global( to9_kbd_parity );
27422742   state_save_register_global( to9_kbd_intr );
27432743   state_save_register_global( to9_kbd_in );
r1355r1356
30813081*/
30823082
30833083/* keyboard automaton */
3084static TIMER_CALLBACK(to8_kbd_timer_cb)
3084static void to8_kbd_timer_func(void)
30853085{
30863086   attotime d;
30873087
r1355r1356
31573157
31583158
31593159
3160static TIMER_CALLBACK(to8_kbd_timer_cb)
3161{
3162   to8_kbd_timer_func();
3163}
3164
3165
3166
31603167/* cpu <-> keyboard hand-check */
31613168static void to8_kbd_set_ack ( int data )
31623169{
r1355r1356
32423249   to8_kbd_ack = 1;
32433250   to8_kbd_caps = 1;
32443251   thom_set_caps_led( ! to8_kbd_caps );
3245   to8_kbd_timer_cb( Machine, 0 );
3252   to8_kbd_timer_func();
32463253}
32473254
32483255
32493256
32503257static void to8_kbd_init ( void )
32513258{
3252   to8_kbd_timer = timer_alloc( to8_kbd_timer_cb );
3253   to8_kbd_signal = timer_alloc( NULL );
3259   to8_kbd_timer = timer_alloc( to8_kbd_timer_cb , NULL);
3260   to8_kbd_signal = timer_alloc( NULL , NULL);
32543261   state_save_register_global( to8_kbd_ack );
32553262   state_save_register_global( to8_kbd_data );
32563263   state_save_register_global( to8_kbd_step );
r1355r1356
42784285{
42794286   LOG (( "mo6_game_init called\n" ));
42804287   pia_config( THOM_PIA_GAME, &mo6_game );
4281   to7_game_timer = timer_alloc( mo6_game_update_cb );
4288   to7_game_timer = timer_alloc( mo6_game_update_cb , NULL);
42824289   timer_adjust( to7_game_timer, TO7_GAME_POLL_PERIOD, 0, TO7_GAME_POLL_PERIOD );
42834290   state_save_register_global( to7_game_sound );
42844291   state_save_register_global( to7_game_mute );
r1355r1356
46074614   to7_modem_init();
46084615   to7_midi_init();
46094616   to7_rf57932_init();
4610   mo5_periodic_timer = timer_alloc( mo5_periodic_cb );
4617   mo5_periodic_timer = timer_alloc( mo5_periodic_cb , NULL);
46114618   mea8000_config( THOM_SOUND_SPEECH, NULL );
46124619 
46134620   /* memory */
r1355r1356
47924799{
47934800   LOG (( "mo5nr_game_init called\n" ));
47944801   pia_config( THOM_PIA_GAME, &mo5nr_game );
4795   to7_game_timer = timer_alloc( mo6_game_update_cb );
4802   to7_game_timer = timer_alloc( mo6_game_update_cb , NULL);
47964803   timer_adjust( to7_game_timer, TO7_GAME_POLL_PERIOD, 0, TO7_GAME_POLL_PERIOD );
47974804   state_save_register_global( to7_game_sound );
47984805   state_save_register_global( to7_game_mute );
r1355r1356
48744881   to7_modem_init();
48754882   to7_midi_init();
48764883   to7_rf57932_init();
4877   mo5_periodic_timer = timer_alloc( mo5_periodic_cb );
4884   mo5_periodic_timer = timer_alloc( mo5_periodic_cb , NULL);
48784885   mea8000_config( THOM_SOUND_SPEECH, NULL );
48794886 
48804887   /* memory */
src/mess/machine/lisa.c
r1355r1356
689689   COPS_Ready = TRUE;
690690
691691   /* impulsion width : +/- 20us */
692   timer_set(ATTOTIME_IN_USEC(20), 0, read_COPS_command);
692   timer_set(ATTOTIME_IN_USEC(20), NULL, 0, read_COPS_command);
693693}
694694
695695static void reset_COPS(void)
r1355r1356
753753   COPS_Ready = FALSE;
754754
755755   /* read command every ms (don't know the real value) */
756   timer_pulse(ATTOTIME_IN_MSEC(1), 0, set_COPS_ready);
756   timer_pulse(ATTOTIME_IN_MSEC(1), NULL, 0, set_COPS_ready);
757757
758758   reset_COPS();
759759}
r1355r1356
11221122
11231123MACHINE_RESET( lisa )
11241124{
1125   mouse_timer = timer_alloc(handle_mouse);
1125   mouse_timer = timer_alloc(handle_mouse, NULL);
11261126
11271127   lisa_ram_ptr = memory_region(REGION_CPU1) + RAM_OFFSET;
11281128   lisa_rom_ptr = memory_region(REGION_CPU1) + ROM_OFFSET;
src/mess/machine/lynx.c
r1355r1356
610610    }
611611
612612   if (0)
613      timer_set(ATTOTIME_IN_CYCLES(blitter.memory_accesses*20,0), 0, lynx_blitter_timer);
613      timer_set(ATTOTIME_IN_CYCLES(blitter.memory_accesses*20,0), NULL, 0, lynx_blitter_timer);
614614}
615615
616616static void lynx_divide(void)
r1355r1356
820820static void lynx_timer_init(int which)
821821{
822822   memset( &lynx_timer[which], 0, sizeof(LYNX_TIMER) );
823   lynx_timer[which].timer = timer_alloc( lynx_timer_shot );
823   lynx_timer[which].timer = timer_alloc( lynx_timer_shot , NULL);
824824   lynx_timer[which].settime = 0.0;
825825}
826826
r1355r1356
983983    if (uart.buffer_loaded) {
984984   uart.data_to_send=uart.buffer;
985985   uart.buffer_loaded=FALSE;
986   timer_set(ATTOTIME_IN_USEC(11), 0, lynx_uart_timer);   
986   timer_set(ATTOTIME_IN_USEC(11), NULL, 0, lynx_uart_timer);   
987987    } else {
988988   uart.sending=FALSE;
989989    }
r1355r1356
10251025   } else {
10261026       uart.sending=TRUE;
10271027       uart.data_to_send=data;
1028       timer_set(ATTOTIME_IN_USEC(11), 0, lynx_uart_timer);
1028       timer_set(ATTOTIME_IN_USEC(11), NULL, 0, lynx_uart_timer);
10291029   }
10301030   break;
10311031    }
src/mess/machine/pmd85.c
r1355r1356
784784
785785   msm8251_init(&pmd85_msm8251_interface);
786786
787   pmd85_cassette_timer = timer_alloc(pmd85_cassette_timer_callback);
787   pmd85_cassette_timer = timer_alloc(pmd85_cassette_timer_callback, NULL);
788788   timer_adjust(pmd85_cassette_timer, attotime_zero, 0, ATTOTIME_IN_HZ(2400));
789789
790790   serial_connection_init(&pmd85_cassette_serial_connection);
src/mess/machine/rriot.c
r1355r1356
7979{
8080   memset(&rriot[nr], 0, sizeof(rriot[nr]));
8181   rriot[nr].config = config;
82   rriot[nr].timer = timer_alloc(rriot_timer_cb);
82   rriot[nr].timer = timer_alloc(rriot_timer_cb, NULL);
8383
8484    LOG("RRIOT - successfully initialised\n");
8585}
src/mess/machine/geneve.c
r1355r1356
399399      logerror("time to ready: %f -> %d\n", attotime_to_double(time_to_ready), (int) cycles_to_ready);
400400
401401      activecpu_adjust_icount(-cycles_to_ready);
402      timer_set(attotime_zero, 0, /*speech_kludge_callback*/NULL);
402      timer_set(attotime_zero, NULL, 0, /*speech_kludge_callback*/NULL);
403403   }
404404#endif
405405
src/mess/machine/tx0.c
r1355r1356
166166{
167167   memory_set_opbase_handler(0, setOPbasefunc);;
168168
169   tape_reader.timer = timer_alloc(reader_callback);
170   tape_puncher.timer = timer_alloc(puncher_callback);
171   typewriter.prt_timer = timer_alloc(prt_callback);
172   dis_timer = timer_alloc(dis_callback);
169   tape_reader.timer = timer_alloc(reader_callback, NULL);
170   tape_puncher.timer = timer_alloc(puncher_callback, NULL);
171   typewriter.prt_timer = timer_alloc(prt_callback, NULL);
172   dis_timer = timer_alloc(dis_callback, NULL);
173173
174174   add_reset_callback(machine, tx0_machine_reset);
175175   add_exit_callback(machine, tx0_machine_stop);
src/mess/machine/pc_turbo.c
r1355r1356
2222
2323
2424
25static TIMER_CALLBACK_PTR(pc_turbo_callback)
25static TIMER_CALLBACK(pc_turbo_callback)
2626{
27   struct pc_turbo_info *ti = (struct pc_turbo_info *) param;
27   struct pc_turbo_info *ti = (struct pc_turbo_info *) ptr;
2828   int val;
2929   
3030   val = readinputport(ti->port) & ti->mask;
r1355r1356
4949   ti->cur_val = -1;
5050   ti->off_speed = off_speed;
5151   ti->on_speed = on_speed;
52   timer_pulse_ptr(ATTOTIME_IN_MSEC(100), ti, pc_turbo_callback);
52   timer_pulse(ATTOTIME_IN_MSEC(100), ti, 0, pc_turbo_callback);
5353   return 0;
5454}
src/mess/machine/lviv.c
r1355r1356
226226   memory_set_bankptr(3, memory_region(REGION_CPU1) + 0x010000);
227227   memory_set_bankptr(4, memory_region(REGION_CPU1) + 0x010000);
228228
229   /*timer_pulse(TIME_IN_NSEC(200), 0, lviv_draw_pixel);*/
229   /*timer_pulse(TIME_IN_NSEC(200), NULL, 0, lviv_draw_pixel);*/
230230
231231   /*memset(mess_ram, 0, sizeof(unsigned char)*0xffff);*/
232232}
src/mess/machine/ay3600.c
r1355r1356
316316
317317   /* We poll the keyboard periodically to scan the keys.  This is
318318   actually consistent with how the AY-3600 keyboard controller works. */
319   timer_pulse(ATTOTIME_IN_HZ(60), 0, AY3600_poll);
319   timer_pulse(ATTOTIME_IN_HZ(60), NULL, 0, AY3600_poll);
320320
321321   /* Set Caps Lock light to ON, since that's how we default it. */
322322   set_led_status(1,1);
src/mess/machine/pc8801.c
r1355r1356
175175   interrupt_mask_reg=0xf8;
176176   interrupt_trig_reg=0x0;
177177   cpunum_set_irq_callback(0,pc8801_interupt_callback);
178   timer_pulse(ATTOTIME_IN_HZ(600),0,pc8801_timer_interrupt);
178   timer_pulse(ATTOTIME_IN_HZ(600),NULL, 0,pc8801_timer_interrupt);
179179}
180180
181181WRITE8_HANDLER(pc88sr_outport_30)
src/mess/machine/tms9901.c
r1355r1356
197197{
198198   int i;
199199
200   tms9901[which].timer = timer_alloc(decrementer_callback);
200   tms9901[which].timer = timer_alloc(decrementer_callback, NULL);
201201
202202   tms9901[which].supported_int_mask = param->supported_int_mask;
203203
src/mess/machine/pet.c
r1355r1356
452452   }
453453
454454   /* pet clock */
455   timer_pulse(ATTOTIME_IN_MSEC(10), 0, pet_interrupt);
455   timer_pulse(ATTOTIME_IN_MSEC(10), NULL, 0, pet_interrupt);
456456
457457   via_config(0, &pet_via);
458458   pia_config(1, &pet_pia1);
src/mess/machine/oric.c
r1355r1356
11011101   oric_irqs = 0;
11021102   oric_ram_0x0c000 = NULL;
11031103
1104    timer_pulse(ATTOTIME_IN_HZ(4800), 0, oric_refresh_tape);
1104    timer_pulse(ATTOTIME_IN_HZ(4800), NULL, 0, oric_refresh_tape);
11051105
11061106   via_reset();
11071107   via_config(0, &oric_6522_interface);
src/mess/machine/europc.c
r1355r1356
277277   memset(&europc_rtc,0,sizeof(europc_rtc));
278278   europc_rtc.data[0xf]=1;
279279
280   europc_rtc.timer = timer_alloc(europc_rtc_timer);
280   europc_rtc.timer = timer_alloc(europc_rtc_timer, NULL);
281281   timer_adjust(europc_rtc.timer, attotime_zero, 0, attotime_make(1, 0));
282282}
283283
src/mess/machine/6551.c
r1355r1356
8888   memset(&acia, 0, sizeof(struct acia6551));
8989   /* transmit data reg is empty */
9090   acia.status_register |= (1<<4);
91   acia.timer = timer_alloc(acia_6551_timer_callback);
91   acia.timer = timer_alloc(acia_6551_timer_callback, NULL);
9292
9393   serial_connection_init(&acia.connection);
9494   serial_connection_set_in_callback(&acia.connection, acia_6551_in_callback);
src/mess/machine/atom.c
r1355r1356
251251   via_reset();
252252
253253   timer_state = 0;
254   timer_pulse(ATTOTIME_IN_HZ(2400*2), 0, atom_timer_callback);
254   timer_pulse(ATTOTIME_IN_HZ(2400*2), NULL, 0, atom_timer_callback);
255255
256256   memory_set_opbase_handler(0,atom_opbase_handler);
257257}
src/mess/machine/pc1403.c
r1355r1356
236236
237237   for (i=0; i<128; i++) gfx[i]=i;
238238
239   timer_set(ATTOTIME_IN_SEC(1), 0, pc1403_power_up);
239   timer_set(ATTOTIME_IN_SEC(1), NULL, 0, pc1403_power_up);
240240
241241   memory_set_bankptr(1, memory_region(REGION_USER1));
242242   if (RAM32K)
src/mess/machine/electron.c
r1355r1356
292292   
293293   ula.interrupt_status = 0x82;
294294   ula.interrupt_control = 0x00;
295   timer_set( attotime_zero, 0, setup_beep );
296   electron_tape_timer = timer_alloc( electron_tape_timer_handler );
295   timer_set( attotime_zero, NULL, 0, setup_beep );
296   electron_tape_timer = timer_alloc( electron_tape_timer_handler, NULL );
297297   add_reset_callback(machine, electron_reset);
298298}
299299
src/mess/machine/mfm.c
r1355r1356
147147         /* this is not quite correct. if the motor is stopped in the middle
148148         of the track, the next index pulse will occur in half a track time, from
149149         there after it will occur every 300hz */
150         drive->index_timer = timer_pulse(ATTOTIME_IN_HZ(300), drive_id, index_timer_callback);
150         drive->index_timer = timer_pulse(ATTOTIME_IN_HZ(300), NULL, drive_id, index_timer_callback);
151151      }
152152
153153      drive->motor_state = motor;
src/mess/machine/pc_hdc.c
r1355r1356
178178      status[i] = 0;
179179      error[i] = 0;
180180      dip[i] = 0xff;
181      timer[i] = timer_alloc(pc_hdc_command);
181      timer[i] = timer_alloc(pc_hdc_command, NULL);
182182      if (!timer[i])
183183         return -1;
184184   }
src/mess/machine/centroni.c
r1355r1356
3737{
3838   CENTRONICS *This=cent+nr;
3939   This->config=config;
40   This->timer = timer_alloc(centronics_timer_callback);
40   This->timer = timer_alloc(centronics_timer_callback, NULL);
4141}
4242
4343void centronics_write_data(int nr, UINT8 data)
src/mess/machine/apple1.c
r1355r1356
165165
166166      A 120-Hz poll rate seems to be fast enough to ensure no
167167      keystrokes are missed. */
168   timer_pulse(ATTOTIME_IN_HZ(120), 0, apple1_kbd_poll);
168   timer_pulse(ATTOTIME_IN_HZ(120), NULL, 0, apple1_kbd_poll);
169169}
170170
171171
r1355r1356
371371      /* The keyboard will pulse its strobe line when a key is
372372         pressed.  A 10-usec pulse is typical. */
373373      pia_set_input_ca1(0, 1);
374      timer_set(ATTOTIME_IN_USEC(10), 0, apple1_kbd_strobe_end);
374      timer_set(ATTOTIME_IN_USEC(10), NULL, 0, apple1_kbd_strobe_end);
375375   }
376376}
377377
r1355r1356
414414      write.  Thus the write delay depends on the cursor position and
415415      where the display is in the refresh cycle. */
416416   if (!data)
417      timer_set(apple1_vh_dsp_time_to_ready(), 0, apple1_dsp_ready_start);
417      timer_set(apple1_vh_dsp_time_to_ready(), NULL, 0, apple1_dsp_ready_start);
418418}
419419
420420static TIMER_CALLBACK(apple1_dsp_ready_start)
r1355r1356
424424      input CB1.  The end of this pulse will tell the PIA that the
425425      display is ready for another write. */
426426   pia_set_input_cb1(0, 0);
427   timer_set(ATTOTIME_IN_NSEC(3500), 0, apple1_dsp_ready_end);
427   timer_set(ATTOTIME_IN_NSEC(3500), NULL, 0, apple1_dsp_ready_end);
428428}
429429
430430static TIMER_CALLBACK(apple1_dsp_ready_end)
src/mess/machine/mc6843.c
r1355r1356
801801   assert( mc6843 );
802802   memset( mc6843, 0, sizeof( * mc6843 ) );
803803   mc6843->iface = iface;
804   mc6843->timer_cont = timer_alloc( mc6843_cont );
804   mc6843->timer_cont = timer_alloc( mc6843_cont , NULL);
805805
806806   state_save_register_item( "mc6843", 0, mc6843->CTAR );
807807   state_save_register_item( "mc6843", 0, mc6843->CMR );
src/mess/machine/mm58274c.c
r1355r1356
9292{
9393   memset(&rtc[which], 0, sizeof(rtc[which]));
9494
95   timer_pulse(ATTOTIME_IN_MSEC(100), which, increment_rtc);
96   rtc[which].interrupt_timer = timer_alloc(rtc_interrupt_callback);
95   timer_pulse(ATTOTIME_IN_MSEC(100), NULL, which, increment_rtc);
96   rtc[which].interrupt_timer = timer_alloc(rtc_interrupt_callback, NULL);
9797
9898   {
9999      mame_system_time systime;
src/mess/machine/ibmpc.c
r1355r1356
227227void pc_rtc_init(void)
228228{
229229   memset(&pc_rtc,0,sizeof(pc_rtc));
230   pc_rtc.timer = timer_alloc(pc_rtc_timer);
230   pc_rtc.timer = timer_alloc(pc_rtc_timer, NULL);
231231   timer_adjust(pc_rtc.timer, attotime_zero, 0, attotime_make(1, 0));
232232}
233233
src/mess/machine/68901mfp.c
r1355r1356
11621162
11631163   // counter timers
11641164
1165   mfp_p->timer[MFP68901_TIMER_A] = timer_alloc(timer_a);
1166   mfp_p->timer[MFP68901_TIMER_B] = timer_alloc(timer_b);
1167   mfp_p->timer[MFP68901_TIMER_C] = timer_alloc(timer_c);
1168   mfp_p->timer[MFP68901_TIMER_D] = timer_alloc(timer_d);
1165   mfp_p->timer[MFP68901_TIMER_A] = timer_alloc(timer_a, NULL);
1166   mfp_p->timer[MFP68901_TIMER_B] = timer_alloc(timer_b, NULL);
1167   mfp_p->timer[MFP68901_TIMER_C] = timer_alloc(timer_c, NULL);
1168   mfp_p->timer[MFP68901_TIMER_D] = timer_alloc(timer_d, NULL);
11691169
11701170   // serial receive timer
11711171
11721172   if (mfp_p->intf->rx_clock > 0)
11731173   {
1174      timer_pulse(ATTOTIME_IN_HZ(mfp_p->intf->rx_clock), which, rx_tick);
1174      timer_pulse(ATTOTIME_IN_HZ(mfp_p->intf->rx_clock), NULL, which, rx_tick);
11751175   }
11761176   
11771177   // serial transmit timer
11781178
11791179   if (mfp_p->intf->tx_clock > 0)
11801180   {
1181      timer_pulse(ATTOTIME_IN_HZ(mfp_p->intf->tx_clock), which, tx_tick);
1181      timer_pulse(ATTOTIME_IN_HZ(mfp_p->intf->tx_clock), NULL, which, tx_tick);
11821182   }
11831183
11841184   // general purpose I/O poll timer
11851185
11861186   if (mfp_p->intf->gpio_r)
11871187   {
1188      timer_pulse(ATTOTIME_IN_HZ(mfp_p->intf->chip_clock / 4), which, mfp68901_gpio_poll_tick);
1188      timer_pulse(ATTOTIME_IN_HZ(mfp_p->intf->chip_clock / 4), NULL, which, mfp68901_gpio_poll_tick);
11891189   }
11901190
11911191   // save state support
src/mess/machine/amigafdc.c
r1355r1356
7474   fdc_status[id].dir = 0;
7575   fdc_status[id].wprot = 1;
7676   fdc_status[id].cyl = 0;
77   fdc_status[id].rev_timer = timer_alloc(fdc_rev_proc);
78   fdc_status[id].dma_timer = timer_alloc(fdc_dma_proc);
79   fdc_status[id].sync_timer = timer_alloc(fdc_sync_proc);
77   fdc_status[id].rev_timer = timer_alloc(fdc_rev_proc, NULL);
78   fdc_status[id].dma_timer = timer_alloc(fdc_dma_proc, NULL);
79   fdc_status[id].sync_timer = timer_alloc(fdc_sync_proc, NULL);
8080   fdc_status[id].rev_timer_started = 0;
8181   fdc_status[id].cached = -1;
8282   fdc_status[id].pos = 0;
src/mess/machine/z80dart.c
r1355r1356
275275
276276   memset(dart, 0, sizeof(*dart));
277277
278   dart->chan[0].receive_timer = timer_alloc(serial_callback);
279   dart->chan[1].receive_timer = timer_alloc(serial_callback);
278   dart->chan[0].receive_timer = timer_alloc(serial_callback, NULL);
279   dart->chan[1].receive_timer = timer_alloc(serial_callback, NULL);
280280
281281   dart->irq_cb = intf->irq_cb;
282282   dart->dtr_changed_cb = intf->dtr_changed_cb;
r1355r1356
579579void z80dart_set_cts(int which, int ch, int state)
580580{
581581   /* operate deferred */
582   timer_set(attotime_zero, (DART_RR0_CTS << 8) + (state != 0) * 0x80 + which * 2 + ch, change_input_line);
582   timer_set(attotime_zero, NULL, (DART_RR0_CTS << 8) + (state != 0) * 0x80 + which * 2 + ch, change_input_line);
583583}
584584
585585
r1355r1356
591591void z80dart_set_dcd(int which, int ch, int state)
592592{
593593   /* operate deferred */
594   timer_set(attotime_zero, (DART_RR0_DCD << 8) + (state != 0) * 0x80 + which * 2 + ch, change_input_line);
594   timer_set(attotime_zero, NULL, (DART_RR0_DCD << 8) + (state != 0) * 0x80 + which * 2 + ch, change_input_line);
595595}
596596
597597
r1355r1356
603603void z80dart_set_ri(int which, int state)
604604{
605605   /* operate deferred */
606   timer_set(attotime_zero, (DART_RR0_RI << 8) + (state != 0) * 0x80 + which * 2, change_input_line);
606   timer_set(attotime_zero, NULL, (DART_RR0_RI << 8) + (state != 0) * 0x80 + which * 2, change_input_line);
607607}
608608
609609
src/mess/machine/amigakbd.c
r1355r1356
112112   key_buf = auto_malloc( KEYBOARD_BUFFER_SIZE );
113113   key_buf_pos = 0;
114114   key_cur_pos = 0;
115   kbd_timer = timer_alloc(kbd_update_callback);
115   kbd_timer = timer_alloc(kbd_update_callback, NULL);
116116   timer_reset( kbd_timer, attotime_never );
117117}
118118
src/mess/machine/matsucd.c
r1355r1356
6666   
6767   cd.cdrom = mess_cd_get_cdrom_file_by_number(0);
6868   
69   cd.frame_timer = timer_alloc(matsu_subcode_proc);
69   cd.frame_timer = timer_alloc(matsu_subcode_proc, NULL);
7070   
7171   cd.stch_signal = 1;
7272}
r1355r1356
270270      if ( cd.stch_signal != 0 )
271271      {
272272         update_status_changed( 0 );
273         timer_set( ATTOTIME_IN_MSEC(1), 0, matsucd_set_status_end );
273         timer_set( ATTOTIME_IN_MSEC(1), NULL, 0, matsucd_set_status_end );
274274      }
275275   }
276276}
src/mess/machine/microtan.c
r1355r1356
434434        break;
435435    case 1: /* BFF1: write delayed NMI */
436436        LOG(("microtan_bff1_w: %d <- %02x (delayed NMI)\n", offset, data));
437        timer_set(ATTOTIME_IN_CYCLES(8,0), 0, microtan_pulse_nmi);
437        timer_set(ATTOTIME_IN_CYCLES(8,0), NULL, 0, microtan_pulse_nmi);
438438        break;
439439    case 2: /* BFF2: write keypad column write (what is this meant for?) */
440440        LOG(("microtan_bff2_w: %d <- %02x (keypad column)\n", offset, data));
r1355r1356
965965
966966   acia_6551_init();
967967
968   microtan_timer = timer_alloc(microtan_read_cassette);
968   microtan_timer = timer_alloc(microtan_read_cassette, NULL);
969969}
src/mess/machine/intv.c
r1355r1356
434434{
435435   cpunum_set_input_line(0, CP1610_INT_INTRM, ASSERT_LINE);
436436   sr1_int_pending = 1;
437   timer_set(ATTOTIME_IN_CYCLES(3791, 0), 0, intv_interrupt_complete);
437   timer_set(ATTOTIME_IN_CYCLES(3791, 0), NULL, 0, intv_interrupt_complete);
438438   stic_screenrefresh();
439439}
440440
src/mess/machine/amigacrt.c
r1355r1356
100100   
101101      /* trigger NMI irq */
102102      amiga_ar1_spurious = 0;
103      timer_set( ATTOTIME_IN_CYCLES(28,0), 0, amiga_ar1_delayed_nmi );
103      timer_set( ATTOTIME_IN_CYCLES(28,0), NULL, 0, amiga_ar1_delayed_nmi );
104104   }
105105}
106106
r1355r1356
117117      {
118118         /* trigger an NMI or spurious irq */
119119         amiga_ar1_spurious = (offset == 0x60/2) ? 0 : 1;
120         timer_set( ATTOTIME_IN_CYCLES(28,0), 0, amiga_ar1_delayed_nmi );
120         timer_set( ATTOTIME_IN_CYCLES(28,0), NULL, 0, amiga_ar1_delayed_nmi );
121121      }
122122   }
123123   
src/mess/machine/tms9902.c
r1355r1356
136136   tms9902[which].brk_callback = param->brk_callback;
137137   tms9902[which].xmit_callback = param->xmit_callback;
138138
139   tms9902[which].timer = timer_alloc(decrementer_callback);
139   tms9902[which].timer = timer_alloc(decrementer_callback, NULL);
140140
141141   reset(which);
142142}
src/mess/machine/osborne1.c
r1355r1356
432432
433433   memset( mess_ram + 0x10000, 0xFF, 0x1000 );
434434
435   osborne1.video_timer = timer_alloc( osborne1_video_callback );
435   osborne1.video_timer = timer_alloc( osborne1_video_callback , NULL);
436436   timer_adjust( osborne1.video_timer, video_screen_get_time_until_pos( 0, 1, 0 ), 0, attotime_never );
437437   pia_1_ca1_w( 0, 0 );
438438
439   timer_set( attotime_zero, 0, setup_beep );
439   timer_set( attotime_zero, NULL, 0, setup_beep );
440440
441441   memory_set_opbase_handler( 0, osborne1_opbase );
442442}
src/mess/machine/sms.c
r1355r1356
955955
956956   rapid_fire_state_1 = 0;
957957   rapid_fire_state_2 = 0;
958   rapid_fire_timer = timer_alloc( rapid_fire_callback );
958   rapid_fire_timer = timer_alloc( rapid_fire_callback , NULL);
959959   timer_adjust( rapid_fire_timer, ATTOTIME_IN_HZ(10), 0, ATTOTIME_IN_HZ(10) );
960960
961961   last_paddle_read_time = 0;
src/mess/machine/wd17xx.c
r1355r1356
300300
301301
302302
303static TIMER_CALLBACK_PTR(wd17xx_busy_callback)
303static TIMER_CALLBACK(wd17xx_busy_callback)
304304{
305   wd17xx_info *info = (wd17xx_info *) param;
305   wd17xx_info *info = (wd17xx_info *) ptr;
306306   wd17xx_set_irq(info);         
307307   timer_reset(busy_timer, attotime_never);
308308}
r1355r1356
312312static void wd17xx_set_busy(wd17xx_info *w, attotime duration)
313313{
314314   w->status |= STA_1_BUSY;
315   timer_adjust_ptr(busy_timer, duration, attotime_zero);
315   timer_adjust(busy_timer, duration, 0, attotime_zero);
316316}
317317
318318
r1355r1356
397397   wd.callback_param = param;
398398//   wd.status_ipl = STA_1_IPL;
399399   wd.density = DEN_MFM_LO;
400   busy_timer = timer_alloc_ptr(wd17xx_busy_callback, &wd);
401   wd.timer = timer_alloc(wd17xx_misc_timer_callback);
402   wd.timer_rs = timer_alloc(wd17xx_read_sector_callback);
403   wd.timer_ws = timer_alloc(wd17xx_write_sector_callback);
400   busy_timer = timer_alloc(wd17xx_busy_callback, &wd);
401   wd.timer = timer_alloc(wd17xx_misc_timer_callback, NULL);
402   wd.timer_rs = timer_alloc(wd17xx_read_sector_callback, NULL);
403   wd.timer_ws = timer_alloc(wd17xx_write_sector_callback, NULL);
404404
405405   wd17xx_reset();
406406}
src/mess/machine/pc_mouse.c
r1355r1356
3030void pc_mouse_initialise(void)
3131{
3232   pc_mouse.head = pc_mouse.tail = 0;
33   pc_mouse.timer = timer_alloc(pc_mouse_scan);
33   pc_mouse.timer = timer_alloc(pc_mouse_scan, NULL);
3434   pc_mouse.inputs=UART8250_HANDSHAKE_IN_DSR|UART8250_HANDSHAKE_IN_CTS;
3535   if (pc_mouse.serial_port!=-1)
3636      uart8250_handshake_in(pc_mouse.serial_port, pc_mouse.inputs);
src/mess/machine/cybiko.c
r1355r1356
296296{
297297   _logerror( 0, "cybiko_rs232_init\n");
298298   memset( &rs232, 0, sizeof( rs232));
299//   timer_pulse( TIME_IN_HZ( 10), 0, rs232_timer_callback);
299//   timer_pulse( TIME_IN_HZ( 10), NULL, 0, rs232_timer_callback);
300300}
301301
302302void cybiko_rs232_exit( void)
src/mess/machine/trs80.c
r1355r1356
282282   if (cas_size)
283283   {
284284      LOG(("trs80_init_machine: schedule cas_copy_callback (%d)\n", cas_size));
285      timer_set(ATTOTIME_IN_MSEC(500), 0, cas_copy_callback);
285      timer_set(ATTOTIME_IN_MSEC(500), NULL, 0, cas_copy_callback);
286286   }
287287}
288288
src/mess/machine/ti85.c
r1355r1356
193193
194194   ti_calculator_model = TI_81;
195195
196   timer_pulse(ATTOTIME_IN_HZ(200), 0, ti85_timer_callback);
196   timer_pulse(ATTOTIME_IN_HZ(200), NULL, 0, ti85_timer_callback);
197197
198198   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, MWA8_ROM);
199199   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, MWA8_ROM);
r1355r1356
223223
224224   ti_calculator_model = TI_85;
225225
226   timer_pulse(ATTOTIME_IN_HZ(200), 0, ti85_timer_callback);
226   timer_pulse(ATTOTIME_IN_HZ(200), NULL, 0, ti85_timer_callback);
227227
228228   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, MWA8_ROM);
229229   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, MWA8_ROM);
r1355r1356
267267
268268      ti_calculator_model = TI_86;
269269
270      timer_pulse(ATTOTIME_IN_HZ(200), 0, ti85_timer_callback);
270      timer_pulse(ATTOTIME_IN_HZ(200), NULL, 0, ti85_timer_callback);
271271   }
272272
273273   add_reset_callback(machine, ti85_reset_serial);
src/mess/machine/hd63450.c
r1355r1356
2121   dmac.intf = intf;
2222   for(x=0;x<4;x++)
2323   {
24      dmac.timer[x] = timer_alloc(dma_transfer_timer);
24      dmac.timer[x] = timer_alloc(dma_transfer_timer, NULL);
2525      dmac.reg[x].niv = 0x0f;  // defaults?
2626      dmac.reg[x].eiv = 0x0f;
2727   }
src/mess/machine/pce.c
r1355r1356
834834      pce_cd.end_frame = pce_cd.last_frame;
835835   }
836836
837   pce_cd.data_timer = timer_alloc( pce_cd_data_timer_callback );
837   pce_cd.data_timer = timer_alloc( pce_cd_data_timer_callback , NULL);
838838   timer_adjust( pce_cd.data_timer, attotime_never, 0, attotime_never );
839   pce_cd.adpcm_dma_timer = timer_alloc( pce_cd_adpcm_dma_timer_callback );
839   pce_cd.adpcm_dma_timer = timer_alloc( pce_cd_adpcm_dma_timer_callback , NULL);
840840   timer_adjust( pce_cd.adpcm_dma_timer, attotime_never, 0, attotime_never );
841841}
842842
r1355r1356
944944   if ( pce_cd.scsi_REQ && ! pce_cd.scsi_ACK && ! pce_cd.scsi_CD ) {
945945      if ( pce_cd.scsi_IO ) {
946946         pce_cd.scsi_ACK = 1;
947         timer_set( ATTOTIME_IN_CYCLES( 15, 0 ), 0, pce_cd_clear_ack );
947         timer_set( ATTOTIME_IN_CYCLES( 15, 0 ), NULL, 0, pce_cd_clear_ack );
948948      }
949949   }
950950   return data;
src/mess/machine/ti99_4x.c
r1355r1356
12311231      logerror("time to ready: %f -> %d\n", attotime_to_double(time_to_ready), (int) cycles_to_ready);
12321232
12331233      activecpu_adjust_icount(-cycles_to_ready);
1234      timer_set(attotime_zero, 0, /*speech_kludge_callback*/NULL);
1234      timer_set(attotime_zero, NULL, 0, /*speech_kludge_callback*/NULL);
12351235   }
12361236#endif
12371237
r1355r1356
15941594                     , (int) cycles_to_ready);
15951595
15961596                  activecpu_adjust_icount(-cycles_to_ready);
1597                  timer_set(attotime_zero, 0, /*speech_kludge_callback*/NULL);
1597                  timer_set(attotime_zero, NULL, 0, /*speech_kludge_callback*/NULL);
15981598               }
15991599
16001600               tms5220_data_w(offset, data);
r1355r1356
17421742      of next message is not requested for either, so we need to decide on
17431743      our own when we can post a new event.  Currently, we wait for 1000us
17441744      after the DSR acknowledges the second nybble. */
1745      timer_set(ATTOTIME_IN_USEC(1000), 0, ti99_handset_ack_callback);
1745      timer_set(ATTOTIME_IN_USEC(1000), NULL, 0, ti99_handset_ack_callback);
17461746   }
17471747
17481748   if (handset_buflen == 0)
r1355r1356
17621762      handset_ack = data;
17631763      if (data == handset_clock)
17641764         /* I don't know what the real delay is, but 30us apears to be enough */
1765         timer_set(ATTOTIME_IN_USEC(30), 0, ti99_handset_ack_callback);
1765         timer_set(ATTOTIME_IN_USEC(30), NULL, 0, ti99_handset_ack_callback);
17661766   }
17671767}
17681768
src/mess/machine/pc1251.c
r1355r1356
156156   UINT8 *gfx = memory_region(REGION_GFX1);
157157   for (i=0; i<128; i++) gfx[i]=i;
158158
159   timer_set(ATTOTIME_IN_SEC(1), 0, pc1251_power_up);
159   timer_set(ATTOTIME_IN_SEC(1), NULL, 0, pc1251_power_up);
160160
161161   // c600 b800 b000 a000 8000 tested   
162162   // 4 kb memory feedback 512 bytes too few???
src/mess/machine/tms5501.c
r1355r1356
155155   }
156156}
157157
158static TIMER_CALLBACK(tms5501_timer_0_decrementer_callback)
158static void tms5501_timer_0_decrementer(int which)
159159{
160   int which = param;
161160   tms5501[which].pending_interrupts |= TMS5501_TIMER_0_INT;
162161   tms5501_field_interrupts(which);
163162}
164163
165static TIMER_CALLBACK(tms5501_timer_1_decrementer_callback)
164static TIMER_CALLBACK(tms5501_timer_0_decrementer_callback)
166165{
167   int which = param;
166   tms5501_timer_0_decrementer(param);
167}
168
169static void tms5501_timer_1_decrementer(int which)
170{
168171   tms5501[which].pending_interrupts |= TMS5501_TIMER_1_INT;
169172   tms5501_field_interrupts(which);
170173}
171174
172static TIMER_CALLBACK(tms5501_timer_2_decrementer_callback)
175static TIMER_CALLBACK(tms5501_timer_1_decrementer_callback)
173176{
174   int which = param;
177   tms5501_timer_1_decrementer(param);
178}
179
180static void tms5501_timer_2_decrementer(int which)
181{
175182   tms5501[which].pending_interrupts |= TMS5501_TIMER_2_INT;
176183   tms5501_field_interrupts(which);
177184}
178185
179static TIMER_CALLBACK(tms5501_timer_3_decrementer_callback)
186static TIMER_CALLBACK(tms5501_timer_2_decrementer_callback)
180187{
181   int which = param;
188   tms5501_timer_2_decrementer(param);
189}
190
191static void tms5501_timer_3_decrementer(int which)
192{
182193   tms5501[which].pending_interrupts |= TMS5501_TIMER_3_INT;
183194   tms5501_field_interrupts(which);
184195}
185196
186static TIMER_CALLBACK(tms5501_timer_4_decrementer_callback)
197static TIMER_CALLBACK(tms5501_timer_3_decrementer_callback)
187198{
188   int which = param;
199   tms5501_timer_3_decrementer(param);
200}
201
202static void tms5501_timer_4_decrementer(int which)
203{
189204   if (!(tms5501[which].command & TMS5501_INT_7_SELECT))
190205      tms5501[which].pending_interrupts |= TMS5501_TIMER_4_INT;
191206   tms5501_field_interrupts(which);
192207}
193208
209static TIMER_CALLBACK(tms5501_timer_4_decrementer_callback)
210{
211   tms5501_timer_4_decrementer(param);
212}
213
194214static void tms5501_timer_reload(int which, int timer)
195215{
196216   if (tms5501[which].timer_counter[timer])
r1355r1356
201221   {   /* clock interval == 0 -> no timer */
202222      switch (timer)
203223      {
204         case 0: tms5501_timer_0_decrementer_callback(Machine, which); break;
205         case 1: tms5501_timer_1_decrementer_callback(Machine, which); break;
206         case 2: tms5501_timer_2_decrementer_callback(Machine, which); break;
207         case 3: tms5501_timer_3_decrementer_callback(Machine, which); break;
208         case 4: tms5501_timer_4_decrementer_callback(Machine, which); break;
224         case 0: tms5501_timer_0_decrementer(which); break;
225         case 1: tms5501_timer_1_decrementer(which); break;
226         case 2: tms5501_timer_2_decrementer(which); break;
227         case 3: tms5501_timer_3_decrementer(which); break;
228         case 4: tms5501_timer_4_decrementer(which); break;
209229      }
210230      timer_enable(tms5501[which].timer[timer], 0);
211231   }
r1355r1356
232252void tms5501_init (int which, const tms5501_init_param *param)
233253{
234254   tms5501[which].clock_rate = param->clock_rate;
235   tms5501[which].timer[0] = timer_alloc(tms5501_timer_0_decrementer_callback);
236   tms5501[which].timer[1] = timer_alloc(tms5501_timer_1_decrementer_callback);
237   tms5501[which].timer[2] = timer_alloc(tms5501_timer_2_decrementer_callback);
238   tms5501[which].timer[3] = timer_alloc(tms5501_timer_3_decrementer_callback);
239   tms5501[which].timer[4] = timer_alloc(tms5501_timer_4_decrementer_callback);
255   tms5501[which].timer[0] = timer_alloc(tms5501_timer_0_decrementer_callback, NULL);
256   tms5501[which].timer[1] = timer_alloc(tms5501_timer_1_decrementer_callback, NULL);
257   tms5501[which].timer[2] = timer_alloc(tms5501_timer_2_decrementer_callback, NULL);
258   tms5501[which].timer[3] = timer_alloc(tms5501_timer_3_decrementer_callback, NULL);
259   tms5501[which].timer[4] = timer_alloc(tms5501_timer_4_decrementer_callback, NULL);
240260
241261   tms5501[which].pio_read_callback = param->pio_read_callback;
242262   tms5501[which].pio_write_callback = param->pio_write_callback;
src/mess/machine/sgi.c
r1355r1356
520520   }
521521}
522522
523TIMER_CALLBACK(mc_update)
523void mc_update(void)
524524{
525525   nMC_RPSSCounter += 1000;
526526}
527527
528static TIMER_CALLBACK(mc_update_callback)
529{
530   mc_update();
531}
532
528533void mc_init()
529534{
530535   nMC_CPUControl0 = 0;
r1355r1356
568573   nMC_DMAGIO64Addr = 0;
569574   nMC_DMAMode = 0;
570575   nMC_DMAZoomByteCnt = 0;
571   tMC_UpdateTimer = timer_alloc( mc_update );
576   tMC_UpdateTimer = timer_alloc( mc_update_callback , NULL);
572577   timer_adjust( tMC_UpdateTimer, ATTOTIME_IN_HZ(10000), 0, ATTOTIME_IN_HZ(10000) );
573578
574579   // if Indigo2, ID appropriately
src/mess/machine/vc20tape.c
r1355r1356
902902   tape.data = 0;
903903#endif
904904   prg.c16 = 0;
905   wav.timer = timer_alloc(vc20_wav_timer);
906   prg.prg_timer = timer_alloc(vc20_prg_timer);
905   wav.timer = timer_alloc(vc20_wav_timer, NULL);
906   prg.prg_timer = timer_alloc(vc20_prg_timer, NULL);
907907}
908908
909909void c16_tape_open (void)
src/mess/machine/bbc.c
r1355r1356
20912091DRIVER_INIT( bbc )
20922092{
20932093   bbc_Master=0;
2094   bbc_tape_timer = timer_alloc(bbc_tape_timer_cb);
2094   bbc_tape_timer = timer_alloc(bbc_tape_timer_cb, NULL);
20952095}
20962096DRIVER_INIT( bbcm )
20972097{
20982098   bbc_Master=1;
2099   bbc_tape_timer = timer_alloc(bbc_tape_timer_cb);
2100    mc146818_init(MC146818_STANDARD);
2099   bbc_tape_timer = timer_alloc(bbc_tape_timer_cb, NULL);
2100   mc146818_init(MC146818_STANDARD);
21012101}
21022102
21032103MACHINE_START( bbca )
src/mess/machine/sgi.h
r1355r1356
1111
1212#include "mame.h"
1313
14TIMER_CALLBACK(mc_update);
1514void mc_init(void);
15void mc_update(void);
1616
1717READ32_HANDLER(mc_r);
1818WRITE32_HANDLER(mc_w);
src/mess/machine/compis.c
r1355r1356
15191519void compis_cpu_init(void)
15201520{
15211521   /* create timers here so they stick around */
1522   i186.timer[0].int_timer = timer_alloc(internal_timer_int);
1523   i186.timer[1].int_timer = timer_alloc(internal_timer_int);
1524   i186.timer[2].int_timer = timer_alloc(internal_timer_int);
1525   i186.timer[0].time_timer = timer_alloc(NULL);
1526   i186.timer[1].time_timer = timer_alloc(NULL);
1527   i186.timer[2].time_timer = timer_alloc(NULL);
1528   i186.dma[0].finish_timer = timer_alloc(dma_timer_callback);
1529   i186.dma[1].finish_timer = timer_alloc(dma_timer_callback);
1522   i186.timer[0].int_timer = timer_alloc(internal_timer_int, NULL);
1523   i186.timer[1].int_timer = timer_alloc(internal_timer_int, NULL);
1524   i186.timer[2].int_timer = timer_alloc(internal_timer_int, NULL);
1525   i186.timer[0].time_timer = timer_alloc(NULL, NULL);
1526   i186.timer[1].time_timer = timer_alloc(NULL, NULL);
1527   i186.timer[2].time_timer = timer_alloc(NULL, NULL);
1528   i186.dma[0].finish_timer = timer_alloc(dma_timer_callback, NULL);
1529   i186.dma[1].finish_timer = timer_alloc(dma_timer_callback, NULL);
15301530}
15311531
15321532/*-------------------------------------------------------------------------*/
src/mess/machine/kc.c
r1355r1356
231231
232232static void kc_disc_interface_init(void)
233233{
234   timer_set(attotime_zero, 0, kc85_disk_reset_timer_callback);
234   timer_set(attotime_zero, NULL, 0, kc85_disk_reset_timer_callback);
235235
236236   nec765_init(&kc_fdc_interface,NEC765A);
237237
r1355r1356
410410
411411static void   kc_cassette_init(void)
412412{
413   kc_cassette_timer = timer_alloc(kc_cassette_timer_callback);
413   kc_cassette_timer = timer_alloc(kc_cassette_timer_callback, NULL);
414414}
415415
416416static void   kc_cassette_set_motor(int motor_state)
r1355r1356
902902   keyboard_data.head = (keyboard_data.tail = 0);
903903
904904   /* 50hz is just a arbitrary value - used to put scan-codes into the queue for transmitting */
905   timer_pulse(ATTOTIME_IN_HZ(50), 0, kc_keyboard_update);
905   timer_pulse(ATTOTIME_IN_HZ(50), NULL, 0, kc_keyboard_update);
906906
907907   /* timer to transmit pulses to kc base unit */
908   timer_pulse(ATTOTIME_IN_USEC(1024), 0, kc_keyboard_transmit_timer_callback);
908   timer_pulse(ATTOTIME_IN_USEC(1024), NULL, 0, kc_keyboard_transmit_timer_callback);
909909
910910   /* kc keyboard is not transmitting */
911911   keyboard_data.transmit_state = KC_KEYBOARD_TRANSMIT_IDLE;
r1355r1356
18911891   kc85_50hz_state = 0;
18921892   kc85_15khz_state = 0;
18931893   kc85_15khz_count = 0;
1894   timer_pulse(ATTOTIME_IN_HZ(15625), 0, kc85_15khz_timer_callback);
1895   timer_set(attotime_zero, 0, kc85_reset_timer_callback);
1894   timer_pulse(ATTOTIME_IN_HZ(15625), NULL, 0, kc85_15khz_timer_callback);
1895   timer_set(attotime_zero, NULL, 0, kc85_reset_timer_callback);
18961896   kc85_module_system_init();
18971897}
18981898
src/mess/machine/corvushd.c
r1355r1356
13911391   //
13921392   // Set up timers for command completion and timeout from host
13931393   //
1394   timer_set(ATTOTIME_IN_USEC(c->delay), CALLBACK_CTH_MODE, corvus_hdc_callback);
1394   timer_set(ATTOTIME_IN_USEC(c->delay), NULL, CALLBACK_CTH_MODE, corvus_hdc_callback);
13951395   timer_enable(c->timeout_timer, 0);         // We've received enough data, disable the timeout timer
13961396
13971397   c->delay = 0;                           // Reset delay for next function
r1355r1356
14961496   c->xmit_bytes = 0;                     // We don't have anything to say to the host
14971497   c->recv_bytes = 0;                     // We aren't waiting on additional data from the host
14981498
1499   c->timeout_timer = timer_alloc(corvus_hdc_callback);   // Set up a timer to handle the four-second host-to-controller timeout
1499   c->timeout_timer = timer_alloc(corvus_hdc_callback, NULL);   // Set up a timer to handle the four-second host-to-controller timeout
15001500   timer_adjust(c->timeout_timer, ATTOTIME_IN_SEC(4), CALLBACK_TIMEOUT, attotime_zero);
15011501   timer_enable(c->timeout_timer, 0);      // Start this timer out disabled
15021502
r1355r1356
16701670      c->xmit_bytes = 0;      // We don't have anything more to say
16711671      c->recv_bytes = 0;      // No active commands
16721672     
1673      timer_set((ATTOTIME_IN_USEC(INTERBYTE_DELAY)), CALLBACK_HTC_MODE, corvus_hdc_callback);
1673      timer_set((ATTOTIME_IN_USEC(INTERBYTE_DELAY)), NULL, CALLBACK_HTC_MODE, corvus_hdc_callback);
16741674
16751675//      c->status &= ~(CONTROLLER_DIRECTION | CONTROLLER_BUSY);   // Put us in Idle, Host-to-Controller mode
16761676   } else {
16771677      //
16781678      // Not finished with this packet.  Insert an interbyte delay and then let the host continue
16791679      //
1680      timer_set((ATTOTIME_IN_USEC(INTERBYTE_DELAY)), CALLBACK_SAME_MODE, corvus_hdc_callback);     
1680      timer_set((ATTOTIME_IN_USEC(INTERBYTE_DELAY)), NULL, CALLBACK_SAME_MODE, corvus_hdc_callback);     
16811681   }
16821682
16831683   return result;
r1355r1356
17561756      // Make the controller busy for a few microseconds while the command is processed
17571757      //
17581758      c->status |= CONTROLLER_BUSY;
1759      timer_set((ATTOTIME_IN_USEC(INTERBYTE_DELAY)), CALLBACK_SAME_MODE, corvus_hdc_callback);
1759      timer_set((ATTOTIME_IN_USEC(INTERBYTE_DELAY)), NULL, CALLBACK_SAME_MODE, corvus_hdc_callback);
17601760   }
17611761}
src/mess/drivers/vip.c
r1355r1356
278278   // turn on power led
279279   set_led_status(0, 1);
280280
281   timer_set(attotime_zero, 0, setup_beep);
281   timer_set(attotime_zero, NULL, 0, setup_beep);
282282}
283283
284284/* System Drivers */
src/mess/drivers/nc.c
r1355r1356
600600   nc_update_interrupts();
601601
602602   /* keyboard timer */
603   nc_keyboard_timer = timer_alloc(nc_keyboard_timer_callback);
603   nc_keyboard_timer = timer_alloc(nc_keyboard_timer_callback, NULL);
604604   timer_adjust(nc_keyboard_timer, ATTOTIME_IN_MSEC(10), 0, attotime_zero);
605605
606606   /* dummy timer */
607   timer_pulse(ATTOTIME_IN_HZ(50), 0, dummy_timer_callback);
607   timer_pulse(ATTOTIME_IN_HZ(50), NULL, 0, dummy_timer_callback);
608608
609609   /* serial timer */
610   nc_serial_timer = timer_alloc(nc_serial_timer_callback);
610   nc_serial_timer = timer_alloc(nc_serial_timer_callback, NULL);
611611
612612   /* at reset set to 0x0ff */
613613   nc_uart_control = 0x0ff;
src/mess/drivers/adam.c
r1355r1356
617617   clear_keyboard_buffer();
618618
619619   memset(&memory_region(REGION_CPU1)[0x0000], 0xFF, 0x20000); /* Initializing RAM */
620   timer_pulse(ATTOTIME_IN_MSEC(20), 0, adam_paddle_callback);
620   timer_pulse(ATTOTIME_IN_MSEC(20), NULL, 0, adam_paddle_callback);
621621}
622622
623623static MACHINE_DRIVER_START( adam )
src/mess/drivers/sord.c
r1355r1356
491491   /* PI-5 interface connected to Sord M5 */
492492   ppi8255_init(&sord_ppi8255_interface);
493493
494//   cassette_timer = timer_pulse(TIME_IN_HZ(11025), 0, cassette_timer_callback);
494//   cassette_timer = timer_pulse(TIME_IN_HZ(11025), NULL, 0, cassette_timer_callback);
495495   TMS9928A_reset ();
496496   z80ctc_reset(0);
497497
src/mess/drivers/mk1.c
r1355r1356
157157}
158158
159159
160static MACHINE_START( mk1 ) {
161   timer_pulse( ATTOTIME_IN_HZ(30), 0, mk1_update_leds );
160static MACHINE_START( mk1 )
161{
162   timer_pulse( ATTOTIME_IN_HZ(30), NULL, 0, mk1_update_leds );
162163}
163164
164165static MACHINE_DRIVER_START( mk1 )
src/mess/drivers/z88.c
r1355r1356
278278{
279279   memset(mess_ram, 0x0ff, mess_ram_size);
280280
281   timer_pulse(ATTOTIME_IN_MSEC(5), 0, z88_rtc_timer_callback);
281   timer_pulse(ATTOTIME_IN_MSEC(5), NULL, 0, z88_rtc_timer_callback);
282282
283283   blink_reset();
284284
src/mess/drivers/pcw16.c
r1355r1356
13511351   pcw16_interrupt_counter = 0;
13521352
13531353   /* video ints */
1354   timer_pulse(ATTOTIME_IN_USEC(5830), 0,pcw16_timer_callback);
1354   timer_pulse(ATTOTIME_IN_USEC(5830), NULL, 0,pcw16_timer_callback);
13551355   /* rtc timer */
1356   timer_pulse(ATTOTIME_IN_HZ(256), 0, rtc_timer_callback);
1356   timer_pulse(ATTOTIME_IN_HZ(256), NULL, 0, rtc_timer_callback);
13571357   /* keyboard timer */
1358   timer_pulse(ATTOTIME_IN_HZ(50), 0, pcw16_keyboard_timer_callback);
1358   timer_pulse(ATTOTIME_IN_HZ(50), NULL, 0, pcw16_keyboard_timer_callback);
13591359
13601360
13611361   pc_fdc_init(&pcw16_fdc_interface);
src/mess/drivers/glasgow.c
r1355r1356
506506
507507static MACHINE_START( glasgow )
508508{
509  key_selector=0;
510  irq_flag=0;
511  lcd_shift_counter=3;
512   timer_pulse(ATTOTIME_IN_HZ(50), 0, update_nmi);
513  beep_set_frequency(0, 44);
509   key_selector=0;
510   irq_flag=0;
511   lcd_shift_counter=3;
512   timer_pulse(ATTOTIME_IN_HZ(50), NULL, 0, update_nmi);
513   beep_set_frequency(0, 44);
514514}
515515
516516
517517static MACHINE_START( dallas32 )
518518{
519  lcd_shift_counter=3;
519   lcd_shift_counter=3;
520520
521   timer_pulse(ATTOTIME_IN_HZ(50), 0, update_nmi32);
522  beep_set_frequency(0, 44);
521   timer_pulse(ATTOTIME_IN_HZ(50), NULL, 0, update_nmi32);
522   beep_set_frequency(0, 44);
523523}
524524
525525
r1355r1356
907907***************************************************************************/
908908
909909/*     YEAR, NAME,     PARENT,   BIOS, COMPAT MACHINE,INPUT,          INIT,     CONFIG, COMPANY,                      FULLNAME,                 FLAGS */
910CONS(  1984, glasgow,  0,        0,    glasgow,       old_keyboard,   NULL,     NULL,   "Hegener & Glaser Muenchen",  "Mephisto III S Glasgow", 0)
911CONS(  1984, amsterd,  0,        0,    amsterd,       new_keyboard,   NULL,     NULL,   "Hegener & Glaser Muenchen",  "Mephisto Amsterdam",     0)
912CONS(  1984, dallas,   0,        0,    glasgow,       old_keyboard,   NULL,     NULL,   "Hegener & Glaser Muenchen",  "Mephisto Dallas",        0)
913CONS(  1984, roma,     0,        0,    glasgow,       new_keyboard,   NULL,     NULL,   "Hegener & Glaser Muenchen",  "Mephisto Roma",          0)
914CONS(  1984, dallas32, 0,        0,    dallas32,      new_keyboard,   NULL,     NULL,   "Hegener & Glaser Muenchen",  "Mephisto Dallas 32 Bit", 0)
915CONS(  1984, roma32,   0,        0,    dallas32,      new_keyboard,   NULL,     NULL,   "Hegener & Glaser Muenchen",  "Mephisto Roma 32 Bit",   0)
916CONS(  1984, dallas16, 0,        0,    amsterd,       new_keyboard,   NULL,     NULL,   "Hegener & Glaser Muenchen",  "Mephisto Dallas 16 Bit", 0)
910CONS(  1984, glasgow,  0,        0,    glasgow,       old_keyboard,   0,      NULL,   "Hegener & Glaser Muenchen",  "Mephisto III S Glasgow", 0)
911CONS(  1984, amsterd,  0,        0,    amsterd,       new_keyboard,   0,      NULL,   "Hegener & Glaser Muenchen",  "Mephisto Amsterdam",     0)
912CONS(  1984, dallas,   0,        0,    glasgow,       old_keyboard,   0,       NULL,   "Hegener & Glaser Muenchen",  "Mephisto Dallas",        0)
913CONS(  1984, roma,     0,        0,    glasgow,       new_keyboard,   0,       NULL,   "Hegener & Glaser Muenchen",  "Mephisto Roma",          0)
914CONS(  1984, dallas32, 0,        0,    dallas32,      new_keyboard,   0,       NULL,   "Hegener & Glaser Muenchen",  "Mephisto Dallas 32 Bit", 0)
915CONS(  1984, roma32,   0,        0,    dallas32,      new_keyboard,   0,       NULL,   "Hegener & Glaser Muenchen",  "Mephisto Roma 32 Bit",   0)
916CONS(  1984, dallas16, 0,        0,    amsterd,       new_keyboard,   0,      NULL,   "Hegener & Glaser Muenchen",  "Mephisto Dallas 16 Bit", 0)
917917
918918
919919
src/mess/drivers/tm990189.c
r1355r1356
189189
190190static MACHINE_RESET( tm990_189 )
191191{
192   displayena_timer = timer_alloc(NULL);
192   displayena_timer = timer_alloc(NULL, NULL);
193193
194194   hold_load();
195195
r1355r1356
216216
217217static MACHINE_RESET( tm990_189_v )
218218{
219   displayena_timer = timer_alloc(NULL);
219   displayena_timer = timer_alloc(NULL, NULL);
220220
221   joy1x_timer = timer_alloc(NULL);
222   joy1y_timer = timer_alloc(NULL);
223   joy2x_timer = timer_alloc(NULL);
224   joy2y_timer = timer_alloc(NULL);
221   joy1x_timer = timer_alloc(NULL, NULL);
222   joy1y_timer = timer_alloc(NULL, NULL);
223   joy2x_timer = timer_alloc(NULL, NULL);
224   joy2y_timer = timer_alloc(NULL, NULL);
225225
226226   hold_load();
227227
r1355r1356
357357{
358358   load_state = TRUE;
359359   field_interrupts();
360   timer_set(ATTOTIME_IN_MSEC(100), 0, clear_load);
360   timer_set(ATTOTIME_IN_MSEC(100), NULL, 0, clear_load);
361361}
362362
363363/*
r1355r1356
477477   rs232_fp = image;
478478
479479   tms9902_set_dsr(id, 1);
480   rs232_input_timer = timer_alloc(rs232_input_callback);
480   rs232_input_timer = timer_alloc(rs232_input_callback, NULL);
481481   timer_adjust(rs232_input_timer, attotime_zero, 0, ATTOTIME_IN_MSEC(10));
482482
483483   return INIT_PASS;
src/mess/drivers/thomson.c
r1355r1356
780780MACHINE_DRIVER_END
781781
782782
783COMP ( 1982, to7, 0, 0, to7, to7, NULL, to7, "Thomson", "TO7", 0 )
783COMP ( 1982, to7, 0, 0, to7, to7, 0, to7, "Thomson", "TO7", 0 )
784784
785COMP ( 1980, t9000, to7, 0, t9000, t9000, NULL, t9000, "Thomson", "T9000", 0 )
785COMP ( 1980, t9000, to7, 0, t9000, t9000, 0, t9000, "Thomson", "T9000", 0 )
786786
787787
788788/***************************** TO7/70 *********************************
r1355r1356
969969     MDRV_IMPORT_FROM ( to770 )
970970MACHINE_DRIVER_END
971971
972COMP ( 1984, to770, 0, 0, to770, to770, NULL, to770, "Thomson", "TO7/70", 0 )
972COMP ( 1984, to770, 0, 0, to770, to770, 0, to770, "Thomson", "TO7/70", 0 )
973973
974COMP ( 1984, to770a, to770, 0, to770a, to770a, NULL, to770a, "Thomson", "TO7/70 arabic", 0 )
974COMP ( 1984, to770a, to770, 0, to770a, to770a, 0, to770a, "Thomson", "TO7/70 arabic", 0 )
975975
976976
977977/************************* MO5 / MO5E *********************************
r1355r1356
11691169MACHINE_DRIVER_END
11701170
11711171
1172COMP ( 1984, mo5, 0, 0, mo5, mo5, NULL, mo5, "Thomson", "MO5", 0 )
1172COMP ( 1984, mo5, 0, 0, mo5, mo5, 0, mo5, "Thomson", "MO5", 0 )
11731173
1174COMP ( 1986, mo5e, mo5, 0, mo5e, mo5e, NULL, mo5e, "Thomson", "MO5E", 0 )
1174COMP ( 1986, mo5e, mo5, 0, mo5e, mo5e, 0, mo5e, "Thomson", "MO5E", 0 )
11751175
11761176
11771177/********************************* TO9 *******************************
r1355r1356
15121512MACHINE_DRIVER_END
15131513
15141514
1515COMP ( 1985, to9, 0, 0, to9, to9, NULL, to9, "Thomson", "TO9", GAME_IMPERFECT_COLORS )
1515COMP ( 1985, to9, 0, 0, to9, to9, 0, to9, "Thomson", "TO9", GAME_IMPERFECT_COLORS )
15161516
15171517
15181518/******************************** TO8 ********************************
r1355r1356
17531753MACHINE_DRIVER_END
17541754
17551755
1756COMP ( 1986, to8, 0, 0, to8, to8, NULL, to8, "Thomson", "TO8", 0 )
1756COMP ( 1986, to8, 0, 0, to8, to8, 0, to8, "Thomson", "TO8", 0 )
17571757
1758COMP ( 1987, to8d, to8, 0, to8d, to8d, NULL, to8d, "Thomson", "TO8D", 0 )
1758COMP ( 1987, to8d, to8, 0, to8d, to8d, 0, to8d, "Thomson", "TO8D", 0 )
17591759
17601760
17611761/******************************** TO9+ *******************************
r1355r1356
19061906     MDRV_CPU_PROGRAM_MAP ( to9p, 0 )
19071907MACHINE_DRIVER_END
19081908
1909COMP ( 1986, to9p, 0, 0, to9p, to9p, NULL, to9p, "Thomson", "TO9+", 0 )
1909COMP ( 1986, to9p, 0, 0, to9p, to9p, 0, to9p, "Thomson", "TO9+", 0 )
19101910
19111911
19121912
r1355r1356
22582258     MDRV_IMPORT_FROM ( mo6 )
22592259MACHINE_DRIVER_END
22602260
2261COMP ( 1986, mo6, 0, 0, mo6, mo6, NULL, mo6, "Thomson", "MO6", 0 )
2261COMP ( 1986, mo6, 0, 0, mo6, mo6, 0, mo6, "Thomson", "MO6", 0 )
22622262
2263COMP ( 1986, pro128, mo6, 0, pro128, pro128, NULL, pro128, "Olivetti / Thomson", "Prodest PC 128", 0 )
2263COMP ( 1986, pro128, mo6, 0, pro128, pro128, 0, pro128, "Olivetti / Thomson", "Prodest PC 128", 0 )
22642264
22652265
22662266
r1355r1356
24832483     MDRV_CPU_PROGRAM_MAP ( mo5nr, 0 )
24842484MACHINE_DRIVER_END
24852485
2486COMP ( 1986, mo5nr, 0, 0, mo5nr, mo5nr, NULL, mo5nr, "Thomson", "MO5 NR", 0 )
2486COMP ( 1986, mo5nr, 0, 0, mo5nr, mo5nr, 0, mo5nr, "Thomson", "MO5 NR", 0 )
src/mess/drivers/abc80.c
r1355r1356
441441{
442442   state_save_register_global(keylatch);
443443
444   abc80_keyboard_timer = timer_alloc(abc80_keyboard_tick);
444   abc80_keyboard_timer = timer_alloc(abc80_keyboard_tick, NULL);
445445   timer_adjust(abc80_keyboard_timer, attotime_zero, 0, ATTOTIME_IN_USEC(2500));
446446}
447447
src/mess/drivers/x68k.c
r1355r1356
205205   sys.mfp.irqline = 6;  // MFP is connected to 68000 IRQ line 6
206206   sys.mfp.current_irq = -1;  // No current interrupt
207207
208/*   mfp_timer[0] = timer_alloc(mfp_timer_a_callback);
209   mfp_timer[1] = timer_alloc(mfp_timer_b_callback);
210   mfp_timer[2] = timer_alloc(mfp_timer_c_callback);
211   mfp_timer[3] = timer_alloc(mfp_timer_d_callback);
212   mfp_irq = timer_alloc(mfp_update_irq);
208/*   mfp_timer[0] = timer_alloc(mfp_timer_a_callback, NULL);
209   mfp_timer[1] = timer_alloc(mfp_timer_b_callback, NULL);
210   mfp_timer[2] = timer_alloc(mfp_timer_c_callback, NULL);
211   mfp_timer[3] = timer_alloc(mfp_timer_d_callback, NULL);
212   mfp_irq = timer_alloc(mfp_update_irq, NULL);
213213   timer_adjust(mfp_irq, attotime_zero, 0, ATTOTIME_IN_USEC(32));
214214*/
215215}
r1355r1356
13291329      offset *= 2;
13301330      if(ACCESSING_LSB)
13311331         offset++;
1332      timer_set(ATTOTIME_IN_CYCLES(16,0),0xeafa00+offset,x68k_fake_bus_error);
1332      timer_set(ATTOTIME_IN_CYCLES(16,0), NULL, 0xeafa00+offset,x68k_fake_bus_error);
13331333//      cpunum_set_input_line_and_vector(0,2,ASSERT_LINE,current_vector[2]);
13341334   }
13351335   return 0xffff;
r1355r1356
13451345      offset *= 2;
13461346      if(ACCESSING_LSB)
13471347         offset++;
1348      timer_set(ATTOTIME_IN_CYCLES(16,0),0xeafa00+offset,x68k_fake_bus_error);
1348      timer_set(ATTOTIME_IN_CYCLES(16,0), NULL, 0xeafa00+offset,x68k_fake_bus_error);
13491349//      cpunum_set_input_line_and_vector(0,2,ASSERT_LINE,current_vector[2]);
13501350   }
13511351}
r1355r1356
19631963   // init keyboard
19641964   sys.keyboard.delay = 500;  // 3*100+200
19651965   sys.keyboard.repeat = 110;  // 4^2*5+30
1966   kb_timer = timer_alloc(x68k_keyboard_poll);
1967   scanline_timer = timer_alloc(x68k_hsync);
1968   raster_irq = timer_alloc(x68k_crtc_raster_irq);
1969   vblank_irq = timer_alloc(x68k_crtc_vblank_irq);
1970   mouse_timer = timer_alloc(x68k_scc_ack);
1966   kb_timer = timer_alloc(x68k_keyboard_poll, NULL);
1967   scanline_timer = timer_alloc(x68k_hsync, NULL);
1968   raster_irq = timer_alloc(x68k_crtc_raster_irq, NULL);
1969   vblank_irq = timer_alloc(x68k_crtc_vblank_irq, NULL);
1970   mouse_timer = timer_alloc(x68k_scc_ack, NULL);
19711971}
19721972
19731973
src/mess/drivers/super80.c
r1355r1356
7272   keyboard_scan();
7373   /* enable ROM in base >0000, and re-enable RAM shortly thereafter */
7474   memory_set_bankptr(1, memory_region(REGION_CPU1) + 0xC000);
75   timer_set(ATTOTIME_IN_USEC(10), 0, reset_timer_callback);
75   timer_set(ATTOTIME_IN_USEC(10), NULL, 0, reset_timer_callback);
7676}
7777
7878static VIDEO_START( super80 )
src/mess/drivers/atarist.c
r1355r1356
15971597
15981598   cpunum_set_irq_callback(0, atarist_int_ack);
15991599
1600   dmasound_timer = timer_alloc(atariste_dmasound_tick);
1601   microwire_timer = timer_alloc(atariste_microwire_tick);
1600   dmasound_timer = timer_alloc(atariste_dmasound_tick, NULL);
1601   microwire_timer = timer_alloc(atariste_microwire_tick, NULL);
16021602}
16031603
16041604static MACHINE_START( megaste )
src/mess/drivers/ip22.c
r1355r1356
11311131            return;
11321132         }
11331133      }
1134      timer_set(ATTOTIME_IN_HZ(44100), 0, ip22_dma);
1134      timer_set(ATTOTIME_IN_HZ(44100), NULL, 0, ip22_dma);
11351135   }
11361136}
11371137
r1355r1356
12011201      verboselog( 0, "    FIFO End: Rowe %04x\n", ( data & PBUS_CTRL_FIFO_END ) >> 24 );
12021202      if( ( data & PBUS_CTRL_DMASTART ) || ( data & PBUS_CTRL_LOAD_EN ) )
12031203      {
1204         timer_set(ATTOTIME_IN_HZ(44100), 0, ip22_dma);
1204         timer_set(ATTOTIME_IN_HZ(44100), NULL, 0, ip22_dma);
12051205         nPBUS_DMA_Active = 1;
12061206      }
12071207      return;
r1355r1356
12321232// mc_update wants once every millisecond (1/1000th of a second)
12331233static TIMER_CALLBACK(ip22_timer)
12341234{
1235   mc_update(machine, 0);
1236
1237   timer_set(ATTOTIME_IN_MSEC(1), 0, ip22_timer);
1235   mc_update();
1236   timer_set(ATTOTIME_IN_MSEC(1), NULL, 0, ip22_timer);
12381237}
12391238
12401239static MACHINE_RESET( ip225015 )
r1355r1356
12461245   RTC_REGISTERB = 0x08;
12471246   RTC_REGISTERD = 0x80;
12481247
1249   timer_set(ATTOTIME_IN_MSEC(1), 0, ip22_timer);
1248   timer_set(ATTOTIME_IN_MSEC(1), NULL, 0, ip22_timer);
12501249
12511250   // set up low RAM mirror
12521251   memory_set_bankptr(1, ip22_mainram);
src/mess/drivers/exidy.c
r1355r1356
257257
258258static MACHINE_START( exidy )
259259{
260   serial_timer = timer_alloc(exidy_serial_timer_callback);
261   cassette_timer = timer_alloc(exidy_cassette_timer_callback);
260   serial_timer = timer_alloc(exidy_serial_timer_callback, NULL);
261   cassette_timer = timer_alloc(exidy_cassette_timer_callback, NULL);
262262
263263   wd17xx_init(WD_TYPE_179X, NULL, NULL);
264264}
r1355r1356
278278   
279279   exidy_fe_port_w(0,0);
280280
281   timer_set(attotime_zero, 0, exidy_reset_timer_callback);
281   timer_set(attotime_zero, NULL, 0, exidy_reset_timer_callback);
282282   
283283   floppy_drive_set_geometry(image_from_devtype_and_index(IO_FLOPPY, 0), FLOPPY_DRIVE_DS_80);
284284
r1355r1356
307307   
308308   exidy_fe_port_w(0,0);
309309
310   timer_set(attotime_zero, 0, exidy_reset_timer_callback);
310   timer_set(attotime_zero, NULL, 0, exidy_reset_timer_callback);
311311   
312312   floppy_drive_set_geometry(image_from_devtype_and_index(IO_FLOPPY, 0), FLOPPY_DRIVE_DS_80);
313313}
src/mess/drivers/a2600.c
r1355r1356
17411741            dpc.df[data_fetcher].music_mode = 0;
17421742         }
17431743      }
1744      dpc.oscillator = timer_alloc( modeDPC_timer_callback );
1744      dpc.oscillator = timer_alloc( modeDPC_timer_callback , NULL);
17451745      timer_adjust( dpc.oscillator, ATTOTIME_IN_HZ(42000), 0, ATTOTIME_IN_HZ(42000) );
17461746      break;
17471747
src/mess/drivers/studio2.c
r1355r1356
400400
401401static DRIVER_INIT( studio2 )
402402{
403   timer_set(attotime_zero, 0, setup_beep);
404   timer_set(ATTOTIME_IN_MSEC(200), 0, set_cpu_mode);
403   timer_set(attotime_zero, NULL, 0, setup_beep);
404   timer_set(ATTOTIME_IN_MSEC(200), NULL, 0, set_cpu_mode);
405405}
406406
407407static int mpt02_colorram_r(UINT16 addr)
r1355r1356
426426
427427static DRIVER_INIT( mpt02 )
428428{
429   timer_set(attotime_zero, 0, mpt02_setup_beep);
429   timer_set(attotime_zero, NULL, 0, mpt02_setup_beep);
430430   cdp1864_configure(&mpt02_CDP1864_interface);
431431}
432432
src/mess/drivers/pcw.c
r1355r1356
776776   roller_ram_offset = 0;
777777
778778   /* timer interrupt */
779   timer_pulse(ATTOTIME_IN_HZ(300), 0, pcw_timer_interrupt);
779   timer_pulse(ATTOTIME_IN_HZ(300), NULL, 0, pcw_timer_interrupt);
780780
781   timer_set(attotime_zero, 0, setup_beep);
781   timer_set(attotime_zero, NULL, 0, setup_beep);
782782}
783783
784784
src/mess/drivers/mk2.c
r1355r1356
9494
9595static MACHINE_START( mk2 )
9696{
97   timer_pulse(ATTOTIME_IN_HZ(60), 0, update_leds);
97   timer_pulse(ATTOTIME_IN_HZ(60), NULL, 0, update_leds);
9898}
9999
100100static MACHINE_RESET( mk2 )
src/mess/drivers/coleco.c
r1355r1356
228228{
229229    cpunum_set_input_line_vector(0, 0, 0xff);
230230   memset(&memory_region(REGION_CPU1)[0x6000], 0xff, 0x400);   // initialize RAM
231    timer_pulse(ATTOTIME_IN_MSEC(20), 0, paddle_callback);
231    timer_pulse(ATTOTIME_IN_MSEC(20), NULL, 0, paddle_callback);
232232}
233233
234234static MACHINE_DRIVER_START( coleco )
src/mess/drivers/ql.c
r1355r1356
226226
227227static WRITE8_HANDLER( zx8302_ipc_command_w )
228228{
229   timer_set(ATTOTIME_IN_NSEC(480), data, zx8302_delayed_ipc_command);
229   timer_set(ATTOTIME_IN_NSEC(480), NULL, data, zx8302_delayed_ipc_command);
230230}
231231
232232static WRITE8_HANDLER( zx8302_mdv_control_w )
r1355r1356
760760   zx8302.comctl = 1;
761761   zx8302.comdata = 1;
762762
763   zx8302_txd_timer = timer_alloc(zx8302_txd_tick);
764   zx8302_ipc_timer = timer_alloc(zx8302_ipc_tick);
765   zx8302_rtc_timer = timer_alloc(zx8302_rtc_tick);
766   zx8302_gap_timer = timer_alloc(zx8302_gap_tick);
763   zx8302_txd_timer = timer_alloc(zx8302_txd_tick, NULL);
764   zx8302_ipc_timer = timer_alloc(zx8302_ipc_tick, NULL);
765   zx8302_rtc_timer = timer_alloc(zx8302_rtc_tick, NULL);
766   zx8302_gap_timer = timer_alloc(zx8302_gap_tick, NULL);
767767
768768   timer_adjust(zx8302_rtc_timer, attotime_zero, 0, ATTOTIME_IN_HZ(X2/32768));
769769   timer_adjust(zx8302_gap_timer, attotime_zero, 0, ATTOTIME_IN_MSEC(31));
src/mess/drivers/abc80x.c
r1355r1356
651651   state_save_register_global(abc77_keylatch);
652652   state_save_register_global(abc77_clock);
653653
654   abc800_ctc_timer = timer_alloc(abc800_ctc_tick);
654   abc800_ctc_timer = timer_alloc(abc800_ctc_tick, NULL);
655655   timer_adjust(abc800_ctc_timer, attotime_zero, 0, ATTOTIME_IN_HZ(ABC800_X01/2/2/2));
656656
657657   z80ctc_init(0, &abc800_ctc_intf);
src/mess/drivers/tmc2000e.c
r1355r1356
283283   // enable power led
284284   set_led_status(2, 1);
285285
286   timer_set(attotime_zero, 0, setup_beep);
286   timer_set(attotime_zero, NULL, 0, setup_beep);
287287
288288   cdp1864_configure(&tmc2000e_CDP1864_interface);
289289}
src/mess/drivers/tmc1800.c
r1355r1356
420420
421421static DRIVER_INIT( tmc1800 )
422422{
423   timer_set(attotime_zero, 0, setup_beep);
423   timer_set(attotime_zero, NULL, 0, setup_beep);
424424}
425425
426426static DRIVER_INIT( tmc2000 )
427427{
428   timer_set(attotime_zero, 0, setup_beep);
428   timer_set(attotime_zero, NULL, 0, setup_beep);
429429   cdp1864_configure(&tmc2000_CDP1864_interface);
430430}
431431
src/mess/drivers/crvision.c
r1355r1356
357357   sn76489_ready = 0;
358358
359359   // wait 32 cycles of 2 MHz to synchronize CPU and SN76489
360   timer_set(ATTOTIME_IN_USEC(16), 0, sn76489_set_ready);
360   timer_set(ATTOTIME_IN_USEC(16), NULL, 0, sn76489_set_ready);
361361}
362362
363363static WRITE8_HANDLER( pia_cb2_w )
src/mess/drivers/einstein.c
r1355r1356
14531453   /* the einstein keyboard can generate a interrupt */
14541454   /* the int is actually clocked at the system clock 4Mhz, but this would be too fast for our
14551455   driver. So we update at 50Hz and hope this is good enough. */
1456   timer_pulse(ATTOTIME_IN_HZ(50), 0, einstein_keyboard_timer_callback);
1456   timer_pulse(ATTOTIME_IN_HZ(50), NULL, 0, einstein_keyboard_timer_callback);
14571457
14581458   /* the input to channel 0 and 1 of the ctc is a 2mhz clock */
14591459   einstein_ctc_trigger = 0;
1460   timer_pulse(ATTOTIME_IN_HZ(2000000), 0, einstein_ctc_trigger_callback);
1460   timer_pulse(ATTOTIME_IN_HZ(2000000), NULL, 0, einstein_ctc_trigger_callback);
14611461
14621462   centronics_config(0, einstein_cent_config);
14631463   /* assumption: select is tied low */
src/mess/drivers/intv.c
r1355r1356
497497***************************************************************************/
498498
499499/*    YEAR  NAME      PARENT   COMPAT   MACHINE   INPUT     INIT      CONFIG      COMPANY      FULLNAME */
500CONS( 1979, intv,      0,      0,      intv,     intv,    NULL,      intv,      "Mattel",    "Intellivision", GAME_NOT_WORKING )
501CONS( 1981, intvsrs,   0,      0,      intv,     intv,    NULL,      intv,      "Mattel",    "Intellivision (Sears)", GAME_NOT_WORKING )
502COMP( 1981, intvkbd,   0,      0,      intvkbd,  intvkbd,    NULL,      intvkbd,   "Mattel",    "Intellivision Keyboard Component (Unreleased)", GAME_NOT_WORKING)
500CONS( 1979, intv,      0,      0,      intv,     intv,    0,         intv,      "Mattel",    "Intellivision", GAME_NOT_WORKING )
501CONS( 1981, intvsrs,   0,      0,      intv,     intv,    0,         intv,      "Mattel",    "Intellivision (Sears)", GAME_NOT_WORKING )
502COMP( 1981, intvkbd,   0,      0,      intvkbd,  intvkbd,    0,         intvkbd,   "Mattel",    "Intellivision Keyboard Component (Unreleased)", GAME_NOT_WORKING)
src/mess/drivers/exelv.c
r1355r1356
209209         io_state = IOS_NOP;
210210         break;
211211      case IOS_RESET:
212         timer_set(ATTOTIME_IN_USEC(100), 0, io_reset_timer);
212         timer_set(ATTOTIME_IN_USEC(100), NULL, 0, io_reset_timer);
213213         break;
214214      case IOS_STSPEECH1:
215215         io_state = IOS_STSPEECH2;
src/mess/drivers/mephisto.c
r1355r1356
182182
183183static MACHINE_START( mephisto )
184184{
185  lcd_shift_counter=3;
186  // timer_pulse(ATTOTIME_IN_HZ(60), 0, update_leds);
187   timer_pulse(ATTOTIME_IN_HZ(600), 0, update_nmi);
188  // cpunum_set_input_line(0, M65C02_IRQ_LINE,CLEAR_LINE);
189  //beep_set_frequency(0, 4000);
185   lcd_shift_counter=3;
186   // timer_pulse(ATTOTIME_IN_HZ(60), NULL, 0, update_leds);
187   timer_pulse(ATTOTIME_IN_HZ(600), NULL, 0, update_nmi);
188   // cpunum_set_input_line(0, M65C02_IRQ_LINE,CLEAR_LINE);
189   //beep_set_frequency(0, 4000);
190190}
191191
192192
src/mess/drivers/vtech1.c
r1355r1356
503503 Drivers
504504******************************************************************************/
505505
506/*    YEAR  NAME        PARENT      COMPAT  MACHINE     INPUT   INIT    CONFIG      COMPANY                     FULLNAME                            FLAGS */
507COMP( 1983, laser110,   0,          0,      laser110,   vtech1, NULL,   laser110,   "Video Technology",         "Laser 110",                        0 )
508COMP( 1983, las110de,   laser110,   0,      laser110,   vtech1, NULL,   laser110,   "Sanyo",                    "Laser 110 (Germany)",              0 )
506/*    YEAR  NAME        PARENT      COMPAT  MACHINE     INPUT   INIT CONFIG      COMPANY                     FULLNAME                            FLAGS */
507COMP( 1983, laser110,   0,          0,      laser110,   vtech1, 0,   laser110,   "Video Technology",         "Laser 110",                        0 )
508COMP( 1983, las110de,   laser110,   0,      laser110,   vtech1, 0,   laser110,   "Sanyo",                    "Laser 110 (Germany)",              0 )
509509
510COMP( 1983, laser200,   0,          0,      laser200,   vtech1, NULL,   laser110,   "Video Technology",         "Laser 200",                        0 )
511COMP( 1983, vz200de,    laser200,   0,      laser200,   vtech1, NULL,   laser110,   "Video Technology",         "VZ-200 (Germany & Netherlands)",   0 )
512COMP( 1983, fellow,     laser200,   0,      laser200,   vtech1, NULL,   laser110,   "Salora",                   "Fellow (Finland)",                 0 )
513COMP( 1983, tx8000,     laser200,   0,      laser200,   vtech1, NULL,   laser110,   "Texet",                    "TX-8000 (UK)",                     0 )
510COMP( 1983, laser200,   0,          0,      laser200,   vtech1, 0,   laser110,   "Video Technology",         "Laser 200",                        0 )
511COMP( 1983, vz200de,    laser200,   0,      laser200,   vtech1, 0,   laser110,   "Video Technology",         "VZ-200 (Germany & Netherlands)",   0 )
512COMP( 1983, fellow,     laser200,   0,      laser200,   vtech1, 0,   laser110,   "Salora",                   "Fellow (Finland)",                 0 )
513COMP( 1983, tx8000,     laser200,   0,      laser200,   vtech1, 0,   laser110,   "Texet",                    "TX-8000 (UK)",                     0 )
514514
515COMP( 1984, laser210,   0,          0,      laser210,   vtech1, NULL,   laser210,   "Video Technology",         "Laser 210",                        0 )
516COMP( 1984, vz200,      laser210,   0,      laser210,   vtech1, NULL,   laser210,   "Dick Smith Electronics",   "VZ-200 (Oceania)",                 0 )
517COMP( 1984, las210de,   laser210,   0,      laser210,   vtech1, NULL,   laser210,   "Sanyo",                    "Laser 210 (Germany)",              0 )
515COMP( 1984, laser210,   0,          0,      laser210,   vtech1, 0,   laser210,   "Video Technology",         "Laser 210",                        0 )
516COMP( 1984, vz200,      laser210,   0,      laser210,   vtech1, 0,   laser210,   "Dick Smith Electronics",   "VZ-200 (Oceania)",                 0 )
517COMP( 1984, las210de,   laser210,   0,      laser210,   vtech1, 0,   laser210,   "Sanyo",                    "Laser 210 (Germany)",              0 )
518518
519COMP( 1984, laser310,   0,          0,      laser310,   vtech1, NULL,   laser310,   "Video Technology",         "Laser 310",                        0 )
520COMP( 1984, vz300,      laser310,   0,      laser310,   vtech1, NULL,   laser310,   "Dick Smith Electronics",   "VZ-300 (Oceania)",                 0 )
519COMP( 1984, laser310,   0,          0,      laser310,   vtech1, 0,   laser310,   "Video Technology",         "Laser 310",                        0 )
520COMP( 1984, vz300,      laser310,   0,      laser310,   vtech1, 0,    laser310,   "Dick Smith Electronics",   "VZ-300 (Oceania)",                 0 )
src/mess/drivers/amstrad.c
r1355r1356
18071807The CRTC generates a memory address using it's MA and RA signal outputs
18081808The Gate-Array fetches two bytes for each address*/
18091809
1810//   timer_pulse(ATTOTIME_IN_USEC(AMSTRAD_US_PER_SCANLINE), 0, amstrad_vh_execute_crtc_cycles);
1811   timer_pulse(ATTOTIME_IN_USEC(1), 0, amstrad_vh_execute_crtc_cycles_callback);
1810//   timer_pulse(ATTOTIME_IN_USEC(AMSTRAD_US_PER_SCANLINE), NULL, 0, amstrad_vh_execute_crtc_cycles);
1811   timer_pulse(ATTOTIME_IN_USEC(1), NULL, 0, amstrad_vh_execute_crtc_cycles_callback);
18121812
18131813   /* The opcode timing in the Amstrad is different to the opcode
18141814   timing in the core for the Z80 CPU.
src/mess/drivers/a310.c
r1355r1356
216216   a310_pagesize = 0;
217217   wd17xx_init(WD_TYPE_1772, a310_wd177x_callback, NULL);
218218
219   vbl_timer = timer_alloc(a310_vblank);
219   vbl_timer = timer_alloc(a310_vblank, NULL);
220220   timer_adjust(vbl_timer, attotime_never, 0, attotime_never);
221221
222   timer[0] = timer_alloc(a310_timer);
223   timer[1] = timer_alloc(a310_timer);
224   timer[2] = timer_alloc(a310_timer);
225   timer[3] = timer_alloc(a310_timer);
222   timer[0] = timer_alloc(a310_timer, NULL);
223   timer[1] = timer_alloc(a310_timer, NULL);
224   timer[2] = timer_alloc(a310_timer, NULL);
225   timer[3] = timer_alloc(a310_timer, NULL);
226226   timer_adjust(timer[0], attotime_never, 0, attotime_never);
227227   timer_adjust(timer[1], attotime_never, 0, attotime_never);
228228   timer_adjust(timer[2], attotime_never, 0, attotime_never);
229229   timer_adjust(timer[3], attotime_never, 0, attotime_never);
230230
231   snd_timer = timer_alloc(a310_audio_tick);
231   snd_timer = timer_alloc(a310_audio_tick, NULL);
232232   timer_adjust(snd_timer, attotime_never, 0, attotime_never);
233233
234234   // reset the DAC to centerline
src/mess/drivers/avigo.c
r1355r1356
453453{
454454   /* a timer used to check status of pen */
455455   /* an interrupt is generated when the pen is pressed to the screen */
456   timer_pulse(ATTOTIME_IN_HZ(50), 0, avigo_dummy_timer_callback);
456   timer_pulse(ATTOTIME_IN_HZ(50), NULL, 0, avigo_dummy_timer_callback);
457457
458458   add_reset_callback(machine, avigo_machine_reset);
459459}
src/mess/drivers/psx.c
r1355r1356
186186      if( !m_pad[ n_port ].b_ack )
187187      {
188188         m_pad[ n_port ].b_ack = 1;
189         timer_set( ATTOTIME_IN_USEC( 2 ), n_port, psx_pad_ack );
189         timer_set( ATTOTIME_IN_USEC( 2 ), NULL, n_port, psx_pad_ack );
190190      }
191191   }
192192}
r1355r1356
299299   if( b_ack )
300300   {
301301      m_pad[ n_port ].b_ack = 0;
302      timer_set( ATTOTIME_IN_USEC( 10 ), n_port, psx_pad_ack );
302      timer_set( ATTOTIME_IN_USEC( 10 ), NULL, n_port, psx_pad_ack );
303303   }
304304}
305305
src/mess/drivers/tutor.c
r1355r1356
102102
103103static DRIVER_INIT(tutor)
104104{
105   tape_interrupt_timer = timer_alloc(tape_interrupt_handler);
105   tape_interrupt_timer = timer_alloc(tape_interrupt_handler, NULL);
106106
107107   memory_configure_bank(1, 0, 1, memory_region(REGION_CPU1) + basic_base, 0);
108108   memory_configure_bank(1, 1, 1, memory_region(REGION_CPU1) + cartridge_base, 0);
src/mess/drivers/svision.c
r1355r1356
432432
433433static DRIVER_INIT( svision )
434434{
435   svision.timer1 = timer_alloc(svision_timer);
435   svision.timer1 = timer_alloc(svision_timer, NULL);
436436   svision_pet.on = FALSE;
437437   memory_set_bankptr(2, memory_region(REGION_USER1) + 0x1c000);
438438}
439439
440440static DRIVER_INIT( svisions )
441441{
442   svision.timer1 = timer_alloc(svision_timer);
442   svision.timer1 = timer_alloc(svision_timer, NULL);
443443   memory_set_bankptr(2, memory_region(REGION_USER1) + 0x1c000);
444   svision.timer1 = timer_alloc(svision_timer);
444   svision.timer1 = timer_alloc(svision_timer, NULL);
445445   svision_pet.on = TRUE;
446   svision_pet.timer = timer_alloc(svision_pet_timer);
447   timer_pulse(attotime_mul(ATTOTIME_IN_SEC(8), 256/Machine->drv->cpu[0].clock), 0, svision_pet_timer); 
446   svision_pet.timer = timer_alloc(svision_pet_timer, NULL);
447   timer_pulse(attotime_mul(ATTOTIME_IN_SEC(8), 256/Machine->drv->cpu[0].clock), NULL, 0, svision_pet_timer); 
448448}
449449
450450static MACHINE_RESET( svision )
src/mess/drivers/ip20.c
r1355r1356
468468
469469static INTERRUPT_GEN( ip20_update_chips )
470470{
471   mc_update(Machine, 0);
471   mc_update();
472472   nRTC_Temp++;
473473   if( nRTC_Temp == 100 )
474474   {
docs/messnew.txt
r1355r1356
2626
2727Source Changes:
2828----------------
29- The core is based on MAME 0.121u1.  This incorporates all features of the
29- The core is based on MAME 0.121u2.  This incorporates all features of the
3030  update to this core.  [MAME team]
3131
3232
makefile
r1355r1356
6262
6363
6464#-------------------------------------------------
65# configure name of final executable
66#-------------------------------------------------
67
68# uncomment and specify prefix to be added to the name
69# PREFIX =
70
71# uncomment and specify suffix to be added to the name
72# SUFFIX =
73
74
75
76#-------------------------------------------------
77# specify architecture-specific optimizations
78#-------------------------------------------------
79
80# uncomment and specify architecture-specific optimizations here
81# some examples:
82#   optimize for I686:   ARCHOPTS = -march=pentiumpro
83#   optimize for Core 2: ARCHOPTS = -march=pentium-m -msse3
84#   optimize for G4:     ARCHOPTS = -mcpu=G4
85# note that we leave this commented by default so that you can
86# configure this in your environment and never have to think about it
87# ARCHOPTS =
88
89
90
91#-------------------------------------------------
6592# specify program options; see each option below
6693# for details
6794#-------------------------------------------------
r1355r1356
88115# for details
89116#-------------------------------------------------
90117
91# uncomment one of the next lines to build a target-optimized build
92# NATIVE = 1
93# ATHLON = 1
94# AMD64 = 1
95# I686 = 1
96# P4 = 1
97# PM = 1
98# CORE2 = 1
99# G4 = 1
100# G5 = 1
101# CELL = 1
102
103118# uncomment next line if you are building for a 64-bit target
104119# PTR64 = 1
105120
121# uncomment next line if you are building for a big-endian target
122# BIGENDIAN = 1
123
106124# uncomment next line to build expat as part of MAME build
107125BUILD_EXPAT = 1
108126
r1355r1356
179197
180198
181199#-------------------------------------------------
182# based on the architecture, determine suffixes
183# and endianness
184#-------------------------------------------------
185
186# by default, don't compile for a specific target CPU
187# and assume little-endian (x86)
188ARCH =
189ENDIAN = little
190
191# architecture-specific builds get extra options
192ifdef NATIVE
193SUFFIX = nat
194ARCH = -march=native
195endif
196
197ifdef ATHLON
198SUFFIX = at
199ARCH = -march=athlon
200endif
201
202ifdef AMD64
203SUFFIX = 64
204ARCH = -march=athlon64
205endif
206
207ifdef I686
208SUFFIX = pp
209ARCH = -march=pentiumpro
210endif
211
212ifdef P4
213SUFFIX = p4
214ARCH = -march=pentium4
215endif
216
217ifdef PM
218SUFFIX = pm
219ARCH = -march=pentium-m
220endif
221
222ifdef CORE2
223SUFFIX = c2
224ARCH = -march=pentium-m -msse3
225endif
226
227ifdef G4
228SUFFIX = g4
229ARCH = -mcpu=G4
230ENDIAN = big
231endif
232
233ifdef G5
234SUFFIX = g5
235ARCH = -mcpu=G5
236ENDIAN = big
237endif
238
239ifdef CELL
240SUFFIX = cbe
241ARCH =
242ENDIAN = big
243endif
244
245
246
247#-------------------------------------------------
248200# form the name of the executable
249201#-------------------------------------------------
250202
251203# debug builds just get the 'd' suffix and nothing more
252204ifdef DEBUG
253SUFFIX = d
205DEBUGSUFFIX = d
254206endif
255207
256208# the name is just 'target' if no subtarget; otherwise it is
r1355r1356
261213NAME = $(TARGET)$(SUBTARGET)
262214endif
263215
264# fullname is prefix+name+suffix
265FULLNAME = $(PREFIX)$(NAME)$(SUFFIX)
216# fullname is prefix+name+suffix+debugsuffix
217FULLNAME = $(PREFIX)$(NAME)$(SUFFIX)$(DEBUGSUFFIX)
266218
267219# add an EXE suffix to get the final emulator name
268220EMULATOR = $(FULLNAME)$(EXE)
r1355r1356
299251DEFS += -DINLINE="static __inline__"
300252
301253# define LSB_FIRST if we are a little-endian target
302ifeq ($(ENDIAN),little)
254ifndef BIGENDIAN
303255DEFS += -DLSB_FIRST
304256endif
305257
r1355r1356
334286# we compile to C89 standard with GNU extensions
335287CFLAGS = -std=gnu89
336288
289# this speeds it up a bit by piping between the preprocessor/compiler/assembler
290CFLAGS += -pipe
291
337292# add -g if we need symbols
338293ifdef SYMBOLS
339294CFLAGS += -g
r1355r1356
366321# if we are optimizing, include optimization options
367322# and make all errors into warnings
368323ifneq ($(OPTIMIZE),0)
369CFLAGS += -Werror $(ARCH) -fno-strict-aliasing
370#CFLAGS += $(ARCH) -fno-strict-aliasing
324CFLAGS += -Werror $(ARCHOPTS) -fno-strict-aliasing
325#CFLAGS += $(ARCHOPTS) -fno-strict-aliasing
371326endif
372327
373328# if symbols are on, make sure we have frame pointers

Previous 15994 Revisions Next


© 1998-2018 The MESS Team