| 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 |
| r1355 | r1356 | |
|---|---|---|
| 252 | 252 | # form the name of the executable |
| 253 | 253 | #------------------------------------------------- |
| 254 | 254 | |
| 255 | # MSVC builds append the 'vc' suffix | |
| 256 | ifdef MSVC_BUILD | |
| 257 | SUFFIX:=$(SUFFIX)vc | |
| 258 | endif | |
| 259 | ||
| 260 | 255 | # unicode builds append the 'u' suffix |
| 261 | 256 | ifdef UNICODE |
| 262 | 257 | SUFFIX:=$(SUFFIX)u |
| r1355 | r1356 | |
| 388 | 383 | # and make all errors into warnings |
| 389 | 384 | ifneq ($(OPTIMIZE),0) |
| 390 | 385 | CFLAGS += -Werror $(ARCH) -fno-strict-aliasing |
| 386 | #CFLAGS += $(ARCH) -fno-strict-aliasing | |
| 391 | 387 | endif |
| 392 | 388 | |
| 393 | 389 | # if symbols are on, make sure we have frame pointers |
| r1355 | r1356 | |
|---|---|---|
| 182 | 182 | ctc_intf.baseclock = machine->drv->cpu[1].clock; |
| 183 | 183 | z80ctc_init (0, &ctc_intf); |
| 184 | 184 | |
| 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); | |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 |
| r1355 | r1356 | |
|---|---|---|
| 215 | 215 | |
| 216 | 216 | channel = stream_create(0, 1, CLOCK_16H, NULL, warpwarp_sound_update); |
| 217 | 217 | |
| 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); | |
| 220 | 220 | return auto_malloc(1); |
| 221 | 221 | } |
| r1355 | r1356 | |
|---|---|---|
| 1153 | 1153 | channel = stream_create( 0, 2, 32000, NULL, snes_sh_update ); |
| 1154 | 1154 | |
| 1155 | 1155 | /* Initialize the timers */ |
| 1156 | timers[0].timer = timer_alloc( snes_spc_timer ); | |
| 1156 | timers[0].timer = timer_alloc( snes_spc_timer , NULL); | |
| 1157 | 1157 | timer_adjust( timers[0].timer, ATTOTIME_IN_HZ(8000), 0, ATTOTIME_IN_HZ(8000) ); |
| 1158 | 1158 | 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); | |
| 1160 | 1160 | timer_adjust( timers[1].timer, ATTOTIME_IN_HZ(8000), 1, ATTOTIME_IN_HZ(8000) ); |
| 1161 | 1161 | 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); | |
| 1163 | 1163 | timer_adjust( timers[2].timer, ATTOTIME_IN_HZ(64000), 2, ATTOTIME_IN_HZ(64000) ); |
| 1164 | 1164 | timer_enable( timers[2].timer, 0 ); |
| 1165 | 1165 |
| r1355 | r1356 | |
|---|---|---|
| 285 | 285 | void cojag_sound_reset(void) |
| 286 | 286 | { |
| 287 | 287 | #if ENABLE_SPEEDUP_HACKS |
| 288 | serial_timer = timer_alloc(serial_chunky_callback); | |
| 288 | serial_timer = timer_alloc(serial_chunky_callback, NULL); | |
| 289 | 289 | #else |
| 290 | serial_timer = timer_alloc(serial_callback); | |
| 290 | serial_timer = timer_alloc(serial_callback, NULL); | |
| 291 | 291 | #endif |
| 292 | 292 | } |
| 293 | 293 |
| r1355 | r1356 | |
|---|---|---|
| 30 | 30 | |
| 31 | 31 | |
| 32 | 32 | |
| 33 | struct SN76477interface sheriff_sn76477_interface = | |
| 33 | static struct SN76477interface sheriff_sn76477_interface = | |
| 34 | 34 | { |
| 35 | 35 | RES_K(36) , /* 04 */ |
| 36 | 36 | RES_K(100) , /* 05 */ |
| r1355 | r1356 | |
| 58 | 58 | }; |
| 59 | 59 | |
| 60 | 60 | |
| 61 | struct SN76477interface spacefev_sn76477_interface = | |
| 61 | static struct SN76477interface spacefev_sn76477_interface = | |
| 62 | 62 | { |
| 63 | 63 | RES_K(36) , /* 04 */ |
| 64 | 64 | RES_K(150) , /* 05 */ |
| r1355 | r1356 | |
| 342 | 342 | |
| 343 | 343 | WRITE8_HANDLER( n8080_sound_1_w ) |
| 344 | 344 | { |
| 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 */ | |
| 346 | 346 | } |
| 347 | 347 | WRITE8_HANDLER( n8080_sound_2_w ) |
| 348 | 348 | { |
| 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 */ | |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | |
| r1355 | r1356 | |
| 470 | 470 | { |
| 471 | 471 | n8080_hardware = 1; |
| 472 | 472 | |
| 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); | |
| 474 | 474 | |
| 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); | |
| 478 | 478 | |
| 479 | 479 | mono_flop[0] = 0; |
| 480 | 480 | mono_flop[1] = 0; |
| r1355 | r1356 | |
| 489 | 489 | { |
| 490 | 490 | n8080_hardware = 2; |
| 491 | 491 | |
| 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); | |
| 494 | 494 | |
| 495 | 495 | mono_flop[0] = 0; |
| 496 | 496 | mono_flop[1] = 0; |
| r1355 | r1356 | |
| 504 | 504 | { |
| 505 | 505 | n8080_hardware = 3; |
| 506 | 506 | |
| 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); | |
| 508 | 508 | |
| 509 | 509 | helifire_dac_volume = 1; |
| 510 | 510 | helifire_dac_timing = 0; |
| r1355 | r1356 | |
|---|---|---|
| 241 | 241 | /* if we're in manual mode, signal an interrupt once we latch the low byte */ |
| 242 | 242 | if (!chan->dmaenabled && chan->manualmode && (chan->curlocation & 1)) |
| 243 | 243 | { |
| 244 | signal_irq(Machine, channum); | |
| 244 | signal_irq(Machine, NULL, channum); | |
| 245 | 245 | chan->manualmode = FALSE; |
| 246 | 246 | } |
| 247 | 247 | } |
| r1355 | r1356 | |
| 271 | 271 | for (i = 0; i < 4; i++) |
| 272 | 272 | { |
| 273 | 273 | 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); | |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | /* create the stream */ |
| r1355 | r1356 | |
|---|---|---|
| 1426 | 1426 | |
| 1427 | 1427 | /* watch for a 0->1 edge on bit 4 ("shift in") to clock in the new data */ |
| 1428 | 1428 | 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); | |
| 1430 | 1430 | } |
| 1431 | 1431 | |
| 1432 | 1432 |
| r1355 | r1356 | |
|---|---|---|
| 363 | 363 | sample_set_volume(CHANNEL_LFO+2,0); |
| 364 | 364 | sample_start_raw(CHANNEL_LFO+2,backgroundwave,sizeof(backgroundwave)/2,1000,1); |
| 365 | 365 | |
| 366 | noisetimer = timer_alloc(noise_timer_cb); | |
| 366 | noisetimer = timer_alloc(noise_timer_cb, NULL); | |
| 367 | 367 | timer_adjust(noisetimer, ATTOTIME_IN_NSEC((155000+22000)/100*693*22), 0, ATTOTIME_IN_NSEC((155000+22000)/100*693*22)); |
| 368 | 368 | |
| 369 | lfotimer = timer_alloc(lfo_timer_cb); | |
| 369 | lfotimer = timer_alloc(lfo_timer_cb, NULL); | |
| 370 | 370 | |
| 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); | |
| 372 | 372 | |
| 373 | 373 | state_save_register_global(freq); |
| 374 | 374 | state_save_register_global(noise_enable); |
| r1355 | r1356 | |
|---|---|---|
| 107 | 107 | #else |
| 108 | 108 | |
| 109 | 109 | 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); | |
| 111 | 111 | else |
| 112 | 112 | update_sound_a(data); |
| 113 | 113 |
| r1355 | r1356 | |
|---|---|---|
| 139 | 139 | *************************************/ |
| 140 | 140 | |
| 141 | 141 | static TIMER_CALLBACK( dma_timer_callback ); |
| 142 | static TIMER_CALLBACK( timer_callback ); | |
| 142 | static TIMER_CALLBACK( cage_timer_callback ); | |
| 143 | 143 | static void update_timer(int which); |
| 144 | 144 | static WRITE32_HANDLER( speedup_w ); |
| 145 | 145 | |
| r1355 | r1356 | |
| 164 | 164 | cage_cpu_clock_period = ATTOTIME_IN_HZ(Machine->drv->cpu[cage_cpu].clock); |
| 165 | 165 | cage_cpu_h1_clock_period = attotime_mul(cage_cpu_clock_period, 2); |
| 166 | 166 | |
| 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); | |
| 170 | 170 | |
| 171 | 171 | if (speedup) |
| 172 | 172 | speedup_ram = memory_install_write32_handler(cage_cpu, ADDRESS_SPACE_PROGRAM, speedup, speedup, 0, 0, speedup_w); |
| r1355 | r1356 | |
| 276 | 276 | * |
| 277 | 277 | *************************************/ |
| 278 | 278 | |
| 279 | static TIMER_CALLBACK( timer_callback ) | |
| 279 | static TIMER_CALLBACK( cage_timer_callback ) | |
| 280 | 280 | { |
| 281 | 281 | int which = param; |
| 282 | 282 | |
| r1355 | r1356 | |
| 521 | 521 | { |
| 522 | 522 | if (LOG_COMM) |
| 523 | 523 | 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); | |
| 525 | 525 | } |
| 526 | 526 | |
| 527 | 527 |
| r1355 | r1356 | |
|---|---|---|
| 119 | 119 | if (cpunum == -1) |
| 120 | 120 | return; |
| 121 | 121 | |
| 122 | timer_call_after_resynch(data, namco_54xx_latch_callback); | |
| 122 | timer_call_after_resynch(NULL, data, namco_54xx_latch_callback); | |
| 123 | 123 | |
| 124 | 124 | cpunum_set_input_line(cpunum, 0, ASSERT_LINE); |
| 125 | 125 | |
| r1355 | r1356 | |
| 128 | 128 | // The input clock to the 06XX interface chip is 64H, that is |
| 129 | 129 | // 18432000/6/64 = 48kHz, so it makes sense for the irq line to be |
| 130 | 130 | // 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); | |
| 132 | 132 | } |
| r1355 | r1356 | |
|---|---|---|
| 84 | 84 | sample_set_volume(0,0); |
| 85 | 85 | sample_start_raw(0,_single,SINGLE_LENGTH,single_rate,1); |
| 86 | 86 | |
| 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); | |
| 88 | 88 | } |
| r1355 | r1356 | |
|---|---|---|
| 382 | 382 | /********* external interfaces ***********/ |
| 383 | 383 | WRITE8_HANDLER( ssio_data_w ) |
| 384 | 384 | { |
| 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); | |
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | READ8_HANDLER( ssio_status_r ) |
| r1355 | r1356 | |
| 443 | 443 | |
| 444 | 444 | |
| 445 | 445 | /********* sound interfaces ***********/ |
| 446 | struct AY8910interface ssio_ay8910_interface_1 = | |
| 446 | static struct AY8910interface ssio_ay8910_interface_1 = | |
| 447 | 447 | { |
| 448 | 448 | 0, |
| 449 | 449 | 0, |
| r1355 | r1356 | |
| 451 | 451 | ssio_portb0_w |
| 452 | 452 | }; |
| 453 | 453 | |
| 454 | struct AY8910interface ssio_ay8910_interface_2 = | |
| 454 | static struct AY8910interface ssio_ay8910_interface_2 = | |
| 455 | 455 | { |
| 456 | 456 | 0, |
| 457 | 457 | 0, |
| r1355 | r1356 | |
| 564 | 564 | /********* external interfaces ***********/ |
| 565 | 565 | WRITE8_HANDLER( csdeluxe_data_w ) |
| 566 | 566 | { |
| 567 | timer_call_after_resynch(data, csdeluxe_delayed_data_w); | |
| 567 | timer_call_after_resynch(NULL, data, csdeluxe_delayed_data_w); | |
| 568 | 568 | } |
| 569 | 569 | |
| 570 | 570 | READ8_HANDLER( csdeluxe_status_r ) |
| r1355 | r1356 | |
| 664 | 664 | /********* external interfaces ***********/ |
| 665 | 665 | WRITE8_HANDLER( soundsgood_data_w ) |
| 666 | 666 | { |
| 667 | timer_call_after_resynch(data, soundsgood_delayed_data_w); | |
| 667 | timer_call_after_resynch(NULL, data, soundsgood_delayed_data_w); | |
| 668 | 668 | } |
| 669 | 669 | |
| 670 | 670 | READ8_HANDLER( soundsgood_status_r ) |
| r1355 | r1356 | |
| 755 | 755 | /********* external interfaces ***********/ |
| 756 | 756 | WRITE8_HANDLER( turbocs_data_w ) |
| 757 | 757 | { |
| 758 | timer_call_after_resynch(data, turbocs_delayed_data_w); | |
| 758 | timer_call_after_resynch(NULL, data, turbocs_delayed_data_w); | |
| 759 | 759 | } |
| 760 | 760 | |
| 761 | 761 | READ8_HANDLER( turbocs_status_r ) |
| r1355 | r1356 | |
| 882 | 882 | /********* external interfaces ***********/ |
| 883 | 883 | WRITE8_HANDLER( squawkntalk_data_w ) |
| 884 | 884 | { |
| 885 | timer_call_after_resynch(data, squawkntalk_delayed_data_w); | |
| 885 | timer_call_after_resynch(NULL, data, squawkntalk_delayed_data_w); | |
| 886 | 886 | } |
| 887 | 887 | |
| 888 | 888 | void squawkntalk_reset_w(int state) |
| r1355 | r1356 | |
|---|---|---|
| 177 | 177 | |
| 178 | 178 | WRITE8_HANDLER( t5182_sound_irq_w ) |
| 179 | 179 | { |
| 180 | timer_call_after_resynch(CPU_ASSERT,setirq_callback); | |
| 180 | timer_call_after_resynch(NULL, CPU_ASSERT,setirq_callback); | |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | static WRITE8_HANDLER( t5182_ym2151_irq_ack_w ) |
| 184 | 184 | { |
| 185 | timer_call_after_resynch(YM2151_ACK,setirq_callback); | |
| 185 | timer_call_after_resynch(NULL, YM2151_ACK,setirq_callback); | |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | static WRITE8_HANDLER( t5182_cpu_irq_ack_w ) |
| 189 | 189 | { |
| 190 | timer_call_after_resynch(CPU_CLEAR,setirq_callback); | |
| 190 | timer_call_after_resynch(NULL, CPU_CLEAR,setirq_callback); | |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | static void t5182_ym2151_irq_handler(int irq) |
| 194 | 194 | { |
| 195 | 195 | if (irq) |
| 196 | timer_call_after_resynch(YM2151_ASSERT,setirq_callback); | |
| 196 | timer_call_after_resynch(NULL, YM2151_ASSERT,setirq_callback); | |
| 197 | 197 | else |
| 198 | timer_call_after_resynch(YM2151_CLEAR,setirq_callback); | |
| 198 | timer_call_after_resynch(NULL, YM2151_CLEAR,setirq_callback); | |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 |
| r1355 | r1356 | |
|---|---|---|
| 225 | 225 | |
| 226 | 226 | WRITE8_HANDLER( sega_speech_data_w ) |
| 227 | 227 | { |
| 228 | timer_call_after_resynch(data, delayed_speech_w); | |
| 228 | timer_call_after_resynch(NULL, data, delayed_speech_w); | |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | |
| r1355 | r1356 | |
| 317 | 317 | cpunum_set_input_line(usb.cpunum, INPUT_LINE_RESET, ASSERT_LINE); |
| 318 | 318 | |
| 319 | 319 | /* 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); | |
| 321 | 321 | usb.t1_clock_mask = t1_clock_mask; |
| 322 | 322 | } |
| 323 | 323 | |
| r1355 | r1356 | |
| 360 | 360 | WRITE8_HANDLER( sega_usb_data_w ) |
| 361 | 361 | { |
| 362 | 362 | 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); | |
| 364 | 364 | |
| 365 | 365 | /* boost the interleave so that sequences can be sent */ |
| 366 | 366 | cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(250)); |
| r1355 | r1356 | |
|---|---|---|
| 139 | 139 | |
| 140 | 140 | MACHINE_START( frogs_audio ) |
| 141 | 141 | { |
| 142 | frogs_croak_timer = timer_alloc(frogs_croak_callback); | |
| 142 | frogs_croak_timer = timer_alloc(frogs_croak_callback, NULL); | |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 |
| r1355 | r1356 | |
|---|---|---|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | |
| 101 | struct AY8910interface irem_ay8910_interface_1 = | |
| 101 | static struct AY8910interface irem_ay8910_interface_1 = | |
| 102 | 102 | { |
| 103 | 103 | soundlatch_r, |
| 104 | 104 | 0, |
| r1355 | r1356 | |
| 106 | 106 | irem_msm5205_w |
| 107 | 107 | }; |
| 108 | 108 | |
| 109 | struct AY8910interface irem_ay8910_interface_2 = | |
| 109 | static struct AY8910interface irem_ay8910_interface_2 = | |
| 110 | 110 | { |
| 111 | 111 | 0, |
| 112 | 112 | 0, |
| r1355 | r1356 | |
| 114 | 114 | 0 |
| 115 | 115 | }; |
| 116 | 116 | |
| 117 | struct MSM5205interface irem_msm5205_interface_1 = | |
| 117 | static struct MSM5205interface irem_msm5205_interface_1 = | |
| 118 | 118 | { |
| 119 | 119 | irem_adpcm_int, /* interrupt function */ |
| 120 | 120 | MSM5205_S96_4B /* default to 4KHz, but can be changed at run time */ |
| 121 | 121 | }; |
| 122 | 122 | |
| 123 | struct MSM5205interface irem_msm5205_interface_2 = | |
| 123 | static struct MSM5205interface irem_msm5205_interface_2 = | |
| 124 | 124 | { |
| 125 | 125 | 0, /* interrupt function */ |
| 126 | 126 | MSM5205_SEX_4B /* default to 4KHz, but can be changed at run time, slave */ |
| r1355 | r1356 | |
|---|---|---|
| 526 | 526 | is_redline = 0; |
| 527 | 527 | |
| 528 | 528 | /* 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); | |
| 537 | 537 | |
| 538 | 538 | for (i = 0; i < 9; i++) |
| 539 | counter[i].timer = timer_alloc(NULL); | |
| 539 | counter[i].timer = timer_alloc(NULL, NULL); | |
| 540 | 540 | |
| 541 | 541 | return auto_malloc(1); |
| 542 | 542 | } |
| r1355 | r1356 | |
| 1720 | 1720 | |
| 1721 | 1721 | WRITE8_HANDLER( leland_80186_command_lo_w ) |
| 1722 | 1722 | { |
| 1723 | timer_call_after_resynch(data, command_lo_sync); | |
| 1723 | timer_call_after_resynch(NULL, data, command_lo_sync); | |
| 1724 | 1724 | } |
| 1725 | 1725 | |
| 1726 | 1726 | |
| r1355 | r1356 | |
| 1775 | 1775 | if (LOG_COMM) logerror("%04X:Read sound response latch = %02X\n", activecpu_get_previouspc(), sound_response); |
| 1776 | 1776 | |
| 1777 | 1777 | /* 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); | |
| 1779 | 1779 | return sound_response; |
| 1780 | 1780 | } |
| 1781 | 1781 |
| r1355 | r1356 | |
|---|---|---|
| 72 | 72 | static UINT8 decay; |
| 73 | 73 | static UINT8 sh1_count = 0; |
| 74 | 74 | |
| 75 | enum { | |
| 75 | enum | |
| 76 | { | |
| 76 | 77 | WAIT_CMD, |
| 77 | 78 | WAIT_WRITE, |
| 78 | 79 | WAIT_DONE1, |
| 79 | 80 | WAIT_DONE2 |
| 80 | } | |
| 81 | } | |
| 81 | 82 | |
| 82 | 83 | static UINT8 m58817_state; |
| 83 | 84 | static UINT8 m58817_drq; |
| r1355 | r1356 | |
|---|---|---|
| 68 | 68 | /* Channels 0, 1, 2, 3 - Unused */ |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | static TIMER_CALLBACK( timer_callback ) | |
| 71 | static TIMER_CALLBACK( taito_en_timer_callback ) | |
| 72 | 72 | { |
| 73 | 73 | /* Only cause IRQ if the mask is set to allow it */ |
| 74 | 74 | if (m68681_imr&8) { |
| r1355 | r1356 | |
| 80 | 80 | |
| 81 | 81 | void f3_68681_reset(void) |
| 82 | 82 | { |
| 83 | timer_68681 = timer_alloc(timer_callback); | |
| 83 | timer_68681 = timer_alloc(taito_en_timer_callback, NULL); | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | READ16_HANDLER(f3_68681_r) |
| r1355 | r1356 | |
|---|---|---|
| 110 | 110 | |
| 111 | 111 | WRITE16_HANDLER( hd68k_snd_data_w ) |
| 112 | 112 | { |
| 113 | timer_call_after_resynch(data, delayed_68k_w); | |
| 113 | timer_call_after_resynch(NULL, data, delayed_68k_w); | |
| 114 | 114 | logerror("%06X:main write to sound=%04X\n", activecpu_get_previouspc(), data); |
| 115 | 115 | } |
| 116 | 116 |
| r1355 | r1356 | |
|---|---|---|
| 107 | 107 | |
| 108 | 108 | MACHINE_RESET( m72_sound ) |
| 109 | 109 | { |
| 110 | setvector_callback(machine, VECTOR_INIT); | |
| 110 | setvector_callback(machine, NULL, VECTOR_INIT); | |
| 111 | 111 | |
| 112 | 112 | state_save_register_global(irqvector); |
| 113 | 113 | state_save_register_global(sample_addr); |
| r1355 | r1356 | |
| 116 | 116 | void m72_ym2151_irq_handler(int irq) |
| 117 | 117 | { |
| 118 | 118 | if (irq) |
| 119 | timer_call_after_resynch(YM2151_ASSERT,setvector_callback); | |
| 119 | timer_call_after_resynch(NULL, YM2151_ASSERT,setvector_callback); | |
| 120 | 120 | else |
| 121 | timer_call_after_resynch(YM2151_CLEAR,setvector_callback); | |
| 121 | timer_call_after_resynch(NULL, YM2151_CLEAR,setvector_callback); | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | WRITE16_HANDLER( m72_sound_command_w ) |
| r1355 | r1356 | |
| 126 | 126 | if (ACCESSING_LSB) |
| 127 | 127 | { |
| 128 | 128 | soundlatch_w(offset,data); |
| 129 | timer_call_after_resynch(Z80_ASSERT,setvector_callback); | |
| 129 | timer_call_after_resynch(NULL, Z80_ASSERT,setvector_callback); | |
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | WRITE8_HANDLER( m72_sound_command_byte_w ) |
| 134 | 134 | { |
| 135 | 135 | soundlatch_w(offset,data); |
| 136 | timer_call_after_resynch(Z80_ASSERT,setvector_callback); | |
| 136 | timer_call_after_resynch(NULL, Z80_ASSERT,setvector_callback); | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | WRITE8_HANDLER( m72_sound_irq_ack_w ) |
| 140 | 140 | { |
| 141 | timer_call_after_resynch(Z80_CLEAR,setvector_callback); | |
| 141 | timer_call_after_resynch(NULL, Z80_CLEAR,setvector_callback); | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 |
| r1355 | r1356 | |
|---|---|---|
| 125 | 125 | channel = stream_create(0, 1, 18432000 / 3 / 2 / 384, NULL, geebee_sound_update); |
| 126 | 126 | vcount = 0; |
| 127 | 127 | |
| 128 | volume_timer = timer_alloc(volume_decay); | |
| 128 | volume_timer = timer_alloc(volume_decay, NULL); | |
| 129 | 129 | return auto_malloc(1); |
| 130 | 130 | } |
| r1355 | r1356 | |
|---|---|---|
| 579 | 579 | sega005_stream = stream_create(0, 1, SEGA005_COUNTER_FREQ, NULL, sega005_stream_update); |
| 580 | 580 | |
| 581 | 581 | /* 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); | |
| 583 | 583 | |
| 584 | 584 | /* set the initial sound data */ |
| 585 | 585 | sound_data = 0x00; |
| r1355 | r1356 | |
|---|---|---|
| 464 | 464 | |
| 465 | 465 | void williams_cvsd_data_w(int data) |
| 466 | 466 | { |
| 467 | timer_call_after_resynch(data, williams_cvsd_delayed_data_w); | |
| 467 | timer_call_after_resynch(NULL, data, williams_cvsd_delayed_data_w); | |
| 468 | 468 | } |
| 469 | 469 | |
| 470 | 470 |
| r1355 | r1356 | |
|---|---|---|
| 39 | 39 | if ((data & 0x0f) != 8) |
| 40 | 40 | { |
| 41 | 41 | 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); | |
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | 45 |
| r1355 | r1356 | |
|---|---|---|
| 158 | 158 | /* Should be decrementing every data*1024 6532 clock cycles */ |
| 159 | 159 | /* 6532 runs at 1.5 MHz */ |
| 160 | 160 | |
| 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); | |
| 162 | 162 | return; |
| 163 | 163 | |
| 164 | 164 | default: |
| r1355 | r1356 | |
| 195 | 195 | |
| 196 | 196 | WRITE8_HANDLER( starwars_sout_w ) |
| 197 | 197 | { |
| 198 | timer_call_after_resynch(data, sound_callback); | |
| 198 | timer_call_after_resynch(NULL, data, sound_callback); | |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | |
| r1355 | r1356 | |
| 233 | 233 | |
| 234 | 234 | WRITE8_HANDLER( starwars_main_wr_w ) |
| 235 | 235 | { |
| 236 | timer_call_after_resynch(data, main_callback); | |
| 236 | timer_call_after_resynch(NULL, data, main_callback); | |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 |
| r1355 | r1356 | |
|---|---|---|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | /* 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); | |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | WRITE8_HANDLER( gottlieb_speech_clock_DAC_w ) |
| r1355 | r1356 | |
| 209 | 209 | static TIMER_CALLBACK( nmi_callback ); |
| 210 | 210 | void gottlieb_sound_init(void) |
| 211 | 211 | { |
| 212 | nmi_timer = timer_alloc(nmi_callback); | |
| 212 | nmi_timer = timer_alloc(nmi_callback, NULL); | |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | void stooges_sp0250_drq(int level) |
| r1355 | r1356 | |
|---|---|---|
| 891 | 891 | dcs.sounddata_words = dcs.bootrom_words; |
| 892 | 892 | |
| 893 | 893 | /* 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); | |
| 896 | 896 | |
| 897 | 897 | /* non-RAM based automatically acks */ |
| 898 | 898 | dcs.auto_ack = TRUE; |
| 899 | 899 | |
| 900 | 900 | /* reset the system */ |
| 901 | dcs_reset(Machine, 0); | |
| 901 | dcs_reset(Machine, NULL, 0); | |
| 902 | 902 | } |
| 903 | 903 | |
| 904 | 904 | |
| r1355 | r1356 | |
| 942 | 942 | dcs_sram = auto_malloc(0x8000*4); |
| 943 | 943 | |
| 944 | 944 | /* 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); | |
| 948 | 948 | |
| 949 | 949 | /* we don't do auto-ack by default */ |
| 950 | 950 | dcs.auto_ack = FALSE; |
| r1355 | r1356 | |
| 955 | 955 | |
| 956 | 956 | /* allocate a watchdog timer for HLE transfers */ |
| 957 | 957 | if (HLE_TRANSFERS) |
| 958 | transfer.watchdog = timer_alloc(transfer_watchdog_callback); | |
| 958 | transfer.watchdog = timer_alloc(transfer_watchdog_callback, NULL); | |
| 959 | 959 | |
| 960 | 960 | /* reset the system */ |
| 961 | dcs_reset(Machine, 0); | |
| 961 | dcs_reset(Machine, NULL, 0); | |
| 962 | 962 | } |
| 963 | 963 | |
| 964 | 964 | |
| r1355 | r1356 | |
| 1449 | 1449 | logerror("%08x: DCS reset = %d\n", safe_activecpu_get_pc(), state); |
| 1450 | 1450 | |
| 1451 | 1451 | /* just run through the init code again */ |
| 1452 | timer_call_after_resynch(0, dcs_reset); | |
| 1452 | timer_call_after_resynch(NULL, 0, dcs_reset); | |
| 1453 | 1453 | cpunum_set_input_line(dcs.cpunum, INPUT_LINE_RESET, ASSERT_LINE); |
| 1454 | 1454 | } |
| 1455 | 1455 | |
| r1355 | r1356 | |
| 1523 | 1523 | |
| 1524 | 1524 | /* if we are DCS1, set a timer to latch the data */ |
| 1525 | 1525 | 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); | |
| 1527 | 1527 | else |
| 1528 | 1528 | dcs_delayed_data_w(data); |
| 1529 | 1529 | } |
| r1355 | r1356 | |
| 1566 | 1566 | { |
| 1567 | 1567 | if (LOG_DCS_IO) |
| 1568 | 1568 | 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); | |
| 1570 | 1570 | } |
| 1571 | 1571 | |
| 1572 | 1572 | |
| r1355 | r1356 | |
| 1584 | 1584 | |
| 1585 | 1585 | void dcs_ack_w(void) |
| 1586 | 1586 | { |
| 1587 | timer_call_after_resynch(0, delayed_ack_w_callback); | |
| 1587 | timer_call_after_resynch(NULL, 0, delayed_ack_w_callback); | |
| 1588 | 1588 | } |
| 1589 | 1589 | |
| 1590 | 1590 | |
| r1355 | r1356 | |
| 1620 | 1620 | { |
| 1621 | 1621 | if (LOG_DCS_IO) |
| 1622 | 1622 | 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); | |
| 1624 | 1624 | } |
| 1625 | 1625 | |
| 1626 | 1626 | |
| r1355 | r1356 | |
| 2045 | 2045 | /* if the output is full, stall for a usec */ |
| 2046 | 2046 | if (IS_OUTPUT_FULL()) |
| 2047 | 2047 | { |
| 2048 | timer_set(ATTOTIME_IN_USEC(1), param, s1_ack_callback2); | |
| 2048 | timer_set(ATTOTIME_IN_USEC(1), NULL, param, s1_ack_callback2); | |
| 2049 | 2049 | return; |
| 2050 | 2050 | } |
| 2051 | 2051 | output_latch_w(0, 0x000a, 0); |
| r1355 | r1356 | |
| 2057 | 2057 | /* if the output is full, stall for a usec */ |
| 2058 | 2058 | if (IS_OUTPUT_FULL()) |
| 2059 | 2059 | { |
| 2060 | timer_set(ATTOTIME_IN_USEC(1), param, s1_ack_callback1); | |
| 2060 | timer_set(ATTOTIME_IN_USEC(1), NULL, param, s1_ack_callback1); | |
| 2061 | 2061 | return; |
| 2062 | 2062 | } |
| 2063 | 2063 | output_latch_w(0, param, 0); |
| 2064 | 2064 | |
| 2065 | 2065 | /* 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); | |
| 2067 | 2067 | } |
| 2068 | 2068 | |
| 2069 | 2069 | |
| r1355 | r1356 | |
| 2173 | 2173 | |
| 2174 | 2174 | /* if we're done, start a timer to send the response words */ |
| 2175 | 2175 | 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); | |
| 2177 | 2177 | return 1; |
| 2178 | 2178 | } |
| 2179 | 2179 | break; |
| r1355 | r1356 | |
| 2187 | 2187 | /* if the output is full, stall for a usec */ |
| 2188 | 2188 | if (IS_OUTPUT_FULL()) |
| 2189 | 2189 | { |
| 2190 | timer_set(ATTOTIME_IN_USEC(1), param, s2_ack_callback); | |
| 2190 | timer_set(ATTOTIME_IN_USEC(1), NULL, param, s2_ack_callback); | |
| 2191 | 2191 | return; |
| 2192 | 2192 | } |
| 2193 | 2193 | output_latch_w(0, param, 0); |
| r1355 | r1356 | |
| 2275 | 2275 | /* if we're done, start a timer to send the response words */ |
| 2276 | 2276 | if (transfer.state == 0) |
| 2277 | 2277 | { |
| 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); | |
| 2279 | 2279 | timer_adjust(transfer.watchdog, attotime_never, 0, attotime_never); |
| 2280 | 2280 | } |
| 2281 | 2281 | return 1; |
| r1355 | r1356 | |
|---|---|---|
| 420 | 420 | sh6840_LFSR_3 = 0xffffffff; |
| 421 | 421 | |
| 422 | 422 | /* Init 6532 */ |
| 423 | riot_timer = timer_alloc(riot_interrupt); | |
| 423 | riot_timer = timer_alloc(riot_interrupt, NULL); | |
| 424 | 424 | riot_irq_flag = 0; |
| 425 | 425 | riot_timer_irq_enable = 0; |
| 426 | 426 | riot_porta_data = 0xff; |
| r1355 | r1356 | |
|---|---|---|
| 86 | 86 | 0 /* VEE */ |
| 87 | 87 | }; |
| 88 | 88 | |
| 89 | discrete_dac_r1_ladder tank8_dac = | |
| 89 | static discrete_dac_r1_ladder tank8_dac = | |
| 90 | 90 | { |
| 91 | 91 | 1, |
| 92 | 92 | {RES_K(4.7)}, // R89 |
| r1355 | r1356 | |
|---|---|---|
| 882 | 882 | |
| 883 | 883 | MACHINE_START( schaser ) |
| 884 | 884 | { |
| 885 | schaser_effect_555_timer = timer_alloc(schaser_effect_555_cb); | |
| 885 | schaser_effect_555_timer = timer_alloc(schaser_effect_555_cb, NULL); | |
| 886 | 886 | |
| 887 | 887 | machine_start_mw8080bw(machine); |
| 888 | 888 | } |
| r1355 | r1356 | |
|---|---|---|
| 827 | 827 | |
| 828 | 828 | state_save_register_item("cchip", 0, current_bank); |
| 829 | 829 | |
| 830 | timer_pulse(ATTOTIME_IN_HZ(60), 0, cchip_timer); | |
| 830 | timer_pulse(ATTOTIME_IN_HZ(60), NULL, 0, cchip_timer); | |
| 831 | 831 | } |
| r1355 | r1356 | |
|---|---|---|
| 36 | 36 | battles_customio_command_count = 0; |
| 37 | 37 | battles_customio_data = 0; |
| 38 | 38 | battles_sound_played = 0; |
| 39 | nmi_timer = timer_alloc(battles_nmi_generate); | |
| 39 | nmi_timer = timer_alloc(battles_nmi_generate, NULL); | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 |
| r1355 | r1356 | |
|---|---|---|
| 94 | 94 | akiko.cdrom_cmd_resp = 0; |
| 95 | 95 | akiko.cdrom = cdrom_open(get_disk_handle(0)); |
| 96 | 96 | 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); | |
| 99 | 99 | |
| 100 | 100 | /* create the TOC table */ |
| 101 | 101 | if ( akiko.cdrom != NULL && cdrom_get_last_track(akiko.cdrom) ) |
| r1355 | r1356 | |
| 679 | 679 | { |
| 680 | 680 | akiko.cdrom_cmd_start = (akiko.cdrom_cmd_start+3) & 0xff; |
| 681 | 681 | |
| 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 ); | |
| 683 | 683 | |
| 684 | 684 | break; |
| 685 | 685 | } |
| r1355 | r1356 | |
|---|---|---|
| 88 | 88 | /* C1CA-C1CB */ UINT16 timer_duration; |
| 89 | 89 | }; |
| 90 | 90 | |
| 91 | struct | |
| 91 | static struct | |
| 92 | 92 | { |
| 93 | 93 | const UINT8 *rom; // NMK004 data ROM |
| 94 | 94 | UINT8 from_main; // command from main CPU |
| r1355 | r1356 | |
| 1050 | 1050 | void NMK004_init(void) |
| 1051 | 1051 | { |
| 1052 | 1052 | /* 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); | |
| 1054 | 1054 | } |
| 1055 | 1055 | |
| 1056 | 1056 |
| r1355 | r1356 | |
|---|---|---|
| 105 | 105 | WRITE8_HANDLER( bublbobl_sound_command_w ) |
| 106 | 106 | { |
| 107 | 107 | soundlatch_w(offset,data); |
| 108 | timer_call_after_resynch(data,nmi_callback); | |
| 108 | timer_call_after_resynch(NULL, data,nmi_callback); | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | WRITE8_HANDLER( bublbobl_sh_nmi_disable_w ) |
| r1355 | r1356 | |
|---|---|---|
| 84 | 84 | TTL7474_preset_w(1, 0); |
| 85 | 85 | |
| 86 | 86 | /* start a timer to generate interrupts */ |
| 87 | int_timer = timer_alloc(interrupt_timer); | |
| 87 | int_timer = timer_alloc(interrupt_timer, NULL); | |
| 88 | 88 | timer_adjust(int_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero); |
| 89 | 89 | } |
| 90 | 90 |
| r1355 | r1356 | |
|---|---|---|
| 193 | 193 | /* rom-based use a deferred write mechanism */ |
| 194 | 194 | if (asic65_type == ASIC65_ROMBASED) |
| 195 | 195 | { |
| 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); | |
| 197 | 197 | cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(20)); |
| 198 | 198 | return; |
| 199 | 199 | } |
| r1355 | r1356 | |
|---|---|---|
| 507 | 507 | |
| 508 | 508 | static WRITE8_HANDLER( tnzs_sync_kludge_w ) |
| 509 | 509 | { |
| 510 | timer_call_after_resynch(data,kludge_callback); | |
| 510 | timer_call_after_resynch(NULL, data,kludge_callback); | |
| 511 | 511 | } |
| 512 | 512 | |
| 513 | 513 |
| r1355 | r1356 | |
|---|---|---|
| 113 | 113 | gamma_irq_clock = 0; |
| 114 | 114 | |
| 115 | 115 | /* 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); | |
| 117 | 117 | |
| 118 | 118 | state_save_register_item("misc", 0, alpha_data); |
| 119 | 119 | state_save_register_item("misc", 0, alpha_rcvd); |
| r1355 | r1356 | |
| 146 | 146 | cpunum_set_input_line(1, INPUT_LINE_NMI, PULSE_LINE); |
| 147 | 147 | |
| 148 | 148 | /* 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); | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | |
| 153 | 153 | WRITE8_HANDLER( mhavoc_gamma_w ) |
| 154 | 154 | { |
| 155 | 155 | 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); | |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 |
| r1355 | r1356 | |
|---|---|---|
| 258 | 258 | mrulemap = (struct MRULELIST *)byte_ptr; // pointer table to rule lists |
| 259 | 259 | mrulepool = (struct MRULE *)(byte_ptr + 0x4000); // rules pool |
| 260 | 260 | |
| 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 | |
| 262 | 262 | |
| 263 | 263 | seedMT(mame_rand(Machine)); |
| 264 | 264 | } |
| r1355 | r1356 | |
|---|---|---|
| 1657 | 1657 | |
| 1658 | 1658 | tape_dir = 0; |
| 1659 | 1659 | tape_speed = 0; |
| 1660 | tape_timer = timer_alloc(NULL); | |
| 1660 | tape_timer = timer_alloc(NULL, NULL); | |
| 1661 | 1661 | |
| 1662 | 1662 | firsttime = 1; |
| 1663 | 1663 | tape_present = 1; |
| r1355 | r1356 | |
| 1711 | 1711 | |
| 1712 | 1712 | memset(decocass_quadrature_decoder, 0, sizeof(decocass_quadrature_decoder)); |
| 1713 | 1713 | 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); | |
| 1715 | 1715 | } |
| 1716 | 1716 | |
| 1717 | 1717 | MACHINE_RESET( decocass ) |
| r1355 | r1356 | |
|---|---|---|
| 185 | 185 | /* set a callback for the next 32-scanline increment */ |
| 186 | 186 | scanline += 32; |
| 187 | 187 | 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); | |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | static TIMER_CALLBACK( irmb_done_callback ); |
| r1355 | r1356 | |
| 201 | 201 | |
| 202 | 202 | irvg_vblank=0; |
| 203 | 203 | irvg_running = 0; |
| 204 | irvg_timer = timer_alloc(irvg_done_callback); | |
| 204 | irvg_timer = timer_alloc(irvg_done_callback, NULL); | |
| 205 | 205 | irmb_running = 0; |
| 206 | irmb_timer = timer_alloc(irmb_done_callback); | |
| 206 | irmb_timer = timer_alloc(irmb_done_callback, NULL); | |
| 207 | 207 | |
| 208 | 208 | /* 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); | |
| 210 | 210 | |
| 211 | 211 | irobot_rom_banksel_w(0,0); |
| 212 | 212 | irobot_out0_w(0,0); |
| r1355 | r1356 | |
|---|---|---|
| 361 | 361 | battery_ram = auto_malloc(LELAND_BATTERY_RAM_SIZE); |
| 362 | 362 | |
| 363 | 363 | /* start scanline interrupts going */ |
| 364 | master_int_timer = timer_alloc(leland_interrupt_callback); | |
| 364 | master_int_timer = timer_alloc(leland_interrupt_callback, NULL); | |
| 365 | 365 | } |
| 366 | 366 | |
| 367 | 367 | |
| r1355 | r1356 | |
| 414 | 414 | extra_tram = auto_malloc(ATAXX_EXTRA_TRAM_SIZE); |
| 415 | 415 | |
| 416 | 416 | /* start scanline interrupts going */ |
| 417 | master_int_timer = timer_alloc(ataxx_interrupt_callback); | |
| 417 | master_int_timer = timer_alloc(ataxx_interrupt_callback, NULL); | |
| 418 | 418 | } |
| 419 | 419 | |
| 420 | 420 |
| r1355 | r1356 | |
|---|---|---|
| 287 | 287 | |
| 288 | 288 | pic.yearoffs = yearoffs; |
| 289 | 289 | pic.time_just_written = 0; |
| 290 | pic.time_write_timer = timer_alloc(reset_timer); | |
| 290 | pic.time_write_timer = timer_alloc(reset_timer, NULL); | |
| 291 | 291 | memset(pic.default_nvram, 0xff, sizeof(pic.default_nvram)); |
| 292 | 292 | generate_serial_data(upper); |
| 293 | 293 | } |
| r0 | r1356 | |
|---|---|---|
| 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 | ||
| 10 | UINT16 *system24temp_sys16_shared_ram; | |
| 11 | READ16_HANDLER( system24temp_sys16_shared_ram_r ) | |
| 12 | { | |
| 13 | return system24temp_sys16_shared_ram[offset]; | |
| 14 | } | |
| 15 | ||
| 16 | WRITE16_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 | ||
| 27 | static UINT8 (*system24temp_sys16_io_io_r)(int port); | |
| 28 | static void (*system24temp_sys16_io_io_w)(int port, UINT8 data); | |
| 29 | static void (*system24temp_sys16_io_cnt_w)(UINT8 data); | |
| 30 | static READ16_HANDLER ((*system24temp_sys16_io_iod_r)); | |
| 31 | static WRITE16_HANDLER((*system24temp_sys16_io_iod_w)); | |
| 32 | static UINT8 system24temp_sys16_io_cnt, system24temp_sys16_io_dir; | |
| 33 | ||
| 34 | void 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 | ||
| 49 | READ16_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 | ||
| 76 | READ32_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 | ||
| 82 | WRITE16_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 | } |
| r1355 | r1356 | |
|---|---|---|
| 273 | 273 | cd_stat = CD_STAT_OPEN; |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | sector_timer = timer_alloc(sector_cb); | |
| 276 | sector_timer = timer_alloc(sector_cb, NULL); | |
| 277 | 277 | timer_adjust(sector_timer, ATTOTIME_IN_HZ(150), 0, attotime_zero); // 150 sectors / second = 300kBytes/second |
| 278 | 278 | } |
| 279 | 279 |
| r1355 | r1356 | |
|---|---|---|
| 32 | 32 | |
| 33 | 33 | static struct ticket_state dispenser[MAX_DISPENSERS]; |
| 34 | 34 | |
| 35 | static TIMER_CALLBACK | |
| 35 | static TIMER_CALLBACK | |
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | /*************************************************************************** |
| r1355 | r1356 | |
| 53 | 53 | { |
| 54 | 54 | dispenser[i].status = ticketnotdispensed; |
| 55 | 55 | dispenser[i].power = 0x00; |
| 56 | dispenser[i].timer = timer_alloc | |
| 56 | dispenser[i].timer = timer_alloc | |
| 57 | 57 | |
| 58 | 58 | state_save_register_item("ticket", i, dispenser[i].status); |
| 59 | 59 | state_save_register_item("ticket", i, dispenser[i].power); |
| r1355 | r1356 | |
| 102 | 102 | #ifdef DEBUG_TICKET |
| 103 | 103 | logerror("PC: %04X Ticket Power On\n", activecpu_get_pc()); |
| 104 | 104 | #endif |
| 105 | timer_adjust | |
| 105 | timer_adjust | |
| 106 | 106 | dispenser[0].power = 1; |
| 107 | 107 | |
| 108 | 108 | dispenser[0].status = ticketnotdispensed; |
| r1355 | r1356 | |
| 115 | 115 | #ifdef DEBUG_TICKET |
| 116 | 116 | logerror("PC: %04X Ticket Power Off\n", activecpu_get_pc()); |
| 117 | 117 | #endif |
| 118 | timer_adjust | |
| 118 | timer_adjust | |
| 119 | 119 | set_led_status(2,0); |
| 120 | 120 | dispenser[0].power = 0; |
| 121 | 121 | } |
| r1355 | r1356 | |
| 132 | 132 | #ifdef DEBUG_TICKET |
| 133 | 133 | logerror("PC: %04X Ticket Power On\n", activecpu_get_pc()); |
| 134 | 134 | #endif |
| 135 | timer_adjust | |
| 135 | timer_adjust | |
| 136 | 136 | dispenser[1].power = 1; |
| 137 | 137 | |
| 138 | 138 | dispenser[1].status = ticketnotdispensed; |
| r1355 | r1356 | |
| 145 | 145 | #ifdef DEBUG_TICKET |
| 146 | 146 | logerror("PC: %04X Ticket Power Off\n", activecpu_get_pc()); |
| 147 | 147 | #endif |
| 148 | timer_adjust | |
| 148 | timer_adjust | |
| 149 | 149 | set_led_status(2,0); |
| 150 | 150 | dispenser[1].power = 0; |
| 151 | 151 | } |
| r1355 | r1356 | |
| 160 | 160 | When a ticket dispenses, there is N milliseconds of status = high, |
| 161 | 161 | and N milliseconds of status = low (a wait cycle?). |
| 162 | 162 | ***************************************************************************/ |
| 163 | static TIMER_CALLBACK | |
| 163 | static TIMER_CALLBACK | |
| 164 | 164 | { |
| 165 | struct ticket_state *dispenser = p | |
| 165 | struct ticket_state *dispenser = ptr | |
| 166 | 166 | |
| 167 | 167 | /* If we still have power, keep toggling ticket states. */ |
| 168 | 168 | if (dispenser->power) |
| r1355 | r1356 | |
| 171 | 171 | #ifdef DEBUG_TICKET |
| 172 | 172 | logerror("Ticket Status Changed to %02X\n", status); |
| 173 | 173 | #endif |
| 174 | timer_adjust | |
| 174 | timer_adjust | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | if (dispenser->status == ticketdispensed) |
| r1355 | r1356 | |
|---|---|---|
| 794 | 794 | if (chipnum < MAX_NAMCOIO && state != CLEAR_LINE && !io[chipnum].reset) |
| 795 | 795 | { |
| 796 | 796 | /* 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); | |
| 798 | 798 | } |
| 799 | 799 | } |
| 800 | 800 | |
| r1355 | r1356 | |
| 876 | 876 | namcoio_init(4*chipnum + 2, type2, intf2); |
| 877 | 877 | namcoio_init(4*chipnum + 3, type3, intf3); |
| 878 | 878 | nmi_cpu[chipnum] = cpu; |
| 879 | nmi_timer[chipnum] = timer_alloc(nmi_generate); | |
| 879 | nmi_timer[chipnum] = timer_alloc(nmi_generate, NULL); | |
| 880 | 880 | namco_06xx_state_save(chipnum); |
| 881 | 881 | } |
| 882 | 882 | } |
| r1355 | r1356 | |
|---|---|---|
| 28 | 28 | |
| 29 | 29 | READ8_HANDLER( pitnrun_mcu_data_r ) |
| 30 | 30 | { |
| 31 | timer_call_after_resynch(0,pitnrun_mcu_real_data_r); | |
| 31 | timer_call_after_resynch(NULL, 0,pitnrun_mcu_real_data_r); | |
| 32 | 32 | return toz80; |
| 33 | 33 | } |
| 34 | 34 | |
| r1355 | r1356 | |
| 41 | 41 | |
| 42 | 42 | WRITE8_HANDLER( pitnrun_mcu_data_w ) |
| 43 | 43 | { |
| 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)); | |
| 45 | 46 | } |
| 46 | 47 | |
| 47 | 48 | READ8_HANDLER( pitnrun_mcu_status_r ) |
| 48 | 49 | { |
| 49 | 50 | /* mcu synchronization */ |
| 50 | cpu_yielduntil_time (ATTOTIME_IN_USEC(5)); | |
| 51 | 51 | /* bit 0 = the 68705 has read data from the Z80 */ |
| 52 | 52 | /* bit 1 = the 68705 has written data for the Z80 */ |
| 53 | 53 | return ~((zready << 1) | (zaccept << 0)); |
| r1355 | r1356 | |
| 108 | 108 | if (~data & 0x02) |
| 109 | 109 | { |
| 110 | 110 | /* 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); | |
| 112 | 112 | cpunum_set_input_line(2,0,CLEAR_LINE); |
| 113 | 113 | portA_in = fromz80; |
| 114 | 114 | } |
| 115 | 115 | if (~data & 0x04) |
| 116 | 116 | { |
| 117 | 117 | /* 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); | |
| 119 | 119 | } |
| 120 | 120 | if (~data & 0x10) |
| 121 | 121 | { |
| r1355 | r1356 | |
|---|---|---|
| 2 | 2 | |
| 3 | 3 | #include "driver.h" |
| 4 | 4 | #include "cpu/mips/mips3.h" |
| 5 | #include "cpu/rsp/rsp.h" | |
| 6 | 5 | #include "sound/custom.h" |
| 7 | 6 | #include "streams.h" |
| 8 | 7 | #include "includes/n64.h" |
| r1355 | r1356 | |
| 225 | 224 | |
| 226 | 225 | |
| 227 | 226 | |
| 228 | void sp_set_status(UINT32 status) | |
| 227 | static void sp_set_status(UINT32 status) | |
| 229 | 228 | { |
| 230 | 229 | if (status & 0x1) |
| 231 | 230 | { |
| r1355 | r1356 | |
| 499 | 498 | } |
| 500 | 499 | } |
| 501 | 500 | |
| 502 | UINT32 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 | ||
| 511 | void 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 | ||
| 519 | 501 | // RDP Interface |
| 520 | 502 | UINT32 dp_start; |
| 521 | 503 | UINT32 dp_end; |
| r1355 | r1356 | |
| 582 | 564 | } |
| 583 | 565 | |
| 584 | 566 | |
| 567 | rsp_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 | }; | |
| 585 | 575 | |
| 576 | ||
| 586 | 577 | // Video Interface |
| 587 | 578 | static UINT32 vi_width; |
| 588 | 579 | UINT32 vi_origin; |
| r1355 | r1356 | |
| 1059 | 1050 | // Serial Interface |
| 1060 | 1051 | static UINT8 pif_ram[0x40]; |
| 1061 | 1052 | static UINT8 pif_cmd[0x40]; |
| 1062 | UINT32 si_dram_addr = 0; | |
| 1063 | UINT32 si_pif_addr = 0; | |
| 1064 | UINT32 si_status = 0; | |
| 1053 | static UINT32 si_dram_addr = 0; | |
| 1054 | static UINT32 si_pif_addr = 0; | |
| 1055 | static UINT32 si_status = 0; | |
| 1065 | 1056 | |
| 1066 | 1057 | static UINT8 eeprom[512]; |
| 1067 | 1058 | static UINT8 mempack[0x8000]; |
| r1355 | r1356 | |
| 1517 | 1508 | } |
| 1518 | 1509 | } |
| 1519 | 1510 | |
| 1520 | UINT32 cic_status = 0x00000000; | |
| 1511 | static UINT32 cic_status = 0x00000000; | |
| 1521 | 1512 | |
| 1522 | 1513 | READ32_HANDLER( n64_pif_ram_r ) |
| 1523 | 1514 | { |
| r1355 | r1356 | |
| 1576 | 1567 | cpunum_set_info_ptr(0, CPUINFO_PTR_MIPS3_FASTRAM_BASE, rdram); |
| 1577 | 1568 | cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_READONLY, 0); |
| 1578 | 1569 | |
| 1579 | audio_timer = timer_alloc(audio_timer_callback); | |
| 1570 | audio_timer = timer_alloc(audio_timer_callback, NULL); | |
| 1580 | 1571 | timer_adjust(audio_timer, attotime_never, 0, attotime_never); |
| 1581 | 1572 | |
| 1582 | 1573 | cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE); |
| r1355 | r1356 | |
|---|---|---|
| 108 | 108 | { |
| 109 | 109 | // Do a RST10 |
| 110 | 110 | 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); | |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | /* |
| r1355 | r1356 | |
|---|---|---|
| 204 | 204 | st->txd[0] = st->portHandler ? st->portHandler(0) : 0; |
| 205 | 205 | if( sst ) |
| 206 | 206 | { |
| 207 | timer_call_after_resynch(num,taito8741_serial_tx); | |
| 207 | timer_call_after_resynch(NULL, num, taito8741_serial_tx); | |
| 208 | 208 | st->serial_out = 0; |
| 209 | 209 | st->status |= 0x04; |
| 210 | 210 | st->phase = CMD_08; |
| r1355 | r1356 | |
| 445 | 445 | if( (i8741[num].sts & 0x02) ) |
| 446 | 446 | { |
| 447 | 447 | /* 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); | |
| 449 | 449 | } |
| 450 | 450 | } |
| 451 | 451 |
| r1355 | r1356 | |
|---|---|---|
| 283 | 283 | }; |
| 284 | 284 | |
| 285 | 285 | |
| 286 | static TIMER_CALLBACK( timer_callback ) | |
| 286 | static TIMER_CALLBACK( volfied_timer_callback ) | |
| 287 | 287 | { |
| 288 | 288 | // Palette commands - palette data written to bank 0: $10 - $af |
| 289 | 289 | if (current_cmd>=0x1 && current_cmd<0x12) |
| r1355 | r1356 | |
| 392 | 392 | // Palette request cmd - verified to take around 122242 68000 cycles to complete |
| 393 | 393 | if (current_cmd >= 0x1 && current_cmd < 0x12) |
| 394 | 394 | { |
| 395 | timer_set(ATTOTIME_IN_CYCLES(122242,0), 0, timer_callback); | |
| 395 | timer_set(ATTOTIME_IN_CYCLES(122242,0), NULL, 0, volfied_timer_callback); | |
| 396 | 396 | } |
| 397 | 397 | // Unknown cmd - verified to take around 105500 68000 cycles to complete |
| 398 | 398 | else if (current_cmd >= 0x81 && current_cmd < 0x92) |
| 399 | 399 | { |
| 400 | timer_set(ATTOTIME_IN_CYCLES(105500,0), 0, timer_callback); | |
| 400 | timer_set(ATTOTIME_IN_CYCLES(105500,0), NULL, 0, volfied_timer_callback); | |
| 401 | 401 | } |
| 402 | 402 | else |
| 403 | 403 | { |
| r1355 | r1356 | |
|---|---|---|
| 119 | 119 | cpunum_set_input_line(0, M6809_IRQ_LINE, ASSERT_LINE); |
| 120 | 120 | |
| 121 | 121 | /* 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); | |
| 123 | 123 | |
| 124 | 124 | /* if this is Grudge Match, update the steering */ |
| 125 | 125 | if (grudge_steering_result & 0x80) |
| r1355 | r1356 | |
| 155 | 155 | |
| 156 | 156 | /* reset counters; counter 2's gate is tied high */ |
| 157 | 157 | 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); | |
| 160 | 160 | counter[2].gate = 1; |
| 161 | 161 | |
| 162 | 162 | /* reset the manual counter 0 clock */ |
| 163 | 163 | counter_control = 0x00; |
| 164 | 164 | 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); | |
| 166 | 166 | counter_0_timer_active = 0; |
| 167 | 167 | |
| 168 | 168 | /* reset the ADC states */ |
| r1355 | r1356 | |
| 191 | 191 | memory_set_bank(2, 0); |
| 192 | 192 | |
| 193 | 193 | /* start a timer to generate interrupts */ |
| 194 | scanline_timer = timer_alloc(interrupt_timer); | |
| 194 | scanline_timer = timer_alloc(interrupt_timer, NULL); | |
| 195 | 195 | timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero); |
| 196 | 196 | |
| 197 | 197 | /* register for saving */ |
| r1355 | r1356 | |
| 525 | 525 | |
| 526 | 526 | /* set a timer for 500usec later to actually transmit the data */ |
| 527 | 527 | /* (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); | |
| 529 | 529 | } |
| 530 | 530 | |
| 531 | 531 | |
| r1355 | r1356 | |
| 542 | 542 | |
| 543 | 543 | /* output register is at offset 1; set a timer to synchronize the CPUs */ |
| 544 | 544 | else |
| 545 | timer_call_after_resynch(data, m6850_w_callback); | |
| 545 | timer_call_after_resynch(NULL, data, m6850_w_callback); | |
| 546 | 546 | } |
| 547 | 547 | |
| 548 | 548 | |
| r1355 | r1356 | |
| 661 | 661 | /* set a timer to go off and read the value after 50us */ |
| 662 | 662 | /* it's important that we do this for Mini Golf */ |
| 663 | 663 | logerror("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); | |
| 665 | 665 | } |
| 666 | 666 | |
| 667 | 667 | |
| r1355 | r1356 | |
| 909 | 909 | { |
| 910 | 910 | counter[0].count--; |
| 911 | 911 | if (counter[0].count == 0) |
| 912 | counter_callback(machine, 0); | |
| 912 | counter_callback(machine, NULL, 0); | |
| 913 | 913 | } |
| 914 | 914 | } |
| 915 | 915 |
| r1355 | r1356 | |
|---|---|---|
| 271 | 271 | INTERRUPT_GEN( qix_vblank_start ) |
| 272 | 272 | { |
| 273 | 273 | 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); | |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | |
| r1355 | r1356 | |
| 372 | 372 | static WRITE8_HANDLER( sync_pia_4_porta_w ) |
| 373 | 373 | { |
| 374 | 374 | /* 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); | |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | |
| r1355 | r1356 | |
| 519 | 519 | { |
| 520 | 520 | /* make all the CPUs synchronize, and only AFTER that write the command to the PIA */ |
| 521 | 521 | /* 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); | |
| 523 | 523 | } |
| 524 | 524 | |
| 525 | 525 |
| r1355 | r1356 | |
|---|---|---|
| 318 | 318 | snes_ram[VMAIN] = 0x80; |
| 319 | 319 | |
| 320 | 320 | /* init timers and stop them */ |
| 321 | snes_scanline_timer = timer_alloc(snes_scanline_tick); | |
| 321 | snes_scanline_timer = timer_alloc(snes_scanline_tick, NULL); | |
| 322 | 322 | 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); | |
| 324 | 324 | 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); | |
| 326 | 326 | 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); | |
| 328 | 328 | timer_adjust(snes_hirq_timer, attotime_never, 0, attotime_never); |
| 329 | 329 | |
| 330 | 330 | // SNES hcounter has a 0-339 range. hblank starts at counter 260. |
| r1355 | r1356 | |
|---|---|---|
| 132 | 132 | #if DEBUG_MCU |
| 133 | 133 | logerror("%04x: protection write %02x\n",activecpu_get_pc(),data); |
| 134 | 134 | #endif |
| 135 | timer_call_after_resynch(data,taitosj_mcu_real_data_w); | |
| 135 | timer_call_after_resynch(NULL, data,taitosj_mcu_real_data_w); | |
| 136 | 136 | /* temporarily boost the interleave to sync things up */ |
| 137 | 137 | cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(10)); |
| 138 | 138 | } |
| r1355 | r1356 | |
| 218 | 218 | if (~data & 0x02) |
| 219 | 219 | { |
| 220 | 220 | /* 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); | |
| 222 | 222 | cpunum_set_input_line(2,0,CLEAR_LINE); |
| 223 | 223 | portA_in = fromz80; |
| 224 | 224 | #if DEBUG_MCU |
| r1355 | r1356 | |
| 235 | 235 | logerror("%04x: 68705 -> Z80 %02x\n",activecpu_get_pc(),portA_out); |
| 236 | 236 | #endif |
| 237 | 237 | /* 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); | |
| 239 | 239 | } |
| 240 | 240 | if (~data & 0x10) |
| 241 | 241 | { |
| r1355 | r1356 | |
|---|---|---|
| 293 | 293 | cia_config(1, &cia_intf[1]); |
| 294 | 294 | |
| 295 | 295 | /* 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); | |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | |
| r1355 | r1356 | |
| 1308 | 1308 | if (amiga_intf->serdat_w != NULL) |
| 1309 | 1309 | (*amiga_intf->serdat_w)(data); |
| 1310 | 1310 | 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); | |
| 1312 | 1312 | break; |
| 1313 | 1313 | |
| 1314 | 1314 | case REG_BLTSIZE: |
| r1355 | r1356 | |
|---|---|---|
| 174 | 174 | WRITE16_HANDLER( vertigo_audio_w ) |
| 175 | 175 | { |
| 176 | 176 | if (ACCESSING_LSB) |
| 177 | timer_call_after_resynch(data & 0xff, sound_command_w); | |
| 177 | timer_call_after_resynch(NULL, data & 0xff, sound_command_w); | |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | READ16_HANDLER( vertigo_sio_r ) |
| r1355 | r1356 | |
|---|---|---|
| 503 | 503 | pc_page_offset_mask = 0x0F0000; |
| 504 | 504 | } |
| 505 | 505 | |
| 506 | pc_keyboard_timer = timer_alloc(pc_keyb_timer); | |
| 506 | pc_keyboard_timer = timer_alloc(pc_keyb_timer, NULL); | |
| 507 | 507 | } |
| 508 | 508 | |
| 509 | 509 | /* |
| r1355 | r1356 | |
|---|---|---|
| 143 | 143 | |
| 144 | 144 | /* create timers */ |
| 145 | 145 | 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); | |
| 147 | 147 | |
| 148 | 148 | /* create a timer for scanlines */ |
| 149 | scanline_interrupt_timer = timer_alloc(scanline_interrupt_callback); | |
| 149 | scanline_interrupt_timer = timer_alloc(scanline_interrupt_callback, NULL); | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | |
| r1355 | r1356 | |
| 595 | 595 | |
| 596 | 596 | WRITE16_HANDLER( atarigen_sound_reset_w ) |
| 597 | 597 | { |
| 598 | timer_call_after_resynch(0, delayed_sound_reset); | |
| 598 | timer_call_after_resynch(NULL, 0, delayed_sound_reset); | |
| 599 | 599 | } |
| 600 | 600 | |
| 601 | 601 | |
| r1355 | r1356 | |
| 606 | 606 | |
| 607 | 607 | void atarigen_sound_reset(void) |
| 608 | 608 | { |
| 609 | timer_call_after_resynch(1, delayed_sound_reset); | |
| 609 | timer_call_after_resynch(NULL, 1, delayed_sound_reset); | |
| 610 | 610 | } |
| 611 | 611 | |
| 612 | 612 | |
| r1355 | r1356 | |
| 620 | 620 | WRITE16_HANDLER( atarigen_sound_w ) |
| 621 | 621 | { |
| 622 | 622 | if (ACCESSING_LSB) |
| 623 | timer_call_after_resynch(data & 0xff, delayed_sound_w); | |
| 623 | timer_call_after_resynch(NULL, data & 0xff, delayed_sound_w); | |
| 624 | 624 | } |
| 625 | 625 | |
| 626 | 626 | WRITE16_HANDLER( atarigen_sound_upper_w ) |
| 627 | 627 | { |
| 628 | 628 | 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); | |
| 630 | 630 | } |
| 631 | 631 | |
| 632 | 632 | WRITE32_HANDLER( atarigen_sound_upper32_w ) |
| 633 | 633 | { |
| 634 | 634 | 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); | |
| 636 | 636 | } |
| 637 | 637 | |
| 638 | 638 | |
| r1355 | r1356 | |
| 672 | 672 | |
| 673 | 673 | WRITE8_HANDLER( atarigen_6502_sound_w ) |
| 674 | 674 | { |
| 675 | timer_call_after_resynch(data, delayed_6502_sound_w); | |
| 675 | timer_call_after_resynch(NULL, data, delayed_6502_sound_w); | |
| 676 | 676 | } |
| 677 | 677 | |
| 678 | 678 | |
| r1355 | r1356 | |
| 936 | 936 | atarivc_state.latch1 = atarivc_state.latch2 = -1; |
| 937 | 937 | actual_vc_latch0 = actual_vc_latch1 = -1; |
| 938 | 938 | |
| 939 | atarivc_eof_update_timer[scrnum] = timer_alloc(atarivc_eof_update); | |
| 939 | atarivc_eof_update_timer[scrnum] = timer_alloc(atarivc_eof_update, NULL); | |
| 940 | 940 | |
| 941 | 941 | /* start a timer to go off a little before scanline 0 */ |
| 942 | 942 | if (atarivc_eof_data) |
| r1355 | r1356 | |
| 1297 | 1297 | |
| 1298 | 1298 | /* halt and set a timer to wake up */ |
| 1299 | 1299 | 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); | |
| 1301 | 1301 | cpunum_set_input_line(0, INPUT_LINE_HALT, ASSERT_LINE); |
| 1302 | 1302 | } |
| 1303 | 1303 |
| r1355 | r1356 | |
|---|---|---|
| 278 | 278 | int temp = midwunit_sound_state_r(0, 0); |
| 279 | 279 | result |= (temp & 0x800) >> 9; |
| 280 | 280 | result |= (~temp & 0x400) >> 10; |
| 281 | timer_call_after_resynch(0, 0); | |
| 281 | timer_call_after_resynch(NULL, 0, 0); | |
| 282 | 282 | } |
| 283 | 283 | break; |
| 284 | 284 | |
| r1355 | r1356 | |
| 305 | 305 | int temp = midwunit_sound_state_r(0, 0); |
| 306 | 306 | result |= (temp & 0x800) >> 11; |
| 307 | 307 | result |= (~temp & 0x400) >> 8; |
| 308 | timer_call_after_resynch(0, 0); | |
| 308 | timer_call_after_resynch(NULL, 0, 0); | |
| 309 | 309 | } |
| 310 | 310 | break; |
| 311 | 311 |
| r1355 | r1356 | |
|---|---|---|
| 665 | 665 | if( IsSystem21()==0 && namcos2_68k_master_C148[NAMCOS2_C148_POSIRQ] ) |
| 666 | 666 | { |
| 667 | 667 | 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 ); | |
| 669 | 669 | } |
| 670 | 670 | cpunum_set_input_line( CPU_MASTER, namcos2_68k_master_C148[NAMCOS2_C148_VBLANKIRQ], HOLD_LINE); |
| 671 | 671 | } |
| r1355 | r1356 | |
| 681 | 681 | if( IsSystem21()==0 && namcos2_68k_slave_C148[NAMCOS2_C148_POSIRQ] ) |
| 682 | 682 | { |
| 683 | 683 | 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 ); | |
| 685 | 685 | } |
| 686 | 686 | cpunum_set_input_line( CPU_SLAVE, namcos2_68k_slave_C148[NAMCOS2_C148_VBLANKIRQ], HOLD_LINE); |
| 687 | 687 | } |
| r1355 | r1356 | |
| 699 | 699 | if( namcos2_68k_gpu_C148[NAMCOS2_C148_POSIRQ] ) |
| 700 | 700 | { |
| 701 | 701 | 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 ); | |
| 703 | 703 | } |
| 704 | 704 | cpunum_set_input_line( CPU_GPU, namcos2_68k_gpu_C148[NAMCOS2_C148_VBLANKIRQ], HOLD_LINE); |
| 705 | 705 | } |
| r1355 | r1356 | |
|---|---|---|
| 266 | 266 | // The input clock to the 06XX interface chip is 64H, that is |
| 267 | 267 | // 18432000/6/64 = 48kHz, so it makes sense for the irq line to be |
| 268 | 268 | // 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); | |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | void namco_50xx_write(UINT8 data) |
| r1355 | r1356 | |
| 276 | 276 | if (cpunum == -1) |
| 277 | 277 | return; |
| 278 | 278 | |
| 279 | timer_call_after_resynch(data, namco_50xx_latch_callback); | |
| 279 | timer_call_after_resynch(NULL, data, namco_50xx_latch_callback); | |
| 280 | 280 | |
| 281 | 281 | namco_50xx_irq_set(cpunum); |
| 282 | 282 | } |
| r1355 | r1356 | |
| 288 | 288 | if (cpunum == -1) |
| 289 | 289 | return; |
| 290 | 290 | |
| 291 | timer_call_after_resynch(data, namco_50xx_2_latch_callback); | |
| 291 | timer_call_after_resynch(NULL, data, namco_50xx_2_latch_callback); | |
| 292 | 292 | |
| 293 | 293 | namco_50xx_irq_set(cpunum); |
| 294 | 294 | } |
| r1355 | r1356 | |
| 301 | 301 | if (cpunum == -1) |
| 302 | 302 | return; |
| 303 | 303 | |
| 304 | timer_call_after_resynch(0, namco_50xx_readrequest_callback); | |
| 304 | timer_call_after_resynch(NULL, 0, namco_50xx_readrequest_callback); | |
| 305 | 305 | |
| 306 | 306 | namco_50xx_irq_set(cpunum); |
| 307 | 307 | } |
| r1355 | r1356 | |
| 313 | 313 | if (cpunum == -1) |
| 314 | 314 | return; |
| 315 | 315 | |
| 316 | timer_call_after_resynch(0, namco_50xx_2_readrequest_callback); | |
| 316 | timer_call_after_resynch(NULL, 0, namco_50xx_2_readrequest_callback); | |
| 317 | 317 | |
| 318 | 318 | namco_50xx_irq_set(cpunum); |
| 319 | 319 | } |
| r1355 | r1356 | |
|---|---|---|
| 61 | 61 | static UINT8 v493_irq_state; |
| 62 | 62 | static UINT8 v493_irq_vector; |
| 63 | 63 | |
| 64 | static | |
| 64 | static t | |
| 65 | 65 | |
| 66 | 66 | static UINT8 zwackery_sound_data; |
| 67 | 67 | |
| r1355 | r1356 | |
| 290 | 290 | z80sio_init(0, &nflfoot_sio_intf); |
| 291 | 291 | |
| 292 | 292 | /* 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); | |
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | |
| r1355 | r1356 | |
| 319 | 319 | { |
| 320 | 320 | struct counter_state *m6840 = &m6840_state[i]; |
| 321 | 321 | |
| 322 | m6840->timer = timer_alloc(counter_fired_callback); | |
| 322 | m6840->timer = timer_alloc(counter_fired_callback, NULL); | |
| 323 | 323 | |
| 324 | 324 | state_save_register_item("m6840", i, m6840->control); |
| 325 | 325 | state_save_register_item("m6840", i, m6840->latch); |
| r1355 | r1356 | |
| 459 | 459 | /* also set a timer to generate the 493 signal at a specific time before the next VBLANK */ |
| 460 | 460 | /* the timing of this is crucial for Blasted and Tri-Sports, which check the timing of */ |
| 461 | 461 | /* 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); | |
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | |
| r1355 | r1356 | |
| 499 | 499 | { |
| 500 | 500 | v493_irq_state = 1; |
| 501 | 501 | 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); | |
| 503 | 503 | logerror("--- (INT1) ---\n"); |
| 504 | 504 | } |
| 505 | 505 | |
| r1355 | r1356 | |
| 620 | 620 | static TIMER_CALLBACK( zwackery_493_callback ) |
| 621 | 621 | { |
| 622 | 622 | 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); | |
| 624 | 624 | } |
| 625 | 625 | |
| 626 | 626 |
| r1355 | r1356 | |
|---|---|---|
| 60 | 60 | |
| 61 | 61 | WRITE8_HANDLER( arkanoid_Z80_mcu_w ) |
| 62 | 62 | { |
| 63 | timer_call_after_resynch(data, test); | |
| 63 | timer_call_after_resynch(NULL, data, test); | |
| 64 | 64 | /* boost the interleave for a few usecs to make sure it is read successfully */ |
| 65 | 65 | cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(10)); |
| 66 | 66 | } |
| r1355 | r1356 | |
|---|---|---|
| 63 | 63 | |
| 64 | 64 | timer_period = attotime_mul(ATTOTIME_IN_HZ(44100), 128); // roughly 2.9us |
| 65 | 65 | |
| 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); | |
| 67 | 67 | timer_adjust(K056800_sound_cpu_timer, timer_period, 0, timer_period); |
| 68 | 68 | } |
| 69 | 69 |
| r1355 | r1356 | |
|---|---|---|
| 527 | 527 | |
| 528 | 528 | WRITE8_HANDLER( slikshot_z80_control_w ) |
| 529 | 529 | { |
| 530 | timer_call_after_resynch(data, delayed_z80_control_w); | |
| 530 | timer_call_after_resynch(NULL, data, delayed_z80_control_w); | |
| 531 | 531 | } |
| 532 | 532 | |
| 533 | 533 |
| r1355 | r1356 | |
|---|---|---|
| 200 | 200 | memset(duart_read_data, 0, sizeof(duart_read_data)); |
| 201 | 201 | memset(duart_write_data, 0, sizeof(duart_write_data)); |
| 202 | 202 | duart_output_port = 0; |
| 203 | duart_timer = timer_alloc(duart_callback); | |
| 203 | duart_timer = timer_alloc(duart_callback, NULL); | |
| 204 | 204 | |
| 205 | 205 | /* reset the ADSP/DSIII/DSIV boards */ |
| 206 | 206 | adsp_halt = 1; |
| r1355 | r1356 | |
| 783 | 783 | |
| 784 | 784 | /* if being written from the 68000, synchronize on it */ |
| 785 | 785 | 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); | |
| 787 | 787 | |
| 788 | 788 | /* otherwise, just update */ |
| 789 | 789 | else |
| r1355 | r1356 | |
| 871 | 871 | if (offset == 0x1fff) |
| 872 | 872 | { |
| 873 | 873 | 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); | |
| 875 | 875 | cpu_triggerint(hdcpu_adsp); |
| 876 | 876 | } |
| 877 | 877 | else |
| r1355 | r1356 | |
| 974 | 974 | |
| 975 | 975 | case 3: |
| 976 | 976 | 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); | |
| 978 | 978 | break; |
| 979 | 979 | |
| 980 | 980 | case 5: |
| r1355 | r1356 | |
| 1571 | 1571 | COMBINE_DATA(&newdata); |
| 1572 | 1572 | dataptr[next_msp_sync % MAX_MSP_SYNC] = dptr; |
| 1573 | 1573 | 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); | |
| 1575 | 1575 | } |
| 1576 | 1576 | else |
| 1577 | 1577 | COMBINE_DATA(&rddsp32_sync[0][offset]); |
| r1355 | r1356 | |
| 1587 | 1587 | COMBINE_DATA(&newdata); |
| 1588 | 1588 | dataptr[next_msp_sync % MAX_MSP_SYNC] = dptr; |
| 1589 | 1589 | 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); | |
| 1591 | 1591 | } |
| 1592 | 1592 | else |
| 1593 | 1593 | COMBINE_DATA(&rddsp32_sync[1][offset]); |
| r1355 | r1356 | |
|---|---|---|
| 1563 | 1563 | |
| 1564 | 1564 | for( n = 0; n < 7; n++ ) |
| 1565 | 1565 | { |
| 1566 | m_p_timer_dma[ n ] = timer_alloc( dma_finished_callback ); | |
| 1566 | m_p_timer_dma[ n ] = timer_alloc( dma_finished_callback , NULL); | |
| 1567 | 1567 | m_p_fn_dma_read[ n ] = NULL; |
| 1568 | 1568 | m_p_fn_dma_write[ n ] = NULL; |
| 1569 | 1569 | } |
| 1570 | 1570 | |
| 1571 | 1571 | for( n = 0; n < 3; n++ ) |
| 1572 | 1572 | { |
| 1573 | m_p_timer_root[ n ] = timer_alloc( root_finished ); | |
| 1573 | m_p_timer_root[ n ] = timer_alloc( root_finished , NULL); | |
| 1574 | 1574 | } |
| 1575 | 1575 | |
| 1576 | 1576 | for( n = 0; n < 2; n++ ) |
| 1577 | 1577 | { |
| 1578 | m_p_timer_sio[ n ] = timer_alloc( sio_clock ); | |
| 1578 | m_p_timer_sio[ n ] = timer_alloc( sio_clock , NULL); | |
| 1579 | 1579 | } |
| 1580 | 1580 | |
| 1581 | 1581 | for( n = 0; n < 256; n++ ) |
| r1355 | r1356 | |
|---|---|---|
| 483 | 483 | if (i8751_timer) |
| 484 | 484 | logerror("i8751: Missed a timer!!!\n"); |
| 485 | 485 | else |
| 486 | i8751_timer = timer_call_after_resynch(0, i8751_callback);*/ | |
| 486 | i8751_timer = timer_call_after_resynch(NULL, 0, i8751_callback);*/ | |
| 487 | 487 | |
| 488 | 488 | /* There is a timing problem in Heavy Barrel if the processing time is not |
| 489 | 489 | simulated - if the interrupt is triggered straight away then HB will reset |
| r1355 | r1356 | |
|---|---|---|
| 41 | 41 | lsasquad_sound_pending |= 0x01; |
| 42 | 42 | sound_cmd = data; |
| 43 | 43 | //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); | |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | READ8_HANDLER( lsasquad_sh_sound_command_r ) |
| r1355 | r1356 | |
|---|---|---|
| 274 | 274 | pia_1_ca1_w(0, 1); |
| 275 | 275 | |
| 276 | 276 | /* 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); | |
| 278 | 278 | |
| 279 | 279 | /* set a timer for next frame */ |
| 280 | 280 | timer_adjust(scan240_timer, video_screen_get_time_until_pos(0, 240, 0), 0, attotime_zero); |
| r1355 | r1356 | |
| 318 | 318 | ticket_dispenser_init(70, TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH); |
| 319 | 319 | |
| 320 | 320 | /* 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); | |
| 322 | 322 | timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero); |
| 323 | 323 | |
| 324 | 324 | /* 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); | |
| 326 | 326 | timer_adjust(scan240_timer, video_screen_get_time_until_pos(0, 240, 0), 0, attotime_zero); |
| 327 | 327 | |
| 328 | 328 | state_save_register_global(vram_bank); |
| r1355 | r1356 | |
| 377 | 377 | pia_0_ca1_w(0, 0); |
| 378 | 378 | |
| 379 | 379 | /* 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); | |
| 381 | 381 | |
| 382 | 382 | /* set a timer for next frame */ |
| 383 | 383 | timer_adjust(scan254_timer, video_screen_get_time_until_pos(0, 254, 0), 0, attotime_zero); |
| r1355 | r1356 | |
| 410 | 410 | williams2_bank_select_w(0, 0); |
| 411 | 411 | |
| 412 | 412 | /* 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); | |
| 414 | 414 | timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero); |
| 415 | 415 | |
| 416 | 416 | /* 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); | |
| 418 | 418 | timer_adjust(scan254_timer, video_screen_get_time_until_pos(0, 254, 0), 0, attotime_zero); |
| 419 | 419 | |
| 420 | 420 | state_save_register_global(vram_bank); |
| r1355 | r1356 | |
| 490 | 490 | WRITE8_HANDLER( williams_snd_cmd_w ) |
| 491 | 491 | { |
| 492 | 492 | /* 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); | |
| 494 | 494 | } |
| 495 | 495 | |
| 496 | 496 | WRITE8_HANDLER( playball_snd_cmd_w ) |
| 497 | 497 | { |
| 498 | timer_call_after_resynch(data, williams_deferred_snd_cmd_w); | |
| 498 | timer_call_after_resynch(NULL, data, williams_deferred_snd_cmd_w); | |
| 499 | 499 | } |
| 500 | 500 | |
| 501 | 501 | |
| r1355 | r1356 | |
| 506 | 506 | |
| 507 | 507 | static WRITE8_HANDLER( williams2_snd_cmd_w ) |
| 508 | 508 | { |
| 509 | timer_call_after_resynch(data, williams2_deferred_snd_cmd_w); | |
| 509 | timer_call_after_resynch(NULL, data, williams2_deferred_snd_cmd_w); | |
| 510 | 510 | } |
| 511 | 511 | |
| 512 | 512 | |
| r1355 | r1356 | |
| 915 | 915 | { |
| 916 | 916 | joust2_current_sound_data = (joust2_current_sound_data & ~0xff) | (data & 0xff); |
| 917 | 917 | 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); | |
| 919 | 919 | } |
| r1355 | r1356 | |
|---|---|---|
| 12 | 12 | #define SBRKOUT_DOUBLE 0x01 |
| 13 | 13 | #define SBRKOUT_CAVITY 0x02 |
| 14 | 14 | |
| 15 | int sbrkout_game_switch = SBRKOUT_PROGRESSIVE; | |
| 15 | static int sbrkout_game_switch = SBRKOUT_PROGRESSIVE; | |
| 16 | 16 | |
| 17 | 17 | |
| 18 | 18 | /*************************************************************************** |
| r1355 | r1356 | |
|---|---|---|
| 284 | 284 | }; |
| 285 | 285 | |
| 286 | 286 | |
| 287 | static TIMER_CALLBACK( timer_callback ) | |
| 287 | static TIMER_CALLBACK( opwolf_timer_callback ) | |
| 288 | 288 | { |
| 289 | 289 | // Level data command |
| 290 | 290 | if (current_cmd==0xf5) |
| r1355 | r1356 | |
| 694 | 694 | { |
| 695 | 695 | // Simulate time for command to execute (exact timing unknown, this is close) |
| 696 | 696 | 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); | |
| 698 | 698 | } |
| 699 | 699 | cchip_last_7a=cchip_ram[0x7a]; |
| 700 | 700 | |
| r1355 | r1356 | |
| 747 | 747 | cchip_coins_for_credit[1]=1; |
| 748 | 748 | cchip_credits_for_coin[1]=1; |
| 749 | 749 | |
| 750 | timer_pulse(ATTOTIME_IN_HZ(60), 0, cchip_timer); | |
| 750 | timer_pulse(ATTOTIME_IN_HZ(60), NULL, 0, cchip_timer); | |
| 751 | 751 | } |
| r1355 | r1356 | |
|---|---|---|
| 44 | 44 | #define NB1413M3_TIMER_BASE 20000000 |
| 45 | 45 | static TIMER_CALLBACK( nb1413m3_timer_callback ) |
| 46 | 46 | { |
| 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); | |
| 48 | 48 | |
| 49 | 49 | nb1413m3_74ls193_counter++; |
| 50 | 50 | nb1413m3_74ls193_counter &= 0x0f; |
| r1355 | r1356 | |
| 141 | 141 | |
| 142 | 142 | nb1413m3_74ls193_counter = 0; |
| 143 | 143 | |
| 144 | timer_call_after_resynch(0, nb1413m3_timer_callback); | |
| 144 | timer_call_after_resynch(NULL, 0, nb1413m3_timer_callback); | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | WRITE8_HANDLER( nb1413m3_nmi_clock_w ) |
| r1355 | r1356 | |
|---|---|---|
| 2031 | 2031 | extern void v60_stall(void); |
| 2032 | 2032 | v60_stall(); |
| 2033 | 2033 | |
| 2034 | timer_call_after_resynch(0, NULL); | |
| 2034 | timer_call_after_resynch(NULL, 0, NULL); | |
| 2035 | 2035 | |
| 2036 | 2036 | return 0; |
| 2037 | 2037 | } |
| r1355 | r1356 | |
|---|---|---|
| 15 | 15 | extern UINT8 jackal_interrupt_enable; |
| 16 | 16 | extern void jackal_mark_tile_dirty(int offset); |
| 17 | 17 | |
| 18 | UINT8 *jackal_rambank = 0; | |
| 19 | UINT8 *jackal_spritebank = 0; | |
| 18 | static UINT8 *jackal_rambank = 0; | |
| 19 | static UINT8 *jackal_spritebank = 0; | |
| 20 | 20 | |
| 21 | 21 | |
| 22 | 22 | MACHINE_RESET( jackal ) |
| r1355 | r1356 | |
|---|---|---|
| 87 | 87 | |
| 88 | 88 | static void mw8080bw_create_interrupt_timer(void) |
| 89 | 89 | { |
| 90 | interrupt_timer = timer_alloc(mw8080bw_interrupt_callback); | |
| 90 | interrupt_timer = timer_alloc(mw8080bw_interrupt_callback, NULL); | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 |
| r1355 | r1356 | |
|---|---|---|
| 550 | 550 | DRIVER( vautour2 ) /* bootleg */ |
| 551 | 551 | DRIVER( griffon ) /* bootleg (Videotron) */ |
| 552 | 552 | DRIVER( falcona ) /* bootleg */ |
| 553 | DRIVER( nextfase ) /* bootleg */ | |
| 553 | 554 | DRIVER( pleiads ) /* (c) 1981 Tehkan */ |
| 554 | 555 | DRIVER( pleiadbl ) /* bootleg */ |
| 555 | 556 | DRIVER( pleiadce ) /* (c) 1981 Centuri + Tehkan */ |
| r1355 | r1356 | |
| 662 | 663 | DRIVER( skykid ) /* (c) 1985 */ |
| 663 | 664 | DRIVER( skykido ) /* (c) 1985 */ |
| 664 | 665 | DRIVER( skykidd ) /* (c) 1985 */ |
| 666 | DRIVER( skykids ) /* (c) 1985 */ | |
| 665 | 667 | DRIVER( aliensec ) /* (c) 1985 */ |
| 666 | 668 | DRIVER( baraduke ) /* (c) 1985 */ |
| 667 | 669 | DRIVER( metrocrs ) /* (c) 1985 */ |
| r1355 | r1356 | |
| 3270 | 3272 | DRIVER( myherok ) /* 834-5755 (c) 1985 Coreland / Sega (S1) */ |
| 3271 | 3273 | DRIVER( shtngmst ) /* 834-5719/5720 (c) 1985 (S2) */ |
| 3272 | 3274 | DRIVER( shtngmsa ) /* 834-5719/5720 (c) 1985 (S2) */ |
| 3275 | DRIVER( shtngmsb ) /* 834-5719/5720 (c) 1985 (S2) */ | |
| 3273 | 3276 | DRIVER( chplft ) /* 834-5795 (c) 1985, (c) 1982 Dan Gorlin (S2) */ |
| 3274 | 3277 | DRIVER( chplftb ) /* 834-5795 (c) 1985, (c) 1982 Dan Gorlin (S2) */ |
| 3275 | 3278 | DRIVER( chplftbl ) /* bootleg (S2) */ |
| r1355 | r1356 | |
| 3338 | 3341 | DRIVER( enduror1 ) /* (c) 1985 (FD1089B, decrypted) */ |
| 3339 | 3342 | DRIVER( endurob2 ) /* (c) 1985 (Beta bootleg) */ |
| 3340 | 3343 | DRIVER( endurobl ) /* (c) 1985 (Herb bootleg) */ |
| 3341 | DRIVER( hangon ) /* (c) 1985 */ | |
| 3344 | DRIVER( hangon ) /* (c) 1985 (Rev A)*/ | |
| 3345 | DRIVER( hangon1 ) /* (c) 1985 */ | |
| 3342 | 3346 | DRIVER( sharrier ) /* (c) 1985 */ |
| 3343 | 3347 | DRIVER( sharrir1 ) /* (c) 1985 */ |
| 3344 | 3348 | DRIVER( shangupb ) /* (c) 1992 (but bootleg, hangon hw?) */ |
| r1355 | r1356 | |
| 4192 | 4196 | DRIVER( edrandy0 ) /* MAD (c) 1990 Data East Corporation (World) */ |
| 4193 | 4197 | DRIVER( edrandyj ) /* MAD (c) 1990 Data East Corporation (Japan) */ |
| 4194 | 4198 | DRIVER( supbtime ) /* MAE (c) 1990 Data East Corporation (World) */ |
| 4199 | DRIVER( supbtima ) /* MAE (c) 1990 Data East Corporation (World) */ | |
| 4195 | 4200 | DRIVER( supbtimj ) /* MAE (c) 1990 Data East Corporation (Japan) */ |
| 4196 | 4201 | DRIVER( mutantf ) /* MAF (c) 1992 Data East Corporation (World) */ |
| 4197 | 4202 | DRIVER( mutantfa ) /* MAF (c) 1992 Data East Corporation (World) */ |
| r1355 | r1356 | |
| 4971 | 4976 | DRIVER( caterplr ) /* (bootleg) */ |
| 4972 | 4977 | DRIVER( millpac ) /* Valadon */ |
| 4973 | 4978 | DRIVER( magworm ) /* (bootleg) */ |
| 4979 | DRIVER( mazeinv ) /* (proto) (c) 1982 */ | |
| 4974 | 4980 | DRIVER( milliped ) /* 136013 (c) 1982 */ |
| 4975 | 4981 | DRIVER( qwak ) /* (proto) (c) 1982 */ |
| 4976 | 4982 | DRIVER( runaway ) /* (proto) (c) 1982 */ |
| r1355 | r1356 | |
| 5219 | 5225 | /* Escape from the Planet of Robot Monsters */ |
| 5220 | 5226 | DRIVER( eprom ) /* 136069 (c) 1989 */ |
| 5221 | 5227 | DRIVER( eprom2 ) /* 136069 (c) 1989 */ |
| 5228 | DRIVER( guts ) /* prototype */ | |
| 5222 | 5229 | /* Cyberball 2 Player */ |
| 5223 | 5230 | DRIVER( cyberb2p ) /* 136071 (c) 1989 */ |
| 5224 | 5231 | DRIVER( cyberb23 ) /* 136071 (c) 1989 */ |
| r1355 | r1356 | |
| 7846 | 7853 | DRIVER( esha ) /* (c) 1984 Funai / Gakken */ |
| 7847 | 7854 | DRIVER( eshb ) /* (c) 1984 Funai / Gakken */ |
| 7848 | 7855 | DRIVER( comebaby ) /* (c) 2000 ExPotato */ |
| 7849 | DRIVER( pe | |
| 7856 | DRIVER( pe | |
| 7850 | 7857 | DRIVER( pepp0158 ) /* (c) 1987 IGT - International Gaming Technology */ |
| 7851 | 7858 | DRIVER( pepp0188 ) /* (c) 1987 IGT - International Gaming Technology */ |
| 7852 | DRIVER( pe | |
| 7859 | DRIVER( pepp | |
| 7853 | 7860 | DRIVER( pebe0014 ) /* (c) 1994 IGT - International Gaming Technology */ |
| 7854 | 7861 | DRIVER( peke1012 ) /* (c) 1994 IGT - International Gaming Technology */ |
| 7855 | 7862 | DRIVER( peps0615 ) /* (c) 1996 IGT - International Gaming Technology */ |
| r1355 | r1356 | |
|---|---|---|
| 9 | 9 | VIDEO_START( eprom ); |
| 10 | 10 | VIDEO_UPDATE( eprom ); |
| 11 | 11 | |
| 12 | VIDEO_START( guts ); | |
| 13 | VIDEO_UPDATE( guts ); | |
| 14 | ||
| 12 | 15 | void eprom_scanline_update(running_machine *machine, int scrnum, int scanline); |
| r0 | r1356 | |
|---|---|---|
| 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 | ||
| 10 | extern UINT16 *system24temp_sys16_shared_ram; | |
| 11 | READ16_HANDLER( system24temp_sys16_shared_ram_r ); | |
| 12 | WRITE16_HANDLER( system24temp_sys16_shared_ram_w ); | |
| 13 | ||
| 14 | void 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))); | |
| 19 | READ16_HANDLER ( system24temp_sys16_io_r ); | |
| 20 | WRITE16_HANDLER( system24temp_sys16_io_w ); | |
| 21 | READ32_HANDLER ( system24temp_sys16_io_dword_r ); | |
| 22 | ||
| 23 | /* End New Code */ |
| r1355 | r1356 | |
|---|---|---|
| 1 | 1 | #ifndef _INCLUDES_N64_H_ |
| 2 | 2 | #define _INCLUDES_N64_H_ |
| 3 | 3 | |
| 4 | #include "cpu/rsp/rsp.h" | |
| 5 | ||
| 4 | 6 | /*----------- defined in video/n64.c -----------*/ |
| 5 | 7 | |
| 6 | 8 | extern VIDEO_START( n64 ); |
| r1355 | r1356 | |
| 40 | 42 | |
| 41 | 43 | /*----------- defined in machine/n64.c -----------*/ |
| 42 | 44 | |
| 45 | extern rsp_config n64_rsp_config; | |
| 46 | ||
| 43 | 47 | extern UINT32 *rdram; |
| 44 | 48 | extern UINT32 *rsp_imem; |
| 45 | 49 | extern UINT32 *rsp_dmem; |
| r1355 | r1356 | |
|---|---|---|
| 30 | 30 | WRITE8_HANDLER( bullsdrt_tilesbank_w ); |
| 31 | 31 | WRITE8_HANDLER( bullsdrt_sprites_bank_w ); |
| 32 | 32 | |
| 33 | WRITE8_HANDLER( mazeinv_paletteram_w ); | |
| 34 |
| r1355 | r1356 | |
|---|---|---|
| 1145 | 1145 | $(DRIVERS)/segas16a.o $(VIDEO)/segas16a.o \ |
| 1146 | 1146 | $(DRIVERS)/segas16b.o $(VIDEO)/segas16b.o \ |
| 1147 | 1147 | $(DRIVERS)/segas18.o $(VIDEO)/segas18.o \ |
| 1148 | $(DRIVERS)/segas24.o $(MACHINE)/segas24.o $(VIDEO)/segas24.o \ | |
| 1148 | 1149 | $(DRIVERS)/segas32.o $(MACHINE)/segas32.o $(VIDEO)/segas32.o \ |
| 1149 | 1150 | $(DRIVERS)/segae.o $(VIDEO)/segasyse.o \ |
| 1150 | 1151 | $(DRIVERS)/segaxbd.o $(VIDEO)/segaxbd.o \ |
| r1355 | r1356 | |
| 1157 | 1158 | $(DRIVERS)/system1.o $(VIDEO)/system1.o \ |
| 1158 | 1159 | $(DRIVERS)/system16.o $(MACHINE)/system16.o $(VIDEO)/system16.o $(VIDEO)/sys16spr.o \ |
| 1159 | 1160 | $(DRIVERS)/system18.o \ |
| 1160 | $(DRIVERS)/system24.o $(MACHINE)/system24.o $(VIDEO)/system24.o \ | |
| 1161 | 1161 | $(DRIVERS)/topshoot.o \ |
| 1162 | 1162 | $(DRIVERS)/turbo.o $(AUDIO)/turbo.o $(VIDEO)/turbo.o \ |
| 1163 | 1163 | $(DRIVERS)/vicdual.o $(AUDIO)/vicdual.o $(VIDEO)/vicdual.o \ |
| r1355 | r1356 | |
| 1684 | 1684 | $(DRIVERS)/nbmj8688.o: $(LAYOUT)/nbmj8688.lh |
| 1685 | 1685 | |
| 1686 | 1686 | $(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 | |
| 1690 | 1692 | |
| 1691 | 1693 | $(DRIVERS)/pmpoker.o: $(LAYOUT)/pmpoker.lh \ |
| 1692 | 1694 | $(LAYOUT)/goldnpkr.lh \ |
| r1355 | r1356 | |
| 1696 | 1698 | |
| 1697 | 1699 | $(DRIVERS)/sspeedr.o: $(LAYOUT)/sspeedr.lh |
| 1698 | 1700 | |
| 1701 | $(DRIVERS)/tceptor.o: $(LAYOUT)/tceptor2.lh | |
| 1702 | ||
| 1699 | 1703 | $(DRIVERS)/tetrisp2.o: $(LAYOUT)/rocknms.lh |
| 1700 | 1704 | |
| 1701 | 1705 | $(DRIVERS)/turbo.o: $(LAYOUT)/turbo.lh \ |
| r1355 | r1356 | |
| 1716 | 1720 | #------------------------------------------------- |
| 1717 | 1721 | |
| 1718 | 1722 | $(DRIVERS)/neogeo.o: $(MAMESRC)/drivers/neodrvr.c |
| 1719 | $(DRIVERS)/mpu4.o: $(MAMESRC)/drivers/mpu4drvr.c |
| r1355 | r1356 | |
|---|---|---|
| 8 | 8 | #include "driver.h" |
| 9 | 9 | |
| 10 | 10 | #ifdef MAME_DEBUG |
| 11 | int nycaptor_mask=0; | |
| 11 | static int nycaptor_mask=0; | |
| 12 | 12 | #endif |
| 13 | 13 | |
| 14 | 14 | static tilemap *bg_tilemap; |
| r1355 | r1356 | |
|---|---|---|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | |
| 40 | static 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 | } | |
| 40 | 48 | |
| 49 | ||
| 50 | ||
| 41 | 51 | /************************************* |
| 42 | 52 | * |
| 43 | 53 | * Video system start |
| r1355 | r1356 | |
| 95 | 105 | } |
| 96 | 106 | |
| 97 | 107 | |
| 108 | VIDEO_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) */ | |
| 98 | 122 | |
| 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 | ||
| 99 | 160 | /************************************* |
| 100 | 161 | * |
| 101 | 162 | * Periodic scanline updater |
| r1355 | r1356 | |
| 268 | 329 | } |
| 269 | 330 | return 0; |
| 270 | 331 | } |
| 332 | ||
| 333 | ||
| 334 | VIDEO_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 | } |
| r1355 | r1356 | |
|---|---|---|
| 580 | 580 | } |
| 581 | 581 | |
| 582 | 582 | /* 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); | |
| 584 | 584 | |
| 585 | 585 | profiler_mark(PROFILER_END); |
| 586 | 586 | } |
| r1355 | r1356 | |
| 614 | 614 | dest[x] = pen_map[src[coladdr++ & 0x1ff]]; |
| 615 | 615 | |
| 616 | 616 | /* handle autoerase on the previous line */ |
| 617 | autoerase_line(machine, params->rowaddr - 1); | |
| 617 | autoerase_line(machine, NULL, params->rowaddr - 1); | |
| 618 | 618 | |
| 619 | 619 | /* if this is the last update of the screen, set a timer to clear out the final line */ |
| 620 | 620 | /* (since we update one behind) */ |
| 621 | 621 | 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); | |
| 623 | 623 | } |
| r1355 | r1356 | |
|---|---|---|
| 382 | 382 | nb19010_busyflag = 0; |
| 383 | 383 | |
| 384 | 384 | /* 1650ns per count */ |
| 385 | timer_set( | |
| 385 | timer_set(ATTOTIME_IN_NSEC( | |
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | /****************************************************************************** |
| r1355 | r1356 | |
|---|---|---|
| 44 | 44 | UINT8 midtunit_gfx_rom_large; |
| 45 | 45 | static UINT16 midtunit_control; |
| 46 | 46 | |
| 47 | /* palette-related variables */ | |
| 48 | static pen_t * pen_map; | |
| 49 | ||
| 50 | 47 | /* videoram-related variables */ |
| 51 | 48 | static UINT32 gfxbank_offset[2]; |
| 52 | 49 | static UINT16 * local_videoram; |
| r1355 | r1356 | |
| 89 | 86 | |
| 90 | 87 | VIDEO_START( midtunit ) |
| 91 | 88 | { |
| 92 | int i; | |
| 93 | ||
| 94 | 89 | /* allocate memory */ |
| 95 | 90 | local_videoram = auto_malloc(0x100000); |
| 96 | pen_map = auto_malloc(65536 * sizeof(pen_map[0])); | |
| 97 | 91 | |
| 98 | /* initialize pen map */ | |
| 99 | for (i = 0; i < 0x10000; i++) | |
| 100 | pen_map[i] = i & 0x7fff; | |
| 101 | ||
| 102 | 92 | /* reset all the globals */ |
| 103 | 93 | gfxbank_offset[0] = 0x000000; |
| 104 | 94 | gfxbank_offset[1] = 0x400000; |
| r1355 | r1356 | |
| 804 | 794 | |
| 805 | 795 | /* signal we're done */ |
| 806 | 796 | skipdma: |
| 807 | timer_set(ATTOTIME_IN_NSEC(41 * pixels), 0, dma_callback); | |
| 797 | timer_set(ATTOTIME_IN_NSEC(41 * pixels), NULL, 0, dma_callback); | |
| 808 | 798 | |
| 809 | 799 | profiler_mark(PROFILER_END); |
| 810 | 800 | } |
| r1355 | r1356 | |
| 826 | 816 | |
| 827 | 817 | /* copy the non-blanked portions of this scanline */ |
| 828 | 818 | for (x = params->heblnk; x < params->hsblnk; x++) |
| 829 | dest[x] = | |
| 819 | dest[x] = | |
| 830 | 820 | } |
| 831 | 821 | |
| 832 | 822 | void midxunit_scanline_update(running_machine *machine, int screen, mame_bitmap *bitmap, int scanline, const tms34010_display_params *params) |
| r1355 | r1356 | |
| 838 | 828 | |
| 839 | 829 | /* copy the non-blanked portions of this scanline */ |
| 840 | 830 | for (x = params->heblnk; x < params->hsblnk; x++) |
| 841 | dest[x] = | |
| 831 | dest[x] = | |
| 842 | 832 | } |
| r1355 | r1356 | |
|---|---|---|
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | nb19010_busyflag = 0; |
| 345 | timer_set( | |
| 345 | timer_set( | |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | /****************************************************************************** |
| r1355 | r1356 | |
|---|---|---|
| 231 | 231 | /* reset statics */ |
| 232 | 232 | memset(itech32_video, 0, 0x80); |
| 233 | 233 | |
| 234 | scanline_timer = timer_alloc(scanline_interrupt); | |
| 234 | scanline_timer = timer_alloc(scanline_interrupt, NULL); | |
| 235 | 235 | enable_latch[0] = 1; |
| 236 | 236 | enable_latch[1] = (itech32_planes > 1) ? 1 : 0; |
| 237 | 237 |
| r1355 | r1356 | |
|---|---|---|
| 28 | 28 | #define SAA5050_BLACK 0 |
| 29 | 29 | #define SAA5050_WHITE 7 |
| 30 | 30 | |
| 31 | struct { | |
| 31 | static struct | |
| 32 | { | |
| 32 | 33 | UINT16 saa5050_flags; |
| 33 | 34 | UINT8 saa5050_forecol; |
| 34 | 35 | UINT8 saa5050_backcol; |
| r1355 | r1356 | |
|---|---|---|
| 51 | 51 | |
| 52 | 52 | static poly_manager *poly; |
| 53 | 53 | |
| 54 | static UINT32 zeuscmd_buffer[ | |
| 54 | static UINT32 zeuscmd_buffer[20]; | |
| 55 | 55 | static UINT8 zeuscmd_buffer_words; |
| 56 | 56 | static UINT8 zeuscmd_buffer_expected_words; |
| 57 | 57 | static INT16 zeus_matrix[3][3]; |
| r1355 | r1356 | |
| 62 | 62 | static UINT32 zeus_texdata; |
| 63 | 63 | static UINT32 zeus_objdata; |
| 64 | 64 | |
| 65 | static UINT32 last_tex[1000][2]; | |
| 66 | static int last_tex_index; | |
| 67 | ||
| 68 | 65 | static UINT32 *waveram; |
| 69 | 66 | |
| 67 | static UINT8 single_step; | |
| 68 | static poly_extra_data single_step_extra; | |
| 69 | static UINT32 single_step_val1; | |
| 70 | static UINT32 single_step_val2; | |
| 71 | static INT32 single_step_dx, single_step_dy; | |
| 72 | static UINT8 single_step_advance; | |
| 70 | 73 | |
| 71 | 74 | |
| 75 | ||
| 72 | 76 | /************************************* |
| 73 | 77 | * |
| 74 | 78 | * Function prototypes |
| r1355 | r1356 | |
| 77 | 81 | |
| 78 | 82 | static void exit_handler(running_machine *machine); |
| 79 | 83 | |
| 84 | static void zeus_write_16bit(offs_t offset, UINT16 data, int logit); | |
| 85 | static void zeus_write_32bit(offs_t offset, UINT32 data, int logit); | |
| 86 | static void zeus_process_write(offs_t offset); | |
| 87 | static void zeuscmd_execute(int words); | |
| 88 | static UINT8 zeuscmd_length(UINT32 word); | |
| 80 | 89 | |
| 81 | 90 | |
| 91 | ||
| 82 | 92 | /************************************* |
| 83 | 93 | * |
| 84 | 94 | * Inlines |
| r1355 | r1356 | |
| 249 | 259 | src += 2; |
| 250 | 260 | } |
| 251 | 261 | } |
| 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 | } | |
| 252 | 293 | } |
| 253 | 294 | |
| 254 | 295 | /* waveram drawing case */ |
| r1355 | r1356 | |
| 278 | 319 | popmessage("offs = %06X", yoffs << 12); |
| 279 | 320 | } |
| 280 | 321 | |
| 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 | ||
| 290 | 322 | return 0; |
| 291 | 323 | } |
| 292 | 324 | |
| 293 | 325 | |
| 294 | 326 | |
| 295 | /* | |
| 296 | 327 | |
| 297 | New analysis: | |
| 298 | 328 | |
| 299 | Offset | |
| 300 | ------ | |
| 301 | 329 | |
| 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 | ||
| 390 | Notes: | |
| 391 | ||
| 392 | In 16-bit mode, writes to $E0 are done via $E1 first then $E0 | |
| 393 | ||
| 394 | ------------------------------------------------------- | |
| 395 | ||
| 396 | Old 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 | ||
| 424 | 330 | /* |
| 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 | /* | |
| 443 | 331 | Control = $80F6 when doing initial screen clear. |
| 444 | 332 | Writes 256 consecutive values to $B0, must mean autoincrement |
| 445 | 333 | Uses latched value in $B2 (maybe also in $B0) |
| r1355 | r1356 | |
| 473 | 361 | |
| 474 | 362 | $0000C040 = set palette to 'yyyyyyyy' |
| 475 | 363 | |
| 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 | ||
| 476 | 374 | $17rrxxxx = 16-bit write 'xxxx' to register 'rr' |
| 477 | 375 | |
| 478 | 376 | $1752xxxx = write 'xxxx' to something that reflects back through $B2 |
| r1355 | r1356 | |
| 480 | 378 | $1772xxxx = write 'xxxx' to upper 16 bits of Y coordinate |
| 481 | 379 | $1774xxxx = write 'xxxx' to upper 16 bits of Z coordinate |
| 482 | 380 | |
| 483 | $18rr0000 = 32-bit write 'xxxxxxxx' to register 'rr' | |
| 381 | $18rr0000 = 32-bit write 'xxxxxxxx' to register ('rr' & 0x7f) | |
| 484 | 382 | xxxxxxxx |
| 485 | 383 | |
| 486 | 384 | $1A000000 = pipeline synchronize (guess) |
| r1355 | r1356 | |
| 500 | 398 | */ |
| 501 | 399 | |
| 502 | 400 | /* |
| 401 | ||
| 402 | MK4: | |
| 403 | ||
| 503 | 404 | Zeus cmd 18 : 18D60000 500A00FF |
| 504 | 405 | Zeus cmd 00 : 0005C0A5 21001125 |
| 505 | 406 | Zeus cmd 25 : 25000000 007F0018 01000400 B0F60008 |
| r1355 | r1356 | |
| 602 | 503 | 08000000 00000000 |
| 603 | 504 | */ |
| 604 | 505 | |
| 506 | /* | |
| 605 | 507 | |
| 508 | Note this sequence: | |
| 509 | Zeus cmd 17 : 1757500A | |
| 510 | Zeus cmd 17 : 175600FF | |
| 511 | Zeus cmd 17 : 176F0032 | |
| 512 | Zeus cmd 17 : 176E0031 | |
| 513 | Zeus cmd 17 : 176D003B | |
| 514 | Zeus cmd 17 : 176C002F | |
| 515 | ||
| 516 | Appears to do the same thing as: | |
| 517 | Zeus cmd 18 : 18D60000 500A00FF | |
| 518 | Zeus cmd 18 : 18EE0000 00320031 | |
| 519 | Zeus cmd 18 : 18EC0000 003B002F | |
| 520 | ||
| 521 | ||
| 522 | ||
| 523 | Also this sequence: | |
| 524 | Zeus cmd 17 : 176940C4 | |
| 525 | Zeus cmd 17 : 17681370 | |
| 526 | ||
| 527 | Seems to have the same purpose as this part of the command stream: | |
| 528 | 19E80000 40C41370 | |
| 529 | ||
| 530 | ||
| 531 | ||
| 532 | Invasion startup: | |
| 533 | ||
| 534 | 00CC86:zeus16_w(81) = 0000 [00000000] | |
| 535 | 00CC86:zeus16_w(80) = 0000 [00000000] | |
| 536 | 00CC86:zeus16_w(4B) = 018F [018F0000] | |
| 537 | 00CC86:zeus16_w(4A) = 01FE [018F01FE] | |
| 538 | 00CC86:zeus16_w(49) = 018F [018F0000] | |
| 539 | 00CC86:zeus16_w(48) = 01FE [018F01FE] | |
| 540 | 00CC86:zeus16_w(CE) = 7620 [00007620] | |
| 541 | 00CC86:zeus16_w(CD) = 0000 [00000000] | |
| 542 | 00CC86:zeus16_w(CC) = 0000 [00000000] | |
| 543 | 00CC86:zeus16_w(CB) = 0116 [01160000] | |
| 544 | 00CC86:zeus16_w(CA) = 0107 [01160107] | |
| 545 | 00CC86:zeus16_w(C9) = 0103 [01030000] | |
| 546 | 00CC86:zeus16_w(C8) = 00FF [010300FF] | |
| 547 | 00CC86:zeus16_w(C7) = 0211 [02110000] | |
| 548 | 00CC86:zeus16_w(C6) = 007F [0211007F] | |
| 549 | 00CC86:zeus16_w(C5) = 000C [000C0000] | |
| 550 | 00CC86:zeus16_w(C4) = 004C [000C004C] | |
| 551 | 00CC86:zeus16_w(C3) = 001F [001F0000] | |
| 552 | 00CC86:zeus16_w(C2) = E591 [001FE591] | |
| 553 | 00CC86:zeus16_w(C1) = 801F [801F0000] | |
| 554 | 00CC86:zeus16_w(C0) = 2500 [801F2500] | |
| 555 | 00CC86:zeus16_w(86) = 8003 [00008003] | |
| 556 | 00CC86:zeus16_w(80) = 0C05 [00000C05] | |
| 557 | 00CC86:zeus16_w(8F) = 0206 [02060000] | |
| 558 | 00CC86:zeus16_w(8E) = 0000 [02060000] | |
| 559 | 00CC86:zeus16_w(8D) = 0226 [02260000] | |
| 560 | 00CC86:zeus16_w(8C) = 0000 [02260000] | |
| 561 | 00CC86:zeus16_w(8B) = 0000 [00000000] | |
| 562 | 00CC86:zeus16_w(8A) = FAFA [0000FAFA] | |
| 563 | 00CC86:zeus16_w(89) = 0000 [00000000] | |
| 564 | 00CC86:zeus16_w(88) = FAFA [0000FAFA] | |
| 565 | 00CC86:zeus16_w(80) = 0001 [00000001] | |
| 566 | 00CC86:zeus16_w(8F) = 0207 [02070000] | |
| 567 | 00CC86:zeus16_w(8E) = BFFF [0207BFFF] | |
| 568 | 00CC86:zeus16_w(8F) = 0206 [0206BFFF] | |
| 569 | 00CC86:zeus16_w(8E) = 0000 [02060000] | |
| 570 | 00CC86:zeus16_w(8D) = 0227 [02270000] | |
| 571 | 00CC86:zeus16_w(8C) = BFFF [0227BFFF] | |
| 572 | 00CC86:zeus16_w(8D) = 0226 [0226BFFF] | |
| 573 | 00CC86:zeus16_w(8C) = 0000 [02260000] | |
| 574 | 00CC86:zeus16_w(8F) = 0207 [02070000] | |
| 575 | 00CC86:zeus16_w(8E) = F020 [0207F020] | |
| 576 | 00CC86:zeus16_w(8F) = 0206 [0206F020] | |
| 577 | 00CC86:zeus16_w(8E) = 0000 [02060000] | |
| 578 | 00CC86:zeus16_w(8D) = 0227 [02270000] | |
| 579 | 00CC86:zeus16_w(8C) = F020 [0227F020] | |
| 580 | 00CC86:zeus16_w(8D) = 0226 [0226F020] | |
| 581 | 00CC86:zeus16_w(8C) = 0000 [02260000] | |
| 582 | 00CC86:zeus16_w(8F) = 0207 [02070000] | |
| 583 | 00CC86:zeus16_w(8E) = DFFF [0207DFFF] | |
| 584 | 00CC86:zeus16_w(8F) = 0206 [0206DFFF] | |
| 585 | 00CC86:zeus16_w(8E) = 0000 [02060000] | |
| 586 | 00CC86:zeus16_w(8D) = 0227 [02270000] | |
| 587 | 00CC86:zeus16_w(8C) = DFFF [0227DFFF] | |
| 588 | 00CC86:zeus16_w(8D) = 0226 [0226DFFF] | |
| 589 | 00CC86:zeus16_w(8C) = 0000 [02260000] | |
| 590 | 00CC86:zeus16_w(8F) = 0207 [02070000] | |
| 591 | 00CC86:zeus16_w(8E) = DFFF [0207DFFF] | |
| 592 | 00CC86:zeus16_w(8F) = 0206 [0206DFFF] | |
| 593 | 00CC86:zeus16_w(8E) = 0000 [02060000] | |
| 594 | 00CC86:zeus16_w(8D) = 0227 [02270000] | |
| 595 | 00CC86:zeus16_w(8C) = DFFF [0227DFFF] | |
| 596 | 00CC86:zeus16_w(8D) = 0226 [0226DFFF] | |
| 597 | 00CC86:zeus16_w(8C) = 0000 [02260000] | |
| 598 | 00CC86:zeus16_w(8F) = 0206 [02060000] | |
| 599 | 00CC86:zeus16_w(8E) = 0000 [02060000] | |
| 600 | 00CC86:zeus16_w(8D) = 0226 [02260000] | |
| 601 | 00CC86:zeus16_w(8C) = 0000 [02260000] | |
| 602 | 00CC86:zeus16_w(8B) = 0000 [0000FAFA] | |
| 603 | 00CC86:zeus16_w(8A) = D254 [0000D254] | |
| 604 | 00CC86:zeus16_w(89) = 8FFF [8FFFFAFA] | |
| 605 | 00CC86:zeus16_w(88) = D794 [8FFFD794] | |
| 606 | 00CC86:zeus16_w(85) = 0000 [00000000] | |
| 607 | 00CC86:zeus16_w(84) = 0000 [00000000] | |
| 608 | 00CC86:zeus16_w(83) = 1F1F [1F1F0000] | |
| 609 | 00CC86:zeus16_w(82) = 2011 [1F1F2011] | |
| 610 | 00CC86:zeus16_w(69) = 0003 [00030000] | |
| 611 | 00CC86:zeus16_w(69) = 0000 [00000000] | |
| 612 | 00CC86:zeus16_w(68) = 0100 [00000100] | |
| 613 | 00CC92:zeus16_w(200) = 0100 [00000100] | |
| 614 | 00CC92:zeus16_w(201) = 0000 [00000100] | |
| 615 | 00CC92:zeus16_w(202) = 0000 [00000000] | |
| 616 | 00CC92:zeus16_w(203) = 0000 [00000000] | |
| 617 | 00CC92:zeus16_w(204) = 00D4 [000000D4] | |
| 618 | 00CC92:zeus16_w(205) = 0000 [000000D4] | |
| 619 | 00CC92:zeus16_w(206) = 0000 [00000000] | |
| 620 | 00CC92:zeus16_w(207) = A000 [A0000000] | |
| 621 | 00CC92:zeus16_w(208) = 0050 [00000050] | |
| 622 | 00CC92:zeus16_w(209) = 0000 [00000050] | |
| 623 | 00CC92:zeus16_w(20A) = 0000 [00000000] | |
| 624 | 00CC92:zeus16_w(20B) = A000 [A0000000] | |
| 625 | 00CC92:zeus16_w(20C) = 0703 [00000703] | |
| 626 | 00CC92:zeus16_w(20D) = 0000 [00000703] | |
| 627 | 00CC92:zeus16_w(20E) = 0000 [00000000] | |
| 628 | 00CC92:zeus16_w(20F) = 0000 [00000000] | |
| 629 | 00CC92:zeus16_w(210) = 0050 [00000050] | |
| 630 | 00CC92:zeus16_w(211) = 0000 [00000050] | |
| 631 | 00CC92:zeus16_w(212) = 0000 [00000000] | |
| 632 | 00CC92:zeus16_w(213) = A000 [A0000000] | |
| 633 | 00CC92:zeus16_w(214) = 005A [0000005A] | |
| 634 | 00CC92:zeus16_w(215) = 01C0 [01C0005A] | |
| 635 | 00CC92:zeus16_w(216) = 0000 [00000000] | |
| 636 | 00CC92:zeus16_w(217) = B000 [B0000000] | |
| 637 | 00CC92:zeus16_w(218) = 00D8 [000000D8] | |
| 638 | 00CC92:zeus16_w(219) = 0000 [000000D8] | |
| 639 | 00CC92:zeus16_w(21A) = 0000 [00000000] | |
| 640 | 00CC92:zeus16_w(21B) = 9000 [90000000] | |
| 641 | 00CC92:zeus16_w(21C) = 0607 [00000607] | |
| 642 | 00CC92:zeus16_w(21D) = 0000 [00000607] | |
| 643 | 00CC92:zeus16_w(21E) = 0000 [00000000] | |
| 644 | 00CC92:zeus16_w(21F) = 0000 [00000000] | |
| 645 | 00CC92:zeus16_w(220) = C000 [0000C000] | |
| 646 | 00CC92:zeus16_w(221) = 0008 [0008C000] | |
| 647 | 00CC92:zeus16_w(222) = 0000 [00000000] | |
| 648 | 00CC92:zeus16_w(223) = 003F [003F0000] | |
| 649 | 00CC92:zeus16_w(224) = 006A [0000006A] | |
| 650 | 00CC92:zeus16_w(225) = 01D0 [01D0006A] | |
| 651 | 00CC92:zeus16_w(226) = 0025 [00000025] | |
| 652 | 00CC92:zeus16_w(227) = B000 [B0000025] | |
| 653 | 00CC92:zeus16_w(228) = 0F00 [00000F00] | |
| 654 | 00CC92:zeus16_w(229) = 0000 [00000F00] | |
| 655 | 00CC92:zeus16_w(22A) = 0001 [00000001] | |
| 656 | 00CC92:zeus16_w(22B) = 0000 [00000001] | |
| 657 | 00CC92:zeus16_w(22C) = 0E08 [00000E08] | |
| 658 | 00CC92:zeus16_w(22D) = 0000 [00000E08] | |
| 659 | 00CC92:zeus16_w(22E) = 0000 [00000000] | |
| 660 | 00CC92:zeus16_w(22F) = 0000 [00000000] | |
| 661 | 00CC92:zeus16_w(230) = 00D4 [000000D4] | |
| 662 | 00CC92:zeus16_w(231) = 0000 [000000D4] | |
| 663 | 00CC92:zeus16_w(232) = 0000 [00000000] | |
| 664 | 00CC92:zeus16_w(233) = A000 [A0000000] | |
| 665 | 00CC92:zeus16_w(234) = 0050 [00000050] | |
| 666 | 00CC92:zeus16_w(235) = 0000 [00000050] | |
| 667 | 00CC92:zeus16_w(236) = 0000 [00000000] | |
| 668 | 00CC92:zeus16_w(237) = A000 [A0000000] | |
| 669 | 00CC92:zeus16_w(238) = 070E [0000070E] | |
| 670 | 00CC92:zeus16_w(239) = 0000 [0000070E] | |
| 671 | 00CC92:zeus16_w(23A) = 0000 [00000000] | |
| 672 | 00CC92:zeus16_w(23B) = 0000 [00000000] | |
| 673 | 00CC92:zeus16_w(23C) = 0050 [00000050] | |
| 674 | 00CC92:zeus16_w(23D) = 0000 [00000050] | |
| 675 | 00CC92:zeus16_w(23E) = 0000 [00000000] | |
| 676 | 00CC92:zeus16_w(23F) = A000 [A0000000] | |
| 677 | 00CC92:zeus16_w(240) = 005A [0000005A] | |
| 678 | 00CC92:zeus16_w(241) = 01C0 [01C0005A] | |
| 679 | 00CC92:zeus16_w(242) = 0000 [00000000] | |
| 680 | 00CC92:zeus16_w(243) = B000 [B0000000] | |
| 681 | 00CC92:zeus16_w(244) = 00D8 [000000D8] | |
| 682 | 00CC92:zeus16_w(245) = 0000 [000000D8] | |
| 683 | 00CC92:zeus16_w(246) = 0000 [00000000] | |
| 684 | 00CC92:zeus16_w(247) = 8CC0 [8CC00000] | |
| 685 | 00CC92:zeus16_w(248) = 0612 [00000612] | |
| 686 | 00CC92:zeus16_w(249) = 0000 [00000612] | |
| 687 | 00CC92:zeus16_w(24A) = 0000 [00000000] | |
| 688 | 00CC92:zeus16_w(24B) = 0000 [00000000] | |
| 689 | 00CC92:zeus16_w(24C) = D000 [0000D000] | |
| 690 | 00CC92:zeus16_w(24D) = 0008 [0008D000] | |
| 691 | 00CC92:zeus16_w(24E) = 8000 [00008000] | |
| 692 | 00CC92:zeus16_w(24F) = 003E [003E8000] | |
| 693 | 00CC92:zeus16_w(250) = 006A [0000006A] | |
| 694 | 00CC92:zeus16_w(251) = 01D0 [01D0006A] | |
| 695 | 00CC92:zeus16_w(252) = 0025 [00000025] | |
| 696 | 00CC92:zeus16_w(253) = B000 [B0000025] | |
| 697 | 00CC92:zeus16_w(254) = 0F00 [00000F00] | |
| 698 | 00CC92:zeus16_w(255) = 0000 [00000F00] | |
| 699 | 00CC92:zeus16_w(256) = 0001 [00000001] | |
| 700 | 00CC92:zeus16_w(257) = 0000 [00000001] | |
| 701 | 00CC92:zeus16_w(258) = 0E13 [00000E13] | |
| 702 | 00CC92:zeus16_w(259) = 0000 [00000E13] | |
| 703 | 00CC92:zeus16_w(25A) = 0000 [00000000] | |
| 704 | 00CC92:zeus16_w(25B) = 0000 [00000000] | |
| 705 | 00CC92:zeus16_w(25C) = 0F00 [00000F00] | |
| 706 | 00CC92:zeus16_w(25D) = 05C0 [05C00F00] | |
| 707 | 00CC92:zeus16_w(25E) = 0000 [00000000] | |
| 708 | 00CC92:zeus16_w(25F) = B000 [B0000000] | |
| 709 | 00CC92:zeus16_w(260) = 0F80 [00000F80] | |
| 710 | 00CC92:zeus16_w(261) = 0400 [04000F80] | |
| 711 | 00CC92:zeus16_w(262) = 0000 [00000000] | |
| 712 | 00CC92:zeus16_w(263) = 9000 [90000000] | |
| 713 | 00CC92:zeus16_w(264) = 0F80 [00000F80] | |
| 714 | 00CC92:zeus16_w(265) = 0400 [04000F80] | |
| 715 | 00CC92:zeus16_w(266) = 0000 [00000000] | |
| 716 | 00CC92:zeus16_w(267) = 8CC0 [8CC00000] | |
| 717 | 00CC92:zeus16_w(268) = 011A [0000011A] | |
| 718 | 00CC92:zeus16_w(269) = 0000 [0000011A] | |
| 719 | 00CC92:zeus16_w(26A) = 0000 [00000000] | |
| 720 | 00CC92:zeus16_w(26B) = 0000 [00000000] | |
| 721 | 00CC92:zeus16_w(26C) = 0F00 [00000F00] | |
| 722 | 00CC92:zeus16_w(26D) = 0000 [00000F00] | |
| 723 | 00CC92:zeus16_w(26E) = 0000 [00000000] | |
| 724 | 00CC92:zeus16_w(26F) = 0000 [00000000] | |
| 725 | 00CC92:zeus16_w(270) = A001 [0000A001] | |
| 726 | 00CC92:zeus16_w(271) = 0003 [0003A001] | |
| 727 | 00CC92:zeus16_w(272) = 0025 [00000025] | |
| 728 | 00CC92:zeus16_w(273) = 0000 [00000025] | |
| 729 | 00CC92:zeus16_w(274) = 0000 [00000000] | |
| 730 | 00CC92:zeus16_w(275) = 40F3 [40F30000] | |
| 731 | 00CC92:zeus16_w(276) = 0000 [00000000] | |
| 732 | 00CC92:zeus16_w(277) = 0000 [00000000] | |
| 733 | 00CC92:zeus16_w(278) = 4000 [00004000] | |
| 734 | 00CC92:zeus16_w(279) = 0803 [08034000] | |
| 735 | 00CC92:zeus16_w(27A) = 2000 [00002000] | |
| 736 | 00CC92:zeus16_w(27B) = 0013 [00132000] | |
| 737 | 00CC92:zeus16_w(27C) = 8000 [00008000] | |
| 738 | 00CC92:zeus16_w(27D) = 0003 [00038000] | |
| 739 | 00CC92:zeus16_w(27E) = 1000 [00001000] | |
| 740 | 00CC92:zeus16_w(27F) = 003E [003E1000] | |
| 741 | 00CC92:zeus16_w(280) = 20F0 [000020F0] | |
| 742 | 00CC92:zeus16_w(281) = 0001 [000120F0] | |
| 743 | 00CC92:zeus16_w(282) = 0000 [00000000] | |
| 744 | 00CC92:zeus16_w(283) = 93C0 [93C00000] | |
| 745 | 00CC92:zeus16_w(284) = 60F2 [000060F2] | |
| 746 | 00CC92:zeus16_w(285) = 0001 [000160F2] | |
| 747 | 00CC92:zeus16_w(286) = 0000 [00000000] | |
| 748 | 00CC92:zeus16_w(287) = 9380 [93800000] | |
| 749 | 00CC92:zeus16_w(288) = FFF4 [0000FFF4] | |
| 750 | 00CC92:zeus16_w(289) = 0001 [0001FFF4] | |
| 751 | 00CC92:zeus16_w(28A) = 0000 [00000000] | |
| 752 | 00CC92:zeus16_w(28B) = 90C0 [90C00000] | |
| 753 | 00CC92:zeus16_w(28C) = 0000 [00000000] | |
| 754 | 00CC92:zeus16_w(28D) = 0000 [00000000] | |
| 755 | 00CC92:zeus16_w(28E) = 0000 [00000000] | |
| 756 | 00CC92:zeus16_w(28F) = 0000 [00000000] | |
| 757 | 00CC92:zeus16_w(290) = 0000 [00000000] | |
| 758 | 00CC92:zeus16_w(291) = 0000 [00000000] | |
| 759 | 00CC92:zeus16_w(292) = 0000 [00000000] | |
| 760 | 00CC92:zeus16_w(293) = 0000 [00000000] | |
| 761 | 00CC92:zeus16_w(294) = 0000 [00000000] | |
| 762 | 00CC92:zeus16_w(295) = 0000 [00000000] | |
| 763 | 00CC92:zeus16_w(296) = 0000 [00000000] | |
| 764 | 00CC92:zeus16_w(297) = 0000 [00000000] | |
| 765 | 00CC92:zeus16_w(298) = 0000 [00000000] | |
| 766 | 00CC92:zeus16_w(299) = 0000 [00000000] | |
| 767 | 00CC92:zeus16_w(29A) = 0000 [00000000] | |
| 768 | 00CC92:zeus16_w(29B) = 0000 [00000000] | |
| 769 | 00CC92:zeus16_w(29C) = 0000 [00000000] | |
| 770 | 00CC92:zeus16_w(29D) = 0000 [00000000] | |
| 771 | 00CC92:zeus16_w(29E) = 0000 [00000000] | |
| 772 | 00CC92:zeus16_w(29F) = 0000 [00000000] | |
| 773 | 00CC92:zeus16_w(2A0) = 0000 [00000000] | |
| 774 | 00CC92:zeus16_w(2A1) = 0000 [00000000] | |
| 775 | 00CC92:zeus16_w(2A2) = 0000 [00000000] | |
| 776 | 00CC92:zeus16_w(2A3) = 0000 [00000000] | |
| 777 | 00CC92:zeus16_w(2A4) = 0000 [00000000] | |
| 778 | 00CC92:zeus16_w(2A5) = 0000 [00000000] | |
| 779 | 00CC92:zeus16_w(2A6) = 0000 [00000000] | |
| 780 | 00CC92:zeus16_w(2A7) = 0000 [00000000] | |
| 781 | 00CC92:zeus16_w(2A8) = 0000 [00000000] | |
| 782 | 00CC92:zeus16_w(2A9) = 0000 [00000000] | |
| 783 | 00CC92:zeus16_w(2AA) = 0000 [00000000] | |
| 784 | 00CC92:zeus16_w(2AB) = 0000 [00000000] | |
| 785 | 00CC92:zeus16_w(2AC) = 0000 [00000000] | |
| 786 | 00CC92:zeus16_w(2AD) = 0000 [00000000] | |
| 787 | 00CC92:zeus16_w(2AE) = 0000 [00000000] | |
| 788 | 00CC92:zeus16_w(2AF) = 0000 [00000000] | |
| 789 | 00CC92:zeus16_w(2B0) = 0000 [00000000] | |
| 790 | 00CC92:zeus16_w(2B1) = 0000 [00000000] | |
| 791 | 00CC92:zeus16_w(2B2) = 0000 [00000000] | |
| 792 | 00CC92:zeus16_w(2B3) = 0000 [00000000] | |
| 793 | 00CC92:zeus16_w(2B4) = 7F00 [00007F00] | |
| 794 | 00CC92:zeus16_w(2B5) = 0001 [00017F00] | |
| 795 | 00CC92:zeus16_w(2B6) = 0000 [00000000] | |
| 796 | 00CC92:zeus16_w(2B7) = 03C0 [03C00000] | |
| 797 | 00CC92:zeus16_w(2B8) = C000 [0000C000] | |
| 798 | 00CC92:zeus16_w(2B9) = 0003 [0003C000] | |
| 799 | 00CC92:zeus16_w(2BA) = 0000 [00000000] | |
| 800 | 00CC92:zeus16_w(2BB) = 0000 [00000000] | |
| 801 | 00CC92:zeus16_w(2BC) = EF00 [0000EF00] | |
| 802 | 00CC92:zeus16_w(2BD) = 0001 [0001EF00] | |
| 803 | 00CC92:zeus16_w(2BE) = 0000 [00000000] | |
| 804 | 00CC92:zeus16_w(2BF) = 03C0 [03C00000] | |
| 805 | 00CC92:zeus16_w(2C0) = 0007 [00000007] | |
| 806 | 00CC86:zeus16_w(68) = 0008 [00000008] | |
| 807 | 00CC86:zeus16_w(80) = 0C01 [00000C01] | |
| 808 | 00CC86:zeus16_w(80) = 0C1D [00000C1D] | |
| 809 | 00CC86:zeus16_w(69) = 0003 [00030008] | |
| 810 | 00CC86:zeus16_w(69) = 0000 [00000008] | |
| 811 | 00CC86:zeus16_w(80) = 0C01 [00000C01] | |
| 812 | 00CC86:zeus16_w(80) = FC1D [0000FC1D] | |
| 813 | 00CC86:zeus16_w(81) = 0022 [0022FC1D] | |
| 814 | Zeus cmd 1A : 1A000000 | |
| 815 | 00CFDC:zeus32_w(86) = 00008020 | |
| 816 | 00CFE0:zeus32_w(8E) = 0207F440 | |
| 817 | 00CFE1:zeus32_w(100) = 00000000 | |
| 818 | 00CFE5:zeus32_w(86) = 00008000 | |
| 819 | 00CFE7:zeus32_w(8E) = 02060000 | |
| 820 | 00D0FC:zeus32_w(CE) = 00C97020 | |
| 821 | 00D09A:zeus32_w(80) = 0022FC3F | |
| 822 | 00D104:zeus32_w(CE) = 00C87020 | |
| 823 | 00D034:zeus32_w(84) = 00000100 | |
| 824 | 00D0C9:zeus32_w(68) = 00000100 | |
| 825 | 00D0CA:zeus32_w(00) = 0000C3F0 | |
| 826 | 00D0CC:zeus32_w(5C) = 00000000 | |
| 827 | 00D0CE:zeus32_w(06) = FFFF0030 | |
| 828 | 00D0D0:zeus32_w(02) = 000C0000 | |
| 829 | 00D0D2:zeus32_w(04) = 00000E01 | |
| 830 | 00D0D4:zeus32_w(4C) = 00808080 | |
| 831 | 00D0D5:zeus32_w(4E) = 00808080 | |
| 832 | 00D0D6:zeus32_w(08) = 00000000 | |
| 833 | 00D0D7:zeus32_w(0C) = 00FF018F | |
| 834 | 00D0DD:zeus32_w(0A) = 0000018F | |
| 835 | 00D0E3:zeus32_w(0E) = 00FF0000 | |
| 836 | 00D0E5:zeus32_w(1E) = FFFFFFFF | |
| 837 | 00D0E6:zeus32_w(1C) = FFFFFFFF | |
| 838 | 00D0E7:zeus32_w(1A) = FFFFFFFF | |
| 839 | 00D0E8:zeus32_w(18) = FFFFFFFF | |
| 840 | 00D0EA:zeus32_w(46) = 00000000 | |
| 841 | 00D0EB:zeus32_w(44) = 00000000 | |
| 842 | 00D0EC:zeus32_w(42) = 00000000 | |
| 843 | 00D0ED:zeus32_w(40) = 00000000 | |
| 844 | 00D0EE:zeus32_w(26) = 00000000 | |
| 845 | 00D0EF:zeus32_w(24) = 00000000 | |
| 846 | 00D0F0:zeus32_w(22) = 00000000 | |
| 847 | 00D0F1:zeus32_w(20) = 00000000 | |
| 848 | 00D09A:zeus32_w(80) = 0022FCFF | |
| 849 | 00D0F6:zeus32_w(60) = 00000001 | |
| 850 | 00D09A:zeus32_w(80) = 0022FC3F | |
| 851 | 00D01E:zeus32_w(76) = F8800000 | |
| 852 | 00D020:zeus32_w(CC) = 00000000 | |
| 853 | 00D034:zeus32_w(84) = 00000080 | |
| 854 | 00D0FC:zeus32_w(CE) = 00C97020 | |
| 855 | 00D09A:zeus32_w(80) = 0022FC3F | |
| 856 | 00D104:zeus32_w(CE) = 00C87020 | |
| 857 | Zeus cmd 1A : 1A000000 | |
| 858 | Zeus cmd 18 : 187E0000 0000FFFF | |
| 859 | Zeus cmd 18 : 187C0000 FFFFFFE0 | |
| 860 | Zeus cmd 18 : 187A0000 00800000 | |
| 861 | Zeus cmd 18 : 18780000 000000C7 | |
| 862 | Zeus cmd 18 : 18760000 F8800000 | |
| 863 | Zeus cmd 17 : 176F0032 | |
| 864 | Zeus cmd 17 : 176E0031 | |
| 865 | Zeus cmd 17 : 176D003B | |
| 866 | Zeus cmd 17 : 176C002B | |
| 867 | Zeus cmd 18 : 184E0000 00808080 | |
| 868 | Zeus cmd 18 : 184C0000 00808080 | |
| 869 | Zeus cmd 18 : 184A0000 00FF018E | |
| 870 | Zeus cmd 18 : 18480000 00FF018E | |
| 871 | Zeus cmd 17 : 176940C4 | |
| 872 | Zeus cmd 17 : 17681370 | |
| 873 | Zeus cmd 17 : 1707FFFF | |
| 874 | Zeus cmd 17 : 17060030 | |
| 875 | Zeus cmd 17 : 17010000 | |
| 876 | Zeus cmd 2D : 2D007FFF | |
| 877 | Zeus cmd 2E : 2E000800 00000000 | |
| 878 | Zeus cmd 17 : 1757500A | |
| 879 | Zeus cmd 17 : 175600FF | |
| 880 | Zeus cmd 17 : 17524321 | |
| 881 | Zeus cmd 17 : 1752BCDE | |
| 882 | Zeus cmd 01 : 0100C0B0 3F001059 | |
| 883 | 00D09A:zeus32_w(80) = 0222FC3F | |
| 884 | .... | |
| 885 | Zeus cmd 1A : 1A000000 | |
| 886 | Zeus cmd 1A : 1A000000 | |
| 887 | .... | |
| 888 | Zeus cmd 1A : 1A000000 | |
| 889 | Zeus cmd 1A : 1A000000 | |
| 890 | .... | |
| 891 | Zeus cmd 01 : 0100C0B0 3F001059 | |
| 892 | 00D09A:zeus32_w(80) = 0222FC3F | |
| 893 | .... | |
| 894 | Zeus cmd 1A : 1A000000 | |
| 895 | Zeus cmd 1A : 1A000000 | |
| 896 | .... | |
| 897 | 00D09A:zeus32_w(80) = FB22FC3F | |
| 898 | 00D01E:zeus32_w(76) = F8800000 | |
| 899 | 00D020:zeus32_w(CC) = 00800000 | |
| 900 | 00D034:zeus32_w(84) = 00000000 | |
| 901 | 00D0C9:zeus32_w(68) = 00000100 | |
| 902 | 00D0CA:zeus32_w(00) = 00000000 | |
| 903 | 00D0CC:zeus32_w(5C) = 00000000 | |
| 904 | 00D0CE:zeus32_w(06) = FFFF0030 | |
| 905 | 00D0D0:zeus32_w(02) = 000C0000 | |
| 906 | 00D0D2:zeus32_w(04) = 00000E01 | |
| 907 | 00D0D4:zeus32_w(4C) = 00808080 | |
| 908 | 00D0D5:zeus32_w(4E) = 00808080 | |
| 909 | 00D0D6:zeus32_w(08) = 00000000 | |
| 910 | 00D0D7:zeus32_w(0C) = 00FF018F | |
| 911 | 00D0DD:zeus32_w(0A) = 0000018F | |
| 912 | 00D0E3:zeus32_w(0E) = 00FF0000 | |
| 913 | 00D0E5:zeus32_w(1E) = FFFFFFFF | |
| 914 | 00D0E6:zeus32_w(1C) = FFFFFFFF | |
| 915 | 00D0E7:zeus32_w(1A) = FFFFFFFF | |
| 916 | 00D0E8:zeus32_w(18) = FFFFFFFF | |
| 917 | 00D0EA:zeus32_w(46) = 00000000 | |
| 918 | 00D0EB:zeus32_w(44) = 00000000 | |
| 919 | 00D0EC:zeus32_w(42) = 00000000 | |
| 920 | 00D0ED:zeus32_w(40) = 00000000 | |
| 921 | 00D0EE:zeus32_w(26) = 00000000 | |
| 922 | 00D0EF:zeus32_w(24) = 00000000 | |
| 923 | 00D0F0:zeus32_w(22) = 00000000 | |
| 924 | 00D0F1:zeus32_w(20) = 00000000 | |
| 925 | 00D09A:zeus32_w(80) = FB22FCFF | |
| 926 | 00D0F6:zeus32_w(60) = 00000001 | |
| 927 | 00D09A:zeus32_w(80) = FB22FC3F | |
| 928 | Zeus cmd 17 : 1757500A | |
| 929 | Zeus cmd 17 : 175600FF | |
| 930 | 00D09A:zeus32_w(80) = 0222FC3F | |
| 931 | ||
| 932 | ||
| 933 | */ | |
| 606 | 934 | static void render_poly_4bit(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid) |
| 607 | 935 | { |
| 608 | 936 | const poly_extra_data *extra = extradata; |
| r1355 | r1356 | |
| 618 | 946 | int texwidth = extra->texwidth; |
| 619 | 947 | int x; |
| 620 | 948 | |
| 949 | if (extra->alpha < 0x80) | |
| 950 | return; | |
| 951 | ||
| 621 | 952 | for (x = extent->startx; x < extent->stopx; x++) |
| 622 | 953 | { |
| 623 | 954 | float z = recip_approx(ooz); |
| r1355 | r1356 | |
| 655 | 986 | int texwidth = extra->texwidth; |
| 656 | 987 | int x; |
| 657 | 988 | |
| 989 | if (extra->alpha < 0x80) | |
| 990 | return; | |
| 991 | ||
| 658 | 992 | for (x = extent->startx; x < extent->stopx; x++) |
| 659 | 993 | { |
| 660 | 994 | float z = recip_approx(ooz); |
| r1355 | r1356 | |
| 677 | 1011 | } |
| 678 | 1012 | |
| 679 | 1013 | |
| 680 | static void zeus_draw_ | |
| 1014 | static void zeus_draw_model | |
| 681 | 1015 | { |
| 682 | 1016 | static UINT32 *loglist[1000]; |
| 683 | 1017 | static int loglist_last = 0; |
| r1355 | r1356 | |
| 694 | 1028 | if (logcmd) |
| 695 | 1029 | { |
| 696 | 1030 | 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, | |
| 699 | 1033 | 512 >> texwshift, |
| 1034 | (val2 & 0x20) ? 8 : 4, | |
| 700 | 1035 | ((val1 << (7 - texwshift)) >> 10) & 0xfff, |
| 701 | 1036 | ((val1 << (7 - texwshift)) >> 1) & 0x1ff |
| 702 | 1037 | ); |
| 703 | 1038 | } |
| 704 | 1039 | |
| 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 | ||
| 715 | 1040 | if (logcmd) |
| 716 | 1041 | { |
| 717 | 1042 | for (i = 0; i < loglist_last; i++) |
| r1355 | r1356 | |
| 790 | 1115 | vert[i].y += 128.0f; |
| 791 | 1116 | } |
| 792 | 1117 | |
| 793 | val1 <<= 7 - texwshift; | |
| 794 | ||
| 795 | 1118 | extra = poly_get_extra_data(poly); |
| 796 | 1119 | extra->transcolor = 0x100; |
| 797 | extra->texbase = &waveram[val1 & 0x3fffff]; | |
| 1120 | extra->texbase = &waveram[(val1 << (7 - texwshift)) & 0x3fffff]; | |
| 798 | 1121 | extra->texwidth = 512 >> texwshift; |
| 799 | 1122 | extra->palbase = zeus_palbase; |
| 800 | 1123 | 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 | ||
| 801 | 1134 | poly_render_quad(poly, NULL, &Machine->screen[0].visarea, callback, 3, &vert[0], &vert[1], &vert[2], &vert[3]); |
| 1135 | poly_wait(poly, "Normal"); | |
| 802 | 1136 | |
| 803 | poly_wait(poly, "Normal"); | |
| 1137 | if (single_step) | |
| 1138 | while (!single_step_advance) video_frame_update(TRUE); | |
| 804 | 1139 | } |
| 805 | else if (data[datanum] == 0x0c018000) | |
| 1140 | else if (data[datanum] == 0x0c018000/* mk4 */ || data[datanum] == 0x0c008000/* invasn */) | |
| 806 | 1141 | next_addr_and_count = data[datanum + 1]; |
| 807 | 1142 | } |
| 808 | 1143 | if (datanum != count) |
| r1355 | r1356 | |
| 816 | 1151 | } |
| 817 | 1152 | |
| 818 | 1153 | |
| 819 | static 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 | ||
| 917 | static 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 | ||
| 955 | 1154 | READ32_HANDLER( zeus_r ) |
| 956 | 1155 | { |
| 957 | 1156 | int logit = (offset < 0xb0 || offset > 0xb7); |
| r1355 | r1356 | |
| 1026 | 1225 | { |
| 1027 | 1226 | int logit = zeus_enable_logging || ((offset < 0xb0 || offset > 0xb7) && (offset < 0xe0 || offset > 0xe1)); |
| 1028 | 1227 | |
| 1228 | if (logit) | |
| 1229 | logerror("%06X:zeus_w", activecpu_get_pc()); | |
| 1230 | ||
| 1029 | 1231 | /* 32-bit mode */ |
| 1030 | 1232 | if (zeusbase[0x80] & 0x00020000) |
| 1031 | { | |
| 1032 | zeusbase[offset & ~1] = data; | |
| 1233 | zeus_write_32bit(offset, data, logit); | |
| 1033 | 1234 | |
| 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 | ||
| 1045 | 1235 | /* 16-bit mode */ |
| 1046 | 1236 | else |
| 1237 | zeus_write_16bit(offset, data, logit); | |
| 1238 | } | |
| 1239 | ||
| 1240 | ||
| 1241 | READ32_HANDLER( zeus2_r ) | |
| 1242 | { | |
| 1243 | return zeus_r(offset * 2, 0); | |
| 1244 | } | |
| 1245 | ||
| 1246 | ||
| 1247 | WRITE32_HANDLER( zeus2_w ) | |
| 1248 | { | |
| 1249 | zeus_w(offset * 2, data, mem_mask); | |
| 1250 | } | |
| 1251 | ||
| 1252 | ||
| 1253 | static 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 | ||
| 1273 | static 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) | |
| 1047 | 1280 | { |
| 1048 | 1281 | 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); | |
| 1050 | 1285 | 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); | |
| 1055 | 1287 | } |
| 1056 | 1288 | |
| 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 | ||
| 1397 | Notes: | |
| 1398 | ||
| 1399 | In 16-bit mode, writes to $E0 are done via $E1 first then $E0 | |
| 1400 | ||
| 1401 | ------------------------------------------------------- | |
| 1402 | ||
| 1403 | Old 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 | ||
| 1431 | static void zeus_process_write(offs_t offset) | |
| 1432 | { | |
| 1057 | 1433 | /* handle the writes; only trigger on low accesses */ |
| 1058 | 1434 | switch (offset) |
| 1059 | 1435 | { |
| r1355 | r1356 | |
| 1061 | 1437 | /* invasn writes here to execute a command (?) */ |
| 1062 | 1438 | if (zeusbase[0x60] & 1) |
| 1063 | 1439 | { |
| 1064 | if (zeusbase[0x80] == 0x | |
| 1440 | if ((zeusbase[0x80] & 0xffffff) == 0x | |
| 1065 | 1441 | { |
| 1066 | 1442 | int startx, stopx, starty, stopy; |
| 1067 | 1443 | int x, y; |
| r1355 | r1356 | |
| 1094 | 1470 | for (y = starty; y <= stopy; y++) |
| 1095 | 1471 | for (x = startx; x <= stopx; x++) |
| 1096 | 1472 | 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"); | |
| 1097 | 1476 | } |
| 1098 | 1477 | else |
| 1099 | 1478 | logerror("Execute unknown command\n"); |
| r1355 | r1356 | |
| 1131 | 1510 | } |
| 1132 | 1511 | break; |
| 1133 | 1512 | |
| 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 | ||
| 1134 | 1555 | case 0xe0: |
| 1135 | 1556 | zeuscmd_buffer[zeuscmd_buffer_words++] = zeusbase[0xe0]; |
| 1136 | 1557 | if (zeuscmd_buffer_words == 1) |
| 1137 | 1558 | zeuscmd_buffer_expected_words = zeuscmd_length(zeusbase[0xe0]); |
| 1138 | 1559 | if (zeuscmd_buffer_words == zeuscmd_buffer_expected_words) |
| 1139 | 1560 | { |
| 1140 | zeuscmd_execute(); | |
| 1561 | zeuscmd_execute(zeuscmd_buffer_expected_words); | |
| 1141 | 1562 | zeuscmd_buffer_words = 0; |
| 1142 | 1563 | } |
| 1143 | 1564 | break; |
| r1355 | r1356 | |
| 1145 | 1566 | } |
| 1146 | 1567 | |
| 1147 | 1568 | |
| 1148 | ||
| 1569 | static void log_waveram(UINT32 length_and_base) | |
| 1149 | 1570 | { |
| 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]); | |
| 1151 | 1605 | } |
| 1152 | 1606 | |
| 1153 | 1607 | |
| 1154 | ||
| 1608 | static | |
| 1155 | 1609 | { |
| 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 | } | |
| 1157 | 1808 | } |
| 1809 | ||
| 1810 | ||
| 1811 | static 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 |
| r1355 | r1356 | |
|---|---|---|
| 153 | 153 | static const int decode_x_zr107[8] = { 0, 16, 1, 17, 2, 18, 3, 19 }; |
| 154 | 154 | static const int decode_y_zr107[16] = { 0, 8, 32, 40, 4, 12, 36, 44, 64, 72, 96, 104, 68, 76, 100, 108 }; |
| 155 | 155 | |
| 156 | UINT32 K001005_status = 0; | |
| 156 | static UINT32 K001005_status = 0; | |
| 157 | 157 | static mame_bitmap *K001005_bitmap[2]; |
| 158 | 158 | static mame_bitmap *K001005_zbuffer; |
| 159 | 159 | static rectangle K001005_cliprect; |
| r1355 | r1356 | |
|---|---|---|
| 820 | 820 | |
| 821 | 821 | bg_bits = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); |
| 822 | 822 | |
| 823 | scanline_timer = timer_alloc(scanline_callback); | |
| 823 | scanline_timer = timer_alloc(scanline_callback, NULL); | |
| 824 | 824 | timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero); |
| 825 | 825 | |
| 826 | 826 | } |
| r1355 | r1356 | |
| 837 | 837 | |
| 838 | 838 | bg_bits = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); |
| 839 | 839 | |
| 840 | scanline_timer = timer_alloc(scanline_callback); | |
| 840 | scanline_timer = timer_alloc(scanline_callback, NULL); | |
| 841 | 841 | timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero); |
| 842 | 842 | |
| 843 | 843 | } |
| r1355 | r1356 | |
|---|---|---|
| 35 | 35 | #include "kaneko16.h" |
| 36 | 36 | #include "kan_pand.h" |
| 37 | 37 | |
| 38 | UINT16 kaneko16_disp_enable = 1; // default enabled for games not using it | |
| 38 | static UINT16 kaneko16_disp_enable = 1; // default enabled for games not using it | |
| 39 | 39 | |
| 40 | 40 | |
| 41 | 41 | static tilemap *kaneko16_tmap_0, *kaneko16_tmap_1; |
| r1355 | r1356 | |
| 49 | 49 | UINT16* galsnew_fg_pixram; |
| 50 | 50 | |
| 51 | 51 | int kaneko16_sprite_type; |
| 52 | int kaneko16_keep_sprites = 0; // default disabled for games not using it | |
| 52 | static int kaneko16_keep_sprites = 0; // default disabled for games not using it | |
| 53 | 53 | UINT16 kaneko16_sprite_xoffs, kaneko16_sprite_flipx; |
| 54 | 54 | UINT16 kaneko16_sprite_yoffs, kaneko16_sprite_flipy; |
| 55 | 55 | UINT16 *kaneko16_sprites_regs; |
| r1355 | r1356 | |
|---|---|---|
| 444 | 444 | init_gfxelement(machine, mo, desc->gfxindex); |
| 445 | 445 | |
| 446 | 446 | /* 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); | |
| 448 | 448 | timer_adjust(force_update_timer,video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero); |
| 449 | 449 | |
| 450 | 450 | init_savestate(map, mo); |
| r1355 | r1356 | |
|---|---|---|
| 267 | 267 | } |
| 268 | 268 | } |
| 269 | 269 | |
| 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); | |
| 271 | 271 | |
| 272 | 272 | state = 1; |
| 273 | 273 | } |
| r1355 | r1356 | |
|---|---|---|
| 230 | 230 | int kludge; /* Ghouls n Ghosts sprite kludge */ |
| 231 | 231 | }; |
| 232 | 232 | |
| 233 | struct CPS1config *cps1_game_config; | |
| 233 | static struct CPS1config *cps1_game_config; | |
| 234 | 234 | |
| 235 | 235 | /* CPSB ID multiply protection ctrl priority masks unknwn layer enable masks */ |
| 236 | 236 | #define CPS_B_01 0x00,0x0000, 0,0,0,0, /* n/a */ 0x66,{0x68,0x6a,0x6c,0x6e},0x70, {0x02,0x04,0x08,0x30,0x30} |
| r1355 | r1356 | |
| 601 | 601 | static int palette_basecolor[6]; |
| 602 | 602 | #define cps1_palette_entries (32*8) /* Number colour schemes in palette */ |
| 603 | 603 | |
| 604 | const int cps1_scroll_size =0x4000; /* scroll1, scroll2, scroll3 */ | |
| 605 | const int cps1_obj_size =0x0800; | |
| 606 | const int cps1_other_size =0x0800; | |
| 607 | const int cps1_palette_align=0x0800; /* can't be larger than this, breaks ringdest & batcirc otherwise */ | |
| 608 | const int cps1_palette_size=cps1_palette_entries*32; /* Size of palette RAM */ | |
| 604 | static const int cps1_scroll_size =0x4000; /* scroll1, scroll2, scroll3 */ | |
| 605 | static const int cps1_obj_size =0x0800; | |
| 606 | static const int cps1_other_size =0x0800; | |
| 607 | static const int cps1_palette_align=0x0800; /* can't be larger than this, breaks ringdest & batcirc otherwise */ | |
| 608 | static const int cps1_palette_size=cps1_palette_entries*32; /* Size of palette RAM */ | |
| 609 | 609 | |
| 610 | 610 | static UINT16 *cps1_scroll1; |
| 611 | 611 | static UINT16 *cps1_scroll2; |
| r1355 | r1356 | |
| 661 | 661 | static const int stars_rom_size = 0x2000; |
| 662 | 662 | |
| 663 | 663 | /* PSL: CPS2 support */ |
| 664 | const int cps2_obj_size =0x2000; | |
| 664 | static const int cps2_obj_size =0x2000; | |
| 665 | 665 | UINT16 *cps2_objram1,*cps2_objram2; |
| 666 | 666 | UINT16 *cps2_output; |
| 667 | 667 |
| r1355 | r1356 | |
|---|---|---|
| 39 | 39 | audio bits are in the same bytes, and there are so few |
| 40 | 40 | samples... */ |
| 41 | 41 | |
| 42 | int starcrus_engine_sound_playing = 0; | |
| 43 | int starcrus_explode_sound_playing = 0; | |
| 44 | int starcrus_launch1_sound_playing = 0; | |
| 45 | int starcrus_launch2_sound_playing = 0; | |
| 42 | static int starcrus_engine_sound_playing = 0; | |
| 43 | static int starcrus_explode_sound_playing = 0; | |
| 44 | static int starcrus_launch1_sound_playing = 0; | |
| 45 | static int starcrus_launch2_sound_playing = 0; | |
| 46 | 46 | |
| 47 | 47 | WRITE8_HANDLER( starcrus_s1_x_w ) { s1_x = data^0xff; } |
| 48 | 48 | WRITE8_HANDLER( starcrus_s1_y_w ) { s1_y = data^0xff; } |
| r1355 | r1356 | |
|---|---|---|
| 161 | 161 | if (offset == 7) |
| 162 | 162 | { |
| 163 | 163 | 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); | |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | /* clear the IRQ on offset 0 */ |
| r1355 | r1356 | |
|---|---|---|
| 517 | 517 | blit_in_progress = 1; |
| 518 | 518 | |
| 519 | 519 | /* 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); | |
| 521 | 521 | } |
| 522 | 522 | |
| 523 | 523 | /* debugging */ |
| r1355 | r1356 | |
|---|---|---|
| 1731 | 1731 | |
| 1732 | 1732 | galaxian_stars_on = 0; |
| 1733 | 1733 | 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); | |
| 1736 | 1736 | timer_adjusted = 0; |
| 1737 | 1737 | stars_colors_start = colors_offset; |
| 1738 | 1738 |
| r1355 | r1356 | |
|---|---|---|
| 364 | 364 | { |
| 365 | 365 | if (sync_next_write) |
| 366 | 366 | { |
| 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); | |
| 368 | 368 | sync_next_write = 0; |
| 369 | 369 | } |
| 370 | 370 | else |
| r1355 | r1356 | |
| 415 | 415 | offset = ((offset >> 1) & 0x07) | ((offset << 3) & 0x08) | (offset & 0x10); |
| 416 | 416 | if (sync_next_write) |
| 417 | 417 | { |
| 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); | |
| 419 | 419 | sync_next_write = 0; |
| 420 | 420 | } |
| 421 | 421 | else |
| r1355 | r1356 | |
| 474 | 474 | update_for_scanline(VIDEO_HEIGHT * 8); |
| 475 | 475 | |
| 476 | 476 | /* 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); | |
| 478 | 478 | } |
| 479 | 479 | |
| 480 | 480 |
| r1355 | r1356 | |
|---|---|---|
| 53 | 53 | /* set a timer to mimic the 555 timer that drives the EDGINT signal */ |
| 54 | 54 | /* the 555 is run in monostable mode with R=56000 and C=1000pF */ |
| 55 | 55 | 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); | |
| 57 | 57 | |
| 58 | 58 | /* latch the current flip state at the same time */ |
| 59 | 59 | video_flip = video_control & 1; |
| r1355 | r1356 | |
|---|---|---|
| 1178 | 1178 | } |
| 1179 | 1179 | |
| 1180 | 1180 | /* 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); | |
| 1182 | 1182 | } |
| 1183 | 1183 | |
| 1184 | 1184 | |
| 1185 | 1185 | static void segaic16_tilemap_16b_reset(struct tilemap_info *info) |
| 1186 | 1186 | { |
| 1187 | 1187 | /* 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); | |
| 1189 | 1189 | } |
| 1190 | 1190 | |
| 1191 | 1191 |
| r1355 | r1356 | |
|---|---|---|
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | 102 | /* 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); | |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 |
| r1355 | r1356 | |
|---|---|---|
| 84 | 84 | vram_mask = 0xff; |
| 85 | 85 | |
| 86 | 86 | /* allocate a timer */ |
| 87 | scanline_timer = timer_alloc(scanline_callback); | |
| 87 | scanline_timer = timer_alloc(scanline_callback, NULL); | |
| 88 | 88 | timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 1, 0), 1, attotime_zero); |
| 89 | 89 | |
| 90 | 90 | /* set up save states */ |
| r1355 | r1356 | |
|---|---|---|
| 118 | 118 | //UINT16 *atarirle_0_table; |
| 119 | 119 | //UINT32 *atarirle_0_table32; |
| 120 | 120 | |
| 121 | int atarirle_hilite_index = -1; | |
| 121 | static int atarirle_hilite_index = -1; | |
| 122 | 122 | |
| 123 | 123 | |
| 124 | 124 |
| r1355 | r1356 | |
|---|---|---|
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | 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); | |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | /****************************************************************************** |
| r1355 | r1356 | |
|---|---|---|
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | |
| 371 | WRITE8_HANDLER( mazeinv_paletteram_w ) | |
| 372 | { | |
| 373 | int bit0,bit1,bit2; | |
| 374 | int r,g,b; | |
| 371 | 375 | |
| 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 | ||
| 372 | 402 | /************************************* |
| 373 | 403 | * |
| 374 | 404 | * Video update |
| r1355 | r1356 | |
|---|---|---|
| 201 | 201 | /* reset the statics */ |
| 202 | 202 | atarimo_set_yscroll(0, 256); |
| 203 | 203 | 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); | |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 |
| r1355 | r1356 | |
|---|---|---|
| 150 | 150 | { |
| 151 | 151 | if (p1[x] != 16 && p2[x] != 16) |
| 152 | 152 | { |
| 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); | |
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | 156 | } |
| r1355 | r1356 | |
|---|---|---|
| 33 | 33 | |
| 34 | 34 | static mame_bitmap *temp_bitmap; |
| 35 | 35 | |
| 36 | static UINT16 *tceptor_sprite_ram_buffered; | |
| 37 | ||
| 36 | 38 | static int is_mask_spr[1024/16]; |
| 37 | 39 | |
| 38 | 40 | /*******************************************************************/ |
| r1355 | r1356 | |
| 73 | 75 | /* color_prom now points to the beginning of the lookup table */ |
| 74 | 76 | |
| 75 | 77 | /* |
| 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 | */ | |
| 82 | 84 | |
| 83 | 85 | /* tiles lookup table (1024 colors) */ |
| 84 | 86 | for (i = 0; i < 1024;i++) |
| r1355 | r1356 | |
| 419 | 421 | { |
| 420 | 422 | int gfx_index; |
| 421 | 423 | |
| 424 | tceptor_sprite_ram_buffered = auto_malloc(0x200); | |
| 425 | memset(tceptor_sprite_ram_buffered, 0, 0x200); | |
| 426 | ||
| 422 | 427 | /* find first empty slot to decode gfx */ |
| 423 | 428 | for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++) |
| 424 | 429 | if (machine->gfx[gfx_index] == 0) |
| r1355 | r1356 | |
| 450 | 455 | bg1_tilemap = tilemap_create(get_bg1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32); |
| 451 | 456 | bg2_tilemap = tilemap_create(get_bg2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32); |
| 452 | 457 | |
| 458 | state_save_register_global_pointer(tceptor_sprite_ram_buffered, 0x200 / 2); | |
| 453 | 459 | state_save_register_global(bg1_scroll_x); |
| 454 | 460 | state_save_register_global(bg1_scroll_y); |
| 455 | 461 | state_save_register_global(bg2_scroll_x); |
| r1355 | r1356 | |
| 484 | 490 | |
| 485 | 491 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int sprite_priority) |
| 486 | 492 | { |
| 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]; | |
| 489 | 495 | int need_mask = 0; |
| 490 | 496 | int i; |
| 491 | 497 | |
| r1355 | r1356 | |
| 571 | 577 | int pri; |
| 572 | 578 | int bg_center = 144 - ((((bg1_scroll_x + bg2_scroll_x ) & 0x1ff) - 288) / 2); |
| 573 | 579 | |
| 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 | ||
| 574 | 590 | // left background |
| 575 | 591 | rect = *cliprect; |
| 576 | 592 | rect.max_x = bg_center; |
| r1355 | r1356 | |
| 595 | 611 | tilemap_draw(bitmap, cliprect, tx_tilemap, 0, 0); |
| 596 | 612 | return 0; |
| 597 | 613 | } |
| 614 | ||
| 615 | ||
| 616 | VIDEO_EOF( tceptor ) | |
| 617 | { | |
| 618 | memcpy(tceptor_sprite_ram_buffered, tceptor_sprite_ram, 0x200); | |
| 619 | } |
| r1355 | r1356 | |
|---|---|---|
| 70 | 70 | |
| 71 | 71 | VIDEO_START( midvunit ) |
| 72 | 72 | { |
| 73 | scanline_timer = timer_alloc(scanline_timer_cb); | |
| 73 | scanline_timer = timer_alloc(scanline_timer_cb, NULL); | |
| 74 | 74 | poly = poly_alloc(4000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS); |
| 75 | 75 | add_exit_callback(machine, midvunit_exit); |
| 76 | 76 | } |
| r1355 | r1356 | |
|---|---|---|
| 133 | 133 | tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0); |
| 134 | 134 | |
| 135 | 135 | /* reset the statics */ |
| 136 | yscroll_reset_timer = timer_alloc(reset_yscroll_callback); | |
| 136 | yscroll_reset_timer = timer_alloc(reset_yscroll_callback, NULL); | |
| 137 | 137 | videobank = 0; |
| 138 | 138 | } |
| 139 | 139 |
| r1355 | r1356 | |
|---|---|---|
| 734 | 734 | |
| 735 | 735 | pen_table = auto_malloc(65536 * sizeof(pen_t)); |
| 736 | 736 | |
| 737 | vi_timer = timer_alloc(vi_callback); | |
| 737 | vi_timer = timer_alloc(vi_callback, NULL); | |
| 738 | 738 | |
| 739 | 739 | state_save_register_global_pointer(pen_table, 65536); |
| 740 | 740 | state_save_register_global_array(blitter_regs); |
| r1355 | r1356 | |
|---|---|---|
| 106 | 106 | |
| 107 | 107 | VIDEO_START( spacefev ) |
| 108 | 108 | { |
| 109 | cannon_timer = timer_alloc(spacefev_stop_red_cannon); | |
| 109 | cannon_timer = timer_alloc(spacefev_stop_red_cannon, NULL); | |
| 110 | 110 | |
| 111 | 111 | flip_screen = 0; |
| 112 | 112 |
| r1355 | r1356 | |
|---|---|---|
| 479 | 479 | } |
| 480 | 480 | |
| 481 | 481 | 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); | |
| 483 | 483 | } |
| 484 | 484 | |
| 485 | 485 | /****************************************************************************** |
| r1355 | r1356 | |
|---|---|---|
| 17 | 17 | UINT8 *vb_videoram; |
| 18 | 18 | UINT8 *vb_attribram; |
| 19 | 19 | int vball_gfxset=0; |
| 20 | int vb_bgprombank=0xff; | |
| 21 | int vb_spprombank=0xff; | |
| 20 | static int vb_bgprombank=0xff; | |
| 21 | static int vb_spprombank=0xff; | |
| 22 | 22 | |
| 23 | 23 | static tilemap *bg_tilemap; |
| 24 | 24 | static int scrollx[32]; |
| r1355 | r1356 | |
|---|---|---|
| 224 | 224 | VIDEO_START( astrocde ) |
| 225 | 225 | { |
| 226 | 226 | /* allocate a per-scanline timer */ |
| 227 | scanline_timer = timer_alloc(scanline_callback); | |
| 227 | scanline_timer = timer_alloc(scanline_callback, NULL); | |
| 228 | 228 | timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 1, 0), 1, attotime_zero); |
| 229 | 229 | |
| 230 | 230 | /* register for save states */ |
| r1355 | r1356 | |
| 239 | 239 | VIDEO_START( profpac ) |
| 240 | 240 | { |
| 241 | 241 | /* allocate a per-scanline timer */ |
| 242 | scanline_timer = timer_alloc(scanline_callback); | |
| 242 | scanline_timer = timer_alloc(scanline_callback, NULL); | |
| 243 | 243 | timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 1, 0), 1, attotime_zero); |
| 244 | 244 | |
| 245 | 245 | /* allocate videoram */ |
| r1355 | r1356 | |
| 444 | 444 | else |
| 445 | 445 | { |
| 446 | 446 | 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); | |
| 448 | 448 | } |
| 449 | 449 | |
| 450 | 450 | /* latch the feedback registers */ |
| r1355 | r1356 | |
| 480 | 480 | else |
| 481 | 481 | { |
| 482 | 482 | 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); | |
| 484 | 484 | } |
| 485 | 485 | } |
| 486 | 486 |
| r1355 | r1356 | |
|---|---|---|
| 542 | 542 | nb1413m3_busyflag = 0; |
| 543 | 543 | |
| 544 | 544 | 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); | |
| 546 | 546 | 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); | |
| 548 | 548 | } |
| 549 | 549 | |
| 550 | 550 |
| r1355 | r1356 | |
|---|---|---|
| 21 | 21 | static int sprites_flipscreen = 0; |
| 22 | 22 | static UINT16 *spriteram_buffered,*spriteram_delayed; |
| 23 | 23 | |
| 24 | INT32 taito_sprite_type = 0; | |
| 24 | static INT32 taito_sprite_type = 0; | |
| 25 | 25 | UINT16 *taito_sprite_ext; |
| 26 | 26 | size_t taito_spriteext_size; |
| 27 | 27 | static UINT16 spritebank[8]; |
| r1355 | r1356 | |
|---|---|---|
| 97 | 97 | update_complete = 0; |
| 98 | 98 | video_control = 0; |
| 99 | 99 | memset(µ, 0, sizeof(micro)); |
| 100 | micro.timer = timer_alloc(NULL); | |
| 100 | micro.timer = timer_alloc(NULL, NULL); | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | |
| r1355 | r1356 | |
| 1180 | 1180 | int fpix = *fg++; |
| 1181 | 1181 | int bpix = bg[(x + scrollx) & 255]; |
| 1182 | 1182 | 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); | |
| 1184 | 1184 | } |
| 1185 | 1185 | } |
| 1186 | 1186 | } |
| r1355 | r1356 | |
| 1218 | 1218 | int bpix = bg[(x + scrollx) & 255]; |
| 1219 | 1219 | scanline[x] = bpix | (fpix << 3); |
| 1220 | 1220 | 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); | |
| 1222 | 1222 | } |
| 1223 | 1223 | |
| 1224 | 1224 | /* draw the scanline */ |
| r1355 | r1356 | |
|---|---|---|
| 1286 | 1286 | |
| 1287 | 1287 | flip_x = flip_y = 0; |
| 1288 | 1288 | |
| 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); | |
| 1291 | 1291 | |
| 1292 | 1292 | /* |
| 1293 | 1293 | * The x and y DACs use 10 bit of the counter values which are in |
| r1355 | r1356 | |
|---|---|---|
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | 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); | |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | /****************************************************************************** |
| r1355 | r1356 | |
|---|---|---|
| 354 | 354 | |
| 355 | 355 | /* check the collisions bit */ |
| 356 | 356 | 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); | |
| 358 | 358 | } |
| 359 | 359 | currx++; |
| 360 | 360 | |
| r1355 | r1356 | |
| 367 | 367 | |
| 368 | 368 | /* check the collisions bit */ |
| 369 | 369 | 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); | |
| 371 | 371 | } |
| 372 | 372 | currx++; |
| 373 | 373 | } |
| r1355 | r1356 | |
| 456 | 456 | time = attotime_sub(video_screen_get_time_until_pos(0, beamy, beamx), attotime_make(0, increment * 6)); |
| 457 | 457 | for (i = 0; i <= 12; i++) |
| 458 | 458 | { |
| 459 | timer_set(time, beamx, beam_firq_callback); | |
| 459 | timer_set(time, NULL, beamx, beam_firq_callback); | |
| 460 | 460 | time = attotime_add(time, attotime_make(0, increment)); |
| 461 | 461 | } |
| 462 | 462 | } |
| r1355 | r1356 | |
|---|---|---|
| 132 | 132 | period_on = video_screen_get_time_until_pos(scrnum, video_screen_get_vpos(scrnum) + 7, machine->screen[scrnum].width * 0.9); |
| 133 | 133 | period_off = video_screen_get_time_until_pos(scrnum, video_screen_get_vpos(scrnum) + 8, machine->screen[scrnum].width * 0.9); |
| 134 | 134 | |
| 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); | |
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | 139 |
| r1355 | r1356 | |
|---|---|---|
| 1443 | 1443 | static int K007342_gfxnum; |
| 1444 | 1444 | static int K007342_int_enabled; |
| 1445 | 1445 | static int K007342_flipscreen; |
| 1446 | static int K007342_scrollx[2]; | |
| 1447 | static int K007342_scrolly[2]; | |
| 1446 | static UINT16 K007342_scrollx[2]; | |
| 1447 | static UINT8 K007342_scrolly[2]; | |
| 1448 | 1448 | static UINT8 *K007342_videoram_0,*K007342_colorram_0; |
| 1449 | 1449 | static UINT8 *K007342_videoram_1,*K007342_colorram_1; |
| 1450 | static | |
| 1450 | static UINT8 K007342_regs[8]; | |
| 1451 | 1451 | static void (*K007342_callback)(int tmap, int bank, int *code, int *color, int *flags); |
| 1452 | 1452 | static tilemap *K007342_tilemap[2]; |
| 1453 | 1453 | |
| r1355 | r1356 | |
| 1517 | 1517 | |
| 1518 | 1518 | tilemap_set_transparent_pen(K007342_tilemap[0],0); |
| 1519 | 1519 | 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); | |
| 1520 | 1528 | } |
| 1521 | 1529 | |
| 1522 | 1530 | READ8_HANDLER( K007342_r ) |
| r1355 | r1356 | |
| 1677 | 1685 | memset(K007420_ram,0,0x200); |
| 1678 | 1686 | |
| 1679 | 1687 | K007420_banklimit = -1; |
| 1688 | ||
| 1689 | state_save_register_global_pointer(K007420_ram, 0x0200); | |
| 1690 | state_save_register_global(K007420_banklimit); | |
| 1680 | 1691 | } |
| 1681 | 1692 | |
| 1682 | 1693 | READ8_HANDLER( K007420_r ) |
| r1355 | r1356 | |
| 2468 | 2479 | K051960_callback = callback; |
| 2469 | 2480 | K051960_ram = auto_malloc(0x400); |
| 2470 | 2481 | 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); | |
| 2471 | 2490 | } |
| 2472 | 2491 | |
| 2473 | 2492 | |
| r1355 | r1356 | |
| 2964 | 2983 | |
| 2965 | 2984 | memset(K053245_ram[chip],0,K053245_ramsize[chip]); |
| 2966 | 2985 | 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]); | |
| 2967 | 2993 | } |
| 2968 | 2994 | |
| 2969 | 2995 | void K053245_set_SpriteOffset(int chip,int offsx, int offsy) |
| r1355 | r1356 | |
| 4613 | 4639 | |
| 4614 | 4640 | K051316_wraparound[chip] = 0; /* default = no wraparound */ |
| 4615 | 4641 | 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]); | |
| 4616 | 4648 | } |
| 4617 | 4649 | |
| 4618 | 4650 | void K051316_vh_start_0(running_machine *machine,int gfx_memory_region,int bpp, |
| r1355 | r1356 | |
|---|---|---|
| 48 | 48 | { |
| 49 | 49 | timer_value = 0; |
| 50 | 50 | |
| 51 | timer_pulse(ATTOTIME_IN_SEC(1), 0, countdown_timer_callback); | |
| 51 | timer_pulse(ATTOTIME_IN_SEC(1), NULL, 0, countdown_timer_callback); | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 |
| r1355 | r1356 | |
|---|---|---|
| 1065 | 1065 | } |
| 1066 | 1066 | #endif |
| 1067 | 1067 | |
| 1068 | static void after(int cycles, | |
| 1068 | static void after(int cycles, | |
| 1069 | 1069 | { |
| 1070 | 1070 | attotime duration = attotime_make(0, attotime_to_attoseconds(video_screen_get_scan_period(0)) * cycles / CYCLES_PER_LINE); |
| 1071 | 1071 | (void)funcname; |
| 1072 | 1072 | 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); | |
| 1074 | 1074 | } |
| 1075 | 1075 | |
| 1076 | 1076 | static TIMER_CALLBACK( antic_issue_dli ) |
| r1355 | r1356 | |
|---|---|---|
| 378 | 378 | { |
| 379 | 379 | /* at the end of VBLANK is when automatic sprite rendering happens */ |
| 380 | 380 | if (!state) |
| 381 | timer_set(ATTOTIME_IN_USEC(50), 1, update_sprites); | |
| 381 | timer_set(ATTOTIME_IN_USEC(50), NULL, 1, update_sprites); | |
| 382 | 382 | } |
| 383 | 383 | |
| 384 | 384 |
| r1355 | r1356 | |
|---|---|---|
| 90 | 90 | tilemap_set_transparent_pen(fg_tilemap,15); |
| 91 | 91 | |
| 92 | 92 | /* reset the timer */ |
| 93 | crtc_timer = timer_alloc(crtc_interrupt_gen); | |
| 93 | crtc_timer = timer_alloc(crtc_interrupt_gen, NULL); | |
| 94 | 94 | |
| 95 | 95 | scrollx_ofs = 0x159; |
| 96 | 96 | scrolly_ofs = 0x10; |
| r1355 | r1356 | |
| 129 | 129 | tilemap_set_transparent_pen(fg_tilemap,15); |
| 130 | 130 | |
| 131 | 131 | /* reset the timer */ |
| 132 | crtc_timer = timer_alloc(crtc_interrupt_gen); | |
| 132 | crtc_timer = timer_alloc(crtc_interrupt_gen, NULL); | |
| 133 | 133 | |
| 134 | 134 | scrollx_ofs = 0x159; |
| 135 | 135 | scrolly_ofs = 0x10; |
| r0 | r1356 | |
|---|---|---|
| 1 | #include "driver.h" | |
| 2 | #include "video/segaic24.h" | |
| 3 | #include "includes/segas24.h" | |
| 4 | ||
| 5 | VIDEO_START(system24) | |
| 6 | { | |
| 7 | sys24_tile_vh_start(machine, 0xfff); | |
| 8 | sys24_sprite_vh_start(); | |
| 9 | sys24_mixer_vh_start(); | |
| 10 | } | |
| 11 | ||
| 12 | static 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 | ||
| 24 | VIDEO_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 | } |
| r1355 | r1356 | |
|---|---|---|
| 256 | 256 | |
| 257 | 257 | static void create_auto_animation_timer(void) |
| 258 | 258 | { |
| 259 | auto_animation_timer = timer_alloc(auto_animation_timer_callback); | |
| 259 | auto_animation_timer = timer_alloc(auto_animation_timer_callback, NULL); | |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | |
| r1355 | r1356 | |
| 678 | 678 | |
| 679 | 679 | static void create_sprite_line_timer(void) |
| 680 | 680 | { |
| 681 | sprite_line_timer = timer_alloc(sprite_line_timer_callback); | |
| 681 | sprite_line_timer = timer_alloc(sprite_line_timer_callback, NULL); | |
| 682 | 682 | } |
| 683 | 683 | |
| 684 | 684 |
| r1355 | r1356 | |
|---|---|---|
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | /* 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); | |
| 301 | 301 | chips[i].scanline = 0; |
| 302 | 302 | chips[i].scan_scale = 1; |
| 303 | 303 |
| r1355 | r1356 | |
|---|---|---|
| 38 | 38 | tiles are always accessible) |
| 39 | 39 | ************************************************************/ |
| 40 | 40 | |
| 41 | int f2_sprite_type = 0; | |
| 41 | static int f2_sprite_type = 0; | |
| 42 | 42 | UINT16 *f2_sprite_extension; |
| 43 | 43 | size_t f2_spriteext_size; |
| 44 | 44 | |
| r1355 | r1356 | |
| 67 | 67 | static INT32 f2_tilemap_yoffs = 0; |
| 68 | 68 | static INT32 f2_text_xoffs = 0; |
| 69 | 69 | |
| 70 | int f2_tilemap_col_base = 0; | |
| 70 | static int f2_tilemap_col_base = 0; | |
| 71 | 71 | |
| 72 | 72 | static INT32 f2_game = 0; |
| 73 | 73 | static INT32 FOOTCHMP = 1; |
| r1355 | r1356 | |
|---|---|---|
| 569 | 569 | cpunum_set_input_line(3,0,CLEAR_LINE); |
| 570 | 570 | |
| 571 | 571 | /* 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); | |
| 573 | 573 | |
| 574 | 574 | /* 3.clear of /SINT starts sprite drawing circuit */ |
| 575 | 575 | draw_sprite(); |
| r1355 | r1356 | |
|---|---|---|
| 372 | 372 | |
| 373 | 373 | /* if we got one, trigger an interrupt */ |
| 374 | 374 | 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); | |
| 376 | 376 | } |
| 377 | 377 | if (*BITMAP_ADDR16(motion_object_2_vid, sy, sx) != 0xff) |
| 378 | 378 | { |
| 379 | 379 | /* check for background collision (M2CHAR) */ |
| 380 | 380 | if (((*BITMAP_ADDR16(tmpbitmap, org_2_y + sy, org_2_x + sx) - 4) & bgmask) != 0) |
| 381 | 381 | 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); | |
| 383 | 383 | } |
| 384 | 384 | } |
| 385 | 385 | } |
| r1355 | r1356 | |
|---|---|---|
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | 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); | |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 |
| r1355 | r1356 | |
|---|---|---|
| 64 | 64 | |
| 65 | 65 | /* generate interrupts for player 1's gun */ |
| 66 | 66 | 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); | |
| 69 | 69 | |
| 70 | 70 | /* generate interrupts for player 2's gun */ |
| 71 | 71 | 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); | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | |
| r1355 | r1356 | |
| 84 | 84 | VIDEO_START( tickee ) |
| 85 | 85 | { |
| 86 | 86 | /* 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); | |
| 88 | 88 | timer_adjust(setup_gun_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero); |
| 89 | 89 | } |
| 90 | 90 |
| r1355 | r1356 | |
|---|---|---|
| 99 | 99 | /* Pixel clock is 26.6666 MHz, we have 0x800 bytes, or 0x400 words |
| 100 | 100 | to copy from spriteram to the buffer. It seems safe to assume 1 |
| 101 | 101 | 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); | |
| 103 | 103 | } |
| 104 | 104 | // logerror("%04x: m92_spritecontrol_w %08x %08x\n",activecpu_get_pc(),offset,data); |
| 105 | 105 | } |
| r1355 | r1356 | |
|---|---|---|
| 111 | 111 | dstbitmap = auto_bitmap_alloc(DSTBITMAP_WIDTH, DSTBITMAP_HEIGHT, machine->screen[0].format); |
| 112 | 112 | |
| 113 | 113 | /* create a timer */ |
| 114 | blitter_timer = timer_alloc(blitter_scanline_callback); | |
| 114 | blitter_timer = timer_alloc(blitter_scanline_callback, NULL); | |
| 115 | 115 | |
| 116 | 116 | /* register for saving */ |
| 117 | 117 | state_save_register_global_array(blitter_color); |
| r1355 | r1356 | |
| 162 | 162 | memset(BITMAP_ADDR16(dstbitmap, y % DSTBITMAP_HEIGHT, 0), 0, DSTBITMAP_WIDTH * 2); |
| 163 | 163 | |
| 164 | 164 | /* 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); | |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | |
| r1355 | r1356 | |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | /* 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); | |
| 220 | 220 | |
| 221 | 221 | /* these extra parameters are written but they are always zero, so I don't know what they do */ |
| 222 | 222 | if (blitter_xparam[8] != 0 || blitter_xparam[9] != 0 || blitter_xparam[10] != 0 || blitter_xparam[11] != 0 || |
| r1355 | r1356 | |
|---|---|---|
| 95 | 95 | memset(rpunch_bitmapram, 0xff, rpunch_bitmapram_size); |
| 96 | 96 | |
| 97 | 97 | /* reset the timer */ |
| 98 | crtc_timer = timer_alloc(crtc_interrupt_gen); | |
| 98 | crtc_timer = timer_alloc(crtc_interrupt_gen, NULL); | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 |
| r1355 | r1356 | |
|---|---|---|
| 46 | 46 | tree0_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); |
| 47 | 47 | tree1_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format); |
| 48 | 48 | |
| 49 | changela_scanline_timer = timer_alloc(changela_scanline_callback); | |
| 49 | changela_scanline_timer = timer_alloc(changela_scanline_callback, NULL); | |
| 50 | 50 | timer_adjust(changela_scanline_timer, video_screen_get_time_until_pos(0, 30, 0), 30, attotime_zero); |
| 51 | 51 | |
| 52 | 52 | state_save_register_global(slopeROM_bank); |
| r1355 | r1356 | |
|---|---|---|
| 129 | 129 | |
| 130 | 130 | if (hit_line != 999 && hit_code != 999) |
| 131 | 131 | { |
| 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); | |
| 133 | 133 | } |
| 134 | 134 | } |
| 135 | 135 |
| r1355 | r1356 | |
|---|---|---|
| 143 | 143 | bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, |
| 144 | 144 | TILEMAP_TYPE_PEN, 8, 8, 32, 32); |
| 145 | 145 | |
| 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 */ | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect) |
| r0 | r1356 | |
|---|---|---|
| 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> |
| r0 | r1356 | |
|---|---|---|
| 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> |
| r1355 | r1356 | |
|---|---|---|
| 4 | 4 | <element name="bezel"> |
| 5 | 5 | </element> |
| 6 | 6 | |
| 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"> | |
| 8 | 11 | <rect state="0"> |
| 9 | 12 | <color red="0.5" green="0.5" blue="0.5" /> |
| 10 | 13 | </rect> |
| 11 | 14 | <rect state="1"> |
| 12 | 15 | <color red="1.0" green="1.0" blue="1.0" /> |
| 13 | 16 | </rect> |
| 14 | <text string=" | |
| 17 | <text string="START"> | |
| 15 | 18 | <color red="0.0" green="0.0" blue="0.0" /> |
| 16 | 19 | <bounds x="0" y="0.1" width="1" height="0.8" /> |
| 17 | 20 | </text> |
| 18 | 21 | </element> |
| 19 | 22 | |
| 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> | |
| 21 | 28 | <rect state="1"> |
| 22 | <color red="1.0" green=" | |
| 29 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 23 | 30 | </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"> | |
| 24 | 37 | <rect state="0"> |
| 25 | <color red="0.5" green="0. | |
| 38 | <color red="0.5" green="0.5" blue="0.5" /> | |
| 26 | 39 | </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> | |
| 27 | 47 | </element> |
| 28 | ||
| 29 | <element name="dooropen" defstate="1"> | |
| 48 | <element name="hopper2" defstate="1"> | |
| 30 | 49 | <rect state="0"> |
| 31 | 50 | <color red="0.5" green="0.5" blue="0.5" /> |
| 32 | 51 | </rect> |
| 33 | 52 | <rect state="1"> |
| 34 | 53 | <color red="1.0" green="1.0" blue="1.0" /> |
| 35 | 54 | </rect> |
| 36 | <text string=" | |
| 55 | <text string="HO | |
| 37 | 56 | <color red="0.0" green="0.0" blue="0.0" /> |
| 38 | 57 | <bounds x="0" y="0.1" width="1" height="0.8" /> |
| 39 | 58 | </text> |
| 40 | 59 | </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> | |
| 43 | 64 | <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"> | |
| 44 | 82 | <color red="0.5" green="0.5" blue="0.5" /> |
| 45 | 83 | </rect> |
| 46 | 84 | <rect state="1"> |
| 47 | 85 | <color red="1.0" green="1.0" blue="1.0" /> |
| 48 | 86 | </rect> |
| 49 | <text string=" | |
| 87 | <text string="BET | |
| 50 | 88 | <color red="0.0" green="0.0" blue="0.0" /> |
| 51 | 89 | <bounds x="0" y="0.1" width="1" height="0.8" /> |
| 52 | 90 | </text> |
| 53 | 91 | </element> |
| 54 | ||
| 55 | <element name="cashout" defstate="1"> | |
| 92 | <element name="betmax" defstate="1"> | |
| 56 | 93 | <rect state="0"> |
| 57 | 94 | <color red="0.5" green="0.5" blue="0.5" /> |
| 58 | 95 | </rect> |
| 59 | 96 | <rect state="1"> |
| 60 | 97 | <color red="1.0" green="1.0" blue="1.0" /> |
| 61 | 98 | </rect> |
| 62 | <text string=" | |
| 99 | <text string="BE | |
| 63 | 100 | <color red="0.0" green="0.0" blue="0.0" /> |
| 64 | 101 | <bounds x="0" y="0.1" width="1" height="0.8" /> |
| 65 | 102 | </text> |
| 66 | 103 | </element> |
| 67 | ||
| 68 | <element name="betcredits" defstate="1"> | |
| 104 | <element name="cashout" defstate="1"> | |
| 69 | 105 | <rect state="0"> |
| 70 | 106 | <color red="0.5" green="0.5" blue="0.5" /> |
| 71 | 107 | </rect> |
| 72 | 108 | <rect state="1"> |
| 73 | 109 | <color red="1.0" green="1.0" blue="1.0" /> |
| 74 | 110 | </rect> |
| 75 | <text string=" | |
| 111 | <text string=" | |
| 76 | 112 | <color red="0.0" green="0.0" blue="0.0" /> |
| 77 | 113 | <bounds x="0" y="0.1" width="1" height="0.8" /> |
| 78 | 114 | </text> |
| r1355 | r1356 | |
| 85 | 121 | <bezel element="bezel"> |
| 86 | 122 | <bounds left="0" top="0" right="340" bottom="310" /> |
| 87 | 123 | </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" /> | |
| 90 | 128 | </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" /> | |
| 93 | 131 | </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" /> | |
| 96 | 134 | </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" /> | |
| 99 | 137 | </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" /> | |
| 102 | 140 | </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"> | |
| 104 | 162 | <bounds x="310" y="10" width="20" height="20" /> |
| 105 | 163 | </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" /> | |
| 108 | 166 | </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" /> | |
| 111 | 169 | </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" /> | |
| 114 | 172 | </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" /> | |
| 117 | 175 | </bezel> |
| 118 | 176 | </view> |
| 119 | 177 | </mamelayout> |
| r0 | r1356 | |
|---|---|---|
| 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> |
| r0 | r1356 | |
|---|---|---|
| 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> |
| r0 | r1356 | |
|---|---|---|
| 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> |
| r0 | r1356 | |
|---|---|---|
| 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> |
| r1355 | r1356 | |
|---|---|---|
| 138 | 138 | ***************************************************************************/ |
| 139 | 139 | |
| 140 | 140 | #ifdef MAME_DEBUG |
| 141 | int DEBUG_BLITTER = 0; | |
| 141 | static int DEBUG_BLITTER = 0; | |
| 142 | 142 | #endif |
| 143 | 143 | |
| 144 | 144 | /* Typedefs */ |
| r1355 | r1356 | |
|---|---|---|
| 271 | 271 | static WRITE8_HANDLER( sound_command_w ) |
| 272 | 272 | { |
| 273 | 273 | soundlatch_w(0,data); |
| 274 | timer_call_after_resynch(data,nmi_callback); | |
| 274 | timer_call_after_resynch(NULL, data,nmi_callback); | |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | static WRITE8_HANDLER( nmi_disable_w ) |
| r1355 | r1356 | |
|---|---|---|
| 110 | 110 | scanline = 16; |
| 111 | 111 | } |
| 112 | 112 | |
| 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); | |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | |
| r1355 | r1356 | |
| 122 | 122 | |
| 123 | 123 | static MACHINE_RESET( mgolf ) |
| 124 | 124 | { |
| 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); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 |
| r1355 | r1356 | |
|---|---|---|
| 422 | 422 | |
| 423 | 423 | static MACHINE_RESET( mlc ) |
| 424 | 424 | { |
| 425 | raster_irq_timer = timer_alloc(interrupt_gen); | |
| 425 | raster_irq_timer = timer_alloc(interrupt_gen, NULL); | |
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | static struct YMZ280Binterface ymz280b_intf = |
| r1355 | r1356 | |
|---|---|---|
| 593 | 593 | Timer2ctrl=0; |
| 594 | 594 | Timer3ctrl=0; |
| 595 | 595 | |
| 596 | Timer0=timer_alloc(Timer0cb); | |
| 596 | Timer0=timer_alloc(Timer0cb, NULL); | |
| 597 | 597 | timer_adjust(Timer0,attotime_never,0,attotime_never); |
| 598 | 598 | |
| 599 | Timer1=timer_alloc(Timer1cb); | |
| 599 | Timer1=timer_alloc(Timer1cb, NULL); | |
| 600 | 600 | timer_adjust(Timer1,attotime_never,0,attotime_never); |
| 601 | 601 | |
| 602 | Timer2=timer_alloc(Timer2cb); | |
| 602 | Timer2=timer_alloc(Timer2cb, NULL); | |
| 603 | 603 | timer_adjust(Timer2,attotime_never,0,attotime_never); |
| 604 | 604 | |
| 605 | Timer3=timer_alloc(Timer3cb); | |
| 605 | Timer3=timer_alloc(Timer3cb, NULL); | |
| 606 | 606 | timer_adjust(Timer3,attotime_never,0,attotime_never); |
| 607 | 607 | |
| 608 | 608 | VR0_Snd_Set_Areas(textureram,frameram); |
| r1355 | r1356 | |
|---|---|---|
| 7 | 7 | Games supported: |
| 8 | 8 | * Escape From The Planet Of The Robot Monsters (1989) [2 sets] |
| 9 | 9 | * Klax prototypes [2 sets] |
| 10 | * Guts n' Glory (prototype) | |
| 10 | 11 | |
| 11 | 12 | Known bugs: |
| 12 | 13 | * none at this time |
| r1355 | r1356 | |
| 185 | 186 | ADDRESS_MAP_END |
| 186 | 187 | |
| 187 | 188 | |
| 189 | static 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 | |
| 212 | ADDRESS_MAP_END | |
| 188 | 213 | |
| 214 | ||
| 215 | ||
| 189 | 216 | /************************************* |
| 190 | 217 | * |
| 191 | 218 | * Extra CPU memory handlers |
| r1355 | r1356 | |
| 292 | 319 | INPUT_PORTS_END |
| 293 | 320 | |
| 294 | 321 | |
| 322 | static 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 ) | |
| 295 | 331 | |
| 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 */ | |
| 363 | INPUT_PORTS_END | |
| 364 | ||
| 365 | ||
| 366 | ||
| 296 | 367 | /************************************* |
| 297 | 368 | * |
| 298 | 369 | * Graphics definitions |
| r1355 | r1356 | |
| 305 | 376 | RGN_FRAC(1,1), |
| 306 | 377 | 2, |
| 307 | 378 | { 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) }, | |
| 310 | 381 | 8*16 |
| 311 | 382 | }; |
| 312 | 383 | |
| r1355 | r1356 | |
| 317 | 388 | RGN_FRAC(1,4), |
| 318 | 389 | 4, |
| 319 | 390 | { 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) }, | |
| 322 | 393 | 8*8 |
| 323 | 394 | }; |
| 324 | 395 | |
| r1355 | r1356 | |
| 329 | 400 | GFXDECODE_END |
| 330 | 401 | |
| 331 | 402 | |
| 403 | static 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 */ | |
| 407 | GFXDECODE_END | |
| 332 | 408 | |
| 409 | ||
| 410 | ||
| 333 | 411 | /************************************* |
| 334 | 412 | * |
| 335 | 413 | * Machine drivers |
| r1355 | r1356 | |
| 401 | 479 | MACHINE_DRIVER_END |
| 402 | 480 | |
| 403 | 481 | |
| 482 | static 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) | |
| 404 | 487 | |
| 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) | |
| 509 | MACHINE_DRIVER_END | |
| 510 | ||
| 511 | ||
| 512 | ||
| 405 | 513 | /************************************* |
| 406 | 514 | * |
| 407 | 515 | * ROM definition(s) |
| r1355 | r1356 | |
| 560 | 668 | ROM_END |
| 561 | 669 | |
| 562 | 670 | |
| 671 | ROM_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) ) | |
| 563 | 677 | |
| 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) ) | |
| 720 | ROM_END | |
| 721 | ||
| 722 | ||
| 723 | ||
| 564 | 724 | /************************************* |
| 565 | 725 | * |
| 566 | 726 | * Driver initialization |
| r1355 | r1356 | |
| 587 | 747 | } |
| 588 | 748 | |
| 589 | 749 | |
| 750 | static DRIVER_INIT( guts ) | |
| 751 | { | |
| 752 | atarigen_eeprom_default = NULL; | |
| 753 | atarijsa_init(1, 6, 1, 0x0002); | |
| 754 | } | |
| 590 | 755 | |
| 756 | ||
| 757 | ||
| 591 | 758 | /************************************* |
| 592 | 759 | * |
| 593 | 760 | * Game driver(s) |
| r1355 | r1356 | |
| 598 | 765 | GAME( 1989, eprom2, eprom, eprom, eprom, eprom, ROT0, "Atari Games", "Escape from the Planet of the Robot Monsters (set 2)", GAME_SUPPORTS_SAVE ) |
| 599 | 766 | GAME( 1989, klaxp1, klax, klaxp, klaxp, klaxp, ROT0, "Atari Games", "Klax (prototype set 1)", GAME_SUPPORTS_SAVE ) |
| 600 | 767 | GAME( 1989, klaxp2, klax, klaxp, klaxp, klaxp, ROT0, "Atari Games", "Klax (prototype set 2)", GAME_SUPPORTS_SAVE ) |
| 768 | GAME( 1989, guts, 0, guts, guts, guts, ROT0, "Atari Games", "Guts n' Glory (prototype)", 0 ) |
| r1355 | r1356 | |
|---|---|---|
| 99 | 99 | scanline = 0; |
| 100 | 100 | } |
| 101 | 101 | |
| 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); | |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | |
| 106 | 106 | static MACHINE_RESET( fgoal ) |
| 107 | 107 | { |
| 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); | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 |
| r1355 | r1356 | |
|---|---|---|
| 150 | 150 | update_main_irqs(); |
| 151 | 151 | |
| 152 | 152 | /* 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); | |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | |
| r1355 | r1356 | |
| 178 | 178 | |
| 179 | 179 | static void sound_data_w(UINT8 data) |
| 180 | 180 | { |
| 181 | timer_call_after_resynch(data, delayed_sound_data_w); | |
| 181 | timer_call_after_resynch(NULL, data, delayed_sound_data_w); | |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | |
| r1355 | r1356 | |
| 222 | 222 | segaic16_compare_timer_init(1, NULL, NULL); |
| 223 | 223 | |
| 224 | 224 | /* 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); | |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 |
| r1355 | r1356 | |
|---|---|---|
| 958 | 958 | state_save_register_global(sslam_bar); |
| 959 | 959 | state_save_register_global(sslam_snd_bank); |
| 960 | 960 | |
| 961 | music_timer = timer_alloc(music_playback); | |
| 961 | music_timer = timer_alloc(music_playback, NULL); | |
| 962 | 962 | } |
| 963 | 963 | |
| 964 | 964 | static DRIVER_INIT( powerbls ) |
| r1355 | r1356 | |
|---|---|---|
| 333 | 333 | |
| 334 | 334 | // IRQ |
| 335 | 335 | 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); | |
| 337 | 337 | |
| 338 | 338 | laserdisc_vsync(discinfo); |
| 339 | 339 | } |
| r1355 | r1356 | |
|---|---|---|
| 264 | 264 | static MACHINE_START( cliffhgr ) |
| 265 | 265 | { |
| 266 | 266 | 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); | |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | static MACHINE_RESET( cliffhgr ) |
| r1355 | r1356 | |
|---|---|---|
| 188 | 188 | |
| 189 | 189 | static WRITE8_HANDLER( sound_command_w ) |
| 190 | 190 | { |
| 191 | timer_call_after_resynch(data | 0x100, delayed_command_w); | |
| 191 | timer_call_after_resynch(NULL, data | 0x100, delayed_command_w); | |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | |
| 195 | 195 | static WRITE8_HANDLER( sound_command_nonmi_w ) |
| 196 | 196 | { |
| 197 | timer_call_after_resynch(data, delayed_command_w); | |
| 197 | timer_call_after_resynch(NULL, data, delayed_command_w); | |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 |
| r1355 | r1356 | |
|---|---|---|
| 232 | 232 | memory_configure_bank(1, 0, 2, memory_region(REGION_CPU1) + 0xa000, 0x6000); |
| 233 | 233 | |
| 234 | 234 | /* 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); | |
| 236 | 236 | irq_state = 0; |
| 237 | 237 | schedule_next_irq(0); |
| 238 | 238 |
| r1355 | r1356 | |
|---|---|---|
| 104 | 104 | |
| 105 | 105 | static MACHINE_RESET( exterm ) |
| 106 | 106 | { |
| 107 | sound_nmi_timer = timer_alloc(master_sound_nmi_callback); | |
| 107 | sound_nmi_timer = timer_alloc(master_sound_nmi_callback, NULL); | |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | |
| r1355 | r1356 | |
| 222 | 222 | static WRITE16_HANDLER( sound_latch_w ) |
| 223 | 223 | { |
| 224 | 224 | if (ACCESSING_LSB) |
| 225 | timer_call_after_resynch(data & 0xff, sound_delayed_w); | |
| 225 | timer_call_after_resynch(NULL, data & 0xff, sound_delayed_w); | |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 |
| r1355 | r1356 | |
|---|---|---|
| 36 | 36 | |
| 37 | 37 | static MACHINE_RESET( dragrace ) |
| 38 | 38 | { |
| 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); | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | static void dragrace_update_misc_flags(void) |
| r1355 | r1356 | |
|---|---|---|
| 860 | 860 | dacl = auto_malloc(65536 * sizeof(INT16)); |
| 861 | 861 | dacr = auto_malloc(65536 * sizeof(INT16)); |
| 862 | 862 | |
| 863 | sound_timer = timer_alloc(sound_timer_callback); | |
| 863 | sound_timer = timer_alloc(sound_timer_callback, NULL); | |
| 864 | 864 | timer_adjust(sound_timer, ATTOTIME_IN_MSEC(10), 0, attotime_zero); |
| 865 | 865 | |
| 866 | 866 | dmadac_enable(0, 2, 1); |
| r1355 | r1356 | |
|---|---|---|
| 128 | 128 | static INTERRUPT_GEN( irq4_gen ) |
| 129 | 129 | { |
| 130 | 130 | 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); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | |
| r1355 | r1356 | |
| 269 | 269 | * |
| 270 | 270 | *************************************/ |
| 271 | 271 | |
| 272 | struct EEPROM_interface eeprom_interface_policetr = | |
| 272 | static struct EEPROM_interface eeprom_interface_policetr = | |
| 273 | 273 | { |
| 274 | 274 | 8, // address bits 8 |
| 275 | 275 | 16, // data bits 16 |
| r1355 | r1356 | |
|---|---|---|
| 146 | 146 | static MACHINE_RESET( amerdart ) |
| 147 | 147 | { |
| 148 | 148 | nvram_write_enable = 0; |
| 149 | nvram_write_timer = timer_alloc(nvram_write_timeout); | |
| 149 | nvram_write_timer = timer_alloc(nvram_write_timeout, NULL); | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | |
| r1355 | r1356 | |
| 154 | 154 | { |
| 155 | 155 | tlc34076_reset(6); |
| 156 | 156 | nvram_write_enable = 0; |
| 157 | nvram_write_timer = timer_alloc(nvram_write_timeout); | |
| 157 | nvram_write_timer = timer_alloc(nvram_write_timeout, NULL); | |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | |
| r1355 | r1356 | |
| 277 | 277 | { |
| 278 | 278 | logerror("%08x:IOP write %04x\n", activecpu_get_pc(), data); |
| 279 | 279 | 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); | |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | |
| r1355 | r1356 | |
| 321 | 321 | static WRITE16_HANDLER( coolpool_iop_w ) |
| 322 | 322 | { |
| 323 | 323 | 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); | |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 |
| r1355 | r1356 | |
|---|---|---|
| 3537 | 3537 | ROM_LOAD( "pr-5317.76", 0x0000, 0x0100, CRC(648350b8) SHA1(c7986aa9127ef5b50b845434cb4e81dff9861cd2) ) /* timing? (not used) */ |
| 3538 | 3538 | ROM_END |
| 3539 | 3539 | |
| 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 | ||
| 3540 | 3549 | ROM_START( shtngmst ) |
| 3541 | 3550 | 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) ) | |
| 3545 | 3556 | |
| 3557 | /* This rom is located on the main board. */ | |
| 3546 | 3558 | ROM_REGION( 0x10000, REGION_CPU2, 0 ) |
| 3547 | ROM_LOAD( "epr7043", | |
| 3559 | ROM_LOAD( "epr7043.ic126", | |
| 3548 | 3560 | |
| 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. */ | |
| 3549 | 3566 | 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) ) | |
| 3553 | 3570 | |
| 3571 | /* These roms are located on the daughter board. */ | |
| 3554 | 3572 | 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) ) | |
| 3562 | 3580 | |
| 3581 | /* These proms are located on the main board. */ | |
| 3563 | 3582 | 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 */ | |
| 3568 | 3596 | ROM_END |
| 3569 | 3597 | |
| 3570 | 3598 | /* |
| 3599 | Shooting Master (SEGA) - Set 2, 8751 315-5159a | |
| 3600 | Year: 1985 | |
| 3601 | System 2 | |
| 3571 | 3602 | |
| 3603 | Main Board 834-5719 | |
| 3604 | Light Gun Board? 834-5720 | |
| 3605 | */ | |
| 3606 | ||
| 3607 | ROM_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 */ | |
| 3654 | ROM_END | |
| 3655 | ||
| 3656 | /* | |
| 3657 | ||
| 3572 | 3658 | Shooting Master (EVG) |
| 3573 | 3659 | Year: 1985 |
| 3574 | 3660 | Manufacturer: E.V.G. SRL Milano made in Italy (Sega license) |
| r1355 | r1356 | |
| 3651 | 3737 | ROM_LOAD( "pal16r4a(315-5137).bin", 0x0200, 0x0104, CRC(6ffd9e6f) SHA1(a60a3a2ec5bc256b18bfff0fec0172ee2e4fd955) ) |
| 3652 | 3738 | ROM_END |
| 3653 | 3739 | |
| 3740 | /* | |
| 3741 | Choplifter (8751 315-5151) | |
| 3742 | Year: 1985 | |
| 3743 | System 2 | |
| 3654 | 3744 | |
| 3745 | Main Board 834-5795 | |
| 3746 | */ | |
| 3747 | ||
| 3655 | 3748 | ROM_START( chplft ) |
| 3656 | 3749 | 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) ) | |
| 3660 | 3753 | |
| 3661 | 3754 | 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) ) | |
| 3663 | 3756 | |
| 3757 | ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* Internal i8751 MCU code */ | |
| 3758 | ROM_LOAD( "315-5151.ic74", 0x00000, 0x1000, NO_DUMP ) | |
| 3759 | ||
| 3664 | 3760 | 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) ) | |
| 3668 | 3764 | |
| 3669 | 3765 | 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) ) | |
| 3674 | 3770 | |
| 3675 | 3771 | 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) */ | |
| 3680 | 3776 | |
| 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. */ | |
| 3684 | 3784 | ROM_END |
| 3685 | 3785 | |
| 3786 | /* | |
| 3787 | Choplifter (Unprotected) | |
| 3788 | Year: 1985 | |
| 3789 | System 2 | |
| 3790 | ||
| 3791 | Main Board 834-5795 | |
| 3792 | */ | |
| 3793 | ||
| 3686 | 3794 | ROM_START( chplftb ) |
| 3687 | 3795 | 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) ) | |
| 3691 | 3799 | |
| 3692 | 3800 | 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) ) | |
| 3694 | 3802 | |
| 3695 | 3803 | 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) ) | |
| 3699 | 3807 | |
| 3700 | 3808 | 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) ) | |
| 3705 | 3813 | |
| 3706 | 3814 | 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. */ | |
| 3711 | 3827 | ROM_END |
| 3712 | 3828 | |
| 3829 | /* | |
| 3830 | Choplifter (Bootleg) | |
| 3831 | Year: 1985 | |
| 3832 | System 2 | |
| 3833 | */ | |
| 3834 | ||
| 3713 | 3835 | ROM_START( chplftbl ) |
| 3714 | 3836 | ROM_REGION( 0x20000, REGION_CPU1, 0 ) |
| 3715 | 3837 | ROM_LOAD( "ep7124bl.90", 0x00000, 0x8000, CRC(71a37932) SHA1(72b6f8949d356b3adc5248fdaa13c2a1b9c0fa70) ) |
| r1355 | r1356 | |
| 4735 | 4857 | GAME( 1985, sscandal, myhero, system1, myhero, myheroj, ROT0, "Coreland / Sega", "Seishun Scandal (315-5132, Japan)", GAME_SUPPORTS_SAVE ) |
| 4736 | 4858 | GAME( 1985, myherok, myhero, system1, myhero, myherok, ROT0, "Coreland / Sega", "My Hero (Korea)", GAME_SUPPORTS_SAVE ) |
| 4737 | 4859 | GAME( 1985, hvymetal, 0, hvymetal, hvymetal, hvymetal, ROT0, "Sega", "Heavy Metal (315-5135)", GAME_SUPPORTS_SAVE ) |
| 4738 | GAME( 1985, shtngmst, 0, shtngmst, shtngmst, 0, ROT0, "Sega", "Shooting Master", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) /* 8751 protection, mcu = 315-5159 */ | |
| 4860 | GAME( 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 */ | |
| 4739 | 4861 | GAME( 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 */ |
| 4740 | GAME( 1985, chplft, 0, chplft, chplft, 0, ROT0, "Sega", "Choplifter", GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) /* 8751 protection */ | |
| 4741 | GAME( 1985, chplftb, chplft, chplft, chplft, 0, ROT0, "Sega", "Choplifter (alternate)", GAME_SUPPORTS_SAVE ) | |
| 4862 | GAME( 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 */ | |
| 4863 | GAME( 1985, chplft, 0, chplft, chplft, 0, ROT0, "Sega", "Choplifter (8751 315-5151)", GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) /* 8751 protection */ | |
| 4864 | GAME( 1985, chplftb, chplft, chplft, chplft, 0, ROT0, "Sega", "Choplifter (unprotected)", GAME_SUPPORTS_SAVE ) | |
| 4742 | 4865 | GAME( 1985, chplftbl, chplft, chplft, chplft, 0, ROT0, "bootleg", "Choplifter (bootleg)", GAME_SUPPORTS_SAVE ) |
| 4743 | 4866 | GAME( 1985, 4dwarrio, 0, system1, 4dwarrio, 4dwarrio, ROT0, "Coreland / Sega", "4-D Warriors (315-5162)", GAME_SUPPORTS_SAVE ) |
| 4744 | 4867 | GAME( 1986, brain, 0, brain, brain, 0, ROT0, "Coreland / Sega", "Brain", GAME_SUPPORTS_SAVE ) |
| r1355 | r1356 | |
|---|---|---|
| 169 | 169 | static MACHINE_START( jedi ) |
| 170 | 170 | { |
| 171 | 171 | /* set a timer to run the interrupts */ |
| 172 | jedi_timer = timer_alloc(generate_interrupt); | |
| 172 | jedi_timer = timer_alloc(generate_interrupt, NULL); | |
| 173 | 173 | timer_adjust(jedi_timer,video_screen_get_time_until_pos(0, 32, 0), 32, attotime_zero); |
| 174 | 174 | |
| 175 | 175 | /* configure the banks */ |
| r1355 | r1356 | |
| 236 | 236 | |
| 237 | 237 | static WRITE8_HANDLER( sound_latch_w ) |
| 238 | 238 | { |
| 239 | timer_call_after_resynch(data, delayed_sound_latch_w); | |
| 239 | timer_call_after_resynch(NULL, data, delayed_sound_latch_w); | |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 |
| r1355 | r1356 | |
|---|---|---|
| 454 | 454 | |
| 455 | 455 | static MACHINE_RESET(skns) |
| 456 | 456 | { |
| 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); | |
| 460 | 460 | |
| 461 | 461 | memory_set_bankptr(1,memory_region(REGION_USER1)); |
| 462 | 462 | } |
| r1355 | r1356 | |
|---|---|---|
| 655 | 655 | |
| 656 | 656 | INPUT_PORTS_END |
| 657 | 657 | |
| 658 | struct ES8712interface es8712_interface = | |
| 658 | static struct ES8712interface es8712_interface = | |
| 659 | 659 | { |
| 660 | 660 | REGION_SOUND1 |
| 661 | 661 | }; |
| r1355 | r1356 | |
|---|---|---|
| 314 | 314 | static TIMER_CALLBACK( network_interrupt_callback ) |
| 315 | 315 | { |
| 316 | 316 | 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); | |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | |
| 321 | 321 | static TIMER_CALLBACK( vblank_interrupt_callback ) |
| 322 | 322 | { |
| 323 | 323 | 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); | |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | |
| r1355 | r1356 | |
| 335 | 335 | |
| 336 | 336 | static MACHINE_START( namcofl ) |
| 337 | 337 | { |
| 338 | raster_interrupt_timer = timer_alloc(raster_interrupt_callback); | |
| 338 | raster_interrupt_timer = timer_alloc(raster_interrupt_callback, NULL); | |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | |
| 342 | 342 | static MACHINE_RESET( namcofl ) |
| 343 | 343 | { |
| 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); | |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 |
| r1355 | r1356 | |
|---|---|---|
| 55 | 55 | /* the same on all systems? */ |
| 56 | 56 | #define MASTER_CLOCK 53693100 |
| 57 | 57 | /* timing details */ |
| 58 | int megadriv_framerate = 60; | |
| 59 | int megadrive_total_scanlines = 262; | |
| 60 | int megadrive_visible_scanlines = 224; | |
| 61 | int megadrive_irq6_scanline = 224; | |
| 62 | int megadrive_irq6_hpos = 320; | |
| 63 | int megadrive_z80irq_scanline = 226; | |
| 64 | int megadrive_z80irq_hpos = 320; | |
| 65 | int megadrive_imode = 0; | |
| 66 | int megadrive_imode_odd_frame = 0; | |
| 67 | int megadrive_vblank_flag = 0; | |
| 68 | int megadrive_irq6_pending = 0; | |
| 69 | int megadrive_irq4_pending = 0; | |
| 58 | static int megadriv_framerate = 60; | |
| 59 | static int megadrive_total_scanlines = 262; | |
| 60 | static int megadrive_visible_scanlines = 224; | |
| 61 | static int megadrive_irq6_scanline = 224; | |
| 62 | //int megadrive_irq6_hpos = 320; | |
| 63 | static int megadrive_z80irq_scanline = 226; | |
| 64 | //int megadrive_z80irq_hpos = 320; | |
| 65 | static int megadrive_imode = 0; | |
| 66 | static int megadrive_imode_odd_frame = 0; | |
| 67 | static int megadrive_vblank_flag = 0; | |
| 68 | static int megadrive_irq6_pending = 0; | |
| 69 | static int megadrive_irq4_pending = 0; | |
| 70 | 70 | |
| 71 | 71 | INLINE UINT16 get_hposition(void); |
| 72 | 72 | |
| r1355 | r1356 | |
| 78 | 78 | static UINT16* megadrive_vdp_palette_lookup_highlight; |
| 79 | 79 | static UINT8 oldscreenwidth = 3; |
| 80 | 80 | UINT16* megadrive_ram; |
| 81 | UINT8 megadrive_vram_fill_pending = 0; | |
| 82 | UINT16 megadrive_vram_fill_length = 0; | |
| 83 | int genesis_scanline_counter = 0; | |
| 84 | int megadrive_sprite_collision = 0; | |
| 81 | static UINT8 megadrive_vram_fill_pending = 0; | |
| 82 | static UINT16 megadrive_vram_fill_length = 0; | |
| 83 | static int genesis_scanline_counter = 0; | |
| 84 | static int megadrive_sprite_collision = 0; | |
| 85 | 85 | static int megadrive_region_export; |
| 86 | 86 | static int megadrive_region_pal; |
| 87 | 87 | static int megadrive_max_hposition; |
| r1355 | r1356 | |
| 1426 | 1426 | |
| 1427 | 1427 | static void init_megadri6_io(void) |
| 1428 | 1428 | { |
| 1429 | io_timeout[0] = timer_alloc(io_timeout0_timer_callback); | |
| 1429 | io_timeout[0] = timer_alloc(io_timeout0_timer_callback, NULL); | |
| 1430 | 1430 | io_stage[0] = -1; |
| 1431 | 1431 | |
| 1432 | io_timeout[1] = timer_alloc(io_timeout1_timer_callback); | |
| 1432 | io_timeout[1] = timer_alloc(io_timeout1_timer_callback, NULL); | |
| 1433 | 1433 | io_stage[1] = -1; |
| 1434 | 1434 | |
| 1435 | 1435 | } |
| r1355 | r1356 | |
| 4254 | 4254 | top-left of the screen. The first scanline is scanline 0 (we set scanline to -1 in |
| 4255 | 4255 | VIDEO_EOF) */ |
| 4256 | 4256 | |
| 4257 | timer_call_after_resynch(0, 0); | |
| 4257 | timer_call_after_resynch(NULL, 0, 0); | |
| 4258 | 4258 | /* Compensate for some rounding errors |
| 4259 | 4259 | |
| 4260 | 4260 | When the counter reaches 261 we should have reached the end of the frame, however due |
| r1355 | r1356 | |
| 4406 | 4406 | |
| 4407 | 4407 | megadrive_init_io(machine); |
| 4408 | 4408 | |
| 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); | |
| 4412 | 4412 | |
| 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); | |
| 4415 | 4415 | |
| 4416 | 4416 | timer_adjust(frame_timer, attotime_zero, 0, attotime_zero); |
| 4417 | 4417 | timer_adjust(scanline_timer, attotime_zero, 0, attotime_zero); |
| r1355 | r1356 | |
|---|---|---|
| 544 | 544 | static WRITE16_HANDLER( sound_data_w ) |
| 545 | 545 | { |
| 546 | 546 | 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); | |
| 548 | 548 | } |
| 549 | 549 | |
| 550 | 550 | |
| r1355 | r1356 | |
| 557 | 557 | static WRITE32_HANDLER( sound_data32_w ) |
| 558 | 558 | { |
| 559 | 559 | 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); | |
| 561 | 561 | } |
| 562 | 562 | |
| 563 | 563 |
| r1355 | r1356 | |
|---|---|---|
| 295 | 295 | static WRITE32_HANDLER( unknown_int_req_w ) |
| 296 | 296 | { |
| 297 | 297 | /* 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); | |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 |
| r1355 | r1356 | |
|---|---|---|
| 1859 | 1859 | |
| 1860 | 1860 | static MACHINE_RESET( deco32 ) |
| 1861 | 1861 | { |
| 1862 | raster_irq_timer = timer_alloc(interrupt_gen); | |
| 1862 | raster_irq_timer = timer_alloc(interrupt_gen, NULL); | |
| 1863 | 1863 | } |
| 1864 | 1864 | |
| 1865 | 1865 | static INTERRUPT_GEN( deco32_vbl_interrupt ) |
| r1355 | r1356 | |
|---|---|---|
| 47 | 47 | |
| 48 | 48 | *(UINT32 *)ram_base *= 2; |
| 49 | 49 | |
| 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); | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | |
| r1355 | r1356 | |
| 634 | 634 | /* video hardware */ |
| 635 | 635 | MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER) |
| 636 | 636 | 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*/) | |
| 639 | 639 | MDRV_PALETTE_LENGTH(32768) |
| 640 | 640 | |
| 641 | 641 | MDRV_VIDEO_START(midzeus) |
| r1355 | r1356 | |
|---|---|---|
| 405 | 405 | |
| 406 | 406 | static WRITE8_HANDLER( main_to_sub_comm_w ) |
| 407 | 407 | { |
| 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); | |
| 409 | 409 | } |
| 410 | 410 | |
| 411 | 411 |
| r1355 | r1356 | |
|---|---|---|
| 62 | 62 | static WRITE8_HANDLER( lkage_sound_command_w ) |
| 63 | 63 | { |
| 64 | 64 | soundlatch_w(offset,data); |
| 65 | timer_call_after_resynch(data,nmi_callback); | |
| 65 | timer_call_after_resynch(NULL, data,nmi_callback); | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | static WRITE8_HANDLER( lkage_sh_nmi_disable_w ) |
| r1355 | r1356 | |
|---|---|---|
| 167 | 167 | |
| 168 | 168 | #include "driver.h" |
| 169 | 169 | #include "cpu/mips/mips3.h" |
| 170 | #include "cpu/rsp/rsp.h" | |
| 171 | 170 | #include "streams.h" |
| 172 | 171 | #include "sound/custom.h" |
| 173 | 172 | #include "includes/n64.h" |
| r1355 | r1356 | |
| 434 | 433 | MDRV_CPU_VBLANK_INT( n64_vblank, 1 ) |
| 435 | 434 | |
| 436 | 435 | MDRV_CPU_ADD(RSP, 62500000) |
| 436 | MDRV_CPU_CONFIG(n64_rsp_config) | |
| 437 | 437 | MDRV_CPU_PROGRAM_MAP(rsp_map, 0) |
| 438 | 438 | |
| 439 | 439 | MDRV_MACHINE_RESET( aleck64 ) |
| r1355 | r1356 | |
|---|---|---|
| 844 | 844 | GFXDECODE_END |
| 845 | 845 | |
| 846 | 846 | |
| 847 | struct VLM5030interface trackfld_vlm5030_interface = | |
| 847 | static struct VLM5030interface trackfld_vlm5030_interface = | |
| 848 | 848 | { |
| 849 | 849 | REGION_SOUND1, /* memory region */ |
| 850 | 850 | 0 /* memory size */ |
| r1355 | r1356 | |
|---|---|---|
| 105 | 105 | |
| 106 | 106 | static void create_irq_timer(void) |
| 107 | 107 | { |
| 108 | irq_timer = timer_alloc(irq_callback); | |
| 108 | irq_timer = timer_alloc(irq_callback, NULL); | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 |
| r1355 | r1356 | |
|---|---|---|
| 212 | 212 | portB_in = portB_out = ddrB = 0; |
| 213 | 213 | portC_in = portC_out = ddrC = 0; |
| 214 | 214 | tdr = tcr = 0; |
| 215 | mcu_timer = timer_alloc( mcu_timer_proc ); | |
| 215 | mcu_timer = timer_alloc( mcu_timer_proc , NULL); | |
| 216 | 216 | |
| 217 | 217 | output_set_lamp_value(0, 0); |
| 218 | 218 | output_set_lamp_value(1, 0); |
| r1355 | r1356 | |
|---|---|---|
| 499 | 499 | *************************************/ |
| 500 | 500 | |
| 501 | 501 | static void vblank_assert(int state); |
| 502 | static TIMER_CALLBACK( timer_callback ); | |
| 502 | static TIMER_CALLBACK( nile_timer_callback ); | |
| 503 | 503 | static void ide_interrupt(int state); |
| 504 | 504 | static void remap_dynamic_addresses(void); |
| 505 | 505 | |
| r1355 | r1356 | |
| 576 | 576 | cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_READONLY, 1); |
| 577 | 577 | |
| 578 | 578 | /* 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); | |
| 583 | 583 | |
| 584 | 584 | /* reset dynamic addressing */ |
| 585 | 585 | memset(nile_regs, 0, 0x1000); |
| r1355 | r1356 | |
| 952 | 952 | } |
| 953 | 953 | |
| 954 | 954 | |
| 955 | static TIMER_CALLBACK( timer_callback ) | |
| 955 | static TIMER_CALLBACK( nile_timer_callback ) | |
| 956 | 956 | { |
| 957 | 957 | int which = param; |
| 958 | 958 | UINT32 *regs = &nile_regs[NREG_T0CTRL + which * 4]; |
| r1355 | r1356 | |
|---|---|---|
| 184 | 184 | |
| 185 | 185 | static MACHINE_RESET( yboard ) |
| 186 | 186 | { |
| 187 | interrupt_timer = timer_alloc(scanline_callback); | |
| 187 | interrupt_timer = timer_alloc(scanline_callback, NULL); | |
| 188 | 188 | timer_adjust(interrupt_timer, video_screen_get_time_until_pos(0, 223, 0), 223, attotime_zero); |
| 189 | 189 | |
| 190 | 190 | state_save_register_global_array(misc_io_data); |
| r1355 | r1356 | |
| 217 | 217 | static WRITE16_HANDLER( sound_data_w ) |
| 218 | 218 | { |
| 219 | 219 | 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); | |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 |
| r1355 | r1356 | |
|---|---|---|
| 167 | 167 | |
| 168 | 168 | /* we must do this on a timer in order to have it take effect */ |
| 169 | 169 | /* 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); | |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 |
| r1355 | r1356 | |
|---|---|---|
| 114 | 114 | |
| 115 | 115 | static void create_interrupt_timers(void) |
| 116 | 116 | { |
| 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); | |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 |
| r1355 | r1356 | |
|---|---|---|
| 128 | 128 | |
| 129 | 129 | static void sound_data_w(UINT8 data) |
| 130 | 130 | { |
| 131 | timer_call_after_resynch(data, delayed_sound_data_w); | |
| 131 | timer_call_after_resynch(NULL, data, delayed_sound_data_w); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | |
| r1355 | r1356 | |
| 213 | 213 | case 65: |
| 214 | 214 | case 129: |
| 215 | 215 | 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); | |
| 217 | 217 | next_scanline = scanline + 1; |
| 218 | 218 | break; |
| 219 | 219 | |
| r1355 | r1356 | |
| 244 | 244 | update_main_irqs(); |
| 245 | 245 | |
| 246 | 246 | /* 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); | |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | |
| r1355 | r1356 | |
| 275 | 275 | cpunum_set_info_fct(0, CPUINFO_PTR_M68K_RESET_CALLBACK, (genf *)outrun_reset); |
| 276 | 276 | |
| 277 | 277 | /* 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); | |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 |
| r1355 | r1356 | |
|---|---|---|
| 335 | 335 | static READ8_HANDLER( ls670_0_r ) |
| 336 | 336 | { |
| 337 | 337 | /* set a timer to force synchronization after the read */ |
| 338 | timer_call_after_resynch(0, NULL); | |
| 338 | timer_call_after_resynch(NULL, 0, NULL); | |
| 339 | 339 | |
| 340 | 340 | return ls670_0[offset]; |
| 341 | 341 | } |
| r1355 | r1356 | |
| 351 | 351 | static WRITE8_HANDLER( ls670_0_w ) |
| 352 | 352 | { |
| 353 | 353 | /* 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); | |
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | |
| r1355 | r1356 | |
| 359 | 359 | static READ8_HANDLER( ls670_1_r ) |
| 360 | 360 | { |
| 361 | 361 | /* set a timer to force synchronization after the read */ |
| 362 | timer_call_after_resynch(0, NULL); | |
| 362 | timer_call_after_resynch(NULL, 0, NULL); | |
| 363 | 363 | |
| 364 | 364 | return ls670_1[offset]; |
| 365 | 365 | } |
| r1355 | r1356 | |
| 375 | 375 | static WRITE8_HANDLER( ls670_1_w ) |
| 376 | 376 | { |
| 377 | 377 | /* 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); | |
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | |
| r1355 | r1356 | |
| 1084 | 1084 | |
| 1085 | 1085 | static WRITE8_HANDLER( main_sound_w ) |
| 1086 | 1086 | { |
| 1087 | timer_call_after_resynch(data & 0xff, delayed_sound_w); | |
| 1087 | timer_call_after_resynch(NULL, data & 0xff, delayed_sound_w); | |
| 1088 | 1088 | } |
| 1089 | 1089 | |
| 1090 | 1090 |
| r1355 | r1356 | |
|---|---|---|
| 153 | 153 | static MACHINE_START( foodf ) |
| 154 | 154 | { |
| 155 | 155 | state_save_register_global(whichport); |
| 156 | scanline_timer = timer_alloc(scanline_update); | |
| 156 | scanline_timer = timer_alloc(scanline_update, NULL); | |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 |
| r1355 | r1356 | |
|---|---|---|
| 48 | 48 | |
| 49 | 49 | static VIDEO_START( acefruit ) |
| 50 | 50 | { |
| 51 | acefruit_refresh_timer = timer_alloc( acefruit_refresh ); | |
| 51 | acefruit_refresh_timer = timer_alloc( acefruit_refresh , NULL); | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | static INTERRUPT_GEN( acefruit_vblank ) |
| r1355 | r1356 | |
|---|---|---|
| 122 | 122 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); |
| 123 | 123 | } |
| 124 | 124 | |
| 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); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | |
| 129 | 129 | static MACHINE_RESET( sprint4 ) |
| 130 | 130 | { |
| 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); | |
| 132 | 132 | |
| 133 | 133 | memset(steer_FF1, 0, sizeof steer_FF1); |
| 134 | 134 | memset(steer_FF2, 0, sizeof steer_FF2); |
| r1355 | r1356 | |
|---|---|---|
| 1197 | 1197 | pia_config(4,&pia_ic7_intf); |
| 1198 | 1198 | pia_config(5,&pia_ic8_intf); |
| 1199 | 1199 | |
| 1200 | ic24_timer = timer_alloc(ic24_timeout); | |
| 1200 | ic24_timer = timer_alloc(ic24_timeout, NULL); | |
| 1201 | 1201 | // setup ptm //////////////////////////////////////////////////////////// |
| 1202 | 1202 | ptm6840_config(0, &ptm_ic2_intf ); |
| 1203 | 1203 | } |
| r1355 | r1356 | |
|---|---|---|
| 271 | 271 | }; |
| 272 | 272 | |
| 273 | 273 | |
| 274 | UINT8 *tturfbl_soundbank_ptr = NULL; /* Pointer to currently selected portion of ROM */ | |
| 274 | static UINT8 *tturfbl_soundbank_ptr = NULL; /* Pointer to currently selected portion of ROM */ | |
| 275 | 275 | |
| 276 | 276 | static READ8_HANDLER( tturfbl_soundbank_r ) |
| 277 | 277 | { |
| r1355 | r1356 | |
|---|---|---|
| 209 | 209 | |
| 210 | 210 | static WRITE8_HANDLER(protection_w) |
| 211 | 211 | { |
| 212 | timer_call_after_resynch(data, protection_deferred_w); | |
| 212 | timer_call_after_resynch(NULL, data, protection_deferred_w); | |
| 213 | 213 | cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(100)); |
| 214 | 214 | } |
| 215 | 215 |
| r1355 | r1356 | |
|---|---|---|
| 85 | 85 | { |
| 86 | 86 | // sound_nmi_enabled = 1; |
| 87 | 87 | 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 */ | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | static ADDRESS_MAP_START( z80_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1355 | r1356 | |
| 266 | 266 | simpsons_objdma(); |
| 267 | 267 | |
| 268 | 268 | // 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); | |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | if (K052109_is_IRQ_enabled()) |
| r1355 | r1356 | |
|---|---|---|
| 216 | 216 | |
| 217 | 217 | static INTERRUPT_GEN( rastansaga2_interrupt ) |
| 218 | 218 | { |
| 219 | timer_set(ATTOTIME_IN_CYCLES(5000,0),0,rsaga2_interrupt2); | |
| 219 | timer_set(ATTOTIME_IN_CYCLES(5000,0), NULL, 0, rsaga2_interrupt2); | |
| 220 | 220 | cpunum_set_input_line(0, 4, HOLD_LINE); |
| 221 | 221 | } |
| 222 | 222 | |
| r1355 | r1356 | |
| 228 | 228 | |
| 229 | 229 | static INTERRUPT_GEN( crimec_interrupt ) |
| 230 | 230 | { |
| 231 | timer_set(ATTOTIME_IN_CYCLES(5000,0),0,crimec_interrupt3); | |
| 231 | timer_set(ATTOTIME_IN_CYCLES(5000,0), NULL, 0, crimec_interrupt3); | |
| 232 | 232 | cpunum_set_input_line(0, 5, HOLD_LINE); |
| 233 | 233 | } |
| 234 | 234 | |
| r1355 | r1356 | |
| 240 | 240 | |
| 241 | 241 | static INTERRUPT_GEN( hitice_interrupt ) |
| 242 | 242 | { |
| 243 | timer_set(ATTOTIME_IN_CYCLES(5000,0),0,hitice_interrupt6); | |
| 243 | timer_set(ATTOTIME_IN_CYCLES(5000,0), NULL, 0, hitice_interrupt6); | |
| 244 | 244 | cpunum_set_input_line(0, 4, HOLD_LINE); |
| 245 | 245 | } |
| 246 | 246 | |
| r1355 | r1356 | |
| 252 | 252 | |
| 253 | 253 | static INTERRUPT_GEN( rambo3_interrupt ) |
| 254 | 254 | { |
| 255 | timer_set(ATTOTIME_IN_CYCLES(5000,0),0,rambo3_interrupt1); | |
| 255 | timer_set(ATTOTIME_IN_CYCLES(5000,0), NULL, 0, rambo3_interrupt1); | |
| 256 | 256 | cpunum_set_input_line(0, 6, HOLD_LINE); |
| 257 | 257 | } |
| 258 | 258 | |
| r1355 | r1356 | |
| 264 | 264 | |
| 265 | 265 | static INTERRUPT_GEN( pbobble_interrupt ) |
| 266 | 266 | { |
| 267 | timer_set(ATTOTIME_IN_CYCLES(5000,0),0,pbobble_interrupt5); | |
| 267 | timer_set(ATTOTIME_IN_CYCLES(5000,0), NULL, 0, pbobble_interrupt5); | |
| 268 | 268 | cpunum_set_input_line(0, 3, HOLD_LINE); |
| 269 | 269 | } |
| 270 | 270 | |
| r1355 | r1356 | |
| 275 | 275 | |
| 276 | 276 | static INTERRUPT_GEN( viofight_interrupt ) |
| 277 | 277 | { |
| 278 | timer_set(ATTOTIME_IN_CYCLES(5000,0),0,viofight_interrupt1); | |
| 278 | timer_set(ATTOTIME_IN_CYCLES(5000,0), NULL, 0, viofight_interrupt1); | |
| 279 | 279 | cpunum_set_input_line(0, 4, HOLD_LINE); |
| 280 | 280 | } |
| 281 | 281 | |
| r1355 | r1356 | |
| 286 | 286 | |
| 287 | 287 | static INTERRUPT_GEN( masterw_interrupt ) |
| 288 | 288 | { |
| 289 | timer_set(ATTOTIME_IN_CYCLES(5000,0),0,masterw_interrupt4); | |
| 289 | timer_set(ATTOTIME_IN_CYCLES(5000,0), NULL, 0, masterw_interrupt4); | |
| 290 | 290 | cpunum_set_input_line(0, 5, HOLD_LINE); |
| 291 | 291 | } |
| 292 | 292 | |
| r1355 | r1356 | |
| 297 | 297 | |
| 298 | 298 | static INTERRUPT_GEN( silentd_interrupt ) |
| 299 | 299 | { |
| 300 | timer_set(ATTOTIME_IN_CYCLES(5000,0),0,silentd_interrupt4); | |
| 300 | timer_set(ATTOTIME_IN_CYCLES(5000,0), NULL, 0, silentd_interrupt4); | |
| 301 | 301 | cpunum_set_input_line(0, 6, HOLD_LINE); |
| 302 | 302 | } |
| 303 | 303 | |
| r1355 | r1356 | |
| 308 | 308 | |
| 309 | 309 | static INTERRUPT_GEN( selfeena_interrupt ) |
| 310 | 310 | { |
| 311 | timer_set(ATTOTIME_IN_CYCLES(5000,0),0,selfeena_interrupt4); | |
| 311 | timer_set(ATTOTIME_IN_CYCLES(5000,0), NULL, 0, selfeena_interrupt4); | |
| 312 | 312 | cpunum_set_input_line(0, 6, HOLD_LINE); |
| 313 | 313 | } |
| 314 | 314 | |
| r1355 | r1356 | |
| 319 | 319 | |
| 320 | 320 | static INTERRUPT_GEN( sbm_interrupt )//5 |
| 321 | 321 | { |
| 322 | timer_set(ATTOTIME_IN_CYCLES(10000,0),0,sbm_interrupt5); | |
| 322 | timer_set(ATTOTIME_IN_CYCLES(10000,0), NULL, 0, sbm_interrupt5); | |
| 323 | 323 | cpunum_set_input_line(0, 4, HOLD_LINE); |
| 324 | 324 | } |
| 325 | 325 |
| r1355 | r1356 | |
|---|---|---|
| 872 | 872 | static MACHINE_START( maze ) |
| 873 | 873 | { |
| 874 | 874 | /* 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); | |
| 876 | 876 | |
| 877 | 877 | /* initialize state of Tone Timing FF, IC C1 */ |
| 878 | 878 | maze_tone_timing_state = 0; |
| r1355 | r1356 | |
| 2048 | 2048 | static MACHINE_START( spcenctr ) |
| 2049 | 2049 | { |
| 2050 | 2050 | /* 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); | |
| 2053 | 2053 | |
| 2054 | 2054 | /* setup for save states */ |
| 2055 | 2055 | state_save_register_global(spcenctr_strobe_state); |
| r1355 | r1356 | |
|---|---|---|
| 27 | 27 | static WRITE16_HANDLER( vaportra_sound_w ) |
| 28 | 28 | { |
| 29 | 29 | /* Force synchronisation between CPUs with fake timer */ |
| 30 | timer_call_after_resynch(0, NULL); | |
| 30 | timer_call_after_resynch(NULL, 0, NULL); | |
| 31 | 31 | soundlatch_w(0,data & 0xff); |
| 32 | 32 | cpunum_set_input_line(1,0,ASSERT_LINE); |
| 33 | 33 | } |
| r1355 | r1356 | |
|---|---|---|
| 656 | 656 | sndram = memory_region(REGION_SOUND1) + 0x100000; |
| 657 | 657 | |
| 658 | 658 | /* 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); | |
| 660 | 660 | |
| 661 | 661 | /* reset the IDE controller */ |
| 662 | 662 | gp2_irq_control = 0; |
| r1355 | r1356 | |
|---|---|---|
| 1373 | 1373 | INPUT_PORTS_END |
| 1374 | 1374 | |
| 1375 | 1375 | |
| 1376 | struct AY8910interface scobra_ay8910_interface_2 = | |
| 1376 | static struct AY8910interface scobra_ay8910_interface_2 = | |
| 1377 | 1377 | { |
| 1378 | 1378 | soundlatch_r, |
| 1379 | 1379 | scramble_portB_r |
| r1355 | r1356 | |
|---|---|---|
| 197 | 197 | cpunum_set_info_fct(2, CPUINFO_PTR_ADSP2100_TX_HANDLER, (genf *)adsp_tx_callback); |
| 198 | 198 | |
| 199 | 199 | /* 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); | |
| 201 | 201 | |
| 202 | 202 | memory_configure_bank(1, 0, 256, memory_region(REGION_USER1), 0x4000); |
| 203 | 203 | memory_set_bank(1, 0); |
| r1355 | r1356 | |
| 315 | 315 | { |
| 316 | 316 | logerror("%06X:sound_data_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, ~mem_mask); |
| 317 | 317 | 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); | |
| 319 | 319 | } |
| 320 | 320 | static WRITE32_HANDLER( sound_data_020_w ) { if ((mem_mask & 0xffff0000) != 0xffff0000) sound_data_w(offset, data >> 16, mem_mask >> 16); } |
| 321 | 321 |
| r1355 | r1356 | |
|---|---|---|
| 824 | 824 | int n_game; |
| 825 | 825 | emu_timer *timer; |
| 826 | 826 | |
| 827 | timer = timer_alloc( mcu_timer ); | |
| 827 | timer = timer_alloc( mcu_timer , NULL); | |
| 828 | 828 | timer_adjust( timer, ATTOTIME_IN_HZ( 600 ), 0, ATTOTIME_IN_HZ( 600 ) ); |
| 829 | 829 | |
| 830 | 830 | psx_driver_init(); |
| r1355 | r1356 | |
|---|---|---|
| 622 | 622 | machine_start_itech8(machine); |
| 623 | 623 | |
| 624 | 624 | /* 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); | |
| 626 | 626 | } |
| 627 | 627 | |
| 628 | 628 | static MACHINE_RESET( itech8 ) |
| r1355 | r1356 | |
| 674 | 674 | if (scanline >= 256) scanline = 0; |
| 675 | 675 | |
| 676 | 676 | /* 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); | |
| 678 | 678 | } |
| 679 | 679 | |
| 680 | 680 | |
| r1355 | r1356 | |
| 786 | 786 | |
| 787 | 787 | static WRITE8_HANDLER( sound_data_w ) |
| 788 | 788 | { |
| 789 | timer_call_after_resynch(data, delayed_sound_data_w); | |
| 789 | timer_call_after_resynch(NULL, data, delayed_sound_data_w); | |
| 790 | 790 | } |
| 791 | 791 | |
| 792 | 792 | |
| r1355 | r1356 | |
| 797 | 797 | ((data & 0x5d) << 1) | |
| 798 | 798 | ((data & 0x20) >> 3) | |
| 799 | 799 | ((data & 0x02) << 5); |
| 800 | timer_call_after_resynch(data, delayed_sound_data_w); | |
| 800 | timer_call_after_resynch(NULL, data, delayed_sound_data_w); | |
| 801 | 801 | } |
| 802 | 802 | |
| 803 | 803 |
| r1355 | r1356 | |
|---|---|---|
| 236 | 236 | INTERRUPT_GEN( snk_irq_AB ) |
| 237 | 237 | { |
| 238 | 238 | 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); | |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | INTERRUPT_GEN( snk_irq_BA ) |
| 243 | 243 | { |
| 244 | 244 | 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); | |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | // NMI handshakes between CPUs are determined to be much simpler |
| r1355 | r1356 | |
|---|---|---|
| 196 | 196 | cpunum_set_input_line(0, 2, HOLD_LINE); |
| 197 | 197 | cpunum_set_input_line(1, 1, HOLD_LINE); |
| 198 | 198 | /* 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); | |
| 200 | 200 | rastersplit = 0; |
| 201 | 201 | } else { |
| 202 | 202 | requested_int |= 0x12; /* hsync */ |
| r1355 | r1356 | |
| 367 | 367 | another blit. */ |
| 368 | 368 | if (b1 == 0) |
| 369 | 369 | { |
| 370 | timer_set(ATTOTIME_IN_USEC(500),0,hyprduel_blit_done); | |
| 370 | timer_set(ATTOTIME_IN_USEC(500), NULL,0,hyprduel_blit_done); | |
| 371 | 371 | return; |
| 372 | 372 | } |
| 373 | 373 |
| r1355 | r1356 | |
|---|---|---|
| 347 | 347 | } |
| 348 | 348 | if( scanline < NAMCONB1_VBSTART ) |
| 349 | 349 | { |
| 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 ); | |
| 351 | 351 | } |
| 352 | 352 | } /* namconb2_interrupt */ |
| 353 | 353 | static INTERRUPT_GEN( namconb1_interrupt ) |
| r1355 | r1356 | |
| 395 | 395 | } |
| 396 | 396 | if( scanline < NAMCONB1_VBSTART ) |
| 397 | 397 | { |
| 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 ); | |
| 399 | 399 | } |
| 400 | 400 | } /* namconb1_interrupt */ |
| 401 | 401 |
| r1355 | r1356 | |
|---|---|---|
| 87 | 87 | static WRITE8_HANDLER( sound_command_w ) |
| 88 | 88 | { |
| 89 | 89 | soundlatch_w(0,data); |
| 90 | timer_call_after_resynch(data,nmi_callback); | |
| 90 | timer_call_after_resynch(NULL, data,nmi_callback); | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 |
| r1355 | r1356 | |
|---|---|---|
| 87 | 87 | AM_RANGE(0xfff00000, 0xffffffff) AM_ROM AM_REGION(REGION_USER1,0) |
| 88 | 88 | ADDRESS_MAP_END |
| 89 | 89 | |
| 90 | static 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 | ||
| 90 | 100 | static ADDRESS_MAP_START( mosaicf2_io, ADDRESS_SPACE_IO, 32 ) |
| 91 | 101 | AM_RANGE(0x4000, 0x4003) AM_READ(oki_32bit_r) |
| 92 | 102 | AM_RANGE(0x4810, 0x4813) AM_READ(ym2151_status_32bit_r) |
| 93 | 103 | AM_RANGE(0x5000, 0x5003) AM_READ(input_port_0_dword_r) |
| 94 | AM_RANGE(0x5200, 0x5203) AM_READ(input_port_1 | |
| 104 | AM_RANGE(0x5200, 0x5203) AM_READ(f32_input_port_1 | |
| 95 | 105 | AM_RANGE(0x5400, 0x5403) AM_READ(eeprom_r) |
| 96 | 106 | AM_RANGE(0x6000, 0x6003) AM_WRITE(oki_32bit_w) |
| 97 | 107 | AM_RANGE(0x6800, 0x6803) AM_WRITE(ym2151_data_32bit_w) |
| r1355 | r1356 | |
|---|---|---|
| 84 | 84 | scanline += 32; |
| 85 | 85 | if (scanline >= 256) |
| 86 | 86 | 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); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | |
| r1355 | r1356 | |
| 109 | 109 | memcpy(slapstic_base, &slapstic_source[current_bank * 0x4000], 0x4000); |
| 110 | 110 | |
| 111 | 111 | /* 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); | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 |
| r1355 | r1356 | |
|---|---|---|
| 341 | 341 | |
| 342 | 342 | model2_timerrun[0] = model2_timerrun[1] = model2_timerrun[2] = model2_timerrun[3] = 0; |
| 343 | 343 | |
| 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); | |
| 348 | 348 | |
| 349 | 349 | timer_adjust(model2_timers[0], attotime_never, 0, attotime_never); |
| 350 | 350 | timer_adjust(model2_timers[1], attotime_never, 0, attotime_never); |
| r1355 | r1356 | |
| 621 | 621 | /* GEO */ |
| 622 | 622 | |
| 623 | 623 | UINT32 geo_read_start_address = 0; |
| 624 | UINT32 geo_write_start_address = 0; | |
| 624 | static UINT32 geo_write_start_address = 0; | |
| 625 | 625 | |
| 626 | 626 | static WRITE32_HANDLER( geo_ctl1_w ) |
| 627 | 627 | { |
| r1355 | r1356 | |
|---|---|---|
| 24 | 24 | MACHINE_RESET( espial ) |
| 25 | 25 | { |
| 26 | 26 | /* we must start with NMI interrupts disabled */ |
| 27 | timer_call_after_resynch(0, interrupt_disable); | |
| 27 | timer_call_after_resynch(NULL, 0, interrupt_disable); | |
| 28 | 28 | sound_nmi_enabled = FALSE; |
| 29 | 29 | } |
| 30 | 30 |
| r1355 | r1356 | |
|---|---|---|
| 450 | 450 | |
| 451 | 451 | |
| 452 | 452 | |
| 453 | struct VLM5030interface hyperspt_vlm5030_interface = | |
| 453 | static struct VLM5030interface hyperspt_vlm5030_interface = | |
| 454 | 454 | { |
| 455 | 455 | REGION_SOUND1, /* memory region */ |
| 456 | 456 | 0 /* memory size */ |
| r1355 | r1356 | |
|---|---|---|
| 359 | 359 | { |
| 360 | 360 | // sound_nmi_enabled = 1; |
| 361 | 361 | 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 */ | |
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 |
| r1355 | r1356 | |
|---|---|---|
| 174 | 174 | { |
| 175 | 175 | memset(&duart_1, 0, sizeof(duart_1)); |
| 176 | 176 | |
| 177 | duart_1_timer = timer_alloc(duart_1_timer_event); | |
| 177 | duart_1_timer = timer_alloc(duart_1_timer_event, NULL); | |
| 178 | 178 | |
| 179 | 179 | /* Reset states */ |
| 180 | 180 | duart_1_irq = tms_irq = 0; |
| r1355 | r1356 | |
|---|---|---|
| 1944 | 1944 | sfx_sh_irqtrigger_w |
| 1945 | 1945 | }; |
| 1946 | 1946 | |
| 1947 | struct AY8910interface explorer_ay8910_interface_1 = | |
| 1947 | static struct AY8910interface explorer_ay8910_interface_1 = | |
| 1948 | 1948 | { |
| 1949 | 1949 | scramble_portB_r |
| 1950 | 1950 | }; |
| 1951 | 1951 | |
| 1952 | struct AY8910interface explorer_ay8910_interface_2 = | |
| 1952 | static struct AY8910interface explorer_ay8910_interface_2 = | |
| 1953 | 1953 | { |
| 1954 | 1954 | hotshock_soundlatch_r |
| 1955 | 1955 | }; |
| 1956 | 1956 | |
| 1957 | struct AY8910interface hotshock_ay8910_interface_2 = | |
| 1957 | static struct AY8910interface hotshock_ay8910_interface_2 = | |
| 1958 | 1958 | { |
| 1959 | 1959 | hotshock_soundlatch_r, |
| 1960 | 1960 | scramble_portB_r |
| 1961 | 1961 | }; |
| 1962 | 1962 | |
| 1963 | struct AY8910interface scorpion_ay8910_interface_1 = | |
| 1963 | static struct AY8910interface scorpion_ay8910_interface_1 = | |
| 1964 | 1964 | { |
| 1965 | 1965 | 0, |
| 1966 | 1966 | 0, |
| r1355 | r1356 | |
| 1968 | 1968 | scorpion_sound_cmd_w, |
| 1969 | 1969 | }; |
| 1970 | 1970 | |
| 1971 | struct AY8910interface triplep_ay8910_interface = | |
| 1971 | static struct AY8910interface triplep_ay8910_interface = | |
| 1972 | 1972 | { |
| 1973 | 1973 | 0 |
| 1974 | 1974 | }; |
| r1355 | r1356 | |
|---|---|---|
| 190 | 190 | MSM5205_S48_4B |
| 191 | 191 | }; |
| 192 | 192 | |
| 193 | UINT8* shdancbl_soundbank_ptr = NULL; /* Pointer to currently selected portion of ROM */ | |
| 193 | static UINT8* shdancbl_soundbank_ptr = NULL; /* Pointer to currently selected portion of ROM */ | |
| 194 | 194 | |
| 195 | 195 | static WRITE16_HANDLER( sound_command_irq_w ){ |
| 196 | 196 | if( ACCESSING_LSB ){ |
| r1355 | r1356 | |
|---|---|---|
| 170 | 170 | |
| 171 | 171 | static void create_irq_timer(void) |
| 172 | 172 | { |
| 173 | irq_timer = timer_alloc(irq_callback); | |
| 173 | irq_timer = timer_alloc(irq_callback, NULL); | |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | |
| r1355 | r1356 | |
| 247 | 247 | |
| 248 | 248 | static void create_nmi_timer(void) |
| 249 | 249 | { |
| 250 | nmi_timer = timer_alloc(nmi_callback); | |
| 250 | nmi_timer = timer_alloc(nmi_callback, NULL); | |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 |
| r1355 | r1356 | |
|---|---|---|
| 175 | 175 | |
| 176 | 176 | /* in Gridiron, the sound CPU goes in a tight loop after the self test, */ |
| 177 | 177 | /* 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); | |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 |
| r1355 | r1356 | |
|---|---|---|
| 123 | 123 | |
| 124 | 124 | static WRITE8_HANDLER( sound_data_w ) |
| 125 | 125 | { |
| 126 | timer_call_after_resynch(data, delayed_sound_w); | |
| 126 | timer_call_after_resynch(NULL, data, delayed_sound_w); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 |
| r1355 | r1356 | |
|---|---|---|
| 130 | 130 | |
| 131 | 131 | /* main CPU might be waiting for sound CPU to finish NMI, |
| 132 | 132 | 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); | |
| 134 | 134 | // logerror("PC %06X - Read coin port during Z80 NMI\n", activecpu_get_pc()); |
| 135 | 135 | } |
| 136 | 136 | |
| r1355 | r1356 | |
| 171 | 171 | static WRITE32_HANDLER( psikyo_soundlatch_w ) |
| 172 | 172 | { |
| 173 | 173 | if (ACCESSING_LSB32) |
| 174 | timer_call_after_resynch(data & 0xff, psikyo_soundlatch_callback); | |
| 174 | timer_call_after_resynch(NULL, data & 0xff, psikyo_soundlatch_callback); | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | /*************************************************************************** |
| r1355 | r1356 | |
| 181 | 181 | static WRITE32_HANDLER( s1945_soundlatch_w ) |
| 182 | 182 | { |
| 183 | 183 | 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); | |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | static UINT8 s1945_table[256] = { |
| r1355 | r1356 | |
| 1552 | 1552 | ***************************************************************************/ |
| 1553 | 1553 | |
| 1554 | 1554 | |
| 1555 | struct YM2610interface sngkace_ym2610_interface = | |
| 1555 | static struct YM2610interface sngkace_ym2610_interface = | |
| 1556 | 1556 | { |
| 1557 | 1557 | sound_irq, /* irq */ |
| 1558 | 1558 | REGION_SOUND1, /* delta_t */ |
| r1355 | r1356 | |
| 1606 | 1606 | ***************************************************************************/ |
| 1607 | 1607 | |
| 1608 | 1608 | |
| 1609 | struct YM2610interface gunbird_ym2610_interface = | |
| 1609 | static struct YM2610interface gunbird_ym2610_interface = | |
| 1610 | 1610 | { |
| 1611 | 1611 | sound_irq, /* irq */ |
| 1612 | 1612 | REGION_SOUND1, /* delta_t */ |
| r1355 | r1356 | |
|---|---|---|
| 376 | 376 | |
| 377 | 377 | #ifdef PGMARM7SPEEDHACK |
| 378 | 378 | 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.. | |
| 380 | 380 | cpu_spinuntil_trigger(1002); |
| 381 | 381 | #else |
| 382 | 382 | cpunum_set_input_line(2, ARM7_FIRQ_LINE, PULSE_LINE); |
| r1355 | r1356 | |
|---|---|---|
| 262 | 262 | /* set a timer for an arbitrarily short period. |
| 263 | 263 | The real time it takes to clear to screen is not |
| 264 | 264 | 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); | |
| 266 | 266 | |
| 267 | 267 | break; |
| 268 | 268 | } |
| r1355 | r1356 | |
| 281 | 281 | /* Kaos sits in a tight loop polling the VIA irq flags register, but that register is |
| 282 | 282 | cleared by the irq handler. Therefore, I wait a bit before triggering the irq to |
| 283 | 283 | 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); | |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | |
| r1355 | r1356 | |
| 319 | 319 | |
| 320 | 320 | static void create_via_0_timer(void) |
| 321 | 321 | { |
| 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); | |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 |
| r1355 | r1356 | |
|---|---|---|
| 129 | 129 | video_screen_update_partial(0, scanline - 1); |
| 130 | 130 | scanline += 32; |
| 131 | 131 | 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); | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | |
| 136 | 136 | static MACHINE_RESET( capbowl ) |
| 137 | 137 | { |
| 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); | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 |
| r1355 | r1356 | |
|---|---|---|
| 249 | 249 | static INTERRUPT_GEN( irq0_start ) |
| 250 | 250 | { |
| 251 | 251 | 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); | |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | |
| r1355 | r1356 | |
| 392 | 392 | UINT32 r26 = activecpu_get_reg(MIPS3_R26) - *kinst_speedup; |
| 393 | 393 | if (r26 < r3) |
| 394 | 394 | { |
| 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); | |
| 396 | 396 | cpu_spinuntil_int(); |
| 397 | 397 | } |
| 398 | 398 | } |
| r1355 | r1356 | |
|---|---|---|
| 156 | 156 | update_interrupts(); |
| 157 | 157 | |
| 158 | 158 | /* 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); | |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | |
| r1355 | r1356 | |
| 173 | 173 | |
| 174 | 174 | /* compute the timing of the HBLANK interrupt and set the first timer */ |
| 175 | 175 | 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); | |
| 177 | 177 | |
| 178 | 178 | /* reset IRQs */ |
| 179 | 179 | irq_line_state = CLEAR_LINE; |
| r1355 | r1356 | |
|---|---|---|
| 105 | 105 | if(!offset) |
| 106 | 106 | latches[2]|=1; |
| 107 | 107 | COMBINE_DATA(&latches[offset]); |
| 108 | timer_call_after_resynch(0, NULL); | |
| 108 | timer_call_after_resynch(NULL, 0, NULL); | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | static READ8_HANDLER(latch8_r) |
| r1355 | r1356 | |
| 120 | 120 | if(!offset) |
| 121 | 121 | latches[2]|=2; |
| 122 | 122 | latches[offset]=data; |
| 123 | timer_call_after_resynch(0, NULL); | |
| 123 | timer_call_after_resynch(NULL, 0, NULL); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | static ADDRESS_MAP_START( v810_mem,ADDRESS_SPACE_PROGRAM, 32 ) |
| r1355 | r1356 | |
|---|---|---|
| 227 | 227 | GFXDECODE_END |
| 228 | 228 | |
| 229 | 229 | |
| 230 | struct VLM5030interface sbasketb_vlm5030_interface = | |
| 230 | static struct VLM5030interface sbasketb_vlm5030_interface = | |
| 231 | 231 | { |
| 232 | 232 | REGION_SOUND1, /* memory region */ |
| 233 | 233 | 0 /* memory size */ |
| r1355 | r1356 | |
|---|---|---|
| 633 | 633 | |
| 634 | 634 | resume_trigger = 1000; |
| 635 | 635 | |
| 636 | dmadelay_timer = timer_alloc(dmaend_callback); | |
| 636 | dmadelay_timer = timer_alloc(dmaend_callback, NULL); | |
| 637 | 637 | } |
| 638 | 638 | |
| 639 | 639 |
| r1355 | r1356 | |
|---|---|---|
| 63 | 63 | if (check < &atarigen_alpha[0x7c0] && (*check & 0x8000)) |
| 64 | 64 | { |
| 65 | 65 | 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); | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /* update the playfield and motion objects */ |
| r1355 | r1356 | |
|---|---|---|
| 366 | 366 | static UINT32* cps3_eeprom; |
| 367 | 367 | static UINT32* cps3_fullscreenzoom; |
| 368 | 368 | |
| 369 | UINT32 cps3_ss_pal_base = 0; | |
| 369 | static UINT32 cps3_ss_pal_base = 0; | |
| 370 | 370 | static UINT32* cps3_colourram; |
| 371 | 371 | static UINT32 cps3_unk_vidregs[0x20/4]; |
| 372 | UINT32 cps3_ss_bank_base = 0; | |
| 372 | static UINT32 cps3_ss_bank_base = 0; | |
| 373 | 373 | |
| 374 | 374 | static UINT32 cps3_screenwidth; |
| 375 | 375 | //cdrom_file* cps3_cd; |
| r1355 | r1356 | |
| 2038 | 2038 | //static UINT8* current_table; |
| 2039 | 2039 | static UINT32 current_table_address = -1; |
| 2040 | 2040 | |
| 2041 | int cps3_rle_length = 0; | |
| 2041 | static int cps3_rle_length = 0; | |
| 2042 | 2042 | |
| 2043 | 2043 | static int last_normal_byte = 0; |
| 2044 | 2044 | |
| r1355 | r1356 | |
| 2515 | 2515 | |
| 2516 | 2516 | if (cps3_use_fastboot) |
| 2517 | 2517 | { |
| 2518 | fastboot_timer = timer_alloc(fastboot_timer_callback); | |
| 2518 | fastboot_timer = timer_alloc(fastboot_timer_callback, NULL); | |
| 2519 | 2519 | // printf("reset\n"); |
| 2520 | 2520 | timer_adjust(fastboot_timer, attotime_zero, 0, attotime_zero); |
| 2521 | 2521 | } |
| r1355 | r1356 | |
|---|---|---|
| 481 | 481 | { |
| 482 | 482 | cpunum_set_input_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE); |
| 483 | 483 | } |
| 484 | struct YM2610interface mcatadv_ym2610_interface = | |
| 484 | static struct YM2610interface mcatadv_ym2610_interface = | |
| 485 | 485 | { |
| 486 | 486 | sound_irq, /* irq */ |
| 487 | 487 | REGION_SOUND1, /* delta_t */ |
| r1355 | r1356 | |
|---|---|---|
| 575 | 575 | static void toaplan2_vblank_irq(int irq_line) |
| 576 | 576 | { |
| 577 | 577 | /* 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); | |
| 579 | 579 | } |
| 580 | 580 | |
| 581 | 581 | static INTERRUPT_GEN( toaplan2_vblank_irq1 ) { toaplan2_vblank_irq(1); } |
| r1355 | r1356 | |
|---|---|---|
| 46 | 46 | |
| 47 | 47 | static WRITE8_HANDLER( tankbust_soundlatch_w ) |
| 48 | 48 | { |
| 49 | timer_call_after_resynch(data,soundlatch_callback); | |
| 49 | timer_call_after_resynch(NULL, data,soundlatch_callback); | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | static READ8_HANDLER( tankbust_soundlatch_r ) |
| r1355 | r1356 | |
| 95 | 95 | break; |
| 96 | 96 | |
| 97 | 97 | 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); | |
| 99 | 99 | break; |
| 100 | 100 | |
| 101 | 101 | case 2: /* 0xe002 coin counter */ |
| r1355 | r1356 | |
|---|---|---|
| 541 | 541 | cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_READONLY, 1); |
| 542 | 542 | |
| 543 | 543 | /* 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); | |
| 548 | 548 | galileo.dma_active = -1; |
| 549 | 549 | |
| 550 | 550 | vblank_irq_num = 0; |
| r1355 | r1356 | |
|---|---|---|
| 55 | 55 | cpu_triggerint(1); |
| 56 | 56 | |
| 57 | 57 | /* 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); | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | |
| 62 | 62 | static WRITE16_HANDLER( main_sound_w ) |
| 63 | 63 | { |
| 64 | 64 | if (ACCESSING_LSB) |
| 65 | timer_call_after_resynch(data & 0xff, delayed_sound_w); | |
| 65 | timer_call_after_resynch(NULL, data & 0xff, delayed_sound_w); | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 |
| r1355 | r1356 | |
|---|---|---|
| 1024 | 1024 | |
| 1025 | 1025 | static void init_rockn_timer(running_machine *machine) |
| 1026 | 1026 | { |
| 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); | |
| 1029 | 1029 | |
| 1030 | 1030 | state_save_register_global_array(tetrisp2_systemregs); |
| 1031 | 1031 | state_save_register_global_array(rocknms_sub_systemregs); |
| r1355 | r1356 | |
| 1056 | 1056 | { |
| 1057 | 1057 | init_rockn_timer(machine); |
| 1058 | 1058 | |
| 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); | |
| 1061 | 1061 | |
| 1062 | 1062 | rockn_protectdata = 3; |
| 1063 | 1063 |
| r1355 | r1356 | |
|---|---|---|
| 57 | 57 | { |
| 58 | 58 | if (mask[i] != 0) |
| 59 | 59 | { |
| 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); | |
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |
| r1355 | r1356 | |
| 71 | 71 | scanline = 0; |
| 72 | 72 | } |
| 73 | 73 | |
| 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); | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | |
| r1355 | r1356 | |
| 87 | 87 | |
| 88 | 88 | static MACHINE_RESET( boxer ) |
| 89 | 89 | { |
| 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); | |
| 91 | 91 | |
| 92 | 92 | pot_latch = 0; |
| 93 | 93 | } |
| r1355 | r1356 | |
|---|---|---|
| 74 | 74 | scanline += SCANLINE_UPDATE_CHUNK; |
| 75 | 75 | if (scanline >= machine->screen[0].height) |
| 76 | 76 | 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); | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | |
| 81 | 81 | static MACHINE_RESET( starfire ) |
| 82 | 82 | { |
| 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); | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 |
| r1355 | r1356 | |
|---|---|---|
| 1183 | 1183 | { /* SUBCPU enable on System 22 (guessed, but too early crashes Rave Racer so it's a good test) */ |
| 1184 | 1184 | if (data == 0xff00) |
| 1185 | 1185 | { |
| 1186 | timer_set(ATTOTIME_IN_MSEC(50), 0, start_subcpu); | |
| 1186 | timer_set(ATTOTIME_IN_MSEC(50), NULL, 0, start_subcpu); | |
| 1187 | 1187 | } |
| 1188 | 1188 | } |
| 1189 | 1189 | } |
| r1355 | r1356 | |
|---|---|---|
| 52 | 52 | { |
| 53 | 53 | if (potsense[i] != 0) |
| 54 | 54 | { |
| 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); | |
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | scanline += 0x40; |
| 60 | 60 | scanline &= 0xff; |
| 61 | 61 | |
| 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); | |
| 63 | 63 | |
| 64 | 64 | flyball_potsense = 0; |
| 65 | 65 | flyball_potmask = 0; |
| r1355 | r1356 | |
| 77 | 77 | for (i = 0; i < 0x1000; i++) |
| 78 | 78 | rombase[i] = ROM[i ^ 0x1ff]; |
| 79 | 79 | |
| 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); | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 |
| r1355 | r1356 | |
|---|---|---|
| 95 | 95 | cpunum_set_input_line(0, INPUT_LINE_RESET, PULSE_LINE); |
| 96 | 96 | |
| 97 | 97 | /* 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); | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | last_coin_input = coin_input; |
| r1355 | r1356 | |
| 174 | 174 | { |
| 175 | 175 | timer_started = 1; |
| 176 | 176 | |
| 177 | timer_pulse(TIMER_HALF_PERIOD, 0, vicdual_timer_callback); | |
| 177 | timer_pulse(TIMER_HALF_PERIOD, NULL, 0, vicdual_timer_callback); | |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | return timer_value; |
| r1355 | r1356 | |
|---|---|---|
| 188 | 188 | { |
| 189 | 189 | sasuke_counter = 0; |
| 190 | 190 | |
| 191 | sasuke_timer = timer_alloc(sasuke_update_counter); | |
| 191 | sasuke_timer = timer_alloc(sasuke_update_counter, NULL); | |
| 192 | 192 | timer_adjust(sasuke_timer, attotime_zero, 0, ATTOTIME_IN_HZ(11289000/8)); // 1.4 MHz |
| 193 | 193 | } |
| 194 | 194 |
| r1355 | r1356 | |
|---|---|---|
| 6 | 6 | * Centipede (5 sets) |
| 7 | 7 | * Warlords |
| 8 | 8 | * Millipede |
| 9 | * Maze Invaders (prototype) | |
| 9 | 10 | * Bulls Eye Darts |
| 10 | 11 | |
| 11 | 12 | Centipede sync-prom added by HIGHWAYMAN. |
| r1355 | r1356 | |
| 450 | 451 | if (scanline & 16) |
| 451 | 452 | cpunum_set_input_line(0, 0, ((scanline - 1) & 32) ? ASSERT_LINE : CLEAR_LINE); |
| 452 | 453 | |
| 454 | /* do a partial update now to handle sprite multiplexing (Maze Invaders) */ | |
| 455 | video_screen_update_partial(0, scanline); | |
| 456 | ||
| 453 | 457 | /* call back again after 16 scanlines */ |
| 454 | 458 | scanline += 16; |
| 455 | 459 | if (scanline >= 256) |
| r1355 | r1356 | |
| 469 | 473 | |
| 470 | 474 | static MACHINE_RESET( centiped ) |
| 471 | 475 | { |
| 472 | interrupt_timer = timer_alloc(generate_interrupt); | |
| 476 | interrupt_timer = timer_alloc(generate_interrupt, NULL); | |
| 473 | 477 | timer_adjust(interrupt_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero); |
| 474 | 478 | cpunum_set_input_line(0, 0, CLEAR_LINE); |
| 475 | 479 | dsw_select = 0; |
| r1355 | r1356 | |
| 591 | 595 | control_select = (data >> 7) & 1; |
| 592 | 596 | } |
| 593 | 597 | |
| 598 | ||
| 599 | static READ8_HANDLER( mazeinv_input_r ) | |
| 600 | { | |
| 601 | return readinputport(6 + control_select); | |
| 602 | } | |
| 603 | ||
| 604 | ||
| 605 | static WRITE8_HANDLER( mazeinv_input_select_w ) | |
| 606 | { | |
| 607 | control_select = offset & 3; | |
| 608 | } | |
| 609 | ||
| 594 | 610 | static READ8_HANDLER( bullsdrt_data_port_r ) |
| 595 | 611 | { |
| 596 | 612 | switch (activecpu_get_pc()) |
| r1355 | r1356 | |
| 603 | 619 | return 0; |
| 604 | 620 | } |
| 605 | 621 | |
| 622 | ||
| 623 | ||
| 606 | 624 | /************************************* |
| 607 | 625 | * |
| 608 | 626 | * Output ports |
| r1355 | r1356 | |
| 772 | 790 | |
| 773 | 791 | |
| 774 | 792 | |
| 793 | /************************************* | |
| 794 | * | |
| 795 | * Maze Invaders CPU memory handlers | |
| 796 | * | |
| 797 | *************************************/ | |
| 798 | ||
| 799 | static 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 | |
| 823 | ADDRESS_MAP_END | |
| 824 | ||
| 825 | ||
| 826 | ||
| 775 | 827 | /**************************************** |
| 776 | 828 | * |
| 777 | 829 | * Bulls Eye Darts CPU memory handlers |
| r1355 | r1356 | |
| 1283 | 1335 | INPUT_PORTS_END |
| 1284 | 1336 | |
| 1285 | 1337 | |
| 1338 | static 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 | |
| 1438 | INPUT_PORTS_END | |
| 1439 | ||
| 1440 | ||
| 1286 | 1441 | static INPUT_PORTS_START( bullsdrt ) |
| 1287 | 1442 | PORT_START /* IN0 */ |
| 1288 | 1443 | PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* trackball data */ |
| r1355 | r1356 | |
| 1594 | 1749 | MACHINE_DRIVER_END |
| 1595 | 1750 | |
| 1596 | 1751 | |
| 1752 | static 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) | |
| 1759 | MACHINE_DRIVER_END | |
| 1760 | ||
| 1761 | ||
| 1597 | 1762 | static MACHINE_DRIVER_START( bullsdrt ) |
| 1598 | 1763 | |
| 1599 | 1764 | /* basic machine hardware */ |
| r1355 | r1356 | |
| 1759 | 1924 | ROM_END |
| 1760 | 1925 | |
| 1761 | 1926 | |
| 1927 | ROM_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) ) | |
| 1942 | ROM_END | |
| 1943 | ||
| 1944 | ||
| 1762 | 1945 | ROM_START( warlords ) |
| 1763 | 1946 | ROM_REGION( 0x10000, REGION_CPU1, 0 ) |
| 1764 | 1947 | ROM_LOAD( "037154.1m", 0x5000, 0x0800, CRC(18006c87) SHA1(6b4aab1b1710819d29f4bbc29269eb9c915626c0) ) |
| r1355 | r1356 | |
| 1842 | 2025 | GAME( 1982, milliped, 0, milliped, milliped, 0, ROT270, "Atari", "Millipede", GAME_SUPPORTS_SAVE ) |
| 1843 | 2026 | |
| 1844 | 2027 | GAME( 1980, warlords, 0, warlords, warlords, 0, ROT0, "Atari", "Warlords", GAME_SUPPORTS_SAVE ) |
| 2028 | GAME( 1981, mazeinv, 0, mazeinv, mazeinv, 0, ROT270, "Atari", "Maze Invaders (prototype)", 0 ) | |
| 1845 | 2029 | |
| 1846 | 2030 | GAME( 1985, bullsdrt, 0, bullsdrt, bullsdrt, bullsdrt, ROT270, "Shinkai Inc. (Magic Eletronics Inc. licence)", "Bulls Eye Darts", GAME_IMPERFECT_COLORS | GAME_SUPPORTS_SAVE ) |
| r1355 | r1356 | |
|---|---|---|
| 186 | 186 | |
| 187 | 187 | /* reset the joystick parameters */ |
| 188 | 188 | joystick_value = 0; |
| 189 | joystick_timer = timer_alloc(delayed_joystick_int); | |
| 189 | joystick_timer = timer_alloc(delayed_joystick_int, NULL); | |
| 190 | 190 | joystick_int = 0; |
| 191 | 191 | joystick_int_enable = 0; |
| 192 | 192 | } |
| r1355 | r1356 | |
|---|---|---|
| 488 | 488 | |
| 489 | 489 | static INTERRUPT_GEN( wgp_cpub_interrupt ) |
| 490 | 490 | { |
| 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); | |
| 492 | 492 | cpunum_set_input_line(2, 4, HOLD_LINE); |
| 493 | 493 | } |
| 494 | 494 | |
| r1355 | r1356 | |
| 611 | 611 | hardware has got the next a/d conversion ready. We set a token |
| 612 | 612 | delay of 10000 cycles although our inputs are always ready. */ |
| 613 | 613 | |
| 614 | timer_set(ATTOTIME_IN_CYCLES(10000,0),0, wgp_interrupt6); | |
| 614 | timer_set(ATTOTIME_IN_CYCLES(10000,0), NULL, 0, wgp_interrupt6); | |
| 615 | 615 | } |
| 616 | 616 | |
| 617 | 617 |
| r1355 | r1356 | |
|---|---|---|
| 117 | 117 | collision_reset = 0; |
| 118 | 118 | collision_index = 0; |
| 119 | 119 | |
| 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); | |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 |
| r1355 | r1356 | |
|---|---|---|
| 1000 | 1000 | if(!offset) |
| 1001 | 1001 | latches[2]|=1; |
| 1002 | 1002 | COMBINE_DATA(&latches[offset]); |
| 1003 | timer_call_after_resynch(0, NULL); | |
| 1003 | timer_call_after_resynch(NULL, 0, NULL); | |
| 1004 | 1004 | } |
| 1005 | 1005 | |
| 1006 | 1006 | static READ16_HANDLER(latch16_r) |
| r1355 | r1356 | |
| 1015 | 1015 | if(!offset) |
| 1016 | 1016 | latches[2]|=2; |
| 1017 | 1017 | latches[offset]=data; |
| 1018 | timer_call_after_resynch(0, NULL); | |
| 1018 | timer_call_after_resynch(NULL, 0, NULL); | |
| 1019 | 1019 | } |
| 1020 | 1020 | |
| 1021 | 1021 | static ADDRESS_MAP_START( jsk_readmem, ADDRESS_SPACE_PROGRAM, 16 ) |
| r1355 | r1356 | |
|---|---|---|
| 15 | 15 | #include "sound/dac.h" |
| 16 | 16 | #include "sound/2151intf.h" |
| 17 | 17 | #include "sound/namco.h" |
| 18 | #include "rendlay.h" | |
| 19 | #include "tceptor2.lh" | |
| 18 | 20 | |
| 19 | 21 | extern PALETTE_INIT( tceptor ); |
| 20 | 22 | extern VIDEO_START( tceptor ); |
| 21 | 23 | extern VIDEO_UPDATE( tceptor ); |
| 24 | extern VIDEO_EOF( tceptor ); | |
| 22 | 25 | |
| 23 | 26 | extern READ8_HANDLER( tceptor_tile_ram_r ); |
| 24 | 27 | extern WRITE8_HANDLER( tceptor_tile_ram_w ); |
| r1355 | r1356 | |
| 220 | 223 | AM_RANGE(0x4f01, 0x4f01) AM_READ(input_port_4_r) // analog input (accel) |
| 221 | 224 | AM_RANGE(0x4f02, 0x4f02) AM_READ(input_port_5_r) // analog input (left/right) |
| 222 | 225 | 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 | |
| 224 | 227 | AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_ROM) |
| 225 | 228 | ADDRESS_MAP_END |
| 226 | 229 | |
| r1355 | r1356 | |
| 234 | 237 | AM_RANGE(0x4000, 0x43ff) AM_WRITE(namcos1_cus30_w) |
| 235 | 238 | AM_RANGE(0x4800, 0x4800) AM_WRITE(MWA8_NOP) // 3D scope left/right? |
| 236 | 239 | 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 | |
| 238 | 241 | AM_RANGE(0x6000, 0x7fff) AM_WRITE(m68k_shared_w) AM_BASE(&m68k_shared_ram) |
| 239 | 242 | AM_RANGE(0x8000, 0x8000) AM_WRITE(m6809_irq_disable_w) |
| 240 | 243 | AM_RANGE(0x8800, 0x8800) AM_WRITE(m6809_irq_enable_w) |
| r1355 | r1356 | |
| 281 | 284 | |
| 282 | 285 | |
| 283 | 286 | static 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 | |
| 287 | 290 | AM_RANGE(0x700000, 0x703fff) AM_READ(m68k_shared_word_r) |
| 288 | 291 | ADDRESS_MAP_END |
| 289 | 292 | |
| r1355 | r1356 | |
| 431 | 434 | PORT_DIPSETTING( 0x03, "B" ) |
| 432 | 435 | PORT_DIPSETTING( 0x01, "C" ) |
| 433 | 436 | PORT_DIPSETTING( 0x00, "D" ) |
| 434 | PORT_DIPNAME( 0x04, 0x0 | |
| 437 | PORT_DIPNAME( 0x04, 0x04, "MODE" ) | |
| 435 | 438 | PORT_DIPSETTING( 0x00, "2D" ) |
| 436 | 439 | PORT_DIPSETTING( 0x04, "3D" ) |
| 437 | 440 | PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r1355 | r1356 | |
| 539 | 542 | MDRV_CPU_IO_MAP(mcu_readport,mcu_writeport) |
| 540 | 543 | MDRV_CPU_VBLANK_INT(mcu_vb_interrupt,1) |
| 541 | 544 | |
| 542 | MDRV_SCREEN_REFRESH_RATE(60.606060) | |
| 543 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) | |
| 544 | 545 | MDRV_INTERLEAVE(100) |
| 545 | 546 | |
| 546 | 547 | MDRV_NVRAM_HANDLER(generic_1fill) |
| r1355 | r1356 | |
| 550 | 551 | |
| 551 | 552 | /* video hardware */ |
| 552 | 553 | 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) | |
| 556 | 554 | MDRV_GFXDECODE(tceptor) |
| 557 | 555 | MDRV_PALETTE_LENGTH(1024) |
| 558 | 556 | MDRV_COLORTABLE_LENGTH(4096) |
| 557 | MDRV_DEFAULT_LAYOUT(layout_horizont) | |
| 559 | 558 | |
| 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 | ||
| 560 | 580 | MDRV_PALETTE_INIT(tceptor) |
| 581 | ||
| 561 | 582 | MDRV_VIDEO_START(tceptor) |
| 562 | 583 | MDRV_VIDEO_UPDATE(tceptor) |
| 584 | MDRV_VIDEO_EOF(tceptor) | |
| 563 | 585 | |
| 564 | 586 | /* sound hardware */ |
| 565 | 587 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") |
| r1355 | r1356 | |
| 694 | 716 | |
| 695 | 717 | |
| 696 | 718 | /* ( YEAR NAME PARENT MACHINE INPUT INIT MONITOR COMPANY FULLNAME ) */ |
| 697 | GAME( 1986, tceptor, 0, tceptor, tceptor, 0, ROT0, "Namco", "Thunder Ceptor", 0) | |
| 698 | GAME( 1986, tceptor2, tceptor, tceptor, tceptor2, 0, ROT0, "Namco", "Thunder Ceptor II", 0) | |
| 719 | GAME ( 1986, tceptor, 0, tceptor, tceptor, 0, ROT0, "Namco", "Thunder Ceptor", 0) | |
| 720 | GAMEL( 1986, tceptor2, tceptor, tceptor, tceptor2, 0, ROT0, "Namco", "Thunder Ceptor II", 0, layout_tceptor2) |
| r1355 | r1356 | |
|---|---|---|
| 57 | 57 | |
| 58 | 58 | static int aquarium_snd_ack; |
| 59 | 59 | |
| 60 | UINT16 *aquarium_scroll, *aquarium_priority; | |
| 60 | UINT16 *aquarium_scroll; | |
| 61 | //UINT16 *aquarium_priority; | |
| 61 | 62 | UINT16 *aquarium_txt_videoram; |
| 62 | 63 | UINT16 *aquarium_mid_videoram; |
| 63 | 64 | UINT16 *aquarium_bak_videoram; |
| r1355 | r1356 | |
|---|---|---|
| 259 | 259 | requested_int[0] = 1; |
| 260 | 260 | requested_int[5] = 1; // write the scroll registers |
| 261 | 261 | /* 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); | |
| 263 | 263 | update_irq_state(); |
| 264 | 264 | break; |
| 265 | 265 | |
| r1355 | r1356 | |
| 754 | 754 | another blit. */ |
| 755 | 755 | if (b1 == 0) |
| 756 | 756 | { |
| 757 | timer_set(ATTOTIME_IN_USEC(500),0,metro_blit_done); | |
| 757 | timer_set(ATTOTIME_IN_USEC(500), NULL,0,metro_blit_done); | |
| 758 | 758 | return; |
| 759 | 759 | } |
| 760 | 760 | |
| r1355 | r1356 | |
| 3679 | 3679 | |
| 3680 | 3680 | ***************************************************************************/ |
| 3681 | 3681 | |
| 3682 | UPD7810_CONFIG metro_cpu_config = | |
| 3682 | static UPD7810_CONFIG metro_cpu_config = | |
| 3683 | 3683 | { |
| 3684 | 3684 | TYPE_7810, |
| 3685 | 3685 | metro_io_callback |
| r1355 | r1356 | |
| 4667 | 4667 | { |
| 4668 | 4668 | metro_common(); |
| 4669 | 4669 | 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); | |
| 4671 | 4671 | } |
| 4672 | 4672 | |
| 4673 | 4673 | static DRIVER_INIT( gakusai ) |
| r1355 | r1356 | |
|---|---|---|
| 63 | 63 | |
| 64 | 64 | memcpy(ram_base, memory_region(REGION_USER1), 0x20000*4); |
| 65 | 65 | |
| 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); | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | |
| r1355 | r1356 | |
| 75 | 75 | |
| 76 | 76 | memcpy(ram_base, memory_region(REGION_USER1), 0x20000*4); |
| 77 | 77 | |
| 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); | |
| 80 | 80 | |
| 81 | 81 | ide_controller_reset(0); |
| 82 | 82 | } |
| r1355 | r1356 | |
| 154 | 154 | if (which < 0 || which > 2) |
| 155 | 155 | logerror("adc_w: unexpected which = %02X\n", which + 4); |
| 156 | 156 | 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); | |
| 158 | 158 | } |
| 159 | 159 | else |
| 160 | 160 | logerror("adc_w without enabling writes!\n"); |
| r1355 | r1356 | |
|---|---|---|
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | |
| 275 | extern game_driver driver_monymony; | |
| 275 | extern const game_driver driver_monymony; | |
| 276 | 276 | |
| 277 | 277 | static READ8_HANDLER( zaccaria_prot1_r ) |
| 278 | 278 | { |
| r1355 | r1356 | |
|---|---|---|
| 2283 | 2283 | static void init_keyboard(void) |
| 2284 | 2284 | { |
| 2285 | 2285 | // set keyboard timer |
| 2286 | keyboard_timer = timer_alloc(keyboard_timer_callback); | |
| 2286 | keyboard_timer = timer_alloc(keyboard_timer_callback, NULL); | |
| 2287 | 2287 | timer_adjust(keyboard_timer, ATTOTIME_IN_MSEC(10), 0, ATTOTIME_IN_MSEC(10)); |
| 2288 | 2288 | } |
| 2289 | 2289 |
| r1355 | r1356 | |
|---|---|---|
| 120 | 120 | |
| 121 | 121 | static void create_analog_timers(void) |
| 122 | 122 | { |
| 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); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 |
| r1355 | r1356 | |
|---|---|---|
| 113 | 113 | } |
| 114 | 114 | static WRITE8_HANDLER(beg_fromsound_w) /* write to D800 sets bit 1 in status */ |
| 115 | 115 | { |
| 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); | |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | static READ8_HANDLER(beg_fromsound_r) |
| 120 | 120 | { |
| 121 | 121 | /* set a timer to force synchronization after the read */ |
| 122 | timer_call_after_resynch(0, NULL); | |
| 122 | timer_call_after_resynch(NULL, 0, NULL); | |
| 123 | 123 | return from_sound; |
| 124 | 124 | } |
| 125 | 125 | |
| r1355 | r1356 | |
| 127 | 127 | { |
| 128 | 128 | UINT8 ret = sound_state; |
| 129 | 129 | /* set a timer to force synchronization after the read */ |
| 130 | timer_call_after_resynch(0, NULL); | |
| 130 | timer_call_after_resynch(NULL, 0, NULL); | |
| 131 | 131 | sound_state &= ~2; /* read from port 21 clears bit 1 in status */ |
| 132 | 132 | return ret; |
| 133 | 133 | } |
| r1355 | r1356 | |
| 135 | 135 | static READ8_HANDLER(soundstate_r) |
| 136 | 136 | { |
| 137 | 137 | /* set a timer to force synchronization after the read */ |
| 138 | timer_call_after_resynch(0, NULL); | |
| 138 | timer_call_after_resynch(NULL, 0, NULL); | |
| 139 | 139 | return sound_state; |
| 140 | 140 | } |
| 141 | 141 | |
| r1355 | r1356 | |
| 148 | 148 | static WRITE8_HANDLER( sound_command_w ) /* write to port 20 clears bit 0 in status */ |
| 149 | 149 | { |
| 150 | 150 | for_sound = data; |
| 151 | timer_call_after_resynch(data,nmi_callback); | |
| 151 | timer_call_after_resynch(NULL, data,nmi_callback); | |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | static READ8_HANDLER( sound_command_r ) /* read from D800 sets bit 0 in status */ |
| r1355 | r1356 | |
| 184 | 184 | /* do this on a timer to let the CPUs synchronize */ |
| 185 | 185 | static WRITE8_HANDLER (beg13A_clr_w) |
| 186 | 186 | { |
| 187 | timer_call_after_resynch((0<<8) | 0, deferred_ls74_w); | |
| 187 | timer_call_after_resynch(NULL, (0<<8) | 0, deferred_ls74_w); | |
| 188 | 188 | } |
| 189 | 189 | static WRITE8_HANDLER (beg13B_clr_w) |
| 190 | 190 | { |
| 191 | timer_call_after_resynch((1<<8) | 0, deferred_ls74_w); | |
| 191 | timer_call_after_resynch(NULL, (1<<8) | 0, deferred_ls74_w); | |
| 192 | 192 | } |
| 193 | 193 | static WRITE8_HANDLER (beg13A_set_w) |
| 194 | 194 | { |
| 195 | timer_call_after_resynch((0<<8) | 1, deferred_ls74_w); | |
| 195 | timer_call_after_resynch(NULL, (0<<8) | 1, deferred_ls74_w); | |
| 196 | 196 | } |
| 197 | 197 | static WRITE8_HANDLER (beg13B_set_w) |
| 198 | 198 | { |
| 199 | timer_call_after_resynch((1<<8) | 1, deferred_ls74_w); | |
| 199 | timer_call_after_resynch(NULL, (1<<8) | 1, deferred_ls74_w); | |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | static READ8_HANDLER( beg_status_r ) |
| r1355 | r1356 | |
| 211 | 211 | |
| 212 | 212 | */ |
| 213 | 213 | /* set a timer to force synchronization after the read */ |
| 214 | timer_call_after_resynch(0, NULL); | |
| 214 | timer_call_after_resynch(NULL, 0, NULL); | |
| 215 | 215 | return (beg13_ls74[0]<<0) | (beg13_ls74[1]<<1); |
| 216 | 216 | } |
| 217 | 217 |
| r1355 | r1356 | |
|---|---|---|
| 285 | 285 | static WRITE16_HANDLER( int_enable_w ) |
| 286 | 286 | { |
| 287 | 287 | 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); | |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 |
| r1355 | r1356 | |
|---|---|---|
| 39 | 39 | DAC_data_w(0,DACROM[(dac_bank * 0x10000 + dac_adr++) & 0x1ffff]); |
| 40 | 40 | |
| 41 | 41 | 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); | |
| 43 | 43 | else |
| 44 | 44 | dac_busy = 0; |
| 45 | 45 | } |
| r1355 | r1356 | |
| 55 | 55 | dac_adr = dac_adr_s << 8; |
| 56 | 56 | |
| 57 | 57 | if (dac_busy == 0) |
| 58 | timer_call_after_resynch(0,dac_callback); | |
| 58 | timer_call_after_resynch(NULL, 0,dac_callback); | |
| 59 | 59 | |
| 60 | 60 | dac_busy = 1; |
| 61 | 61 | } |
| r1355 | r1356 | |
|---|---|---|
| 141 | 141 | |
| 142 | 142 | static void create_interrupt_timer(void) |
| 143 | 143 | { |
| 144 | interrupt_timer = timer_alloc(interrupt_callback); | |
| 144 | interrupt_timer = timer_alloc(interrupt_callback, NULL); | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 |
| r1355 | r1356 | |
|---|---|---|
| 569 | 569 | |
| 570 | 570 | static TIMER_CALLBACK( scanline_timer_callback ) |
| 571 | 571 | { |
| 572 | timer_call_after_resynch(0, 0); | |
| 572 | timer_call_after_resynch(NULL, 0, 0); | |
| 573 | 573 | |
| 574 | 574 | if (scanline_counter!=(total_scanlines-1)) |
| 575 | 575 | { |
| r1355 | r1356 | |
| 612 | 612 | |
| 613 | 613 | static MACHINE_RESET(wheelfir) |
| 614 | 614 | { |
| 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); | |
| 617 | 617 | timer_adjust(frame_timer, attotime_zero, 0, attotime_zero); |
| 618 | 618 | timer_adjust(scanline_timer, attotime_zero, 0, attotime_zero); |
| 619 | 619 | scanline_counter = -1; |
| r1355 | r1356 | |
|---|---|---|
| 646 | 646 | { |
| 647 | 647 | /* the port C handshaking signals control the sub CPU IRQ, */ |
| 648 | 648 | /* 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); | |
| 650 | 650 | } |
| 651 | 651 | |
| 652 | 652 |
| r1355 | r1356 | |
|---|---|---|
| 1287 | 1287 | uPD71054.max[no] = 0xffff; |
| 1288 | 1288 | } |
| 1289 | 1289 | 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); | |
| 1291 | 1291 | } |
| 1292 | 1292 | } |
| 1293 | 1293 |
| r1355 | r1356 | |
|---|---|---|
| 220 | 220 | /* Kaos sits in a tight loop polling the VIA irq flags register, but that register is |
| 221 | 221 | cleared by the irq handler. Therefore, I wait a bit before triggering the irq to |
| 222 | 222 | 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); | |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 |
| r1355 | r1356 | |
|---|---|---|
| 443 | 443 | |
| 444 | 444 | #define CPU_CLOCK 200000000 |
| 445 | 445 | /* MD2 MD1 MD0 MD6 MD4 MD3 MD5 MD7 MD8 */ |
| 446 | struct sh4_config sh4cpu_config = { 1, 0, 1, 0, 0, 0, 1, 1, 0, CPU_CLOCK }; | |
| 446 | static struct sh4_config sh4cpu_config = { 1, 0, 1, 0, 0, 0, 1, 1, 0, CPU_CLOCK }; | |
| 447 | 447 | |
| 448 | 448 | static UINT64 *dc_sound_ram; |
| 449 | 449 |
| r1355 | r1356 | |
|---|---|---|
| 74 | 74 | static MACHINE_START( magmax ) |
| 75 | 75 | { |
| 76 | 76 | /* Create interrupt timer */ |
| 77 | interrupt_timer = timer_alloc(scanline_callback); | |
| 77 | interrupt_timer = timer_alloc(scanline_callback, NULL); | |
| 78 | 78 | |
| 79 | 79 | /* Set up save state */ |
| 80 | 80 | state_save_register_global(sound_latch); |
| r1355 | r1356 | |
|---|---|---|
| 2642 | 2642 | |
| 2643 | 2643 | GFXDECODE_END |
| 2644 | 2644 | |
| 2645 | struct sh2_config sh2_conf_master = { 0 }; | |
| 2646 | struct sh2_config sh2_conf_slave = { 1 }; | |
| 2645 | static struct sh2_config sh2_conf_master = { 0 }; | |
| 2646 | static struct sh2_config sh2_conf_slave = { 1 }; | |
| 2647 | 2647 | |
| 2648 | 2648 | static int scsp_last_line = 0; |
| 2649 | 2649 |
| r1355 | r1356 | |
|---|---|---|
| 19 | 19 | todo: cleanup, fix so that everything works properly |
| 20 | 20 | games are marked as NOT WORKING due to |
| 21 | 21 | 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 | |
| 23 | 23 | |
| 24 | 24 | |
| 25 | 25 | About MegaTech: |
| r1355 | r1356 | |
| 1057 | 1057 | |
| 1058 | 1058 | #define MEGATECH_GAME04(GAME_REGION, INSTRUCTION_REGION) \ |
| 1059 | 1059 | ROM_REGION( 0x300000, GAME_REGION, 0 ) \ |
| 1060 | ROM_LOAD( "mp11129f.ic1", 0x000000, 0x020000, CRC( | |
| 1060 | ROM_LOAD( "mp11129f.ic1", 0x000000, 0x020000, CRC( | |
| 1061 | 1061 | MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_SMS ) \ |
| 1062 | 1062 | 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 */ | |
| 1063 | 1064 | |
| 1064 | 1065 | ROM_START( mt_ggolf ) |
| 1065 | 1066 | MEGATECH_BIOS |
| r1355 | r1356 | |
| 1248 | 1249 | /* 01 */ GAME( 1988, mt_beast, megatech, megatech, megatech, mtnew, ROT0, "Sega", "Altered Beast (Mega-Tech)", GAME_NOT_WORKING ) |
| 1249 | 1250 | /* 02 */ GAME( 1988, mt_shar2, megatech, megatech, megatech, mtnew, ROT0, "Sega", "Space Harrier II (Mega-Tech)", GAME_NOT_WORKING ) |
| 1250 | 1251 | /* 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 */ | |
| 1256 | 1257 | /* 09 */ // unknown |
| 1257 | /* 10 */ GAME( 19 | |
| 1258 | /* 10 */ GAME( 1987, mt_aftrb, megatech, megatech, megatech, mtnew, ROT0, "Sega", "After Burner (Mega-Tech, SMS based)", GAME_NOT_WORKING) /* sms */ | |
| 1258 | 1259 | /* 11 */ GAME( 1989, mt_tfor2, megatech, megatech, megatech, mtnew, ROT0, "Tecno Soft / Sega", "Thunder Force II MD (Mega-Tech)", GAME_NOT_WORKING ) |
| 1259 | 1260 | /* 12 */ // unknown |
| 1260 | /* 13 */ GAME( 19 | |
| 1261 | /* 13 */ GAME( 1986, mt_astro, megatech, megatech, megatech, mtnew, ROT0, "Sega", "Astro Warrior (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! */ | |
| 1261 | 1262 | /* 14 */ // unknown |
| 1262 | 1263 | /* 15 */ // unknown |
| 1263 | 1264 | /* 16 */ // unknown |
| r1355 | r1356 | |
| 1266 | 1267 | /* 19 */ // unknown |
| 1267 | 1268 | /* 20 */ GAME( 1989, mt_lastb, megatech, megatech, megatech, mtnew, ROT0, "Sega", "Last Battle (Mega-Tech)", GAME_NOT_WORKING ) |
| 1268 | 1269 | /* 21 */ GAME( 1989, mt_wcsoc, megatech, megatech, megatech, mtnew, ROT0, "Sega", "World Championship Soccer (Mega-Tech)", GAME_NOT_WORKING ) |
| 1269 | /* 22 */ GAME( 19 | |
| 1270 | /* 22 */ GAME( 1989, mt_tetri, megatech, megatech, megatech, mtnew, ROT0, "Sega", "Tetris (Mega-Tech)", GAME_NOT_WORKING ) | |
| 1270 | 1271 | /* 23 */ GAME( 1989, mt_gng, megatech, megatech, megatech, mtnew, ROT0, "Capcom / Sega", "Ghouls'n Ghosts (Mega-Tech)", GAME_NOT_WORKING ) |
| 1271 | 1272 | /* 24 */ GAME( 1989, mt_shang, megatech, megatech, megatech, mtnew, ROT0, "Sega", "Super Hang-On (Mega-Tech)", GAME_NOT_WORKING ) |
| 1272 | 1273 | /* 25 */ GAME( 1989, mt_gaxe, megatech, megatech, megatech, mtnew, ROT0, "Sega", "Golden Axe (Mega-Tech)", GAME_NOT_WORKING ) |
| 1273 | 1274 | /* 26 */ GAME( 1989, mt_fwrld, megatech, megatech, megatech, mtnew, ROT0, "Sega", "Forgotten Worlds (Mega-Tech)", GAME_NOT_WORKING ) |
| 1274 | 1275 | /* 27 */ GAME( 1989, mt_mystd, megatech, megatech, megatech, mtnew, ROT0, "Sega", "Mystic Defender (Mega-Tech)", GAME_NOT_WORKING ) |
| 1275 | 1276 | /* 28 */ GAME( 1989, mt_revsh, megatech, megatech, megatech, mtnew, ROT0, "Sega", "The Revenge of Shinobi (Mega-Tech)", GAME_NOT_WORKING ) |
| 1276 | /* 29 */ GAME( 19 | |
| 1277 | /* 29 */ GAME( 1987, mt_parlg, megatech, megatech, megatech, mtnew, ROT0, "Sega", "Parlour Games (Mega-Tech, SMS based)", GAME_NOT_WORKING ) /* sms! */ | |
| 1277 | 1278 | /* 30 */ // unknown |
| 1278 | 1279 | /* 31 */ GAME( 1989, mt_tgolf, megatech, megatech, megatech, mtnew, ROT0, "Sega", "Arnold Palmer Tournament Golf (Mega-Tech)", GAME_NOT_WORKING ) |
| 1279 | 1280 | /* 32 */ GAME( 1989, mt_srbb, megatech, megatech, megatech, mtnew, ROT0, "Sega", "Super Real Basketball (Mega-Tech)", GAME_NOT_WORKING ) |
| r1355 | r1356 | |
|---|---|---|
| 145 | 145 | static MACHINE_START( alg ) |
| 146 | 146 | { |
| 147 | 147 | 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); | |
| 149 | 149 | serial_timer_active = FALSE; |
| 150 | 150 | } |
| 151 | 151 |
| r1355 | r1356 | |
|---|---|---|
| 121 | 121 | static WRITE8_HANDLER( bombjack_soundlatch_w ) |
| 122 | 122 | { |
| 123 | 123 | /* 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); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | static READ8_HANDLER( bombjack_soundlatch_r ) |
| r1355 | r1356 | |
|---|---|---|
| 119 | 119 | { |
| 120 | 120 | /* next interrupt after scanline 256 is scanline 64 */ |
| 121 | 121 | 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); | |
| 123 | 123 | 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); | |
| 125 | 125 | |
| 126 | 126 | /* IRQ starts on scanline 0, 64, 128, etc. */ |
| 127 | 127 | cpunum_set_input_line(0, M6809_IRQ_LINE, ASSERT_LINE); |
| 128 | 128 | |
| 129 | 129 | /* 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); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | |
| r1355 | r1356 | |
| 140 | 140 | static TIMER_CALLBACK( firq_timer ) |
| 141 | 141 | { |
| 142 | 142 | /* 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); | |
| 144 | 144 | |
| 145 | 145 | /* IRQ starts on scanline FIRQ_SCANLINE? */ |
| 146 | 146 | cpunum_set_input_line(0, M6809_FIRQ_LINE, ASSERT_LINE); |
| 147 | 147 | |
| 148 | 148 | /* 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); | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | |
| 153 | 153 | static MACHINE_RESET( gridlee ) |
| 154 | 154 | { |
| 155 | 155 | /* 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); | |
| 158 | 158 | |
| 159 | 159 | /* create the polynomial tables */ |
| 160 | 160 | poly17_init(); |
| r1355 | r1356 | |
|---|---|---|
| 82 | 82 | |
| 83 | 83 | DAC_data_w( 0, rom[dac_address+cur_dac_address_index] ); |
| 84 | 84 | |
| 85 | timer_set( ATTOTIME_IN_HZ( 16000 ), 0, dac_irq ); | |
| 85 | timer_set( ATTOTIME_IN_HZ( 16000 ), NULL, 0, dac_irq ); | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1355 | r1356 | |
|---|---|---|
| 642 | 642 | } |
| 643 | 643 | |
| 644 | 644 | |
| 645 | struct EEPROM_interface zeropnt2_eeprom_interface = | |
| 645 | static struct EEPROM_interface zeropnt2_eeprom_interface = | |
| 646 | 646 | { |
| 647 | 647 | 7, // address bits 7 |
| 648 | 648 | 8, // data bits 8 |
| r1355 | r1356 | |
|---|---|---|
| 64 | 64 | { |
| 65 | 65 | /* Unsure of actual sequence */ |
| 66 | 66 | |
| 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); | |
| 69 | 69 | cpunum_set_input_line(0, 4, HOLD_LINE); |
| 70 | 70 | } |
| 71 | 71 |
| r1355 | r1356 | |
|---|---|---|
| 1200 | 1200 | 0 |
| 1201 | 1201 | }; |
| 1202 | 1202 | |
| 1203 | struct Samplesinterface seawolf2_samples_interface = | |
| 1203 | static struct Samplesinterface seawolf2_samples_interface = | |
| 1204 | 1204 | { |
| 1205 | 1205 | 10, /* 5*2 channels */ |
| 1206 | 1206 | seawolf_sample_names |
| r1355 | r1356 | |
| 1226 | 1226 | * |
| 1227 | 1227 | *************************************/ |
| 1228 | 1228 | |
| 1229 | struct z80_irq_daisy_chain tenpin_daisy_chain[] = | |
| 1229 | static struct z80_irq_daisy_chain tenpin_daisy_chain[] = | |
| 1230 | 1230 | { |
| 1231 | 1231 | { z80ctc_reset, z80ctc_irq_state, z80ctc_irq_ack, z80ctc_irq_reti, 0 }, /* CTC number 0 */ |
| 1232 | 1232 | { 0, 0, 0, 0, -1 } /* end mark */ |
| r1355 | r1356 | |
|---|---|---|
| 267 | 267 | static WRITE8_HANDLER( sound_command_w ) |
| 268 | 268 | { |
| 269 | 269 | soundlatch_w(0,data); |
| 270 | timer_call_after_resynch(data,nmi_callback); | |
| 270 | timer_call_after_resynch(NULL, data,nmi_callback); | |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | static WRITE8_HANDLER( nmi_disable_w ) |
| r1355 | r1356 | |
|---|---|---|
| 1607 | 1607 | 0 /* end of array */ |
| 1608 | 1608 | }; |
| 1609 | 1609 | |
| 1610 | struct Samplesinterface battles_samples_interface = | |
| 1610 | static struct Samplesinterface battles_samples_interface = | |
| 1611 | 1611 | { |
| 1612 | 1612 | 1, /* one channel */ |
| 1613 | 1613 | battles_sample_names |
| r1355 | r1356 | |
|---|---|---|
| 235 | 235 | PORT_BIT( 0xe7, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 236 | 236 | |
| 237 | 237 | 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") | |
| 239 | 239 | PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C )) |
| 240 | 240 | PORT_DIPSETTING( 0x04, DEF_STR( 4C_1C )) |
| 241 | 241 | PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C )) |
| r1355 | r1356 | |
| 244 | 244 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_2C )) |
| 245 | 245 | PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C )) |
| 246 | 246 | 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") | |
| 249 | 248 | PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C )) |
| 250 | 249 | PORT_DIPSETTING( 0x18, DEF_STR( 1C_1C )) |
| 251 | 250 | PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C )) |
| 252 | 251 | 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") | |
| 264 | 254 | PORT_DIPSETTING( 0x40, DEF_STR( No ) ) |
| 265 | 255 | 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") | |
| 267 | 257 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 268 | 258 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 269 | 259 | |
| 270 | 260 | 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") | |
| 272 | 262 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 273 | 263 | 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") | |
| 275 | 265 | PORT_DIPSETTING( 0x06, DEF_STR( Easy ) ) |
| 276 | 266 | PORT_DIPSETTING( 0x04, DEF_STR( Medium ) ) |
| 277 | 267 | PORT_DIPSETTING( 0x02, DEF_STR( Hard ) ) |
| 278 | 268 | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) |
| 279 | PORT_DIPNAME( 0x18, 0x | |
| 269 | PORT_DIPNAME( 0x18, 0x18, "Bonus" ) PORT_DIPLOCATION("SW2:5,4") | |
| 280 | 270 | PORT_DIPSETTING( 0x18, "50k & every 1OOk" ) |
| 281 | 271 | PORT_DIPSETTING( 0x10, "1Ok 20k" ) |
| 282 | 272 | PORT_DIPSETTING( 0x08, "20k 40k" ) |
| 283 | 273 | 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") | |
| 291 | 275 | PORT_DIPSETTING( 0x00, "4" ) |
| 292 | 276 | PORT_DIPSETTING( 0x20, "2" ) |
| 293 | 277 | PORT_DIPSETTING( 0x40, "3" ) |
| 294 | 278 | PORT_DIPSETTING( 0x60, "1" ) |
| 295 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) ) | |
| 279 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:1") | |
| 296 | 280 | PORT_DIPSETTING( 0x80, DEF_STR( Upright ) ) |
| 297 | 281 | PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) |
| 298 | 282 | |
| 299 | 283 | PORT_START_TAG(T5182COINPORT) |
| 300 | 284 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(2) |
| 301 | 285 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(2) |
| 302 | ||
| 303 | 286 | INPUT_PORTS_END |
| 304 | 287 | |
| 305 | 288 | static const gfx_layout charlayout = |
| r1355 | r1356 | |
|---|---|---|
| 430 | 430 | The ADC60808 clock is 512kHz. Conversion takes between 0 and 8 clock |
| 431 | 431 | cycles, so would end in a maximum of 15.625us. We'll use 10. */ |
| 432 | 432 | |
| 433 | timer_set(ATTOTIME_IN_USEC(10),0, ad_interrupt); | |
| 433 | timer_set(ATTOTIME_IN_USEC(10), NULL,0, ad_interrupt); | |
| 434 | 434 | } |
| 435 | 435 | |
| 436 | 436 |
| r1355 | r1356 | |
|---|---|---|
| 187 | 187 | |
| 188 | 188 | static INTERRUPT_GEN( slapshot_interrupt ) |
| 189 | 189 | { |
| 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); | |
| 191 | 191 | cpunum_set_input_line(0,5,HOLD_LINE); |
| 192 | 192 | } |
| 193 | 193 |
| r1355 | r1356 | |
|---|---|---|
| 161 | 161 | |
| 162 | 162 | static void startTimer(void) |
| 163 | 163 | { |
| 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); | |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | static WRITE32_HANDLER(T1GO_w) |
| r1355 | r1356 | |
|---|---|---|
| 154 | 154 | |
| 155 | 155 | static WRITE8_HANDLER( sound_command_w ) |
| 156 | 156 | { |
| 157 | timer_call_after_resynch(data, delayed_command_w); | |
| 157 | timer_call_after_resynch(NULL, data, delayed_command_w); | |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 |
| r1355 | r1356 | |
|---|---|---|
| 825 | 825 | |
| 826 | 826 | static MACHINE_RESET( cninja ) |
| 827 | 827 | { |
| 828 | raster_irq_timer = timer_alloc(interrupt_gen); | |
| 828 | raster_irq_timer = timer_alloc(interrupt_gen, NULL); | |
| 829 | 829 | cninja_scanline=0; |
| 830 | 830 | cninja_irq_mask=0; |
| 831 | 831 | } |
| r1355 | r1356 | |
|---|---|---|
| 391 | 391 | opcode_base = opcode_arg_base = videoram; |
| 392 | 392 | |
| 393 | 393 | /* 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); | |
| 395 | 395 | timer_adjust(cpu_timer, video_screen_get_time_until_pos(0, v_to_scanline(0), 0), 0, attotime_zero); |
| 396 | 396 | |
| 397 | 397 | /* 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); | |
| 399 | 399 | irq_state = 0; |
| 400 | 400 | schedule_next_irq(-32); |
| 401 | 401 |
| r1355 | r1356 | |
|---|---|---|
| 97 | 97 | static WRITE8_HANDLER( sound_command_w ) |
| 98 | 98 | { |
| 99 | 99 | soundlatch_w(0,data); |
| 100 | timer_call_after_resynch(data,nmi_callback); | |
| 100 | timer_call_after_resynch(NULL, data,nmi_callback); | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | static WRITE8_HANDLER( nmi_disable_w ) |
| r1355 | r1356 | |
|---|---|---|
| 660 | 660 | ROM[0x044A/2] = 0x4E71; |
| 661 | 661 | ROM[0x04bc/2] = 0x0000; |
| 662 | 662 | 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); | |
| 664 | 664 | gametype=0; |
| 665 | 665 | } |
| 666 | 666 | |
| r1355 | r1356 | |
| 682 | 682 | ROM[0x04822/2] = 0x4E71; |
| 683 | 683 | ROM[0x04862/2] = 0x4E71; |
| 684 | 684 | |
| 685 | timer_set(ATTOTIME_IN_SEC(2),0,reset_callback); | |
| 685 | timer_set(ATTOTIME_IN_SEC(2), NULL,0,reset_callback); | |
| 686 | 686 | gametype=1; |
| 687 | 687 | |
| 688 | 688 | } |
| r1355 | r1356 | |
|---|---|---|
| 106 | 106 | void polyplay_sh_start(void); |
| 107 | 107 | |
| 108 | 108 | /* timer handling */ |
| 109 | static TIMER_CALLBACK( timer_callback ); | |
| 109 | static TIMER_CALLBACK( polyplay_timer_callback ); | |
| 110 | 110 | static emu_timer* polyplay_timer; |
| 111 | 111 | static WRITE8_HANDLER( polyplay_start_timer2 ); |
| 112 | 112 | static WRITE8_HANDLER( polyplay_sound_channel ); |
| r1355 | r1356 | |
| 133 | 133 | polyplay_set_channel2(0); |
| 134 | 134 | polyplay_play_channel2(0); |
| 135 | 135 | |
| 136 | polyplay_timer = timer_alloc(timer_callback); | |
| 136 | polyplay_timer = timer_alloc(polyplay_timer_callback, NULL); | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | |
| r1355 | r1356 | |
| 365 | 365 | ROM_END |
| 366 | 366 | |
| 367 | 367 | |
| 368 | static TIMER_CALLBACK( timer_callback ) | |
| 368 | static TIMER_CALLBACK( polyplay_timer_callback ) | |
| 369 | 369 | { |
| 370 | 370 | cpunum_set_input_line_and_vector(0, 0, HOLD_LINE, 0x4c); |
| 371 | 371 | } |
| r1355 | r1356 | |
|---|---|---|
| 446 | 446 | switch (offset & 0xe0) |
| 447 | 447 | { |
| 448 | 448 | 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); | |
| 450 | 450 | break; |
| 451 | 451 | |
| 452 | 452 | case 0x20: /* coin bits I/O1 */ |
| r1355 | r1356 | |
|---|---|---|
| 780 | 780 | { NULL, misc_w }, /* Port C write */ |
| 781 | 781 | }; |
| 782 | 782 | |
| 783 | struct AY8910interface merit_ay8912_interface = | |
| 783 | static struct AY8910interface merit_ay8912_interface = | |
| 784 | 784 | { |
| 785 | 785 | 0,0, |
| 786 | 786 | led2_w,0 |
| r1355 | r1356 | |
|---|---|---|
| 468 | 468 | ROM_LOAD( "gc05.bin", 0x00000, 0x20000, CRC(2f2246ff) SHA1(3fcceb6f5aa5f33187bcf4c59d88327f396fa80d) ) |
| 469 | 469 | ROM_END |
| 470 | 470 | |
| 471 | /* is this actually a good dump?, there are no backgrounds ingame! */ | |
| 472 | ROM_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) ) | |
| 489 | ROM_END | |
| 490 | ||
| 471 | 491 | ROM_START( supbtimj ) |
| 472 | 492 | ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */ |
| 473 | 493 | ROM_LOAD16_BYTE( "gc03.bin", 0x00000, 0x20000, CRC(b5621f6a) SHA1(2dfd361e81dc4805bc248cc293d94131162df2d2) ) |
| r1355 | r1356 | |
| 508 | 528 | |
| 509 | 529 | /******************************************************************************/ |
| 510 | 530 | |
| 511 | GAME( 1990, supbtime, 0, supbtime, supbtime, 0, ROT0, "Data East Corporation", "Super Burger Time (World)", 0 ) | |
| 531 | GAME( 1990, supbtime, 0, supbtime, supbtime, 0, ROT0, "Data East Corporation", "Super Burger Time (World, set 1)", 0 ) | |
| 532 | GAME( 1990, supbtima, supbtime, supbtime, supbtime, 0, ROT0, "Data East Corporation", "Super Burger Time (World, set 2)", 0 ) | |
| 512 | 533 | GAME( 1990, supbtimj, supbtime, supbtime, supbtime, 0, ROT0, "Data East Corporation", "Super Burger Time (Japan)", 0 ) |
| 513 | 534 | GAME( 1991, chinatwn, 0, chinatwn, chinatwn, 0, ROT0, "Data East Corporation", "China Town (Japan)", 0 ) |
| r1355 | r1356 | |
|---|---|---|
| 124 | 124 | |
| 125 | 125 | static WRITE8_HANDLER( main_to_sound_w ) |
| 126 | 126 | { |
| 127 | timer_call_after_resynch(data, main_to_sound_callback); | |
| 127 | timer_call_after_resynch(NULL, data, main_to_sound_callback); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | |
| r1355 | r1356 | |
| 151 | 151 | |
| 152 | 152 | static WRITE8_HANDLER( sound_to_main_w ) |
| 153 | 153 | { |
| 154 | timer_call_after_resynch(data, sound_to_main_callback); | |
| 154 | timer_call_after_resynch(NULL, data, sound_to_main_callback); | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 |
| r1355 | r1356 | |
|---|---|---|
| 307 | 307 | static INTERRUPT_GEN( topspeed_interrupt ) |
| 308 | 308 | { |
| 309 | 309 | /* 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); | |
| 311 | 311 | cpunum_set_input_line(0, 5, HOLD_LINE); |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | static INTERRUPT_GEN( topspeed_cpub_interrupt ) |
| 315 | 315 | { |
| 316 | 316 | /* 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); | |
| 318 | 318 | cpunum_set_input_line(2, 5, HOLD_LINE); |
| 319 | 319 | } |
| 320 | 320 |
| r1355 | r1356 | |
|---|---|---|
| 305 | 305 | //static UINT8* sms_rom; |
| 306 | 306 | static UINT8* sms_mainram; |
| 307 | 307 | //static UINT8* smsgg_backupram; |
| 308 | static TIMER_CALLBACK | |
| 308 | static TIMER_CALLBACK | |
| 309 | 309 | static struct sms_vdp *vdp2; |
| 310 | 310 | static struct sms_vdp *vdp1; |
| 311 | 311 | |
| r1355 | r1356 | |
| 729 | 729 | chip->writemode = 0; |
| 730 | 730 | chip->r_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format); |
| 731 | 731 | |
| 732 | chip->sms_scanline_timer = timer_alloc | |
| 732 | chip->sms_scanline_timer = timer_alloc | |
| 733 | 733 | |
| 734 | 734 | return chip; |
| 735 | 735 | } |
| r1355 | r1356 | |
| 737 | 737 | /* stop timer and clear ram.. used on megatech when we switch between genesis and sms mode */ |
| 738 | 738 | void segae_md_sms_stop_scanline_timer(void) |
| 739 | 739 | { |
| 740 | timer_adjust | |
| 740 | timer_adjust | |
| 741 | 741 | memset(md_sms_vdp->vram,0x00,0x4000); |
| 742 | 742 | } |
| 743 | 743 | |
| r1355 | r1356 | |
| 1284 | 1284 | } |
| 1285 | 1285 | |
| 1286 | 1286 | |
| 1287 | static TIMER_CALLBACK | |
| 1287 | static TIMER_CALLBACK | |
| 1288 | 1288 | { |
| 1289 | 1289 | /* This function is called at the very start of every scanline starting at the very |
| 1290 | 1290 | top-left of the screen. The first scanline is scanline 0 (we set scanline to -1 in |
| r1355 | r1356 | |
| 1299 | 1299 | The position to get the H position also has to compensate for a few errors |
| 1300 | 1300 | */ |
| 1301 | 1301 | // printf("num %d\n",num ); |
| 1302 | struct sms_vdp *chip = p | |
| 1302 | struct sms_vdp *chip = ptr | |
| 1303 | 1303 | |
| 1304 | 1304 | if (chip->sms_scanline_counter<(chip->sms_total_scanlines-1)) |
| 1305 | 1305 | { |
| 1306 | 1306 | chip->sms_scanline_counter++; |
| 1307 | timer_adjust | |
| 1307 | timer_adjust | |
| 1308 | 1308 | |
| 1309 | 1309 | if (chip->sms_scanline_counter>sms_mode_table[chip->screen_mode].sms2_height) |
| 1310 | 1310 | { |
| r1355 | r1356 | |
| 1469 | 1469 | |
| 1470 | 1470 | chip->sms_scanline_counter = -1; |
| 1471 | 1471 | chip->yscroll = chip->regs[0x9]; // this can't change mid-frame |
| 1472 | timer_adjust | |
| 1472 | timer_adjust | |
| 1473 | 1473 | } |
| 1474 | 1474 | |
| 1475 | 1475 | #ifdef UNUSED_FUNCTION |
| r1355 | r1356 | |
| 1491 | 1491 | #ifdef UNUSED_FUNCTION |
| 1492 | 1492 | MACHINE_RESET(sms) |
| 1493 | 1493 | { |
| 1494 | timer_adjust | |
| 1494 | timer_adjust | |
| 1495 | 1495 | } |
| 1496 | 1496 | #endif |
| 1497 | 1497 | |
| r1355 | r1356 | |
| 1949 | 1949 | |
| 1950 | 1950 | static MACHINE_RESET(systeme) |
| 1951 | 1951 | { |
| 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); | |
| 1954 | 1954 | } |
| 1955 | 1955 | |
| 1956 | 1956 | MACHINE_RESET(megatech_md_sms) |
| 1957 | 1957 | { |
| 1958 | timer_adjust | |
| 1958 | timer_adjust | |
| 1959 | 1959 | } |
| 1960 | 1960 | |
| 1961 | 1961 | MACHINE_RESET(megatech_bios) |
| 1962 | 1962 | { |
| 1963 | timer_adjust | |
| 1963 | timer_adjust | |
| 1964 | 1964 | } |
| 1965 | 1965 | |
| 1966 | 1966 | static VIDEO_EOF(systeme) |
| r1355 | r1356 | |
|---|---|---|
| 892 | 892 | atapi_data_len = 0; |
| 893 | 893 | atapi_cdata_wait = 0; |
| 894 | 894 | |
| 895 | atapi_timer = timer_alloc( atapi_xfer_end ); | |
| 895 | atapi_timer = timer_alloc( atapi_xfer_end , NULL); | |
| 896 | 896 | timer_adjust(atapi_timer, attotime_never, 0, attotime_never); |
| 897 | 897 | |
| 898 | 898 | for( i = 0; i < 2; i++ ) |
| r1355 | r1356 | |
| 1483 | 1483 | |
| 1484 | 1484 | for (i = 0; i < 3; i++) |
| 1485 | 1485 | { |
| 1486 | m_p_timer_root[i] = timer_alloc(root_finished); | |
| 1486 | m_p_timer_root[i] = timer_alloc(root_finished, NULL); | |
| 1487 | 1487 | } |
| 1488 | 1488 | |
| 1489 | 1489 | timekeeper_init( 0, TIMEKEEPER_M48T58, memory_region( REGION_USER11 ) ); |
| r1355 | r1356 | |
|---|---|---|
| 77 | 77 | |
| 78 | 78 | static MACHINE_RESET( sbrkout ) |
| 79 | 79 | { |
| 80 | timer_pulse(TIME_4V, 0, sbrkout_tones_4V); | |
| 80 | timer_pulse(TIME_4V, NULL, 0, sbrkout_tones_4V); | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 |
| r1355 | r1356 | |
|---|---|---|
| 308 | 308 | calculate_collisions(); |
| 309 | 309 | |
| 310 | 310 | /* 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); | |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | thunderx_1f98_data = data; |
| r1355 | r1356 | |
|---|---|---|
| 57 | 57 | { |
| 58 | 58 | cpunum_set_input_line(1,0,HOLD_LINE); |
| 59 | 59 | //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); | |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | static ADDRESS_MAP_START( wink_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r1355 | r1356 | |
|---|---|---|
| 65 | 65 | scanline = 32; |
| 66 | 66 | } |
| 67 | 67 | |
| 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); | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | |
| 72 | 72 | static MACHINE_RESET( videopin ) |
| 73 | 73 | { |
| 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); | |
| 75 | 75 | |
| 76 | 76 | /* both output latches are cleared on reset */ |
| 77 | 77 |
| r1355 | r1356 | |
|---|---|---|
| 41 | 41 | scanline = 16; |
| 42 | 42 | } |
| 43 | 43 | |
| 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); | |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | |
| 48 | 48 | static MACHINE_RESET( runaway ) |
| 49 | 49 | { |
| 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); | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 |
| r1355 | r1356 | |
|---|---|---|
| 223 | 223 | { |
| 224 | 224 | /* we must do this on a timer in order to have it take effect */ |
| 225 | 225 | /* 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); | |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | static INTERRUPT_GEN( toypop_m68000_interrupt ) |
| r1355 | r1356 | |
|---|---|---|
| 406 | 406 | static TIMER_CALLBACK( timera_int ) |
| 407 | 407 | { |
| 408 | 408 | // 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. | |
| 410 | 410 | m68901_int_gen(TMRA); // Fire an interrupt. |
| 411 | 411 | } |
| 412 | 412 | |
| r1355 | r1356 | |
| 426 | 426 | |
| 427 | 427 | static TIMER_CALLBACK( timerd_int ) |
| 428 | 428 | { |
| 429 | timer_set(ATTOTIME_IN_USEC(250),0,timerd_int); | |
| 429 | timer_set(ATTOTIME_IN_USEC(250), NULL,0,timerd_int); | |
| 430 | 430 | m68901_int_gen(TMRD); // Fire an interrupt. |
| 431 | 431 | } |
| 432 | 432 | |
| r1355 | r1356 | |
| 473 | 473 | break; |
| 474 | 474 | |
| 475 | 475 | 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); | |
| 477 | 477 | break; |
| 478 | 478 | |
| 479 | 479 | case 0x10: mame_printf_debug("Timer B Data:%4x\n",value); // Timer B Data Register |
| r1355 | r1356 | |
| 485 | 485 | break; |
| 486 | 486 | |
| 487 | 487 | 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 | |
| 489 | 489 | break; |
| 490 | 490 | |
| 491 | 491 | } |
| r1355 | r1356 | |
|---|---|---|
| 61 | 61 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); |
| 62 | 62 | } |
| 63 | 63 | |
| 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); | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | |
| 68 | 68 | static MACHINE_RESET( ultratnk ) |
| 69 | 69 | { |
| 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); | |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 |
| r1355 | r1356 | |
|---|---|---|
| 168 | 168 | static TIMER_CALLBACK( interrupt_gen ) |
| 169 | 169 | { |
| 170 | 170 | 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); | |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | static MACHINE_START( tugboat ) |
| r1355 | r1356 | |
| 180 | 180 | static MACHINE_RESET( tugboat ) |
| 181 | 181 | { |
| 182 | 182 | 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); | |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 |
| r1355 | r1356 | |
|---|---|---|
| 69 | 69 | |
| 70 | 70 | static INTERRUPT_GEN( gunbustr_interrupt ) |
| 71 | 71 | { |
| 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); | |
| 73 | 73 | cpunum_set_input_line(0, 4, HOLD_LINE); |
| 74 | 74 | } |
| 75 | 75 | |
| r1355 | r1356 | |
| 181 | 181 | static WRITE32_HANDLER( gunbustr_gun_w ) |
| 182 | 182 | { |
| 183 | 183 | /* 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); | |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 |
| r1355 | r1356 | |
|---|---|---|
| 911 | 911 | sci_int6 = !sci_int6; |
| 912 | 912 | |
| 913 | 913 | 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); | |
| 915 | 915 | cpunum_set_input_line(0, 4, HOLD_LINE); |
| 916 | 916 | } |
| 917 | 917 | |
| r1355 | r1356 | |
| 926 | 926 | dblaxle_int6 = !dblaxle_int6; |
| 927 | 927 | |
| 928 | 928 | 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); | |
| 930 | 930 | |
| 931 | 931 | cpunum_set_input_line(0, 4, HOLD_LINE); |
| 932 | 932 | } |
| r1355 | r1356 | |
| 934 | 934 | static INTERRUPT_GEN( dblaxle_cpub_interrupt ) |
| 935 | 935 | { |
| 936 | 936 | // 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); | |
| 938 | 938 | cpunum_set_input_line(2, 4, HOLD_LINE); |
| 939 | 939 | } |
| 940 | 940 | |
| r1355 | r1356 | |
| 1175 | 1175 | but we don't want CPUA to have an int6 before int4 is over (?) |
| 1176 | 1176 | */ |
| 1177 | 1177 | |
| 1178 | timer_set(ATTOTIME_IN_CYCLES(10000,0),0, taitoz_interrupt6); | |
| 1178 | timer_set(ATTOTIME_IN_CYCLES(10000,0), NULL, 0, taitoz_interrupt6); | |
| 1179 | 1179 | } |
| 1180 | 1180 | |
| 1181 | 1181 | |
| r1355 | r1356 | |
| 1258 | 1258 | Four lightgun interrupts happen before the collected coords |
| 1259 | 1259 | are moved to shared ram where CPUA can use them. */ |
| 1260 | 1260 | |
| 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); | |
| 1262 | 1262 | } |
| 1263 | 1263 | |
| 1264 | 1264 |
| r1355 | r1356 | |
|---|---|---|
| 415 | 415 | PORT_DIPSETTING( 0x01, DEF_STR( Cocktail ) ) |
| 416 | 416 | INPUT_PORTS_END |
| 417 | 417 | |
| 418 | ||
| 419 | static 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 ) ) | |
| 463 | INPUT_PORTS_END | |
| 464 | ||
| 465 | ||
| 418 | 466 | static INPUT_PORTS_START( pleiads ) |
| 419 | 467 | PORT_START /* IN0 */ |
| 420 | 468 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| r1355 | r1356 | |
| 1096 | 1144 | ROM_LOAD( "mmi6301.ic41", 0x0100, 0x0100, CRC(e176b768) SHA1(e2184dd495ed579f10b6da0b78379e02d7a6229f) ) /* palette high bits */ |
| 1097 | 1145 | ROM_END |
| 1098 | 1146 | |
| 1147 | ROM_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 */ | |
| 1170 | ROM_END | |
| 1171 | ||
| 1172 | ||
| 1099 | 1173 | ROM_START( pleiads ) |
| 1100 | 1174 | ROM_REGION( 0x10000, REGION_CPU1, 0 ) |
| 1101 | 1175 | ROM_LOAD( "ic47.r1", 0x0000, 0x0800, CRC(960212c8) SHA1(52a3232e99920805ce9e195b8a6338ae7044dd18) ) |
| r1355 | r1356 | |
| 1239 | 1313 | GAME( 1980, phoenixt, phoenix, phoenix, phoenixt, 0, ROT90, "Taito", "Phoenix (Taito)", 0 ) |
| 1240 | 1314 | GAME( 1980, phoenix3, phoenix, phoenix, phoenix3, 0, ROT90, "bootleg", "Phoenix (T.P.N.)", 0 ) |
| 1241 | 1315 | GAME( 1981, phoenixc, phoenix, phoenix, phoenixt, 0, ROT90, "bootleg?", "Phoenix (IRECSA, G.G.I Corp)", 0 ) |
| 1242 | GAME( 1981, condor, phoenix, condor, condor, condor, ROT90, "Sidam", "Condor", 0 ) | |
| 1316 | ||
| 1317 | ||
| 1318 | GAME( 1981, condor, phoenix, condor, condor, condor, ROT90, "Sidam (bootleg)", "Condor (bootleg of Phoenix)", 0 ) | |
| 1243 | 1319 | // the following 2 were common bootlegs in england & france respectively |
| 1244 | GAME( 1980, falcon, phoenix, phoenix, phoenixt, 0, ROT90, "bootleg", "Falcon (bootleg set 1)", 0 ) | |
| 1245 | GAME( 1980, vautour, phoenix, phoenix, phoenixt, 0, ROT90, "bootleg", "Vautour (set 1 - Jeutel France)", 0 ) | |
| 1246 | GAME( 1980, vautour2, phoenix, condor, condor, condor, ROT90, "bootleg", "Vautour (set 2)", 0 ) | |
| 1320 | GAME( 1980, falcon, phoenix, phoenix, phoenixt, 0, ROT90, "bootleg", "Falcon (bootleg of Phoenix) (set 1)", 0 ) | |
| 1321 | GAME( 1980, vautour, phoenix, phoenix, phoenixt, 0, ROT90, "Jeutel (bootleg)", "Vautour (bootleg of Phoenix) (set 1)", 0 ) | |
| 1322 | GAME( 1980, vautour2, phoenix, condor, condor, condor, ROT90, "bootleg", "Vautour (bootleg of Phoenix) (set 2)", 0 ) | |
| 1247 | 1323 | // fenix is an italian bootleg based on vautour |
| 1248 | GAME( 1980, fenix, phoenix, condor, condor, condor, ROT90, "bootleg", "Fenix", GAME_NOT_WORKING ) | |
| 1249 | GAME( 1980, griffon, phoenix, condor, condor, condor, ROT90, "Videotron", "Griffon", 0 ) | |
| 1250 | GAME( 1980, falcona, phoenix, condor, falcona, 0, ROT90, "bootleg", "Falcon (bootleg set 2)", 0 ) | |
| 1324 | GAME( 1980, fenix, phoenix, condor, condor, condor, ROT90, "bootleg", "Fenix (bootleg of Phoenix)", GAME_NOT_WORKING ) | |
| 1325 | GAME( 1980, griffon, phoenix, condor, condor, condor, ROT90, "Videotron (bootleg)", "Griffon (bootleg of Phoenix)", 0 ) | |
| 1326 | GAME( 1980, falcona, phoenix, condor, falcona, 0, ROT90, "bootleg", "Falcon (bootleg of Phoenix) (set 2)", 0 ) | |
| 1327 | // nextfase is a spanish bootleg | |
| 1328 | GAME( 1981, nextfase, phoenix, phoenix, nextfase, 0, ROT90, "Petaco S.A. (bootleg)","Next Fase (bootleg of Phoenix)", 0 ) | |
| 1329 | ||
| 1251 | 1330 | GAME( 1981, pleiads, 0, pleiads, pleiads, 0, ROT90, "Tehkan", "Pleiads (Tehkan)", GAME_IMPERFECT_COLORS ) |
| 1252 | 1331 | GAME( 1981, pleiadbl, pleiads, pleiads, pleiads, 0, ROT90, "bootleg", "Pleiads (bootleg)", GAME_IMPERFECT_COLORS ) |
| 1253 | 1332 | GAME( 1981, pleiadce, pleiads, pleiads, pleiadce, 0, ROT90, "Tehkan (Centuri license)", "Pleiads (Centuri)", GAME_IMPERFECT_COLORS ) |
| r1355 | r1356 | |
|---|---|---|
| 70 | 70 | static WRITE8_HANDLER( sound_command_w ) |
| 71 | 71 | { |
| 72 | 72 | soundlatch_w(0,data); |
| 73 | timer_call_after_resynch(data,nmi_callback); | |
| 73 | timer_call_after_resynch(NULL, data,nmi_callback); | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | static WRITE8_HANDLER( nmi_disable_w ) |
| r1355 | r1356 | |
|---|---|---|
| 212 | 212 | |
| 213 | 213 | static READ8_HANDLER( mcu_acknowledge_r ) |
| 214 | 214 | { |
| 215 | timer_call_after_resynch(0, mcu_acknowledge_callback); | |
| 215 | timer_call_after_resynch(NULL, 0, mcu_acknowledge_callback); | |
| 216 | 216 | return 0; |
| 217 | 217 | } |
| 218 | 218 | |
| r1355 | r1356 | |
| 419 | 419 | break; |
| 420 | 420 | |
| 421 | 421 | 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); | |
| 423 | 423 | break; |
| 424 | 424 | |
| 425 | 425 | case 0x6: |
| r1355 | r1356 | |
| 435 | 435 | |
| 436 | 436 | static WRITE8_HANDLER( hotsmash_z80_mcu_w ) |
| 437 | 437 | { |
| 438 | timer_call_after_resynch(data, delayed_z80_mcu_w); | |
| 438 | timer_call_after_resynch(NULL, data, delayed_z80_mcu_w); | |
| 439 | 439 | } |
| 440 | 440 | |
| 441 | 441 | static READ8_HANDLER(hotsmash_from_mcu_r) |
| r1355 | r1356 | |
|---|---|---|
| 474 | 474 | { |
| 475 | 475 | /* if a command is still pending, and we haven't maxed out our timer, set a new one */ |
| 476 | 476 | 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); | |
| 478 | 478 | } |
| 479 | 479 | |
| 480 | 480 | |
| r1355 | r1356 | |
| 488 | 488 | jaguar_gpu_resume(); |
| 489 | 489 | |
| 490 | 490 | /* 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); | |
| 492 | 492 | gpu_command_pending = 1; |
| 493 | 493 | } |
| 494 | 494 |
| r1355 | r1356 | |
|---|---|---|
| 207 | 207 | { |
| 208 | 208 | state_save_register_global(cur_control2); |
| 209 | 209 | |
| 210 | dmadelay_timer = timer_alloc(dmaend_callback); | |
| 210 | dmadelay_timer = timer_alloc(dmaend_callback, NULL); | |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 |
| r1355 | r1356 | |
|---|---|---|
| 392 | 392 | memset(v60_irq_control, 0xff, sizeof(v60_irq_control)); |
| 393 | 393 | |
| 394 | 394 | /* 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); | |
| 397 | 397 | |
| 398 | 398 | /* clear IRQ lines */ |
| 399 | 399 | cpunum_set_input_line(0, 0, CLEAR_LINE); |
| r1355 | r1356 | |
| 571 | 571 | { |
| 572 | 572 | signal_v60_irq(MAIN_IRQ_VBSTART); |
| 573 | 573 | 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); | |
| 575 | 575 | if (system32_prot_vblank) |
| 576 | 576 | (*system32_prot_vblank)(); |
| 577 | 577 | } |
| r1355 | r1356 | |
|---|---|---|
| 274 | 274 | { |
| 275 | 275 | // IRQ |
| 276 | 276 | 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); | |
| 278 | 278 | |
| 279 | 279 | laserdisc_vsync(discinfo); |
| 280 | 280 | } |
| r1355 | r1356 | |
|---|---|---|
| 6753 | 6753 | static DRIVER_INIT( svcpcb ) |
| 6754 | 6754 | { |
| 6755 | 6755 | /* 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); | |
| 6758 | 6758 | |
| 6759 | 6759 | svcchaos_px_decrypt(); |
| 6760 | 6760 | svcpcb_gfx_decrypt(); |
| r1355 | r1356 | |
|---|---|---|
| 99 | 99 | static WRITE8_HANDLER( fromance_commanddata_w ) |
| 100 | 100 | { |
| 101 | 101 | /* 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); | |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | |
| 106 | 106 | static READ8_HANDLER( fromance_busycheck_main_r ) |
| 107 | 107 | { |
| 108 | 108 | /* set a timer to force synchronization after the read */ |
| 109 | timer_call_after_resynch(0, NULL); | |
| 109 | timer_call_after_resynch(NULL, 0, NULL); | |
| 110 | 110 | |
| 111 | 111 | if (!fromance_directionflag) return 0x00; // standby |
| 112 | 112 | else return 0xff; // busy |
| r1355 | r1356 | |
|---|---|---|
| 133 | 133 | }; |
| 134 | 134 | |
| 135 | 135 | |
| 136 | struct z80_irq_daisy_chain dleuro_daisy_chain[] = | |
| 136 | static struct z80_irq_daisy_chain dleuro_daisy_chain[] = | |
| 137 | 137 | { |
| 138 | 138 | { z80sio_reset, z80sio_irq_state, z80sio_irq_ack, z80sio_irq_reti, 0 }, |
| 139 | 139 | { z80ctc_reset, z80ctc_irq_state, z80ctc_irq_ack, z80ctc_irq_reti, 0 }, |
| r1355 | r1356 | |
|---|---|---|
| 166 | 166 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Demo_Sounds ) ) |
| 167 | 167 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 168 | 168 | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 169 | PORT_DIPNAME( 0x08, 0x08, "Round S | |
| 169 | PORT_DIPNAME( 0x08, 0x08, "Round Skip | |
| 170 | 170 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 171 | 171 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 172 | 172 | PORT_DIPNAME( 0x04, 0x04, "Freeze" ) |
| r1355 | r1356 | |
| 234 | 234 | PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 235 | 235 | INPUT_PORTS_END |
| 236 | 236 | |
| 237 | static 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 ) | |
| 314 | INPUT_PORTS_END | |
| 315 | ||
| 237 | 316 | static INPUT_PORTS_START( drgnbstr ) |
| 238 | 317 | PORT_START /* DSW A */ |
| 239 | 318 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| r1355 | r1356 | |
| 499 | 578 | ROM_LOAD( "sk1-5.6n", 0x0500, 0x0200, CRC(161514a4) SHA1(4488ce60d12be6586e4a1ddbbfd06bf4e7dfaceb) ) /* sprites lookup table */ |
| 500 | 579 | ROM_END |
| 501 | 580 | |
| 581 | ROM_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 */ | |
| 609 | ROM_END | |
| 610 | ||
| 502 | 611 | ROM_START( drgnbstr ) |
| 503 | 612 | ROM_REGION( 0x14000, REGION_CPU1, 0 ) /* 6809 code */ |
| 504 | 613 | ROM_LOAD( "db1_2b.6c", 0x08000, 0x04000, CRC(0f11cd17) SHA1(691d853f4f08898ecf4bccfb70a568de309329f1) ) |
| r1355 | r1356 | |
| 551 | 660 | GAME( 1985, skykid, 0, skykid, skykid, skykid, ROT180, "Namco", "Sky Kid (New Ver.)", GAME_SUPPORTS_SAVE ) /* Uses CUS63 aka 63a1 */ |
| 552 | 661 | GAME( 1985, skykido, skykid, skykid, skykid, skykid, ROT180, "Namco", "Sky Kid (Old Ver.)", GAME_SUPPORTS_SAVE ) /* Uses CUS63 aka 63a1 */ |
| 553 | 662 | GAME( 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) | |
| 666 | GAME( 1985, skykids, skykid, skykid, skykids, skykid, ROT180, "Namco [Sipem license]", "Sky Kid (Manufactured by Sipem)", GAME_SUPPORTS_SAVE ) /* Uses CUS63 aka 63a1 */ |
| r1355 | r1356 | |
|---|---|---|
| 2228 | 2228 | |
| 2229 | 2229 | init_common(); |
| 2230 | 2230 | |
| 2231 | blitter_reset_timer = timer_alloc(blitter_reset); | |
| 2231 | blitter_reset_timer = timer_alloc(blitter_reset, NULL); | |
| 2232 | 2232 | } |
| 2233 | 2233 | |
| 2234 | 2234 |
| r1355 | r1356 | |
|---|---|---|
| 705 | 705 | static DRIVER_INIT(ssfindo) |
| 706 | 706 | { |
| 707 | 707 | 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); | |
| 710 | 710 | } |
| 711 | 711 | |
| 712 | 712 | static DRIVER_INIT(ppcar) |
| 713 | 713 | { |
| 714 | 714 | 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); | |
| 717 | 717 | } |
| 718 | 718 | |
| 719 | 719 | GAME( 1999, ssfindo, 0, ssfindo, ssfindo, ssfindo, ROT0, "Icarus", "See See Find Out", GAME_NO_SOUND ) |
| r1355 | r1356 | |
|---|---|---|
| 102 | 102 | scanline = 0; |
| 103 | 103 | } |
| 104 | 104 | |
| 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); | |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | |
| r1355 | r1356 | |
| 226 | 226 | |
| 227 | 227 | static MACHINE_RESET( firetrk ) |
| 228 | 228 | { |
| 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); | |
| 230 | 230 | |
| 231 | 231 | if (GAME_IS_MONTECARLO) |
| 232 | 232 | { |
| r1355 | r1356 | |
| 241 | 241 | set_firetrk_service(last_service); |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | timer_call_after_resynch(0, periodic_callback); | |
| 244 | timer_call_after_resynch(NULL, 0, periodic_callback); | |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 |
| r1355 | r1356 | |
|---|---|---|
| 4 | 4 | PLAYER'S EDGE PLUS (PE+) |
| 5 | 5 | |
| 6 | 6 | Driver by Jim Stolis. |
| 7 | Layouts by Stephh. | |
| 7 | 8 | |
| 8 | 9 | Special thanks to smf for I2C EEPROM support. |
| 9 | 10 | |
| r1355 | r1356 | |
| 38 | 39 | periodically update an external eeprom for an even more secure backup. This eeprom |
| 39 | 40 | also holds the current game state in order to recover the player from a full power failure. |
| 40 | 41 | |
| 42 | ||
| 43 | Additional notes | |
| 44 | ================ | |
| 45 | ||
| 46 | 1) 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 | ||
| 61 | 2) 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 | ||
| 97 | 2) 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 | ||
| 105 | 2a) 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 | ||
| 119 | 2b) 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 | ||
| 132 | Stephh'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 | ||
| 41 | 147 | ***********************************************************************************/ |
| 148 | ||
| 42 | 149 | #include "driver.h" |
| 43 | 150 | #include "sound/ay8910.h" |
| 44 | 151 | #include "cpu/i8051/i8051.h" |
| 45 | 152 | #include "machine/i2cmem.h" |
| 46 | 153 | |
| 47 | 154 | #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" | |
| 51 | 160 | |
| 161 | ||
| 162 | static UINT16 autohold_addr; /* address to patch in program RAM to enable autohold feature */ | |
| 163 | ||
| 52 | 164 | static tilemap *bg_tilemap; |
| 53 | 165 | |
| 54 | 166 | /* Pointers to External RAM */ |
| r1355 | r1356 | |
| 241 | 353 | |
| 242 | 354 | static WRITE8_HANDLER( peplus_output_bank_a_w ) |
| 243 | 355 | { |
| 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 */ | |
| 252 | 364 | |
| 253 | 365 | coin_out_state = 0; |
| 254 | 366 | if((data >> 4) & 1) |
| r1355 | r1356 | |
| 257 | 369 | |
| 258 | 370 | static WRITE8_HANDLER( peplus_output_bank_b_w ) |
| 259 | 371 | { |
| 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 */ | |
| 268 | 380 | } |
| 269 | 381 | |
| 270 | 382 | static WRITE8_HANDLER( peplus_output_bank_c_w ) |
| 271 | 383 | { |
| 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 */ | |
| 280 | 392 | } |
| 281 | 393 | |
| 282 | 394 | static WRITE8_HANDLER(i2c_nvram_w) |
| r1355 | r1356 | |
| 308 | 420 | static READ8_HANDLER( peplus_crtc_lpen2_r ) |
| 309 | 421 | { |
| 310 | 422 | 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)); | |
| 313 | 425 | UINT16 t_val = y_val * 0x28 + (x_val+1); |
| 314 | 426 | |
| 315 | 427 | switch(vid_register) { |
| r1355 | r1356 | |
| 340 | 452 | switch (offset) |
| 341 | 453 | { |
| 342 | 454 | case 0x00db: |
| 343 | if ((readinputportbytag("DOOR") & 0x01) == 0) { | |
| 455 | if ((readinputportbytag_safe("DOOR",0xff) & 0x01) == 0) { | |
| 344 | 456 | cmos_ram[offset] = 0x00; |
| 345 | 457 | } |
| 346 | 458 | break; |
| 347 | 459 | case 0x0b8d: |
| 348 | if ((readinputportbytag("DOOR") & 0x02) == 1) { | |
| 460 | if ((readinputportbytag_safe("DOOR",0xff) & 0x02) == 1) { | |
| 349 | 461 | cmos_ram[offset] = 0x01; |
| 350 | 462 | } |
| 351 | 463 | break; |
| r1355 | r1356 | |
| 438 | 550 | sda = i2cmem_read(0, I2CMEM_SDA); |
| 439 | 551 | } |
| 440 | 552 | |
| 441 | if ((readinputportbytag("SENSOR") & 0x01) == 0x01 && coin_state == 0) { | |
| 553 | if ((readinputportbytag_safe("SENSOR",0x00) & 0x01) == 0x01 && coin_state == 0) { | |
| 442 | 554 | coin_state = 1; // Start Coin Cycle |
| 443 | 555 | last_cycles = activecpu_gettotalcycles(); |
| 444 | 556 | } else { |
| r1355 | r1356 | |
| 474 | 586 | } |
| 475 | 587 | |
| 476 | 588 | if (curr_cycles - last_door > 6000) { // Guessing with 6000 |
| 477 | if ((readinputportbytag("DOOR") & 0x01) == 0x01) { | |
| 589 | if ((readinputportbytag_safe("DOOR",0xff) & 0x01) == 0x01) { | |
| 478 | 590 | door_open = (!door_open & 0x01); |
| 479 | 591 | } else { |
| 480 | 592 | door_open = 1; |
| r1355 | r1356 | |
| 587 | 699 | GFXDECODE_END |
| 588 | 700 | |
| 589 | 701 | |
| 590 | /************** | |
| 591 | * Driver Init * | |
| 592 | ***************/ | |
| 593 | ||
| 594 | static 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 | ||
| 608 | static 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 | ||
| 622 | static 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 | ||
| 636 | static 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 | ||
| 649 | static 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 | ||
| 662 | static 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 | ||
| 675 | static 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 | ||
| 688 | static 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 | ||
| 701 | static 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 | ||
| 726 | static 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 | ||
| 751 | 702 | /************************* |
| 752 | 703 | * Memory map information * |
| 753 | 704 | *************************/ |
| r1355 | r1356 | |
| 774 | 725 | |
| 775 | 726 | // Sound and Dipswitches |
| 776 | 727 | AM_RANGE(0x4000, 0x4000) AM_WRITE(AY8910_control_port_0_w) |
| 777 | AM_RANGE(0x4004, 0x4004) AM_READ | |
| 728 | AM_RANGE(0x4004, 0x4004) AM_READ | |
| 778 | 729 | |
| 779 | 730 | // Superboard Data |
| 780 | 731 | AM_RANGE(0x5000, 0x5fff) AM_RAM AM_READWRITE(peplus_s5000_r, peplus_s5000_w) AM_BASE(&s5000_ram) |
| r1355 | r1356 | |
| 795 | 746 | AM_RANGE(0x9000, 0x9000) AM_READ(peplus_dropdoor_r) AM_WRITE(i2c_nvram_w) |
| 796 | 747 | |
| 797 | 748 | // Input Banks B & C, Output Bank B |
| 798 | AM_RANGE(0xa000, 0xa000) AM_READ | |
| 749 | AM_RANGE(0xa000, 0xa000) AM_READ | |
| 799 | 750 | |
| 800 | 751 | // Superboard Data |
| 801 | 752 | AM_RANGE(0xb000, 0xbfff) AM_RAM AM_READWRITE(peplus_sb000_r, peplus_sb000_w) AM_BASE(&sb000_ram) |
| r1355 | r1356 | |
| 820 | 771 | AM_RANGE(0x00, 0x03) AM_READ(peplus_io_r) AM_WRITE(peplus_io_w) AM_BASE(&io_port) |
| 821 | 772 | ADDRESS_MAP_END |
| 822 | 773 | |
| 774 | ||
| 823 | 775 | /************************* |
| 824 | 776 | * Input ports * |
| 825 | 777 | *************************/ |
| 826 | 778 | |
| 827 | static 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 ) | |
| 779 | static INPUT_PORTS_START( peplus ) | |
| 780 | /* IN0 has to be defined for each kind of game */ | |
| 845 | 781 | |
| 846 | 782 | PORT_START_TAG("DOOR") |
| 847 | 783 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Upper Door") PORT_CODE(KEYCODE_O) PORT_TOGGLE |
| r1355 | r1356 | |
| 854 | 790 | PORT_DIPNAME( 0x01, 0x01, "Line Frequency" ) |
| 855 | 791 | PORT_DIPSETTING( 0x01, "60HZ" ) |
| 856 | 792 | 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 ) | |
| 878 | 800 | INPUT_PORTS_END |
| 879 | 801 | |
| 880 | static INPUT_PORTS_START( peplus_keno ) | |
| 802 | ||
| 803 | /************************* | |
| 804 | * Input ports * | |
| 805 | *************************/ | |
| 806 | ||
| 807 | /* Fake inputs to only map what is needed */ | |
| 808 | static INPUT_PORTS_START( peplus_schip ) | |
| 881 | 809 | 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 ) | |
| 838 | INPUT_PORTS_END | |
| 839 | ||
| 840 | static 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) | |
| 891 | 853 | 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 ) | |
| 893 | 855 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON12 ) PORT_NAME("Play Credit") PORT_CODE(KEYCODE_R) |
| 894 | 856 | PORT_BIT( 0x50, IP_ACTIVE_HIGH, IPT_BUTTON13 ) PORT_NAME("Cashout") PORT_CODE(KEYCODE_T) |
| 895 | 857 | 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 ) | |
| 860 | INPUT_PORTS_END | |
| 898 | 861 | |
| 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 */ | |
| 863 | static INPUT_PORTS_START( peplus_pokah ) | |
| 864 | PORT_INCLUDE(peplus_poker) | |
| 902 | 865 | |
| 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 ) ) | |
| 871 | INPUT_PORTS_END | |
| 905 | 872 | |
| 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 ) ) | |
| 873 | static INPUT_PORTS_START( peplus_bjack ) | |
| 874 | PORT_INCLUDE(peplus) | |
| 931 | 875 | |
| 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 ) | |
| 893 | INPUT_PORTS_END | |
| 894 | ||
| 895 | static 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 | ||
| 932 | 916 | PORT_START_TAG("TOUCH_X") |
| 933 | 917 | 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) |
| 934 | 918 | PORT_START_TAG("TOUCH_Y") |
| 935 | 919 | 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) |
| 936 | 920 | INPUT_PORTS_END |
| 937 | 921 | |
| 922 | static 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 ) | |
| 942 | INPUT_PORTS_END | |
| 943 | ||
| 944 | ||
| 945 | ||
| 938 | 946 | /************************* |
| 947 | * Machine Reset * | |
| 948 | *************************/ | |
| 949 | ||
| 950 | static MACHINE_RESET( peplus ) | |
| 951 | { | |
| 952 | if (autohold_addr) | |
| 953 | program_ram[autohold_addr] = readinputportbytag_safe("AUTOHOLD",0x00) & 0x01; | |
| 954 | } | |
| 955 | ||
| 956 | ||
| 957 | /************************* | |
| 939 | 958 | * Machine Driver * |
| 940 | 959 | *************************/ |
| 941 | 960 | |
| r1355 | r1356 | |
| 950 | 969 | MDRV_SCREEN_REFRESH_RATE(60) |
| 951 | 970 | MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) |
| 952 | 971 | |
| 972 | MDRV_MACHINE_RESET(peplus) | |
| 953 | 973 | MDRV_NVRAM_HANDLER(peplus) |
| 954 | 974 | |
| 955 | 975 | // video hardware |
| r1355 | r1356 | |
| 971 | 991 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) |
| 972 | 992 | MACHINE_DRIVER_END |
| 973 | 993 | |
| 994 | ||
| 995 | /***************** | |
| 996 | * Initialisation * | |
| 997 | *****************/ | |
| 998 | ||
| 999 | /* Normal board */ | |
| 1000 | static 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 */ | |
| 1013 | static 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 | ||
| 974 | 1030 | /************************* |
| 1031 | * Driver Init * | |
| 1032 | *************************/ | |
| 1033 | ||
| 1034 | static 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 | ||
| 1043 | static 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 | ||
| 1054 | static 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 | ||
| 1065 | static 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 | ||
| 1076 | static 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 | ||
| 1085 | static 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 | ||
| 1094 | static 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 | ||
| 1103 | static 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 | ||
| 1112 | static 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 | ||
| 1122 | static 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 | /************************* | |
| 975 | 1133 | * Rom Load * |
| 976 | 1134 | *************************/ |
| 977 | 1135 | |
| 978 | ROM_START( pe | |
| 1136 | ROM_START( pe | |
| 979 | 1137 | ROM_REGION( 0x10000, REGION_CPU1, 0 ) |
| 980 | ROM_LOAD( " | |
| 1138 | ROM_LOAD( "set038 | |
| 981 | 1139 | |
| 982 | 1140 | ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE ) |
| 983 | 1141 | ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) ) |
| r1355 | r1356 | |
| 1017 | 1175 | ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) |
| 1018 | 1176 | ROM_END |
| 1019 | 1177 | |
| 1020 | ROM_START( pe | |
| 1178 | ROM_START( pepp | |
| 1021 | 1179 | ROM_REGION( 0x10000, REGION_CPU1, 0 ) |
| 1022 | ROM_LOAD( " | |
| 1180 | ROM_LOAD( "pp | |
| 1023 | 1181 | |
| 1024 | 1182 | ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE ) |
| 1025 | 1183 | ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) ) |
| r1355 | r1356 | |
| 1121 | 1279 | ROM_LOAD( "cap2361.u43", 0x0000, 0x0100, CRC(051aea66) SHA1(2abf32caaeb821ca50a6398581de69bbfe5930e9) ) |
| 1122 | 1280 | ROM_END |
| 1123 | 1281 | |
| 1282 | ||
| 1124 | 1283 | /************************* |
| 1125 | 1284 | * Game Drivers * |
| 1126 | 1285 | *************************/ |
| 1127 | 1286 | |
| 1128 | /* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS */ | |
| 1129 | GAME( 1987, peplus, 0, peplus, peplus_poker, peplus, ROT0, "IGT - International Gaming Technology", "Player's Edge Plus (PP0516) Double Bonus Poker", 0 ) | |
| 1130 | GAME( 1987, pepp0158, 0, peplus, peplus_poker, pepp0158, ROT0, "IGT - International Gaming Technology", "Player's Edge Plus (PP0158) 4 of a Kind Bonus Poker", 0 ) | |
| 1131 | GAME( 1987, pepp0188, 0, peplus, peplus_poker, pepp0188, ROT0, "IGT - International Gaming Technology", "Player's Edge Plus (PP0188) Standard Draw Poker", 0 ) | |
| 1132 | GAME( 1987, peset038, 0, peplus, peplus_poker, peset038, ROT0, "IGT - International Gaming Technology", "Player's Edge Plus (Set038) Set Chip", 0 ) | |
| 1133 | GAME( 1994, pebe0014, 0, peplus, peplus_poker, pebe0014, ROT0, "IGT - International Gaming Technology", "Player's Edge Plus (BE0014) Blackjack", 0 ) | |
| 1134 | GAME( 1994, peke1012, 0, peplus, peplus_keno, peke1012, ROT0, "IGT - International Gaming Technology", "Player's Edge Plus (KE1012) Keno", 0 ) | |
| 1135 | GAME( 1996, peps0615, 0, peplus, peplus_poker, peps0615, ROT0, "IGT - International Gaming Technology", "Player's Edge Plus (PS0615) Chaos Slots", 0 ) | |
| 1136 | GAME( 1996, peps0716, 0, peplus, peplus_poker, peps0716, ROT0, "IGT - International Gaming Technology", "Player's Edge Plus (PS0716) Quarter Mania Slots", 0 ) | |
| 1137 | GAME( 1995, pexp0019, 0, peplus, peplus_poker, pexp0019, ROT0, "IGT - International Gaming Technology", "Player's Edge Plus (XP000019) Deuces Wild Poker", 0 ) | |
| 1138 | GAME( 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 */ | |
| 1290 | GAMEL(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 */ | |
| 1293 | GAMEL(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 ) | |
| 1294 | GAMEL(1987, pepp0188, 0, peplus, peplus_pokah, pepp0188, ROT0, "IGT - International Gaming Technology", "Player's Edge Plus (PP0188) Standard Draw Poker", 0, layout_pe_poker ) | |
| 1295 | GAMEL(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 */ | |
| 1298 | GAMEL(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 */ | |
| 1301 | GAMEL(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 */ | |
| 1304 | GAMEL(1996, peps0615, 0, peplus, peplus_slots, peps0615, ROT0, "IGT - International Gaming Technology", "Player's Edge Plus (PS0615) Chaos Slots", 0, layout_pe_slots ) | |
| 1305 | GAMEL(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 */ | |
| 1308 | GAMEL(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 */ | |
| 1311 | GAMEL(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 ) |
| r0 | r1356 | |
|---|---|---|
| 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 | /* | |
| 16 | Sega System24 Overview | |
| 17 | Sega, 1987-1994 | |
| 18 | ||
| 19 | PCB Layout | |
| 20 | ---------- | |
| 21 | ||
| 22 | Note: The differences in the revisions is just the use of different sized RAMs | |
| 23 | and the quantities of RAM used. | |
| 24 | ||
| 25 | (1st Revision) | |
| 26 | 837-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) | |
| 59 | 837-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) | |
| 93 | 837-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 | |------------|--------|---------------------------------------------------------| | |
| 123 | Notes: | |
| 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 | ||
| 148 | Floppy Controller PCB Layout | |
| 149 | ---------------------------- | |
| 150 | ||
| 151 | 837-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 | ||
| 165 | I/O Controller PCB Layout | |
| 166 | ------------------------- | |
| 167 | ||
| 168 | 834-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 | |--------------------------------------| | |
| 181 | Notes: | |
| 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 | ||
| 201 | ROM Board Layout | |
| 202 | ---------------- | |
| 203 | ||
| 204 | 837-7187-01 | |
| 205 | 171-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 | |------------------------------------------| | |
| 225 | Notes: | |
| 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 | ||
| 240 | FD1094/Floppy/ROM details | |
| 241 | ------------------------- | |
| 242 | ||
| 243 | Game FD1094 Floppy ROMs Other | |
| 244 | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 245 | Hot Rod (3p Turbo) none DS3-5000-01D Main Board: EPR11338.IC1, EPR11339.IC2 I/O Controller PCB, Floppy Controller PCB | |
| 246 | ||
| 247 | Hot 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 | ||
| 250 | Hot 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 | ||
| 253 | Scramble Spirits none DS3-5000-02? Main Board: EPR12186.IC1, EPR12187.IC2 Floppy Controller PCB | |
| 254 | ||
| 255 | Scramble Spirits 317-0058-02D DS3-5000-02D Main Board: EPR12186.IC1, EPR12187.IC2 Floppy Controller PCB | |
| 256 | (Encrypted Version) | |
| 257 | ||
| 258 | Gain Ground (Japan) 317-0058-03B DS3-5000-03B Main Board: EPR12186.IC1, EPR12187.IC2 Floppy Controller PCB | |
| 259 | ||
| 260 | Gain Ground 317-0058-03D DS3-5000-03D Main Board: EPR12186.IC1, EPR12187.IC2 Floppy Controller PCB | |
| 261 | ||
| 262 | Crack Down (Japan) 317-0058-04B DS3-5000-04B Main Board: EPR12186.IC1, EPR12187.IC2 Floppy Controller PCB | |
| 263 | Rev A | |
| 264 | ||
| 265 | Crack Down 317-0058-04D DS3-5000-04D Main Board: EPR12186.IC1, EPR12187.IC2 Floppy Controller PCB | |
| 266 | ||
| 267 | Super Masters Golf 317-0058-05B DS3-5000-05B Main Board: EPR12186.IC1, EPR12187.IC2 I/O Controller PCB, Floppy Controller PCB | |
| 268 | Rev B | |
| 269 | ||
| 270 | Super Masters Golf 317-0058-05D DS3-5000-05D Main Board: EPR12186.IC1, EPR12187.IC2 I/O Controller PCB, Floppy Controller PCB | |
| 271 | Rev D | |
| 272 | ||
| 273 | Rough Racer 317-0058-06B DS3-5000-06B Main Board: EPR12186.IC1, EPR12187.IC2 I/O Controller PCB, Floppy Controller PCB | |
| 274 | ||
| 275 | Bonanza 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 | ||
| 280 | Quiz Syukudai wo 317-0058-08B DS3-5000-08B Main Board: EPR12186.IC1, EPR12187.IC2 Floppy Controller PCB | |
| 281 | Wasuremashita | |
| 282 | ||
| 283 | Dynamic 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 | ||
| 286 | Dynamic 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 | ||
| 291 | Quiz 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 | ||
| 296 | Tokoro San no none none Main Board: EPR14812.IC1, EPR14813.IC2 | |
| 297 | MahMahjan 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 | ||
| 302 | Quiz Rouka Ni none none Main Board: EPR14484.IC1, EPR14485.IC2 | |
| 303 | Tattenasai Daughter Board: EPR14482.IC5, EPR14483.IC7 | |
| 304 | EPLD: 317-0191 | |
| 305 | ||
| 306 | Tokoro San no none none Main Board: EPR16798.IC1, EPR16799.IC2 | |
| 307 | MahMahjan 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 | ||
| 312 | Quiz 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 | ||
| 318 | Notes: | |
| 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 | ||
| 343 | UINT16* s24_mainram1; | |
| 344 | ||
| 345 | extern void s24_fd1094_machine_init(void); | |
| 346 | extern void s24_fd1094_driver_init(void); | |
| 347 | ||
| 348 | VIDEO_START(system24); | |
| 349 | VIDEO_UPDATE(system24); | |
| 350 | ||
| 351 | ||
| 352 | // Floppy Fisk Controller | |
| 353 | ||
| 354 | static int fdc_status, fdc_track, fdc_sector, fdc_data; | |
| 355 | static int fdc_phys_track, fdc_irq, fdc_drq, fdc_span, fdc_index_count; | |
| 356 | static UINT8 *fdc_pt; | |
| 357 | static int track_size; | |
| 358 | ||
| 359 | static 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 | ||
| 371 | static 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 | ||
| 406 | static 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 | ||
| 491 | static 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 | ||
| 499 | static 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 | ||
| 508 | static 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 | ||
| 531 | static 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 | ||
| 556 | static int cur_input_line; | |
| 557 | ||
| 558 | static 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 | ||
| 581 | static 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 | ||
| 604 | static 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 | ||
| 619 | static 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 | ||
| 632 | static UINT8 hotrod_ctrl_cur; | |
| 633 | ||
| 634 | static WRITE16_HANDLER( hotrod3_ctrl_w ) | |
| 635 | { | |
| 636 | if(ACCESSING_LSB) { | |
| 637 | data &= 3; | |
| 638 | hotrod_ctrl_cur = readinputport(9+data); | |
| 639 | } | |
| 640 | } | |
| 641 | ||
| 642 | static 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 | ||
| 674 | static READ16_HANDLER( iod_r ) | |
| 675 | { | |
| 676 | logerror("IO daughterboard read %02x (%x)\n", offset, activecpu_get_pc()); | |
| 677 | return 0xffff; | |
| 678 | } | |
| 679 | ||
| 680 | static 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 | ||
| 688 | static UINT8 resetcontrol, prev_resetcontrol; | |
| 689 | ||
| 690 | static 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 | ||
| 709 | static 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 | ||
| 719 | static UINT8 curbank; | |
| 720 | ||
| 721 | static 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 | ||
| 730 | static READ16_HANDLER( curbank_r ) | |
| 731 | { | |
| 732 | return curbank; | |
| 733 | } | |
| 734 | ||
| 735 | static WRITE16_HANDLER( curbank_w ) | |
| 736 | { | |
| 737 | if(ACCESSING_LSB) { | |
| 738 | curbank = data & 0xff; | |
| 739 | reset_bank(); | |
| 740 | } | |
| 741 | } | |
| 742 | ||
| 743 | ||
| 744 | // YM2151 | |
| 745 | ||
| 746 | static READ16_HANDLER( ym_status_r ) | |
| 747 | { | |
| 748 | return YM2151_status_port_0_r(0); | |
| 749 | } | |
| 750 | ||
| 751 | static WRITE16_HANDLER( ym_register_w ) | |
| 752 | { | |
| 753 | if(ACCESSING_LSB) | |
| 754 | YM2151_register_port_0_w(0, data); | |
| 755 | } | |
| 756 | ||
| 757 | static 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 | ||
| 766 | static UINT8 mahmajn_mlt[8] = { 5, 1, 6, 2, 3, 7, 4, 0 }; | |
| 767 | static UINT8 mahmajn2_mlt[8] = { 6, 0, 5, 3, 1, 4, 2, 7 }; | |
| 768 | static UINT8 gqh_mlt[8] = { 3, 7, 4, 0, 2, 6, 5, 1 }; | |
| 769 | static UINT8 bnzabros_mlt[8] = { 2, 4, 0, 5, 7, 3, 1, 6 }; | |
| 770 | static UINT8 qrouka_mlt[8] = { 1, 6, 4, 7, 0, 5, 3, 2 }; | |
| 771 | static UINT8 quizmeku_mlt[8] = { 0, 3, 2, 4, 6, 1, 7, 5 }; | |
| 772 | static UINT8 dcclub_mlt[8] = { 4, 3, 7, 0, 2, 6, 1, 5 }; | |
| 773 | ||
| 774 | static UINT8 mlatch; | |
| 775 | static const UINT8 *mlatch_table; | |
| 776 | ||
| 777 | static READ16_HANDLER( mlatch_r ) | |
| 778 | { | |
| 779 | return mlatch; | |
| 780 | } | |
| 781 | ||
| 782 | static 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 | ||
| 810 | enum { | |
| 811 | IRQ_YM2151 = 1, | |
| 812 | IRQ_TIMER = 2, | |
| 813 | IRQ_VBLANK = 3, | |
| 814 | IRQ_SPRITE = 4 | |
| 815 | }; | |
| 816 | ||
| 817 | static UINT16 irq_timera; | |
| 818 | static UINT8 irq_timerb; | |
| 819 | static UINT8 irq_allow0, irq_allow1; | |
| 820 | static int irq_timer_pend0, irq_timer_pend1, irq_yms; | |
| 821 | static emu_timer *irq_timer; | |
| 822 | ||
| 823 | static 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 | ||
| 832 | static 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 | ||
| 843 | static 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 | ||
| 852 | static 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 | ||
| 884 | static 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 */ | |
| 887 | static TIMER_CALLBACK( gground_generate_kludge_irq ) | |
| 888 | { | |
| 889 | cpunum_set_input_line(1, 5, HOLD_LINE); | |
| 890 | } | |
| 891 | ||
| 892 | ||
| 893 | static 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 | ||
| 959 | static 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 | ||
| 980 | static 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 | /* | |
| 989 | CPU1: | |
| 990 | 00-03 ROM (1) | |
| 991 | 04-07 ROM | |
| 992 | 08-0f ramlo (2) | |
| 993 | 10-13 ROM | |
| 994 | 14-17 ROM | |
| 995 | f0-f3 ramprg (3) | |
| 996 | fc-ff ramhi (4) | |
| 997 | ||
| 998 | CPU2: | |
| 999 | 00-03 ramprg | |
| 1000 | 04-07 ROM | |
| 1001 | 08-0f ramlo | |
| 1002 | 10-13 ROM | |
| 1003 | 14-17 ROM | |
| 1004 | f0-f3 ramprg | |
| 1005 | fc-ff ramhi | |
| 1006 | */ | |
| 1007 | ||
| 1008 | /************************************* | |
| 1009 | * | |
| 1010 | * CPU 1 memory handlers | |
| 1011 | * | |
| 1012 | *************************************/ | |
| 1013 | ||
| 1014 | static 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) | |
| 1039 | AM_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) | |
| 1043 | ADDRESS_MAP_END | |
| 1044 | ||
| 1045 | /************************************* | |
| 1046 | * | |
| 1047 | * CPU 2 memory handlers | |
| 1048 | * | |
| 1049 | *************************************/ | |
| 1050 | ||
| 1051 | static 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) | |
| 1078 | AM_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) | |
| 1082 | ADDRESS_MAP_END | |
| 1083 | ||
| 1084 | ||
| 1085 | /************************************* | |
| 1086 | * | |
| 1087 | * Game-specific driver inits | |
| 1088 | * | |
| 1089 | *************************************/ | |
| 1090 | ||
| 1091 | static 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 | ||
| 1098 | static 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 | ||
| 1105 | static 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 | ||
| 1112 | static 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 | ||
| 1119 | static 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 | ||
| 1128 | static 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 | ||
| 1137 | static 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 | ||
| 1153 | static 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 | ||
| 1170 | static 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 | ||
| 1179 | static 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 | ||
| 1188 | static 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 | ||
| 1200 | static 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 | ||
| 1209 | static 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 | ||
| 1217 | static 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 | ||
| 1225 | static 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 | ||
| 1233 | static 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 | ||
| 1247 | static 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 | ||
| 1257 | static 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 | ||
| 1274 | static 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) | |
| 1294 | INPUT_PORTS_END | |
| 1295 | ||
| 1296 | static 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 ) | |
| 1306 | INPUT_PORTS_END | |
| 1307 | ||
| 1308 | static 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 ) ) | |
| 1370 | INPUT_PORTS_END | |
| 1371 | ||
| 1372 | static INPUT_PORTS_START( system24_generic ) | |
| 1373 | PORT_INCLUDE( system24_P1_P2 ) | |
| 1374 | PORT_INCLUDE( system24_Service ) | |
| 1375 | PORT_INCLUDE( system24_DSW ) | |
| 1376 | INPUT_PORTS_END | |
| 1377 | ||
| 1378 | /************************************* | |
| 1379 | * | |
| 1380 | * Game-specific port definitions | |
| 1381 | * | |
| 1382 | *************************************/ | |
| 1383 | ||
| 1384 | static 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) | |
| 1441 | INPUT_PORTS_END | |
| 1442 | ||
| 1443 | static 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 ) ) | |
| 1459 | INPUT_PORTS_END | |
| 1460 | ||
| 1461 | static 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" ) | |
| 1487 | INPUT_PORTS_END | |
| 1488 | ||
| 1489 | static 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 ) ) | |
| 1499 | INPUT_PORTS_END | |
| 1500 | ||
| 1501 | static 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) | |
| 1534 | INPUT_PORTS_END | |
| 1535 | ||
| 1536 | static 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 ) ) | |
| 1561 | INPUT_PORTS_END | |
| 1562 | ||
| 1563 | static 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" ) | |
| 1583 | INPUT_PORTS_END | |
| 1584 | ||
| 1585 | static 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 ) ) | |
| 1608 | INPUT_PORTS_END | |
| 1609 | ||
| 1610 | static 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) | |
| 1646 | INPUT_PORTS_END | |
| 1647 | ||
| 1648 | static 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 ) ) | |
| 1684 | INPUT_PORTS_END | |
| 1685 | ||
| 1686 | static 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) | |
| 1696 | INPUT_PORTS_END | |
| 1697 | ||
| 1698 | static 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 ) ) | |
| 1747 | INPUT_PORTS_END | |
| 1748 | ||
| 1749 | static 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 ) ) | |
| 1788 | INPUT_PORTS_END | |
| 1789 | ||
| 1790 | static 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 ) ) | |
| 1855 | INPUT_PORTS_END | |
| 1856 | ||
| 1857 | static 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" ) | |
| 1897 | INPUT_PORTS_END | |
| 1898 | ||
| 1899 | /************************************* | |
| 1900 | * | |
| 1901 | * Sound definitions | |
| 1902 | * | |
| 1903 | *************************************/ | |
| 1904 | ||
| 1905 | static struct YM2151interface ym2151_interface = | |
| 1906 | { | |
| 1907 | irq_ym | |
| 1908 | }; | |
| 1909 | ||
| 1910 | /************************************* | |
| 1911 | * | |
| 1912 | * Generic machine drivers | |
| 1913 | * | |
| 1914 | *************************************/ | |
| 1915 | ||
| 1916 | static 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) | |
| 1950 | MACHINE_DRIVER_END | |
| 1951 | ||
| 1952 | /************************************* | |
| 1953 | * | |
| 1954 | * ROM definition(s) | |
| 1955 | * | |
| 1956 | *************************************/ | |
| 1957 | ||
| 1958 | ROM_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) ) | |
| 1965 | ROM_END | |
| 1966 | ||
| 1967 | ROM_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 | |
| 1974 | ROM_END | |
| 1975 | ||
| 1976 | ROM_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 | |
| 1983 | ROM_END | |
| 1984 | ||
| 1985 | ROM_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) ) | |
| 1999 | ROM_END | |
| 2000 | ||
| 2001 | ROM_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) ) | |
| 2009 | ROM_END | |
| 2010 | ||
| 2011 | ROM_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) ) | |
| 2025 | ROM_END | |
| 2026 | ||
| 2027 | ROM_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) ) | |
| 2041 | ROM_END | |
| 2042 | ||
| 2043 | ROM_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 */ | |
| 2058 | ROM_END | |
| 2059 | ||
| 2060 | ROM_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) ) | |
| 2075 | ROM_END | |
| 2076 | ||
| 2077 | ROM_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) ) | |
| 2089 | ROM_END | |
| 2090 | ||
| 2091 | ROM_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) ) | |
| 2098 | ROM_END | |
| 2099 | ||
| 2100 | ROM_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) ) | |
| 2107 | ROM_END | |
| 2108 | ||
| 2109 | ROM_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 ) | |
| 2119 | ROM_END | |
| 2120 | ||
| 2121 | ROM_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 | ||
| 2135 | ROM_END | |
| 2136 | ||
| 2137 | ROM_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) ) | |
| 2147 | ROM_END | |
| 2148 | ||
| 2149 | ROM_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) ) | |
| 2159 | ROM_END | |
| 2160 | ||
| 2161 | ROM_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) ) | |
| 2171 | ROM_END | |
| 2172 | ||
| 2173 | ROM_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 */ | |
| 2183 | ROM_END | |
| 2184 | ||
| 2185 | ROM_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) ) | |
| 2195 | ROM_END | |
| 2196 | ||
| 2197 | ROM_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) ) | |
| 2207 | ROM_END | |
| 2208 | ||
| 2209 | ROM_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) ) | |
| 2219 | ROM_END | |
| 2220 | ||
| 2221 | ROM_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) ) | |
| 2231 | ROM_END | |
| 2232 | ||
| 2233 | ROM_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) ) | |
| 2243 | ROM_END | |
| 2244 | ||
| 2245 | ROM_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) ) | |
| 2255 | ROM_END | |
| 2256 | ||
| 2257 | ROM_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) ) | |
| 2267 | ROM_END | |
| 2268 | ||
| 2269 | ROM_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) ) | |
| 2279 | ROM_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 */ | |
| 2315 | GAME( 1991, dcclub, 0, system24, dcclub, dcclub, ROT0, "Sega", "Dynamic Country Club (World, ROM Based)", 0 ) | |
| 2316 | GAME( 1991, dcclubj, dcclub, system24, dcclub, dcclub, ROT0, "Sega", "Dynamic Country Club (Japan, ROM Based)", 0 ) | |
| 2317 | GAME( 1992, mahmajn, 0, system24, mahmajn, mahmajn, ROT0, "Sega", "Tokoro San no MahMahjan (Japan, ROM Based)", 0 ) | |
| 2318 | GAME( 1994, qgh, 0, system24, qgh, qgh, ROT0, "Sega", "Quiz Ghost Hunter (Japan, ROM Based)", 0 ) | |
| 2319 | GAME( 1994, quizmeku, 0, system24, quizmeku, quizmeku, ROT0, "Sega", "Quiz Mekurumeku Story (Japan, ROM Based)", 0 ) | |
| 2320 | GAME( 1994, qrouka, 0, system24, qrouka, qrouka, ROT0, "Sega", "Quiz Rouka Ni Tattenasai (Japan, ROM Based)", 0 ) | |
| 2321 | GAME( 1994, mahmajn2, 0, system24, mahmajn, mahmajn2, ROT0, "Sega", "Tokoro San no MahMahjan 2 (Japan, ROM Based)", 0 ) |
| r1355 | r1356 | |
|---|---|---|
| 189 | 189 | static void assert_irq(void) |
| 190 | 190 | { |
| 191 | 191 | 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); | |
| 193 | 193 | /* Timing here is an educated GUESS, Z80 /INT must stay high so the irq |
| 194 | 194 | fires no less than TWICE per frame, else game doesn't work right. |
| 195 | 195 | 6000000 / 56.747 = 105732.4616 cycles per frame, we'll call it A |
| r1355 | r1356 | |
|---|---|---|
| 240 | 240 | |
| 241 | 241 | /* if we have a fake i8751 handler, disable the actual 8751 */ |
| 242 | 242 | if (i8751_vblank_hook != NULL) |
| 243 | timer_call_after_resynch(0, suspend_i8751); | |
| 243 | timer_call_after_resynch(NULL, 0, suspend_i8751); | |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | |
| r1355 | r1356 | |
| 285 | 285 | /* the port C handshaking signals control the Z80 NMI, */ |
| 286 | 286 | /* so we have to sync whenever we access this PPI */ |
| 287 | 287 | 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); | |
| 289 | 289 | return; |
| 290 | 290 | } |
| 291 | 291 | logerror("%06X:standard_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask ^ 0xffff); |
| r1355 | r1356 | |
|---|---|---|
| 272 | 272 | |
| 273 | 273 | static void create_interrupt_timers(void) |
| 274 | 274 | { |
| 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); | |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 |
| r1355 | r1356 | |
|---|---|---|
| 1268 | 1268 | 16*128 |
| 1269 | 1269 | }; |
| 1270 | 1270 | |
| 1271 | gfx_layout t1_charlayout6 = | |
| 1271 | static gfx_layout t1_charlayout6 = | |
| 1272 | 1272 | { |
| 1273 | 1273 | 16, 16, |
| 1274 | 1274 | RGN_FRAC(1,1), |
| r1355 | r1356 | |
| 1280 | 1280 | 16*16*6 |
| 1281 | 1281 | }; |
| 1282 | 1282 | |
| 1283 | gfx_layout t1_charlayout8 = | |
| 1283 | static gfx_layout t1_charlayout8 = | |
| 1284 | 1284 | { |
| 1285 | 1285 | 16, 16, |
| 1286 | 1286 | RGN_FRAC(1,1), |
| r1355 | r1356 | |
| 3526 | 3526 | snd020_hack = 0; |
| 3527 | 3527 | resume_trigger = 0; |
| 3528 | 3528 | |
| 3529 | dmadelay_timer = timer_alloc(dmaend_callback); | |
| 3529 | dmadelay_timer = timer_alloc(dmaend_callback, NULL); | |
| 3530 | 3530 | |
| 3531 | 3531 | i = match = 0; |
| 3532 | 3532 | while ((gameDefs[i].cfgport != -1) && (!match)) |
| r1355 | r1356 | |
|---|---|---|
| 111 | 111 | |
| 112 | 112 | /* if we have a fake i8751 handler, disable the actual 8751 */ |
| 113 | 113 | if (i8751_vblank_hook != NULL) |
| 114 | timer_call_after_resynch(0, suspend_i8751); | |
| 114 | timer_call_after_resynch(NULL, 0, suspend_i8751); | |
| 115 | 115 | |
| 116 | 116 | /* reset global state */ |
| 117 | 117 | adc_select = 0; |
| r1355 | r1356 | |
| 171 | 171 | case 0x0000/2: /* PPI @ 4B */ |
| 172 | 172 | /* the port C handshaking signals control the Z80 NMI, */ |
| 173 | 173 | /* 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); | |
| 175 | 175 | return; |
| 176 | 176 | |
| 177 | 177 | case 0x3000/2: /* PPI @ 4C */ |
| r1355 | r1356 | |
| 217 | 217 | case 0x0000/2: |
| 218 | 218 | /* the port C handshaking signals control the Z80 NMI, */ |
| 219 | 219 | /* 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); | |
| 221 | 221 | return; |
| 222 | 222 | |
| 223 | 223 | case 0x0020/2: /* PPI @ 4C */ |
| r1355 | r1356 | |
| 890 | 890 | MDRV_CPU_PROGRAM_MAP(sound_map_2203,0) |
| 891 | 891 | MDRV_CPU_IO_MAP(sound_portmap_2203,0) |
| 892 | 892 | |
| 893 | /* soud hardware */ | |
| 893 | /* sound hardware */ | |
| 894 | 894 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") |
| 895 | 895 | |
| 896 | 896 | MDRV_SOUND_ADD(YM2203, MASTER_CLOCK_8MHz/2) |
| r1355 | r1356 | |
| 918 | 918 | MDRV_CPU_PROGRAM_MAP(sound_map_2151,0) |
| 919 | 919 | MDRV_CPU_IO_MAP(sound_portmap_2203x2,0) |
| 920 | 920 | |
| 921 | /* soud hardware */ | |
| 921 | /* sound hardware */ | |
| 922 | 922 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") |
| 923 | 923 | |
| 924 | 924 | MDRV_SOUND_ADD(YM2203, MASTER_CLOCK_8MHz/2) |
| r1355 | r1356 | |
| 956 | 956 | MDRV_CPU_PROGRAM_MAP(sound_map_2151,0) |
| 957 | 957 | MDRV_CPU_IO_MAP(sound_portmap_2151,0) |
| 958 | 958 | |
| 959 | /* soud hardware */ | |
| 959 | /* sound hardware */ | |
| 960 | 960 | MDRV_SPEAKER_STANDARD_STEREO("left", "right") |
| 961 | 961 | |
| 962 | 962 | MDRV_SOUND_ADD(YM2151, MASTER_CLOCK_8MHz/2) |
| r1355 | r1356 | |
| 1033 | 1033 | /************************************************************************************************************************** |
| 1034 | 1034 | ************************************************************************************************************************** |
| 1035 | 1035 | ************************************************************************************************************************** |
| 1036 | Hang On | |
| 1036 | Hang On (Rev A) | |
| 1037 | 1037 | CPU: 68000 (317-????) |
| 1038 | 1038 | |
| 1039 | 1039 | ASSY CPU BD 834-5704-01 |
| r1355 | r1356 | |
| 1044 | 1044 | */ |
| 1045 | 1045 | ROM_START( hangon ) |
| 1046 | 1046 | 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) ) | |
| 1051 | 1051 | |
| 1052 | 1052 | ROM_REGION( 0x40000, REGION_CPU2, 0 ) /* second 68000 CPU */ |
| 1053 | 1053 | ROM_LOAD16_BYTE( "epr-6920.ic63", 0x0000, 0x8000, CRC(1c95013e) SHA1(8344ac953477279c2c701f984d98292a21dd2f7d) ) |
| r1355 | r1356 | |
| 1092 | 1092 | /************************************************************************************************************************** |
| 1093 | 1093 | ************************************************************************************************************************** |
| 1094 | 1094 | ************************************************************************************************************************** |
| 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 | */ | |
| 1104 | ROM_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) ) | |
| 1148 | ROM_END | |
| 1149 | /************************************************************************************************************************** | |
| 1150 | ************************************************************************************************************************** | |
| 1151 | ************************************************************************************************************************** | |
| 1095 | 1152 | Super Hang On (bootleg upgrade) |
| 1096 | 1153 | CPU: 68000 (317-????) |
| 1097 | 1154 | */ |
| r1355 | r1356 | |
| 1673 | 1730 | * |
| 1674 | 1731 | *************************************/ |
| 1675 | 1732 | |
| 1676 | GAME( 1985, hangon, 0, hangon, hangon, hangon, ROT0, "Sega", "Hang-On", 0 ) | |
| 1733 | GAME( 1985, hangon, 0, hangon, hangon, hangon, ROT0, "Sega", "Hang-On (Rev A)", 0 ) | |
| 1734 | GAME( 1985, hangon1, hangon, hangon, hangon, hangon, ROT0, "Sega", "Hang-On", 0 ) | |
| 1677 | 1735 | GAME( 1992, shangupb, shangon, shangupb, shangupb, hangon, ROT0, "bootleg", "Super Hang-On (Hang-On upgrade, bootleg)", 0 ) |
| 1678 | 1736 | GAME( 1985, sharrier, 0, sharrier, sharrier, sharrier, ROT0, "Sega", "Space Harrier (Rev A, 8751 315-5163A)", 0 ) |
| 1679 | 1737 | GAME( 1985, sharrir1, sharrier, sharrier, sharrier, sharrier, ROT0, "Sega", "Space Harrier (8751 315-5163)", 0 ) |
| r1355 | r1356 | |
|---|---|---|
| 120 | 120 | static TIMER_CALLBACK( shared_sync_callback ) |
| 121 | 121 | { |
| 122 | 122 | 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); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | |
| r1355 | r1356 | |
| 143 | 143 | if ((opcode & 0xffc0) == 0x4ac0 || |
| 144 | 144 | ((opcode & 0xffc0) == 0x0080 && rom_base[cpunum][ppc / 2 + 1] == 7)) |
| 145 | 145 | { |
| 146 | timer_call_after_resynch(4, shared_sync_callback); | |
| 146 | timer_call_after_resynch(NULL, 4, shared_sync_callback); | |
| 147 | 147 | } |
| 148 | 148 | } |
| 149 | 149 | } |
| r1355 | r1356 | |
|---|---|---|
| 122 | 122 | { |
| 123 | 123 | // sound_nmi_enabled = 1; |
| 124 | 124 | 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 */ | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | /********************************************/ |
| r1355 | r1356 | |
|---|---|---|
| 904 | 904 | |
| 905 | 905 | static void combasc_init_common(void) |
| 906 | 906 | { |
| 907 | combasc_interleave_timer = timer_alloc(NULL); | |
| 907 | combasc_interleave_timer = timer_alloc(NULL, NULL); | |
| 908 | 908 | } |
| 909 | 909 | |
| 910 | 910 | static DRIVER_INIT( combasct ) |
| r1355 | r1356 | |
|---|---|---|
| 132 | 132 | static WRITE8_HANDLER( sound_command_w ) |
| 133 | 133 | { |
| 134 | 134 | soundlatch_w(0,data); |
| 135 | timer_call_after_resynch(data,nmi_callback); | |
| 135 | timer_call_after_resynch(NULL, data,nmi_callback); | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | static WRITE8_HANDLER( nmi_disable_w ) |
| r1355 | r1356 | |
|---|---|---|
| 800 | 800 | |
| 801 | 801 | static INTERRUPT_GEN( taitof2_interrupt ) |
| 802 | 802 | { |
| 803 | timer_set(ATTOTIME_IN_CYCLES(500,0),0, taitof2_interrupt6); | |
| 803 | timer_set(ATTOTIME_IN_CYCLES(500,0), NULL, 0, taitof2_interrupt6); | |
| 804 | 804 | cpunum_set_input_line(0, 5, HOLD_LINE); |
| 805 | 805 | } |
| 806 | 806 |
| r1355 | r1356 | |
|---|---|---|
| 408 | 408 | |
| 409 | 409 | /* The time the IRQ line stays high is set just long enough to happen after the NMI - hacky? */ |
| 410 | 410 | 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); | |
| 412 | 412 | |
| 413 | 413 | laserdisc_vsync(discinfo); |
| 414 | 414 | } |
| r1355 | r1356 | |
|---|---|---|
| 127 | 127 | static WRITE8_HANDLER( sound_arm_nmi_w ) |
| 128 | 128 | { |
| 129 | 129 | 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); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | static WRITE16_HANDLER( sound_irq_w ) |
| r1355 | r1356 | |
|---|---|---|
| 352 | 352 | static MACHINE_START( tubep ) |
| 353 | 353 | { |
| 354 | 354 | /* Create interrupt timer */ |
| 355 | interrupt_timer = timer_alloc(tubep_scanline_callback); | |
| 355 | interrupt_timer = timer_alloc(tubep_scanline_callback, NULL); | |
| 356 | 356 | |
| 357 | 357 | tubep_setup_save_state(); |
| 358 | 358 | } |
| r1355 | r1356 | |
| 516 | 516 | static MACHINE_START( rjammer ) |
| 517 | 517 | { |
| 518 | 518 | /* Create interrupt timer */ |
| 519 | interrupt_timer = timer_alloc(rjammer_scanline_callback); | |
| 519 | interrupt_timer = timer_alloc(rjammer_scanline_callback, NULL); | |
| 520 | 520 | |
| 521 | 521 | tubep_setup_save_state(); |
| 522 | 522 | } |
| r1355 | r1356 | |
|---|---|---|
| 1448 | 1448 | } |
| 1449 | 1449 | |
| 1450 | 1450 | 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); | |
| 1452 | 1452 | } |
| 1453 | 1453 | |
| 1454 | 1454 |
| r1355 | r1356 | |
|---|---|---|
| 178 | 178 | moo_objdma(game_type); |
| 179 | 179 | |
| 180 | 180 | // 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); | |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | // trigger V-blank interrupt |
| r1355 | r1356 | |
| 191 | 191 | moo_objdma(game_type); |
| 192 | 192 | |
| 193 | 193 | // 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); | |
| 195 | 195 | |
| 196 | 196 | // trigger V-blank interrupt |
| 197 | 197 | cpunum_set_input_line(0, 5, HOLD_LINE); |
| r1355 | r1356 | |
|---|---|---|
| 221 | 221 | { |
| 222 | 222 | /* One interrupt per input port (4 per frame, though only 2 used). |
| 223 | 223 | 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); | |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | static WRITE32_HANDLER( rotate_control_w ) /* only a guess that it's rotation */ |
| r1355 | r1356 | |
|---|---|---|
| 11 | 11 | disk image, it's in C:\GH4\GH4.EXE. It's UPX compressed, so unpack it before doing |
| 12 | 12 | any forensics. The emulator does run on Windows as new as XP Pro SP2 but you can't |
| 13 | 13 | 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 | ||
| 14 | 39 | */ |
| 15 | 40 | |
| 16 | 41 | #include "driver.h" |
| r1355 | r1356 | |
|---|---|---|
| 680 | 680 | { |
| 681 | 681 | cdp1869_configure(&destryer_CDP1869_interface); |
| 682 | 682 | |
| 683 | timer_set(ATTOTIME_IN_MSEC(200), 0, set_cpu_mode); | |
| 683 | timer_set(ATTOTIME_IN_MSEC(200), NULL, 0, set_cpu_mode); | |
| 684 | 684 | } |
| 685 | 685 | |
| 686 | 686 | static const CDP1869_interface draco_CDP1869_interface = |
| r1355 | r1356 | |
| 699 | 699 | |
| 700 | 700 | cdp1869_configure(&draco_CDP1869_interface); |
| 701 | 701 | |
| 702 | timer_set(ATTOTIME_IN_MSEC(200), 0, set_cpu_mode); | |
| 702 | timer_set(ATTOTIME_IN_MSEC(200), NULL, 0, set_cpu_mode); | |
| 703 | 703 | } |
| 704 | 704 | |
| 705 | 705 | /* ROMs */ |
| r1355 | r1356 | |
|---|---|---|
| 225 | 225 | state_save_register_global(bankaddress); |
| 226 | 226 | state_save_register_func_postload(set_m92_bank); |
| 227 | 227 | |
| 228 | scanline_timer = timer_alloc(m92_scanline_interrupt); | |
| 228 | scanline_timer = timer_alloc(m92_scanline_interrupt, NULL); | |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | static MACHINE_RESET( m92 ) |
| r1355 | r1356 | |
| 330 | 330 | |
| 331 | 331 | static WRITE16_HANDLER( m92_soundlatch_w ) |
| 332 | 332 | { |
| 333 | timer_call_after_resynch(V30_ASSERT, setvector_callback); | |
| 333 | timer_call_after_resynch(NULL, V30_ASSERT, setvector_callback); | |
| 334 | 334 | soundlatch_w(0, data & 0xff); |
| 335 | 335 | } |
| 336 | 336 | |
| r1355 | r1356 | |
| 347 | 347 | |
| 348 | 348 | static WRITE16_HANDLER( m92_sound_irq_ack_w ) |
| 349 | 349 | { |
| 350 | timer_call_after_resynch(V30_CLEAR, setvector_callback); | |
| 350 | timer_call_after_resynch(NULL, V30_CLEAR, setvector_callback); | |
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | static WRITE16_HANDLER( m92_sound_status_w ) |
| r1355 | r1356 | |
| 928 | 928 | static void sound_irq(int state) |
| 929 | 929 | { |
| 930 | 930 | if (state) |
| 931 | timer_call_after_resynch(YM2151_ASSERT, setvector_callback); | |
| 931 | timer_call_after_resynch(NULL, YM2151_ASSERT, setvector_callback); | |
| 932 | 932 | else |
| 933 | timer_call_after_resynch(YM2151_CLEAR, setvector_callback); | |
| 933 | timer_call_after_resynch(NULL, YM2151_CLEAR, setvector_callback); | |
| 934 | 934 | } |
| 935 | 935 | |
| 936 | 936 | static struct YM2151interface ym2151_interface = |
| r1355 | r1356 | |
| 1920 | 1920 | m92_irq_vectorbase=0x80; |
| 1921 | 1921 | m92_sprite_buffer_busy=1; |
| 1922 | 1922 | |
| 1923 | setvector_callback(machine, VECTOR_INIT); | |
| 1923 | setvector_callback(machine, NULL, VECTOR_INIT); | |
| 1924 | 1924 | irem_cpu_decrypt(1,decryption_table); |
| 1925 | 1925 | } |
| 1926 | 1926 |
| r1355 | r1356 | |
|---|---|---|
| 244 | 244 | { |
| 245 | 245 | cpunum_set_input_line(1, INPUT_LINE_NMI, CLEAR_LINE ); |
| 246 | 246 | |
| 247 | timer_set( ATTOTIME_IN_USEC( 25 ), 0, z80_nmi_callback ); | |
| 247 | timer_set( ATTOTIME_IN_USEC( 25 ), NULL, 0, z80_nmi_callback ); | |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | static WRITE8_HANDLER( z80_irq_w ) |
| r1355 | r1356 | |
|---|---|---|
| 49 | 49 | |
| 50 | 50 | /* PCB supports two dials, but cab has only got one */ |
| 51 | 51 | |
| 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); | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | |
| 57 | 57 | static MACHINE_RESET( destroyr ) |
| 58 | 58 | { |
| 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); | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 |
| r1355 | r1356 | |
|---|---|---|
| 1063 | 1063 | |
| 1064 | 1064 | /* if we have a fake i8751 handler, disable the actual 8751 */ |
| 1065 | 1065 | if (i8751_vblank_hook != NULL) |
| 1066 | timer_call_after_resynch(0, suspend_i8751); | |
| 1066 | timer_call_after_resynch(NULL, 0, suspend_i8751); | |
| 1067 | 1067 | |
| 1068 | 1068 | /* configure sprite banks */ |
| 1069 | 1069 | for (i = 0; i < 16; i++) |
| r1355 | r1356 | |
| 1080 | 1080 | static MACHINE_RESET( atomicp ) |
| 1081 | 1081 | { |
| 1082 | 1082 | 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); | |
| 1084 | 1084 | } |
| 1085 | 1085 | |
| 1086 | 1086 |
| r1355 | r1356 | |
|---|---|---|
| 524 | 524 | static TIMER_CALLBACK( level_1_interrupt_callback ) |
| 525 | 525 | { |
| 526 | 526 | 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); | |
| 528 | 528 | } |
| 529 | 529 | |
| 530 | 530 | |
| 531 | 531 | static TIMER_CALLBACK( vblank_interrupt_callback ) |
| 532 | 532 | { |
| 533 | 533 | 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); | |
| 535 | 535 | } |
| 536 | 536 | |
| 537 | 537 | |
| r1355 | r1356 | |
| 545 | 545 | |
| 546 | 546 | static MACHINE_START( fuuki16 ) |
| 547 | 547 | { |
| 548 | raster_interrupt_timer = timer_alloc(raster_interrupt_callback); | |
| 548 | raster_interrupt_timer = timer_alloc(raster_interrupt_callback, NULL); | |
| 549 | 549 | } |
| 550 | 550 | |
| 551 | 551 | |
| 552 | 552 | static MACHINE_RESET( fuuki16 ) |
| 553 | 553 | { |
| 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); | |
| 556 | 556 | timer_adjust(raster_interrupt_timer, video_screen_get_time_until_pos(0, 0, machine->screen[0].visarea.max_x + 1), 0, attotime_zero); |
| 557 | 557 | } |
| 558 | 558 |
| r1355 | r1356 | |
|---|---|---|
| 274 | 274 | { |
| 275 | 275 | out = 0; |
| 276 | 276 | interrupt_line_active=0; |
| 277 | scanline_timer = timer_alloc(scanline_callback); | |
| 277 | scanline_timer = timer_alloc(scanline_callback, NULL); | |
| 278 | 278 | timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, interrupt_scanline, 0), interrupt_scanline, attotime_zero); |
| 279 | 279 | |
| 280 | 280 | state_save_register_global(out); |
| r1355 | r1356 | |
|---|---|---|
| 393 | 393 | static INTERRUPT_GEN( f3_interrupt2 ) |
| 394 | 394 | { |
| 395 | 395 | 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); | |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | static MACHINE_RESET( f3 ) |
| r1355 | r1356 | |
|---|---|---|
| 1485 | 1485 | 0 |
| 1486 | 1486 | }; |
| 1487 | 1487 | |
| 1488 | struct Samplesinterface journey_samples_interface = | |
| 1488 | static struct Samplesinterface journey_samples_interface = | |
| 1489 | 1489 | { |
| 1490 | 1490 | 1, |
| 1491 | 1491 | journey_sample_names |
| r1355 | r1356 | |
|---|---|---|
| 93 | 93 | |
| 94 | 94 | static void create_interrupt_timer(void) |
| 95 | 95 | { |
| 96 | interrupt_timer = timer_alloc(interrupt_callback); | |
| 96 | interrupt_timer = timer_alloc(interrupt_callback, NULL); | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 |
| r1355 | r1356 | |
|---|---|---|
| 45 | 45 | |
| 46 | 46 | static MACHINE_START( m107 ) |
| 47 | 47 | { |
| 48 | scanline_timer = timer_alloc(m107_scanline_interrupt); | |
| 48 | scanline_timer = timer_alloc(m107_scanline_interrupt, NULL); | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | static MACHINE_RESET( m107 ) |
| r1355 | r1356 | |
| 119 | 119 | |
| 120 | 120 | static WRITE16_HANDLER( m107_soundlatch_w ) |
| 121 | 121 | { |
| 122 | timer_call_after_resynch(V30_ASSERT,setvector_callback); | |
| 122 | timer_call_after_resynch(NULL, V30_ASSERT,setvector_callback); | |
| 123 | 123 | soundlatch_w(0, data & 0xff); |
| 124 | 124 | // logerror("soundlatch_w %02x\n",data); |
| 125 | 125 | } |
| r1355 | r1356 | |
| 138 | 138 | |
| 139 | 139 | static WRITE16_HANDLER( m107_sound_irq_ack_w ) |
| 140 | 140 | { |
| 141 | timer_call_after_resynch(V30_CLEAR,setvector_callback); | |
| 141 | timer_call_after_resynch(NULL, V30_CLEAR,setvector_callback); | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | static WRITE16_HANDLER( m107_sound_status_w ) |
| r1355 | r1356 | |
| 457 | 457 | static void sound_irq(int state) |
| 458 | 458 | { |
| 459 | 459 | if (state) |
| 460 | timer_call_after_resynch(YM2151_ASSERT,setvector_callback); | |
| 460 | timer_call_after_resynch(NULL, YM2151_ASSERT,setvector_callback); | |
| 461 | 461 | else |
| 462 | timer_call_after_resynch(YM2151_CLEAR,setvector_callback); | |
| 462 | timer_call_after_resynch(NULL, YM2151_CLEAR,setvector_callback); | |
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | static struct YM2151interface ym2151_interface = |
| r1355 | r1356 | |
|---|---|---|
| 64 | 64 | scanline = 16; |
| 65 | 65 | } |
| 66 | 66 | |
| 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); | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | |
| 71 | 71 | static MACHINE_RESET( cball ) |
| 72 | 72 | { |
| 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); | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 |
| r1355 | r1356 | |
|---|---|---|
| 123 | 123 | /* Called once/frame to generate the VBLANK interrupt */ |
| 124 | 124 | static INTERRUPT_GEN( cave_interrupt ) |
| 125 | 125 | { |
| 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); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /* Called by the YMZ280B to set the IRQ state */ |
| r1355 | r1356 | |
|---|---|---|
| 539 | 539 | static TIMER_CALLBACK( level_1_interrupt_callback ) |
| 540 | 540 | { |
| 541 | 541 | 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); | |
| 543 | 543 | } |
| 544 | 544 | |
| 545 | 545 | |
| 546 | 546 | static TIMER_CALLBACK( vblank_interrupt_callback ) |
| 547 | 547 | { |
| 548 | 548 | 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); | |
| 550 | 550 | } |
| 551 | 551 | |
| 552 | 552 | |
| r1355 | r1356 | |
| 560 | 560 | |
| 561 | 561 | static MACHINE_START( fuuki32 ) |
| 562 | 562 | { |
| 563 | raster_interrupt_timer = timer_alloc(raster_interrupt_callback); | |
| 563 | raster_interrupt_timer = timer_alloc(raster_interrupt_callback, NULL); | |
| 564 | 564 | } |
| 565 | 565 | |
| 566 | 566 | |
| 567 | 567 | static MACHINE_RESET( fuuki32 ) |
| 568 | 568 | { |
| 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); | |
| 571 | 571 | timer_adjust(raster_interrupt_timer, video_screen_get_time_until_pos(0, 0, machine->screen[0].visarea.max_x + 1), 0, attotime_zero); |
| 572 | 572 | } |
| 573 | 573 |
| r1355 | r1356 | |
|---|---|---|
| 251 | 251 | ROM_END |
| 252 | 252 | |
| 253 | 253 | |
| 254 | GAME( 1978, tourtabl, 0, tourtabl, tourtabl, NULL, ROT0, "Atari", "Tournament Table (set 1)", 0 ) | |
| 255 | GAME( 1978, tourtab2, tourtabl, tourtabl, tourtabl, NULL, ROT0, "Atari", "Tournament Table (set 2)", 0 ) | |
| 254 | GAME( 1978, tourtabl, 0, tourtabl, tourtabl, 0, ROT0, "Atari", "Tournament Table (set 1)", 0 ) | |
| 255 | GAME( 1978, tourtab2, tourtabl, tourtabl, tourtabl, 0, ROT0, "Atari", "Tournament Table (set 2)", 0 ) |
| r1355 | r1356 | |
|---|---|---|
| 103 | 103 | { |
| 104 | 104 | scanline_int = 1; |
| 105 | 105 | 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); | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /* advance to the next scanline */ |
| r1355 | r1356 | |
| 134 | 134 | update_interrupts(); |
| 135 | 135 | |
| 136 | 136 | /* 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); | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | |
| r1355 | r1356 | |
| 172 | 172 | logerror("Machine init\n"); |
| 173 | 173 | |
| 174 | 174 | /* 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); | |
| 176 | 176 | timer_adjust(scan_timer, video_screen_get_time_until_pos(0, 0, 320), 0, attotime_zero); |
| 177 | 177 | } |
| 178 | 178 |
| r1355 | r1356 | |
|---|---|---|
| 196 | 196 | video_screen_configure(0, 320, 256, &visarea, HZ_TO_ATTOSECONDS(PIXEL_CLOCK) * VTOTAL * HTOTAL); |
| 197 | 197 | |
| 198 | 198 | /* 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); | |
| 200 | 200 | irq_state = 0; |
| 201 | 201 | schedule_next_irq(0-64); |
| 202 | 202 |
| r1355 | r1356 | |
|---|---|---|
| 187 | 187 | static WRITE16_HANDLER( sound_command_w ) |
| 188 | 188 | { |
| 189 | 189 | 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); | |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 |
| r1355 | r1356 | |
|---|---|---|
| 656 | 656 | if (!blt_amount) |
| 657 | 657 | { |
| 658 | 658 | 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); | |
| 660 | 660 | return; |
| 661 | 661 | } |
| 662 | 662 |
| r1355 | r1356 | |
|---|---|---|
| 241 | 241 | |
| 242 | 242 | static INTERRUPT_GEN( cadash_interrupt ) |
| 243 | 243 | { |
| 244 | timer_set(ATTOTIME_IN_CYCLES(500,0),0, cadash_interrupt5); | |
| 244 | timer_set(ATTOTIME_IN_CYCLES(500,0), NULL, 0, cadash_interrupt5); | |
| 245 | 245 | cpunum_set_input_line(0, 4, HOLD_LINE); /* interrupt vector 4 */ |
| 246 | 246 | } |
| 247 | 247 |
| r1355 | r1356 | |
|---|---|---|
| 67 | 67 | static WRITE8_HANDLER( sound_arm_nmi_w ) |
| 68 | 68 | { |
| 69 | 69 | 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 */ | |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | static READ8_HANDLER( pip_r ) |
| r1355 | r1356 | |
|---|---|---|
| 47 | 47 | scanline = 0; |
| 48 | 48 | } |
| 49 | 49 | |
| 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); | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | |
| 54 | 54 | static MACHINE_RESET( wolfpack ) |
| 55 | 55 | { |
| 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); | |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 |
| r1355 | r1356 | |
|---|---|---|
| 204 | 204 | |
| 205 | 205 | /* if we are running with a real live 8751, we need to boost the interleave at startup */ |
| 206 | 206 | 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); | |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 |
| r1355 | r1356 | |
|---|---|---|
| 154 | 154 | |
| 155 | 155 | static MACHINE_RESET( nitedrvr ) |
| 156 | 156 | { |
| 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); | |
| 158 | 158 | nitedrvr_register_machine_vars(); |
| 159 | 159 | } |
| 160 | 160 |
| r1355 | r1356 | |
|---|---|---|
| 83 | 83 | |
| 84 | 84 | VCONV = $(WINOBJ)/vconv$(EXE) |
| 85 | 85 | |
| 86 | # append a 'v' prefix if nothing specified | |
| 87 | ifndef PREFIX | |
| 88 | PREFIX = v | |
| 89 | endif | |
| 90 | ||
| 86 | 91 | # replace the various compilers with vconv.exe prefixes |
| 87 | 92 | CC = @$(VCONV) gcc -I. |
| 88 | 93 | LD = @$(VCONV) ld /profile |
| r1355 | r1356 | |
| 103 | 108 | endif |
| 104 | 109 | |
| 105 | 110 | ifdef PTR64 |
| 106 | CC += /wd4267 | |
| 111 | CC += /wd4267 | |
| 107 | 112 | endif |
| 108 | 113 | |
| 109 | 114 | # add some VC++-specific defines |
| 110 | DEFS += -D_CRT_SECURE_NO_DEPRECATE -DXML_STATIC -D__inline__=__inline -Dsnprintf=_snprintf | |
| 115 | DEFS += -D_CRT_SECURE_NO_DEPRECATE -DXML_STATIC -D__inline__=__inline -Dsnprintf=_snprintf | |
| 111 | 116 | |
| 112 | 117 | # make msvcprep into a pre-build step |
| 113 | 118 | # OSPREBUILD = $(VCONV) |
| r1355 | r1356 | |
|---|---|---|
| 26 | 26 | #ifdef _MSC_VER |
| 27 | 27 | void *__cdecl _alloca(size_t); |
| 28 | 28 | #define alloca _alloca |
| 29 | #if _MSC_VER < 1400 | |
| 30 | #define vsnprintf _vsnprintf | |
| 29 | 31 | #endif |
| 32 | #endif | |
| 30 | 33 | |
| 31 | 34 | #ifdef __GNUC__ |
| 32 | 35 | #define alloca __builtin_alloca |
| r1355 | r1356 | |
|---|---|---|
| 16 | 16 | |
| 17 | 17 | // MAME headers |
| 18 | 18 | #include "osdcore.h" |
| 19 | #include "osinline.h" | |
| 19 | 20 | |
| 20 | 21 | |
| 21 | 22 | //============================================================ |
| r1355 | r1356 | |
|---|---|---|
| 86 | 86 | { 0, "-mwindows", "" }, |
| 87 | 87 | { 0, "-mno-cygwin", "" }, |
| 88 | 88 | { 0, "-std=gnu89", "" }, |
| 89 | { 0, "-pipe", "" }, | |
| 89 | 90 | { 0 } |
| 90 | 91 | }; |
| 91 | 92 |
| r1355 | r1356 | |
|---|---|---|
| 24 | 24 | ***************************************************************************/ |
| 25 | 25 | |
| 26 | 26 | /* ----- 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 | |
| 27 | enum | |
| 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 | }; | |
| 37 | 40 | |
| 38 | ||
| 39 | 41 | /* ----- per-region constants ----- */ |
| 40 | 42 | #define ROMREGION_WIDTHMASK 0x00000003 /* native width of region, as power of 2 */ |
| 41 | 43 | #define ROMREGION_8BIT 0x00000000 /* (non-CPU regions only) */ |
| r1355 | r1356 | |
|---|---|---|
| 530 | 530 | |
| 531 | 531 | void debug_refresh_display(void) |
| 532 | 532 | { |
| 533 | video_frame_update(); | |
| 533 | video_frame_update(TRUE); | |
| 534 | 534 | } |
| 535 | 535 | |
| 536 | 536 |
| r1355 | r1356 | |
|---|---|---|
| 78 | 78 | #define EA ea.w.l |
| 79 | 79 | |
| 80 | 80 | /* public globals */ |
| 81 | int m6805_ICount=50000; | |
| 81 | static int m6805_ICount=50000; | |
| 82 | 82 | |
| 83 | 83 | /* DS -- THESE ARE RE-DEFINED IN m6805.h TO RAM, ROM or FUNCTIONS IN cpuintrf.c */ |
| 84 | 84 | #define RM(Addr) M6805_RDMEM(Addr) |
| r1355 | r1356 | |
|---|---|---|
| 486 | 486 | |
| 487 | 487 | void h8_itu_init(void) |
| 488 | 488 | { |
| 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); | |
| 494 | 494 | |
| 495 | 495 | h8_itu_reset(); |
| 496 | 496 |
| r1355 | r1356 | |
|---|---|---|
| 305 | 305 | ****************************************************************************/ |
| 306 | 306 | #if HAS_M68010 |
| 307 | 307 | |
| 308 | void m68010_init(int index, int clock, const void *config, int (*irqcallback)(int)) | |
| 308 | static void m68010_init(int index, int clock, const void *config, int (*irqcallback)(int)) | |
| 309 | 309 | { |
| 310 | 310 | m68k_init(); |
| 311 | 311 | m68k_set_cpu_type(M68K_CPU_TYPE_68010); |
| r1355 | r1356 | |
|---|---|---|
| 3 | 3 | |
| 4 | 4 | #include "cpuintrf.h" |
| 5 | 5 | |
| 6 | extern int z80gb_ICount; | |
| 7 | ||
| 8 | 6 | typedef struct { |
| 9 | 7 | UINT16 *regs; |
| 10 | 8 | UINT8 features; |
| r1355 | r1356 | |
|---|---|---|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /* Nr of cycles to run */ |
| 132 | int z80gb_ICount; | |
| 132 | static int z80gb_ICount; | |
| 133 | 133 | |
| 134 | 134 | static int Cycles[256] = |
| 135 | 135 | { |
| r1355 | r1356 | |
|---|---|---|
| 616 | 616 | screen_to_cpu[config->scrnum] = index; |
| 617 | 617 | |
| 618 | 618 | /* 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); | |
| 620 | 620 | timer_adjust(state.scantimer, attotime_zero, index, attotime_zero); |
| 621 | 621 | |
| 622 | 622 | /* allocate the shiftreg */ |
| r1355 | r1356 | |
| 932 | 932 | if (enabled && vcount == SMART_IOREG(DPYINT)) |
| 933 | 933 | { |
| 934 | 934 | /* generate the display interrupt signal */ |
| 935 | internal_interrupt_callback(machine, cpunum | (TMS34010_DI << 8)); | |
| 935 | internal_interrupt_callback(machine, NULL, cpunum | (TMS34010_DI << 8)); | |
| 936 | 936 | } |
| 937 | 937 | |
| 938 | 938 | /* at the start of VBLANK, load the starting display address */ |
| r1355 | r1356 | |
| 1179 | 1179 | |
| 1180 | 1180 | /* NMI issued? */ |
| 1181 | 1181 | if (data & 0x0100) |
| 1182 | timer_call_after_resynch(cpunum, internal_interrupt_callback); | |
| 1182 | timer_call_after_resynch(NULL, cpunum, internal_interrupt_callback); | |
| 1183 | 1183 | break; |
| 1184 | 1184 | |
| 1185 | 1185 | case REG_HSTCTLL: |
| r1355 | r1356 | |
| 1214 | 1214 | |
| 1215 | 1215 | /* input interrupt? (should really be state-based, but the functions don't exist!) */ |
| 1216 | 1216 | 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); | |
| 1218 | 1218 | else if ((oldreg & 0x0008) && !(newreg & 0x0008)) |
| 1219 | 1219 | IOREG(REG_INTPEND) &= ~TMS34010_HI; |
| 1220 | 1220 | break; |
| r1355 | r1356 | |
| 1323 | 1323 | |
| 1324 | 1324 | /* NMI issued? */ |
| 1325 | 1325 | if (data & 0x0100) |
| 1326 | timer_call_after_resynch(cpunum, internal_interrupt_callback); | |
| 1326 | timer_call_after_resynch(NULL, cpunum, internal_interrupt_callback); | |
| 1327 | 1327 | break; |
| 1328 | 1328 | |
| 1329 | 1329 | case REG020_HSTCTLL: |
| r1355 | r1356 | |
| 1358 | 1358 | |
| 1359 | 1359 | /* input interrupt? (should really be state-based, but the functions don't exist!) */ |
| 1360 | 1360 | 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); | |
| 1362 | 1362 | else if ((oldreg & 0x0008) && !(newreg & 0x0008)) |
| 1363 | 1363 | IOREG(REG020_INTPEND) &= ~TMS34010_HI; |
| 1364 | 1364 | break; |
| r1355 | r1356 | |
|---|---|---|
| 1054 | 1054 | { |
| 1055 | 1055 | INT_ACK = irqcallback; |
| 1056 | 1056 | |
| 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); | |
| 1065 | 1065 | |
| 1066 | 1066 | state_save_register_item("M377xx", index, m37710i_cpu.a); |
| 1067 | 1067 | state_save_register_item("M377xx", index, m37710i_cpu.b); |
| r1355 | r1356 | |
|---|---|---|
| 94 | 94 | static void sc61860_init(int index, int clock, const void *config, int (*irqcallback)(int)) |
| 95 | 95 | { |
| 96 | 96 | 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); | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | static void sc61860_get_context (void *dst) |
| r1355 | r1356 | |
|---|---|---|
| 96 | 96 | /* Pulse the SO (Set Overflow) pin on the CPU */ |
| 97 | 97 | void spc700_pulse_so(void); |
| 98 | 98 | |
| 99 | extern int spc700_ICount; /* cycle count */ | |
| 100 | ||
| 101 | 99 | int spc700_execute(int clocks); |
| 102 | 100 | |
| 103 | 101 |
| r1355 | r1356 | |
|---|---|---|
| 134 | 134 | /* Our CPU structure */ |
| 135 | 135 | static spc700i_cpu_struct spc700i_cpu = {0}; |
| 136 | 136 | |
| 137 | int spc700_ICount = 0; | |
| 137 | static int spc700_ICount = 0; | |
| 138 | 138 | |
| 139 | 139 | /* Temporary Variables */ |
| 140 | 140 | static uint spc700i_source; |
| r1355 | r1356 | |
|---|---|---|
| 171 | 171 | |
| 172 | 172 | /* 6309 registers */ |
| 173 | 173 | static hd6309_Regs hd6309; |
| 174 | int hd6309_slapstic = 0; | |
| 174 | //static int hd6309_slapstic = 0; | |
| 175 | 175 | |
| 176 | 176 | #define pPPC hd6309.ppc |
| 177 | 177 | #define pPC hd6309.pc |
| r1355 | r1356 | |
|---|---|---|
| 2430 | 2430 | case 2: |
| 2431 | 2431 | if ( !is16bit ) |
| 2432 | 2432 | 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); | |
| 2434 | 2434 | break; |
| 2435 | 2435 | } |
| 2436 | 2436 | } |
| r1355 | r1356 | |
| 2446 | 2446 | case 0: |
| 2447 | 2447 | case 2: |
| 2448 | 2448 | if ( is16bit ) // T0/T1 overflow signal clocks T1/T3 |
| 2449 | t90_timer_callback(machine, i+1); | |
| 2449 | t90_timer_callback(machine, NULL, i+1); | |
| 2450 | 2450 | break; |
| 2451 | 2451 | } |
| 2452 | 2452 | } |
| r1355 | r1356 | |
| 2662 | 2662 | // Timers |
| 2663 | 2663 | |
| 2664 | 2664 | 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); | |
| 2666 | 2666 | |
| 2667 | T90.timer[4] = timer_alloc(t90_timer4_callback); | |
| 2667 | T90.timer[4] = timer_alloc(t90_timer4_callback, NULL); | |
| 2668 | 2668 | } |
| 2669 | 2669 | |
| 2670 | 2670 | static ADDRESS_MAP_START(tmp90840_mem, ADDRESS_SPACE_PROGRAM, 8) |
| r1355 | r1356 | |
|---|---|---|
| 28 | 28 | /* define this to expand all EA calculations inline */ |
| 29 | 29 | #define INLINE_EA 1 |
| 30 | 30 | |
| 31 | int s2650_ICount = 0; | |
| 31 | static int s2650_ICount = 0; | |
| 32 | 32 | |
| 33 | 33 | typedef struct { |
| 34 | 34 | UINT16 ppc; /* previous program counter (page + iar) */ |
| r1355 | r1356 | |
|---|---|---|
| 662 | 662 | timer_adjust(hyperstone.timer, attotime_never, 0, attotime_never); |
| 663 | 663 | } |
| 664 | 664 | |
| 665 | static TIMER_CALLBACK( timer_callback ) | |
| 665 | static TIMER_CALLBACK( e132xs_timer_callback ) | |
| 666 | 666 | { |
| 667 | 667 | int update = param & 1; |
| 668 | 668 | int cpunum = param >> 1; |
| r1355 | r1356 | |
| 1576 | 1576 | state_save_register_item("E132XS", index, hyperstone.tr_clocks_per_tick); |
| 1577 | 1577 | |
| 1578 | 1578 | hyperstone.irq_callback = irqcallback; |
| 1579 | hyperstone.timer = timer_alloc(timer_callback); | |
| 1579 | hyperstone.timer = timer_alloc(e132xs_timer_callback, NULL); | |
| 1580 | 1580 | hyperstone.clock_scale_mask = scale_mask; |
| 1581 | 1581 | } |
| 1582 | 1582 |
| r1355 | r1356 | |
|---|---|---|
| 31 | 31 | #endif |
| 32 | 32 | |
| 33 | 33 | |
| 34 | extern UINT32 sp_read_reg(UINT32 reg); | |
| 35 | extern void sp_write_reg(UINT32 reg, UINT32 data); | |
| 36 | extern READ32_HANDLER( n64_dp_reg_r ); | |
| 37 | extern WRITE32_HANDLER( n64_dp_reg_w ); | |
| 38 | extern void sp_set_status(UINT32 status); | |
| 34 | static rsp_config *config; | |
| 39 | 35 | |
| 40 | 36 | |
| 41 | 37 | typedef struct |
| r1355 | r1356 | |
| 52 | 48 | UINT32 r[32]; |
| 53 | 49 | VECTOR_REG v[32]; |
| 54 | 50 | UINT16 flag[4]; |
| 55 | ||
| 51 | | |
| 56 | 52 | |
| 57 | 53 | INT64 accum[8]; |
| 58 | 54 | INT32 square_root_res; |
| r1355 | r1356 | |
| 235 | 231 | { |
| 236 | 232 | if (reg >= 0 && reg < 8) |
| 237 | 233 | { |
| 238 | return sp_re | |
| 234 | return (config->sp_reg | |
| 239 | 235 | } |
| 240 | 236 | else if (reg >= 8 && reg < 16) |
| 241 | 237 | { |
| 242 | return n | |
| 238 | return (config->dp_reg_r)(reg - 8, 0x00000000); | |
| 243 | 239 | } |
| 244 | 240 | else |
| 245 | 241 | { |
| r1355 | r1356 | |
| 251 | 247 | { |
| 252 | 248 | if (reg >= 0 && reg < 8) |
| 253 | 249 | { |
| 254 | sp_ | |
| 250 | (config->sp_ | |
| 255 | 251 | } |
| 256 | 252 | else if (reg >= 8 && reg < 16) |
| 257 | 253 | { |
| 258 | n | |
| 254 | (config->dp_reg_w)(reg - 8, data, 0x00000000); | |
| 259 | 255 | } |
| 260 | 256 | else |
| 261 | 257 | { |
| r1355 | r1356 | |
| 348 | 344 | |
| 349 | 345 | static void rsp_init(int index, int clock, const void *_config, int (*irqcallback)(int)) |
| 350 | 346 | { |
| 351 | //int regIdx, accumIdx; | |
| 347 | //int regIdx, accumIdx; | |
| 348 | config = (rsp_config *)_config; | |
| 349 | ||
| 352 | 350 | #if LOG_INSTRUCTION_EXECUTION |
| 353 | 351 | exec_output = fopen("rsp_execute.txt", "wt"); |
| 354 | 352 | #endif |
| 355 | 353 | |
| 356 | 354 | 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; | |
| 378 | 376 | } |
| 379 | 377 | |
| 380 | 378 | static void rsp_exit(void) |
| r1355 | r1356 | |
| 397 | 395 | #endif |
| 398 | 396 | #if SAVE_DMEM |
| 399 | 397 | { |
| 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 | ||
| 410 | 398 | int i; |
| 411 | 399 | 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 | |
| 412 | 409 | dmem = fopen("rsp_dmem.bin", "wb"); |
| 413 | 410 | |
| 414 | 411 | for (i=0; i < 0x1000; i++) |
| r1355 | r1356 | |
| 966 | 963 | // |
| 967 | 964 | // Stores one element from maximum of 8 vectors, while incrementing element index |
| 968 | 965 | |
| 969 | int element | |
| 966 | int element | |
| 970 | 967 | int vs = dest; |
| 971 | 968 | int ve = dest + 8; |
| 972 | 969 | if (ve > 32) |
| r1355 | r1356 | |
| 2308 | 2305 | i = 0; |
| 2309 | 2306 | } |
| 2310 | 2307 | } |
| 2311 | ||
| 2308 | | |
| 2312 | 2309 | for (i = 31; i > 0; i--) |
| 2313 | 2310 | { |
| 2314 | 2311 | if (rec & (1 << i)) |
| r1355 | r1356 | |
| 2554 | 2551 | |
| 2555 | 2552 | rsp.pc = 0x4001000 | (rsp.pc & 0xfff); |
| 2556 | 2553 | |
| 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 | } | |
| 2561 | 2558 | |
| 2562 | 2559 | while (rsp_icount > 0) |
| 2563 | 2560 | { |
| r1355 | r1356 | |
| 2591 | 2588 | case 0x09: /* JALR */ JUMP_PC_L(RSVAL, RDREG); break; |
| 2592 | 2589 | case 0x0d: /* BREAK */ |
| 2593 | 2590 | { |
| 2594 | sp_set_status(0x3); | |
| 2591 | (config->sp_set_status)(0x3); | |
| 2595 | 2592 | rsp_icount = 1; |
| 2596 | 2593 | |
| 2597 | 2594 | #if LOG_INSTRUCTION_EXECUTION |
| r1355 | r1356 | |
| 2784 | 2781 | |
| 2785 | 2782 | --rsp_icount; |
| 2786 | 2783 | |
| 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 | } | |
| 2791 | 2788 | |
| 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 | } | |
| 2796 | 2793 | |
| 2797 | 2794 | } |
| 2798 | 2795 | |
| r1355 | r1356 | |
| 2942 | 2939 | case CPUINFO_INT_REGISTER + RSP_R30: info->i = rsp.r[30]; break; |
| 2943 | 2940 | case CPUINFO_INT_SP: |
| 2944 | 2941 | 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; | |
| 2947 | 2944 | |
| 2948 | 2945 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 2949 | 2946 | case CPUINFO_PTR_GET_CONTEXT: info->getcontext = rsp_get_context; break; |
| r1355 | r1356 | |
| 3002 | 2999 | case CPUINFO_STR_REGISTER + RSP_R29: sprintf(info->s, "R29: %08X", rsp.r[29]); break; |
| 3003 | 3000 | case CPUINFO_STR_REGISTER + RSP_R30: sprintf(info->s, "R30: %08X", rsp.r[30]); break; |
| 3004 | 3001 | 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; | |
| 3007 | 3004 | } |
| 3008 | 3005 | } |
| r1355 | r1356 | |
|---|---|---|
| 1 | 1 | #ifndef _RSP_H |
| 2 | 2 | #define _RSP_H |
| 3 | 3 | |
| 4 | struct _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 | }; | |
| 12 | typedef struct _rsp_config rsp_config; | |
| 13 | ||
| 4 | 14 | enum |
| 5 | 15 | { |
| 6 | 16 | RSP_PC = 1, |
| r1355 | r1356 | |
|---|---|---|
| 87 | 87 | |
| 88 | 88 | } m6502_Regs; |
| 89 | 89 | |
| 90 | int m6502_IntOccured = 0; | |
| 91 | int m6502_ICount = 0; | |
| 90 | static int m6502_IntOccured = 0; | |
| 91 | static int m6502_ICount = 0; | |
| 92 | 92 | |
| 93 | 93 | static m6502_Regs m6502; |
| 94 | 94 |
| r1355 | r1356 | |
|---|---|---|
| 150 | 150 | void (*sod_callback)(int state); |
| 151 | 151 | } i8085_Regs; |
| 152 | 152 | |
| 153 | int i8085_ICount = 0; | |
| 153 | static int i8085_ICount = 0; | |
| 154 | 154 | |
| 155 | 155 | static i8085_Regs I; |
| 156 | 156 | static UINT8 ZS[256]; |
| r1355 | r1356 | |
|---|---|---|
| 12 | 12 | #endif |
| 13 | 13 | #if (HAS_PPC403) |
| 14 | 14 | void ppc403_exception(int exception); |
| 15 | UINT8 ppc403_spu_r(UINT32 a); | |
| 16 | void ppc403_spu_w(UINT32 a, UINT8 d); | |
| 15 | static UINT8 ppc403_spu_r(UINT32 a); | |
| 16 | static void ppc403_spu_w(UINT32 a, UINT8 d); | |
| 17 | 17 | #endif |
| 18 | 18 | |
| 19 | 19 | #define RD ((op >> 21) & 0x1F) |
| r1355 | r1356 | |
| 921 | 921 | // !!! why is rfci here !!! |
| 922 | 922 | optable19[51] = ppc_rfci; |
| 923 | 923 | |
| 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); | |
| 926 | 926 | |
| 927 | 927 | ppc.read8 = ppc403_read8; |
| 928 | 928 | ppc.read16 = ppc403_read16; |
| r1355 | r1356 | |
|---|---|---|
| 678 | 678 | |
| 679 | 679 | case 0x9: |
| 680 | 680 | ppc.spu.sptb = d; |
| 681 | ppc403_spu_tx_callback(Machine, cpu_getactivecpu()); | |
| 681 | ppc403_spu_tx_callback(Machine, NULL, cpu_getactivecpu()); | |
| 682 | 682 | break; |
| 683 | 683 | |
| 684 | 684 | default: |
| r1355 | r1356 | |
|---|---|---|
| 1074 | 1074 | optable31[163] = recompile_wrteei; |
| 1075 | 1075 | optable19[51] = recompile_rfci; |
| 1076 | 1076 | |
| 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); | |
| 1079 | 1079 | |
| 1080 | 1080 | ppc.is603 = 0; |
| 1081 | 1081 | ppc.is602 = 0; |
| r1355 | r1356 | |
|---|---|---|
| 20 | 20 | #define WDT_INT 9 |
| 21 | 21 | #define NMI_INT 10 |
| 22 | 22 | |
| 23 | extern int sm8500_icount; | |
| 24 | ||
| 25 | 23 | enum { |
| 26 | 24 | /* "main" 16 bit register */ |
| 27 | 25 | SM8500_PC=1, SM8500_SP, SM8500_PS, SM8500_SYS16, SM8500_RR0, SM8500_RR2, SM8500_RR4, SM8500_RR6, SM8500_RR8, SM8500_RR10, |
| r1355 | r1356 | |
|---|---|---|
| 53 | 53 | static sm8500_regs regs; |
| 54 | 54 | |
| 55 | 55 | /* nr of cycles to run */ |
| 56 | int sm8500_icount; | |
| 56 | static int sm8500_icount; | |
| 57 | 57 | |
| 58 | 58 | static UINT8 sm8500_b2w[8] = { |
| 59 | 59 | 0, 8, 2, 10, 4, 12, 6, 14 |
| r1355 | r1356 | |
|---|---|---|
| 2933 | 2933 | { |
| 2934 | 2934 | const struct sh2_config *conf = config; |
| 2935 | 2935 | |
| 2936 | sh2.timer = timer_alloc(sh2_timer_callback); | |
| 2936 | sh2.timer = timer_alloc(sh2_timer_callback, NULL); | |
| 2937 | 2937 | timer_adjust(sh2.timer, attotime_never, 0, attotime_zero); |
| 2938 | 2938 | |
| 2939 | sh2.dma_timer[0] = timer_alloc(sh2_dmac_callback); | |
| 2939 | sh2.dma_timer[0] = timer_alloc(sh2_dmac_callback, NULL); | |
| 2940 | 2940 | timer_adjust(sh2.dma_timer[0], attotime_never, 0, attotime_zero); |
| 2941 | 2941 | |
| 2942 | sh2.dma_timer[1] = timer_alloc(sh2_dmac_callback); | |
| 2942 | sh2.dma_timer[1] = timer_alloc(sh2_dmac_callback, NULL); | |
| 2943 | 2943 | timer_adjust(sh2.dma_timer[1], attotime_never, 0, attotime_zero); |
| 2944 | 2944 | |
| 2945 | 2945 | sh2.m = auto_malloc(0x200); |
| r1355 | r1356 | |
|---|---|---|
| 4121 | 4121 | { |
| 4122 | 4122 | const struct sh4_config *conf = config; |
| 4123 | 4123 | |
| 4124 | sh4.timer0 = timer_alloc(sh4_timer0_callback); | |
| 4124 | sh4.timer0 = timer_alloc(sh4_timer0_callback, NULL); | |
| 4125 | 4125 | 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); | |
| 4127 | 4127 | 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); | |
| 4129 | 4129 | timer_adjust(sh4.timer2, attotime_never, 0, attotime_zero); |
| 4130 | 4130 | |
| 4131 | sh4.dma_timer[0] = timer_alloc(sh4_dmac_callback); | |
| 4131 | sh4.dma_timer[0] = timer_alloc(sh4_dmac_callback, NULL); | |
| 4132 | 4132 | 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); | |
| 4134 | 4134 | 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); | |
| 4136 | 4136 | 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); | |
| 4138 | 4138 | timer_adjust(sh4.dma_timer[3], attotime_never, 0, attotime_zero); |
| 4139 | 4139 | |
| 4140 | sh4.refresh_timer = timer_alloc(sh4_refresh_timer_callback); | |
| 4140 | sh4.refresh_timer = timer_alloc(sh4_refresh_timer_callback, NULL); | |
| 4141 | 4141 | timer_adjust(sh4.refresh_timer, attotime_never, 0, attotime_zero); |
| 4142 | 4142 | sh4.refresh_timer_base = 0; |
| 4143 | 4143 | |
| 4144 | sh4.rtc_timer = timer_alloc(sh4_rtc_timer_callback); | |
| 4144 | sh4.rtc_timer = timer_alloc(sh4_rtc_timer_callback, NULL); | |
| 4145 | 4145 | timer_adjust(sh4.rtc_timer, attotime_never, 0, attotime_zero); |
| 4146 | 4146 | |
| 4147 | 4147 | sh4.m = auto_malloc(16384*4); |
| r1355 | r1356 | |
|---|---|---|
| 343 | 343 | |
| 344 | 344 | static apexc_regs apexc; |
| 345 | 345 | |
| 346 | int apexc_ICount; | |
| 346 | static int apexc_ICount; | |
| 347 | 347 | |
| 348 | 348 | /* decrement ICount by n */ |
| 349 | 349 | #define DELAY(n) {apexc_ICount -= (n); apexc.current_word = (apexc.current_word + (n)) & 0x1f;} |
| r1355 | r1356 | |
|---|---|---|
| 13 | 13 | from the contents of ML and WS */ |
| 14 | 14 | }; |
| 15 | 15 | |
| 16 | extern int apexc_ICount; | |
| 17 | ||
| 18 | 16 | void apexc_get_info(UINT32 state, cpuinfo *info); |
| 19 | 17 | |
| 20 | 18 | #ifndef SUPPORT_ODD_WORD_SIZES |
| r1355 | r1356 | |
|---|---|---|
| 173 | 173 | |
| 174 | 174 | } I8051; |
| 175 | 175 | |
| 176 | int i8051_icount; | |
| 176 | static int i8051_icount; | |
| 177 | 177 | |
| 178 | 178 | static I8051 i8051; |
| 179 | 179 | static I8051_UART uart; |
| r1355 | r1356 | |
|---|---|---|
| 270 | 270 | The carry flag will be set if the result is > 0x99, but not cleared otherwise */ |
| 271 | 271 | |
| 272 | 272 | UINT16 new_acc = R_ACC & 0xff; |
| 273 | if(GET_AC || ( | |
| 273 | if(GET_AC || (new_acc & 0x0f) > 0x09) | |
| 274 | 274 | new_acc += 0x06; |
| 275 | if(GET_CY || ( | |
| 275 | if(GET_CY || ((new_acc & 0xf0) > 0x90) || (new_acc & ~0xff)) | |
| 276 | 276 | new_acc += 0x60; |
| 277 | 277 | SFR_W(ACC,new_acc&0xff); |
| 278 | 278 | if(new_acc & ~0xff) |
| r1355 | r1356 | |
|---|---|---|
| 93 | 93 | #define TI_FLAG 1 |
| 94 | 94 | #define RI_FLAG 2 |
| 95 | 95 | |
| 96 | extern int i8051_icount; /* cycle count */ | |
| 97 | ||
| 98 | 96 | extern void i8051_init (int index, int clock, const void *config, int (*irqcallback)(int)); /* Initialize save states */ |
| 99 | 97 | extern void i8051_reset (void); /* Reset registers to the initial values */ |
| 100 | 98 | extern void i8051_exit (void); /* Shut down CPU core */ |
| r1355 | r1356 | |
| 125 | 123 | * 8752 Section |
| 126 | 124 | ****************************************************************************/ |
| 127 | 125 | #if (HAS_I8752) |
| 128 | #define i8752_icount i8051_icount | |
| 129 | ||
| 130 | 126 | extern void i8752_init (int index, int clock, const void *config, int (*irqcallback)(int)); /* Initialize save states */ |
| 131 | 127 | extern void i8752_reset (void); /* Reset registers to the initial values */ |
| 132 | 128 | extern void i8752_exit (void); /* Shut down CPU core */ |
| r1355 | r1356 | |
|---|---|---|
| 10 | 10 | extern unsigned dasmr3k(char *,unsigned, UINT32); |
| 11 | 11 | extern unsigned dasmmips3(char *,unsigned, UINT32); |
| 12 | 12 | |
| 13 | struct | |
| 13 | static struct | |
| 14 | 14 | { |
| 15 | 15 | UINT8 id[ 8 ]; |
| 16 | 16 | UINT32 text; /* SCE only */ |
| r1355 | r1356 | |
|---|---|---|
| 118 | 118 | mips->tlb_table = auto_malloc(sizeof(mips->tlb_table[0]) * (1 << (MIPS3_MAX_PADDR_SHIFT - MIPS3_MIN_PAGE_SHIFT))); |
| 119 | 119 | |
| 120 | 120 | /* 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); | |
| 122 | 122 | |
| 123 | 123 | /* reset the state */ |
| 124 | 124 | mips3com_reset(mips); |
| r1355 | r1356 | |
|---|---|---|
| 90 | 90 | |
| 91 | 91 | f3853.priority_line=FALSE; |
| 92 | 92 | f3853.external_interrupt_line=TRUE; |
| 93 | f3853.timer = timer_alloc(f3853_timer_callback); | |
| 93 | f3853.timer = timer_alloc(f3853_timer_callback, NULL); | |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | void f3853_reset(void) |
| r1355 | r1356 | |
|---|---|---|
| 1284 | 1284 | I.irq_callback = irqcallback; |
| 1285 | 1285 | |
| 1286 | 1286 | #if (TMS99XX_MODEL == TMS9995_ID) |
| 1287 | I.timer = timer_alloc(decrementer_callback); | |
| 1287 | I.timer = timer_alloc(decrementer_callback, NULL); | |
| 1288 | 1288 | #endif |
| 1289 | 1289 | |
| 1290 | 1290 | I.idle_callback = param ? param->idle_callback : NULL; |
| r1355 | r1356 | |
| 1864 | 1864 | { /* decrement, then interrupt if reach 0 */ |
| 1865 | 1865 | if ((-- I.decrementer_count) == 0) |
| 1866 | 1866 | { |
| 1867 | decrementer_callback(Machine, 0); | |
| 1867 | decrementer_callback(Machine, NULL, 0); | |
| 1868 | 1868 | I.decrementer_count = I.decrementer_interval; /* reload */ |
| 1869 | 1869 | } |
| 1870 | 1870 | } |
| r1355 | r1356 | |
|---|---|---|
| 34 | 34 | |
| 35 | 35 | static v810info v810; |
| 36 | 36 | |
| 37 | int v810_ICount; | |
| 37 | static int v810_ICount; | |
| 38 | 38 | |
| 39 | 39 | #define R0 v810.reg[0] |
| 40 | 40 | #define R1 v810.reg[1] |
| r1355 | r1356 | |
|---|---|---|
| 3 | 3 | |
| 4 | 4 | #include "cpuintrf.h" |
| 5 | 5 | |
| 6 | extern int v810_ICount; | |
| 7 | ||
| 8 | 6 | void v810_get_info(UINT32, cpuinfo*); |
| 9 | 7 | |
| 10 | 8 | #define R_B(addr) (program_read_byte_32le(addr)) |
| r1355 | r1356 | |
|---|---|---|
| 83 | 83 | extern void m6803_get_info(UINT32 state, cpuinfo *info); |
| 84 | 84 | #endif |
| 85 | 85 | |
| 86 | #if (HAS_M6803||HAS_HD63701) | |
| 86 | #if (HAS_M6801||HAS_M6803||HAS_HD63701) | |
| 87 | 87 | /* By default, on a port write port bits which are not set as output in the DDR */ |
| 88 | 88 | /* are set to the value returned by a read from the same port. If you need to */ |
| 89 | 89 | /* know the DDR for e.g. port 1, do m6803_internal_registers_r(M6801_DDR1) */ |
| r1355 | r1356 | |
|---|---|---|
| 610 | 610 | /* include the opcode functions */ |
| 611 | 611 | #include "6800ops.c" |
| 612 | 612 | |
| 613 | #if (HAS_M6801||HAS_M6803||HAS_HD63701) | |
| 613 | 614 | static void m6800_tx(int value) |
| 614 | 615 | { |
| 615 | 616 | m6800.port2_data = (m6800.port2_data & 0xef) | (value << 4); |
| r1355 | r1356 | |
| 804 | 805 | } |
| 805 | 806 | } |
| 806 | 807 | } |
| 808 | #endif | |
| 807 | 809 | |
| 808 | 810 | /**************************************************************************** |
| 809 | 811 | * Reset registers to their initial values |
| r1355 | r1356 | |
| 1274 | 1276 | m6800.irq_callback = irqcallback; |
| 1275 | 1277 | |
| 1276 | 1278 | 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); | |
| 1279 | 1281 | |
| 1280 | 1282 | state_register("m6801", index); |
| 1281 | 1283 | } |
| r1355 | r1356 | |
| 1307 | 1309 | m6800.irq_callback = irqcallback; |
| 1308 | 1310 | |
| 1309 | 1311 | 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); | |
| 1312 | 1314 | |
| 1313 | 1315 | state_register("m6803", index); |
| 1314 | 1316 | } |
| r1355 | r1356 | |
| 1650 | 1652 | m6800.irq_callback = irqcallback; |
| 1651 | 1653 | |
| 1652 | 1654 | 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); | |
| 1655 | 1657 | |
| 1656 | 1658 | state_register("hd63701", index); |
| 1657 | 1659 | } |
| r1355 | r1356 | |
|---|---|---|
| 32 | 32 | #define CP1610_RESET 2 /* Non-Maskable */ |
| 33 | 33 | #define CP1610_INT_INTR INPUT_LINE_NMI /* Non-Maskable */ |
| 34 | 34 | |
| 35 | extern int cp1610_icount; /* cycle count */ | |
| 36 | 35 | |
| 37 | ||
| 38 | 36 | void cp1610_get_info(UINT32 state, cpuinfo *info); |
| 39 | 37 | |
| 40 | 38 | #ifdef MAME_DEBUG |
| r1355 | r1356 | |
|---|---|---|
| 46 | 46 | int mask_interrupts; |
| 47 | 47 | } cp1610_Regs; |
| 48 | 48 | |
| 49 | int cp1610_icount; | |
| 49 | static int cp1610_icount; | |
| 50 | 50 | |
| 51 | 51 | static cp1610_Regs cp1610; |
| 52 | 52 |
| r1355 | r1356 | |
|---|---|---|
| 26 | 26 | * |
| 27 | 27 | *************************************/ |
| 28 | 28 | |
| 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 */ | |
| 29 | enum | |
| 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 | }; | |
| 34 | 37 | |
| 35 | 38 | |
| 36 | 39 |
| r1355 | r1356 | |
|---|---|---|
| 85 | 85 | |
| 86 | 86 | INLINE void latch_w(int which, UINT16 value) |
| 87 | 87 | { |
| 88 | timer_call_after_resynch(which | (value << 8), latch_callback); | |
| 88 | timer_call_after_resynch(NULL, which | (value << 8), latch_callback); | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 |
| r1355 | r1356 | |
|---|---|---|
| 33 | 33 | |
| 34 | 34 | #ifndef __x86_64__ |
| 35 | 35 | #define mul_32x32 _mul_32x32 |
| 36 | INLINE INT64 _mul_32x32(INT32 a, INT32 b) | |
| 36 | INLINE INT64 __attribute__((const, always_inline)) | |
| 37 | _mul_32x32(INT32 a, INT32 b) | |
| 37 | 38 | { |
| 38 | INT64 result; | |
| 39 | register INT64 result; | |
| 39 | 40 | |
| 40 | 41 | __asm__ ( |
| 41 | 42 | " imull %[b] ;" |
| r1355 | r1356 | |
| 58 | 59 | |
| 59 | 60 | #ifndef __x86_64__ |
| 60 | 61 | #define mulu_32x32 _mulu_32x32 |
| 61 | INLINE UINT64 _mulu_32x32(UINT32 a, UINT32 b) | |
| 62 | INLINE UINT64 __attribute__((const, always_inline)) | |
| 63 | _mulu_32x32(UINT32 a, UINT32 b) | |
| 62 | 64 | { |
| 63 | UINT64 result; | |
| 65 | register UINT64 result; | |
| 64 | 66 | |
| 65 | 67 | __asm__ ( |
| 66 | 68 | " mull %[b] ;" |
| r1355 | r1356 | |
| 82 | 84 | -------------------------------------------------*/ |
| 83 | 85 | |
| 84 | 86 | #define mul_32x32_hi _mul_32x32_hi |
| 85 | INLINE INT32 _mul_32x32_hi(INT32 a, INT32 b) | |
| 87 | INLINE INT32 __attribute__((const, always_inline)) | |
| 88 | _mul_32x32_hi(INT32 a, INT32 b) | |
| 86 | 89 | { |
| 87 | INT32 result; | |
| 90 | register INT32 result; | |
| 88 | 91 | |
| 89 | 92 | __asm__ ( |
| 90 | 93 | " imull %[b] ;" |
| r1355 | r1356 | |
| 105 | 108 | -------------------------------------------------*/ |
| 106 | 109 | |
| 107 | 110 | #define mulu_32x32_hi _mulu_32x32_hi |
| 108 | INLINE UINT32 _mulu_32x32_hi(UINT32 a, UINT32 b) | |
| 111 | INLINE UINT32 __attribute__((const, always_inline)) | |
| 112 | _mulu_32x32_hi(UINT32 a, UINT32 b) | |
| 109 | 113 | { |
| 110 | UINT32 result; | |
| 114 | register UINT32 result; | |
| 111 | 115 | |
| 112 | 116 | __asm__ ( |
| 113 | 117 | " mull %[b] ;" |
| r1355 | r1356 | |
| 130 | 134 | |
| 131 | 135 | #ifndef __x86_64__ |
| 132 | 136 | #define mul_32x32_shift _mul_32x32_shift |
| 133 | INLINE INT32 _mul_32x32_shift(INT32 a, INT32 b, UINT8 shift) | |
| 137 | INLINE INT32 __attribute__((const, always_inline)) | |
| 138 | _mul_32x32_shift(INT32 a, INT32 b, UINT8 shift) | |
| 134 | 139 | { |
| 135 | INT32 result; | |
| 140 | register INT32 result; | |
| 136 | 141 | |
| 142 | /* Valid for (0 <= shift <= 31) */ | |
| 137 | 143 | __asm__ ( |
| 138 | 144 | " imull %[b] ;" |
| 139 | 145 | " shrdl %[shift], %%edx, %[result] ;" |
| r1355 | r1356 | |
| 158 | 164 | |
| 159 | 165 | #ifndef __x86_64__ |
| 160 | 166 | #define mulu_32x32_shift _mulu_32x32_shift |
| 161 | INLINE UINT32 _mulu_32x32_shift(UINT32 a, UINT32 b, UINT8 shift) | |
| 167 | INLINE UINT32 __attribute__((const, always_inline)) | |
| 168 | _mulu_32x32_shift(UINT32 a, UINT32 b, UINT8 shift) | |
| 162 | 169 | { |
| 163 | UINT32 result; | |
| 170 | register UINT32 result; | |
| 164 | 171 | |
| 172 | /* Valid for (0 <= shift <= 31) */ | |
| 165 | 173 | __asm__ ( |
| 166 | 174 | " mull %[b] ;" |
| 167 | 175 | " shrdl %[shift], %%edx, %[result] ;" |
| r1355 | r1356 | |
| 184 | 192 | |
| 185 | 193 | #ifndef __x86_64__ |
| 186 | 194 | #define div_64x32 _div_64x32 |
| 187 | INLINE INT32 _div_64x32(INT64 a, INT32 b) | |
| 195 | INLINE INT32 __attribute__((const, always_inline)) | |
| 196 | _div_64x32(INT64 a, INT32 b) | |
| 188 | 197 | { |
| 189 | INT32 result, temp; | |
| 198 | register INT32 result, temp; | |
| 190 | 199 | |
| 200 | /* Throws arithmetic exception if result doesn't fit in 32 bits */ | |
| 191 | 201 | __asm__ ( |
| 192 | 202 | " idivl %[b] ;" |
| 193 | 203 | : [result] "=a" (result) /* Result ends up in eax */ |
| r1355 | r1356 | |
| 209 | 219 | |
| 210 | 220 | #ifndef __x86_64__ |
| 211 | 221 | #define divu_64x32 _divu_64x32 |
| 212 | INLINE UINT32 _divu_64x32(UINT64 a, UINT32 b) | |
| 222 | INLINE UINT32 __attribute__((const, always_inline)) | |
| 223 | _divu_64x32(UINT64 a, UINT32 b) | |
| 213 | 224 | { |
| 214 | UINT32 result, temp; | |
| 225 | register UINT32 result, temp; | |
| 215 | 226 | |
| 227 | /* Throws arithmetic exception if result doesn't fit in 32 bits */ | |
| 216 | 228 | __asm__ ( |
| 217 | 229 | " divl %[b] ;" |
| 218 | 230 | : [result] "=a" (result) /* Result ends up in eax */ |
| r1355 | r1356 | |
| 235 | 247 | |
| 236 | 248 | #ifndef __x86_64__ |
| 237 | 249 | #define div_64x32_rem _div_64x32_rem |
| 238 | INLINE INT32 _div_64x32_rem(INT64 dividend, INT32 divisor, INT32 *remainder) | |
| 250 | INLINE INT32 __attribute__((always_inline)) | |
| 251 | _div_64x32_rem(INT64 dividend, INT32 divisor, INT32 *remainder) | |
| 239 | 252 | { |
| 240 | INT32 quotient; | |
| 253 | register INT32 quotient; | |
| 241 | 254 | |
| 255 | /* Throws arithmetic exception if result doesn't fit in 32 bits */ | |
| 242 | 256 | __asm__ ( |
| 243 | 257 | " idivl %[divisor] ;" |
| 244 | 258 | : [result] "=a" (quotient) /* Quotient ends up in eax */ |
| r1355 | r1356 | |
| 261 | 275 | |
| 262 | 276 | #ifndef __x86_64__ |
| 263 | 277 | #define divu_64x32_rem _divu_64x32_rem |
| 264 | INLINE UINT32 _divu_64x32_rem(UINT64 dividend, UINT32 divisor, UINT32 *remainder) | |
| 278 | INLINE UINT32 __attribute__((always_inline)) | |
| 279 | _divu_64x32_rem(UINT64 dividend, UINT32 divisor, UINT32 *remainder) | |
| 265 | 280 | { |
| 266 | UINT32 quotient; | |
| 281 | register UINT32 quotient; | |
| 267 | 282 | |
| 283 | /* Throws arithmetic exception if result doesn't fit in 32 bits */ | |
| 268 | 284 | __asm__ ( |
| 269 | 285 | " divl %[divisor] ;" |
| 270 | 286 | : [result] "=a" (quotient) /* Quotient ends up in eax */ |
| r1355 | r1356 | |
| 287 | 303 | |
| 288 | 304 | #ifndef __x86_64__ |
| 289 | 305 | #define div_32x32_shift _div_32x32_shift |
| 290 | INLINE INT32 _div_32x32_shift(INT32 a, INT32 b, UINT8 shift) | |
| 306 | INLINE INT32 __attribute__((const, always_inline)) | |
| 307 | _div_32x32_shift(INT32 a, INT32 b, UINT8 shift) | |
| 291 | 308 | { |
| 292 | INT32 result; | |
| 309 | register INT32 result; | |
| 293 | 310 | |
| 311 | /* Valid for (0 <= shift <= 31) */ | |
| 312 | /* Throws arithmetic exception if result doesn't fit in 32 bits */ | |
| 294 | 313 | __asm__ ( |
| 295 | 314 | " cdq ;" |
| 296 | 315 | " shldl %[shift], %[a], %%edx ;" |
| r1355 | r1356 | |
| 316 | 335 | |
| 317 | 336 | #ifndef __x86_64__ |
| 318 | 337 | #define divu_32x32_shift _divu_32x32_shift |
| 319 | INLINE UINT32 _divu_32x32_shift(UINT32 a, UINT32 b, UINT8 shift) | |
| 338 | INLINE UINT32 __attribute__((const, always_inline)) | |
| 339 | _divu_32x32_shift(UINT32 a, UINT32 b, UINT8 shift) | |
| 320 | 340 | { |
| 321 | INT32 result; | |
| 341 | register INT32 result; | |
| 322 | 342 | |
| 343 | /* Valid for (0 <= shift <= 31) */ | |
| 344 | /* Throws arithmetic exception if result doesn't fit in 32 bits */ | |
| 323 | 345 | __asm__ ( |
| 324 | 346 | " clr %%edx ;" |
| 325 | 347 | " shldl %[shift], %[a], %%edx ;" |
| r1355 | r1356 | |
| 344 | 366 | |
| 345 | 367 | #ifndef __x86_64__ |
| 346 | 368 | #define mod_64x32 _mod_64x32 |
| 347 | INLINE INT32 _mod_64x32(INT64 a, INT32 b) | |
| 369 | INLINE INT32 __attribute__((const, always_inline)) | |
| 370 | _mod_64x32(INT64 a, INT32 b) | |
| 348 | 371 | { |
| 349 | INT32 result, temp; | |
| 372 | register INT32 result, temp; | |
| 350 | 373 | |
| 374 | /* Throws arithmetic exception if quotient doesn't fit in 32 bits */ | |
| 351 | 375 | __asm__ ( |
| 352 | 376 | " idivl %[b] ;" |
| 353 | 377 | : [result] "=d" (result) /* Result ends up in edx */ |
| r1355 | r1356 | |
| 369 | 393 | |
| 370 | 394 | #ifndef __x86_64__ |
| 371 | 395 | #define modu_64x32 _modu_64x32 |
| 372 | INLINE UINT32 _modu_64x32(UINT64 a, UINT32 b) | |
| 396 | INLINE UINT32 __attribute__((const, always_inline)) | |
| 397 | _modu_64x32(UINT64 a, UINT32 b) | |
| 373 | 398 | { |
| 374 | UINT32 result, temp; | |
| 399 | register UINT32 result, temp; | |
| 375 | 400 | |
| 401 | /* Throws arithmetic exception if quotient doesn't fit in 32 bits */ | |
| 376 | 402 | __asm__ ( |
| 377 | 403 | " divl %[b] ;" |
| 378 | 404 | : [result] "=d" (result) /* Result ends up in edx */ |
| r1355 | r1356 | |
| 394 | 420 | |
| 395 | 421 | #ifdef __SSE2__ |
| 396 | 422 | #define recip_approx _recip_approx |
| 397 | INLINE float _recip_approx(float value) | |
| 423 | INLINE float __attribute__((const)) | |
| 424 | _recip_approx(float value) | |
| 398 | 425 | { |
| 399 | 426 | __m128 value_xmm = _mm_set_ss(value); |
| 400 | 427 | __m128 result_xmm = _mm_rcp_ss(value_xmm); |
| r1355 | r1356 | |
| 416 | 443 | -------------------------------------------------*/ |
| 417 | 444 | |
| 418 | 445 | #define count_leading_zeros _count_leading_zeros |
| 419 | INLINE UINT8 _count_leading_zeros(UINT32 value) | |
| 446 | INLINE UINT8 __attribute__((const, always_inline)) | |
| 447 | _count_leading_zeros(UINT32 value) | |
| 420 | 448 | { |
| 421 | UINT32 result; | |
| 449 | register UINT32 result; | |
| 422 | 450 | |
| 423 | 451 | __asm__ ( |
| 424 | 452 | " bsrl %[value], %[result] ;" |
| r1355 | r1356 | |
| 440 | 468 | -------------------------------------------------*/ |
| 441 | 469 | |
| 442 | 470 | #define count_leading_ones _count_leading_ones |
| 443 | INLINE UINT8 _count_leading_ones(UINT32 value) | |
| 471 | INLINE UINT8 __attribute__((const, always_inline)) | |
| 472 | _count_leading_ones(UINT32 value) | |
| 444 | 473 | { |
| 445 | UINT32 result; | |
| 474 | register UINT32 result; | |
| 446 | 475 | |
| 447 | 476 | __asm__ ( |
| 448 | 477 | " movl %[value], %[result] ;" |
| r1355 | r1356 | |
| 473 | 502 | -------------------------------------------------*/ |
| 474 | 503 | |
| 475 | 504 | #define compare_exchange32 _compare_exchange32 |
| 476 | INLINE INT32 _compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange) | |
| 505 | INLINE INT32 __attribute__((nonnull(1), always_inline)) | |
| 506 | _compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange) | |
| 477 | 507 | { |
| 478 | 508 | register INT32 result; |
| 479 | 509 | |
| 480 | 510 | __asm__ __volatile__ ( |
| 481 | " lock ; cmpxchg %[exchange], %[ptr] ;" | |
| 511 | " lock ; cmpxchgl %[exchange], %[ptr] ;" | |
| 482 | 512 | : [ptr] "+m" (*ptr) |
| 483 | 513 | , [result] "=a" (result) |
| 484 | 514 | : [compare] "1" (compare) |
| r1355 | r1356 | |
| 499 | 529 | |
| 500 | 530 | #ifdef __x86_64__ |
| 501 | 531 | #define compare_exchange64 _compare_exchange64 |
| 502 | INLINE INT64 _compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange) | |
| 532 | INLINE INT64 __attribute__((nonnull(1), always_inline)) | |
| 533 | _compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange) | |
| 503 | 534 | { |
| 504 | 535 | register INT64 result; |
| 505 | 536 | |
| 506 | 537 | __asm__ __volatile__ ( |
| 507 | " lock ; cmpxchg %[exchange], %[ptr] ;" | |
| 538 | " lock ; cmpxchgq %[exchange], %[ptr] ;" | |
| 508 | 539 | : [ptr] "+m" (*ptr) |
| 509 | 540 | , [result] "=a" (result) |
| 510 | 541 | : [compare] "1" (compare) |
| r1355 | r1356 | |
| 524 | 555 | -------------------------------------------------*/ |
| 525 | 556 | |
| 526 | 557 | #define atomic_exchange32 _atomic_exchange32 |
| 527 | INLINE INT32 _atomic_exchange32(INT32 volatile *ptr, INT32 exchange) | |
| 558 | INLINE INT32 __attribute__((nonnull(1), always_inline)) | |
| 559 | _atomic_exchange32(INT32 volatile *ptr, INT32 exchange) | |
| 528 | 560 | { |
| 529 | 561 | register INT32 result; |
| 530 | 562 | |
| 531 | 563 | __asm__ __volatile__ ( |
| 532 | " lock ; xchg %[exchange], %[ptr] ;" | |
| 564 | " lock ; xchgl %[exchange], %[ptr] ;" | |
| 533 | 565 | : [ptr] "+m" (*ptr) |
| 534 | 566 | , [result] "=r" (result) |
| 535 | 567 | : [exchange] "1" (exchange) |
| r1355 | r1356 | |
| 546 | 578 | -------------------------------------------------*/ |
| 547 | 579 | |
| 548 | 580 | #define atomic_add32 _atomic_add32 |
| 549 | INLINE INT32 _atomic_add32(INT32 volatile *ptr, INT32 delta) | |
| 581 | INLINE INT32 __attribute__((nonnull(1), always_inline)) | |
| 582 | _atomic_add32(INT32 volatile *ptr, INT32 delta) | |
| 550 | 583 | { |
| 551 | 584 | register INT32 result = delta; |
| 552 | 585 | |
| 553 | 586 | __asm__ __volatile__ ( |
| 554 | " lock ; xadd %[result], %[ptr] ;" | |
| 587 | " lock ; xaddl %[result], %[ptr] ;" | |
| 555 | 588 | : [ptr] "+m" (*ptr) |
| 556 | 589 | , [result] "+r" (result) |
| 557 | 590 | : |
| r1355 | r1356 | |
| 569 | 602 | -------------------------------------------------*/ |
| 570 | 603 | |
| 571 | 604 | #define atomic_increment32 _atomic_increment32 |
| 572 | INLINE INT32 _atomic_increment32(INT32 volatile *ptr) | |
| 605 | INLINE INT32 __attribute__((nonnull(1), always_inline)) | |
| 606 | _atomic_increment32(INT32 volatile *ptr) | |
| 573 | 607 | { |
| 574 | 608 | register INT32 result = 1; |
| 575 | 609 | |
| 576 | 610 | __asm__ __volatile__ ( |
| 577 | " lock ; xadd %[result], %[ptr] ;" | |
| 611 | " lock ; xaddl %[result], %[ptr] ;" | |
| 578 | 612 | : [ptr] "+m" (*ptr) |
| 579 | 613 | , [result] "+r" (result) |
| 580 | 614 | : |
| r1355 | r1356 | |
| 592 | 626 | -------------------------------------------------*/ |
| 593 | 627 | |
| 594 | 628 | #define atomic_decrement32 _atomic_decrement32 |
| 595 | INLINE INT32 _atomic_decrement32(INT32 volatile *ptr) | |
| 629 | INLINE INT32 __attribute__((nonnull(1), always_inline)) | |
| 630 | _atomic_decrement32(INT32 volatile *ptr) | |
| 596 | 631 | { |
| 597 | 632 | register INT32 result = -1; |
| 598 | 633 | |
| 599 | 634 | __asm__ __volatile__ ( |
| 600 | " lock ; xadd %[result], %[ptr] ;" | |
| 635 | " lock ; xaddl %[result], %[ptr] ;" | |
| 601 | 636 | : [ptr] "+m" (*ptr) |
| 602 | 637 | , [result] "+r" (result) |
| 603 | 638 | : |
| r1355 | r1356 | |
|---|---|---|
| 117 | 117 | tms34061.regs[TMS34061_VERCOUNTER] = 0x0000; |
| 118 | 118 | |
| 119 | 119 | /* start vertical interrupt timer */ |
| 120 | tms34061.timer = timer_alloc(tms34061_interrupt); | |
| 120 | tms34061.timer = timer_alloc(tms34061_interrupt, NULL); | |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 |
| r1355 | r1356 | |
|---|---|---|
| 199 | 199 | static void soft_reset(voodoo_state *v); |
| 200 | 200 | static void check_stalled_cpu(voodoo_state *v, attotime current_time); |
| 201 | 201 | static void flush_fifos(voodoo_state *v, attotime current_time); |
| 202 | static TIMER_CALLBACK | |
| 202 | static TIMER_CALLBACK | |
| 203 | 203 | static void stall_cpu(voodoo_state *v, int state, attotime current_time); |
| 204 | static TIMER_CALLBACK | |
| 204 | static TIMER_CALLBACK | |
| 205 | 205 | static INT32 register_w(voodoo_state *v, offs_t offset, UINT32 data); |
| 206 | 206 | static INT32 lfb_w(voodoo_state *v, offs_t offset, UINT32 data, UINT32 mem_mask, int forcefront); |
| 207 | 207 | static INT32 texture_w(voodoo_state *v, offs_t offset, UINT32 data); |
| r1355 | r1356 | |
| 380 | 380 | v->pci.fifo.size = 64*2; |
| 381 | 381 | v->pci.fifo.in = v->pci.fifo.out = 0; |
| 382 | 382 | v->pci.stall_state = NOT_STALLED; |
| 383 | v->pci.continue_timer = timer_alloc | |
| 383 | v->pci.continue_timer = timer_alloc | |
| 384 | 384 | |
| 385 | 385 | /* allocate memory */ |
| 386 | 386 | if (type <= VOODOO_2) |
| r1355 | r1356 | |
| 803 | 803 | } |
| 804 | 804 | |
| 805 | 805 | /* allocate a VBLANK timer */ |
| 806 | f->vblank_timer = timer_alloc | |
| 806 | f->vblank_timer = timer_alloc | |
| 807 | 807 | f->vblank = FALSE; |
| 808 | 808 | |
| 809 | 809 | /* initialize the memory FIFO */ |
| r1355 | r1356 | |
| 1087 | 1087 | /* if zero, adjust to next frame, otherwise we may get stuck in an infinite loop */ |
| 1088 | 1088 | if (attotime_compare(vblank_period, attotime_zero) == 0) |
| 1089 | 1089 | vblank_period = video_screen_get_frame_period(v->scrnum); |
| 1090 | timer_adjust | |
| 1090 | timer_adjust | |
| 1091 | 1091 | } |
| 1092 | 1092 | |
| 1093 | 1093 | |
| 1094 | static TIMER_CALLBACK | |
| 1094 | static TIMER_CALLBACK | |
| 1095 | 1095 | { |
| 1096 | voodoo_state *v = p | |
| 1096 | voodoo_state *v = ptr | |
| 1097 | 1097 | |
| 1098 | 1098 | if (LOG_VBLANK_SWAP) logerror("--- vblank end\n"); |
| 1099 | 1099 | |
| r1355 | r1356 | |
| 1107 | 1107 | } |
| 1108 | 1108 | |
| 1109 | 1109 | |
| 1110 | static TIMER_CALLBACK | |
| 1110 | static TIMER_CALLBACK | |
| 1111 | 1111 | { |
| 1112 | voodoo_state *v = p | |
| 1112 | voodoo_state *v = ptr | |
| 1113 | 1113 | |
| 1114 | 1114 | if (LOG_VBLANK_SWAP) logerror("--- vblank start\n"); |
| 1115 | 1115 | |
| r1355 | r1356 | |
| 1135 | 1135 | swap_buffers(v); |
| 1136 | 1136 | |
| 1137 | 1137 | /* set a timer for the next off state */ |
| 1138 | timer_set | |
| 1138 | timer_set | |
| 1139 | 1139 | |
| 1140 | 1140 | /* set internal state and call the client */ |
| 1141 | 1141 | v->fbi.vblank = TRUE; |
| r1355 | r1356 | |
| 2139 | 2139 | * |
| 2140 | 2140 | *************************************/ |
| 2141 | 2141 | |
| 2142 | static TIMER_CALLBACK | |
| 2142 | static TIMER_CALLBACK | |
| 2143 | 2143 | { |
| 2144 | check_stalled_cpu(p | |
| 2144 | check_stalled_cpu(ptr | |
| 2145 | 2145 | } |
| 2146 | 2146 | |
| 2147 | 2147 | |
| r1355 | r1356 | |
| 2194 | 2194 | /* if not, set a timer for the next one */ |
| 2195 | 2195 | else |
| 2196 | 2196 | { |
| 2197 | timer_adjust | |
| 2197 | timer_adjust | |
| 2198 | 2198 | } |
| 2199 | 2199 | } |
| 2200 | 2200 | |
| r1355 | r1356 | |
| 2215 | 2215 | cpu_spinuntil_trigger(v->trigger); |
| 2216 | 2216 | |
| 2217 | 2217 | /* set a timer to clear the stall */ |
| 2218 | timer_adjust | |
| 2218 | timer_adjust | |
| 2219 | 2219 | } |
| 2220 | 2220 | |
| 2221 | 2221 |
| r1355 | r1356 | |
|---|---|---|
| 12 | 12 | #ifndef __RGBVMX__ |
| 13 | 13 | #define __RGBVMX__ |
| 14 | 14 | |
| 15 | #ifndef __APPLE_ALTIVEC__ | |
| 15 | 16 | #include <altivec.h> |
| 17 | #endif | |
| 16 | 18 | |
| 17 | 19 | |
| 18 | 20 | /*************************************************************************** |
| r1355 | r1356 | |
|---|---|---|
| 54 | 54 | static void crtc6845_state_save_postload(void *param); |
| 55 | 55 | static void configure_screen(crtc6845_state *chip, int postload); |
| 56 | 56 | static void update_timer(crtc6845_state *chip); |
| 57 | static TIMER_CALLBACK | |
| 57 | static TIMER_CALLBACK | |
| 58 | 58 | |
| 59 | 59 | |
| 60 | 60 | void crtc6845_init(void) |
| r1355 | r1356 | |
| 98 | 98 | /* create the timer if the user is interested in getting display enable |
| 99 | 99 | notifications */ |
| 100 | 100 | if (intf->display_enable_changed) |
| 101 | chip->display_enable_changed_timer = timer_alloc | |
| 101 | chip->display_enable_changed_timer = timer_alloc | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | |
| r1355 | r1356 | |
| 334 | 334 | else |
| 335 | 335 | duration = attotime_never; |
| 336 | 336 | |
| 337 | timer_adjust | |
| 337 | timer_adjust | |
| 338 | 338 | } |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | |
| 342 | static TIMER_CALLBACK | |
| 342 | static TIMER_CALLBACK | |
| 343 | 343 | { |
| 344 | crtc6845_state *chip = p | |
| 344 | crtc6845_state *chip = ptr | |
| 345 | 345 | |
| 346 | 346 | /* call the callback function -- we know it exists */ |
| 347 | 347 | chip->intf->display_enable_changed(is_display_enabled(chip)); |
| r1355 | r1356 | |
|---|---|---|
| 229 | 229 | { |
| 230 | 230 | int num = 0; |
| 231 | 231 | |
| 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++; | |
| 234 | 234 | |
| 235 | 235 | return num; |
| 236 | 236 | } |
| r1355 | r1356 | |
|---|---|---|
| 301 | 301 | internal_screen_info *info = &viddata->scrinfo[scrnum]; |
| 302 | 302 | |
| 303 | 303 | /* allocate a timer to reset partial updates */ |
| 304 | info->scanline0_timer = timer_alloc(scanline0_callback); | |
| 304 | info->scanline0_timer = timer_alloc(scanline0_callback, NULL); | |
| 305 | 305 | |
| 306 | 306 | /* make pointers back to the config and state */ |
| 307 | 307 | info->config = &machine->drv->screen[scrnum]; |
| r1355 | r1356 | |
| 1017 | 1017 | operations |
| 1018 | 1018 | -------------------------------------------------*/ |
| 1019 | 1019 | |
| 1020 | void video_frame_update( | |
| 1020 | void video_frame_update( | |
| 1021 | 1021 | { |
| 1022 | 1022 | attotime current_time = timer_get_time(); |
| 1023 | 1023 | int skipped_it = global.skipping_this_frame; |
| r1355 | r1356 | |
| 1027 | 1027 | #ifdef MAME_DEBUG |
| 1028 | 1028 | if (phase == MAME_PHASE_RUNNING) |
| 1029 | 1029 | #else |
| 1030 | if (phase == MAME_PHASE_RUNNING && !mame_is_paused(Machine)) | |
| 1030 | if (phase == MAME_PHASE_RUNNING && (debug || !mame_is_paused(Machine))) | |
| 1031 | 1031 | #endif |
| 1032 | 1032 | { |
| 1033 | 1033 | int anything_changed = finish_screen_updates(Machine); |
| r1355 | r1356 | |
| 1045 | 1045 | ui_update_and_render(); |
| 1046 | 1046 | |
| 1047 | 1047 | /* if we're throttling, synchronize before rendering */ |
| 1048 | if (!skipped_it && effective_throttle()) | |
| 1048 | if (!debug && !skipped_it && effective_throttle()) | |
| 1049 | 1049 | update_throttle(current_time); |
| 1050 | 1050 | |
| 1051 | 1051 | /* ask the OSD to update */ |
| 1052 | 1052 | profiler_mark(PROFILER_BLIT); |
| 1053 | osd_update(skipped_it); | |
| 1053 | osd_update(!debug && skipped_it); | |
| 1054 | 1054 | profiler_mark(PROFILER_END); |
| 1055 | 1055 | |
| 1056 | 1056 | /* perform tasks for this frame */ |
| 1057 | mame_frame_update(Machine); | |
| 1057 | if (!debug) | |
| 1058 | mame_frame_update(Machine); | |
| 1058 | 1059 | |
| 1059 | 1060 | /* update frameskipping */ |
| 1060 | update_frameskip(); | |
| 1061 | if (!debug) | |
| 1062 | update_frameskip(); | |
| 1061 | 1063 | |
| 1062 | 1064 | /* update speed computations */ |
| 1063 | if (!skipped_it) | |
| 1065 | if (!debug && !skipped_it) | |
| 1064 | 1066 | recompute_speed(current_time); |
| 1065 | 1067 | |
| 1066 | 1068 | /* call the end-of-frame callback */ |
| 1067 | 1069 | if (phase == MAME_PHASE_RUNNING) |
| 1068 | 1070 | { |
| 1069 | 1071 | /* 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); | |
| 1072 | 1074 | |
| 1073 | 1075 | /* otherwise, call the video EOF callback */ |
| 1074 | 1076 | else if (Machine->drv->video_eof != NULL) |
| r1355 | r1356 | |
|---|---|---|
| 595 | 595 | entry = space->readlookup[LEVEL1_INDEX(pc)]; |
| 596 | 596 | if (entry >= SUBTABLE_BASE) |
| 597 | 597 | 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 */ | |
| 598 | 604 | opcode_entry = entry; |
| 599 | 605 | |
| 600 | 606 | /* if we don't map to a bank, see if there are any banks we can map to */ |
| r1355 | r1356 | |
|---|---|---|
| 28 | 28 | #define AUDIT_VALIDATE_FULL (HASH_CRC | HASH_SHA) |
| 29 | 29 | |
| 30 | 30 | /* 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 | |
| 31 | enum | |
| 32 | { | |
| 33 | CORRECT = 0, | |
| 34 | BEST_AVAILABLE, | |
| 35 | INCORRECT, | |
| 36 | NOTFOUND | |
| 37 | }; | |
| 35 | 38 | |
| 36 | 39 | /* image types for audit_record.type */ |
| 37 | #define AUDIT_FILE_ROM 0 | |
| 38 | #define AUDIT_FILE_DISK 1 | |
| 39 | #define AUDIT_FILE_SAMPLE 2 | |
| 40 | enum | |
| 41 | { | |
| 42 | AUDIT_FILE_ROM = 0, | |
| 43 | AUDIT_FILE_DISK, | |
| 44 | AUDIT_FILE_SAMPLE | |
| 45 | }; | |
| 40 | 46 | |
| 41 | 47 | /* 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 | |
| 48 | enum | |
| 49 | { | |
| 50 | AUDIT_STATUS_GOOD = 0, | |
| 51 | AUDIT_STATUS_FOUND_INVALID, | |
| 52 | AUDIT_STATUS_NOT_FOUND, | |
| 53 | AUDIT_STATUS_ERROR | |
| 54 | }; | |
| 46 | 55 | |
| 47 | 56 | /* 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 | |
| 57 | enum | |
| 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 | }; | |
| 59 | 71 | |
| 60 | 72 | |
| 61 | 73 |
| r1355 | r1356 | |
|---|---|---|
| 117 | 117 | /* ----- global rendering ----- */ |
| 118 | 118 | |
| 119 | 119 | /* update the screen, handling frame skipping and rendering */ |
| 120 | void video_frame_update( | |
| 120 | void video_frame_update( | |
| 121 | 121 | |
| 122 | 122 | |
| 123 | 123 | /* ----- throttling/frameskipping/performance ----- */ |
| r1355 | r1356 | |
|---|---|---|
| 158 | 158 | #define AMEF_UNMAP(x) (((x) << AMEF_UNMAP_SHIFT) | AMEF_SPECIFIES_UNMAP) /* specifies a given unmap value */ |
| 159 | 159 | |
| 160 | 160 | /* ----- 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 */ | |
| 161 | enum | |
| 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, | |
| 194 | 196 | /* 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 | }; | |
| 200 | 203 | |
| 201 | 204 | /* ----- banking constants ----- */ |
| 202 | 205 | #define MAX_BANKS 66 /* maximum number of banks */ |
| r1355 | r1356 | |
| 717 | 720 | ***************************************************************************/ |
| 718 | 721 | |
| 719 | 722 | /* ----- 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 */ | |
| 723 | enum | |
| 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 | }; | |
| 724 | 730 | |
| 725 | 731 | extern const char *address_space_names[ADDRESS_SPACES]; |
| 726 | 732 | |
| r1355 | r1356 | |
| 1153 | 1159 | INLINE UINT64 cpu_readop_arg64(offs_t A) { if (address_is_unsafe(A)) { memory_set_opbase(A); } return cpu_readop_arg64_unsafe(A); } |
| 1154 | 1160 | |
| 1155 | 1161 | /* ----- bank switching for CPU cores ----- */ |
| 1156 | #define change_pc(pc) \ | |
| 1157 | do { \ | |
| 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); | |
| 1161 | 1163 | |
| 1162 | 1164 | /* ----- forces the next branch to generate a call to the opbase handler ----- */ |
| 1163 | 1165 | #define catch_nextBranch() (opcode_entry = 0xff) |
| r1355 | r1356 | |
|---|---|---|
| 378 | 378 | begin_resource_tracking(); |
| 379 | 379 | |
| 380 | 380 | /* perform a soft reset -- this takes us to the running phase */ |
| 381 | soft_reset(machine, 0); | |
| 381 | soft_reset(machine, NULL, 0); | |
| 382 | 382 | |
| 383 | 383 | /* run the CPUs until a reset or exit */ |
| 384 | 384 | mame->hard_reset_pending = FALSE; |
| r1355 | r1356 | |
| 392 | 392 | |
| 393 | 393 | /* otherwise, just pump video updates through */ |
| 394 | 394 | else |
| 395 | video_frame_update(); | |
| 395 | video_frame_update(FALSE); | |
| 396 | 396 | |
| 397 | 397 | /* handle save/load */ |
| 398 | 398 | if (mame->saveload_schedule_callback) |
| r1355 | r1356 | |
| 1508 | 1508 | /* initialize the timers and allocate a soft_reset timer */ |
| 1509 | 1509 | /* this must be done before cpu_init so that CPU's can allocate timers */ |
| 1510 | 1510 | timer_init(machine); |
| 1511 | mame->soft_reset_timer = timer_alloc(soft_reset); | |
| 1511 | mame->soft_reset_timer = timer_alloc(soft_reset, NULL); | |
| 1512 | 1512 | |
| 1513 | 1513 | /* init the osd layer */ |
| 1514 | 1514 | osd_init(machine); |
| r1355 | r1356 | |
|---|---|---|
| 23 | 23 | multiply and return the full 64 bit result |
| 24 | 24 | -------------------------------------------------*/ |
| 25 | 25 | |
| 26 | /* | |
| 26 | /* GCC can do a good job of this. */ | |
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | /*------------------------------------------------- |
| r1355 | r1356 | |
| 32 | 32 | result |
| 33 | 33 | -------------------------------------------------*/ |
| 34 | 34 | |
| 35 | /* | |
| 35 | /* GCC can do a good job of this */ | |
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | /*------------------------------------------------- |
| r1355 | r1356 | |
| 42 | 42 | -------------------------------------------------*/ |
| 43 | 43 | |
| 44 | 44 | #define mul_32x32_hi _mul_32x32_hi |
| 45 | INLINE INT32 _mul_32x32_hi(INT32 val1, INT32 val2) | |
| 45 | INLINE INT32 __attribute__((const, always_inline)) | |
| 46 | _mul_32x32_hi(INT32 val1, INT32 val2) | |
| 46 | 47 | { |
| 47 | INT32 result; | |
| 48 | register INT32 result; | |
| 48 | 49 | |
| 49 | 50 | __asm__ ( |
| 50 | 51 | " mulhw %[result], %[val1], %[val2] \n" |
| r1355 | r1356 | |
| 64 | 65 | -------------------------------------------------*/ |
| 65 | 66 | |
| 66 | 67 | #define mulu_32x32_hi _mulu_32x32_hi |
| 67 | INLINE UINT32 _mulu_32x32_hi(UINT32 val1, UINT32 val2) | |
| 68 | INLINE UINT32 __attribute__((const, always_inline)) | |
| 69 | _mulu_32x32_hi(UINT32 val1, UINT32 val2) | |
| 68 | 70 | { |
| 69 | UINT32 result; | |
| 71 | register UINT32 result; | |
| 70 | 72 | |
| 71 | 73 | __asm__ ( |
| 72 | 74 | " mulhwu %[result], %[val1], %[val2] \n" |
| r1355 | r1356 | |
| 88 | 90 | |
| 89 | 91 | #if !defined(__ppc64__) && !defined(__PPC64__) && !defined(_ARCH_PPC64) |
| 90 | 92 | #define mul_32x32_shift _mul_32x32_shift |
| 91 | INLINE INT32 _mul_32x32_shift(INT32 val1, INT32 val2, UINT8 shift) | |
| 93 | INLINE INT32 __attribute__((const, always_inline)) | |
| 94 | _mul_32x32_shift(INT32 val1, INT32 val2, UINT8 shift) | |
| 92 | 95 | { |
| 93 | INT32 result; | |
| 96 | register INT32 result; | |
| 94 | 97 | |
| 98 | /* Valid for (0 <= shift <= 32) */ | |
| 95 | 99 | __asm__ ( |
| 96 | 100 | " mullw %[result], %[val1], %[val2] \n" |
| 97 | 101 | " mulhw %[val1], %[val1], %[val2] \n" |
| r1355 | r1356 | |
| 120 | 124 | |
| 121 | 125 | #if !defined(__ppc64__) && !defined(__PPC64__) && !defined(_ARCH_PPC64) |
| 122 | 126 | #define mulu_32x32_shift _mulu_32x32_shift |
| 123 | INLINE UINT32 _mulu_32x32_shift(UINT32 val1, UINT32 val2, UINT8 shift) | |
| 127 | INLINE UINT32 __attribute__((const, always_inline)) | |
| 128 | _mulu_32x32_shift(UINT32 val1, UINT32 val2, UINT8 shift) | |
| 124 | 129 | { |
| 125 | UINT32 result; | |
| 130 | register UINT32 result; | |
| 126 | 131 | |
| 132 | /* Valid for (0 <= shift <= 32) */ | |
| 127 | 133 | __asm__ ( |
| 128 | 134 | " mullw %[result], %[val1], %[val2] \n" |
| 129 | 135 | " mulhwu %[val1], %[val1], %[val2] \n" |
| r1355 | r1356 | |
| 160 | 166 | |
| 161 | 167 | |
| 162 | 168 | /*------------------------------------------------- |
| 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 | /*------------------------------------------------- | |
| 163 | 187 | div_32x32_shift - perform a signed divide of |
| 164 | 188 | two 32 bit values, shifting the first before |
| 165 | 189 | division, and returning the 32 bit quotient |
| r1355 | r1356 | |
| 199 | 223 | -------------------------------------------------*/ |
| 200 | 224 | |
| 201 | 225 | #define recip_approx _recip_approx |
| 202 | INLINE float _recip_approx(float value) | |
| 226 | INLINE float __attribute__((const, always_inline)) | |
| 227 | _recip_approx(float value) | |
| 203 | 228 | { |
| 204 | float result; | |
| 229 | register float result; | |
| 205 | 230 | |
| 206 | 231 | __asm__ ( |
| 207 | 232 | " fres %[result], %[value] \n" |
| r1355 | r1356 | |
| 224 | 249 | -------------------------------------------------*/ |
| 225 | 250 | |
| 226 | 251 | #define count_leading_zeros _count_leading_zeros |
| 227 | INLINE UINT8 _count_leading_zeros(UINT32 value) | |
| 252 | INLINE UINT8 __attribute__((const, always_inline)) | |
| 253 | _count_leading_zeros(UINT32 value) | |
| 228 | 254 | { |
| 229 | UINT32 result; | |
| 255 | register UINT32 result; | |
| 230 | 256 | |
| 231 | 257 | __asm__ ( |
| 232 | 258 | " cntlzw %[result], %[value] \n" |
| r1355 | r1356 | |
| 244 | 270 | -------------------------------------------------*/ |
| 245 | 271 | |
| 246 | 272 | #define count_leading_ones _count_leading_ones |
| 247 | INLINE UINT8 _count_leading_ones(UINT32 value) | |
| 273 | INLINE UINT8 __attribute__((const, always_inline)) | |
| 274 | _count_leading_ones(UINT32 value) | |
| 248 | 275 | { |
| 249 | UINT32 result; | |
| 276 | register UINT32 result; | |
| 250 | 277 | |
| 251 | 278 | __asm__ ( |
| 252 | 279 | " not %[result], %[value] \n" |
| r1355 | r1356 | |
| 272 | 299 | -------------------------------------------------*/ |
| 273 | 300 | |
| 274 | 301 | #define compare_exchange32 _compare_exchange32 |
| 275 | INLINE INT32 _compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange) | |
| 302 | INLINE INT32 __attribute__((nonnull(1), always_inline)) | |
| 303 | _compare_exchange32(INT32 volatile *ptr, INT32 compare, INT32 exchange) | |
| 276 | 304 | { |
| 277 | 305 | register INT32 result; |
| 278 | 306 | |
| r1355 | r1356 | |
| 284 | 312 | " stwcx. %[exchange], 0, %[ptr] \n" |
| 285 | 313 | " bne- 1b \n" |
| 286 | 314 | "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" | |
| 292 | 321 | ); |
| 293 | 322 | |
| 294 | 323 | return result; |
| r1355 | r1356 | |
| 304 | 333 | |
| 305 | 334 | #if defined(__ppc64__) || defined(__PPC64__) |
| 306 | 335 | #define compare_exchange64 _compare_exchange64 |
| 307 | INLINE INT64 _compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange) | |
| 336 | INLINE INT64 __attribute__((nonnull(1), always_inline)) | |
| 337 | _compare_exchange64(INT64 volatile *ptr, INT64 compare, INT64 exchange) | |
| 308 | 338 | { |
| 309 | 339 | register INT64 result; |
| 310 | 340 | |
| r1355 | r1356 | |
| 315 | 345 | " stdcx. %[exchange], 0, %[ptr] \n" |
| 316 | 346 | " bne-- 1b \n" |
| 317 | 347 | "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" | |
| 323 | 354 | ); |
| 324 | 355 | |
| 325 | 356 | return result; |
| r1355 | r1356 | |
| 334 | 365 | -------------------------------------------------*/ |
| 335 | 366 | |
| 336 | 367 | #define atomic_exchange32 _atomic_exchange32 |
| 337 | INLINE INT32 _atomic_exchange32(INT32 volatile *ptr, INT32 exchange) | |
| 368 | INLINE INT32 __attribute__((nonnull(1), always_inline)) | |
| 369 | _atomic_exchange32(INT32 volatile *ptr, INT32 exchange) | |
| 338 | 370 | { |
| 339 | 371 | register INT32 result; |
| 340 | 372 | |
| r1355 | r1356 | |
| 343 | 375 | " sync \n" |
| 344 | 376 | " stwcx. %[exchange], 0, %[ptr] \n" |
| 345 | 377 | " 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" | |
| 350 | 383 | ); |
| 351 | 384 | |
| 352 | 385 | return result; |
| r1355 | r1356 | |
| 360 | 393 | -------------------------------------------------*/ |
| 361 | 394 | |
| 362 | 395 | #define atomic_add32 _atomic_add32 |
| 363 | INLINE INT32 _atomic_add32(INT32 volatile *ptr, INT32 delta) | |
| 396 | INLINE INT32 __attribute__((nonnull(1), always_inline)) | |
| 397 | _atomic_add32(INT32 volatile *ptr, INT32 delta) | |
| 364 | 398 | { |
| 365 | 399 | register INT32 result; |
| 366 | 400 | |
| r1355 | r1356 | |
| 370 | 404 | " sync \n" |
| 371 | 405 | " stwcx. %[result], 0, %[ptr] \n" |
| 372 | 406 | " 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" | |
| 377 | 412 | ); |
| 378 | 413 | |
| 379 | 414 | return result; |
| r1355 | r1356 | |
| 387 | 422 | -------------------------------------------------*/ |
| 388 | 423 | |
| 389 | 424 | #define atomic_increment32 _atomic_increment32 |
| 390 | INLINE INT32 _atomic_increment32(INT32 volatile *ptr) | |
| 425 | INLINE INT32 __attribute__((nonnull(1), always_inline)) | |
| 426 | _atomic_increment32(INT32 volatile *ptr) | |
| 391 | 427 | { |
| 392 | 428 | register INT32 result; |
| 393 | 429 | |
| r1355 | r1356 | |
| 397 | 433 | " sync \n" |
| 398 | 434 | " stwcx. %[result], 0, %[ptr] \n" |
| 399 | 435 | " 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) | |
| 401 | 438 | : [ptr] "r" (ptr) |
| 402 | 439 | : "cr0" |
| 403 | 440 | ); |
| r1355 | r1356 | |
| 413 | 450 | -------------------------------------------------*/ |
| 414 | 451 | |
| 415 | 452 | #define atomic_decrement32 _atomic_decrement32 |
| 416 | INLINE INT32 _atomic_decrement32(INT32 volatile *ptr) | |
| 453 | INLINE INT32 __attribute__((nonnull(1), always_inline)) | |
| 454 | _atomic_decrement32(INT32 volatile *ptr) | |
| 417 | 455 | { |
| 418 | 456 | register INT32 result; |
| 419 | 457 | |
| r1355 | r1356 | |
| 423 | 461 | " sync \n" |
| 424 | 462 | " stwcx. %[result], 0, %[ptr] \n" |
| 425 | 463 | " 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) | |
| 427 | 466 | : [ptr] "r" (ptr) |
| 428 | 467 | : "cr0" |
| 429 | 468 | ); |
| r1355 | r1356 | |
|---|---|---|
| 34 | 34 | int offset_flags; |
| 35 | 35 | }; |
| 36 | 36 | |
| 37 | struct timekeeper_chip timekeeper[ MAX_TIMEKEEPER_CHIPS ]; | |
| 37 | static struct timekeeper_chip timekeeper[ MAX_TIMEKEEPER_CHIPS ]; | |
| 38 | 38 | |
| 39 | 39 | #define MASK_SECONDS ( 0x7f ) |
| 40 | 40 | #define MASK_MINUTES ( 0x7f ) |
| r1355 | r1356 | |
| 139 | 139 | c->century = counter_from_ram( c->data, c->offset_century ); |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | static TIMER_CALLBACK | |
| 142 | static TIMER_CALLBACK | |
| 143 | 143 | { |
| 144 | struct timekeeper_chip *c = p | |
| 144 | struct timekeeper_chip *c = ptr | |
| 145 | 145 | |
| 146 | 146 | int carry; |
| 147 | 147 | |
| r1355 | r1356 | |
| 300 | 300 | state_save_register_item( "timekeeper", chip, c->century ); |
| 301 | 301 | state_save_register_item_pointer( "timekeeper", chip, c->data, c->size ); |
| 302 | 302 | |
| 303 | timer = timer_alloc | |
| 303 | timer = timer_alloc | |
| 304 | 304 | duration = ATTOTIME_IN_SEC(1); |
| 305 | timer_adjust | |
| 305 | timer_adjust | |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | static void timekeeper_nvram( int chip, mame_file *file, int read_or_write ) |
| r1355 | r1356 | |
|---|---|---|
| 60 | 60 | #define SIZE_READ_PASSWORD ( SIZE_WRITE_BUFFER ) |
| 61 | 61 | #define SIZE_DATA ( 112 ) |
| 62 | 62 | |
| 63 | struct x76f100_chip x76f100[ X76F100_MAXCHIP ]; | |
| 63 | static struct x76f100_chip x76f100[ X76F100_MAXCHIP ]; | |
| 64 | 64 | |
| 65 | 65 | #define COMMAND_WRITE ( 0x80 ) |
| 66 | 66 | #define COMMAND_READ ( 0x81 ) |
| r1355 | r1356 | |
|---|---|---|
| 117 | 117 | * |
| 118 | 118 | *************************************/ |
| 119 | 119 | |
| 120 | static TIMER_CALLBACK | |
| 120 | static TIMER_CALLBACK | |
| 121 | 121 | static void cia_timer_underflow(cia_state *cia, int timer); |
| 122 | 122 | static TIMER_CALLBACK( cia_clock_tod_callback ); |
| 123 | 123 | |
| r1355 | r1356 | |
| 171 | 171 | for (t = 0; t < (sizeof(cia->timer) / sizeof(cia->timer[0])); t++) |
| 172 | 172 | { |
| 173 | 173 | cia_timer *timer = &cia->timer[t]; |
| 174 | timer->timer = timer_alloc | |
| 174 | timer->timer = timer_alloc | |
| 175 | 175 | timer->cia = cia; |
| 176 | 176 | timer->irq = 0x01 << t; |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | /* setup TOD timer, if appropriate */ |
| 180 | 180 | 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); | |
| 182 | 182 | |
| 183 | 183 | /* special case; for the first CIA, set up an exit handler to clear things out */ |
| 184 | 184 | if (which == 0) |
| r1355 | r1356 | |
| 323 | 323 | { |
| 324 | 324 | /* timer is on and is connected to clock */ |
| 325 | 325 | attotime period = attotime_mul(ATTOTIME_IN_HZ(timer->cia->clock), (timer->count ? timer->count : 0x10000)); |
| 326 | timer_adjust | |
| 326 | timer_adjust | |
| 327 | 327 | } |
| 328 | 328 | else |
| 329 | 329 | { |
| 330 | 330 | /* timer is off or not connected to clock */ |
| 331 | timer_adjust | |
| 331 | timer_adjust | |
| 332 | 332 | } |
| 333 | 333 | } |
| 334 | 334 | |
| r1355 | r1356 | |
| 401 | 401 | } |
| 402 | 402 | |
| 403 | 403 | |
| 404 | static TIMER_CALLBACK | |
| 404 | static TIMER_CALLBACK | |
| 405 | 405 | { |
| 406 | cia_timer *timer = p | |
| 406 | cia_timer *timer = ptr | |
| 407 | 407 | cia_state *cia = timer->cia; |
| 408 | 408 | |
| 409 | 409 | cia_timer_underflow(cia, timer - cia->timer); |
| r1355 | r1356 | |
|---|---|---|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | |
| 78 | static TIMER_CALLBACK | |
| 78 | static TIMER_CALLBACK | |
| 79 | 79 | { |
| 80 | TTL74123_state *chip = p | |
| 80 | TTL74123_state *chip = ptr | |
| 81 | 81 | |
| 82 | 82 | set_output(chip); |
| 83 | 83 | } |
| r1355 | r1356 | |
| 96 | 96 | |
| 97 | 97 | chip->intf = intf; |
| 98 | 98 | chip->which = which; |
| 99 | chip->timer = timer_alloc | |
| 99 | chip->timer = timer_alloc | |
| 100 | 100 | |
| 101 | 101 | /* start with the defaults */ |
| 102 | 102 | chip->A = intf->A; |
| r1355 | r1356 | |
| 129 | 129 | |
| 130 | 130 | if (attotime_compare(timer_timeelapsed(chip->timer), delay_time) >= 0) |
| 131 | 131 | { |
| 132 | timer_adjust | |
| 132 | timer_adjust | |
| 133 | 133 | |
| 134 | 134 | if (LOG) logerror("74123 #%d: Retriggering pulse. Duration: %f\n", chip->which, attotime_to_double(duration)); |
| 135 | 135 | } |
| r1355 | r1356 | |
| 141 | 141 | else |
| 142 | 142 | { |
| 143 | 143 | /* starting */ |
| 144 | timer_adjust | |
| 144 | timer_adjust | |
| 145 | 145 | |
| 146 | 146 | set_output(chip); |
| 147 | 147 | |
| r1355 | r1356 | |
| 181 | 181 | /* clear the output if A=LO, B=HI and falling edge on clear */ |
| 182 | 182 | if (!data && chip->clear && chip->B && !chip->A && !chip->clear) |
| 183 | 183 | { |
| 184 | timer_adjust | |
| 184 | timer_adjust | |
| 185 | 185 | |
| 186 | 186 | if (LOG) logerror("74123 #%d: Cleared\n", which); |
| 187 | 187 | } |
| r1355 | r1356 | |
|---|---|---|
| 168 | 168 | acia_p->cts_pin = intf->cts_pin; |
| 169 | 169 | acia_p->rts_pin = intf->rts_pin; |
| 170 | 170 | 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); | |
| 173 | 173 | acia_p->int_callback = intf->int_callback; |
| 174 | 174 | acia_p->first_reset = 1; |
| 175 | 175 | acia_p->status_read = 0; |
| r1355 | r1356 | |
|---|---|---|
| 33 | 33 | |
| 34 | 34 | void mb3773_init( void ) |
| 35 | 35 | { |
| 36 | watchdog_timer = timer_alloc( watchdog_timeout ); | |
| 36 | watchdog_timer = timer_alloc( watchdog_timeout , NULL); | |
| 37 | 37 | reset_timer(); |
| 38 | 38 | state_save_register_global( ck ); |
| 39 | 39 | } |
| r1355 | r1356 | |
|---|---|---|
| 186 | 186 | * |
| 187 | 187 | *************************************/ |
| 188 | 188 | |
| 189 | static TIMER_CALLBACK | |
| 189 | static TIMER_CALLBACK | |
| 190 | 190 | |
| 191 | 191 | static void ide_build_features(struct ide_state *ide); |
| 192 | 192 | |
| 193 | 193 | static void continue_read(struct ide_state *ide); |
| 194 | 194 | static void read_sector_done(struct ide_state *ide); |
| 195 | static TIMER_CALLBACK | |
| 195 | static TIMER_CALLBACK | |
| 196 | 196 | static void read_first_sector(struct ide_state *ide); |
| 197 | 197 | static void read_next_sector(struct ide_state *ide); |
| 198 | 198 | |
| r1355 | r1356 | |
| 237 | 237 | * |
| 238 | 238 | *************************************/ |
| 239 | 239 | |
| 240 | static TIMER_CALLBACK | |
| 240 | static TIMER_CALLBACK | |
| 241 | 241 | { |
| 242 | struct ide_state *ide = p | |
| 242 | struct ide_state *ide = ptr | |
| 243 | 243 | ide->status &= ~IDE_STATUS_BUSY; |
| 244 | 244 | signal_interrupt(ide); |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | |
| 248 | static TIMER_CALLBACK | |
| 248 | static TIMER_CALLBACK | |
| 249 | 249 | { |
| 250 | struct ide_state *ide = p | |
| 250 | struct ide_state *ide = ptr | |
| 251 | 251 | ide->status &= ~IDE_STATUS_BUSY; |
| 252 | 252 | ide->status |= IDE_STATUS_BUFFER_READY; |
| 253 | 253 | signal_interrupt(ide); |
| r1355 | r1356 | |
| 262 | 262 | |
| 263 | 263 | /* set a timer */ |
| 264 | 264 | if (buffer_ready) |
| 265 | timer_set | |
| 265 | timer_set | |
| 266 | 266 | else |
| 267 | timer_set | |
| 267 | timer_set | |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | |
| r1355 | r1356 | |
| 328 | 328 | ide_build_features(ide); |
| 329 | 329 | |
| 330 | 330 | /* 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); | |
| 333 | 333 | |
| 334 | 334 | /* register ide status */ |
| 335 | 335 | state_save_register_item("ide", which, ide->adapter_control); |
| r1355 | r1356 | |
| 432 | 432 | } |
| 433 | 433 | |
| 434 | 434 | |
| 435 | static TIMER_CALLBACK | |
| 435 | static TIMER_CALLBACK | |
| 436 | 436 | { |
| 437 | ide_controller_reset_ptr(p | |
| 437 | ide_controller_reset_ptr(ptr | |
| 438 | 438 | } |
| 439 | 439 | |
| 440 | 440 | |
| r1355 | r1356 | |
| 736 | 736 | * |
| 737 | 737 | *************************************/ |
| 738 | 738 | |
| 739 | static TIMER_CALLBACK | |
| 739 | static TIMER_CALLBACK | |
| 740 | 740 | { |
| 741 | struct ide_state *ide = p | |
| 741 | struct ide_state *ide = ptr | |
| 742 | 742 | |
| 743 | 743 | /* clear error state */ |
| 744 | 744 | ide->status &= ~IDE_STATUS_ERROR; |
| r1355 | r1356 | |
| 752 | 752 | ide->status &= ~IDE_STATUS_DRIVE_READY; |
| 753 | 753 | |
| 754 | 754 | /* just set a timer and mark ourselves error */ |
| 755 | timer_set | |
| 755 | timer_set | |
| 756 | 756 | } |
| 757 | 757 | |
| 758 | 758 | |
| r1355 | r1356 | |
| 904 | 904 | } |
| 905 | 905 | |
| 906 | 906 | |
| 907 | static TIMER_CALLBACK | |
| 907 | static TIMER_CALLBACK | |
| 908 | 908 | { |
| 909 | read_sector_done(p | |
| 909 | read_sector_done(ptr | |
| 910 | 910 | } |
| 911 | 911 | |
| 912 | 912 | |
| r1355 | r1356 | |
| 927 | 927 | seek_time = TIME_SEEK_MULTISECTOR; |
| 928 | 928 | |
| 929 | 929 | ide->cur_lba = new_lba; |
| 930 | timer_set | |
| 930 | timer_set | |
| 931 | 931 | } |
| 932 | 932 | else |
| 933 | timer_set | |
| 933 | timer_set | |
| 934 | 934 | } |
| 935 | 935 | |
| 936 | 936 | |
| r1355 | r1356 | |
| 946 | 946 | read_sector_done(ide); |
| 947 | 947 | else |
| 948 | 948 | /* just set a timer */ |
| 949 | timer_set | |
| 949 | timer_set | |
| 950 | 950 | } |
| 951 | 951 | else |
| 952 | 952 | /* just set a timer */ |
| 953 | timer_set | |
| 953 | timer_set | |
| 954 | 954 | } |
| 955 | 955 | |
| 956 | 956 | |
| r1355 | r1356 | |
| 962 | 962 | *************************************/ |
| 963 | 963 | |
| 964 | 964 | static void write_sector_done(struct ide_state *ide); |
| 965 | static TIMER_CALLBACK | |
| 965 | static TIMER_CALLBACK | |
| 966 | 966 | |
| 967 | 967 | static void continue_write(struct ide_state *ide) |
| 968 | 968 | { |
| r1355 | r1356 | |
| 983 | 983 | else |
| 984 | 984 | { |
| 985 | 985 | /* set a timer to do the write */ |
| 986 | timer_set | |
| 986 | timer_set | |
| 987 | 987 | } |
| 988 | 988 | } |
| 989 | 989 | else |
| 990 | 990 | { |
| 991 | 991 | /* set a timer to do the write */ |
| 992 | timer_set | |
| 992 | timer_set | |
| 993 | 993 | } |
| 994 | 994 | } |
| 995 | 995 | |
| r1355 | r1356 | |
| 1106 | 1106 | } |
| 1107 | 1107 | |
| 1108 | 1108 | |
| 1109 | static TIMER_CALLBACK | |
| 1109 | static TIMER_CALLBACK | |
| 1110 | 1110 | { |
| 1111 | write_sector_done(p | |
| 1111 | write_sector_done(ptr | |
| 1112 | 1112 | } |
| 1113 | 1113 | |
| 1114 | 1114 | |
| r1355 | r1356 | |
| 1563 | 1563 | { |
| 1564 | 1564 | ide->status |= IDE_STATUS_BUSY; |
| 1565 | 1565 | ide->status &= ~IDE_STATUS_DRIVE_READY; |
| 1566 | timer_adjust | |
| 1566 | timer_adjust | |
| 1567 | 1567 | } |
| 1568 | 1568 | break; |
| 1569 | 1569 | } |
| r1355 | r1356 | |
|---|---|---|
| 286 | 286 | |
| 287 | 287 | r6532[which].shift = 10; |
| 288 | 288 | |
| 289 | r6532[which].counter_timer = timer_alloc(r6532_irq_timer_callback); | |
| 289 | r6532[which].counter_timer = timer_alloc(r6532_irq_timer_callback, NULL); | |
| 290 | 290 | |
| 291 | 291 | r6532_set_timer( which, 0xFF ); |
| 292 | 292 |
| r1355 | r1356 | |
|---|---|---|
| 251 | 251 | v->shift_counter = (v->shift_counter + 1) % 8; |
| 252 | 252 | |
| 253 | 253 | 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); | |
| 255 | 255 | else |
| 256 | 256 | { |
| 257 | 257 | if (!(v->ifr & INT_SR)) |
| r1355 | r1356 | |
| 365 | 365 | v.time2 = via[i].time2; |
| 366 | 366 | v.clock = via[i].clock; |
| 367 | 367 | |
| 368 | v.t1 = timer_alloc(via_t1_timeout); | |
| 368 | v.t1 = timer_alloc(via_t1_timeout, NULL); | |
| 369 | 369 | v.t1_active = 0; |
| 370 | v.t2 = timer_alloc(via_t2_timeout); | |
| 370 | v.t2 = timer_alloc(via_t2_timeout, NULL); | |
| 371 | 371 | v.t2_active = 0; |
| 372 | 372 | |
| 373 | 373 | via[i] = v; |
| r1355 | r1356 | |
| 524 | 524 | if (SO_O2_CONTROL(v->acr)) |
| 525 | 525 | { |
| 526 | 526 | 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); | |
| 528 | 528 | } |
| 529 | 529 | break; |
| 530 | 530 | |
| r1355 | r1356 | |
| 754 | 754 | via_clear_int(which, INT_SR); |
| 755 | 755 | if (SO_O2_CONTROL(v->acr)) |
| 756 | 756 | { |
| 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); | |
| 758 | 758 | } |
| 759 | 759 | break; |
| 760 | 760 |
| r1355 | r1356 | |
|---|---|---|
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | /* 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 ); | |
| 355 | 355 | } |
| 356 | 356 | else |
| 357 | 357 | { |
| r1355 | r1356 | |
| 423 | 423 | scsi_data.busphase = PHS_MESS_IN; |
| 424 | 424 | |
| 425 | 425 | /* 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 ); | |
| 427 | 427 | } |
| 428 | 428 | } |
| 429 | 429 | else |
| r1355 | r1356 | |
| 453 | 453 | scsi_data.regs[WD_AUXILIARY_STATUS] |= ASR_CIP; |
| 454 | 454 | |
| 455 | 455 | /* 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 ); | |
| 457 | 457 | } |
| 458 | 458 | |
| 459 | 459 | /* Command handlers */ |
| r1355 | r1356 | |
| 802 | 802 | } |
| 803 | 803 | |
| 804 | 804 | /* 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); | |
| 806 | 806 | |
| 807 | 807 | scsi_data.temp_input = auto_malloc( TEMP_INPUT_LEN ); |
| 808 | 808 |
| r1355 | r1356 | |
|---|---|---|
| 81 | 81 | |
| 82 | 82 | for (i = 0; i < count; i++) |
| 83 | 83 | { |
| 84 | pic[i].timer = timer_alloc(pic8259_timerproc); | |
| 84 | pic[i].timer = timer_alloc(pic8259_timerproc, NULL); | |
| 85 | 85 | pic[i].set_int_line = set_int_line; |
| 86 | 86 | } |
| 87 | 87 |
| r1355 | r1356 | |
|---|---|---|
| 26 | 26 | int cf; |
| 27 | 27 | }; |
| 28 | 28 | |
| 29 | struct uPD4701_chip uPD4701[ UPD4701_MAXCHIP ]; | |
| 29 | static struct uPD4701_chip uPD4701[ UPD4701_MAXCHIP ]; | |
| 30 | 30 | |
| 31 | 31 | #define MASK_SWITCHES ( 7 ) |
| 32 | 32 | #define MASK_COUNTER ( 0xfff ) |
| r1355 | r1356 | |
|---|---|---|
| 48 | 48 | |
| 49 | 49 | static struct flash_chip chips[FLASH_CHIPS_MAX]; |
| 50 | 50 | |
| 51 | static TIMER_CALLBACK | |
| 51 | static TIMER_CALLBACK | |
| 52 | 52 | { |
| 53 | struct flash_chip *c = p | |
| 53 | struct flash_chip *c = ptr | |
| 54 | 54 | |
| 55 | 55 | switch( c->flash_mode ) |
| 56 | 56 | { |
| r1355 | r1356 | |
| 131 | 131 | c->status = 0x80; |
| 132 | 132 | c->flash_mode = FM_NORMAL; |
| 133 | 133 | c->flash_master_lock = 0; |
| 134 | c->timer = timer_alloc | |
| 134 | c->timer = timer_alloc | |
| 135 | 135 | c->flash_memory = data; |
| 136 | 136 | |
| 137 | 137 | state_save_register_item( "intelfsh", chip, c->status ); |
| r1355 | r1356 | |
| 335 | 335 | c->status = 1 << 3; |
| 336 | 336 | c->flash_mode = FM_ERASEAMD4; |
| 337 | 337 | |
| 338 | timer_adjust | |
| 338 | timer_adjust | |
| 339 | 339 | } |
| 340 | 340 | else if( ( data & 0xff ) == 0x30 ) |
| 341 | 341 | { |
| r1355 | r1356 | |
| 360 | 360 | c->status = 1 << 3; |
| 361 | 361 | c->flash_mode = FM_ERASEAMD4; |
| 362 | 362 | |
| 363 | timer_adjust | |
| 363 | timer_adjust | |
| 364 | 364 | } |
| 365 | 365 | else |
| 366 | 366 | { |
| r1355 | r1356 | |
| 429 | 429 | c->status = 0x00; |
| 430 | 430 | c->flash_mode = FM_READSTATUS; |
| 431 | 431 | |
| 432 | timer_adjust | |
| 432 | timer_adjust | |
| 433 | 433 | break; |
| 434 | 434 | } |
| 435 | 435 | else |
| r1355 | r1356 | |
|---|---|---|
| 168 | 168 | state_save_register_item( "ds2401", which, c->tx ); |
| 169 | 169 | state_save_register_item_pointer( "ds2401", which, data, SIZE_DATA ); |
| 170 | 170 | |
| 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); | |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | void ds2401_write( int which, int data ) |
| r1355 | r1356 | |
|---|---|---|
| 355 | 355 | } |
| 356 | 356 | } |
| 357 | 357 | |
| 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); | |
| 361 | 361 | |
| 362 | 362 | for (i = 0; i < 3; i++) |
| 363 | 363 | timer_enable(ptm[which].timer[i], FALSE); |
| r1355 | r1356 | |
|---|---|---|
| 159 | 159 | case 3: // reset SCSI bus |
| 160 | 160 | scsi_regs[REG_INTSTATE] = 4; // command sent OK |
| 161 | 161 | xfer_state = 0; |
| 162 | timer_set( ATTOTIME_IN_HZ( 16384 ), 0, am53cf96_irq ); | |
| 162 | timer_set( ATTOTIME_IN_HZ( 16384 ), NULL, 0, am53cf96_irq ); | |
| 163 | 163 | break; |
| 164 | 164 | 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 ); | |
| 166 | 166 | if ((fifo[1] == 0) || (fifo[1] == 0x48) || (fifo[1] == 0x4b)) |
| 167 | 167 | { |
| 168 | 168 | scsi_regs[REG_INTSTATE] = 6; |
| r1355 | r1356 | |
| 192 | 192 | case 0x10: // information transfer (must not change xfer_state) |
| 193 | 193 | case 0x11: // second phase of information transfer |
| 194 | 194 | 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 ); | |
| 196 | 196 | scsi_regs[REG_INTSTATE] = 6; // command sent OK |
| 197 | 197 | break; |
| 198 | 198 | default: |
| r1355 | r1356 | |
|---|---|---|
| 394 | 394 | duart[chip].ch[1].pending_interrupt = 0; |
| 395 | 395 | |
| 396 | 396 | // 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); | |
| 398 | 398 | timer_adjust(duart[chip].ch[0].tx_fifo_timer, attotime_never, (chip * 2) + 0, attotime_never); |
| 399 | 399 | |
| 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); | |
| 401 | 401 | timer_adjust(duart[chip].ch[1].tx_fifo_timer, attotime_never, (chip * 2) + 1, attotime_never); |
| 402 | 402 | } |
| 403 | 403 |
| r1355 | r1356 | |
|---|---|---|
| 578 | 578 | |
| 579 | 579 | /* make sure there are no queued interrupts */ |
| 580 | 580 | if (enabled == 0) |
| 581 | timer_call_after_resynch(cpunum, clear_all_lines); | |
| 581 | timer_call_after_resynch(NULL, cpunum, clear_all_lines); | |
| 582 | 582 | } |
| 583 | 583 | |
| 584 | 584 |
| r1355 | r1356 | |
|---|---|---|
| 78 | 78 | #define BCR_Z ( 2 ) |
| 79 | 79 | #define BCR_T ( 1 ) |
| 80 | 80 | |
| 81 | struct x76f041_chip x76f041[ X76F041_MAXCHIP ]; | |
| 81 | static struct x76f041_chip x76f041[ X76F041_MAXCHIP ]; | |
| 82 | 82 | |
| 83 | 83 | #define COMMAND_WRITE ( 0x00 ) |
| 84 | 84 | #define COMMAND_READ ( 0x20 ) |
| r1355 | r1356 | |
|---|---|---|
| 280 | 280 | kbdc8042.inport = 0xa0; |
| 281 | 281 | at_8042_set_outport(0xfe, 1); |
| 282 | 282 | |
| 283 | timer_pulse(ATTOTIME_IN_HZ(60), 0, kbdc8042_time); | |
| 283 | timer_pulse(ATTOTIME_IN_HZ(60), NULL, 0, kbdc8042_time); | |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | static void at_8042_receive(int data) |
| r1355 | r1356 | |
| 522 | 522 | break; |
| 523 | 523 | case 0xaa: /* selftest */ |
| 524 | 524 | 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 */ | |
| 526 | 526 | else |
| 527 | 527 | at_8042_receive(0x55); |
| 528 | 528 | break; |
| r1355 | r1356 | |
|---|---|---|
| 75 | 75 | for (which = 0; which < dma_count; which++) |
| 76 | 76 | { |
| 77 | 77 | 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); | |
| 80 | 80 | dma[which].eop = 1; |
| 81 | 81 | } |
| 82 | 82 | return 0; |
| r1355 | r1356 | |
| 406 | 406 | int param; |
| 407 | 407 | |
| 408 | 408 | 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); | |
| 410 | 410 | dma8237_drq_write_callback(param); |
| 411 | 411 | } |
| 412 | 412 |
| r1355 | r1356 | |
|---|---|---|
| 296 | 296 | |
| 297 | 297 | memset(sio, 0, sizeof(*sio)); |
| 298 | 298 | |
| 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); | |
| 301 | 301 | |
| 302 | 302 | sio->irq_cb = intf->irq_cb; |
| 303 | 303 | sio->dtr_changed_cb = intf->dtr_changed_cb; |
| r1355 | r1356 | |
| 587 | 587 | void z80sio_set_cts(int which, int ch, int state) |
| 588 | 588 | { |
| 589 | 589 | /* 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); | |
| 591 | 591 | } |
| 592 | 592 | |
| 593 | 593 | |
| r1355 | r1356 | |
| 599 | 599 | void z80sio_set_dcd(int which, int ch, int state) |
| 600 | 600 | { |
| 601 | 601 | /* 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); | |
| 603 | 603 | } |
| 604 | 604 | |
| 605 | 605 |
| r1355 | r1356 | |
|---|---|---|
| 110 | 110 | { |
| 111 | 111 | int i; |
| 112 | 112 | 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); | |
| 114 | 114 | |
| 115 | 115 | for (i = 0; i < 3; i++) |
| 116 | 116 | tmp68301_IE[i] = 0; |
| r1355 | r1356 | |
|---|---|---|
| 162 | 162 | ctc->period256 = attotime_mul(ATTOTIME_IN_HZ(intf->baseclock), 256); |
| 163 | 163 | ctc->notimer = intf->notimer; |
| 164 | 164 | 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); | |
| 169 | 169 | ctc->zc[0] = intf->zc0; |
| 170 | 170 | ctc->zc[1] = intf->zc1; |
| 171 | 171 | ctc->zc[2] = intf->zc2; |
| r1355 | r1356 | |
| 391 | 391 | |
| 392 | 392 | /* if we hit zero, do the same thing as for a timer interrupt */ |
| 393 | 393 | if (!ctc->down[ch]) |
| 394 | timercallback(Machine, (which << 2) + ch); | |
| 394 | timercallback(Machine, NULL, (which << 2) + ch); | |
| 395 | 395 | } |
| 396 | 396 | } |
| 397 | 397 | } |
| r1355 | r1356 | |
|---|---|---|
| 781 | 781 | timer->outputtimer = NULL; |
| 782 | 782 | else |
| 783 | 783 | { |
| 784 | timer->outputtimer = timer_alloc(outputcallback); | |
| 784 | timer->outputtimer = timer_alloc(outputcallback, NULL); | |
| 785 | 785 | timer_adjust(timer->outputtimer, attotime_never, i | (timerno<<4), attotime_zero); |
| 786 | 786 | } |
| 787 | 787 | if (timer->freq_callback == NULL) |
| 788 | 788 | timer->freqtimer = NULL; |
| 789 | 789 | else |
| 790 | 790 | { |
| 791 | timer->freqtimer = timer_alloc(freqcallback); | |
| 791 | timer->freqtimer = timer_alloc(freqcallback, NULL); | |
| 792 | 792 | timer_adjust(timer->freqtimer, attotime_never, i | (timerno<<4), attotime_zero); |
| 793 | 793 | } |
| 794 | 794 |
| r1355 | r1356 | |
|---|---|---|
| 305 | 305 | ds2404.rtc[ 3 ] = ( current_time >> 16 ) & 0xff; |
| 306 | 306 | ds2404.rtc[ 4 ] = ( current_time >> 24 ) & 0xff; |
| 307 | 307 | |
| 308 | timer = timer_alloc( DS2404_tick ); | |
| 308 | timer = timer_alloc( DS2404_tick , NULL); | |
| 309 | 309 | timer_adjust( timer, ATTOTIME_IN_HZ( 256 ), 0, ATTOTIME_IN_HZ( 256 ) ); |
| 310 | 310 | } |
| 311 | 311 |
| r1355 | r1356 | |
|---|---|---|
| 201 | 201 | memset(mc146818, 0, sizeof(*mc146818)); |
| 202 | 202 | mc146818->type = type; |
| 203 | 203 | 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); | |
| 205 | 205 | mc146818_set_base_datetime(); |
| 206 | 206 | } |
| 207 | 207 |
| r1355 | r1356 | |
|---|---|---|
| 316 | 316 | |
| 317 | 317 | rtc.xram = xram; |
| 318 | 318 | |
| 319 | rtc.update_timer = timer_alloc(rtc_begin_update_callback); | |
| 319 | rtc.update_timer = timer_alloc(rtc_begin_update_callback, NULL); | |
| 320 | 320 | 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); | |
| 322 | 322 | rtc.interrupt_callback = interrupt_callback; |
| 323 | 323 | } |
| 324 | 324 | |
| r1355 | r1356 | |
| 501 | 501 | rtc.regs[reg_A] |= reg_A_UIP; |
| 502 | 502 | |
| 503 | 503 | /* 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); | |
| 505 | 505 | } |
| 506 | 506 | } |
| 507 | 507 |
| r1355 | r1356 | |
|---|---|---|
| 245 | 245 | |
| 246 | 246 | |
| 247 | 247 | /*************************************************************************** |
| 248 | GLOBALS | |
| 248 | GLOBAL VARAIBLES | |
| 249 | 249 | ***************************************************************************/ |
| 250 | 250 | |
| 251 | 251 | extern running_machine *Machine; |
| r1355 | r1356 | |
|---|---|---|
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | |
| 277 | /*------------------------------------------------- | |
| 278 | attotime_min - return the minimum of two | |
| 279 | attotimes | |
| 280 | -------------------------------------------------*/ | |
| 277 | 281 | |
| 282 | attotime 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 | ||
| 299 | attotime 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 | ||
| 278 | 312 | /*************************************************************************** |
| 279 | 313 | MISC UTILITIES |
| 280 | 314 | ***************************************************************************/ |
| r1355 | r1356 | |
|---|---|---|
| 153 | 153 | /* compare two attotimes */ |
| 154 | 154 | int attotime_compare(attotime _time1, attotime _time2); |
| 155 | 155 | |
| 156 | /* return the minimum of two attotimes */ | |
| 157 | attotime attotime_min(attotime _time1, attotime _time2); | |
| 156 | 158 | |
| 159 | /* return the maximum of two attotimes */ | |
| 160 | attotime attotime_max(attotime _time1, attotime _time2); | |
| 161 | ||
| 162 | ||
| 157 | 163 | /* ----- misc utilities ----- */ |
| 158 | 164 | |
| 159 | 165 | /* return a temporary printable string describing an attotime */ |
| r1355 | r1356 | |
|---|---|---|
| 92 | 92 | INT32 iloops; /* number of interrupts remaining this frame */ |
| 93 | 93 | |
| 94 | 94 | 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 */ | |
| 96 | 96 | INT32 clock; /* current active clock */ |
| 97 | 97 | double clockscale; /* current active clock scale factor */ |
| 98 | 98 | |
| r1355 | r1356 | |
| 202 | 202 | 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)); |
| 203 | 203 | |
| 204 | 204 | /* 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); | |
| 207 | 207 | cpu_compute_vblank_timing(); |
| 208 | 208 | |
| 209 | 209 | /* loop over all our CPUs */ |
| r1355 | r1356 | |
| 372 | 372 | { |
| 373 | 373 | /* Start a time based watchdog. */ |
| 374 | 374 | if (alloc_new) |
| 375 | watchdog_timer = timer_alloc(watchdog_callback); | |
| 375 | watchdog_timer = timer_alloc(watchdog_callback, NULL); | |
| 376 | 376 | timer_adjust(watchdog_timer, Machine->drv->watchdog_time, 0, attotime_zero); |
| 377 | 377 | watchdog_counter = WATCHDOG_IS_TIMER_BASED; |
| 378 | 378 | } |
| r1355 | r1356 | |
| 998 | 998 | |
| 999 | 999 | void cpu_triggertime(attotime duration, int trigger) |
| 1000 | 1000 | { |
| 1001 | timer_set(duration, trigger, cpu_triggertime_callback); | |
| 1001 | timer_set(duration, NULL, trigger, cpu_triggertime_callback); | |
| 1002 | 1002 | } |
| 1003 | 1003 | |
| 1004 | 1004 | |
| r1355 | r1356 | |
| 1046 | 1046 | cpu[cpunum].trigger = trigger; |
| 1047 | 1047 | } |
| 1048 | 1048 | |
| 1049 | void cpu_yielduntil_trigger(int trigger) | |
| 1050 | { | |
| 1051 | int cpunum = cpu_getexecutingcpu(); | |
| 1052 | 1049 | |
| 1053 | VERIFY_EXECUTINGCPU(cpu_yielduntil_trigger); | |
| 1054 | 1050 | |
| 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 | ||
| 1064 | 1051 | /************************************* |
| 1065 | 1052 | * |
| 1066 | 1053 | * Burn/yield CPU cycles until an |
| r1355 | r1356 | |
| 1075 | 1062 | } |
| 1076 | 1063 | |
| 1077 | 1064 | |
| 1078 | void cpu_yielduntil_int(void) | |
| 1079 | { | |
| 1080 | VERIFY_EXECUTINGCPU(cpu_yielduntil_int); | |
| 1081 | cpu_yielduntil_trigger(TRIGGER_INT + activecpu); | |
| 1082 | } | |
| 1083 | 1065 | |
| 1084 | ||
| 1085 | ||
| 1086 | 1066 | /************************************* |
| 1087 | 1067 | * |
| 1088 | 1068 | * Burn/yield CPU cycles until the |
| r1355 | r1356 | |
| 1098 | 1078 | |
| 1099 | 1079 | void cpu_yield(void) |
| 1100 | 1080 | { |
| 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; | |
| 1102 | 1090 | } |
| 1103 | 1091 | |
| 1104 | 1092 | |
| r1355 | r1356 | |
| 1120 | 1108 | } |
| 1121 | 1109 | |
| 1122 | 1110 | |
| 1123 | void cpu_yielduntil_time(attotime duration) | |
| 1124 | { | |
| 1125 | static int timetrig = 0; | |
| 1126 | 1111 | |
| 1127 | cpu_yielduntil_trigger(TRIGGER_YIELDTIME + timetrig); | |
| 1128 | cpu_triggertime(duration, TRIGGER_YIELDTIME + timetrig); | |
| 1129 | timetrig = (timetrig + 1) & 255; | |
| 1130 | } | |
| 1131 | ||
| 1132 | ||
| 1133 | ||
| 1134 | 1112 | #if 0 |
| 1135 | 1113 | #pragma mark - |
| 1136 | 1114 | #pragma mark CORE TIMING |
| r1355 | r1356 | |
| 1213 | 1191 | timer_adjust(vblank_timer, vblank_period, param, vblank_period); |
| 1214 | 1192 | |
| 1215 | 1193 | /* but we need to call the standard routine as well */ |
| 1216 | cpu_vblankcallback(machine, param); | |
| 1194 | cpu_vblankcallback(machine, NULL, param); | |
| 1217 | 1195 | } |
| 1218 | 1196 | |
| 1219 | 1197 | |
| r1355 | r1356 | |
| 1271 | 1249 | { |
| 1272 | 1250 | /* do we update the screen now? */ |
| 1273 | 1251 | if (!(machine->drv->video_attributes & VIDEO_UPDATE_AFTER_VBLANK)) |
| 1274 | video_frame_update(); | |
| 1252 | video_frame_update(FALSE); | |
| 1275 | 1253 | |
| 1276 | 1254 | /* Set the timer to update the screen */ |
| 1277 | 1255 | timer_adjust(update_timer, attotime_make(0, machine->screen[0].vblank), 0, attotime_zero); |
| r1355 | r1356 | |
| 1301 | 1279 | { |
| 1302 | 1280 | /* update the screen if we didn't before */ |
| 1303 | 1281 | if (machine->drv->video_attributes & VIDEO_UPDATE_AFTER_VBLANK) |
| 1304 | video_frame_update(); | |
| 1282 | video_frame_update(FALSE); | |
| 1305 | 1283 | vblank = 0; |
| 1306 | 1284 | |
| 1307 | 1285 | /* update IPT_VBLANK input ports */ |
| r1355 | r1356 | |
| 1416 | 1394 | if (ipf <= 0) |
| 1417 | 1395 | ipf = 1; |
| 1418 | 1396 | 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); | |
| 1420 | 1398 | timer_adjust(timeslice_timer, timeslice_period, 0, timeslice_period); |
| 1421 | 1399 | |
| 1422 | 1400 | /* 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); | |
| 1425 | 1403 | |
| 1426 | 1404 | /* |
| 1427 | 1405 | * The following code finds all the CPUs that are interrupting in sync with the VBLANK |
| r1355 | r1356 | |
| 1468 | 1446 | vblank_countdown = vblank_multiplier; |
| 1469 | 1447 | |
| 1470 | 1448 | /* 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); | |
| 1472 | 1450 | |
| 1473 | 1451 | /* |
| 1474 | 1452 | * The following code creates individual timers for each CPU whose interrupts are not |
| r1355 | r1356 | |
| 1483 | 1461 | /* compute the average number of cycles per interrupt */ |
| 1484 | 1462 | if (ipf <= 0) |
| 1485 | 1463 | ipf = 1; |
| 1486 | cpu[cpunum].vblankint_timer = timer_alloc(NULL); | |
| 1464 | cpu[cpunum].vblankint_timer = timer_alloc(NULL, NULL); | |
| 1487 | 1465 | |
| 1488 | 1466 | /* see if we need to allocate a CPU timer */ |
| 1489 | 1467 | if (machine->drv->cpu[cpunum].timed_interrupt_period != 0) |
| 1490 | 1468 | { |
| 1491 | 1469 | 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); | |
| 1493 | 1471 | timer_adjust(cpu[cpunum].timedint_timer, cpu[cpunum].timedint_period, cpunum, cpu[cpunum].timedint_period); |
| 1494 | 1472 | } |
| 1495 | 1473 | } |
| r1355 | r1356 | |
| 1500 | 1478 | first_time = attotime_sub_attoseconds(vblank_period, machine->screen[0].vblank); |
| 1501 | 1479 | while (attotime_compare(first_time, attotime_zero) < 0) |
| 1502 | 1480 | { |
| 1503 | cpu_vblankcallback(machine, -1); | |
| 1481 | cpu_vblankcallback(machine, NULL, -1); | |
| 1504 | 1482 | first_time = attotime_add(first_time, vblank_period); |
| 1505 | 1483 | } |
| 1506 | timer_set(first_time, 0, cpu_firstvblankcallback); | |
| 1484 | timer_set(first_time, NULL, 0, cpu_firstvblankcallback); | |
| 1507 | 1485 | |
| 1508 | 1486 | /* reset the refresh timer to get ourself back in sync */ |
| 1509 | 1487 | timer_adjust(refresh_timer, attotime_never, 0, attotime_never); |
| r1355 | r1356 | |
|---|---|---|
| 394 | 394 | /* burn specified CPU cycles until a timer trigger */ |
| 395 | 395 | void cpunum_spinuntil_trigger(int cpunum, int trigger); |
| 396 | 396 | |
| 397 | /* yield our timeslice until a timer trigger */ | |
| 398 | void cpu_yielduntil_trigger(int trigger); | |
| 399 | ||
| 400 | 397 | /* burn CPU cycles until the next interrupt */ |
| 401 | 398 | void cpu_spinuntil_int(void); |
| 402 | 399 | |
| 403 | /* yield our timeslice until the next interrupt */ | |
| 404 | void cpu_yielduntil_int(void); | |
| 405 | ||
| 406 | 400 | /* burn CPU cycles until our timeslice is up */ |
| 407 | 401 | void cpu_spin(void); |
| 408 | 402 | |
| r1355 | r1356 | |
| 412 | 406 | /* burn CPU cycles for a specific period of time */ |
| 413 | 407 | void cpu_spinuntil_time(attotime duration); |
| 414 | 408 | |
| 415 | /* yield our timeslice for a specific period of time */ | |
| 416 | void cpu_yielduntil_time(attotime duration); | |
| 417 | 409 | |
| 418 | 410 | |
| 419 | ||
| 420 | 411 | /************************************* |
| 421 | 412 | * |
| 422 | 413 | * Core timing |
| r1355 | r1356 | |
|---|---|---|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /* Timer overflow callback from timer.c */ |
| 37 | static TIMER_CALLBACK | |
| 37 | static TIMER_CALLBACK | |
| 38 | 38 | { |
| 39 | struct ym2612_info *info = p | |
| 39 | struct ym2612_info *info = ptr | |
| 40 | 40 | YM2612TimerOver(info->chip,0); |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | static TIMER_CALLBACK | |
| 43 | static TIMER_CALLBACK | |
| 44 | 44 | { |
| 45 | struct ym2612_info *info = p | |
| 45 | struct ym2612_info *info = ptr | |
| 46 | 46 | YM2612TimerOver(info->chip,1); |
| 47 | 47 | } |
| 48 | 48 | |
| r1355 | r1356 | |
| 57 | 57 | { /* Start FM Timer */ |
| 58 | 58 | attotime period = attotime_mul(ATTOTIME_IN_HZ(clock), count); |
| 59 | 59 | if (!timer_enable(info->timer[c], 1)) |
| 60 | timer_adjust | |
| 60 | timer_adjust | |
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |
| r1355 | r1356 | |
| 99 | 99 | |
| 100 | 100 | /* FM init */ |
| 101 | 101 | /* 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); | |
| 104 | 104 | |
| 105 | 105 | /* stream system initialize */ |
| 106 | 106 | info->stream = stream_create(0,2,rate,info,ym2612_stream_update); |
| r1355 | r1356 | |
|---|---|---|
| 439 | 439 | } |
| 440 | 440 | |
| 441 | 441 | |
| 442 | static TIMER_CALLBACK | |
| 442 | static TIMER_CALLBACK | |
| 443 | 443 | { |
| 444 | struct k054539_info *info = p | |
| 444 | struct k054539_info *info = ptr | |
| 445 | 445 | if(info->regs[0x22f] & 0x20) |
| 446 | 446 | info->intf->irq (); |
| 447 | 447 | } |
| r1355 | r1356 | |
| 473 | 473 | // One or more of the registers must be the timer period |
| 474 | 474 | // And anyway, this particular frequency is probably wrong |
| 475 | 475 | // 480 hz is TRUSTED by gokuparo disco stage - the looping sample doesn't line up otherwise |
| 476 | timer_pulse | |
| 476 | timer_pulse | |
| 477 | 477 | |
| 478 | 478 | info->stream = stream_create(0, 2, clock, info, K054539_update); |
| 479 | 479 |
| r1355 | r1356 | |
|---|---|---|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | /* timer callback at VCLK low eddge */ |
| 114 | static TIMER_CALLBACK | |
| 114 | static TIMER_CALLBACK | |
| 115 | 115 | { |
| 116 | struct MSM5205Voice *voice = p | |
| 116 | struct MSM5205Voice *voice = ptr | |
| 117 | 117 | int val; |
| 118 | 118 | int new_signal; |
| 119 | 119 | /* callback user handler and latch next data */ |
| r1355 | r1356 | |
| 184 | 184 | |
| 185 | 185 | /* stream system initialize */ |
| 186 | 186 | voice->stream = stream_create(0,1,clock,voice,MSM5205_update); |
| 187 | voice->timer = timer_alloc | |
| 187 | voice->timer = timer_alloc | |
| 188 | 188 | |
| 189 | 189 | /* initialize */ |
| 190 | 190 | msm5205_reset(voice); |
| r1355 | r1356 | |
| 220 | 220 | if( voice->vclk != vclk) |
| 221 | 221 | { |
| 222 | 222 | voice->vclk = vclk; |
| 223 | if( !vclk ) MSM5205_vclk_callback(Machine, voice); | |
| 223 | if( !vclk ) MSM5205_vclk_callback(Machine, voice, 0); | |
| 224 | 224 | } |
| 225 | 225 | } |
| 226 | 226 | } |
| r1355 | r1356 | |
| 269 | 269 | if( prescaler ) |
| 270 | 270 | { |
| 271 | 271 | attotime period = attotime_mul(ATTOTIME_IN_HZ(voice->clock), prescaler); |
| 272 | timer_adjust | |
| 272 | timer_adjust | |
| 273 | 273 | } |
| 274 | 274 | else |
| 275 | timer_adjust | |
| 275 | timer_adjust | |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | if( voice->bitwidth != bitwidth ) |
| r1355 | r1356 | |
|---|---|---|
| 39 | 39 | struct ym3812_info *info = param; |
| 40 | 40 | if (info->intf->handler) (info->intf->handler)(irq ? ASSERT_LINE : CLEAR_LINE); |
| 41 | 41 | } |
| 42 | static TIMER_CALLBACK | |
| 42 | static TIMER_CALLBACK | |
| 43 | 43 | { |
| 44 | struct ym3812_info *info = p | |
| 44 | struct ym3812_info *info = ptr | |
| 45 | 45 | YM3812TimerOver(info->chip,0); |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | static TIMER_CALLBACK | |
| 48 | static TIMER_CALLBACK | |
| 49 | 49 | { |
| 50 | struct ym3812_info *info = p | |
| 50 | struct ym3812_info *info = ptr | |
| 51 | 51 | YM3812TimerOver(info->chip,1); |
| 52 | 52 | } |
| 53 | 53 | |
| r1355 | r1356 | |
| 60 | 60 | } |
| 61 | 61 | else |
| 62 | 62 | { /* Start FM Timer */ |
| 63 | timer_adjust | |
| 63 | timer_adjust | |
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
| r1355 | r1356 | |
| 101 | 101 | YM3812SetIRQHandler (info->chip, IRQHandler_3812, info); |
| 102 | 102 | YM3812SetUpdateHandler(info->chip, _stream_update_3812, info); |
| 103 | 103 | |
| 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); | |
| 106 | 106 | |
| 107 | 107 | return info; |
| 108 | 108 | } |
| r1355 | r1356 | |
| 209 | 209 | if (info->intf->handler) (info->intf->handler)(irq ? ASSERT_LINE : CLEAR_LINE); |
| 210 | 210 | } |
| 211 | 211 | /* Timer overflow callback from timer.c */ |
| 212 | static TIMER_CALLBACK | |
| 212 | static TIMER_CALLBACK | |
| 213 | 213 | { |
| 214 | struct ym3526_info *info = p | |
| 214 | struct ym3526_info *info = ptr | |
| 215 | 215 | YM3526TimerOver(info->chip,0); |
| 216 | 216 | } |
| 217 | static TIMER_CALLBACK | |
| 217 | static TIMER_CALLBACK | |
| 218 | 218 | { |
| 219 | struct ym3526_info *info = p | |
| 219 | struct ym3526_info *info = ptr | |
| 220 | 220 | YM3526TimerOver(info->chip,1); |
| 221 | 221 | } |
| 222 | 222 | /* TimerHandler from fm.c */ |
| r1355 | r1356 | |
| 229 | 229 | } |
| 230 | 230 | else |
| 231 | 231 | { /* Start FM Timer */ |
| 232 | timer_adjust | |
| 232 | timer_adjust | |
| 233 | 233 | } |
| 234 | 234 | } |
| 235 | 235 | |
| r1355 | r1356 | |
| 269 | 269 | YM3526SetIRQHandler (info->chip, IRQHandler_3526, info); |
| 270 | 270 | YM3526SetUpdateHandler(info->chip, _stream_update_3526, info); |
| 271 | 271 | |
| 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); | |
| 274 | 274 | |
| 275 | 275 | return info; |
| 276 | 276 | } |
| r1355 | r1356 | |
| 375 | 375 | struct y8950_info *info = param; |
| 376 | 376 | if (info->intf->handler) (info->intf->handler)(irq ? ASSERT_LINE : CLEAR_LINE); |
| 377 | 377 | } |
| 378 | static TIMER_CALLBACK | |
| 378 | static TIMER_CALLBACK | |
| 379 | 379 | { |
| 380 | struct y8950_info *info = p | |
| 380 | struct y8950_info *info = ptr | |
| 381 | 381 | Y8950TimerOver(info->chip,0); |
| 382 | 382 | } |
| 383 | static TIMER_CALLBACK | |
| 383 | static TIMER_CALLBACK | |
| 384 | 384 | { |
| 385 | struct y8950_info *info = p | |
| 385 | struct y8950_info *info = ptr | |
| 386 | 386 | Y8950TimerOver(info->chip,1); |
| 387 | 387 | } |
| 388 | 388 | static void TimerHandler_8950(void *param,int c,attotime period) |
| r1355 | r1356 | |
| 394 | 394 | } |
| 395 | 395 | else |
| 396 | 396 | { /* Start FM Timer */ |
| 397 | timer_adjust | |
| 397 | timer_adjust | |
| 398 | 398 | } |
| 399 | 399 | } |
| 400 | 400 | |
| r1355 | r1356 | |
| 475 | 475 | Y8950SetIRQHandler (info->chip, IRQHandler_8950, info); |
| 476 | 476 | Y8950SetUpdateHandler(info->chip, _stream_update_8950, info); |
| 477 | 477 | |
| 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); | |
| 480 | 480 | |
| 481 | 481 | return info; |
| 482 | 482 | } |
| r1355 | r1356 | |
|---|---|---|
| 108 | 108 | static int diff_lookup[16]; |
| 109 | 109 | |
| 110 | 110 | /* timer callback */ |
| 111 | static TIMER_CALLBACK_PTR( update_irq_state_timer_0 ); | |
| 112 | static TIMER_CALLBACK_PTR( update_irq_state_timer_1 ); | |
| 113 | static TIMER_CALLBACK_PTR( update_irq_state_timer_2 ); | |
| 114 | static TIMER_CALLBACK_PTR( update_irq_state_timer_3 ); | |
| 115 | static TIMER_CALLBACK_PTR( update_irq_state_timer_4 ); | |
| 116 | static TIMER_CALLBACK_PTR( update_irq_state_timer_5 ); | |
| 117 | static TIMER_CALLBACK_PTR( update_irq_state_timer_6 ); | |
| 118 | static TIMER_CALLBACK_PTR( update_irq_state_timer_7 ); | |
| 111 | static TIMER_CALLBACK( update_irq_state_timer_0 ); | |
| 112 | static TIMER_CALLBACK( update_irq_state_timer_1 ); | |
| 113 | static TIMER_CALLBACK( update_irq_state_timer_2 ); | |
| 114 | static TIMER_CALLBACK( update_irq_state_timer_3 ); | |
| 115 | static TIMER_CALLBACK( update_irq_state_timer_4 ); | |
| 116 | static TIMER_CALLBACK( update_irq_state_timer_5 ); | |
| 117 | static TIMER_CALLBACK( update_irq_state_timer_6 ); | |
| 118 | static TIMER_CALLBACK( update_irq_state_timer_7 ); | |
| 119 | 119 | |
| 120 | static | |
| 120 | static t | |
| 121 | 121 | { |
| 122 | 122 | update_irq_state_timer_0, |
| 123 | 123 | update_irq_state_timer_1, |
| r1355 | r1356 | |
| 199 | 199 | struct YMZ280BVoice *voice = &chip->voice[j]; |
| 200 | 200 | update_step(chip, voice); |
| 201 | 201 | if(voice->irq_schedule) |
| 202 | timer_set | |
| 202 | timer_set | |
| 203 | 203 | } |
| 204 | 204 | } |
| 205 | 205 | |
| r1355 | r1356 | |
| 217 | 217 | voice->irq_schedule = 0; |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | static TIMER_CALLBACK_PTR( update_irq_state_timer_0 ) { update_irq_state_timer_common(param, 0); } | |
| 221 | static TIMER_CALLBACK_PTR( update_irq_state_timer_1 ) { update_irq_state_timer_common(param, 1); } | |
| 222 | static TIMER_CALLBACK_PTR( update_irq_state_timer_2 ) { update_irq_state_timer_common(param, 2); } | |
| 223 | static TIMER_CALLBACK_PTR( update_irq_state_timer_3 ) { update_irq_state_timer_common(param, 3); } | |
| 224 | static TIMER_CALLBACK_PTR( update_irq_state_timer_4 ) { update_irq_state_timer_common(param, 4); } | |
| 225 | static TIMER_CALLBACK_PTR( update_irq_state_timer_5 ) { update_irq_state_timer_common(param, 5); } | |
| 226 | static TIMER_CALLBACK_PTR( update_irq_state_timer_6 ) { update_irq_state_timer_common(param, 6); } | |
| 227 | static TIMER_CALLBACK_PTR( update_irq_state_timer_7 ) { update_irq_state_timer_common(param, 7); } | |
| 220 | static TIMER_CALLBACK( update_irq_state_timer_0 ) { update_irq_state_timer_common(ptr, 0); } | |
| 221 | static TIMER_CALLBACK( update_irq_state_timer_1 ) { update_irq_state_timer_common(ptr, 1); } | |
| 222 | static TIMER_CALLBACK( update_irq_state_timer_2 ) { update_irq_state_timer_common(ptr, 2); } | |
| 223 | static TIMER_CALLBACK( update_irq_state_timer_3 ) { update_irq_state_timer_common(ptr, 3); } | |
| 224 | static TIMER_CALLBACK( update_irq_state_timer_4 ) { update_irq_state_timer_common(ptr, 4); } | |
| 225 | static TIMER_CALLBACK( update_irq_state_timer_5 ) { update_irq_state_timer_common(ptr, 5); } | |
| 226 | static TIMER_CALLBACK( update_irq_state_timer_6 ) { update_irq_state_timer_common(ptr, 6); } | |
| 227 | static TIMER_CALLBACK( update_irq_state_timer_7 ) { update_irq_state_timer_common(ptr, 7); } | |
| 228 | 228 | |
| 229 | 229 | |
| 230 | 230 | /********************************************************************************************** |
| r1355 | r1356 | |
| 575 | 575 | voice->playing = 0; |
| 576 | 576 | |
| 577 | 577 | /* set update_irq_state_timer. IRQ is signaled on next CPU execution. */ |
| 578 | timer_set | |
| 578 | timer_set | |
| 579 | 579 | voice->irq_schedule = 1; |
| 580 | 580 | } |
| 581 | 581 | } |
| r1355 | r1356 | |
|---|---|---|
| 522 | 522 | |
| 523 | 523 | *************************************************************/ |
| 524 | 524 | |
| 525 | static TIMER_CALLBACK | |
| 525 | static TIMER_CALLBACK | |
| 526 | 526 | { |
| 527 | struct upd7759_chip *chip = p | |
| 527 | struct upd7759_chip *chip = ptr | |
| 528 | 528 | UINT8 olddrq = chip->drq; |
| 529 | 529 | |
| 530 | 530 | /* update the stream */ |
| r1355 | r1356 | |
| 540 | 540 | |
| 541 | 541 | /* set a timer to go off when that is done */ |
| 542 | 542 | if (chip->state != STATE_IDLE) |
| 543 | timer_adjust | |
| 543 | timer_adjust | |
| 544 | 544 | } |
| 545 | 545 | |
| 546 | 546 | |
| r1355 | r1356 | |
| 575 | 575 | |
| 576 | 576 | /* turn off any timer */ |
| 577 | 577 | if (chip->timer) |
| 578 | timer_adjust | |
| 578 | timer_adjust | |
| 579 | 579 | } |
| 580 | 580 | |
| 581 | 581 | |
| r1355 | r1356 | |
| 643 | 643 | if (intf->region != 0) |
| 644 | 644 | chip->rom = chip->rombase = memory_region(intf->region); |
| 645 | 645 | else |
| 646 | chip->timer = timer_alloc | |
| 646 | chip->timer = timer_alloc | |
| 647 | 647 | |
| 648 | 648 | /* set the DRQ callback */ |
| 649 | 649 | chip->drqcallback = intf->drqcallback; |
| r1355 | r1356 | |
| 702 | 702 | |
| 703 | 703 | /* for slave mode, start the timer going */ |
| 704 | 704 | if (chip->timer) |
| 705 | timer_adjust | |
| 705 | timer_adjust | |
| 706 | 706 | } |
| 707 | 707 | } |
| 708 | 708 |
| r1355 | r1356 | |
|---|---|---|
| 1338 | 1338 | } |
| 1339 | 1339 | } |
| 1340 | 1340 | |
| 1341 | static TIMER_CALLBACK | |
| 1341 | static TIMER_CALLBACK | |
| 1342 | 1342 | { |
| 1343 | YMF271Chip *chip = p | |
| 1343 | YMF271Chip *chip = ptr | |
| 1344 | 1344 | |
| 1345 | 1345 | chip->status |= 1; |
| 1346 | 1346 | |
| r1355 | r1356 | |
| 1351 | 1351 | } |
| 1352 | 1352 | } |
| 1353 | 1353 | |
| 1354 | static TIMER_CALLBACK | |
| 1354 | static TIMER_CALLBACK | |
| 1355 | 1355 | { |
| 1356 | YMF271Chip *chip = p | |
| 1356 | YMF271Chip *chip = ptr | |
| 1357 | 1357 | |
| 1358 | 1358 | chip->status |= 2; |
| 1359 | 1359 | |
| r1355 | r1356 | |
| 1449 | 1449 | //period = (double)(256.0 - chip->timerAVal ) * ( 384.0 * 4.0 / (double)CLOCK); |
| 1450 | 1450 | period = attotime_mul(ATTOTIME_IN_HZ(chip->clock), 384 * (1024 - chip->timerAVal)); |
| 1451 | 1451 | |
| 1452 | timer_adjust | |
| 1452 | timer_adjust | |
| 1453 | 1453 | } |
| 1454 | 1454 | if (data & 0x20) |
| 1455 | 1455 | { // timer B reset |
| r1355 | r1356 | |
| 1460 | 1460 | |
| 1461 | 1461 | period = attotime_mul(ATTOTIME_IN_HZ(chip->clock), 384 * 16 * (256 - chip->timerBVal)); |
| 1462 | 1462 | |
| 1463 | timer_adjust | |
| 1463 | timer_adjust | |
| 1464 | 1464 | } |
| 1465 | 1465 | |
| 1466 | 1466 | break; |
| r1355 | r1356 | |
| 1719 | 1719 | |
| 1720 | 1720 | static void ymf271_init(YMF271Chip *chip, UINT8 *rom, void (*cb)(int), read8_handler ext_read, write8_handler ext_write) |
| 1721 | 1721 | { |
| 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); | |
| 1724 | 1724 | |
| 1725 | 1725 | chip->rom = rom; |
| 1726 | 1726 | chip->irq_callback = cb; |
| r1355 | r1356 | |
|---|---|---|
| 239 | 239 | #define P9(chip) chip->poly9[chip->p9] |
| 240 | 240 | #define P17(chip) chip->poly17[chip->p17] |
| 241 | 241 | |
| 242 | static TIMER_CALLBACK_PTR( pokey_timer_expire_1 ); | |
| 243 | static TIMER_CALLBACK_PTR( pokey_timer_expire_2 ); | |
| 244 | static TIMER_CALLBACK_PTR( pokey_timer_expire_4 ); | |
| 245 | static TIMER_CALLBACK_PTR( pokey_pot_trigger_0 ); | |
| 246 | static TIMER_CALLBACK_PTR( pokey_pot_trigger_1 ); | |
| 247 | static TIMER_CALLBACK_PTR( pokey_pot_trigger_2 ); | |
| 248 | static TIMER_CALLBACK_PTR( pokey_pot_trigger_3 ); | |
| 249 | static TIMER_CALLBACK_PTR( pokey_pot_trigger_4 ); | |
| 250 | static TIMER_CALLBACK_PTR( pokey_pot_trigger_5 ); | |
| 251 | static TIMER_CALLBACK_PTR( pokey_pot_trigger_6 ); | |
| 252 | static TIMER_CALLBACK_PTR( pokey_pot_trigger_7 ); | |
| 242 | static TIMER_CALLBACK( pokey_timer_expire ); | |
| 243 | static TIMER_CALLBACK( pokey_pot_trigger ); | |
| 253 | 244 | |
| 254 | 245 | |
| 255 | 246 | #define SAMPLE -1 |
| r1355 | r1356 | |
| 675 | 666 | chip->clockmult = DIV_64; |
| 676 | 667 | chip->KBCODE = 0x09; /* Atari 800 'no key' */ |
| 677 | 668 | chip->SKCTL = SK_RESET; /* let the RNG run after reset */ |
| 678 | chip->rtimer = timer_alloc(NULL); | |
| 669 | chip->rtimer = timer_alloc(NULL, NULL); | |
| 679 | 670 | |
| 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); | |
| 683 | 674 | |
| 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); | |
| 692 | 683 | |
| 693 | 684 | chip->pot_r[0] = chip->intf.pot_r[0]; |
| 694 | 685 | chip->pot_r[1] = chip->intf.pot_r[1]; |
| r1355 | r1356 | |
| 710 | 701 | return chip; |
| 711 | 702 | } |
| 712 | 703 | |
| 713 | static | |
| 704 | static TIMER_CALLBACK( pokey_timer_expire | |
| 714 | 705 | { |
| 706 | struct POKEYregisters *p = ptr; | |
| 707 | int timers = param; | |
| 708 | ||
| 715 | 709 | LOG_TIMER(("POKEY #%p timer %d with IRQEN $%02x\n", p, timers, p->IRQEN)); |
| 716 | 710 | |
| 717 | 711 | /* check if some of the requested timer interrupts are enabled */ |
| r1355 | r1356 | |
| 727 | 721 | } |
| 728 | 722 | } |
| 729 | 723 | |
| 730 | static TIMER_CALLBACK_PTR( pokey_timer_expire_1 ) | |
| 731 | { | |
| 732 | struct POKEYregisters *chip = param; | |
| 733 | pokey_timer_expire_common(chip, chip->timer_param[TIMER1]); | |
| 734 | } | |
| 735 | static TIMER_CALLBACK_PTR( pokey_timer_expire_2 ) | |
| 736 | { | |
| 737 | struct POKEYregisters *chip = param; | |
| 738 | pokey_timer_expire_common(chip, chip->timer_param[TIMER2]); | |
| 739 | } | |
| 740 | static 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 | ||
| 746 | 724 | #if VERBOSE_SOUND |
| 747 | 725 | static char *audc2str(int val) |
| 748 | 726 | { |
| r1355 | r1356 | |
| 795 | 773 | } |
| 796 | 774 | #endif |
| 797 | 775 | |
| 798 | static TIMER_CALLBACK | |
| 776 | static TIMER_CALLBACK | |
| 799 | 777 | { |
| 800 | struct POKEYregisters *p = p | |
| 778 | struct POKEYregisters *p = ptr | |
| 801 | 779 | if( p->IRQEN & IRQ_SERIN ) |
| 802 | 780 | { |
| 803 | 781 | /* set the enabled timer irq status bits */ |
| r1355 | r1356 | |
| 808 | 786 | } |
| 809 | 787 | } |
| 810 | 788 | |
| 811 | static TIMER_CALLBACK | |
| 789 | static TIMER_CALLBACK | |
| 812 | 790 | { |
| 813 | struct POKEYregisters *p = p | |
| 791 | struct POKEYregisters *p = ptr | |
| 814 | 792 | if( p->IRQEN & IRQ_SEROR ) |
| 815 | 793 | { |
| 816 | 794 | p->IRQST |= IRQ_SEROR; |
| r1355 | r1356 | |
| 819 | 797 | } |
| 820 | 798 | } |
| 821 | 799 | |
| 822 | static TIMER_CALLBACK | |
| 800 | static TIMER_CALLBACK | |
| 823 | 801 | { |
| 824 | struct POKEYregisters *p = p | |
| 802 | struct POKEYregisters *p = ptr | |
| 825 | 803 | if( p->IRQEN & IRQ_SEROC ) |
| 826 | 804 | { |
| 827 | 805 | p->IRQST |= IRQ_SEROC; |
| r1355 | r1356 | |
| 830 | 808 | } |
| 831 | 809 | } |
| 832 | 810 | |
| 833 | static | |
| 811 | static TIMER_CALLBACK( pokey_pot_trigger | |
| 834 | 812 | { |
| 813 | struct POKEYregisters *p = ptr; | |
| 814 | int pot = param; | |
| 835 | 815 | LOG(("POKEY #%p POT%d triggers after %dus\n", p, pot, (int)(1000000 * attotime_to_double(timer_timeelapsed(p->ptimer[pot]))))); |
| 836 | 816 | p->ALLPOT &= ~(1 << pot); /* set the enabled timer irq status bits */ |
| 837 | 817 | } |
| 838 | 818 | |
| 839 | static TIMER_CALLBACK_PTR( pokey_pot_trigger_0 ) { pokey_pot_trigger_common(param, 0); } | |
| 840 | static TIMER_CALLBACK_PTR( pokey_pot_trigger_1 ) { pokey_pot_trigger_common(param, 1); } | |
| 841 | static TIMER_CALLBACK_PTR( pokey_pot_trigger_2 ) { pokey_pot_trigger_common(param, 2); } | |
| 842 | static TIMER_CALLBACK_PTR( pokey_pot_trigger_3 ) { pokey_pot_trigger_common(param, 3); } | |
| 843 | static TIMER_CALLBACK_PTR( pokey_pot_trigger_4 ) { pokey_pot_trigger_common(param, 4); } | |
| 844 | static TIMER_CALLBACK_PTR( pokey_pot_trigger_5 ) { pokey_pot_trigger_common(param, 5); } | |
| 845 | static TIMER_CALLBACK_PTR( pokey_pot_trigger_6 ) { pokey_pot_trigger_common(param, 6); } | |
| 846 | static TIMER_CALLBACK_PTR( pokey_pot_trigger_7 ) { pokey_pot_trigger_common(param, 7); } | |
| 847 | ||
| 848 | 819 | #define AD_TIME ((p->SKCTL & SK_PADDLE) ? p->ad_time_fast : p->ad_time_slow) |
| 849 | 820 | |
| 850 | 821 | static void pokey_potgo(struct POKEYregisters *p) |
| r1355 | r1356 | |
| 870 | 841 | |
| 871 | 842 | /* final value */ |
| 872 | 843 | p->POTx[pot] = r; |
| 873 | timer_adjust | |
| 844 | timer_adjust | |
| 874 | 845 | } |
| 875 | 846 | } |
| 876 | 847 | } |
| r1355 | r1356 | |
| 1137 | 1108 | /* first remove any existing timers */ |
| 1138 | 1109 | LOG_TIMER(("POKEY #%d STIMER $%02x\n", chip, data)); |
| 1139 | 1110 | |
| 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); | |
| 1143 | 1114 | |
| 1144 | 1115 | /* reset all counters to zero (side effect) */ |
| 1145 | 1116 | p->polyadjust = 0; |
| r1355 | r1356 | |
| 1157 | 1128 | /* set timer #1 _and_ #2 event after timer_div clocks of joined CHAN1+CHAN2 */ |
| 1158 | 1129 | p->timer_period[TIMER2] = attotime_mul(p->clock_period, p->divisor[CHAN2]); |
| 1159 | 1130 | p->timer_param[TIMER2] = (chip<<3)|IRQ_TIMR2|IRQ_TIMR1; |
| 1160 | timer_adjust | |
| 1131 | timer_adjust | |
| 1161 | 1132 | } |
| 1162 | 1133 | } |
| 1163 | 1134 | else |
| r1355 | r1356 | |
| 1168 | 1139 | /* set timer #1 event after timer_div clocks of CHAN1 */ |
| 1169 | 1140 | p->timer_period[TIMER1] = attotime_mul(p->clock_period, p->divisor[CHAN1]); |
| 1170 | 1141 | p->timer_param[TIMER1] = (chip<<3)|IRQ_TIMR1; |
| 1171 | timer_adjust | |
| 1142 | timer_adjust | |
| 1172 | 1143 | } |
| 1173 | 1144 | |
| 1174 | 1145 | if( p->divisor[CHAN2] > 4 ) |
| r1355 | r1356 | |
| 1177 | 1148 | /* set timer #2 event after timer_div clocks of CHAN2 */ |
| 1178 | 1149 | p->timer_period[TIMER2] = attotime_mul(p->clock_period, p->divisor[CHAN2]); |
| 1179 | 1150 | p->timer_param[TIMER2] = (chip<<3)|IRQ_TIMR2; |
| 1180 | timer_adjust | |
| 1151 | timer_adjust | |
| 1181 | 1152 | } |
| 1182 | 1153 | } |
| 1183 | 1154 | |
| r1355 | r1356 | |
| 1194 | 1165 | /* set timer #4 event after timer_div clocks of CHAN4 */ |
| 1195 | 1166 | p->timer_period[TIMER4] = attotime_mul(p->clock_period, p->divisor[CHAN4]); |
| 1196 | 1167 | p->timer_param[TIMER4] = (chip<<3)|IRQ_TIMR4; |
| 1197 | timer_adjust | |
| 1168 | timer_adjust | |
| 1198 | 1169 | } |
| 1199 | 1170 | } |
| 1200 | 1171 | } |
| r1355 | r1356 | |
| 1206 | 1177 | /* set timer #4 event after timer_div clocks of CHAN4 */ |
| 1207 | 1178 | p->timer_period[TIMER4] = attotime_mul(p->clock_period, p->divisor[CHAN4]); |
| 1208 | 1179 | p->timer_param[TIMER4] = (chip<<3)|IRQ_TIMR4; |
| 1209 | timer_adjust | |
| 1180 | timer_adjust | |
| 1210 | 1181 | } |
| 1211 | 1182 | } |
| 1212 | 1183 | |
| r1355 | r1356 | |
| 1236 | 1207 | * loaders from Ballblazer and Escape from Fractalus |
| 1237 | 1208 | * The real times are unknown |
| 1238 | 1209 | */ |
| 1239 | timer_set | |
| 1210 | timer_set | |
| 1240 | 1211 | /* 10 bits (assumption 1 start, 8 data and 1 stop bit) take how long? */ |
| 1241 | timer_set | |
| 1212 | timer_set | |
| 1242 | 1213 | break; |
| 1243 | 1214 | |
| 1244 | 1215 | case IRQEN_C: |
| r1355 | r1356 | |
| 1303 | 1274 | if( new_val < p->counter[CHAN1] ) |
| 1304 | 1275 | p->counter[CHAN1] = new_val; |
| 1305 | 1276 | if( p->interrupt_cb && p->timer[TIMER1] ) |
| 1306 | timer_adjust | |
| 1277 | timer_adjust | |
| 1307 | 1278 | p->audible[CHAN1] = !( |
| 1308 | 1279 | (p->AUDC[CHAN1] & VOLUME_ONLY) || |
| 1309 | 1280 | (p->AUDC[CHAN1] & VOLUME_MASK) == 0 || |
| r1355 | r1356 | |
| 1339 | 1310 | if( new_val < p->counter[CHAN2] ) |
| 1340 | 1311 | p->counter[CHAN2] = new_val; |
| 1341 | 1312 | if( p->interrupt_cb && p->timer[TIMER2] ) |
| 1342 | timer_adjust | |
| 1313 | timer_adjust | |
| 1343 | 1314 | p->audible[CHAN2] = !( |
| 1344 | 1315 | (p->AUDC[CHAN2] & VOLUME_ONLY) || |
| 1345 | 1316 | (p->AUDC[CHAN2] & VOLUME_MASK) == 0 || |
| r1355 | r1356 | |
| 1404 | 1375 | if( new_val < p->counter[CHAN4] ) |
| 1405 | 1376 | p->counter[CHAN4] = new_val; |
| 1406 | 1377 | if( p->interrupt_cb && p->timer[TIMER4] ) |
| 1407 | timer_adjust | |
| 1378 | timer_adjust | |
| 1408 | 1379 | p->audible[CHAN4] = !( |
| 1409 | 1380 | (p->AUDC[CHAN4] & VOLUME_ONLY) || |
| 1410 | 1381 | (p->AUDC[CHAN4] & VOLUME_MASK) == 0 || |
| r1355 | r1356 | |
| 1452 | 1423 | void pokey1_serin_ready(int after) |
| 1453 | 1424 | { |
| 1454 | 1425 | struct POKEYregisters *p = sndti_token(SOUND_POKEY, 0); |
| 1455 | timer_set | |
| 1426 | timer_set | |
| 1456 | 1427 | } |
| 1457 | 1428 | |
| 1458 | 1429 | void pokey2_serin_ready(int after) |
| 1459 | 1430 | { |
| 1460 | 1431 | struct POKEYregisters *p = sndti_token(SOUND_POKEY, 1); |
| 1461 | timer_set | |
| 1432 | timer_set | |
| 1462 | 1433 | } |
| 1463 | 1434 | |
| 1464 | 1435 | void pokey3_serin_ready(int after) |
| 1465 | 1436 | { |
| 1466 | 1437 | struct POKEYregisters *p = sndti_token(SOUND_POKEY, 2); |
| 1467 | timer_set | |
| 1438 | timer_set | |
| 1468 | 1439 | } |
| 1469 | 1440 | |
| 1470 | 1441 | void pokey4_serin_ready(int after) |
| 1471 | 1442 | { |
| 1472 | 1443 | struct POKEYregisters *p = sndti_token(SOUND_POKEY, 3); |
| 1473 | timer_set | |
| 1444 | timer_set | |
| 1474 | 1445 | } |
| 1475 | 1446 | |
| 1476 | 1447 | static void pokey_break_w(int chip, int shift) |
| r1355 | r1356 | |
|---|---|---|
| 117 | 117 | sp->playing = 1; |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | static TIMER_CALLBACK | |
| 120 | static TIMER_CALLBACK | |
| 121 | 121 | { |
| 122 | struct sp0250 *sp = p | |
| 122 | struct sp0250 *sp = ptr | |
| 123 | 123 | stream_update(sp->stream); |
| 124 | 124 | } |
| 125 | 125 | |
| r1355 | r1356 | |
| 200 | 200 | sp->RNG = 1; |
| 201 | 201 | sp->drq = intf->drq_callback; |
| 202 | 202 | sp->drq(ASSERT_LINE); |
| 203 | timer_pulse | |
| 203 | timer_pulse | |
| 204 | 204 | |
| 205 | 205 | sp->stream = stream_create(0, 1, clock / CLOCK_DIVIDER, sp, sp0250_update); |
| 206 | 206 |
| r1355 | r1356 | |
|---|---|---|
| 783 | 783 | |
| 784 | 784 | #ifdef USE_MAME_TIMERS |
| 785 | 785 | |
| 786 | static TIMER_CALLBACK | |
| 786 | static TIMER_CALLBACK | |
| 787 | 787 | { |
| 788 | YM2151 *chip = p | |
| 788 | YM2151 *chip = ptr | |
| 789 | 789 | int oldstate = chip->irqlinestate; |
| 790 | 790 | |
| 791 | 791 | chip->irqlinestate |= 1; |
| r1355 | r1356 | |
| 793 | 793 | if (oldstate == 0 && chip->irqhandler) (*chip->irqhandler)(1); |
| 794 | 794 | } |
| 795 | 795 | |
| 796 | static TIMER_CALLBACK | |
| 796 | static TIMER_CALLBACK | |
| 797 | 797 | { |
| 798 | YM2151 *chip = p | |
| 798 | YM2151 *chip = ptr | |
| 799 | 799 | int oldstate = chip->irqlinestate; |
| 800 | 800 | |
| 801 | 801 | chip->irqlinestate |= 2; |
| r1355 | r1356 | |
| 803 | 803 | if (oldstate == 0 && chip->irqhandler) (*chip->irqhandler)(1); |
| 804 | 804 | } |
| 805 | 805 | |
| 806 | static TIMER_CALLBACK | |
| 806 | static TIMER_CALLBACK | |
| 807 | 807 | { |
| 808 | YM2151 *chip = p | |
| 808 | YM2151 *chip = ptr | |
| 809 | 809 | int oldstate = chip->irqlinestate; |
| 810 | 810 | |
| 811 | 811 | chip->irqlinestate &= ~1; |
| r1355 | r1356 | |
| 813 | 813 | if (oldstate == 1 && chip->irqhandler) (*chip->irqhandler)(0); |
| 814 | 814 | } |
| 815 | 815 | |
| 816 | static TIMER_CALLBACK | |
| 816 | static TIMER_CALLBACK | |
| 817 | 817 | { |
| 818 | YM2151 *chip = p | |
| 818 | YM2151 *chip = ptr | |
| 819 | 819 | int oldstate = chip->irqlinestate; |
| 820 | 820 | |
| 821 | 821 | chip->irqlinestate &= ~2; |
| r1355 | r1356 | |
| 823 | 823 | if (oldstate == 2 && chip->irqhandler) (*chip->irqhandler)(0); |
| 824 | 824 | } |
| 825 | 825 | |
| 826 | static TIMER_CALLBACK | |
| 826 | static TIMER_CALLBACK | |
| 827 | 827 | { |
| 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); | |
| 830 | 830 | chip->timer_A_index_old = chip->timer_A_index; |
| 831 | 831 | if (chip->irq_enable & 0x04) |
| 832 | 832 | { |
| 833 | 833 | chip->status |= 1; |
| 834 | timer_set | |
| 834 | timer_set | |
| 835 | 835 | } |
| 836 | 836 | if (chip->irq_enable & 0x80) |
| 837 | 837 | chip->csm_req = 2; /* request KEY ON / KEY OFF sequence */ |
| 838 | 838 | } |
| 839 | static TIMER_CALLBACK | |
| 839 | static TIMER_CALLBACK | |
| 840 | 840 | { |
| 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); | |
| 843 | 843 | chip->timer_B_index_old = chip->timer_B_index; |
| 844 | 844 | if (chip->irq_enable & 0x08) |
| 845 | 845 | { |
| 846 | 846 | chip->status |= 2; |
| 847 | timer_set | |
| 847 | timer_set | |
| 848 | 848 | } |
| 849 | 849 | } |
| 850 | 850 | #if 0 |
| 851 | static TIMER_CALLBACK | |
| 851 | static TIMER_CALLBACK | |
| 852 | 852 | { |
| 853 | YM2151 *chip = p | |
| 853 | YM2151 *chip = ptr | |
| 854 | 854 | chip->status &= 0x7f; /* reset busy flag */ |
| 855 | 855 | } |
| 856 | 856 | #endif |
| r1355 | r1356 | |
| 1056 | 1056 | #if 0 |
| 1057 | 1057 | /* There is no info on what YM2151 really does when busy flag is set */ |
| 1058 | 1058 | if ( chip->status & 0x80 ) return; |
| 1059 | timer_set | |
| 1059 | timer_set | |
| 1060 | 1060 | chip->status |= 0x80; /* set busy flag for 64 chip clock cycles */ |
| 1061 | 1061 | #endif |
| 1062 | 1062 | |
| r1355 | r1356 | |
| 1107 | 1107 | { |
| 1108 | 1108 | #ifdef USE_MAME_TIMERS |
| 1109 | 1109 | chip->status &= ~1; |
| 1110 | timer_set | |
| 1110 | timer_set | |
| 1111 | 1111 | #else |
| 1112 | 1112 | int oldstate = chip->status & 3; |
| 1113 | 1113 | chip->status &= ~1; |
| r1355 | r1356 | |
| 1119 | 1119 | { |
| 1120 | 1120 | #ifdef USE_MAME_TIMERS |
| 1121 | 1121 | chip->status &= ~2; |
| 1122 | timer_set | |
| 1122 | timer_set | |
| 1123 | 1123 | #else |
| 1124 | 1124 | int oldstate = chip->status & 3; |
| 1125 | 1125 | chip->status &= ~2; |
| r1355 | r1356 | |
| 1133 | 1133 | /* start timer _only_ if it wasn't already started (it will reload time value next round) */ |
| 1134 | 1134 | if (!timer_enable(chip->timer_B, 1)) |
| 1135 | 1135 | { |
| 1136 | timer_adjust | |
| 1136 | timer_adjust | |
| 1137 | 1137 | chip->timer_B_index_old = chip->timer_B_index; |
| 1138 | 1138 | } |
| 1139 | 1139 | #else |
| r1355 | r1356 | |
| 1158 | 1158 | /* start timer _only_ if it wasn't already started (it will reload time value next round) */ |
| 1159 | 1159 | if (!timer_enable(chip->timer_A, 1)) |
| 1160 | 1160 | { |
| 1161 | timer_adjust | |
| 1161 | timer_adjust | |
| 1162 | 1162 | chip->timer_A_index_old = chip->timer_A_index; |
| 1163 | 1163 | } |
| 1164 | 1164 | #else |
| r1355 | r1356 | |
| 1542 | 1542 | |
| 1543 | 1543 | #ifdef USE_MAME_TIMERS |
| 1544 | 1544 | /* 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); | |
| 1547 | 1547 | #else |
| 1548 | 1548 | PSG->tim_A = 0; |
| 1549 | 1549 | PSG->tim_B = 0; |
| r1355 | r1356 | |
|---|---|---|
| 308 | 308 | CheckPendingIRQ(SCSP); |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | static TIMER_CALLBACK | |
| 311 | static TIMER_CALLBACK | |
| 312 | 312 | { |
| 313 | struct _SCSP *SCSP = (struct _SCSP *)p | |
| 313 | struct _SCSP *SCSP = (struct _SCSP *)ptr | |
| 314 | 314 | |
| 315 | 315 | SCSP->TimCnt[0] = 0xFFFF; |
| 316 | 316 | SCSP->udata.data[0x20/2]|=0x40; |
| r1355 | r1356 | |
| 320 | 320 | CheckPendingIRQ(SCSP); |
| 321 | 321 | } |
| 322 | 322 | |
| 323 | static TIMER_CALLBACK | |
| 323 | static TIMER_CALLBACK | |
| 324 | 324 | { |
| 325 | struct _SCSP *SCSP = (struct _SCSP *)p | |
| 325 | struct _SCSP *SCSP = (struct _SCSP *)ptr | |
| 326 | 326 | |
| 327 | 327 | SCSP->TimCnt[1] = 0xFFFF; |
| 328 | 328 | SCSP->udata.data[0x20/2]|=0x80; |
| r1355 | r1356 | |
| 332 | 332 | CheckPendingIRQ(SCSP); |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | static TIMER_CALLBACK | |
| 335 | static TIMER_CALLBACK | |
| 336 | 336 | { |
| 337 | struct _SCSP *SCSP = (struct _SCSP *)p | |
| 337 | struct _SCSP *SCSP = (struct _SCSP *)ptr | |
| 338 | 338 | |
| 339 | 339 | SCSP->TimCnt[2] = 0xFFFF; |
| 340 | 340 | SCSP->udata.data[0x20/2]|=0x100; |
| r1355 | r1356 | |
| 524 | 524 | } |
| 525 | 525 | } |
| 526 | 526 | |
| 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); | |
| 530 | 530 | |
| 531 | 531 | for(i=0;i<0x400;++i) |
| 532 | 532 | { |
| r1355 | r1356 | |
| 720 | 720 | time = (44100 / SCSP->TimPris[0]) / (255-(SCSP->udata.data[0x18/2]&0xff)); |
| 721 | 721 | if (time) |
| 722 | 722 | { |
| 723 | timer_adjust | |
| 723 | timer_adjust | |
| 724 | 724 | } |
| 725 | 725 | } |
| 726 | 726 | } |
| r1355 | r1356 | |
| 739 | 739 | time = (44100 / SCSP->TimPris[1]) / (255-(SCSP->udata.data[0x1A/2]&0xff)); |
| 740 | 740 | if (time) |
| 741 | 741 | { |
| 742 | timer_adjust | |
| 742 | timer_adjust | |
| 743 | 743 | } |
| 744 | 744 | } |
| 745 | 745 | } |
| r1355 | r1356 | |
| 758 | 758 | time = (44100 / SCSP->TimPris[2]) / (255-(SCSP->udata.data[0x1C/2]&0xff)); |
| 759 | 759 | if (time) |
| 760 | 760 | { |
| 761 | timer_adjust | |
| 761 | timer_adjust | |
| 762 | 762 | } |
| 763 | 763 | } |
| 764 | 764 | } |
| r1355 | r1356 | |
|---|---|---|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /* Timer overflow callback from timer.c */ |
| 72 | static TIMER_CALLBACK | |
| 72 | static TIMER_CALLBACK | |
| 73 | 73 | { |
| 74 | struct ym2610_info *info = p | |
| 74 | struct ym2610_info *info = ptr | |
| 75 | 75 | YM2610TimerOver(info->chip,0); |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | static TIMER_CALLBACK | |
| 78 | static TIMER_CALLBACK | |
| 79 | 79 | { |
| 80 | struct ym2610_info *info = p | |
| 80 | struct ym2610_info *info = ptr | |
| 81 | 81 | YM2610TimerOver(info->chip,1); |
| 82 | 82 | } |
| 83 | 83 | |
| r1355 | r1356 | |
| 93 | 93 | attotime period = attotime_mul(ATTOTIME_IN_HZ(clock), count); |
| 94 | 94 | |
| 95 | 95 | if (!timer_enable(info->timer[c], 1)) |
| 96 | timer_adjust | |
| 96 | timer_adjust | |
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | |
| r1355 | r1356 | |
| 138 | 138 | if (!info->psg) return NULL; |
| 139 | 139 | |
| 140 | 140 | /* 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); | |
| 143 | 143 | |
| 144 | 144 | /* stream system initialize */ |
| 145 | 145 | info->stream = stream_create(0,2,rate,info,ym2610_stream_update); |
| r1355 | r1356 | |
| 190 | 190 | if (!info->psg) return NULL; |
| 191 | 191 | |
| 192 | 192 | /* 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); | |
| 195 | 195 | |
| 196 | 196 | /* stream system initialize */ |
| 197 | 197 | info->stream = stream_create(0,2,rate,info,ym2610b_stream_update); |
| r1355 | r1356 | |
|---|---|---|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | |
| 167 | static TIMER_CALLBACK | |
| 167 | static TIMER_CALLBACK | |
| 168 | 168 | { |
| 169 | struct ics2115 *chip = p | |
| 169 | struct ics2115 *chip = ptr | |
| 170 | 170 | chip->irq_pend |= 1<<0; |
| 171 | 171 | recalc_irq(chip); |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | static TIMER_CALLBACK | |
| 174 | static TIMER_CALLBACK | |
| 175 | 175 | { |
| 176 | struct ics2115 *chip = p | |
| 176 | struct ics2115 *chip = ptr | |
| 177 | 177 | chip->irq_pend |= 1<<1; |
| 178 | 178 | recalc_irq(chip); |
| 179 | 179 | } |
| r1355 | r1356 | |
| 195 | 195 | if(chip->timer[timer].period != period) { |
| 196 | 196 | chip->timer[timer].period = period; |
| 197 | 197 | if(period) |
| 198 | timer_adjust | |
| 198 | timer_adjust | |
| 199 | 199 | else |
| 200 | timer_adjust | |
| 200 | timer_adjust | |
| 201 | 201 | } |
| 202 | 202 | } |
| 203 | 203 | |
| r1355 | r1356 | |
| 458 | 458 | chip->intf = config; |
| 459 | 459 | chip->index = sndindex; |
| 460 | 460 | 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); | |
| 463 | 463 | chip->ulaw = auto_malloc(256*sizeof(INT16)); |
| 464 | 464 | chip->stream = stream_create(0, 2, 33075, chip, update); |
| 465 | 465 | |
| r1355 | r1356 | |
| 532 | 532 | chip->irq_en = 0; |
| 533 | 533 | chip->irq_pend = 0; |
| 534 | 534 | 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); | |
| 537 | 537 | chip->timer[0].period = 0; |
| 538 | 538 | chip->timer[1].period = 0; |
| 539 | 539 | recalc_irq(chip); |
| r1355 | r1356 | |
|---|---|---|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /* Timer overflow callback from timer.c */ |
| 72 | static TIMER_CALLBACK | |
| 72 | static TIMER_CALLBACK | |
| 73 | 73 | { |
| 74 | struct ym2608_info *info = p | |
| 74 | struct ym2608_info *info = ptr | |
| 75 | 75 | YM2608TimerOver(info->chip,0); |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | static TIMER_CALLBACK | |
| 78 | static TIMER_CALLBACK | |
| 79 | 79 | { |
| 80 | struct ym2608_info *info = p | |
| 80 | struct ym2608_info *info = ptr | |
| 81 | 81 | YM2608TimerOver(info->chip,1); |
| 82 | 82 | } |
| 83 | 83 | |
| r1355 | r1356 | |
| 92 | 92 | { /* Start FM Timer */ |
| 93 | 93 | attotime period = attotime_mul(ATTOTIME_IN_HZ(clock), count); |
| 94 | 94 | if (!timer_enable(info->timer[c], 1)) |
| 95 | timer_adjust | |
| 95 | timer_adjust | |
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | |
| r1355 | r1356 | |
| 135 | 135 | if (!info->psg) return NULL; |
| 136 | 136 | |
| 137 | 137 | /* 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); | |
| 140 | 140 | |
| 141 | 141 | /* stream system initialize */ |
| 142 | 142 | info->stream = stream_create(0,2,rate,info,ym2608_stream_update); |
| r1355 | r1356 | |
|---|---|---|
| 352 | 352 | chip->irq_callback(chip->irq_line); |
| 353 | 353 | } |
| 354 | 354 | |
| 355 | static TIMER_CALLBACK | |
| 355 | static TIMER_CALLBACK | |
| 356 | 356 | { |
| 357 | YMF278BChip *chip = p | |
| 357 | YMF278BChip *chip = ptr | |
| 358 | 358 | if(!(chip->enable & 0x40)) |
| 359 | 359 | { |
| 360 | 360 | chip->current_irq |= 0x40; |
| r1355 | r1356 | |
| 362 | 362 | } |
| 363 | 363 | } |
| 364 | 364 | |
| 365 | static TIMER_CALLBACK | |
| 365 | static TIMER_CALLBACK | |
| 366 | 366 | { |
| 367 | YMF278BChip *chip = p | |
| 367 | YMF278BChip *chip = ptr | |
| 368 | 368 | if(!(chip->enable & 0x20)) |
| 369 | 369 | { |
| 370 | 370 | chip->current_irq |= 0x20; |
| r1355 | r1356 | |
| 381 | 381 | if (chip->clock != YMF278B_STD_CLOCK) |
| 382 | 382 | period = attotime_div(attotime_mul(period, chip->clock), YMF278B_STD_CLOCK); |
| 383 | 383 | |
| 384 | timer_adjust | |
| 384 | timer_adjust | |
| 385 | 385 | } |
| 386 | 386 | else |
| 387 | timer_adjust | |
| 387 | timer_adjust | |
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | static void ymf278b_timer_b_reset(YMF278BChip *chip) |
| r1355 | r1356 | |
| 396 | 396 | if (chip->clock != YMF278B_STD_CLOCK) |
| 397 | 397 | period = attotime_div(attotime_mul(period, chip->clock), YMF278B_STD_CLOCK); |
| 398 | 398 | |
| 399 | timer_adjust | |
| 399 | timer_adjust | |
| 400 | 400 | } |
| 401 | 401 | else |
| 402 | timer_adjust | |
| 402 | timer_adjust | |
| 403 | 403 | } |
| 404 | 404 | |
| 405 | 405 | static void ymf278b_A_w(YMF278BChip *chip, UINT8 reg, UINT8 data) |
| r1355 | r1356 | |
| 670 | 670 | { |
| 671 | 671 | chip->rom = rom; |
| 672 | 672 | 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); | |
| 675 | 675 | chip->irq_line = CLEAR_LINE; |
| 676 | 676 | chip->clock = clock; |
| 677 | 677 |
| r1355 | r1356 | |
|---|---|---|
| 222 | 222 | |
| 223 | 223 | /* setup SH1 timer if necessary */ |
| 224 | 224 | 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 ); | |
| 226 | 226 | |
| 227 | 227 | return ic; |
| 228 | 228 | } |
| r1355 | r1356 | |
|---|---|---|
| 8 | 8 | |
| 9 | 9 | struct K053260_interface { |
| 10 | 10 | int region; /* memory region of sample ROM(s) */ |
| 11 | | |
| 11 | t | |
| 12 | 12 | }; |
| 13 | 13 | |
| 14 | 14 |
| r1355 | r1356 | |
|---|---|---|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /* Timer overflow callback from timer.c */ |
| 58 | static TIMER_CALLBACK | |
| 58 | static TIMER_CALLBACK | |
| 59 | 59 | { |
| 60 | struct ym2203_info *info = p | |
| 60 | struct ym2203_info *info = ptr | |
| 61 | 61 | YM2203TimerOver(info->chip,0); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | static TIMER_CALLBACK | |
| 64 | static TIMER_CALLBACK | |
| 65 | 65 | { |
| 66 | struct ym2203_info *info = p | |
| 66 | struct ym2203_info *info = ptr | |
| 67 | 67 | YM2203TimerOver(info->chip,1); |
| 68 | 68 | } |
| 69 | 69 | |
| r1355 | r1356 | |
| 86 | 86 | { /* Start FM Timer */ |
| 87 | 87 | attotime period = attotime_mul(ATTOTIME_IN_HZ(clock), count); |
| 88 | 88 | if (!timer_enable(info->timer[c], 1)) |
| 89 | timer_adjust | |
| 89 | timer_adjust | |
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | |
| r1355 | r1356 | |
| 119 | 119 | if (!info->psg) return NULL; |
| 120 | 120 | |
| 121 | 121 | /* 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); | |
| 124 | 124 | |
| 125 | 125 | /* stream system initialize */ |
| 126 | 126 | info->stream = stream_create(0,1,rate,info,ym2203_stream_update); |
| r1355 | r1356 | |
|---|---|---|
| 132 | 132 | } |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | static TIMER_CALLBACK | |
| 135 | static TIMER_CALLBACK | |
| 136 | 136 | { |
| 137 | ES5503Osc *osc = p | |
| 137 | ES5503Osc *osc = ptr | |
| 138 | 138 | ES5503Chip *chip = (ES5503Chip *)osc->chip; |
| 139 | 139 | |
| 140 | 140 | stream_update(chip->stream); |
| r1355 | r1356 | |
| 262 | 262 | chip->oscillators[osc].irqpend = 0; |
| 263 | 263 | chip->oscillators[osc].accumulator = 0; |
| 264 | 264 | |
| 265 | chip->oscillators[osc].timer = timer_alloc | |
| 265 | chip->oscillators[osc].timer = timer_alloc | |
| 266 | 266 | chip->oscillators[osc].chip = (void *)chip; |
| 267 | 267 | } |
| 268 | 268 | |
| r1355 | r1356 | |
| 460 | 460 | // ok, we run for this long |
| 461 | 461 | period = attotime_mul(ATTOTIME_IN_HZ(chip->output_rate), length); |
| 462 | 462 | |
| 463 | timer_adjust | |
| 463 | timer_adjust | |
| 464 | 464 | } |
| 465 | 465 | } |
| 466 | 466 | else if (!(chip->oscillators[osc].control & 1) && (data&1)) |
| 467 | 467 | { |
| 468 | 468 | // key off |
| 469 | timer_adjust | |
| 469 | timer_adjust | |
| 470 | 470 | } |
| 471 | 471 | |
| 472 | 472 | chip->oscillators[osc].control = data; |
| r1355 | r1356 | |
|---|---|---|
| 28 | 28 | if (info->intf->handler) (info->intf->handler)(irq); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | static TIMER_CALLBACK | |
| 31 | static TIMER_CALLBACK | |
| 32 | 32 | { |
| 33 | struct ymf262_info *info = p | |
| 33 | struct ymf262_info *info = ptr | |
| 34 | 34 | YMF262TimerOver(info->chip, 0); |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | static TIMER_CALLBACK | |
| 37 | static TIMER_CALLBACK | |
| 38 | 38 | { |
| 39 | struct ymf262_info *info = p | |
| 39 | struct ymf262_info *info = ptr | |
| 40 | 40 | YMF262TimerOver(info->chip, 1); |
| 41 | 41 | } |
| 42 | 42 | |
| r1355 | r1356 | |
| 49 | 49 | } |
| 50 | 50 | else |
| 51 | 51 | { /* Start FM Timer */ |
| 52 | timer_adjust | |
| 52 | timer_adjust | |
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | |
| r1355 | r1356 | |
| 89 | 89 | YMF262SetIRQHandler (info->chip, IRQHandler_262, info); |
| 90 | 90 | YMF262SetUpdateHandler(info->chip, _stream_update, info); |
| 91 | 91 | |
| 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); | |
| 94 | 94 | |
| 95 | 95 | return info; |
| 96 | 96 | } |
| r1355 | r1356 | |
|---|---|---|
| 374 | 374 | |
| 375 | 375 | /* loop while we have a handler */ |
| 376 | 376 | 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); | |
| 378 | 378 | |
| 379 | 379 | /* clear the handler and force an update */ |
| 380 | 380 | ui_set_handler(handler_ingame, 0); |
| 381 | video_frame_update(); | |
| 381 | video_frame_update(FALSE); | |
| 382 | 382 | } |
| 383 | 383 | |
| 384 | 384 | /* if we're the empty driver, force the menus on */ |
| r1355 | r1356 | |
| 407 | 407 | if (force || (curtime - lastupdatetime) > osd_ticks_per_second() / 4) |
| 408 | 408 | { |
| 409 | 409 | lastupdatetime = curtime; |
| 410 | video_frame_update(); | |
| 410 | video_frame_update(FALSE); | |
| 411 | 411 | } |
| 412 | 412 | } |
| 413 | 413 |
| r1355 | r1356 | |
|---|---|---|
| 194 | 194 | finalmix = auto_malloc(Machine->sample_rate * sizeof(*finalmix)); |
| 195 | 195 | |
| 196 | 196 | /* allocate a global timer for sound timing */ |
| 197 | sound_update_timer = timer_alloc(sound_update); | |
| 197 | sound_update_timer = timer_alloc(sound_update, NULL); | |
| 198 | 198 | timer_adjust(sound_update_timer, update_frequency, 0, update_frequency); |
| 199 | 199 | |
| 200 | 200 | /* initialize the streams engine */ |
| r1355 | r1356 | |
|---|---|---|
| 39 | 39 | #define VIDEO_UPDATE(name) UINT32 video_update_##name(running_machine *machine, int screen, mame_bitmap *bitmap, const rectangle *cliprect) |
| 40 | 40 | |
| 41 | 41 | /* NULL versions */ |
| 42 | #define driver_init_NULL NULL | |
| 43 | 42 | #define nvram_handler_NULL NULL |
| 44 | 43 | #define memcard_handler_NULL NULL |
| 45 | 44 | #define machine_start_NULL NULL |
| r1355 | r1356 | |
| 283 | 282 | |
| 284 | 283 | #define MDRV_CPU_REPLACE(tag, _type, _clock) \ |
| 285 | 284 | cpu = driver_find_cpu(machine, tag); \ |
| 286 | cpu->type = (CPU_##_type); \ | |
| 287 | cpu->clock = (_clock); \ | |
| 285 | cpu->type = (CPU_##_type); \ | |
| 286 | cpu->clock = (_clock); \ | |
| 288 | 287 | |
| 289 | 288 | |
| 290 | 289 | /* CPU parameters */ |
| 291 | 290 | #define MDRV_CPU_FLAGS(_flags) \ |
| 292 | 291 | if (cpu) \ |
| 293 | cpu->flags = (_flags); \ | |
| 292 | cpu->flags = (_flags); \ | |
| 294 | 293 | |
| 295 | 294 | #define MDRV_CPU_CONFIG(config) \ |
| 296 | 295 | if (cpu) \ |
| r1355 | r1356 | |
| 508 | 507 | ***************************************************************************/ |
| 509 | 508 | |
| 510 | 509 | #define GAME(YEAR,NAME,PARENT,MACHINE,INPUT,INIT,MONITOR,COMPANY,FULLNAME,FLAGS) \ |
| 511 | game_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)) | |
| 526 | 511 | |
| 527 | 512 | #define GAMEL(YEAR,NAME,PARENT,MACHINE,INPUT,INIT,MONITOR,COMPANY,FULLNAME,FLAGS,LAYOUT) \ |
| 528 | game_driver driver_##NAME = \ | |
| 513 | const game_driver driver_##NAME = \ | |
| 529 | 514 | { \ |
| 530 | 515 | __FILE__, \ |
| 531 | 516 | #PARENT, \ |
| r1355 | r1356 | |
| 552 | 537 | |
| 553 | 538 | extern const game_driver * const drivers[]; |
| 554 | 539 | |
| 555 | extern game_driver driver_empty; | |
| 540 | extern const game_driver driver_empty; | |
| 556 | 541 | |
| 557 | 542 | |
| 558 | 543 | /*************************************************************************** |
| r1355 | r1356 | |
|---|---|---|
| 306 | 306 | if (event_index >= MAX_INPUT_EVENTS) |
| 307 | 307 | { |
| 308 | 308 | input_event_index[cpunum][line]--; |
| 309 | cpunum_empty_event_queue(Machine, cpunum | (line << 8)); | |
| 309 | cpunum_empty_event_queue(Machine, NULL, cpunum | (line << 8)); | |
| 310 | 310 | event_index = input_event_index[cpunum][line]++; |
| 311 | 311 | logerror("Exceeded pending input line event queue on CPU %d!\n", cpunum); |
| 312 | 312 | } |
| r1355 | r1356 | |
| 318 | 318 | |
| 319 | 319 | /* if this is the first one, set the timer */ |
| 320 | 320 | 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); | |
| 322 | 322 | } |
| 323 | 323 | } |
| 324 | 324 | } |
| r1355 | r1356 | |
|---|---|---|
| 45 | 45 | /* in timer.h: typedef struct _emu_timer emu_timer; */ |
| 46 | 46 | struct _emu_timer |
| 47 | 47 | { |
| 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; | |
| 54 | 53 | const char * file; |
| 55 | 54 | int line; |
| 56 | 55 | const char * func; |
| 57 | 56 | UINT8 enabled; |
| 58 | 57 | UINT8 temporary; |
| 59 | UINT8 ptr; | |
| 60 | 58 | attotime period; |
| 61 | 59 | attotime start; |
| 62 | 60 | attotime expire; |
| r1355 | r1356 | |
| 324 | 322 | callback_timer_expire_time = timer->expire; |
| 325 | 323 | |
| 326 | 324 | /* call the callback */ |
| 327 | if (was_enabled) | |
| 325 | if (was_enabled && timer->callback != NULL) | |
| 328 | 326 | { |
| 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); | |
| 343 | 331 | } |
| 344 | 332 | |
| 345 | 333 | /* clear the callback timer global */ |
| r1355 | r1356 | |
| 392 | 380 | |
| 393 | 381 | /* use different instances to differentiate the bits */ |
| 394 | 382 | state_save_push_tag(0); |
| 395 | state_save_register_item(buf, count, timer-> | |
| 383 | state_save_register_item(buf, count, timer-> | |
| 396 | 384 | state_save_register_item(buf, count, timer->enabled); |
| 397 | 385 | state_save_register_item(buf, count, timer->period.seconds); |
| 398 | 386 | state_save_register_item(buf, count, timer->period.attoseconds); |
| r1355 | r1356 | |
| 414 | 402 | emu_timer *t; |
| 415 | 403 | |
| 416 | 404 | /* remove all timers and make a private list */ |
| 417 | while (timer_head) | |
| 405 | while (timer_head != NULL) | |
| 418 | 406 | { |
| 419 | 407 | t = timer_head; |
| 420 | 408 | |
| r1355 | r1356 | |
| 432 | 420 | } |
| 433 | 421 | |
| 434 | 422 | /* now add them all back in; this effectively re-sorts them by time */ |
| 435 | while (privlist) | |
| 423 | while (privlist != NULL) | |
| 436 | 424 | { |
| 437 | 425 | t = privlist; |
| 438 | 426 | privlist = t->next; |
| r1355 | r1356 | |
| 474 | 462 | isn't primed yet |
| 475 | 463 | -------------------------------------------------*/ |
| 476 | 464 | |
| 477 | INLINE emu_timer *_timer_alloc_common( | |
| 465 | INLINE emu_timer *_timer_alloc_common(t | |
| 478 | 466 | { |
| 479 | 467 | attotime time = get_current_time(); |
| 480 | 468 | emu_timer *timer = timer_new(); |
| 481 | 469 | |
| 482 | 470 | /* fill in the record */ |
| 483 | 471 | 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; | |
| 487 | 474 | timer->enabled = FALSE; |
| 488 | 475 | timer->temporary = temp; |
| 489 | timer->ptr = (callback_ptr != NULL); | |
| 490 | 476 | timer->period = attotime_zero; |
| 491 | 477 | timer->file = file; |
| 492 | 478 | timer->line = line; |
| r1355 | r1356 | |
| 508 | 494 | return timer; |
| 509 | 495 | } |
| 510 | 496 | |
| 511 | emu_timer *_timer_alloc | |
| 497 | emu_timer *_timer_alloc_ | |
| 512 | 498 | { |
| 513 | return _timer_alloc_common(callback, | |
| 499 | return _timer_alloc_common(callback, ptr | |
| 514 | 500 | } |
| 515 | 501 | |
| 516 | emu_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 | } | |
| 520 | 502 | |
| 521 | ||
| 522 | 503 | /*------------------------------------------------- |
| 523 | 504 | timer_remove - remove a timer from the |
| 524 | 505 | system |
| r1355 | r1356 | |
| 554 | 535 | fire periodically |
| 555 | 536 | -------------------------------------------------*/ |
| 556 | 537 | |
| 557 | ||
| 538 | ||
| 558 | 539 | { |
| 559 | 540 | attotime time = get_current_time(); |
| 560 | 541 | |
| r1355 | r1356 | |
| 563 | 544 | callback_timer_modified = TRUE; |
| 564 | 545 | |
| 565 | 546 | /* compute the time of the next firing and insert into the list */ |
| 566 | which-> | |
| 547 | which-> | |
| 567 | 548 | which->enabled = TRUE; |
| 568 | 549 | |
| 569 | 550 | /* clamp negative times to 0 */ |
| r1355 | r1356 | |
| 585 | 566 | activecpu_abort_timeslice(); |
| 586 | 567 | } |
| 587 | 568 | |
| 588 | void 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 | } | |
| 594 | 569 | |
| 595 | void 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 | } | |
| 601 | 570 | |
| 602 | ||
| 603 | ||
| 604 | 571 | /*************************************************************************** |
| 605 | 572 | SIMPLIFIED ANONYMOUS TIMER MANAGEMENT |
| 606 | 573 | ***************************************************************************/ |
| r1355 | r1356 | |
| 611 | 578 | period |
| 612 | 579 | -------------------------------------------------*/ |
| 613 | 580 | |
| 614 | void _timer_pulse(attotime period, INT32 param, | |
| 581 | void _timer_pulse_internal(attotime period, void *ptr, INT32 param, t | |
| 615 | 582 | { |
| 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); | |
| 619 | 584 | timer_adjust(timer, period, param, period); |
| 620 | 585 | } |
| 621 | 586 | |
| 622 | void _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); | |
| 625 | 587 | |
| 626 | /* adjust to our liking */ | |
| 627 | timer_adjust_ptr(timer, period, period); | |
| 628 | } | |
| 629 | ||
| 630 | ||
| 631 | 588 | /*------------------------------------------------- |
| 632 | 589 | timer_set - allocate a one-shot timer, which |
| 633 | 590 | calls the callback after the given duration |
| 634 | 591 | -------------------------------------------------*/ |
| 635 | 592 | |
| 636 | void _timer_set(attotime duration, INT32 param, | |
| 593 | void _timer_set_internal(attotime duration, void *ptr, INT32 param, t | |
| 637 | 594 | { |
| 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); | |
| 641 | 596 | timer_adjust(timer, duration, param, attotime_zero); |
| 642 | 597 | } |
| 643 | 598 | |
| 644 | void _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); | |
| 647 | 599 | |
| 648 | /* adjust to our liking */ | |
| 649 | timer_adjust_ptr(timer, duration, attotime_zero); | |
| 650 | } | |
| 651 | 600 | |
| 652 | ||
| 653 | ||
| 654 | 601 | /*************************************************************************** |
| 655 | 602 | MISCELLANEOUS CONTROLS |
| 656 | 603 | ***************************************************************************/ |
| r1355 | r1356 | |
| 661 | 608 | |
| 662 | 609 | void timer_reset(emu_timer *which, attotime duration) |
| 663 | 610 | { |
| 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); | |
| 669 | 612 | } |
| 670 | 613 | |
| 671 | 614 | |
| r1355 | r1356 | |
| 708 | 651 | |
| 709 | 652 | int timer_get_param(emu_timer *which) |
| 710 | 653 | { |
| 711 | return which-> | |
| 654 | return which-> | |
| 712 | 655 | } |
| 713 | 656 | |
| 714 | 657 | |
| 715 | 658 | void *timer_get_param_ptr(emu_timer *which) |
| 716 | 659 | { |
| 717 | return which-> | |
| 660 | return which-> | |
| 718 | 661 | } |
| 719 | 662 | |
| 720 | 663 |
| r1355 | r1356 | |
|---|---|---|
| 87 | 87 | LAYER_CONFIG_ENABLE_SCREEN_OVERLAY) |
| 88 | 88 | |
| 89 | 89 | /* 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 */ | |
| 90 | enum | |
| 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 | }; | |
| 97 | 100 | |
| 98 | 101 | /* 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 */ | |
| 102 | enum | |
| 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 | }; | |
| 103 | 109 | |
| 104 | 110 | |
| 105 | 111 | /* flags for primitives */ |
| r1355 | r1356 | |
|---|---|---|
| 1500 | 1500 | /* ----- initialize string table ----- */ |
| 1501 | 1501 | InitStringTable(); |
| 1502 | 1502 | |
| 1503 | periodic_timer = timer_alloc(cheat_periodic); | |
| 1503 | periodic_timer = timer_alloc(cheat_periodic, NULL); | |
| 1504 | 1504 | timer_adjust(periodic_timer, attotime_make(0, Machine->screen[0].refresh), 0, attotime_make(0, Machine->screen[0].refresh)); |
| 1505 | 1505 | |
| 1506 | 1506 | add_exit_callback(machine, cheat_exit); |
| r1355 | r1356 | |
|---|---|---|
| 37 | 37 | #define PERIOD_OF_555_ASTABLE(r1,r2,c) ATTOTIME_IN_NSEC((attoseconds_t)( 693000000 * ((double)(r1) + 2.0 * (double)(r2)) * (double)(c))) |
| 38 | 38 | |
| 39 | 39 | /* 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) | |
| 46 | 44 | |
| 47 | 45 | /* 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) | |
| 50 | 47 | |
| 51 | 48 | |
| 52 | 49 | |
| r1355 | r1356 | |
| 54 | 51 | TYPE DEFINITIONS |
| 55 | 52 | ***************************************************************************/ |
| 56 | 53 | |
| 54 | /* a timer callback looks like this */ | |
| 55 | typedef void (*timer_callback)(running_machine *machine, void *ptr, INT32 param); | |
| 56 | ||
| 57 | 57 | /* opaque type for representing a timer */ |
| 58 | 58 | typedef struct _emu_timer emu_timer; |
| 59 | 59 | |
| r1355 | r1356 | |
| 104 | 104 | /* ----- core timer management ----- */ |
| 105 | 105 | |
| 106 | 106 | /* allocate a permament timer that isn't primed yet */ |
| 107 | emu_timer *_timer_alloc(void (*callback)(running_machine *, int), const char *file, int line, const char *func); | |
| 108 | emu_timer *_timer_alloc_ptr(void (*callback)(running_machine *, void *), void *param, const char *file, int line, const char *func); | |
| 107 | emu_timer *_timer_alloc_internal(timer_callback callback, void *param, const char *file, int line, const char *func); | |
| 109 | 108 | |
| 110 | 109 | /* adjust the time when this timer will fire, and whether or not it will fire periodically */ |
| 111 | 110 | void timer_adjust(emu_timer *which, attotime duration, INT32 param, attotime period); |
| 112 | void timer_adjust_ptr(emu_timer *which, attotime duration, attotime period); | |
| 113 | 111 | |
| 114 | 112 | |
| 115 | 113 | |
| 116 | 114 | /* ----- anonymous timer management ----- */ |
| 117 | 115 | |
| 118 | /* allocate a pulse timer, which repeatedly calls the callback using the given period */ | |
| 119 | void _timer_pulse(attotime period, INT32 param, void (*callback)(running_machine *, int), const char *file, int line, const char *func); | |
| 120 | void _timer_pulse_ptr(attotime period, void *param, void (*callback)(running_machine *, void *), const char *file, int line, const char *func); | |
| 121 | ||
| 122 | 116 | /* allocate a one-shot timer, which calls the callback after the given duration */ |
| 123 | void _timer_set(attotime duration, INT32 param, void (*callback)(running_machine *, int), const char *file, int line, const char *func); | |
| 124 | void _timer_set_ptr(attotime duration, void *param, void (*callback)(running_machine *, void *), const char *file, int line, const char *func); | |
| 117 | void _timer_set_internal(attotime druation, void *ptr, INT32 param, timer_callback callback, const char *file, int line, const char *func); | |
| 125 | 118 | |
| 119 | /* allocate a pulse timer, which repeatedly calls the callback using the given period */ | |
| 120 | void _timer_pulse_internal(attotime period, void *ptr, INT32 param, timer_callback callback, const char *file, int line, const char *func); | |
| 126 | 121 | |
| 127 | 122 | |
| 123 | ||
| 128 | 124 | /* ----- miscellaneous controls ----- */ |
| 129 | 125 | |
| 130 | 126 | /* reset the timing on a timer */ |
| r1355 | r1356 | |
| 160 | 156 | attotime timer_firetime(emu_timer *which); |
| 161 | 157 | |
| 162 | 158 | |
| 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 | ||
| 174 | INLINE void timer_call_after_resynch(INT32 param, void (*callback)(running_machine *, int)) | |
| 175 | { | |
| 176 | timer_set(attotime_zero, param, callback); | |
| 177 | } | |
| 178 | ||
| 179 | INLINE 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 | ||
| 185 | 159 | #endif /* __TIMER_H__ */ |
| r1355 | r1356 | |
|---|---|---|
| 27 | 27 | return image_lookuptag(img, FLOPDRVTAG); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | static TIMER_CALLBACK | |
| 30 | static TIMER_CALLBACK | |
| 31 | 31 | |
| 32 | 32 | /* this is called on device init */ |
| 33 | 33 | int floppy_drive_init(mess_image *img, const floppy_interface *iface) |
| r1355 | r1356 | |
| 44 | 44 | pDrive->flags = 0; |
| 45 | 45 | pDrive->index_pulse_callback = NULL; |
| 46 | 46 | pDrive->ready_state_change_callback = NULL; |
| 47 | pDrive->index_timer = timer_alloc | |
| 47 | pDrive->index_timer = timer_alloc | |
| 48 | 48 | pDrive->index = 0; |
| 49 | 49 | |
| 50 | 50 | /* all drives are double-sided 80 track - can be overriden in driver! */ |
| r1355 | r1356 | |
| 65 | 65 | |
| 66 | 66 | |
| 67 | 67 | /* index pulses at rpm/60 Hz, and stays high 1/20th of time */ |
| 68 | static | |
| 68 | static void | |
| 69 | 69 | { |
| 70 | mess_image *img = (mess_image *) param; | |
| 71 | 70 | struct floppy_drive *pDrive = get_drive(img); |
| 72 | 71 | |
| 73 | 72 | double ms = 1000. / (pDrive->rpm / 60.); |
| r1355 | r1356 | |
| 75 | 74 | if (pDrive->index) |
| 76 | 75 | { |
| 77 | 76 | pDrive->index = 0; |
| 78 | timer_adjust | |
| 77 | timer_adjust | |
| 79 | 78 | } |
| 80 | 79 | else |
| 81 | 80 | { |
| 82 | 81 | pDrive->index = 1; |
| 83 | timer_adjust | |
| 82 | timer_adjust | |
| 84 | 83 | } |
| 85 | 84 | |
| 86 | 85 | if (pDrive->index_pulse_callback) |
| r1355 | r1356 | |
| 88 | 87 | } |
| 89 | 88 | |
| 90 | 89 | |
| 90 | ||
| 91 | static TIMER_CALLBACK(floppy_drive_index_callback) | |
| 92 | { | |
| 93 | mess_image *image = (mess_image *) ptr; | |
| 94 | floppy_drive_index_func(image); | |
| 95 | } | |
| 96 | ||
| 97 | ||
| 98 | ||
| 91 | 99 | /* set the callback for the index pulse */ |
| 92 | 100 | void floppy_drive_set_index_pulse_callback(mess_image *img, void (*callback)(mess_image *image, int state)) |
| 93 | 101 | { |
| r1355 | r1356 | |
| 209 | 217 | /* check it's in range */ |
| 210 | 218 | |
| 211 | 219 | /* setup timer to trigger at rpm */ |
| 212 | floppy_drive_index_c | |
| 220 | floppy_drive_index_func | |
| 213 | 221 | } |
| 214 | 222 | else |
| 215 | 223 | { |
| 216 | 224 | /* on->off */ |
| 217 | timer_adjust | |
| 225 | timer_adjust | |
| 218 | 226 | } |
| 219 | 227 | } |
| 220 | 228 | } |
| r1355 | r1356 | |
|---|---|---|
| 47 | 47 | bi->last_pulse_time = 0.0; |
| 48 | 48 | bi->recorded_pulses = 0; |
| 49 | 49 | bi->value = config->initial_value; |
| 50 | bi->timeout_timer = timer_alloc(bitbanger_overthreshhold); | |
| 50 | bi->timeout_timer = timer_alloc(bitbanger_overthreshhold, NULL); | |
| 51 | 51 | bi->over_threshhold = 1; |
| 52 | 52 | |
| 53 | 53 | bitbangers[id] = bi; |
| r1355 | r1356 | |
|---|---|---|
| 1036 | 1036 | |
| 1037 | 1037 | |
| 1038 | 1038 | /* complete command (by read, write, or timeout) */ |
| 1039 | static | |
| 1039 | static void | |
| 1040 | 1040 | { |
| 1041 | 1041 | LOG (( "%f thmfc_floppy_cmd_complete_cb: cmd=%i off=%i/%i/%i\n", |
| 1042 | 1042 | attotime_to_double(timer_get_time()), thmfc1->op, thmfc1->data_idx, |
| r1355 | r1356 | |
| 1057 | 1057 | |
| 1058 | 1058 | |
| 1059 | 1059 | |
| 1060 | static TIMER_CALLBACK( thmfc_floppy_cmd_complete_cb ) | |
| 1061 | { | |
| 1062 | thmfc_floppy_cmd_complete(); | |
| 1063 | } | |
| 1064 | ||
| 1065 | ||
| 1066 | ||
| 1060 | 1067 | /* intelligent read: show just one field, skip header */ |
| 1061 | 1068 | static UINT8 thmfc_floppy_read_byte ( void ) |
| 1062 | 1069 | { |
| r1355 | r1356 | |
| 1068 | 1075 | data )); |
| 1069 | 1076 | |
| 1070 | 1077 | if ( thmfc1->data_idx >= thmfc1->data_size - 1 ) |
| 1071 | thmfc_floppy_cmd_complete | |
| 1078 | thmfc_floppy_cmd_complete | |
| 1072 | 1079 | else |
| 1073 | 1080 | thmfc1->data_idx++; |
| 1074 | 1081 | |
| r1355 | r1356 | |
| 1216 | 1223 | thmfc1->data_raw_size = 0; |
| 1217 | 1224 | thmfc1->data[ thmfc1->data_idx ] = data; |
| 1218 | 1225 | if ( thmfc1->data_idx >= thmfc1->data_size - 1 ) |
| 1219 | thmfc_floppy_cmd_complete | |
| 1226 | thmfc_floppy_cmd_complete | |
| 1220 | 1227 | else |
| 1221 | 1228 | thmfc1->data_idx++; |
| 1222 | 1229 | } |
| r1355 | r1356 | |
| 1565 | 1572 | thmfc1 = auto_malloc( sizeof( *thmfc1 ) ); |
| 1566 | 1573 | assert( thmfc1 ); |
| 1567 | 1574 | |
| 1568 | thmfc_floppy_cmd = timer_alloc( thmfc_floppy_cmd_complete_cb ); | |
| 1575 | thmfc_floppy_cmd = timer_alloc( thmfc_floppy_cmd_complete_cb, NULL ); | |
| 1569 | 1576 | |
| 1570 | 1577 | state_save_register_global( thmfc1->op ); |
| 1571 | 1578 | state_save_register_global( thmfc1->sector ); |
| r1355 | r1356 | |
| 1611 | 1618 | { |
| 1612 | 1619 | LOG(( "%f ans3\n", attotime_to_double(timer_get_time()) )); |
| 1613 | 1620 | mc6854_set_cts( 1 ); |
| 1614 | timer_set( ATTOTIME_IN_USEC( 100 ), 0, ans4 ); | |
| 1621 | timer_set( ATTOTIME_IN_USEC( 100 ), NULL, 0, ans4 ); | |
| 1615 | 1622 | } |
| 1616 | 1623 | |
| 1617 | 1624 | static TIMER_CALLBACK( ans2 ) |
| 1618 | 1625 | { |
| 1619 | 1626 | LOG(( "%f ans2\n", attotime_to_double(timer_get_time()) )); |
| 1620 | 1627 | mc6854_set_cts( 0 ); |
| 1621 | timer_set( ATTOTIME_IN_USEC( 100 ), 0, ans3 ); | |
| 1628 | timer_set( ATTOTIME_IN_USEC( 100 ), NULL, 0, ans3 ); | |
| 1622 | 1629 | } |
| 1623 | 1630 | |
| 1624 | 1631 | static TIMER_CALLBACK( ans ) |
| 1625 | 1632 | { |
| 1626 | 1633 | LOG(( "%f ans\n", attotime_to_double(timer_get_time()) )); |
| 1627 | 1634 | mc6854_set_cts( 1 ); |
| 1628 | timer_set( ATTOTIME_IN_USEC( 100 ), 0, ans2 ); | |
| 1635 | timer_set( ATTOTIME_IN_USEC( 100 ), NULL, 0, ans2 ); | |
| 1629 | 1636 | } |
| 1630 | 1637 | /* consigne DKBOOT |
| 1631 | 1638 | |
| r1355 | r1356 | |
| 1667 | 1674 | if ( data[1] == 0xff ) |
| 1668 | 1675 | { |
| 1669 | 1676 | 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 ); | |
| 1671 | 1678 | mc6854_set_cts( 0 ); |
| 1672 | 1679 | } |
| 1673 | 1680 | else if ( ! data[1] ) |
| r1355 | r1356 | |
|---|---|---|
| 23 | 23 | |
| 24 | 24 | |
| 25 | 25 | |
| 26 | static TIMER_CALLBACK | |
| 26 | static TIMER_CALLBACK | |
| 27 | 27 | { |
| 28 | struct snapquick_info *si = (struct snapquick_info *) p | |
| 28 | struct snapquick_info *si = (struct snapquick_info *) ptr | |
| 29 | 29 | snapquick_loadproc loadproc; |
| 30 | 30 | const char *file_type; |
| 31 | 31 | |
| r1355 | r1356 | |
| 63 | 63 | |
| 64 | 64 | delay = device_get_info_double(&si->dev->devclass, DEVINFO_FLOAT_SNAPSHOT_DELAY); |
| 65 | 65 | |
| 66 | timer_set | |
| 66 | timer_set | |
| 67 | 67 | return INIT_PASS; |
| 68 | 68 | } |
| 69 | 69 |
| r1355 | r1356 | |
|---|---|---|
| 791 | 791 | if (offset_end == 0) |
| 792 | 792 | offset_end = offset_start + verify_data_size - 1; |
| 793 | 793 | |
| 794 | /* what type of memory are we validating? */ | |
| 794 | 795 | region = current_command->u.verify_args.mem_region; |
| 795 | 796 | if (region) |
| 796 | 797 | { |
| 798 | /* we're validating a conventional memory region */ | |
| 797 | 799 | target_data = memory_region(region); |
| 798 | 800 | target_data_size = memory_region_length(region); |
| 799 | 801 | } |
| 800 | 802 | else |
| 801 | 803 | { |
| 804 | /* we're validating mess_ram */ | |
| 802 | 805 | target_data = mess_ram; |
| 803 | 806 | target_data_size = mess_ram_size; |
| 804 | 807 | } |
| r1355 | r1356 | |
| 823 | 826 | return; |
| 824 | 827 | } |
| 825 | 828 | |
| 829 | /* loop through the memory, verifying it byte by byte */ | |
| 826 | 830 | for (offset = offset_start; offset <= offset_end; offset++) |
| 827 | 831 | { |
| 828 | 832 | if (verify_data[i] != target_data[offset]) |
| r1355 | r1356 | |
|---|---|---|
| 663 | 663 | mea8000_init_tables(); |
| 664 | 664 | mea8000.channel = channel; |
| 665 | 665 | mea8000.req_out_func = req_out_func; |
| 666 | mea8000.timer = timer_alloc( mea8000_timer_expire ); | |
| 666 | mea8000.timer = timer_alloc( mea8000_timer_expire , NULL); | |
| 667 | 667 | |
| 668 | 668 | state_save_register_item( "mea8000", 0, mea8000.state ); |
| 669 | 669 | state_save_register_item_array( "mea8000", 0, mea8000.buf ); |
| r1355 | r1356 | |
|---|---|---|
| 167 | 167 | dave.one_khz_state = 0; |
| 168 | 168 | dave.fifty_hz_count = DAVE_FIFTY_HZ_COUNTER_RELOAD; |
| 169 | 169 | 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); | |
| 171 | 171 | |
| 172 | 172 | for (i=0; i<3; i++) |
| 173 | 173 | { |
| r1355 | r1356 | |
|---|---|---|
| 101 | 101 | void c364_speech_init(void) |
| 102 | 102 | { |
| 103 | 103 | memset(&speech, 0, sizeof(speech)); |
| 104 | speech.timer = timer_alloc(c364_speech_timer); | |
| 104 | speech.timer = timer_alloc(c364_speech_timer, NULL); | |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | WRITE8_HANDLER(c364_speech_w) |
| r1355 | r1356 | |
|---|---|---|
| 145 | 145 | y = video_screen_get_vpos(0); |
| 146 | 146 | |
| 147 | 147 | 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); | |
| 149 | 149 | ula_irq_active = 1; |
| 150 | 150 | scanline = BITMAP_ADDR16(bitmap, y, 0); |
| 151 | 151 | |
| r1355 | r1356 | |
| 185 | 185 | |
| 186 | 186 | VIDEO_START( zx ) |
| 187 | 187 | { |
| 188 | ula_nmi = timer_alloc(zx_ula_nmi); | |
| 188 | ula_nmi = timer_alloc(zx_ula_nmi, NULL); | |
| 189 | 189 | ula_irq_active = 0; |
| 190 | 190 | video_start_generic_bitmapped(machine); |
| 191 | 191 | } |
| r1355 | r1356 | |
|---|---|---|
| 237 | 237 | else |
| 238 | 238 | vdt[unit].cursor_address_mask = 0x7ff; /* 2 kb of RAM */ |
| 239 | 239 | |
| 240 | timer_set(attotime_zero, unit, setup_beep); | |
| 240 | timer_set(attotime_zero, NULL, unit, setup_beep); | |
| 241 | 241 | |
| 242 | 242 | /* 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); | |
| 244 | 244 | |
| 245 | 245 | /* alloc beep timer */ |
| 246 | vdt[unit].beep_timer = timer_alloc(beep_callback); | |
| 246 | vdt[unit].beep_timer = timer_alloc(beep_callback, NULL); | |
| 247 | 247 | |
| 248 | 248 | return 0; |
| 249 | 249 | } |
| r1355 | r1356 | |
|---|---|---|
| 1049 | 1049 | /* set the scanline update function */ |
| 1050 | 1050 | update_scanline = gb_update_scanline; |
| 1051 | 1051 | |
| 1052 | gb_lcd.lcd_timer = timer_alloc( gb_lcd_timer_proc ); | |
| 1052 | gb_lcd.lcd_timer = timer_alloc( gb_lcd_timer_proc , NULL); | |
| 1053 | 1053 | timer_adjust( gb_lcd.lcd_timer, ATTOTIME_IN_CYCLES(456,0), 0, attotime_never ); |
| 1054 | 1054 | } |
| 1055 | 1055 |
| r1355 | r1356 | |
|---|---|---|
| 1180 | 1180 | vga.monitor.get_columns = ega_get_crtc_columns; |
| 1181 | 1181 | vga.monitor.get_sync_lines = vga_get_crtc_sync_lines; |
| 1182 | 1182 | 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); | |
| 1184 | 1184 | pc_video_start(NULL, pc_ega_choosevideomode, 0); |
| 1185 | 1185 | } |
| 1186 | 1186 | |
| r1355 | r1356 | |
| 1195 | 1195 | vga.monitor.get_columns=vga_get_crtc_columns; |
| 1196 | 1196 | vga.monitor.get_sync_lines=vga_get_crtc_sync_lines; |
| 1197 | 1197 | 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); | |
| 1199 | 1199 | pc_video_start(NULL, pc_vga_choosevideomode, 0); |
| 1200 | 1200 | } |
| 1201 | 1201 |
| r1355 | r1356 | |
|---|---|---|
| 100 | 100 | /********************************************************************* |
| 101 | 101 | Lightpen |
| 102 | 102 | *********************************************************************/ |
| 103 | static | |
| 103 | static void | |
| 104 | 104 | { |
| 105 | 105 | if (vectrex_lightpen_port & 1) |
| 106 | 106 | { |
| r1355 | r1356 | |
| 113 | 113 | } |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | static TIMER_CALLBACK(lightpen_trigger_callback) | |
| 117 | { | |
| 118 | lightpen_trigger(); | |
| 119 | } | |
| 120 | ||
| 116 | 121 | static int lightpen_check (void) |
| 117 | 122 | { |
| 118 | 123 | int dx,dy; |
| r1355 | r1356 | |
| 269 | 274 | |
| 270 | 275 | imager_freq = 1; |
| 271 | 276 | |
| 272 | imager_timer = timer_alloc(vectrex_imager_right_eye); | |
| 277 | imager_timer = timer_alloc(vectrex_imager_right_eye, NULL); | |
| 273 | 278 | timer_adjust(imager_timer, ATTOTIME_IN_HZ(imager_freq), 2, ATTOTIME_IN_HZ(imager_freq)); |
| 274 | 279 | |
| 275 | lp_t = timer_alloc(lightpen_trigger); | |
| 280 | lp_t = timer_alloc(lightpen_trigger_callback, NULL); | |
| 276 | 281 | |
| 277 | 282 | video_start_vector(machine); |
| 278 | 283 | } |
| r1355 | r1356 | |
| 427 | 432 | start_time = time_now; |
| 428 | 433 | } |
| 429 | 434 | if (data & lightpen_check()) |
| 430 | lightpen_trigger( | |
| 435 | lightpen_trigger( | |
| 431 | 436 | |
| 432 | 437 | blank = data; |
| 433 | 438 | } |
| r1355 | r1356 | |
|---|---|---|
| 122 | 122 | |
| 123 | 123 | VIDEO_START( aim65 ) |
| 124 | 124 | { |
| 125 | print_timer = timer_alloc(aim65_printer_timer); | |
| 125 | print_timer = timer_alloc(aim65_printer_timer, NULL); | |
| 126 | 126 | |
| 127 | 127 | /* |
| 128 | 128 | videoram_size = 600 * 10 * 2; |
| r1355 | r1356 | |
|---|---|---|
| 1853 | 1853 | } |
| 1854 | 1854 | |
| 1855 | 1855 | /* 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); | |
| 1860 | 1860 | |
| 1861 | 1861 | /* setup dimensions */ |
| 1862 | 1862 | m6847->top_border_scanlines = v->top_border_scanlines; |
| r1355 | r1356 | |
|---|---|---|
| 1162 | 1162 | state_save_register_global( thom_floppy_rcount ); |
| 1163 | 1163 | output_set_value( "floppy", 0 ); |
| 1164 | 1164 | |
| 1165 | thom_video_timer = timer_alloc( NULL ); | |
| 1165 | thom_video_timer = timer_alloc( NULL , NULL); | |
| 1166 | 1166 | |
| 1167 | thom_scanline_timer = timer_alloc( thom_scanline_start ); | |
| 1167 | thom_scanline_timer = timer_alloc( thom_scanline_start , NULL); | |
| 1168 | 1168 | |
| 1169 | 1169 | thom_lightpen_nb = 0; |
| 1170 | 1170 | thom_lightpen_cb = NULL; |
| 1171 | thom_lightpen_timer = timer_alloc( thom_lightpen_step ); | |
| 1171 | thom_lightpen_timer = timer_alloc( thom_lightpen_step , NULL); | |
| 1172 | 1172 | state_save_register_global( thom_lightpen_nb ); |
| 1173 | 1173 | |
| 1174 | 1174 | thom_init_cb = NULL; |
| 1175 | thom_init_timer = timer_alloc( thom_set_init ); | |
| 1175 | thom_init_timer = timer_alloc( thom_set_init , NULL); | |
| 1176 | 1176 | |
| 1177 | 1177 | video_eof_thom(machine); |
| 1178 | 1178 |
| r1355 | r1356 | |
|---|---|---|
| 61 | 61 | |
| 62 | 62 | VIDEO_START( abc80 ) |
| 63 | 63 | { |
| 64 | abc80_blink_timer = timer_alloc(abc80_blink_tick); | |
| 64 | abc80_blink_timer = timer_alloc(abc80_blink_tick, NULL); | |
| 65 | 65 | timer_adjust(abc80_blink_timer, attotime_zero, 0, ATTOTIME_IN_HZ(ABC80_XTAL/2/6/64/312/16)); |
| 66 | 66 | |
| 67 | 67 | tx_tilemap = tilemap_create(abc80_get_tile_info, abc80_tilemap_scan, |
| r1355 | r1356 | |
|---|---|---|
| 341 | 341 | if(data & 0x08) // text screen raster copy |
| 342 | 342 | { |
| 343 | 343 | 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. | |
| 345 | 345 | } |
| 346 | 346 | if(data & 0x02) // high-speed graphic screen clear |
| 347 | 347 | { |
| r1355 | r1356 | |
| 367 | 367 | { |
| 368 | 368 | fillbitmap(x68k_gfx_3_bitmap_16,0,&rect); |
| 369 | 369 | } |
| 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. | |
| 371 | 371 | // popmessage("CRTC: High-speed gfx screen clear [0x%02x]",sys.crtc.reg[21] & 0x0f); |
| 372 | 372 | } |
| 373 | 373 | break; |
| r1355 | r1356 | |
|---|---|---|
| 703 | 703 | if ((data >> 8) & ATARIST_BLITTER_CTRL_BUSY) |
| 704 | 704 | { |
| 705 | 705 | 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); | |
| 707 | 707 | } |
| 708 | 708 | } |
| 709 | 709 | } |
| r1355 | r1356 | |
| 717 | 717 | |
| 718 | 718 | VIDEO_START( atarist ) |
| 719 | 719 | { |
| 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); | |
| 722 | 722 | |
| 723 | 723 | timer_adjust(atarist_shifter_timer, video_screen_get_time_until_pos(0,0,0), 0, ATTOTIME_IN_HZ(Y2/4)); // 125 ns |
| 724 | 724 | timer_adjust(atarist_glue_timer, video_screen_get_time_until_pos(0,0,0), 0, ATTOTIME_IN_HZ(Y2/16)); // 500 ns |
| r1355 | r1356 | |
|---|---|---|
| 68 | 68 | /* initialise flash timer */ |
| 69 | 69 | vh_state.flash_count = 0; |
| 70 | 70 | 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); | |
| 72 | 72 | /* mode */ |
| 73 | 73 | oric_vh_update_attribute((1<<3)|(1<<4)); |
| 74 | 74 | } |
| r1355 | r1356 | |
|---|---|---|
| 786 | 786 | if (LIGHTPEN_BUTTON) |
| 787 | 787 | { |
| 788 | 788 | /* 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); | |
| 790 | 790 | } |
| 791 | 791 | //state_display(vic2.bitmap); |
| 792 | 792 | } |
| r1355 | r1356 | |
|---|---|---|
| 110 | 110 | |
| 111 | 111 | VIDEO_START( zx8301 ) |
| 112 | 112 | { |
| 113 | zx8301_flash_timer = timer_alloc(zx8301_flash_tick); | |
| 113 | zx8301_flash_timer = timer_alloc(zx8301_flash_tick, NULL); | |
| 114 | 114 | timer_adjust(zx8301_flash_timer, ATTOTIME_IN_HZ(2), 0, ATTOTIME_IN_HZ(2)); |
| 115 | 115 | |
| 116 | 116 | state_save_register_global(zx8301.dispoff); |
| r1355 | r1356 | |
|---|---|---|
| 811 | 811 | } |
| 812 | 812 | |
| 813 | 813 | /* GIME field sync timer */ |
| 814 | video->gime_fs_timer = timer_alloc(gime_fs); | |
| 814 | video->gime_fs_timer = timer_alloc(gime_fs, NULL); | |
| 815 | 815 | |
| 816 | 816 | /* initialize the CoCo video code */ |
| 817 | 817 | memset(&cfg, 0, sizeof(cfg)); |
| r1355 | r1356 | |
|---|---|---|
| 210 | 210 | |
| 211 | 211 | set_display_settings(); |
| 212 | 212 | |
| 213 | smsvdp.smsvdp_display_timer = timer_alloc( smsvdp_display_callback ); | |
| 213 | smsvdp.smsvdp_display_timer = timer_alloc( smsvdp_display_callback , NULL); | |
| 214 | 214 | timer_adjust( smsvdp.smsvdp_display_timer, video_screen_get_time_until_pos( 0, 0, 0 ), 0, video_screen_get_scan_period( 0 ) ); |
| 215 | 215 | return 0; |
| 216 | 216 | } |
| r1355 | r1356 | |
| 255 | 255 | smsvdp.status |= STATUS_HINT; |
| 256 | 256 | if ( smsvdp.reg[0x00] & 0x10 ) { |
| 257 | 257 | /* 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 ); | |
| 259 | 259 | } |
| 260 | 260 | } |
| 261 | 261 | |
| r1355 | r1356 | |
| 264 | 264 | smsvdp.status |= STATUS_VINT; |
| 265 | 265 | if ( smsvdp.reg[0x01] & 0x20 ) { |
| 266 | 266 | /* 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 ); | |
| 268 | 268 | } |
| 269 | 269 | } |
| 270 | 270 | if ( video_skip_this_frame() ) { |
| r1355 | r1356 | |
| 299 | 299 | smsvdp.status |= STATUS_HINT; |
| 300 | 300 | if ( smsvdp.reg[0x00] & 0x10 ) { |
| 301 | 301 | /* 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 ); | |
| 303 | 303 | } |
| 304 | 304 | } else { |
| 305 | 305 | smsvdp.line_counter -= 1; |
| r1355 | r1356 | |
|---|---|---|
| 276 | 276 | state_save_register_item("pccga", 0, cga.status); |
| 277 | 277 | state_save_register_item("pccga", 0, cga.plantronics); |
| 278 | 278 | |
| 279 | timer_pulse(ATTOTIME_IN_USEC(133333), 0, cga_timerproc); | |
| 279 | timer_pulse(ATTOTIME_IN_USEC(133333), NULL, 0, cga_timerproc); | |
| 280 | 280 | return 0; |
| 281 | 281 | } |
| 282 | 282 |
| r1355 | r1356 | |
|---|---|---|
| 196 | 196 | |
| 197 | 197 | VIDEO_START( cdp1864 ) |
| 198 | 198 | { |
| 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); | |
| 202 | 202 | |
| 203 | 203 | /* allocate the temporary bitmap */ |
| 204 | 204 | cdptmpbitmap = auto_bitmap_alloc(Machine->screen[0].width, Machine->screen[0].height, Machine->screen[0].format); |
| r1355 | r1356 | |
|---|---|---|
| 1319 | 1319 | if (LIGHTPEN_BUTTON) |
| 1320 | 1320 | { |
| 1321 | 1321 | /* 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); | |
| 1323 | 1323 | } |
| 1324 | 1324 | } |
| 1325 | 1325 | if (vic2.rasterline == C64_2_RASTERLINE (RASTERLINE)) |
| r1355 | r1356 | |
|---|---|---|
| 806 | 806 | |
| 807 | 807 | m6845_remove_vsync_set_timer(); |
| 808 | 808 | |
| 809 | ||
| 809 | | |
| 810 | 810 | { |
| 811 | ||
| 811 | | |
| 812 | 812 | } |
| 813 | 813 | } |
| 814 | 814 | |
| r1355 | r1356 | |
| 824 | 824 | |
| 825 | 825 | if (crtc_cycles_to_vsync_end!=-1) |
| 826 | 826 | { |
| 827 | ||
| 827 | | |
| 828 | 828 | } |
| 829 | 829 | } |
| 830 | 830 |
| r1355 | r1356 | |
|---|---|---|
| 534 | 534 | lines = TED7360_LINES; |
| 535 | 535 | chargenaddr = bitmapaddr = videoaddr = 0; |
| 536 | 536 | 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); | |
| 540 | 540 | } |
| 541 | 541 | |
| 542 | 542 | void ted7360_set_dma (read8_handler dma_read, |
| r1355 | r1356 | |
|---|---|---|
| 149 | 149 | |
| 150 | 150 | VIDEO_START( cdp1861 ) |
| 151 | 151 | { |
| 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); | |
| 155 | 155 | |
| 156 | 156 | /* allocate the temporary bitmap */ |
| 157 | 157 | cdptmpbitmap = auto_bitmap_alloc(Machine->screen[0].width, Machine->screen[0].height, Machine->screen[0].format); |
| r1355 | r1356 | |
|---|---|---|
| 582 | 582 | |
| 583 | 583 | static void setup_keybuffer(void) |
| 584 | 584 | { |
| 585 | inputx_timer = timer_alloc(inputx_timerproc); | |
| 585 | inputx_timer = timer_alloc(inputx_timerproc, NULL); | |
| 586 | 586 | keybuffer = auto_malloc(sizeof(key_buffer)); |
| 587 | 587 | memset(keybuffer, 0, sizeof(*keybuffer)); |
| 588 | 588 | } |
| r1355 | r1356 | |
|---|---|---|
| 259 | 259 | |
| 260 | 260 | /* Set up RTC timer */ |
| 261 | 261 | 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 ); | |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | } |
| r1355 | r1356 | |
|---|---|---|
| 145 | 145 | if ((cassette_input(image_from_devtype_and_index(IO_CASSETTE, 0)) < -0.75) && zx_tape_bit) |
| 146 | 146 | { |
| 147 | 147 | 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); | |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | data &= ~zx_tape_bit; |
| r1355 | r1356 | |
| 209 | 209 | if ((cassette_input(image_from_devtype_and_index(IO_CASSETTE, 0)) < -0.75) && zx_tape_bit) |
| 210 | 210 | { |
| 211 | 211 | 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); | |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | data &= ~zx_tape_bit; |
| r1355 | r1356 | |
|---|---|---|
| 164 | 164 | pdp1_reset_param.hw_mul_div = (config >> pdp1_config_hw_mul_div_bit) & pdp1_config_hw_mul_div_mask; |
| 165 | 165 | pdp1_reset_param.type_20_sbs = (config >> pdp1_config_type_20_sbs_bit) & pdp1_config_type_20_sbs_mask; |
| 166 | 166 | |
| 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); | |
| 171 | 171 | |
| 172 | 172 | /* reset device state */ |
| 173 | 173 | tape_reader.rcl = tape_reader.rc = 0; |
| r1355 | r1356 | |
| 1041 | 1041 | |
| 1042 | 1042 | static void parallel_drum_init(void) |
| 1043 | 1043 | { |
| 1044 | parallel_drum.rotation_timer = timer_alloc(NULL); | |
| 1044 | parallel_drum.rotation_timer = timer_alloc(NULL, NULL); | |
| 1045 | 1045 | timer_adjust(parallel_drum.rotation_timer, PARALLEL_DRUM_ROTATION_TIME, 0, PARALLEL_DRUM_ROTATION_TIME); |
| 1046 | 1046 | |
| 1047 | parallel_drum.il_timer = timer_alloc(il_timer_callback); | |
| 1047 | parallel_drum.il_timer = timer_alloc(il_timer_callback, NULL); | |
| 1048 | 1048 | parallel_drum_set_il(0); |
| 1049 | 1049 | } |
| 1050 | 1050 | #endif |
| r1355 | r1356 | |
|---|---|---|
| 316 | 316 | timer_reset(fdc.seek_timer, attotime_never); |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | static | |
| 319 | static void | |
| 320 | 320 | { |
| 321 | 321 | /* type 0 = data transfer mode in execution phase */ |
| 322 | 322 | if (fdc.timer_type == 0) |
| r1355 | r1356 | |
| 333 | 333 | } |
| 334 | 334 | else |
| 335 | 335 | { |
| 336 | nec765_timer_c | |
| 336 | nec765_timer_func | |
| 337 | 337 | } |
| 338 | 338 | } |
| 339 | 339 | else if (fdc.timer_type==2) |
| r1355 | r1356 | |
| 384 | 384 | } |
| 385 | 385 | } |
| 386 | 386 | |
| 387 | static TIMER_CALLBACK(nec765_timer_callback) | |
| 388 | { | |
| 389 | nec765_timer_func(param); | |
| 390 | } | |
| 391 | ||
| 387 | 392 | /* after (32-27) the DRQ is set, then 27 us later, the int is set. |
| 388 | 393 | I don't know if this is correct, but it is required for the PCW driver. |
| 389 | 394 | In this driver, the first NMI calls the handler function, furthur NMI's are |
| r1355 | r1356 | |
| 400 | 405 | } |
| 401 | 406 | else |
| 402 | 407 | { |
| 403 | nec765_timer_c | |
| 408 | nec765_timer_func | |
| 404 | 409 | timer_reset(fdc.timer, attotime_never); |
| 405 | 410 | } |
| 406 | 411 | } |
| r1355 | r1356 | |
| 673 | 678 | int i; |
| 674 | 679 | |
| 675 | 680 | 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); | |
| 679 | 684 | memset(&nec765_iface, 0, sizeof(nec765_interface)); |
| 680 | 685 | |
| 681 | 686 | if (iface) |
| r1355 | r1356 | |
|---|---|---|
| 292 | 292 | #endif |
| 293 | 293 | for (i=0; i<128; i++) gfx[i]=i; |
| 294 | 294 | |
| 295 | timer_set(ATTOTIME_IN_SEC(1), 0, pc1401_power_up); | |
| 295 | timer_set(ATTOTIME_IN_SEC(1), NULL, 0, pc1401_power_up); | |
| 296 | 296 | |
| 297 | 297 | if (RAM10K) |
| 298 | 298 | { |
| r1355 | r1356 | |
|---|---|---|
| 1717 | 1717 | |
| 1718 | 1718 | MACHINE_RESET( apple2gs ) |
| 1719 | 1719 | { |
| 1720 | apple2gs_scanline_timer = timer_alloc(apple2gs_scanline_tick); | |
| 1720 | apple2gs_scanline_timer = timer_alloc(apple2gs_scanline_tick, NULL); | |
| 1721 | 1721 | timer_adjust(apple2gs_scanline_timer, attotime_never, 0, attotime_never); |
| 1722 | 1722 | |
| 1723 | 1723 | // fire on scanline zero |
| r1355 | r1356 | |
|---|---|---|
| 101 | 101 | { |
| 102 | 102 | applefdc_lines = 0; |
| 103 | 103 | 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); | |
| 105 | 105 | if (intf) |
| 106 | 106 | iwm_intf = *intf; |
| 107 | 107 | else |
| r1355 | r1356 | |
|---|---|---|
| 450 | 450 | hp48_card1=memory_region(REGION_CPU1)+0x140000; |
| 451 | 451 | hp48_card2=memory_region(REGION_CPU1)+0x180000; |
| 452 | 452 | |
| 453 | timer_pulse(ATTOTIME_IN_HZ(8192), 0, hp48_timer); | |
| 453 | timer_pulse(ATTOTIME_IN_HZ(8192), NULL, 0, hp48_timer); | |
| 454 | 454 | } |
| 455 | 455 | |
| 456 | 456 | DRIVER_INIT( hp48g ) |
| r1355 | r1356 | |
| 470 | 470 | hp48_card1=memory_region(REGION_CPU1)+0x140000; |
| 471 | 471 | hp48_card2=memory_region(REGION_CPU1)+0x180000; |
| 472 | 472 | |
| 473 | timer_pulse(ATTOTIME_IN_HZ(8192), 0, hp48_timer); | |
| 473 | timer_pulse(ATTOTIME_IN_HZ(8192), NULL, 0, hp48_timer); | |
| 474 | 474 | } |
| 475 | 475 | |
| 476 | 476 | MACHINE_RESET( hp48 ) |
| r1355 | r1356 | |
|---|---|---|
| 137 | 137 | ppi8255_init(&dai_ppi82555_intf); |
| 138 | 138 | pit8253_init(1, &dai_pit8253_intf); |
| 139 | 139 | |
| 140 | timer_set(attotime_zero, 0, dai_bootstrap_callback); | |
| 140 | timer_set(attotime_zero, NULL, 0, dai_bootstrap_callback); | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | /*************************************************************************** |
| r1355 | r1356 | |
|---|---|---|
| 445 | 445 | if (kbd_comm == TRUE) |
| 446 | 446 | { |
| 447 | 447 | 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); | |
| 449 | 449 | } |
| 450 | 450 | } |
| 451 | 451 | |
| r1355 | r1356 | |
| 456 | 456 | /* Mac pulls CB2 down to initiate communication */ |
| 457 | 457 | kbd_comm = TRUE; |
| 458 | 458 | kbd_receive = TRUE; |
| 459 | timer_set(ATTOTIME_IN_USEC(100), 0, kbd_clock); | |
| 459 | timer_set(ATTOTIME_IN_USEC(100), NULL, 0, kbd_clock); | |
| 460 | 460 | } |
| 461 | 461 | if (kbd_comm == TRUE && kbd_receive == TRUE) |
| 462 | 462 | { |
| r1355 | r1356 | |
| 1327 | 1327 | mac_set_sound_buffer(0); |
| 1328 | 1328 | |
| 1329 | 1329 | 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); | |
| 1331 | 1331 | |
| 1332 | mac_scanline_timer = timer_alloc(mac_scanline_tick); | |
| 1332 | mac_scanline_timer = timer_alloc(mac_scanline_tick, NULL); | |
| 1333 | 1333 | timer_adjust(mac_scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_never); |
| 1334 | 1334 | } |
| 1335 | 1335 | |
| r1355 | r1356 | |
| 1365 | 1365 | /* setup keyboard */ |
| 1366 | 1366 | keyboard_init(); |
| 1367 | 1367 | |
| 1368 | inquiry_timeout = timer_alloc(inquiry_timeout_func); | |
| 1368 | inquiry_timeout = timer_alloc(inquiry_timeout_func, NULL); | |
| 1369 | 1369 | |
| 1370 | 1370 | cpuintrf_set_dasm_override(0, mac_dasm_override); |
| 1371 | 1371 |
| r1355 | r1356 | |
|---|---|---|
| 56 | 56 | memset( &rtc, 0, sizeof( rtc)); |
| 57 | 57 | rtc.size = 16; |
| 58 | 58 | rtc.data = malloc( rtc.size); |
| 59 | rtc.timer = timer_alloc( pcf8593_timer_callback ); | |
| 59 | rtc.timer = timer_alloc( pcf8593_timer_callback , NULL); | |
| 60 | 60 | timer_adjust( rtc.timer, ATTOTIME_IN_SEC(1), 0, ATTOTIME_IN_SEC(1)); |
| 61 | 61 | pcf8593_reset(); |
| 62 | 62 | } |
| r1355 | r1356 | |
|---|---|---|
| 240 | 240 | tpi6525[1].a.output=cbmb_keyboard_line_select_a; |
| 241 | 241 | tpi6525[1].b.output=cbmb_keyboard_line_select_b; |
| 242 | 242 | 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); | |
| 244 | 244 | |
| 245 | 245 | cbm500 = 0; |
| 246 | 246 | cbm700 = 0; |
| r1355 | r1356 | |
|---|---|---|
| 61 | 61 | { |
| 62 | 62 | memcpy(&i8271.fdc_interface, iface, sizeof(i8271_interface)); |
| 63 | 63 | } |
| 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); | |
| 66 | 66 | i8271.drive = 0; |
| 67 | 67 | i8271.pExecutionPhaseData = temp_buffer; |
| 68 | 68 |
| r1355 | r1356 | |
|---|---|---|
| 160 | 160 | |
| 161 | 161 | MACHINE_START( pc1350 ) |
| 162 | 162 | { |
| 163 | timer_set(ATTOTIME_IN_SEC(1), 0, pc1350_power_up); | |
| 163 | timer_set(ATTOTIME_IN_SEC(1), NULL, 0, pc1350_power_up); | |
| 164 | 164 | |
| 165 | 165 | memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6fff, 0, 0, MRA8_BANK1); |
| 166 | 166 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6fff, 0, 0, MWA8_BANK1); |
| r1355 | r1356 | |
|---|---|---|
| 93 | 93 | memset( &vdp, 0, sizeof(vdp) ); |
| 94 | 94 | memset( &timers, 0, sizeof(timers) ); |
| 95 | 95 | 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); | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | WRITE8_HANDLER( pokemini_hwreg_w ) { |
| r1355 | r1356 | |
|---|---|---|
| 135 | 135 | rtc.test = 0x00; |
| 136 | 136 | rtc.pulse_count = 0; |
| 137 | 137 | |
| 138 | rtc_timer = timer_alloc(rtc_alarm_pulse); | |
| 138 | rtc_timer = timer_alloc(rtc_alarm_pulse, NULL); | |
| 139 | 139 | timer_adjust(rtc_timer, attotime_zero, 0, ATTOTIME_IN_HZ(32)); |
| 140 | 140 | } |
| 141 | 141 |
| r1355 | r1356 | |
|---|---|---|
| 869 | 869 | coco3_recalc_irq(); |
| 870 | 870 | } |
| 871 | 871 | |
| 872 | static | |
| 872 | static t | |
| 873 | 873 | |
| 874 | 874 | void coco_set_halt_line(int halt_line) |
| 875 | 875 | { |
| 876 | 876 | cpunum_set_input_line(0, INPUT_LINE_HALT, halt_line); |
| 877 | 877 | 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); | |
| 879 | 879 | } |
| 880 | 880 | |
| 881 | 881 | |
| r1355 | r1356 | |
| 2060 | 2060 | |
| 2061 | 2061 | static void coco3_timer_init(void) |
| 2062 | 2062 | { |
| 2063 | coco3_gime_timer = timer_alloc(coco3_timer_proc); | |
| 2063 | coco3_gime_timer = timer_alloc(coco3_timer_proc, NULL); | |
| 2064 | 2064 | } |
| 2065 | 2065 | |
| 2066 | 2066 | |
| r1355 | r1356 | |
| 2563 | 2563 | |
| 2564 | 2564 | |
| 2565 | 2565 | /*------------------------------------------------- |
| 2566 | coco_cart_timer_ | |
| 2566 | coco_cart_timer_w | |
| 2567 | 2567 | -------------------------------------------------*/ |
| 2568 | 2568 | |
| 2569 | static | |
| 2569 | static void | |
| 2570 | 2570 | { |
| 2571 | int data = param; | |
| 2572 | 2571 | pia_1_cb1_w(0, (data & 0x01) ? ASSERT_LINE : CLEAR_LINE); |
| 2573 | 2572 | |
| 2574 | 2573 | /* special code for Q state */ |
| r1355 | r1356 | |
| 2579 | 2578 | |
| 2580 | 2579 | |
| 2581 | 2580 | /*------------------------------------------------- |
| 2581 | coco_cart_timer_proc - call for CART line | |
| 2582 | -------------------------------------------------*/ | |
| 2583 | ||
| 2584 | static TIMER_CALLBACK(coco_cart_timer_proc) | |
| 2585 | { | |
| 2586 | coco_cart_timer_w(machine, param); | |
| 2587 | } | |
| 2588 | ||
| 2589 | ||
| 2590 | ||
| 2591 | /*------------------------------------------------- | |
| 2582 | 2592 | coco3_cart_timer_proc - calls coco_timer_proc and |
| 2583 | 2593 | in addition will raise the GIME interrupt |
| 2584 | 2594 | -------------------------------------------------*/ |
| r1355 | r1356 | |
| 2587 | 2597 | { |
| 2588 | 2598 | int data = param; |
| 2589 | 2599 | coco3_raise_interrupt(COCO3_INT_EI0, (data & 0x01) ? ASSERT_LINE : CLEAR_LINE); |
| 2590 | coco_cart_timer_ | |
| 2600 | coco_cart_timer_w | |
| 2591 | 2601 | } |
| 2592 | 2602 | |
| 2593 | 2603 | |
| r1355 | r1356 | |
| 2721 | 2731 | struct _machine_init_interface |
| 2722 | 2732 | { |
| 2723 | 2733 | const pia6821_interface *piaintf; /* PIA initializer */ |
| 2724 | | |
| 2734 | t | |
| 2725 | 2735 | void (*printer_out_)(int data); /* printer output callback */ |
| 2726 | | |
| 2736 | t | |
| 2727 | 2737 | const char *fdc_cart_hardware; /* normal cartridge hardware */ |
| 2728 | 2738 | void (*map_memory)(coco_cartridge *cartridge, UINT32 offset, UINT32 mask); |
| 2729 | 2739 | }; |
| r1355 | r1356 | |
| 2753 | 2763 | recalc_interrupts = init->recalc_interrupts_; |
| 2754 | 2764 | |
| 2755 | 2765 | /* 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); | |
| 2757 | 2767 | |
| 2758 | 2768 | /* 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); | |
| 2761 | 2771 | |
| 2762 | 2772 | /* setup ROM */ |
| 2763 | 2773 | coco_rom = memory_region(REGION_CPU1); |
| r1355 | r1356 | |
| 2777 | 2787 | pia_reset(); |
| 2778 | 2788 | |
| 2779 | 2789 | /* 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); | |
| 2783 | 2793 | |
| 2784 | 2794 | /* determine which cartridge hardware we should be using */ |
| 2785 | 2795 | cart_image = cartslot_image(); |
| r1355 | r1356 | |
|---|---|---|
| 507 | 507 | /* initialize the dmac */ |
| 508 | 508 | memset( &dmac_data, 0, sizeof( dmac_data ) ); |
| 509 | 509 | |
| 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); | |
| 512 | 512 | |
| 513 | 513 | /* initialize the 6525 TPI */ |
| 514 | 514 | tpi6525_0_reset(); |
| r1355 | r1356 | |
|---|---|---|
| 980 | 980 | mc6854 = auto_malloc( sizeof( * mc6854 ) ); |
| 981 | 981 | assert( mc6854 ); |
| 982 | 982 | mc6854->iface = iface; |
| 983 | mc6854->ttimer = timer_alloc( mc6854_tfifo_cb ); | |
| 983 | mc6854->ttimer = timer_alloc( mc6854_tfifo_cb , NULL); | |
| 984 | 984 | state_save_register_item( "mc6854", 0, mc6854->cr1 ); |
| 985 | 985 | state_save_register_item( "mc6854", 0, mc6854->cr2 ); |
| 986 | 986 | state_save_register_item( "mc6854", 0, mc6854->cr3 ); |
| r1355 | r1356 | |
|---|---|---|
| 297 | 297 | memset(&rtc.interface, 0, sizeof(struct tc8521_interface)); |
| 298 | 298 | if (intf) |
| 299 | 299 | 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); | |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | READ8_HANDLER(tc8521_r) |
| r1355 | r1356 | |
|---|---|---|
| 233 | 233 | gb_sound_w( 0x16, 0x00 ); /* Initialize sound hardware */ |
| 234 | 234 | |
| 235 | 235 | /* 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); | |
| 237 | 237 | timer_enable( gb_serial_timer, 0 ); |
| 238 | 238 | |
| 239 | 239 | } |
| r1355 | r1356 | |
|---|---|---|
| 624 | 624 | m6530[0].dria = 0xff; |
| 625 | 625 | m6530[0].drib = 0xff; |
| 626 | 626 | 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); | |
| 628 | 628 | set_chip_clock(0, 255); |
| 629 | 629 | |
| 630 | 630 | m6530[1].dria = 0xff; |
| 631 | 631 | m6530[1].drib = 0xff; |
| 632 | 632 | 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); | |
| 634 | 634 | set_chip_clock(1, 255); |
| 635 | 635 | } |
| 636 | 636 |
| r1355 | r1356 | |
|---|---|---|
| 151 | 151 | if (uPD7002_status&0x08) |
| 152 | 152 | { |
| 153 | 153 | // 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); | |
| 155 | 155 | } else { |
| 156 | 156 | // 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); | |
| 158 | 158 | } |
| 159 | 159 | break; |
| 160 | 160 |
| r1355 | r1356 | |
|---|---|---|
| 370 | 370 | |
| 371 | 371 | DVENA = 0; |
| 372 | 372 | motor_on = 0; |
| 373 | motor_on_timer = timer_alloc(motor_on_timer_callback); | |
| 373 | motor_on_timer = timer_alloc(motor_on_timer_callback, NULL); | |
| 374 | 374 | |
| 375 | 375 | ti99_peb_set_card_handlers(0x1100, & fdc_handlers); |
| 376 | 376 | |
| r1355 | r1356 | |
| 635 | 635 | |
| 636 | 636 | DVENA = 0; |
| 637 | 637 | motor_on = 0; |
| 638 | motor_on_timer = timer_alloc(motor_on_timer_callback); | |
| 638 | motor_on_timer = timer_alloc(motor_on_timer_callback, NULL); | |
| 639 | 639 | |
| 640 | 640 | ti99_peb_set_card_handlers(0x1100, & ccfdc_handlers); |
| 641 | 641 | |
| r1355 | r1356 | |
| 854 | 854 | |
| 855 | 855 | DVENA = 0; |
| 856 | 856 | motor_on = 0; |
| 857 | motor_on_timer = timer_alloc(motor_on_timer_callback); | |
| 857 | motor_on_timer = timer_alloc(motor_on_timer_callback, NULL); | |
| 858 | 858 | |
| 859 | 859 | ti99_peb_set_card_handlers(0x1100, & bwg_handlers); |
| 860 | 860 | |
| r1355 | r1356 | |
| 1248 | 1248 | |
| 1249 | 1249 | DVENA = 0; |
| 1250 | 1250 | motor_on = 0; |
| 1251 | motor_on_timer = timer_alloc(motor_on_timer_callback); | |
| 1251 | motor_on_timer = timer_alloc(motor_on_timer_callback, NULL); | |
| 1252 | 1252 | |
| 1253 | 1253 | ti99_peb_set_card_handlers(0x1100, & hfdc_handlers); |
| 1254 | 1254 |
| r1355 | r1356 | |
|---|---|---|
| 130 | 130 | */ |
| 131 | 131 | void at29c040a_init(int id) |
| 132 | 132 | { |
| 133 | at29c040a[id].programming_timer = timer_alloc(at29c040a_programming_timer_callback); | |
| 133 | at29c040a[id].programming_timer = timer_alloc(at29c040a_programming_timer_callback, NULL); | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | /* |
| r1355 | r1356 | |
|---|---|---|
| 77 | 77 | |
| 78 | 78 | /* should possibly go in a DRIVER_INIT piece? */ |
| 79 | 79 | 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); | |
| 81 | 81 | } |
| 82 | 82 | /* intialize the empty dummy bank */ |
| 83 | 83 | if ( dummy_bank == NULL ) { |
| r1355 | r1356 | |
|---|---|---|
| 89 | 89 | |
| 90 | 90 | MACHINE_RESET(mz700) |
| 91 | 91 | { |
| 92 | ne556_timer[0] = timer_alloc(ne556_callback); | |
| 92 | ne556_timer[0] = timer_alloc(ne556_callback, NULL); | |
| 93 | 93 | 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); | |
| 96 | 96 | 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)*/ | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 |
| r1355 | r1356 | |
|---|---|---|
| 84 | 84 | void ti990_hold_load(void) |
| 85 | 85 | { |
| 86 | 86 | 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); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /* |
| r1355 | r1356 | |
|---|---|---|
| 118 | 118 | serial_devices[id].data_form.word_length = num_data_bits; |
| 119 | 119 | serial_devices[id].data_form.stop_bit_count = stop_bit_count; |
| 120 | 120 | 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); | |
| 122 | 122 | |
| 123 | 123 | serial_connection_init(&serial_devices[id].connection); |
| 124 | 124 | serial_connection_set_in_callback(&serial_devices[id].connection, serial_device_in_callback); |
| r1355 | r1356 | |
|---|---|---|
| 238 | 238 | { |
| 239 | 239 | vectrex_imager_status = param; |
| 240 | 240 | 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); | |
| 244 | 244 | |
| 245 | 245 | if (param == 2) |
| 246 | 246 | { |
| 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); | |
| 248 | 248 | |
| 249 | 249 | /* Index hole sensor is connected to IO7 which triggers also CA1 of VIA */ |
| 250 | 250 | via_0_ca1_w (0, 1); |
| r1355 | r1356 | |
|---|---|---|
| 4219 | 4219 | ppu2c0x_set_hblank_callback (0, mapper ? mapper->mmc_hblank : NULL); |
| 4220 | 4220 | |
| 4221 | 4221 | if (!nes_irq_timer) |
| 4222 | nes_irq_timer = timer_alloc(nes_irq_callback); | |
| 4222 | nes_irq_timer = timer_alloc(nes_irq_callback, NULL); | |
| 4223 | 4223 | |
| 4224 | 4224 | mapper_warning = 0; |
| 4225 | 4225 | /* 8k mask */ |
| r1355 | r1356 | |
|---|---|---|
| 634 | 634 | |
| 635 | 635 | logerror("floppy image %s loaded\n", image_filename(image)); |
| 636 | 636 | |
| 637 | vc1541->timer = timer_alloc(vc1541_timer); | |
| 637 | vc1541->timer = timer_alloc(vc1541_timer, NULL); | |
| 638 | 638 | return INIT_PASS; |
| 639 | 639 | } |
| 640 | 640 | |
| r1355 | r1356 | |
| 956 | 956 | |
| 957 | 957 | /* time should be small enough to allow quitting of the irq |
| 958 | 958 | 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); | |
| 960 | 960 | timer_adjust(vc1541->drive.c1551.timer, attotime_zero, 0, ATTOTIME_IN_HZ(60)); |
| 961 | 961 | return 0; |
| 962 | 962 | } |
| r1355 | r1356 | |
|---|---|---|
| 571 | 571 | void mc6846_config ( const mc6846_interface* iface ) |
| 572 | 572 | { |
| 573 | 573 | 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); | |
| 576 | 576 | |
| 577 | 577 | state_save_register_item( "mc6846", 0, mc6846.csr ); |
| 578 | 578 | state_save_register_item( "mc6846", 0, mc6846.pcr ); |
| r1355 | r1356 | |
|---|---|---|
| 1008 | 1008 | { |
| 1009 | 1009 | LOG (( "to7_game_init called\n" )); |
| 1010 | 1010 | 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); | |
| 1012 | 1012 | timer_adjust( to7_game_timer, TO7_GAME_POLL_PERIOD, 0, TO7_GAME_POLL_PERIOD ); |
| 1013 | 1013 | state_save_register_global( to7_game_sound ); |
| 1014 | 1014 | state_save_register_global( to7_game_mute ); |
| r1355 | r1356 | |
| 1930 | 1930 | to7_modem_init(); |
| 1931 | 1931 | to7_midi_init(); |
| 1932 | 1932 | to7_rf57932_init(); |
| 1933 | mo5_periodic_timer = timer_alloc( mo5_periodic_cb ); | |
| 1933 | mo5_periodic_timer = timer_alloc( mo5_periodic_cb , NULL); | |
| 1934 | 1934 | mea8000_config( THOM_SOUND_SPEECH, NULL ); |
| 1935 | 1935 | |
| 1936 | 1936 | /* memory */ |
| r1355 | r1356 | |
| 2737 | 2737 | static void to9_kbd_init ( void ) |
| 2738 | 2738 | { |
| 2739 | 2739 | 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); | |
| 2741 | 2741 | state_save_register_global( to9_kbd_parity ); |
| 2742 | 2742 | state_save_register_global( to9_kbd_intr ); |
| 2743 | 2743 | state_save_register_global( to9_kbd_in ); |
| r1355 | r1356 | |
| 3081 | 3081 | */ |
| 3082 | 3082 | |
| 3083 | 3083 | /* keyboard automaton */ |
| 3084 | static | |
| 3084 | static void | |
| 3085 | 3085 | { |
| 3086 | 3086 | attotime d; |
| 3087 | 3087 | |
| r1355 | r1356 | |
| 3157 | 3157 | |
| 3158 | 3158 | |
| 3159 | 3159 | |
| 3160 | static TIMER_CALLBACK(to8_kbd_timer_cb) | |
| 3161 | { | |
| 3162 | to8_kbd_timer_func(); | |
| 3163 | } | |
| 3164 | ||
| 3165 | ||
| 3166 | ||
| 3160 | 3167 | /* cpu <-> keyboard hand-check */ |
| 3161 | 3168 | static void to8_kbd_set_ack ( int data ) |
| 3162 | 3169 | { |
| r1355 | r1356 | |
| 3242 | 3249 | to8_kbd_ack = 1; |
| 3243 | 3250 | to8_kbd_caps = 1; |
| 3244 | 3251 | thom_set_caps_led( ! to8_kbd_caps ); |
| 3245 | to8_kbd_timer_c | |
| 3252 | to8_kbd_timer_func | |
| 3246 | 3253 | } |
| 3247 | 3254 | |
| 3248 | 3255 | |
| 3249 | 3256 | |
| 3250 | 3257 | static void to8_kbd_init ( void ) |
| 3251 | 3258 | { |
| 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); | |
| 3254 | 3261 | state_save_register_global( to8_kbd_ack ); |
| 3255 | 3262 | state_save_register_global( to8_kbd_data ); |
| 3256 | 3263 | state_save_register_global( to8_kbd_step ); |
| r1355 | r1356 | |
| 4278 | 4285 | { |
| 4279 | 4286 | LOG (( "mo6_game_init called\n" )); |
| 4280 | 4287 | 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); | |
| 4282 | 4289 | timer_adjust( to7_game_timer, TO7_GAME_POLL_PERIOD, 0, TO7_GAME_POLL_PERIOD ); |
| 4283 | 4290 | state_save_register_global( to7_game_sound ); |
| 4284 | 4291 | state_save_register_global( to7_game_mute ); |
| r1355 | r1356 | |
| 4607 | 4614 | to7_modem_init(); |
| 4608 | 4615 | to7_midi_init(); |
| 4609 | 4616 | to7_rf57932_init(); |
| 4610 | mo5_periodic_timer = timer_alloc( mo5_periodic_cb ); | |
| 4617 | mo5_periodic_timer = timer_alloc( mo5_periodic_cb , NULL); | |
| 4611 | 4618 | mea8000_config( THOM_SOUND_SPEECH, NULL ); |
| 4612 | 4619 | |
| 4613 | 4620 | /* memory */ |
| r1355 | r1356 | |
| 4792 | 4799 | { |
| 4793 | 4800 | LOG (( "mo5nr_game_init called\n" )); |
| 4794 | 4801 | 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); | |
| 4796 | 4803 | timer_adjust( to7_game_timer, TO7_GAME_POLL_PERIOD, 0, TO7_GAME_POLL_PERIOD ); |
| 4797 | 4804 | state_save_register_global( to7_game_sound ); |
| 4798 | 4805 | state_save_register_global( to7_game_mute ); |
| r1355 | r1356 | |
| 4874 | 4881 | to7_modem_init(); |
| 4875 | 4882 | to7_midi_init(); |
| 4876 | 4883 | to7_rf57932_init(); |
| 4877 | mo5_periodic_timer = timer_alloc( mo5_periodic_cb ); | |
| 4884 | mo5_periodic_timer = timer_alloc( mo5_periodic_cb , NULL); | |
| 4878 | 4885 | mea8000_config( THOM_SOUND_SPEECH, NULL ); |
| 4879 | 4886 | |
| 4880 | 4887 | /* memory */ |
| r1355 | r1356 | |
|---|---|---|
| 689 | 689 | COPS_Ready = TRUE; |
| 690 | 690 | |
| 691 | 691 | /* 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); | |
| 693 | 693 | } |
| 694 | 694 | |
| 695 | 695 | static void reset_COPS(void) |
| r1355 | r1356 | |
| 753 | 753 | COPS_Ready = FALSE; |
| 754 | 754 | |
| 755 | 755 | /* 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); | |
| 757 | 757 | |
| 758 | 758 | reset_COPS(); |
| 759 | 759 | } |
| r1355 | r1356 | |
| 1122 | 1122 | |
| 1123 | 1123 | MACHINE_RESET( lisa ) |
| 1124 | 1124 | { |
| 1125 | mouse_timer = timer_alloc(handle_mouse); | |
| 1125 | mouse_timer = timer_alloc(handle_mouse, NULL); | |
| 1126 | 1126 | |
| 1127 | 1127 | lisa_ram_ptr = memory_region(REGION_CPU1) + RAM_OFFSET; |
| 1128 | 1128 | lisa_rom_ptr = memory_region(REGION_CPU1) + ROM_OFFSET; |
| r1355 | r1356 | |
|---|---|---|
| 610 | 610 | } |
| 611 | 611 | |
| 612 | 612 | 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); | |
| 614 | 614 | } |
| 615 | 615 | |
| 616 | 616 | static void lynx_divide(void) |
| r1355 | r1356 | |
| 820 | 820 | static void lynx_timer_init(int which) |
| 821 | 821 | { |
| 822 | 822 | 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); | |
| 824 | 824 | lynx_timer[which].settime = 0.0; |
| 825 | 825 | } |
| 826 | 826 | |
| r1355 | r1356 | |
| 983 | 983 | if (uart.buffer_loaded) { |
| 984 | 984 | uart.data_to_send=uart.buffer; |
| 985 | 985 | 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); | |
| 987 | 987 | } else { |
| 988 | 988 | uart.sending=FALSE; |
| 989 | 989 | } |
| r1355 | r1356 | |
| 1025 | 1025 | } else { |
| 1026 | 1026 | uart.sending=TRUE; |
| 1027 | 1027 | 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); | |
| 1029 | 1029 | } |
| 1030 | 1030 | break; |
| 1031 | 1031 | } |
| r1355 | r1356 | |
|---|---|---|
| 784 | 784 | |
| 785 | 785 | msm8251_init(&pmd85_msm8251_interface); |
| 786 | 786 | |
| 787 | pmd85_cassette_timer = timer_alloc(pmd85_cassette_timer_callback); | |
| 787 | pmd85_cassette_timer = timer_alloc(pmd85_cassette_timer_callback, NULL); | |
| 788 | 788 | timer_adjust(pmd85_cassette_timer, attotime_zero, 0, ATTOTIME_IN_HZ(2400)); |
| 789 | 789 | |
| 790 | 790 | serial_connection_init(&pmd85_cassette_serial_connection); |
| r1355 | r1356 | |
|---|---|---|
| 79 | 79 | { |
| 80 | 80 | memset(&rriot[nr], 0, sizeof(rriot[nr])); |
| 81 | 81 | rriot[nr].config = config; |
| 82 | rriot[nr].timer = timer_alloc(rriot_timer_cb); | |
| 82 | rriot[nr].timer = timer_alloc(rriot_timer_cb, NULL); | |
| 83 | 83 | |
| 84 | 84 | LOG("RRIOT - successfully initialised\n"); |
| 85 | 85 | } |
| r1355 | r1356 | |
|---|---|---|
| 399 | 399 | logerror("time to ready: %f -> %d\n", attotime_to_double(time_to_ready), (int) cycles_to_ready); |
| 400 | 400 | |
| 401 | 401 | 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); | |
| 403 | 403 | } |
| 404 | 404 | #endif |
| 405 | 405 |
| r1355 | r1356 | |
|---|---|---|
| 166 | 166 | { |
| 167 | 167 | memory_set_opbase_handler(0, setOPbasefunc);; |
| 168 | 168 | |
| 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); | |
| 173 | 173 | |
| 174 | 174 | add_reset_callback(machine, tx0_machine_reset); |
| 175 | 175 | add_exit_callback(machine, tx0_machine_stop); |
| r1355 | r1356 | |
|---|---|---|
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | |
| 25 | static TIMER_CALLBACK | |
| 25 | static TIMER_CALLBACK | |
| 26 | 26 | { |
| 27 | struct pc_turbo_info *ti = (struct pc_turbo_info *) p | |
| 27 | struct pc_turbo_info *ti = (struct pc_turbo_info *) ptr | |
| 28 | 28 | int val; |
| 29 | 29 | |
| 30 | 30 | val = readinputport(ti->port) & ti->mask; |
| r1355 | r1356 | |
| 49 | 49 | ti->cur_val = -1; |
| 50 | 50 | ti->off_speed = off_speed; |
| 51 | 51 | ti->on_speed = on_speed; |
| 52 | timer_pulse | |
| 52 | timer_pulse | |
| 53 | 53 | return 0; |
| 54 | 54 | } |
| r1355 | r1356 | |
|---|---|---|
| 226 | 226 | memory_set_bankptr(3, memory_region(REGION_CPU1) + 0x010000); |
| 227 | 227 | memory_set_bankptr(4, memory_region(REGION_CPU1) + 0x010000); |
| 228 | 228 | |
| 229 | /*timer_pulse(TIME_IN_NSEC(200), 0, lviv_draw_pixel);*/ | |
| 229 | /*timer_pulse(TIME_IN_NSEC(200), NULL, 0, lviv_draw_pixel);*/ | |
| 230 | 230 | |
| 231 | 231 | /*memset(mess_ram, 0, sizeof(unsigned char)*0xffff);*/ |
| 232 | 232 | } |
| r1355 | r1356 | |
|---|---|---|
| 316 | 316 | |
| 317 | 317 | /* We poll the keyboard periodically to scan the keys. This is |
| 318 | 318 | 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); | |
| 320 | 320 | |
| 321 | 321 | /* Set Caps Lock light to ON, since that's how we default it. */ |
| 322 | 322 | set_led_status(1,1); |
| r1355 | r1356 | |
|---|---|---|
| 175 | 175 | interrupt_mask_reg=0xf8; |
| 176 | 176 | interrupt_trig_reg=0x0; |
| 177 | 177 | 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); | |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | WRITE8_HANDLER(pc88sr_outport_30) |
| r1355 | r1356 | |
|---|---|---|
| 197 | 197 | { |
| 198 | 198 | int i; |
| 199 | 199 | |
| 200 | tms9901[which].timer = timer_alloc(decrementer_callback); | |
| 200 | tms9901[which].timer = timer_alloc(decrementer_callback, NULL); | |
| 201 | 201 | |
| 202 | 202 | tms9901[which].supported_int_mask = param->supported_int_mask; |
| 203 | 203 |
| r1355 | r1356 | |
|---|---|---|
| 452 | 452 | } |
| 453 | 453 | |
| 454 | 454 | /* pet clock */ |
| 455 | timer_pulse(ATTOTIME_IN_MSEC(10), 0, pet_interrupt); | |
| 455 | timer_pulse(ATTOTIME_IN_MSEC(10), NULL, 0, pet_interrupt); | |
| 456 | 456 | |
| 457 | 457 | via_config(0, &pet_via); |
| 458 | 458 | pia_config(1, &pet_pia1); |
| r1355 | r1356 | |
|---|---|---|
| 1101 | 1101 | oric_irqs = 0; |
| 1102 | 1102 | oric_ram_0x0c000 = NULL; |
| 1103 | 1103 | |
| 1104 | timer_pulse(ATTOTIME_IN_HZ(4800), 0, oric_refresh_tape); | |
| 1104 | timer_pulse(ATTOTIME_IN_HZ(4800), NULL, 0, oric_refresh_tape); | |
| 1105 | 1105 | |
| 1106 | 1106 | via_reset(); |
| 1107 | 1107 | via_config(0, &oric_6522_interface); |
| r1355 | r1356 | |
|---|---|---|
| 277 | 277 | memset(&europc_rtc,0,sizeof(europc_rtc)); |
| 278 | 278 | europc_rtc.data[0xf]=1; |
| 279 | 279 | |
| 280 | europc_rtc.timer = timer_alloc(europc_rtc_timer); | |
| 280 | europc_rtc.timer = timer_alloc(europc_rtc_timer, NULL); | |
| 281 | 281 | timer_adjust(europc_rtc.timer, attotime_zero, 0, attotime_make(1, 0)); |
| 282 | 282 | } |
| 283 | 283 |
| r1355 | r1356 | |
|---|---|---|
| 88 | 88 | memset(&acia, 0, sizeof(struct acia6551)); |
| 89 | 89 | /* transmit data reg is empty */ |
| 90 | 90 | acia.status_register |= (1<<4); |
| 91 | acia.timer = timer_alloc(acia_6551_timer_callback); | |
| 91 | acia.timer = timer_alloc(acia_6551_timer_callback, NULL); | |
| 92 | 92 | |
| 93 | 93 | serial_connection_init(&acia.connection); |
| 94 | 94 | serial_connection_set_in_callback(&acia.connection, acia_6551_in_callback); |
| r1355 | r1356 | |
|---|---|---|
| 251 | 251 | via_reset(); |
| 252 | 252 | |
| 253 | 253 | 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); | |
| 255 | 255 | |
| 256 | 256 | memory_set_opbase_handler(0,atom_opbase_handler); |
| 257 | 257 | } |
| r1355 | r1356 | |
|---|---|---|
| 236 | 236 | |
| 237 | 237 | for (i=0; i<128; i++) gfx[i]=i; |
| 238 | 238 | |
| 239 | timer_set(ATTOTIME_IN_SEC(1), 0, pc1403_power_up); | |
| 239 | timer_set(ATTOTIME_IN_SEC(1), NULL, 0, pc1403_power_up); | |
| 240 | 240 | |
| 241 | 241 | memory_set_bankptr(1, memory_region(REGION_USER1)); |
| 242 | 242 | if (RAM32K) |
| r1355 | r1356 | |
|---|---|---|
| 292 | 292 | |
| 293 | 293 | ula.interrupt_status = 0x82; |
| 294 | 294 | 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 ); | |
| 297 | 297 | add_reset_callback(machine, electron_reset); |
| 298 | 298 | } |
| 299 | 299 |
| r1355 | r1356 | |
|---|---|---|
| 147 | 147 | /* this is not quite correct. if the motor is stopped in the middle |
| 148 | 148 | of the track, the next index pulse will occur in half a track time, from |
| 149 | 149 | 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); | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | drive->motor_state = motor; |
| r1355 | r1356 | |
|---|---|---|
| 178 | 178 | status[i] = 0; |
| 179 | 179 | error[i] = 0; |
| 180 | 180 | dip[i] = 0xff; |
| 181 | timer[i] = timer_alloc(pc_hdc_command); | |
| 181 | timer[i] = timer_alloc(pc_hdc_command, NULL); | |
| 182 | 182 | if (!timer[i]) |
| 183 | 183 | return -1; |
| 184 | 184 | } |
| r1355 | r1356 | |
|---|---|---|
| 37 | 37 | { |
| 38 | 38 | CENTRONICS *This=cent+nr; |
| 39 | 39 | This->config=config; |
| 40 | This->timer = timer_alloc(centronics_timer_callback); | |
| 40 | This->timer = timer_alloc(centronics_timer_callback, NULL); | |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | void centronics_write_data(int nr, UINT8 data) |
| r1355 | r1356 | |
|---|---|---|
| 165 | 165 | |
| 166 | 166 | A 120-Hz poll rate seems to be fast enough to ensure no |
| 167 | 167 | 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); | |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | |
| r1355 | r1356 | |
| 371 | 371 | /* The keyboard will pulse its strobe line when a key is |
| 372 | 372 | pressed. A 10-usec pulse is typical. */ |
| 373 | 373 | 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); | |
| 375 | 375 | } |
| 376 | 376 | } |
| 377 | 377 | |
| r1355 | r1356 | |
| 414 | 414 | write. Thus the write delay depends on the cursor position and |
| 415 | 415 | where the display is in the refresh cycle. */ |
| 416 | 416 | 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); | |
| 418 | 418 | } |
| 419 | 419 | |
| 420 | 420 | static TIMER_CALLBACK(apple1_dsp_ready_start) |
| r1355 | r1356 | |
| 424 | 424 | input CB1. The end of this pulse will tell the PIA that the |
| 425 | 425 | display is ready for another write. */ |
| 426 | 426 | 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); | |
| 428 | 428 | } |
| 429 | 429 | |
| 430 | 430 | static TIMER_CALLBACK(apple1_dsp_ready_end) |
| r1355 | r1356 | |
|---|---|---|
| 801 | 801 | assert( mc6843 ); |
| 802 | 802 | memset( mc6843, 0, sizeof( * mc6843 ) ); |
| 803 | 803 | mc6843->iface = iface; |
| 804 | mc6843->timer_cont = timer_alloc( mc6843_cont ); | |
| 804 | mc6843->timer_cont = timer_alloc( mc6843_cont , NULL); | |
| 805 | 805 | |
| 806 | 806 | state_save_register_item( "mc6843", 0, mc6843->CTAR ); |
| 807 | 807 | state_save_register_item( "mc6843", 0, mc6843->CMR ); |
| r1355 | r1356 | |
|---|---|---|
| 92 | 92 | { |
| 93 | 93 | memset(&rtc[which], 0, sizeof(rtc[which])); |
| 94 | 94 | |
| 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); | |
| 97 | 97 | |
| 98 | 98 | { |
| 99 | 99 | mame_system_time systime; |
| r1355 | r1356 | |
|---|---|---|
| 227 | 227 | void pc_rtc_init(void) |
| 228 | 228 | { |
| 229 | 229 | 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); | |
| 231 | 231 | timer_adjust(pc_rtc.timer, attotime_zero, 0, attotime_make(1, 0)); |
| 232 | 232 | } |
| 233 | 233 |
| r1355 | r1356 | |
|---|---|---|
| 1162 | 1162 | |
| 1163 | 1163 | // counter timers |
| 1164 | 1164 | |
| 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); | |
| 1169 | 1169 | |
| 1170 | 1170 | // serial receive timer |
| 1171 | 1171 | |
| 1172 | 1172 | if (mfp_p->intf->rx_clock > 0) |
| 1173 | 1173 | { |
| 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); | |
| 1175 | 1175 | } |
| 1176 | 1176 | |
| 1177 | 1177 | // serial transmit timer |
| 1178 | 1178 | |
| 1179 | 1179 | if (mfp_p->intf->tx_clock > 0) |
| 1180 | 1180 | { |
| 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); | |
| 1182 | 1182 | } |
| 1183 | 1183 | |
| 1184 | 1184 | // general purpose I/O poll timer |
| 1185 | 1185 | |
| 1186 | 1186 | if (mfp_p->intf->gpio_r) |
| 1187 | 1187 | { |
| 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); | |
| 1189 | 1189 | } |
| 1190 | 1190 | |
| 1191 | 1191 | // save state support |
| r1355 | r1356 | |
|---|---|---|
| 74 | 74 | fdc_status[id].dir = 0; |
| 75 | 75 | fdc_status[id].wprot = 1; |
| 76 | 76 | 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); | |
| 80 | 80 | fdc_status[id].rev_timer_started = 0; |
| 81 | 81 | fdc_status[id].cached = -1; |
| 82 | 82 | fdc_status[id].pos = 0; |
| r1355 | r1356 | |
|---|---|---|
| 275 | 275 | |
| 276 | 276 | memset(dart, 0, sizeof(*dart)); |
| 277 | 277 | |
| 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); | |
| 280 | 280 | |
| 281 | 281 | dart->irq_cb = intf->irq_cb; |
| 282 | 282 | dart->dtr_changed_cb = intf->dtr_changed_cb; |
| r1355 | r1356 | |
| 579 | 579 | void z80dart_set_cts(int which, int ch, int state) |
| 580 | 580 | { |
| 581 | 581 | /* 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); | |
| 583 | 583 | } |
| 584 | 584 | |
| 585 | 585 | |
| r1355 | r1356 | |
| 591 | 591 | void z80dart_set_dcd(int which, int ch, int state) |
| 592 | 592 | { |
| 593 | 593 | /* 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); | |
| 595 | 595 | } |
| 596 | 596 | |
| 597 | 597 | |
| r1355 | r1356 | |
| 603 | 603 | void z80dart_set_ri(int which, int state) |
| 604 | 604 | { |
| 605 | 605 | /* 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); | |
| 607 | 607 | } |
| 608 | 608 | |
| 609 | 609 |
| r1355 | r1356 | |
|---|---|---|
| 112 | 112 | key_buf = auto_malloc( KEYBOARD_BUFFER_SIZE ); |
| 113 | 113 | key_buf_pos = 0; |
| 114 | 114 | key_cur_pos = 0; |
| 115 | kbd_timer = timer_alloc(kbd_update_callback); | |
| 115 | kbd_timer = timer_alloc(kbd_update_callback, NULL); | |
| 116 | 116 | timer_reset( kbd_timer, attotime_never ); |
| 117 | 117 | } |
| 118 | 118 |
| r1355 | r1356 | |
|---|---|---|
| 66 | 66 | |
| 67 | 67 | cd.cdrom = mess_cd_get_cdrom_file_by_number(0); |
| 68 | 68 | |
| 69 | cd.frame_timer = timer_alloc(matsu_subcode_proc); | |
| 69 | cd.frame_timer = timer_alloc(matsu_subcode_proc, NULL); | |
| 70 | 70 | |
| 71 | 71 | cd.stch_signal = 1; |
| 72 | 72 | } |
| r1355 | r1356 | |
| 270 | 270 | if ( cd.stch_signal != 0 ) |
| 271 | 271 | { |
| 272 | 272 | 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 ); | |
| 274 | 274 | } |
| 275 | 275 | } |
| 276 | 276 | } |
| r1355 | r1356 | |
|---|---|---|
| 434 | 434 | break; |
| 435 | 435 | case 1: /* BFF1: write delayed NMI */ |
| 436 | 436 | 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); | |
| 438 | 438 | break; |
| 439 | 439 | case 2: /* BFF2: write keypad column write (what is this meant for?) */ |
| 440 | 440 | LOG(("microtan_bff2_w: %d <- %02x (keypad column)\n", offset, data)); |
| r1355 | r1356 | |
| 965 | 965 | |
| 966 | 966 | acia_6551_init(); |
| 967 | 967 | |
| 968 | microtan_timer = timer_alloc(microtan_read_cassette); | |
| 968 | microtan_timer = timer_alloc(microtan_read_cassette, NULL); | |
| 969 | 969 | } |
| r1355 | r1356 | |
|---|---|---|
| 434 | 434 | { |
| 435 | 435 | cpunum_set_input_line(0, CP1610_INT_INTRM, ASSERT_LINE); |
| 436 | 436 | 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); | |
| 438 | 438 | stic_screenrefresh(); |
| 439 | 439 | } |
| 440 | 440 |
| r1355 | r1356 | |
|---|---|---|
| 100 | 100 | |
| 101 | 101 | /* trigger NMI irq */ |
| 102 | 102 | 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 ); | |
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | 106 | |
| r1355 | r1356 | |
| 117 | 117 | { |
| 118 | 118 | /* trigger an NMI or spurious irq */ |
| 119 | 119 | 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 ); | |
| 121 | 121 | } |
| 122 | 122 | } |
| 123 | 123 |
| r1355 | r1356 | |
|---|---|---|
| 136 | 136 | tms9902[which].brk_callback = param->brk_callback; |
| 137 | 137 | tms9902[which].xmit_callback = param->xmit_callback; |
| 138 | 138 | |
| 139 | tms9902[which].timer = timer_alloc(decrementer_callback); | |
| 139 | tms9902[which].timer = timer_alloc(decrementer_callback, NULL); | |
| 140 | 140 | |
| 141 | 141 | reset(which); |
| 142 | 142 | } |
| r1355 | r1356 | |
|---|---|---|
| 432 | 432 | |
| 433 | 433 | memset( mess_ram + 0x10000, 0xFF, 0x1000 ); |
| 434 | 434 | |
| 435 | osborne1.video_timer = timer_alloc( osborne1_video_callback ); | |
| 435 | osborne1.video_timer = timer_alloc( osborne1_video_callback , NULL); | |
| 436 | 436 | timer_adjust( osborne1.video_timer, video_screen_get_time_until_pos( 0, 1, 0 ), 0, attotime_never ); |
| 437 | 437 | pia_1_ca1_w( 0, 0 ); |
| 438 | 438 | |
| 439 | timer_set( attotime_zero, 0, setup_beep ); | |
| 439 | timer_set( attotime_zero, NULL, 0, setup_beep ); | |
| 440 | 440 | |
| 441 | 441 | memory_set_opbase_handler( 0, osborne1_opbase ); |
| 442 | 442 | } |
| r1355 | r1356 | |
|---|---|---|
| 955 | 955 | |
| 956 | 956 | rapid_fire_state_1 = 0; |
| 957 | 957 | rapid_fire_state_2 = 0; |
| 958 | rapid_fire_timer = timer_alloc( rapid_fire_callback ); | |
| 958 | rapid_fire_timer = timer_alloc( rapid_fire_callback , NULL); | |
| 959 | 959 | timer_adjust( rapid_fire_timer, ATTOTIME_IN_HZ(10), 0, ATTOTIME_IN_HZ(10) ); |
| 960 | 960 | |
| 961 | 961 | last_paddle_read_time = 0; |
| r1355 | r1356 | |
|---|---|---|
| 300 | 300 | |
| 301 | 301 | |
| 302 | 302 | |
| 303 | static TIMER_CALLBACK | |
| 303 | static TIMER_CALLBACK | |
| 304 | 304 | { |
| 305 | wd17xx_info *info = (wd17xx_info *) p | |
| 305 | wd17xx_info *info = (wd17xx_info *) ptr | |
| 306 | 306 | wd17xx_set_irq(info); |
| 307 | 307 | timer_reset(busy_timer, attotime_never); |
| 308 | 308 | } |
| r1355 | r1356 | |
| 312 | 312 | static void wd17xx_set_busy(wd17xx_info *w, attotime duration) |
| 313 | 313 | { |
| 314 | 314 | w->status |= STA_1_BUSY; |
| 315 | timer_adjust | |
| 315 | timer_adjust | |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | |
| r1355 | r1356 | |
| 397 | 397 | wd.callback_param = param; |
| 398 | 398 | // wd.status_ipl = STA_1_IPL; |
| 399 | 399 | 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); | |
| 404 | 404 | |
| 405 | 405 | wd17xx_reset(); |
| 406 | 406 | } |
| r1355 | r1356 | |
|---|---|---|
| 30 | 30 | void pc_mouse_initialise(void) |
| 31 | 31 | { |
| 32 | 32 | 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); | |
| 34 | 34 | pc_mouse.inputs=UART8250_HANDSHAKE_IN_DSR|UART8250_HANDSHAKE_IN_CTS; |
| 35 | 35 | if (pc_mouse.serial_port!=-1) |
| 36 | 36 | uart8250_handshake_in(pc_mouse.serial_port, pc_mouse.inputs); |
| r1355 | r1356 | |
|---|---|---|
| 296 | 296 | { |
| 297 | 297 | _logerror( 0, "cybiko_rs232_init\n"); |
| 298 | 298 | 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); | |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | void cybiko_rs232_exit( void) |
| r1355 | r1356 | |
|---|---|---|
| 282 | 282 | if (cas_size) |
| 283 | 283 | { |
| 284 | 284 | 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); | |
| 286 | 286 | } |
| 287 | 287 | } |
| 288 | 288 |
| r1355 | r1356 | |
|---|---|---|
| 193 | 193 | |
| 194 | 194 | ti_calculator_model = TI_81; |
| 195 | 195 | |
| 196 | timer_pulse(ATTOTIME_IN_HZ(200), 0, ti85_timer_callback); | |
| 196 | timer_pulse(ATTOTIME_IN_HZ(200), NULL, 0, ti85_timer_callback); | |
| 197 | 197 | |
| 198 | 198 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, MWA8_ROM); |
| 199 | 199 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, MWA8_ROM); |
| r1355 | r1356 | |
| 223 | 223 | |
| 224 | 224 | ti_calculator_model = TI_85; |
| 225 | 225 | |
| 226 | timer_pulse(ATTOTIME_IN_HZ(200), 0, ti85_timer_callback); | |
| 226 | timer_pulse(ATTOTIME_IN_HZ(200), NULL, 0, ti85_timer_callback); | |
| 227 | 227 | |
| 228 | 228 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, MWA8_ROM); |
| 229 | 229 | memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, MWA8_ROM); |
| r1355 | r1356 | |
| 267 | 267 | |
| 268 | 268 | ti_calculator_model = TI_86; |
| 269 | 269 | |
| 270 | timer_pulse(ATTOTIME_IN_HZ(200), 0, ti85_timer_callback); | |
| 270 | timer_pulse(ATTOTIME_IN_HZ(200), NULL, 0, ti85_timer_callback); | |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | add_reset_callback(machine, ti85_reset_serial); |
| r1355 | r1356 | |
|---|---|---|
| 21 | 21 | dmac.intf = intf; |
| 22 | 22 | for(x=0;x<4;x++) |
| 23 | 23 | { |
| 24 | dmac.timer[x] = timer_alloc(dma_transfer_timer); | |
| 24 | dmac.timer[x] = timer_alloc(dma_transfer_timer, NULL); | |
| 25 | 25 | dmac.reg[x].niv = 0x0f; // defaults? |
| 26 | 26 | dmac.reg[x].eiv = 0x0f; |
| 27 | 27 | } |
| r1355 | r1356 | |
|---|---|---|
| 834 | 834 | pce_cd.end_frame = pce_cd.last_frame; |
| 835 | 835 | } |
| 836 | 836 | |
| 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); | |
| 838 | 838 | 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); | |
| 840 | 840 | timer_adjust( pce_cd.adpcm_dma_timer, attotime_never, 0, attotime_never ); |
| 841 | 841 | } |
| 842 | 842 | |
| r1355 | r1356 | |
| 944 | 944 | if ( pce_cd.scsi_REQ && ! pce_cd.scsi_ACK && ! pce_cd.scsi_CD ) { |
| 945 | 945 | if ( pce_cd.scsi_IO ) { |
| 946 | 946 | 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 ); | |
| 948 | 948 | } |
| 949 | 949 | } |
| 950 | 950 | return data; |
| r1355 | r1356 | |
|---|---|---|
| 1231 | 1231 | logerror("time to ready: %f -> %d\n", attotime_to_double(time_to_ready), (int) cycles_to_ready); |
| 1232 | 1232 | |
| 1233 | 1233 | 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); | |
| 1235 | 1235 | } |
| 1236 | 1236 | #endif |
| 1237 | 1237 | |
| r1355 | r1356 | |
| 1594 | 1594 | , (int) cycles_to_ready); |
| 1595 | 1595 | |
| 1596 | 1596 | 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); | |
| 1598 | 1598 | } |
| 1599 | 1599 | |
| 1600 | 1600 | tms5220_data_w(offset, data); |
| r1355 | r1356 | |
| 1742 | 1742 | of next message is not requested for either, so we need to decide on |
| 1743 | 1743 | our own when we can post a new event. Currently, we wait for 1000us |
| 1744 | 1744 | 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); | |
| 1746 | 1746 | } |
| 1747 | 1747 | |
| 1748 | 1748 | if (handset_buflen == 0) |
| r1355 | r1356 | |
| 1762 | 1762 | handset_ack = data; |
| 1763 | 1763 | if (data == handset_clock) |
| 1764 | 1764 | /* 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); | |
| 1766 | 1766 | } |
| 1767 | 1767 | } |
| 1768 | 1768 |
| r1355 | r1356 | |
|---|---|---|
| 156 | 156 | UINT8 *gfx = memory_region(REGION_GFX1); |
| 157 | 157 | for (i=0; i<128; i++) gfx[i]=i; |
| 158 | 158 | |
| 159 | timer_set(ATTOTIME_IN_SEC(1), 0, pc1251_power_up); | |
| 159 | timer_set(ATTOTIME_IN_SEC(1), NULL, 0, pc1251_power_up); | |
| 160 | 160 | |
| 161 | 161 | // c600 b800 b000 a000 8000 tested |
| 162 | 162 | // 4 kb memory feedback 512 bytes too few??? |
| r1355 | r1356 | |
|---|---|---|
| 155 | 155 | } |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | static | |
| 158 | static void | |
| 159 | 159 | { |
| 160 | int which = param; | |
| 161 | 160 | tms5501[which].pending_interrupts |= TMS5501_TIMER_0_INT; |
| 162 | 161 | tms5501_field_interrupts(which); |
| 163 | 162 | } |
| 164 | 163 | |
| 165 | static TIMER_CALLBACK(tms5501_timer_ | |
| 164 | static TIMER_CALLBACK(tms5501_timer_0_decrementer_callback) | |
| 166 | 165 | { |
| 167 | int which = param; | |
| 166 | tms5501_timer_0_decrementer(param); | |
| 167 | } | |
| 168 | ||
| 169 | static void tms5501_timer_1_decrementer(int which) | |
| 170 | { | |
| 168 | 171 | tms5501[which].pending_interrupts |= TMS5501_TIMER_1_INT; |
| 169 | 172 | tms5501_field_interrupts(which); |
| 170 | 173 | } |
| 171 | 174 | |
| 172 | static TIMER_CALLBACK(tms5501_timer_ | |
| 175 | static TIMER_CALLBACK(tms5501_timer_1_decrementer_callback) | |
| 173 | 176 | { |
| 174 | int which = param; | |
| 177 | tms5501_timer_1_decrementer(param); | |
| 178 | } | |
| 179 | ||
| 180 | static void tms5501_timer_2_decrementer(int which) | |
| 181 | { | |
| 175 | 182 | tms5501[which].pending_interrupts |= TMS5501_TIMER_2_INT; |
| 176 | 183 | tms5501_field_interrupts(which); |
| 177 | 184 | } |
| 178 | 185 | |
| 179 | static TIMER_CALLBACK(tms5501_timer_ | |
| 186 | static TIMER_CALLBACK(tms5501_timer_2_decrementer_callback) | |
| 180 | 187 | { |
| 181 | int which = param; | |
| 188 | tms5501_timer_2_decrementer(param); | |
| 189 | } | |
| 190 | ||
| 191 | static void tms5501_timer_3_decrementer(int which) | |
| 192 | { | |
| 182 | 193 | tms5501[which].pending_interrupts |= TMS5501_TIMER_3_INT; |
| 183 | 194 | tms5501_field_interrupts(which); |
| 184 | 195 | } |
| 185 | 196 | |
| 186 | static TIMER_CALLBACK(tms5501_timer_ | |
| 197 | static TIMER_CALLBACK(tms5501_timer_3_decrementer_callback) | |
| 187 | 198 | { |
| 188 | int which = param; | |
| 199 | tms5501_timer_3_decrementer(param); | |
| 200 | } | |
| 201 | ||
| 202 | static void tms5501_timer_4_decrementer(int which) | |
| 203 | { | |
| 189 | 204 | if (!(tms5501[which].command & TMS5501_INT_7_SELECT)) |
| 190 | 205 | tms5501[which].pending_interrupts |= TMS5501_TIMER_4_INT; |
| 191 | 206 | tms5501_field_interrupts(which); |
| 192 | 207 | } |
| 193 | 208 | |
| 209 | static TIMER_CALLBACK(tms5501_timer_4_decrementer_callback) | |
| 210 | { | |
| 211 | tms5501_timer_4_decrementer(param); | |
| 212 | } | |
| 213 | ||
| 194 | 214 | static void tms5501_timer_reload(int which, int timer) |
| 195 | 215 | { |
| 196 | 216 | if (tms5501[which].timer_counter[timer]) |
| r1355 | r1356 | |
| 201 | 221 | { /* clock interval == 0 -> no timer */ |
| 202 | 222 | switch (timer) |
| 203 | 223 | { |
| 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; | |
| 209 | 229 | } |
| 210 | 230 | timer_enable(tms5501[which].timer[timer], 0); |
| 211 | 231 | } |
| r1355 | r1356 | |
| 232 | 252 | void tms5501_init (int which, const tms5501_init_param *param) |
| 233 | 253 | { |
| 234 | 254 | 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); | |
| 240 | 260 | |
| 241 | 261 | tms5501[which].pio_read_callback = param->pio_read_callback; |
| 242 | 262 | tms5501[which].pio_write_callback = param->pio_write_callback; |
| r1355 | r1356 | |
|---|---|---|
| 520 | 520 | } |
| 521 | 521 | } |
| 522 | 522 | |
| 523 | ||
| 523 | void | |
| 524 | 524 | { |
| 525 | 525 | nMC_RPSSCounter += 1000; |
| 526 | 526 | } |
| 527 | 527 | |
| 528 | static TIMER_CALLBACK(mc_update_callback) | |
| 529 | { | |
| 530 | mc_update(); | |
| 531 | } | |
| 532 | ||
| 528 | 533 | void mc_init() |
| 529 | 534 | { |
| 530 | 535 | nMC_CPUControl0 = 0; |
| r1355 | r1356 | |
| 568 | 573 | nMC_DMAGIO64Addr = 0; |
| 569 | 574 | nMC_DMAMode = 0; |
| 570 | 575 | nMC_DMAZoomByteCnt = 0; |
| 571 | tMC_UpdateTimer = timer_alloc( mc_update ); | |
| 576 | tMC_UpdateTimer = timer_alloc( mc_update_callback , NULL); | |
| 572 | 577 | timer_adjust( tMC_UpdateTimer, ATTOTIME_IN_HZ(10000), 0, ATTOTIME_IN_HZ(10000) ); |
| 573 | 578 | |
| 574 | 579 | // if Indigo2, ID appropriately |
| r1355 | r1356 | |
|---|---|---|
| 902 | 902 | tape.data = 0; |
| 903 | 903 | #endif |
| 904 | 904 | 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); | |
| 907 | 907 | } |
| 908 | 908 | |
| 909 | 909 | void c16_tape_open (void) |
| r1355 | r1356 | |
|---|---|---|
| 2091 | 2091 | DRIVER_INIT( bbc ) |
| 2092 | 2092 | { |
| 2093 | 2093 | bbc_Master=0; |
| 2094 | bbc_tape_timer = timer_alloc(bbc_tape_timer_cb); | |
| 2094 | bbc_tape_timer = timer_alloc(bbc_tape_timer_cb, NULL); | |
| 2095 | 2095 | } |
| 2096 | 2096 | DRIVER_INIT( bbcm ) |
| 2097 | 2097 | { |
| 2098 | 2098 | 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); | |
| 2101 | 2101 | } |
| 2102 | 2102 | |
| 2103 | 2103 | MACHINE_START( bbca ) |
| r1355 | r1356 | |
|---|---|---|
| 11 | 11 | |
| 12 | 12 | #include "mame.h" |
| 13 | 13 | |
| 14 | TIMER_CALLBACK(mc_update); | |
| 15 | 14 | void mc_init(void); |
| 15 | void mc_update(void); | |
| 16 | 16 | |
| 17 | 17 | READ32_HANDLER(mc_r); |
| 18 | 18 | WRITE32_HANDLER(mc_w); |
| r1355 | r1356 | |
|---|---|---|
| 1519 | 1519 | void compis_cpu_init(void) |
| 1520 | 1520 | { |
| 1521 | 1521 | /* 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); | |
| 1530 | 1530 | } |
| 1531 | 1531 | |
| 1532 | 1532 | /*-------------------------------------------------------------------------*/ |
| r1355 | r1356 | |
|---|---|---|
| 231 | 231 | |
| 232 | 232 | static void kc_disc_interface_init(void) |
| 233 | 233 | { |
| 234 | timer_set(attotime_zero, 0, kc85_disk_reset_timer_callback); | |
| 234 | timer_set(attotime_zero, NULL, 0, kc85_disk_reset_timer_callback); | |
| 235 | 235 | |
| 236 | 236 | nec765_init(&kc_fdc_interface,NEC765A); |
| 237 | 237 | |
| r1355 | r1356 | |
| 410 | 410 | |
| 411 | 411 | static void kc_cassette_init(void) |
| 412 | 412 | { |
| 413 | kc_cassette_timer = timer_alloc(kc_cassette_timer_callback); | |
| 413 | kc_cassette_timer = timer_alloc(kc_cassette_timer_callback, NULL); | |
| 414 | 414 | } |
| 415 | 415 | |
| 416 | 416 | static void kc_cassette_set_motor(int motor_state) |
| r1355 | r1356 | |
| 902 | 902 | keyboard_data.head = (keyboard_data.tail = 0); |
| 903 | 903 | |
| 904 | 904 | /* 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); | |
| 906 | 906 | |
| 907 | 907 | /* 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); | |
| 909 | 909 | |
| 910 | 910 | /* kc keyboard is not transmitting */ |
| 911 | 911 | keyboard_data.transmit_state = KC_KEYBOARD_TRANSMIT_IDLE; |
| r1355 | r1356 | |
| 1891 | 1891 | kc85_50hz_state = 0; |
| 1892 | 1892 | kc85_15khz_state = 0; |
| 1893 | 1893 | 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); | |
| 1896 | 1896 | kc85_module_system_init(); |
| 1897 | 1897 | } |
| 1898 | 1898 |
| r1355 | r1356 | |
|---|---|---|
| 1391 | 1391 | // |
| 1392 | 1392 | // Set up timers for command completion and timeout from host |
| 1393 | 1393 | // |
| 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); | |
| 1395 | 1395 | timer_enable(c->timeout_timer, 0); // We've received enough data, disable the timeout timer |
| 1396 | 1396 | |
| 1397 | 1397 | c->delay = 0; // Reset delay for next function |
| r1355 | r1356 | |
| 1496 | 1496 | c->xmit_bytes = 0; // We don't have anything to say to the host |
| 1497 | 1497 | c->recv_bytes = 0; // We aren't waiting on additional data from the host |
| 1498 | 1498 | |
| 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 | |
| 1500 | 1500 | timer_adjust(c->timeout_timer, ATTOTIME_IN_SEC(4), CALLBACK_TIMEOUT, attotime_zero); |
| 1501 | 1501 | timer_enable(c->timeout_timer, 0); // Start this timer out disabled |
| 1502 | 1502 | |
| r1355 | r1356 | |
| 1670 | 1670 | c->xmit_bytes = 0; // We don't have anything more to say |
| 1671 | 1671 | c->recv_bytes = 0; // No active commands |
| 1672 | 1672 | |
| 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); | |
| 1674 | 1674 | |
| 1675 | 1675 | // c->status &= ~(CONTROLLER_DIRECTION | CONTROLLER_BUSY); // Put us in Idle, Host-to-Controller mode |
| 1676 | 1676 | } else { |
| 1677 | 1677 | // |
| 1678 | 1678 | // Not finished with this packet. Insert an interbyte delay and then let the host continue |
| 1679 | 1679 | // |
| 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); | |
| 1681 | 1681 | } |
| 1682 | 1682 | |
| 1683 | 1683 | return result; |
| r1355 | r1356 | |
| 1756 | 1756 | // Make the controller busy for a few microseconds while the command is processed |
| 1757 | 1757 | // |
| 1758 | 1758 | 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); | |
| 1760 | 1760 | } |
| 1761 | 1761 | } |
| r1355 | r1356 | |
|---|---|---|
| 278 | 278 | // turn on power led |
| 279 | 279 | set_led_status(0, 1); |
| 280 | 280 | |
| 281 | timer_set(attotime_zero, 0, setup_beep); | |
| 281 | timer_set(attotime_zero, NULL, 0, setup_beep); | |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | /* System Drivers */ |
| r1355 | r1356 | |
|---|---|---|
| 600 | 600 | nc_update_interrupts(); |
| 601 | 601 | |
| 602 | 602 | /* keyboard timer */ |
| 603 | nc_keyboard_timer = timer_alloc(nc_keyboard_timer_callback); | |
| 603 | nc_keyboard_timer = timer_alloc(nc_keyboard_timer_callback, NULL); | |
| 604 | 604 | timer_adjust(nc_keyboard_timer, ATTOTIME_IN_MSEC(10), 0, attotime_zero); |
| 605 | 605 | |
| 606 | 606 | /* 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); | |
| 608 | 608 | |
| 609 | 609 | /* serial timer */ |
| 610 | nc_serial_timer = timer_alloc(nc_serial_timer_callback); | |
| 610 | nc_serial_timer = timer_alloc(nc_serial_timer_callback, NULL); | |
| 611 | 611 | |
| 612 | 612 | /* at reset set to 0x0ff */ |
| 613 | 613 | nc_uart_control = 0x0ff; |
| r1355 | r1356 | |
|---|---|---|
| 617 | 617 | clear_keyboard_buffer(); |
| 618 | 618 | |
| 619 | 619 | 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); | |
| 621 | 621 | } |
| 622 | 622 | |
| 623 | 623 | static MACHINE_DRIVER_START( adam ) |
| r1355 | r1356 | |
|---|---|---|
| 491 | 491 | /* PI-5 interface connected to Sord M5 */ |
| 492 | 492 | ppi8255_init(&sord_ppi8255_interface); |
| 493 | 493 | |
| 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); | |
| 495 | 495 | TMS9928A_reset (); |
| 496 | 496 | z80ctc_reset(0); |
| 497 | 497 |
| r1355 | r1356 | |
|---|---|---|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | |
| 160 | static MACHINE_START( mk1 ) { | |
| 161 | timer_pulse( ATTOTIME_IN_HZ(30), 0, mk1_update_leds ); | |
| 160 | static MACHINE_START( mk1 ) | |
| 161 | { | |
| 162 | timer_pulse( ATTOTIME_IN_HZ(30), NULL, 0, mk1_update_leds ); | |
| 162 | 163 | } |
| 163 | 164 | |
| 164 | 165 | static MACHINE_DRIVER_START( mk1 ) |
| r1355 | r1356 | |
|---|---|---|
| 278 | 278 | { |
| 279 | 279 | memset(mess_ram, 0x0ff, mess_ram_size); |
| 280 | 280 | |
| 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); | |
| 282 | 282 | |
| 283 | 283 | blink_reset(); |
| 284 | 284 |
| r1355 | r1356 | |
|---|---|---|
| 1351 | 1351 | pcw16_interrupt_counter = 0; |
| 1352 | 1352 | |
| 1353 | 1353 | /* 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); | |
| 1355 | 1355 | /* 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); | |
| 1357 | 1357 | /* 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); | |
| 1359 | 1359 | |
| 1360 | 1360 | |
| 1361 | 1361 | pc_fdc_init(&pcw16_fdc_interface); |
| r1355 | r1356 | |
|---|---|---|
| 506 | 506 | |
| 507 | 507 | static MACHINE_START( glasgow ) |
| 508 | 508 | { |
| 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); | |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | |
| 517 | 517 | static MACHINE_START( dallas32 ) |
| 518 | 518 | { |
| 519 | ||
| 519 | | |
| 520 | 520 | |
| 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); | |
| 523 | 523 | } |
| 524 | 524 | |
| 525 | 525 | |
| r1355 | r1356 | |
| 907 | 907 | ***************************************************************************/ |
| 908 | 908 | |
| 909 | 909 | /* YEAR, NAME, PARENT, BIOS, COMPAT MACHINE,INPUT, INIT, CONFIG, COMPANY, FULLNAME, FLAGS */ |
| 910 | CONS( 1984, glasgow, 0, 0, glasgow, old_keyboard, NULL, NULL, "Hegener & Glaser Muenchen", "Mephisto III S Glasgow", 0) | |
| 911 | CONS( 1984, amsterd, 0, 0, amsterd, new_keyboard, NULL, NULL, "Hegener & Glaser Muenchen", "Mephisto Amsterdam", 0) | |
| 912 | CONS( 1984, dallas, 0, 0, glasgow, old_keyboard, NULL, NULL, "Hegener & Glaser Muenchen", "Mephisto Dallas", 0) | |
| 913 | CONS( 1984, roma, 0, 0, glasgow, new_keyboard, NULL, NULL, "Hegener & Glaser Muenchen", "Mephisto Roma", 0) | |
| 914 | CONS( 1984, dallas32, 0, 0, dallas32, new_keyboard, NULL, NULL, "Hegener & Glaser Muenchen", "Mephisto Dallas 32 Bit", 0) | |
| 915 | CONS( 1984, roma32, 0, 0, dallas32, new_keyboard, NULL, NULL, "Hegener & Glaser Muenchen", "Mephisto Roma 32 Bit", 0) | |
| 916 | CONS( 1984, dallas16, 0, 0, amsterd, new_keyboard, NULL, NULL, "Hegener & Glaser Muenchen", "Mephisto Dallas 16 Bit", 0) | |
| 910 | CONS( 1984, glasgow, 0, 0, glasgow, old_keyboard, 0, NULL, "Hegener & Glaser Muenchen", "Mephisto III S Glasgow", 0) | |
| 911 | CONS( 1984, amsterd, 0, 0, amsterd, new_keyboard, 0, NULL, "Hegener & Glaser Muenchen", "Mephisto Amsterdam", 0) | |
| 912 | CONS( 1984, dallas, 0, 0, glasgow, old_keyboard, 0, NULL, "Hegener & Glaser Muenchen", "Mephisto Dallas", 0) | |
| 913 | CONS( 1984, roma, 0, 0, glasgow, new_keyboard, 0, NULL, "Hegener & Glaser Muenchen", "Mephisto Roma", 0) | |
| 914 | CONS( 1984, dallas32, 0, 0, dallas32, new_keyboard, 0, NULL, "Hegener & Glaser Muenchen", "Mephisto Dallas 32 Bit", 0) | |
| 915 | CONS( 1984, roma32, 0, 0, dallas32, new_keyboard, 0, NULL, "Hegener & Glaser Muenchen", "Mephisto Roma 32 Bit", 0) | |
| 916 | CONS( 1984, dallas16, 0, 0, amsterd, new_keyboard, 0, NULL, "Hegener & Glaser Muenchen", "Mephisto Dallas 16 Bit", 0) | |
| 917 | 917 | |
| 918 | 918 | |
| 919 | 919 |
| r1355 | r1356 | |
|---|---|---|
| 189 | 189 | |
| 190 | 190 | static MACHINE_RESET( tm990_189 ) |
| 191 | 191 | { |
| 192 | displayena_timer = timer_alloc(NULL); | |
| 192 | displayena_timer = timer_alloc(NULL, NULL); | |
| 193 | 193 | |
| 194 | 194 | hold_load(); |
| 195 | 195 | |
| r1355 | r1356 | |
| 216 | 216 | |
| 217 | 217 | static MACHINE_RESET( tm990_189_v ) |
| 218 | 218 | { |
| 219 | displayena_timer = timer_alloc(NULL); | |
| 219 | displayena_timer = timer_alloc(NULL, NULL); | |
| 220 | 220 | |
| 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); | |
| 225 | 225 | |
| 226 | 226 | hold_load(); |
| 227 | 227 | |
| r1355 | r1356 | |
| 357 | 357 | { |
| 358 | 358 | load_state = TRUE; |
| 359 | 359 | field_interrupts(); |
| 360 | timer_set(ATTOTIME_IN_MSEC(100), 0, clear_load); | |
| 360 | timer_set(ATTOTIME_IN_MSEC(100), NULL, 0, clear_load); | |
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | /* |
| r1355 | r1356 | |
| 477 | 477 | rs232_fp = image; |
| 478 | 478 | |
| 479 | 479 | tms9902_set_dsr(id, 1); |
| 480 | rs232_input_timer = timer_alloc(rs232_input_callback); | |
| 480 | rs232_input_timer = timer_alloc(rs232_input_callback, NULL); | |
| 481 | 481 | timer_adjust(rs232_input_timer, attotime_zero, 0, ATTOTIME_IN_MSEC(10)); |
| 482 | 482 | |
| 483 | 483 | return INIT_PASS; |
| r1355 | r1356 | |
|---|---|---|
| 780 | 780 | MACHINE_DRIVER_END |
| 781 | 781 | |
| 782 | 782 | |
| 783 | COMP ( 1982, to7, 0, 0, to7, to7, | |
| 783 | COMP ( 1982, to7, 0, 0, to7, to7, 0 | |
| 784 | 784 | |
| 785 | COMP ( 1980, t9000, to7, 0, t9000, t9000, | |
| 785 | COMP ( 1980, t9000, to7, 0, t9000, t9000, 0 | |
| 786 | 786 | |
| 787 | 787 | |
| 788 | 788 | /***************************** TO7/70 ********************************* |
| r1355 | r1356 | |
| 969 | 969 | MDRV_IMPORT_FROM ( to770 ) |
| 970 | 970 | MACHINE_DRIVER_END |
| 971 | 971 | |
| 972 | COMP ( 1984, to770, 0, 0, to770, to770, | |
| 972 | COMP ( 1984, to770, 0, 0, to770, to770, 0 | |
| 973 | 973 | |
| 974 | COMP ( 1984, to770a, to770, 0, to770a, to770a, | |
| 974 | COMP ( 1984, to770a, to770, 0, to770a, to770a, 0 | |
| 975 | 975 | |
| 976 | 976 | |
| 977 | 977 | /************************* MO5 / MO5E ********************************* |
| r1355 | r1356 | |
| 1169 | 1169 | MACHINE_DRIVER_END |
| 1170 | 1170 | |
| 1171 | 1171 | |
| 1172 | COMP ( 1984, mo5, 0, 0, mo5, mo5, | |
| 1172 | COMP ( 1984, mo5, 0, 0, mo5, mo5, 0 | |
| 1173 | 1173 | |
| 1174 | COMP ( 1986, mo5e, mo5, 0, mo5e, mo5e, | |
| 1174 | COMP ( 1986, mo5e, mo5, 0, mo5e, mo5e, 0 | |
| 1175 | 1175 | |
| 1176 | 1176 | |
| 1177 | 1177 | /********************************* TO9 ******************************* |
| r1355 | r1356 | |
| 1512 | 1512 | MACHINE_DRIVER_END |
| 1513 | 1513 | |
| 1514 | 1514 | |
| 1515 | COMP ( 1985, to9, 0, 0, to9, to9, | |
| 1515 | COMP ( 1985, to9, 0, 0, to9, to9, 0 | |
| 1516 | 1516 | |
| 1517 | 1517 | |
| 1518 | 1518 | /******************************** TO8 ******************************** |
| r1355 | r1356 | |
| 1753 | 1753 | MACHINE_DRIVER_END |
| 1754 | 1754 | |
| 1755 | 1755 | |
| 1756 | COMP ( 1986, to8, 0, 0, to8, to8, | |
| 1756 | COMP ( 1986, to8, 0, 0, to8, to8, 0 | |
| 1757 | 1757 | |
| 1758 | COMP ( 1987, to8d, to8, 0, to8d, to8d, | |
| 1758 | COMP ( 1987, to8d, to8, 0, to8d, to8d, 0 | |
| 1759 | 1759 | |
| 1760 | 1760 | |
| 1761 | 1761 | /******************************** TO9+ ******************************* |
| r1355 | r1356 | |
| 1906 | 1906 | MDRV_CPU_PROGRAM_MAP ( to9p, 0 ) |
| 1907 | 1907 | MACHINE_DRIVER_END |
| 1908 | 1908 | |
| 1909 | COMP ( 1986, to9p, 0, 0, to9p, to9p, | |
| 1909 | COMP ( 1986, to9p, 0, 0, to9p, to9p, 0 | |
| 1910 | 1910 | |
| 1911 | 1911 | |
| 1912 | 1912 | |
| r1355 | r1356 | |
| 2258 | 2258 | MDRV_IMPORT_FROM ( mo6 ) |
| 2259 | 2259 | MACHINE_DRIVER_END |
| 2260 | 2260 | |
| 2261 | COMP ( 1986, mo6, 0, 0, mo6, mo6, | |
| 2261 | COMP ( 1986, mo6, 0, 0, mo6, mo6, 0 | |
| 2262 | 2262 | |
| 2263 | COMP ( 1986, pro128, mo6, 0, pro128, pro128, | |
| 2263 | COMP ( 1986, pro128, mo6, 0, pro128, pro128, 0 | |
| 2264 | 2264 | |
| 2265 | 2265 | |
| 2266 | 2266 | |
| r1355 | r1356 | |
| 2483 | 2483 | MDRV_CPU_PROGRAM_MAP ( mo5nr, 0 ) |
| 2484 | 2484 | MACHINE_DRIVER_END |
| 2485 | 2485 | |
| 2486 | COMP ( 1986, mo5nr, 0, 0, mo5nr, mo5nr, | |
| 2486 | COMP ( 1986, mo5nr, 0, 0, mo5nr, mo5nr, 0 |
| r1355 | r1356 | |
|---|---|---|
| 441 | 441 | { |
| 442 | 442 | state_save_register_global(keylatch); |
| 443 | 443 | |
| 444 | abc80_keyboard_timer = timer_alloc(abc80_keyboard_tick); | |
| 444 | abc80_keyboard_timer = timer_alloc(abc80_keyboard_tick, NULL); | |
| 445 | 445 | timer_adjust(abc80_keyboard_timer, attotime_zero, 0, ATTOTIME_IN_USEC(2500)); |
| 446 | 446 | } |
| 447 | 447 |
| r1355 | r1356 | |
|---|---|---|
| 205 | 205 | sys.mfp.irqline = 6; // MFP is connected to 68000 IRQ line 6 |
| 206 | 206 | sys.mfp.current_irq = -1; // No current interrupt |
| 207 | 207 | |
| 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); | |
| 213 | 213 | timer_adjust(mfp_irq, attotime_zero, 0, ATTOTIME_IN_USEC(32)); |
| 214 | 214 | */ |
| 215 | 215 | } |
| r1355 | r1356 | |
| 1329 | 1329 | offset *= 2; |
| 1330 | 1330 | if(ACCESSING_LSB) |
| 1331 | 1331 | 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); | |
| 1333 | 1333 | // cpunum_set_input_line_and_vector(0,2,ASSERT_LINE,current_vector[2]); |
| 1334 | 1334 | } |
| 1335 | 1335 | return 0xffff; |
| r1355 | r1356 | |
| 1345 | 1345 | offset *= 2; |
| 1346 | 1346 | if(ACCESSING_LSB) |
| 1347 | 1347 | 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); | |
| 1349 | 1349 | // cpunum_set_input_line_and_vector(0,2,ASSERT_LINE,current_vector[2]); |
| 1350 | 1350 | } |
| 1351 | 1351 | } |
| r1355 | r1356 | |
| 1963 | 1963 | // init keyboard |
| 1964 | 1964 | sys.keyboard.delay = 500; // 3*100+200 |
| 1965 | 1965 | 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); | |
| 1971 | 1971 | } |
| 1972 | 1972 | |
| 1973 | 1973 |
| r1355 | r1356 | |
|---|---|---|
| 72 | 72 | keyboard_scan(); |
| 73 | 73 | /* enable ROM in base >0000, and re-enable RAM shortly thereafter */ |
| 74 | 74 | 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); | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | static VIDEO_START( super80 ) |
| r1355 | r1356 | |
|---|---|---|
| 1597 | 1597 | |
| 1598 | 1598 | cpunum_set_irq_callback(0, atarist_int_ack); |
| 1599 | 1599 | |
| 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); | |
| 1602 | 1602 | } |
| 1603 | 1603 | |
| 1604 | 1604 | static MACHINE_START( megaste ) |
| r1355 | r1356 | |
|---|---|---|
| 1131 | 1131 | return; |
| 1132 | 1132 | } |
| 1133 | 1133 | } |
| 1134 | timer_set(ATTOTIME_IN_HZ(44100), 0, ip22_dma); | |
| 1134 | timer_set(ATTOTIME_IN_HZ(44100), NULL, 0, ip22_dma); | |
| 1135 | 1135 | } |
| 1136 | 1136 | } |
| 1137 | 1137 | |
| r1355 | r1356 | |
| 1201 | 1201 | verboselog( 0, " FIFO End: Rowe %04x\n", ( data & PBUS_CTRL_FIFO_END ) >> 24 ); |
| 1202 | 1202 | if( ( data & PBUS_CTRL_DMASTART ) || ( data & PBUS_CTRL_LOAD_EN ) ) |
| 1203 | 1203 | { |
| 1204 | timer_set(ATTOTIME_IN_HZ(44100), 0, ip22_dma); | |
| 1204 | timer_set(ATTOTIME_IN_HZ(44100), NULL, 0, ip22_dma); | |
| 1205 | 1205 | nPBUS_DMA_Active = 1; |
| 1206 | 1206 | } |
| 1207 | 1207 | return; |
| r1355 | r1356 | |
| 1232 | 1232 | // mc_update wants once every millisecond (1/1000th of a second) |
| 1233 | 1233 | static TIMER_CALLBACK(ip22_timer) |
| 1234 | 1234 | { |
| 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); | |
| 1238 | 1237 | } |
| 1239 | 1238 | |
| 1240 | 1239 | static MACHINE_RESET( ip225015 ) |
| r1355 | r1356 | |
| 1246 | 1245 | RTC_REGISTERB = 0x08; |
| 1247 | 1246 | RTC_REGISTERD = 0x80; |
| 1248 | 1247 | |
| 1249 | timer_set(ATTOTIME_IN_MSEC(1), 0, ip22_timer); | |
| 1248 | timer_set(ATTOTIME_IN_MSEC(1), NULL, 0, ip22_timer); | |
| 1250 | 1249 | |
| 1251 | 1250 | // set up low RAM mirror |
| 1252 | 1251 | memory_set_bankptr(1, ip22_mainram); |
| r1355 | r1356 | |
|---|---|---|
| 257 | 257 | |
| 258 | 258 | static MACHINE_START( exidy ) |
| 259 | 259 | { |
| 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); | |
| 262 | 262 | |
| 263 | 263 | wd17xx_init(WD_TYPE_179X, NULL, NULL); |
| 264 | 264 | } |
| r1355 | r1356 | |
| 278 | 278 | |
| 279 | 279 | exidy_fe_port_w(0,0); |
| 280 | 280 | |
| 281 | timer_set(attotime_zero, 0, exidy_reset_timer_callback); | |
| 281 | timer_set(attotime_zero, NULL, 0, exidy_reset_timer_callback); | |
| 282 | 282 | |
| 283 | 283 | floppy_drive_set_geometry(image_from_devtype_and_index(IO_FLOPPY, 0), FLOPPY_DRIVE_DS_80); |
| 284 | 284 | |
| r1355 | r1356 | |
| 307 | 307 | |
| 308 | 308 | exidy_fe_port_w(0,0); |
| 309 | 309 | |
| 310 | timer_set(attotime_zero, 0, exidy_reset_timer_callback); | |
| 310 | timer_set(attotime_zero, NULL, 0, exidy_reset_timer_callback); | |
| 311 | 311 | |
| 312 | 312 | floppy_drive_set_geometry(image_from_devtype_and_index(IO_FLOPPY, 0), FLOPPY_DRIVE_DS_80); |
| 313 | 313 | } |
| r1355 | r1356 | |
|---|---|---|
| 1741 | 1741 | dpc.df[data_fetcher].music_mode = 0; |
| 1742 | 1742 | } |
| 1743 | 1743 | } |
| 1744 | dpc.oscillator = timer_alloc( modeDPC_timer_callback ); | |
| 1744 | dpc.oscillator = timer_alloc( modeDPC_timer_callback , NULL); | |
| 1745 | 1745 | timer_adjust( dpc.oscillator, ATTOTIME_IN_HZ(42000), 0, ATTOTIME_IN_HZ(42000) ); |
| 1746 | 1746 | break; |
| 1747 | 1747 |
| r1355 | r1356 | |
|---|---|---|
| 400 | 400 | |
| 401 | 401 | static DRIVER_INIT( studio2 ) |
| 402 | 402 | { |
| 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); | |
| 405 | 405 | } |
| 406 | 406 | |
| 407 | 407 | static int mpt02_colorram_r(UINT16 addr) |
| r1355 | r1356 | |
| 426 | 426 | |
| 427 | 427 | static DRIVER_INIT( mpt02 ) |
| 428 | 428 | { |
| 429 | timer_set(attotime_zero, 0, mpt02_setup_beep); | |
| 429 | timer_set(attotime_zero, NULL, 0, mpt02_setup_beep); | |
| 430 | 430 | cdp1864_configure(&mpt02_CDP1864_interface); |
| 431 | 431 | } |
| 432 | 432 |
| r1355 | r1356 | |
|---|---|---|
| 776 | 776 | roller_ram_offset = 0; |
| 777 | 777 | |
| 778 | 778 | /* 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); | |
| 780 | 780 | |
| 781 | timer_set(attotime_zero, 0, setup_beep); | |
| 781 | timer_set(attotime_zero, NULL, 0, setup_beep); | |
| 782 | 782 | } |
| 783 | 783 | |
| 784 | 784 |
| r1355 | r1356 | |
|---|---|---|
| 94 | 94 | |
| 95 | 95 | static MACHINE_START( mk2 ) |
| 96 | 96 | { |
| 97 | timer_pulse(ATTOTIME_IN_HZ(60), 0, update_leds); | |
| 97 | timer_pulse(ATTOTIME_IN_HZ(60), NULL, 0, update_leds); | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | static MACHINE_RESET( mk2 ) |
| r1355 | r1356 | |
|---|---|---|
| 228 | 228 | { |
| 229 | 229 | cpunum_set_input_line_vector(0, 0, 0xff); |
| 230 | 230 | 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); | |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | static MACHINE_DRIVER_START( coleco ) |
| r1355 | r1356 | |
|---|---|---|
| 226 | 226 | |
| 227 | 227 | static WRITE8_HANDLER( zx8302_ipc_command_w ) |
| 228 | 228 | { |
| 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); | |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | static WRITE8_HANDLER( zx8302_mdv_control_w ) |
| r1355 | r1356 | |
| 760 | 760 | zx8302.comctl = 1; |
| 761 | 761 | zx8302.comdata = 1; |
| 762 | 762 | |
| 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); | |
| 767 | 767 | |
| 768 | 768 | timer_adjust(zx8302_rtc_timer, attotime_zero, 0, ATTOTIME_IN_HZ(X2/32768)); |
| 769 | 769 | timer_adjust(zx8302_gap_timer, attotime_zero, 0, ATTOTIME_IN_MSEC(31)); |
| r1355 | r1356 | |
|---|---|---|
| 651 | 651 | state_save_register_global(abc77_keylatch); |
| 652 | 652 | state_save_register_global(abc77_clock); |
| 653 | 653 | |
| 654 | abc800_ctc_timer = timer_alloc(abc800_ctc_tick); | |
| 654 | abc800_ctc_timer = timer_alloc(abc800_ctc_tick, NULL); | |
| 655 | 655 | timer_adjust(abc800_ctc_timer, attotime_zero, 0, ATTOTIME_IN_HZ(ABC800_X01/2/2/2)); |
| 656 | 656 | |
| 657 | 657 | z80ctc_init(0, &abc800_ctc_intf); |
| r1355 | r1356 | |
|---|---|---|
| 283 | 283 | // enable power led |
| 284 | 284 | set_led_status(2, 1); |
| 285 | 285 | |
| 286 | timer_set(attotime_zero, 0, setup_beep); | |
| 286 | timer_set(attotime_zero, NULL, 0, setup_beep); | |
| 287 | 287 | |
| 288 | 288 | cdp1864_configure(&tmc2000e_CDP1864_interface); |
| 289 | 289 | } |
| r1355 | r1356 | |
|---|---|---|
| 420 | 420 | |
| 421 | 421 | static DRIVER_INIT( tmc1800 ) |
| 422 | 422 | { |
| 423 | timer_set(attotime_zero, 0, setup_beep); | |
| 423 | timer_set(attotime_zero, NULL, 0, setup_beep); | |
| 424 | 424 | } |
| 425 | 425 | |
| 426 | 426 | static DRIVER_INIT( tmc2000 ) |
| 427 | 427 | { |
| 428 | timer_set(attotime_zero, 0, setup_beep); | |
| 428 | timer_set(attotime_zero, NULL, 0, setup_beep); | |
| 429 | 429 | cdp1864_configure(&tmc2000_CDP1864_interface); |
| 430 | 430 | } |
| 431 | 431 |
| r1355 | r1356 | |
|---|---|---|
| 357 | 357 | sn76489_ready = 0; |
| 358 | 358 | |
| 359 | 359 | // 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); | |
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | static WRITE8_HANDLER( pia_cb2_w ) |
| r1355 | r1356 | |
|---|---|---|
| 1453 | 1453 | /* the einstein keyboard can generate a interrupt */ |
| 1454 | 1454 | /* the int is actually clocked at the system clock 4Mhz, but this would be too fast for our |
| 1455 | 1455 | 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); | |
| 1457 | 1457 | |
| 1458 | 1458 | /* the input to channel 0 and 1 of the ctc is a 2mhz clock */ |
| 1459 | 1459 | 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); | |
| 1461 | 1461 | |
| 1462 | 1462 | centronics_config(0, einstein_cent_config); |
| 1463 | 1463 | /* assumption: select is tied low */ |
| r1355 | r1356 | |
|---|---|---|
| 497 | 497 | ***************************************************************************/ |
| 498 | 498 | |
| 499 | 499 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME */ |
| 500 | CONS( 1979, intv, 0, 0, intv, intv, NULL, intv, "Mattel", "Intellivision", GAME_NOT_WORKING ) | |
| 501 | CONS( 1981, intvsrs, 0, 0, intv, intv, NULL, intv, "Mattel", "Intellivision (Sears)", GAME_NOT_WORKING ) | |
| 502 | COMP( 1981, intvkbd, 0, 0, intvkbd, intvkbd, NULL, intvkbd, "Mattel", "Intellivision Keyboard Component (Unreleased)", GAME_NOT_WORKING) | |
| 500 | CONS( 1979, intv, 0, 0, intv, intv, 0, intv, "Mattel", "Intellivision", GAME_NOT_WORKING ) | |
| 501 | CONS( 1981, intvsrs, 0, 0, intv, intv, 0, intv, "Mattel", "Intellivision (Sears)", GAME_NOT_WORKING ) | |
| 502 | COMP( 1981, intvkbd, 0, 0, intvkbd, intvkbd, 0, intvkbd, "Mattel", "Intellivision Keyboard Component (Unreleased)", GAME_NOT_WORKING) |
| r1355 | r1356 | |
|---|---|---|
| 209 | 209 | io_state = IOS_NOP; |
| 210 | 210 | break; |
| 211 | 211 | 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); | |
| 213 | 213 | break; |
| 214 | 214 | case IOS_STSPEECH1: |
| 215 | 215 | io_state = IOS_STSPEECH2; |
| r1355 | r1356 | |
|---|---|---|
| 182 | 182 | |
| 183 | 183 | static MACHINE_START( mephisto ) |
| 184 | 184 | { |
| 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); | |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 |
| r1355 | r1356 | |
|---|---|---|
| 503 | 503 | Drivers |
| 504 | 504 | ******************************************************************************/ |
| 505 | 505 | |
| 506 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS */ | |
| 507 | COMP( 1983, laser110, 0, 0, laser110, vtech1, NULL, laser110, "Video Technology", "Laser 110", 0 ) | |
| 508 | COMP( 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 */ | |
| 507 | COMP( 1983, laser110, 0, 0, laser110, vtech1, 0, laser110, "Video Technology", "Laser 110", 0 ) | |
| 508 | COMP( 1983, las110de, laser110, 0, laser110, vtech1, 0, laser110, "Sanyo", "Laser 110 (Germany)", 0 ) | |
| 509 | 509 | |
| 510 | COMP( 1983, laser200, 0, 0, laser200, vtech1, NULL, laser110, "Video Technology", "Laser 200", 0 ) | |
| 511 | COMP( 1983, vz200de, laser200, 0, laser200, vtech1, NULL, laser110, "Video Technology", "VZ-200 (Germany & Netherlands)", 0 ) | |
| 512 | COMP( 1983, fellow, laser200, 0, laser200, vtech1, NULL, laser110, "Salora", "Fellow (Finland)", 0 ) | |
| 513 | COMP( 1983, tx8000, laser200, 0, laser200, vtech1, NULL, laser110, "Texet", "TX-8000 (UK)", 0 ) | |
| 510 | COMP( 1983, laser200, 0, 0, laser200, vtech1, 0, laser110, "Video Technology", "Laser 200", 0 ) | |
| 511 | COMP( 1983, vz200de, laser200, 0, laser200, vtech1, 0, laser110, "Video Technology", "VZ-200 (Germany & Netherlands)", 0 ) | |
| 512 | COMP( 1983, fellow, laser200, 0, laser200, vtech1, 0, laser110, "Salora", "Fellow (Finland)", 0 ) | |
| 513 | COMP( 1983, tx8000, laser200, 0, laser200, vtech1, 0, laser110, "Texet", "TX-8000 (UK)", 0 ) | |
| 514 | 514 | |
| 515 | COMP( 1984, laser210, 0, 0, laser210, vtech1, NULL, laser210, "Video Technology", "Laser 210", 0 ) | |
| 516 | COMP( 1984, vz200, laser210, 0, laser210, vtech1, NULL, laser210, "Dick Smith Electronics", "VZ-200 (Oceania)", 0 ) | |
| 517 | COMP( 1984, las210de, laser210, 0, laser210, vtech1, NULL, laser210, "Sanyo", "Laser 210 (Germany)", 0 ) | |
| 515 | COMP( 1984, laser210, 0, 0, laser210, vtech1, 0, laser210, "Video Technology", "Laser 210", 0 ) | |
| 516 | COMP( 1984, vz200, laser210, 0, laser210, vtech1, 0, laser210, "Dick Smith Electronics", "VZ-200 (Oceania)", 0 ) | |
| 517 | COMP( 1984, las210de, laser210, 0, laser210, vtech1, 0, laser210, "Sanyo", "Laser 210 (Germany)", 0 ) | |
| 518 | 518 | |
| 519 | COMP( 1984, laser310, 0, 0, laser310, vtech1, NULL, laser310, "Video Technology", "Laser 310", 0 ) | |
| 520 | COMP( 1984, vz300, laser310, 0, laser310, vtech1, NULL, laser310, "Dick Smith Electronics", "VZ-300 (Oceania)", 0 ) | |
| 519 | COMP( 1984, laser310, 0, 0, laser310, vtech1, 0, laser310, "Video Technology", "Laser 310", 0 ) | |
| 520 | COMP( 1984, vz300, laser310, 0, laser310, vtech1, 0, laser310, "Dick Smith Electronics", "VZ-300 (Oceania)", 0 ) |
| r1355 | r1356 | |
|---|---|---|
| 1807 | 1807 | The CRTC generates a memory address using it's MA and RA signal outputs |
| 1808 | 1808 | The Gate-Array fetches two bytes for each address*/ |
| 1809 | 1809 | |
| 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); | |
| 1812 | 1812 | |
| 1813 | 1813 | /* The opcode timing in the Amstrad is different to the opcode |
| 1814 | 1814 | timing in the core for the Z80 CPU. |
| r1355 | r1356 | |
|---|---|---|
| 216 | 216 | a310_pagesize = 0; |
| 217 | 217 | wd17xx_init(WD_TYPE_1772, a310_wd177x_callback, NULL); |
| 218 | 218 | |
| 219 | vbl_timer = timer_alloc(a310_vblank); | |
| 219 | vbl_timer = timer_alloc(a310_vblank, NULL); | |
| 220 | 220 | timer_adjust(vbl_timer, attotime_never, 0, attotime_never); |
| 221 | 221 | |
| 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); | |
| 226 | 226 | timer_adjust(timer[0], attotime_never, 0, attotime_never); |
| 227 | 227 | timer_adjust(timer[1], attotime_never, 0, attotime_never); |
| 228 | 228 | timer_adjust(timer[2], attotime_never, 0, attotime_never); |
| 229 | 229 | timer_adjust(timer[3], attotime_never, 0, attotime_never); |
| 230 | 230 | |
| 231 | snd_timer = timer_alloc(a310_audio_tick); | |
| 231 | snd_timer = timer_alloc(a310_audio_tick, NULL); | |
| 232 | 232 | timer_adjust(snd_timer, attotime_never, 0, attotime_never); |
| 233 | 233 | |
| 234 | 234 | // reset the DAC to centerline |
| r1355 | r1356 | |
|---|---|---|
| 453 | 453 | { |
| 454 | 454 | /* a timer used to check status of pen */ |
| 455 | 455 | /* 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); | |
| 457 | 457 | |
| 458 | 458 | add_reset_callback(machine, avigo_machine_reset); |
| 459 | 459 | } |
| r1355 | r1356 | |
|---|---|---|
| 186 | 186 | if( !m_pad[ n_port ].b_ack ) |
| 187 | 187 | { |
| 188 | 188 | 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 ); | |
| 190 | 190 | } |
| 191 | 191 | } |
| 192 | 192 | } |
| r1355 | r1356 | |
| 299 | 299 | if( b_ack ) |
| 300 | 300 | { |
| 301 | 301 | 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 ); | |
| 303 | 303 | } |
| 304 | 304 | } |
| 305 | 305 |
| r1355 | r1356 | |
|---|---|---|
| 102 | 102 | |
| 103 | 103 | static DRIVER_INIT(tutor) |
| 104 | 104 | { |
| 105 | tape_interrupt_timer = timer_alloc(tape_interrupt_handler); | |
| 105 | tape_interrupt_timer = timer_alloc(tape_interrupt_handler, NULL); | |
| 106 | 106 | |
| 107 | 107 | memory_configure_bank(1, 0, 1, memory_region(REGION_CPU1) + basic_base, 0); |
| 108 | 108 | memory_configure_bank(1, 1, 1, memory_region(REGION_CPU1) + cartridge_base, 0); |
| r1355 | r1356 | |
|---|---|---|
| 432 | 432 | |
| 433 | 433 | static DRIVER_INIT( svision ) |
| 434 | 434 | { |
| 435 | svision.timer1 = timer_alloc(svision_timer); | |
| 435 | svision.timer1 = timer_alloc(svision_timer, NULL); | |
| 436 | 436 | svision_pet.on = FALSE; |
| 437 | 437 | memory_set_bankptr(2, memory_region(REGION_USER1) + 0x1c000); |
| 438 | 438 | } |
| 439 | 439 | |
| 440 | 440 | static DRIVER_INIT( svisions ) |
| 441 | 441 | { |
| 442 | svision.timer1 = timer_alloc(svision_timer); | |
| 442 | svision.timer1 = timer_alloc(svision_timer, NULL); | |
| 443 | 443 | memory_set_bankptr(2, memory_region(REGION_USER1) + 0x1c000); |
| 444 | svision.timer1 = timer_alloc(svision_timer); | |
| 444 | svision.timer1 = timer_alloc(svision_timer, NULL); | |
| 445 | 445 | 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); | |
| 448 | 448 | } |
| 449 | 449 | |
| 450 | 450 | static MACHINE_RESET( svision ) |
| r1355 | r1356 | |
|---|---|---|
| 468 | 468 | |
| 469 | 469 | static INTERRUPT_GEN( ip20_update_chips ) |
| 470 | 470 | { |
| 471 | mc_update( | |
| 471 | mc_update( | |
| 472 | 472 | nRTC_Temp++; |
| 473 | 473 | if( nRTC_Temp == 100 ) |
| 474 | 474 | { |
| r1355 | r1356 | |
|---|---|---|
| 26 | 26 | |
| 27 | 27 | Source Changes: |
| 28 | 28 | ---------------- |
| 29 | - The core is based on MAME 0.121u | |
| 29 | - The core is based on MAME 0.121u2. This incorporates all features of the | |
| 30 | 30 | update to this core. [MAME team] |
| 31 | 31 | |
| 32 | 32 |
| r1355 | r1356 | |
|---|---|---|
| 62 | 62 | |
| 63 | 63 | |
| 64 | 64 | #------------------------------------------------- |
| 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 | #------------------------------------------------- | |
| 65 | 92 | # specify program options; see each option below |
| 66 | 93 | # for details |
| 67 | 94 | #------------------------------------------------- |
| r1355 | r1356 | |
| 88 | 115 | # for details |
| 89 | 116 | #------------------------------------------------- |
| 90 | 117 | |
| 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 | ||
| 103 | 118 | # uncomment next line if you are building for a 64-bit target |
| 104 | 119 | # PTR64 = 1 |
| 105 | 120 | |
| 121 | # uncomment next line if you are building for a big-endian target | |
| 122 | # BIGENDIAN = 1 | |
| 123 | ||
| 106 | 124 | # uncomment next line to build expat as part of MAME build |
| 107 | 125 | BUILD_EXPAT = 1 |
| 108 | 126 | |
| r1355 | r1356 | |
| 179 | 197 | |
| 180 | 198 | |
| 181 | 199 | #------------------------------------------------- |
| 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) | |
| 188 | ARCH = | |
| 189 | ENDIAN = little | |
| 190 | ||
| 191 | # architecture-specific builds get extra options | |
| 192 | ifdef NATIVE | |
| 193 | SUFFIX = nat | |
| 194 | ARCH = -march=native | |
| 195 | endif | |
| 196 | ||
| 197 | ifdef ATHLON | |
| 198 | SUFFIX = at | |
| 199 | ARCH = -march=athlon | |
| 200 | endif | |
| 201 | ||
| 202 | ifdef AMD64 | |
| 203 | SUFFIX = 64 | |
| 204 | ARCH = -march=athlon64 | |
| 205 | endif | |
| 206 | ||
| 207 | ifdef I686 | |
| 208 | SUFFIX = pp | |
| 209 | ARCH = -march=pentiumpro | |
| 210 | endif | |
| 211 | ||
| 212 | ifdef P4 | |
| 213 | SUFFIX = p4 | |
| 214 | ARCH = -march=pentium4 | |
| 215 | endif | |
| 216 | ||
| 217 | ifdef PM | |
| 218 | SUFFIX = pm | |
| 219 | ARCH = -march=pentium-m | |
| 220 | endif | |
| 221 | ||
| 222 | ifdef CORE2 | |
| 223 | SUFFIX = c2 | |
| 224 | ARCH = -march=pentium-m -msse3 | |
| 225 | endif | |
| 226 | ||
| 227 | ifdef G4 | |
| 228 | SUFFIX = g4 | |
| 229 | ARCH = -mcpu=G4 | |
| 230 | ENDIAN = big | |
| 231 | endif | |
| 232 | ||
| 233 | ifdef G5 | |
| 234 | SUFFIX = g5 | |
| 235 | ARCH = -mcpu=G5 | |
| 236 | ENDIAN = big | |
| 237 | endif | |
| 238 | ||
| 239 | ifdef CELL | |
| 240 | SUFFIX = cbe | |
| 241 | ARCH = | |
| 242 | ENDIAN = big | |
| 243 | endif | |
| 244 | ||
| 245 | ||
| 246 | ||
| 247 | #------------------------------------------------- | |
| 248 | 200 | # form the name of the executable |
| 249 | 201 | #------------------------------------------------- |
| 250 | 202 | |
| 251 | 203 | # debug builds just get the 'd' suffix and nothing more |
| 252 | 204 | ifdef DEBUG |
| 253 | SUFFIX = d | |
| 205 | DEBUGSUFFIX = d | |
| 254 | 206 | endif |
| 255 | 207 | |
| 256 | 208 | # the name is just 'target' if no subtarget; otherwise it is |
| r1355 | r1356 | |
| 261 | 213 | NAME = $(TARGET)$(SUBTARGET) |
| 262 | 214 | endif |
| 263 | 215 | |
| 264 | # fullname is prefix+name+suffix | |
| 265 | FULLNAME = $(PREFIX)$(NAME)$(SUFFIX) | |
| 216 | # fullname is prefix+name+suffix+debugsuffix | |
| 217 | FULLNAME = $(PREFIX)$(NAME)$(SUFFIX)$(DEBUGSUFFIX) | |
| 266 | 218 | |
| 267 | 219 | # add an EXE suffix to get the final emulator name |
| 268 | 220 | EMULATOR = $(FULLNAME)$(EXE) |
| r1355 | r1356 | |
| 299 | 251 | DEFS += -DINLINE="static __inline__" |
| 300 | 252 | |
| 301 | 253 | # define LSB_FIRST if we are a little-endian target |
| 302 | ife | |
| 254 | ifndef BIGENDIAN | |
| 303 | 255 | DEFS += -DLSB_FIRST |
| 304 | 256 | endif |
| 305 | 257 | |
| r1355 | r1356 | |
| 334 | 286 | # we compile to C89 standard with GNU extensions |
| 335 | 287 | CFLAGS = -std=gnu89 |
| 336 | 288 | |
| 289 | # this speeds it up a bit by piping between the preprocessor/compiler/assembler | |
| 290 | CFLAGS += -pipe | |
| 291 | ||
| 337 | 292 | # add -g if we need symbols |
| 338 | 293 | ifdef SYMBOLS |
| 339 | 294 | CFLAGS += -g |
| r1355 | r1356 | |
| 366 | 321 | # if we are optimizing, include optimization options |
| 367 | 322 | # and make all errors into warnings |
| 368 | 323 | ifneq ($(OPTIMIZE),0) |
| 369 | CFLAGS += -Werror $(ARCH) -fno-strict-aliasing | |
| 370 | #CFLAGS += $(ARCH) -fno-strict-aliasing | |
| 324 | CFLAGS += -Werror $(ARCHOPTS) -fno-strict-aliasing | |
| 325 | #CFLAGS += $(ARCHOPTS) -fno-strict-aliasing | |
| 371 | 326 | endif |
| 372 | 327 | |
| 373 | 328 | # if symbols are on, make sure we have frame pointers |
| Previous | 15994 Revisions | Next |