| Previous | 15994 Revisions | Next |
| r10316 Sunday 6th February, 2011 at 12:42:37 UTC by Miodrag Milanović |
|---|
| Sync with MAME (convert emu_timers to objects) |
| [src/emu] | devcpu.h devimage.c devintrf.c devintrf.h diexec.c emu.h emucore.h inptport.c machine.c machine.h schedule.c schedule.h screen.c screen.h sound.c timer.c timer.h uimenu.c video.c watchdog.c |
| [src/emu/audio] | generic.c |
| [src/emu/cpu/cop400] | cop400.c |
| [src/emu/cpu/e132xs] | e132xs.c |
| [src/emu/cpu/h83002] | h8_8.c h8periph.c |
| [src/emu/cpu/hd61700] | hd61700.c |
| [src/emu/cpu/lr35902] | lr35902.c lr35902.h |
| [src/emu/cpu/m37710] | m37710.c |
| [src/emu/cpu/m6800] | m6800.c |
| [src/emu/cpu/mb88xx] | mb88xx.c |
| [src/emu/cpu/mcs48] | mcs48.c |
| [src/emu/cpu/mips] | mips3com.c |
| [src/emu/cpu/mn10200] | mn10200.c |
| [src/emu/cpu/nec] | v25.c |
| [src/emu/cpu/powerpc] | ppc.c ppccom.c |
| [src/emu/cpu/sc61860] | sc61860.c |
| [src/emu/cpu/sh2] | sh2comn.c |
| [src/emu/cpu/sh4] | sh4comn.c |
| [src/emu/cpu/tlcs90] | tlcs90.c |
| [src/emu/cpu/tms34010] | tms34010.c |
| [src/emu/cpu/tms9900] | 99xxcore.h |
| [src/emu/cpu/z8] | z8.c |
| [src/emu/debug] | debugcpu.c |
| [src/emu/imagedev] | bitbngr.c cassette.c flopdrv.c snapquik.c |
| [src/emu/machine] | 6522via.c 6526cia.c 6532riot.c 6840ptm.c 6850acia.c 68681.c 74123.c 8042kbdc.c 8237dma.c 8257dma.c am53cf96.c at28c16.c cdp1852.c ds2401.c ds2404.c f3853.c generic.c idectrl.c ins8250.c intelfsh.c k056230.c latch8.c ldcore.c ldpr8210.c ldv1000.c ldvp931.c mb3773.c mc146818.c mc68901.c microtch.c pc16552d.c pic8259.c pit8253.c rtc65271.c s3c24xx.c timekpr.c tmp68301.c wd33c93.c z80ctc.c z80dart.c z80dma.c z80sio.c z80sti.c |
| [src/emu/sound] | 2203intf.c 2608intf.c 2610intf.c 2612intf.c 262intf.c 3526intf.c 3812intf.c 8950intf.c aica.c asc.c bsmt2000.c cdp1864.c cdp1869.c es5503.c fm.h fmopl.c ics2115.c k053260.c k053260.h k054539.c k056800.c mos6560.c msm5205.c pokey.c scsp.c sp0250.c speaker.c tms5110.c tms5220.c upd7759.c ym2151.c ym2413.c ymf262.c ymf271.c ymf278b.c ymz280b.c |
| [src/emu/video] | mc6845.c pc_vga.c tms34061.c voodoo.c |
| [src/ldplayer] | ldplayer.c |
| [src/mame] | mame.mak mamedriv.c |
| [src/mame/audio] | 8080bw.c amiga.c beezer.c cage.c cinemat.c dcs.c exidy.c geebee.c gottlieb.c harddriv.c jedi.c leland.c m72.c mcr.c n8080.c namco52.c namco54.c qix.c segag80r.c segasnd.c senjyo.c snes_snd.c starwars.c t5182.c turbo.c vicdual.c warpwarp.c williams.c |
| [src/mame/drivers] | 2mindril.c 39in1.c 40love.c acefruit.c alg.c alpha68k.c aristmk4.c aristmk5.c artmagic.c asterix.c astinvad.c asuka.c atarisy2.c atetris.c beaminv.c berzerk.c bfcobra.c bfm_sc1.c bfm_sc2.c bfmsys85.c bigevglf.c bombjack.c boxer.c btoads.c buggychl.c capbowl.c cave.c cball.c ccastles.c cclimber.c champbas.c cidelsa.c clayshoo.c cliffhgr.c cloud9.c cojag.c combatsc.c coolpool.c crgolf.c crystal.c cubeqst.c cvs.c dec8.c destroyr.c enigma2.c eolith.c eolithsp.c equites.c esh.c espial.c esripsys.c exidy440.c exterm.c fgoal.c firebeat.c firetrk.c flstory.c flyball.c fromance.c fuukifg2.c fuukifg3.c gaelco3d.c galaga.c galastrm.c gaplus.c gcpinbal.c gijoe.c gottlieb.c gpworld.c grchamp.c gridlee.c groundfx.c gticlub.c guab.c gunbustr.c halleys.c hitme.c hng64.c hornet.c hyprduel.c itech32.c itech8.c jangou.c jedi.c jpmimpct.c jpmsys5.c kinst.c konamigx.c ksys573.c ladyfrog.c lgp.c lkage.c m10.c m107.c m63.c m72.c m92.c magmax.c mappy.c marineb.c maygay1b.c mazerbla.c megadriv.c megatech.c metro.c mgolf.c midvunit.c midzeus.c missile.c mjsister.c mlanding.c moo.c mpu4.c mpu4drvr.c msisaac.c multigam.c mustache.c mw18w.c* mw8080bw.c namcofl.c namconb1.c namcos10.c namcos22.c namcos23.c naomi.c neodrvr.c neogeo.c nmk16.c nycaptor.c orbit.c othunder.c panicr.c parodius.c peplus.c pgm.c pipedrm.c pipeline.c policetr.c powerins.c psikyo.c qdrmfgp.c rabbit.c rollerg.c rpunch.c runaway.c sbrkout.c seattle.c segahang.c segaorun.c segas16a.c segas16b.c segas18.c segas32.c segaxbd.c segaybd.c seta.c simpsons.c skullxbo.c slapshot.c snk.c sothello.c spacefb.c sprint4.c ssfindo.c sslam.c ssv.c st0016.c stv.c superqix.c suprridr.c taito_b.c taito_f2.c taito_f3.c taito_z.c taitogn.c tankbust.c tehkanwc.c tetrisp2.c thayers.c thunderx.c tickee.c tmmjprd.c tmnt.c toaplan2.c topspeed.c toypop.c trucocl.c trvquest.c tubep.c tugboat.c turbo.c twincobr.c ultratnk.c undrfire.c vaportra.c vegas.c vendetta.c vicdual.c videopin.c wardner.c wgp.c wheelfir.c wink.c wolfpack.c xexex.c zn.c zodiack.c zr107.c |
| [src/mame/includes] | cave.h |
| [src/mame/layout] | 18w.lay* gamball.lay mpu4ext.lay* |
| [src/mame/machine] | amiga.c archimds.c arkanoid.c asic65.c atarigen.c balsente.c bublbobl.c cdi070.c cdicdic.c cdislave.c cubocd32.c dc.c decocass.c gaelco3d.c harddriv.c irobot.c leland.c lsasquad.c mcr.c mcr68.c megadriv.c meters.c meters.h mhavoc.c micro3d.c midwayic.c midwunit.c model1.c mw8080bw.c n64.c namco06.c namco50.c namco53.c namcos2.c nb1413m3.c nmk004.c nmk112.c opwolf.c pcshare.c pitnrun.c psx.c qix.c rainbow.c segamsys.c slapstic.c slikshot.c snes.c starwars.c steppers.c steppers.h stfight.c tait8741.c taitosj.c ticket.c tnzs.c vertigo.c volfied.c williams.c |
| [src/mame/video] | artmagic.c astrocde.c atari.c atarimo.c atarisy2.c avgdvg.c blstroid.c cave.c cchasm.c changela.c dc.c dcheese.c dday.c dkong.c esripsys.c exidy.c exidy440.c fromance.c galaxold.c gameplan.c hyhoo.c itech32.c itech8.c jaguar.c leland.c lethalj.c lockon.c m92.c mcd212.c midtunit.c midvunit.c midyunit.c midzeus2.c mystston.c n8080.c nbmj8688.c nbmj8891.c nbmj8900.c nbmj8991.c nbmj9195.c neogeo.c niyanpai.c pastelg.c ppu2c0x.c rpunch.c segag80r.c segaic16.c segaic16.h segas32.c sprint8.c starfire.c tank8.c triplhnt.c tubep.c twin16.c tx1.c victory.c |
| [src/mess/audio] | dave.c lynx.c mea8000.c svision.c t6721.c ted7360.c upd1771.c |
| [src/mess/devices] | cococart.c kermit.c microdrv.c sonydriv.c xmodem.c |
| [src/mess/drivers] | 4004clk.c a2600.c a7000.c abc80.c atarist.c avigo.c beta.c bml3.c busicom.c c10.c cat.c coleco.c craft.c dectalk.c fk1.c fm7.c fmtowns.c gba.c glasgow.c gp32.c h19.c intv.c ip20.c ip22.c jr200.c junior.c kim1.c mekd2.c mephisto.c micronic.c mk1.c mk2.c mpf1.c multi8.c mycom.c nanos.c nc.c newbrain.c ng_aes.c ngp.c okean240.c osbexec.c osi.c pasogo.c pb1000.c pc6001.c pc8801.c pc88va.c pcw.c pcw16.c pockstat.c polgar.c prof80.c psion.c psx.c ptcsol.c pv1000.c px4.c samcoupe.c saturn.c scorpion.c scv.c sg1000.c smc777.c snes.c socrates.c ssystem3.c studio2.c supercon.c supracan.c svision.c tec1.c ti89.c tk80bs.c tm990189.c tmc1800.c tutor.c vg5k.c vt100.c x07.c x1.c x68k.c z88.c |
| [src/mess/formats] | mz_cas.c |
| [src/mess/includes] | coco.h |
| [src/mess/machine] | 64h156.c 6525tpi.c 6551.c 8530scc.c abc77.c adc080x.c amigacd.c amigacrt.c amigafdc.c amigakbd.c amstrad.c apple1.c apple2.c apple2gs.c applefdc.c at29040.c at29040a.c ay31015.c ay3600.c bbc.c bebox.c bk.c c128.c c1541.c c1551.c c1571.c c16.c c2040.c c64.c c65.c cbm.c cbmb.c cdp1871.c cgenie.c coco.c com8116.c compis.c comx35.c corvushd.c ctronics.c cybiko.c dai.c dc.c e0516.c electron.c europc.c fm_scsi.c gamecom.c gb.c hd63450.c hec2hrp.c hecdisk2.c hp48.c i8155.c i8257.c i8271.c ibmpc.c intv.c irisha.c kay_kbd.c kaypro.c kb3600.c kc.c kr2376.c lisa.c llc.c lviv.c lynx.c mac.c matsucd.c mb89352.c mbee.c mc68328.c mc6843.c mc6846.c mc6852.c mc6854.c microtan.c mikro80.c mm58274c.c mm74c922.c mos6530.c msm58321.c mz700.c nes.c nes_pcb.c odyssey2.c ondra.c oric.c osborne1.c pc.c pc1251.c pc1350.c pc1401.c pc1403.c pc_fdc.c pc_hdc.c pc_joy.c pc_mouse.c pc_turbo.c pce.c pcf8593.c pdp1.c pecom.c pet.c pmd85.c pokemini.c poly88.c radio86.c rmnimbus.c rp5c01a.c rp5c15.c samcoupe.c scsibus.c serial.c sgi.c smc92x4.c sms.c sorcerer.c special.c super80.c sym1.c tc8521.c teleprinter.c terminal.c tf20.c thomflop.c thomson.c ti85.c ti990.c tms5501.c tms9901.c tms9902.c trs80.c tx0.c upd1990a.c upd7002.c upd71071.c upd765.c ut88.c vector06.c vectrex.c wd17xx.c wswan.c x68k_hdc.c z80ne.c zx.c zx8302.c |
| [src/mess/machine/ti99] | bwg.c handset.c hfdc.c spchsyn.c speech8.c ti_fdc.c |
| [src/mess/tools/messtest] | core.c testmess.c |
| [src/mess/video] | 911_vdt.c aim65.c apple1.c apple2.c atarist.c cdp1861.c coco3.c coco6847.c crt9007.c crtc6845.c crtc_ega.c ef9345.c electron.c fm7.c fmtowns.c galaxy.c gamecom.c gb.c hd44352.c hd44780.c hd61830.c hp48.c k1ge.c m6845.c m6847.c mz700.c odyssey2.c oric.c pc_cga.c pc_mda.c pc_vga_mess.c smsvdp.c thomson.c upd3301.c upd7220.c vdc8563.c vectrex.c vic4567.c vic6567.c vtvideo.c x68k.c zx.c zx8301.c |
| [src/osd/osdmini] | minimain.c |
| r10315 | r10316 | |
|---|---|---|
| 236 | 236 | |
| 237 | 237 | state->channel = device->machine->sound().stream_alloc(*device, 0, 1, CLOCK_16H, NULL, warpwarp_sound_update); |
| 238 | 238 | |
| 239 | state->sound_volume_timer = timer_alloc(machine, sound_volume_decay, state); | |
| 240 | state->music_volume_timer = timer_alloc(machine, music_volume_decay, state); | |
| 239 | state->sound_volume_timer = machine->scheduler().timer_alloc(FUNC(sound_volume_decay), state); | |
| 240 | state->music_volume_timer = machine->scheduler().timer_alloc(FUNC(music_volume_decay), state); | |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 |
| r10315 | r10316 | |
|---|---|---|
| 329 | 329 | |
| 330 | 330 | WRITE8_HANDLER( n8080_sound_1_w ) |
| 331 | 331 | { |
| 332 | | |
| 332 | | |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | WRITE8_HANDLER( n8080_sound_2_w ) |
| 336 | 336 | { |
| 337 | | |
| 337 | | |
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | |
| r10315 | r10316 | |
| 431 | 431 | state->helifire_dac_timing = DECAY_RATE * log(state->helifire_dac_volume); |
| 432 | 432 | } |
| 433 | 433 | |
| 434 | state->helifire_dac_timing += | |
| 434 | state->helifire_dac_timing += | |
| 435 | 435 | } |
| 436 | 436 | |
| 437 | 437 | |
| r10315 | r10316 | |
| 453 | 453 | static TIMER_DEVICE_CALLBACK( helifire_dac_volume_timer ) |
| 454 | 454 | { |
| 455 | 455 | n8080_state *state = timer.machine->driver_data<n8080_state>(); |
| 456 | double t = state->helifire_dac_timing - timer | |
| 456 | double t = state->helifire_dac_timing - timer | |
| 457 | 457 | |
| 458 | 458 | if (state->helifire_dac_phase) |
| 459 | 459 | { |
| r10315 | r10316 | |
| 470 | 470 | { |
| 471 | 471 | n8080_state *state = machine->driver_data<n8080_state>(); |
| 472 | 472 | |
| 473 | state->sound_timer[0] = timer_alloc(machine, stop_mono_flop_callback, NULL); | |
| 474 | state->sound_timer[1] = timer_alloc(machine, stop_mono_flop_callback, NULL); | |
| 475 | state->sound_timer[2] = timer_alloc(machine, stop_mono_flop_callback, NULL); | |
| 473 | state->sound_timer[0] = machine->scheduler().timer_alloc(FUNC(stop_mono_flop_callback)); | |
| 474 | state->sound_timer[1] = machine->scheduler().timer_alloc(FUNC(stop_mono_flop_callback)); | |
| 475 | state->sound_timer[2] = machine->scheduler().timer_alloc(FUNC(stop_mono_flop_callback)); | |
| 476 | 476 | |
| 477 | 477 | state_save_register_global(machine, state->prev_snd_data); |
| 478 | 478 | state_save_register_global(machine, state->prev_sound_pins); |
| r10315 | r10316 | |
| 502 | 502 | { |
| 503 | 503 | n8080_state *state = machine->driver_data<n8080_state>(); |
| 504 | 504 | |
| 505 | state->sound_timer[0] = timer_alloc(machine, stop_mono_flop_callback, NULL); | |
| 506 | state->sound_timer[1] = timer_alloc(machine, stop_mono_flop_callback, NULL); | |
| 505 | state->sound_timer[0] = machine->scheduler().timer_alloc(FUNC(stop_mono_flop_callback)); | |
| 506 | state->sound_timer[1] = machine->scheduler().timer_alloc(FUNC(stop_mono_flop_callback)); | |
| 507 | 507 | |
| 508 | 508 | state_save_register_global(machine, state->prev_snd_data); |
| 509 | 509 | state_save_register_global(machine, state->prev_sound_pins); |
| r10315 | r10316 | |
|---|---|---|
| 111 | 111 | #else |
| 112 | 112 | |
| 113 | 113 | if (((data ^ last_sound_a) & 0x1e) && (last_sound_a & 0x1e) != 0x1e) |
| 114 | | |
| 114 | | |
| 115 | 115 | else |
| 116 | 116 | update_sound_a(data); |
| 117 | 117 |
| r10315 | r10316 | |
|---|---|---|
| 541 | 541 | running_machine *machine = cage_cpu->machine; |
| 542 | 542 | if (LOG_COMM) |
| 543 | 543 | logerror("%s:Command to CAGE = %04X\n", cpuexec_describe_context(machine), data); |
| 544 | | |
| 544 | | |
| 545 | 545 | } |
| 546 | 546 | |
| 547 | 547 |
| r10315 | r10316 | |
|---|---|---|
| 142 | 142 | { |
| 143 | 143 | namco_52xx_state *state = get_safe_token(device); |
| 144 | 144 | |
| 145 | | |
| 145 | | |
| 146 | 146 | |
| 147 | 147 | cpu_set_input_line(state->cpu, 0, ASSERT_LINE); |
| 148 | 148 | |
| r10315 | r10316 | |
| 154 | 154 | |
| 155 | 155 | /* the 52xx uses TSTI to check for an interrupt; it also may be handling |
| 156 | 156 | a timer interrupt, so we need to ensure the IRQ line is held long enough */ |
| 157 | | |
| 157 | | |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | |
| r10315 | r10316 | |
| 220 | 220 | |
| 221 | 221 | /* start the external clock */ |
| 222 | 222 | if (intf->extclock != 0) |
| 223 | | |
| 223 | | |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 |
| r10315 | r10316 | |
|---|---|---|
| 90 | 90 | sample_set_volume(device, 0, state->single_volume / 15.0); |
| 91 | 91 | sample_start_raw(device, 0, state->single_data, SINGLE_LENGTH, state->single_rate, 1); |
| 92 | 92 | |
| 93 | timer_pulse(machine | |
| 93 | machine->scheduler().timer_pulse(machine | |
| 94 | 94 | } |
| r10315 | r10316 | |
|---|---|---|
| 222 | 222 | |
| 223 | 223 | WRITE8_HANDLER( sega_speech_data_w ) |
| 224 | 224 | { |
| 225 | | |
| 225 | | |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | |
| r10315 | r10316 | |
| 356 | 356 | WRITE8_HANDLER( sega_usb_data_w ) |
| 357 | 357 | { |
| 358 | 358 | LOG(("%04X:usb_data_w = %02X\n", cpu_get_pc(space->cpu), data)); |
| 359 | | |
| 359 | | |
| 360 | 360 | |
| 361 | 361 | /* boost the interleave so that sequences can be sent */ |
| 362 | 362 | cpuexec_boost_interleave(space->machine, attotime::zero, attotime::from_usec(250)); |
| r10315 | r10316 | |
|---|---|---|
| 557 | 557 | |
| 558 | 558 | /* create timers here so they stick around */ |
| 559 | 559 | state->i80186.cpu = dmaspace->cpu; |
| 560 | state->i80186.timer[0].int_timer = timer_alloc(machine, internal_timer_int, device); | |
| 561 | state->i80186.timer[1].int_timer = timer_alloc(machine, internal_timer_int, device); | |
| 562 | state->i80186.timer[2].int_timer = timer_alloc(machine, internal_timer_int, device); | |
| 563 | state->i80186.timer[0].time_timer = timer_alloc(machine, NULL, NULL); | |
| 564 | state->i80186.timer[1].time_timer = timer_alloc(machine, NULL, NULL); | |
| 565 | state->i80186.timer[2].time_timer = timer_alloc(machine, NULL, NULL); | |
| 566 | state->i80186.dma[0].finish_timer = timer_alloc(machine, dma_timer_callback, device); | |
| 567 | state->i80186.dma[1].finish_timer = timer_alloc(machine, dma_timer_callback, device); | |
| 560 | state->i80186.timer[0].int_timer = machine->scheduler().timer_alloc(FUNC(internal_timer_int), device); | |
| 561 | state->i80186.timer[1].int_timer = machine->scheduler().timer_alloc(FUNC(internal_timer_int), device); | |
| 562 | state->i80186.timer[2].int_timer = machine->scheduler().timer_alloc(FUNC(internal_timer_int), device); | |
| 563 | state->i80186.timer[0].time_timer = machine->scheduler().timer_alloc(FUNC(NULL)); | |
| 564 | state->i80186.timer[1].time_timer = machine->scheduler().timer_alloc(FUNC(NULL)); | |
| 565 | state->i80186.timer[2].time_timer = machine->scheduler().timer_alloc(FUNC(NULL)); | |
| 566 | state->i80186.dma[0].finish_timer = machine->scheduler().timer_alloc(FUNC(dma_timer_callback), device); | |
| 567 | state->i80186.dma[1].finish_timer = machine->scheduler().timer_alloc(FUNC(dma_timer_callback), device); | |
| 568 | 568 | |
| 569 | 569 | for (i = 0; i < 9; i++) |
| 570 | state->counter[i].timer = timer_alloc( | |
| 570 | state->counter[i].timer = machine->scheduler().timer_alloc(F | |
| 571 | 571 | } |
| 572 | 572 | |
| 573 | 573 | static DEVICE_START( leland_80186_sound ) |
| r10315 | r10316 | |
| 694 | 694 | static IRQ_CALLBACK( int_callback ) |
| 695 | 695 | { |
| 696 | 696 | leland_sound_state *state = get_safe_token(device->machine->device("custom")); |
| 697 | if (LOG_INTERRUPTS) logerror("(%f) **** Acknowledged interrupt vector %02X\n", | |
| 697 | if (LOG_INTERRUPTS) logerror("(%f) **** Acknowledged interrupt vector %02X\n", | |
| 698 | 698 | |
| 699 | 699 | /* clear the interrupt */ |
| 700 | 700 | cpu_set_input_line(state->i80186.cpu, 0, CLEAR_LINE); |
| r10315 | r10316 | |
| 809 | 809 | if (!state->i80186.intr.pending) |
| 810 | 810 | cputag_set_input_line(machine, "audiocpu", 0, ASSERT_LINE); |
| 811 | 811 | state->i80186.intr.pending = 1; |
| 812 | if (LOG_INTERRUPTS) logerror("(%f) **** Requesting interrupt vector %02X\n", | |
| 812 | if (LOG_INTERRUPTS) logerror("(%f) **** Requesting interrupt vector %02X\n", | |
| 813 | 813 | } |
| 814 | 814 | |
| 815 | 815 | |
| r10315 | r10316 | |
| 836 | 836 | case 0x0f: state->i80186.intr.in_service &= ~0x80; break; |
| 837 | 837 | default: logerror("%s:ERROR - 80186 EOI with unknown vector %02X\n", cpuexec_describe_context(machine), data & 0x1f); |
| 838 | 838 | } |
| 839 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for vector %02X\n", | |
| 839 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for vector %02X\n", | |
| 840 | 840 | } |
| 841 | 841 | |
| 842 | 842 | /* non-specific case */ |
| r10315 | r10316 | |
| 849 | 849 | if ((state->i80186.intr.timer & 7) == i && (state->i80186.intr.in_service & 0x01)) |
| 850 | 850 | { |
| 851 | 851 | state->i80186.intr.in_service &= ~0x01; |
| 852 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for timer\n", | |
| 852 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for timer\n", | |
| 853 | 853 | return; |
| 854 | 854 | } |
| 855 | 855 | |
| r10315 | r10316 | |
| 858 | 858 | if ((state->i80186.intr.dma[j] & 7) == i && (state->i80186.intr.in_service & (0x04 << j))) |
| 859 | 859 | { |
| 860 | 860 | state->i80186.intr.in_service &= ~(0x04 << j); |
| 861 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for DMA%d\n", | |
| 861 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for DMA%d\n", | |
| 862 | 862 | return; |
| 863 | 863 | } |
| 864 | 864 | |
| r10315 | r10316 | |
| 867 | 867 | if ((state->i80186.intr.ext[j] & 7) == i && (state->i80186.intr.in_service & (0x10 << j))) |
| 868 | 868 | { |
| 869 | 869 | state->i80186.intr.in_service &= ~(0x10 << j); |
| 870 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for INT%d\n", | |
| 870 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for INT%d\n", | |
| 871 | 871 | return; |
| 872 | 872 | } |
| 873 | 873 | } |
| r10315 | r10316 | |
| 1814 | 1814 | |
| 1815 | 1815 | WRITE8_DEVICE_HANDLER( leland_80186_command_lo_w ) |
| 1816 | 1816 | { |
| 1817 | | |
| 1817 | | |
| 1818 | 1818 | } |
| 1819 | 1819 | |
| 1820 | 1820 | |
| r10315 | r10316 | |
| 1877 | 1877 | if (LOG_COMM) logerror("%04X:Read sound response latch = %02X\n", pc, state->sound_response); |
| 1878 | 1878 | |
| 1879 | 1879 | /* synchronize the response */ |
| 1880 | | |
| 1880 | | |
| 1881 | 1881 | return state->sound_response; |
| 1882 | 1882 | } |
| 1883 | 1883 |
| r10315 | r10316 | |
|---|---|---|
| 582 | 582 | sega005_stream = device->machine->sound().stream_alloc(*device, 0, 1, SEGA005_COUNTER_FREQ, NULL, sega005_stream_update); |
| 583 | 583 | |
| 584 | 584 | /* create a timer for the 555 */ |
| 585 | sega005_sound_timer = timer_alloc( | |
| 585 | sega005_sound_timer = machine->scheduler().timer_alloc(FUNC( | |
| 586 | 586 | |
| 587 | 587 | /* set the initial sound data */ |
| 588 | 588 | sound_data = 0x00; |
| r10315 | r10316 | |
|---|---|---|
| 1515 | 1515 | logerror("%s: DCS reset = %d\n", cpuexec_describe_context(dcs.cpu->machine), state); |
| 1516 | 1516 | |
| 1517 | 1517 | /* just run through the init code again */ |
| 1518 | | |
| 1518 | | |
| 1519 | 1519 | cpu_set_input_line(dcs.cpu, INPUT_LINE_RESET, ASSERT_LINE); |
| 1520 | 1520 | } |
| 1521 | 1521 | |
| r10315 | r10316 | |
| 1589 | 1589 | |
| 1590 | 1590 | /* if we are DCS1, set a timer to latch the data */ |
| 1591 | 1591 | if (dcs.sport_timer == NULL) |
| 1592 | | |
| 1592 | | |
| 1593 | 1593 | else |
| 1594 | 1594 | dcs_delayed_data_w(dcs.cpu->machine, data); |
| 1595 | 1595 | } |
| r10315 | r10316 | |
| 1632 | 1632 | { |
| 1633 | 1633 | if (LOG_DCS_IO) |
| 1634 | 1634 | logerror("%08X:output_latch_w(%04X) (empty=%d)\n", cpu_get_pc(space->cpu), data, IS_OUTPUT_EMPTY()); |
| 1635 | | |
| 1635 | | |
| 1636 | 1636 | } |
| 1637 | 1637 | |
| 1638 | 1638 | |
| r10315 | r10316 | |
| 1650 | 1650 | |
| 1651 | 1651 | void dcs_ack_w(void) |
| 1652 | 1652 | { |
| 1653 | | |
| 1653 | | |
| 1654 | 1654 | } |
| 1655 | 1655 | |
| 1656 | 1656 | |
| r10315 | r10316 | |
| 1686 | 1686 | { |
| 1687 | 1687 | if (LOG_DCS_IO) |
| 1688 | 1688 | logerror("%04X:output_control = %04X\n", cpu_get_pc(space->cpu), data); |
| 1689 | | |
| 1689 | | |
| 1690 | 1690 | } |
| 1691 | 1691 | |
| 1692 | 1692 | |
| r10315 | r10316 | |
| 2122 | 2122 | /* if the output is full, stall for a usec */ |
| 2123 | 2123 | if (IS_OUTPUT_FULL()) |
| 2124 | 2124 | { |
| 2125 | timer_set( | |
| 2125 | machine->scheduler().timer_set( | |
| 2126 | 2126 | return; |
| 2127 | 2127 | } |
| 2128 | 2128 | output_latch_w(cpu_get_address_space(dcs.cpu, ADDRESS_SPACE_PROGRAM), 0, 0x000a, 0xffff); |
| r10315 | r10316 | |
| 2134 | 2134 | /* if the output is full, stall for a usec */ |
| 2135 | 2135 | if (IS_OUTPUT_FULL()) |
| 2136 | 2136 | { |
| 2137 | timer_set( | |
| 2137 | machine->scheduler().timer_set( | |
| 2138 | 2138 | return; |
| 2139 | 2139 | } |
| 2140 | 2140 | output_latch_w(cpu_get_address_space(dcs.cpu, ADDRESS_SPACE_PROGRAM), 0, param, 0xffff); |
| 2141 | 2141 | |
| 2142 | 2142 | /* chain to the next word we need to write back */ |
| 2143 | timer_set( | |
| 2143 | machine->scheduler().timer_set( | |
| 2144 | 2144 | } |
| 2145 | 2145 | |
| 2146 | 2146 | |
| r10315 | r10316 | |
| 2256 | 2256 | |
| 2257 | 2257 | /* if we're done, start a timer to send the response words */ |
| 2258 | 2258 | if (transfer.state == 0) |
| 2259 | timer_set( | |
| 2259 | machine->scheduler().timer_set( | |
| 2260 | 2260 | return 1; |
| 2261 | 2261 | } |
| 2262 | 2262 | break; |
| r10315 | r10316 | |
| 2272 | 2272 | /* if the output is full, stall for a usec */ |
| 2273 | 2273 | if (IS_OUTPUT_FULL()) |
| 2274 | 2274 | { |
| 2275 | timer_set( | |
| 2275 | machine->scheduler().timer_set( | |
| 2276 | 2276 | return; |
| 2277 | 2277 | } |
| 2278 | 2278 | output_latch_w(space, 0, param, 0xffff); |
| r10315 | r10316 | |
| 2369 | 2369 | /* if we're done, start a timer to send the response words */ |
| 2370 | 2370 | if (transfer.state == 0) |
| 2371 | 2371 | { |
| 2372 | timer_set( | |
| 2372 | machine->scheduler().timer_set( | |
| 2373 | 2373 | transfer.watchdog->reset(); |
| 2374 | 2374 | } |
| 2375 | 2375 | return 1; |
| r10315 | r10316 | |
|---|---|---|
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | /* generate a NMI after a while to make the CPU continue to send data */ |
| 275 | | |
| 275 | | |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | static WRITE8_HANDLER( speech_clock_dac_w ) |
| r10315 | r10316 | |
| 446 | 446 | nmi_state_update(machine); |
| 447 | 447 | |
| 448 | 448 | /* set a timer to turn it off again on hte next SOUND_CLOCK/16 */ |
| 449 | timer_set( | |
| 449 | machine->scheduler().timer_set( | |
| 450 | 450 | |
| 451 | 451 | /* adjust the NMI timer for the next time */ |
| 452 | 452 | nmi_timer_adjust(); |
| r10315 | r10316 | |
| 526 | 526 | static SOUND_START( gottlieb2 ) |
| 527 | 527 | { |
| 528 | 528 | /* set up the NMI timer */ |
| 529 | nmi_timer = timer_alloc( | |
| 529 | nmi_timer = machine->scheduler().timer_alloc(FUNC(n | |
| 530 | 530 | nmi_rate = 0; |
| 531 | 531 | nmi_timer_adjust(); |
| 532 | 532 |
| r10315 | r10316 | |
|---|---|---|
| 88 | 88 | |
| 89 | 89 | WRITE8_HANDLER( jedi_audio_latch_w ) |
| 90 | 90 | { |
| 91 | | |
| 91 | | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 |
| r10315 | r10316 | |
|---|---|---|
| 495 | 495 | |
| 496 | 496 | if (state->tms != NULL) |
| 497 | 497 | { |
| 498 | logerror("(%f)%s:TMS5220 data write = %02X\n", | |
| 498 | logerror("(%f)%s:TMS5220 data write = %02X\n", | |
| 499 | 499 | tms5220_data_w(state->tms, 0, data); |
| 500 | 500 | } |
| 501 | 501 | } |
| r10315 | r10316 | |
| 505 | 505 | exidy_sound_state *state = get_safe_token(device); |
| 506 | 506 | if (state->tms != NULL) |
| 507 | 507 | { |
| 508 | logerror("(%f)%s:TMS5220 status read = %02X\n", | |
| 508 | logerror("(%f)%s:TMS5220 status read = %02X\n", | |
| 509 | 509 | return tms5220_status_r(state->tms, 0); |
| 510 | 510 | } |
| 511 | 511 | else |
| r10315 | r10316 | |
| 1008 | 1008 | |
| 1009 | 1009 | if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound command = %02X\n", cpu_get_previouspc(state->maincpu), data); |
| 1010 | 1010 | |
| 1011 | | |
| 1011 | | |
| 1012 | 1012 | } |
| 1013 | 1013 | |
| 1014 | 1014 |
| r10315 | r10316 | |
|---|---|---|
| 918 | 918 | { |
| 919 | 919 | mw8080bw_state *state = machine->driver_data<mw8080bw_state>(); |
| 920 | 920 | |
| 921 | state->schaser_effect_555_timer = timer_alloc( | |
| 921 | state->schaser_effect_555_timer = machine->scheduler().timer_alloc(FUNC( | |
| 922 | 922 | |
| 923 | 923 | state_save_register_global(machine, state->schaser_explosion); |
| 924 | 924 | state_save_register_global(machine, state->schaser_effect_555_is_low); |
| r10315 | r10316 | |
|---|---|---|
| 109 | 109 | static WRITE8_DEVICE_HANDLER( sync_sndpia1_porta_w ) |
| 110 | 110 | { |
| 111 | 111 | /* we need to synchronize this so the sound CPU doesn't drop anything important */ |
| 112 | | |
| 112 | | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 |
| r10315 | r10316 | |
|---|---|---|
| 270 | 270 | for (i = 0; i < 4; i++) |
| 271 | 271 | { |
| 272 | 272 | audio_state->channel[i].index = i; |
| 273 | audio_state->channel[i].irq_timer = | |
| 273 | audio_state->channel[i].irq_timer = | |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | /* create the stream */ |
| r10315 | r10316 | |
|---|---|---|
| 1471 | 1471 | |
| 1472 | 1472 | /* watch for a 0->1 edge on bit 4 ("shift in") to clock in the new data */ |
| 1473 | 1473 | if ((bits_changed & 0x10) && (sound_val & 0x10)) |
| 1474 | | |
| 1474 | | |
| 1475 | 1475 | } |
| 1476 | 1476 | |
| 1477 | 1477 |
| r10315 | r10316 | |
|---|---|---|
| 120 | 120 | { |
| 121 | 121 | namco_54xx_state *state = get_safe_token(device); |
| 122 | 122 | |
| 123 | | |
| 123 | | |
| 124 | 124 | |
| 125 | 125 | cpu_set_input_line(state->cpu, 0, ASSERT_LINE); |
| 126 | 126 | |
| r10315 | r10316 | |
| 129 | 129 | // The input clock to the 06XX interface chip is 64H, that is |
| 130 | 130 | // 18432000/6/64 = 48kHz, so it makes sense for the irq line to be |
| 131 | 131 | // asserted for one clock cycle ~= 21us. |
| 132 | | |
| 132 | | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 |
| r10315 | r10316 | |
|---|---|---|
| 358 | 358 | /********* external interfaces ***********/ |
| 359 | 359 | WRITE8_HANDLER( ssio_data_w ) |
| 360 | 360 | { |
| 361 | | |
| 361 | space->machine->schedul | |
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | READ8_HANDLER( ssio_status_r ) |
| r10315 | r10316 | |
| 548 | 548 | /********* external interfaces ***********/ |
| 549 | 549 | WRITE8_HANDLER( csdeluxe_data_w ) |
| 550 | 550 | { |
| 551 | | |
| 551 | | |
| 552 | 552 | } |
| 553 | 553 | |
| 554 | 554 | READ8_HANDLER( csdeluxe_status_r ) |
| r10315 | r10316 | |
| 666 | 666 | /********* external interfaces ***********/ |
| 667 | 667 | WRITE8_HANDLER( soundsgood_data_w ) |
| 668 | 668 | { |
| 669 | | |
| 669 | | |
| 670 | 670 | } |
| 671 | 671 | |
| 672 | 672 | READ8_HANDLER( soundsgood_status_r ) |
| r10315 | r10316 | |
| 770 | 770 | /********* external interfaces ***********/ |
| 771 | 771 | WRITE8_HANDLER( turbocs_data_w ) |
| 772 | 772 | { |
| 773 | | |
| 773 | | |
| 774 | 774 | } |
| 775 | 775 | |
| 776 | 776 | READ8_HANDLER( turbocs_status_r ) |
| r10315 | r10316 | |
| 903 | 903 | /********* external interfaces ***********/ |
| 904 | 904 | WRITE8_HANDLER( squawkntalk_data_w ) |
| 905 | 905 | { |
| 906 | | |
| 906 | | |
| 907 | 907 | } |
| 908 | 908 | |
| 909 | 909 | void squawkntalk_reset_w(running_machine *machine, int state) |
| r10315 | r10316 | |
|---|---|---|
| 206 | 206 | |
| 207 | 207 | WRITE8_HANDLER( t5182_sound_irq_w ) |
| 208 | 208 | { |
| 209 | | |
| 209 | | |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | static WRITE8_HANDLER( t5182_ym2151_irq_ack_w ) |
| 213 | 213 | { |
| 214 | | |
| 214 | | |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | static WRITE8_HANDLER( t5182_cpu_irq_ack_w ) |
| 218 | 218 | { |
| 219 | | |
| 219 | | |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | static void t5182_ym2151_irq_handler(device_t *device, int irq) |
| 223 | 223 | { |
| 224 | 224 | if (irq) |
| 225 | | |
| 225 | device->machine->schedul | |
| 226 | 226 | else |
| 227 | | |
| 227 | | |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 |
| r10315 | r10316 | |
|---|---|---|
| 139 | 139 | |
| 140 | 140 | MACHINE_START( frogs_audio ) |
| 141 | 141 | { |
| 142 | frogs_croak_timer = timer_alloc( | |
| 142 | frogs_croak_timer = machine->scheduler().timer_alloc(FUNC( | |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 |
| r10315 | r10316 | |
|---|---|---|
| 78 | 78 | |
| 79 | 79 | WRITE16_HANDLER( hd68k_snd_data_w ) |
| 80 | 80 | { |
| 81 | | |
| 81 | | |
| 82 | 82 | logerror("%06X:main write to sound=%04X\n", cpu_get_previouspc(space->cpu), data); |
| 83 | 83 | } |
| 84 | 84 |
| r10315 | r10316 | |
|---|---|---|
| 118 | 118 | void m72_ym2151_irq_handler(device_t *device, int irq) |
| 119 | 119 | { |
| 120 | 120 | if (irq) |
| 121 | | |
| 121 | | |
| 122 | 122 | else |
| 123 | | |
| 123 | | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | WRITE16_HANDLER( m72_sound_command_w ) |
| r10315 | r10316 | |
| 128 | 128 | if (ACCESSING_BITS_0_7) |
| 129 | 129 | { |
| 130 | 130 | soundlatch_w(space,offset,data); |
| 131 | | |
| 131 | | |
| 132 | 132 | } |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | WRITE8_HANDLER( m72_sound_command_byte_w ) |
| 136 | 136 | { |
| 137 | 137 | soundlatch_w(space,offset,data); |
| 138 | | |
| 138 | | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | WRITE8_HANDLER( m72_sound_irq_ack_w ) |
| 142 | 142 | { |
| 143 | | |
| 143 | | |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 |
| r10315 | r10316 | |
|---|---|---|
| 141 | 141 | state->channel = device->machine->sound().stream_alloc(*device, 0, 1, 18432000 / 3 / 2 / 384, NULL, geebee_sound_update); |
| 142 | 142 | state->vcount = 0; |
| 143 | 143 | |
| 144 | state->volume_timer = timer_alloc( | |
| 144 | state->volume_timer = machine->scheduler().timer_alloc(FUNC( | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | DEVICE_GET_INFO( geebee_sound ) |
| r10315 | r10316 | |
|---|---|---|
| 7 | 7 | AKA Lord Nightmare |
| 8 | 8 | |
| 9 | 9 | TODO: |
| 10 | * get rid of sh6840_LFSR_oldxor, is leftover of old code. | |
| 11 | 10 | * Several inexplicable things on the schematic are not handled, such as the |
| 12 | 11 | 'VCO' input for 6840 channel 2 external clock whose source does not appear |
| 13 | 12 | anywhere on the schematic, nor does it handle the 'DMOD DATA' and 'DMOD |
| r10315 | r10316 | |
| 102 | 101 | UINT8 sh6840_volume[4]; |
| 103 | 102 | UINT8 sh6840_MSB_latch; |
| 104 | 103 | UINT8 sh6840_LSB_latch; |
| 105 | UINT8 sh6840_LFSR_oldxor; | |
| 106 | 104 | UINT32 sh6840_LFSR; |
| 107 | 105 | UINT32 sh6840_LFSR_clocks; |
| 108 | 106 | UINT32 sh6840_clocks_per_sample; |
| r10315 | r10316 | |
| 218 | 216 | state->sh6840_LFSR_clocks = 0; |
| 219 | 217 | /* shift the LFSR. finally or in the result and see if we've |
| 220 | 218 | * had a 0->1 transition */ |
| 221 | state->sh6840_LFSR_oldxor = state->sh6840_LFSR&0x1; | |
| 222 | 219 | newxor = (((state->sh6840_LFSR&0x10000)?1:0) ^ ((state->sh6840_LFSR&0x2000)?1:0))?1:0; |
| 223 | 220 | state->sh6840_LFSR <<= 1; |
| 224 | 221 | state->sh6840_LFSR |= newxor; |
| r10315 | r10316 | |
| 248 | 245 | state_save_register_device_item_array(device, 0, state->sh6840_volume); |
| 249 | 246 | state_save_register_device_item(device, 0, state->sh6840_MSB_latch); |
| 250 | 247 | state_save_register_device_item(device, 0, state->sh6840_LSB_latch); |
| 251 | state_save_register_device_item(device, 0, state->sh6840_LFSR_oldxor); | |
| 252 | 248 | state_save_register_device_item(device, 0, state->sh6840_LFSR); |
| 253 | 249 | state_save_register_device_item(device, 0, state->sh6840_LFSR_clocks); |
| 254 | 250 | state_save_register_device_item(device, 0, state->sh6840_clock_count); |
| r10315 | r10316 | |
| 335 | 331 | if (noisy != 0) |
| 336 | 332 | { |
| 337 | 333 | noise_clocks_this_sample = sh6840_update_noise(state, t->clocks - chan1_clocks); |
| 338 | if (clocks) state->sh6840_noiselatch3 = state->sh6840_LFSR | |
| 334 | if (clocks) state->sh6840_noiselatch3 = (state->sh6840_LFSR&0 | |
| 339 | 335 | } |
| 340 | 336 | |
| 341 | 337 | /* handle timer 2 if enabled */ |
| r10315 | r10316 | |
| 423 | 419 | state->sh6840_noiselatch3 = 0; |
| 424 | 420 | |
| 425 | 421 | /* LFSR */ |
| 426 | state->sh6840_LFSR_oldxor = 0; | |
| 427 | 422 | state->sh6840_LFSR = 0xffffffff; |
| 428 | 423 | state->sh6840_LFSR_clocks = 0; |
| 429 | 424 | } |
| r10315 | r10316 | |
| 493 | 488 | state->sh6840_latchwrite = data&0x80; |
| 494 | 489 | if ((!state->sh6840_latchwriteold) && (state->sh6840_latchwrite)) // rising edge |
| 495 | 490 | { |
| 496 | state->sh6840_noiselatch1 = state->sh6840_LFSR | |
| 491 | state->sh6840_noiselatch1 = (state->sh6840_LFSR&0 | |
| 497 | 492 | } |
| 498 | 493 | } |
| 499 | 494 | |
| r10315 | r10316 | |
| 503 | 498 | |
| 504 | 499 | /* force an update of the stream */ |
| 505 | 500 | state->stream->update(); |
| 506 | return state->sh6840_LFSR | |
| 501 | return (state->sh6840_LFSR&0 | |
| 507 | 502 | } |
| 508 | 503 | |
| 509 | 504 | WRITE8_DEVICE_HANDLER( beezer_sh6840_w ) |
| r10315 | r10316 | |
|---|---|---|
| 1320 | 1320 | memcpy(spc700->ipl_region, machine->region("user5")->base(), 64); |
| 1321 | 1321 | |
| 1322 | 1322 | /* Initialize the timers */ |
| 1323 | spc700->timer[0] = timer_alloc( | |
| 1323 | spc700->timer[0] = machine->scheduler().timer_alloc(FUNC( | |
| 1324 | 1324 | timer_adjust_periodic(spc700->timer[0], attotime::from_hz(8000), 0, attotime::from_hz(8000)); |
| 1325 | 1325 | timer_enable(spc700->timer[0], 0); |
| 1326 | spc700->timer[1] = timer_alloc( | |
| 1326 | spc700->timer[1] = machine->scheduler().timer_alloc(FUNC( | |
| 1327 | 1327 | timer_adjust_periodic(spc700->timer[1], attotime::from_hz(8000), 1, attotime::from_hz(8000)); |
| 1328 | 1328 | timer_enable(spc700->timer[1], 0); |
| 1329 | spc700->timer[2] = timer_alloc( | |
| 1329 | spc700->timer[2] = machine->scheduler().timer_alloc(FUNC( | |
| 1330 | 1330 | timer_adjust_periodic(spc700->timer[2], attotime::from_hz(64000), 2, attotime::from_hz(64000)); |
| 1331 | 1331 | timer_enable(spc700->timer[2], 0); |
| 1332 | 1332 |
| r10315 | r10316 | |
|---|---|---|
| 480 | 480 | |
| 481 | 481 | void williams_cvsd_data_w(running_machine *machine, int data) |
| 482 | 482 | { |
| 483 | | |
| 483 | | |
| 484 | 484 | } |
| 485 | 485 | |
| 486 | 486 | |
| r10315 | r10316 | |
| 554 | 554 | |
| 555 | 555 | static WRITE8_HANDLER( narc_master_sync_w ) |
| 556 | 556 | { |
| 557 | | |
| 557 | | |
| 558 | 558 | audio_sync |= 0x01; |
| 559 | 559 | logerror("Master sync = %02X\n", data); |
| 560 | 560 | } |
| r10315 | r10316 | |
| 568 | 568 | |
| 569 | 569 | static WRITE8_HANDLER( narc_slave_sync_w ) |
| 570 | 570 | { |
| 571 | | |
| 571 | | |
| 572 | 572 | audio_sync |= 0x02; |
| 573 | 573 | logerror("Slave sync = %02X\n", data); |
| 574 | 574 | } |
| r10315 | r10316 | |
| 649 | 649 | |
| 650 | 650 | /* don't clear the external IRQ state for a short while; this allows the |
| 651 | 651 | self-tests to pass */ |
| 652 | | |
| 652 | | |
| 653 | 653 | return soundlatch_r(space, 0); |
| 654 | 654 | } |
| 655 | 655 |
| r10315 | r10316 | |
|---|---|---|
| 100 | 100 | |
| 101 | 101 | WRITE8_HANDLER( starwars_sout_w ) |
| 102 | 102 | { |
| 103 | | |
| 103 | | |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | |
| r10315 | r10316 | |
| 138 | 138 | |
| 139 | 139 | WRITE8_HANDLER( starwars_main_wr_w ) |
| 140 | 140 | { |
| 141 | | |
| 141 | | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 |
| r10315 | r10316 | |
|---|---|---|
| 594 | 594 | |
| 595 | 595 | /* TODO: Calculate a better estimate for timing */ |
| 596 | 596 | if (state->mac_stat) |
| 597 | | |
| 597 | | |
| 598 | 598 | |
| 599 | 599 | state->mrab11 = mrab11; |
| 600 | 600 | state->vtx_addr = vtx_addr; |
| r10315 | r10316 | |
| 658 | 658 | return; |
| 659 | 659 | } |
| 660 | 660 | |
| 661 | | |
| 661 | | |
| 662 | 662 | } |
| 663 | 663 | |
| 664 | 664 | CUSTOM_INPUT( botssa_hwchk_r ) |
| r10315 | r10316 | |
| 757 | 757 | non-zero on a reset, otherwise the 3D object data doesn't get uploaded! */ |
| 758 | 758 | space->write_dword(0x00470000, 0xa5a5a5a5); |
| 759 | 759 | |
| 760 | state->mc68901.timer_a = timer_alloc(m | |
| 760 | state->mc68901.timer_a = machine->scheduler().timer_alloc(FUNC(m | |
| 761 | 761 | |
| 762 | 762 | /* TODO? BOTSS crashes when starting the final stage because the 68000 |
| 763 | 763 | overwrites memory in use by the Am29000. Slowing down the 68000 slightly |
| r10315 | r10316 | |
|---|---|---|
| 833 | 833 | |
| 834 | 834 | state_save_register_item(machine, "cchip", NULL, 0, state->current_bank); |
| 835 | 835 | |
| 836 | timer_pulse( | |
| 836 | machine->scheduler().timer_pulse( | |
| 837 | 837 | } |
| r10315 | r10316 | |
|---|---|---|
| 197 | 197 | state->cdrom_cmd_resp = 0; |
| 198 | 198 | |
| 199 | 199 | state->cdrom_toc = NULL; |
| 200 | state->dma_timer = timer_alloc(machine, akiko_dma_proc, state); | |
| 201 | state->frame_timer = timer_alloc(machine, akiko_frame_proc, state); | |
| 200 | state->dma_timer = machine->scheduler().timer_alloc(FUNC(akiko_dma_proc), state); | |
| 201 | state->frame_timer = machine->scheduler().timer_alloc(FUNC(akiko_frame_proc), state); | |
| 202 | 202 | state->i2cmem = machine->device("i2cmem"); |
| 203 | 203 | |
| 204 | 204 | |
| r10315 | r10316 | |
| 702 | 702 | { |
| 703 | 703 | state->cdrom_cmd_start = (state->cdrom_cmd_start+3) & 0xff; |
| 704 | 704 | |
| 705 | | |
| 705 | | |
| 706 | 706 | |
| 707 | 707 | break; |
| 708 | 708 | } |
| r10315 | r10316 | |
|---|---|---|
| 1046 | 1046 | void NMK004_init(running_machine *machine) |
| 1047 | 1047 | { |
| 1048 | 1048 | /* we have to do this via a timer because we get called before the sound reset */ |
| 1049 | | |
| 1049 | | |
| 1050 | 1050 | } |
| 1051 | 1051 | |
| 1052 | 1052 |
| r10315 | r10316 | |
|---|---|---|
| 275 | 275 | |
| 276 | 276 | static void set_status(gaelco_serial_state *state, UINT8 mask, UINT8 set, int wait) |
| 277 | 277 | { |
| 278 | timer_set(state->device->machine, attotime::from_hz(wait), | |
| 279 | state, (mask << 8)|set, set_status_cb); | |
| 278 | state->device->machine->scheduler().timer_set(attotime::from_hz(wait), FUNC(set_status_cb), (mask << 8)|set, | |
| 279 | state); | |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | static void process_in(gaelco_serial_state *state) |
| r10315 | r10316 | |
| 465 | 465 | state->device = device; |
| 466 | 466 | |
| 467 | 467 | devcb_resolve_write_line(&state->irq_func, &intf->irq_func, device); |
| 468 | state->sync_timer = | |
| 468 | state->sync_timer = | |
| 469 | 469 | |
| 470 | 470 | /* register for save states */ |
| 471 | 471 | //state_save_register_device_item(device, 0, earom->offset); |
| r10315 | r10316 | |
|---|---|---|
| 103 | 103 | WRITE8_HANDLER( bublbobl_sound_command_w ) |
| 104 | 104 | { |
| 105 | 105 | soundlatch_w(space, offset, data); |
| 106 | | |
| 106 | | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | WRITE8_HANDLER( bublbobl_sh_nmi_disable_w ) |
| r10315 | r10316 | |
|---|---|---|
| 192 | 192 | /* rom-based use a deferred write mechanism */ |
| 193 | 193 | if (asic65.type == ASIC65_ROMBASED) |
| 194 | 194 | { |
| 195 | | |
| 195 | | |
| 196 | 196 | cpuexec_boost_interleave(space->machine, attotime::zero, attotime::from_usec(20)); |
| 197 | 197 | return; |
| 198 | 198 | } |
| r10315 | r10316 | |
|---|---|---|
| 484 | 484 | |
| 485 | 485 | static WRITE8_HANDLER( tnzs_sync_kludge_w ) |
| 486 | 486 | { |
| 487 | | |
| 487 | | |
| 488 | 488 | } |
| 489 | 489 | */ |
| 490 | 490 |
| r10315 | r10316 | |
|---|---|---|
| 136 | 136 | cputag_set_input_line(machine, "gamma", INPUT_LINE_NMI, PULSE_LINE); |
| 137 | 137 | |
| 138 | 138 | /* the sound CPU needs to reply in 250microseconds (according to Neil Bradley) */ |
| 139 | timer_set( | |
| 139 | machine->scheduler().timer_set( | |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | |
| r10315 | r10316 | |
| 144 | 144 | { |
| 145 | 145 | mhavoc_state *state = space->machine->driver_data<mhavoc_state>(); |
| 146 | 146 | logerror(" writing to gamma processor: %02x (%d %d)\n", data, state->gamma_rcvd, state->alpha_xmtd); |
| 147 | | |
| 147 | | |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 |
| r10315 | r10316 | |
|---|---|---|
| 208 | 208 | WRITE8_HANDLER( decocass_reset_w ) |
| 209 | 209 | { |
| 210 | 210 | decocass_state *state = space->machine->driver_data<decocass_state>(); |
| 211 | LOG(1,("%10s 6502-PC: %04x decocass_reset_w(%02x): $%02x\n", | |
| 211 | LOG(1,("%10s 6502-PC: %04x decocass_reset_w(%02x): $%02x\n", | |
| 212 | 212 | state->decocass_reset = data; |
| 213 | 213 | |
| 214 | 214 | /* CPU #1 active high reset */ |
| r10315 | r10316 | |
| 288 | 288 | |
| 289 | 289 | data = (BIT(data, 0) << 0) | (BIT(data, 1) << 1) | 0x7c; |
| 290 | 290 | LOG(4,("%10s 6502-PC: %04x decocass_type1_latch_26_pass_3_inv_2_r(%02x): $%02x <- (%s %s)\n", |
| 291 | | |
| 291 | | |
| 292 | 292 | (data & 1) ? "OBF" : "-", |
| 293 | 293 | (data & 2) ? "IBF" : "-")); |
| 294 | 294 | } |
| r10315 | r10316 | |
| 336 | 336 | (((prom[promaddr] >> 4) & 1) << MAP7(state->type1_outmap)); |
| 337 | 337 | |
| 338 | 338 | LOG(3,("%10s 6502-PC: %04x decocass_type1_latch_26_pass_3_inv_2_r(%02x): $%02x\n", |
| 339 | | |
| 339 | | |
| 340 | 340 | |
| 341 | 341 | state->latch1 = save; /* latch the data for the next A0 == 0 read */ |
| 342 | 342 | } |
| r10315 | r10316 | |
| 368 | 368 | |
| 369 | 369 | data = (BIT(data, 0) << 0) | (BIT(data, 1) << 1) | 0x7c; |
| 370 | 370 | LOG(4,("%10s 6502-PC: %04x decocass_type1_pass_136_r(%02x): $%02x <- (%s %s)\n", |
| 371 | | |
| 371 | | |
| 372 | 372 | (data & 1) ? "OBF" : "-", |
| 373 | 373 | (data & 2) ? "IBF" : "-")); |
| 374 | 374 | } |
| r10315 | r10316 | |
| 416 | 416 | (((prom[promaddr] >> 4) & 1) << MAP7(state->type1_outmap)); |
| 417 | 417 | |
| 418 | 418 | LOG(3,("%10s 6502-PC: %04x decocass_type1_pass_136_r(%02x): $%02x\n", |
| 419 | | |
| 419 | | |
| 420 | 420 | |
| 421 | 421 | state->latch1 = save; /* latch the data for the next A0 == 0 read */ |
| 422 | 422 | } |
| r10315 | r10316 | |
| 448 | 448 | |
| 449 | 449 | data = (BIT(data, 0) << 0) | (BIT(data, 1) << 1) | 0x7c; |
| 450 | 450 | LOG(4,("%10s 6502-PC: %04x decocass_type1_latch_27_pass_3_inv_2_r(%02x): $%02x <- (%s %s)\n", |
| 451 | | |
| 451 | | |
| 452 | 452 | (data & 1) ? "OBF" : "-", |
| 453 | 453 | (data & 2) ? "IBF" : "-")); |
| 454 | 454 | } |
| r10315 | r10316 | |
| 496 | 496 | (((state->latch1 >> MAP7(state->type1_inmap)) & 1) << MAP7(state->type1_outmap)); |
| 497 | 497 | |
| 498 | 498 | LOG(3,("%10s 6502-PC: %04x decocass_type1_latch_27_pass_3_inv_2_r(%02x): $%02x\n", |
| 499 | | |
| 499 | | |
| 500 | 500 | |
| 501 | 501 | state->latch1 = save; /* latch the data for the next A0 == 0 read */ |
| 502 | 502 | } |
| r10315 | r10316 | |
| 528 | 528 | |
| 529 | 529 | data = (BIT(data, 0) << 0) | (BIT(data, 1) << 1) | 0x7c; |
| 530 | 530 | LOG(4,("%10s 6502-PC: %04x decocass_type1_latch_26_pass_5_inv_2_r(%02x): $%02x <- (%s %s)\n", |
| 531 | | |
| 531 | | |
| 532 | 532 | (data & 1) ? "OBF" : "-", |
| 533 | 533 | (data & 2) ? "IBF" : "-")); |
| 534 | 534 | } |
| r10315 | r10316 | |
| 576 | 576 | (((prom[promaddr] >> 4) & 1) << MAP7(state->type1_outmap)); |
| 577 | 577 | |
| 578 | 578 | LOG(3,("%10s 6502-PC: %04x decocass_type1_latch_26_pass_5_inv_2_r(%02x): $%02x\n", |
| 579 | | |
| 579 | | |
| 580 | 580 | |
| 581 | 581 | state->latch1 = save; /* latch the data for the next A0 == 0 read */ |
| 582 | 582 | } |
| r10315 | r10316 | |
| 610 | 610 | |
| 611 | 611 | data = (BIT(data, 0) << 0) | (BIT(data, 1) << 1) | 0x7c; |
| 612 | 612 | LOG(4,("%10s 6502-PC: %04x decocass_type1_latch_16_pass_3_inv_1_r(%02x): $%02x <- (%s %s)\n", |
| 613 | | |
| 613 | | |
| 614 | 614 | (data & 1) ? "OBF" : "-", |
| 615 | 615 | (data & 2) ? "IBF" : "-")); |
| 616 | 616 | } |
| r10315 | r10316 | |
| 658 | 658 | (((prom[promaddr] >> 4) & 1) << MAP7(state->type1_outmap)); |
| 659 | 659 | |
| 660 | 660 | LOG(3,("%10s 6502-PC: %04x decocass_type1_latch_16_pass_3_inv_1_r(%02x): $%02x\n", |
| 661 | | |
| 661 | | |
| 662 | 662 | |
| 663 | 663 | state->latch1 = save; /* latch the data for the next A0 == 0 read */ |
| 664 | 664 | } |
| r10315 | r10316 | |
| 688 | 688 | { |
| 689 | 689 | UINT8 *prom = space->machine->region("dongle")->base(); |
| 690 | 690 | data = prom[256 * state->type2_d2_latch + state->type2_promaddr]; |
| 691 | LOG(3,("%10s 6502-PC: %04x decocass_type2_r(%02x): $%02x <- prom[%03x]\n", | |
| 691 | LOG(3,("%10s 6502-PC: %04x decocass_type2_r(%02x): $%02x <- prom[%03x]\n", | |
| 692 | 692 | } |
| 693 | 693 | else |
| 694 | 694 | { |
| r10315 | r10316 | |
| 702 | 702 | else |
| 703 | 703 | data = offset & 0xff; |
| 704 | 704 | |
| 705 | LOG(3,("%10s 6502-PC: %04x decocass_type2_r(%02x): $%02x <- 8041-%s\n", | |
| 705 | LOG(3,("%10s 6502-PC: %04x decocass_type2_r(%02x): $%02x <- 8041-%s\n", | |
| 706 | 706 | } |
| 707 | 707 | return data; |
| 708 | 708 | } |
| r10315 | r10316 | |
| 714 | 714 | { |
| 715 | 715 | if (1 == (offset & 1)) |
| 716 | 716 | { |
| 717 | LOG(4,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> set PROM+D2 latch", | |
| 717 | LOG(4,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> set PROM+D2 latch", | |
| 718 | 718 | } |
| 719 | 719 | else |
| 720 | 720 | { |
| 721 | 721 | state->type2_promaddr = data; |
| 722 | LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> set PROM addr $%02x\n", | |
| 722 | LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> set PROM addr $%02x\n", | |
| 723 | 723 | return; |
| 724 | 724 | } |
| 725 | 725 | } |
| 726 | 726 | else |
| 727 | 727 | { |
| 728 | LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s ", | |
| 728 | LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s ", | |
| 729 | 729 | } |
| 730 | 730 | if (1 == (offset & 1)) |
| 731 | 731 | { |
| r10315 | r10316 | |
| 770 | 770 | { |
| 771 | 771 | UINT8 *prom = space->machine->region("dongle")->base(); |
| 772 | 772 | data = prom[state->type3_ctrs]; |
| 773 | LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- prom[$%03x]\n", | |
| 773 | LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- prom[$%03x]\n", | |
| 774 | 774 | if (++state->type3_ctrs == 4096) |
| 775 | 775 | state->type3_ctrs = 0; |
| 776 | 776 | } |
| r10315 | r10316 | |
| 779 | 779 | if (0 == (offset & E5XX_MASK)) |
| 780 | 780 | { |
| 781 | 781 | data = upi41_master_r(state->mcu, 1); |
| 782 | LOG(4,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- 8041 STATUS\n", | |
| 782 | LOG(4,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- 8041 STATUS\n", | |
| 783 | 783 | } |
| 784 | 784 | else |
| 785 | 785 | { |
| 786 | 786 | data = 0xff; /* open data bus? */ |
| 787 | LOG(4,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- open bus\n", | |
| 787 | LOG(4,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- open bus\n", | |
| 788 | 788 | } |
| 789 | 789 | } |
| 790 | 790 | } |
| r10315 | r10316 | |
| 793 | 793 | if (1 == state->type3_pal_19) |
| 794 | 794 | { |
| 795 | 795 | save = data = 0xff; /* open data bus? */ |
| 796 | LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- open bus", | |
| 796 | LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- open bus", | |
| 797 | 797 | } |
| 798 | 798 | else |
| 799 | 799 | { |
| r10315 | r10316 | |
| 924 | 924 | (BIT(save, 7) << 7); |
| 925 | 925 | } |
| 926 | 926 | state->type3_d0_latch = save & 1; |
| 927 | LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x '%c' <- 8041-DATA\n", | |
| 927 | LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x '%c' <- 8041-DATA\n", | |
| 928 | 928 | } |
| 929 | 929 | else |
| 930 | 930 | { |
| r10315 | r10316 | |
| 938 | 938 | (BIT(save, 5) << 5) | |
| 939 | 939 | (BIT(save, 6) << 7) | |
| 940 | 940 | (BIT(save, 7) << 6); |
| 941 | LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", | |
| 941 | LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", | |
| 942 | 942 | state->type3_d0_latch = save & 1; |
| 943 | 943 | } |
| 944 | 944 | } |
| r10315 | r10316 | |
| 955 | 955 | if (1 == state->type3_pal_19) |
| 956 | 956 | { |
| 957 | 957 | state->type3_ctrs = data << 4; |
| 958 | LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", | |
| 958 | LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", | |
| 959 | 959 | return; |
| 960 | 960 | } |
| 961 | 961 | else |
| r10315 | r10316 | |
| 967 | 967 | if (1 == state->type3_pal_19) |
| 968 | 968 | { |
| 969 | 969 | /* write nowhere?? */ |
| 970 | LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", | |
| 970 | LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", | |
| 971 | 971 | return; |
| 972 | 972 | } |
| 973 | 973 | } |
| 974 | LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", | |
| 974 | LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", | |
| 975 | 975 | upi41_master_w(state->mcu, offset, data); |
| 976 | 976 | } |
| 977 | 977 | |
| r10315 | r10316 | |
| 997 | 997 | if (0 == (offset & E5XX_MASK)) |
| 998 | 998 | { |
| 999 | 999 | data = upi41_master_r(state->mcu, 1); |
| 1000 | LOG(4,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x <- 8041 STATUS\n", | |
| 1000 | LOG(4,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x <- 8041 STATUS\n", | |
| 1001 | 1001 | } |
| 1002 | 1002 | else |
| 1003 | 1003 | { |
| 1004 | 1004 | data = 0xff; /* open data bus? */ |
| 1005 | LOG(4,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x <- open bus\n", | |
| 1005 | LOG(4,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x <- open bus\n", | |
| 1006 | 1006 | } |
| 1007 | 1007 | } |
| 1008 | 1008 | else |
| r10315 | r10316 | |
| 1012 | 1012 | UINT8 *prom = space->machine->region("dongle")->base(); |
| 1013 | 1013 | |
| 1014 | 1014 | data = prom[state->type4_ctrs]; |
| 1015 | LOG(3,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x '%c' <- PROM[%04x]\n", | |
| 1015 | LOG(3,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x '%c' <- PROM[%04x]\n", | |
| 1016 | 1016 | state->type4_ctrs = (state->type4_ctrs + 1) & 0x7fff; |
| 1017 | 1017 | } |
| 1018 | 1018 | else |
| r10315 | r10316 | |
| 1020 | 1020 | if (0 == (offset & E5XX_MASK)) |
| 1021 | 1021 | { |
| 1022 | 1022 | data = upi41_master_r(state->mcu, 0); |
| 1023 | LOG(3,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", | |
| 1023 | LOG(3,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", | |
| 1024 | 1024 | } |
| 1025 | 1025 | else |
| 1026 | 1026 | { |
| 1027 | 1027 | data = 0xff; /* open data bus? */ |
| 1028 | LOG(4,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x <- open bus\n", | |
| 1028 | LOG(4,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x <- open bus\n", | |
| 1029 | 1029 | } |
| 1030 | 1030 | } |
| 1031 | 1031 | } |
| r10315 | r10316 | |
| 1041 | 1041 | if (1 == state->type4_latch) |
| 1042 | 1042 | { |
| 1043 | 1043 | state->type4_ctrs = (state->type4_ctrs & 0x00ff) | ((data & 0x7f) << 8); |
| 1044 | LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> CTRS MSB (%04x)\n", | |
| 1044 | LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> CTRS MSB (%04x)\n", | |
| 1045 | 1045 | return; |
| 1046 | 1046 | } |
| 1047 | 1047 | else |
| r10315 | r10316 | |
| 1055 | 1055 | if (state->type4_latch) |
| 1056 | 1056 | { |
| 1057 | 1057 | state->type4_ctrs = (state->type4_ctrs & 0xff00) | data; |
| 1058 | LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> CTRS LSB (%04x)\n", | |
| 1058 | LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> CTRS LSB (%04x)\n", | |
| 1059 | 1059 | return; |
| 1060 | 1060 | } |
| 1061 | 1061 | } |
| 1062 | LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", | |
| 1062 | LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", | |
| 1063 | 1063 | upi41_master_w(state->mcu, offset, data); |
| 1064 | 1064 | } |
| 1065 | 1065 | |
| r10315 | r10316 | |
| 1082 | 1082 | if (0 == (offset & E5XX_MASK)) |
| 1083 | 1083 | { |
| 1084 | 1084 | data = upi41_master_r(state->mcu, 1); |
| 1085 | LOG(4,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x <- 8041 STATUS\n", | |
| 1085 | LOG(4,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x <- 8041 STATUS\n", | |
| 1086 | 1086 | } |
| 1087 | 1087 | else |
| 1088 | 1088 | { |
| 1089 | 1089 | data = 0xff; /* open data bus? */ |
| 1090 | LOG(4,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x <- open bus\n", | |
| 1090 | LOG(4,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x <- open bus\n", | |
| 1091 | 1091 | } |
| 1092 | 1092 | } |
| 1093 | 1093 | else |
| r10315 | r10316 | |
| 1095 | 1095 | if (state->type5_latch) |
| 1096 | 1096 | { |
| 1097 | 1097 | data = 0x55; /* Only a fixed value? It looks like this is all we need to do */ |
| 1098 | LOG(3,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x '%c' <- fixed value???\n", | |
| 1098 | LOG(3,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x '%c' <- fixed value???\n", | |
| 1099 | 1099 | } |
| 1100 | 1100 | else |
| 1101 | 1101 | { |
| 1102 | 1102 | if (0 == (offset & E5XX_MASK)) |
| 1103 | 1103 | { |
| 1104 | 1104 | data = upi41_master_r(state->mcu, 0); |
| 1105 | LOG(3,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", | |
| 1105 | LOG(3,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", | |
| 1106 | 1106 | } |
| 1107 | 1107 | else |
| 1108 | 1108 | { |
| 1109 | 1109 | data = 0xff; /* open data bus? */ |
| 1110 | LOG(4,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x <- open bus\n", | |
| 1110 | LOG(4,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x <- open bus\n", | |
| 1111 | 1111 | } |
| 1112 | 1112 | } |
| 1113 | 1113 | } |
| r10315 | r10316 | |
| 1122 | 1122 | { |
| 1123 | 1123 | if (1 == state->type5_latch) |
| 1124 | 1124 | { |
| 1125 | LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", | |
| 1125 | LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", | |
| 1126 | 1126 | return; |
| 1127 | 1127 | } |
| 1128 | 1128 | else |
| r10315 | r10316 | |
| 1134 | 1134 | if (state->type5_latch) |
| 1135 | 1135 | { |
| 1136 | 1136 | /* write nowhere?? */ |
| 1137 | LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", | |
| 1137 | LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", | |
| 1138 | 1138 | return; |
| 1139 | 1139 | } |
| 1140 | 1140 | } |
| 1141 | LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", | |
| 1141 | LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", | |
| 1142 | 1142 | upi41_master_w(state->mcu, offset, data); |
| 1143 | 1143 | } |
| 1144 | 1144 | |
| r10315 | r10316 | |
| 1160 | 1160 | if (0 == (offset & E5XX_MASK)) |
| 1161 | 1161 | { |
| 1162 | 1162 | data = upi41_master_r(state->mcu, 1); |
| 1163 | LOG(4,("%10s 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- 8041 STATUS\n", | |
| 1163 | LOG(4,("%10s 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- 8041 STATUS\n", | |
| 1164 | 1164 | } |
| 1165 | 1165 | else |
| 1166 | 1166 | { |
| 1167 | 1167 | data = 0xff; /* open data bus? */ |
| 1168 | LOG(4,("%10s 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- open bus\n", | |
| 1168 | LOG(4,("%10s 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- open bus\n", | |
| 1169 | 1169 | } |
| 1170 | 1170 | } |
| 1171 | 1171 | else |
| r10315 | r10316 | |
| 1173 | 1173 | if (0 == (offset & E5XX_MASK)) |
| 1174 | 1174 | { |
| 1175 | 1175 | data = upi41_master_r(state->mcu, 0); |
| 1176 | LOG(3,("%10s 6502-PC: %04x decocass_nodong_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", | |
| 1176 | LOG(3,("%10s 6502-PC: %04x decocass_nodong_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", | |
| 1177 | 1177 | } |
| 1178 | 1178 | else |
| 1179 | 1179 | { |
| 1180 | 1180 | data = 0xff; /* open data bus? */ |
| 1181 | LOG(4,("%10s 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- open bus\n", | |
| 1181 | LOG(4,("%10s 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- open bus\n", | |
| 1182 | 1182 | } |
| 1183 | 1183 | } |
| 1184 | 1184 | |
| r10315 | r10316 | |
| 1212 | 1212 | (!tape_is_present(state->cassette) << 7); /* D7 = cassette present */ |
| 1213 | 1213 | |
| 1214 | 1214 | LOG(4,("%10s 6502-PC: %04x decocass_e5xx_r(%02x): $%02x <- STATUS (%s%s%s%s%s%s%s%s)\n", |
| 1215 | | |
| 1215 | | |
| 1216 | 1216 | cpu_get_previouspc(space->cpu), |
| 1217 | 1217 | offset, data, |
| 1218 | 1218 | data & 0x01 ? "" : "REQ/", |
| r10315 | r10316 | |
| 1245 | 1245 | |
| 1246 | 1246 | if (0 == (offset & E5XX_MASK)) |
| 1247 | 1247 | { |
| 1248 | LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", | |
| 1248 | LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", | |
| 1249 | 1249 | upi41_master_w(state->mcu, offset & 1, data); |
| 1250 | 1250 | #ifdef MAME_DEBUG |
| 1251 | 1251 | decocass_fno(space->machine, offset, data); |
| r10315 | r10316 | |
| 1253 | 1253 | } |
| 1254 | 1254 | else |
| 1255 | 1255 | { |
| 1256 | LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> dongle\n", | |
| 1256 | LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> dongle\n", | |
| 1257 | 1257 | } |
| 1258 | 1258 | } |
| 1259 | 1259 | |
| r10315 | r10316 | |
| 1702 | 1702 | if (data != state->i8041_p1_write_latch) |
| 1703 | 1703 | { |
| 1704 | 1704 | LOG(4,("%10s 8041-PC: %03x i8041_p1_w: $%02x (%s%s%s%s%s%s%s%s)\n", |
| 1705 | | |
| 1705 | | |
| 1706 | 1706 | cpu_get_previouspc(space->cpu), |
| 1707 | 1707 | data, |
| 1708 | 1708 | data & 0x01 ? "" : "DATA-WRT", |
| r10315 | r10316 | |
| 1739 | 1739 | if (data != state->i8041_p1_read_latch) |
| 1740 | 1740 | { |
| 1741 | 1741 | LOG(4,("%10s 8041-PC: %03x i8041_p1_r: $%02x (%s%s%s%s%s%s%s%s)\n", |
| 1742 | | |
| 1742 | | |
| 1743 | 1743 | cpu_get_previouspc(space->cpu), |
| 1744 | 1744 | data, |
| 1745 | 1745 | data & 0x01 ? "" : "DATA-WRT", |
| r10315 | r10316 | |
| 1761 | 1761 | if (data != state->i8041_p2_write_latch) |
| 1762 | 1762 | { |
| 1763 | 1763 | LOG(4,("%10s 8041-PC: %03x i8041_p2_w: $%02x (%s%s%s%s%s%s%s%s)\n", |
| 1764 | | |
| 1764 | | |
| 1765 | 1765 | cpu_get_previouspc(space->cpu), |
| 1766 | 1766 | data, |
| 1767 | 1767 | data & 0x01 ? "" : "FNO/", |
| r10315 | r10316 | |
| 1787 | 1787 | if (data != state->i8041_p2_read_latch) |
| 1788 | 1788 | { |
| 1789 | 1789 | LOG(4,("%10s 8041-PC: %03x i8041_p2_r: $%02x (%s%s%s%s%s%s%s%s)\n", |
| 1790 | | |
| 1790 | | |
| 1791 | 1791 | cpu_get_previouspc(space->cpu), |
| 1792 | 1792 | data, |
| 1793 | 1793 | data & 0x01 ? "" : "FNO/", |
| r10315 | r10316 | |
| 2178 | 2178 | assert(device->machine->config != NULL); |
| 2179 | 2179 | |
| 2180 | 2180 | /* fetch the data pointer */ |
| 2181 | tape->timer = | |
| 2181 | tape->timer = | |
| 2182 | 2182 | if (device->region() == NULL) |
| 2183 | 2183 | return; |
| 2184 | 2184 | UINT8 *regionbase = *device->region(); |
| r10315 | r10316 | |
|---|---|---|
| 169 | 169 | /* set a callback for the next 32-scanline increment */ |
| 170 | 170 | scanline += 32; |
| 171 | 171 | if (scanline >= 256) scanline = 0; |
| 172 | timer_set(machine | |
| 172 | machine->scheduler().timer_set(machine | |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | MACHINE_RESET( irobot ) |
| r10315 | r10316 | |
| 190 | 190 | state->irmb_timer = machine->device<timer_device>("irmb_timer"); |
| 191 | 191 | |
| 192 | 192 | /* set an initial timer to go off on scanline 0 */ |
| 193 | timer_set(machine | |
| 193 | machine->scheduler().timer_set(machine | |
| 194 | 194 | |
| 195 | 195 | irobot_rom_banksel_w(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM),0,0); |
| 196 | 196 | irobot_out0_w(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM),0,0); |
| r10315 | r10316 | |
|---|---|---|
| 366 | 366 | battery_ram = reinterpret_cast<UINT8 *>(memory_get_shared(*machine, "battery")); |
| 367 | 367 | |
| 368 | 368 | /* start scanline interrupts going */ |
| 369 | master_int_timer = timer_alloc( | |
| 369 | master_int_timer = machine->scheduler().timer_alloc(FUNC( | |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | |
| r10315 | r10316 | |
| 415 | 415 | extra_tram = auto_alloc_array(machine, UINT8, ATAXX_EXTRA_TRAM_SIZE); |
| 416 | 416 | |
| 417 | 417 | /* start scanline interrupts going */ |
| 418 | master_int_timer = timer_alloc( | |
| 418 | master_int_timer = machine->scheduler().timer_alloc(FUNC(a | |
| 419 | 419 | } |
| 420 | 420 | |
| 421 | 421 |
| r10315 | r10316 | |
|---|---|---|
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | /* allocate a timer */ |
| 274 | state->nmi_timer = | |
| 274 | state->nmi_timer = | |
| 275 | 275 | |
| 276 | 276 | state_save_register_device_item(device, 0, state->control); |
| 277 | 277 | } |
| r10315 | r10316 | |
|---|---|---|
| 281 | 281 | |
| 282 | 282 | pic.yearoffs = yearoffs; |
| 283 | 283 | pic.time_just_written = 0; |
| 284 | pic.time_write_timer = timer_alloc( | |
| 284 | pic.time_write_timer = machine->scheduler().timer_alloc(FUNC( | |
| 285 | 285 | memset(pic.default_nvram, 0xff, sizeof(pic.default_nvram)); |
| 286 | 286 | generate_serial_data(machine, upper); |
| 287 | 287 | } |
| r10315 | r10316 | |
| 300 | 300 | /* if we're still holding the data ready bit high, do it */ |
| 301 | 301 | if (pic.latch & 0xf00) |
| 302 | 302 | { |
| 303 | if ( | |
| 303 | if ( | |
| 304 | 304 | pic.latch &= 0xff; |
| 305 | 305 | else |
| 306 | 306 | pic.latch -= 0x100; |
| r10315 | r10316 | |
| 347 | 347 | |
| 348 | 348 | /* store in the latch, along with a bit to indicate we have data */ |
| 349 | 349 | pic.latch = (data & 0x00f) | 0x480; |
| 350 | pic.latch_expire_time = | |
| 350 | pic.latch_expire_time = | |
| 351 | 351 | if (data & 0x10) |
| 352 | 352 | { |
| 353 | 353 | int cmd = pic.state ? (pic.state & 0x0f) : (pic.latch & 0x0f); |
| r10315 | r10316 | |
|---|---|---|
| 1216 | 1216 | { |
| 1217 | 1217 | register_globals(); |
| 1218 | 1218 | |
| 1219 | m_interrupt_timer = timer_alloc( | |
| 1219 | m_interrupt_timer = m_machine.scheduler().timer_alloc(FUNC( | |
| 1220 | 1220 | timer_adjust_oneshot(m_interrupt_timer, attotime::never, 0); |
| 1221 | 1221 | |
| 1222 | m_audio_sample_timer = timer_alloc( | |
| 1222 | m_audio_sample_timer = m_machine.scheduler().timer_alloc(FUNC(a | |
| 1223 | 1223 | timer_adjust_oneshot(m_audio_sample_timer, attotime::never, 0); |
| 1224 | 1224 | |
| 1225 | 1225 | m_ram = auto_alloc_array(&m_machine, UINT16, 0x3c00/2); |
| r10315 | r10316 | |
|---|---|---|
| 133 | 133 | state->ticketdispensed = config->statushigh ? state->active_bit : 0; |
| 134 | 134 | state->ticketnotdispensed = state->ticketdispensed ^ state->active_bit; |
| 135 | 135 | |
| 136 | state->timer = | |
| 136 | state->timer = | |
| 137 | 137 | |
| 138 | 138 | state_save_register_device_item(device, 0, state->status); |
| 139 | 139 | state_save_register_device_item(device, 0, state->power); |
| r10315 | r10316 | |
|---|---|---|
| 265 | 265 | wave_dma.flag = (wave_dma.indirect & 1) ? 1 : 0; |
| 266 | 266 | /* Note: if you trigger an instant DMA IRQ trigger, sfz3upper doesn't play any bgm. */ |
| 267 | 267 | /* TODO: timing of this */ |
| 268 | | |
| 268 | | |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | static void pvr_dma_execute(address_space *space) |
| r10315 | r10316 | |
| 303 | 303 | } |
| 304 | 304 | /* Note: do not update the params, since this DMA type doesn't support it. */ |
| 305 | 305 | /* TODO: timing of this */ |
| 306 | | |
| 306 | | |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | // register decode helpers |
| r10315 | r10316 | |
| 689 | 689 | dc_sysctrl_regs[SB_C2DSTAT]=address+ddtdata.length; |
| 690 | 690 | |
| 691 | 691 | /* 200 usecs breaks sfz3upper */ |
| 692 | | |
| 692 | | |
| 693 | 693 | /* simulate YUV FIFO processing here */ |
| 694 | 694 | if((address & 0x1800000) == 0x0800000) |
| 695 | | |
| 695 | | |
| 696 | 696 | } |
| 697 | 697 | break; |
| 698 | 698 | |
| r10315 | r10316 | |
| 1066 | 1066 | |
| 1067 | 1067 | if (endflag) |
| 1068 | 1068 | { |
| 1069 | | |
| 1069 | | |
| 1070 | 1070 | break; |
| 1071 | 1071 | } |
| 1072 | 1072 | // skip fixed packet header |
| r10315 | r10316 | |
| 1215 | 1215 | |
| 1216 | 1216 | if (endflag) |
| 1217 | 1217 | { |
| 1218 | | |
| 1218 | | |
| 1219 | 1219 | break; |
| 1220 | 1220 | } |
| 1221 | 1221 | // skip fixed packet header |
| r10315 | r10316 | |
| 1333 | 1333 | sh4_dma_ddt(space->machine->device("maincpu"), &ddtdata); |
| 1334 | 1334 | /* Note: KOF Neowave definitely wants this to be delayed (!) */ |
| 1335 | 1335 | /* FIXME: timing of this */ |
| 1336 | | |
| 1336 | | |
| 1337 | 1337 | } |
| 1338 | 1338 | break; |
| 1339 | 1339 | } |
| r10315 | r10316 | |
| 1609 | 1609 | dc_rtcregister[RTC2] = current_time & 0x0000ffff; |
| 1610 | 1610 | dc_rtcregister[RTC1] = (current_time & 0xffff0000) >> 16; |
| 1611 | 1611 | |
| 1612 | dc_rtc_timer = timer_alloc( | |
| 1612 | dc_rtc_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1613 | 1613 | } |
| 1614 | 1614 | |
| 1615 | 1615 | MACHINE_START( dc ) |
| r10315 | r10316 | |
|---|---|---|
| 29 | 29 | READ8_HANDLER( pitnrun_mcu_data_r ) |
| 30 | 30 | { |
| 31 | 31 | pitnrun_state *state = space->machine->driver_data<pitnrun_state>(); |
| 32 | | |
| 32 | | |
| 33 | 33 | return state->toz80; |
| 34 | 34 | } |
| 35 | 35 | |
| r10315 | r10316 | |
| 43 | 43 | |
| 44 | 44 | WRITE8_HANDLER( pitnrun_mcu_data_w ) |
| 45 | 45 | { |
| 46 | | |
| 46 | | |
| 47 | 47 | cpuexec_boost_interleave(space->machine, attotime::zero, attotime::from_usec(5)); |
| 48 | 48 | } |
| 49 | 49 | |
| r10315 | r10316 | |
| 115 | 115 | if (~data & 0x02) |
| 116 | 116 | { |
| 117 | 117 | /* 68705 is going to read data from the Z80 */ |
| 118 | | |
| 118 | | |
| 119 | 119 | cputag_set_input_line(space->machine, "mcu",0,CLEAR_LINE); |
| 120 | 120 | state->portA_in = state->fromz80; |
| 121 | 121 | } |
| 122 | 122 | if (~data & 0x04) |
| 123 | 123 | { |
| 124 | 124 | /* 68705 is writing data for the Z80 */ |
| 125 | | |
| 125 | | |
| 126 | 126 | } |
| 127 | 127 | if (~data & 0x10) |
| 128 | 128 | { |
| r10315 | r10316 | |
|---|---|---|
| 126 | 126 | // The input clock to the 06XX interface chip is 64H, that is |
| 127 | 127 | // 18432000/6/64 = 48kHz, so it makes sense for the irq line to be |
| 128 | 128 | // asserted for one clock cycle ~= 21us. |
| 129 | | |
| 129 | | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | READ8_DEVICE_HANDLER( namco_53xx_read ) |
| r10315 | r10316 | |
|---|---|---|
| 1156 | 1156 | } |
| 1157 | 1157 | else if (ai_status & 0x40000000) |
| 1158 | 1158 | { |
| 1159 | double secs_left = (timer_firetime(audio_timer) - | |
| 1159 | double secs_left = (timer_firetime(audio_timer) - | |
| 1160 | 1160 | unsigned int samples_left = secs_left * DACRATE_NTSC / (ai_dacrate + 1); |
| 1161 | 1161 | return samples_left * 4; |
| 1162 | 1162 | } |
| r10315 | r10316 | |
| 2023 | 2023 | rspdrc_set_options(machine->device("rsp"), RSPDRC_STRICT_VERIFY); |
| 2024 | 2024 | rspdrc_flush_drc_cache(machine->device("rsp")); |
| 2025 | 2025 | |
| 2026 | audio_timer = timer_alloc( | |
| 2026 | audio_timer = machine->scheduler().timer_alloc(FUNC(a | |
| 2027 | 2027 | } |
| 2028 | 2028 | |
| 2029 | 2029 | MACHINE_RESET( n64 ) |
| r10315 | r10316 | |
|---|---|---|
| 130 | 130 | { |
| 131 | 131 | // Do a RST10 |
| 132 | 132 | cpu_set_input_line_and_vector(device, 0, HOLD_LINE, 0xd7); |
| 133 | | |
| 133 | | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | /* |
| r10315 | r10316 | |
|---|---|---|
| 20 | 20 | UINT8 page_mask; |
| 21 | 21 | |
| 22 | 22 | UINT8 current_bank[8]; |
| 23 | UINT8 last_bank[2]; | |
| 24 | 23 | |
| 25 | 24 | UINT8 *rom0, *rom1; |
| 26 | 25 | int size0, size1; |
| r10315 | r10316 | |
| 46 | 45 | } |
| 47 | 46 | |
| 48 | 47 | /***************************************************************************** |
| 49 | | |
| 48 | STATIC | |
| 50 | 49 | *****************************************************************************/ |
| 51 | 50 | |
| 52 | ||
| 51 | static void do_bankswitch | |
| 53 | 52 | { |
| 54 | nmk112_state *nmk112 = get_safe_token(device); | |
| 55 | 53 | int chip = (offset & 4) >> 2; |
| 56 | 54 | int banknum = offset & 3; |
| 57 | 55 | int paged = (nmk112->page_mask & (1 << chip)); |
| 58 | 56 | |
| 59 | 57 | UINT8 *rom = chip ? nmk112->rom1 : nmk112->rom0; |
| 60 | 58 | int size = chip ? nmk112->size1 : nmk112->size0; |
| 61 | int bankaddr = (data * BANKSIZE) % size; | |
| 62 | 59 | |
| 63 | if (nmk112->current_bank[offset] == data) | |
| 64 | return; | |
| 65 | ||
| 66 | 60 | nmk112->current_bank[offset] = data; |
| 67 | 61 | |
| 62 | if (size == 0) return; | |
| 63 | ||
| 64 | int bankaddr = (data * BANKSIZE) % size; | |
| 65 | ||
| 68 | 66 | /* copy the samples */ |
| 69 | 67 | if ((paged) && (banknum == 0)) |
| 70 | 68 | memcpy(rom + 0x400, rom + 0x40000 + bankaddr + 0x400, BANKSIZE - 0x400); |
| r10315 | r10316 | |
| 77 | 75 | rom += banknum * TABLESIZE; |
| 78 | 76 | memcpy(rom, rom + 0x40000 + bankaddr, TABLESIZE); |
| 79 | 77 | } |
| 78 | } | |
| 80 | 79 | |
| 81 | nmk112->last_bank[chip] = offset & 3; | |
| 80 | /***************************************************************************** | |
| 81 | DEVICE HANDLERS | |
| 82 | *****************************************************************************/ | |
| 83 | ||
| 84 | WRITE8_DEVICE_HANDLER( nmk112_okibank_w ) | |
| 85 | { | |
| 86 | nmk112_state *nmk112 = get_safe_token(device); | |
| 87 | ||
| 88 | if (nmk112->current_bank[offset] != data) | |
| 89 | do_bankswitch(nmk112, offset, data); | |
| 82 | 90 | } |
| 83 | 91 | |
| 84 | 92 | WRITE16_DEVICE_HANDLER( nmk112_okibank_lsb_w ) |
| r10315 | r10316 | |
| 92 | 100 | static STATE_POSTLOAD( nmk112_postload_bankswitch ) |
| 93 | 101 | { |
| 94 | 102 | nmk112_state *nmk112 = (nmk112_state *)param; |
| 95 | int i; | |
| 96 | 103 | |
| 97 | for (i = 0; i < 2; i++) | |
| 98 | { | |
| 99 | int banknum = nmk112->last_bank[i]; | |
| 100 | int paged = (nmk112->page_mask & (1 << i)); | |
| 101 | ||
| 102 | UINT8 *rom = i ? nmk112->rom1 : nmk112->rom0; | |
| 103 | int size = i ? nmk112->size1 : nmk112->size0; | |
| 104 | int bankaddr = (nmk112->current_bank[nmk112->last_bank[i] + i * 4] * BANKSIZE) % size; | |
| 105 | ||
| 106 | /* copy the samples */ | |
| 107 | if ((paged) && (banknum == 0)) | |
| 108 | memcpy(rom + 0x400, rom + 0x40000 + bankaddr + 0x400, BANKSIZE - 0x400); | |
| 109 | else | |
| 110 | memcpy(rom + banknum * BANKSIZE, rom + 0x40000 + bankaddr, BANKSIZE); | |
| 111 | ||
| 112 | /* also copy the sample address table, if it is paged on this chip */ | |
| 113 | if (paged) | |
| 114 | { | |
| 115 | rom += banknum * TABLESIZE; | |
| 116 | memcpy(rom, rom + 0x40000 + bankaddr, TABLESIZE); | |
| 117 | } | |
| 118 | } | |
| 104 | for (int i = 0; i < 8; i++) | |
| 105 | do_bankswitch(nmk112, i, nmk112->current_bank[i]); | |
| 119 | 106 | } |
| 120 | 107 | |
| 121 | 108 | |
| r10315 | r10316 | |
| 128 | 115 | nmk112_state *nmk112 = get_safe_token(device); |
| 129 | 116 | const nmk112_interface *intf = get_interface(device); |
| 130 | 117 | |
| 131 | nmk112->rom0 = device->machine->region(intf->rgn0)->base(); | |
| 132 | nmk112->size0 = device->machine->region(intf->rgn0)->bytes() - 0x40000; | |
| 133 | nmk112->rom1 = device->machine->region(intf->rgn1)->base(); | |
| 134 | nmk112->size1 = device->machine->region(intf->rgn1)->bytes() - 0x40000; | |
| 118 | if (intf->rgn0 == NULL) | |
| 119 | { | |
| 120 | nmk112->rom0 = NULL; | |
| 121 | nmk112->size0 = 0; | |
| 122 | } | |
| 123 | else | |
| 124 | { | |
| 125 | nmk112->rom0 = device->machine->region(intf->rgn0)->base(); | |
| 126 | nmk112->size0 = device->machine->region(intf->rgn0)->bytes() - 0x40000; | |
| 127 | } | |
| 135 | 128 | |
| 129 | if (intf->rgn1 == NULL) | |
| 130 | { | |
| 131 | nmk112->rom1 = NULL; | |
| 132 | nmk112->size1 = 0; | |
| 133 | } | |
| 134 | else | |
| 135 | { | |
| 136 | nmk112->rom1 = device->machine->region(intf->rgn1)->base(); | |
| 137 | nmk112->size1 = device->machine->region(intf->rgn1)->bytes() - 0x40000; | |
| 138 | } | |
| 139 | ||
| 136 | 140 | nmk112->page_mask = ~intf->disable_page_mask; |
| 137 | 141 | |
| 138 | 142 | state_save_register_device_item_array(device, 0, nmk112->current_bank); |
| 139 | state_save_register_device_item_array(device, 0, nmk112->last_bank); | |
| 140 | 143 | state_save_register_postload(device->machine, nmk112_postload_bankswitch, nmk112); |
| 141 | 144 | } |
| 142 | 145 | |
| 143 | 146 | static DEVICE_RESET( nmk112 ) |
| 144 | 147 | { |
| 145 | 148 | nmk112_state *nmk112 = get_safe_token(device); |
| 146 | int i; | |
| 147 | 149 | |
| 148 | for (i = 0; i < 8; i++) | |
| 149 | nmk112->current_bank[i] = ~0; | |
| 150 | for (int i = 0; i < 8; i++) | |
| 151 | { | |
| 152 | nmk112->current_bank[i] = 0; | |
| 153 | do_bankswitch(nmk112, i, nmk112->current_bank[i]); | |
| 154 | } | |
| 150 | 155 | } |
| 151 | 156 | |
| 152 | 157 |
| r10315 | r10316 | |
|---|---|---|
| 204 | 204 | st->txd[0] = st->portHandler ? st->portHandler(space,0) : st->portName ? input_port_read(space->machine, st->portName) : 0; |
| 205 | 205 | if( sst ) |
| 206 | 206 | { |
| 207 | | |
| 207 | | |
| 208 | 208 | st->serial_out = 0; |
| 209 | 209 | st->status |= 0x04; |
| 210 | 210 | st->phase = CMD_08; |
| r10315 | r10316 | |
| 440 | 440 | if( (i8741[num].sts & 0x02) ) |
| 441 | 441 | { |
| 442 | 442 | /* transmit data */ |
| 443 | timer_set ( | |
| 443 | machine->scheduler().timer_set ( | |
| 444 | 444 | } |
| 445 | 445 | } |
| 446 | 446 |
| r10315 | r10316 | |
|---|---|---|
| 392 | 392 | // Palette request cmd - verified to take around 122242 68000 cycles to complete |
| 393 | 393 | if (state->current_cmd >= 0x1 && state->current_cmd < 0x12) |
| 394 | 394 | { |
| 395 | | |
| 395 | | |
| 396 | 396 | } |
| 397 | 397 | // Unknown cmd - verified to take around 105500 68000 cycles to complete |
| 398 | 398 | else if (state->current_cmd >= 0x81 && state->current_cmd < 0x92) |
| 399 | 399 | { |
| 400 | | |
| 400 | | |
| 401 | 401 | } |
| 402 | 402 | else |
| 403 | 403 | { |
| r10315 | r10316 | |
|---|---|---|
| 49 | 49 | cputag_set_input_line(timer.machine, "maincpu", M6809_IRQ_LINE, ASSERT_LINE); |
| 50 | 50 | |
| 51 | 51 | /* it will turn off on the next HBLANK */ |
| 52 | timer | |
| 52 | timer.machine->scheduler().timer_s | |
| 53 | 53 | |
| 54 | 54 | /* if this is Grudge Match, update the steering */ |
| 55 | 55 | if (state->grudge_steering_result & 0x80) |
| r10315 | r10316 | |
| 482 | 482 | |
| 483 | 483 | /* set a timer for 500usec later to actually transmit the data */ |
| 484 | 484 | /* (this is very important for several games, esp Snacks'n Jaxson) */ |
| 485 | timer_set( | |
| 485 | machine->scheduler().timer_set( | |
| 486 | 486 | } |
| 487 | 487 | |
| 488 | 488 | |
| r10315 | r10316 | |
| 501 | 501 | |
| 502 | 502 | /* output register is at offset 1; set a timer to synchronize the CPUs */ |
| 503 | 503 | else |
| 504 | | |
| 504 | | |
| 505 | 505 | } |
| 506 | 506 | |
| 507 | 507 | |
| r10315 | r10316 | |
| 628 | 628 | /* set a timer to go off and read the value after 50us */ |
| 629 | 629 | /* it's important that we do this for Mini Golf */ |
| 630 | 630 | logerror("adc_select %d\n", offset & 7); |
| 631 | | |
| 631 | | |
| 632 | 632 | } |
| 633 | 633 | |
| 634 | 634 |
| r10315 | r10316 | |
|---|---|---|
| 1659 | 1659 | |
| 1660 | 1660 | for (i=0; i<3; i++) |
| 1661 | 1661 | { |
| 1662 | io_timeout[i] = timer_alloc( | |
| 1662 | io_timeout[i] = machine->scheduler().timer_alloc(FUNC(i | |
| 1663 | 1663 | } |
| 1664 | 1664 | } |
| 1665 | 1665 | |
| r10315 | r10316 | |
| 2269 | 2269 | |
| 2270 | 2270 | /* If the z80 is running, sync the z80 execution state */ |
| 2271 | 2271 | if ( ! genz80.z80_is_reset ) |
| 2272 | | |
| 2272 | | |
| 2273 | 2273 | } |
| 2274 | 2274 | |
| 2275 | 2275 | static WRITE16_HANDLER ( megadriv_68k_req_z80_reset ) |
| r10315 | r10316 | |
| 2313 | 2313 | genz80.z80_is_reset = 1; |
| 2314 | 2314 | } |
| 2315 | 2315 | } |
| 2316 | | |
| 2316 | | |
| 2317 | 2317 | } |
| 2318 | 2318 | |
| 2319 | 2319 | |
| r10315 | r10316 | |
| 2977 | 2977 | // reads |
| 2978 | 2978 | static READ16_HANDLER( _32x_68k_commsram_r ) |
| 2979 | 2979 | { |
| 2980 | if (_32X_COMMS_PORT_SYNC) | |
| 2980 | if (_32X_COMMS_PORT_SYNC) | |
| 2981 | 2981 | return commsram[offset]; |
| 2982 | 2982 | } |
| 2983 | 2983 | |
| r10315 | r10316 | |
| 2985 | 2985 | static WRITE16_HANDLER( _32x_68k_commsram_w ) |
| 2986 | 2986 | { |
| 2987 | 2987 | COMBINE_DATA(&commsram[offset]); |
| 2988 | if (_32X_COMMS_PORT_SYNC) | |
| 2988 | if (_32X_COMMS_PORT_SYNC) | |
| 2989 | 2989 | } |
| 2990 | 2990 | |
| 2991 | 2991 | /**********************************************************************************************/ |
| r10315 | r10316 | |
| 4145 | 4145 | |
| 4146 | 4146 | static READ16_HANDLER( segacd_comms_flags_r ) |
| 4147 | 4147 | { |
| 4148 | | |
| 4148 | | |
| 4149 | 4149 | return segacd_comms_flags; |
| 4150 | 4150 | } |
| 4151 | 4151 | |
| r10315 | r10316 | |
| 4154 | 4154 | if (ACCESSING_BITS_0_7) |
| 4155 | 4155 | { |
| 4156 | 4156 | segacd_comms_flags = (segacd_comms_flags & 0xff00) | (data & 0x00ff); |
| 4157 | | |
| 4157 | | |
| 4158 | 4158 | } |
| 4159 | 4159 | |
| 4160 | 4160 | if (ACCESSING_BITS_8_15) |
| r10315 | r10316 | |
| 4180 | 4180 | if (ACCESSING_BITS_8_15) |
| 4181 | 4181 | { |
| 4182 | 4182 | segacd_comms_flags = (segacd_comms_flags & 0x00ff) | (data & 0xff00); |
| 4183 | | |
| 4183 | | |
| 4184 | 4184 | } |
| 4185 | 4185 | } |
| 4186 | 4186 | |
| r10315 | r10316 | |
| 4216 | 4216 | |
| 4217 | 4217 | static READ16_HANDLER( segacd_comms_main_part1_r ) |
| 4218 | 4218 | { |
| 4219 | | |
| 4219 | | |
| 4220 | 4220 | return segacd_comms_part1[offset]; |
| 4221 | 4221 | } |
| 4222 | 4222 | |
| 4223 | 4223 | static WRITE16_HANDLER( segacd_comms_main_part1_w ) |
| 4224 | 4224 | { |
| 4225 | | |
| 4225 | | |
| 4226 | 4226 | COMBINE_DATA(&segacd_comms_part1[offset]); |
| 4227 | 4227 | } |
| 4228 | 4228 | |
| 4229 | 4229 | static READ16_HANDLER( segacd_comms_main_part2_r ) |
| 4230 | 4230 | { |
| 4231 | | |
| 4231 | | |
| 4232 | 4232 | return segacd_comms_part2[offset]; |
| 4233 | 4233 | } |
| 4234 | 4234 | |
| r10315 | r10316 | |
| 4240 | 4240 | |
| 4241 | 4241 | static READ16_HANDLER( segacd_comms_sub_part1_r ) |
| 4242 | 4242 | { |
| 4243 | | |
| 4243 | | |
| 4244 | 4244 | return segacd_comms_part1[offset]; |
| 4245 | 4245 | } |
| 4246 | 4246 | |
| r10315 | r10316 | |
| 4251 | 4251 | |
| 4252 | 4252 | static READ16_HANDLER( segacd_comms_sub_part2_r ) |
| 4253 | 4253 | { |
| 4254 | | |
| 4254 | | |
| 4255 | 4255 | return segacd_comms_part2[offset]; |
| 4256 | 4256 | } |
| 4257 | 4257 | |
| 4258 | 4258 | static WRITE16_HANDLER( segacd_comms_sub_part2_w ) |
| 4259 | 4259 | { |
| 4260 | | |
| 4260 | | |
| 4261 | 4261 | COMBINE_DATA(&segacd_comms_part2[offset]); |
| 4262 | 4262 | } |
| 4263 | 4263 | |
| r10315 | r10316 | |
| 5021 | 5021 | |
| 5022 | 5022 | memory_install_read16_handler (space, 0x0000070, 0x0000073, 0, 0, scd_hint_vector_r ); |
| 5023 | 5023 | |
| 5024 | segacd_gfx_conversion_timer = timer_alloc( | |
| 5024 | segacd_gfx_conversion_timer = machine->scheduler().timer_alloc(FUNC( | |
| 5025 | 5025 | timer_adjust_oneshot(segacd_gfx_conversion_timer, attotime::never, 0); |
| 5026 | 5026 | |
| 5027 | segacd_dmna_ret_timer = timer_alloc( | |
| 5027 | segacd_dmna_ret_timer = machine->scheduler().timer_alloc(FUNC( | |
| 5028 | 5028 | timer_adjust_oneshot(segacd_gfx_conversion_timer, attotime::never, 0); |
| 5029 | 5029 | |
| 5030 | segacd_hock_timer = timer_alloc( | |
| 5030 | segacd_hock_timer = machine->scheduler().timer_alloc(FUNC( | |
| 5031 | 5031 | timer_adjust_oneshot(segacd_hock_timer, attotime::never, 0); |
| 5032 | 5032 | |
| 5033 | segacd_irq3_timer = timer_alloc( | |
| 5033 | segacd_irq3_timer = machine->scheduler().timer_alloc(FUNC( | |
| 5034 | 5034 | timer_adjust_oneshot(segacd_irq3_timer, attotime::never, 0); |
| 5035 | 5035 | |
| 5036 | 5036 | |
| r10315 | r10316 | |
| 5259 | 5259 | if((segacd_cdd.ctrl & 4 || dir) && segacd_irq_mask & 0x10) // export status, check if bit 2 (HOst ClocK) and irq is enabled |
| 5260 | 5260 | { |
| 5261 | 5261 | segacd_cdd.ctrl |= 4; // enable Hock bit if it isn't already active |
| 5262 | timer_set( | |
| 5262 | machine->scheduler().timer_set( | |
| 5263 | 5263 | } |
| 5264 | 5264 | } |
| 5265 | 5265 | #endif |
| r10315 | r10316 | |
| 8246 | 8246 | top-left of the screen. The first scanline is scanline 0 (we set scanline to -1 in |
| 8247 | 8247 | VIDEO_EOF) */ |
| 8248 | 8248 | |
| 8249 | timer | |
| 8249 | timer.machin | |
| 8250 | 8250 | /* Compensate for some rounding errors |
| 8251 | 8251 | |
| 8252 | 8252 | When the counter reaches 261 we should have reached the end of the frame, however due |
| r10315 | r10316 | |
| 8424 | 8424 | genz80.z80_has_bus = 1; |
| 8425 | 8425 | genz80.z80_bank_addr = 0; |
| 8426 | 8426 | genesis_scanline_counter = -1; |
| 8427 | timer_set( | |
| 8427 | machine->scheduler().timer_set( | |
| 8428 | 8428 | } |
| 8429 | 8429 | |
| 8430 | 8430 | megadrive_imode = 0; |
| r10315 | r10316 | |
| 8959 | 8959 | |
| 8960 | 8960 | if(_32x_is_connected) |
| 8961 | 8961 | { |
| 8962 | _32x_pwm_timer = timer_alloc( | |
| 8962 | _32x_pwm_timer = machine->scheduler().timer_alloc(FUNC( | |
| 8963 | 8963 | timer_adjust_oneshot(_32x_pwm_timer, attotime::never, 0); |
| 8964 | 8964 | } |
| 8965 | 8965 |
| r10315 | r10316 | |
|---|---|---|
| 2 | 2 | // // |
| 3 | 3 | // Electro mechanical meters // |
| 4 | 4 | // // |
| 5 | // 23-07-2004: Re-Animator // | |
| 6 | 5 | // // |
| 7 | // TODO: - meter ticks if the signal changes from high to low AND the // | |
| 8 | // signal was high for at least 'reacttime' cycles // | |
| 9 | // It should tick if the signal goes from low to high AND stays // | |
| 10 | // high for at least xxx milliseconds // | |
| 11 | // // | |
| 12 | 6 | /////////////////////////////////////////////////////////////////////////// |
| 13 | 7 | |
| 14 | 8 | #include "emu.h" |
| r10315 | r10316 | |
| 18 | 12 | |
| 19 | 13 | static struct |
| 20 | 14 | { |
| 21 | long timestamp, // time stamp in cycles after which timer will tick | |
| 22 | reacttime, | |
| 23 | count; // mechmeter value | |
| 24 | int state; // state 0/1 | |
| 15 | long on, // Activity of reel | |
| 16 | reacttime, | |
| 17 | count; // mechmeter value | |
| 18 | int state; // state 0/1 | |
| 19 | emu_timer *meter_timer; | |
| 25 | 20 | } meter_info[MAXMECHMETERS]; |
| 26 | 21 | |
| 27 | ||
| 28 | 22 | static int number_mtr; |
| 29 | 23 | |
| 30 | 24 | /////////////////////////////////////////////////////////////////////////// |
| 25 | static TIMER_CALLBACK( meter_callback ) | |
| 26 | { | |
| 27 | meter_info[param].count++; | |
| 28 | } | |
| 31 | 29 | |
| 32 | void Mech | |
| 30 | void MechMtr_config(running_machine *machine, int number) | |
| 33 | 31 | { |
| 34 | ||
| 32 | | |
| 35 | 33 | |
| 36 | ||
| 34 | | |
| 37 | 35 | |
| 38 | for ( i = 0; i < number; i++ ) | |
| 39 | { | |
| 40 | meter_info[i].reacttime = METERREACTTIME; | |
| 41 | meter_info[i].state = 0; | |
| 42 | meter_info[i].count = 0; | |
| 43 | meter_info[i].timestamp = 0; | |
| 44 | } | |
| 45 | number_mtr = number; | |
| 36 | for ( i = 0; i < number; i++ ) | |
| 37 | { | |
| 38 | meter_info[i].reacttime = METERREACTTIME; | |
| 39 | meter_info[i].state = 0; | |
| 40 | meter_info[i].count = 0; | |
| 41 | meter_info[i].on = 0; | |
| 42 | meter_info[i].meter_timer = machine->scheduler().timer_alloc(FUNC(meter_callback), (void*)(FPTR)i); | |
| 43 | timer_reset(meter_info[i].meter_timer, attotime::never); | |
| 44 | } | |
| 45 | number_mtr = number; | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /////////////////////////////////////////////////////////////////////////// |
| 49 | 49 | |
| 50 | int | |
| 50 | int | |
| 51 | 51 | { |
| 52 | ||
| 52 | | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /////////////////////////////////////////////////////////////////////////// |
| 56 | 56 | |
| 57 | 57 | void MechMtr_Setcount(int id, long count) |
| 58 | 58 | { |
| 59 | ||
| 59 | | |
| 60 | 60 | |
| 61 | ||
| 61 | | |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /////////////////////////////////////////////////////////////////////////// |
| 65 | 65 | |
| 66 | 66 | long MechMtr_Getcount(int id) |
| 67 | 67 | { |
| 68 | ||
| 68 | | |
| 69 | 69 | |
| 70 | ||
| 70 | | |
| 71 | 71 | |
| 72 | ||
| 72 | | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | /////////////////////////////////////////////////////////////////////////// |
| 76 | 76 | |
| 77 | 77 | void MechMtr_ReactTime(int id, long cycles) |
| 78 | 78 | { |
| 79 | if ( id >= number_mtr ) return; | |
| 79 | if ( id >= number_mtr ) return; | |
| 80 | meter_info[id].reacttime = cycles; | |
| 81 | } | |
| 80 | 82 | |
| 81 | meter_info[id].reacttime = cycles; | |
| 83 | /////////////////////////////////////////////////////////////////////////// | |
| 84 | ||
| 85 | int MechMtr_GetActivity(int id) | |
| 86 | { | |
| 87 | return meter_info[id].on; | |
| 82 | 88 | } |
| 83 | 89 | |
| 84 | 90 | /////////////////////////////////////////////////////////////////////////// |
| 85 | 91 | |
| 86 | int Mech | |
| 92 | int MechMtr_update(int id | |
| 87 | 93 | { |
| 88 | 94 | int res = 0; |
| 89 | 95 | |
| r10315 | r10316 | |
| 97 | 103 | |
| 98 | 104 | if ( state ) |
| 99 | 105 | { |
| 100 | meter_info[id].timestamp = cycles + meter_info[id].reacttime; | |
| 106 | meter_info[id].on =1; | |
| 107 | timer_adjust_oneshot(meter_info[id].meter_timer, attotime::from_seconds(meter_info[id].reacttime), id); | |
| 101 | 108 | } |
| 102 | 109 | else |
| 103 | 110 | { |
| 104 | if ( cycles > meter_info[id].timestamp ) | |
| 105 | { // meter has been active long enough | |
| 106 | res = 1; | |
| 107 | meter_info[id].count++; | |
| 108 | } | |
| 111 | meter_info[id].on =0; | |
| 112 | timer_adjust_oneshot(meter_info[id].meter_timer, attotime::never, id); | |
| 109 | 113 | } |
| 110 | 114 | } |
| 111 | 115 |
| r10315 | r10316 | |
|---|---|---|
| 480 | 480 | { |
| 481 | 481 | /* make all the CPUs synchronize, and only AFTER that write the command to the PIA */ |
| 482 | 482 | /* otherwise the 68705 will miss commands */ |
| 483 | | |
| 483 | | |
| 484 | 484 | } |
| 485 | 485 | |
| 486 | 486 |
| r10315 | r10316 | |
|---|---|---|
| 4 | 4 | // // |
| 5 | 5 | // 23-07-2004: Re-Animator // |
| 6 | 6 | // // |
| 7 | // TODO: - meter ticks if the signal changes from high to low AND the // | |
| 8 | // signal was high for at least 'reacttime' cycles // | |
| 9 | // It should tick if the signal goes from low to high AND stays // | |
| 10 | // high for at least xxx milliseconds // | |
| 11 | 7 | // // |
| 12 | 8 | /////////////////////////////////////////////////////////////////////////// |
| 13 | 9 | |
| 14 | #ifndef INC_MMTR | |
| 15 | #define INC_MMTR | |
| 10 | #pragma once | |
| 16 | 11 | |
| 12 | #ifndef __METERS_H__ | |
| 13 | #define __METERS_H__ | |
| 14 | ||
| 15 | #include "emu.h" | |
| 16 | ||
| 17 | ||
| 17 | 18 | #define MAXMECHMETERS 8 |
| 18 | 19 | |
| 19 | #define METERREACTTIME | |
| 20 | #define METERREACTTIME | |
| 20 | 21 | |
| 21 | void Mech | |
| 22 | void MechMtr_config(running_machine *machine, int number); | |
| 22 | 23 | |
| 23 | 24 | int MechMtr_GetNumberMeters(void); |
| 24 | 25 | |
| r10315 | r10316 | |
| 28 | 29 | |
| 29 | 30 | void MechMtr_ReactTime(int id, long cycles); |
| 30 | 31 | |
| 31 | int Mech | |
| 32 | int MechMtr_update( int id, | |
| 32 | 33 | |
| 34 | int MechMtr_GetActivity(int id); | |
| 33 | 35 | #endif |
| r10315 | r10316 | |
|---|---|---|
| 11 | 11 | // 05-03-2004: Re-Animator // |
| 12 | 12 | // // |
| 13 | 13 | // TODO: add different types of stepper motors if needed // |
| 14 | // // | |
| 14 | // someone who understands the device system may want to convert // | |
| 15 | // this // | |
| 15 | 16 | /////////////////////////////////////////////////////////////////////////// |
| 16 | 17 | |
| 17 | 18 | #include "emu.h" |
| r10315 | r10316 | |
| 344 | 345 | 0, //0001->0110 1->6 |
| 345 | 346 | 0, //0001->0111 1->7 |
| 346 | 347 | 0, //0001->1000 1->8 |
| 347 | -1,//0001->1001 1->9 | |
| 348 | -1,//0001->1001 1->9 -1,//1001->1000 9->8 | |
| 348 | 349 | 0, //0001->1010 1->A |
| 349 | 350 | 0, //0001->1011 1->B |
| 350 | 351 | 0, //0001->1100 1->C |
| r10315 | r10316 | |
| 660 | 661 | start = step[which].index_start, |
| 661 | 662 | end = step[which].index_end; |
| 662 | 663 | |
| 663 | if ( (( pos >= start ) && ( pos <= end )) && | |
| 664 | if (start > end) // cope with index patterns that wrap around | |
| 665 | { | |
| 666 | if ( (( pos > start ) || ( pos < end )) && | |
| 664 | 667 | ( ( step[which].pattern == step[which].index_patt || step[which].index_patt==0) || |
| 665 | 668 | ( step[which].pattern == 0 && |
| 666 | 669 | (step[which].old_pattern == step[which].index_patt || step[which].index_patt==0) |
| 667 | 670 | ) ) ) |
| 671 | { | |
| 672 | step[which].optic = 1; | |
| 673 | } | |
| 674 | else step[which].optic = 0; | |
| 675 | } | |
| 676 | else | |
| 668 | 677 | { |
| 678 | if ( (( pos > start ) && ( pos < end )) && | |
| 679 | ( ( step[which].pattern == step[which].index_patt || step[which].index_patt==0) || | |
| 680 | ( step[which].pattern == 0 && | |
| 681 | (step[which].old_pattern == step[which].index_patt || step[which].index_patt==0) | |
| 682 | ) ) ) | |
| 683 | { | |
| 669 | 684 | step[which].optic = 1; |
| 685 | } | |
| 686 | else step[which].optic = 0; | |
| 670 | 687 | } |
| 671 | else step[which].optic = 0; | |
| 672 | 688 | } |
| 673 | ||
| 674 | 689 | /////////////////////////////////////////////////////////////////////////// |
| 675 | 690 | |
| 676 | 691 | void stepper_reset_position(int which) |
| r10315 | r10316 | |
| 729 | 744 | break; |
| 730 | 745 | } |
| 731 | 746 | #if 0 /* Assists with new index generation */ |
| 732 | if ( which ==0 ) | |
| 747 | if ( which ==0 )popmessage | |
| 733 | 748 | #endif |
| 734 | 749 | |
| 735 | 750 | if ( steps ) |
| r10315 | r10316 | |
|---|---|---|
| 213 | 213 | /* Start of VBlank */ |
| 214 | 214 | if (snes_ppu.beam.current_vert == snes_ppu.beam.last_visible_line) |
| 215 | 215 | { |
| 216 | timer_set(machine | |
| 216 | machine->scheduler().timer_set(machine | |
| 217 | 217 | |
| 218 | 218 | snes_ram[HVBJOY] |= 0x81; /* Set vblank bit to on & indicate controllers being read */ |
| 219 | 219 | snes_ram[RDNMI] |= 0x80; /* Set NMI occured bit */ |
| r10315 | r10316 | |
| 766 | 766 | break; |
| 767 | 767 | case HDMAEN: /* HDMA channel designation */ |
| 768 | 768 | if (data) //if a HDMA is enabled, data is inited at the next scanline |
| 769 | | |
| 769 | | |
| 770 | 770 | break; |
| 771 | 771 | case MEMSEL: /* Access cycle designation in memory (2) area */ |
| 772 | 772 | /* FIXME: Need to adjust the speed only during access of banks 0x80+ |
| r10315 | r10316 | |
| 1708 | 1708 | snes_state *state = machine->driver_data<snes_state>(); |
| 1709 | 1709 | |
| 1710 | 1710 | /* init timers and stop them */ |
| 1711 | state->scanline_timer = timer_alloc( | |
| 1711 | state->scanline_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1712 | 1712 | timer_adjust_oneshot(state->scanline_timer, attotime::never, 0); |
| 1713 | state->hblank_timer = timer_alloc( | |
| 1713 | state->hblank_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1714 | 1714 | timer_adjust_oneshot(state->hblank_timer, attotime::never, 0); |
| 1715 | state->nmi_timer = timer_alloc( | |
| 1715 | state->nmi_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1716 | 1716 | timer_adjust_oneshot(state->nmi_timer, attotime::never, 0); |
| 1717 | state->hirq_timer = timer_alloc( | |
| 1717 | state->hirq_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1718 | 1718 | timer_adjust_oneshot(state->hirq_timer, attotime::never, 0); |
| 1719 | state->div_timer = timer_alloc( | |
| 1719 | state->div_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1720 | 1720 | timer_adjust_oneshot(state->div_timer, attotime::never, 0); |
| 1721 | state->mult_timer = timer_alloc( | |
| 1721 | state->mult_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1722 | 1722 | timer_adjust_oneshot(state->mult_timer, attotime::never, 0); |
| 1723 | state->io_timer = timer_alloc( | |
| 1723 | state->io_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1724 | 1724 | timer_adjust_oneshot(state->io_timer, attotime::never, 0); |
| 1725 | 1725 | |
| 1726 | 1726 | // SNES hcounter has a 0-339 range. hblank starts at counter 260. |
| r10315 | r10316 | |
|---|---|---|
| 1 | 1 | /////////////////////////////////////////////////////////////////////////// |
| 2 | 2 | // // |
| 3 | // | |
| 3 | // steppers.c steppermotor emulation | |
| 4 | 4 | // // |
| 5 | 5 | // Emulates : 48 step motors driven with full step or half step // |
| 6 | 6 | // also emulates the index optic // |
| 7 | 7 | // // |
| 8 | // 13-08-2008: J. Wallace - Added a rigid interface structure, // | |
| 9 | // and removed unnecessary inline functions // | |
| 10 | // Rewritten to make it more flexible // | |
| 11 | 8 | // 26-01-2007: J. Wallace - Rewritten to make it more flexible // |
| 12 | // 26-01-2007: J. Wallace - Rewritten to make it more flexible // | |
| 13 | // 26-01-2007: J. Wallace - Rewritten to make it more flexible // | |
| 14 | 9 | // and to allow indices to be set in drivers // |
| 15 | 10 | // 29-12-2006: J. Wallace - Added state save support // |
| 16 | 11 | // 05-03-2004: Re-Animator // |
| 17 | 12 | // // |
| 18 | 13 | // TODO: add different types of stepper motors if needed // |
| 19 | // // | |
| 14 | // someone who understands the device system may want to convert // | |
| 15 | // this // | |
| 20 | 16 | /////////////////////////////////////////////////////////////////////////// |
| 21 | 17 | |
| 22 | 18 |
| r10315 | r10316 | |
|---|---|---|
| 116 | 116 | WRITE8_HANDLER( taitosj_mcu_data_w ) |
| 117 | 117 | { |
| 118 | 118 | LOG(("%04x: protection write %02x\n",cpu_get_pc(space->cpu),data)); |
| 119 | | |
| 119 | | |
| 120 | 120 | /* temporarily boost the interleave to sync things up */ |
| 121 | 121 | cpuexec_boost_interleave(space->machine, attotime::zero, attotime::from_usec(10)); |
| 122 | 122 | } |
| r10315 | r10316 | |
| 200 | 200 | if (~data & 0x02) |
| 201 | 201 | { |
| 202 | 202 | /* 68705 is going to read data from the Z80 */ |
| 203 | | |
| 203 | | |
| 204 | 204 | cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE); |
| 205 | 205 | state->portA_in = state->fromz80; |
| 206 | 206 | LOG(("%04x: 68705 <- Z80 %02x\n", cpu_get_pc(space->cpu), state->portA_in)); |
| r10315 | r10316 | |
| 214 | 214 | LOG(("%04x: 68705 -> Z80 %02x\n", cpu_get_pc(space->cpu), state->portA_out)); |
| 215 | 215 | |
| 216 | 216 | /* 68705 is writing data for the Z80 */ |
| 217 | | |
| 217 | | |
| 218 | 218 | } |
| 219 | 219 | if (~data & 0x10) |
| 220 | 220 | { |
| r10315 | r10316 | |
|---|---|---|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | /* setup the timers */ |
| 254 | state->irq_timer = timer_alloc(machine, amiga_irq_proc, NULL); | |
| 255 | state->blitter_timer = timer_alloc(machine, amiga_blitter_proc, NULL); | |
| 254 | state->irq_timer = machine->scheduler().timer_alloc(FUNC(amiga_irq_proc)); | |
| 255 | state->blitter_timer = machine->scheduler().timer_alloc(FUNC(amiga_blitter_proc)); | |
| 256 | 256 | |
| 257 | 257 | state->sound_device = machine->device("amiga"); |
| 258 | 258 | } |
| r10315 | r10316 | |
| 297 | 297 | (*state->intf->reset_callback)(machine); |
| 298 | 298 | |
| 299 | 299 | /* start the scanline timer */ |
| 300 | timer_set(machine | |
| 300 | machine->scheduler().timer_set(machine | |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | |
| r10315 | r10316 | |
| 346 | 346 | |
| 347 | 347 | /* set timer for next line */ |
| 348 | 348 | scanline = (scanline + 1) % machine->primary_screen->height(); |
| 349 | timer_set(machine | |
| 349 | machine->scheduler().timer_set(machine | |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | |
| r10315 | r10316 | |
| 1281 | 1281 | if (state->intf->serdat_w != NULL) |
| 1282 | 1282 | (*state->intf->serdat_w)(space->machine, data); |
| 1283 | 1283 | CUSTOM_REG(REG_SERDATR) &= ~0x3000; |
| 1284 | | |
| 1284 | | |
| 1285 | 1285 | break; |
| 1286 | 1286 | |
| 1287 | 1287 | case REG_BLTSIZE: |
| r10315 | r10316 | |
|---|---|---|
| 95 | 95 | static WRITE_LINE_DEVICE_HANDLER( v_irq4_w ) |
| 96 | 96 | { |
| 97 | 97 | update_irq_encoder(device->machine, INPUT_LINE_IRQ4, state); |
| 98 | vertigo_vproc(device->machine->device<cpu_device>("maincpu")->attotime_to_cycles(timer_get_time(device->machine) - irq4_time), state); | |
| 99 | irq4_time = timer_get_time(device->machine); | |
| 98 | vertigo_vproc(device->machine->device<cpu_device>("maincpu")->attotime_to_cycles(device->machine->time() - irq4_time), state); | |
| 99 | irq4_time = device->machine->time(); | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | |
| r10315 | r10316 | |
| 186 | 186 | WRITE16_HANDLER( vertigo_audio_w ) |
| 187 | 187 | { |
| 188 | 188 | if (ACCESSING_BITS_0_7) |
| 189 | | |
| 189 | | |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | |
| r10315 | r10316 | |
| 229 | 229 | ttl74148_update(ttl74148); |
| 230 | 230 | vertigo_vproc_reset(machine); |
| 231 | 231 | |
| 232 | irq4_time = | |
| 232 | irq4_time = | |
| 233 | 233 | irq_state = 7; |
| 234 | 234 | } |
| 235 | 235 |
| r10315 | r10316 | |
|---|---|---|
| 31 | 31 | |
| 32 | 32 | #define VERBOSE_DBG 0 /* general debug messages */ |
| 33 | 33 | #define DBG_LOG(N,M,A) \ |
| 34 | if(VERBOSE_DBG>=N){ if( M )logerror("%11.6f: %-24s", | |
| 34 | if(VERBOSE_DBG>=N){ if( M )logerror("%11.6f: %-24s", | |
| 35 | 35 | |
| 36 | 36 | #define VERBOSE_JOY 0 /* JOY (joystick port) */ |
| 37 | 37 | #define JOY_LOG(N,M,A) \ |
| 38 | if(VERBOSE_JOY>=N){ if( M )logerror("%11.6f: %-24s", | |
| 38 | if(VERBOSE_JOY>=N){ if( M )logerror("%11.6f: %-24s", | |
| 39 | 39 | |
| 40 | 40 | |
| 41 | 41 | static TIMER_CALLBACK( pc_keyb_timer ); |
| r10315 | r10316 | |
| 69 | 69 | memset(&pc_keyb, 0, sizeof(pc_keyb)); |
| 70 | 70 | pc_keyb.machine = machine; |
| 71 | 71 | pc_keyb.int_cb = set_keyb_int_func; |
| 72 | pc_keyb.timer = timer_alloc( | |
| 72 | pc_keyb.timer = machine->scheduler().timer_alloc(FUNC( | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | UINT8 pc_keyb_read(void) |
| r10315 | r10316 | |
|---|---|---|
| 119 | 119 | for (i = 0, screen = machine->first_screen(); screen != NULL; i++, screen = screen->next_screen()) |
| 120 | 120 | { |
| 121 | 121 | state->screen_timer[i].screen = screen; |
| 122 | state->screen_timer[i].scanline_interrupt_timer = timer_alloc(machine, scanline_interrupt_callback, (void *)screen); | |
| 123 | state->screen_timer[i].scanline_timer = timer_alloc(machine, scanline_timer_callback, (void *)screen); | |
| 124 | state->screen_timer[i].atarivc_eof_update_timer = timer_alloc(machine, atarivc_eof_update, (void *)screen); | |
| 122 | state->screen_timer[i].scanline_interrupt_timer = machine->scheduler().timer_alloc(FUNC(scanline_interrupt_callback), (void *)screen); | |
| 123 | state->screen_timer[i].scanline_timer = machine->scheduler().timer_alloc(FUNC(scanline_timer_callback), (void *)screen); | |
| 124 | state->screen_timer[i].atarivc_eof_update_timer = machine->scheduler().timer_alloc(FUNC(atarivc_eof_update), (void *)screen); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | state_save_register_global(machine, state->scanline_int_state); |
| r10315 | r10316 | |
| 639 | 639 | |
| 640 | 640 | WRITE16_HANDLER( atarigen_sound_reset_w ) |
| 641 | 641 | { |
| 642 | | |
| 642 | | |
| 643 | 643 | } |
| 644 | 644 | |
| 645 | 645 | |
| r10315 | r10316 | |
| 650 | 650 | |
| 651 | 651 | void atarigen_sound_reset(running_machine *machine) |
| 652 | 652 | { |
| 653 | | |
| 653 | | |
| 654 | 654 | } |
| 655 | 655 | |
| 656 | 656 | |
| r10315 | r10316 | |
| 664 | 664 | WRITE16_HANDLER( atarigen_sound_w ) |
| 665 | 665 | { |
| 666 | 666 | if (ACCESSING_BITS_0_7) |
| 667 | | |
| 667 | | |
| 668 | 668 | } |
| 669 | 669 | |
| 670 | 670 | WRITE16_HANDLER( atarigen_sound_upper_w ) |
| 671 | 671 | { |
| 672 | 672 | if (ACCESSING_BITS_8_15) |
| 673 | | |
| 673 | space->machine->schedul | |
| 674 | 674 | } |
| 675 | 675 | |
| 676 | 676 | WRITE32_HANDLER( atarigen_sound_upper32_w ) |
| 677 | 677 | { |
| 678 | 678 | if (ACCESSING_BITS_24_31) |
| 679 | | |
| 679 | space->machine->schedul | |
| 680 | 680 | } |
| 681 | 681 | |
| 682 | 682 | |
| r10315 | r10316 | |
| 719 | 719 | |
| 720 | 720 | WRITE8_HANDLER( atarigen_6502_sound_w ) |
| 721 | 721 | { |
| 722 | | |
| 722 | | |
| 723 | 723 | } |
| 724 | 724 | |
| 725 | 725 | |
| r10315 | r10316 | |
| 1382 | 1382 | hblank += width; |
| 1383 | 1383 | |
| 1384 | 1384 | /* halt and set a timer to wake up */ |
| 1385 | | |
| 1385 | | |
| 1386 | 1386 | cpu_set_input_line(cpu, INPUT_LINE_HALT, ASSERT_LINE); |
| 1387 | 1387 | } |
| 1388 | 1388 |
| r10315 | r10316 | |
|---|---|---|
| 474 | 474 | { |
| 475 | 475 | register_globals(); |
| 476 | 476 | |
| 477 | m_interrupt_timer = timer_alloc( | |
| 477 | m_interrupt_timer = m_machine.scheduler().timer_alloc(FUNC( | |
| 478 | 478 | timer_adjust_oneshot(m_interrupt_timer, attotime::never, 0); |
| 479 | 479 | } |
| 480 | 480 |
| r10315 | r10316 | |
|---|---|---|
| 302 | 302 | int temp = midwunit_sound_state_r(space, 0, 0xffff); |
| 303 | 303 | result |= (temp & 0x800) >> 9; |
| 304 | 304 | result |= (~temp & 0x400) >> 10; |
| 305 | | |
| 305 | | |
| 306 | 306 | } |
| 307 | 307 | break; |
| 308 | 308 | |
| r10315 | r10316 | |
| 329 | 329 | int temp = midwunit_sound_state_r(space, 0, 0xffff); |
| 330 | 330 | result |= (temp & 0x800) >> 11; |
| 331 | 331 | result |= (~temp & 0x400) >> 8; |
| 332 | | |
| 332 | | |
| 333 | 333 | } |
| 334 | 334 | break; |
| 335 | 335 |
| r10315 | r10316 | |
|---|---|---|
| 107 | 107 | { |
| 108 | 108 | namcos2_eeprom = auto_alloc_array(machine, UINT8, namcos2_eeprom_size); |
| 109 | 109 | machine->device<nvram_device>("nvram")->set_base(namcos2_eeprom, namcos2_eeprom_size); |
| 110 | namcos2_posirq_timer = timer_alloc( | |
| 110 | namcos2_posirq_timer = machine->scheduler().timer_alloc(FUNC(n | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | MACHINE_RESET( namcos2 ) |
| r10315 | r10316 | |
|---|---|---|
| 219 | 219 | // The input clock to the 06XX interface chip is 64H, that is |
| 220 | 220 | // 18432000/6/64 = 48kHz, so it makes sense for the irq line to be |
| 221 | 221 | // asserted for one clock cycle ~= 21us. |
| 222 | | |
| 222 | | |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | WRITE8_DEVICE_HANDLER( namco_50xx_write ) |
| 226 | 226 | { |
| 227 | | |
| 227 | | |
| 228 | 228 | |
| 229 | 229 | namco_50xx_irq_set(device); |
| 230 | 230 | } |
| r10315 | r10316 | |
| 232 | 232 | |
| 233 | 233 | void namco_50xx_read_request(device_t *device) |
| 234 | 234 | { |
| 235 | | |
| 235 | | |
| 236 | 236 | |
| 237 | 237 | namco_50xx_irq_set(device); |
| 238 | 238 | } |
| r10315 | r10316 | |
|---|---|---|
| 168 | 168 | MACHINE_START( nflfoot ) |
| 169 | 169 | { |
| 170 | 170 | /* allocate a timer for the IPU watchdog */ |
| 171 | ipu_watchdog_timer = timer_alloc( | |
| 171 | ipu_watchdog_timer = machine->scheduler().timer_alloc(FUNC(i | |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 |
| r10315 | r10316 | |
|---|---|---|
| 34 | 34 | |
| 35 | 35 | WRITE8_HANDLER( arkanoid_Z80_mcu_w ) |
| 36 | 36 | { |
| 37 | | |
| 37 | | |
| 38 | 38 | /* boost the interleave for a few usecs to make sure it is read successfully */ |
| 39 | 39 | cpuexec_boost_interleave(space->machine, attotime::zero, attotime::from_usec(10)); |
| 40 | 40 | } |
| r10315 | r10316 | |
|---|---|---|
| 231 | 231 | { |
| 232 | 232 | memc_pagesize = 0; |
| 233 | 233 | |
| 234 | vbl_timer = timer_alloc( | |
| 234 | vbl_timer = machine->scheduler().timer_alloc(FUNC( | |
| 235 | 235 | timer_adjust_oneshot(vbl_timer, attotime::never, 0); |
| 236 | 236 | |
| 237 | timer[0] = timer_alloc(machine, ioc_timer, NULL); | |
| 238 | timer[1] = timer_alloc(machine, ioc_timer, NULL); | |
| 239 | timer[2] = timer_alloc(machine, ioc_timer, NULL); | |
| 240 | timer[3] = timer_alloc(machine, ioc_timer, NULL); | |
| 237 | timer[0] = machine->scheduler().timer_alloc(FUNC(ioc_timer)); | |
| 238 | timer[1] = machine->scheduler().timer_alloc(FUNC(ioc_timer)); | |
| 239 | timer[2] = machine->scheduler().timer_alloc(FUNC(ioc_timer)); | |
| 240 | timer[3] = machine->scheduler().timer_alloc(FUNC(ioc_timer)); | |
| 241 | 241 | timer_adjust_oneshot(timer[0], attotime::never, 0); |
| 242 | 242 | timer_adjust_oneshot(timer[1], attotime::never, 0); |
| 243 | 243 | timer_adjust_oneshot(timer[2], attotime::never, 0); |
| 244 | 244 | timer_adjust_oneshot(timer[3], attotime::never, 0); |
| 245 | 245 | |
| 246 | vid_timer = timer_alloc(machine, vidc_video_tick, NULL); | |
| 247 | snd_timer = timer_alloc(machine, vidc_audio_tick, NULL); | |
| 246 | vid_timer = machine->scheduler().timer_alloc(FUNC(vidc_video_tick)); | |
| 247 | snd_timer = machine->scheduler().timer_alloc(FUNC(vidc_audio_tick)); | |
| 248 | 248 | timer_adjust_oneshot(snd_timer, attotime::never, 0); |
| 249 | 249 | } |
| 250 | 250 |
| r10315 | r10316 | |
|---|---|---|
| 438 | 438 | chip->writemode = 0; |
| 439 | 439 | chip->r_bitmap = auto_bitmap_alloc(machine, 256, 256, BITMAP_FORMAT_RGB15); |
| 440 | 440 | |
| 441 | chip->sms_scanline_timer = timer_alloc( | |
| 441 | chip->sms_scanline_timer = machine->scheduler().timer_alloc(FUNC( | |
| 442 | 442 | |
| 443 | 443 | return chip; |
| 444 | 444 | } |
| r10315 | r10316 | |
|---|---|---|
| 415 | 415 | inters_to_words(inter1, inter2, inter3, &beams, &word1, &word2, &word3); |
| 416 | 416 | words_to_sensors(word1, word2, word3, beams, &sensor0, &sensor1, &sensor2, &sensor3); |
| 417 | 417 | |
| 418 | logerror("%15f: Sensor values: %04x %04x %04x %04x\n", | |
| 418 | logerror("%15f: Sensor values: %04x %04x %04x %04x\n", | |
| 419 | 419 | } |
| 420 | 420 | |
| 421 | 421 | |
| r10315 | r10316 | |
| 525 | 525 | |
| 526 | 526 | WRITE8_HANDLER( slikshot_z80_control_w ) |
| 527 | 527 | { |
| 528 | | |
| 528 | | |
| 529 | 529 | } |
| 530 | 530 | |
| 531 | 531 |
| r10315 | r10316 | |
|---|---|---|
| 697 | 697 | |
| 698 | 698 | /* if being written from the 68000, synchronize on it */ |
| 699 | 699 | if (state->hd34010_host_access) |
| 700 | | |
| 700 | space->machine->schedul | |
| 701 | 701 | |
| 702 | 702 | /* otherwise, just update */ |
| 703 | 703 | else |
| r10315 | r10316 | |
| 790 | 790 | if (offset == 0x1fff) |
| 791 | 791 | { |
| 792 | 792 | logerror("%06X:ADSP sync address written (%04X)\n", cpu_get_previouspc(space->cpu), data); |
| 793 | | |
| 793 | | |
| 794 | 794 | cpu_triggerint(state->adsp); |
| 795 | 795 | } |
| 796 | 796 | else |
| r10315 | r10316 | |
| 897 | 897 | |
| 898 | 898 | case 3: |
| 899 | 899 | logerror("ADSP bank = %d (deferred)\n", val); |
| 900 | | |
| 900 | | |
| 901 | 901 | break; |
| 902 | 902 | |
| 903 | 903 | case 5: |
| r10315 | r10316 | |
| 1520 | 1520 | COMBINE_DATA(&newdata); |
| 1521 | 1521 | state->dataptr[state->next_msp_sync % MAX_MSP_SYNC] = dptr; |
| 1522 | 1522 | state->dataval[state->next_msp_sync % MAX_MSP_SYNC] = newdata; |
| 1523 | | |
| 1523 | space->machine->schedul | |
| 1524 | 1524 | } |
| 1525 | 1525 | else |
| 1526 | 1526 | COMBINE_DATA(&state->rddsp32_sync[0][offset]); |
| r10315 | r10316 | |
| 1537 | 1537 | COMBINE_DATA(&newdata); |
| 1538 | 1538 | state->dataptr[state->next_msp_sync % MAX_MSP_SYNC] = dptr; |
| 1539 | 1539 | state->dataval[state->next_msp_sync % MAX_MSP_SYNC] = newdata; |
| 1540 | | |
| 1540 | space->machine->schedul | |
| 1541 | 1541 | } |
| 1542 | 1542 | else |
| 1543 | 1543 | COMBINE_DATA(&state->rddsp32_sync[1][offset]); |
| r10315 | r10316 | |
|---|---|---|
| 1661 | 1661 | |
| 1662 | 1662 | for( n = 0; n < 7; n++ ) |
| 1663 | 1663 | { |
| 1664 | p_psx->channel[ n ].timer = timer_alloc( | |
| 1664 | p_psx->channel[ n ].timer = machine->scheduler().timer_alloc( FUNC( | |
| 1665 | 1665 | p_psx->channel[ n ].fn_read = NULL; |
| 1666 | 1666 | p_psx->channel[ n ].fn_write = NULL; |
| 1667 | 1667 | } |
| 1668 | 1668 | |
| 1669 | 1669 | for( n = 0; n < 3; n++ ) |
| 1670 | 1670 | { |
| 1671 | p_psx->root[ n ].timer = timer_alloc( | |
| 1671 | p_psx->root[ n ].timer = machine->scheduler().timer_alloc( FUNC( | |
| 1672 | 1672 | } |
| 1673 | 1673 | |
| 1674 | 1674 | for( n = 0; n < 2; n++ ) |
| 1675 | 1675 | { |
| 1676 | p_psx->sio[ n ].timer = timer_alloc( | |
| 1676 | p_psx->sio[ n ].timer = machine->scheduler().timer_alloc( FUNC( | |
| 1677 | 1677 | p_psx->sio[ n ].fn_handler = NULL; |
| 1678 | 1678 | } |
| 1679 | 1679 |
| r10315 | r10316 | |
|---|---|---|
| 43 | 43 | state->sound_cmd = data; |
| 44 | 44 | |
| 45 | 45 | //logerror("%04x: sound cmd %02x\n", cpu_get_pc(space->cpu), data); |
| 46 | | |
| 46 | | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | READ8_HANDLER( lsasquad_sh_sound_command_r ) |
| r10315 | r10316 | |
|---|---|---|
| 280 | 280 | pia6821_ca1_w(pia_1, 1); |
| 281 | 281 | |
| 282 | 282 | /* set a timer to turn it off once the scanline counter resets */ |
| 283 | timer | |
| 283 | timer.machine->scheduler().timer_s | |
| 284 | 284 | |
| 285 | 285 | /* set a timer for next frame */ |
| 286 | 286 | timer.adjust(timer.machine->primary_screen->time_until_pos(240)); |
| r10315 | r10316 | |
| 425 | 425 | pia6821_ca1_w(pia_0, 0); |
| 426 | 426 | |
| 427 | 427 | /* set a timer to turn it off once the scanline counter resets */ |
| 428 | timer | |
| 428 | timer.machine->scheduler().timer_s | |
| 429 | 429 | |
| 430 | 430 | /* set a timer for next frame */ |
| 431 | 431 | timer.adjust(timer.machine->primary_screen->time_until_pos(254)); |
| r10315 | r10316 | |
| 546 | 546 | WRITE8_DEVICE_HANDLER( williams_snd_cmd_w ) |
| 547 | 547 | { |
| 548 | 548 | /* the high two bits are set externally, and should be 1 */ |
| 549 | | |
| 549 | | |
| 550 | 550 | } |
| 551 | 551 | |
| 552 | 552 | WRITE8_DEVICE_HANDLER( playball_snd_cmd_w ) |
| 553 | 553 | { |
| 554 | | |
| 554 | | |
| 555 | 555 | } |
| 556 | 556 | |
| 557 | 557 | |
| r10315 | r10316 | |
| 564 | 564 | |
| 565 | 565 | static WRITE8_DEVICE_HANDLER( williams2_snd_cmd_w ) |
| 566 | 566 | { |
| 567 | | |
| 567 | | |
| 568 | 568 | } |
| 569 | 569 | |
| 570 | 570 | |
| r10315 | r10316 | |
| 983 | 983 | { |
| 984 | 984 | joust2_current_sound_data = (joust2_current_sound_data & ~0xff) | (data & 0xff); |
| 985 | 985 | williams_cvsd_data_w(device->machine, joust2_current_sound_data); |
| 986 | | |
| 986 | | |
| 987 | 987 | } |
| r10315 | r10316 | |
|---|---|---|
| 48 | 48 | static UINT8 v493_irq_state; |
| 49 | 49 | static UINT8 v493_irq_vector; |
| 50 | 50 | |
| 51 | static timer_ | |
| 51 | static timer_expired_func v493_callback; | |
| 52 | 52 | |
| 53 | 53 | static UINT8 zwackery_sound_data; |
| 54 | 54 | |
| r10315 | r10316 | |
| 169 | 169 | { |
| 170 | 170 | struct counter_state *m6840 = &m6840_state[i]; |
| 171 | 171 | |
| 172 | m6840->timer = timer_alloc( | |
| 172 | m6840->timer = machine->scheduler().timer_alloc(FUNC(c | |
| 173 | 173 | |
| 174 | 174 | state_save_register_item(machine, "m6840", NULL, i, m6840->control); |
| 175 | 175 | state_save_register_item(machine, "m6840", NULL, i, m6840->latch); |
| r10315 | r10316 | |
| 267 | 267 | /* also set a timer to generate the 493 signal at a specific time before the next VBLANK */ |
| 268 | 268 | /* the timing of this is crucial for Blasted and Tri-Sports, which check the timing of */ |
| 269 | 269 | /* VBLANK and 493 using counter 2 */ |
| 270 | | |
| 270 | | |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | |
| r10315 | r10316 | |
| 296 | 296 | { |
| 297 | 297 | v493_irq_state = 1; |
| 298 | 298 | update_mcr68_interrupts(machine); |
| 299 | timer_set(machine | |
| 299 | machine->scheduler().timer_set(machine | |
| 300 | 300 | logerror("--- (INT1) ---\n"); |
| 301 | 301 | } |
| 302 | 302 | |
| r10315 | r10316 | |
| 351 | 351 | device_t *pia = machine->device("pia0"); |
| 352 | 352 | |
| 353 | 353 | pia6821_ca1_w(pia, 1); |
| 354 | timer_set(machine | |
| 354 | machine->scheduler().timer_set(machine | |
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 |
| r10315 | r10316 | |
|---|---|---|
| 695 | 695 | { |
| 696 | 696 | // Simulate time for command to execute (exact timing unknown, this is close) |
| 697 | 697 | state->current_cmd = 0xf5; |
| 698 | timer_set( | |
| 698 | machine->scheduler().timer_set( | |
| 699 | 699 | } |
| 700 | 700 | state->cchip_last_7a = state->cchip_ram[0x7a]; |
| 701 | 701 | |
| r10315 | r10316 | |
| 752 | 752 | state->cchip_coins_for_credit[1] = 1; |
| 753 | 753 | state->cchip_credits_for_coin[1] = 1; |
| 754 | 754 | |
| 755 | timer_pulse( | |
| 755 | machine->scheduler().timer_pulse( | |
| 756 | 756 | } |
| r10315 | r10316 | |
|---|---|---|
| 178 | 178 | state->PROM_AM[cnt] = (val >> 7) & 0x0001; |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | state->math_timer = timer_alloc(ma | |
| 181 | state->math_timer = machine->scheduler().timer_alloc(FUNC(ma | |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 |
| r10315 | r10316 | |
|---|---|---|
| 43 | 43 | #define NB1413M3_TIMER_BASE 20000000 |
| 44 | 44 | static TIMER_CALLBACK( nb1413m3_timer_callback ) |
| 45 | 45 | { |
| 46 | timer_set( | |
| 46 | machine->scheduler().timer_set( | |
| 47 | 47 | |
| 48 | 48 | nb1413m3_74ls193_counter++; |
| 49 | 49 | nb1413m3_74ls193_counter &= 0x0f; |
| r10315 | r10316 | |
| 140 | 140 | |
| 141 | 141 | nb1413m3_74ls193_counter = 0; |
| 142 | 142 | |
| 143 | | |
| 143 | | |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | WRITE8_HANDLER( nb1413m3_nmi_clock_w ) |
| r10315 | r10316 | |
|---|---|---|
| 2037 | 2037 | // Reading from empty FIFO causes the v60 to enter wait state |
| 2038 | 2038 | v60_stall(space->machine->device("maincpu")); |
| 2039 | 2039 | |
| 2040 | | |
| 2040 | | |
| 2041 | 2041 | |
| 2042 | 2042 | return 0; |
| 2043 | 2043 | } |
| r10315 | r10316 | |
|---|---|---|
| 1143 | 1143 | slapsticlog = fopen("slapstic.log", "w"); |
| 1144 | 1144 | if (slapsticlog) |
| 1145 | 1145 | { |
| 1146 | attotime time = | |
| 1146 | attotime time = | |
| 1147 | 1147 | |
| 1148 | 1148 | if ((time - last_time) > attotime::from_seconds(1)) |
| 1149 | 1149 | fprintf(slapsticlog, "------------------------------------\n"); |
| r10315 | r10316 | |
|---|---|---|
| 1143 | 1143 | state_save_register_global(machine, scc68070->mmu.desc[7].segment); |
| 1144 | 1144 | state_save_register_global(machine, scc68070->mmu.desc[7].base); |
| 1145 | 1145 | |
| 1146 | scc68070->timers.timer0_timer = timer_alloc( | |
| 1146 | scc68070->timers.timer0_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1147 | 1147 | timer_adjust_oneshot(scc68070->timers.timer0_timer, attotime::never, 0); |
| 1148 | 1148 | |
| 1149 | scc68070->uart.rx_timer = timer_alloc( | |
| 1149 | scc68070->uart.rx_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1150 | 1150 | timer_adjust_oneshot(scc68070->uart.rx_timer, attotime::never, 0); |
| 1151 | 1151 | |
| 1152 | scc68070->uart.tx_timer = timer_alloc( | |
| 1152 | scc68070->uart.tx_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1153 | 1153 | timer_adjust_oneshot(scc68070->uart.tx_timer, attotime::never, 0); |
| 1154 | 1154 | } |
| 1155 | 1155 |
| r10315 | r10316 | |
|---|---|---|
| 75 | 75 | static void mw8080bw_create_interrupt_timer( running_machine *machine ) |
| 76 | 76 | { |
| 77 | 77 | mw8080bw_state *state = machine->driver_data<mw8080bw_state>(); |
| 78 | state->interrupt_timer = timer_alloc(m | |
| 78 | state->interrupt_timer = machine->scheduler().timer_alloc(FUNC(m | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 |
| r10315 | r10316 | |
|---|---|---|
| 1383 | 1383 | DRIVER( cosmo ) /* TDS+Mints */ |
| 1384 | 1384 | DRIVER( darthvdr ) /* bootleg */ |
| 1385 | 1385 | |
| 1386 | DRIVER( 18w ) /* 653 (c) 1979 Midway */ | |
| 1387 | DRIVER( 18w2 ) /* 653 (c) 1979 Midway */ | |
| 1386 | 1388 | DRIVER( sspeedr ) /* 1979 Midway */ |
| 1387 | 1389 | |
| 1388 | 1390 | /* Similar but with a M6800 instead of an 8080 */ |
| r10315 | r10316 | |
| 4897 | 4899 | DRIVER( vfurlong ) /* 2005.03 Net Select Keiba Victory Furlong */ |
| 4898 | 4900 | /* 2005.03 The Rumble Fish 2 */ |
| 4899 | 4901 | DRIVER( ngbc ) /* 2005.07 NeoGeo Battle Colloseum */ |
| 4900 | | |
| 4902 | DRIVER( samsptk ) /* 2005.09 Samurai Spirits Tenkaichi Kenkakuden */ | |
| 4901 | 4903 | DRIVER( kofxi ) /* 2005.10 The King of Fighters XI */ |
| 4902 | 4904 | DRIVER( fotns ) /* 2005.12 Hokuto no Ken */ |
| 4903 | 4905 | DRIVER( mslug6 ) /* 2006.02 Metal Slug 6 */ |
| r10315 | r10316 | |
| 8961 | 8963 | DRIVER( eyesdown ) /* 199? */ |
| 8962 | 8964 | DRIVER( eyesdownd ) /* 199? */ |
| 8963 | 8965 | |
| 8966 | /* BwB games */ | |
| 8964 | 8967 | DRIVER( blox ) /* 199? */ |
| 8965 | 8968 | DRIVER( bloxd ) /* 199? */ |
| 8969 | DRIVER( bwbtetrs ) /* 199? */ | |
| 8966 | 8970 | DRIVER( prizeinv ) /* 199? */ |
| 8967 | 8971 | DRIVER( vgpoker ) /* 199? */ |
| 8972 | DRIVER( renoreel ) /* 199? */ | |
| 8973 | DRIVER( redhtpkr ) /* 199? */ | |
| 8968 | 8974 | |
| 8969 | 8975 | /* ADP games */ |
| 8970 | 8976 | DRIVER( backgamn ) /* (c) 1990 */ |
| r10315 | r10316 | |
| 9235 | 9241 | DRIVER( ironfortj ) /* (c) 1998 Eolith */ |
| 9236 | 9242 | DRIVER( puzzlekg ) /* (c) 1998 Eolith */ |
| 9237 | 9243 | DRIVER( hidctch2 ) /* (c) 1999 Eolith */ |
| 9244 | DRIVER( hidctch2a) /* (c) 1999 Eolith */ | |
| 9238 | 9245 | DRIVER( nhidctch ) /* (c) 1999 Eolith */ |
| 9239 | 9246 | DRIVER( landbrk ) /* (c) 1999 Eolith */ |
| 9240 | 9247 | DRIVER( landbrka ) /* (c) 1999 Eolith */ |
| r10315 | r10316 | |
| 10561 | 10568 | DRIVER( m_oldtmr ) /* Barcrest - highly prelim*/ |
| 10562 | 10569 | DRIVER( m_ccelbr ) |
| 10563 | 10570 | DRIVER( m_gmball ) |
| 10571 | DRIVER( m_grtecp ) /* 199? */ | |
| 10564 | 10572 | |
| 10565 | 10573 | /* MPU5 */ |
| 10566 | 10574 | DRIVER( m_honmon ) |
| r10315 | r10316 | |
|---|---|---|
| 25 | 25 | { |
| 26 | 26 | public: |
| 27 | 27 | cave_state(running_machine &machine, const driver_device_config_base &config) |
| 28 | : driver_device(machine, config) { } | |
| 28 | : driver_device(machine, config), int_timer(*this, "int_timer") { } | |
| 29 | 29 | |
| 30 | 30 | /* memory pointers */ |
| 31 | 31 | UINT16 * videoregs; |
| r10315 | r10316 | |
| 112 | 112 | /* devices */ |
| 113 | 113 | device_t *maincpu; |
| 114 | 114 | device_t *audiocpu; |
| 115 | required_device<timer_device> int_timer; | |
| 115 | 116 | }; |
| 116 | 117 | |
| 117 | 118 | /*----------- defined in video/cave.c -----------*/ |
| r10315 | r10316 | |
|---|---|---|
| 892 | 892 | $(MAMEOBJ)/midw8080.a: \ |
| 893 | 893 | $(DRIVERS)/8080bw.o $(AUDIO)/8080bw.o $(VIDEO)/8080bw.o \ |
| 894 | 894 | $(DRIVERS)/m79amb.o $(AUDIO)/m79amb.o \ |
| 895 | $(DRIVERS)/mw18w.o \ | |
| 895 | 896 | $(DRIVERS)/mw8080bw.o $(MACHINE)/mw8080bw.o $(AUDIO)/mw8080bw.o $(VIDEO)/mw8080bw.o \ |
| 896 | 897 | $(DRIVERS)/rotaryf.o \ |
| 897 | 898 | $(DRIVERS)/sspeedr.o $(VIDEO)/sspeedr.o \ |
| r10315 | r10316 | |
| 1875 | 1876 | |
| 1876 | 1877 | $(DRIVERS)/mpu4.o: $(LAYOUT)/mpu4.lh \ |
| 1877 | 1878 | $(LAYOUT)/connect4.lh \ |
| 1879 | $(LAYOUT)/mpu4ext.lh \ | |
| 1878 | 1880 | $(LAYOUT)/gamball.lh |
| 1879 | 1881 | |
| 1882 | $(DRIVERS)/mw18w.o: $(LAYOUT)/18w.lh | |
| 1883 | ||
| 1880 | 1884 | $(DRIVERS)/mw8080bw.o: $(LAYOUT)/280zzzap.lh \ |
| 1881 | 1885 | $(LAYOUT)/clowns.lh \ |
| 1882 | 1886 | $(LAYOUT)/invaders.lh \ |
| r10315 | r10316 | |
|---|---|---|
| 1655 | 1655 | VIDEO_START_CALL(generic_bitmapped); |
| 1656 | 1656 | mcd212_ab_init(&state->mcd212_ab); |
| 1657 | 1657 | mcd212_init(machine, &state->mcd212_regs); |
| 1658 | state->mcd212_regs.scan_timer = timer_alloc(m | |
| 1658 | state->mcd212_regs.scan_timer = machine->scheduler().timer_alloc(FUNC(m | |
| 1659 | 1659 | timer_adjust_oneshot(state->mcd212_regs.scan_timer, machine->primary_screen->time_until_pos(0, 0), 0); |
| 1660 | 1660 | |
| 1661 | 1661 | state->lcdbitmap = downcast<screen_device *>(machine->device("lcd"))->alloc_compatible_bitmap(); |
| r10315 | r10316 | |
|---|---|---|
| 228 | 228 | tilemap_set_transparent_pen(state->fg_tilemap, 0); |
| 229 | 229 | |
| 230 | 230 | /* create the interrupt timer */ |
| 231 | state->interrupt_timer = timer_alloc( | |
| 231 | state->interrupt_timer = machine->scheduler().timer_alloc(FUNC(in | |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 |
| r10315 | r10316 | |
|---|---|---|
| 541 | 541 | } |
| 542 | 542 | |
| 543 | 543 | /* signal we're done */ |
| 544 | | |
| 544 | | |
| 545 | 545 | |
| 546 | 546 | g_profiler.stop(); |
| 547 | 547 | } |
| r10315 | r10316 | |
| 580 | 580 | /* if this is the last update of the screen, set a timer to clear out the final line */ |
| 581 | 581 | /* (since we update one behind) */ |
| 582 | 582 | if (scanline == screen.visible_area().max_y) |
| 583 | | |
| 583 | | |
| 584 | 584 | } |
| r10315 | r10316 | |
|---|---|---|
| 387 | 387 | nb19010_busyflag = 0; |
| 388 | 388 | |
| 389 | 389 | /* 1650ns per count */ |
| 390 | timer_set( | |
| 390 | machine->scheduler().timer_set( | |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | 393 | /****************************************************************************** |
| r10315 | r10316 | |
|---|---|---|
| 308 | 308 | g_profiler.stop(); |
| 309 | 309 | |
| 310 | 310 | #if (!INSTANT_BLIT) |
| 311 | blitter_busy_until = | |
| 311 | blitter_busy_until = | |
| 312 | 312 | #endif |
| 313 | 313 | } |
| 314 | 314 | |
| r10315 | r10316 | |
| 322 | 322 | */ |
| 323 | 323 | UINT16 result = 0xffef | (blitter_page << 4); |
| 324 | 324 | #if (!INSTANT_BLIT) |
| 325 | if ( | |
| 325 | if ( | |
| 326 | 326 | result ^= 6; |
| 327 | 327 | #endif |
| 328 | 328 | return result; |
| r10315 | r10316 | |
|---|---|---|
| 787 | 787 | |
| 788 | 788 | /* signal we're done */ |
| 789 | 789 | skipdma: |
| 790 | | |
| 790 | | |
| 791 | 791 | |
| 792 | 792 | g_profiler.stop(); |
| 793 | 793 | } |
| r10315 | r10316 | |
|---|---|---|
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 | nb19010_busyflag = 0; |
| 350 | timer_set( | |
| 350 | machine->scheduler().timer_set( | |
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | /****************************************************************************** |
| r10315 | r10316 | |
|---|---|---|
| 232 | 232 | /* reset statics */ |
| 233 | 233 | memset(itech32_video, 0, 0x80); |
| 234 | 234 | |
| 235 | scanline_timer = timer_alloc( | |
| 235 | scanline_timer = machine->scheduler().timer_alloc(FUNC( | |
| 236 | 236 | enable_latch[0] = 1; |
| 237 | 237 | enable_latch[1] = (itech32_planes > 1) ? 1 : 0; |
| 238 | 238 |
| r10315 | r10316 | |
|---|---|---|
| 944 | 944 | |
| 945 | 945 | VIDEO_START_CALL(dkong_base); |
| 946 | 946 | |
| 947 | state->scanline_timer = timer_alloc( | |
| 947 | state->scanline_timer = machine->scheduler().timer_alloc(FUNC( | |
| 948 | 948 | timer_adjust_oneshot(state->scanline_timer, machine->primary_screen->time_until_pos(0), 0); |
| 949 | 949 | |
| 950 | 950 | switch (state->hardware_type) |
| r10315 | r10316 | |
|---|---|---|
| 440 | 440 | init_gfxelement(mo, desc->gfxindex); |
| 441 | 441 | |
| 442 | 442 | /* start a timer to update a few times during refresh */ |
| 443 | force_update_timer = timer_alloc( | |
| 443 | force_update_timer = machine->scheduler().timer_alloc(FUNC( | |
| 444 | 444 | timer_adjust_oneshot(force_update_timer,machine->primary_screen->time_until_pos(0), 0); |
| 445 | 445 | |
| 446 | 446 | init_savestate(machine, map, mo); |
| r10315 | r10316 | |
|---|---|---|
| 284 | 284 | index |= 0x80; /* collision on right side */ |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | timer_set(machine | |
| 287 | machine->scheduler().timer_set(machine | |
| 288 | 288 | |
| 289 | 289 | _state = 1; |
| 290 | 290 | } |
| r10315 | r10316 | |
|---|---|---|
| 165 | 165 | else |
| 166 | 166 | do_blit(); |
| 167 | 167 | |
| 168 | | |
| 168 | | |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | /* clear the IRQ on offset 0 */ |
| r10315 | r10316 | |
|---|---|---|
| 523 | 523 | blit_in_progress = 1; |
| 524 | 524 | |
| 525 | 525 | /* set a timer to go off when we're done */ |
| 526 | | |
| 526 | | |
| 527 | 527 | } |
| 528 | 528 | |
| 529 | 529 | /* debugging */ |
| r10315 | r10316 | |
|---|---|---|
| 83 | 83 | leland_video_ram = auto_alloc_array_clear(machine, UINT8, VRAM_SIZE); |
| 84 | 84 | |
| 85 | 85 | /* scanline timer */ |
| 86 | scanline_timer = timer_alloc( | |
| 86 | scanline_timer = machine->scheduler().timer_alloc(FUNC( | |
| 87 | 87 | timer_adjust_oneshot(scanline_timer, machine->primary_screen->time_until_pos(0), 0); |
| 88 | 88 | |
| 89 | 89 | } |
| r10315 | r10316 | |
| 318 | 318 | |
| 319 | 319 | WRITE8_HANDLER( leland_mvram_port_w ) |
| 320 | 320 | { |
| 321 | | |
| 321 | space->machine->schedul | |
| 322 | 322 | } |
| 323 | 323 | |
| 324 | 324 | |
| r10315 | r10316 | |
| 363 | 363 | WRITE8_HANDLER( ataxx_mvram_port_w ) |
| 364 | 364 | { |
| 365 | 365 | offset = ((offset >> 1) & 0x07) | ((offset << 3) & 0x08) | (offset & 0x10); |
| 366 | | |
| 366 | space->machine->schedul | |
| 367 | 367 | } |
| 368 | 368 | |
| 369 | 369 |
| r10315 | r10316 | |
|---|---|---|
| 52 | 52 | /* set a timer to mimic the 555 timer that drives the EDGINT signal */ |
| 53 | 53 | /* the 555 is run in monostable mode with R=56000 and C=1000pF */ |
| 54 | 54 | vblank_latch = 1; |
| 55 | timer_set( | |
| 55 | machine->scheduler().timer_set( | |
| 56 | 56 | |
| 57 | 57 | /* latch the current flip state at the same time */ |
| 58 | 58 | video_flip = video_control & 1; |
| r10315 | r10316 | |
|---|---|---|
| 1399 | 1399 | /* FIXME: timing of these */ |
| 1400 | 1400 | switch (state_ta.tafifo_listtype) |
| 1401 | 1401 | { |
| 1402 | case 0: timer_set(machine, attotime::from_usec(100), NULL, 0, transfer_opaque_list_irq); break; | |
| 1403 | case 1: timer_set(machine, attotime::from_usec(100), NULL, 0, transfer_opaque_modifier_volume_list_irq); break; | |
| 1404 | case 2: timer_set(machine, attotime::from_usec(100), NULL, 0, transfer_translucent_list_irq); break; | |
| 1405 | case 3: timer_set(machine, attotime::from_usec(100), NULL, 0, transfer_translucent_modifier_volume_list_irq); break; | |
| 1406 | case 4: timer_set(machine, attotime::from_usec(100), NULL, 0, transfer_punch_through_list_irq); break; | |
| 1402 | case 0: machine->scheduler().timer_set(attotime::from_usec(100), FUNC(transfer_opaque_list_irq)); break; | |
| 1403 | case 1: machine->scheduler().timer_set(attotime::from_usec(100), FUNC(transfer_opaque_modifier_volume_list_irq)); break; | |
| 1404 | case 2: machine->scheduler().timer_set(attotime::from_usec(100), FUNC(transfer_translucent_list_irq)); break; | |
| 1405 | case 3: machine->scheduler().timer_set(attotime::from_usec(100), FUNC(transfer_translucent_modifier_volume_list_irq)); break; | |
| 1406 | case 4: machine->scheduler().timer_set(attotime::from_usec(100), FUNC(transfer_punch_through_list_irq)); break; | |
| 1407 | 1407 | } |
| 1408 | 1408 | state_ta.tafifo_listtype= -1; // no list being received |
| 1409 | 1409 | state_ta.listtype_used |= (2+8); |
| r10315 | r10316 | |
| 2551 | 2551 | |
| 2552 | 2552 | computedilated(); |
| 2553 | 2553 | |
| 2554 | vbout_timer = timer_alloc( | |
| 2554 | vbout_timer = machine->scheduler().timer_alloc(FUNC( | |
| 2555 | 2555 | timer_adjust_oneshot(vbout_timer, machine->primary_screen->time_until_pos(spg_vblank_out_irq_line_num), 0); |
| 2556 | 2556 | |
| 2557 | vbin_timer = timer_alloc( | |
| 2557 | vbin_timer = machine->scheduler().timer_alloc(FUNC( | |
| 2558 | 2558 | timer_adjust_oneshot(vbin_timer, machine->primary_screen->time_until_pos(spg_vblank_in_irq_line_num), 0); |
| 2559 | 2559 | |
| 2560 | hbin_timer = timer_alloc( | |
| 2560 | hbin_timer = machine->scheduler().timer_alloc(FUNC(h | |
| 2561 | 2561 | timer_adjust_oneshot(hbin_timer, machine->primary_screen->time_until_pos(0, spg_hblank_in_irq-1), 0); |
| 2562 | 2562 | |
| 2563 | 2563 | scanline = 0; |
| 2564 | 2564 | next_y = 0; |
| 2565 | 2565 | |
| 2566 | endofrender_timer_isp = timer_alloc(machine, endofrender_isp, 0); | |
| 2567 | endofrender_timer_tsp = timer_alloc(machine, endofrender_tsp, 0); | |
| 2568 | endofrender_timer_video = timer_alloc(machine, endofrender_video, 0); | |
| 2566 | endofrender_timer_isp = machine->scheduler().timer_alloc(FUNC(endofrender_isp)); | |
| 2567 | endofrender_timer_tsp = machine->scheduler().timer_alloc(FUNC(endofrender_tsp)); | |
| 2568 | endofrender_timer_video = machine->scheduler().timer_alloc(FUNC(endofrender_video)); | |
| 2569 | 2569 | |
| 2570 | 2570 | timer_adjust_oneshot(endofrender_timer_isp, attotime::never, 0); |
| 2571 | 2571 | timer_adjust_oneshot(endofrender_timer_tsp, attotime::never, 0); |
| r10315 | r10316 | |
|---|---|---|
| 1095 | 1095 | } |
| 1096 | 1096 | |
| 1097 | 1097 | /* set a timer to do this again next frame */ |
| 1098 | timer | |
| 1098 | info->latch_timer->adjus | |
| 1099 | 1099 | } |
| 1100 | 1100 | |
| 1101 | 1101 | |
| 1102 | 1102 | static void segaic16_tilemap_16b_reset(running_machine *machine, struct tilemap_info *info) |
| 1103 | 1103 | { |
| 1104 | 1104 | /* set a timer to latch values on scanline 261 */ |
| 1105 | timer | |
| 1105 | info->latch_timer->adjus | |
| 1106 | 1106 | } |
| 1107 | 1107 | |
| 1108 | 1108 | |
| r10315 | r10316 | |
| 1151 | 1151 | info->numpages = 4; |
| 1152 | 1152 | info->draw_layer = segaic16_tilemap_16a_draw_layer; |
| 1153 | 1153 | info->reset = NULL; |
| 1154 | info->latch_timer = NULL; | |
| 1154 | 1155 | break; |
| 1155 | 1156 | |
| 1156 | 1157 | case SEGAIC16_TILEMAP_16A: |
| r10315 | r10316 | |
| 1159 | 1160 | info->numpages = 8; |
| 1160 | 1161 | info->draw_layer = segaic16_tilemap_16a_draw_layer; |
| 1161 | 1162 | info->reset = NULL; |
| 1163 | info->latch_timer = NULL; | |
| 1162 | 1164 | break; |
| 1163 | 1165 | |
| 1164 | 1166 | case SEGAIC16_TILEMAP_16B: |
| r10315 | r10316 | |
| 1167 | 1169 | info->numpages = 16; |
| 1168 | 1170 | info->draw_layer = segaic16_tilemap_16b_draw_layer; |
| 1169 | 1171 | info->reset = segaic16_tilemap_16b_reset; |
| 1172 | info->latch_timer = machine->scheduler().timer_alloc(FUNC(segaic16_tilemap_16b_latch_values)); | |
| 1170 | 1173 | break; |
| 1171 | 1174 | |
| 1172 | 1175 | case SEGAIC16_TILEMAP_16B_ALT: |
| r10315 | r10316 | |
| 1175 | 1178 | info->numpages = 16; |
| 1176 | 1179 | info->draw_layer = segaic16_tilemap_16b_draw_layer; |
| 1177 | 1180 | info->reset = segaic16_tilemap_16b_reset; |
| 1181 | info->latch_timer = machine->scheduler().timer_alloc(FUNC(segaic16_tilemap_16b_latch_values)); | |
| 1178 | 1182 | break; |
| 1179 | 1183 | |
| 1180 | 1184 | default: |
| r10315 | r10316 | |
|---|---|---|
| 280 | 280 | texel_width = 256; |
| 281 | 281 | zeus_renderbase = waveram[1]; |
| 282 | 282 | |
| 283 | int_timer = timer_alloc( | |
| 283 | int_timer = machine->scheduler().timer_alloc(FUNC(in | |
| 284 | 284 | |
| 285 | 285 | /* save states */ |
| 286 | 286 | state_save_register_global_pointer(machine, waveram[0], WAVERAM0_WIDTH * WAVERAM0_HEIGHT * 8 / sizeof(waveram[0][0])); |
| r10315 | r10316 | |
|---|---|---|
| 121 | 121 | void (*draw_layer)(running_machine *machine, struct tilemap_info *info, bitmap_t *bitmap, const rectangle *cliprect, int which, int flags, int priority); |
| 122 | 122 | UINT16 * textram; /* pointer to textram pointer */ |
| 123 | 123 | UINT16 * tileram; /* pointer to tileram pointer */ |
| 124 | emu_timer * latch_timer; /* timer for latching 16b tilemap scroll values */ | |
| 124 | 125 | }; |
| 125 | 126 | |
| 126 | 127 | struct road_info |
| r10315 | r10316 | |
|---|---|---|
| 203 | 203 | /* set a timer for an arbitrarily short period. |
| 204 | 204 | The real time it takes to clear to screen is not |
| 205 | 205 | important to the software */ |
| 206 | | |
| 206 | | |
| 207 | 207 | |
| 208 | 208 | break; |
| 209 | 209 | } |
| r10315 | r10316 | |
| 223 | 223 | /* Kaos sits in a tight loop polling the VIA irq flags register, but that register is |
| 224 | 224 | cleared by the irq handler. Therefore, I wait a bit before triggering the irq to |
| 225 | 225 | leave time for the program to see the flag change. */ |
| 226 | | |
| 226 | | |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | |
| r10315 | r10316 | |
| 291 | 291 | state->videoram_size = (HBSTART - HBEND) * (VBSTART - VBEND); |
| 292 | 292 | state->videoram = auto_alloc_array(machine, UINT8, state->videoram_size); |
| 293 | 293 | |
| 294 | state->via_0_ca1_timer = timer_alloc( | |
| 294 | state->via_0_ca1_timer = machine->scheduler().timer_alloc(FUNC( | |
| 295 | 295 | |
| 296 | 296 | /* register for save states */ |
| 297 | 297 | state_save_register_global_pointer(machine, state->videoram, state->videoram_size); |
| r10315 | r10316 | |
|---|---|---|
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | 102 | /* Refresh processor runs with 6 MHz */ |
| 103 | timer_set ( | |
| 103 | machine->scheduler().timer_set ( | |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 |
| r10315 | r10316 | |
|---|---|---|
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | nb1413m3_busyflag = 0; |
| 289 | timer_set( | |
| 289 | machine->scheduler().timer_set( | |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | /****************************************************************************** |
| r10315 | r10316 | |
|---|---|---|
| 20 | 20 | starfire_state *state = machine->driver_data<starfire_state>(); |
| 21 | 21 | |
| 22 | 22 | state->starfire_screen = machine->primary_screen->alloc_compatible_bitmap(); |
| 23 | state->scanline_timer = timer_alloc( | |
| 23 | state->scanline_timer = machine->scheduler().timer_alloc(FUNC( | |
| 24 | 24 | timer_adjust_oneshot(state->scanline_timer, machine->primary_screen->time_until_pos(STARFIRE_VBEND), STARFIRE_VBEND); |
| 25 | 25 | |
| 26 | 26 | /* register for state saving */ |
| r10315 | r10316 | |
|---|---|---|
| 1500 | 1500 | |
| 1501 | 1501 | galaxold_stars_on = 0; |
| 1502 | 1502 | stars_blink_state = 0; |
| 1503 | stars_blink_timer = timer_alloc(machine, stars_blink_callback, NULL); | |
| 1504 | stars_scroll_timer = timer_alloc(machine, stars_scroll_callback, NULL); | |
| 1503 | stars_blink_timer = machine->scheduler().timer_alloc(FUNC(stars_blink_callback)); | |
| 1504 | stars_scroll_timer = machine->scheduler().timer_alloc(FUNC(stars_scroll_callback)); | |
| 1505 | 1505 | timer_adjusted = 0; |
| 1506 | 1506 | stars_colors_start = colors_offset; |
| 1507 | 1507 |
| r10315 | r10316 | |
|---|---|---|
| 188 | 188 | |
| 189 | 189 | for (x = visarea.min_x; x <= visarea.max_x; x++) |
| 190 | 190 | if (p1[x] != 0x20 && p2[x] == 0x23) |
| 191 | timer_set(machine, machine->primary_screen->time_until_pos(y + 24, x), NULL, | |
| 192 | colortable_entry_get_value(machine->colortable, p1[x]), | |
| 193 | sprint8_collision_callback); | |
| 191 | machine->scheduler().timer_set(machine->primary_screen->time_until_pos(y + 24, x), | |
| 192 | FUNC(sprint8_collision_callback), | |
| 193 | colortable_entry_get_value(machine->colortable, p1[x])); | |
| 194 | 194 | } |
| 195 | 195 | } |
| r10315 | r10316 | |
|---|---|---|
| 61 | 61 | { |
| 62 | 62 | cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); |
| 63 | 63 | timer_adjust_oneshot(scanline_timer, machine->primary_screen->time_until_pos(scanline + 1), scanline); |
| 64 | timer_set( | |
| 64 | machine->scheduler().timer_set( | |
| 65 | 65 | } |
| 66 | 66 | else |
| 67 | 67 | cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE); |
| r10315 | r10316 | |
| 76 | 76 | |
| 77 | 77 | VIDEO_START( midvunit ) |
| 78 | 78 | { |
| 79 | scanline_timer = timer_alloc( | |
| 79 | scanline_timer = machine->scheduler().timer_alloc(FUNC( | |
| 80 | 80 | poly = poly_alloc(machine, 4000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS); |
| 81 | 81 | machine->add_notifier(MACHINE_NOTIFY_EXIT, midvunit_exit); |
| 82 | 82 |
| r10315 | r10316 | |
|---|---|---|
| 110 | 110 | tilemap_set_transparent_pen(state->alpha_tilemap, 0); |
| 111 | 111 | |
| 112 | 112 | /* reset the statics */ |
| 113 | state->yscroll_reset_timer = timer_alloc( | |
| 113 | state->yscroll_reset_timer = machine->scheduler().timer_alloc(FUNC( | |
| 114 | 114 | state->videobank = 0; |
| 115 | 115 | |
| 116 | 116 | /* save states */ |
| r10315 | r10316 | |
|---|---|---|
| 628 | 628 | if (offset == B_CMD) |
| 629 | 629 | { |
| 630 | 630 | blitter_status = 0; |
| 631 | | |
| 631 | | |
| 632 | 632 | blitter_run(space->machine); |
| 633 | 633 | } |
| 634 | 634 | |
| r10315 | r10316 | |
| 688 | 688 | if (gpu_regs[PIT0]) |
| 689 | 689 | { |
| 690 | 690 | sample_period = attotime::from_nsec(((machine->device("gpu")->unscaled_clock()*PIT_MULT_DBG_HACK) / (1+gpu_regs[PIT0])) / (1+gpu_regs[PIT1])); |
| 691 | timer_set( | |
| 691 | machine->scheduler().timer_set( | |
| 692 | 692 | } |
| 693 | 693 | } |
| 694 | 694 | |
| r10315 | r10316 | |
| 713 | 713 | if (gpu_regs[PIT0] && gpu_regs[PIT0] != 0xffff) //FIXME: avoid too much small timers for now |
| 714 | 714 | { |
| 715 | 715 | sample_period = attotime::from_nsec(((space->machine->device("gpu")->unscaled_clock()*PIT_MULT_DBG_HACK) / (1+gpu_regs[PIT0])) / (1+gpu_regs[PIT1])); |
| 716 | | |
| 716 | | |
| 717 | 717 | } |
| 718 | 718 | break; |
| 719 | 719 | |
| r10315 | r10316 | |
| 902 | 902 | memset(&gpu_regs, 0, sizeof(gpu_regs)); |
| 903 | 903 | cpu_irq_state = 0; |
| 904 | 904 | |
| 905 | object_timer = timer_alloc( | |
| 905 | object_timer = machine->scheduler().timer_alloc(FUNC(c | |
| 906 | 906 | adjust_object_timer(machine, 0); |
| 907 | 907 | |
| 908 | 908 | screen_bitmap = auto_bitmap_alloc(machine, 760, 512, BITMAP_FORMAT_RGB32); |
| r10315 | r10316 | |
|---|---|---|
| 93 | 93 | { |
| 94 | 94 | n8080_state *state = machine->driver_data<n8080_state>(); |
| 95 | 95 | |
| 96 | state->cannon_timer = timer_alloc( | |
| 96 | state->cannon_timer = machine->scheduler().timer_alloc(FUNC( | |
| 97 | 97 | |
| 98 | 98 | flip_screen_set_no_update(machine, 0); |
| 99 | 99 |
| r10315 | r10316 | |
|---|---|---|
| 486 | 486 | } |
| 487 | 487 | |
| 488 | 488 | nb1413m3_busyflag = 0; |
| 489 | timer_set( | |
| 489 | machine->scheduler().timer_set( | |
| 490 | 490 | } |
| 491 | 491 | |
| 492 | 492 | /****************************************************************************** |
| r10315 | r10316 | |
|---|---|---|
| 222 | 222 | VIDEO_START( astrocde ) |
| 223 | 223 | { |
| 224 | 224 | /* allocate a per-scanline timer */ |
| 225 | scanline_timer = timer_alloc( | |
| 225 | scanline_timer = machine->scheduler().timer_alloc(FUNC( | |
| 226 | 226 | timer_adjust_oneshot(scanline_timer, machine->primary_screen->time_until_pos(1), 1); |
| 227 | 227 | |
| 228 | 228 | /* register for save states */ |
| r10315 | r10316 | |
| 237 | 237 | VIDEO_START( profpac ) |
| 238 | 238 | { |
| 239 | 239 | /* allocate a per-scanline timer */ |
| 240 | scanline_timer = timer_alloc( | |
| 240 | scanline_timer = machine->scheduler().timer_alloc(FUNC( | |
| 241 | 241 | timer_adjust_oneshot(scanline_timer, machine->primary_screen->time_until_pos(1), 1); |
| 242 | 242 | |
| 243 | 243 | /* allocate videoram */ |
| r10315 | r10316 | |
| 443 | 443 | if ((interrupt_enable & 0x01) == 0) |
| 444 | 444 | { |
| 445 | 445 | cputag_set_input_line_and_vector(machine, "maincpu", 0, HOLD_LINE, interrupt_vector & 0xf0); |
| 446 | timer_set(machine | |
| 446 | machine->scheduler().timer_set(machine | |
| 447 | 447 | } |
| 448 | 448 | |
| 449 | 449 | /* mode 1 means assert for 1 instruction */ |
| 450 | 450 | else |
| 451 | 451 | { |
| 452 | 452 | cputag_set_input_line_and_vector(machine, "maincpu", 0, ASSERT_LINE, interrupt_vector & 0xf0); |
| 453 | timer_set(machine | |
| 453 | machine->scheduler().timer_set(machine | |
| 454 | 454 | } |
| 455 | 455 | |
| 456 | 456 | /* latch the feedback registers */ |
| r10315 | r10316 | |
| 483 | 483 | if ((interrupt_enable & 0x04) == 0) |
| 484 | 484 | { |
| 485 | 485 | cputag_set_input_line_and_vector(machine, "maincpu", 0, HOLD_LINE, interrupt_vector); |
| 486 | timer_set(machine | |
| 486 | machine->scheduler().timer_set(machine | |
| 487 | 487 | } |
| 488 | 488 | |
| 489 | 489 | /* mode 1 means assert for 1 instruction */ |
| 490 | 490 | else |
| 491 | 491 | { |
| 492 | 492 | cputag_set_input_line_and_vector(machine, "maincpu", 0, ASSERT_LINE, interrupt_vector); |
| 493 | timer_set(machine | |
| 493 | machine->scheduler().timer_set(machine | |
| 494 | 494 | } |
| 495 | 495 | } |
| 496 | 496 |
| r10315 | r10316 | |
|---|---|---|
| 548 | 548 | nb1413m3_busyflag = 0; |
| 549 | 549 | |
| 550 | 550 | if (gfxtype == GFXTYPE_8BIT) |
| 551 | timer_set( | |
| 551 | machine->scheduler().timer_set( | |
| 552 | 552 | else |
| 553 | timer_set( | |
| 553 | machine->scheduler().timer_set( | |
| 554 | 554 | } |
| 555 | 555 | |
| 556 | 556 |
| r10315 | r10316 | |
|---|---|---|
| 86 | 86 | scrollx = scrolly = 0; |
| 87 | 87 | video_control = 0; |
| 88 | 88 | memset(µ, 0, sizeof(micro)); |
| 89 | micro.timer = timer_alloc( | |
| 89 | micro.timer = machine->scheduler().timer_alloc(F | |
| 90 | 90 | |
| 91 | 91 | /* register for state saving */ |
| 92 | 92 | state_save_register_global_array(machine, victory_paletteram); |
| r10315 | r10316 | |
| 1125 | 1125 | int bpix = bg[(x + scrollx) & 255]; |
| 1126 | 1126 | scanline[x] = bpix | (fpix << 3); |
| 1127 | 1127 | if (fpix && (bpix & bgcollmask) && count++ < 128) |
| 1128 | | |
| 1128 | | |
| 1129 | 1129 | } |
| 1130 | 1130 | } |
| 1131 | 1131 |
| r10315 | r10316 | |
|---|---|---|
| 1504 | 1504 | |
| 1505 | 1505 | flip_x = flip_y = 0; |
| 1506 | 1506 | |
| 1507 | vg_halt_timer = timer_alloc(machine, vg_set_halt_callback, NULL); | |
| 1508 | vg_run_timer = timer_alloc(machine, run_state_machine, NULL); | |
| 1507 | vg_halt_timer = machine->scheduler().timer_alloc(FUNC(vg_set_halt_callback)); | |
| 1508 | vg_run_timer = machine->scheduler().timer_alloc(FUNC(run_state_machine)); | |
| 1509 | 1509 | |
| 1510 | 1510 | /* |
| 1511 | 1511 | * The x and y DACs use 10 bit of the counter values which are in |
| r10315 | r10316 | |
| 1530 | 1530 | xmin = visarea.min_x; |
| 1531 | 1531 | ymin = visarea.min_y; |
| 1532 | 1532 | |
| 1533 | vg_halt_timer = timer_alloc(machine, vg_set_halt_callback, NULL); | |
| 1534 | vg_run_timer = timer_alloc(machine, run_state_machine, NULL); | |
| 1533 | vg_halt_timer = machine->scheduler().timer_alloc(FUNC(vg_set_halt_callback)); | |
| 1534 | vg_run_timer = machine->scheduler().timer_alloc(FUNC(run_state_machine)); | |
| 1535 | 1535 | |
| 1536 | 1536 | register_state (machine); |
| 1537 | 1537 |
| r10315 | r10316 | |
|---|---|---|
| 104 | 104 | line_buffer[1].priority_buf = auto_alloc_array(machine, UINT8, 512); |
| 105 | 105 | |
| 106 | 106 | /* Create and initialise the HBLANK timers */ |
| 107 | hblank_start_timer = timer_alloc(machine, hblank_start_callback, NULL); | |
| 108 | hblank_end_timer = timer_alloc(machine, hblank_end_callback, NULL); | |
| 107 | hblank_start_timer = machine->scheduler().timer_alloc(FUNC(hblank_start_callback)); | |
| 108 | hblank_end_timer = machine->scheduler().timer_alloc(FUNC(hblank_end_callback)); | |
| 109 | 109 | timer_adjust_oneshot(hblank_start_timer, machine->primary_screen->time_until_pos(0, ESRIPSYS_HBLANK_START), 0); |
| 110 | 110 | |
| 111 | 111 | /* Create the sprite scaling table */ |
| r10315 | r10316 | |
|---|---|---|
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | nb1413m3_busyflag = 0; |
| 297 | timer_set( | |
| 297 | machine->scheduler().timer_set( | |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | /****************************************************************************** |
| r10315 | r10316 | |
|---|---|---|
| 374 | 374 | |
| 375 | 375 | /* check the collisions bit */ |
| 376 | 376 | if (check_collision && (palette[2 * pen] & 0x80) && (count++ < 128)) |
| 377 | | |
| 377 | | |
| 378 | 378 | } |
| 379 | 379 | currx++; |
| 380 | 380 | |
| r10315 | r10316 | |
| 387 | 387 | |
| 388 | 388 | /* check the collisions bit */ |
| 389 | 389 | if (check_collision && (palette[2 * pen] & 0x80) && (count++ < 128)) |
| 390 | | |
| 390 | | |
| 391 | 391 | } |
| 392 | 392 | currx++; |
| 393 | 393 | } |
| r10315 | r10316 | |
| 458 | 458 | attotime time = screen->time_until_pos(beamy, beamx) - increment * 6; |
| 459 | 459 | for (i = 0; i <= 12; i++) |
| 460 | 460 | { |
| 461 | | |
| 461 | | |
| 462 | 462 | time += increment; |
| 463 | 463 | } |
| 464 | 464 | } |
| r10315 | r10316 | |
|---|---|---|
| 1128 | 1128 | tx1_rod_bmp = auto_alloc_array(machine, UINT8, 256 * 3 * 240); |
| 1129 | 1129 | |
| 1130 | 1130 | /* Set a timer to run the interrupts */ |
| 1131 | interrupt_timer = timer_alloc( | |
| 1131 | interrupt_timer = machine->scheduler().timer_alloc(FUNC(in | |
| 1132 | 1132 | |
| 1133 | 1133 | /* /CUDISP CRTC interrupt */ |
| 1134 | 1134 | timer_adjust_oneshot(interrupt_timer, machine->primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS), 0); |
| r10315 | r10316 | |
| 3047 | 3047 | bb_rod_bmp = auto_alloc_array(machine, UINT8, 3 * 256 * 240); |
| 3048 | 3048 | |
| 3049 | 3049 | /* Set a timer to run the interrupts */ |
| 3050 | interrupt_timer = timer_alloc( | |
| 3050 | interrupt_timer = machine->scheduler().timer_alloc(FUNC(in | |
| 3051 | 3051 | |
| 3052 | 3052 | /* /CUDISP CRTC interrupt */ |
| 3053 | 3053 | timer_adjust_oneshot(interrupt_timer, machine->primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS), 0); |
| r10315 | r10316 | |
| 3061 | 3061 | bb_rod_bmp = auto_alloc_array(machine, UINT8, 256 * 240); |
| 3062 | 3062 | |
| 3063 | 3063 | /* Set a timer to run the interrupts */ |
| 3064 | interrupt_timer = timer_alloc( | |
| 3064 | interrupt_timer = machine->scheduler().timer_alloc(FUNC(in | |
| 3065 | 3065 | |
| 3066 | 3066 | /* /CUDISP CRTC interrupt */ |
| 3067 | 3067 | timer_adjust_oneshot(interrupt_timer, machine->primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS), 0); |
| r10315 | r10316 | |
|---|---|---|
| 130 | 130 | period_on = screen.time_until_pos(vpos + 7, width * 0.9); |
| 131 | 131 | period_off = screen.time_until_pos(vpos + 8, width * 0.9); |
| 132 | 132 | |
| 133 | timer_set(screen.machine, period_on, NULL, 0, irq_on); | |
| 134 | timer_set(screen.machine, period_off, NULL, 0, irq_off); | |
| 133 | screen.machine->scheduler().timer_set(period_on, FUNC(irq_on)); | |
| 134 | screen.machine->scheduler().timer_set(period_off, FUNC(irq_off)); | |
| 135 | 135 | } |
| 136 | 136 | } |
| 137 | 137 |
| r10315 | r10316 | |
|---|---|---|
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | nb1413m3_busyflag = 0; |
| 379 | timer_set( | |
| 379 | machine->scheduler().timer_set( | |
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | /****************************************************************************** |
| r10315 | r10316 | |
|---|---|---|
| 39 | 39 | |
| 40 | 40 | state->timer_value = 0; |
| 41 | 41 | |
| 42 | timer_pulse( | |
| 42 | machine->scheduler().timer_pulse( | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 |
| r10315 | r10316 | |
|---|---|---|
| 918 | 918 | state->obj_pal_ram = auto_alloc_array(machine, UINT8, 2048); |
| 919 | 919 | |
| 920 | 920 | /* Timer for ground display list callback */ |
| 921 | state->bufend_timer = timer_alloc( | |
| 921 | state->bufend_timer = machine->scheduler().timer_alloc(FUNC( | |
| 922 | 922 | |
| 923 | 923 | /* Timer for the CRTC cursor pulse */ |
| 924 | state->cursor_timer = timer_alloc( | |
| 924 | state->cursor_timer = machine->scheduler().timer_alloc(FUNC(c | |
| 925 | 925 | timer_adjust_oneshot(state->cursor_timer, machine->primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS), 0); |
| 926 | 926 | |
| 927 | 927 | state_save_register_global_bitmap(machine, state->back_buffer); |
| r10315 | r10316 | |
|---|---|---|
| 1051 | 1051 | return machine->primary_screen->hpos() * CYCLES_PER_LINE / machine->primary_screen->width(); |
| 1052 | 1052 | } |
| 1053 | 1053 | |
| 1054 | static void after(running_machine *machine, int cycles, timer_ | |
| 1054 | static void after(running_machine *machine, int cycles, timer_expired_func function, const char *funcname) | |
| 1055 | 1055 | { |
| 1056 | 1056 | attotime duration = machine->primary_screen->scan_period() * cycles / CYCLES_PER_LINE; |
| 1057 | 1057 | (void)funcname; |
| 1058 | 1058 | LOG((" after %3d (%5.1f us) %s\n", cycles, duration.as_double() * 1.0e6, funcname)); |
| 1059 | timer_set( | |
| 1059 | machine->scheduler().timer_set( | |
| 1060 | 1060 | } |
| 1061 | 1061 | |
| 1062 | 1062 | static TIMER_CALLBACK( antic_issue_dli ) |
| r10315 | r10316 | |
| 1158 | 1158 | static TIMER_CALLBACK( antic_steal_cycles ) |
| 1159 | 1159 | { |
| 1160 | 1160 | LOG((" @cycle #%3d steal %d cycles\n", cycle(machine), antic.steal_cycles)); |
| 1161 | after(machine, antic.steal_cycles, antic_line_done | |
| 1161 | after(machine, antic.steal_cycles, FUNC(antic_line_done) | |
| 1162 | 1162 | antic.steal_cycles = 0; |
| 1163 | 1163 | cpu_spinuntil_trigger( machine->device("maincpu"), TRIGGER_STEAL ); |
| 1164 | 1164 | } |
| r10315 | r10316 | |
| 1229 | 1229 | |
| 1230 | 1230 | antic.steal_cycles += CYCLES_REFRESH; |
| 1231 | 1231 | LOG((" run CPU for %d cycles\n", CYCLES_HSYNC - CYCLES_HSTART - antic.steal_cycles)); |
| 1232 | after(machine, CYCLES_HSYNC - CYCLES_HSTART - antic.steal_cycles, antic_steal_cycles | |
| 1232 | after(machine, CYCLES_HSYNC - CYCLES_HSTART - antic.steal_cycles, FUNC(antic_steal_cycles) | |
| 1233 | 1233 | } |
| 1234 | 1234 | |
| 1235 | 1235 | |
| r10315 | r10316 | |
| 1341 | 1341 | { |
| 1342 | 1342 | /* remove the DLI bit */ |
| 1343 | 1343 | new_cmd &= ~ANTIC_DLI; |
| 1344 | after(machine, CYCLES_DLI_NMI, antic_issue_dli | |
| 1344 | after(machine, CYCLES_DLI_NMI, FUNC(antic_issue_dli) | |
| 1345 | 1345 | } |
| 1346 | 1346 | /* load memory scan bit set ? */ |
| 1347 | 1347 | if( new_cmd & ANTIC_LMS ) |
| r10315 | r10316 | |
| 1473 | 1473 | |
| 1474 | 1474 | antic.r.nmist &= ~DLI_NMI; |
| 1475 | 1475 | if( antic.modelines == 1 && (antic.cmd & antic.w.nmien & DLI_NMI) ) |
| 1476 | after(machine, CYCLES_DLI_NMI, antic_issue_dli | |
| 1476 | after(machine, CYCLES_DLI_NMI, FUNC(antic_issue_dli) | |
| 1477 | 1477 | |
| 1478 | after(machine, CYCLES_HSTART, antic_scanline_render | |
| 1478 | after(machine, CYCLES_HSTART, FUNC(antic_scanline_render) | |
| 1479 | 1479 | } |
| 1480 | 1480 | |
| 1481 | 1481 | /***************************************************************************** |
| r10315 | r10316 | |
|---|---|---|
| 373 | 373 | { |
| 374 | 374 | /* at the end of VBLANK is when automatic sprite rendering happens */ |
| 375 | 375 | if (!state) |
| 376 | timer_set( | |
| 376 | machine->scheduler().timer_set( | |
| 377 | 377 | } |
| 378 | 378 | |
| 379 | 379 |
| r10315 | r10316 | |
|---|---|---|
| 70 | 70 | tilemap_set_transparent_pen(state->fg_tilemap, 15); |
| 71 | 71 | |
| 72 | 72 | /* reset the timer */ |
| 73 | state->crtc_timer = timer_alloc( | |
| 73 | state->crtc_timer = machine->scheduler().timer_alloc(FUNC(c | |
| 74 | 74 | |
| 75 | 75 | /* state save */ |
| 76 | 76 | state_save_register_global(machine, state->selected_videoram); |
| r10315 | r10316 | |
|---|---|---|
| 243 | 243 | static void create_auto_animation_timer( running_machine *machine ) |
| 244 | 244 | { |
| 245 | 245 | neogeo_state *state = machine->driver_data<neogeo_state>(); |
| 246 | state->auto_animation_timer = timer_alloc( | |
| 246 | state->auto_animation_timer = machine->scheduler().timer_alloc(FUNC(a | |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | |
| r10315 | r10316 | |
| 664 | 664 | static void create_sprite_line_timer( running_machine *machine ) |
| 665 | 665 | { |
| 666 | 666 | neogeo_state *state = machine->driver_data<neogeo_state>(); |
| 667 | state->sprite_line_timer = timer_alloc( | |
| 667 | state->sprite_line_timer = machine->scheduler().timer_alloc(FUNC( | |
| 668 | 668 | } |
| 669 | 669 | |
| 670 | 670 |
| r10315 | r10316 | |
|---|---|---|
| 1301 | 1301 | ppu2c0x->security_value = 0x1b; |
| 1302 | 1302 | |
| 1303 | 1303 | /* initialize the scanline handling portion */ |
| 1304 | ppu2c0x->scanline_timer = | |
| 1304 | ppu2c0x->scanline_timer = | |
| 1305 | 1305 | timer_adjust_oneshot(ppu2c0x->scanline_timer, device->machine->primary_screen->time_until_pos(1), 0); |
| 1306 | 1306 | |
| 1307 | ppu2c0x->hblank_timer = | |
| 1307 | ppu2c0x->hblank_timer = | |
| 1308 | 1308 | timer_adjust_oneshot(ppu2c0x->hblank_timer, device->machine->device<cpu_device>("maincpu")->cycles_to_attotime(86.67), 0); // ??? FIXME - hardcoding NTSC, need better calculation |
| 1309 | 1309 | |
| 1310 | ppu2c0x->nmi_timer = | |
| 1310 | ppu2c0x->nmi_timer = | |
| 1311 | 1311 | timer_adjust_oneshot(ppu2c0x->nmi_timer, attotime::never, 0); |
| 1312 | 1312 | |
| 1313 | 1313 | ppu2c0x->nmi_callback_proc = intf->nmi_handler; |
| r10315 | r10316 | |
|---|---|---|
| 590 | 590 | cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE); |
| 591 | 591 | |
| 592 | 592 | /* 2.assert /SINT again after this time */ |
| 593 | | |
| 593 | | |
| 594 | 594 | |
| 595 | 595 | /* 3.clear of /SINT starts sprite drawing circuit */ |
| 596 | 596 | draw_sprite(space->machine); |
| r10315 | r10316 | |
|---|---|---|
| 361 | 361 | |
| 362 | 362 | /* if we got one, trigger an interrupt */ |
| 363 | 363 | if ((current_collision_mask & collision_mask) && (count++ < 128)) |
| 364 | timer_set(machine | |
| 364 | machine->scheduler().timer_set(machine | |
| 365 | 365 | } |
| 366 | 366 | |
| 367 | 367 | if (*BITMAP_ADDR16(motion_object_2_vid, sy, sx) != 0xff) |
| r10315 | r10316 | |
| 369 | 369 | /* check for background collision (M2CHAR) */ |
| 370 | 370 | if (*BITMAP_ADDR16(background_bitmap, org_2_y + sy, org_2_x + sx) != 0) |
| 371 | 371 | if ((collision_mask & 0x08) && (count++ < 128)) |
| 372 | timer_set(machine | |
| 372 | machine->scheduler().timer_set(machine | |
| 373 | 373 | } |
| 374 | 374 | } |
| 375 | 375 | } |
| r10315 | r10316 | |
|---|---|---|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | nb1413m3_busyflag = 0; |
| 231 | timer_set( | |
| 231 | machine->scheduler().timer_set( | |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 |
| r10315 | r10316 | |
|---|---|---|
| 79 | 79 | /* Pixel clock is 26.6666 MHz, we have 0x800 bytes, or 0x400 words |
| 80 | 80 | to copy from spriteram to the buffer. It seems safe to assume 1 |
| 81 | 81 | word can be copied per clock.*/ |
| 82 | | |
| 82 | | |
| 83 | 83 | } |
| 84 | 84 | // logerror("%04x: m92_spritecontrol_w %08x %08x\n",cpu_get_pc(space->cpu),offset,data); |
| 85 | 85 | } |
| r10315 | r10316 | |
|---|---|---|
| 504 | 504 | |
| 505 | 505 | memset(twin16_sprite_buffer,0xff,0x800*sizeof(UINT16)); |
| 506 | 506 | twin16_sprite_busy = 0; |
| 507 | twin16_sprite_timer = timer_alloc( | |
| 507 | twin16_sprite_timer = machine->scheduler().timer_alloc(FUNC( | |
| 508 | 508 | timer_adjust_oneshot(twin16_sprite_timer, attotime::never, 0); |
| 509 | 509 | |
| 510 | 510 | /* register for savestates */ |
| r10315 | r10316 | |
|---|---|---|
| 98 | 98 | state->dstbitmap = auto_bitmap_alloc(machine, DSTBITMAP_WIDTH, DSTBITMAP_HEIGHT, machine->primary_screen->format()); |
| 99 | 99 | |
| 100 | 100 | /* create a timer */ |
| 101 | state->blitter_timer = timer_alloc( | |
| 101 | state->blitter_timer = machine->scheduler().timer_alloc(FUNC( | |
| 102 | 102 | |
| 103 | 103 | /* register for saving */ |
| 104 | 104 | state_save_register_global_array(machine, state->blitter_color); |
| r10315 | r10316 | |
| 151 | 151 | memset(BITMAP_ADDR16(state->dstbitmap, y % DSTBITMAP_HEIGHT, 0), 0, DSTBITMAP_WIDTH * 2); |
| 152 | 152 | |
| 153 | 153 | /* signal an IRQ when done (timing is just a guess) */ |
| 154 | timer_set(machine | |
| 154 | machine->scheduler().timer_set(machine | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | |
| r10315 | r10316 | |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | /* signal an IRQ when done (timing is just a guess) */ |
| 209 | timer_set(machine | |
| 209 | machine->scheduler().timer_set(machine | |
| 210 | 210 | |
| 211 | 211 | /* these extra parameters are written but they are always zero, so I don't know what they do */ |
| 212 | 212 | if (state->blitter_xparam[8] != 0 || state->blitter_xparam[9] != 0 || state->blitter_xparam[10] != 0 || state->blitter_xparam[11] != 0 || |
| r10315 | r10316 | |
|---|---|---|
| 1762 | 1762 | |
| 1763 | 1763 | static STATE_POSTLOAD( cave_sprite_postload ) |
| 1764 | 1764 | { |
| 1765 | /* FIXME: this is probably not enough to restore sprites, but anyway saves do not | |
| 1766 | currently work due to pending timers hence it is hard to test what is missing */ | |
| 1765 | /* FIXME: this is probably not the best way to restore the sprites, | |
| 1766 | but it seems to work more or less (sprites may be wrong for one frame) */ | |
| 1767 | 1767 | cave_get_sprite_info(machine); |
| 1768 | 1768 | } |
| r10315 | r10316 | |
|---|---|---|
| 100 | 100 | memset(rpunch_bitmapram, 0xff, rpunch_bitmapram_size); |
| 101 | 101 | |
| 102 | 102 | /* reset the timer */ |
| 103 | crtc_timer = timer_alloc( | |
| 103 | crtc_timer = machine->scheduler().timer_alloc(FUNC(c | |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 |
| r10315 | r10316 | |
|---|---|---|
| 29 | 29 | state->tree0_bitmap = machine->primary_screen->alloc_compatible_bitmap(); |
| 30 | 30 | state->tree1_bitmap = machine->primary_screen->alloc_compatible_bitmap(); |
| 31 | 31 | |
| 32 | state->scanline_timer = timer_alloc( | |
| 32 | state->scanline_timer = machine->scheduler().timer_alloc(FUNC(ch | |
| 33 | 33 | timer_adjust_oneshot(state->scanline_timer, machine->primary_screen->time_until_pos(30), 30); |
| 34 | 34 | |
| 35 | 35 | state_save_register_global_pointer(machine, state->memory_devices, 4 * 0x800); |
| r10315 | r10316 | |
|---|---|---|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if (hit_line != 999 && hit_code != 999) |
| 127 | timer_set(machine | |
| 127 | machine->scheduler().timer_set(machine | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 |
| r0 | r10316 | |
|---|---|---|
| 1 | <?xml version="1.0"?> | |
| 2 | <mamelayout version="2"> | |
| 3 | <element name="digit"> | |
| 4 | <led7seg> | |
| 5 | <color red="1.0" green="0.0" blue="0.0" /> | |
| 6 | </led7seg> | |
| 7 | </element> | |
| 8 | <element name="matrixlamp"> | |
| 9 | <rect state ="0"> | |
| 10 | <bounds x="0" y="0" width="7" height="7" /> | |
| 11 | <color red="0.7" green="0.7" blue="0.7" /> | |
| 12 | </rect> | |
| 13 | <rect state ="1"> | |
| 14 | <bounds x="0" y="0" width="7" height="7" /> | |
| 15 | <color red="0.0" green="0.0" blue="1.0" /> | |
| 16 | </rect> | |
| 17 | <rect state ="2"> | |
| 18 | <bounds x="0" y="0" width="7" height="7" /> | |
| 19 | <color red="0.0" green="1.0" blue="0.0" /> | |
| 20 | </rect> | |
| 21 | </element> | |
| 22 | <element name="Steppers" defstate="96"> | |
| 23 | <text string="00" state="0"> | |
| 24 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 25 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 26 | </text> | |
| 27 | <text string="01" state="1"> | |
| 28 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 29 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 30 | </text> | |
| 31 | <text string="02" state="2"> | |
| 32 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 33 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 34 | </text> | |
| 35 | <text string="03" state="3"> | |
| 36 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 37 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 38 | </text> | |
| 39 | <text string="04" state="4"> | |
| 40 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 41 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 42 | </text> | |
| 43 | <text string="05" state="5"> | |
| 44 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 45 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 46 | </text> | |
| 47 | <text string="06" state="6"> | |
| 48 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 49 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 50 | </text> | |
| 51 | <text string="07" state="7"> | |
| 52 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 53 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 54 | </text> | |
| 55 | <text string="08" state="8"> | |
| 56 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 57 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 58 | </text> | |
| 59 | <text string="09" state="9"> | |
| 60 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 61 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 62 | </text> | |
| 63 | <text string="10" state="10"> | |
| 64 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 65 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 66 | </text> | |
| 67 | <text string="11" state="11"> | |
| 68 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 69 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 70 | </text> | |
| 71 | <text string="12" state="12"> | |
| 72 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 73 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 74 | </text> | |
| 75 | <text string="13" state="13"> | |
| 76 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 77 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 78 | </text> | |
| 79 | <text string="14" state="14"> | |
| 80 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 81 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 82 | </text> | |
| 83 | <text string="15" state="15"> | |
| 84 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 85 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 86 | </text> | |
| 87 | <text string="16" state="16"> | |
| 88 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 89 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 90 | </text> | |
| 91 | <text string="17" state="17"> | |
| 92 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 93 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 94 | </text> | |
| 95 | <text string="18" state="18"> | |
| 96 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 97 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 98 | </text> | |
| 99 | <text string="19" state="19"> | |
| 100 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 101 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 102 | </text> | |
| 103 | <text string="20" state="20"> | |
| 104 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 105 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 106 | </text> | |
| 107 | <text string="21" state="21"> | |
| 108 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 109 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 110 | </text> | |
| 111 | <text string="22" state="22"> | |
| 112 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 113 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 114 | </text> | |
| 115 | <text string="23" state="23"> | |
| 116 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 117 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 118 | </text> | |
| 119 | <text string="24" state="24"> | |
| 120 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 121 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 122 | </text> | |
| 123 | <text string="25" state="25"> | |
| 124 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 125 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 126 | </text> | |
| 127 | <text string="26" state="26"> | |
| 128 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 129 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 130 | </text> | |
| 131 | <text string="27" state="27"> | |
| 132 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 133 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 134 | </text> | |
| 135 | <text string="28" state="28"> | |
| 136 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 137 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 138 | </text> | |
| 139 | <text string="29" state="29"> | |
| 140 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 141 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 142 | </text> | |
| 143 | <text string="30" state="30"> | |
| 144 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 145 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 146 | </text> | |
| 147 | <text string="31" state="31"> | |
| 148 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 149 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 150 | </text> | |
| 151 | <text string="32" state="32"> | |
| 152 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 153 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 154 | </text> | |
| 155 | <text string="33" state="33"> | |
| 156 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 157 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 158 | </text> | |
| 159 | <text string="34" state="34"> | |
| 160 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 161 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 162 | </text> | |
| 163 | <text string="35" state="35"> | |
| 164 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 165 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 166 | </text> | |
| 167 | <text string="36" state="36"> | |
| 168 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 169 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 170 | </text> | |
| 171 | <text string="37" state="37"> | |
| 172 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 173 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 174 | </text> | |
| 175 | <text string="38" state="38"> | |
| 176 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 177 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 178 | </text> | |
| 179 | <text string="39" state="39"> | |
| 180 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 181 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 182 | </text> | |
| 183 | <text string="40" state="40"> | |
| 184 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 185 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 186 | </text> | |
| 187 | <text string="41" state="41"> | |
| 188 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 189 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 190 | </text> | |
| 191 | <text string="42" state="42"> | |
| 192 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 193 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 194 | </text> | |
| 195 | <text string="43" state="43"> | |
| 196 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 197 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 198 | </text> | |
| 199 | <text string="44" state="44"> | |
| 200 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 201 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 202 | </text> | |
| 203 | <text string="45" state="45"> | |
| 204 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 205 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 206 | </text> | |
| 207 | <text string="46" state="46"> | |
| 208 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 209 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 210 | </text> | |
| 211 | <text string="47" state="47"> | |
| 212 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 213 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 214 | </text> | |
| 215 | <text string="48" state="48"> | |
| 216 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 217 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 218 | </text> | |
| 219 | <text string="49" state="49"> | |
| 220 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 221 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 222 | </text> | |
| 223 | <text string="50" state="50"> | |
| 224 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 225 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 226 | </text> | |
| 227 | <text string="51" state="51"> | |
| 228 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 229 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 230 | </text> | |
| 231 | <text string="52" state="52"> | |
| 232 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 233 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 234 | </text> | |
| 235 | <text string="53" state="53"> | |
| 236 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 237 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 238 | </text> | |
| 239 | <text string="54" state="54"> | |
| 240 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 241 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 242 | </text> | |
| 243 | <text string="55" state="55"> | |
| 244 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 245 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 246 | </text> | |
| 247 | <text string="56" state="56"> | |
| 248 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 249 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 250 | </text> | |
| 251 | <text string="57" state="57"> | |
| 252 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 253 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 254 | </text> | |
| 255 | <text string="58" state="58"> | |
| 256 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 257 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 258 | </text> | |
| 259 | <text string="59" state="59"> | |
| 260 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 261 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 262 | </text> | |
| 263 | <text string="60" state="60"> | |
| 264 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 265 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 266 | </text> | |
| 267 | <text string="61" state="61"> | |
| 268 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 269 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 270 | </text> | |
| 271 | <text string="62" state="62"> | |
| 272 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 273 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 274 | </text> | |
| 275 | <text string="63" state="63"> | |
| 276 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 277 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 278 | </text> | |
| 279 | <text string="64" state="64"> | |
| 280 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 281 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 282 | </text> | |
| 283 | <text string="65" state="65"> | |
| 284 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 285 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 286 | </text> | |
| 287 | <text string="66" state="66"> | |
| 288 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 289 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 290 | </text> | |
| 291 | <text string="67" state="67"> | |
| 292 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 293 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 294 | </text> | |
| 295 | <text string="68" state="68"> | |
| 296 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 297 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 298 | </text> | |
| 299 | <text string="69" state="69"> | |
| 300 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 301 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 302 | </text> | |
| 303 | <text string="70" state="70"> | |
| 304 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 305 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 306 | </text> | |
| 307 | <text string="71" state="71"> | |
| 308 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 309 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 310 | </text> | |
| 311 | <text string="72" state="72"> | |
| 312 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 313 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 314 | </text> | |
| 315 | <text string="73" state="73"> | |
| 316 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 317 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 318 | </text> | |
| 319 | <text string="74" state="74"> | |
| 320 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 321 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 322 | </text> | |
| 323 | <text string="75" state="75"> | |
| 324 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 325 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 326 | </text> | |
| 327 | <text string="76" state="76"> | |
| 328 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 329 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 330 | </text> | |
| 331 | <text string="77" state="77"> | |
| 332 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 333 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 334 | </text> | |
| 335 | <text string="78" state="78"> | |
| 336 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 337 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 338 | </text> | |
| 339 | <text string="79" state="79"> | |
| 340 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 341 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 342 | </text> | |
| 343 | <text string="80" state="80"> | |
| 344 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 345 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 346 | </text> | |
| 347 | <text string="81" state="81"> | |
| 348 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 349 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 350 | </text> | |
| 351 | <text string="82" state="82"> | |
| 352 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 353 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 354 | </text> | |
| 355 | <text string="83" state="83"> | |
| 356 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 357 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 358 | </text> | |
| 359 | <text string="84" state="84"> | |
| 360 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 361 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 362 | </text> | |
| 363 | <text string="85" state="85"> | |
| 364 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 365 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 366 | </text> | |
| 367 | <text string="86" state="86"> | |
| 368 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 369 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 370 | </text> | |
| 371 | <text string="87" state="87"> | |
| 372 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 373 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 374 | </text> | |
| 375 | <text string="88" state="88"> | |
| 376 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 377 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 378 | </text> | |
| 379 | <text string="89" state="89"> | |
| 380 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 381 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 382 | </text> | |
| 383 | <text string="90" state="90"> | |
| 384 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 385 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 386 | </text> | |
| 387 | <text string="91" state="91"> | |
| 388 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 389 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 390 | </text> | |
| 391 | <text string="92" state="92"> | |
| 392 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 393 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 394 | </text> | |
| 395 | <text string="93" state="93"> | |
| 396 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 397 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 398 | </text> | |
| 399 | <text string="94" state="94"> | |
| 400 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 401 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 402 | </text> | |
| 403 | <text string="95" state="95"> | |
| 404 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 405 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 406 | </text> | |
| 407 | </element> | |
| 408 | <element name="vfd0"> | |
| 409 | <led16segsc> | |
| 410 | <color red="0" green="0.6" blue="1.0" /> | |
| 411 | </led16segsc> | |
| 412 | </element> | |
| 413 | ||
| 414 | <view name="AWP Simulated Video (No Artwork)"> | |
| 415 | <backdrop name="reel1" element="Steppers" state="0"> | |
| 416 | <bounds x="10" y="300" width="50" height="50"/> | |
| 417 | </backdrop> | |
| 418 | <backdrop name="reel2" element="Steppers" state="0"> | |
| 419 | <bounds x="60" y="300" width="50" height="50"/> | |
| 420 | </backdrop> | |
| 421 | <backdrop name="reel3" element="Steppers" state="0"> | |
| 422 | <bounds x="110" y="300" width="50" height="50"/> | |
| 423 | </backdrop> | |
| 424 | <backdrop name="reel4" element="Steppers" state="0"> | |
| 425 | <bounds x="160" y="300" width="50" height="50"/> | |
| 426 | </backdrop> | |
| 427 | <backdrop name="reel5" element="Steppers" state="0"> | |
| 428 | <bounds x="220" y="300" width="50" height="50"/> | |
| 429 | </backdrop> | |
| 430 | <backdrop name="reel6" element="Steppers" state="0"> | |
| 431 | <bounds x="280" y="300" width="50" height="50"/> | |
| 432 | </backdrop> | |
| 433 | <backdrop name="lamp0" element="matrixlamp" state="0"> | |
| 434 | <bounds x="0" y="0" width="7" height="7"/> | |
| 435 | </backdrop> | |
| 436 | <backdrop name="lamp1" element="matrixlamp" state="0"> | |
| 437 | <bounds x="0" y="8" width="7" height="7"/> | |
| 438 | </backdrop> | |
| 439 | <backdrop name="lamp2" element="matrixlamp" state="0"> | |
| 440 | <bounds x="0" y="16" width="7" height="7"/> | |
| 441 | </backdrop> | |
| 442 | <backdrop name="lamp3" element="matrixlamp" state="0"> | |
| 443 | <bounds x="0" y="24" width="7" height="7"/> | |
| 444 | </backdrop> | |
| 445 | <backdrop name="lamp4" element="matrixlamp" state="0"> | |
| 446 | <bounds x="0" y="32" width="7" height="7"/> | |
| 447 | </backdrop> | |
| 448 | <backdrop name="lamp5" element="matrixlamp" state="0"> | |
| 449 | <bounds x="0" y="40" width="7" height="7"/> | |
| 450 | </backdrop> | |
| 451 | <backdrop name="lamp6" element="matrixlamp" state="0"> | |
| 452 | <bounds x="0" y="48" width="7" height="7"/> | |
| 453 | </backdrop> | |
| 454 | <backdrop name="lamp7" element="matrixlamp" state="0"> | |
| 455 | <bounds x="0" y="56" width="7" height="7"/> | |
| 456 | </backdrop> | |
| 457 | <backdrop name="lamp8" element="matrixlamp" state="0"> | |
| 458 | <bounds x="8" y="0" width="7" height="7"/> | |
| 459 | </backdrop> | |
| 460 | <backdrop name="lamp9" element="matrixlamp" state="0"> | |
| 461 | <bounds x="8" y="8" width="7" height="7"/> | |
| 462 | </backdrop> | |
| 463 | <backdrop name="lamp10" element="matrixlamp" state="0"> | |
| 464 | <bounds x="8" y="16" width="7" height="7"/> | |
| 465 | </backdrop> | |
| 466 | <backdrop name="lamp11" element="matrixlamp" state="0"> | |
| 467 | <bounds x="8" y="24" width="7" height="7"/> | |
| 468 | </backdrop> | |
| 469 | <backdrop name="lamp12" element="matrixlamp" state="0"> | |
| 470 | <bounds x="8" y="32" width="7" height="7"/> | |
| 471 | </backdrop> | |
| 472 | <backdrop name="lamp13" element="matrixlamp" state="0"> | |
| 473 | <bounds x="8" y="40" width="7" height="7"/> | |
| 474 | </backdrop> | |
| 475 | <backdrop name="lamp14" element="matrixlamp" state="0"> | |
| 476 | <bounds x="8" y="48" width="7" height="7"/> | |
| 477 | </backdrop> | |
| 478 | <backdrop name="lamp15" element="matrixlamp" state="0"> | |
| 479 | <bounds x="8" y="56" width="7" height="7"/> | |
| 480 | </backdrop> | |
| 481 | <backdrop name="lamp16" element="matrixlamp" state="0"> | |
| 482 | <bounds x="16" y="0" width="7" height="7"/> | |
| 483 | </backdrop> | |
| 484 | <backdrop name="lamp17" element="matrixlamp" state="0"> | |
| 485 | <bounds x="16" y="8" width="7" height="7"/> | |
| 486 | </backdrop> | |
| 487 | <backdrop name="lamp18" element="matrixlamp" state="0"> | |
| 488 | <bounds x="16" y="16" width="7" height="7"/> | |
| 489 | </backdrop> | |
| 490 | <backdrop name="lamp19" element="matrixlamp" state="0"> | |
| 491 | <bounds x="16" y="24" width="7" height="7"/> | |
| 492 | </backdrop> | |
| 493 | <backdrop name="lamp20" element="matrixlamp" state="0"> | |
| 494 | <bounds x="16" y="32" width="7" height="7"/> | |
| 495 | </backdrop> | |
| 496 | <backdrop name="lamp21" element="matrixlamp" state="0"> | |
| 497 | <bounds x="16" y="40" width="7" height="7"/> | |
| 498 | </backdrop> | |
| 499 | <backdrop name="lamp22" element="matrixlamp" state="0"> | |
| 500 | <bounds x="16" y="48" width="7" height="7"/> | |
| 501 | </backdrop> | |
| 502 | <backdrop name="lamp23" element="matrixlamp" state="0"> | |
| 503 | <bounds x="16" y="56" width="7" height="7"/> | |
| 504 | </backdrop> | |
| 505 | <backdrop name="lamp24" element="matrixlamp" state="0"> | |
| 506 | <bounds x="24" y="0" width="7" height="7"/> | |
| 507 | </backdrop> | |
| 508 | <backdrop name="lamp25" element="matrixlamp" state="0"> | |
| 509 | <bounds x="24" y="8" width="7" height="7"/> | |
| 510 | </backdrop> | |
| 511 | <backdrop name="lamp26" element="matrixlamp" state="0"> | |
| 512 | <bounds x="24" y="16" width="7" height="7"/> | |
| 513 | </backdrop> | |
| 514 | <backdrop name="lamp27" element="matrixlamp" state="0"> | |
| 515 | <bounds x="24" y="24" width="7" height="7"/> | |
| 516 | </backdrop> | |
| 517 | <backdrop name="lamp28" element="matrixlamp" state="0"> | |
| 518 | <bounds x="24" y="32" width="7" height="7"/> | |
| 519 | </backdrop> | |
| 520 | <backdrop name="lamp29" element="matrixlamp" state="0"> | |
| 521 | <bounds x="24" y="40" width="7" height="7"/> | |
| 522 | </backdrop> | |
| 523 | <backdrop name="lamp30" element="matrixlamp" state="0"> | |
| 524 | <bounds x="24" y="48" width="7" height="7"/> | |
| 525 | </backdrop> | |
| 526 | <backdrop name="lamp31" element="matrixlamp" state="0"> | |
| 527 | <bounds x="24" y="56" width="7" height="7"/> | |
| 528 | </backdrop> | |
| 529 | <backdrop name="lamp32" element="matrixlamp" state="0"> | |
| 530 | <bounds x="32" y="0" width="7" height="7"/> | |
| 531 | </backdrop> | |
| 532 | <backdrop name="lamp33" element="matrixlamp" state="0"> | |
| 533 | <bounds x="32" y="8" width="7" height="7"/> | |
| 534 | </backdrop> | |
| 535 | <backdrop name="lamp34" element="matrixlamp" state="0"> | |
| 536 | <bounds x="32" y="16" width="7" height="7"/> | |
| 537 | </backdrop> | |
| 538 | <backdrop name="lamp35" element="matrixlamp" state="0"> | |
| 539 | <bounds x="32" y="24" width="7" height="7"/> | |
| 540 | </backdrop> | |
| 541 | <backdrop name="lamp36" element="matrixlamp" state="0"> | |
| 542 | <bounds x="32" y="32" width="7" height="7"/> | |
| 543 | </backdrop> | |
| 544 | <backdrop name="lamp37" element="matrixlamp" state="0"> | |
| 545 | <bounds x="32" y="40" width="7" height="7"/> | |
| 546 | </backdrop> | |
| 547 | <backdrop name="lamp38" element="matrixlamp" state="0"> | |
| 548 | <bounds x="32" y="48" width="7" height="7"/> | |
| 549 | </backdrop> | |
| 550 | <backdrop name="lamp39" element="matrixlamp" state="0"> | |
| 551 | <bounds x="32" y="56" width="7" height="7"/> | |
| 552 | </backdrop> | |
| 553 | <backdrop name="lamp40" element="matrixlamp" state="0"> | |
| 554 | <bounds x="40" y="0" width="7" height="7"/> | |
| 555 | </backdrop> | |
| 556 | <backdrop name="lamp41" element="matrixlamp" state="0"> | |
| 557 | <bounds x="40" y="8" width="7" height="7"/> | |
| 558 | </backdrop> | |
| 559 | <backdrop name="lamp42" element="matrixlamp" state="0"> | |
| 560 | <bounds x="40" y="16" width="7" height="7"/> | |
| 561 | </backdrop> | |
| 562 | <backdrop name="lamp43" element="matrixlamp" state="0"> | |
| 563 | <bounds x="40" y="24" width="7" height="7"/> | |
| 564 | </backdrop> | |
| 565 | <backdrop name="lamp44" element="matrixlamp" state="0"> | |
| 566 | <bounds x="40" y="32" width="7" height="7"/> | |
| 567 | </backdrop> | |
| 568 | <backdrop name="lamp45" element="matrixlamp" state="0"> | |
| 569 | <bounds x="40" y="40" width="7" height="7"/> | |
| 570 | </backdrop> | |
| 571 | <backdrop name="lamp46" element="matrixlamp" state="0"> | |
| 572 | <bounds x="40" y="48" width="7" height="7"/> | |
| 573 | </backdrop> | |
| 574 | <backdrop name="lamp47" element="matrixlamp" state="0"> | |
| 575 | <bounds x="40" y="56" width="7" height="7"/> | |
| 576 | </backdrop> | |
| 577 | <backdrop name="lamp48" element="matrixlamp" state="0"> | |
| 578 | <bounds x="48" y="0" width="7" height="7"/> | |
| 579 | </backdrop> | |
| 580 | <backdrop name="lamp49" element="matrixlamp" state="0"> | |
| 581 | <bounds x="48" y="8" width="7" height="7"/> | |
| 582 | </backdrop> | |
| 583 | <backdrop name="lamp50" element="matrixlamp" state="0"> | |
| 584 | <bounds x="48" y="16" width="7" height="7"/> | |
| 585 | </backdrop> | |
| 586 | <backdrop name="lamp51" element="matrixlamp" state="0"> | |
| 587 | <bounds x="48" y="24" width="7" height="7"/> | |
| 588 | </backdrop> | |
| 589 | <backdrop name="lamp52" element="matrixlamp" state="0"> | |
| 590 | <bounds x="48" y="32" width="7" height="7"/> | |
| 591 | </backdrop> | |
| 592 | <backdrop name="lamp53" element="matrixlamp" state="0"> | |
| 593 | <bounds x="48" y="40" width="7" height="7"/> | |
| 594 | </backdrop> | |
| 595 | <backdrop name="lamp54" element="matrixlamp" state="0"> | |
| 596 | <bounds x="48" y="48" width="7" height="7"/> | |
| 597 | </backdrop> | |
| 598 | <backdrop name="lamp55" element="matrixlamp" state="0"> | |
| 599 | <bounds x="48" y="56" width="7" height="7"/> | |
| 600 | </backdrop> | |
| 601 | <backdrop name="lamp56" element="matrixlamp" state="0"> | |
| 602 | <bounds x="56" y="0" width="7" height="7"/> | |
| 603 | </backdrop> | |
| 604 | <backdrop name="lamp57" element="matrixlamp" state="0"> | |
| 605 | <bounds x="56" y="8" width="7" height="7"/> | |
| 606 | </backdrop> | |
| 607 | <backdrop name="lamp58" element="matrixlamp" state="0"> | |
| 608 | <bounds x="56" y="16" width="7" height="7"/> | |
| 609 | </backdrop> | |
| 610 | <backdrop name="lamp59" element="matrixlamp" state="0"> | |
| 611 | <bounds x="56" y="24" width="7" height="7"/> | |
| 612 | </backdrop> | |
| 613 | <backdrop name="lamp60" element="matrixlamp" state="0"> | |
| 614 | <bounds x="56" y="32" width="7" height="7"/> | |
| 615 | </backdrop> | |
| 616 | <backdrop name="lamp61" element="matrixlamp" state="0"> | |
| 617 | <bounds x="56" y="40" width="7" height="7"/> | |
| 618 | </backdrop> | |
| 619 | <backdrop name="lamp62" element="matrixlamp" state="0"> | |
| 620 | <bounds x="56" y="48" width="7" height="7"/> | |
| 621 | </backdrop> | |
| 622 | <backdrop name="lamp63" element="matrixlamp" state="0"> | |
| 623 | <bounds x="56" y="56" width="7" height="7"/> | |
| 624 | </backdrop> | |
| 625 | <backdrop name="lamp64" element="matrixlamp" state="0"> | |
| 626 | <bounds x="64" y="0" width="7" height="7"/> | |
| 627 | </backdrop> | |
| 628 | <backdrop name="lamp65" element="matrixlamp" state="0"> | |
| 629 | <bounds x="64" y="8" width="7" height="7"/> | |
| 630 | </backdrop> | |
| 631 | <backdrop name="lamp66" element="matrixlamp" state="0"> | |
| 632 | <bounds x="64" y="16" width="7" height="7"/> | |
| 633 | </backdrop> | |
| 634 | <backdrop name="lamp67" element="matrixlamp" state="0"> | |
| 635 | <bounds x="64" y="24" width="7" height="7"/> | |
| 636 | </backdrop> | |
| 637 | <backdrop name="lamp68" element="matrixlamp" state="0"> | |
| 638 | <bounds x="64" y="32" width="7" height="7"/> | |
| 639 | </backdrop> | |
| 640 | <backdrop name="lamp69" element="matrixlamp" state="0"> | |
| 641 | <bounds x="64" y="40" width="7" height="7"/> | |
| 642 | </backdrop> | |
| 643 | <backdrop name="lamp70" element="matrixlamp" state="0"> | |
| 644 | <bounds x="64" y="48" width="7" height="7"/> | |
| 645 | </backdrop> | |
| 646 | <backdrop name="lamp71" element="matrixlamp" state="0"> | |
| 647 | <bounds x="64" y="56" width="7" height="7"/> | |
| 648 | </backdrop> | |
| 649 | <backdrop name="lamp72" element="matrixlamp" state="0"> | |
| 650 | <bounds x="72" y="0" width="7" height="7"/> | |
| 651 | </backdrop> | |
| 652 | <backdrop name="lamp73" element="matrixlamp" state="0"> | |
| 653 | <bounds x="72" y="8" width="7" height="7"/> | |
| 654 | </backdrop> | |
| 655 | <backdrop name="lamp74" element="matrixlamp" state="0"> | |
| 656 | <bounds x="72" y="16" width="7" height="7"/> | |
| 657 | </backdrop> | |
| 658 | <backdrop name="lamp75" element="matrixlamp" state="0"> | |
| 659 | <bounds x="72" y="24" width="7" height="7"/> | |
| 660 | </backdrop> | |
| 661 | <backdrop name="lamp76" element="matrixlamp" state="0"> | |
| 662 | <bounds x="72" y="32" width="7" height="7"/> | |
| 663 | </backdrop> | |
| 664 | <backdrop name="lamp77" element="matrixlamp" state="0"> | |
| 665 | <bounds x="72" y="40" width="7" height="7"/> | |
| 666 | </backdrop> | |
| 667 | <backdrop name="lamp78" element="matrixlamp" state="0"> | |
| 668 | <bounds x="72" y="48" width="7" height="7"/> | |
| 669 | </backdrop> | |
| 670 | <backdrop name="lamp79" element="matrixlamp" state="0"> | |
| 671 | <bounds x="72" y="56" width="7" height="7"/> | |
| 672 | </backdrop> | |
| 673 | <backdrop name="lamp80" element="matrixlamp" state="0"> | |
| 674 | <bounds x="80" y="0" width="7" height="7"/> | |
| 675 | </backdrop> | |
| 676 | <backdrop name="lamp81" element="matrixlamp" state="0"> | |
| 677 | <bounds x="80" y="8" width="7" height="7"/> | |
| 678 | </backdrop> | |
| 679 | <backdrop name="lamp82" element="matrixlamp" state="0"> | |
| 680 | <bounds x="80" y="16" width="7" height="7"/> | |
| 681 | </backdrop> | |
| 682 | <backdrop name="lamp83" element="matrixlamp" state="0"> | |
| 683 | <bounds x="80" y="24" width="7" height="7"/> | |
| 684 | </backdrop> | |
| 685 | <backdrop name="lamp84" element="matrixlamp" state="0"> | |
| 686 | <bounds x="80" y="32" width="7" height="7"/> | |
| 687 | </backdrop> | |
| 688 | <backdrop name="lamp85" element="matrixlamp" state="0"> | |
| 689 | <bounds x="80" y="40" width="7" height="7"/> | |
| 690 | </backdrop> | |
| 691 | <backdrop name="lamp86" element="matrixlamp" state="0"> | |
| 692 | <bounds x="80" y="48" width="7" height="7"/> | |
| 693 | </backdrop> | |
| 694 | <backdrop name="lamp87" element="matrixlamp" state="0"> | |
| 695 | <bounds x="80" y="56" width="7" height="7"/> | |
| 696 | </backdrop> | |
| 697 | <backdrop name="lamp88" element="matrixlamp" state="0"> | |
| 698 | <bounds x="88" y="0" width="7" height="7"/> | |
| 699 | </backdrop> | |
| 700 | <backdrop name="lamp89" element="matrixlamp" state="0"> | |
| 701 | <bounds x="88" y="8" width="7" height="7"/> | |
| 702 | </backdrop> | |
| 703 | <backdrop name="lamp90" element="matrixlamp" state="0"> | |
| 704 | <bounds x="88" y="16" width="7" height="7"/> | |
| 705 | </backdrop> | |
| 706 | <backdrop name="lamp91" element="matrixlamp" state="0"> | |
| 707 | <bounds x="88" y="24" width="7" height="7"/> | |
| 708 | </backdrop> | |
| 709 | <backdrop name="lamp92" element="matrixlamp" state="0"> | |
| 710 | <bounds x="88" y="32" width="7" height="7"/> | |
| 711 | </backdrop> | |
| 712 | <backdrop name="lamp93" element="matrixlamp" state="0"> | |
| 713 | <bounds x="88" y="40" width="7" height="7"/> | |
| 714 | </backdrop> | |
| 715 | <backdrop name="lamp94" element="matrixlamp" state="0"> | |
| 716 | <bounds x="88" y="48" width="7" height="7"/> | |
| 717 | </backdrop> | |
| 718 | <backdrop name="lamp95" element="matrixlamp" state="0"> | |
| 719 | <bounds x="88" y="56" width="7" height="7"/> | |
| 720 | </backdrop> | |
| 721 | <backdrop name="lamp96" element="matrixlamp" state="0"> | |
| 722 | <bounds x="96" y="0" width="7" height="7"/> | |
| 723 | </backdrop> | |
| 724 | <backdrop name="lamp97" element="matrixlamp" state="0"> | |
| 725 | <bounds x="96" y="8" width="7" height="7"/> | |
| 726 | </backdrop> | |
| 727 | <backdrop name="lamp98" element="matrixlamp" state="0"> | |
| 728 | <bounds x="96" y="16" width="7" height="7"/> | |
| 729 | </backdrop> | |
| 730 | <backdrop name="lamp99" element="matrixlamp" state="0"> | |
| 731 | <bounds x="96" y="24" width="7" height="7"/> | |
| 732 | </backdrop> | |
| 733 | <backdrop name="lamp100" element="matrixlamp" state="0"> | |
| 734 | <bounds x="96" y="32" width="7" height="7"/> | |
| 735 | </backdrop> | |
| 736 | <backdrop name="lamp101" element="matrixlamp" state="0"> | |
| 737 | <bounds x="96" y="40" width="7" height="7"/> | |
| 738 | </backdrop> | |
| 739 | <backdrop name="lamp102" element="matrixlamp" state="0"> | |
| 740 | <bounds x="96" y="48" width="7" height="7"/> | |
| 741 | </backdrop> | |
| 742 | <backdrop name="lamp103" element="matrixlamp" state="0"> | |
| 743 | <bounds x="96" y="56" width="7" height="7"/> | |
| 744 | </backdrop> | |
| 745 | <backdrop name="lamp104" element="matrixlamp" state="0"> | |
| 746 | <bounds x="104" y="0" width="7" height="7"/> | |
| 747 | </backdrop> | |
| 748 | <backdrop name="lamp105" element="matrixlamp" state="0"> | |
| 749 | <bounds x="104" y="8" width="7" height="7"/> | |
| 750 | </backdrop> | |
| 751 | <backdrop name="lamp106" element="matrixlamp" state="0"> | |
| 752 | <bounds x="104" y="16" width="7" height="7"/> | |
| 753 | </backdrop> | |
| 754 | <backdrop name="lamp107" element="matrixlamp" state="0"> | |
| 755 | <bounds x="104" y="24" width="7" height="7"/> | |
| 756 | </backdrop> | |
| 757 | <backdrop name="lamp108" element="matrixlamp" state="0"> | |
| 758 | <bounds x="104" y="32" width="7" height="7"/> | |
| 759 | </backdrop> | |
| 760 | <backdrop name="lamp109" element="matrixlamp" state="0"> | |
| 761 | <bounds x="104" y="40" width="7" height="7"/> | |
| 762 | </backdrop> | |
| 763 | <backdrop name="lamp110" element="matrixlamp" state="0"> | |
| 764 | <bounds x="104" y="48" width="7" height="7"/> | |
| 765 | </backdrop> | |
| 766 | <backdrop name="lamp111" element="matrixlamp" state="0"> | |
| 767 | <bounds x="104" y="56" width="7" height="7"/> | |
| 768 | </backdrop> | |
| 769 | <backdrop name="lamp112" element="matrixlamp" state="0"> | |
| 770 | <bounds x="112" y="0" width="7" height="7"/> | |
| 771 | </backdrop> | |
| 772 | <backdrop name="lamp113" element="matrixlamp" state="0"> | |
| 773 | <bounds x="112" y="8" width="7" height="7"/> | |
| 774 | </backdrop> | |
| 775 | <backdrop name="lamp114" element="matrixlamp" state="0"> | |
| 776 | <bounds x="112" y="16" width="7" height="7"/> | |
| 777 | </backdrop> | |
| 778 | <backdrop name="lamp115" element="matrixlamp" state="0"> | |
| 779 | <bounds x="112" y="24" width="7" height="7"/> | |
| 780 | </backdrop> | |
| 781 | <backdrop name="lamp116" element="matrixlamp" state="0"> | |
| 782 | <bounds x="112" y="32" width="7" height="7"/> | |
| 783 | </backdrop> | |
| 784 | <backdrop name="lamp117" element="matrixlamp" state="0"> | |
| 785 | <bounds x="112" y="40" width="7" height="7"/> | |
| 786 | </backdrop> | |
| 787 | <backdrop name="lamp118" element="matrixlamp" state="0"> | |
| 788 | <bounds x="112" y="48" width="7" height="7"/> | |
| 789 | </backdrop> | |
| 790 | <backdrop name="lamp119" element="matrixlamp" state="0"> | |
| 791 | <bounds x="112" y="56" width="7" height="7"/> | |
| 792 | </backdrop> | |
| 793 | <backdrop name="lamp120" element="matrixlamp" state="0"> | |
| 794 | <bounds x="120" y="0" width="7" height="7"/> | |
| 795 | </backdrop> | |
| 796 | <backdrop name="lamp121" element="matrixlamp" state="0"> | |
| 797 | <bounds x="120" y="8" width="7" height="7"/> | |
| 798 | </backdrop> | |
| 799 | <backdrop name="lamp122" element="matrixlamp" state="0"> | |
| 800 | <bounds x="120" y="16" width="7" height="7"/> | |
| 801 | </backdrop> | |
| 802 | <backdrop name="lamp123" element="matrixlamp" state="0"> | |
| 803 | <bounds x="120" y="24" width="7" height="7"/> | |
| 804 | </backdrop> | |
| 805 | <backdrop name="lamp124" element="matrixlamp" state="0"> | |
| 806 | <bounds x="120" y="32" width="7" height="7"/> | |
| 807 | </backdrop> | |
| 808 | <backdrop name="lamp125" element="matrixlamp" state="0"> | |
| 809 | <bounds x="120" y="40" width="7" height="7"/> | |
| 810 | </backdrop> | |
| 811 | <backdrop name="lamp126" element="matrixlamp" state="0"> | |
| 812 | <bounds x="120" y="48" width="7" height="7"/> | |
| 813 | </backdrop> | |
| 814 | <backdrop name="lamp127" element="matrixlamp" state="0"> | |
| 815 | <bounds x="120" y="56" width="7" height="7"/> | |
| 816 | </backdrop> | |
| 817 | <backdrop name="lamp128" element="matrixlamp" state="0"> | |
| 818 | <bounds x="128" y="0" width="7" height="7"/> | |
| 819 | </backdrop> | |
| 820 | <backdrop name="lamp129" element="matrixlamp" state="0"> | |
| 821 | <bounds x="128" y="8" width="7" height="7"/> | |
| 822 | </backdrop> | |
| 823 | <backdrop name="lamp130" element="matrixlamp" state="0"> | |
| 824 | <bounds x="128" y="16" width="7" height="7"/> | |
| 825 | </backdrop> | |
| 826 | <backdrop name="lamp131" element="matrixlamp" state="0"> | |
| 827 | <bounds x="128" y="24" width="7" height="7"/> | |
| 828 | </backdrop> | |
| 829 | <backdrop name="lamp132" element="matrixlamp" state="0"> | |
| 830 | <bounds x="128" y="32" width="7" height="7"/> | |
| 831 | </backdrop> | |
| 832 | <backdrop name="lamp133" element="matrixlamp" state="0"> | |
| 833 | <bounds x="128" y="40" width="7" height="7"/> | |
| 834 | </backdrop> | |
| 835 | <backdrop name="lamp134" element="matrixlamp" state="0"> | |
| 836 | <bounds x="128" y="48" width="7" height="7"/> | |
| 837 | </backdrop> | |
| 838 | <backdrop name="lamp135" element="matrixlamp" state="0"> | |
| 839 | <bounds x="128" y="56" width="7" height="7"/> | |
| 840 | </backdrop> | |
| 841 | <backdrop name="lamp136" element="matrixlamp" state="0"> | |
| 842 | <bounds x="136" y="0" width="7" height="7"/> | |
| 843 | </backdrop> | |
| 844 | <backdrop name="lamp137" element="matrixlamp" state="0"> | |
| 845 | <bounds x="136" y="8" width="7" height="7"/> | |
| 846 | </backdrop> | |
| 847 | <backdrop name="lamp138" element="matrixlamp" state="0"> | |
| 848 | <bounds x="136" y="16" width="7" height="7"/> | |
| 849 | </backdrop> | |
| 850 | <backdrop name="lamp139" element="matrixlamp" state="0"> | |
| 851 | <bounds x="136" y="24" width="7" height="7"/> | |
| 852 | </backdrop> | |
| 853 | <backdrop name="lamp140" element="matrixlamp" state="0"> | |
| 854 | <bounds x="136" y="32" width="7" height="7"/> | |
| 855 | </backdrop> | |
| 856 | <backdrop name="lamp141" element="matrixlamp" state="0"> | |
| 857 | <bounds x="136" y="40" width="7" height="7"/> | |
| 858 | </backdrop> | |
| 859 | <backdrop name="lamp142" element="matrixlamp" state="0"> | |
| 860 | <bounds x="136" y="48" width="7" height="7"/> | |
| 861 | </backdrop> | |
| 862 | <backdrop name="lamp143" element="matrixlamp" state="0"> | |
| 863 | <bounds x="136" y="56" width="7" height="7"/> | |
| 864 | </backdrop> | |
| 865 | <backdrop name="lamp144" element="matrixlamp" state="0"> | |
| 866 | <bounds x="144" y="0" width="7" height="7"/> | |
| 867 | </backdrop> | |
| 868 | <backdrop name="lamp145" element="matrixlamp" state="0"> | |
| 869 | <bounds x="144" y="8" width="7" height="7"/> | |
| 870 | </backdrop> | |
| 871 | <backdrop name="lamp146" element="matrixlamp" state="0"> | |
| 872 | <bounds x="144" y="16" width="7" height="7"/> | |
| 873 | </backdrop> | |
| 874 | <backdrop name="lamp147" element="matrixlamp" state="0"> | |
| 875 | <bounds x="144" y="24" width="7" height="7"/> | |
| 876 | </backdrop> | |
| 877 | <backdrop name="lamp148" element="matrixlamp" state="0"> | |
| 878 | <bounds x="144" y="32" width="7" height="7"/> | |
| 879 | </backdrop> | |
| 880 | <backdrop name="lamp149" element="matrixlamp" state="0"> | |
| 881 | <bounds x="144" y="40" width="7" height="7"/> | |
| 882 | </backdrop> | |
| 883 | <backdrop name="lamp150" element="matrixlamp" state="0"> | |
| 884 | <bounds x="144" y="48" width="7" height="7"/> | |
| 885 | </backdrop> | |
| 886 | <backdrop name="lamp151" element="matrixlamp" state="0"> | |
| 887 | <bounds x="144" y="56" width="7" height="7"/> | |
| 888 | </backdrop> | |
| 889 | <backdrop name="lamp152" element="matrixlamp" state="0"> | |
| 890 | <bounds x="152" y="0" width="7" height="7"/> | |
| 891 | </backdrop> | |
| 892 | <backdrop name="lamp153" element="matrixlamp" state="0"> | |
| 893 | <bounds x="152" y="8" width="7" height="7"/> | |
| 894 | </backdrop> | |
| 895 | <backdrop name="lamp154" element="matrixlamp" state="0"> | |
| 896 | <bounds x="152" y="16" width="7" height="7"/> | |
| 897 | </backdrop> | |
| 898 | <backdrop name="lamp155" element="matrixlamp" state="0"> | |
| 899 | <bounds x="152" y="24" width="7" height="7"/> | |
| 900 | </backdrop> | |
| 901 | <backdrop name="lamp156" element="matrixlamp" state="0"> | |
| 902 | <bounds x="152" y="32" width="7" height="7"/> | |
| 903 | </backdrop> | |
| 904 | <backdrop name="lamp157" element="matrixlamp" state="0"> | |
| 905 | <bounds x="152" y="40" width="7" height="7"/> | |
| 906 | </backdrop> | |
| 907 | <backdrop name="lamp158" element="matrixlamp" state="0"> | |
| 908 | <bounds x="152" y="48" width="7" height="7"/> | |
| 909 | </backdrop> | |
| 910 | <backdrop name="lamp159" element="matrixlamp" state="0"> | |
| 911 | <bounds x="152" y="56" width="7" height="7"/> | |
| 912 | </backdrop> | |
| 913 | <backdrop name="lamp160" element="matrixlamp" state="0"> | |
| 914 | <bounds x="160" y="0" width="7" height="7"/> | |
| 915 | </backdrop> | |
| 916 | <backdrop name="lamp161" element="matrixlamp" state="0"> | |
| 917 | <bounds x="160" y="8" width="7" height="7"/> | |
| 918 | </backdrop> | |
| 919 | <backdrop name="lamp162" element="matrixlamp" state="0"> | |
| 920 | <bounds x="160" y="16" width="7" height="7"/> | |
| 921 | </backdrop> | |
| 922 | <backdrop name="lamp163" element="matrixlamp" state="0"> | |
| 923 | <bounds x="160" y="24" width="7" height="7"/> | |
| 924 | </backdrop> | |
| 925 | <backdrop name="lamp164" element="matrixlamp" state="0"> | |
| 926 | <bounds x="160" y="32" width="7" height="7"/> | |
| 927 | </backdrop> | |
| 928 | <backdrop name="lamp165" element="matrixlamp" state="0"> | |
| 929 | <bounds x="160" y="40" width="7" height="7"/> | |
| 930 | </backdrop> | |
| 931 | <backdrop name="lamp166" element="matrixlamp" state="0"> | |
| 932 | <bounds x="160" y="48" width="7" height="7"/> | |
| 933 | </backdrop> | |
| 934 | <backdrop name="lamp167" element="matrixlamp" state="0"> | |
| 935 | <bounds x="160" y="56" width="7" height="7"/> | |
| 936 | </backdrop> | |
| 937 | <backdrop name="lamp168" element="matrixlamp" state="0"> | |
| 938 | <bounds x="168" y="0" width="7" height="7"/> | |
| 939 | </backdrop> | |
| 940 | <backdrop name="lamp169" element="matrixlamp" state="0"> | |
| 941 | <bounds x="168" y="8" width="7" height="7"/> | |
| 942 | </backdrop> | |
| 943 | <backdrop name="lamp170" element="matrixlamp" state="0"> | |
| 944 | <bounds x="168" y="16" width="7" height="7"/> | |
| 945 | </backdrop> | |
| 946 | <backdrop name="lamp171" element="matrixlamp" state="0"> | |
| 947 | <bounds x="168" y="24" width="7" height="7"/> | |
| 948 | </backdrop> | |
| 949 | <backdrop name="lamp172" element="matrixlamp" state="0"> | |
| 950 | <bounds x="168" y="32" width="7" height="7"/> | |
| 951 | </backdrop> | |
| 952 | <backdrop name="lamp173" element="matrixlamp" state="0"> | |
| 953 | <bounds x="168" y="40" width="7" height="7"/> | |
| 954 | </backdrop> | |
| 955 | <backdrop name="lamp174" element="matrixlamp" state="0"> | |
| 956 | <bounds x="168" y="48" width="7" height="7"/> | |
| 957 | </backdrop> | |
| 958 | <backdrop name="lamp175" element="matrixlamp" state="0"> | |
| 959 | <bounds x="168" y="56" width="7" height="7"/> | |
| 960 | </backdrop> | |
| 961 | <backdrop name="lamp176" element="matrixlamp" state="0"> | |
| 962 | <bounds x="176" y="0" width="7" height="7"/> | |
| 963 | </backdrop> | |
| 964 | <backdrop name="lamp177" element="matrixlamp" state="0"> | |
| 965 | <bounds x="176" y="8" width="7" height="7"/> | |
| 966 | </backdrop> | |
| 967 | <backdrop name="lamp178" element="matrixlamp" state="0"> | |
| 968 | <bounds x="176" y="16" width="7" height="7"/> | |
| 969 | </backdrop> | |
| 970 | <backdrop name="lamp179" element="matrixlamp" state="0"> | |
| 971 | <bounds x="176" y="24" width="7" height="7"/> | |
| 972 | </backdrop> | |
| 973 | <backdrop name="lamp180" element="matrixlamp" state="0"> | |
| 974 | <bounds x="176" y="32" width="7" height="7"/> | |
| 975 | </backdrop> | |
| 976 | <backdrop name="lamp181" element="matrixlamp" state="0"> | |
| 977 | <bounds x="176" y="40" width="7" height="7"/> | |
| 978 | </backdrop> | |
| 979 | <backdrop name="lamp182" element="matrixlamp" state="0"> | |
| 980 | <bounds x="176" y="48" width="7" height="7"/> | |
| 981 | </backdrop> | |
| 982 | <backdrop name="lamp183" element="matrixlamp" state="0"> | |
| 983 | <bounds x="176" y="56" width="7" height="7"/> | |
| 984 | </backdrop> | |
| 985 | <backdrop name="lamp184" element="matrixlamp" state="0"> | |
| 986 | <bounds x="184" y="0" width="7" height="7"/> | |
| 987 | </backdrop> | |
| 988 | <backdrop name="lamp185" element="matrixlamp" state="0"> | |
| 989 | <bounds x="184" y="8" width="7" height="7"/> | |
| 990 | </backdrop> | |
| 991 | <backdrop name="lamp186" element="matrixlamp" state="0"> | |
| 992 | <bounds x="184" y="16" width="7" height="7"/> | |
| 993 | </backdrop> | |
| 994 | <backdrop name="lamp187" element="matrixlamp" state="0"> | |
| 995 | <bounds x="184" y="24" width="7" height="7"/> | |
| 996 | </backdrop> | |
| 997 | <backdrop name="lamp188" element="matrixlamp" state="0"> | |
| 998 | <bounds x="184" y="32" width="7" height="7"/> | |
| 999 | </backdrop> | |
| 1000 | <backdrop name="lamp189" element="matrixlamp" state="0"> | |
| 1001 | <bounds x="184" y="40" width="7" height="7"/> | |
| 1002 | </backdrop> | |
| 1003 | <backdrop name="lamp190" element="matrixlamp" state="0"> | |
| 1004 | <bounds x="184" y="48" width="7" height="7"/> | |
| 1005 | </backdrop> | |
| 1006 | <backdrop name="lamp191" element="matrixlamp" state="0"> | |
| 1007 | <bounds x="184" y="56" width="7" height="7"/> | |
| 1008 | </backdrop> | |
| 1009 | <backdrop name="lamp192" element="matrixlamp" state="0"> | |
| 1010 | <bounds x="192" y="0" width="7" height="7"/> | |
| 1011 | </backdrop> | |
| 1012 | <backdrop name="lamp193" element="matrixlamp" state="0"> | |
| 1013 | <bounds x="192" y="8" width="7" height="7"/> | |
| 1014 | </backdrop> | |
| 1015 | <backdrop name="lamp194" element="matrixlamp" state="0"> | |
| 1016 | <bounds x="192" y="16" width="7" height="7"/> | |
| 1017 | </backdrop> | |
| 1018 | <backdrop name="lamp195" element="matrixlamp" state="0"> | |
| 1019 | <bounds x="192" y="24" width="7" height="7"/> | |
| 1020 | </backdrop> | |
| 1021 | <backdrop name="lamp196" element="matrixlamp" state="0"> | |
| 1022 | <bounds x="192" y="32" width="7" height="7"/> | |
| 1023 | </backdrop> | |
| 1024 | <backdrop name="lamp197" element="matrixlamp" state="0"> | |
| 1025 | <bounds x="192" y="40" width="7" height="7"/> | |
| 1026 | </backdrop> | |
| 1027 | <backdrop name="lamp198" element="matrixlamp" state="0"> | |
| 1028 | <bounds x="192" y="48" width="7" height="7"/> | |
| 1029 | </backdrop> | |
| 1030 | <backdrop name="lamp199" element="matrixlamp" state="0"> | |
| 1031 | <bounds x="192" y="56" width="7" height="7"/> | |
| 1032 | </backdrop> | |
| 1033 | <backdrop name="lamp200" element="matrixlamp" state="0"> | |
| 1034 | <bounds x="200" y="0" width="7" height="7"/> | |
| 1035 | </backdrop> | |
| 1036 | <backdrop name="lamp201" element="matrixlamp" state="0"> | |
| 1037 | <bounds x="200" y="8" width="7" height="7"/> | |
| 1038 | </backdrop> | |
| 1039 | <backdrop name="lamp202" element="matrixlamp" state="0"> | |
| 1040 | <bounds x="200" y="16" width="7" height="7"/> | |
| 1041 | </backdrop> | |
| 1042 | <backdrop name="lamp203" element="matrixlamp" state="0"> | |
| 1043 | <bounds x="200" y="24" width="7" height="7"/> | |
| 1044 | </backdrop> | |
| 1045 | <backdrop name="lamp204" element="matrixlamp" state="0"> | |
| 1046 | <bounds x="200" y="32" width="7" height="7"/> | |
| 1047 | </backdrop> | |
| 1048 | <backdrop name="lamp205" element="matrixlamp" state="0"> | |
| 1049 | <bounds x="200" y="40" width="7" height="7"/> | |
| 1050 | </backdrop> | |
| 1051 | <backdrop name="lamp206" element="matrixlamp" state="0"> | |
| 1052 | <bounds x="200" y="48" width="7" height="7"/> | |
| 1053 | </backdrop> | |
| 1054 | <backdrop name="lamp207" element="matrixlamp" state="0"> | |
| 1055 | <bounds x="200" y="56" width="7" height="7"/> | |
| 1056 | </backdrop> | |
| 1057 | <backdrop name="lamp208" element="matrixlamp" state="0"> | |
| 1058 | <bounds x="208" y="0" width="7" height="7"/> | |
| 1059 | </backdrop> | |
| 1060 | <backdrop name="lamp209" element="matrixlamp" state="0"> | |
| 1061 | <bounds x="208" y="8" width="7" height="7"/> | |
| 1062 | </backdrop> | |
| 1063 | <backdrop name="lamp210" element="matrixlamp" state="0"> | |
| 1064 | <bounds x="208" y="16" width="7" height="7"/> | |
| 1065 | </backdrop> | |
| 1066 | <backdrop name="lamp211" element="matrixlamp" state="0"> | |
| 1067 | <bounds x="208" y="24" width="7" height="7"/> | |
| 1068 | </backdrop> | |
| 1069 | <backdrop name="lamp212" element="matrixlamp" state="0"> | |
| 1070 | <bounds x="208" y="32" width="7" height="7"/> | |
| 1071 | </backdrop> | |
| 1072 | <backdrop name="lamp213" element="matrixlamp" state="0"> | |
| 1073 | <bounds x="208" y="40" width="7" height="7"/> | |
| 1074 | </backdrop> | |
| 1075 | <backdrop name="lamp214" element="matrixlamp" state="0"> | |
| 1076 | <bounds x="208" y="48" width="7" height="7"/> | |
| 1077 | </backdrop> | |
| 1078 | <backdrop name="lamp215" element="matrixlamp" state="0"> | |
| 1079 | <bounds x="208" y="56" width="7" height="7"/> | |
| 1080 | </backdrop> | |
| 1081 | <backdrop name="lamp216" element="matrixlamp" state="0"> | |
| 1082 | <bounds x="216" y="0" width="7" height="7"/> | |
| 1083 | </backdrop> | |
| 1084 | <backdrop name="lamp217" element="matrixlamp" state="0"> | |
| 1085 | <bounds x="216" y="8" width="7" height="7"/> | |
| 1086 | </backdrop> | |
| 1087 | <backdrop name="lamp218" element="matrixlamp" state="0"> | |
| 1088 | <bounds x="216" y="16" width="7" height="7"/> | |
| 1089 | </backdrop> | |
| 1090 | <backdrop name="lamp219" element="matrixlamp" state="0"> | |
| 1091 | <bounds x="216" y="24" width="7" height="7"/> | |
| 1092 | </backdrop> | |
| 1093 | <backdrop name="lamp220" element="matrixlamp" state="0"> | |
| 1094 | <bounds x="216" y="32" width="7" height="7"/> | |
| 1095 | </backdrop> | |
| 1096 | <backdrop name="lamp221" element="matrixlamp" state="0"> | |
| 1097 | <bounds x="216" y="40" width="7" height="7"/> | |
| 1098 | </backdrop> | |
| 1099 | <backdrop name="lamp222" element="matrixlamp" state="0"> | |
| 1100 | <bounds x="216" y="48" width="7" height="7"/> | |
| 1101 | </backdrop> | |
| 1102 | <backdrop name="lamp223" element="matrixlamp" state="0"> | |
| 1103 | <bounds x="216" y="56" width="7" height="7"/> | |
| 1104 | </backdrop> | |
| 1105 | <backdrop name="lamp224" element="matrixlamp" state="0"> | |
| 1106 | <bounds x="224" y="0" width="7" height="7"/> | |
| 1107 | </backdrop> | |
| 1108 | <backdrop name="digit0" element="digit" state="0"> | |
| 1109 | <bounds x="300" y="200" width="8" height="10"/> | |
| 1110 | </backdrop> | |
| 1111 | <backdrop name="digit1" element="digit" state="0"> | |
| 1112 | <bounds x="308" y="200" width="8" height="10"/> | |
| 1113 | </backdrop> | |
| 1114 | <backdrop name="digit2" element="digit" state="0"> | |
| 1115 | <bounds x="316" y="200" width="8" height="10"/> | |
| 1116 | </backdrop> | |
| 1117 | <backdrop name="digit3" element="digit" state="0"> | |
| 1118 | <bounds x="324" y="200" width="8" height="10"/> | |
| 1119 | </backdrop> | |
| 1120 | <backdrop name="digit4" element="digit" state="0"> | |
| 1121 | <bounds x="332" y="200" width="8" height="10"/> | |
| 1122 | </backdrop> | |
| 1123 | <backdrop name="digit5" element="digit" state="0"> | |
| 1124 | <bounds x="340" y="200" width="8" height="10"/> | |
| 1125 | </backdrop> | |
| 1126 | <backdrop name="digit6" element="digit" state="0"> | |
| 1127 | <bounds x="348" y="200" width="8" height="10"/> | |
| 1128 | </backdrop> | |
| 1129 | <backdrop name="digit7" element="digit" state="0"> | |
| 1130 | <bounds x="356" y="200" width="8" height="10"/> | |
| 1131 | </backdrop> | |
| 1132 | <backdrop name="digit8" element="digit" state="0"> | |
| 1133 | <bounds x="300" y="211" width="8" height="10"/> | |
| 1134 | </backdrop> | |
| 1135 | <backdrop name="digit9" element="digit" state="0"> | |
| 1136 | <bounds x="308" y="211" width="8" height="10"/> | |
| 1137 | </backdrop> | |
| 1138 | <backdrop name="digit10" element="digit" state="0"> | |
| 1139 | <bounds x="316" y="211" width="8" height="10"/> | |
| 1140 | </backdrop> | |
| 1141 | <backdrop name="digit11" element="digit" state="0"> | |
| 1142 | <bounds x="324" y="211" width="8" height="10"/> | |
| 1143 | </backdrop> | |
| 1144 | <backdrop name="digit12" element="digit" state="0"> | |
| 1145 | <bounds x="332" y="211" width="8" height="10"/> | |
| 1146 | </backdrop> | |
| 1147 | <backdrop name="digit13" element="digit" state="0"> | |
| 1148 | <bounds x="340" y="211" width="8" height="10"/> | |
| 1149 | </backdrop> | |
| 1150 | <backdrop name="digit14" element="digit" state="0"> | |
| 1151 | <bounds x="348" y="211" width="8" height="10"/> | |
| 1152 | </backdrop> | |
| 1153 | <backdrop name="digit15" element="digit" state="0"> | |
| 1154 | <bounds x="356" y="211" width="8" height="10"/> | |
| 1155 | </backdrop> | |
| 1156 | <backdrop name="digit16" element="digit" state="0"> | |
| 1157 | <bounds x="300" y="222" width="8" height="10"/> | |
| 1158 | </backdrop> | |
| 1159 | <backdrop name="digit17" element="digit" state="0"> | |
| 1160 | <bounds x="308" y="222" width="8" height="10"/> | |
| 1161 | </backdrop> | |
| 1162 | <backdrop name="digit18" element="digit" state="0"> | |
| 1163 | <bounds x="316" y="222" width="8" height="10"/> | |
| 1164 | </backdrop> | |
| 1165 | <backdrop name="digit19" element="digit" state="0"> | |
| 1166 | <bounds x="324" y="222" width="8" height="10"/> | |
| 1167 | </backdrop> | |
| 1168 | <backdrop name="digit20" element="digit" state="0"> | |
| 1169 | <bounds x="332" y="222" width="8" height="10"/> | |
| 1170 | </backdrop> | |
| 1171 | <backdrop name="digit21" element="digit" state="0"> | |
| 1172 | <bounds x="340" y="222" width="8" height="10"/> | |
| 1173 | </backdrop> | |
| 1174 | <backdrop name="digit22" element="digit" state="0"> | |
| 1175 | <bounds x="348" y="222" width="8" height="10"/> | |
| 1176 | </backdrop> | |
| 1177 | <backdrop name="digit23" element="digit" state="0"> | |
| 1178 | <bounds x="356" y="222" width="8" height="10"/> | |
| 1179 | </backdrop> | |
| 1180 | <backdrop name="digit24" element="digit" state="0"> | |
| 1181 | <bounds x="300" y="233" width="8" height="10"/> | |
| 1182 | </backdrop> | |
| 1183 | <backdrop name="digit25" element="digit" state="0"> | |
| 1184 | <bounds x="308" y="233" width="8" height="10"/> | |
| 1185 | </backdrop> | |
| 1186 | <backdrop name="digit26" element="digit" state="0"> | |
| 1187 | <bounds x="316" y="233" width="8" height="10"/> | |
| 1188 | </backdrop> | |
| 1189 | <backdrop name="digit27" element="digit" state="0"> | |
| 1190 | <bounds x="324" y="233" width="8" height="10"/> | |
| 1191 | </backdrop> | |
| 1192 | <backdrop name="digit28" element="digit" state="0"> | |
| 1193 | <bounds x="332" y="233" width="8" height="10"/> | |
| 1194 | </backdrop> | |
| 1195 | <backdrop name="digit29" element="digit" state="0"> | |
| 1196 | <bounds x="340" y="233" width="8" height="10"/> | |
| 1197 | </backdrop> | |
| 1198 | <backdrop name="digit30" element="digit" state="0"> | |
| 1199 | <bounds x="348" y="233" width="8" height="10"/> | |
| 1200 | </backdrop> | |
| 1201 | <backdrop name="digit31" element="digit" state="0"> | |
| 1202 | <bounds x="356" y="233" width="8" height="10"/> | |
| 1203 | </backdrop> | |
| 1204 | <backdrop name="digit32" element="digit" state="0"> | |
| 1205 | <bounds x="300" y="244" width="8" height="10"/> | |
| 1206 | </backdrop> | |
| 1207 | <backdrop name="digit33" element="digit" state="0"> | |
| 1208 | <bounds x="308" y="244" width="8" height="10"/> | |
| 1209 | </backdrop> | |
| 1210 | <backdrop name="digit34" element="digit" state="0"> | |
| 1211 | <bounds x="316" y="244" width="8" height="10"/> | |
| 1212 | </backdrop> | |
| 1213 | <backdrop name="digit35" element="digit" state="0"> | |
| 1214 | <bounds x="324" y="244" width="8" height="10"/> | |
| 1215 | </backdrop> | |
| 1216 | <backdrop name="digit36" element="digit" state="0"> | |
| 1217 | <bounds x="332" y="244" width="8" height="10"/> | |
| 1218 | </backdrop> | |
| 1219 | <backdrop name="digit37" element="digit" state="0"> | |
| 1220 | <bounds x="340" y="244" width="8" height="10"/> | |
| 1221 | </backdrop> | |
| 1222 | <backdrop name="digit38" element="digit" state="0"> | |
| 1223 | <bounds x="348" y="244" width="8" height="10"/> | |
| 1224 | </backdrop> | |
| 1225 | <backdrop name="digit39" element="digit" state="0"> | |
| 1226 | <bounds x="356" y="244" width="8" height="10"/> | |
| 1227 | </backdrop> | |
| 1228 | <backdrop name="vfd0" element="vfd0" state="0"> | |
| 1229 | <bounds x="17" y="280" width="7" height="24"/> | |
| 1230 | </backdrop> | |
| 1231 | <backdrop name="vfd1" element="vfd0" state="0"> | |
| 1232 | <bounds x="24" y="280" width="7" height="24"/> | |
| 1233 | </backdrop> | |
| 1234 | <backdrop name="vfd2" element="vfd0" state="0"> | |
| 1235 | <bounds x="31" y="280" width="7" height="24"/> | |
| 1236 | </backdrop> | |
| 1237 | <backdrop name="vfd3" element="vfd0" state="0"> | |
| 1238 | <bounds x="38" y="280" width="7" height="24"/> | |
| 1239 | </backdrop> | |
| 1240 | <backdrop name="vfd4" element="vfd0" state="0"> | |
| 1241 | <bounds x="45" y="280" width="7" height="24"/> | |
| 1242 | </backdrop> | |
| 1243 | <backdrop name="vfd5" element="vfd0" state="0"> | |
| 1244 | <bounds x="52" y="280" width="7" height="24"/> | |
| 1245 | </backdrop> | |
| 1246 | <backdrop name="vfd6" element="vfd0" state="0"> | |
| 1247 | <bounds x="59" y="280" width="7" height="24"/> | |
| 1248 | </backdrop> | |
| 1249 | <backdrop name="vfd7" element="vfd0" state="0"> | |
| 1250 | <bounds x="66" y="280" width="7" height="24"/> | |
| 1251 | </backdrop> | |
| 1252 | <backdrop name="vfd8" element="vfd0" state="0"> | |
| 1253 | <bounds x="73" y="280" width="7" height="24"/> | |
| 1254 | </backdrop> | |
| 1255 | <backdrop name="vfd9" element="vfd0" state="0"> | |
| 1256 | <bounds x="80" y="280" width="7" height="24"/> | |
| 1257 | </backdrop> | |
| 1258 | <backdrop name="vfd10" element="vfd0" state="0"> | |
| 1259 | <bounds x="87" y="280" width="7" height="24"/> | |
| 1260 | </backdrop> | |
| 1261 | <backdrop name="vfd11" element="vfd0" state="0"> | |
| 1262 | <bounds x="94" y="280" width="7" height="24"/> | |
| 1263 | </backdrop> | |
| 1264 | <backdrop name="vfd12" element="vfd0" state="0"> | |
| 1265 | <bounds x="101" y="280" width="7" height="24"/> | |
| 1266 | </backdrop> | |
| 1267 | <backdrop name="vfd13" element="vfd0" state="0"> | |
| 1268 | <bounds x="108" y="280" width="7" height="24"/> | |
| 1269 | </backdrop> | |
| 1270 | <backdrop name="vfd14" element="vfd0" state="0"> | |
| 1271 | <bounds x="115" y="280" width="7" height="24"/> | |
| 1272 | </backdrop> | |
| 1273 | <backdrop name="vfd15" element="vfd0" state="0"> | |
| 1274 | <bounds x="122" y="280" width="7" height="24"/> | |
| 1275 | </backdrop> | |
| 1276 | </view> | |
| 1277 | <view name="VFD Display Output Only"> | |
| 1278 | <bezel name="vfd0" element="vfd0" state="0"> | |
| 1279 | <bounds x="10" y="200" width="9" height="17"/> | |
| 1280 | </bezel> | |
| 1281 | <bezel name="vfd1" element="vfd0" state="0"> | |
| 1282 | <bounds x="19" y="200" width="9" height="17"/> | |
| 1283 | </bezel> | |
| 1284 | <bezel name="vfd2" element="vfd0" state="0"> | |
| 1285 | <bounds x="28" y="200" width="9" height="17"/> | |
| 1286 | </bezel> | |
| 1287 | <bezel name="vfd3" element="vfd0" state="0"> | |
| 1288 | <bounds x="37" y="200" width="9" height="17"/> | |
| 1289 | </bezel> | |
| 1290 | <bezel name="vfd4" element="vfd0" state="0"> | |
| 1291 | <bounds x="46" y="200" width="9" height="17"/> | |
| 1292 | </bezel> | |
| 1293 | <bezel name="vfd5" element="vfd0" state="0"> | |
| 1294 | <bounds x="55" y="200" width="9" height="17"/> | |
| 1295 | </bezel> | |
| 1296 | <bezel name="vfd6" element="vfd0" state="0"> | |
| 1297 | <bounds x="64" y="200" width="9" height="17"/> | |
| 1298 | </bezel> | |
| 1299 | <bezel name="vfd7" element="vfd0" state="0"> | |
| 1300 | <bounds x="73" y="200" width="9" height="17"/> | |
| 1301 | </bezel> | |
| 1302 | <bezel name="vfd8" element="vfd0" state="0"> | |
| 1303 | <bounds x="82" y="200" width="9" height="17"/> | |
| 1304 | </bezel> | |
| 1305 | <bezel name="vfd9" element="vfd0" state="0"> | |
| 1306 | <bounds x="91" y="200" width="9" height="17"/> | |
| 1307 | </bezel> | |
| 1308 | <bezel name="vfd10" element="vfd0" state="0"> | |
| 1309 | <bounds x="100" y="200" width="9" height="17"/> | |
| 1310 | </bezel> | |
| 1311 | <bezel name="vfd11" element="vfd0" state="0"> | |
| 1312 | <bounds x="109" y="200" width="9" height="17"/> | |
| 1313 | </bezel> | |
| 1314 | <bezel name="vfd12" element="vfd0" state="0"> | |
| 1315 | <bounds x="118" y="200" width="9" height="17"/> | |
| 1316 | </bezel> | |
| 1317 | <bezel name="vfd13" element="vfd0" state="0"> | |
| 1318 | <bounds x="127" y="200" width="9" height="17"/> | |
| 1319 | </bezel> | |
| 1320 | <bezel name="vfd14" element="vfd0" state="0"> | |
| 1321 | <bounds x="136" y="200" width="9" height="17"/> | |
| 1322 | </bezel> | |
| 1323 | <bezel name="vfd15" element="vfd0" state="0"> | |
| 1324 | <bounds x="145" y="200" width="9" height="17"/> | |
| 1325 | </bezel> | |
| 1326 | </view> | |
| 1327 | </mamelayout> |
| r10315 | r10316 | |
|---|---|---|
| 2007 | 2007 | <bounds x="120" y="56" width="7" height="7"/> |
| 2008 | 2008 | </backdrop> |
| 2009 | 2009 | <backdrop name="digit3" element="digit" state="0"> |
| 2010 | <bounds x="308" y="230" width="8" height="10"/> | |
| 2011 | </backdrop> | |
| 2012 | <backdrop name="digit4" element="digit" state="0"> | |
| 2013 | 2010 | <bounds x="316" y="230" width="8" height="10"/> |
| 2014 | 2011 | </backdrop> |
| 2015 | <backdrop name="digit5" element="digit" state="0"> | |
| 2016 | <bounds x="300" y="200" width="8" height="10"/> | |
| 2017 | </backdrop> | |
| 2018 | <backdrop name="digit6" element="digit" state="0"> | |
| 2019 | <bounds x="308" y="200" width="8" height="10"/> | |
| 2020 | </backdrop> | |
| 2021 | <backdrop name="digit7" element="digit" state="0"> | |
| 2022 | <bounds x="316" y="200" width="8" height="10"/> | |
| 2023 | </backdrop> | |
| 2024 | <backdrop name="vfd0" element="vfd0" state="0"> | |
| 2025 | <bounds x="17" y="280" width="7" height="24"/> | |
| 2026 | </backdrop> | |
| 2027 | <backdrop name="vfd1" element="vfd0" state="0"> | |
| 2028 | <bounds x="24" y="280" width="7" height="24"/> | |
| 2029 | </backdrop> | |
| 2030 | <backdrop name="vfd2" element="vfd0" state="0"> | |
| 2031 | <bounds x="31" y="280" width="7" height="24"/> | |
| 2032 | </backdrop> | |
| 2033 | <backdrop name="vfd3" element="vfd0" state="0"> | |
| 2034 | <bounds x="38" y="280" width="7" height="24"/> | |
| 2035 | </backdrop> | |
| 2036 | <backdrop name="vfd4" element="vfd0" state="0"> | |
| 2037 | <bounds x="45" y="280" width="7" height="24"/> | |
| 2038 | </backdrop> | |
| 2039 | <backdrop name="vfd5" element="vfd0" state="0"> | |
| 2040 | <bounds x="52" y="280" width="7" height="24"/> | |
| 2041 | </backdrop> | |
| 2042 | <backdrop name="vfd6" element="vfd0" state="0"> | |
| 2043 | <bounds x="59" y="280" width="7" height="24"/> | |
| 2044 | </backdrop> | |
| 2045 | <backdrop name="vfd7" element="vfd0" state="0"> | |
| 2046 | <bounds x="66" y="280" width="7" height="24"/> | |
| 2047 | </backdrop> | |
| 2048 | <backdrop name="vfd8" element="vfd0" state="0"> | |
| 2049 | <bounds x="73" y="280" width="7" height="24"/> | |
| 2050 | </backdrop> | |
| 2051 | <backdrop name="vfd9" element="vfd0" state="0"> | |
| 2052 | <bounds x="80" y="280" width="7" height="24"/> | |
| 2053 | </backdrop> | |
| 2054 | <backdrop name="vfd10" element="vfd0" state="0"> | |
| 2055 | <bounds x="87" y="280" width="7" height="24"/> | |
| 2056 | </backdrop> | |
| 2057 | <backdrop name="vfd11" element="vfd0" state="0"> | |
| 2058 | <bounds x="94" y="280" width="7" height="24"/> | |
| 2059 | </backdrop> | |
| 2060 | <backdrop name="vfd12" element="vfd0" state="0"> | |
| 2061 | <bounds x="101" y="280" width="7" height="24"/> | |
| 2062 | </backdrop> | |
| 2063 | <backdrop name="vfd13" element="vfd0" state="0"> | |
| 2064 | <bounds x="108" y="280" width="7" height="24"/> | |
| 2065 | </backdrop> | |
| 2066 | <backdrop name="vfd14" element="vfd0" state="0"> | |
| 2067 | <bounds x="115" y="280" width="7" height="24"/> | |
| 2068 | </backdrop> | |
| 2069 | <backdrop name="vfd15" element="vfd0" state="0"> | |
| 2070 | <bounds x="122" y="280" width="7" height="24"/> | |
| 2071 | </backdrop> | |
| 2072 | </view> | |
| 2073 | </mamelayout> | |
| 2074 | <?xml version="1.0"?> | |
| 2075 | <mamelayout version="2"> | |
| 2076 | <element name="TotalReels" defstate="4"/> | |
| 2077 | <element name="ReelSteps1" defstate="8"/> | |
| 2078 | <element name="ReelSymbols1" defstate="3"/> | |
| 2079 | <element name="ReelSteps2" defstate="6"/> | |
| 2080 | <element name="digit"> | |
| 2081 | <led7seg> | |
| 2082 | <color red="1.0" green="0.0" blue="0.0" /> | |
| 2083 | </led7seg> | |
| 2084 | </element> | |
| 2085 | <element name="matrixlamp"> | |
| 2086 | <rect state ="0"> | |
| 2087 | <bounds x="0" y="0" width="7" height="7" /> | |
| 2088 | <color red="0.7" green="0.7" blue="0.7" /> | |
| 2089 | </rect> | |
| 2090 | <rect state ="1"> | |
| 2091 | <bounds x="0" y="0" width="7" height="7" /> | |
| 2092 | <color red="0.0" green="0.0" blue="1.0" /> | |
| 2093 | </rect> | |
| 2094 | <rect state ="2"> | |
| 2095 | <bounds x="0" y="0" width="7" height="7" /> | |
| 2096 | <color red="0.0" green="1.0" blue="0.0" /> | |
| 2097 | </rect> | |
| 2098 | </element> | |
| 2099 | <element name="Reel1" defstate="96"> | |
| 2100 | <text string="3.00 RPT" state="0"> | |
| 2101 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2102 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2103 | </text> | |
| 2104 | <text string="3.00 RPT" state="1"> | |
| 2105 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2106 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2107 | </text> | |
| 2108 | <text string="3.00 RPT" state="2"> | |
| 2109 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2110 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2111 | </text> | |
| 2112 | <text string="3.00 RPT" state="3"> | |
| 2113 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2114 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2115 | </text> | |
| 2116 | <text string="3.00 RPT" state="4"> | |
| 2117 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2118 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2119 | </text> | |
| 2120 | <text string="3.00 RPT" state="5"> | |
| 2121 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2122 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2123 | </text> | |
| 2124 | <text string="3.00 RPT" state="6"> | |
| 2125 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2126 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2127 | </text> | |
| 2128 | <text string="3.00 RPT" state="7"> | |
| 2129 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2130 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2131 | </text> | |
| 2132 | <text string="POT" state="8"> | |
| 2133 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2134 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2135 | </text> | |
| 2136 | <text string="POT" state="9"> | |
| 2137 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2138 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2139 | </text> | |
| 2140 | <text string="POT" state="10"> | |
| 2141 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2142 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2143 | </text> | |
| 2144 | <text string="POT" state="11"> | |
| 2145 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2146 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2147 | </text> | |
| 2148 | <text string="POT" state="12"> | |
| 2149 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2150 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2151 | </text> | |
| 2152 | <text string="POT" state="13"> | |
| 2153 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2154 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2155 | </text> | |
| 2156 | <text string="POT" state="14"> | |
| 2157 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2158 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2159 | </text> | |
| 2160 | <text string="POT" state="15"> | |
| 2161 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2162 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2163 | </text> | |
| 2164 | <text string="JACK" state="16"> | |
| 2165 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2166 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2167 | </text> | |
| 2168 | <text string="JACK" state="17"> | |
| 2169 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2170 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2171 | </text> | |
| 2172 | <text string="JACK" state="18"> | |
| 2173 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2174 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2175 | </text> | |
| 2176 | <text string="JACK" state="19"> | |
| 2177 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2178 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2179 | </text> | |
| 2180 | <text string="JACK" state="20"> | |
| 2181 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2182 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2183 | </text> | |
| 2184 | <text string="JACK" state="21"> | |
| 2185 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2186 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2187 | </text> | |
| 2188 | <text string="JACK" state="22"> | |
| 2189 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2190 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2191 | </text> | |
| 2192 | <text string="JACK" state="23"> | |
| 2193 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2194 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2195 | </text> | |
| 2196 | <text string="LOSE" state="24"> | |
| 2197 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2198 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2199 | </text> | |
| 2200 | <text string="LOSE" state="25"> | |
| 2201 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2202 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2203 | </text> | |
| 2204 | <text string="LOSE" state="26"> | |
| 2205 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2206 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2207 | </text> | |
| 2208 | <text string="LOSE" state="27"> | |
| 2209 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2210 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2211 | </text> | |
| 2212 | <text string="LOSE" state="28"> | |
| 2213 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2214 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2215 | </text> | |
| 2216 | <text string="LOSE" state="29"> | |
| 2217 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2218 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2219 | </text> | |
| 2220 | <text string="LOSE" state="30"> | |
| 2221 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2222 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2223 | </text> | |
| 2224 | <text string="LOSE" state="31"> | |
| 2225 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2226 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2227 | </text> | |
| 2228 | <text string="60p" state="32"> | |
| 2229 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2230 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2231 | </text> | |
| 2232 | <text string="60p" state="33"> | |
| 2233 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2234 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2235 | </text> | |
| 2236 | <text string="60p" state="34"> | |
| 2237 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2238 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2239 | </text> | |
| 2240 | <text string="60p" state="35"> | |
| 2241 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2242 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2243 | </text> | |
| 2244 | <text string="60p" state="36"> | |
| 2245 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2246 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2247 | </text> | |
| 2248 | <text string="60p" state="37"> | |
| 2249 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2250 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2251 | </text> | |
| 2252 | <text string="60p" state="38"> | |
| 2253 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2254 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2255 | </text> | |
| 2256 | <text string="60p" state="39"> | |
| 2257 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2258 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2259 | </text> | |
| 2260 | <text string="80p" state="40"> | |
| 2261 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2262 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2263 | </text> | |
| 2264 | <text string="80p" state="41"> | |
| 2265 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2266 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2267 | </text> | |
| 2268 | <text string="80p" state="42"> | |
| 2269 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2270 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2271 | </text> | |
| 2272 | <text string="80p" state="43"> | |
| 2273 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2274 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2275 | </text> | |
| 2276 | <text string="80p" state="44"> | |
| 2277 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2278 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2279 | </text> | |
| 2280 | <text string="80p" state="45"> | |
| 2281 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2282 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2283 | </text> | |
| 2284 | <text string="80p" state="46"> | |
| 2285 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2286 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2287 | </text> | |
| 2288 | <text string="80p" state="47"> | |
| 2289 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2290 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2291 | </text> | |
| 2292 | <text string="1.00" state="48"> | |
| 2293 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2294 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2295 | </text> | |
| 2296 | <text string="1.00" state="49"> | |
| 2297 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2298 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2299 | </text> | |
| 2300 | <text string="1.00" state="50"> | |
| 2301 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2302 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2303 | </text> | |
| 2304 | <text string="1.00" state="51"> | |
| 2305 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2306 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2307 | </text> | |
| 2308 | <text string="1.00" state="52"> | |
| 2309 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2310 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2311 | </text> | |
| 2312 | <text string="1.00" state="53"> | |
| 2313 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2314 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2315 | </text> | |
| 2316 | <text string="1.00" state="54"> | |
| 2317 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2318 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2319 | </text> | |
| 2320 | <text string="1.00" state="55"> | |
| 2321 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2322 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2323 | </text> | |
| 2324 | <text string="1.20" state="56"> | |
| 2325 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2326 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2327 | </text> | |
| 2328 | <text string="1.20" state="57"> | |
| 2329 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2330 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2331 | </text> | |
| 2332 | <text string="1.20" state="58"> | |
| 2333 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2334 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2335 | </text> | |
| 2336 | <text string="1.20" state="59"> | |
| 2337 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2338 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2339 | </text> | |
| 2340 | <text string="1.20" state="60"> | |
| 2341 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2342 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2343 | </text> | |
| 2344 | <text string="1.20" state="61"> | |
| 2345 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2346 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2347 | </text> | |
| 2348 | <text string="1.20" state="62"> | |
| 2349 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2350 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2351 | </text> | |
| 2352 | <text string="1.20" state="63"> | |
| 2353 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2354 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2355 | </text> | |
| 2356 | <text string="1.60" state="64"> | |
| 2357 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2358 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2359 | </text> | |
| 2360 | <text string="1.60" state="65"> | |
| 2361 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2362 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2363 | </text> | |
| 2364 | <text string="1.60" state="66"> | |
| 2365 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2366 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2367 | </text> | |
| 2368 | <text string="1.60" state="67"> | |
| 2369 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2370 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2371 | </text> | |
| 2372 | <text string="1.60" state="68"> | |
| 2373 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2374 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2375 | </text> | |
| 2376 | <text string="1.60" state="69"> | |
| 2377 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2378 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2379 | </text> | |
| 2380 | <text string="1.60" state="70"> | |
| 2381 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2382 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2383 | </text> | |
| 2384 | <text string="1.60" state="71"> | |
| 2385 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2386 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2387 | </text> | |
| 2388 | <text string="2.00" state="72"> | |
| 2389 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2390 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2391 | </text> | |
| 2392 | <text string="2.00" state="73"> | |
| 2393 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2394 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2395 | </text> | |
| 2396 | <text string="2.00" state="74"> | |
| 2397 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2398 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2399 | </text> | |
| 2400 | <text string="2.00" state="75"> | |
| 2401 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2402 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2403 | </text> | |
| 2404 | <text string="2.00" state="76"> | |
| 2405 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2406 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2407 | </text> | |
| 2408 | <text string="2.00" state="77"> | |
| 2409 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2410 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2411 | </text> | |
| 2412 | <text string="2.00" state="78"> | |
| 2413 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2414 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2415 | </text> | |
| 2416 | <text string="2.00" state="79"> | |
| 2417 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2418 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2419 | </text> | |
| 2420 | <text string="2.20" state="80"> | |
| 2421 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2422 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2423 | </text> | |
| 2424 | <text string="2.20" state="81"> | |
| 2425 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2426 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2427 | </text> | |
| 2428 | <text string="2.20" state="82"> | |
| 2429 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2430 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2431 | </text> | |
| 2432 | <text string="2.20" state="83"> | |
| 2433 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2434 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2435 | </text> | |
| 2436 | <text string="2.20" state="84"> | |
| 2437 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2438 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2439 | </text> | |
| 2440 | <text string="2.20" state="85"> | |
| 2441 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2442 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2443 | </text> | |
| 2444 | <text string="2.20" state="86"> | |
| 2445 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2446 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2447 | </text> | |
| 2448 | <text string="2.20" state="87"> | |
| 2449 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2450 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2451 | </text> | |
| 2452 | <text string="2.40" state="88"> | |
| 2453 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2454 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2455 | </text> | |
| 2456 | <text string="2.40" state="89"> | |
| 2457 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2458 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2459 | </text> | |
| 2460 | <text string="2.40" state="90"> | |
| 2461 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2462 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2463 | </text> | |
| 2464 | <text string="2.40" state="91"> | |
| 2465 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2466 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2467 | </text> | |
| 2468 | <text string="2.40" state="92"> | |
| 2469 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2470 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2471 | </text> | |
| 2472 | <text string="2.40" state="93"> | |
| 2473 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2474 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2475 | </text> | |
| 2476 | <text string="2.40" state="94"> | |
| 2477 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2478 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2479 | </text> | |
| 2480 | <text string="2.40" state="95"> | |
| 2481 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2482 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2483 | </text> | |
| 2484 | </element> | |
| 2485 | ||
| 2486 | <element name="Reel2" defstate="96"> | |
| 2487 | <text string="7" state="0"> | |
| 2488 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2489 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2490 | </text> | |
| 2491 | <text string="7" state="1"> | |
| 2492 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2493 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2494 | </text> | |
| 2495 | <text string="7" state="2"> | |
| 2496 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2497 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2498 | </text> | |
| 2499 | <text string="7" state="3"> | |
| 2500 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2501 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2502 | </text> | |
| 2503 | <text string="7" state="4"> | |
| 2504 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2505 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2506 | </text> | |
| 2507 | <text string="7" state="5"> | |
| 2508 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2509 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2510 | </text> | |
| 2511 | <text string="Cherry" state="6"> | |
| 2512 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2513 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2514 | </text> | |
| 2515 | <text string="Cherry" state="7"> | |
| 2516 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2517 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2518 | </text> | |
| 2519 | <text string="Cherry" state="8"> | |
| 2520 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2521 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2522 | </text> | |
| 2523 | <text string="Cherry" state="9"> | |
| 2524 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2525 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2526 | </text> | |
| 2527 | <text string="Cherry" state="10"> | |
| 2528 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2529 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2530 | </text> | |
| 2531 | <text string="Cherry" state="11"> | |
| 2532 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2533 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2534 | </text> | |
| 2535 | <text string="Bar" state="12"> | |
| 2536 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2537 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2538 | </text> | |
| 2539 | <text string="Bar" state="13"> | |
| 2540 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2541 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2542 | </text> | |
| 2543 | <text string="Bar" state="14"> | |
| 2544 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2545 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2546 | </text> | |
| 2547 | <text string="Bar" state="15"> | |
| 2548 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2549 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2550 | </text> | |
| 2551 | <text string="Bar" state="16"> | |
| 2552 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2553 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2554 | </text> | |
| 2555 | <text string="Bar" state="17"> | |
| 2556 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2557 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2558 | </text> | |
| 2559 | <text string="Melon" state="18"> | |
| 2560 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2561 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2562 | </text> | |
| 2563 | <text string="Melon" state="19"> | |
| 2564 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2565 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2566 | </text> | |
| 2567 | <text string="Melon" state="20"> | |
| 2568 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2569 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2570 | </text> | |
| 2571 | <text string="Melon" state="21"> | |
| 2572 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2573 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2574 | </text> | |
| 2575 | <text string="Melon" state="22"> | |
| 2576 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2577 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2578 | </text> | |
| 2579 | <text string="Melon" state="23"> | |
| 2580 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2581 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2582 | </text> | |
| 2583 | <text string="7" state="24"> | |
| 2584 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2585 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2586 | </text> | |
| 2587 | <text string="7" state="25"> | |
| 2588 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2589 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2590 | </text> | |
| 2591 | <text string="7" state="26"> | |
| 2592 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2593 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2594 | </text> | |
| 2595 | <text string="7" state="27"> | |
| 2596 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2597 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2598 | </text> | |
| 2599 | <text string="7" state="28"> | |
| 2600 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2601 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2602 | </text> | |
| 2603 | <text string="7" state="29"> | |
| 2604 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2605 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2606 | </text> | |
| 2607 | <text string="Bar" state="30"> | |
| 2608 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2609 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2610 | </text> | |
| 2611 | <text string="Bar" state="31"> | |
| 2612 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2613 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2614 | </text> | |
| 2615 | <text string="Bar" state="32"> | |
| 2616 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2617 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2618 | </text> | |
| 2619 | <text string="Bar" state="33"> | |
| 2620 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2621 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2622 | </text> | |
| 2623 | <text string="Bar" state="34"> | |
| 2624 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2625 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2626 | </text> | |
| 2627 | <text string="Bar" state="35"> | |
| 2628 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2629 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2630 | </text> | |
| 2631 | <text string="Bell" state="36"> | |
| 2632 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2633 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2634 | </text> | |
| 2635 | <text string="Bell" state="37"> | |
| 2636 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2637 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2638 | </text> | |
| 2639 | <text string="Bell" state="38"> | |
| 2640 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2641 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2642 | </text> | |
| 2643 | <text string="Bell" state="39"> | |
| 2644 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2645 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2646 | </text> | |
| 2647 | <text string="Bell" state="40"> | |
| 2648 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2649 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2650 | </text> | |
| 2651 | <text string="Bell" state="41"> | |
| 2652 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2653 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2654 | </text> | |
| 2655 | <text string="Cherry" state="42"> | |
| 2656 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2657 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2658 | </text> | |
| 2659 | <text string="Cherry" state="43"> | |
| 2660 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2661 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2662 | </text> | |
| 2663 | <text string="Cherry" state="44"> | |
| 2664 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2665 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2666 | </text> | |
| 2667 | <text string="Cherry" state="45"> | |
| 2668 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2669 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2670 | </text> | |
| 2671 | <text string="Cherry" state="46"> | |
| 2672 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2673 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2674 | </text> | |
| 2675 | <text string="Cherry" state="47"> | |
| 2676 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2677 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2678 | </text> | |
| 2679 | <text string="Melon" state="48"> | |
| 2680 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2681 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2682 | </text> | |
| 2683 | <text string="Melon" state="49"> | |
| 2684 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2685 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2686 | </text> | |
| 2687 | <text string="Melon" state="50"> | |
| 2688 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2689 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2690 | </text> | |
| 2691 | <text string="Melon" state="51"> | |
| 2692 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2693 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2694 | </text> | |
| 2695 | <text string="Melon" state="52"> | |
| 2696 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2697 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2698 | </text> | |
| 2699 | <text string="Melon" state="53"> | |
| 2700 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2701 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2702 | </text> | |
| 2703 | <text string="Bell" state="54"> | |
| 2704 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2705 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2706 | </text> | |
| 2707 | <text string="Bell" state="55"> | |
| 2708 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2709 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2710 | </text> | |
| 2711 | <text string="Bell" state="56"> | |
| 2712 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2713 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2714 | </text> | |
| 2715 | <text string="Bell" state="57"> | |
| 2716 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2717 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2718 | </text> | |
| 2719 | <text string="Bell" state="58"> | |
| 2720 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2721 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2722 | </text> | |
| 2723 | <text string="Bell" state="59"> | |
| 2724 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2725 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2726 | </text> | |
| 2727 | <text string="7" state="60"> | |
| 2728 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2729 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2730 | </text> | |
| 2731 | <text string="7" state="61"> | |
| 2732 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2733 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2734 | </text> | |
| 2735 | <text string="7" state="62"> | |
| 2736 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2737 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2738 | </text> | |
| 2739 | <text string="7" state="63"> | |
| 2740 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2741 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2742 | </text> | |
| 2743 | <text string="7" state="64"> | |
| 2744 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2745 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2746 | </text> | |
| 2747 | <text string="7" state="65"> | |
| 2748 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2749 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2750 | </text> | |
| 2751 | <text string="Bar" state="66"> | |
| 2752 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2753 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2754 | </text> | |
| 2755 | <text string="Bar" state="67"> | |
| 2756 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2757 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2758 | </text> | |
| 2759 | <text string="Bar" state="68"> | |
| 2760 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2761 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2762 | </text> | |
| 2763 | <text string="Bar" state="69"> | |
| 2764 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2765 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2766 | </text> | |
| 2767 | <text string="Bar" state="70"> | |
| 2768 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2769 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2770 | </text> | |
| 2771 | <text string="Bar" state="71"> | |
| 2772 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2773 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2774 | </text> | |
| 2775 | <text string="Cherry" state="72"> | |
| 2776 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2777 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2778 | </text> | |
| 2779 | <text string="Cherry" state="73"> | |
| 2780 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2781 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2782 | </text> | |
| 2783 | <text string="Cherry" state="74"> | |
| 2784 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2785 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2786 | </text> | |
| 2787 | <text string="Cherry" state="75"> | |
| 2788 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2789 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2790 | </text> | |
| 2791 | <text string="Cherry" state="76"> | |
| 2792 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2793 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2794 | </text> | |
| 2795 | <text string="Cherry" state="77"> | |
| 2796 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2797 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2798 | </text> | |
| 2799 | <text string="Bell" state="78"> | |
| 2800 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2801 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2802 | </text> | |
| 2803 | <text string="Bell" state="79"> | |
| 2804 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2805 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2806 | </text> | |
| 2807 | <text string="Bell" state="80"> | |
| 2808 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2809 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2810 | </text> | |
| 2811 | <text string="Bell" state="81"> | |
| 2812 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2813 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2814 | </text> | |
| 2815 | <text string="Bell" state="82"> | |
| 2816 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2817 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2818 | </text> | |
| 2819 | <text string="Bell" state="83"> | |
| 2820 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2821 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2822 | </text> | |
| 2823 | <text string="Bar" state="84"> | |
| 2824 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2825 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2826 | </text> | |
| 2827 | <text string="Bar" state="85"> | |
| 2828 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2829 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2830 | </text> | |
| 2831 | <text string="Bar" state="86"> | |
| 2832 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2833 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2834 | </text> | |
| 2835 | <text string="Bar" state="87"> | |
| 2836 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2837 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2838 | </text> | |
| 2839 | <text string="Bar" state="88"> | |
| 2840 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2841 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2842 | </text> | |
| 2843 | <text string="Bar" state="89"> | |
| 2844 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2845 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2846 | </text> | |
| 2847 | <text string="Melon" state="90"> | |
| 2848 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2849 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2850 | </text> | |
| 2851 | <text string="Melon" state="91"> | |
| 2852 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2853 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2854 | </text> | |
| 2855 | <text string="Melon" state="92"> | |
| 2856 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2857 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2858 | </text> | |
| 2859 | <text string="Melon" state="93"> | |
| 2860 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2861 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2862 | </text> | |
| 2863 | <text string="Melon" state="94"> | |
| 2864 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2865 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2866 | </text> | |
| 2867 | <text string="Melon" state="95"> | |
| 2868 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2869 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2870 | </text> | |
| 2871 | </element> | |
| 2872 | ||
| 2873 | <element name="Reel3" defstate="96"> | |
| 2874 | <text string="7" state="0"> | |
| 2875 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2876 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2877 | </text> | |
| 2878 | <text string="7" state="1"> | |
| 2879 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2880 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2881 | </text> | |
| 2882 | <text string="7" state="2"> | |
| 2883 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2884 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2885 | </text> | |
| 2886 | <text string="7" state="3"> | |
| 2887 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2888 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2889 | </text> | |
| 2890 | <text string="7" state="4"> | |
| 2891 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2892 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2893 | </text> | |
| 2894 | <text string="7" state="5"> | |
| 2895 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2896 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2897 | </text> | |
| 2898 | <text string="Melon" state="6"> | |
| 2899 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2900 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2901 | </text> | |
| 2902 | <text string="Melon" state="7"> | |
| 2903 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2904 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2905 | </text> | |
| 2906 | <text string="Melon" state="8"> | |
| 2907 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2908 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2909 | </text> | |
| 2910 | <text string="Melon" state="9"> | |
| 2911 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2912 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2913 | </text> | |
| 2914 | <text string="Melon" state="10"> | |
| 2915 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2916 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2917 | </text> | |
| 2918 | <text string="Melon" state="11"> | |
| 2919 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2920 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2921 | </text> | |
| 2922 | <text string="Bell" state="12"> | |
| 2923 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2924 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2925 | </text> | |
| 2926 | <text string="Bell" state="13"> | |
| 2927 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2928 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2929 | </text> | |
| 2930 | <text string="Bell" state="14"> | |
| 2931 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2932 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2933 | </text> | |
| 2934 | <text string="Bell" state="15"> | |
| 2935 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2936 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2937 | </text> | |
| 2938 | <text string="Bell" state="16"> | |
| 2939 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2940 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2941 | </text> | |
| 2942 | <text string="Bell" state="17"> | |
| 2943 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2944 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2945 | </text> | |
| 2946 | <text string="Cherry" state="18"> | |
| 2947 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2948 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2949 | </text> | |
| 2950 | <text string="Cherry" state="19"> | |
| 2951 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2952 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2953 | </text> | |
| 2954 | <text string="Cherry" state="20"> | |
| 2955 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2956 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2957 | </text> | |
| 2958 | <text string="Cherry" state="21"> | |
| 2959 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2960 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2961 | </text> | |
| 2962 | <text string="Cherry" state="22"> | |
| 2963 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2964 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2965 | </text> | |
| 2966 | <text string="Cherry" state="23"> | |
| 2967 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2968 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2969 | </text> | |
| 2970 | <text string="Bar" state="24"> | |
| 2971 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2972 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2973 | </text> | |
| 2974 | <text string="Bar" state="25"> | |
| 2975 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2976 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2977 | </text> | |
| 2978 | <text string="Bar" state="26"> | |
| 2979 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2980 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2981 | </text> | |
| 2982 | <text string="Bar" state="27"> | |
| 2983 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2984 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2985 | </text> | |
| 2986 | <text string="Bar" state="28"> | |
| 2987 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2988 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2989 | </text> | |
| 2990 | <text string="Bar" state="29"> | |
| 2991 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2992 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2993 | </text> | |
| 2994 | <text string="Bell" state="30"> | |
| 2995 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 2996 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 2997 | </text> | |
| 2998 | <text string="Bell" state="31"> | |
| 2999 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3000 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3001 | </text> | |
| 3002 | <text string="Bell" state="32"> | |
| 3003 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3004 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3005 | </text> | |
| 3006 | <text string="Bell" state="33"> | |
| 3007 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3008 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3009 | </text> | |
| 3010 | <text string="Bell" state="34"> | |
| 3011 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3012 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3013 | </text> | |
| 3014 | <text string="Bell" state="35"> | |
| 3015 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3016 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3017 | </text> | |
| 3018 | <text string="Melon" state="36"> | |
| 3019 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3020 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3021 | </text> | |
| 3022 | <text string="Melon" state="37"> | |
| 3023 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3024 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3025 | </text> | |
| 3026 | <text string="Melon" state="38"> | |
| 3027 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3028 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3029 | </text> | |
| 3030 | <text string="Melon" state="39"> | |
| 3031 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3032 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3033 | </text> | |
| 3034 | <text string="Melon" state="40"> | |
| 3035 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3036 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3037 | </text> | |
| 3038 | <text string="Melon" state="41"> | |
| 3039 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3040 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3041 | </text> | |
| 3042 | <text string="Bar" state="42"> | |
| 3043 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3044 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3045 | </text> | |
| 3046 | <text string="Bar" state="43"> | |
| 3047 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3048 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3049 | </text> | |
| 3050 | <text string="Bar" state="44"> | |
| 3051 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3052 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3053 | </text> | |
| 3054 | <text string="Bar" state="45"> | |
| 3055 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3056 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3057 | </text> | |
| 3058 | <text string="Bar" state="46"> | |
| 3059 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3060 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3061 | </text> | |
| 3062 | <text string="Bar" state="47"> | |
| 3063 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3064 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3065 | </text> | |
| 3066 | <text string="Cherry" state="48"> | |
| 3067 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3068 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3069 | </text> | |
| 3070 | <text string="Cherry" state="49"> | |
| 3071 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3072 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3073 | </text> | |
| 3074 | <text string="Cherry" state="50"> | |
| 3075 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3076 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3077 | </text> | |
| 3078 | <text string="Cherry" state="51"> | |
| 3079 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3080 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3081 | </text> | |
| 3082 | <text string="Cherry" state="52"> | |
| 3083 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3084 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3085 | </text> | |
| 3086 | <text string="Cherry" state="53"> | |
| 3087 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3088 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3089 | </text> | |
| 3090 | <text string="7" state="54"> | |
| 3091 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3092 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3093 | </text> | |
| 3094 | <text string="7" state="55"> | |
| 3095 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3096 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3097 | </text> | |
| 3098 | <text string="7" state="56"> | |
| 3099 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3100 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3101 | </text> | |
| 3102 | <text string="7" state="57"> | |
| 3103 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3104 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3105 | </text> | |
| 3106 | <text string="7" state="58"> | |
| 3107 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3108 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3109 | </text> | |
| 3110 | <text string="7" state="59"> | |
| 3111 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3112 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3113 | </text> | |
| 3114 | <text string="Melon" state="60"> | |
| 3115 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3116 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3117 | </text> | |
| 3118 | <text string="Melon" state="61"> | |
| 3119 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3120 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3121 | </text> | |
| 3122 | <text string="Melon" state="62"> | |
| 3123 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3124 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3125 | </text> | |
| 3126 | <text string="Melon" state="63"> | |
| 3127 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3128 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3129 | </text> | |
| 3130 | <text string="Melon" state="64"> | |
| 3131 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3132 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3133 | </text> | |
| 3134 | <text string="Melon" state="65"> | |
| 3135 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3136 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3137 | </text> | |
| 3138 | <text string="Bar" state="66"> | |
| 3139 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3140 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3141 | </text> | |
| 3142 | <text string="Bar" state="67"> | |
| 3143 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3144 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3145 | </text> | |
| 3146 | <text string="Bar" state="68"> | |
| 3147 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3148 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3149 | </text> | |
| 3150 | <text string="Bar" state="69"> | |
| 3151 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3152 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3153 | </text> | |
| 3154 | <text string="Bar" state="70"> | |
| 3155 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3156 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3157 | </text> | |
| 3158 | <text string="Bar" state="71"> | |
| 3159 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3160 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3161 | </text> | |
| 3162 | <text string="Cherry" state="72"> | |
| 3163 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3164 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3165 | </text> | |
| 3166 | <text string="Cherry" state="73"> | |
| 3167 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3168 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3169 | </text> | |
| 3170 | <text string="Cherry" state="74"> | |
| 3171 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3172 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3173 | </text> | |
| 3174 | <text string="Cherry" state="75"> | |
| 3175 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3176 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3177 | </text> | |
| 3178 | <text string="Cherry" state="76"> | |
| 3179 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3180 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3181 | </text> | |
| 3182 | <text string="Cherry" state="77"> | |
| 3183 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3184 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3185 | </text> | |
| 3186 | <text string="Melon" state="78"> | |
| 3187 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3188 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3189 | </text> | |
| 3190 | <text string="Melon" state="79"> | |
| 3191 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3192 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3193 | </text> | |
| 3194 | <text string="Melon" state="80"> | |
| 3195 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3196 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3197 | </text> | |
| 3198 | <text string="Melon" state="81"> | |
| 3199 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3200 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3201 | </text> | |
| 3202 | <text string="Melon" state="82"> | |
| 3203 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3204 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3205 | </text> | |
| 3206 | <text string="Melon" state="83"> | |
| 3207 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3208 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3209 | </text> | |
| 3210 | <text string="Cherry" state="84"> | |
| 3211 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3212 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3213 | </text> | |
| 3214 | <text string="Cherry" state="85"> | |
| 3215 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3216 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3217 | </text> | |
| 3218 | <text string="Cherry" state="86"> | |
| 3219 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3220 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3221 | </text> | |
| 3222 | <text string="Cherry" state="87"> | |
| 3223 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3224 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3225 | </text> | |
| 3226 | <text string="Cherry" state="88"> | |
| 3227 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3228 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3229 | </text> | |
| 3230 | <text string="Cherry" state="89"> | |
| 3231 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3232 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3233 | </text> | |
| 3234 | <text string="Bell" state="90"> | |
| 3235 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3236 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3237 | </text> | |
| 3238 | <text string="Bell" state="91"> | |
| 3239 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3240 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3241 | </text> | |
| 3242 | <text string="Bell" state="92"> | |
| 3243 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3244 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3245 | </text> | |
| 3246 | <text string="Bell" state="93"> | |
| 3247 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3248 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3249 | </text> | |
| 3250 | <text string="Bell" state="94"> | |
| 3251 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3252 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3253 | </text> | |
| 3254 | <text string="Bell" state="95"> | |
| 3255 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3256 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3257 | </text> | |
| 3258 | </element> | |
| 3259 | ||
| 3260 | <element name="Reel4" defstate="96"> | |
| 3261 | <text string="Bell" state="0"> | |
| 3262 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3263 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3264 | </text> | |
| 3265 | <text string="Bell" state="1"> | |
| 3266 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3267 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3268 | </text> | |
| 3269 | <text string="Bell" state="2"> | |
| 3270 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3271 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3272 | </text> | |
| 3273 | <text string="Bell" state="3"> | |
| 3274 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3275 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3276 | </text> | |
| 3277 | <text string="Bell" state="4"> | |
| 3278 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3279 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3280 | </text> | |
| 3281 | <text string="Bell" state="5"> | |
| 3282 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3283 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3284 | </text> | |
| 3285 | <text string="7" state="6"> | |
| 3286 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3287 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3288 | </text> | |
| 3289 | <text string="7" state="7"> | |
| 3290 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3291 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3292 | </text> | |
| 3293 | <text string="7" state="8"> | |
| 3294 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3295 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3296 | </text> | |
| 3297 | <text string="7" state="9"> | |
| 3298 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3299 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3300 | </text> | |
| 3301 | <text string="7" state="10"> | |
| 3302 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3303 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3304 | </text> | |
| 3305 | <text string="7" state="11"> | |
| 3306 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3307 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3308 | </text> | |
| 3309 | <text string="Bell" state="12"> | |
| 3310 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3311 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3312 | </text> | |
| 3313 | <text string="Bell" state="13"> | |
| 3314 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3315 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3316 | </text> | |
| 3317 | <text string="Bell" state="14"> | |
| 3318 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3319 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3320 | </text> | |
| 3321 | <text string="Bell" state="15"> | |
| 3322 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3323 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3324 | </text> | |
| 3325 | <text string="Bell" state="16"> | |
| 3326 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3327 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3328 | </text> | |
| 3329 | <text string="Bell" state="17"> | |
| 3330 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3331 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3332 | </text> | |
| 3333 | <text string="Bar" state="18"> | |
| 3334 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3335 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3336 | </text> | |
| 3337 | <text string="Bar" state="19"> | |
| 3338 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3339 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3340 | </text> | |
| 3341 | <text string="Bar" state="20"> | |
| 3342 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3343 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3344 | </text> | |
| 3345 | <text string="Bar" state="21"> | |
| 3346 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3347 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3348 | </text> | |
| 3349 | <text string="Bar" state="22"> | |
| 3350 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3351 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3352 | </text> | |
| 3353 | <text string="Bar" state="23"> | |
| 3354 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3355 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3356 | </text> | |
| 3357 | <text string="7" state="24"> | |
| 3358 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3359 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3360 | </text> | |
| 3361 | <text string="7" state="25"> | |
| 3362 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3363 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3364 | </text> | |
| 3365 | <text string="7" state="26"> | |
| 3366 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3367 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3368 | </text> | |
| 3369 | <text string="7" state="27"> | |
| 3370 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3371 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3372 | </text> | |
| 3373 | <text string="7" state="28"> | |
| 3374 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3375 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3376 | </text> | |
| 3377 | <text string="7" state="29"> | |
| 3378 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3379 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3380 | </text> | |
| 3381 | <text string="Cherry" state="30"> | |
| 3382 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3383 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3384 | </text> | |
| 3385 | <text string="Cherry" state="31"> | |
| 3386 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3387 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3388 | </text> | |
| 3389 | <text string="Cherry" state="32"> | |
| 3390 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3391 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3392 | </text> | |
| 3393 | <text string="Cherry" state="33"> | |
| 3394 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3395 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3396 | </text> | |
| 3397 | <text string="Cherry" state="34"> | |
| 3398 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3399 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3400 | </text> | |
| 3401 | <text string="Cherry" state="35"> | |
| 3402 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3403 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3404 | </text> | |
| 3405 | <text string="Melon" state="36"> | |
| 3406 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3407 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3408 | </text> | |
| 3409 | <text string="Melon" state="37"> | |
| 3410 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3411 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3412 | </text> | |
| 3413 | <text string="Melon" state="38"> | |
| 3414 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3415 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3416 | </text> | |
| 3417 | <text string="Melon" state="39"> | |
| 3418 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3419 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3420 | </text> | |
| 3421 | <text string="Melon" state="40"> | |
| 3422 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3423 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3424 | </text> | |
| 3425 | <text string="Melon" state="41"> | |
| 3426 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3427 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3428 | </text> | |
| 3429 | <text string="Bell" state="42"> | |
| 3430 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3431 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3432 | </text> | |
| 3433 | <text string="Bell" state="43"> | |
| 3434 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3435 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3436 | </text> | |
| 3437 | <text string="Bell" state="44"> | |
| 3438 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3439 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3440 | </text> | |
| 3441 | <text string="Bell" state="45"> | |
| 3442 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3443 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3444 | </text> | |
| 3445 | <text string="Bell" state="46"> | |
| 3446 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3447 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3448 | </text> | |
| 3449 | <text string="Bell" state="47"> | |
| 3450 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3451 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3452 | </text> | |
| 3453 | <text string="Cherry" state="48"> | |
| 3454 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3455 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3456 | </text> | |
| 3457 | <text string="Cherry" state="49"> | |
| 3458 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3459 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3460 | </text> | |
| 3461 | <text string="Cherry" state="50"> | |
| 3462 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3463 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3464 | </text> | |
| 3465 | <text string="Cherry" state="51"> | |
| 3466 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3467 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3468 | </text> | |
| 3469 | <text string="Cherry" state="52"> | |
| 3470 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3471 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3472 | </text> | |
| 3473 | <text string="Cherry" state="53"> | |
| 3474 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3475 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3476 | </text> | |
| 3477 | <text string="Bar" state="54"> | |
| 3478 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3479 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3480 | </text> | |
| 3481 | <text string="Bar" state="55"> | |
| 3482 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3483 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3484 | </text> | |
| 3485 | <text string="Bar" state="56"> | |
| 3486 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3487 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3488 | </text> | |
| 3489 | <text string="Bar" state="57"> | |
| 3490 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3491 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3492 | </text> | |
| 3493 | <text string="Bar" state="58"> | |
| 3494 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3495 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3496 | </text> | |
| 3497 | <text string="Bar" state="59"> | |
| 3498 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3499 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3500 | </text> | |
| 3501 | <text string="7" state="60"> | |
| 3502 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3503 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3504 | </text> | |
| 3505 | <text string="7" state="61"> | |
| 3506 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3507 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3508 | </text> | |
| 3509 | <text string="7" state="62"> | |
| 3510 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3511 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3512 | </text> | |
| 3513 | <text string="7" state="63"> | |
| 3514 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3515 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3516 | </text> | |
| 3517 | <text string="7" state="64"> | |
| 3518 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3519 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3520 | </text> | |
| 3521 | <text string="7" state="65"> | |
| 3522 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3523 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3524 | </text> | |
| 3525 | <text string="Melon" state="66"> | |
| 3526 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3527 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3528 | </text> | |
| 3529 | <text string="Melon" state="67"> | |
| 3530 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3531 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3532 | </text> | |
| 3533 | <text string="Melon" state="68"> | |
| 3534 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3535 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3536 | </text> | |
| 3537 | <text string="Melon" state="69"> | |
| 3538 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3539 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3540 | </text> | |
| 3541 | <text string="Melon" state="70"> | |
| 3542 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3543 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3544 | </text> | |
| 3545 | <text string="Melon" state="71"> | |
| 3546 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3547 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3548 | </text> | |
| 3549 | <text string="Cherry" state="72"> | |
| 3550 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3551 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3552 | </text> | |
| 3553 | <text string="Cherry" state="73"> | |
| 3554 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3555 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3556 | </text> | |
| 3557 | <text string="Cherry" state="74"> | |
| 3558 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3559 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3560 | </text> | |
| 3561 | <text string="Cherry" state="75"> | |
| 3562 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3563 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3564 | </text> | |
| 3565 | <text string="Cherry" state="76"> | |
| 3566 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3567 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3568 | </text> | |
| 3569 | <text string="Cherry" state="77"> | |
| 3570 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3571 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3572 | </text> | |
| 3573 | <text string="Bell" state="78"> | |
| 3574 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3575 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3576 | </text> | |
| 3577 | <text string="Bell" state="79"> | |
| 3578 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3579 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3580 | </text> | |
| 3581 | <text string="Bell" state="80"> | |
| 3582 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3583 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3584 | </text> | |
| 3585 | <text string="Bell" state="81"> | |
| 3586 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3587 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3588 | </text> | |
| 3589 | <text string="Bell" state="82"> | |
| 3590 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3591 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3592 | </text> | |
| 3593 | <text string="Bell" state="83"> | |
| 3594 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3595 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3596 | </text> | |
| 3597 | <text string="Bar" state="84"> | |
| 3598 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3599 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3600 | </text> | |
| 3601 | <text string="Bar" state="85"> | |
| 3602 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3603 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3604 | </text> | |
| 3605 | <text string="Bar" state="86"> | |
| 3606 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3607 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3608 | </text> | |
| 3609 | <text string="Bar" state="87"> | |
| 3610 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3611 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3612 | </text> | |
| 3613 | <text string="Bar" state="88"> | |
| 3614 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3615 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3616 | </text> | |
| 3617 | <text string="Bar" state="89"> | |
| 3618 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3619 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3620 | </text> | |
| 3621 | <text string="Melon" state="90"> | |
| 3622 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3623 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3624 | </text> | |
| 3625 | <text string="Melon" state="91"> | |
| 3626 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3627 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3628 | </text> | |
| 3629 | <text string="Melon" state="92"> | |
| 3630 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3631 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3632 | </text> | |
| 3633 | <text string="Melon" state="93"> | |
| 3634 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3635 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3636 | </text> | |
| 3637 | <text string="Melon" state="94"> | |
| 3638 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3639 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3640 | </text> | |
| 3641 | <text string="Melon" state="95"> | |
| 3642 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 3643 | <bounds x="0" y="0.1" width="1" height="1" /> | |
| 3644 | </text> | |
| 3645 | </element> | |
| 3646 | <element name="vfd0"> | |
| 3647 | <led16segsc> | |
| 3648 | <color red="0" green="0.6" blue="1.0" /> | |
| 3649 | </led16segsc> | |
| 3650 | </element> | |
| 3651 | ||
| 3652 | <view name="Gamball AWP Simulated Video (No Artwork)"> | |
| 3653 | <backdrop name="TotalReels" element="TotalReels"/> | |
| 3654 | <backdrop name="ReelSteps1" element="ReelSteps1"/> | |
| 3655 | <backdrop name="ReelSteps2" element="ReelSteps2"/> | |
| 3656 | <backdrop name="ReelSteps3" element="ReelSteps2"/> | |
| 3657 | <backdrop name="ReelSteps4" element="ReelSteps2"/> | |
| 3658 | <backdrop name="ReelSymbols1" element="ReelSymbols1"/> | |
| 3659 | <backdrop name="ReelSymbols2" element="ReelSymbols1"/> | |
| 3660 | <backdrop name="ReelSymbols3" element="ReelSymbols1"/> | |
| 3661 | <backdrop name="ReelSymbols4" element="ReelSymbols1"/> | |
| 3662 | <backdrop name="reel1a1" element="Reel1" state="96"> | |
| 3663 | <bounds x="85" y="463" width="49" height="29.3333"/> | |
| 3664 | </backdrop> | |
| 3665 | <backdrop name="reel1" element="Reel1" state="96"> | |
| 3666 | <bounds x="85" y="491.3333" width="49" height="29.3333"/> | |
| 3667 | </backdrop> | |
| 3668 | <backdrop name="reel1b1" element="Reel1" state="96"> | |
| 3669 | <bounds x="85" y="520.6666" width="49" height="29.3333"/> | |
| 3670 | </backdrop> | |
| 3671 | <backdrop name="reel2a1" element="Reel2" state="96"> | |
| 3672 | <bounds x="161" y="463" width="49" height="29.3333"/> | |
| 3673 | </backdrop> | |
| 3674 | <backdrop name="reel2" element="Reel2" state="96"> | |
| 3675 | <bounds x="161" y="491.3333" width="49" height="29.3333"/> | |
| 3676 | </backdrop> | |
| 3677 | <backdrop name="reel2b1" element="Reel2" state="96"> | |
| 3678 | <bounds x="161" y="520.6666" width="49" height="29.3333"/> | |
| 3679 | </backdrop> | |
| 3680 | <backdrop name="reel3a1" element="Reel3" state="96"> | |
| 3681 | <bounds x="236" y="463" width="49" height="29.3333"/> | |
| 3682 | </backdrop> | |
| 3683 | <backdrop name="reel3" element="Reel3" state="96"> | |
| 3684 | <bounds x="236" y="491.3333" width="49" height="29.3333"/> | |
| 3685 | </backdrop> | |
| 3686 | <backdrop name="reel3b1" element="Reel3" state="96"> | |
| 3687 | <bounds x="236" y="520.6666" width="49" height="29.3333"/> | |
| 3688 | </backdrop> | |
| 3689 | <backdrop name="reel4a1" element="Reel4" state="96"> | |
| 3690 | <bounds x="311" y="463" width="49" height="29.3333"/> | |
| 3691 | </backdrop> | |
| 3692 | <backdrop name="reel4" element="Reel4" state="96"> | |
| 3693 | <bounds x="311" y="491.3333" width="49" height="29.3333"/> | |
| 3694 | </backdrop> | |
| 3695 | <backdrop name="reel4b1" element="Reel4" state="96"> | |
| 3696 | <bounds x="311" y="520.6666" width="49" height="29.3333"/> | |
| 3697 | </backdrop> | |
| 3698 | <backdrop name="lamp0" element="matrixlamp" state="0"> | |
| 3699 | <bounds x="0" y="0" width="7" height="7"/> | |
| 3700 | </backdrop> | |
| 3701 | <backdrop name="lamp1" element="matrixlamp" state="0"> | |
| 3702 | <bounds x="0" y="8" width="7" height="7"/> | |
| 3703 | </backdrop> | |
| 3704 | <backdrop name="lamp2" element="matrixlamp" state="0"> | |
| 3705 | <bounds x="0" y="16" width="7" height="7"/> | |
| 3706 | </backdrop> | |
| 3707 | <backdrop name="lamp3" element="matrixlamp" state="0"> | |
| 3708 | <bounds x="0" y="24" width="7" height="7"/> | |
| 3709 | </backdrop> | |
| 3710 | <backdrop name="lamp4" element="matrixlamp" state="0"> | |
| 3711 | <bounds x="0" y="32" width="7" height="7"/> | |
| 3712 | </backdrop> | |
| 3713 | <backdrop name="lamp5" element="matrixlamp" state="0"> | |
| 3714 | <bounds x="0" y="40" width="7" height="7"/> | |
| 3715 | </backdrop> | |
| 3716 | <backdrop name="lamp6" element="matrixlamp" state="0"> | |
| 3717 | <bounds x="0" y="48" width="7" height="7"/> | |
| 3718 | </backdrop> | |
| 3719 | <backdrop name="lamp7" element="matrixlamp" state="0"> | |
| 3720 | <bounds x="0" y="56" width="7" height="7"/> | |
| 3721 | </backdrop> | |
| 3722 | <backdrop name="lamp8" element="matrixlamp" state="0"> | |
| 3723 | <bounds x="8" y="0" width="7" height="7"/> | |
| 3724 | </backdrop> | |
| 3725 | <backdrop name="lamp9" element="matrixlamp" state="0"> | |
| 3726 | <bounds x="8" y="8" width="7" height="7"/> | |
| 3727 | </backdrop> | |
| 3728 | <backdrop name="lamp10" element="matrixlamp" state="0"> | |
| 3729 | <bounds x="8" y="16" width="7" height="7"/> | |
| 3730 | </backdrop> | |
| 3731 | <backdrop name="lamp11" element="matrixlamp" state="0"> | |
| 3732 | <bounds x="8" y="24" width="7" height="7"/> | |
| 3733 | </backdrop> | |
| 3734 | <backdrop name="lamp12" element="matrixlamp" state="0"> | |
| 3735 | <bounds x="8" y="32" width="7" height="7"/> | |
| 3736 | </backdrop> | |
| 3737 | <backdrop name="lamp13" element="matrixlamp" state="0"> | |
| 3738 | <bounds x="8" y="40" width="7" height="7"/> | |
| 3739 | </backdrop> | |
| 3740 | <backdrop name="lamp14" element="matrixlamp" state="0"> | |
| 3741 | <bounds x="8" y="48" width="7" height="7"/> | |
| 3742 | </backdrop> | |
| 3743 | <backdrop name="lamp15" element="matrixlamp" state="0"> | |
| 3744 | <bounds x="8" y="56" width="7" height="7"/> | |
| 3745 | </backdrop> | |
| 3746 | <backdrop name="lamp16" element="matrixlamp" state="0"> | |
| 3747 | <bounds x="16" y="0" width="7" height="7"/> | |
| 3748 | </backdrop> | |
| 3749 | <backdrop name="lamp17" element="matrixlamp" state="0"> | |
| 3750 | <bounds x="16" y="8" width="7" height="7"/> | |
| 3751 | </backdrop> | |
| 3752 | <backdrop name="lamp18" element="matrixlamp" state="0"> | |
| 3753 | <bounds x="16" y="16" width="7" height="7"/> | |
| 3754 | </backdrop> | |
| 3755 | <backdrop name="lamp19" element="matrixlamp" state="0"> | |
| 3756 | <bounds x="16" y="24" width="7" height="7"/> | |
| 3757 | </backdrop> | |
| 3758 | <backdrop name="lamp20" element="matrixlamp" state="0"> | |
| 3759 | <bounds x="16" y="32" width="7" height="7"/> | |
| 3760 | </backdrop> | |
| 3761 | <backdrop name="lamp21" element="matrixlamp" state="0"> | |
| 3762 | <bounds x="16" y="40" width="7" height="7"/> | |
| 3763 | </backdrop> | |
| 3764 | <backdrop name="lamp22" element="matrixlamp" state="0"> | |
| 3765 | <bounds x="16" y="48" width="7" height="7"/> | |
| 3766 | </backdrop> | |
| 3767 | <backdrop name="lamp23" element="matrixlamp" state="0"> | |
| 3768 | <bounds x="16" y="56" width="7" height="7"/> | |
| 3769 | </backdrop> | |
| 3770 | <backdrop name="lamp24" element="matrixlamp" state="0"> | |
| 3771 | <bounds x="24" y="0" width="7" height="7"/> | |
| 3772 | </backdrop> | |
| 3773 | <backdrop name="lamp25" element="matrixlamp" state="0"> | |
| 3774 | <bounds x="24" y="8" width="7" height="7"/> | |
| 3775 | </backdrop> | |
| 3776 | <backdrop name="lamp26" element="matrixlamp" state="0"> | |
| 3777 | <bounds x="24" y="16" width="7" height="7"/> | |
| 3778 | </backdrop> | |
| 3779 | <backdrop name="lamp27" element="matrixlamp" state="0"> | |
| 3780 | <bounds x="24" y="24" width="7" height="7"/> | |
| 3781 | </backdrop> | |
| 3782 | <backdrop name="lamp28" element="matrixlamp" state="0"> | |
| 3783 | <bounds x="24" y="32" width="7" height="7"/> | |
| 3784 | </backdrop> | |
| 3785 | <backdrop name="lamp29" element="matrixlamp" state="0"> | |
| 3786 | <bounds x="24" y="40" width="7" height="7"/> | |
| 3787 | </backdrop> | |
| 3788 | <backdrop name="lamp30" element="matrixlamp" state="0"> | |
| 3789 | <bounds x="24" y="48" width="7" height="7"/> | |
| 3790 | </backdrop> | |
| 3791 | <backdrop name="lamp31" element="matrixlamp" state="0"> | |
| 3792 | <bounds x="24" y="56" width="7" height="7"/> | |
| 3793 | </backdrop> | |
| 3794 | <backdrop name="lamp32" element="matrixlamp" state="0"> | |
| 3795 | <bounds x="32" y="0" width="7" height="7"/> | |
| 3796 | </backdrop> | |
| 3797 | <backdrop name="lamp33" element="matrixlamp" state="0"> | |
| 3798 | <bounds x="32" y="8" width="7" height="7"/> | |
| 3799 | </backdrop> | |
| 3800 | <backdrop name="lamp34" element="matrixlamp" state="0"> | |
| 3801 | <bounds x="32" y="16" width="7" height="7"/> | |
| 3802 | </backdrop> | |
| 3803 | <backdrop name="lamp35" element="matrixlamp" state="0"> | |
| 3804 | <bounds x="32" y="24" width="7" height="7"/> | |
| 3805 | </backdrop> | |
| 3806 | <backdrop name="lamp36" element="matrixlamp" state="0"> | |
| 3807 | <bounds x="32" y="32" width="7" height="7"/> | |
| 3808 | </backdrop> | |
| 3809 | <backdrop name="lamp37" element="matrixlamp" state="0"> | |
| 3810 | <bounds x="32" y="40" width="7" height="7"/> | |
| 3811 | </backdrop> | |
| 3812 | <backdrop name="lamp38" element="matrixlamp" state="0"> | |
| 3813 | <bounds x="32" y="48" width="7" height="7"/> | |
| 3814 | </backdrop> | |
| 3815 | <backdrop name="lamp39" element="matrixlamp" state="0"> | |
| 3816 | <bounds x="32" y="56" width="7" height="7"/> | |
| 3817 | </backdrop> | |
| 3818 | <backdrop name="lamp40" element="matrixlamp" state="0"> | |
| 3819 | <bounds x="40" y="0" width="7" height="7"/> | |
| 3820 | </backdrop> | |
| 3821 | <backdrop name="lamp41" element="matrixlamp" state="0"> | |
| 3822 | <bounds x="40" y="8" width="7" height="7"/> | |
| 3823 | </backdrop> | |
| 3824 | <backdrop name="lamp42" element="matrixlamp" state="0"> | |
| 3825 | <bounds x="40" y="16" width="7" height="7"/> | |
| 3826 | </backdrop> | |
| 3827 | <backdrop name="lamp43" element="matrixlamp" state="0"> | |
| 3828 | <bounds x="40" y="24" width="7" height="7"/> | |
| 3829 | </backdrop> | |
| 3830 | <backdrop name="lamp44" element="matrixlamp" state="0"> | |
| 3831 | <bounds x="40" y="32" width="7" height="7"/> | |
| 3832 | </backdrop> | |
| 3833 | <backdrop name="lamp45" element="matrixlamp" state="0"> | |
| 3834 | <bounds x="40" y="40" width="7" height="7"/> | |
| 3835 | </backdrop> | |
| 3836 | <backdrop name="lamp46" element="matrixlamp" state="0"> | |
| 3837 | <bounds x="40" y="48" width="7" height="7"/> | |
| 3838 | </backdrop> | |
| 3839 | <backdrop name="lamp47" element="matrixlamp" state="0"> | |
| 3840 | <bounds x="40" y="56" width="7" height="7"/> | |
| 3841 | </backdrop> | |
| 3842 | <backdrop name="lamp48" element="matrixlamp" state="0"> | |
| 3843 | <bounds x="48" y="0" width="7" height="7"/> | |
| 3844 | </backdrop> | |
| 3845 | <backdrop name="lamp49" element="matrixlamp" state="0"> | |
| 3846 | <bounds x="48" y="8" width="7" height="7"/> | |
| 3847 | </backdrop> | |
| 3848 | <backdrop name="lamp50" element="matrixlamp" state="0"> | |
| 3849 | <bounds x="48" y="16" width="7" height="7"/> | |
| 3850 | </backdrop> | |
| 3851 | <backdrop name="lamp51" element="matrixlamp" state="0"> | |
| 3852 | <bounds x="48" y="24" width="7" height="7"/> | |
| 3853 | </backdrop> | |
| 3854 | <backdrop name="lamp52" element="matrixlamp" state="0"> | |
| 3855 | <bounds x="48" y="32" width="7" height="7"/> | |
| 3856 | </backdrop> | |
| 3857 | <backdrop name="lamp53" element="matrixlamp" state="0"> | |
| 3858 | <bounds x="48" y="40" width="7" height="7"/> | |
| 3859 | </backdrop> | |
| 3860 | <backdrop name="lamp54" element="matrixlamp" state="0"> | |
| 3861 | <bounds x="48" y="48" width="7" height="7"/> | |
| 3862 | </backdrop> | |
| 3863 | <backdrop name="lamp55" element="matrixlamp" state="0"> | |
| 3864 | <bounds x="48" y="56" width="7" height="7"/> | |
| 3865 | </backdrop> | |
| 3866 | <backdrop name="lamp56" element="matrixlamp" state="0"> | |
| 3867 | <bounds x="56" y="0" width="7" height="7"/> | |
| 3868 | </backdrop> | |
| 3869 | <backdrop name="lamp57" element="matrixlamp" state="0"> | |
| 3870 | <bounds x="56" y="8" width="7" height="7"/> | |
| 3871 | </backdrop> | |
| 3872 | <backdrop name="lamp58" element="matrixlamp" state="0"> | |
| 3873 | <bounds x="56" y="16" width="7" height="7"/> | |
| 3874 | </backdrop> | |
| 3875 | <backdrop name="lamp59" element="matrixlamp" state="0"> | |
| 3876 | <bounds x="56" y="24" width="7" height="7"/> | |
| 3877 | </backdrop> | |
| 3878 | <backdrop name="lamp60" element="matrixlamp" state="0"> | |
| 3879 | <bounds x="56" y="32" width="7" height="7"/> | |
| 3880 | </backdrop> | |
| 3881 | <backdrop name="lamp61" element="matrixlamp" state="0"> | |
| 3882 | <bounds x="56" y="40" width="7" height="7"/> | |
| 3883 | </backdrop> | |
| 3884 | <backdrop name="lamp62" element="matrixlamp" state="0"> | |
| 3885 | <bounds x="56" y="48" width="7" height="7"/> | |
| 3886 | </backdrop> | |
| 3887 | <backdrop name="lamp63" element="matrixlamp" state="0"> | |
| 3888 | <bounds x="56" y="56" width="7" height="7"/> | |
| 3889 | </backdrop> | |
| 3890 | <backdrop name="lamp64" element="matrixlamp" state="0"> | |
| 3891 | <bounds x="64" y="0" width="7" height="7"/> | |
| 3892 | </backdrop> | |
| 3893 | <backdrop name="lamp65" element="matrixlamp" state="0"> | |
| 3894 | <bounds x="64" y="8" width="7" height="7"/> | |
| 3895 | </backdrop> | |
| 3896 | <backdrop name="lamp66" element="matrixlamp" state="0"> | |
| 3897 | <bounds x="64" y="16" width="7" height="7"/> | |
| 3898 | </backdrop> | |
| 3899 | <backdrop name="lamp67" element="matrixlamp" state="0"> | |
| 3900 | <bounds x="64" y="24" width="7" height="7"/> | |
| 3901 | </backdrop> | |
| 3902 | <backdrop name="lamp68" element="matrixlamp" state="0"> | |
| 3903 | <bounds x="64" y="32" width="7" height="7"/> | |
| 3904 | </backdrop> | |
| 3905 | <backdrop name="lamp69" element="matrixlamp" state="0"> | |
| 3906 | <bounds x="64" y="40" width="7" height="7"/> | |
| 3907 | </backdrop> | |
| 3908 | <backdrop name="lamp70" element="matrixlamp" state="0"> | |
| 3909 | <bounds x="64" y="48" width="7" height="7"/> | |
| 3910 | </backdrop> | |
| 3911 | <backdrop name="lamp71" element="matrixlamp" state="0"> | |
| 3912 | <bounds x="64" y="56" width="7" height="7"/> | |
| 3913 | </backdrop> | |
| 3914 | <backdrop name="lamp72" element="matrixlamp" state="0"> | |
| 3915 | <bounds x="72" y="0" width="7" height="7"/> | |
| 3916 | </backdrop> | |
| 3917 | <backdrop name="lamp73" element="matrixlamp" state="0"> | |
| 3918 | <bounds x="72" y="8" width="7" height="7"/> | |
| 3919 | </backdrop> | |
| 3920 | <backdrop name="lamp74" element="matrixlamp" state="0"> | |
| 3921 | <bounds x="72" y="16" width="7" height="7"/> | |
| 3922 | </backdrop> | |
| 3923 | <backdrop name="lamp75" element="matrixlamp" state="0"> | |
| 3924 | <bounds x="72" y="24" width="7" height="7"/> | |
| 3925 | </backdrop> | |
| 3926 | <backdrop name="lamp76" element="matrixlamp" state="0"> | |
| 3927 | <bounds x="72" y="32" width="7" height="7"/> | |
| 3928 | </backdrop> | |
| 3929 | <backdrop name="lamp77" element="matrixlamp" state="0"> | |
| 3930 | <bounds x="72" y="40" width="7" height="7"/> | |
| 3931 | </backdrop> | |
| 3932 | <backdrop name="lamp78" element="matrixlamp" state="0"> | |
| 3933 | <bounds x="72" y="48" width="7" height="7"/> | |
| 3934 | </backdrop> | |
| 3935 | <backdrop name="lamp79" element="matrixlamp" state="0"> | |
| 3936 | <bounds x="72" y="56" width="7" height="7"/> | |
| 3937 | </backdrop> | |
| 3938 | <backdrop name="lamp80" element="matrixlamp" state="0"> | |
| 3939 | <bounds x="80" y="0" width="7" height="7"/> | |
| 3940 | </backdrop> | |
| 3941 | <backdrop name="lamp81" element="matrixlamp" state="0"> | |
| 3942 | <bounds x="80" y="8" width="7" height="7"/> | |
| 3943 | </backdrop> | |
| 3944 | <backdrop name="lamp82" element="matrixlamp" state="0"> | |
| 3945 | <bounds x="80" y="16" width="7" height="7"/> | |
| 3946 | </backdrop> | |
| 3947 | <backdrop name="lamp83" element="matrixlamp" state="0"> | |
| 3948 | <bounds x="80" y="24" width="7" height="7"/> | |
| 3949 | </backdrop> | |
| 3950 | <backdrop name="lamp84" element="matrixlamp" state="0"> | |
| 3951 | <bounds x="80" y="32" width="7" height="7"/> | |
| 3952 | </backdrop> | |
| 3953 | <backdrop name="lamp85" element="matrixlamp" state="0"> | |
| 3954 | <bounds x="80" y="40" width="7" height="7"/> | |
| 3955 | </backdrop> | |
| 3956 | <backdrop name="lamp86" element="matrixlamp" state="0"> | |
| 3957 | <bounds x="80" y="48" width="7" height="7"/> | |
| 3958 | </backdrop> | |
| 3959 | <backdrop name="lamp87" element="matrixlamp" state="0"> | |
| 3960 | <bounds x="80" y="56" width="7" height="7"/> | |
| 3961 | </backdrop> | |
| 3962 | <backdrop name="lamp88" element="matrixlamp" state="0"> | |
| 3963 | <bounds x="88" y="0" width="7" height="7"/> | |
| 3964 | </backdrop> | |
| 3965 | <backdrop name="lamp89" element="matrixlamp" state="0"> | |
| 3966 | <bounds x="88" y="8" width="7" height="7"/> | |
| 3967 | </backdrop> | |
| 3968 | <backdrop name="lamp90" element="matrixlamp" state="0"> | |
| 3969 | <bounds x="88" y="16" width="7" height="7"/> | |
| 3970 | </backdrop> | |
| 3971 | <backdrop name="lamp91" element="matrixlamp" state="0"> | |
| 3972 | <bounds x="88" y="24" width="7" height="7"/> | |
| 3973 | </backdrop> | |
| 3974 | <backdrop name="lamp92" element="matrixlamp" state="0"> | |
| 3975 | <bounds x="88" y="32" width="7" height="7"/> | |
| 3976 | </backdrop> | |
| 3977 | <backdrop name="lamp93" element="matrixlamp" state="0"> | |
| 3978 | <bounds x="88" y="40" width="7" height="7"/> | |
| 3979 | </backdrop> | |
| 3980 | <backdrop name="lamp94" element="matrixlamp" state="0"> | |
| 3981 | <bounds x="88" y="48" width="7" height="7"/> | |
| 3982 | </backdrop> | |
| 3983 | <backdrop name="lamp95" element="matrixlamp" state="0"> | |
| 3984 | <bounds x="88" y="56" width="7" height="7"/> | |
| 3985 | </backdrop> | |
| 3986 | <backdrop name="lamp96" element="matrixlamp" state="0"> | |
| 3987 | <bounds x="96" y="0" width="7" height="7"/> | |
| 3988 | </backdrop> | |
| 3989 | <backdrop name="lamp97" element="matrixlamp" state="0"> | |
| 3990 | <bounds x="96" y="8" width="7" height="7"/> | |
| 3991 | </backdrop> | |
| 3992 | <backdrop name="lamp98" element="matrixlamp" state="0"> | |
| 3993 | <bounds x="96" y="16" width="7" height="7"/> | |
| 3994 | </backdrop> | |
| 3995 | <backdrop name="lamp99" element="matrixlamp" state="0"> | |
| 3996 | <bounds x="96" y="24" width="7" height="7"/> | |
| 3997 | </backdrop> | |
| 3998 | <backdrop name="lamp100" element="matrixlamp" state="0"> | |
| 3999 | <bounds x="96" y="32" width="7" height="7"/> | |
| 4000 | </backdrop> | |
| 4001 | <backdrop name="lamp101" element="matrixlamp" state="0"> | |
| 4002 | <bounds x="96" y="40" width="7" height="7"/> | |
| 4003 | </backdrop> | |
| 4004 | <backdrop name="lamp102" element="matrixlamp" state="0"> | |
| 4005 | <bounds x="96" y="48" width="7" height="7"/> | |
| 4006 | </backdrop> | |
| 4007 | <backdrop name="lamp103" element="matrixlamp" state="0"> | |
| 4008 | <bounds x="96" y="56" width="7" height="7"/> | |
| 4009 | </backdrop> | |
| 4010 | <backdrop name="lamp104" element="matrixlamp" state="0"> | |
| 4011 | <bounds x="104" y="0" width="7" height="7"/> | |
| 4012 | </backdrop> | |
| 4013 | <backdrop name="lamp105" element="matrixlamp" state="0"> | |
| 4014 | <bounds x="104" y="8" width="7" height="7"/> | |
| 4015 | </backdrop> | |
| 4016 | <backdrop name="lamp106" element="matrixlamp" state="0"> | |
| 4017 | <bounds x="104" y="16" width="7" height="7"/> | |
| 4018 | </backdrop> | |
| 4019 | <backdrop name="lamp107" element="matrixlamp" state="0"> | |
| 4020 | <bounds x="104" y="24" width="7" height="7"/> | |
| 4021 | </backdrop> | |
| 4022 | <backdrop name="lamp108" element="matrixlamp" state="0"> | |
| 4023 | <bounds x="104" y="32" width="7" height="7"/> | |
| 4024 | </backdrop> | |
| 4025 | <backdrop name="lamp109" element="matrixlamp" state="0"> | |
| 4026 | <bounds x="104" y="40" width="7" height="7"/> | |
| 4027 | </backdrop> | |
| 4028 | <backdrop name="lamp110" element="matrixlamp" state="0"> | |
| 4029 | <bounds x="104" y="48" width="7" height="7"/> | |
| 4030 | </backdrop> | |
| 4031 | <backdrop name="lamp111" element="matrixlamp" state="0"> | |
| 4032 | <bounds x="104" y="56" width="7" height="7"/> | |
| 4033 | </backdrop> | |
| 4034 | <backdrop name="lamp112" element="matrixlamp" state="0"> | |
| 4035 | <bounds x="112" y="0" width="7" height="7"/> | |
| 4036 | </backdrop> | |
| 4037 | <backdrop name="lamp113" element="matrixlamp" state="0"> | |
| 4038 | <bounds x="112" y="8" width="7" height="7"/> | |
| 4039 | </backdrop> | |
| 4040 | <backdrop name="lamp114" element="matrixlamp" state="0"> | |
| 4041 | <bounds x="112" y="16" width="7" height="7"/> | |
| 4042 | </backdrop> | |
| 4043 | <backdrop name="lamp115" element="matrixlamp" state="0"> | |
| 4044 | <bounds x="112" y="24" width="7" height="7"/> | |
| 4045 | </backdrop> | |
| 4046 | <backdrop name="lamp116" element="matrixlamp" state="0"> | |
| 4047 | <bounds x="112" y="32" width="7" height="7"/> | |
| 4048 | </backdrop> | |
| 4049 | <backdrop name="lamp117" element="matrixlamp" state="0"> | |
| 4050 | <bounds x="112" y="40" width="7" height="7"/> | |
| 4051 | </backdrop> | |
| 4052 | <backdrop name="lamp118" element="matrixlamp" state="0"> | |
| 4053 | <bounds x="112" y="48" width="7" height="7"/> | |
| 4054 | </backdrop> | |
| 4055 | <backdrop name="lamp119" element="matrixlamp" state="0"> | |
| 4056 | <bounds x="112" y="56" width="7" height="7"/> | |
| 4057 | </backdrop> | |
| 4058 | <backdrop name="lamp120" element="matrixlamp" state="0"> | |
| 4059 | <bounds x="120" y="0" width="7" height="7"/> | |
| 4060 | </backdrop> | |
| 4061 | <backdrop name="lamp121" element="matrixlamp" state="0"> | |
| 4062 | <bounds x="120" y="8" width="7" height="7"/> | |
| 4063 | </backdrop> | |
| 4064 | <backdrop name="lamp122" element="matrixlamp" state="0"> | |
| 4065 | <bounds x="120" y="16" width="7" height="7"/> | |
| 4066 | </backdrop> | |
| 4067 | <backdrop name="lamp123" element="matrixlamp" state="0"> | |
| 4068 | <bounds x="120" y="24" width="7" height="7"/> | |
| 4069 | </backdrop> | |
| 4070 | <backdrop name="lamp124" element="matrixlamp" state="0"> | |
| 4071 | <bounds x="120" y="32" width="7" height="7"/> | |
| 4072 | </backdrop> | |
| 4073 | <backdrop name="lamp125" element="matrixlamp" state="0"> | |
| 4074 | <bounds x="120" y="40" width="7" height="7"/> | |
| 4075 | </backdrop> | |
| 4076 | <backdrop name="lamp126" element="matrixlamp" state="0"> | |
| 4077 | <bounds x="120" y="48" width="7" height="7"/> | |
| 4078 | </backdrop> | |
| 4079 | <backdrop name="lamp127" element="matrixlamp" state="0"> | |
| 4080 | <bounds x="120" y="56" width="7" height="7"/> | |
| 4081 | </backdrop> | |
| 4082 | <backdrop name="digit3" element="digit" state="0"> | |
| 2012 | <backdrop name="digit4" element="digit" state="0"> | |
| 4083 | 2013 | <bounds x="308" y="230" width="8" height="10"/> |
| 4084 | 2014 | </backdrop> |
| 4085 | <backdrop name="digit4" element="digit" state="0"> | |
| 4086 | <bounds x="316" y="230" width="8" height="10"/> | |
| 4087 | </backdrop> | |
| 4088 | 2015 | <backdrop name="digit5" element="digit" state="0"> |
| 4089 | 2016 | <bounds x="300" y="200" width="8" height="10"/> |
| 4090 | 2017 | </backdrop> |
| r0 | r10316 | |
|---|---|---|
| 1 | <?xml version="1.0"?> | |
| 2 | <mamelayout version="2"> | |
| 3 | <element name="digit" defstate="0"> | |
| 4 | <led7seg> | |
| 5 | <color red="1.0" green="0.3" blue="0.0" /> | |
| 6 | </led7seg> | |
| 7 | </element> | |
| 8 | ||
| 9 | <view name="Simple LEDs"> | |
| 10 | <bounds left="0" right="256" top="0" bottom="256" /> | |
| 11 | ||
| 12 | <!-- left panel --> | |
| 13 | <!-- TIME --> | |
| 14 | <bezel name="digit3" element="digit"> | |
| 15 | <bounds left="0" top="0" right="9" bottom="15" /> | |
| 16 | </bezel> | |
| 17 | <bezel name="digit2" element="digit"> | |
| 18 | <bounds left="10" top="0" right="19" bottom="15" /> | |
| 19 | </bezel> | |
| 20 | ||
| 21 | <!-- not connected --> | |
| 22 | <bezel name="dummy_digita" element="digit"> | |
| 23 | <bounds left="20" top="0" right="29" bottom="15" /> | |
| 24 | </bezel> | |
| 25 | <bezel name="dummy_digitb" element="digit"> | |
| 26 | <bounds left="30" top="0" right="39" bottom="15" /> | |
| 27 | </bezel> | |
| 28 | ||
| 29 | <!-- M.P.H. --> | |
| 30 | <bezel name="digit1" element="digit"> | |
| 31 | <bounds left="40" top="0" right="49" bottom="15" /> | |
| 32 | </bezel> | |
| 33 | <bezel name="digit0" element="digit"> | |
| 34 | <bounds left="50" top="0" right="59" bottom="15" /> | |
| 35 | </bezel> | |
| 36 | ||
| 37 | <!-- right panel --> | |
| 38 | <!-- SCORE --> | |
| 39 | <bezel name="digit9" element="digit"> | |
| 40 | <bounds left="100" top="0" right="109" bottom="15" /> | |
| 41 | </bezel> | |
| 42 | <bezel name="digit8" element="digit"> | |
| 43 | <bounds left="110" top="0" right="119" bottom="15" /> | |
| 44 | </bezel> | |
| 45 | <bezel name="digit7" element="digit"> | |
| 46 | <bounds left="120" top="0" right="129" bottom="15" /> | |
| 47 | </bezel> | |
| 48 | <bezel name="digit6" element="digit"> | |
| 49 | <bounds left="130" top="0" right="139" bottom="15" /> | |
| 50 | </bezel> | |
| 51 | <bezel name="digit5" element="digit"> | |
| 52 | <bounds left="140" top="0" right="149" bottom="15" /> | |
| 53 | </bezel> | |
| 54 | <bezel name="digit4" element="digit"> | |
| 55 | <bounds left="150" top="0" right="159" bottom="15" /> | |
| 56 | </bezel> | |
| 57 | </view> | |
| 58 | </mamelayout> |
| r10315 | r10316 | |
|---|---|---|
| 1360 | 1360 | { |
| 1361 | 1361 | int i; |
| 1362 | 1362 | int changed = meter_latch ^ data; |
| 1363 | UINT64 cycles = downcast<cpu_device *>(space->cpu)->total_cycles(); | |
| 1364 | 1363 | |
| 1365 | 1364 | meter_latch = data; |
| 1366 | 1365 | |
| r10315 | r10316 | |
| 1372 | 1371 | { |
| 1373 | 1372 | if (changed & (1 << i)) |
| 1374 | 1373 | { |
| 1375 | Mech | |
| 1374 | MechMtr_update(i | |
| 1376 | 1375 | generic_pulse_irq_line(space->cpu, M6809_FIRQ_LINE); |
| 1377 | 1376 | } |
| 1378 | 1377 | } |
| r10315 | r10316 | |
|---|---|---|
| 290 | 290 | static WRITE8_HANDLER( sound_command_w ) |
| 291 | 291 | { |
| 292 | 292 | soundlatch_w(space, 0, data); |
| 293 | | |
| 293 | | |
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | static WRITE8_HANDLER( nmi_disable_w ) |
| r10315 | r10316 | |
|---|---|---|
| 92 | 92 | { |
| 93 | 93 | if (val == 0) |
| 94 | 94 | { |
| 95 | state->time_released = | |
| 95 | state->time_released = | |
| 96 | 96 | |
| 97 | 97 | if (!state->mask) |
| 98 | 98 | cpu_set_input_line(state->maincpu, INPUT_LINE_NMI, PULSE_LINE); |
| 99 | 99 | } |
| 100 | 100 | else |
| 101 | state->time_pushed = | |
| 101 | state->time_pushed = | |
| 102 | 102 | |
| 103 | 103 | state->prev = val; |
| 104 | 104 | } |
| r10315 | r10316 | |
| 119 | 119 | if (scanline >= 262) |
| 120 | 120 | scanline = 16; |
| 121 | 121 | |
| 122 | timer_set(machine | |
| 122 | machine->scheduler().timer_set(machine | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | |
| 126 | 126 | static double calc_plunger_pos(running_machine *machine) |
| 127 | 127 | { |
| 128 | 128 | mgolf_state *state = machine->driver_data<mgolf_state>(); |
| 129 | return ( | |
| 129 | return ( | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | |
| r10315 | r10316 | |
| 312 | 312 | static MACHINE_RESET( mgolf ) |
| 313 | 313 | { |
| 314 | 314 | mgolf_state *state = machine->driver_data<mgolf_state>(); |
| 315 | timer_set(machine | |
| 315 | machine->scheduler().timer_set(machine | |
| 316 | 316 | |
| 317 | 317 | state->mask = 0; |
| 318 | 318 | state->prev = 0; |
| r10315 | r10316 | |
|---|---|---|
| 86 | 86 | if (scanline > 256) |
| 87 | 87 | scanline = 0; |
| 88 | 88 | |
| 89 | timer_set(machine | |
| 89 | machine->scheduler().timer_set(machine | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | |
| r10315 | r10316 | |
| 356 | 356 | { |
| 357 | 357 | fgoal_state *state = machine->driver_data<fgoal_state>(); |
| 358 | 358 | |
| 359 | timer_set(machine | |
| 359 | machine->scheduler().timer_set(machine | |
| 360 | 360 | |
| 361 | 361 | state->xpos = 0; |
| 362 | 362 | state->ypos = 0; |
| r10315 | r10316 | |
|---|---|---|
| 269 | 269 | else |
| 270 | 270 | { |
| 271 | 271 | int changed = mmtr_latch ^ data; |
| 272 | UINT64 cycles = downcast<cpu_device *>(space->cpu)->total_cycles(); | |
| 273 | 272 | |
| 274 | 273 | mmtr_latch = data; |
| 275 | 274 | |
| r10315 | r10316 | |
| 277 | 276 | { |
| 278 | 277 | if ( changed & (1 << i) ) |
| 279 | 278 | { |
| 280 | Mech | |
| 279 | MechMtr_update(i | |
| 281 | 280 | generic_pulse_irq_line(space->machine->device("maincpu"), M6809_FIRQ_LINE); |
| 282 | 281 | } |
| 283 | 282 | } |
| r10315 | r10316 | |
| 1362 | 1361 | { |
| 1363 | 1362 | sc1_common_init(machine,3,1); |
| 1364 | 1363 | adder2_decode_char_roms(machine); // decode GFX roms |
| 1365 | Mech | |
| 1364 | MechMtr_config(machine,8); | |
| 1366 | 1365 | |
| 1367 | 1366 | BFM_BD1_init(0); |
| 1368 | 1367 | } |
| r10315 | r10316 | |
| 1370 | 1369 | static DRIVER_INIT(lotse) |
| 1371 | 1370 | { |
| 1372 | 1371 | sc1_common_init(machine,6,1); |
| 1373 | Mech | |
| 1372 | MechMtr_config(machine,8); | |
| 1374 | 1373 | |
| 1375 | 1374 | BFM_BD1_init(0); |
| 1376 | 1375 | BFM_BD1_init(1); |
| r10315 | r10316 | |
| 1381 | 1380 | static DRIVER_INIT(rou029) |
| 1382 | 1381 | { |
| 1383 | 1382 | sc1_common_init(machine,6,0); |
| 1384 | Mech | |
| 1383 | MechMtr_config(machine,8); | |
| 1385 | 1384 | |
| 1386 | 1385 | BFM_BD1_init(0); |
| 1387 | 1386 | } |
| r10315 | r10316 | |
| 1391 | 1390 | static DRIVER_INIT(clatt) |
| 1392 | 1391 | { |
| 1393 | 1392 | sc1_common_init(machine,6,1); |
| 1394 | Mech | |
| 1393 | MechMtr_config(machine,8); | |
| 1395 | 1394 | |
| 1396 | 1395 | BFM_BD1_init(0); |
| 1397 | 1396 |
| r10315 | r10316 | |
|---|---|---|
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | |
| 321 | static TIMER_CALLBACK( scanline_callback ) | |
| 321 | static TIMER_DEVICE_CALLBACK( scanline_callback ) | |
| 322 | 322 | { |
| 323 | segas1x_state *state = machine->driver_data<segas1x_state>(); | |
| 323 | segas1x_state *state = timer.machine->driver_data<segas1x_state>(); | |
| 324 | 324 | |
| 325 | 325 | int scanline = param; |
| 326 | 326 | int next_scanline = (scanline + 2) % 262; |
| r10315 | r10316 | |
| 349 | 349 | |
| 350 | 350 | /* update IRQs on the main CPU */ |
| 351 | 351 | if (update) |
| 352 | update_main_irqs(machine); | |
| 352 | update_main_irqs(timer.machine); | |
| 353 | 353 | |
| 354 | 354 | /* come back in 2 scanlines */ |
| 355 | timer | |
| 355 | timer.adjus | |
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | |
| r10315 | r10316 | |
| 385 | 385 | |
| 386 | 386 | static void sound_data_w(running_machine *machine, UINT8 data) |
| 387 | 387 | { |
| 388 | | |
| 388 | | |
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 | |
| r10315 | r10316 | |
| 424 | 424 | |
| 425 | 425 | static MACHINE_RESET( xboard ) |
| 426 | 426 | { |
| 427 | segas1x_state *state = machine->driver_data<segas1x_state>(); | |
| 427 | 428 | fd1094_machine_init(machine->device("maincpu")); |
| 428 | 429 | segaic16_tilemap_reset(machine, 0); |
| 429 | 430 | |
| r10315 | r10316 | |
| 431 | 432 | m68k_set_reset_callback(machine->device("maincpu"), xboard_reset); |
| 432 | 433 | |
| 433 | 434 | /* start timers to track interrupts */ |
| 434 | ti | |
| 435 | state->interrupt_timer->adjust(machine | |
| 435 | 436 | } |
| 436 | 437 | |
| 437 | 438 | |
| r10315 | r10316 | |
| 1349 | 1350 | MCFG_NVRAM_ADD_0FILL("backup2") |
| 1350 | 1351 | MCFG_QUANTUM_TIME(attotime::from_hz(6000)) |
| 1351 | 1352 | |
| 1353 | MCFG_TIMER_ADD("int_timer", scanline_callback) | |
| 1354 | ||
| 1352 | 1355 | MCFG_315_5248_ADD("5248_main") |
| 1353 | 1356 | MCFG_315_5248_ADD("5248_subx") |
| 1354 | 1357 | MCFG_315_5249_ADD("5249_main") |
| r10315 | r10316 | |
|---|---|---|
| 938 | 938 | state_save_register_global(machine, state->bar); |
| 939 | 939 | state_save_register_global(machine, state->snd_bank); |
| 940 | 940 | |
| 941 | state->music_timer = timer_alloc(m | |
| 941 | state->music_timer = machine->scheduler().timer_alloc(FUNC(m | |
| 942 | 942 | } |
| 943 | 943 | |
| 944 | 944 | static DRIVER_INIT( powerbls ) |
| r10315 | r10316 | |
|---|---|---|
| 848 | 848 | state_save_register_global_pointer(machine, jvs_sdata, 1024); |
| 849 | 849 | state_save_register_global(machine, jvs_sdata_ptr); |
| 850 | 850 | |
| 851 | sound_irq_timer = timer_alloc( | |
| 851 | sound_irq_timer = machine->scheduler().timer_alloc(FUNC(i | |
| 852 | 852 | } |
| 853 | 853 | |
| 854 | 854 | static MACHINE_RESET( hornet ) |
| r10315 | r10316 | |
|---|---|---|
| 224 | 224 | |
| 225 | 225 | static WRITE8_HANDLER( sound_command_w ) |
| 226 | 226 | { |
| 227 | | |
| 227 | | |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | |
| 231 | 231 | static WRITE8_HANDLER( sound_command_nonmi_w ) |
| 232 | 232 | { |
| 233 | | |
| 233 | | |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 |
| r10315 | r10316 | |
|---|---|---|
| 220 | 220 | memory_configure_bank(machine, "bank1", 0, 2, machine->region("maincpu")->base() + 0xa000, 0x6000); |
| 221 | 221 | |
| 222 | 222 | /* create a timer for IRQs and set up the first callback */ |
| 223 | state->irq_timer = timer_alloc( | |
| 223 | state->irq_timer = machine->scheduler().timer_alloc(FUNC(c | |
| 224 | 224 | state->irq_state = 0; |
| 225 | 225 | schedule_next_irq(machine, 0); |
| 226 | 226 |
| r10315 | r10316 | |
|---|---|---|
| 50 | 50 | static INTERRUPT_GEN( orbit_interrupt ) |
| 51 | 51 | { |
| 52 | 52 | cpu_set_input_line(device, 0, ASSERT_LINE); |
| 53 | | |
| 53 | | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 |
| r10315 | r10316 | |
|---|---|---|
| 127 | 127 | static INTERRUPT_GEN( irq4_gen ) |
| 128 | 128 | { |
| 129 | 129 | cpu_set_input_line(device, R3000_IRQ4, ASSERT_LINE); |
| 130 | | |
| 130 | | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 |
| r10315 | r10316 | |
|---|---|---|
| 259 | 259 | // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); |
| 260 | 260 | |
| 261 | 261 | if (!namcoio_read_reset_line(io58xx)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 262 | | |
| 262 | | |
| 263 | 263 | |
| 264 | 264 | if (!namcoio_read_reset_line(io56xx)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 265 | | |
| 265 | | |
| 266 | 266 | |
| 267 | 267 | } |
| 268 | 268 |
| r10315 | r10316 | |
|---|---|---|
| 399 | 399 | |
| 400 | 400 | MCFG_DEVICE_REMOVE("oki2") |
| 401 | 401 | MCFG_DEVICE_REMOVE("ym2203") |
| 402 | MCFG_DEVICE_REMOVE("nmk112") | |
| 402 | 403 | MACHINE_CONFIG_END |
| 403 | 404 | |
| 404 | 405 | static MACHINE_CONFIG_DERIVED( powerinb, powerins ) |
| r10315 | r10316 | |
|---|---|---|
| 158 | 158 | jedi_state *state = machine->driver_data<jedi_state>(); |
| 159 | 159 | |
| 160 | 160 | /* set a timer to run the interrupts */ |
| 161 | state->interrupt_timer = timer_alloc( | |
| 161 | state->interrupt_timer = machine->scheduler().timer_alloc(FUNC( | |
| 162 | 162 | timer_adjust_oneshot(state->interrupt_timer, machine->primary_screen->time_until_pos(32), 32); |
| 163 | 163 | |
| 164 | 164 | /* configure the banks */ |
| r10315 | r10316 | |
|---|---|---|
| 482 | 482 | n_game++; |
| 483 | 483 | } |
| 484 | 484 | |
| 485 | state->dip_timer = timer_alloc( | |
| 485 | state->dip_timer = machine->scheduler().timer_alloc( FUNC( | |
| 486 | 486 | } |
| 487 | 487 | |
| 488 | 488 | static void psx_spu_irq(device_t *device, UINT32 data) |
| r10315 | r10316 | |
|---|---|---|
| 78 | 78 | |
| 79 | 79 | static MACHINE_START( midzeus ) |
| 80 | 80 | { |
| 81 | timer[0] = timer_alloc(machine, NULL, NULL); | |
| 82 | timer[1] = timer_alloc(machine, NULL, NULL); | |
| 81 | timer[0] = machine->scheduler().timer_alloc(FUNC(NULL)); | |
| 82 | timer[1] = machine->scheduler().timer_alloc(FUNC(NULL)); | |
| 83 | 83 | |
| 84 | gun_timer[0] = timer_alloc(machine, invasn_gun_callback, NULL); | |
| 85 | gun_timer[1] = timer_alloc(machine, invasn_gun_callback, NULL); | |
| 84 | gun_timer[0] = machine->scheduler().timer_alloc(FUNC(invasn_gun_callback)); | |
| 85 | gun_timer[1] = machine->scheduler().timer_alloc(FUNC(invasn_gun_callback)); | |
| 86 | 86 | |
| 87 | 87 | state_save_register_global(machine, gun_control); |
| 88 | 88 | state_save_register_global(machine, gun_irq_state); |
| r10315 | r10316 | |
| 118 | 118 | static INTERRUPT_GEN( display_irq ) |
| 119 | 119 | { |
| 120 | 120 | cpu_set_input_line(device, 0, ASSERT_LINE); |
| 121 | | |
| 121 | | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 |
| r10315 | r10316 | |
|---|---|---|
| 245 | 245 | static WRITE16_HANDLER( sound_data_w ) |
| 246 | 246 | { |
| 247 | 247 | if (ACCESSING_BITS_0_7) |
| 248 | | |
| 248 | | |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 |
| r10315 | r10316 | |
|---|---|---|
| 267 | 267 | |
| 268 | 268 | /* we must do this on a timer in order to have it take effect */ |
| 269 | 269 | /* otherwise, the reset process will override our changes */ |
| 270 | | |
| 270 | | |
| 271 | 271 | |
| 272 | 272 | toprollr_rombank = 0; |
| 273 | 273 | } |
| r10315 | r10316 | |
|---|---|---|
| 267 | 267 | #include "cpu/mips/psx.h" |
| 268 | 268 | #include "includes/psx.h" |
| 269 | 269 | |
| 270 | WRITE32_HANDLER( namcos10_bank_w ) | |
| 271 | { | |
| 272 | memory_set_bank( space->machine, "bank1", data & 0xf ); | |
| 273 | } | |
| 274 | ||
| 270 | 275 | class namcos10_state : public psx_state |
| 271 | 276 | { |
| 272 | 277 | public: |
| r10315 | r10316 | |
| 275 | 280 | }; |
| 276 | 281 | |
| 277 | 282 | static ADDRESS_MAP_START( namcos10_map, ADDRESS_SPACE_PROGRAM, 32 ) |
| 278 | AM_RANGE(0x00000000, 0x00 | |
| 283 | AM_RANGE(0x00000000, 0x00ffffff) AM_RAM AM_SHARE("share1") /* ram */ | |
| 279 | 284 | AM_RANGE(0x1f800000, 0x1f8003ff) AM_RAM /* scratchpad */ |
| 280 | 285 | AM_RANGE(0x1f801000, 0x1f801007) AM_WRITENOP |
| 281 | 286 | AM_RANGE(0x1f801008, 0x1f80100b) AM_RAM /* ?? */ |
| r10315 | r10316 | |
| 293 | 298 | AM_RANGE(0x1f802020, 0x1f802033) AM_RAM /* ?? */ |
| 294 | 299 | AM_RANGE(0x1f802040, 0x1f802043) AM_WRITENOP |
| 295 | 300 | AM_RANGE(0x1fc00000, 0x1fffffff) AM_ROM AM_SHARE("share2") AM_REGION("user1", 0) /* bios */ |
| 296 | AM_RANGE(0x80000000, 0x80 | |
| 301 | AM_RANGE(0x80000000, 0x80ffffff) AM_RAM AM_SHARE("share1") /* ram mirror */ | |
| 297 | 302 | AM_RANGE(0x9fc00000, 0x9fffffff) AM_ROM AM_SHARE("share2") /* bios mirror */ |
| 298 | AM_RANGE(0xa0000000, 0xa0 | |
| 303 | AM_RANGE(0xa0000000, 0xa0ffffff) AM_RAM AM_SHARE("share1") /* ram mirror */ | |
| 299 | 304 | AM_RANGE(0xbfc00000, 0xbfffffff) AM_ROM AM_SHARE("share2") /* bios mirror */ |
| 300 | 305 | AM_RANGE(0xfffe0130, 0xfffe0133) AM_WRITENOP |
| 301 | 306 | ADDRESS_MAP_END |
| 302 | 307 | |
| 303 | static void mem | |
| 308 | static void memm_driver_init( | |
| 304 | 309 | { |
| 310 | psx_driver_init(machine); | |
| 311 | memory_install_write32_handler( cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1f300000, 0x1f300003, 0, 0, namcos10_bank_w ); | |
| 312 | memory_install_read_bank( cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1f400000, 0x1f7fffff, 0, 0, "bank1" ); | |
| 313 | memory_configure_bank( machine, "bank1", 0, 16, machine->region( "user2" )->base(), 4 * 1024 * 1024 ); | |
| 314 | } | |
| 315 | ||
| 316 | UINT8 *nand_base; | |
| 317 | UINT32 nand_address = 0; | |
| 318 | ||
| 319 | READ32_HANDLER( nand_status_r ) | |
| 320 | { | |
| 321 | return 0; | |
| 322 | } | |
| 323 | ||
| 324 | WRITE32_HANDLER( nand_address1_w ) | |
| 325 | { | |
| 326 | nand_address = ( nand_address & 0x00ffffff ) | ( ( data & 0xff ) << 24 ); | |
| 327 | } | |
| 328 | ||
| 329 | WRITE32_HANDLER( nand_address2_w ) | |
| 330 | { | |
| 331 | nand_address = ( nand_address & 0xff00ffff ) | ( ( data & 0xff ) << 16 ); | |
| 332 | } | |
| 333 | ||
| 334 | WRITE32_HANDLER( nand_address3_w ) | |
| 335 | { | |
| 336 | nand_address = ( nand_address & 0xffff00ff ) | ( ( data & 0xff ) << 8 ); | |
| 337 | } | |
| 338 | ||
| 339 | WRITE32_HANDLER( nand_address4_w ) | |
| 340 | { | |
| 341 | nand_address = ( nand_address & 0xffffff00 ) | ( ( data & 0xff ) << 0 ); | |
| 342 | } | |
| 343 | ||
| 344 | UINT16 nand_read( UINT32 address ) | |
| 345 | { | |
| 346 | int index = ( ( address / 512 ) * 528 ) + ( address % 512 ); | |
| 347 | return nand_base[ index ] | ( nand_base[ index + 1 ] << 8 ); | |
| 348 | } | |
| 349 | ||
| 350 | UINT16 nand_read2( UINT32 address ) | |
| 351 | { | |
| 352 | int index = ( ( address / 512 ) * 528 ) + ( address % 512 ); | |
| 353 | return nand_base[ index + 1 ] | ( nand_base[ index ] << 8 ); | |
| 354 | } | |
| 355 | ||
| 356 | READ32_HANDLER( nand_data_r ) | |
| 357 | { | |
| 358 | UINT32 data = nand_read2( nand_address * 2 ); | |
| 359 | ||
| 360 | printf( "data<-%08x (%08x)\n", data, nand_address ); | |
| 361 | nand_address++; | |
| 362 | ||
| 363 | return data; | |
| 364 | } | |
| 365 | ||
| 366 | static void nand_copy( UINT32 *dst, UINT32 address, int len ) | |
| 367 | { | |
| 305 | 368 | while( len > 0 ) |
| 306 | 369 | { |
| 307 | *( dst ) = ( *( src + 0 ) << 0 ) | ( *( src + 1 ) << 8 ) | ( *( src + 2 ) << 16 ) | ( *( src + 3 ) << 24 ); | |
| 308 | dst++; | |
| 309 | src += 4; | |
| 370 | *( dst++ ) = nand_read( address ) | ( nand_read( address + 2 ) << 16 ); | |
| 371 | address += 4; | |
| 310 | 372 | len -= 4; |
| 311 | 373 | } |
| 312 | 374 | } |
| 313 | 375 | |
| 314 | static void memm_driver_init( running_machine *machine ) | |
| 315 | { | |
| 316 | psx_driver_init(machine); | |
| 317 | } | |
| 318 | ||
| 319 | 376 | static void memn_driver_init( running_machine *machine ) |
| 320 | 377 | { |
| 321 | 378 | UINT8 *BIOS = (UINT8 *)machine->region( "user1" )->base(); |
| 322 | | |
| 379 | nand_base | |
| 323 | 380 | |
| 324 | memcpy32le( (UINT32 *)( BIOS + 0x0000000 ), ROM + 0x08000, 0x001c000 ); | |
| 325 | memcpy32le( (UINT32 *)( BIOS + 0x0020000 ), ROM + 0x24000, 0x03dffff ); | |
| 381 | nand_copy( (UINT32 *)( BIOS + 0x0000000 ), 0x08000, 0x001c000 ); | |
| 382 | nand_copy( (UINT32 *)( BIOS + 0x0020000 ), 0x24000, 0x03e0000 ); | |
| 326 | 383 | |
| 384 | memory_install_read32_handler( cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1f400000, 0x1f400003, 0, 0, nand_status_r ); | |
| 385 | memory_install_write32_handler( cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1f410000, 0x1f410003, 0, 0, nand_address1_w ); | |
| 386 | memory_install_write32_handler( cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1f420000, 0x1f420003, 0, 0, nand_address2_w ); | |
| 387 | memory_install_write32_handler( cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1f430000, 0x1f430003, 0, 0, nand_address3_w ); | |
| 388 | memory_install_write32_handler( cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1f440000, 0x1f440003, 0, 0, nand_address4_w ); | |
| 389 | memory_install_read32_handler( cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1f450000, 0x1f450003, 0, 0, nand_data_r ); | |
| 390 | ||
| 327 | 391 | psx_driver_init(machine); |
| 328 | 392 | } |
| 329 | 393 | |
| r10315 | r10316 | |
| 384 | 448 | |
| 385 | 449 | static MACHINE_CONFIG_START( namcos10, namcos10_state ) |
| 386 | 450 | /* basic machine hardware */ |
| 387 | MCFG_CPU_ADD( "maincpu", | |
| 451 | MCFG_CPU_ADD( "maincpu", | |
| 388 | 452 | MCFG_CPU_PROGRAM_MAP( namcos10_map) |
| 389 | 453 | MCFG_CPU_VBLANK_INT("screen", psx_vblank) |
| 390 | 454 | |
| r10315 | r10316 | |
| 465 | 529 | ROM_LOAD( "dr21vera.1a", 0x000000, 0x800000, CRC(f93532a2) SHA1(8b72f2868978be1f0e0abd11425a3c8b2b0c4e99) ) |
| 466 | 530 | |
| 467 | 531 | ROM_REGION( 0x4000000, "user2", 0 ) /* main prg */ |
| 468 | ROM_LOAD( "dr21ma1.1d", 0x0000000, 0x1000000, CRC(26dc6f55) SHA1(a9cedf547fa7a4d5850b9b3b867d46e577a035e0) ) | |
| 469 | ROM_LOAD( "dr21ma2.2d", 0x1000000, 0x1000000, CRC(702556ff) SHA1(c95defd5fd6a9b406fc8d8f28ecfab732ef1ff42) ) | |
| 532 | ROM_LOAD( "dr21ma1.1d", 0x0000000, 0x1000000, CRC(26dc6f55) SHA1(a9cedf547fa7a4d5850b9b3b867d46e577a035e0) ) | |
| 533 | ROM_LOAD( "dr21ma2.2d", 0x1000000, 0x1000000, CRC(702556ff) SHA1(c95defd5fd6a9b406fc8d8f28ecfab732ef1ff42) ) | |
| 470 | 534 | ROM_END |
| 471 | 535 | |
| 472 | 536 | ROM_START( mrdrlr2a ) |
| 473 | 537 | ROM_REGION32_LE( 0x800000, "user1", 0 ) /* main prg */ |
| 474 | ||
| 538 | | |
| 475 | 539 | |
| 476 | 540 | ROM_REGION( 0x4000000, "user2", 0 ) /* main prg */ |
| 477 | ROM_LOAD( "dr21ma1.1d", 0x0000000, 0x1000000, CRC(26dc6f55) SHA1(a9cedf547fa7a4d5850b9b3b867d46e577a035e0) ) | |
| 478 | ROM_LOAD( "dr21ma2.2d", 0x1000000, 0x1000000, CRC(702556ff) SHA1(c95defd5fd6a9b406fc8d8f28ecfab732ef1ff42) ) | |
| 541 | ROM_LOAD( "dr21ma1.1d", 0x0000000, 0x1000000, CRC(26dc6f55) SHA1(a9cedf547fa7a4d5850b9b3b867d46e577a035e0) ) | |
| 542 | ROM_LOAD( "dr21ma2.2d", 0x1000000, 0x1000000, CRC(702556ff) SHA1(c95defd5fd6a9b406fc8d8f28ecfab732ef1ff42) ) | |
| 479 | 543 | ROM_END |
| 480 | 544 | |
| 481 | 545 | ROM_START( gjspace ) |
| r10315 | r10316 | |
| 483 | 547 | ROM_FILL( 0x0000000, 0x400000, 0x55 ) |
| 484 | 548 | |
| 485 | 549 | ROM_REGION( 0x4000000, "user2", 0 ) /* main prg */ |
| 486 | ROM_LOAD( "10011a_0.bin", 0x0000000, 0x1000000, CRC(853e329e) SHA1(dd272ab2de9052c5aeee9e0ead4ee3d14347593e) ) | |
| 487 | ROM_LOAD( "10011a_1.bin", 0x1000000, 0x1000000, CRC(7d4e96f7) SHA1(41b0d27b93662f15547311c8723ac5141e129cab) ) | |
| 488 | ROM_LOAD( "10011a_2.bin", 0x2000000, 0x1000000, CRC(83111de6) SHA1(d760fd41644104f6d3a2806ab4664df2c77bdc42) ) | |
| 489 | ROM_LOAD( "10011a_3.bin", 0x3000000, 0x1000000, CRC(b6ea8be7) SHA1(3e65deda2b0e6758ce0ed05419ed096efb8ad755) ) | |
| 550 | ROM_LOAD( "10011a_0.bin", 0x0000000, 0x1000000, BAD_DUMP CRC(853e329e) SHA1(dd272ab2de9052c5aeee9e0ead4ee3d14347593e) ) | |
| 551 | ROM_LOAD( "10011a_1.bin", 0x1000000, 0x1000000, BAD_DUMP CRC(7d4e96f7) SHA1(41b0d27b93662f15547311c8723ac5141e129cab) ) | |
| 552 | ROM_LOAD( "10011a_2.bin", 0x2000000, 0x1000000, BAD_DUMP CRC(83111de6) SHA1(d760fd41644104f6d3a2806ab4664df2c77bdc42) ) | |
| 553 | ROM_LOAD( "10011a_3.bin", 0x3000000, 0x1000000, BAD_DUMP CRC(b6ea8be7) SHA1(3e65deda2b0e6758ce0ed05419ed096efb8ad755) ) | |
| 490 | 554 | ROM_END |
| 491 | 555 | |
| 492 | 556 | ROM_START( mrdrilrg ) |
| r10315 | r10316 | |
| 494 | 558 | ROM_FILL( 0x0000000, 0x400000, 0x55 ) |
| 495 | 559 | |
| 496 | 560 | ROM_REGION( 0x3000000, "user2", 0 ) /* main prg */ |
| 497 | ROM_LOAD( "drg1a_0.bin", 0x0000000, 0x1000000, CRC(1e5595f1) SHA1(0373ccb6e4b6fe96010afbb9657c3c0b2b02dd57) ) | |
| 498 | ROM_LOAD( "drg1a_1.bin", 0x1000000, 0x1000000, CRC(4db3a361) SHA1(d6a4fb682ab75cd98a9a960c244e94cacd367f12) ) | |
| 499 | ROM_LOAD( "drg1a_2.bin", 0x2000000, 0x1000000, CRC(c99ffa30) SHA1(fdcc0a348fe705c5ed1611170570f2fd9068525a) ) | |
| 561 | ROM_LOAD( "drg1a_0.bin", 0x0000000, 0x1000000, BAD_DUMP CRC(1e5595f1) SHA1(0373ccb6e4b6fe96010afbb9657c3c0b2b02dd57) ) | |
| 562 | ROM_LOAD( "drg1a_1.bin", 0x1000000, 0x1000000, BAD_DUMP CRC(4db3a361) SHA1(d6a4fb682ab75cd98a9a960c244e94cacd367f12) ) | |
| 563 | ROM_LOAD( "drg1a_2.bin", 0x2000000, 0x1000000, BAD_DUMP CRC(c99ffa30) SHA1(fdcc0a348fe705c5ed1611170570f2fd9068525a) ) | |
| 500 | 564 | ROM_END |
| 501 | 565 | |
| 502 | 566 | ROM_START( knpuzzle ) |
| r10315 | r10316 | |
| 504 | 568 | ROM_FILL( 0x0000000, 0x400000, 0x55 ) |
| 505 | 569 | |
| 506 | 570 | ROM_REGION( 0x3000000, "user2", 0 ) /* main prg */ |
| 507 | ROM_LOAD( "kpm1a_0.bin", 0x0000000, 0x1000000, CRC(606d001b) SHA1(5a94e56a164a9132af7f9bd51cae0674dbe0e036) ) | |
| 508 | ROM_LOAD( "kpm1a_1.bin", 0x1000000, 0x1000000, CRC(a506d767) SHA1(f4830edc8eaa42ff80e83aca2fa38a4d2807c667) ) | |
| 509 | ROM_LOAD( "kpm1a_2.bin", 0x2000000, 0x1000000, CRC(5f40c402) SHA1(2a56421c0f0c9cc5b7b93ddacfc6f3d214a946d9) ) | |
| 571 | ROM_LOAD( "kpm1a_0.bin", 0x0000000, 0x1000000, BAD_DUMP CRC(606d001b) SHA1(5a94e56a164a9132af7f9bd51cae0674dbe0e036) ) | |
| 572 | ROM_LOAD( "kpm1a_1.bin", 0x1000000, 0x1000000, BAD_DUMP CRC(a506d767) SHA1(f4830edc8eaa42ff80e83aca2fa38a4d2807c667) ) | |
| 573 | ROM_LOAD( "kpm1a_2.bin", 0x2000000, 0x1000000, BAD_DUMP CRC(5f40c402) SHA1(2a56421c0f0c9cc5b7b93ddacfc6f3d214a946d9) ) | |
| 510 | 574 | ROM_END |
| 511 | 575 | |
| 512 | 576 | ROM_START( startrgn ) |
| r10315 | r10316 | |
| 514 | 578 | ROM_FILL( 0x0000000, 0x400000, 0x55 ) |
| 515 | 579 | |
| 516 | 580 | ROM_REGION( 0x2000000, "user2", 0 ) /* main prg */ |
| 517 | ROM_LOAD( "stt1a_0.bin", 0x0000000, 0x1000000, CRC(07513d66) SHA1(baed445ff81e7f687e39b26648b3fe2ff601826b) ) | |
| 518 | ROM_LOAD( "stt1a_1.bin", 0x1000000, 0x1000000, CRC(f6e8e641) SHA1(37c8c1482d652b46a744252721299448b15e1027) ) | |
| 581 | ROM_LOAD( "stt1a_0.bin", 0x0000000, 0x1000000, BAD_DUMP CRC(07513d66) SHA1(baed445ff81e7f687e39b26648b3fe2ff601826b) ) | |
| 582 | ROM_LOAD( "stt1a_1.bin", 0x1000000, 0x1000000, BAD_DUMP CRC(f6e8e641) SHA1(37c8c1482d652b46a744252721299448b15e1027) ) | |
| 519 | 583 | ROM_END |
| 520 | 584 | |
| 521 | 585 | ROM_START( gamshara ) |
| 522 | 586 | ROM_REGION32_LE( 0x400000, "user1", 0 ) /* bios */ |
| 523 | 587 | ROM_FILL( 0x0000000, 0x400000, 0x55 ) |
| 524 | 588 | |
| 525 | ROM_REGION( 0x2000000, "user2", 0 ) /* main prg */ | |
| 526 | ROM_LOAD( "10021a.8e", 0x0000000, 0x1000000, CRC(db0a3687) SHA1(757360c43fba247e6c0c0fc66bb089575e19d646) ) | |
| 527 | ROM_LOAD( "10021a.8d", 0x1000000, 0x1000000, CRC(bebafef6) SHA1(6c965c09f3186523d27c50894a15b9c1dd02a794) ) | |
| 589 | ROM_REGION( 0x2100000, "user2", 0 ) /* main prg */ | |
| 590 | ROM_LOAD( "10021a.8e", 0x0000000, 0x1080000, CRC(6c0361fc) SHA1(7debf1f2e6bed31d59fb224a78a17a94fc573785) ) | |
| 591 | ROM_LOAD( "10021a.8d", 0x1080000, 0x1080000, CRC(73669ff7) SHA1(eb8bbf931f1f8a049208d081d040512a3ffa9c00) ) | |
| 528 | 592 | ROM_END |
| 529 | 593 | |
| 530 | 594 | GAME( 2000, mrdrilr2, 0, namcos10, namcos10, mrdrilr2, ROT0, "Namco", "Mr. Driller 2 (Japan, DR21 Ver.A)", GAME_NOT_WORKING | GAME_NO_SOUND ) |
| r10315 | r10316 | |
|---|---|---|
| 4 | 4 | This is the core driver, no video specific stuff should go in here. |
| 5 | 5 | This driver holds all the mechanical games. |
| 6 | 6 | |
| 7 | 01-2011: Adding the missing 'OKI' sound card, and documented it. | |
| 7 | 8 | 05-2009: Miscellaneous lamp fixes, based on data from FME Forever. |
| 8 | 9 | 09-2007: Haze: Added Deal 'Em video support. |
| 9 | 10 | 03-08-2007: J Wallace: Removed audio filter for now, since sound is more accurate without them. |
| r10315 | r10316 | |
| 53 | 54 | -----------+---+-----------------+-------------------------------------------------------------------------- |
| 54 | 55 | 0850 ? | W | ??????????????? | page latch (NV) |
| 55 | 56 | -----------+---+-----------------+-------------------------------------------------------------------------- |
| 56 | 0880 |R/W| D D D D D D D D | PIA6821 on soundboard (Oki MSM6376@16MHz | |
| 57 | 0880 |R/W| D D D D D D D D | PIA6821 on soundboard (Oki MSM6376@16MHz | |
| 57 | 58 | | | | port A = ?? |
| 58 | 59 | | | | port B (882) |
| 59 | 60 | | | | b7 = 0 if OKI busy |
| r10315 | r10316 | |
| 66 | 67 | | | | b1 = ?? |
| 67 | 68 | | | | b0 = ?? |
| 68 | 69 | -----------+---+-----------------+-------------------------------------------------------------------------- |
| 69 | 08C0 | | | MC6840 on sound board | |
| 70 | 08C0 | | | MC6840 on sound board | |
| 70 | 71 | -----------+---+-----------------+-------------------------------------------------------------------------- |
| 71 | 72 | 0900- |R/W| D D D D D D D D | MC6840 PTM IC2 |
| 72 | 73 | |
| r10315 | r10316 | |
| 198 | 199 | |
| 199 | 200 | TODO: - Fix lamp timing, MAME doesn't update fast enough to see everything |
| 200 | 201 | - Distinguish door switches using manual |
| 202 | - Complete stubs for hoppers (needs slightly better 68681 emulation, and new 'hoppers' device) | |
| 203 | - Any reel using the remote meter drive (CB2) slips backwards due to timing mismatches, a better method | |
| 204 | is needed to combine the data. This eventually leads to spin alarms i.e Flo's move in Great Escape | |
| 205 | - Add a BwB game with characteriser. | |
| 201 | 206 | ***********************************************************************************************************/ |
| 202 | 207 | #include "emu.h" |
| 203 | 208 | #include "machine/6821pia.h" |
| r10315 | r10316 | |
| 223 | 228 | #define LOG_CHR_FULL(x) do { if (MPU4VERBOSE) logerror x; } while (0) |
| 224 | 229 | #define LOG_IC3(x) do { if (MPU4VERBOSE) logerror x; } while (0) |
| 225 | 230 | #define LOG_IC8(x) do { if (MPU4VERBOSE) logerror x; } while (0) |
| 231 | #define LOG_SS(x) do { if (1) logerror x; } while (0) | |
| 226 | 232 | |
| 227 | 233 | #include "video/awpvid.h" //Fruit Machines Only |
| 228 | 234 | #include "connect4.lh" |
| 229 | 235 | #include "gamball.lh" |
| 230 | 236 | #include "mpu4.lh" |
| 237 | #include "mpu4ext.lh" | |
| 231 | 238 | #define MPU4_MASTER_CLOCK (6880000) |
| 232 | 239 | |
| 233 | 240 | /* local vars */ |
| r10315 | r10316 | |
| 239 | 246 | static int serial_data; |
| 240 | 247 | static int signal_50hz; |
| 241 | 248 | static int ic4_input_b; |
| 249 | static int aux1_input; | |
| 250 | static int aux2_input; | |
| 242 | 251 | static int IC23G1; |
| 243 | 252 | static int IC23G2A; |
| 244 | 253 | static int IC23G2B; |
| r10315 | r10316 | |
| 249 | 258 | static int lamp_col; |
| 250 | 259 | static int reel_flag; |
| 251 | 260 | static int ic23_active; |
| 252 | static int led_ | |
| 261 | static int led_lamp | |
| 253 | 262 | static int link7a_connected; |
| 254 | static int multiplex_smooth; | |
| 255 | 263 | static emu_timer *ic24_timer; |
| 256 | 264 | static TIMER_CALLBACK( ic24_timeout ); |
| 257 | 265 | |
| 258 | static int expansion_latch;// OKI MOD 4 and above only | |
| 259 | static int global_volume;// OKI MOD 4 and above only | |
| 260 | ||
| 261 | ||
| 266 | static int expansion_latch;// OKI MOD 4 and above only (PIA on Gamecard) | |
| 267 | static int global_volume;// OKI MOD 4 and above only (PIA on Gamecard) | |
| 262 | 268 | /* 32 multiplexed inputs - but a further 8 possible per AUX. |
| 263 | 269 | Two connectors 'orange' (sampled every 8ms) and 'black' (sampled every 16ms) |
| 264 | 270 | Each connector carries two banks of eight inputs and two enable signals */ |
| r10315 | r10316 | |
| 267 | 273 | static UINT8 lamp_data; |
| 268 | 274 | static UINT8 ay_data; |
| 269 | 275 | |
| 270 | static UINT8 MPU4_chr_data[72]; | |
| 271 | ||
| 272 | static UINT8 Lamps[128]; /* 128 multiplexed lamps */ | |
| 276 | static UINT8 Lamps[224]; /* 128 multiplexed lamps + 96 extension */ | |
| 273 | 277 | static int optic_pattern; |
| 278 | static int active_reel; | |
| 279 | static int remote_meter; | |
| 274 | 280 | |
| 281 | static UINT8 reel_mux_table[8]= {0,4,2,6,1,5,3,7};//include 7, although I don't think it's used | |
| 282 | static UINT8 reel_mux_table7[8]= {3,1,5,6,4,2,0,7}; | |
| 283 | ||
| 284 | static int reel_mux; /* added support for up to 8 reels */ | |
| 285 | #define STANDARD_REEL 0 /* As originally designed 3/4 reels*/ | |
| 286 | #define FIVE_REEL_5TO8 1 /* Interfaces to meter port, allows some mechanical metering, but there is significant 'bounce' in the extra reel*/ | |
| 287 | #define FIVE_REEL_8TO5 2 /* Mounted backwards for space reasons, but different board*/ | |
| 288 | #define FIVE_REEL_3TO6 3 /* Connected to the centre of the meter connector, taking up meters 3 to 6 */ | |
| 289 | #define SIX_REEL_1TO8 4 /* Two reels on the meter drives*/ | |
| 290 | #define SIX_REEL_5TO8 5 /* Like FIVE_REEL_5TO8, but with an extra reel elsewhere*/ | |
| 291 | #define SEVEN_REEL 6 /* Mainly club machines, significant reworking of reel hardware*/ | |
| 292 | ||
| 293 | static int lamp_extender;/* Plug in boards that add additional lamps and leds via the AUX ports. */ | |
| 294 | static int last_b7; | |
| 295 | static int last_latch; | |
| 296 | #define NO_EXTENDER 0 /* As originally designed */ | |
| 297 | #define SMALL_CARD 1 | |
| 298 | #define LARGE_CARD_A 2 //96 Lamps | |
| 299 | #define LARGE_CARD_B 3 // 96 Lamps, 16 LEDs - as used by BwB | |
| 300 | #define LARGE_CARD_C 4 //Identical to B, no built in LED support | |
| 301 | ||
| 302 | static int lamp_sense; | |
| 303 | static int card_live; | |
| 304 | ||
| 305 | static int led_extender; /* Plug in boards that add leds via the AUX ports. */ | |
| 306 | #define CARD_A 1 | |
| 307 | #define CARD_B 2 | |
| 308 | #define CARD_C 3 | |
| 309 | ||
| 310 | static int hopper =0; | |
| 311 | #define TUBES 0 | |
| 312 | #define HOPPER_DUART_A 1 | |
| 313 | #define HOPPER_DUART_B 2 | |
| 314 | #define HOPPER_DUART_C 3 | |
| 315 | #define HOPPER_NONDUART_A 4 | |
| 316 | #define HOPPER_NONDUART_B 5 | |
| 275 | 317 | /* Lookup table for CHR data */ |
| 276 | 318 | |
| 277 | 319 | struct mpu4_chr_table |
| r10315 | r10316 | |
| 301 | 343 | 8 display enables (pins 10 - 17) |
| 302 | 344 | */ |
| 303 | 345 | |
| 304 | static UINT8 led_segs[ | |
| 346 | static UINT8 led_segs[40];//8 regular, up to 32 on extender cards | |
| 305 | 347 | |
| 306 | 348 | |
| 307 | 349 | /* Process lamp and LED data for output system */ |
| r10315 | r10316 | |
| 313 | 355 | |
| 314 | 356 | static void draw_lamps(void) |
| 315 | 357 | { |
| 316 | int i; | |
| 358 | int i,j; | |
| 317 | 359 | |
| 318 | 360 | for (i = 0; i < 8; i++) |
| 319 | 361 | { |
| 320 | 362 | output_set_lamp_value((8*input_strobe)+i, (Lamps[(8*input_strobe)+i])); |
| 321 | 363 | output_set_lamp_value((8*input_strobe)+i+64, (Lamps[(8*input_strobe)+i+64])); |
| 322 | 364 | } |
| 365 | if (lamp_extender) | |
| 366 | { | |
| 367 | for (j = 0; j < 6; j++) | |
| 368 | { | |
| 369 | output_set_lamp_value((6*input_strobe)+128+j, (Lamps[(6*input_strobe)+128+j])); | |
| 370 | output_set_lamp_value((6*input_strobe)+176+j, (Lamps[(6*input_strobe)+176+j])); | |
| 371 | } | |
| 372 | } | |
| 323 | 373 | } |
| 324 | 374 | |
| 325 | ||
| 326 | 375 | static void update_lamps(void) |
| 327 | 376 | { |
| 328 | int i; | |
| 377 | int i,j; | |
| 329 | 378 | |
| 330 | 379 | for (i = 0; i < 8; i++) |
| 331 | 380 | { |
| r10315 | r10316 | |
| 333 | 382 | Lamps[(8*input_strobe)+i+64] = (lamp_strobe2 & (1 << i)) != 0; |
| 334 | 383 | } |
| 335 | 384 | |
| 336 | if (led_ | |
| 385 | if (led_lamp | |
| 337 | 386 | { |
| 338 | /* Some games use | |
| 387 | /* Some games (like Connect 4) use | |
| 339 | 388 | UINT8 pled_segs[2] = {0,0}; |
| 340 | 389 | |
| 341 | 390 | static const int lamps1[8] = { 106, 107, 108, 109, 104, 105, 110, 133 }; |
| r10315 | r10316 | |
| 351 | 400 | mpu4_draw_led(9, pled_segs[1]); |
| 352 | 401 | } |
| 353 | 402 | |
| 354 | /* Lamp smoothing, this draws lamps only at the peaks of the AC power that would light them */ | |
| 355 | if ((multiplex_smooth == (input_strobe - 1))||((multiplex_smooth == 7) && (input_strobe == 0))) | |
| 403 | draw_lamps(); | |
| 404 | mpu4_draw_led(input_strobe, led_segs[input_strobe]); | |
| 405 | if (led_extender) | |
| 356 | 406 | { |
| 357 | draw_lamps(); | |
| 358 | mpu4_draw_led(input_strobe, led_segs[input_strobe]); | |
| 359 | multiplex_smooth = input_strobe; | |
| 407 | for (j = 0; j < 5; j++) | |
| 408 | { | |
| 409 | mpu4_draw_led(((8*input_strobe)+8+j), led_segs[((8*input_strobe)+8+j)]); | |
| 410 | } | |
| 360 | 411 | } |
| 412 | } | |
| 361 | 413 | |
| 414 | static void lamp_extend_small(int data) | |
| 415 | { | |
| 416 | int lamp_strobe_ext,column,i; | |
| 417 | column = data & 0x07; | |
| 418 | ||
| 419 | lamp_strobe_ext = 0x1f - ((data & 0xf8) >> 3); | |
| 420 | if ( lamp_strobe_ext ) | |
| 421 | { | |
| 422 | for (i = 0; i < 5; i++) | |
| 423 | { | |
| 424 | Lamps[(5*column)+i+128] = (lamp_strobe_ext & (1 << i)) != 0; | |
| 425 | } | |
| 426 | } | |
| 362 | 427 | } |
| 363 | 428 | |
| 429 | static void lamp_extend_largea(int data,int column,int active) | |
| 430 | { | |
| 431 | int lampbase,i,byte7; | |
| 364 | 432 | |
| 433 | lamp_sense = 0; | |
| 434 | byte7 = data & 0x80; | |
| 435 | if ( byte7 != last_b7 ) | |
| 436 | { | |
| 437 | if ( byte7 ) | |
| 438 | { | |
| 439 | lampbase = 128 + column * 8; | |
| 440 | } | |
| 441 | else | |
| 442 | { | |
| 443 | lampbase = 192 + column * 8; | |
| 444 | } | |
| 445 | if ( data & 0x3f ) | |
| 446 | { | |
| 447 | lamp_sense = 1; | |
| 448 | } | |
| 449 | if ( active ) | |
| 450 | { | |
| 451 | for (i = 0; i < 6; i++) | |
| 452 | { | |
| 453 | Lamps[(lampbase)+i] = (data & (1 << i)) != 0; | |
| 454 | } | |
| 455 | } | |
| 456 | } | |
| 457 | last_b7 = byte7; | |
| 458 | } | |
| 459 | ||
| 460 | static void lamp_extend_largebc(int data,int column,int active) | |
| 461 | { | |
| 462 | int lampbase,i,byte7; | |
| 463 | ||
| 464 | lamp_sense = 0; | |
| 465 | byte7 = data & 0x80; | |
| 466 | if ( byte7 != last_b7 ) | |
| 467 | { | |
| 468 | card_live = 1; | |
| 469 | if ( byte7 ) | |
| 470 | { | |
| 471 | lampbase = 128 + column * 8; | |
| 472 | } | |
| 473 | else | |
| 474 | { | |
| 475 | lampbase = 192 + column * 8; | |
| 476 | } | |
| 477 | if ( data & 0x3f ) | |
| 478 | { | |
| 479 | lamp_sense = 1; | |
| 480 | } | |
| 481 | if ( active ) | |
| 482 | { | |
| 483 | for (i = 0; i < 6; i++) | |
| 484 | { | |
| 485 | Lamps[(lampbase)+i] = (data & (1 << i)) != 0; | |
| 486 | } | |
| 487 | } | |
| 488 | last_b7 = byte7; | |
| 489 | } | |
| 490 | else | |
| 491 | { | |
| 492 | card_live = 0; | |
| 493 | } | |
| 494 | } | |
| 495 | ||
| 496 | static void led_write_latch(int latch, int data, int column) | |
| 497 | { | |
| 498 | int diff; | |
| 499 | ||
| 500 | diff = (latch ^ last_latch) & latch; | |
| 501 | column = 7 - column; | |
| 502 | data = ~data;//inverted? | |
| 503 | ||
| 504 | if ( diff & 1 ) | |
| 505 | { | |
| 506 | led_segs[column] = data; | |
| 507 | } | |
| 508 | if ( diff & 2 ) | |
| 509 | { | |
| 510 | led_segs[8+column] = data; | |
| 511 | } | |
| 512 | if ( diff & 4 ) | |
| 513 | { | |
| 514 | led_segs[16+column] = data; | |
| 515 | } | |
| 516 | if ( diff & 8 ) | |
| 517 | { | |
| 518 | led_segs[24+column] = data; | |
| 519 | } | |
| 520 | if ( diff & 16 ) | |
| 521 | { | |
| 522 | led_segs[32+column] = data; | |
| 523 | } | |
| 524 | last_latch = diff; | |
| 525 | } | |
| 526 | ||
| 527 | ||
| 528 | static void update_meters(void) | |
| 529 | { | |
| 530 | int meter; | |
| 531 | int data = ((mmtr_data & 0x7f) | remote_meter); | |
| 532 | switch (reel_mux) | |
| 533 | { | |
| 534 | case STANDARD_REEL: | |
| 535 | // Change nothing | |
| 536 | break; | |
| 537 | case FIVE_REEL_5TO8: | |
| 538 | stepper_update(4, (data >> 4)); | |
| 539 | data = (data & 0x0F); //Strip reel data from meter drives, leaving active elements | |
| 540 | awp_draw_reel(4); | |
| 541 | break; | |
| 542 | case FIVE_REEL_8TO5: | |
| 543 | stepper_update(4, (((data & 0x01) + ((data & 0x08) >> 2) + ((data & 0x20) >> 3) + ((data & 0x80) >> 4)) & 0x0f)) ; | |
| 544 | data = 0x00; //Strip all reel data from meter drives, nothing is connected | |
| 545 | awp_draw_reel(4); | |
| 546 | break; | |
| 547 | case FIVE_REEL_3TO6: | |
| 548 | stepper_update(4, ((data >> 2) & 0x0f)); | |
| 549 | data = 0x00; //Strip all reel data from meter drives | |
| 550 | awp_draw_reel(4); | |
| 551 | break; | |
| 552 | case SIX_REEL_1TO8: | |
| 553 | stepper_update(4, (data & 0x0f)); | |
| 554 | stepper_update(5, ((data >> 4) & 0x0f)); | |
| 555 | data = 0x00; //Strip all reel data from meter drives | |
| 556 | awp_draw_reel(4); | |
| 557 | awp_draw_reel(5); | |
| 558 | break; | |
| 559 | case SIX_REEL_5TO8: | |
| 560 | stepper_update(4, ((data >> 4) & 0x0f)); | |
| 561 | data = 0x00; //Strip all reel data from meter drives | |
| 562 | awp_draw_reel(4); | |
| 563 | break; | |
| 564 | case SEVEN_REEL: | |
| 565 | stepper_update(0, (((data & 0x01) + ((data & 0x08) >> 2) + ((data & 0x20) >> 3) + ((data & 0x80) >> 4)) & 0x0f)) ; | |
| 566 | data = 0x00; //Strip all reel data from meter drives | |
| 567 | awp_draw_reel(0); | |
| 568 | break; | |
| 569 | } | |
| 570 | ||
| 571 | MechMtr_update(7, (data & 0x80)); | |
| 572 | for (meter = 0; meter < 4; meter ++) | |
| 573 | { | |
| 574 | MechMtr_update(meter, (data & (1 << meter))); | |
| 575 | } | |
| 576 | if (reel_mux == STANDARD_REEL) | |
| 577 | { | |
| 578 | for (meter = 4; meter < 7; meter ++) | |
| 579 | { | |
| 580 | MechMtr_update(meter, (data & (1 << meter))); | |
| 581 | } | |
| 582 | } | |
| 583 | } | |
| 584 | ||
| 365 | 585 | /* called if board is reset */ |
| 366 | 586 | static void mpu4_stepper_reset(void) |
| 367 | 587 | { |
| r10315 | r10316 | |
| 427 | 647 | pia6821_get_irq_a(pia8) | pia6821_get_irq_b(pia8) | |
| 428 | 648 | ptm6840_get_irq(ptm2); |
| 429 | 649 | |
| 430 | if (!link7a_connected) | |
| 650 | if (!link7a_connected) //7B = IRQ, 7A = FIRQ, both = NMI | |
| 431 | 651 | { |
| 432 | 652 | cputag_set_input_line(device->machine, "maincpu", M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE); |
| 433 | 653 | LOG(("6809 int%d \n", combined_state)); |
| r10315 | r10316 | |
| 439 | 659 | } |
| 440 | 660 | } |
| 441 | 661 | |
| 442 | /*static WRITE_LINE_DEVICE_HANDLER( cpu0_irq_m6840 ) | |
| 443 | { | |
| 444 | // cpu0_irq(device->machine->device("pia_ic3"), state); | |
| 445 | cpu0_irq(device->machine->device("6840ptm"), state); | |
| 446 | }*/ | |
| 447 | ||
| 448 | ||
| 449 | 662 | /* Bankswitching */ |
| 450 | 663 | static WRITE8_HANDLER( bankswitch_w ) |
| 451 | 664 | { |
| r10315 | r10316 | |
| 466 | 679 | |
| 467 | 680 | /* copy output value to IC2 c2 |
| 468 | 681 | this output is the clock for timer2 */ |
| 682 | /* 1200Hz System interrupt timer */ | |
| 469 | 683 | } |
| 470 | 684 | |
| 471 | 685 | |
| r10315 | r10316 | |
| 473 | 687 | { |
| 474 | 688 | device_t *pia = device->machine->device("pia_ic3"); |
| 475 | 689 | pia6821_ca1_w(pia, data); /* copy output value to IC3 ca1 */ |
| 476 | ||
| 477 | 690 | /* the output from timer2 is the input clock for timer3 */ |
| 691 | /* miscellaneous interrupts generated here */ | |
| 478 | 692 | ptm6840_set_c3(device, 0, data); |
| 479 | 693 | } |
| 480 | 694 | |
| r10315 | r10316 | |
| 483 | 697 | { |
| 484 | 698 | /* the output from timer3 is used as a square wave for the alarm output |
| 485 | 699 | and as an external clock source for timer 1! */ |
| 486 | ||
| 700 | /* also runs lamp fade */ | |
| 487 | 701 | ptm6840_set_c1(device, 0, data); |
| 488 | 702 | } |
| 489 | 703 | |
| r10315 | r10316 | |
| 495 | 709 | { DEVCB_HANDLER(ic2_o1_callback), |
| 496 | 710 | DEVCB_HANDLER(ic2_o2_callback), |
| 497 | 711 | DEVCB_HANDLER(ic2_o3_callback) }, |
| 498 | DEVCB_LINE(cpu0_irq) | |
| 712 | DEVCB_LINE(cpu0_irq) | |
| 499 | 713 | }; |
| 500 | 714 | |
| 501 | 715 | |
| r10315 | r10316 | |
| 628 | 842 | } |
| 629 | 843 | |
| 630 | 844 | |
| 631 | /* IC4 | |
| 845 | /* IC4 | |
| 632 | 846 | static WRITE8_DEVICE_HANDLER( pia_ic4_porta_w ) |
| 633 | 847 | { |
| 634 | 848 | if(ic23_active) |
| 635 | 849 | { |
| 850 | if (((lamp_extender == NO_EXTENDER)||(lamp_extender == SMALL_CARD)||(lamp_extender == LARGE_CARD_C))&& (led_extender == NO_EXTENDER)) | |
| 636 | 851 | led_segs[input_strobe] = data; |
| 637 | mpu4_draw_led(input_strobe, led_segs[input_strobe]); | |
| 638 | 852 | } |
| 639 | 853 | } |
| 640 | 854 | |
| 855 | static WRITE8_DEVICE_HANDLER( pia_ic4_portb_w ) | |
| 856 | { | |
| 857 | if (reel_mux) | |
| 858 | { | |
| 859 | /* A write here connects one reel (and only one) | |
| 860 | to the optic test circuit. This allows 8 reels | |
| 861 | to be supported instead of 4. */ | |
| 862 | if (reel_mux == SEVEN_REEL) | |
| 863 | { | |
| 864 | active_reel= reel_mux_table7[(data >> 4) & 0x07]; | |
| 865 | } | |
| 866 | else | |
| 867 | active_reel= reel_mux_table[(data >> 4) & 0x07]; | |
| 868 | } | |
| 869 | } | |
| 641 | 870 | |
| 871 | ||
| 642 | 872 | static READ8_DEVICE_HANDLER( pia_ic4_portb_r ) |
| 643 | 873 | { |
| 644 | 874 | if ( serial_data ) |
| r10315 | r10316 | |
| 652 | 882 | pia6821_cb1_w(device, 0); |
| 653 | 883 | } |
| 654 | 884 | |
| 655 | if ( optic_pattern & 0x01 ) ic4_input_b |= 0x40; /* reel A tab */ | |
| 656 | else ic4_input_b &= ~0x40; | |
| 885 | if (!reel_mux) | |
| 886 | { | |
| 887 | if ( optic_pattern & 0x01 ) ic4_input_b |= 0x40; /* reel A tab */ | |
| 888 | else ic4_input_b &= ~0x40; | |
| 657 | 889 | |
| 658 | if ( optic_pattern & 0x02 ) ic4_input_b |= 0x20; /* reel B tab */ | |
| 659 | else ic4_input_b &= ~0x20; | |
| 890 | if ( optic_pattern & 0x02 ) ic4_input_b |= 0x20; /* reel B tab */ | |
| 891 | else ic4_input_b &= ~0x20; | |
| 660 | 892 | |
| 661 | if ( optic_pattern & 0x04 ) ic4_input_b |= 0x10; /* reel C tab */ | |
| 662 | else ic4_input_b &= ~0x10; | |
| 893 | if ( optic_pattern & 0x04 ) ic4_input_b |= 0x10; /* reel C tab */ | |
| 894 | else ic4_input_b &= ~0x10; | |
| 663 | 895 | |
| 664 | if ( optic_pattern & 0x08 ) ic4_input_b |= 0x08; /* reel D tab */ | |
| 665 | else ic4_input_b &= ~0x08; | |
| 896 | if ( optic_pattern & 0x08 ) ic4_input_b |= 0x08; /* reel D tab */ | |
| 897 | else ic4_input_b &= ~0x08; | |
| 666 | 898 | |
| 899 | } | |
| 900 | else | |
| 901 | { | |
| 902 | if (stepper_optic_state(active_reel)) | |
| 903 | { | |
| 904 | ic4_input_b |= 0x08; | |
| 905 | } | |
| 906 | else | |
| 907 | { | |
| 908 | ic4_input_b &= ~0x08; | |
| 909 | } | |
| 910 | } | |
| 667 | 911 | if ( signal_50hz ) ic4_input_b |= 0x04; /* 50 Hz */ |
| 668 | 912 | else ic4_input_b &= ~0x04; |
| 669 | 913 | |
| 670 | ic4_input_b |= 0x02; //By triggering the overcurrent circuit here, we can make the MPU4 lamp test pass. | |
| 914 | if (ic4_input_b & 0x02) | |
| 915 | { | |
| 916 | ic4_input_b &= ~0x02; | |
| 917 | } | |
| 918 | else | |
| 919 | { | |
| 920 | ic4_input_b |= 0x02; //Pulse the overcurrent line with every read to show the CPU each lamp has lit | |
| 921 | } | |
| 671 | 922 | #ifdef UNUSED_FUNCTION |
| 672 | if ( lamp_overcurrent ) ic4_input_b |= 0x02; | |
| 673 | 923 | if ( lamp_undercurrent ) ic4_input_b |= 0x01; |
| 674 | 924 | #endif |
| 675 | 925 | |
| r10315 | r10316 | |
| 700 | 950 | DEVCB_NULL, /* line CA2 in */ |
| 701 | 951 | DEVCB_NULL, /* line CB2 in */ |
| 702 | 952 | DEVCB_HANDLER(pia_ic4_porta_w), /* port A out */ |
| 703 | DEVCB_N | |
| 953 | DEVCB_HANDLER(pia_ic4_portb_w), /* port B out */ | |
| 704 | 954 | DEVCB_LINE(pia_ic4_ca2_w), /* line CA2 out */ |
| 705 | 955 | DEVCB_LINE(pia_ic4_cb2_w), /* line CB2 out */ |
| 706 | 956 | DEVCB_LINE(cpu0_irq), /* IRQA */ |
| r10315 | r10316 | |
| 710 | 960 | /* IC5, AUX ports, coin lockouts and AY sound chip select (MODs below 4 only) */ |
| 711 | 961 | static READ8_DEVICE_HANDLER( pia_ic5_porta_r ) |
| 712 | 962 | { |
| 963 | if (lamp_extender == LARGE_CARD_A) | |
| 964 | { | |
| 965 | if (lamp_sense && ic23_active) | |
| 966 | { | |
| 967 | aux1_input |= 0x40; | |
| 968 | } | |
| 969 | else | |
| 970 | { | |
| 971 | aux1_input &= ~0x40; //Pulse the overcurrent line with every read to show the CPU each lamp has lit | |
| 972 | } | |
| 973 | } | |
| 974 | if (hopper == HOPPER_NONDUART_A) | |
| 975 | { | |
| 976 | /* if (hopper1_active) | |
| 977 | { | |
| 978 | aux1_input |= 0x04; | |
| 979 | } | |
| 980 | else | |
| 981 | { | |
| 982 | aux1_input &= ~0x04; | |
| 983 | }*/ | |
| 984 | } | |
| 713 | 985 | LOG(("%s: IC5 PIA Read of Port A (AUX1)\n",cpuexec_describe_context(device->machine))); |
| 714 | 986 | |
| 715 | return input_port_read(device->machine, "AUX1"); | |
| 987 | return input_port_read(device->machine, "AUX1")|aux1_input; | |
| 716 | 988 | } |
| 717 | 989 | |
| 990 | static WRITE8_DEVICE_HANDLER( pia_ic5_porta_w ) | |
| 991 | { | |
| 992 | device_t *pia_ic4 = device->machine->device("pia_ic5"); | |
| 993 | if (hopper == HOPPER_NONDUART_A) | |
| 994 | { | |
| 995 | //hopper1_drive_sensor(data&0x10); | |
| 996 | } | |
| 997 | switch (lamp_extender) | |
| 998 | { | |
| 999 | case NO_EXTENDER: | |
| 1000 | if (led_extender == CARD_B) | |
| 1001 | { | |
| 1002 | led_write_latch(data & 0x1f, pia6821_get_output_a(pia_ic4),input_strobe); | |
| 1003 | } | |
| 1004 | else if ((led_extender != CARD_A)||(led_extender != NO_EXTENDER)) | |
| 1005 | { | |
| 1006 | led_segs[(input_strobe+8)] = data; | |
| 1007 | } | |
| 1008 | break; | |
| 1009 | case SMALL_CARD: | |
| 1010 | if(ic23_active) | |
| 1011 | { | |
| 1012 | lamp_extend_small(data); | |
| 1013 | } | |
| 1014 | break; | |
| 1015 | case LARGE_CARD_A: | |
| 1016 | lamp_extend_largea(data,input_strobe,ic23_active); | |
| 1017 | break; | |
| 1018 | case LARGE_CARD_B: | |
| 1019 | lamp_extend_largebc(data,input_strobe,ic23_active); | |
| 1020 | if ((ic23_active) && card_live) | |
| 1021 | { | |
| 1022 | led_segs[(8*(last_b7 >>7))+input_strobe] = (~data); | |
| 1023 | } | |
| 1024 | break; | |
| 1025 | case LARGE_CARD_C: | |
| 1026 | lamp_extend_largebc(data,input_strobe,ic23_active); | |
| 1027 | break; | |
| 1028 | } | |
| 1029 | if (reel_mux == SIX_REEL_5TO8) | |
| 1030 | { | |
| 1031 | stepper_update(4, data&0x0F); | |
| 1032 | stepper_update(5, (data >> 4)&0x0F); | |
| 1033 | awp_draw_reel(4); | |
| 1034 | awp_draw_reel(5); | |
| 1035 | } | |
| 1036 | else | |
| 1037 | if (reel_mux == SEVEN_REEL) | |
| 1038 | { | |
| 1039 | stepper_update(1, data&0x0F); | |
| 1040 | stepper_update(2, (data >> 4)&0x0F); | |
| 1041 | awp_draw_reel(1); | |
| 1042 | awp_draw_reel(2); | |
| 1043 | } | |
| 718 | 1044 | |
| 1045 | } | |
| 1046 | ||
| 1047 | static WRITE8_DEVICE_HANDLER( pia_ic5_portb_w ) | |
| 1048 | { | |
| 1049 | if (hopper == HOPPER_NONDUART_B) | |
| 1050 | { | |
| 1051 | //hopper1_drive_motor(data &0x01) | |
| 1052 | //hopper1_drive_sensor(data &0x08) | |
| 1053 | } | |
| 1054 | if (led_extender == CARD_A) | |
| 1055 | { | |
| 1056 | // led_write_latch(data & 0x07, pia_get_output_a(pia_ic4),input_strobe) | |
| 1057 | } | |
| 1058 | } | |
| 719 | 1059 | static READ8_DEVICE_HANDLER( pia_ic5_portb_r ) |
| 720 | 1060 | { |
| 721 | 1061 | device_t *pia_ic5 = device->machine->device("pia_ic5"); |
| 1062 | if (hopper == HOPPER_NONDUART_B) | |
| 1063 | {/* | |
| 1064 | if (hopper1_active) | |
| 1065 | { | |
| 1066 | aux2_input |= 0x08; | |
| 1067 | } | |
| 1068 | else | |
| 1069 | { | |
| 1070 | aux2_input &= ~0x08; | |
| 1071 | }*/ | |
| 1072 | } | |
| 1073 | ||
| 722 | 1074 | LOG(("%s: IC5 PIA Read of Port B (coin input AUX2)\n",cpuexec_describe_context(device->machine))); |
| 723 | 1075 | coin_lockout_w(device->machine, 0, (pia6821_get_output_b(pia_ic5) & 0x01) ); |
| 724 | 1076 | coin_lockout_w(device->machine, 1, (pia6821_get_output_b(pia_ic5) & 0x02) ); |
| 725 | 1077 | coin_lockout_w(device->machine, 2, (pia6821_get_output_b(pia_ic5) & 0x04) ); |
| 726 | 1078 | coin_lockout_w(device->machine, 3, (pia6821_get_output_b(pia_ic5) & 0x08) ); |
| 727 | return input_port_read(device->machine, "AUX2"); | |
| 1079 | return input_port_read(device->machine, "AUX2") | aux2_input; | |
| 728 | 1080 | } |
| 729 | 1081 | |
| 730 | 1082 | |
| r10315 | r10316 | |
| 815 | 1167 | DEVCB_NULL, /* line CB1 in */ |
| 816 | 1168 | DEVCB_NULL, /* line CA2 in */ |
| 817 | 1169 | DEVCB_NULL, /* line CB2 in */ |
| 818 | DEVCB_NULL, /* port A out */ | |
| 819 | DEVCB_NULL, /* port B out */ | |
| 1170 | DEVCB_HANDLER(pia_ic5_porta_w), /* port A out */ | |
| 1171 | DEVCB_HANDLER(pia_ic5_portb_w), /* port B out */ | |
| 820 | 1172 | DEVCB_LINE(pia_ic5_ca2_w), /* line CA2 out */ |
| 821 | 1173 | DEVCB_LINE(pia_ic5_cb2_w), /* port CB2 out */ |
| 822 | 1174 | DEVCB_LINE(cpu0_irq), /* IRQA */ |
| r10315 | r10316 | |
| 828 | 1180 | static WRITE8_DEVICE_HANDLER( pia_ic6_portb_w ) |
| 829 | 1181 | { |
| 830 | 1182 | LOG(("%s: IC6 PIA Port B Set to %2x (Reel A and B)\n", cpuexec_describe_context(device->machine),data)); |
| 831 | stepper_update(0, data & 0x0F ); | |
| 832 | stepper_update(1, (data>>4) & 0x0F ); | |
| 833 | 1183 | |
| 834 | if (reel_ | |
| 1184 | if (reel_mux == SEVEN_REEL) | |
| 835 | 1185 | { |
| 1186 | stepper_update(3, data&0x0F); | |
| 1187 | stepper_update(4, (data >> 4)&0x0F); | |
| 1188 | awp_draw_reel(3); | |
| 1189 | awp_draw_reel(4); | |
| 1190 | } | |
| 1191 | else | |
| 1192 | { | |
| 1193 | stepper_update(0, data & 0x0F ); | |
| 1194 | stepper_update(1, (data>>4) & 0x0F ); | |
| 1195 | awp_draw_reel(0); | |
| 1196 | awp_draw_reel(1); | |
| 1197 | } | |
| 1198 | ||
| 1199 | if (reel_flag && (reel_mux == STANDARD_REEL)) | |
| 1200 | { | |
| 836 | 1201 | if ( stepper_optic_state(0) ) optic_pattern |= 0x01; |
| 837 | 1202 | else optic_pattern &= ~0x01; |
| 838 | 1203 | |
| 839 | 1204 | if ( stepper_optic_state(1) ) optic_pattern |= 0x02; |
| 840 | 1205 | else optic_pattern &= ~0x02; |
| 841 | 1206 | } |
| 842 | awp_draw_reel(0); | |
| 843 | awp_draw_reel(1); | |
| 844 | 1207 | } |
| 845 | 1208 | |
| 846 | 1209 | |
| r10315 | r10316 | |
| 900 | 1263 | static WRITE8_DEVICE_HANDLER( pia_ic7_porta_w ) |
| 901 | 1264 | { |
| 902 | 1265 | LOG(("%s: IC7 PIA Port A Set to %2x (Reel C and D)\n", cpuexec_describe_context(device->machine),data)); |
| 903 | stepper_update(2, data & 0x0F ); | |
| 904 | stepper_update(3, (data >> 4)& 0x0F ); | |
| 1266 | if (reel_mux == SEVEN_REEL) | |
| 1267 | { | |
| 1268 | stepper_update(5, data&0x0F); | |
| 1269 | stepper_update(6, (data >> 4)&0x0F); | |
| 1270 | awp_draw_reel(5); | |
| 1271 | awp_draw_reel(6); | |
| 1272 | } | |
| 1273 | else | |
| 1274 | { | |
| 1275 | stepper_update(2, data & 0x0F ); | |
| 1276 | stepper_update(3, (data>>4) & 0x0F ); | |
| 1277 | awp_draw_reel(2); | |
| 1278 | awp_draw_reel(3); | |
| 1279 | } | |
| 905 | 1280 | |
| 906 | if (reel_flag) | |
| 1281 | if (reel_flag && (reel_mux == STANDARD_REEL)) | |
| 907 | 1282 | { |
| 908 | 1283 | if ( stepper_optic_state(2) ) optic_pattern |= 0x04; |
| 909 | 1284 | else optic_pattern &= ~0x04; |
| 910 | 1285 | if ( stepper_optic_state(3) ) optic_pattern |= 0x08; |
| 911 | 1286 | else optic_pattern &= ~0x08; |
| 912 | 1287 | } |
| 913 | awp_draw_reel(2); | |
| 914 | awp_draw_reel(3); | |
| 915 | 1288 | } |
| 916 | 1289 | |
| 917 | ||
| 918 | 1290 | static WRITE8_DEVICE_HANDLER( pia_ic7_portb_w ) |
| 919 | 1291 | { |
| 920 | int meter; | |
| 921 | UINT64 cycles = device->machine->device<cpu_device>("maincpu")->total_cycles(); | |
| 1292 | if (hopper == HOPPER_DUART_A) | |
| 1293 | { | |
| 1294 | //duart write data | |
| 1295 | } | |
| 1296 | else if (hopper == HOPPER_NONDUART_A) | |
| 1297 | { | |
| 1298 | //hoppr1_drive_motor(data & 0x10); | |
| 1299 | } | |
| 922 | 1300 | |
| 1301 | mmtr_data = data; | |
| 1302 | } | |
| 1303 | ||
| 1304 | static READ8_DEVICE_HANDLER( pia_ic7_portb_r ) | |
| 1305 | { | |
| 923 | 1306 | /* The meters are connected to a voltage drop sensor, where current |
| 924 | 1307 | flowing through them also passes through pin B7, meaning that when |
| 925 | 1308 | any meter is activated, pin B7 goes high. |
| 926 | 1309 | As for why they connected this to an output port rather than using |
| 927 | CB1, no idea. | |
| 1310 | CB1, no idea, although it proved of benefit when the reel multiplexer was designed | |
| 1311 | as it allows a separate meter to be used when the rest of the port is blocked. | |
| 928 | 1312 | This appears to have confounded the schematic drawer, who has assumed that |
| 929 | 1313 | all eight meters are driven from this port, giving the 8 line driver chip |
| 930 | 1314 | 9 connections in total. */ |
| 931 | 1315 | |
| 932 | mmtr_data = data; | |
| 933 | if (mmtr_data) | |
| 1316 | //This may be overkill, but the meter sensing is VERY picky | |
| 1317 | ||
| 1318 | int combined_meter = MechMtr_GetActivity(0) | MechMtr_GetActivity(1) | | |
| 1319 | MechMtr_GetActivity(2) | MechMtr_GetActivity(3) | | |
| 1320 | MechMtr_GetActivity(4) | MechMtr_GetActivity(5) | | |
| 1321 | MechMtr_GetActivity(6) | MechMtr_GetActivity(7); | |
| 1322 | ||
| 1323 | if(combined_meter) | |
| 934 | 1324 | { |
| 935 | pia6821_portb_w(device, 0, mmtr_data | 0x80); | |
| 936 | for (meter = 0; meter < 8; meter ++) | |
| 937 | if (mmtr_data & (1 << meter)) Mechmtr_update(meter, cycles, mmtr_data & (1 << meter)); | |
| 1325 | return 0x80; | |
| 938 | 1326 | } |
| 939 | 1327 | else |
| 940 | 1328 | { |
| 941 | | |
| 1329 | | |
| 942 | 1330 | } |
| 943 | ||
| 944 | LOG(("%s: IC7 PIA Port B Set to %2x (Meters, Reel E and F)\n", cpuexec_describe_context(device->machine),data)); | |
| 945 | 1331 | } |
| 946 | 1332 | |
| 947 | 1333 | |
| 1334 | ||
| 1335 | ||
| 1336 | ||
| 1337 | ||
| 1338 | ||
| 948 | 1339 | static WRITE_LINE_DEVICE_HANDLER( pia_ic7_ca2_w ) |
| 949 | 1340 | { |
| 950 | 1341 | LOG(("%s: IC7 PIA write CA2 %2x (input strobe bit 0 / LED A)\n", cpuexec_describe_context(device->machine),state)); |
| r10315 | r10316 | |
| 954 | 1345 | ic23_update(); |
| 955 | 1346 | } |
| 956 | 1347 | |
| 957 | ||
| 958 | 1348 | static WRITE_LINE_DEVICE_HANDLER( pia_ic7_cb2_w ) |
| 959 | 1349 | { |
| 960 | /* The eighth meter is connected here, because the voltage sensor | |
| 961 | is on PB7. */ | |
| 962 | UINT64 cycles = device->machine->device<cpu_device>("maincpu")->total_cycles(); | |
| 963 | if (state) | |
| 964 | { | |
| 965 | pia6821_portb_w(device, 0, mmtr_data|0x80); | |
| 966 | Mechmtr_update(7, cycles, state ); | |
| 967 | } | |
| 968 | LOG(("%s: IC7 PIA write CB2 %2x \n", cpuexec_describe_context(device->machine),state)); | |
| 1350 | remote_meter = state?0x80:0x00; | |
| 969 | 1351 | } |
| 970 | 1352 | |
| 971 | ||
| 972 | 1353 | static const pia6821_interface pia_ic7_intf = |
| 973 | 1354 | { |
| 974 | 1355 | DEVCB_NULL, /* port A in */ |
| 975 | DEVCB_N | |
| 1356 | DEVCB_HANDLER(pia_ic7_portb_r), /* port B in */ | |
| 976 | 1357 | DEVCB_NULL, /* line CA1 in */ |
| 977 | 1358 | DEVCB_NULL, /* line CB1 in */ |
| 978 | 1359 | DEVCB_NULL, /* line CA2 in */ |
| r10315 | r10316 | |
| 980 | 1361 | DEVCB_HANDLER(pia_ic7_porta_w), /* port A out */ |
| 981 | 1362 | DEVCB_HANDLER(pia_ic7_portb_w), /* port B out */ |
| 982 | 1363 | DEVCB_LINE(pia_ic7_ca2_w), /* line CA2 out */ |
| 983 | DEVCB_LINE(pia_ic7_cb2_w), /* | |
| 1364 | DEVCB_LINE(pia_ic7_cb2_w), /* line CB2 out */ | |
| 984 | 1365 | DEVCB_LINE(cpu0_irq), /* IRQA */ |
| 985 | 1366 | DEVCB_LINE(cpu0_irq) /* IRQB */ |
| 986 | 1367 | }; |
| r10315 | r10316 | |
| 1003 | 1384 | |
| 1004 | 1385 | static WRITE8_DEVICE_HANDLER( pia_ic8_portb_w ) |
| 1005 | 1386 | { |
| 1387 | if (hopper == HOPPER_DUART_B) | |
| 1388 | { | |
| 1389 | // duart.drive_sensor(data & 0x04, data & 0x01, 0, 0); | |
| 1390 | } | |
| 1391 | else if (hopper == HOPPER_DUART_C) | |
| 1392 | { | |
| 1393 | // duart.drive_sensor(data & 0x04, data & 0x01, data & 0x04, data & 0x02); | |
| 1394 | } | |
| 1006 | 1395 | int i; |
| 1007 | 1396 | LOG_IC8(("%s: IC8 PIA Port B Set to %2x (OUTPUT PORT, TRIACS)\n", cpuexec_describe_context(device->machine),data)); |
| 1008 | 1397 | for (i = 0; i < 8; i++) |
| 1009 | if ( data & (1 << i) ) output_set_indexed_value("triac", i, data & (1 << i)); | |
| 1398 | { | |
| 1399 | output_set_indexed_value("triac", i, data & (1 << i)); | |
| 1400 | } | |
| 1010 | 1401 | } |
| 1011 | 1402 | |
| 1012 | ||
| 1013 | 1403 | static WRITE_LINE_DEVICE_HANDLER( pia_ic8_ca2_w ) |
| 1014 | 1404 | { |
| 1015 | 1405 | LOG_IC8(("%s: IC8 PIA write CA2 (input_strobe bit 2 / LED C) %02X\n", cpuexec_describe_context(device->machine), state & 0xFF)); |
| r10315 | r10316 | |
| 1049 | 1439 | }; |
| 1050 | 1440 | |
| 1051 | 1441 | |
| 1442 | // Sampled sound card, using a PIA and PTM for timing and data handling | |
| 1052 | 1443 | static WRITE8_DEVICE_HANDLER( pia_gb_porta_w ) |
| 1053 | 1444 | { |
| 1054 | 1445 | device_t *msm6376 = device->machine->device("msm6376"); |
| 1055 | ||
| 1056 | LOG(("%s: GAMEBOARD: PIA Port A Set to %2x\n", cpuexec_describe_context(device->machine),data)); | |
| 1446 | LOG_SS(("%s: GAMEBOARD: PIA Port A Set to %2x\n", cpuexec_describe_context(device->machine),data)); | |
| 1057 | 1447 | okim6376_w(msm6376, 0, data); |
| 1058 | 1448 | } |
| 1059 | 1449 | |
| r10315 | r10316 | |
| 1061 | 1451 | { |
| 1062 | 1452 | int changed = expansion_latch^data; |
| 1063 | 1453 | |
| 1064 | LOG(("%s: GAMEBOARD: PIA Port | |
| 1454 | LOG_SS(("%s: GAMEBOARD: PIA Port A Set to %2x\n", cpuexec_describe_context(device->machine),data)); | |
| 1065 | 1455 | |
| 1066 | 1456 | expansion_latch = data; |
| 1067 | 1457 | |
| r10315 | r10316 | |
| 1081 | 1471 | { |
| 1082 | 1472 | // float percent = (32-global_volume)/32.0; //volume_override?1.0:(32-global_volume)/32.0; |
| 1083 | 1473 | // LOG(("GAMEBOARD: OKI volume %f \n",percent)); |
| 1084 | // sndti_set_output_gain(SOUND_OKIM6295, 0, 0, percent); | |
| 1085 | 1474 | } |
| 1086 | 1475 | } |
| 1087 | 1476 | } |
| 1088 | 1477 | } |
| 1089 | 1478 | static READ8_DEVICE_HANDLER( pia_gb_portb_r ) |
| 1090 | 1479 | { |
| 1091 | LOG(("%s: GAMEBOARD: PIA Read of Port B\n",cpuexec_describe_context(device->machine))); | |
| 1480 | device_t *msm6376 = device->machine->device("msm6376"); | |
| 1481 | LOG_SS(("%s: GAMEBOARD: PIA Read of Port B\n",cpuexec_describe_context(device->machine))); | |
| 1092 | 1482 | // |
| 1093 | 1483 | // b7, 1 = OKI ready, 0 = OKI busy |
| 1094 | 1484 | // b5, vol clock |
| 1095 | 1485 | // b4, 1 = Vol down, 0 = Vol up |
| 1096 | 1486 | // |
| 1097 | 1487 | |
| 1098 | //if (offset == 0x40) | |
| 1099 | //{ | |
| 1100 | // return OKIM6295_status_r(0); | |
| 1101 | //} | |
| 1102 | return 0x40; | |
| 1488 | return okim6376_r(msm6376,0); | |
| 1103 | 1489 | } |
| 1104 | 1490 | |
| 1105 | 1491 | static WRITE_LINE_DEVICE_HANDLER( pia_gb_ca2_w ) |
| 1106 | 1492 | { |
| 1107 | LOG(("%s: GAMEBOARD: OKI RESET data = %02X\n", cpuexec_describe_context(device->machine), state)); | |
| 1493 | LOG_SS(("%s: GAMEBOARD: OKI RESET data = %02X\n", cpuexec_describe_context(device->machine), state)); | |
| 1108 | 1494 | |
| 1109 | // ret | |
| 1495 | // reset | |
| 1110 | 1496 | } |
| 1111 | 1497 | |
| 1112 | static const pia6821_interface pia_ | |
| 1498 | static const pia6821_interface pia_ic4ss | |
| 1113 | 1499 | { |
| 1114 | 1500 | DEVCB_NULL, /* port A in */ |
| 1115 | 1501 | DEVCB_HANDLER(pia_gb_portb_r), /* port B in */ |
| r10315 | r10316 | |
| 1125 | 1511 | DEVCB_NULL /* IRQB */ |
| 1126 | 1512 | }; |
| 1127 | 1513 | |
| 1514 | //Sampled sound timer | |
| 1515 | /* | |
| 1516 | FIXME | |
| 1517 | The MSM6376 sound chip is configured in a slightly strange way, to enable dynamic | |
| 1518 | sample rate changes (8Khz, 10.6 Khz, 16 KHz) by varying the clock. | |
| 1519 | According to the BwB programmer's guide, the formula is: | |
| 1520 | MSM6376 clock frequency:- | |
| 1521 | freq = (1720000/((t3L+1)(t3H+1)))*[(t3H(T3L+1)+1)/(2(t1+1))] | |
| 1522 | where [] means rounded up integer, | |
| 1523 | t3L is the LSB of Clock 3, | |
| 1524 | t3H is the MSB of Clock 3, | |
| 1525 | and t1 is the figure added to clock 1. | |
| 1128 | 1526 | |
| 1527 | The sample speed divisor is f/300 | |
| 1528 | */ | |
| 1529 | ||
| 1530 | //O3 -> G1 O1 -> c2 o2 -> c1 | |
| 1531 | static WRITE8_DEVICE_HANDLER( ic3ss_o1_callback ) | |
| 1532 | { | |
| 1533 | ptm6840_set_c2(device, 0, data); | |
| 1534 | } | |
| 1535 | ||
| 1536 | ||
| 1537 | static WRITE8_DEVICE_HANDLER( ic3ss_o2_callback )//Generates 'beep' tone | |
| 1538 | { | |
| 1539 | ptm6840_set_c1(device, 0, data);//? | |
| 1540 | } | |
| 1541 | ||
| 1542 | ||
| 1543 | static WRITE8_DEVICE_HANDLER( ic3ss_o3_callback ) | |
| 1544 | { | |
| 1545 | ptm6840_set_g1(device, 0, data); /* this output is the clock for timer1 */ | |
| 1546 | } | |
| 1547 | ||
| 1548 | ||
| 1549 | static const ptm6840_interface ptm_ic3ss_intf = | |
| 1550 | { | |
| 1551 | MPU4_MASTER_CLOCK / 4, | |
| 1552 | { 0, 0, 0 }, | |
| 1553 | { DEVCB_HANDLER(ic3ss_o1_callback), | |
| 1554 | DEVCB_HANDLER(ic3ss_o2_callback), | |
| 1555 | DEVCB_HANDLER(ic3ss_o3_callback) }, | |
| 1556 | DEVCB_NULL//LINE(cpu1_ptm_irq) | |
| 1557 | }; | |
| 1558 | ||
| 1129 | 1559 | /* input ports for MPU4 board */ |
| 1130 | 1560 | static INPUT_PORTS_START( mpu4 ) |
| 1131 | 1561 | PORT_START("ORANGE1") |
| r10315 | r10316 | |
| 1450 | 1880 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 1451 | 1881 | |
| 1452 | 1882 | PORT_START("AUX1") |
| 1453 | /* PORT_DIPNAME( 0x01, 0x00, "AUX101" ) | |
| 1454 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 1455 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) | |
| 1456 | PORT_DIPNAME( 0x02, 0x00, "AUX102" ) | |
| 1457 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 1458 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) | |
| 1459 | PORT_DIPNAME( 0x04, 0x00, "AUX103" ) | |
| 1460 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 1461 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) | |
| 1462 | PORT_DIPNAME( 0x08, 0x00, "AUX104" ) | |
| 1463 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
| 1464 | PORT_DIPSETTING( 0x08, DEF_STR( On ) )*/ | |
| 1465 | 1883 | PORT_DIPNAME( 0x10, 0x00, "AUX105" ) |
| 1466 | 1884 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1467 | 1885 | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| r10315 | r10316 | |
| 1489 | 1907 | static const stepper_interface barcrest_reel_interface = |
| 1490 | 1908 | { |
| 1491 | 1909 | BARCREST_48STEP_REEL, |
| 1492 | 0, | |
| 1493 | 8, | |
| 1910 | 92, | |
| 1911 | 4, | |
| 1494 | 1912 | 0x00 |
| 1495 | 1913 | }; |
| 1914 | static const stepper_interface barcrest_opto1_interface = | |
| 1915 | { | |
| 1916 | BARCREST_48STEP_REEL, | |
| 1917 | 4, | |
| 1918 | 12, | |
| 1919 | 0x00 | |
| 1920 | }; | |
| 1496 | 1921 | |
| 1497 | 1922 | /* Common configurations */ |
| 1498 | 1923 | static void mpu4_config_common(running_machine *machine) |
| 1499 | 1924 | { |
| 1500 | ic24_timer = timer_alloc( | |
| 1925 | ic24_timer = machine->scheduler().timer_alloc(FUNC(i | |
| 1501 | 1926 | } |
| 1502 | 1927 | |
| 1928 | static void mpu4_config_common_reels(running_machine *machine,int reels) | |
| 1929 | { | |
| 1930 | int n; | |
| 1931 | /* setup n default 96 half step reels, using the standard optic flag */ | |
| 1932 | for ( n = 0; n < reels; n++ ) | |
| 1933 | { | |
| 1934 | stepper_config(machine, n, &barcrest_reel_interface); | |
| 1935 | } | |
| 1936 | awp_reel_setup(); | |
| 1937 | } | |
| 1938 | ||
| 1503 | 1939 | static MACHINE_START( mpu4mod2 ) |
| 1504 | 1940 | { |
| 1505 | 1941 | mpu4_config_common(machine); |
| r10315 | r10316 | |
| 1508 | 1944 | mod_number=2; |
| 1509 | 1945 | |
| 1510 | 1946 | /* setup 8 mechanical meters */ |
| 1511 | Mech | |
| 1947 | MechMtr_config(machine,8); | |
| 1512 | 1948 | |
| 1513 | /* setup 4 reels */ | |
| 1514 | stepper_config(machine, 0, &barcrest_reel_interface); | |
| 1515 | stepper_config(machine, 1, &barcrest_reel_interface); | |
| 1516 | stepper_config(machine, 2, &barcrest_reel_interface); | |
| 1517 | stepper_config(machine, 3, &barcrest_reel_interface); | |
| 1518 | ||
| 1519 | 1949 | /* setup the standard oki MSC1937 display */ |
| 1520 | 1950 | ROC10937_init(0, MSC1937,0); |
| 1521 | 1951 | } |
| r10315 | r10316 | |
| 1527 | 1957 | link7a_connected=0; |
| 1528 | 1958 | |
| 1529 | 1959 | // setup 8 mechanical meters //////////////////////////////////////////// |
| 1530 | Mech | |
| 1960 | MechMtr_config(machine,8); | |
| 1531 | 1961 | |
| 1532 | // setup 4 default 96 half step reels /////////////////////////////////// | |
| 1533 | stepper_config(machine, 0, &barcrest_reel_interface); | |
| 1534 | stepper_config(machine, 1, &barcrest_reel_interface); | |
| 1535 | stepper_config(machine, 2, &barcrest_reel_interface); | |
| 1536 | stepper_config(machine, 3, &barcrest_reel_interface); | |
| 1537 | ||
| 1538 | 1962 | // setup the standard oki MSC1937 display /////////////////////////////// |
| 1539 | ROC10937_init(0, MSC1937, | |
| 1963 | ROC10937_init(0, MSC1937,0); // does oldtimer use a OKI MSC1937 alpha display controller? | |
| 1540 | 1964 | } |
| 1541 | 1965 | |
| 1542 | 1966 | static MACHINE_START( mpu4mod4 ) |
| r10315 | r10316 | |
| 1547 | 1971 | mod_number=4; |
| 1548 | 1972 | |
| 1549 | 1973 | // setup 8 mechanical meters //////////////////////////////////////////// |
| 1550 | Mech | |
| 1974 | MechMtr_config(machine,8); | |
| 1551 | 1975 | |
| 1552 | // setup 4 default 96 half step reels /////////////////////////////////// | |
| 1553 | stepper_config(machine, 0, &barcrest_reel_interface); | |
| 1554 | stepper_config(machine, 1, &barcrest_reel_interface); | |
| 1555 | stepper_config(machine, 2, &barcrest_reel_interface); | |
| 1556 | stepper_config(machine, 3, &barcrest_reel_interface); | |
| 1557 | ||
| 1558 | awp_reel_setup(); | |
| 1559 | 1976 | // setup the standard oki MSC1937 display /////////////////////////////// |
| 1560 | 1977 | ROC10937_init(0, MSC1937,0); |
| 1561 | 1978 | } |
| r10315 | r10316 | |
| 1563 | 1980 | /* |
| 1564 | 1981 | Characteriser (CHR) |
| 1565 | 1982 | |
| 1566 | I haven't been able to work out all the ways of finding the CHR data, but there must be a flag in the ROMs | |
| 1567 | somewhere to pick it out. As built, the CHR is a PAL which can perform basic bit manipulation according to an as yet unknown unique key. However, the programmers decided to best use this protection device in read/write/compare | |
| 1983 | As built, the CHR is a PAL which can perform basic bit manipulation according to | |
| 1984 | an as yet unknown unique key. However, the programmers decided to best use this protection device in read/write/compare | |
| 1568 | 1985 | cycles, storing almost the entire 'hidden' data table in the ROMs in plain sight. Only later rebuilds by BwB |
| 1569 | avoided this 'feature' of the development kit, and | |
| 1986 | avoided this 'feature' of the development kit, and wi | |
| 1570 | 1987 | |
| 1571 | 1988 | This information has been used to generate the CHR tables loaded by the programs, until a key can be determined. |
| 1572 | 1989 | |
| 1573 | 1990 | For most Barcrest games, the following method was used: |
| 1574 | 1991 | |
| 1575 | To calculate the values necessary to program the CHR, we must first find the version string, taking | |
| 1576 | the example of an AWP called Club Celebration, this starts at 0xff28 and terminates at 0xff2f. | |
| 1577 | 0xff2f then represents the CHR address. | |
| 1578 | For some reason, the tables always seem to start and end with '00 00'. | |
| 1579 | ||
| 1580 | From that point on, every word represents a call and response pair, until we have generated 8 8 byte rows of data. | |
| 1581 | ||
| 1582 | The call values appear to be fixed, so it would be possible to make a switch statement, but I believe the emulated | |
| 1583 | behaviour to be more likely. | |
| 1584 | ||
| 1585 | 1992 | The initial 'PALTEST' routine as found in the Barcrest programs simply writes the first 'call' to the CHR space, |
| 1586 | 1993 | to read back the 'response'. There is no attempt to alter the order or anything else, just |
| 1587 | 1994 | a simple runthrough of the entire data table. The only 'catch' in this is to note that the CHR chip always scans |
| r10315 | r10316 | |
| 1599 | 2006 | int x; |
| 1600 | 2007 | int call=data; |
| 1601 | 2008 | LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X", cpu_get_previouspc(space->cpu),offset,data)); |
| 1602 | ||
| 1603 | 2009 | if (!mpu4_current_chr_table) |
| 1604 | 2010 | fatalerror("No Characteriser Table @ %04x\n", cpu_get_previouspc(space->cpu)); |
| 1605 | 2011 | |
| 1606 | 2012 | if (offset == 0) |
| 1607 | 2013 | { |
| 1608 | // for (x = prot_col; x < 64; x++) | |
| 1609 | 2014 | { |
| 1610 | 2015 | if (call == 0) |
| 1611 | 2016 | { |
| r10315 | r10316 | |
| 1628 | 2033 | else if (offset == 2) |
| 1629 | 2034 | { |
| 1630 | 2035 | LOG_CHR(("Characteriser write 2 data %02X\n",data)); |
| 1631 | for (x = lamp_col; x < 16; x++) | |
| 2036 | switch (call) | |
| 2037 | // Rather than the search strategy, we can map the calls directly here. Note that they are hex versions of the square number series | |
| 1632 | 2038 | { |
| 1633 | if (mpu4_current_chr_table[(64+x)].call == call) | |
| 1634 | { | |
| 1635 | lamp_col = x; | |
| 1636 | LOG_CHR(("Characteriser find column %02X\n",lamp_col)); | |
| 1637 | break; | |
| 1638 | } | |
| 1639 | if (lamp_col > 7) | |
| 1640 | { | |
| 1641 | lamp_col = 0; | |
| 1642 | } | |
| 2039 | case 0x00: | |
| 2040 | lamp_col = 0; | |
| 2041 | break; | |
| 2042 | case 0x01: | |
| 2043 | lamp_col = 1; | |
| 2044 | break; | |
| 2045 | case 0x04: | |
| 2046 | lamp_col = 2; | |
| 2047 | break; | |
| 2048 | case 0x09: | |
| 2049 | lamp_col = 3; | |
| 2050 | break; | |
| 2051 | case 0x10: | |
| 2052 | lamp_col = 4; | |
| 2053 | break; | |
| 2054 | case 0x19: | |
| 2055 | lamp_col = 5; | |
| 2056 | break; | |
| 2057 | case 0x24: | |
| 2058 | lamp_col = 6; | |
| 2059 | break; | |
| 2060 | case 0x31: | |
| 2061 | lamp_col = 7; | |
| 2062 | break; | |
| 1643 | 2063 | } |
| 2064 | LOG_CHR(("Characteriser find 2 column %02X\n",lamp_col)); | |
| 1644 | 2065 | } |
| 1645 | 2066 | } |
| 1646 | 2067 | |
| r10315 | r10316 | |
| 1651 | 2072 | fatalerror("No Characteriser Table @ %04x\n", cpu_get_previouspc(space->cpu)); |
| 1652 | 2073 | |
| 1653 | 2074 | LOG_CHR(("Characteriser read offset %02X \n",offset)); |
| 1654 | LOG_CHR_FULL(("%04x Characteriser read offset %02X", cpu_get_previouspc(space->cpu),offset)); | |
| 1655 | 2075 | if (offset == 0) |
| 1656 | 2076 | { |
| 1657 | LOG_CHR(("Characteriser read data %02X \n", | |
| 2077 | LOG_CHR(("Characteriser read data %02X \n",mpu4_current_chr_ | |
| 1658 | 2078 | return mpu4_current_chr_table[prot_col].response; |
| 1659 | 2079 | } |
| 1660 | 2080 | if (offset == 3) |
| 1661 | 2081 | { |
| 1662 | LOG_CHR(("Characteriser read data %02X \n", | |
| 2082 | LOG_CHR(("Characteriser read data off 3 %02X \n",mpu4_current_chr_ | |
| 1663 | 2083 | return mpu4_current_chr_table[lamp_col+64].response; |
| 1664 | 2084 | } |
| 1665 | 2085 | return 0; |
| r10315 | r10316 | |
| 1689 | 2109 | {0x00, 0x00},{0x01, 0x18},{0x04, 0x08},{0x09, 0x10},{0x10, 0x00},{0x19, 0x18},{0x24, 0x08},{0x31, 0x00} |
| 1690 | 2110 | }; |
| 1691 | 2111 | |
| 2112 | static const mpu4_chr_table grtecp_data[72] = { | |
| 2113 | {0x00, 0x00},{0x1a, 0x84},{0x04, 0xa4},{0x10, 0xac},{0x18, 0x70},{0x0f, 0x80},{0x13, 0x2c},{0x1b, 0xc0}, | |
| 2114 | {0x03, 0xbc},{0x07, 0x5c},{0x17, 0x5c},{0x1d, 0x5c},{0x36, 0xdc},{0x35, 0x5c},{0x2b, 0xcc},{0x28, 0x68}, | |
| 2115 | {0x39, 0xd0},{0x21, 0xb8},{0x22, 0xdc},{0x25, 0x54},{0x2c, 0x08},{0x29, 0x58},{0x31, 0x54},{0x34, 0x90}, | |
| 2116 | {0x0a, 0xb8},{0x1f, 0x5c},{0x06, 0x5c},{0x0e, 0x44},{0x1c, 0x84},{0x12, 0xac},{0x1e, 0xe0},{0x0d, 0xbc}, | |
| 2117 | {0x14, 0xcc},{0x0a, 0xe8},{0x19, 0x70},{0x15, 0x00},{0x06, 0x8c},{0x0f, 0x70},{0x08, 0x00},{0x1b, 0x84}, | |
| 2118 | {0x1e, 0xa4},{0x04, 0xa4},{0x01, 0xbc},{0x0c, 0xdc},{0x18, 0x5c},{0x1a, 0xcc},{0x11, 0xe8},{0x0b, 0xe0}, | |
| 2119 | {0x03, 0xbc},{0x17, 0x4c},{0x10, 0xc8},{0x1d, 0xf8},{0x0e, 0xd4},{0x07, 0xa8},{0x12, 0x68},{0x09, 0x40}, | |
| 2120 | {0x0d, 0x0c},{0x1f, 0xd8},{0x16, 0xdc},{0x05, 0x54},{0x13, 0x98},{0x1c, 0x44},{0x02, 0x9c},{0x00, 0x00}, | |
| 2121 | {0x00, 0x00},{0x01, 0x18},{0x04, 0x00},{0x09, 0x18},{0x10, 0x08},{0x19, 0x10},{0x24, 0x00},{0x31, 0x00} | |
| 2122 | }; | |
| 2123 | ||
| 2124 | static const mpu4_chr_table oldtmr_data[72] = { | |
| 2125 | {0x00, 0x00},{0x1a, 0x90},{0x04, 0xc0},{0x10, 0x54},{0x18, 0xa4},{0x0f, 0xf0},{0x13, 0x64},{0x1b, 0x90}, | |
| 2126 | {0x03, 0xe4},{0x07, 0xd4},{0x17, 0x60},{0x1d, 0xb4},{0x36, 0xc0},{0x35, 0x70},{0x2b, 0x80},{0x28, 0x74}, | |
| 2127 | {0x39, 0xa4},{0x21, 0xf4},{0x22, 0xe4},{0x25, 0xd0},{0x2c, 0x64},{0x29, 0x10},{0x31, 0x20},{0x34, 0x90}, | |
| 2128 | {0x0a, 0xe4},{0x1f, 0xf4},{0x06, 0xc4},{0x0e, 0x70},{0x1c, 0x00},{0x12, 0x14},{0x1e, 0x00},{0x0d, 0x14}, | |
| 2129 | {0x14, 0xa0},{0x0a, 0xf0},{0x19, 0x64},{0x15, 0x10},{0x06, 0x84},{0x0f, 0x70},{0x08, 0x00},{0x1b, 0x90}, | |
| 2130 | {0x1e, 0x40},{0x04, 0x90},{0x01, 0xe4},{0x0c, 0xf4},{0x18, 0x64},{0x1a, 0x90},{0x11, 0x64},{0x0b, 0x90}, | |
| 2131 | {0x03, 0xe4},{0x17, 0x50},{0x10, 0x24},{0x1d, 0xb4},{0x0e, 0xe0},{0x07, 0xd4},{0x12, 0xe4},{0x09, 0x50}, | |
| 2132 | {0x0d, 0x04},{0x1f, 0xb4},{0x16, 0xc0},{0x05, 0xd0},{0x13, 0x64},{0x1c, 0x90},{0x02, 0xe4},{0x00, 0x00}, | |
| 2133 | {0x00, 0x00},{0x01, 0x00},{0x04, 0x00},{0x09, 0x00},{0x10, 0x00},{0x19, 0x10},{0x24, 0x00},{0x31, 0x00} | |
| 2134 | }; | |
| 2135 | ||
| 2136 | static DRIVER_INIT (m_oldtmr) | |
| 2137 | { | |
| 2138 | reel_mux=SIX_REEL_1TO8; | |
| 2139 | ||
| 2140 | stepper_config(machine, 0, &barcrest_opto1_interface); | |
| 2141 | stepper_config(machine, 1, &barcrest_opto1_interface); | |
| 2142 | stepper_config(machine, 2, &barcrest_opto1_interface); | |
| 2143 | stepper_config(machine, 3, &barcrest_opto1_interface); | |
| 2144 | stepper_config(machine, 4, &barcrest_opto1_interface); | |
| 2145 | stepper_config(machine, 5, &barcrest_opto1_interface); | |
| 2146 | ||
| 2147 | awp_reel_setup(); | |
| 2148 | mpu4_current_chr_table = oldtmr_data; | |
| 2149 | } | |
| 2150 | ||
| 1692 | 2151 | static DRIVER_INIT (m_ccelbr) |
| 1693 | 2152 | { |
| 2153 | reel_mux=STANDARD_REEL; | |
| 2154 | // setup 4 default 96 half step reels /////////////////////////////////// | |
| 2155 | mpu4_config_common_reels(machine,4); | |
| 2156 | ||
| 1694 | 2157 | mpu4_current_chr_table = ccelbr_data; |
| 1695 | 2158 | } |
| 1696 | 2159 | |
| 1697 | 2160 | static DRIVER_INIT (m_gmball) |
| 1698 | 2161 | { |
| 1699 | mpu4_current_chr_table = gmball_data; | |
| 2162 | reel_mux=STANDARD_REEL; | |
| 2163 | // setup 4 default 96 half step reels /////////////////////////////////// | |
| 2164 | mpu4_config_common_reels(machine,4); | |
| 2165 | ||
| 2166 | mpu4_current_chr_table = gmball_data; | |
| 1700 | 2167 | } |
| 1701 | 2168 | |
| 2169 | static DRIVER_INIT (m_grtecp) | |
| 2170 | { | |
| 2171 | reel_mux=FIVE_REEL_5TO8; | |
| 2172 | lamp_extender=SMALL_CARD; | |
| 2173 | // setup 5 default 96 half step reels with the mux board | |
| 2174 | mpu4_config_common_reels(machine,5); | |
| 2175 | mpu4_current_chr_table = grtecp_data; | |
| 2176 | } | |
| 1702 | 2177 | |
| 2178 | static DRIVER_INIT (mpu4tst2) | |
| 2179 | { | |
| 2180 | reel_mux=STANDARD_REEL; | |
| 2181 | // setup 5 default 96 half step reels with the mux board | |
| 2182 | mpu4_config_common_reels(machine,4); | |
| 2183 | ||
| 2184 | } | |
| 2185 | ||
| 2186 | static DRIVER_INIT (mpu4utst) | |
| 2187 | { | |
| 2188 | reel_mux=STANDARD_REEL; | |
| 2189 | // setup 4 default 96 half step reels /////////////////////////////////// | |
| 2190 | mpu4_config_common_reels(machine,4); | |
| 2191 | } | |
| 2192 | ||
| 2193 | static DRIVER_INIT (connect4) | |
| 2194 | { | |
| 2195 | led_lamp=1; | |
| 2196 | } | |
| 2197 | ||
| 1703 | 2198 | /* generate a 50 Hz signal (based on an RC time) */ |
| 1704 | 2199 | static TIMER_DEVICE_CALLBACK( gen_50hz ) |
| 1705 | 2200 | { |
| r10315 | r10316 | |
| 1709 | 2204 | signal_50hz = signal_50hz?0:1; |
| 1710 | 2205 | update_lamps(); |
| 1711 | 2206 | pia6821_ca1_w(timer.machine->device("pia_ic4"), signal_50hz); /* signal is connected to IC4 CA1 */ |
| 2207 | ||
| 2208 | if (signal_50hz) | |
| 2209 | { | |
| 2210 | update_meters(); | |
| 2211 | } | |
| 2212 | ||
| 1712 | 2213 | } |
| 1713 | 2214 | |
| 1714 | ||
| 1715 | 2215 | static ADDRESS_MAP_START( mod2_memmap, ADDRESS_SPACE_PROGRAM, 8 ) |
| 1716 | 2216 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("nvram") |
| 1717 | 2217 | AM_RANGE(0x0800, 0x0810) AM_READWRITE(characteriser_r,characteriser_w) |
| r10315 | r10316 | |
| 1762 | 2262 | |
| 1763 | 2263 | AM_RANGE(0x0850, 0x0850) AM_WRITE(bankswitch_w) // write bank (rom page select) |
| 1764 | 2264 | |
| 1765 | AM_RANGE(0x0880, 0x0883) AM_DEVREADWRITE("pia_ | |
| 2265 | AM_RANGE(0x0880, 0x0883) AM_DEVREADWRITE("pia_ic4ss | |
| 1766 | 2266 | |
| 1767 | ||
| 2267 | | |
| 1768 | 2268 | |
| 1769 | 2269 | // AM_RANGE(0x08e0, 0x08e7) AM_READWRITE(68681_duart_r,68681_duart_w) //Runs hoppers |
| 1770 | 2270 | |
| r10315 | r10316 | |
| 1789 | 2289 | // AM_RANGE(0x0800, 0x0810) AM_READWRITE(characteriser_r,characteriser_w) |
| 1790 | 2290 | |
| 1791 | 2291 | AM_RANGE(0x0850, 0x0850) AM_WRITE(bankswitch_w) // write bank (rom page select) |
| 1792 | AM_RANGE(0x0880, 0x0883) AM_DEVREADWRITE("pia_ | |
| 2292 | AM_RANGE(0x0880, 0x0883) AM_DEVREADWRITE("pia_ic4ss | |
| 1793 | 2293 | |
| 1794 | ||
| 2294 | | |
| 1795 | 2295 | |
| 1796 | 2296 | // AM_RANGE(0x08e0, 0x08e7) AM_READWRITE(68681_duart_r,68681_duart_w) //Runs hoppers |
| 1797 | 2297 | |
| r10315 | r10316 | |
| 1862 | 2362 | static MACHINE_CONFIG_DERIVED( mod4oki, mpu4mod2 ) |
| 1863 | 2363 | MCFG_MACHINE_START(mpu4mod4) |
| 1864 | 2364 | |
| 1865 | MCFG_PIA6821_ADD("pia_gamebd", pia_gameboard_intf) | |
| 2365 | MCFG_PTM6840_ADD("ptm_ic3ss", ptm_ic3ss_intf) | |
| 2366 | MCFG_PIA6821_ADD("pia_ic4ss", pia_ic4ss_intf) | |
| 1866 | 2367 | |
| 1867 | 2368 | MCFG_CPU_MODIFY("maincpu") |
| 1868 | 2369 | MCFG_CPU_PROGRAM_MAP(mod4_oki_map) |
| 1869 | 2370 | |
| 1870 | 2371 | MCFG_DEVICE_REMOVE("ay8913") |
| 1871 | MCFG_SOUND_ADD("msm6376", OKIM6376, 4000 | |
| 2372 | MCFG_SOUND_ADD("msm6376", OKIM6376, 64000 | |
| 1872 | 2373 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 1873 | 2374 | MACHINE_CONFIG_END |
| 1874 | 2375 | |
| 1875 | 2376 | static MACHINE_CONFIG_DERIVED( mpu4dutch, mod4oki ) |
| 1876 | 2377 | MCFG_CPU_MODIFY("maincpu") |
| 1877 | 2378 | MCFG_CPU_PROGRAM_MAP(dutch_memmap) // setup read and write memorymap |
| 1878 | MCFG_MACHINE_START(mpu4dutch) | |
| 2379 | MCFG_MACHINE_START(mpu4dutch) | |
| 1879 | 2380 | MACHINE_CONFIG_END |
| 1880 | 2381 | |
| 1881 | static DRIVER_INIT (connect4) | |
| 1882 | { | |
| 1883 | led_extend=1; | |
| 1884 | } | |
| 1885 | ||
| 1886 | 2382 | ROM_START( m_oldtmr ) |
| 1887 | 2383 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 1888 | 2384 | ROM_LOAD( "dot11.bin", 0x00000, 0x10000, CRC(da095666) SHA1(bc7654dc9da1f830a43f925db8079f27e18bb61e)) |
| r10315 | r10316 | |
| 1919 | 2415 | ROM_LOAD( "meter-zero.p1", 0x8000, 0x8000, CRC(e74297e5) SHA1(49a2cc85eda14199975ec37a794b685c839d3ab9)) |
| 1920 | 2416 | ROM_END |
| 1921 | 2417 | |
| 1922 | // year, name, parent, machine, input, init, monitor, company, fullname, flags | |
| 1923 | GAME( 198?, m_oldtmr, 0, mpu4dutch, mpu4, 0, ROT0, "Barcrest","Old Timer",GAME_NOT_WORKING|GAME_NO_SOUND|GAME_REQUIRES_ARTWORK|GAME_MECHANICAL ) | |
| 1924 | GAME( 198?, m_ccelbr, 0, mpu4mod2, mpu4, m_ccelbr, ROT0, "Barcrest","Club Celebration",GAME_NOT_WORKING|GAME_REQUIRES_ARTWORK|GAME_MECHANICAL ) | |
| 1925 | GAMEL(198?, m_gmball, 0, mod4yam, gamball, m_gmball, ROT0, "Barcrest","Gamball",GAME_NOT_WORKING|GAME_REQUIRES_ARTWORK|GAME_MECHANICAL,layout_gamball ) | |
| 2418 | ROM_START( m_grtecp ) | |
| 2419 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 2420 | ROM_LOAD("an2k.p1", 0x00000, 0x10000, CRC(c0886dff) SHA1(ef2b509fde05ef4ef055a09275afc9e153f50efc)) | |
| 1926 | 2421 | |
| 2422 | ROM_REGION( 0x200000, "msm6376", 0 ) | |
| 2423 | ROM_LOAD( "an2snd.p1", 0x000000, 0x080000, CRC(5394e9ae) SHA1(86ccd8531fc87f34d3c5482ba7e5a2c06ea69491) ) | |
| 2424 | ROM_LOAD( "an2snd.p2", 0x080000, 0x080000, CRC(109ace1f) SHA1(9f0e8065186beb61ed50fea834de2d91e68db953) ) | |
| 2425 | ||
| 2426 | ROM_END | |
| 2427 | // year, name, parent, machine, input, init, monitor,company, fullname, flags | |
| 2428 | GAME( 198?, m_oldtmr,0, mpu4dutch,mpu4, m_oldtmr, ROT0, "Barcrest", "Old Timer", GAME_NOT_WORKING|GAME_NO_SOUND|GAME_REQUIRES_ARTWORK ) | |
| 2429 | GAME( 198?, m_ccelbr,0, mpu4mod2, mpu4, m_ccelbr, ROT0, "Barcrest", "Club Celebration", GAME_NOT_WORKING|GAME_REQUIRES_ARTWORK ) | |
| 2430 | GAMEL(198?, m_gmball,0, mod4yam, gamball, m_gmball, ROT0, "Barcrest", "Gamball", GAME_NOT_WORKING|GAME_REQUIRES_ARTWORK|GAME_MECHANICAL,layout_gamball )//Mechanical ball launcher | |
| 2431 | GAMEL(198?, m_grtecp,0, mod4oki, mpu4, m_grtecp, ROT0, "Barcrest", "Andy's Great Escape", GAME_NOT_WORKING|GAME_REQUIRES_ARTWORK,layout_mpu4ext )//5 reel meter mux | |
| 2432 | ||
| 1927 | 2433 | //SWP |
| 1928 | 2434 | GAMEL(1989?,connect4, 0, mpu4mod2, connect4, connect4, ROT0, "Dolbeck Systems","Connect 4",GAME_IMPERFECT_GRAPHICS|GAME_REQUIRES_ARTWORK,layout_connect4 ) |
| 1929 | 2435 | |
| 1930 | 2436 | //Diagnostic ROMs |
| 1931 | GAME( 198?, mpu4utst, 0, mpu4mod2, mpu4, 0, ROT0, "Barcrest","MPU4 Unit Test (Program 4)",GAME_MECHANICAL ) | |
| 1932 | GAME( 198?, mpu4tst2, 0, mpu4mod2, mpu4, 0, ROT0, "Barcrest","MPU4 Unit Test (Program 2)",GAME_MECHANICAL ) | |
| 2437 | GAME( 198?, mpu4utst, 0, mpu4mod2, mpu4, mpu4utst, ROT0, "Barcrest","MPU4 Unit Test (Program 4)",GAME_MECHANICAL ) | |
| 2438 | GAME( 198?, mpu4tst2, 0, mpu4mod2, mpu4, mpu4tst2, ROT0, "Barcrest","MPU4 Unit Test (Program 2)",GAME_MECHANICAL ) | |
| 1933 | 2439 | GAME( 198?, mpu4met0, 0, mpu4mod2, mpu4, 0, ROT0, "Barcrest","MPU4 Meter Clear ROM",GAME_MECHANICAL ) |
| 1934 | 2440 | |
| 1935 | 2441 | #include "drivers/mpu4drvr.c" |
| r10315 | r10316 | |
|---|---|---|
| 161 | 161 | |
| 162 | 162 | static WRITE8_DEVICE_HANDLER(protection_w) |
| 163 | 163 | { |
| 164 | | |
| 164 | | |
| 165 | 165 | cpuexec_boost_interleave(device->machine, attotime::zero, attotime::from_usec(100)); |
| 166 | 166 | } |
| 167 | 167 |
| r10315 | r10316 | |
|---|---|---|
| 194 | 194 | |
| 195 | 195 | static INTERRUPT_GEN( rastansaga2_interrupt ) |
| 196 | 196 | { |
| 197 | | |
| 197 | | |
| 198 | 198 | cpu_set_input_line(device, 4, HOLD_LINE); |
| 199 | 199 | } |
| 200 | 200 | |
| r10315 | r10316 | |
| 207 | 207 | |
| 208 | 208 | static INTERRUPT_GEN( crimec_interrupt ) |
| 209 | 209 | { |
| 210 | | |
| 210 | | |
| 211 | 211 | cpu_set_input_line(device, 5, HOLD_LINE); |
| 212 | 212 | } |
| 213 | 213 | |
| r10315 | r10316 | |
| 220 | 220 | |
| 221 | 221 | static INTERRUPT_GEN( hitice_interrupt ) |
| 222 | 222 | { |
| 223 | | |
| 223 | | |
| 224 | 224 | cpu_set_input_line(device, 4, HOLD_LINE); |
| 225 | 225 | } |
| 226 | 226 | |
| r10315 | r10316 | |
| 233 | 233 | |
| 234 | 234 | static INTERRUPT_GEN( rambo3_interrupt ) |
| 235 | 235 | { |
| 236 | | |
| 236 | | |
| 237 | 237 | cpu_set_input_line(device, 6, HOLD_LINE); |
| 238 | 238 | } |
| 239 | 239 | |
| r10315 | r10316 | |
| 246 | 246 | |
| 247 | 247 | static INTERRUPT_GEN( pbobble_interrupt ) |
| 248 | 248 | { |
| 249 | | |
| 249 | | |
| 250 | 250 | cpu_set_input_line(device, 3, HOLD_LINE); |
| 251 | 251 | } |
| 252 | 252 | |
| r10315 | r10316 | |
| 258 | 258 | |
| 259 | 259 | static INTERRUPT_GEN( viofight_interrupt ) |
| 260 | 260 | { |
| 261 | | |
| 261 | | |
| 262 | 262 | cpu_set_input_line(device, 4, HOLD_LINE); |
| 263 | 263 | } |
| 264 | 264 | |
| r10315 | r10316 | |
| 270 | 270 | |
| 271 | 271 | static INTERRUPT_GEN( masterw_interrupt ) |
| 272 | 272 | { |
| 273 | | |
| 273 | | |
| 274 | 274 | cpu_set_input_line(device, 5, HOLD_LINE); |
| 275 | 275 | } |
| 276 | 276 | |
| r10315 | r10316 | |
| 282 | 282 | |
| 283 | 283 | static INTERRUPT_GEN( silentd_interrupt ) |
| 284 | 284 | { |
| 285 | | |
| 285 | | |
| 286 | 286 | cpu_set_input_line(device, 6, HOLD_LINE); |
| 287 | 287 | } |
| 288 | 288 | |
| r10315 | r10316 | |
| 294 | 294 | |
| 295 | 295 | static INTERRUPT_GEN( selfeena_interrupt ) |
| 296 | 296 | { |
| 297 | | |
| 297 | | |
| 298 | 298 | cpu_set_input_line(device, 6, HOLD_LINE); |
| 299 | 299 | } |
| 300 | 300 | |
| r10315 | r10316 | |
| 306 | 306 | |
| 307 | 307 | static INTERRUPT_GEN( sbm_interrupt )//5 |
| 308 | 308 | { |
| 309 | | |
| 309 | | |
| 310 | 310 | cpu_set_input_line(device, 4, HOLD_LINE); |
| 311 | 311 | } |
| 312 | 312 |
| r10315 | r10316 | |
|---|---|---|
| 893 | 893 | mw8080bw_state *state = machine->driver_data<mw8080bw_state>(); |
| 894 | 894 | |
| 895 | 895 | /* create astable timer for IC B1 */ |
| 896 | timer_pulse( | |
| 896 | machine->scheduler().timer_pulse( | |
| 897 | 897 | |
| 898 | 898 | /* initialize state of Tone Timing FF, IC C1 */ |
| 899 | 899 | state->maze_tone_timing_state = 0; |
| r10315 | r10316 | |
|---|---|---|
| 24 | 24 | vaportra_state *state = space->machine->driver_data<vaportra_state>(); |
| 25 | 25 | |
| 26 | 26 | /* Force synchronisation between CPUs with fake timer */ |
| 27 | | |
| 27 | | |
| 28 | 28 | soundlatch_w(space, 0, data & 0xff); |
| 29 | 29 | cpu_set_input_line(state->audiocpu, 0, ASSERT_LINE); |
| 30 | 30 | } |
| r10315 | r10316 | |
|---|---|---|
| 376 | 376 | if (LOG) |
| 377 | 377 | logerror("%06X:sound_data_w(%02X) = %08X & %08X\n", cpu_get_pc(space->cpu), offset, data, mem_mask); |
| 378 | 378 | if (ACCESSING_BITS_0_7) |
| 379 | | |
| 379 | | |
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 |
| r10315 | r10316 | |
|---|---|---|
| 372 | 372 | static WRITE8_HANDLER( sgladiat_soundlatch_w ) |
| 373 | 373 | { |
| 374 | 374 | soundlatch_w(space, offset, data); |
| 375 | | |
| 375 | | |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | static READ8_HANDLER( sgladiat_soundlatch_r ) |
| 379 | 379 | { |
| 380 | | |
| 380 | | |
| 381 | 381 | return soundlatch_r(space,0); |
| 382 | 382 | } |
| 383 | 383 | |
| 384 | 384 | static READ8_HANDLER( sgladiat_sound_nmi_ack_r ) |
| 385 | 385 | { |
| 386 | | |
| 386 | | |
| 387 | 387 | return 0xff; |
| 388 | 388 | } |
| 389 | 389 | |
| r10315 | r10316 | |
| 460 | 460 | static void ymirq_callback_1(device_t *device, int irq) |
| 461 | 461 | { |
| 462 | 462 | if (irq) |
| 463 | | |
| 463 | | |
| 464 | 464 | } |
| 465 | 465 | |
| 466 | 466 | static void ymirq_callback_2(device_t *device, int irq) |
| 467 | 467 | { |
| 468 | 468 | if (irq) |
| 469 | | |
| 469 | | |
| 470 | 470 | } |
| 471 | 471 | |
| 472 | 472 | |
| r10315 | r10316 | |
| 495 | 495 | static WRITE8_HANDLER( snk_soundlatch_w ) |
| 496 | 496 | { |
| 497 | 497 | soundlatch_w(space, offset, data); |
| 498 | | |
| 498 | | |
| 499 | 499 | } |
| 500 | 500 | |
| 501 | 501 | static CUSTOM_INPUT( snk_sound_busy ) |
| r10315 | r10316 | |
| 517 | 517 | static WRITE8_HANDLER( snk_sound_status_w ) |
| 518 | 518 | { |
| 519 | 519 | if (~data & 0x10) // ack YM1 irq |
| 520 | | |
| 520 | | |
| 521 | 521 | |
| 522 | 522 | if (~data & 0x20) // ack YM2 irq |
| 523 | | |
| 523 | | |
| 524 | 524 | |
| 525 | 525 | if (~data & 0x40) // clear busy flag |
| 526 | | |
| 526 | | |
| 527 | 527 | |
| 528 | 528 | if (~data & 0x80) // ack command from main cpu |
| 529 | | |
| 529 | | |
| 530 | 530 | } |
| 531 | 531 | |
| 532 | 532 | |
| 533 | 533 | |
| 534 | 534 | static READ8_HANDLER( tnk3_cmdirq_ack_r ) |
| 535 | 535 | { |
| 536 | | |
| 536 | | |
| 537 | 537 | return 0xff; |
| 538 | 538 | } |
| 539 | 539 | |
| 540 | 540 | static READ8_HANDLER( tnk3_ymirq_ack_r ) |
| 541 | 541 | { |
| 542 | | |
| 542 | | |
| 543 | 543 | return 0xff; |
| 544 | 544 | } |
| 545 | 545 | |
| r10315 | r10316 | |
| 547 | 547 | { |
| 548 | 548 | // it's uncertain whether the latch should be cleared here or when it's read |
| 549 | 549 | soundlatch_clear_w(space, 0, 0); |
| 550 | | |
| 550 | | |
| 551 | 551 | return 0xff; |
| 552 | 552 | } |
| 553 | 553 |
| r10315 | r10316 | |
|---|---|---|
| 348 | 348 | } |
| 349 | 349 | if( scanline < NAMCONB1_VBSTART ) |
| 350 | 350 | { |
| 351 | | |
| 351 | | |
| 352 | 352 | } |
| 353 | 353 | } /* namconb1_interrupt */ |
| 354 | 354 | |
| r10315 | r10316 | |
| 417 | 417 | scanline = 0; |
| 418 | 418 | |
| 419 | 419 | if( scanline < NAMCONB1_VBSTART ) |
| 420 | | |
| 420 | | |
| 421 | 421 | } /* namconb2_interrupt */ |
| 422 | 422 | |
| 423 | 423 | static void namconb1_cpureg8_w(running_machine *machine, int reg, UINT8 data) |
| r10315 | r10316 | |
|---|---|---|
| 561 | 561 | |
| 562 | 562 | static WRITE16_HANDLER( jpmio_w ) |
| 563 | 563 | { |
| 564 | UINT64 cycles = space->machine->firstcpu->total_cycles(); | |
| 565 | 564 | switch (offset) |
| 566 | 565 | { |
| 567 | 566 | case 0x02: |
| r10315 | r10316 | |
| 589 | 588 | } |
| 590 | 589 | else |
| 591 | 590 | // slide = 0; |
| 592 | Mech | |
| 591 | MechMtr_update(0 | |
| 593 | 592 | duart_1.IP &= ~0x10; |
| 594 | 593 | break; |
| 595 | 594 | } |
| r10315 | r10316 | |
| 1206 | 1205 | static WRITE16_HANDLER( jpmioawp_w ) |
| 1207 | 1206 | { |
| 1208 | 1207 | int i; |
| 1209 | UINT64 cycles = space->machine->firstcpu->total_cycles(); | |
| 1210 | 1208 | switch (offset) |
| 1211 | 1209 | { |
| 1212 | 1210 | case 0x00: |
| r10315 | r10316 | |
| 1248 | 1246 | } |
| 1249 | 1247 | else |
| 1250 | 1248 | // slide = 0; |
| 1251 | Mech | |
| 1249 | MechMtr_update(0 | |
| 1252 | 1250 | if ( data ) |
| 1253 | 1251 | { |
| 1254 | 1252 | duart_1.IP &= ~0x10; |
| r10315 | r10316 | |
|---|---|---|
| 158 | 158 | |
| 159 | 159 | /* in Gridiron, the sound CPU goes in a tight loop after the self test, */ |
| 160 | 160 | /* probably waiting to be reset by a watchdog */ |
| 161 | if (cpu_get_pc(space->cpu) == 0x08bc) | |
| 161 | if (cpu_get_pc(space->cpu) == 0x08bc) | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 |
| r10315 | r10316 | |
|---|---|---|
| 894 | 894 | jangou_state *state = machine->driver_data<jangou_state>(); |
| 895 | 895 | |
| 896 | 896 | /* Create a timer to feed the CVSD DAC with sample bits */ |
| 897 | state->cvsd_bit_timer = timer_alloc( | |
| 897 | state->cvsd_bit_timer = machine->scheduler().timer_alloc(FUNC(c | |
| 898 | 898 | timer_adjust_periodic(state->cvsd_bit_timer, attotime::from_hz(MASTER_CLOCK / 1024), 0, attotime::from_hz(MASTER_CLOCK / 1024)); |
| 899 | 899 | } |
| 900 | 900 |
| r10315 | r10316 | |
|---|---|---|
| 752 | 752 | { |
| 753 | 753 | pgm_state *state = space->machine->driver_data<pgm_state>(); |
| 754 | 754 | |
| 755 | | |
| 755 | | |
| 756 | 756 | |
| 757 | 757 | return (state->kovsh_highlatch_68k_w << 16) | (state->kovsh_lowlatch_68k_w); |
| 758 | 758 | } |
| r10315 | r10316 | |
| 761 | 761 | { |
| 762 | 762 | pgm_state *state = space->machine->driver_data<pgm_state>(); |
| 763 | 763 | |
| 764 | | |
| 764 | | |
| 765 | 765 | |
| 766 | 766 | if (ACCESSING_BITS_16_31) |
| 767 | 767 | { |
| r10315 | r10316 | |
| 779 | 779 | { |
| 780 | 780 | pgm_state *state = space->machine->driver_data<pgm_state>(); |
| 781 | 781 | |
| 782 | | |
| 782 | | |
| 783 | 783 | |
| 784 | 784 | switch (offset) |
| 785 | 785 | { |
| r10315 | r10316 | |
| 793 | 793 | { |
| 794 | 794 | pgm_state *state = space->machine->driver_data<pgm_state>(); |
| 795 | 795 | |
| 796 | | |
| 796 | | |
| 797 | 797 | |
| 798 | 798 | switch (offset) |
| 799 | 799 | { |
| r10315 | r10316 | |
|---|---|---|
| 126 | 126 | machine->primary_screen->update_partial(scanline - 1); |
| 127 | 127 | scanline += 32; |
| 128 | 128 | if (scanline > 240) scanline = 32; |
| 129 | timer_set(machine | |
| 129 | machine->scheduler().timer_set(machine | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | |
| r10315 | r10316 | |
| 354 | 354 | { |
| 355 | 355 | capbowl_state *state = machine->driver_data<capbowl_state>(); |
| 356 | 356 | |
| 357 | timer_set(machine | |
| 357 | machine->scheduler().timer_set(machine | |
| 358 | 358 | |
| 359 | 359 | state->blitter_addr = 0; |
| 360 | 360 | state->last_trackball_val[0] = 0; |
| r10315 | r10316 | |
|---|---|---|
| 261 | 261 | static INTERRUPT_GEN( irq0_start ) |
| 262 | 262 | { |
| 263 | 263 | cpu_set_input_line(device, 0, ASSERT_LINE); |
| 264 | | |
| 264 | | |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 |
| r10315 | r10316 | |
|---|---|---|
| 111 | 111 | if(!offset) |
| 112 | 112 | latches[2]|=1; |
| 113 | 113 | COMBINE_DATA(&latches[offset]); |
| 114 | | |
| 114 | | |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | static READ8_HANDLER(latch8_r) |
| r10315 | r10316 | |
| 126 | 126 | if(!offset) |
| 127 | 127 | latches[2]|=2; |
| 128 | 128 | latches[offset]=data; |
| 129 | | |
| 129 | | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | static ADDRESS_MAP_START( v810_mem,ADDRESS_SPACE_PROGRAM, 32 ) |
| r10315 | r10316 | |
|---|---|---|
| 213 | 213 | Pipi & Bibis (Ryouta Kikaku) Working. |
| 214 | 214 | FixEight Working, MCU type is a NEC V25. Chip is a PLCC94 stamped 'TS-001-TURBO' |
| 215 | 215 | FixEight bootleg Working. One unknown ROM (same as pipibibi one). Region hardcoded to Korea (@ $4d8) |
| 216 | Grind Stormer / VFive Working, MCU type is a NEC V25. Chip is a PLCC94 stamped 'TS-004-SPY'.* | |
| 217 | Batsugun / Batsugun Sp' Working, MCU type is a NEC V25. Chip is a PLCC94 stamped 'TS-004-SPY'.* | |
| 216 | Grind Stormer / VFive Working, MCU type is a NEC V25. Chip is a PLCC94 stamped 'TS-007-SPY'.* | |
| 217 | Batsugun / Batsugun Sp' Working, MCU type is a NEC V25. Chip is a PLCC94 stamped 'TS-007-SPY'.* | |
| 218 | 218 | Snow Bros. 2 Working. |
| 219 | 219 | Mahou Daisakusen Working. |
| 220 | 220 | Shippu Mahou Daisakusen Working. |
| r10315 | r10316 | |
| 542 | 542 | static void toaplan2_vblank_irq(running_machine *machine, int irq_line) |
| 543 | 543 | { |
| 544 | 544 | /* the IRQ appears to fire at line 0xe6 */ |
| 545 | timer_set(machine | |
| 545 | machine->scheduler().timer_set(machine | |
| 546 | 546 | } |
| 547 | 547 | |
| 548 | 548 | static INTERRUPT_GEN( toaplan2_vblank_irq1 ) { toaplan2_vblank_irq(device->machine, 1); } |
| r10315 | r10316 | |
| 811 | 811 | } |
| 812 | 812 | } |
| 813 | 813 | |
| 814 | static WRITE16_HANDLER( fixeight_subcpu_ctrl_w ) | |
| 815 | { | |
| 816 | toaplan2_state *state = space->machine->driver_data<toaplan2_state>(); | |
| 817 | ||
| 818 | cpu_set_input_line(state->sub_cpu, INPUT_LINE_RESET, (data & state->v25_reset_line) ? CLEAR_LINE : ASSERT_LINE); | |
| 819 | } | |
| 820 | ||
| 814 | 821 | static WRITE16_DEVICE_HANDLER( oki_bankswitch_w ) |
| 815 | 822 | { |
| 816 | 823 | if (ACCESSING_BITS_0_7) |
| r10315 | r10316 | |
| 1297 | 1304 | ADDRESS_MAP_END |
| 1298 | 1305 | |
| 1299 | 1306 | |
| 1300 | WRITE16_HANDLER( fixeight_subcpu_ctrl ) | |
| 1301 | { | |
| 1302 | printf("fixeight_subcpu_ctrl %04x\n",data); | |
| 1303 | ||
| 1304 | toaplan2_state *state = space->machine->driver_data<toaplan2_state>(); | |
| 1305 | ||
| 1306 | cpu_set_input_line(state->sub_cpu, INPUT_LINE_RESET, (data & state->v25_reset_line) ? CLEAR_LINE : ASSERT_LINE); | |
| 1307 | } | |
| 1308 | ||
| 1309 | ||
| 1310 | 1307 | /* this one is rather different to the other v25 based ones, shared ram is moved for example */ |
| 1311 | 1308 | static ADDRESS_MAP_START( fixeight_68k_mem, ADDRESS_SPACE_PROGRAM, 16 ) |
| 1312 | 1309 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| r10315 | r10316 | |
| 1317 | 1314 | AM_RANGE(0x200010, 0x200011) AM_READ_PORT("SYS") |
| 1318 | 1315 | AM_RANGE(0x20001c, 0x20001d) AM_WRITE(toaplan2_coin_word_w) /* Coin count/lock */ |
| 1319 | 1316 | AM_RANGE(0x280000, 0x28ffff) AM_READWRITE( batsugun_share_r, batsugun_share_w ) |
| 1320 | AM_RANGE(0x700000, 0x700001) AM_WRITE(fixeight_subcpu_ctrl) // guess!!! | |
| 1321 | 1317 | AM_RANGE(0x300000, 0x30000d) AM_DEVREADWRITE("gp9001vdp0", gp9001_vdp_r, gp9001_vdp_w) |
| 1322 | 1318 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE_GENERIC(paletteram) |
| 1323 | 1319 | AM_RANGE(0x500000, 0x501fff) AM_READWRITE(toaplan2_txvideoram16_r, toaplan2_txvideoram16_w) AM_BASE_SIZE_MEMBER(toaplan2_state, txvideoram16, tx_vram_size) |
| 1324 | 1320 | AM_RANGE(0x502000, 0x5021ff) AM_READWRITE(toaplan2_txvideoram16_offs_r, toaplan2_txvideoram16_offs_w) AM_BASE_SIZE_MEMBER(toaplan2_state, txvideoram16_offs, tx_offs_vram_size) |
| 1325 | 1321 | AM_RANGE(0x503000, 0x5031ff) AM_READWRITE(toaplan2_txscrollram16_r, toaplan2_txscrollram16_w) AM_BASE_SIZE_MEMBER(toaplan2_state, txscrollram16, tx_scroll_vram_size) |
| 1326 | 1322 | AM_RANGE(0x600000, 0x60ffff) AM_READWRITE(toaplan2_tx_gfxram16_r, toaplan2_tx_gfxram16_w) AM_BASE_MEMBER(toaplan2_state, tx_gfxram16) |
| 1323 | AM_RANGE(0x700000, 0x700001) AM_WRITE(fixeight_subcpu_ctrl_w) | |
| 1327 | 1324 | AM_RANGE(0x800000, 0x800001) AM_READ(video_count_r) |
| 1328 | 1325 | ADDRESS_MAP_END |
| 1329 | 1326 | |
| r10315 | r10316 | |
| 3748 | 3745 | MCFG_CPU_PROGRAM_MAP(V25_rambased_mem) |
| 3749 | 3746 | MCFG_CPU_IO_MAP(V25_port) |
| 3750 | 3747 | |
| 3751 | MCFG_QUANTUM_TIME(attotime::from_hz(6000)) | |
| 3752 | ||
| 3753 | 3748 | MCFG_MACHINE_RESET(batsugun) |
| 3754 | 3749 | |
| 3755 | 3750 | /* video hardware */ |
| r10315 | r10316 | |
| 3908 | 3903 | |
| 3909 | 3904 | static const nmk112_interface bgaregga_nmk112_intf = |
| 3910 | 3905 | { |
| 3911 | "oki", | |
| 3906 | "oki", NULL | |
| 3912 | 3907 | }; |
| 3913 | 3908 | |
| 3914 | 3909 | static const nmk112_interface batrider_nmk112_intf = |
| r10315 | r10316 | |
| 5266 | 5261 | GAME( 1991, whoopee, pipibibs, whoopee, whoopee, T2_Z180, ROT0, "Toaplan", "Pipi & Bibis / Whoopee!! (Whoopee!! board)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) // original Whoopee!! boards have a HD647180 instead of Z80 |
| 5267 | 5262 | GAME( 1991, pipibibsbl,pipibibs, pipibibi_bootleg, pipibibsbl, pipibibsbl, ROT0, "bootleg (Ryouta Kikaku)", "Pipi & Bibis / Whoopee!! (bootleg)", GAME_SUPPORTS_SAVE ) |
| 5268 | 5263 | |
| 5269 | ||
| 5270 | 5264 | // region is in eeprom (and also requires correct return value from a v25 mapped address??) |
| 5271 | 5265 | // todo: something could be wrong here, because the _dumped_ eeprom doesn't work.. |
| 5272 | 5266 | GAME( 1992, fixeight, 0, fixeight, fixeight, fixeight, ROT270, "Toaplan", "FixEight (Europe)", GAME_SUPPORTS_SAVE ) |
| r10315 | r10316 | |
| 5326 | 5320 | GAME( 1999, bkraiduj, bkraidu, bbakradu, bbakraid, bbakradu, ROT270, "Eighting", "Battle Bakraid - Unlimited Version (Japan) (Tue Jun 8 1999)", GAME_SUPPORTS_SAVE ) |
| 5327 | 5321 | // older revision of the code |
| 5328 | 5322 | GAME( 1999, bkraidj, bkraidu, bbakraid, bbakraid, bbakraid, ROT270, "Eighting", "Battle Bakraid (Japan) (Wed Apr 7 1999)", GAME_SUPPORTS_SAVE ) |
| 5329 | ||
| 5330 | ||
| 5331 | ||
| 5332 | ||
| 5333 |
| r10315 | r10316 | |
|---|---|---|
| 66 | 66 | cpu_triggerint(machine->device("audiocpu")); |
| 67 | 67 | |
| 68 | 68 | /* use a timer to make long transfers faster */ |
| 69 | timer_set( | |
| 69 | machine->scheduler().timer_set( | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | |
| 73 | 73 | static WRITE16_HANDLER( main_sound_w ) |
| 74 | 74 | { |
| 75 | 75 | if (ACCESSING_BITS_0_7) |
| 76 | | |
| 76 | | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 |
| r10315 | r10316 | |
|---|---|---|
| 80 | 80 | |
| 81 | 81 | for (i = 1; i < 256; i++) |
| 82 | 82 | if (mask[i] != 0) |
| 83 | timer_set(machine | |
| 83 | machine->scheduler().timer_set(machine | |
| 84 | 84 | |
| 85 | 85 | state->pot_state = 0; |
| 86 | 86 | } |
| r10315 | r10316 | |
| 90 | 90 | if (scanline >= 262) |
| 91 | 91 | scanline = 0; |
| 92 | 92 | |
| 93 | timer_set(machine | |
| 93 | machine->scheduler().timer_set(machine | |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | |
| r10315 | r10316 | |
| 428 | 428 | static MACHINE_RESET( boxer ) |
| 429 | 429 | { |
| 430 | 430 | boxer_state *state = machine->driver_data<boxer_state>(); |
| 431 | timer_set(machine | |
| 431 | machine->scheduler().timer_set(machine | |
| 432 | 432 | |
| 433 | 433 | state->pot_state = 0; |
| 434 | 434 | state->pot_latch = 0; |
| r10315 | r10316 | |
|---|---|---|
| 98 | 98 | cputag_set_input_line(field->port->machine, "maincpu", INPUT_LINE_RESET, PULSE_LINE); |
| 99 | 99 | |
| 100 | 100 | /* simulate the coin switch being closed for a while */ |
| 101 | | |
| 101 | | |
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | |
| r10315 | r10316 | |
| 155 | 155 | static CUSTOM_INPUT( vicdual_get_timer_value ) |
| 156 | 156 | { |
| 157 | 157 | /* return the state of the timer (old code claims "4MHz square wave", but it was toggled once every 2msec, or 500Hz) */ |
| 158 | return | |
| 158 | return | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 |
| r10315 | r10316 | |
|---|---|---|
| 477 | 477 | |
| 478 | 478 | static INTERRUPT_GEN( wgp_cpub_interrupt ) |
| 479 | 479 | { |
| 480 | | |
| 480 | | |
| 481 | 481 | cpu_set_input_line(device, 4, HOLD_LINE); |
| 482 | 482 | } |
| 483 | 483 | |
| r10315 | r10316 | |
| 601 | 601 | hardware has got the next a/d conversion ready. We set a token |
| 602 | 602 | delay of 10000 cycles although our inputs are always ready. */ |
| 603 | 603 | |
| 604 | | |
| 604 | | |
| 605 | 605 | } |
| 606 | 606 | |
| 607 | 607 |
| r10315 | r10316 | |
|---|---|---|
| 256 | 256 | state->requested_int[0] = 1; |
| 257 | 257 | state->requested_int[5] = 1; // write the scroll registers |
| 258 | 258 | /* the duration is a guess */ |
| 259 | | |
| 259 | | |
| 260 | 260 | update_irq_state(device->machine); |
| 261 | 261 | break; |
| 262 | 262 | |
| r10315 | r10316 | |
| 729 | 729 | another blit. */ |
| 730 | 730 | if (b1 == 0) |
| 731 | 731 | { |
| 732 | | |
| 732 | | |
| 733 | 733 | return; |
| 734 | 734 | } |
| 735 | 735 | |
| r10315 | r10316 | |
| 6123 | 6123 | metro_state *state = machine->driver_data<metro_state>(); |
| 6124 | 6124 | metro_common(machine); |
| 6125 | 6125 | state->irq_line = -1; /* split interrupt handlers */ |
| 6126 | state->mouja_irq_timer = timer_alloc(m | |
| 6126 | state->mouja_irq_timer = machine->scheduler().timer_alloc(FUNC(m | |
| 6127 | 6127 | } |
| 6128 | 6128 | |
| 6129 | 6129 | static DRIVER_INIT( gakusai ) |
| r10315 | r10316 | |
|---|---|---|
| 663 | 663 | ROM_LOAD( "qs1001a.u96", 0x000000, 0x80000, CRC(d13c6407) SHA1(57b14f97c7d4f9b5d9745d3571a0b7115fbe3176) ) |
| 664 | 664 | ROM_END |
| 665 | 665 | |
| 666 | ROM_START( hidctch2a ) | |
| 667 | ROM_REGION( 0x80000, "maincpu", 0 ) /* Hyperstone CPU Code */ | |
| 668 | ROM_LOAD( "hc2j.u43", 0x00000, 0x80000, CRC(8d3b8394) SHA1(29093ee13eb3609abc670d6722f3095f03045af6) ) | |
| 666 | 669 | |
| 670 | ROM_REGION32_BE( 0x2000000, "user1", ROMREGION_ERASE00 ) /* Game Data - banked ROM, swapping necessary */ | |
| 671 | ROM_LOAD32_WORD_SWAP( "00", 0x0000000, 0x200000, CRC(c6b1bc84) SHA1(205d1dc5079562b11cef72fef25a3c570eaecf78) ) | |
| 672 | ROM_LOAD32_WORD_SWAP( "01", 0x0000002, 0x200000, CRC(5a1c1ab3) SHA1(3c07a98f9ea8b30bac5a260403e688314fd12abb) ) | |
| 673 | ROM_LOAD32_WORD_SWAP( "02", 0x0400000, 0x200000, CRC(3f7815aa) SHA1(ed46cbe03fde5cab15e004812036b0aaa00fc628) ) | |
| 674 | ROM_LOAD32_WORD_SWAP( "03", 0x0400002, 0x200000, CRC(d686c59b) SHA1(f82d97f17d9cb10cae4d47f4efdd3ba6c5baace3) ) | |
| 675 | ROM_LOAD32_WORD_SWAP( "04", 0x0800000, 0x200000, CRC(d35cb515) SHA1(75943b6c8052232c8b01ab57b4d32d54a22e7279) ) | |
| 676 | ROM_LOAD32_WORD_SWAP( "05", 0x0800002, 0x200000, CRC(7870e5c6) SHA1(e36a62cb205d396337abdea8e553d70b6da32f8f) ) | |
| 677 | ROM_LOAD32_WORD_SWAP( "06", 0x0c00000, 0x200000, CRC(10184a21) SHA1(fc99bc003ba69b651691ca37a5490beae29e36bc) ) | |
| 678 | ROM_LOAD32_WORD_SWAP( "07", 0x0c00002, 0x200000, CRC(b6c4879f) SHA1(b672d5d7fc3dd1b32cd2f1084a71d1a225594866) ) | |
| 679 | ROM_LOAD32_WORD_SWAP( "08", 0x1000000, 0x200000, CRC(670204d1) SHA1(efdead17ea1d1796f47abf65dc4792a10406b45c) ) | |
| 680 | ROM_LOAD32_WORD_SWAP( "09", 0x1000002, 0x200000, CRC(28c0f55c) SHA1(0390aaf272deb1338293823d9d3a27306b2d9db6) ) | |
| 681 | ROM_LOAD32_WORD_SWAP( "10", 0x1400000, 0x200000, CRC(45f374f4) SHA1(a5cec2fcb58445e0ff74c86b20aba7accd132ea5) ) | |
| 682 | ROM_LOAD32_WORD_SWAP( "11", 0x1400002, 0x200000, CRC(cac54db3) SHA1(c31366e22d242ec0c0bb9f79869352894173db88) ) | |
| 683 | ROM_LOAD32_WORD_SWAP( "12", 0x1800000, 0x200000, CRC(66e681ff) SHA1(8f78dec1dc3e5c6825f559cef69e413c98ed9aab) ) | |
| 684 | ROM_LOAD32_WORD_SWAP( "13", 0x1800002, 0x200000, CRC(14bd38a9) SHA1(a3ff48de8150616a8ca49abf60225455397b938c) ) | |
| 685 | ROM_LOAD32_WORD_SWAP( "14", 0x1c00000, 0x200000, CRC(8eb1b01b) SHA1(e144ba01aa65dc96e22d1d41c3ca87ae19e874d5) ) | |
| 686 | ROM_LOAD32_WORD_SWAP( "15", 0x1c00002, 0x200000, CRC(3b06fe4e) SHA1(35356a116e6b825b8ed93c8ea1e016491ac1863a) ) | |
| 687 | ||
| 688 | ROM_REGION( 0x008000, "cpu1", 0 ) /* QDSP ('51) Code */ | |
| 689 | ROM_LOAD( "u107", 0x0000, 0x8000, CRC(89450a2f) SHA1(d58efa805f497bec179fdbfb8c5860ac5438b4ec) ) | |
| 690 | ||
| 691 | ROM_REGION( 0x008000, "cpu2", 0 ) /* Sound (80c301) CPU Code */ | |
| 692 | ROM_LOAD( "hc2j.u111", 0x0000, 0x8000, CRC(79012474) SHA1(09a2d5705d7bc52cc2d1644c87c1e31ee44813ef) ) | |
| 693 | ||
| 694 | ROM_REGION( 0x080000, "music", 0 ) /* Music data */ | |
| 695 | ROM_LOAD( "u108", 0x00000, 0x80000, CRC(75fc7a65) SHA1(308715ab62d28787ee894ddcf7304464e2543b2e) ) | |
| 696 | ||
| 697 | ROM_REGION( 0x080000, "sfx", 0 ) /* QDSP samples (SFX) */ | |
| 698 | ROM_LOAD( "u97", 0x00000, 0x80000, CRC(a7a1627e) SHA1(a93ced858d839daac1fa9a85f4f8c89cb179bad5) ) | |
| 699 | ||
| 700 | ROM_REGION( 0x080000, "wavetable", 0 ) /* QDSP wavetable rom */ | |
| 701 | ROM_LOAD( "qs1001a.u96", 0x000000, 0x80000, CRC(d13c6407) SHA1(57b14f97c7d4f9b5d9745d3571a0b7115fbe3176) ) | |
| 702 | ROM_END | |
| 703 | ||
| 704 | ||
| 667 | 705 | /* |
| 668 | 706 | |
| 669 | 707 | Raccoon World |
| r10315 | r10316 | |
| 1116 | 1154 | GAME( 1998, hidnctch, 0, eolith45, hidnctch, eolith, ROT0, "Eolith", "Hidden Catch (World) / Tul Lin Gu Lim Chat Ki '98 (Korea) (pcb ver 3.03)", GAME_NO_SOUND ) // or Teurrin Geurim Chajgi '98 |
| 1117 | 1155 | GAME( 1998, raccoon, 0, eolith45, raccoon, eolith, ROT0, "Eolith", "Raccoon World", GAME_NO_SOUND ) |
| 1118 | 1156 | GAME( 1998, puzzlekg, 0, eolith45, puzzlekg, eolith, ROT0, "Eolith", "Puzzle King (Dance & Puzzle)", GAME_NO_SOUND ) |
| 1119 | GAME( 1999, hidctch2, 0, eolith50, hidnctch, hidctch2, ROT0, "Eolith", "Hidden Catch 2 (pcb ver 3.03)", GAME_NO_SOUND ) | |
| 1157 | GAME( 1999, hidctch2, 0, eolith50, hidnctch, hidctch2, ROT0, "Eolith", "Hidden Catch 2 (pcb ver 3.03) (Kor/Eng) (AT89c52 protected)", GAME_NO_SOUND ) | |
| 1158 | GAME( 1999, hidctch2a, hidctch2, eolith50, hidnctch, eolith, ROT0, "Eolith", "Hidden Catch 2 (pcb ver 1.00) (Kor/Eng/Jpn/Chi)", GAME_NO_SOUND ) | |
| 1120 | 1159 | GAME( 1999, landbrk, 0, eolith45, landbrk, landbrk, ROT0, "Eolith", "Land Breaker (World) / Miss Tang Ja Ru Gi (Korea) (pcb ver 3.02)", GAME_NO_SOUND ) // or Miss Ttang Jjareugi |
| 1121 | GAME( 1999, landbrka, landbrk, eolith45, landbrk, landbrka, ROT0, "Eolith", "Land Breaker (World) / Miss Tang Ja Ru Gi (Korea) (pcb ver 3.03)", GAME_NO_SOUND ) // or Miss Ttang Jjareugi | |
| 1122 | GAME( 1999, penfan, 0, eolith45, landbrk, eolith, ROT0, "Eolith", "Penfan Girls - Step1. Mild Mind", GAME_NO_SOUND ) // alt title of Ribbon? (todo: speedup) | |
| 1160 | GAME( 1999, landbrka, landbrk, eolith45, landbrk, landbrka, ROT0, "Eolith", "Land Breaker (World) / Miss Tang Ja Ru Gi (Korea) (pcb ver 3.03) (AT89c52 protected)", GAME_NO_SOUND ) // or Miss Ttang Jjareugi | |
| 1161 | GAME( 1999, penfan, 0, eolith45, landbrk, eolith, ROT0, "Eolith", "Penfan Girls - Step1. Mild Mind", GAME_NO_SOUND ) // alt title of Ribbon? | |
| 1123 | 1162 | GAME( 1999, nhidctch, 0, eolith45, hidnctch, eolith, ROT0, "Eolith", "New Hidden Catch (World) / New Tul Lin Gu Lim Chat Ki '98 (Korea) (pcb ver 3.02)", GAME_NO_SOUND ) // or New Teurrin Geurim Chajgi '98 |
| 1124 | 1163 | GAME( 2000, hidctch3, 0, eolith50, hidctch3, hidctch3, ROT0, "Eolith", "Hidden Catch 3 (ver 1.00 / pcb ver 3.05)", GAME_NO_SOUND ) |
| 1125 | 1164 | GAME( 2001, fort2b, 0, eolith50, common, eolith, ROT0, "Eolith", "Fortress 2 Blue Arcade (ver 1.01 / pcb ver 3.05)", GAME_NO_SOUND ) |
| r10315 | r10316 | |
|---|---|---|
| 2040 | 2040 | |
| 2041 | 2041 | static MACHINE_START( s23 ) |
| 2042 | 2042 | { |
| 2043 | c361_timer = timer_alloc( | |
| 2043 | c361_timer = machine->scheduler().timer_alloc(FUNC(c | |
| 2044 | 2044 | timer_adjust_oneshot(c361_timer, attotime::never, 0); |
| 2045 | 2045 | } |
| 2046 | 2046 |
| r10315 | r10316 | |
|---|---|---|
| 299 | 299 | static WRITE16_HANDLER( int_enable_w ) |
| 300 | 300 | { |
| 301 | 301 | if (offset == 0 && ACCESSING_BITS_0_7) |
| 302 | | |
| 302 | | |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 |
| r10315 | r10316 | |
|---|---|---|
| 160 | 160 | dac_data_w(state->dac, DACROM[(state->dac_bank * 0x10000 + state->dac_adr++) & 0x1ffff]); |
| 161 | 161 | |
| 162 | 162 | if (((state->dac_adr & 0xff00 ) >> 8) != state->dac_adr_e) |
| 163 | timer_set( | |
| 163 | machine->scheduler().timer_set( | |
| 164 | 164 | else |
| 165 | 165 | state->dac_busy = 0; |
| 166 | 166 | } |
| r10315 | r10316 | |
| 178 | 178 | state->dac_adr = state->dac_adr_s << 8; |
| 179 | 179 | |
| 180 | 180 | if (state->dac_busy == 0) |
| 181 | | |
| 181 | | |
| 182 | 182 | |
| 183 | 183 | state->dac_busy = 1; |
| 184 | 184 | } |
| r10315 | r10316 | |
|---|---|---|
| 147 | 147 | |
| 148 | 148 | static void create_interrupt_timer(running_machine *machine) |
| 149 | 149 | { |
| 150 | interrupt_timer = timer_alloc( | |
| 150 | interrupt_timer = machine->scheduler().timer_alloc(FUNC(in | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 |
| r10315 | r10316 | |
|---|---|---|
| 637 | 637 | wheelfir_state *state = space->machine->driver_data<wheelfir_state>(); |
| 638 | 638 | COMBINE_DATA(&state->soundlatch); |
| 639 | 639 | cputag_set_input_line(space->machine, "subcpu", 1, HOLD_LINE); /* guess, tested also with periodic interrupts and latch clear*/ |
| 640 | | |
| 640 | | |
| 641 | 641 | } |
| 642 | 642 | |
| 643 | 643 | static READ16_HANDLER( wheelfir_snd_r ) |
| r10315 | r10316 | |
| 721 | 721 | static TIMER_DEVICE_CALLBACK( scanline_timer_callback ) |
| 722 | 722 | { |
| 723 | 723 | wheelfir_state *state = timer.machine->driver_data<wheelfir_state>(); |
| 724 | timer | |
| 724 | timer.machin | |
| 725 | 725 | state->current_scanline=param; |
| 726 | 726 | |
| 727 | 727 | if(state->current_scanline<NUM_SCANLINES) |
| r10315 | r10316 | |
|---|---|---|
| 1370 | 1370 | uPD71054->max[no] = 0xffff; |
| 1371 | 1371 | } |
| 1372 | 1372 | for( no = 0; no < USED_TIMER_NUM; no++ ) { |
| 1373 | uPD71054->timer[no] = timer_alloc( | |
| 1373 | uPD71054->timer[no] = machine->scheduler().timer_alloc( FUNC( | |
| 1374 | 1374 | } |
| 1375 | 1375 | } |
| 1376 | 1376 | |
| r10315 | r10316 | |
| 2064 | 2064 | if ((data & 0x0010) && !state->keroppi_prize_hop) |
| 2065 | 2065 | { |
| 2066 | 2066 | state->keroppi_prize_hop = 1; |
| 2067 | | |
| 2067 | | |
| 2068 | 2068 | } |
| 2069 | 2069 | } |
| 2070 | 2070 |
| r10315 | r10316 | |
|---|---|---|
| 6899 | 6899 | static const UINT32 kofxi_key = 0xa4be3; |
| 6900 | 6900 | static const UINT32 dirtypig_key = 0xc194f; |
| 6901 | 6901 | static const UINT32 mslug6_key = 0x53627; |
| 6902 | static const UINT32 samsptk_key = 0xe935f; | |
| 6902 | 6903 | |
| 6903 | 6904 | static DRIVER_INIT( atomiswave ) |
| 6904 | 6905 | { |
| r10315 | r10316 | |
| 6949 | 6950 | AW_DRIVER_INIT(ftspeed) |
| 6950 | 6951 | AW_DRIVER_INIT(dirtypig) |
| 6951 | 6952 | AW_DRIVER_INIT(mslug6) |
| 6953 | AW_DRIVER_INIT(samsptk) | |
| 6952 | 6954 | |
| 6953 | 6955 | ROM_START( fotns ) |
| 6954 | 6956 | ROM_REGION( 0x200000, "awflash", 0) |
| r10315 | r10316 | |
| 7241 | 7243 | ROM_COPY( "user1", 0x7000000, 0x9000000, 0x2000000) |
| 7242 | 7244 | ROM_END |
| 7243 | 7245 | |
| 7246 | ROM_START( samsptk ) | |
| 7247 | ROM_REGION( 0x200000, "awflash", 0) | |
| 7248 | AW_BIOS | |
| 7249 | ||
| 7250 | ROM_REGION( 0x10000000, "user1", ROMREGION_ERASE) | |
| 7251 | ROM_LOAD( "ax2901p01.fmem1", 0x0000000, 0x0800000, CRC(58e0030b) SHA1(ed8a66833beeb56d83770123eff28df0f25221d1) ) | |
| 7252 | ROM_LOAD( "ax2901m01.mrom1", 0x1000000, 0x2000000, CRC(dbbbd90d) SHA1(102ee0b249a3e0ca2f659b6c515816c522ad78d0) ) | |
| 7253 | ROM_LOAD( "ax2902m01.mrom2", 0x3000000, 0x2000000, CRC(a3bd7890) SHA1(9b8d934d6ebc3ef688cd8a6de47657a0663fea10) ) | |
| 7254 | ROM_LOAD( "ax2903m01.mrom3", 0x5000000, 0x2000000, CRC(56f50fdd) SHA1(8a5a4a99108c0279056998046c7b332e80121dee) ) | |
| 7255 | ROM_LOAD( "ax2904m01.mrom4", 0x7000000, 0x2000000, CRC(8a3ae175) SHA1(966f527a92e24c8eb770344697f2edf6140cf971) ) | |
| 7256 | ROM_LOAD( "ax2905m01.mrom5", 0x9000000, 0x2000000, CRC(429877ba) SHA1(88e1f3bc682b18d331e328ef8754065109cf9bda) ) | |
| 7257 | ROM_LOAD( "ax2906m01.mrom6", 0xb000000, 0x2000000, CRC(cb95298d) SHA1(5fb5d5a0d6801df61101a1b23de0c14ff29ef654) ) | |
| 7258 | ROM_LOAD( "ax2907m01.mrom7", 0xd000000, 0x2000000, CRC(48015081) SHA1(3c0a0a6dc9ab7bf889579477699e612c3092f9bf) ) | |
| 7259 | ROM_END | |
| 7260 | ||
| 7244 | 7261 | /* Atomiswave */ |
| 7245 | 7262 | GAME( 2001, awbios, 0, aw, aw, atomiswave, ROT0, "Sammy", "Atomiswave Bios", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT ) |
| 7246 | 7263 | |
| r10315 | r10316 | |
| 7257 | 7274 | GAME( 2004, kov7sprt, awbios, aw, aw, kov7sprt, ROT0, "Sammy / IGS", "Knights of Valour - The Seven Spirits", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND ) |
| 7258 | 7275 | GAME( 2005, vfurlong, awbios, aw, aw, vfurlong, ROT0, "Sammy", "Net Select Keiba Victory Furlong", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 7259 | 7276 | GAME( 2005, ngbc, awbios, aw, aw, ngbc, ROT0, "Sammy / SNK Playmore", "Neo-Geo Battle Coliseum", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 7277 | GAME( 2005, samsptk, awbios, aw, aw, samsptk, ROT0, "Sammy / SNK Playmore", "Samurai Spirits Tenkaichi Kenkakuden", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 7260 | 7278 | GAME( 2005, kofxi, awbios, aw, aw, kofxi, ROT0, "Sammy / SNK Playmore", "The King of Fighters XI", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 7261 | 7279 | GAME( 2005, fotns, awbios, aw, aw, fotns, ROT0, "Sega / Arc System Works", "Fist Of The North Star", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 7262 | 7280 | GAME( 2005, kofnw, awbios, aw, aw, kofnw, ROT0, "Sammy / SNK Playmore", "The King of Fighters Neowave", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| r10315 | r10316 | |
|---|---|---|
| 1531 | 1531 | if(LOG_SCU) logerror("DMA transfer END\n"); |
| 1532 | 1532 | |
| 1533 | 1533 | /*TODO: timing of this*/ |
| 1534 | | |
| 1534 | | |
| 1535 | 1535 | |
| 1536 | 1536 | if(scu_add_tmp & 0x80000000) |
| 1537 | 1537 | { |
| r10315 | r10316 | |
| 1632 | 1632 | |
| 1633 | 1633 | if(LOG_SCU) logerror("DMA transfer END\n"); |
| 1634 | 1634 | |
| 1635 | | |
| 1635 | | |
| 1636 | 1636 | |
| 1637 | 1637 | if(scu_add_tmp & 0x80000000) |
| 1638 | 1638 | { |
| r10315 | r10316 | |
| 1733 | 1733 | |
| 1734 | 1734 | if(LOG_SCU) logerror("DMA transfer END\n"); |
| 1735 | 1735 | |
| 1736 | | |
| 1736 | | |
| 1737 | 1737 | |
| 1738 | 1738 | if(scu_add_tmp & 0x80000000) |
| 1739 | 1739 | { |
| r10315 | r10316 | |
| 1808 | 1808 | |
| 1809 | 1809 | }while(job_done == 0); |
| 1810 | 1810 | |
| 1811 | | |
| 1811 | | |
| 1812 | 1812 | } |
| 1813 | 1813 | |
| 1814 | 1814 | static void dma_indirect_lv1(address_space *space) |
| r10315 | r10316 | |
| 1877 | 1877 | |
| 1878 | 1878 | }while(job_done == 0); |
| 1879 | 1879 | |
| 1880 | | |
| 1880 | | |
| 1881 | 1881 | } |
| 1882 | 1882 | |
| 1883 | 1883 | static void dma_indirect_lv2(address_space *space) |
| r10315 | r10316 | |
| 1945 | 1945 | |
| 1946 | 1946 | }while(job_done == 0); |
| 1947 | 1947 | |
| 1948 | | |
| 1948 | | |
| 1949 | 1949 | } |
| 1950 | 1950 | |
| 1951 | 1951 | |
| r10315 | r10316 | |
| 2633 | 2633 | smpc_ram[0x2d] = DectoBCD(systime.local_time.minute); |
| 2634 | 2634 | smpc_ram[0x2f] = DectoBCD(systime.local_time.second); |
| 2635 | 2635 | |
| 2636 | stv_rtc_timer = timer_alloc( | |
| 2636 | stv_rtc_timer = machine->scheduler().timer_alloc(FUNC( | |
| 2637 | 2637 | } |
| 2638 | 2638 | |
| 2639 | 2639 | /* |
| r10315 | r10316 | |
| 2816 | 2816 | |
| 2817 | 2817 | /*TODO: timing of this one (related to the VDP1 speed)*/ |
| 2818 | 2818 | /* (NOTE: value shouldn't be at h_sync/v_sync position (will break shienryu))*/ |
| 2819 | | |
| 2819 | | |
| 2820 | 2820 | } |
| 2821 | 2821 | |
| 2822 | 2822 | static MACHINE_RESET( stv ) |
| r10315 | r10316 | |
|---|---|---|
| 272 | 272 | if (game_region) |
| 273 | 273 | { |
| 274 | 274 | { |
| 275 | timer_set( | |
| 275 | machine->scheduler().timer_set( | |
| 276 | 276 | } |
| 277 | 277 | } |
| 278 | 278 | else |
| r10315 | r10316 | |
| 287 | 287 | |
| 288 | 288 | static void megatech_select_game(running_machine *machine, int gameno) |
| 289 | 289 | { |
| 290 | timer_set( | |
| 290 | machine->scheduler().timer_set( | |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | static WRITE8_HANDLER( megatech_cart_select_w ) |
| r10315 | r10316 | |
|---|---|---|
| 163 | 163 | state_save_register_global_array(machine, last_analog_input); |
| 164 | 164 | state_save_register_global_array(machine, last_analog_output); |
| 165 | 165 | |
| 166 | irq_off = timer_alloc(machine, irq_off_tick, 0); | |
| 167 | irq_timer = timer_alloc(machine, irq_timer_tick, 0); | |
| 168 | firq_off = timer_alloc(machine, firq_off_tick, 0); | |
| 169 | firq_timer = timer_alloc(machine, firq_timer_tick, 0); | |
| 166 | irq_off = machine->scheduler().timer_alloc(FUNC(irq_off_tick)); | |
| 167 | irq_timer = machine->scheduler().timer_alloc(FUNC(irq_timer_tick)); | |
| 168 | firq_off = machine->scheduler().timer_alloc(FUNC(firq_off_tick)); | |
| 169 | firq_timer = machine->scheduler().timer_alloc(FUNC(firq_timer_tick)); | |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 |
| r10315 | r10316 | |
|---|---|---|
| 182 | 182 | |
| 183 | 183 | static INTERRUPT_GEN( slapshot_interrupt ) |
| 184 | 184 | { |
| 185 | | |
| 185 | | |
| 186 | 186 | cpu_set_input_line(device, 5, HOLD_LINE); |
| 187 | 187 | } |
| 188 | 188 |
| r10315 | r10316 | |
|---|---|---|
| 419 | 419 | MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK | VIDEO_BUFFERS_SPRITERAM) |
| 420 | 420 | |
| 421 | 421 | MCFG_SCREEN_ADD("screen", RASTER) |
| 422 | MCFG_SCREEN_REFRESH_RATE( (XTAL_14MHz / 2) / (446 * 286) ) | |
| 423 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
| 422 | MCFG_SCREEN_RAW_PARAMS(XTAL_14MHz/2, 446, 0, 320, 286, 0, 240) | |
| 424 | 423 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 425 | MCFG_SCREEN_SIZE(64*8, 64*8) | |
| 426 | MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1) | |
| 427 | 424 | |
| 428 | 425 | MCFG_GFXDECODE(wardner) |
| 429 | 426 | MCFG_PALETTE_LENGTH(1792) |
| r10315 | r10316 | |
|---|---|---|
| 518 | 518 | space->set_direct_update_handler(direct_update_delegate_create_static(missile_direct_handler, *machine)); |
| 519 | 519 | |
| 520 | 520 | /* create a timer to speed/slow the CPU */ |
| 521 | state->cpu_timer = timer_alloc( | |
| 521 | state->cpu_timer = machine->scheduler().timer_alloc(FUNC(a | |
| 522 | 522 | timer_adjust_oneshot(state->cpu_timer, machine->primary_screen->time_until_pos(v_to_scanline(state, 0), 0), 0); |
| 523 | 523 | |
| 524 | 524 | /* create a timer for IRQs and set up the first callback */ |
| 525 | state->irq_timer = timer_alloc( | |
| 525 | state->irq_timer = machine->scheduler().timer_alloc(FUNC(c | |
| 526 | 526 | state->irq_state = 0; |
| 527 | 527 | schedule_next_irq(machine, -32); |
| 528 | 528 |
| r10315 | r10316 | |
|---|---|---|
| 357 | 357 | { |
| 358 | 358 | m63_state *state = space->machine->driver_data<m63_state>(); |
| 359 | 359 | cpu_set_input_line(state->soundcpu, 0, ASSERT_LINE); |
| 360 | | |
| 360 | | |
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | static WRITE8_HANDLER( snddata_w ) |
| r10315 | r10316 | |
|---|---|---|
| 371 | 371 | |
| 372 | 372 | static WRITE8_HANDLER( sound_command_w ) |
| 373 | 373 | { |
| 374 | | |
| 374 | | |
| 375 | 375 | } |
| 376 | 376 | |
| 377 | 377 |
| r10315 | r10316 | |
|---|---|---|
| 106 | 106 | static MACHINE_START( m72 ) |
| 107 | 107 | { |
| 108 | 108 | m72_state *state = machine->driver_data<m72_state>(); |
| 109 | state->scanline_timer = timer_alloc(m | |
| 109 | state->scanline_timer = machine->scheduler().timer_alloc(FUNC(m | |
| 110 | 110 | |
| 111 | 111 | state_save_register_global(machine, state->mcu_sample_addr); |
| 112 | 112 | state_save_register_global(machine, state->mcu_snd_cmd_latch); |
| r10315 | r10316 | |
| 115 | 115 | static MACHINE_START( kengo ) |
| 116 | 116 | { |
| 117 | 117 | m72_state *state = machine->driver_data<m72_state>(); |
| 118 | state->scanline_timer = timer_alloc( | |
| 118 | state->scanline_timer = machine->scheduler().timer_alloc(FUNC( | |
| 119 | 119 | |
| 120 | 120 | state_save_register_global(machine, state->mcu_sample_addr); |
| 121 | 121 | state_save_register_global(machine, state->mcu_snd_cmd_latch); |
| r10315 | r10316 | |
| 135 | 135 | state->mcu_snd_cmd_latch = 0; |
| 136 | 136 | |
| 137 | 137 | timer_adjust_oneshot(state->scanline_timer, machine->primary_screen->time_until_pos(0), 0); |
| 138 | | |
| 138 | | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | static MACHINE_RESET( xmultipl ) |
| r10315 | r10316 | |
| 259 | 259 | state->protection_ram[offset] = val; |
| 260 | 260 | cputag_set_input_line(space->machine, "mcu", 0, ASSERT_LINE); |
| 261 | 261 | /* Line driven, most likely by write line */ |
| 262 | //timer_set(space->machine, space->machine->device<cpu_device>("mcu")->cycles_to_attotime(2), NULL, 0, mcu_irq0_clear); | |
| 263 | //timer_set(space->machine, space->machine->device<cpu_device>("mcu")->cycles_to_attotime(0), NULL, 0, mcu_irq0_raise); | |
| 262 | //space->machine->scheduler().timer_set(space->machine->device<cpu_device>("mcu")->cycles_to_attotime(2), FUNC(mcu_irq0_clear)); | |
| 263 | //space->machine->scheduler().timer_set(space->machine->device<cpu_device>("mcu")->cycles_to_attotime(0), FUNC(mcu_irq0_raise)); | |
| 264 | 264 | } |
| 265 | 265 | else |
| 266 | | |
| 266 | | |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | static WRITE8_HANDLER( m72_mcu_data_w ) |
| r10315 | r10316 | |
| 273 | 273 | if (offset&1) val = (state->protection_ram[offset/2] & 0x00ff) | (data << 8); |
| 274 | 274 | else val = (state->protection_ram[offset/2] & 0xff00) | (data&0xff); |
| 275 | 275 | |
| 276 | | |
| 276 | | |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | static READ8_HANDLER(m72_mcu_data_r ) |
| r10315 | r10316 | |
|---|---|---|
| 139 | 139 | |
| 140 | 140 | static WRITE8_HANDLER( main_to_sound_w ) |
| 141 | 141 | { |
| 142 | | |
| 142 | | |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | |
| r10315 | r10316 | |
| 170 | 170 | |
| 171 | 171 | static WRITE8_HANDLER( sound_to_main_w ) |
| 172 | 172 | { |
| 173 | | |
| 173 | | |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 |
| r10315 | r10316 | |
|---|---|---|
| 303 | 303 | static INTERRUPT_GEN( topspeed_interrupt ) |
| 304 | 304 | { |
| 305 | 305 | /* Unsure how many int6's per frame */ |
| 306 | | |
| 306 | | |
| 307 | 307 | cpu_set_input_line(device, 5, HOLD_LINE); |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | static INTERRUPT_GEN( topspeed_cpub_interrupt ) |
| 311 | 311 | { |
| 312 | 312 | /* Unsure how many int6's per frame */ |
| 313 | | |
| 313 | | |
| 314 | 314 | cpu_set_input_line(device, 5, HOLD_LINE); |
| 315 | 315 | } |
| 316 | 316 |
| r10315 | r10316 | |
|---|---|---|
| 446 | 446 | case 0x02: |
| 447 | 447 | ret=ret^0x20; |
| 448 | 448 | inscrd++; |
| 449 | | |
| 449 | | |
| 450 | 450 | break; |
| 451 | 451 | |
| 452 | 452 | default: |
| r10315 | r10316 | |
| 460 | 460 | { |
| 461 | 461 | case 0x00: |
| 462 | 462 | ret=ret^0x40; |
| 463 | | |
| 463 | | |
| 464 | 464 | hopper_motor=0x02; |
| 465 | 465 | break; |
| 466 | 466 | case 0x01: |
| r10315 | r10316 | |
|---|---|---|
| 313 | 313 | calculate_collisions(space->machine); |
| 314 | 314 | |
| 315 | 315 | /* 100 cycle delay is arbitrary */ |
| 316 | | |
| 316 | | |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | state->_1f98_data = data; |
| r10315 | r10316 | |
|---|---|---|
| 31 | 31 | { |
| 32 | 32 | if (val == 0) |
| 33 | 33 | { |
| 34 | state->time_released = | |
| 34 | state->time_released = | |
| 35 | 35 | |
| 36 | 36 | if (!state->mask) |
| 37 | 37 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, ASSERT_LINE); |
| 38 | 38 | } |
| 39 | 39 | else |
| 40 | state->time_pushed = | |
| 40 | state->time_pushed = | |
| 41 | 41 | |
| 42 | 42 | state->prev = val; |
| 43 | 43 | } |
| r10315 | r10316 | |
| 57 | 57 | if (scanline >= 263) |
| 58 | 58 | scanline = 32; |
| 59 | 59 | |
| 60 | timer_set(machine | |
| 60 | machine->scheduler().timer_set(machine | |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | |
| r10315 | r10316 | |
| 65 | 65 | { |
| 66 | 66 | device_t *discrete = machine->device("discrete"); |
| 67 | 67 | |
| 68 | timer_set(machine | |
| 68 | machine->scheduler().timer_set(machine | |
| 69 | 69 | |
| 70 | 70 | /* both output latches are cleared on reset */ |
| 71 | 71 | |
| r10315 | r10316 | |
| 77 | 77 | static double calc_plunger_pos(running_machine *machine) |
| 78 | 78 | { |
| 79 | 79 | videopin_state *state = machine->driver_data<videopin_state>(); |
| 80 | return ( | |
| 80 | return ( | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 |
| r10315 | r10316 | |
|---|---|---|
| 36 | 36 | static MACHINE_START( runaway ) |
| 37 | 37 | { |
| 38 | 38 | runaway_state *state = machine->driver_data<runaway_state>(); |
| 39 | state->interrupt_timer = timer_alloc( | |
| 39 | state->interrupt_timer = machine->scheduler().timer_alloc(FUNC(in | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | static MACHINE_RESET( runaway ) |
| r10315 | r10316 | |
|---|---|---|
| 84 | 84 | |
| 85 | 85 | static READ8_HANDLER( subcpu_halt_set ) |
| 86 | 86 | { |
| 87 | | |
| 87 | | |
| 88 | 88 | subcpu_status|=2; |
| 89 | 89 | return 0; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | static READ8_HANDLER( subcpu_halt_clear ) |
| 93 | 93 | { |
| 94 | | |
| 94 | | |
| 95 | 95 | subcpu_status&=~1; |
| 96 | 96 | subcpu_status&=~2; |
| 97 | 97 | return 0; |
| r10315 | r10316 | |
|---|---|---|
| 110 | 110 | // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); |
| 111 | 111 | |
| 112 | 112 | if (!namcoio_read_reset_line(namcoio_0)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 113 | | |
| 113 | | |
| 114 | 114 | |
| 115 | 115 | if (!namcoio_read_reset_line(namcoio_1)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 116 | | |
| 116 | | |
| 117 | 117 | |
| 118 | 118 | if (!namcoio_read_reset_line(namcoio_2)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 119 | | |
| 119 | | |
| 120 | 120 | |
| 121 | 121 | } |
| 122 | 122 | |
| r10315 | r10316 | |
| 154 | 154 | { |
| 155 | 155 | /* we must do this on a timer in order to have it take effect */ |
| 156 | 156 | /* otherwise, the reset process will override our changes */ |
| 157 | | |
| 157 | | |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | static INTERRUPT_GEN( toypop_m68000_interrupt ) |
| r10315 | r10316 | |
|---|---|---|
| 57 | 57 | if (input_port_read(machine, "IN0") & 0x40) |
| 58 | 58 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE); |
| 59 | 59 | |
| 60 | timer_set(machine | |
| 60 | machine->scheduler().timer_set(machine | |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | |
| 64 | 64 | static MACHINE_RESET( ultratnk ) |
| 65 | 65 | { |
| 66 | timer_set(machine | |
| 66 | machine->scheduler().timer_set(machine | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 |
| r10315 | r10316 | |
|---|---|---|
| 188 | 188 | static TIMER_CALLBACK( interrupt_gen ) |
| 189 | 189 | { |
| 190 | 190 | cputag_set_input_line(machine, "maincpu", 0, HOLD_LINE); |
| 191 | timer_set(machine | |
| 191 | machine->scheduler().timer_set(machine | |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | static MACHINE_RESET( tugboat ) |
| 195 | 195 | { |
| 196 | timer_set(machine | |
| 196 | machine->scheduler().timer_set(machine | |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 |
| r10315 | r10316 | |
|---|---|---|
| 199 | 199 | |
| 200 | 200 | static READ8_HANDLER( mcu_acknowledge_r ) |
| 201 | 201 | { |
| 202 | | |
| 202 | | |
| 203 | 203 | return 0; |
| 204 | 204 | } |
| 205 | 205 | |
| r10315 | r10316 | |
| 463 | 463 | break; |
| 464 | 464 | |
| 465 | 465 | case 0x5: // answer to Z80 |
| 466 | | |
| 466 | | |
| 467 | 467 | break; |
| 468 | 468 | |
| 469 | 469 | case 0x6: |
| r10315 | r10316 | |
| 479 | 479 | |
| 480 | 480 | static WRITE8_HANDLER( hotsmash_z80_mcu_w ) |
| 481 | 481 | { |
| 482 | | |
| 482 | | |
| 483 | 483 | } |
| 484 | 484 | |
| 485 | 485 | static READ8_HANDLER(hotsmash_from_mcu_r) |
| r10315 | r10316 | |
|---|---|---|
| 285 | 285 | state->k053246 = machine->device("k053246"); |
| 286 | 286 | state->k053251 = machine->device("k053251"); |
| 287 | 287 | |
| 288 | state->dmadelay_timer = timer_alloc( | |
| 288 | state->dmadelay_timer = machine->scheduler().timer_alloc(FUNC( | |
| 289 | 289 | |
| 290 | 290 | state_save_register_global(machine, state->cur_control2); |
| 291 | 291 | } |
| r10315 | r10316 | |
|---|---|---|
| 615 | 615 | { |
| 616 | 616 | signal_v60_irq(device->machine, MAIN_IRQ_VBSTART); |
| 617 | 617 | system32_set_vblank(device->machine, 1); |
| 618 | | |
| 618 | | |
| 619 | 619 | if (system32_prot_vblank) |
| 620 | 620 | (*system32_prot_vblank)(device); |
| 621 | 621 | } |
| r10315 | r10316 | |
|---|---|---|
| 219 | 219 | timer_adjust_oneshot(state->int_timer, machine->primary_screen->time_until_pos(param), param); |
| 220 | 220 | |
| 221 | 221 | /* an RC circuit turns the interrupt off after a short amount of time */ |
| 222 | timer_set( | |
| 222 | machine->scheduler().timer_set( | |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | |
| r10315 | r10316 | |
| 232 | 232 | state->ppi8255_1 = machine->device("ppi8255_1"); |
| 233 | 233 | state->samples = machine->device("samples"); |
| 234 | 234 | |
| 235 | state->int_timer = timer_alloc( | |
| 235 | state->int_timer = machine->scheduler().timer_alloc(FUNC( | |
| 236 | 236 | timer_adjust_oneshot(state->int_timer, machine->primary_screen->time_until_pos(128), 128); |
| 237 | 237 | |
| 238 | 238 | state_save_register_global(machine, state->screen_flip); |
| r10315 | r10316 | |
|---|---|---|
| 7968 | 7968 | DRIVER_INIT_CALL(neogeo); |
| 7969 | 7969 | |
| 7970 | 7970 | /* start a timer that will check the BIOS select DIP every second */ |
| 7971 | timer_set(machine, attotime::zero, NULL, 0, ms5pcb_bios_timer_callback); | |
| 7972 | timer_pulse(machine, attotime::from_msec(1000), NULL, 0, ms5pcb_bios_timer_callback); | |
| 7971 | machine->scheduler().timer_set(attotime::zero, FUNC(ms5pcb_bios_timer_callback)); | |
| 7972 | machine->scheduler().timer_pulse(attotime::from_msec(1000), FUNC(ms5pcb_bios_timer_callback)); | |
| 7973 | 7973 | |
| 7974 | 7974 | mslug5_decrypt_68k(machine); |
| 7975 | 7975 | svcpcb_gfx_decrypt(machine); |
| r10315 | r10316 | |
| 8005 | 8005 | DRIVER_INIT_CALL(neogeo); |
| 8006 | 8006 | |
| 8007 | 8007 | /* start a timer that will check the BIOS select DIP every second */ |
| 8008 | timer_set(machine, attotime::zero, NULL, 0, svcpcb_bios_timer_callback); | |
| 8009 | timer_pulse(machine, attotime::from_msec(1000), NULL, 0, svcpcb_bios_timer_callback); | |
| 8008 | machine->scheduler().timer_set(attotime::zero, FUNC(svcpcb_bios_timer_callback)); | |
| 8009 | machine->scheduler().timer_pulse(attotime::from_msec(1000), FUNC(svcpcb_bios_timer_callback)); | |
| 8010 | 8010 | |
| 8011 | 8011 | svc_px_decrypt(machine); |
| 8012 | 8012 | svcpcb_gfx_decrypt(machine); |
| r10315 | r10316 | |
|---|---|---|
| 268 | 268 | { |
| 269 | 269 | // IRQ |
| 270 | 270 | cpu_set_input_line(device, 0, ASSERT_LINE); |
| 271 | | |
| 271 | | |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | static MACHINE_START( esh ) |
| r10315 | r10316 | |
|---|---|---|
| 44 | 44 | { "raccoon", 0x40008204, 239 }, |
| 45 | 45 | { "puzzlekg", 0x40029458, 239 }, |
| 46 | 46 | { "hidctch2", 0x40009524, 239 }, |
| 47 | { "hidctch2a",0x40029B58, 239 }, | |
| 47 | 48 | { "landbrk", 0x40023574, 239 }, |
| 48 | 49 | { "landbrka", 0x4002446c, 239 }, |
| 49 | 50 | { "nhidctch", 0x40012778, 239 }, |
| r10315 | r10316 | |
|---|---|---|
| 71 | 71 | static WRITE8_HANDLER( fromance_commanddata_w ) |
| 72 | 72 | { |
| 73 | 73 | /* do this on a timer to let the slave CPU synchronize */ |
| 74 | | |
| 74 | | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | |
| r10315 | r10316 | |
| 80 | 80 | fromance_state *state = space->machine->driver_data<fromance_state>(); |
| 81 | 81 | |
| 82 | 82 | /* set a timer to force synchronization after the read */ |
| 83 | | |
| 83 | | |
| 84 | 84 | |
| 85 | 85 | if (!state->directionflag) |
| 86 | 86 | return 0x00; // standby |
| r10315 | r10316 | |
|---|---|---|
| 2215 | 2215 | |
| 2216 | 2216 | init_common(machine); |
| 2217 | 2217 | |
| 2218 | blitter_reset_timer = timer_alloc( | |
| 2218 | blitter_reset_timer = machine->scheduler().timer_alloc(FUNC( | |
| 2219 | 2219 | } |
| 2220 | 2220 | |
| 2221 | 2221 |
| r10315 | r10316 | |
|---|---|---|
| 192 | 192 | static MACHINE_START( mustache ) |
| 193 | 193 | { |
| 194 | 194 | mustache_state *state = machine->driver_data<mustache_state>(); |
| 195 | state->clear_irq_timer = timer_alloc( | |
| 195 | state->clear_irq_timer = machine->scheduler().timer_alloc(FUNC(c | |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | static MACHINE_CONFIG_START( mustache, mustache_state ) |
| r10315 | r10316 | |
|---|---|---|
| 265 | 265 | |
| 266 | 266 | /* if we have a fake i8751 handler, disable the actual 8751 */ |
| 267 | 267 | if (state->i8751_vblank_hook != NULL) |
| 268 | | |
| 268 | | |
| 269 | 269 | |
| 270 | 270 | state->mcu_control = 0x00; |
| 271 | 271 | } |
| r10315 | r10316 | |
| 317 | 317 | /* the port C handshaking signals control the Z80 NMI, */ |
| 318 | 318 | /* so we have to sync whenever we access this PPI */ |
| 319 | 319 | if (ACCESSING_BITS_0_7) |
| 320 | | |
| 320 | space->machine->schedul | |
| 321 | 321 | return; |
| 322 | 322 | } |
| 323 | 323 | logerror("%06X:standard_io_w - unknown write access to address %04X = %04X & %04X\n", cpu_get_pc(space->cpu), offset * 2, data, mem_mask); |
| r10315 | r10316 | |
|---|---|---|
| 369 | 369 | static void create_interrupt_timers( running_machine *machine ) |
| 370 | 370 | { |
| 371 | 371 | neogeo_state *state = machine->driver_data<neogeo_state>(); |
| 372 | state->display_position_interrupt_timer = timer_alloc(machine, display_position_interrupt_callback, NULL); | |
| 373 | state->display_position_vblank_timer = timer_alloc(machine, display_position_vblank_callback, NULL); | |
| 374 | state->vblank_interrupt_timer = timer_alloc(machine, vblank_interrupt_callback, NULL); | |
| 372 | state->display_position_interrupt_timer = machine->scheduler().timer_alloc(FUNC(display_position_interrupt_callback)); | |
| 373 | state->display_position_vblank_timer = machine->scheduler().timer_alloc(FUNC(display_position_vblank_callback)); | |
| 374 | state->vblank_interrupt_timer = machine->scheduler().timer_alloc(FUNC(vblank_interrupt_callback)); | |
| 375 | 375 | } |
| 376 | 376 | |
| 377 | 377 |
| r10315 | r10316 | |
|---|---|---|
| 133 | 133 | |
| 134 | 134 | /* if we have a fake i8751 handler, disable the actual 8751 */ |
| 135 | 135 | if (state->i8751_vblank_hook != NULL) |
| 136 | | |
| 136 | | |
| 137 | 137 | |
| 138 | 138 | /* reset global state */ |
| 139 | 139 | state->adc_select = 0; |
| r10315 | r10316 | |
| 204 | 204 | case 0x0000/2: /* PPI @ 4B */ |
| 205 | 205 | /* the port C handshaking signals control the Z80 NMI, */ |
| 206 | 206 | /* so we have to sync whenever we access this PPI */ |
| 207 | | |
| 207 | space->machine->schedul | |
| 208 | 208 | return; |
| 209 | 209 | |
| 210 | 210 | case 0x3000/2: /* PPI @ 4C */ |
| r10315 | r10316 | |
| 260 | 260 | case 0x0000/2: |
| 261 | 261 | /* the port C handshaking signals control the Z80 NMI, */ |
| 262 | 262 | /* so we have to sync whenever we access this PPI */ |
| 263 | | |
| 263 | space->machine->schedul | |
| 264 | 264 | return; |
| 265 | 265 | |
| 266 | 266 | case 0x0020/2: /* PPI @ 4C */ |
| r10315 | r10316 | |
|---|---|---|
| 105 | 105 | static WRITE8_HANDLER( sound_command_w ) |
| 106 | 106 | { |
| 107 | 107 | soundlatch_w(space, 0, data); |
| 108 | | |
| 108 | | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | static WRITE8_HANDLER( nmi_disable_w ) |
| r10315 | r10316 | |
|---|---|---|
| 583 | 583 | |
| 584 | 584 | static INTERRUPT_GEN( taitof2_interrupt ) |
| 585 | 585 | { |
| 586 | | |
| 586 | | |
| 587 | 587 | cpu_set_input_line(device, 5, HOLD_LINE); |
| 588 | 588 | } |
| 589 | 589 |
| r10315 | r10316 | |
|---|---|---|
| 279 | 279 | memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x05806, 0x05806, 0, 0x07f8, laserdisc_select_w); |
| 280 | 280 | |
| 281 | 281 | /* allocate a timer for serial transmission, and one for philips code processing */ |
| 282 | laserdisc_bit_timer = timer_alloc(machine, laserdisc_bit_callback, NULL); | |
| 283 | laserdisc_philips_timer = timer_alloc(machine, laserdisc_philips_callback, NULL); | |
| 282 | laserdisc_bit_timer = machine->scheduler().timer_alloc(FUNC(laserdisc_bit_callback)); | |
| 283 | laserdisc_philips_timer = machine->scheduler().timer_alloc(FUNC(laserdisc_philips_callback)); | |
| 284 | 284 | |
| 285 | 285 | /* create some audio RAM */ |
| 286 | 286 | laserdisc_audio_buffer = auto_alloc_array(machine, UINT8, AUDIORAM_SIZE); |
| r10315 | r10316 | |
| 487 | 487 | |
| 488 | 488 | /* assert the line and set a timer for deassertion */ |
| 489 | 489 | laserdisc_line_w(laserdisc, LASERDISC_LINE_CONTROL, ASSERT_LINE); |
| 490 | timer_set( | |
| 490 | machine->scheduler().timer_set( | |
| 491 | 491 | |
| 492 | 492 | /* determine how long for the next command; there is a 555 timer with a |
| 493 | 493 | variable resistor controlling the timing of the pulses. Nominally, the |
| r10315 | r10316 | |
| 689 | 689 | { |
| 690 | 690 | /* assert the NMI and set a timer to clear it at the first visible line */ |
| 691 | 691 | cpu_set_input_line(device, INPUT_LINE_NMI, ASSERT_LINE); |
| 692 | | |
| 692 | | |
| 693 | 693 | |
| 694 | 694 | /* if we have a laserdisc, update it */ |
| 695 | 695 | if (laserdisc != NULL) |
| r10315 | r10316 | |
|---|---|---|
| 82 | 82 | asterix_state *state = space->machine->driver_data<asterix_state>(); |
| 83 | 83 | |
| 84 | 84 | cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, CLEAR_LINE); |
| 85 | | |
| 85 | | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | static WRITE16_HANDLER( sound_irq_w ) |
| r10315 | r10316 | |
|---|---|---|
| 448 | 448 | state_save_register_global_array(machine, state->layerpri); |
| 449 | 449 | state_save_register_global_array(machine, state->protram); |
| 450 | 450 | |
| 451 | state->dmaend_timer = timer_alloc( | |
| 451 | state->dmaend_timer = machine->scheduler().timer_alloc(FUNC( | |
| 452 | 452 | } |
| 453 | 453 | |
| 454 | 454 | static MACHINE_RESET( moo ) |
| r10315 | r10316 | |
|---|---|---|
| 177 | 177 | { |
| 178 | 178 | /* One interrupt per input port (4 per frame, though only 2 used). |
| 179 | 179 | 1000 cycle delay is arbitrary */ |
| 180 | | |
| 180 | | |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | static WRITE32_HANDLER( rotate_control_w ) /* only a guess that it's rotation */ |
| r10315 | r10316 | |
|---|---|---|
| 101 | 101 | |
| 102 | 102 | /* generate interrupts for player 1's gun */ |
| 103 | 103 | get_crosshair_xy(machine, 0, &beamx, &beamy); |
| 104 | timer_set(machine, machine->primary_screen->time_until_pos(beamy + beamyadd, beamx + beamxadd), NULL, 0, trigger_gun_interrupt); | |
| 105 | timer_set(machine, machine->primary_screen->time_until_pos(beamy + beamyadd + 1, beamx + beamxadd), NULL, 0, clear_gun_interrupt); | |
| 104 | machine->scheduler().timer_set(machine->primary_screen->time_until_pos(beamy + beamyadd, beamx + beamxadd), FUNC(trigger_gun_interrupt), 0); | |
| 105 | machine->scheduler().timer_set(machine->primary_screen->time_until_pos(beamy + beamyadd + 1, beamx + beamxadd), FUNC(clear_gun_interrupt), 0); | |
| 106 | 106 | |
| 107 | 107 | /* generate interrupts for player 2's gun */ |
| 108 | 108 | get_crosshair_xy(machine, 1, &beamx, &beamy); |
| 109 | timer_set(machine, machine->primary_screen->time_until_pos(beamy + beamyadd, beamx + beamxadd), NULL, 1, trigger_gun_interrupt); | |
| 110 | timer_set(machine, machine->primary_screen->time_until_pos(beamy + beamyadd + 1, beamx + beamxadd), NULL, 1, clear_gun_interrupt); | |
| 109 | machine->scheduler().timer_set(machine->primary_screen->time_until_pos(beamy + beamyadd, beamx + beamxadd), FUNC(trigger_gun_interrupt), 1); | |
| 110 | machine->scheduler().timer_set(machine->primary_screen->time_until_pos(beamy + beamyadd + 1, beamx + beamxadd), FUNC(clear_gun_interrupt), 1); | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | |
| r10315 | r10316 | |
| 121 | 121 | static VIDEO_START( tickee ) |
| 122 | 122 | { |
| 123 | 123 | /* start a timer going on the first scanline of every frame */ |
| 124 | setup_gun_timer = timer_alloc( | |
| 124 | setup_gun_timer = machine->scheduler().timer_alloc(FUNC( | |
| 125 | 125 | timer_adjust_oneshot(setup_gun_timer, machine->primary_screen->time_until_pos(0), 0); |
| 126 | 126 | } |
| 127 | 127 |
| r10315 | r10316 | |
|---|---|---|
| 235 | 235 | state_save_register_global(machine, state->bankaddress); |
| 236 | 236 | state_save_register_postload(machine, m92_postload, NULL); |
| 237 | 237 | |
| 238 | state->scanline_timer = timer_alloc(m | |
| 238 | state->scanline_timer = machine->scheduler().timer_alloc(FUNC(m | |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | static MACHINE_RESET( m92 ) |
| r10315 | r10316 | |
| 348 | 348 | |
| 349 | 349 | static WRITE16_HANDLER( m92_soundlatch_w ) |
| 350 | 350 | { |
| 351 | | |
| 351 | | |
| 352 | 352 | soundlatch_w(space, 0, data & 0xff); |
| 353 | 353 | } |
| 354 | 354 | |
| r10315 | r10316 | |
| 366 | 366 | |
| 367 | 367 | static WRITE16_HANDLER( m92_sound_irq_ack_w ) |
| 368 | 368 | { |
| 369 | | |
| 369 | | |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | static WRITE16_HANDLER( m92_sound_status_w ) |
| r10315 | r10316 | |
| 911 | 911 | static void sound_irq(device_t *device, int state) |
| 912 | 912 | { |
| 913 | 913 | if (state) |
| 914 | | |
| 914 | | |
| 915 | 915 | else |
| 916 | | |
| 916 | | |
| 917 | 917 | } |
| 918 | 918 | |
| 919 | 919 | static const ym2151_interface ym2151_config = |
| r10315 | r10316 | |
|---|---|---|
| 130 | 130 | state->potsense[1] = 0; |
| 131 | 131 | |
| 132 | 132 | /* PCB supports two dials, but cab has only got one */ |
| 133 | timer_set(machine, machine->primary_screen->time_until_pos(input_port_read(machine, "PADDLE"), 0), NULL, 0, destroyr_dial_callback); | |
| 134 | timer_set(machine, machine->primary_screen->time_until_pos(0), NULL, 0, destroyr_frame_callback); | |
| 133 | machine->scheduler().timer_set(machine->primary_screen->time_until_pos(input_port_read(machine, "PADDLE")), FUNC(destroyr_dial_callback)); | |
| 134 | machine->scheduler().timer_set(machine->primary_screen->time_until_pos(0), FUNC(destroyr_frame_callback)); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | |
| r10315 | r10316 | |
| 139 | 139 | { |
| 140 | 140 | destroyr_state *state = machine->driver_data<destroyr_state>(); |
| 141 | 141 | |
| 142 | timer_set(machine | |
| 142 | machine->scheduler().timer_set(machine | |
| 143 | 143 | |
| 144 | 144 | state->cursor = 0; |
| 145 | 145 | state->wavemod = 0; |
| r10315 | r10316 | |
|---|---|---|
| 654 | 654 | else |
| 655 | 655 | { |
| 656 | 656 | multigam_mmc1_reg_write_enable = 0; |
| 657 | | |
| 657 | | |
| 658 | 658 | } |
| 659 | 659 | |
| 660 | 660 | int reg = (offset >> 13); |
| r10315 | r10316 | |
|---|---|---|
| 401 | 401 | { |
| 402 | 402 | fuuki16_state *state = machine->driver_data<fuuki16_state>(); |
| 403 | 403 | cpu_set_input_line(state->maincpu, 1, HOLD_LINE); |
| 404 | timer_set(machine | |
| 404 | machine->scheduler().timer_set(machine | |
| 405 | 405 | } |
| 406 | 406 | |
| 407 | 407 | |
| r10315 | r10316 | |
| 409 | 409 | { |
| 410 | 410 | fuuki16_state *state = machine->driver_data<fuuki16_state>(); |
| 411 | 411 | cpu_set_input_line(state->maincpu, 3, HOLD_LINE); // VBlank IRQ |
| 412 | timer_set(machine | |
| 412 | machine->scheduler().timer_set(machine | |
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | |
| r10315 | r10316 | |
| 432 | 432 | state->maincpu = machine->device("maincpu"); |
| 433 | 433 | state->audiocpu = machine->device("audiocpu"); |
| 434 | 434 | |
| 435 | state->raster_interrupt_timer = timer_alloc( | |
| 435 | state->raster_interrupt_timer = machine->scheduler().timer_alloc(FUNC( | |
| 436 | 436 | } |
| 437 | 437 | |
| 438 | 438 | |
| r10315 | r10316 | |
| 441 | 441 | fuuki16_state *state = machine->driver_data<fuuki16_state>(); |
| 442 | 442 | const rectangle &visarea = machine->primary_screen->visible_area(); |
| 443 | 443 | |
| 444 | timer_set(machine, machine->primary_screen->time_until_pos(248), NULL, 0, level_1_interrupt_callback); | |
| 445 | timer_set(machine, machine->primary_screen->time_until_vblank_start(), NULL, 0, vblank_interrupt_callback); | |
| 444 | machine->scheduler().timer_set(machine->primary_screen->time_until_pos(248), FUNC(level_1_interrupt_callback)); | |
| 445 | machine->scheduler().timer_set(machine->primary_screen->time_until_vblank_start(), FUNC(vblank_interrupt_callback)); | |
| 446 | 446 | timer_adjust_oneshot(state->raster_interrupt_timer, machine->primary_screen->time_until_pos(0, visarea.max_x + 1), 0); |
| 447 | 447 | } |
| 448 | 448 |
| r10315 | r10316 | |
|---|---|---|
| 1542 | 1542 | for(index = 0; index < 16; index++) |
| 1543 | 1543 | { |
| 1544 | 1544 | state->dma_regs.dcsr[index] = 0x00000008; |
| 1545 | state->dma_regs.timer[index] = timer_alloc( | |
| 1545 | state->dma_regs.timer[index] = machine->scheduler().timer_alloc(FUNC( | |
| 1546 | 1546 | } |
| 1547 | 1547 | |
| 1548 | 1548 | memset(&state->ostimer_regs, 0, sizeof(state->ostimer_regs)); |
| 1549 | 1549 | for(index = 0; index < 4; index++) |
| 1550 | 1550 | { |
| 1551 | 1551 | state->ostimer_regs.osmr[index] = 0; |
| 1552 | state->ostimer_regs.timer[index] = timer_alloc( | |
| 1552 | state->ostimer_regs.timer[index] = machine->scheduler().timer_alloc(FUNC( | |
| 1553 | 1553 | } |
| 1554 | 1554 | |
| 1555 | 1555 | memset(&state->intc_regs, 0, sizeof(state->intc_regs)); |
| 1556 | 1556 | |
| 1557 | 1557 | memset(&state->lcd_regs, 0, sizeof(state->lcd_regs)); |
| 1558 | state->lcd_regs.dma[0].eof = timer_alloc(machine, pxa255_lcd_dma_eof, 0); | |
| 1559 | state->lcd_regs.dma[1].eof = timer_alloc(machine, pxa255_lcd_dma_eof, 0); | |
| 1558 | state->lcd_regs.dma[0].eof = machine->scheduler().timer_alloc(FUNC(pxa255_lcd_dma_eof)); | |
| 1559 | state->lcd_regs.dma[1].eof = machine->scheduler().timer_alloc(FUNC(pxa255_lcd_dma_eof)); | |
| 1560 | 1560 | state->lcd_regs.trgbr = 0x00aa5500; |
| 1561 | 1561 | state->lcd_regs.tcr = 0x0000754f; |
| 1562 | 1562 |
| r10315 | r10316 | |
|---|---|---|
| 752 | 752 | |
| 753 | 753 | static MACHINE_START( guab ) |
| 754 | 754 | { |
| 755 | fdc_timer = timer_alloc( | |
| 755 | fdc_timer = machine->scheduler().timer_alloc(FUNC( | |
| 756 | 756 | } |
| 757 | 757 | |
| 758 | 758 | static MACHINE_RESET( guab ) |
| r10315 | r10316 | |
|---|---|---|
| 110 | 110 | static void create_interrupt_timer( running_machine *machine ) |
| 111 | 111 | { |
| 112 | 112 | beaminv_state *state = machine->driver_data<beaminv_state>(); |
| 113 | state->interrupt_timer = timer_alloc( | |
| 113 | state->interrupt_timer = machine->scheduler().timer_alloc(FUNC(in | |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 |
| r10315 | r10316 | |
|---|---|---|
| 186 | 186 | machine->primary_screen->configure(320, 256, visarea, HZ_TO_ATTOSECONDS(PIXEL_CLOCK) * VTOTAL * HTOTAL); |
| 187 | 187 | |
| 188 | 188 | /* create a timer for IRQs and set up the first callback */ |
| 189 | state->irq_timer = timer_alloc( | |
| 189 | state->irq_timer = machine->scheduler().timer_alloc(FUNC(c | |
| 190 | 190 | state->irq_state = 0; |
| 191 | 191 | schedule_next_irq(machine, 0-64); |
| 192 | 192 |
| r10315 | r10316 | |
|---|---|---|
| 173 | 173 | static WRITE16_HANDLER( sound_command_w ) |
| 174 | 174 | { |
| 175 | 175 | if (ACCESSING_BITS_0_7) |
| 176 | | |
| 176 | | |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 |
| r10315 | r10316 | |
|---|---|---|
| 250 | 250 | static void swap_linecpu_banks(running_machine *machine) |
| 251 | 251 | { |
| 252 | 252 | /* Best sync up before we switch banks around */ |
| 253 | | |
| 253 | | |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 |
| r10315 | r10316 | |
|---|---|---|
| 219 | 219 | |
| 220 | 220 | /* if we are running with a real live 8751, we need to boost the interleave at startup */ |
| 221 | 221 | if (state->mcu != NULL && state->mcu->type() == I8751) |
| 222 | | |
| 222 | | |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 |
| r10315 | r10316 | |
|---|---|---|
| 569 | 569 | |
| 570 | 570 | cpu_set_irq_callback(machine->device("maincpu"), icallback); |
| 571 | 571 | for (i = 0; i < 4; i++) |
| 572 | state->Timer[i] = timer_alloc( | |
| 572 | state->Timer[i] = machine->scheduler().timer_alloc(FUNC( | |
| 573 | 573 | |
| 574 | 574 | PatchReset(machine); |
| 575 | 575 |
| r10315 | r10316 | |
|---|---|---|
| 138 | 138 | static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" }; |
| 139 | 139 | |
| 140 | 140 | UINT8 val = input_port_read(machine, portnames[port]); |
| 141 | if ( | |
| 141 | if ( | |
| 142 | 142 | val ^= 0x80; |
| 143 | 143 | return val; |
| 144 | 144 | } |
| r10315 | r10316 | |
| 196 | 196 | UINT8 raw_game_speed = input_port_read(device->machine, "R3"); |
| 197 | 197 | double resistance = raw_game_speed * 25000 / 100; |
| 198 | 198 | attotime duration = attotime(0, ATTOSECONDS_PER_SECOND * 0.45 * 6.8e-6 * resistance * (data + 1)); |
| 199 | state->timeout_time = | |
| 199 | state->timeout_time = | |
| 200 | 200 | |
| 201 | 201 | discrete_sound_w(device, HITME_DOWNCOUNT_VAL, data); |
| 202 | 202 | discrete_sound_w(device, HITME_OUT0, 1); |
| r10315 | r10316 | |
|---|---|---|
| 645 | 645 | int i; |
| 646 | 646 | |
| 647 | 647 | // setup 8 mechanical meters //////////////////////////////////////////// |
| 648 | Mech | |
| 648 | MechMtr_config(machine,8); | |
| 649 | 649 | |
| 650 | 650 | // setup 6 default 96 half step reels /////////////////////////////////// |
| 651 | 651 | for ( i = 0; i < 6; i++ ) |
| r10315 | r10316 | |
| 706 | 706 | static WRITE8_DEVICE_HANDLER( m1_meter_w ) |
| 707 | 707 | { |
| 708 | 708 | int i; |
| 709 | UINT64 cycles = device->machine->device<cpu_device>("maincpu")->total_cycles(); | |
| 710 | 709 | |
| 711 | 710 | for (i=0; i<8; i++) |
| 712 | if ( data & (1 << i) ) Mech | |
| 711 | if ( data & (1 << i) ) MechMtr_update(i | |
| 713 | 712 | } |
| 714 | 713 | |
| 715 | 714 | static WRITE8_HANDLER( m1_latch_w ) |
| r10315 | r10316 | |
|---|---|---|
| 336 | 336 | static MACHINE_START( lgp ) |
| 337 | 337 | { |
| 338 | 338 | laserdisc = machine->device("laserdisc"); |
| 339 | irq_timer = timer_alloc( | |
| 339 | irq_timer = machine->scheduler().timer_alloc(FUNC(i | |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 |
| r10315 | r10316 | |
|---|---|---|
| 217 | 217 | static MACHINE_START( cliffhgr ) |
| 218 | 218 | { |
| 219 | 219 | laserdisc = machine->device("laserdisc"); |
| 220 | irq_timer = timer_alloc( | |
| 220 | irq_timer = machine->scheduler().timer_alloc(FUNC(c | |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | static MACHINE_RESET( cliffhgr ) |
| r10315 | r10316 | |
|---|---|---|
| 582 | 582 | MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK | VIDEO_BUFFERS_SPRITERAM) |
| 583 | 583 | |
| 584 | 584 | MCFG_SCREEN_ADD("screen", RASTER) |
| 585 | MCFG_SCREEN_REFRESH_RATE( (XTAL_28MHz / 4) / (446 * 286) ) | |
| 586 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
| 585 | MCFG_SCREEN_RAW_PARAMS(XTAL_28MHz/4, 446, 0, 320, 286, 0, 240) | |
| 587 | 586 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 588 | MCFG_SCREEN_SIZE(64*8, 64*8) | |
| 589 | MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1) | |
| 590 | 587 | |
| 591 | 588 | MCFG_GFXDECODE(twincobr) |
| 592 | 589 | MCFG_PALETTE_LENGTH(1792) |
| r10315 | r10316 | |
|---|---|---|
| 161 | 161 | { |
| 162 | 162 | hack_irq = 1; |
| 163 | 163 | update_irq_state(space->machine); |
| 164 | | |
| 164 | | |
| 165 | 165 | } |
| 166 | 166 | return input_port_read(space->machine, "300000"); |
| 167 | 167 | } |
| r10315 | r10316 | |
|---|---|---|
| 198 | 198 | static WRITE16_HANDLER( sound_latch_w ) |
| 199 | 199 | { |
| 200 | 200 | if (ACCESSING_BITS_0_7) |
| 201 | | |
| 201 | | |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 |
| r10315 | r10316 | |
|---|---|---|
| 484 | 484 | static WRITE16_HANDLER( coolpool_iop_w ) |
| 485 | 485 | { |
| 486 | 486 | logerror("%08x:IOP write %04x\n", cpu_get_pc(space->cpu), data); |
| 487 | | |
| 487 | | |
| 488 | 488 | } |
| 489 | 489 | |
| 490 | 490 |
| r10315 | r10316 | |
|---|---|---|
| 183 | 183 | static int read_e2ram(void); |
| 184 | 184 | static void e2ram_reset(void); |
| 185 | 185 | |
| 186 | // global vars //////////////////////////////////////////////////////////// | |
| 187 | ||
| 188 | static int sc2gui_update_mmtr; // bit pattern which mechanical meter needs updating | |
| 189 | ||
| 190 | 186 | // local vars ///////////////////////////////////////////////////////////// |
| 191 | 187 | |
| 192 | 188 | static UINT8 key[16]; // security device on gamecard (video games only) |
| r10315 | r10316 | |
| 321 | 317 | |
| 322 | 318 | hopper_running = 0; // for video games |
| 323 | 319 | hopper_coin_sense = 0; |
| 324 | sc2gui_update_mmtr= 0xFF; | |
| 325 | 320 | |
| 326 | 321 | slide_states[0] = 0; |
| 327 | 322 | slide_states[1] = 0; |
| r10315 | r10316 | |
| 583 | 578 | { |
| 584 | 579 | int i; |
| 585 | 580 | int changed = mmtr_latch ^ data; |
| 586 | UINT64 cycles = downcast<cpu_device *>(space->cpu)->total_cycles(); | |
| 587 | 581 | |
| 588 | 582 | mmtr_latch = data; |
| 589 | 583 | |
| r10315 | r10316 | |
| 591 | 585 | { |
| 592 | 586 | if ( changed & (1 << i) ) |
| 593 | 587 | { |
| 594 | if ( Mechmtr_update(i, cycles, data & (1 << i) ) ) | |
| 595 | { | |
| 596 | sc2gui_update_mmtr |= (1 << i); | |
| 597 | } | |
| 588 | MechMtr_update(i, data & (1 << i) ); | |
| 598 | 589 | } |
| 599 | 590 | } |
| 600 | 591 | if ( data & 0x1F ) cputag_set_input_line(space->machine, "maincpu", M6809_FIRQ_LINE, ASSERT_LINE ); |
| r10315 | r10316 | |
| 2251 | 2242 | { |
| 2252 | 2243 | sc2_common_init(machine, 1); |
| 2253 | 2244 | adder2_decode_char_roms(machine); |
| 2254 | Mech | |
| 2245 | MechMtr_config(machine,8); // setup mech meters | |
| 2255 | 2246 | |
| 2256 | 2247 | has_hopper = 0; |
| 2257 | 2248 | |
| r10315 | r10316 | |
| 4005 | 3996 | static DRIVER_INIT (bbrkfst) |
| 4006 | 3997 | { |
| 4007 | 3998 | sc2awp_common_init(machine,5, 1); |
| 4008 | Mech | |
| 3999 | MechMtr_config(machine,8); | |
| 4009 | 4000 | |
| 4010 | 4001 | BFM_BD1_init(0); |
| 4011 | 4002 | BFM_BD1_init(1); |
| r10315 | r10316 | |
| 4027 | 4018 | static DRIVER_INIT (drwho) |
| 4028 | 4019 | { |
| 4029 | 4020 | sc2awp_common_init(machine,4, 1); |
| 4030 | Mech | |
| 4021 | MechMtr_config(machine,8); | |
| 4031 | 4022 | |
| 4032 | 4023 | BFM_BD1_init(0); |
| 4033 | 4024 | BFM_BD1_init(1); |
| r10315 | r10316 | |
| 4047 | 4038 | static DRIVER_INIT (drwhon) |
| 4048 | 4039 | { |
| 4049 | 4040 | sc2awp_common_init(machine,4, 0); |
| 4050 | Mech | |
| 4041 | MechMtr_config(machine,8); | |
| 4051 | 4042 | |
| 4052 | 4043 | BFM_BD1_init(0); |
| 4053 | 4044 | BFM_BD1_init(1); |
| r10315 | r10316 | |
| 4068 | 4059 | static DRIVER_INIT (focus) |
| 4069 | 4060 | { |
| 4070 | 4061 | sc2awp_common_init(machine,6, 1); |
| 4071 | Mech | |
| 4062 | MechMtr_config(machine,5); | |
| 4072 | 4063 | |
| 4073 | 4064 | BFM_BD1_init(0); |
| 4074 | 4065 | } |
| r10315 | r10316 | |
| 4077 | 4068 | { |
| 4078 | 4069 | sc2awp_common_init(machine,6, 1); |
| 4079 | 4070 | |
| 4080 | Mech | |
| 4071 | MechMtr_config(machine,5); | |
| 4081 | 4072 | |
| 4082 | 4073 | Scorpion2_SetSwitchState(3,3,1); /* 5p play */ |
| 4083 | 4074 | Scorpion2_SetSwitchState(3,4,1); /* 20p play */ |
| r10315 | r10316 | |
| 4120 | 4111 | static DRIVER_INIT (bfmcgslm) |
| 4121 | 4112 | { |
| 4122 | 4113 | sc2awp_common_init(machine,6, 1); |
| 4123 | Mech | |
| 4114 | MechMtr_config(machine,8); | |
| 4124 | 4115 | BFM_BD1_init(0); |
| 4125 | 4116 | has_hopper = 0; |
| 4126 | 4117 | } |
| r10315 | r10316 | |
| 4128 | 4119 | static DRIVER_INIT (luvjub) |
| 4129 | 4120 | { |
| 4130 | 4121 | sc2awp_common_init(machine,6, 1); |
| 4131 | Mech | |
| 4122 | MechMtr_config(machine,8); | |
| 4132 | 4123 | has_hopper = 0; |
| 4133 | 4124 | |
| 4134 | 4125 | Scorpion2_SetSwitchState(3,0,1); |
| r10315 | r10316 | |
|---|---|---|
| 396 | 396 | if (!blt_amount) |
| 397 | 397 | { |
| 398 | 398 | if(BLITLOG) mame_printf_debug("end of blit list\n"); |
| 399 | timer_set( | |
| 399 | machine->scheduler().timer_set( | |
| 400 | 400 | return; |
| 401 | 401 | } |
| 402 | 402 |
| r10315 | r10316 | |
|---|---|---|
| 535 | 535 | static TIMER_CALLBACK( network_interrupt_callback ) |
| 536 | 536 | { |
| 537 | 537 | cputag_set_input_line(machine, "maincpu", I960_IRQ0, ASSERT_LINE); |
| 538 | timer_set(machine | |
| 538 | machine->scheduler().timer_set(machine | |
| 539 | 539 | } |
| 540 | 540 | |
| 541 | 541 | |
| 542 | 542 | static TIMER_CALLBACK( vblank_interrupt_callback ) |
| 543 | 543 | { |
| 544 | 544 | cputag_set_input_line(machine, "maincpu", I960_IRQ2, ASSERT_LINE); |
| 545 | timer_set(machine | |
| 545 | machine->scheduler().timer_set(machine | |
| 546 | 546 | } |
| 547 | 547 | |
| 548 | 548 | |
| r10315 | r10316 | |
| 571 | 571 | |
| 572 | 572 | static MACHINE_START( namcofl ) |
| 573 | 573 | { |
| 574 | raster_interrupt_timer = timer_alloc( | |
| 574 | raster_interrupt_timer = machine->scheduler().timer_alloc(FUNC( | |
| 575 | 575 | } |
| 576 | 576 | |
| 577 | 577 | |
| 578 | 578 | static MACHINE_RESET( namcofl ) |
| 579 | 579 | { |
| 580 | timer_set(machine, machine->primary_screen->time_until_pos(machine->primary_screen->visible_area().max_y + 3, 0), NULL, 0, network_interrupt_callback); | |
| 581 | timer_set(machine, machine->primary_screen->time_until_pos(machine->primary_screen->visible_area().max_y + 1, 0), NULL, 0, vblank_interrupt_callback); | |
| 580 | machine->scheduler().timer_set(machine->primary_screen->time_until_pos(machine->primary_screen->visible_area().max_y + 3), FUNC(network_interrupt_callback)); | |
| 581 | machine->scheduler().timer_set(machine->primary_screen->time_until_pos(machine->primary_screen->visible_area().max_y + 1), FUNC(vblank_interrupt_callback)); | |
| 582 | 582 | |
| 583 | 583 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() ); |
| 584 | 584 | memory_set_bankptr(machine, "bank2", namcofl_workram ); |
| r10315 | r10316 | |
|---|---|---|
| 295 | 295 | |
| 296 | 296 | for (i = 0; i < 3; i++) |
| 297 | 297 | { |
| 298 | mess_io_timeout[i] = timer_alloc(m | |
| 298 | mess_io_timeout[i] = machine->scheduler().timer_alloc(FUNC(m | |
| 299 | 299 | mess_io_stage[i] = -1; |
| 300 | 300 | } |
| 301 | 301 | } |
| r10315 | r10316 | |
|---|---|---|
| 520 | 520 | static int effx, effy; |
| 521 | 521 | static int lastresult; |
| 522 | 522 | static attotime lasttime; |
| 523 | attotime curtime = | |
| 523 | attotime curtime = | |
| 524 | 524 | |
| 525 | 525 | if ((curtime - lasttime) > space->machine->primary_screen->scan_period()) |
| 526 | 526 | { |
| r10315 | r10316 | |
| 559 | 559 | static int effx, effy; |
| 560 | 560 | static int lastresult; |
| 561 | 561 | static attotime lasttime; |
| 562 | attotime curtime = | |
| 562 | attotime curtime = | |
| 563 | 563 | |
| 564 | 564 | if ((curtime - lasttime) > space->machine->primary_screen->scan_period()) |
| 565 | 565 | { |
| r10315 | r10316 | |
| 678 | 678 | static WRITE16_HANDLER( sound_data_w ) |
| 679 | 679 | { |
| 680 | 680 | if (ACCESSING_BITS_0_7) |
| 681 | | |
| 681 | | |
| 682 | 682 | } |
| 683 | 683 | |
| 684 | 684 | |
| r10315 | r10316 | |
| 691 | 691 | static WRITE32_HANDLER( sound_data32_w ) |
| 692 | 692 | { |
| 693 | 693 | if (ACCESSING_BITS_16_23) |
| 694 | | |
| 694 | | |
| 695 | 695 | } |
| 696 | 696 | |
| 697 | 697 |
| r10315 | r10316 | |
|---|---|---|
| 365 | 365 | static WRITE32_HANDLER( unknown_int_req_w ) |
| 366 | 366 | { |
| 367 | 367 | /* 10000 cycle delay is arbitrary */ |
| 368 | | |
| 368 | | |
| 369 | 369 | } |
| 370 | 370 | |
| 371 | 371 | |
| r10315 | r10316 | |
| 456 | 456 | { |
| 457 | 457 | /* One interrupt per input port (4 per frame, though only 2 used). |
| 458 | 458 | 1000 cycle delay is arbitrary */ |
| 459 | | |
| 459 | | |
| 460 | 460 | } |
| 461 | 461 | |
| 462 | 462 | /*********************************************************** |
| r10315 | r10316 | |
|---|---|---|
| 404 | 404 | |
| 405 | 405 | static WRITE8_HANDLER( main_to_sub_comm_w ) |
| 406 | 406 | { |
| 407 | | |
| 407 | | |
| 408 | 408 | } |
| 409 | 409 | |
| 410 | 410 |
| r10315 | r10316 | |
|---|---|---|
| 107 | 107 | static WRITE8_HANDLER( lkage_sound_command_w ) |
| 108 | 108 | { |
| 109 | 109 | soundlatch_w(space, offset, data); |
| 110 | | |
| 110 | | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | static WRITE8_HANDLER( lkage_sh_nmi_disable_w ) |
| r10315 | r10316 | |
|---|---|---|
| 531 | 531 | voodoo = machine->device("voodoo"); |
| 532 | 532 | |
| 533 | 533 | /* allocate timers for the NILE */ |
| 534 | timer[0] = timer_alloc(machine, NULL, NULL); | |
| 535 | timer[1] = timer_alloc(machine, NULL, NULL); | |
| 536 | timer[2] = timer_alloc(machine, nile_timer_callback, NULL); | |
| 537 | timer[3] = timer_alloc(machine, nile_timer_callback, NULL); | |
| 534 | timer[0] = machine->scheduler().timer_alloc(FUNC(NULL)); | |
| 535 | timer[1] = machine->scheduler().timer_alloc(FUNC(NULL)); | |
| 536 | timer[2] = machine->scheduler().timer_alloc(FUNC(nile_timer_callback)); | |
| 537 | timer[3] = machine->scheduler().timer_alloc(FUNC(nile_timer_callback)); | |
| 538 | 538 | |
| 539 | 539 | /* identify our sound board */ |
| 540 | 540 | if (machine->device("dsio") != NULL) |
| r10315 | r10316 | |
|---|---|---|
| 135 | 135 | static void create_interrupt_timers( running_machine *machine ) |
| 136 | 136 | { |
| 137 | 137 | enigma2_state *state = machine->driver_data<enigma2_state>(); |
| 138 | state->interrupt_clear_timer = timer_alloc(machine, interrupt_clear_callback, NULL); | |
| 139 | state->interrupt_assert_timer = timer_alloc(machine, interrupt_assert_callback, NULL); | |
| 138 | state->interrupt_clear_timer = machine->scheduler().timer_alloc(FUNC(interrupt_clear_callback)); | |
| 139 | state->interrupt_assert_timer = machine->scheduler().timer_alloc(FUNC(interrupt_assert_callback)); | |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 |
| r10315 | r10316 | |
|---|---|---|
| 375 | 375 | |
| 376 | 376 | static void sound_data_w(running_machine *machine, UINT8 data) |
| 377 | 377 | { |
| 378 | | |
| 378 | | |
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | |
| r10315 | r10316 | |
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | |
| 464 | static TIMER_CALLBACK( scanline_callback ) | |
| 464 | static TIMER_DEVICE_CALLBACK( scanline_callback ) | |
| 465 | 465 | { |
| 466 | segas1x_state *state = machine->driver_data<segas1x_state>(); | |
| 466 | segas1x_state *state = timer.machine->driver_data<segas1x_state>(); | |
| 467 | 467 | int scanline = param; |
| 468 | 468 | int next_scanline = scanline; |
| 469 | 469 | |
| r10315 | r10316 | |
| 474 | 474 | case 65: |
| 475 | 475 | case 129: |
| 476 | 476 | case 193: |
| 477 | timer | |
| 477 | timer. | |
| 478 | 478 | next_scanline = scanline + 1; |
| 479 | 479 | break; |
| 480 | 480 | |
| r10315 | r10316 | |
| 502 | 502 | } |
| 503 | 503 | |
| 504 | 504 | /* update IRQs on the main CPU */ |
| 505 | update_main_irqs(machine); | |
| 505 | update_main_irqs(timer.machine); | |
| 506 | 506 | |
| 507 | 507 | /* come back at the next targeted scanline */ |
| 508 | timer | |
| 508 | timer.adjus | |
| 509 | 509 | } |
| 510 | 510 | |
| 511 | 511 | |
| r10315 | r10316 | |
| 538 | 538 | m68k_set_reset_callback(machine->device("maincpu"), outrun_reset); |
| 539 | 539 | |
| 540 | 540 | /* start timers to track interrupts */ |
| 541 | ti | |
| 541 | state->interrupt_timer->adjust(machine | |
| 542 | 542 | } |
| 543 | 543 | |
| 544 | 544 | |
| r10315 | r10316 | |
| 1118 | 1118 | MCFG_MACHINE_RESET(outrun) |
| 1119 | 1119 | MCFG_QUANTUM_TIME(attotime::from_hz(6000)) |
| 1120 | 1120 | |
| 1121 | MCFG_TIMER_ADD("int_timer", scanline_callback) | |
| 1122 | ||
| 1121 | 1123 | MCFG_PPI8255_ADD( "ppi8255", single_ppi_intf ) |
| 1122 | 1124 | |
| 1123 | 1125 | /* video hardware */ |
| r10315 | r10316 | |
|---|---|---|
| 730 | 730 | int line = (irq == 0) ? INPUT_LINE_IRQ1 : INPUT_LINE_IRQ2; |
| 731 | 731 | |
| 732 | 732 | cputag_set_input_line(machine, "audiocpu", line, ASSERT_LINE); |
| 733 | timer_set( | |
| 733 | machine->scheduler().timer_set( | |
| 734 | 734 | } |
| 735 | 735 | |
| 736 | 736 | static const k056800_interface gticlub_k056800_interface = |
| r10315 | r10316 | |
|---|---|---|
| 742 | 742 | mazerbla_state *state = space->machine->driver_data<mazerbla_state>(); |
| 743 | 743 | |
| 744 | 744 | /* set a timer to force synchronization after the read */ |
| 745 | | |
| 745 | | |
| 746 | 746 | |
| 747 | 747 | return state->ls670_0[offset]; |
| 748 | 748 | } |
| r10315 | r10316 | |
| 759 | 759 | static WRITE8_HANDLER( ls670_0_w ) |
| 760 | 760 | { |
| 761 | 761 | /* do this on a timer to let the CPUs synchronize */ |
| 762 | | |
| 762 | | |
| 763 | 763 | } |
| 764 | 764 | |
| 765 | 765 | static READ8_HANDLER( ls670_1_r ) |
| r10315 | r10316 | |
| 767 | 767 | mazerbla_state *state = space->machine->driver_data<mazerbla_state>(); |
| 768 | 768 | |
| 769 | 769 | /* set a timer to force synchronization after the read */ |
| 770 | | |
| 770 | | |
| 771 | 771 | |
| 772 | 772 | return state->ls670_1[offset]; |
| 773 | 773 | } |
| r10315 | r10316 | |
| 784 | 784 | static WRITE8_HANDLER( ls670_1_w ) |
| 785 | 785 | { |
| 786 | 786 | /* do this on a timer to let the CPUs synchronize */ |
| 787 | | |
| 787 | | |
| 788 | 788 | } |
| 789 | 789 | |
| 790 | 790 | |
| r10315 | r10316 | |
| 928 | 928 | |
| 929 | 929 | static WRITE8_HANDLER( main_sound_w ) |
| 930 | 930 | { |
| 931 | | |
| 931 | | |
| 932 | 932 | } |
| 933 | 933 | |
| 934 | 934 | static WRITE8_HANDLER( sound_int_clear_w ) |
| r10315 | r10316 | |
|---|---|---|
| 52 | 52 | |
| 53 | 53 | static VIDEO_START( acefruit ) |
| 54 | 54 | { |
| 55 | acefruit_refresh_timer = timer_alloc( | |
| 55 | acefruit_refresh_timer = machine->scheduler().timer_alloc(FUNC(ac | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | static INTERRUPT_GEN( acefruit_vblank ) |
| r10315 | r10316 | |
|---|---|---|
| 107 | 107 | if (input_port_read(machine, "IN0") & 0x40) |
| 108 | 108 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE); |
| 109 | 109 | |
| 110 | timer_set(machine | |
| 110 | machine->scheduler().timer_set(machine | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | |
| 114 | 114 | static MACHINE_RESET( sprint4 ) |
| 115 | 115 | { |
| 116 | 116 | sprint4_state *state = machine->driver_data<sprint4_state>(); |
| 117 | timer_set(machine | |
| 117 | machine->scheduler().timer_set(machine | |
| 118 | 118 | |
| 119 | 119 | memset(state->steer_FF1, 0, sizeof state->steer_FF1); |
| 120 | 120 | memset(state->steer_FF2, 0, sizeof state->steer_FF2); |
| r10315 | r10316 | |
|---|---|---|
| 130 | 130 | { |
| 131 | 131 | simpsons_state *state = space->machine->driver_data<simpsons_state>(); |
| 132 | 132 | cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, CLEAR_LINE); |
| 133 | | |
| 133 | | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | static ADDRESS_MAP_START( z80_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r10315 | r10316 | |
| 269 | 269 | { |
| 270 | 270 | simpsons_objdma(device->machine); |
| 271 | 271 | // 32+256us delay at 8MHz dotclock; artificially shortened since actual V-blank length is unknown |
| 272 | | |
| 272 | | |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | if (k052109_is_irq_enabled(state->k052109)) |
| r10315 | r10316 | |
|---|---|---|
| 616 | 616 | static MACHINE_START( qdrmfgp2 ) |
| 617 | 617 | { |
| 618 | 618 | /* sound irq (CCU? 240Hz) */ |
| 619 | timer_pulse( | |
| 619 | machine->scheduler().timer_pulse( | |
| 620 | 620 | |
| 621 | 621 | MACHINE_START_CALL( qdrmfgp ); |
| 622 | 622 | } |
| r10315 | r10316 | |
|---|---|---|
| 632 | 632 | { |
| 633 | 633 | /* signal the NMI */ |
| 634 | 634 | itech8_update_interrupts(device->machine, 1, -1, -1); |
| 635 | | |
| 635 | | |
| 636 | 636 | |
| 637 | 637 | if (FULL_LOGGING) logerror("------------ VBLANK (%d) --------------\n", device->machine->primary_screen->vpos()); |
| 638 | 638 | } |
| r10315 | r10316 | |
| 664 | 664 | static MACHINE_START( sstrike ) |
| 665 | 665 | { |
| 666 | 666 | /* we need to update behind the beam as well */ |
| 667 | timer_set(machine | |
| 667 | machine->scheduler().timer_set(machine | |
| 668 | 668 | } |
| 669 | 669 | |
| 670 | 670 | static MACHINE_RESET( itech8 ) |
| r10315 | r10316 | |
| 707 | 707 | if (scanline >= 256) scanline = 0; |
| 708 | 708 | |
| 709 | 709 | /* set a new timer */ |
| 710 | timer_set(machine | |
| 710 | machine->scheduler().timer_set(machine | |
| 711 | 711 | } |
| 712 | 712 | |
| 713 | 713 | |
| r10315 | r10316 | |
| 806 | 806 | |
| 807 | 807 | static WRITE8_HANDLER( sound_data_w ) |
| 808 | 808 | { |
| 809 | | |
| 809 | | |
| 810 | 810 | } |
| 811 | 811 | |
| 812 | 812 | |
| r10315 | r10316 | |
| 817 | 817 | ((data & 0x5d) << 1) | |
| 818 | 818 | ((data & 0x20) >> 3) | |
| 819 | 819 | ((data & 0x02) << 5); |
| 820 | | |
| 820 | | |
| 821 | 821 | } |
| 822 | 822 | |
| 823 | 823 |
| r10315 | r10316 | |
|---|---|---|
| 71 | 71 | state->requested_int |= 0x20; |
| 72 | 72 | cpu_set_input_line(device, 2, HOLD_LINE); |
| 73 | 73 | /* the duration is a guess */ |
| 74 | | |
| 74 | | |
| 75 | 75 | } |
| 76 | 76 | else |
| 77 | 77 | state->requested_int |= 0x12; /* hsync */ |
| r10315 | r10316 | |
| 342 | 342 | another blit. */ |
| 343 | 343 | if (b1 == 0) |
| 344 | 344 | { |
| 345 | | |
| 345 | | |
| 346 | 346 | return; |
| 347 | 347 | } |
| 348 | 348 | |
| r10315 | r10316 | |
| 823 | 823 | hyprduel_state *state = machine->driver_data<hyprduel_state>(); |
| 824 | 824 | |
| 825 | 825 | state->int_num = 0x01; |
| 826 | state->magerror_irq_timer = timer_alloc(ma | |
| 826 | state->magerror_irq_timer = machine->scheduler().timer_alloc(FUNC(ma | |
| 827 | 827 | } |
| 828 | 828 | |
| 829 | 829 |
| r10315 | r10316 | |
|---|---|---|
| 50 | 50 | static WRITE8_HANDLER( sound_command_w ) |
| 51 | 51 | { |
| 52 | 52 | soundlatch_w(space, 0, data); |
| 53 | | |
| 53 | | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 |
| r10315 | r10316 | |
|---|---|---|
| 114 | 114 | atetris_state *state = machine->driver_data<atetris_state>(); |
| 115 | 115 | |
| 116 | 116 | /* Allocate interrupt timer */ |
| 117 | state->interrupt_timer = timer_alloc( | |
| 117 | state->interrupt_timer = machine->scheduler().timer_alloc(FUNC(in | |
| 118 | 118 | |
| 119 | 119 | /* Set up save state */ |
| 120 | 120 | state_save_register_global(machine, state->current_bank); |
| r10315 | r10316 | |
|---|---|---|
| 55 | 55 | state->flipscreen = 0; |
| 56 | 56 | |
| 57 | 57 | /* we must start with NMI interrupts disabled */ |
| 58 | | |
| 58 | | |
| 59 | 59 | state->sound_nmi_enabled = FALSE; |
| 60 | 60 | } |
| 61 | 61 |
| r10315 | r10316 | |
|---|---|---|
| 348 | 348 | tmnt_state *state = space->machine->driver_data<tmnt_state>(); |
| 349 | 349 | // sound_nmi_enabled = 1; |
| 350 | 350 | cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, CLEAR_LINE); |
| 351 | | |
| 351 | | |
| 352 | 352 | } |
| 353 | 353 | |
| 354 | 354 |
| r10315 | r10316 | |
|---|---|---|
| 143 | 143 | zodiack_state *state = machine->driver_data<zodiack_state>(); |
| 144 | 144 | |
| 145 | 145 | /* we must start with NMI interrupts disabled */ |
| 146 | | |
| 146 | | |
| 147 | 147 | state->sound_nmi_enabled = FALSE; |
| 148 | 148 | } |
| 149 | 149 |
| r10315 | r10316 | |
|---|---|---|
| 174 | 174 | |
| 175 | 175 | static void create_irq_timer(running_machine *machine) |
| 176 | 176 | { |
| 177 | irq_timer = timer_alloc( | |
| 177 | irq_timer = machine->scheduler().timer_alloc(FUNC(i | |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | |
| r10315 | r10316 | |
| 251 | 251 | |
| 252 | 252 | static void create_nmi_timer(running_machine *machine) |
| 253 | 253 | { |
| 254 | nmi_timer = timer_alloc( | |
| 254 | nmi_timer = machine->scheduler().timer_alloc(FUNC(n | |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 |
| r10315 | r10316 | |
|---|---|---|
| 124 | 124 | |
| 125 | 125 | static WRITE8_HANDLER( sound_data_w ) |
| 126 | 126 | { |
| 127 | | |
| 127 | | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 |
| r10315 | r10316 | |
|---|---|---|
| 88 | 88 | |
| 89 | 89 | /* main CPU might be waiting for sound CPU to finish NMI, |
| 90 | 90 | so set a timer to give sound CPU a chance to run */ |
| 91 | | |
| 91 | | |
| 92 | 92 | // logerror("%s - Read coin port during Z80 NMI\n", cpuexec_describe_context(machine)); |
| 93 | 93 | } |
| 94 | 94 | |
| r10315 | r10316 | |
| 157 | 157 | static WRITE32_HANDLER( psikyo_soundlatch_w ) |
| 158 | 158 | { |
| 159 | 159 | if (ACCESSING_BITS_0_7) |
| 160 | | |
| 160 | | |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | /*************************************************************************** |
| r10315 | r10316 | |
| 167 | 167 | static WRITE32_HANDLER( s1945_soundlatch_w ) |
| 168 | 168 | { |
| 169 | 169 | if (ACCESSING_BITS_16_23) |
| 170 | | |
| 170 | | |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | static const UINT8 s1945_table[256] = { |
| r10315 | r10316 | |
|---|---|---|
| 495 | 495 | state_save_register_global(machine, state->cur_sound_region); |
| 496 | 496 | state_save_register_postload(machine, xexex_postload, NULL); |
| 497 | 497 | |
| 498 | state->dmadelay_timer = timer_alloc( | |
| 498 | state->dmadelay_timer = machine->scheduler().timer_alloc(FUNC( | |
| 499 | 499 | } |
| 500 | 500 | |
| 501 | 501 | static MACHINE_RESET( xexex ) |
| r10315 | r10316 | |
|---|---|---|
| 56 | 56 | { |
| 57 | 57 | int width = screen.width(); |
| 58 | 58 | attotime period = screen.time_until_pos(screen.vpos() + 6, width * 0.9); |
| 59 | | |
| 59 | | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /* update the playfield and motion objects */ |
| r10315 | r10316 | |
|---|---|---|
| 284 | 284 | if (pixels) |
| 285 | 285 | { |
| 286 | 286 | dma_active = 1; |
| 287 | | |
| 287 | | |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | if(!(data & 0x40)) // unknown line used |
| r10315 | r10316 | |
|---|---|---|
| 32 | 32 | |
| 33 | 33 | static WRITE8_HANDLER( tankbust_soundlatch_w ) |
| 34 | 34 | { |
| 35 | | |
| 35 | | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | static READ8_DEVICE_HANDLER( tankbust_soundlatch_r ) |
| r10315 | r10316 | |
| 81 | 81 | break; |
| 82 | 82 | |
| 83 | 83 | case 1: /* 0xe001 (value 0 then 1) written right after the soundlatch_w */ |
| 84 | | |
| 84 | | |
| 85 | 85 | break; |
| 86 | 86 | |
| 87 | 87 | case 2: /* 0xe002 coin counter */ |
| r10315 | r10316 | |
|---|---|---|
| 515 | 515 | voodoo = machine->device("voodoo"); |
| 516 | 516 | |
| 517 | 517 | /* allocate timers for the galileo */ |
| 518 | galileo.timer[0].timer = timer_alloc(machine, galileo_timer_callback, NULL); | |
| 519 | galileo.timer[1].timer = timer_alloc(machine, galileo_timer_callback, NULL); | |
| 520 | galileo.timer[2].timer = timer_alloc(machine, galileo_timer_callback, NULL); | |
| 521 | galileo.timer[3].timer = timer_alloc(machine, galileo_timer_callback, NULL); | |
| 518 | galileo.timer[0].timer = machine->scheduler().timer_alloc(FUNC(galileo_timer_callback)); | |
| 519 | galileo.timer[1].timer = machine->scheduler().timer_alloc(FUNC(galileo_timer_callback)); | |
| 520 | galileo.timer[2].timer = machine->scheduler().timer_alloc(FUNC(galileo_timer_callback)); | |
| 521 | galileo.timer[3].timer = machine->scheduler().timer_alloc(FUNC(galileo_timer_callback)); | |
| 522 | 522 | |
| 523 | 523 | /* set the fastest DRC options, but strict verification */ |
| 524 | 524 | mips3drc_set_options(machine->device("maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY); |
| r10315 | r10316 | |
|---|---|---|
| 166 | 166 | |
| 167 | 167 | static WRITE32_HANDLER( galastrm_adstick_ctrl_w ) |
| 168 | 168 | { |
| 169 | | |
| 169 | | |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | /*********************************************************** |
| r10315 | r10316 | |
|---|---|---|
| 1044 | 1044 | |
| 1045 | 1045 | static void init_rockn_timer(running_machine *machine) |
| 1046 | 1046 | { |
| 1047 | timer_pulse(machine, attotime::from_msec(32), NULL, 0, rockn_timer_level1_callback); | |
| 1048 | rockn_timer_l4 = timer_alloc(machine, rockn_timer_level4_callback, NULL); | |
| 1047 | machine->scheduler().timer_pulse(attotime::from_msec(32), FUNC(rockn_timer_level1_callback)); | |
| 1048 | rockn_timer_l4 = machine->scheduler().timer_alloc(FUNC(rockn_timer_level4_callback)); | |
| 1049 | 1049 | |
| 1050 | 1050 | state_save_register_global_array(machine, tetrisp2_systemregs); |
| 1051 | 1051 | state_save_register_global_array(machine, rocknms_sub_systemregs); |
| r10315 | r10316 | |
| 1076 | 1076 | { |
| 1077 | 1077 | init_rockn_timer(machine); |
| 1078 | 1078 | |
| 1079 | timer_pulse(machine, attotime::from_msec(32), NULL, 0, rockn_timer_sub_level1_callback); | |
| 1080 | rockn_timer_sub_l4 = timer_alloc(machine, rockn_timer_sub_level4_callback, NULL); | |
| 1079 | machine->scheduler().timer_pulse(attotime::from_msec(32), FUNC(rockn_timer_sub_level1_callback)); | |
| 1080 | rockn_timer_sub_l4 = machine->scheduler().timer_alloc(FUNC(rockn_timer_sub_level4_callback)); | |
| 1081 | 1081 | |
| 1082 | 1082 | rockn_protectdata = 3; |
| 1083 | 1083 |
| r10315 | r10316 | |
|---|---|---|
| 2914 | 2914 | |
| 2915 | 2915 | ROM_REGION( 0x90000, "audiocpu", 0 ) /* Sound CPU */ |
| 2916 | 2916 | ROM_LOAD( "gw-12.10f", 0x00000, 0x08000, CRC(e6d6c9cf) SHA1(c35a7a385592e55bdfe232d042f2228f4f7e9ffa) ) |
| 2917 | ROM_CONTINUE( 0x18000, 0x08000 ) | |
| 2918 | ROM_LOAD( "gw-9.15f", 0x30000, 0x10000, CRC(84e5c946) SHA1(0b071d15b664a9c529713b1b896bdb5ebfa16c25) ) | |
| 2917 | ROM_CONTINUE( 0x18000, 0x08000 ) | |
| 2918 | ROM_LOAD( "gw-11.11f", 0x30000, 0x10000, CRC(7b9f2608) SHA1(8d61dfa32369450e396cc8a5d67c58eedb2167e6) ) | |
| 2919 | 2919 | ROM_LOAD( "gw-10.13f", 0x50000, 0x10000, CRC(eb305d42) SHA1(93910cf60c1b8a87969888d8693c7d6782f1e799) ) |
| 2920 | ROM_LOAD( "gw- | |
| 2920 | ROM_LOAD( "gw-9 | |
| 2921 | 2921 | |
| 2922 | 2922 | ROM_REGION( 0x020000, "gfx1", 0 ) /* chars */ |
| 2923 | 2923 | ROM_LOAD( "gw-13.4l", 0x000000, 0x10000, CRC(b75bf1d0) SHA1(c22c0049274c45701be0a7be2afc0517620a3a10) ) |
| r10315 | r10316 | |
| 2991 | 2991 | ROM_REGION( 0x90000, "audiocpu", 0 ) /* Sound CPU */ |
| 2992 | 2992 | ROM_LOAD( "u12", 0x00000, 0x08000, CRC(2620caa1) SHA1(bd464abce0bedab68cb913321e76d83eb36ca374) ) |
| 2993 | 2993 | ROM_CONTINUE( 0x18000, 0x08000 ) |
| 2994 | ROM_LOAD( "u11", 0x30000, 0x10000, CRC(2218ceb9) SHA1(69a843308cb0628ad856a09a33cd148f36ce0d24) ) | |
| 2995 | ROM_LOAD( "u10", 0x50000, 0x10000, CRC(636978ae) SHA1(5d8093bc43192c89e230af318609222a69866b6e) ) | |
| 2994 | 2996 | ROM_LOAD( "u9", 0x70000, 0x10000, CRC(9136745e) SHA1(d7a2bfeac69ab2dbd4565a5bd1abb1f3f1199b42) ) |
| 2995 | ROM_LOAD( "u10", 0x50000, 0x10000, CRC(636978ae) SHA1(5d8093bc43192c89e230af318609222a69866b6e) ) | |
| 2996 | ROM_LOAD( "u11", 0x30000, 0x10000, CRC(2218ceb9) SHA1(69a843308cb0628ad856a09a33cd148f36ce0d24) ) | |
| 2997 | 2997 | |
| 2998 | 2998 | ROM_REGION( 0x020000, "gfx1", 0 ) /* chars */ |
| 2999 | 2999 | ROM_LOAD( "gwb_ic.m19", 0x000000, 0x10000, CRC(b75bf1d0) SHA1(c22c0049274c45701be0a7be2afc0517620a3a10) ) |
| r10315 | r10316 | |
|---|---|---|
| 2188 | 2188 | { /* SUBCPU enable on System 22 (guessed, but too early crashes Rave Racer so it's a good test) */ |
| 2189 | 2189 | if (data == 0xff00) |
| 2190 | 2190 | { |
| 2191 | | |
| 2191 | | |
| 2192 | 2192 | } |
| 2193 | 2193 | } |
| 2194 | 2194 | } |
| r10315 | r10316 | |
|---|---|---|
| 136 | 136 | |
| 137 | 137 | for (i = 0; i < 64; i++) |
| 138 | 138 | if (potsense[i] != 0) |
| 139 | timer_set(machine | |
| 139 | machine->scheduler().timer_set(machine | |
| 140 | 140 | |
| 141 | 141 | scanline += 0x40; |
| 142 | 142 | scanline &= 0xff; |
| 143 | 143 | |
| 144 | timer_set(machine | |
| 144 | machine->scheduler().timer_set(machine | |
| 145 | 145 | |
| 146 | 146 | state->potsense = 0; |
| 147 | 147 | state->potmask = 0; |
| r10315 | r10316 | |
| 387 | 387 | |
| 388 | 388 | machine->device("maincpu")->reset(); |
| 389 | 389 | |
| 390 | timer_set(machine | |
| 390 | machine->scheduler().timer_set(machine | |
| 391 | 391 | |
| 392 | 392 | state->pitcher_vert = 0; |
| 393 | 393 | state->pitcher_horz = 0; |
| r10315 | r10316 | |
|---|---|---|
| 933 | 933 | if(!offset) |
| 934 | 934 | state->latches[2]|=1; |
| 935 | 935 | COMBINE_DATA(&state->latches[offset]); |
| 936 | | |
| 936 | | |
| 937 | 937 | } |
| 938 | 938 | |
| 939 | 939 | static READ16_HANDLER(latch16_r) |
| r10315 | r10316 | |
| 952 | 952 | if(!offset) |
| 953 | 953 | state->latches[2]|=2; |
| 954 | 954 | state->latches[offset]=data; |
| 955 | | |
| 955 | | |
| 956 | 956 | } |
| 957 | 957 | |
| 958 | 958 | static ADDRESS_MAP_START( jsk_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| r10315 | r10316 | |
|---|---|---|
| 172 | 172 | - Hook up OKIM6376 sound in The Mating Game |
| 173 | 173 | - Get the BwB games running |
| 174 | 174 | * They have a slightly different 68k memory map. The 6850 is at e00000 and the 6840 is at e01000 |
| 175 | They appear to hang on the handshake with the MPU4 board | |
| 175 | 176 | - Find out what causes the games to reset in service mode (see jump taken at CPU1:c8e8) |
| 176 | 177 | - Deal 'Em lockouts vary on certain cabinets (normally connected to AUX2, but not there?) |
| 177 | 178 | - Deal 'Em has bad tiles (apostrophe, logo, bottom corner), black should actually be transparent |
| r10315 | r10316 | |
| 1094 | 1095 | } |
| 1095 | 1096 | } |
| 1096 | 1097 | |
| 1098 | /****************************************** | |
| 1099 | * | |
| 1100 | * Brooktree Bt471 RAMDAC | |
| 1101 | * Implementation stolen from JPM | |
| 1102 | * Impact, may not be 100% (that has a 477) | |
| 1103 | ******************************************/ | |
| 1097 | 1104 | |
| 1105 | static struct | |
| 1106 | { | |
| 1107 | UINT8 address; | |
| 1108 | UINT8 addr_cnt; | |
| 1109 | UINT8 pixmask; | |
| 1110 | UINT8 command; | |
| 1111 | rgb_t color; | |
| 1112 | } bt471; | |
| 1113 | ||
| 1114 | ||
| 1115 | /* | |
| 1116 | * 0 0 0 Address register (RAM write mode) | |
| 1117 | * 0 0 1 Color palette RAMs | |
| 1118 | * 0 1 0 Pixel read mask register | |
| 1119 | * 0 1 1 Address register (RAM read mode) | |
| 1120 | * 1 0 0 Address register (overlay write mode) | |
| 1121 | * 1 1 1 Address register (overlay read mode) | |
| 1122 | * 1 0 1 Overlay register | |
| 1123 | */ | |
| 1124 | ||
| 1125 | WRITE16_HANDLER( bt471_w ) | |
| 1126 | { | |
| 1127 | UINT8 val = data & 0xff; | |
| 1128 | { | |
| 1129 | popmessage("Bt477: Unhandled write access (offset:%x, data:%x)", offset, val); | |
| 1130 | } | |
| 1131 | ||
| 1132 | switch (offset) | |
| 1133 | { | |
| 1134 | case 0x0: | |
| 1135 | { | |
| 1136 | bt471.address = val; | |
| 1137 | bt471.addr_cnt = 0; | |
| 1138 | break; | |
| 1139 | } | |
| 1140 | case 0x1: | |
| 1141 | { | |
| 1142 | UINT8 *addr_cnt = &bt471.addr_cnt; | |
| 1143 | rgb_t *color = &bt471.color; | |
| 1144 | ||
| 1145 | color[*addr_cnt] = val; | |
| 1146 | ||
| 1147 | if (++*addr_cnt == 3) | |
| 1148 | { | |
| 1149 | palette_set_color(space->machine, bt471.address, MAKE_RGB(color[0], color[1], color[2])); | |
| 1150 | *addr_cnt = 0; | |
| 1151 | ||
| 1152 | /* Address register increments */ | |
| 1153 | bt471.address++; | |
| 1154 | } | |
| 1155 | break; | |
| 1156 | } | |
| 1157 | case 0x2: | |
| 1158 | { | |
| 1159 | bt471.pixmask = val; | |
| 1160 | break; | |
| 1161 | } | |
| 1162 | ||
| 1163 | // default: | |
| 1164 | { | |
| 1165 | popmessage("Bt477: Unhandled write access (offset:%x, data:%x)", offset, val); | |
| 1166 | } | |
| 1167 | } | |
| 1168 | } | |
| 1169 | ||
| 1170 | READ16_HANDLER( bt471_r ) | |
| 1171 | { | |
| 1172 | popmessage("Bt477: Unhandled read access (offset:%x)", offset); | |
| 1173 | return 0; | |
| 1174 | } | |
| 1175 | ||
| 1176 | ||
| 1098 | 1177 | /************************************* |
| 1099 | 1178 | * |
| 1100 | 1179 | * Trackball interface |
| r10315 | r10316 | |
| 1888 | 1967 | { |
| 1889 | 1968 | mpu4_config_common(machine); |
| 1890 | 1969 | |
| 1970 | mod_number=4; //No AY chip | |
| 1891 | 1971 | /* setup communications */ |
| 1892 | 1972 | link7a_connected = 1; |
| 1893 | 1973 | |
| 1894 | 1974 | /* setup 8 mechanical meters */ |
| 1895 | Mech | |
| 1975 | MechMtr_config(machine,8); | |
| 1896 | 1976 | |
| 1897 | /* setup 4 reels (for hybrid machines) */ | |
| 1898 | stepper_config(machine, 0, &barcrest_reel_interface); | |
| 1899 | stepper_config(machine, 1, &barcrest_reel_interface); | |
| 1900 | stepper_config(machine, 2, &barcrest_reel_interface); | |
| 1901 | stepper_config(machine, 3, &barcrest_reel_interface); | |
| 1902 | ||
| 1903 | 1977 | /* setup the standard oki MSC1937 display */ |
| 1904 | 1978 | ROC10937_init(0, MSC1937, 0); |
| 1905 | 1979 | |
| r10315 | r10316 | |
| 1977 | 2051 | /* AM_RANGE(0xffd000, 0xffd00f) AM_READWRITE(characteriser16_r, characteriser16_w) Word-based version of old CHR??? */ |
| 1978 | 2052 | ADDRESS_MAP_END |
| 1979 | 2053 | |
| 2054 | static ADDRESS_MAP_START( bwbvid_6809_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 2055 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("nvram") | |
| 2056 | AM_RANGE(0x0800, 0x0800) AM_DEVREADWRITE("acia6850_0", acia6850_stat_r, acia6850_ctrl_w) | |
| 2057 | AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE("acia6850_0", acia6850_data_r, acia6850_data_w) | |
| 2058 | AM_RANGE(0x0880, 0x0881) //AM_NOP //Read/write here | |
| 2059 | AM_RANGE(0x0900, 0x0907) AM_DEVREADWRITE("ptm_ic2", ptm6840_read, ptm6840_write) | |
| 2060 | AM_RANGE(0x0a00, 0x0a03) AM_DEVREADWRITE("pia_ic3", pia6821_r, pia6821_w) | |
| 2061 | AM_RANGE(0x0b00, 0x0b03) AM_DEVREADWRITE("pia_ic4", pia6821_r, pia6821_w) | |
| 2062 | AM_RANGE(0x0c00, 0x0c03) AM_DEVREADWRITE("pia_ic5", pia6821_r, pia6821_w) | |
| 2063 | AM_RANGE(0x0d00, 0x0d03) AM_DEVREADWRITE("pia_ic6", pia6821_r, pia6821_w) | |
| 2064 | AM_RANGE(0x0e00, 0x0e03) AM_DEVREADWRITE("pia_ic7", pia6821_r, pia6821_w) | |
| 2065 | AM_RANGE(0x0f00, 0x0f03) AM_DEVREADWRITE("pia_ic8", pia6821_r, pia6821_w) | |
| 2066 | AM_RANGE(0x4000, 0x7fff) AM_RAM | |
| 2067 | AM_RANGE(0xbe00, 0xbfff) AM_RAM | |
| 2068 | AM_RANGE(0xc000, 0xffff) AM_ROM AM_REGION("maincpu",0) /* 64k EPROM on board, only this region read */ | |
| 2069 | ADDRESS_MAP_END | |
| 1980 | 2070 | |
| 2071 | static ADDRESS_MAP_START( bwbvid_68k_map, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 2072 | AM_RANGE(0x000000, 0x7fffff) AM_ROM | |
| 2073 | AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE(&mpu4_vid_mainram) | |
| 2074 | AM_RANGE(0x810000, 0x81ffff) AM_RAM /* ? */ | |
| 2075 | AM_RANGE(0x900000, 0x900001) AM_DEVWRITE8("saa", saa1099_data_w, 0x00ff) | |
| 2076 | AM_RANGE(0x900002, 0x900003) AM_DEVWRITE8("saa", saa1099_control_w, 0x00ff) | |
| 2077 | AM_RANGE(0xa00000, 0xa00003) AM_READWRITE(ef9369_r, ef9369_w) | |
| 2078 | // AM_RANGE(0xa00000, 0xa0000f) AM_READWRITE(bt471_r,bt471_w) //Some games use this | |
| 2079 | /* AM_RANGE(0xa00004, 0xa0000f) AM_READWRITE(mpu4_vid_unmap_r, mpu4_vid_unmap_w) */ | |
| 2080 | AM_RANGE(0xb00000, 0xb0000f) AM_READWRITE(mpu4_vid_scn2674_r, mpu4_vid_scn2674_w) | |
| 2081 | AM_RANGE(0xc00000, 0xc1ffff) AM_READWRITE(mpu4_vid_vidram_r, mpu4_vid_vidram_w) | |
| 2082 | AM_RANGE(0xe05000, 0xe05001) //AM_READWRITE(adpcm_r, adpcm_w) CHR ? | |
| 2083 | AM_RANGE(0xe00000, 0xe00001) AM_DEVREADWRITE8("acia6850_1", acia6850_stat_r, acia6850_ctrl_w, 0xff) | |
| 2084 | AM_RANGE(0xe00002, 0xe00003) AM_DEVREADWRITE8("acia6850_1", acia6850_data_r, acia6850_data_w, 0xff) | |
| 2085 | ADDRESS_MAP_END | |
| 2086 | ||
| 2087 | static ADDRESS_MAP_START( bwbvid5_68k_map, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 2088 | AM_RANGE(0x000000, 0x7fffff) AM_ROM | |
| 2089 | AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE(&mpu4_vid_mainram) | |
| 2090 | AM_RANGE(0x810000, 0x81ffff) AM_RAM /* ? */ | |
| 2091 | AM_RANGE(0x900000, 0x900001) AM_DEVWRITE8("saa", saa1099_data_w, 0x00ff) | |
| 2092 | AM_RANGE(0x900002, 0x900003) AM_DEVWRITE8("saa", saa1099_control_w, 0x00ff) | |
| 2093 | AM_RANGE(0xa00000, 0xa00003) AM_READWRITE(ef9369_r, ef9369_w) | |
| 2094 | //AM_RANGE(0xa00000, 0xa00003) AM_READWRITE(bt471_r,bt471_w) Some games use this | |
| 2095 | /* AM_RANGE(0xa00004, 0xa0000f) AM_READWRITE(mpu4_vid_unmap_r, mpu4_vid_unmap_w) */ | |
| 2096 | AM_RANGE(0xb00000, 0xb0000f) AM_READWRITE(mpu4_vid_scn2674_r, mpu4_vid_scn2674_w) | |
| 2097 | AM_RANGE(0xc00000, 0xc1ffff) AM_READWRITE(mpu4_vid_vidram_r, mpu4_vid_vidram_w) | |
| 2098 | AM_RANGE(0xe05000, 0xe05001) //AM_READWRITE(adpcm_r, adpcm_w) CHR ? | |
| 2099 | AM_RANGE(0xe00000, 0xe00001) AM_DEVREADWRITE8("acia6850_1", acia6850_stat_r, acia6850_ctrl_w, 0xff) | |
| 2100 | AM_RANGE(0xe00002, 0xe00003) AM_DEVREADWRITE8("acia6850_1", acia6850_data_r, acia6850_data_w, 0xff) | |
| 2101 | AM_RANGE(0xe01000, 0xe0100f) AM_DEVREADWRITE8("6840ptm_68k", ptm6840_read, ptm6840_write, 0xff) | |
| 2102 | AM_RANGE(0xe02000, 0xe02007) AM_DEVREADWRITE8("pia_ic4ss", pia6821_r, pia6821_w, 0xff) | |
| 2103 | AM_RANGE(0xe03000, 0xe0300f) AM_DEVREADWRITE8("6840ptm_ic3ss", ptm6840_read, ptm6840_write, 0xff) | |
| 2104 | ADDRESS_MAP_END | |
| 2105 | // | |
| 1981 | 2106 | /* Deal 'Em */ |
| 1982 | 2107 | /* Deal 'Em was designed as an enhanced gamecard, to fit into an existing MPU4 cabinet |
| 1983 | 2108 | It's an unoffical addon, and does all its work through the existing 6809 CPU. |
| 1984 | 2109 | Although given unofficial status, Barcrest's patent on the MPU4 Video hardware (GB1596363) describes |
| 1985 | the Deal 'Em board design, rather than the one they ultimately used, suggesting some sort of licensing deal. */ | |
| 2110 | the Deal 'Em board design, rather than the one they ultimately used, suggesting some sort of licensing deal. | |
| 2111 | Perhaps this was the (seemingly very rare) MPU3 Video card design? */ | |
| 1986 | 2112 | |
| 1987 | 2113 | static const gfx_layout dealemcharlayout = |
| 1988 | 2114 | { |
| r10315 | r10316 | |
| 2136 | 2262 | static TIMER_DEVICE_CALLBACK( scanline_timer_callback ) |
| 2137 | 2263 | { |
| 2138 | 2264 | int current_scanline=param; |
| 2139 | timer | |
| 2265 | timer.machin | |
| 2140 | 2266 | |
| 2141 | 2267 | |
| 2142 | 2268 | if (current_scanline==0) |
| r10315 | r10316 | |
| 2269 | 2395 | MCFG_PALETTE_LENGTH(16) |
| 2270 | 2396 | |
| 2271 | 2397 | MCFG_PTM6840_ADD("6840ptm_68k", ptm_vid_intf) |
| 2272 | ||
| 2273 | MCFG_SPEAKER_STANDARD_MONO("mono") | |
| 2274 | MCFG_SOUND_ADD("ay8913",AY8913, MPU4_MASTER_CLOCK/4) | |
| 2275 | MCFG_SOUND_CONFIG(ay8910_config) | |
| 2276 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) | |
| 2277 | ||
| 2278 | 2398 | /* Present on all video cards */ |
| 2279 | 2399 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 2280 | 2400 | MCFG_SOUND_ADD("saa", SAA1099, 8000000) |
| r10315 | r10316 | |
| 2293 | 2413 | MACHINE_CONFIG_END |
| 2294 | 2414 | |
| 2295 | 2415 | static MACHINE_CONFIG_DERIVED( mating, crmaze ) |
| 2296 | ||
| 2297 | 2416 | MCFG_SOUND_ADD("oki", OKIM6376, 64000) //? |
| 2298 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) | |
| 2417 | MCFG_SOUND_ROUTE(0, "lspeaker", 0.5) | |
| 2418 | MCFG_SOUND_ROUTE(1, "rspeaker", 0.5) | |
| 2299 | 2419 | MACHINE_CONFIG_END |
| 2300 | 2420 | |
| 2301 | 2421 | static MACHINE_CONFIG_DERIVED( vgpoker, mpu4_vid ) |
| r10315 | r10316 | |
| 2303 | 2423 | MCFG_CPU_PROGRAM_MAP(vp_68k_map) |
| 2304 | 2424 | MACHINE_CONFIG_END |
| 2305 | 2425 | |
| 2426 | static MACHINE_CONFIG_START( bwbvid, driver_device ) | |
| 2427 | MCFG_CPU_ADD("maincpu", M6809, MPU4_MASTER_CLOCK/4 ) | |
| 2428 | MCFG_CPU_PROGRAM_MAP(bwbvid_6809_map) | |
| 2429 | MCFG_TIMER_ADD_PERIODIC("50hz",gen_50hz, attotime::from_hz(100)) | |
| 2306 | 2430 | |
| 2431 | MCFG_NVRAM_ADD_0FILL("nvram") /* confirm */ | |
| 2307 | 2432 | |
| 2433 | /* 6840 PTM */ | |
| 2434 | MCFG_PTM6840_ADD("ptm_ic2", ptm_ic2_intf) | |
| 2435 | ||
| 2436 | MCFG_PIA6821_ADD("pia_ic3", pia_ic3_intf) | |
| 2437 | MCFG_PIA6821_ADD("pia_ic4", pia_ic4_intf) | |
| 2438 | MCFG_PIA6821_ADD("pia_ic5", pia_ic5_intf) | |
| 2439 | MCFG_PIA6821_ADD("pia_ic6", pia_ic6_intf) | |
| 2440 | MCFG_PIA6821_ADD("pia_ic7", pia_ic7_intf) | |
| 2441 | MCFG_PIA6821_ADD("pia_ic8", pia_ic8_intf) | |
| 2442 | ||
| 2443 | /* video hardware */ | |
| 2444 | MCFG_SCREEN_ADD("screen", RASTER) | |
| 2445 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) | |
| 2446 | MCFG_SCREEN_SIZE(64*8, 40*8) // note this directly affects the scanline counters used below, and thus the timing of everything | |
| 2447 | MCFG_SCREEN_VISIBLE_AREA(0*8, 63*8-1, 0*8, 37*8-1) | |
| 2448 | MCFG_SCREEN_REFRESH_RATE(50) | |
| 2449 | ||
| 2450 | MCFG_CPU_ADD("video", M68000, VIDEO_MASTER_CLOCK ) | |
| 2451 | MCFG_CPU_PROGRAM_MAP(bwbvid_68k_map) | |
| 2452 | ||
| 2453 | MCFG_QUANTUM_TIME(attotime::from_hz(960)) | |
| 2454 | ||
| 2455 | MCFG_MACHINE_START(mpu4_vid) | |
| 2456 | MCFG_MACHINE_RESET(mpu4_vid) | |
| 2457 | MCFG_VIDEO_START (mpu4_vid) | |
| 2458 | MCFG_VIDEO_UPDATE(mpu4_vid) | |
| 2459 | ||
| 2460 | MCFG_PALETTE_LENGTH(16) | |
| 2461 | ||
| 2462 | MCFG_PTM6840_ADD("6840ptm_68k", ptm_vid_intf) | |
| 2463 | ||
| 2464 | /* Present on all video cards */ | |
| 2465 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") | |
| 2466 | MCFG_SOUND_ADD("saa", SAA1099, 8000000) | |
| 2467 | MCFG_SOUND_ROUTE(0, "lspeaker", 0.5) | |
| 2468 | MCFG_SOUND_ROUTE(1, "rspeaker", 0.5) | |
| 2469 | ||
| 2470 | MCFG_ACIA6850_ADD("acia6850_0", m6809_acia_if) | |
| 2471 | MCFG_ACIA6850_ADD("acia6850_1", m68k_acia_if) | |
| 2472 | ||
| 2473 | // for the video timing | |
| 2474 | MCFG_TIMER_ADD_SCANLINE("scan_timer", scanline_timer_callback, "screen", 0, 1) | |
| 2475 | MACHINE_CONFIG_END | |
| 2476 | ||
| 2477 | static MACHINE_CONFIG_DERIVED( bwbvid5, bwbvid ) | |
| 2478 | MCFG_CPU_MODIFY("video") | |
| 2479 | MCFG_CPU_PROGRAM_MAP(bwbvid5_68k_map) | |
| 2480 | ||
| 2481 | MCFG_PTM6840_ADD("6840ptm_ic3ss", ptm_ic3ss_intf) | |
| 2482 | MCFG_PIA6821_ADD("pia_ic4ss", pia_ic4ss_intf) | |
| 2483 | ||
| 2484 | MCFG_SOUND_ADD("msm6376", OKIM6376, 64000) //? | |
| 2485 | MCFG_SOUND_ROUTE(0, "lspeaker", 0.5) | |
| 2486 | MCFG_SOUND_ROUTE(1, "rspeaker", 0.5) | |
| 2487 | ||
| 2488 | MACHINE_CONFIG_END | |
| 2489 | ||
| 2308 | 2490 | /* machine driver for Zenitone Deal 'Em board */ |
| 2309 | 2491 | static MACHINE_CONFIG_START( dealem, driver_device ) |
| 2310 | 2492 | MCFG_MACHINE_START(mpu4mod2) /* main mpu4 board initialisation */ |
| r10315 | r10316 | |
| 2697 | 2879 | ROM_LOAD16_BYTE( "blxv___2.0_6", 0x040001, 0x10000, CRC(a3d92b5b) SHA1(1e7042d5eae4a19a01a3ef7d806c434886dc9f4d) ) |
| 2698 | 2880 | ROM_END |
| 2699 | 2881 | |
| 2882 | ROM_START( bwbtetrs ) | |
| 2883 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 2884 | ROM_LOAD("tetris22.p0", 0x00000, 0x04000, CRC(b711c7ae) SHA1(767b17ddf9021fdf79ff6c52f04a5d8ea60cf30e) ) | |
| 2885 | ||
| 2886 | ROM_REGION( 0x800000, "video", 0 ) | |
| 2887 | ROM_LOAD16_BYTE( "tetris22.p1", 0x000000, 0x10000, CRC(e81dd182) SHA1(28b460224abf6fe24b637542ccd1c84040674555) ) | |
| 2888 | ROM_LOAD16_BYTE( "tetris22.p2", 0x000001, 0x10000, CRC(68aa4f15) SHA1(4e4511a64391fc64e5f5b7ccb46a78fd2e1d94d6) ) | |
| 2889 | ROM_LOAD16_BYTE( "tetris22.p3", 0x020000, 0x10000, CRC(b38b4763) SHA1(d28e77fdd6869cb5b5ec40ed1f300a2a947e0482) ) | |
| 2890 | ROM_LOAD16_BYTE( "tetris22.p4", 0x020001, 0x10000, CRC(1649f604) SHA1(ca4ac303391a0969d41c8f988b8e81cfcee1a21c) ) | |
| 2891 | ROM_LOAD16_BYTE( "tetris22.p5", 0x040001, 0x10000, CRC(02859676) SHA1(5293c767021a6b5253eecab0b0568aa082ea7084) ) | |
| 2892 | ROM_LOAD16_BYTE( "tetris22.p6", 0x040001, 0x10000, CRC(40d24c82) SHA1(7ac3cf148af84ad93eaf11ce3420abbe45d986e2) ) | |
| 2893 | ROM_END | |
| 2894 | ||
| 2895 | /* Vegas Poker Prototype dumped by HIGHWAYMAN */ | |
| 2896 | ROM_START( vgpoker ) | |
| 2897 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 2898 | ROM_LOAD("comms-v2.0.bin", 0x00000, 0x10000, CRC(1717581f) SHA1(40f8cae39a2ab0c89d2bbfd8a37725aaae229c96)) | |
| 2899 | ||
| 2900 | ROM_REGION( 0x800000, "video", 0 ) | |
| 2901 | ROM_LOAD16_BYTE("video-1.bin", 0x000000, 0x010000, CRC(7ba2396c) SHA1(eb24b802b984315fc2eba4f15c208e2c1925c1c8)) | |
| 2902 | ROM_LOAD16_BYTE("video-2.bin", 0x000001, 0x010000, CRC(4f9e830b) SHA1(f17bebb289c3620bf4c88b2b358a9dab87ac214f)) | |
| 2903 | ROM_LOAD16_BYTE("video-3.bin", 0x020000, 0x010000, CRC(607e0baa) SHA1(9f64a46ef3b9a854e939b5e7f0d1e6e925735922)) | |
| 2904 | ROM_LOAD16_BYTE("video-4.bin", 0x020001, 0x010000, CRC(2019f5d3) SHA1(d183b3b92d03be9f9d57b5df1a621cbfe955ed93)) | |
| 2905 | ROM_LOAD16_BYTE("video-5.bin", 0x040000, 0x010000, CRC(c029202e) SHA1(b08bb2678c2ff62a58ef67d5440c326d0fadc34e)) | |
| 2906 | ROM_LOAD16_BYTE("video-6.bin", 0x040001, 0x010000, CRC(3287ae4e) SHA1(3b05a036de3ca7ec644bfbf04934e44e631d1e28)) | |
| 2907 | ROM_LOAD16_BYTE("video-7.bin", 0x060000, 0x010000, CRC(231cf163) SHA1(02b28ef0e1661a82d0fba2ecc5474c79651fa9e7)) | |
| 2908 | ROM_LOAD16_BYTE("video-8.bin", 0x060001, 0x010000, CRC(076efdc8) SHA1(bef0a1d8f0e7486ee5dc7407ce5c96854cefa5cf)) | |
| 2909 | ROM_END | |
| 2910 | ||
| 2911 | ||
| 2912 | ROM_START( renoreel ) | |
| 2913 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 2914 | ROM_LOAD("rr_27s__.a60", 0x00000, 0x10000, CRC(44c9ff47) SHA1(93a3155144b233c113aa3b49bd4eb5969e400a68)) | |
| 2915 | ||
| 2916 | ROM_REGION( 0x800000, "video", 0 ) | |
| 2917 | ROM_LOAD16_BYTE( "rr______.a_1", 0x000000, 0x80000, CRC(ff27d0ba) SHA1(85cce36495f00a05c1806ecde37274212680e466) ) | |
| 2918 | ROM_LOAD16_BYTE( "rr______.a_2", 0x000001, 0x80000, CRC(519b9ae1) SHA1(8ccfe8de0f2c85923df81af8cba6f20af43d2fe2) ) | |
| 2919 | ||
| 2920 | ROM_REGION( 0x200000, "msm6376", 0 ) | |
| 2921 | ROM_LOAD( "renosnda.bin", 0x000000, 0x080000, CRC(a72a5e1b) SHA1(a0d5338a400345a55484848a7612119405f617b1) ) | |
| 2922 | ROM_LOAD( "renosndb.bin", 0x080000, 0x080000, CRC(46e9a32f) SHA1(d45835a82368992597e44b3c5b9d00d8b901e733) ) | |
| 2923 | ||
| 2924 | ROM_END | |
| 2925 | ||
| 2926 | ROM_START( redhtpkr ) | |
| 2927 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 2928 | ROM_LOAD("rp_20s__.3_0", 0x00000, 0x10000, CRC(b7d02d22) SHA1(f9da1c6dde064bc39d0c48a165dac7acde933397)) | |
| 2929 | ||
| 2930 | ROM_REGION( 0x800000, "video", 0 ) | |
| 2931 | ROM_LOAD16_BYTE("rp______.3_1", 0x000000, 0x010000, CRC(b987406d) SHA1(8c4d386570c0c6298b1cabf50295021b3b0cf625)) | |
| 2932 | ROM_LOAD16_BYTE("rp______.3_2", 0x000001, 0x010000, CRC(73e3c12e) SHA1(19e3ed7255fa0c3bfa14b6a4b705c0c3e1a237b6)) | |
| 2933 | ROM_LOAD16_BYTE("rp______.3_3", 0x020000, 0x010000, CRC(05a30183) SHA1(302f4926073bf7335da7f0b1e6399b64ea9bbae4)) | |
| 2934 | ROM_LOAD16_BYTE("rp______.3_4", 0x020001, 0x010000, CRC(6b122765) SHA1(72cd0fda322790bed8cdc7697306ec01efc43789)) | |
| 2935 | ROM_LOAD16_BYTE("rp______.3_5", 0x040000, 0x010000, CRC(d9fd05d0) SHA1(330ef58c012b5d5fd018bea54b3ae315b3e45cfd)) | |
| 2936 | ROM_LOAD16_BYTE("rp______.3_6", 0x040001, 0x010000, CRC(eeea91ff) SHA1(cc7870a68f62d4dd70c13713a432a61a091821ef)) | |
| 2937 | ||
| 2938 | ROM_END | |
| 2939 | ||
| 2700 | 2940 | ROM_START( crmaze ) |
| 2701 | 2941 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2702 | 2942 | VID_BIOS |
| r10315 | r10316 | |
| 3122 | 3362 | ROM_END |
| 3123 | 3363 | |
| 3124 | 3364 | |
| 3125 | /* Vegas Poker Prototype dumped by HIGHWAYMAN */ | |
| 3126 | ROM_START( vgpoker ) | |
| 3127 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 3128 | ROM_LOAD("comms-v2.0.bin", 0x00000, 0x10000, CRC(1717581f) SHA1(40f8cae39a2ab0c89d2bbfd8a37725aaae229c96)) | |
| 3129 | ||
| 3130 | ROM_REGION( 0x800000, "video", 0 ) | |
| 3131 | ROM_LOAD16_BYTE("video-1.bin", 0x000000, 0x010000, CRC(7ba2396c) SHA1(eb24b802b984315fc2eba4f15c208e2c1925c1c8)) | |
| 3132 | ROM_LOAD16_BYTE("video-2.bin", 0x000001, 0x010000, CRC(4f9e830b) SHA1(f17bebb289c3620bf4c88b2b358a9dab87ac214f)) | |
| 3133 | ROM_LOAD16_BYTE("video-3.bin", 0x020000, 0x010000, CRC(607e0baa) SHA1(9f64a46ef3b9a854e939b5e7f0d1e6e925735922)) | |
| 3134 | ROM_LOAD16_BYTE("video-4.bin", 0x020001, 0x010000, CRC(2019f5d3) SHA1(d183b3b92d03be9f9d57b5df1a621cbfe955ed93)) | |
| 3135 | ROM_LOAD16_BYTE("video-5.bin", 0x040000, 0x010000, CRC(c029202e) SHA1(b08bb2678c2ff62a58ef67d5440c326d0fadc34e)) | |
| 3136 | ROM_LOAD16_BYTE("video-6.bin", 0x040001, 0x010000, CRC(3287ae4e) SHA1(3b05a036de3ca7ec644bfbf04934e44e631d1e28)) | |
| 3137 | ROM_LOAD16_BYTE("video-7.bin", 0x060000, 0x010000, CRC(231cf163) SHA1(02b28ef0e1661a82d0fba2ecc5474c79651fa9e7)) | |
| 3138 | ROM_LOAD16_BYTE("video-8.bin", 0x060001, 0x010000, CRC(076efdc8) SHA1(bef0a1d8f0e7486ee5dc7407ce5c96854cefa5cf)) | |
| 3139 | ROM_END | |
| 3140 | 3365 | /*Deal 'Em was a conversion kit designed to make early MPU4 machines into video games by replacing the top glass |
| 3141 | 3366 | and reel assembly with this kit and a supplied monitor. |
| 3142 | 3367 | The real Deal 'Em ran on Summit Coin hardware, and was made by someone else. |
| r10315 | r10316 | |
| 3192 | 3417 | GAME( 199?, quidgrid2, quidgrid, mpu4_vid, mpu4, quidgrid, ROT0, "Barcrest", "Ten Quid Grid (v2.4)", GAME_NOT_WORKING ) |
| 3193 | 3418 | GAME( 199?, quidgrid2d,quidgrid, mpu4_vid, mpu4, quidgrid, ROT0, "Barcrest", "Ten Quid Grid (v2.4, Datapak)", GAME_NOT_WORKING ) |
| 3194 | 3419 | |
| 3195 | /* Games below are newer BwB games and use their own BIOS ROMs */ | |
| 3420 | /* Games below are newer BwB games and use their own BIOS ROMs and hardware setups*/ | |
| 3196 | 3421 | GAME( 199?, vgpoker, 0, vgpoker, mpu4, 0, ROT0, "BwB", "Vegas Poker (prototype, release 2)", GAME_NOT_WORKING ) |
| 3197 | GAME( 199?, prizeinv, 0, mpu4_vid, mpu4, 0, ROT0, "BwB", "Prize Space Invaders (20\" v1.1)", GAME_NOT_WORKING ) | |
| 3198 | GAME( 199?, blox, 0, mpu4_vid, mpu4, 0, ROT0, "BwB", "Blox (v2.0)", GAME_NOT_WORKING ) | |
| 3199 | GAME( 199?, bloxd, blox, mpu4_vid, mpu4, 0, ROT0, "BwB", "Blox (v2.0, Datapak)", GAME_NOT_WORKING ) | |
| 3422 | GAME( 199?, prizeinv, 0, bwbvid, mpu4, 0, ROT0, "BwB", "Prize Space Invaders (20\" v1.1)", GAME_NOT_WORKING ) | |
| 3423 | GAME( 199?, blox, 0, bwbvid, mpu4, 0, ROT0, "BwB", "Blox (v2.0)", GAME_NOT_WORKING ) | |
| 3424 | GAME( 199?, bloxd, blox, bwbvid, mpu4, 0, ROT0, "BwB", "Blox (v2.0, Datapak)", GAME_NOT_WORKING ) | |
| 3425 | GAME( 1996, renoreel, 0, bwbvid5, mpu4, 0, ROT0, "BwB", "Reno Reels (20p/10GBP Cash, release A)", GAME_NOT_WORKING ) | |
| 3426 | GAME( 199?, redhtpkr, 0, bwbvid, mpu4, 0, ROT0, "BwB", "Red Hot Poker (20p/10GBP Cash, release 3)", GAME_NOT_WORKING ) | |
| 3427 | GAME( 199?, bwbtetrs, 0, bwbvid, mpu4, 0, ROT0, "BwB", "BwB Tetris v 2.2", GAME_NOT_WORKING ) |
| r10315 | r10316 | |
|---|---|---|
| 161 | 161 | if (which < 0 || which > 2) |
| 162 | 162 | logerror("adc_w: unexpected which = %02X\n", which + 4); |
| 163 | 163 | adc_data = input_port_read_safe(space->machine, adcnames[which], 0); |
| 164 | | |
| 164 | | |
| 165 | 165 | } |
| 166 | 166 | else |
| 167 | 167 | logerror("adc_w without enabling writes!\n"); |
| r10315 | r10316 | |
|---|---|---|
| 2215 | 2215 | static void init_keyboard(running_machine *machine) |
| 2216 | 2216 | { |
| 2217 | 2217 | // set keyboard timer |
| 2218 | keyboard_timer = timer_alloc( | |
| 2218 | keyboard_timer = machine->scheduler().timer_alloc(FUNC( | |
| 2219 | 2219 | timer_adjust_periodic(keyboard_timer, attotime::from_msec(10), 0, attotime::from_msec(10)); |
| 2220 | 2220 | } |
| 2221 | 2221 |
| r10315 | r10316 | |
|---|---|---|
| 132 | 132 | static void create_analog_timers( running_machine *machine ) |
| 133 | 133 | { |
| 134 | 134 | clayshoo_state *state = machine->driver_data<clayshoo_state>(); |
| 135 | state->analog_timer_1 = timer_alloc(machine, reset_analog_bit, NULL); | |
| 136 | state->analog_timer_2 = timer_alloc(machine, reset_analog_bit, NULL); | |
| 135 | state->analog_timer_1 = machine->scheduler().timer_alloc(FUNC(reset_analog_bit)); | |
| 136 | state->analog_timer_2 = machine->scheduler().timer_alloc(FUNC(reset_analog_bit)); | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 |
| r10315 | r10316 | |
|---|---|---|
| 83 | 83 | } |
| 84 | 84 | static WRITE8_HANDLER( beg_fromsound_w ) /* write to D800 sets bit 1 in status */ |
| 85 | 85 | { |
| 86 | | |
| 86 | space->machine->schedul | |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | static READ8_HANDLER( beg_fromsound_r ) |
| 90 | 90 | { |
| 91 | 91 | bigevglf_state *state = space->machine->driver_data<bigevglf_state>(); |
| 92 | 92 | /* set a timer to force synchronization after the read */ |
| 93 | | |
| 93 | | |
| 94 | 94 | return state->from_sound; |
| 95 | 95 | } |
| 96 | 96 | |
| r10315 | r10316 | |
| 99 | 99 | bigevglf_state *state = space->machine->driver_data<bigevglf_state>(); |
| 100 | 100 | UINT8 ret = state->sound_state; |
| 101 | 101 | /* set a timer to force synchronization after the read */ |
| 102 | | |
| 102 | | |
| 103 | 103 | state->sound_state &= ~2; /* read from port 21 clears bit 1 in status */ |
| 104 | 104 | return ret; |
| 105 | 105 | } |
| r10315 | r10316 | |
| 108 | 108 | { |
| 109 | 109 | bigevglf_state *state = space->machine->driver_data<bigevglf_state>(); |
| 110 | 110 | /* set a timer to force synchronization after the read */ |
| 111 | | |
| 111 | | |
| 112 | 112 | return state->sound_state; |
| 113 | 113 | } |
| 114 | 114 | |
| r10315 | r10316 | |
| 127 | 127 | { |
| 128 | 128 | bigevglf_state *state = space->machine->driver_data<bigevglf_state>(); |
| 129 | 129 | state->for_sound = data; |
| 130 | | |
| 130 | | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | static READ8_HANDLER( sound_command_r ) /* read from D800 sets bit 0 in status */ |
| r10315 | r10316 | |
| 165 | 165 | /* do this on a timer to let the CPUs synchronize */ |
| 166 | 166 | static WRITE8_HANDLER( beg13_a_clr_w ) |
| 167 | 167 | { |
| 168 | | |
| 168 | | |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | static WRITE8_HANDLER( beg13_b_clr_w ) |
| 172 | 172 | { |
| 173 | | |
| 173 | | |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | static WRITE8_HANDLER( beg13_a_set_w ) |
| 177 | 177 | { |
| 178 | | |
| 178 | | |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | static WRITE8_HANDLER( beg13_b_set_w ) |
| 182 | 182 | { |
| 183 | | |
| 183 | | |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | static READ8_HANDLER( beg_status_r ) |
| r10315 | r10316 | |
| 197 | 197 | |
| 198 | 198 | */ |
| 199 | 199 | /* set a timer to force synchronization after the read */ |
| 200 | | |
| 200 | | |
| 201 | 201 | return (state->beg13_ls74[0] << 0) | (state->beg13_ls74[1] << 1); |
| 202 | 202 | } |
| 203 | 203 |
| r10315 | r10316 | |
|---|---|---|
| 727 | 727 | { |
| 728 | 728 | /* the port C handshaking signals control the sub CPU IRQ, */ |
| 729 | 729 | /* so we have to sync whenever we access this PPI */ |
| 730 | | |
| 730 | device->machine->schedul | |
| 731 | 731 | } |
| 732 | 732 | |
| 733 | 733 |
| r10315 | r10316 | |
|---|---|---|
| 321 | 321 | static void start_393hz_timer(running_machine *machine) |
| 322 | 322 | { |
| 323 | 323 | cvs_state *state = machine->driver_data<cvs_state>(); |
| 324 | state->cvs_393hz_timer = timer_alloc( | |
| 324 | state->cvs_393hz_timer = machine->scheduler().timer_alloc(FUNC(c | |
| 325 | 325 | timer_adjust_periodic(state->cvs_393hz_timer, attotime::from_hz(30*393), 0, attotime::from_hz(30*393)); |
| 326 | 326 | } |
| 327 | 327 |
| r10315 | r10316 | |
|---|---|---|
| 160 | 160 | /* Kaos sits in a tight loop polling the VIA irq flags register, but that register is |
| 161 | 161 | cleared by the irq handler. Therefore, I wait a bit before triggering the irq to |
| 162 | 162 | leave time for the program to see the flag change. */ |
| 163 | | |
| 163 | | |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 |
| r10315 | r10316 | |
|---|---|---|
| 83 | 83 | static MACHINE_START( magmax ) |
| 84 | 84 | { |
| 85 | 85 | /* Create interrupt timer */ |
| 86 | interrupt_timer = timer_alloc( | |
| 86 | interrupt_timer = machine->scheduler().timer_alloc(FUNC( | |
| 87 | 87 | |
| 88 | 88 | /* Set up save state */ |
| 89 | 89 | state_save_register_global(machine, sound_latch); |
| r10315 | r10316 | |
|---|---|---|
| 98 | 98 | alg_state *state = machine->driver_data<alg_state>(); |
| 99 | 99 | state->laserdisc = machine->device("laserdisc"); |
| 100 | 100 | |
| 101 | state->serial_timer = timer_alloc( | |
| 101 | state->serial_timer = machine->scheduler().timer_alloc(FUNC( | |
| 102 | 102 | state->serial_timer_active = FALSE; |
| 103 | 103 | } |
| 104 | 104 |
| r10315 | r10316 | |
|---|---|---|
| 110 | 110 | static WRITE8_HANDLER( bombjack_soundlatch_w ) |
| 111 | 111 | { |
| 112 | 112 | /* make all the CPUs synchronize, and only AFTER that write the new command to the latch */ |
| 113 | | |
| 113 | | |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | static READ8_HANDLER( bombjack_soundlatch_r ) |
| r10315 | r10316 | |
|---|---|---|
| 76 | 76 | |
| 77 | 77 | dac_data_w( device, rom[dac_address+cur_dac_address_index] ); |
| 78 | 78 | |
| 79 | | |
| 79 | | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r10315 | r10316 | |
|---|---|---|
| 64 | 64 | { |
| 65 | 65 | /* Unsure of actual sequence */ |
| 66 | 66 | |
| 67 | timer_set(device->machine, downcast<cpu_device *>(device)->cycles_to_attotime(500), NULL, 0, gcpinbal_interrupt1); | |
| 68 | // timer_set(device->machine, downcast<cpu_device *>(device)->cycles_to_attotime(1000), NULL, 0, gcpinbal_interrupt3); | |
| 67 | device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(500), FUNC(gcpinbal_interrupt1)); | |
| 68 | // device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(1000), FUNC(gcpinbal_interrupt3)); | |
| 69 | 69 | cpu_set_input_line(device, 4, HOLD_LINE); |
| 70 | 70 | } |
| 71 | 71 |
| r10315 | r10316 | |
|---|---|---|
| 237 | 237 | static WRITE8_HANDLER( sound_command_w ) |
| 238 | 238 | { |
| 239 | 239 | soundlatch_w(space, 0, data); |
| 240 | | |
| 240 | | |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | static WRITE8_HANDLER( nmi_disable_w ) |
| r10315 | r10316 | |
|---|---|---|
| 880 | 880 | static MACHINE_START( galaga ) |
| 881 | 881 | { |
| 882 | 882 | /* create the interrupt timer */ |
| 883 | cpu3_interrupt_timer = timer_alloc( | |
| 883 | cpu3_interrupt_timer = machine->scheduler().timer_alloc(FUNC(c | |
| 884 | 884 | custom_mod = 0; |
| 885 | 885 | state_save_register_global(machine, custom_mod); |
| 886 | 886 | } |
| r10315 | r10316 | |
|---|---|---|
| 216 | 216 | static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect ) |
| 217 | 217 | { |
| 218 | 218 | UINT8 *spriteram = machine->generic.spriteram.u8; |
| 219 | int offs,fx,fy,x,y,color,sprite; | |
| 219 | int offs,flipx,flipy,x,y,color,sprite; | |
| 220 | 220 | |
| 221 | 221 | for (offs = 0; offs<0x1000; offs+=16) |
| 222 | 222 | { |
| 223 | ||
| 224 | fx = 0; | |
| 225 | fy = spriteram[offs+1] & 0x80; | |
| 223 | flipx = 0; | |
| 224 | flipy = spriteram[offs+1] & 0x80; | |
| 226 | 225 | y = spriteram[offs+2]; |
| 227 | 226 | x = spriteram[offs+3]; |
| 227 | if (spriteram[offs+1] & 0x40) x -= 0x100; | |
| 228 | 228 | |
| 229 | 229 | color = spriteram[offs+1] & 0x0f; |
| 230 | ||
| 231 | 230 | sprite = spriteram[offs+0]+(scrollram[0x0c]<<8); |
| 232 | 231 | |
| 233 | 232 | drawgfx_transmask(bitmap,cliprect,machine->gfx[2], |
| 234 | 233 | sprite, |
| 235 | color,fx,fy,x,y, | |
| 234 | color,flipx,flipy,x,y, | |
| 236 | 235 | colortable_get_transpen_mask(machine->colortable, machine->gfx[2], color, 0)); |
| 237 | 236 | } |
| 238 | 237 | } |
| r10315 | r10316 | |
|---|---|---|
| 385 | 385 | The ADC60808 clock is 512kHz. Conversion takes between 0 and 8 clock |
| 386 | 386 | cycles, so would end in a maximum of 15.625us. We'll use 10. */ |
| 387 | 387 | |
| 388 | | |
| 388 | | |
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 |
| r10315 | r10316 | |
|---|---|---|
| 87 | 87 | static WRITE8_HANDLER( sound_command_w ) |
| 88 | 88 | { |
| 89 | 89 | soundlatch_w(space, 0, data); |
| 90 | | |
| 90 | | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | static WRITE8_HANDLER( nmi_disable_w ) |
| r10315 | r10316 | |
|---|---|---|
| 220 | 220 | { |
| 221 | 221 | int i; |
| 222 | 222 | int changed = mmtr_latch ^ data; |
| 223 | UINT64 cycles = downcast<cpu_device *>(space->cpu)->total_cycles(); | |
| 224 | 223 | |
| 225 | 224 | mmtr_latch = data; |
| 226 | 225 | |
| 227 | 226 | for (i=0; i<8; i++) |
| 228 | if ( changed & (1 << i) ) Mech | |
| 227 | if ( changed & (1 << i) ) MechMtr_update(i | |
| 229 | 228 | |
| 230 | 229 | if ( data ) generic_pulse_irq_line(space->machine->device("maincpu"), M6809_FIRQ_LINE); |
| 231 | 230 | } |
| r10315 | r10316 | |
|---|---|---|
| 207 | 207 | |
| 208 | 208 | static WRITE8_HANDLER( frame_w ) |
| 209 | 209 | { |
| 210 | | |
| 210 | | |
| 211 | 211 | esripsys_frame_vbl = 1; |
| 212 | 212 | } |
| 213 | 213 |
| r10315 | r10316 | |
|---|---|---|
| 64 | 64 | |
| 65 | 65 | cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_IRQ0, HOLD_LINE); |
| 66 | 66 | |
| 67 | | |
| 67 | | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | static READ8_HANDLER( irqstate_r ) |
| r10315 | r10316 | |
| 459 | 459 | case 0: |
| 460 | 460 | case 1: |
| 461 | 461 | // phoneme timing response |
| 462 | | |
| 462 | | |
| 463 | 463 | break; |
| 464 | 464 | case 2: |
| 465 | 465 | // frame timing response |
| 466 | | |
| 466 | | |
| 467 | 467 | break; |
| 468 | 468 | case 3: |
| 469 | 469 | // disable A/_R output |
| r10315 | r10316 | |
|---|---|---|
| 677 | 677 | int line = (irq == 0) ? INPUT_LINE_IRQ1 : INPUT_LINE_IRQ2; |
| 678 | 678 | |
| 679 | 679 | cputag_set_input_line(machine, "audiocpu", line, ASSERT_LINE); |
| 680 | timer_set( | |
| 680 | machine->scheduler().timer_set( | |
| 681 | 681 | } |
| 682 | 682 | |
| 683 | 683 | static const k056800_interface zr107_k056800_interface = |
| r10315 | r10316 | |
|---|---|---|
| 1051 | 1051 | state->atapi_data_len = 0; |
| 1052 | 1052 | state->atapi_cdata_wait = 0; |
| 1053 | 1053 | |
| 1054 | state->atapi_timer = timer_alloc( | |
| 1054 | state->atapi_timer = machine->scheduler().timer_alloc(FUNC(a | |
| 1055 | 1055 | timer_adjust_oneshot(state->atapi_timer, attotime::never, 0); |
| 1056 | 1056 | |
| 1057 | 1057 | for( i = 0; i < 2; i++ ) |
| r10315 | r10316 | |
| 1589 | 1589 | |
| 1590 | 1590 | for (i = 0; i < 3; i++) |
| 1591 | 1591 | { |
| 1592 | state->m_p_timer_root[i] = timer_alloc( | |
| 1592 | state->m_p_timer_root[i] = machine->scheduler().timer_alloc(FUNC( | |
| 1593 | 1593 | } |
| 1594 | 1594 | |
| 1595 | 1595 | state_save_register_global( machine, state->m_n_security_control ); |
| r10315 | r10316 | |
|---|---|---|
| 88 | 88 | sbrkout_state *state = machine->driver_data<sbrkout_state>(); |
| 89 | 89 | UINT8 *videoram = state->videoram; |
| 90 | 90 | memory_set_bankptr(machine, "bank1", &videoram[0x380]); |
| 91 | state->scanline_timer = timer_alloc(machine, scanline_callback, NULL); | |
| 92 | state->pot_timer = timer_alloc(machine, pot_trigger_callback, NULL); | |
| 91 | state->scanline_timer = machine->scheduler().timer_alloc(FUNC(scanline_callback)); | |
| 92 | state->pot_timer = machine->scheduler().timer_alloc(FUNC(pot_trigger_callback)); | |
| 93 | 93 | |
| 94 | 94 | state_save_register_global(machine, state->sync2_value); |
| 95 | 95 | state_save_register_global_array(machine, state->pot_mask); |
| r10315 | r10316 | |
|---|---|---|
| 98 | 98 | { |
| 99 | 99 | cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE); |
| 100 | 100 | //sync with sound cpu (but it still loses some soundlatches...) |
| 101 | // | |
| 101 | // | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | static ADDRESS_MAP_START( wink_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r10315 | r10316 | |
|---|---|---|
| 213 | 213 | /*---- ---- ---- -x-- lamp*/ |
| 214 | 214 | if (data & 1) |
| 215 | 215 | { |
| 216 | // | |
| 216 | // | |
| 217 | 217 | state->shutter_sensor = 0x100; |
| 218 | 218 | } |
| 219 | 219 | else if (data & 2) |
| 220 | 220 | { |
| 221 | // | |
| 221 | // | |
| 222 | 222 | state->shutter_sensor = 0x200; |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | if (data & 0x1000 || data & 0x4000) |
| 226 | 226 | { |
| 227 | // | |
| 227 | // | |
| 228 | 228 | state->defender_sensor = 0x800; |
| 229 | 229 | } |
| 230 | 230 | else if (data & 0x2000 || data & 0x8000) |
| 231 | 231 | { |
| 232 | // | |
| 232 | // | |
| 233 | 233 | state->defender_sensor = 0x400; |
| 234 | 234 | } |
| 235 | 235 | } |
| r10315 | r10316 | |
|---|---|---|
| 884 | 884 | znsec_init(0, tt10); |
| 885 | 885 | znsec_init(1, tt16); |
| 886 | 886 | psx_sio_install_handler(machine, 0, sio_pad_handler); |
| 887 | state->dip_timer = timer_alloc( | |
| 887 | state->dip_timer = machine->scheduler().timer_alloc( FUNC( | |
| 888 | 888 | |
| 889 | 889 | memset(state->cis, 0xff, 512); |
| 890 | 890 | if (get_disk_handle(machine, "card") != NULL) |
| r10315 | r10316 | |
|---|---|---|
| 63 | 63 | |
| 64 | 64 | static INTERRUPT_GEN( gunbustr_interrupt ) |
| 65 | 65 | { |
| 66 | | |
| 66 | | |
| 67 | 67 | cpu_set_input_line(device, 4, HOLD_LINE); |
| 68 | 68 | } |
| 69 | 69 | |
| r10315 | r10316 | |
| 184 | 184 | static WRITE32_HANDLER( gunbustr_gun_w ) |
| 185 | 185 | { |
| 186 | 186 | /* 10000 cycle delay is arbitrary */ |
| 187 | | |
| 187 | | |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 |
| r10315 | r10316 | |
|---|---|---|
| 965 | 965 | state->sci_int6 = !state->sci_int6; |
| 966 | 966 | |
| 967 | 967 | if (state->sci_int6) |
| 968 | | |
| 968 | | |
| 969 | 969 | |
| 970 | 970 | cpu_set_input_line(device, 4, HOLD_LINE); |
| 971 | 971 | } |
| r10315 | r10316 | |
| 983 | 983 | state->dblaxle_int6 = !state->dblaxle_int6; |
| 984 | 984 | |
| 985 | 985 | if (state->dblaxle_int6) |
| 986 | | |
| 986 | | |
| 987 | 987 | |
| 988 | 988 | cpu_set_input_line(device, 4, HOLD_LINE); |
| 989 | 989 | } |
| r10315 | r10316 | |
| 991 | 991 | static INTERRUPT_GEN( dblaxle_cpub_interrupt ) |
| 992 | 992 | { |
| 993 | 993 | // Unsure how many int6's per frame |
| 994 | | |
| 994 | | |
| 995 | 995 | cpu_set_input_line(device, 4, HOLD_LINE); |
| 996 | 996 | } |
| 997 | 997 | |
| r10315 | r10316 | |
| 1208 | 1208 | but we don't want CPUA to have an int6 before int4 is over (?) |
| 1209 | 1209 | */ |
| 1210 | 1210 | |
| 1211 | | |
| 1211 | | |
| 1212 | 1212 | } |
| 1213 | 1213 | |
| 1214 | 1214 | |
| r10315 | r10316 | |
| 1293 | 1293 | Four lightgun interrupts happen before the collected coords |
| 1294 | 1294 | are moved to shared ram where CPUA can use them. */ |
| 1295 | 1295 | |
| 1296 | | |
| 1296 | | |
| 1297 | 1297 | } |
| 1298 | 1298 | |
| 1299 | 1299 | static WRITE16_HANDLER( spacegun_gun_output_w ) |
| r10315 | r10316 | |
|---|---|---|
| 34 | 34 | static WRITE8_HANDLER( sound_command_w ) |
| 35 | 35 | { |
| 36 | 36 | soundlatch_w(space, 0, data); |
| 37 | | |
| 37 | | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | static WRITE8_HANDLER( nmi_disable_w ) |
| r10315 | r10316 | |
|---|---|---|
| 595 | 595 | cojag_state *state = machine->driver_data<cojag_state>(); |
| 596 | 596 | /* if a command is still pending, and we haven't maxed out our timer, set a new one */ |
| 597 | 597 | if (state->gpu_command_pending && param < 1000) |
| 598 | timer_set( | |
| 598 | machine->scheduler().timer_set( | |
| 599 | 599 | } |
| 600 | 600 | |
| 601 | 601 | |
| r10315 | r10316 | |
| 610 | 610 | jaguar_gpu_resume(space->machine); |
| 611 | 611 | |
| 612 | 612 | /* start the sync timer going, and note that there is a command pending */ |
| 613 | | |
| 613 | | |
| 614 | 614 | state->gpu_command_pending = 1; |
| 615 | 615 | } |
| 616 | 616 |
| r10315 | r10316 | |
|---|---|---|
| 772 | 772 | // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); |
| 773 | 773 | |
| 774 | 774 | if (!namcoio_read_reset_line(namcoio_1)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 775 | | |
| 775 | | |
| 776 | 776 | |
| 777 | 777 | if (!namcoio_read_reset_line(namcoio_2)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 778 | | |
| 778 | | |
| 779 | 779 | } |
| 780 | 780 | |
| 781 | 781 | static TIMER_CALLBACK( pacnpal_io_run ) |
| r10315 | r10316 | |
| 803 | 803 | // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); |
| 804 | 804 | |
| 805 | 805 | if (!namcoio_read_reset_line(namcoio_1)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 806 | | |
| 806 | | |
| 807 | 807 | |
| 808 | 808 | if (!namcoio_read_reset_line(namcoio_2)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 809 | | |
| 809 | | |
| 810 | 810 | } |
| 811 | 811 | |
| 812 | 812 | static TIMER_CALLBACK( phozon_io_run ) |
| r10315 | r10316 | |
| 834 | 834 | // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); |
| 835 | 835 | |
| 836 | 836 | if (!namcoio_read_reset_line(namcoio_1)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 837 | | |
| 837 | | |
| 838 | 838 | |
| 839 | 839 | if (!namcoio_read_reset_line(namcoio_2)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 840 | | |
| 840 | | |
| 841 | 841 | } |
| 842 | 842 | |
| 843 | 843 | static TIMER_CALLBACK( mappy_io_run ) |
| r10315 | r10316 | |
| 865 | 865 | // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); |
| 866 | 866 | |
| 867 | 867 | if (!namcoio_read_reset_line(namcoio_1)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 868 | | |
| 868 | | |
| 869 | 869 | |
| 870 | 870 | if (!namcoio_read_reset_line(namcoio_2)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 871 | | |
| 871 | | |
| 872 | 872 | } |
| 873 | 873 | |
| 874 | 874 |
| r10315 | r10316 | |
|---|---|---|
| 231 | 231 | // reset the DAC to centerline |
| 232 | 232 | //dac_signed_data_w(machine->device("dac"), 0x80); |
| 233 | 233 | |
| 234 | mk5_2KHz_timer = timer_alloc(m | |
| 234 | mk5_2KHz_timer = machine->scheduler().timer_alloc(FUNC(m | |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | static MACHINE_RESET( aristmk5 ) |
| r10315 | r10316 | |
|---|---|---|
| 414 | 414 | static SOUND_START(equites) |
| 415 | 415 | { |
| 416 | 416 | equites_state *state = machine->driver_data<equites_state>(); |
| 417 | state->nmi_timer = timer_alloc( | |
| 417 | state->nmi_timer = machine->scheduler().timer_alloc(FUNC( | |
| 418 | 418 | |
| 419 | state->adjuster_timer = timer_alloc( | |
| 419 | state->adjuster_timer = machine->scheduler().timer_alloc(FUNC( | |
| 420 | 420 | timer_adjust_periodic(state->adjuster_timer, attotime::from_hz(60), 0, attotime::from_hz(60)); |
| 421 | 421 | } |
| 422 | 422 |
| r10315 | r10316 | |
|---|---|---|
| 692 | 692 | static DRIVER_INIT(ssfindo) |
| 693 | 693 | { |
| 694 | 694 | flashType=0; |
| 695 | PS7500timer0 = timer_alloc(machine, PS7500_Timer0_callback, NULL); | |
| 696 | PS7500timer1 = timer_alloc(machine, PS7500_Timer1_callback, NULL); | |
| 695 | PS7500timer0 = machine->scheduler().timer_alloc(FUNC(PS7500_Timer0_callback)); | |
| 696 | PS7500timer1 = machine->scheduler().timer_alloc(FUNC(PS7500_Timer1_callback)); | |
| 697 | 697 | } |
| 698 | 698 | |
| 699 | 699 | static DRIVER_INIT(ppcar) |
| 700 | 700 | { |
| 701 | 701 | flashType=1; |
| 702 | PS7500timer0 = timer_alloc(machine, PS7500_Timer0_callback, NULL); | |
| 703 | PS7500timer1 = timer_alloc(machine, PS7500_Timer1_callback, NULL); | |
| 702 | PS7500timer0 = machine->scheduler().timer_alloc(FUNC(PS7500_Timer0_callback)); | |
| 703 | PS7500timer1 = machine->scheduler().timer_alloc(FUNC(PS7500_Timer1_callback)); | |
| 704 | 704 | } |
| 705 | 705 | |
| 706 | 706 | GAME( 1999, ssfindo, 0, ssfindo, ssfindo, ssfindo, ROT0, "Icarus", "See See Find Out", GAME_NO_SOUND ) |
| r10315 | r10316 | |
|---|---|---|
| 72 | 72 | if (scanline > 262) |
| 73 | 73 | scanline = 0; |
| 74 | 74 | |
| 75 | timer_set(machine | |
| 75 | machine->scheduler().timer_set(machine | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | |
| r10315 | r10316 | |
| 172 | 172 | { |
| 173 | 173 | set_service_mode(machine, 0); |
| 174 | 174 | |
| 175 | | |
| 175 | | |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 |
| r10315 | r10316 | |
|---|---|---|
| 334 | 334 | xt = x_val * (vis_area.max_x - vis_area.min_x) / 1024 + vis_area.min_x; |
| 335 | 335 | yt = y_val * (vis_area.max_y - vis_area.min_y) / 1024 + vis_area.min_y; |
| 336 | 336 | |
| 337 | | |
| 337 | | |
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | static WRITE_LINE_DEVICE_HANDLER(crtc_vsync) |
| r10315 | r10316 | |
|---|---|---|
| 3756 | 3756 | snd020_hack = 0; |
| 3757 | 3757 | resume_trigger = 0; |
| 3758 | 3758 | |
| 3759 | dmadelay_timer = timer_alloc( | |
| 3759 | dmadelay_timer = machine->scheduler().timer_alloc(FUNC( | |
| 3760 | 3760 | |
| 3761 | 3761 | i = match = 0; |
| 3762 | 3762 | while ((gameDefs[i].cfgport != -1) && (!match)) |
| r10315 | r10316 | |
|---|---|---|
| 139 | 139 | parodius_state *state = space->machine->driver_data<parodius_state>(); |
| 140 | 140 | |
| 141 | 141 | cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, CLEAR_LINE); |
| 142 | | |
| 142 | | |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | /********************************************/ |
| r10315 | r10316 | |
|---|---|---|
| 689 | 689 | state->page[0] = MEM + 0x4000; |
| 690 | 690 | state->page[1] = MEM + 0x6000; |
| 691 | 691 | |
| 692 | state->interleave_timer = timer_alloc( | |
| 692 | state->interleave_timer = machine->scheduler().timer_alloc(F | |
| 693 | 693 | |
| 694 | 694 | state->audiocpu = machine->device<cpu_device>("audiocpu"); |
| 695 | 695 | state->k007121_1 = machine->device("k007121_1"); |
| r10315 | r10316 | |
|---|---|---|
| 422 | 422 | |
| 423 | 423 | /* The time the IRQ line stays high is set just long enough to happen after the NMI - hacky? */ |
| 424 | 424 | cpu_set_input_line(device, 0, ASSERT_LINE); |
| 425 | | |
| 425 | | |
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | static const gfx_layout gpworld_tile_layout = |
| r10315 | r10316 | |
|---|---|---|
| 349 | 349 | static MACHINE_START( tubep ) |
| 350 | 350 | { |
| 351 | 351 | /* Create interrupt timer */ |
| 352 | interrupt_timer = timer_alloc( | |
| 352 | interrupt_timer = machine->scheduler().timer_alloc(FUNC( | |
| 353 | 353 | |
| 354 | 354 | tubep_setup_save_state(machine); |
| 355 | 355 | } |
| r10315 | r10316 | |
| 512 | 512 | static MACHINE_START( rjammer ) |
| 513 | 513 | { |
| 514 | 514 | /* Create interrupt timer */ |
| 515 | interrupt_timer = timer_alloc( | |
| 515 | interrupt_timer = machine->scheduler().timer_alloc(FUNC( | |
| 516 | 516 | |
| 517 | 517 | tubep_setup_save_state(machine); |
| 518 | 518 | } |
| r0 | r10316 | |
|---|---|---|
| 1 | /* Midway's 18 Wheeler hardware, game number 653 | |
| 2 | ||
| 3 | driver todo: | |
| 4 | - discrete sound | |
| 5 | - hook up lamps (and sensors) | |
| 6 | - lots of external artwork | |
| 7 | ||
| 8 | To diagnose game, turn on service mode and: | |
| 9 | - test RAM/ROM, leds, lamps: reset with shifter in neutral | |
| 10 | - test sound and misc input: turn on DSW 7 and reset with shifter in neutral | |
| 11 | - test accelerator: reset with shifter in 1st gear | |
| 12 | - test steering wheel: reset with shifter in 2nd gear | |
| 13 | ||
| 14 | */ | |
| 15 | ||
| 16 | #include "emu.h" | |
| 17 | #include "cpu/z80/z80.h" | |
| 18 | ||
| 19 | #include "18w.lh" | |
| 20 | ||
| 21 | ||
| 22 | static WRITE8_HANDLER( mw18w_sound0_w ) | |
| 23 | { | |
| 24 | // sound write (airhorn, brake, crash) plus motor speed for backdrop, and coin counter | |
| 25 | coin_counter_w(space->machine, 0, data&1); | |
| 26 | } | |
| 27 | ||
| 28 | static WRITE8_HANDLER( mw18w_sound1_w ) | |
| 29 | { | |
| 30 | // sound write (bell, engine) plus lamp dim control for backdrop lamp | |
| 31 | ; | |
| 32 | } | |
| 33 | ||
| 34 | static WRITE8_HANDLER( mw18w_lamps_w ) | |
| 35 | { | |
| 36 | ; | |
| 37 | } | |
| 38 | ||
| 39 | static WRITE8_HANDLER( mw18w_led_display_w ) | |
| 40 | { | |
| 41 | // d0-3: 7448 (BCD to LED segment) | |
| 42 | const UINT8 ls48_map[16] = | |
| 43 | { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0x00 }; | |
| 44 | ||
| 45 | // d4-7: 7442 (BCD to decimal) -> pick digit panel | |
| 46 | if ((data&0xf0)>0x90) return; | |
| 47 | output_set_digit_value(data>>4, ls48_map[data&0xf]); | |
| 48 | } | |
| 49 | ||
| 50 | static WRITE8_HANDLER( mw18w_irq0_clear_w ) | |
| 51 | { | |
| 52 | cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE); | |
| 53 | } | |
| 54 | ||
| 55 | static CUSTOM_INPUT( mw18w_sensors_r ) | |
| 56 | { | |
| 57 | // d7: off road | |
| 58 | // d6: in dock area | |
| 59 | return 0xff; | |
| 60 | } | |
| 61 | ||
| 62 | ||
| 63 | ||
| 64 | ||
| 65 | static ADDRESS_MAP_START( mw18w_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 66 | AM_RANGE(0x0000, 0x1fff) AM_ROM | |
| 67 | AM_RANGE(0x2000, 0x23ff) AM_RAM | |
| 68 | ADDRESS_MAP_END | |
| 69 | ||
| 70 | static ADDRESS_MAP_START( mw18w_portmap, ADDRESS_SPACE_IO, 8 ) | |
| 71 | ADDRESS_MAP_UNMAP_HIGH | |
| 72 | ADDRESS_MAP_GLOBAL_MASK(0xff) | |
| 73 | AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_WRITE(mw18w_sound0_w) | |
| 74 | AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") AM_WRITE(mw18w_sound1_w) | |
| 75 | AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_WRITE(mw18w_lamps_w) | |
| 76 | AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW") AM_WRITE(mw18w_led_display_w) | |
| 77 | AM_RANGE(0x04, 0x04) AM_READ_PORT("IN4") | |
| 78 | AM_RANGE(0x06, 0x06) AM_WRITE(watchdog_reset_w) | |
| 79 | AM_RANGE(0x07, 0x07) AM_WRITE(mw18w_irq0_clear_w) | |
| 80 | ADDRESS_MAP_END | |
| 81 | ||
| 82 | static const UINT32 mw18w_controller_table[] = | |
| 83 | { | |
| 84 | // same encoder as sspeedr | |
| 85 | 0x3f, 0x3e, 0x3c, 0x3d, 0x39, 0x38, 0x3a, 0x3b, | |
| 86 | 0x33, 0x32, 0x30, 0x31, 0x35, 0x34, 0x36, 0x37, | |
| 87 | 0x27, 0x26, 0x24, 0x25, 0x21, 0x20, 0x22, 0x23, | |
| 88 | 0x2b, 0x2a, 0x28, 0x29, 0x2d, 0x2c, 0x2e, 0x2f, | |
| 89 | 0x0f, 0x0e, 0x0c, 0x0d, 0x09, 0x08, 0x0a, 0x0b, | |
| 90 | 0x03, 0x02, 0x00, 0x01, 0x05, 0x04, 0x06, 0x07, | |
| 91 | 0x17, 0x16, 0x14, 0x15, 0x11, 0x10, 0x12, 0x13, | |
| 92 | 0x1b, 0x1a, 0x18, 0x19, 0x1d, 0x1c, 0x1e, 0x1f | |
| 93 | }; | |
| 94 | ||
| 95 | static INPUT_PORTS_START( mw18w ) | |
| 96 | PORT_START("IN0") | |
| 97 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 98 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 99 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 100 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // left/right sw. | |
| 101 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 102 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 103 | PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(mw18w_sensors_r, NULL) | |
| 104 | ||
| 105 | PORT_START("IN1") | |
| 106 | PORT_BIT( 0x1f, 0x00, IPT_PEDAL ) PORT_REMAP_TABLE(mw18w_controller_table + 0x20) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) // accelerate | |
| 107 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Shifter 1st Gear") | |
| 108 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Shifter 3rd Gear") | |
| 109 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Shifter 2nd Gear") | |
| 110 | ||
| 111 | PORT_START("IN2") | |
| 112 | PORT_BIT( 0x3f, 0x1f, IPT_PADDLE ) PORT_REMAP_TABLE(mw18w_controller_table) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) // steering wheel | |
| 113 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) // brake | |
| 114 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Shifter Reverse") | |
| 115 | ||
| 116 | PORT_START("DSW") | |
| 117 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW:1,2") | |
| 118 | PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) | |
| 119 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) | |
| 120 | PORT_DIPSETTING( 0x03, DEF_STR( 2C_3C ) ) | |
| 121 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) | |
| 122 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Game_Time ) ) PORT_DIPLOCATION("SW:5,6") | |
| 123 | PORT_DIPSETTING( 0x00, "60 seconds" ) | |
| 124 | PORT_DIPSETTING( 0x10, "70 seconds" ) | |
| 125 | PORT_DIPSETTING( 0x20, "80 seconds" ) | |
| 126 | PORT_DIPSETTING( 0x30, "90 seconds" ) | |
| 127 | ||
| 128 | PORT_DIPNAME( 0x0c, 0x00, "Extended Time" ) PORT_DIPLOCATION("SW:3,4") | |
| 129 | PORT_DIPSETTING( 0x00, "20 seconds at 4000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x00) // @ 60 seconds | |
| 130 | PORT_DIPSETTING( 0x04, "30 seconds at 8000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x00) | |
| 131 | PORT_DIPSETTING( 0x08, "15 seconds at 8000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x00) | |
| 132 | PORT_DIPSETTING( 0x0c, "30 seconds at 10000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x00) | |
| 133 | PORT_DIPSETTING( 0x00, "20 seconds at 6000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x10) // @ 70 seconds | |
| 134 | PORT_DIPSETTING( 0x04, "30 seconds at 9000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x10) | |
| 135 | PORT_DIPSETTING( 0x08, "20 seconds at 9000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x10) | |
| 136 | PORT_DIPSETTING( 0x0c, "30 seconds at 12000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x10) | |
| 137 | PORT_DIPSETTING( 0x00, "20 seconds at 8000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x20) // @ 80 seconds | |
| 138 | PORT_DIPSETTING( 0x04, "30 seconds at 12000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x20) | |
| 139 | PORT_DIPSETTING( 0x08, "20 seconds at 12000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x20) | |
| 140 | PORT_DIPSETTING( 0x0c, "30 seconds at 16000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x20) | |
| 141 | PORT_DIPSETTING( 0x00, "20 seconds at 10000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x30) // @ 90 seconds | |
| 142 | PORT_DIPSETTING( 0x04, "30 seconds at 15000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x30) | |
| 143 | PORT_DIPSETTING( 0x08, "20 seconds at 15000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x30) | |
| 144 | PORT_DIPSETTING( 0x0c, "30 seconds at 20000" ) PORT_CONDITION("DSW", 0x30, PORTCOND_EQUALS, 0x30) | |
| 145 | ||
| 146 | PORT_DIPNAME( 0x40, 0x40, "I/O Test" ) PORT_DIPLOCATION("SW:7") | |
| 147 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 148 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 149 | PORT_SERVICE_DIPLOC(0x80, IP_ACTIVE_LOW, "SW:8" ) | |
| 150 | ||
| 151 | PORT_START("IN4") | |
| 152 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) // n/c | |
| 153 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) // n/c | |
| 154 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) | |
| 155 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) // for both coin chutes | |
| 156 | PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 157 | INPUT_PORTS_END | |
| 158 | ||
| 159 | ||
| 160 | ||
| 161 | ||
| 162 | static MACHINE_CONFIG_START( mw18w, driver_device ) | |
| 163 | /* basic machine hardware */ | |
| 164 | MCFG_CPU_ADD("maincpu", Z80, XTAL_19_968MHz/8) | |
| 165 | MCFG_CPU_PERIODIC_INT(irq0_line_assert,960.516) // 555 IC | |
| 166 | MCFG_CPU_PROGRAM_MAP(mw18w_map) | |
| 167 | MCFG_CPU_IO_MAP(mw18w_portmap) | |
| 168 | ||
| 169 | /* no video! */ | |
| 170 | ||
| 171 | /* sound hardware */ | |
| 172 | // MCFG_SPEAKER_STANDARD_MONO("mono") | |
| 173 | MACHINE_CONFIG_END | |
| 174 | ||
| 175 | ||
| 176 | ROM_START(18w) | |
| 177 | ROM_REGION(0x10000, "maincpu", 0) | |
| 178 | ROM_LOAD( "18w_b1.rom1", 0x0000, 0x0800, CRC(200c5beb) SHA1(994d67a89f18df9716c5dd4dd60f6e7eeb880f1b)) | |
| 179 | ROM_LOAD( "18w_a2.rom2", 0x0800, 0x0800, CRC(efbadee8) SHA1(834eaf8ca50544123de7529b90b828cf46b1c001)) | |
| 180 | ROM_LOAD( "18w_b3.rom3", 0x1000, 0x0800, CRC(214606f6) SHA1(9a9dc20259b4462661c6be410d98d2be54657a0e)) | |
| 181 | ROM_LOAD( "18w_a4.rom4", 0x1800, 0x0800, CRC(e88ad6a9) SHA1(ac010aa7e0288197ff9342801522623b64dd2a47)) | |
| 182 | ROM_END | |
| 183 | ||
| 184 | ROM_START(18w2) | |
| 185 | ROM_REGION(0x10000, "maincpu", 0) | |
| 186 | ROM_LOAD( "18w_b1.rom1", 0x0000, 0x0800, CRC(cbc0fb2c) SHA1(66b14f0d76baebbd64e8ed107e536ad811d55273)) | |
| 187 | ROM_LOAD( "18w_b2.rom2", 0x0800, 0x0800, CRC(efbadee8) SHA1(834eaf8ca50544123de7529b90b828cf46b1c001)) | |
| 188 | ROM_LOAD( "18w_b3.rom3", 0x1000, 0x0800, CRC(214606f6) SHA1(9a9dc20259b4462661c6be410d98d2be54657a0e)) | |
| 189 | ROM_LOAD( "18w_b4.rom4", 0x1800, 0x0800, CRC(e88ad6a9) SHA1(ac010aa7e0288197ff9342801522623b64dd2a47)) | |
| 190 | ROM_END | |
| 191 | ||
| 192 | ||
| 193 | GAMEL( 1979, 18w, 0, mw18w, mw18w, 0, ROT0, "Midway", "18 Wheeler (set 1)", GAME_NO_SOUND | GAME_NOT_WORKING | GAME_MECHANICAL, layout_18w ) | |
| 194 | GAMEL( 1979, 18w2, 18w, mw18w, mw18w, 0, ROT0, "Midway", "18 Wheeler (set 2)", GAME_NO_SOUND | GAME_NOT_WORKING | GAME_MECHANICAL, layout_18w ) |
| r10315 | r10316 | |
|---|---|---|
| 1661 | 1661 | } |
| 1662 | 1662 | |
| 1663 | 1663 | cpu_set_input_line(device, 0, ASSERT_LINE); |
| 1664 | | |
| 1664 | | |
| 1665 | 1665 | } |
| 1666 | 1666 | |
| 1667 | 1667 |
| r10315 | r10316 | |
|---|---|---|
| 471 | 471 | { |
| 472 | 472 | /* reset the CPU */ |
| 473 | 473 | m_reset = 0; |
| 474 | timer_set( | |
| 474 | m_machine.scheduler().timer_set( | |
| 475 | 475 | } |
| 476 | 476 | |
| 477 | 477 | /* Machine Drivers */ |
| r10315 | r10316 | |
|---|---|---|
| 212 | 212 | vendetta_state *state = space->machine->driver_data<vendetta_state>(); |
| 213 | 213 | cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, CLEAR_LINE); |
| 214 | 214 | |
| 215 | | |
| 215 | | |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | static WRITE8_HANDLER( z80_irq_w ) |
| r10315 | r10316 | |
|---|---|---|
| 1130 | 1130 | |
| 1131 | 1131 | /* if we have a fake i8751 handler, disable the actual 8751, otherwise crank the interleave */ |
| 1132 | 1132 | if (state->i8751_vblank_hook != NULL) |
| 1133 | | |
| 1133 | | |
| 1134 | 1134 | else |
| 1135 | | |
| 1135 | | |
| 1136 | 1136 | |
| 1137 | 1137 | /* configure sprite banks */ |
| 1138 | 1138 | for (i = 0; i < 16; i++) |
| r10315 | r10316 | |
|---|---|---|
| 59 | 59 | state->marineb_active_low_flipscreen = 0; |
| 60 | 60 | |
| 61 | 61 | /* we must start with NMI interrupts disabled */ |
| 62 | | |
| 62 | | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | static MACHINE_RESET( springer ) |
| r10315 | r10316 | |
|---|---|---|
| 363 | 363 | static INTERRUPT_GEN( f3_interrupt2 ) |
| 364 | 364 | { |
| 365 | 365 | cpu_set_input_line(device, 2, HOLD_LINE); // vblank |
| 366 | | |
| 366 | | |
| 367 | 367 | } |
| 368 | 368 | |
| 369 | 369 | static SOUND_RESET( f3 ) |
| r10315 | r10316 | |
|---|---|---|
| 577 | 577 | static MACHINE_START( jpmsys5v ) |
| 578 | 578 | { |
| 579 | 579 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base()); |
| 580 | touch_timer = timer_alloc( | |
| 580 | touch_timer = machine->scheduler().timer_alloc(FUNC( | |
| 581 | 581 | } |
| 582 | 582 | |
| 583 | 583 | static MACHINE_RESET( jpmsys5v ) |
| r10315 | r10316 | |
|---|---|---|
| 582 | 582 | state->audiocpu = machine->device("audiocpu"); |
| 583 | 583 | |
| 584 | 584 | // FIXME |
| 585 | timer_pulse( | |
| 585 | machine->scheduler().timer_pulse( | |
| 586 | 586 | |
| 587 | 587 | MACHINE_START_CALL(champbas); |
| 588 | 588 | } |
| r10315 | r10316 | |
|---|---|---|
| 56 | 56 | static MACHINE_START( m107 ) |
| 57 | 57 | { |
| 58 | 58 | m107_state *state = machine->driver_data<m107_state>(); |
| 59 | state->scanline_timer = timer_alloc(m | |
| 59 | state->scanline_timer = machine->scheduler().timer_alloc(FUNC(m | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | static MACHINE_RESET( m107 ) |
| r10315 | r10316 | |
| 132 | 132 | |
| 133 | 133 | static WRITE16_HANDLER( m107_soundlatch_w ) |
| 134 | 134 | { |
| 135 | | |
| 135 | | |
| 136 | 136 | soundlatch_w(space, 0, data & 0xff); |
| 137 | 137 | // logerror("soundlatch_w %02x\n",data); |
| 138 | 138 | } |
| r10315 | r10316 | |
| 151 | 151 | |
| 152 | 152 | static WRITE16_HANDLER( m107_sound_irq_ack_w ) |
| 153 | 153 | { |
| 154 | | |
| 154 | | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | static WRITE16_HANDLER( m107_sound_status_w ) |
| r10315 | r10316 | |
| 805 | 805 | static void sound_irq(device_t *device, int state) |
| 806 | 806 | { |
| 807 | 807 | if (state) |
| 808 | | |
| 808 | | |
| 809 | 809 | else |
| 810 | | |
| 810 | | |
| 811 | 811 | } |
| 812 | 812 | |
| 813 | 813 | static const ym2151_interface ym2151_config = |
| r10315 | r10316 | |
|---|---|---|
| 80 | 80 | if (scanline >= 262) |
| 81 | 81 | scanline = 16; |
| 82 | 82 | |
| 83 | timer_set(machine | |
| 83 | machine->scheduler().timer_set(machine | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | |
| r10315 | r10316 | |
| 92 | 92 | |
| 93 | 93 | static MACHINE_RESET( cball ) |
| 94 | 94 | { |
| 95 | timer_set(machine | |
| 95 | machine->scheduler().timer_set(machine | |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 |
| r10315 | r10316 | |
|---|---|---|
| 102 | 102 | cpu_set_input_line(state->maincpu, state->irq_level, CLEAR_LINE); |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | static TIMER_CALLBACK( cave_vblank_start ) | |
| 106 | { | |
| 107 | cave_state *state = machine->driver_data<cave_state>(); | |
| 108 | state->vblank_irq = 1; | |
| 109 | update_irq_state(machine); | |
| 110 | cave_get_sprite_info(machine); | |
| 111 | state->agallet_vblank_irq = 1; | |
| 112 | } | |
| 113 | ||
| 114 | 105 | static TIMER_CALLBACK( cave_vblank_end ) |
| 115 | 106 | { |
| 116 | 107 | cave_state *state = machine->driver_data<cave_state>(); |
| r10315 | r10316 | |
| 122 | 113 | state->agallet_vblank_irq = 0; |
| 123 | 114 | } |
| 124 | 115 | |
| 116 | static TIMER_DEVICE_CALLBACK( cave_vblank_start ) | |
| 117 | { | |
| 118 | cave_state *state = timer.machine->driver_data<cave_state>(); | |
| 119 | state->vblank_irq = 1; | |
| 120 | update_irq_state(timer.machine); | |
| 121 | cave_get_sprite_info(timer.machine); | |
| 122 | state->agallet_vblank_irq = 1; | |
| 123 | timer.machine->scheduler().timer_set(attotime::from_usec(2000), FUNC(cave_vblank_end)); | |
| 124 | } | |
| 125 | ||
| 125 | 126 | /* Called once/frame to generate the VBLANK interrupt */ |
| 126 | 127 | static INTERRUPT_GEN( cave_interrupt ) |
| 127 | 128 | { |
| 128 | 129 | cave_state *state = device->machine->driver_data<cave_state>(); |
| 129 | timer_set(device->machine, attotime::from_usec(17376 - state->time_vblank_irq), NULL, 0, cave_vblank_start); | |
| 130 | timer_set(device->machine, attotime::from_usec(17376 - state->time_vblank_irq + 2000), NULL, 0, cave_vblank_end); | |
| 130 | state->int_timer->adjust(attotime::from_usec(17376 - state->time_vblank_irq)); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | /* Called by the YMZ280B to set the IRQ state */ |
| r10315 | r10316 | |
| 1034 | 1034 | |
| 1035 | 1035 | ***************************************************************************/ |
| 1036 | 1036 | |
| 1037 | ||
| 1038 | static ADDRESS_MAP_START( oki_map, 0, 8 ) | |
| 1039 | AM_RANGE(0x00000, 0x1ffff) AM_ROMBANK("bank3") | |
| 1040 | AM_RANGE(0x20000, 0x3ffff) AM_ROMBANK("bank4") | |
| 1041 | ADDRESS_MAP_END | |
| 1042 | ||
| 1043 | static ADDRESS_MAP_START( oki2_map, 0, 8 ) | |
| 1044 | AM_RANGE(0x00000, 0x1ffff) AM_ROMBANK("bank5") | |
| 1045 | AM_RANGE(0x20000, 0x3ffff) AM_ROMBANK("bank6") | |
| 1046 | ADDRESS_MAP_END | |
| 1047 | ||
| 1048 | ||
| 1037 | 1049 | /*************************************************************************** |
| 1038 | 1050 | Hotdog Storm |
| 1039 | 1051 | ***************************************************************************/ |
| r10315 | r10316 | |
| 1048 | 1060 | |
| 1049 | 1061 | static WRITE8_HANDLER( hotdogst_okibank_w ) |
| 1050 | 1062 | { |
| 1051 | UINT8 *RAM = space->machine->region("oki")->base(); | |
| 1052 | 1063 | int bank1 = (data >> 0) & 0x3; |
| 1053 | 1064 | int bank2 = (data >> 4) & 0x3; |
| 1054 | memcpy(RAM + 0x20000 * 0, RAM + 0x40000 + 0x20000 * bank1, 0x20000); | |
| 1055 | memcpy(RAM + 0x20000 * 1, RAM + 0x40000 + 0x20000 * bank2, 0x20000); | |
| 1065 | memory_set_bank(space->machine, "bank3", bank1); | |
| 1066 | memory_set_bank(space->machine, "bank4", bank2); | |
| 1056 | 1067 | } |
| 1057 | 1068 | |
| 1058 | 1069 | static ADDRESS_MAP_START( hotdogst_sound_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r10315 | r10316 | |
| 1117 | 1128 | |
| 1118 | 1129 | static WRITE8_HANDLER( metmqstr_okibank0_w ) |
| 1119 | 1130 | { |
| 1120 | UINT8 *ROM = space->machine->region("oki1")->base(); | |
| 1121 | 1131 | int bank1 = (data >> 0) & 0x7; |
| 1122 | 1132 | int bank2 = (data >> 4) & 0x7; |
| 1123 | memcpy(ROM + 0x20000 * 0, ROM + 0x40000 + 0x20000 * bank1, 0x20000); | |
| 1124 | memcpy(ROM + 0x20000 * 1, ROM + 0x40000 + 0x20000 * bank2, 0x20000); | |
| 1133 | memory_set_bank(space->machine, "bank3", bank1); | |
| 1134 | memory_set_bank(space->machine, "bank4", bank2); | |
| 1125 | 1135 | } |
| 1126 | 1136 | |
| 1127 | 1137 | static WRITE8_HANDLER( metmqstr_okibank1_w ) |
| 1128 | 1138 | { |
| 1129 | UINT8 *ROM = space->machine->region("oki2")->base(); | |
| 1130 | 1139 | int bank1 = (data >> 0) & 0x7; |
| 1131 | 1140 | int bank2 = (data >> 4) & 0x7; |
| 1132 | memcpy(ROM + 0x20000 * 0, ROM + 0x40000 + 0x20000 * bank1, 0x20000); | |
| 1133 | memcpy(ROM + 0x20000 * 1, ROM + 0x40000 + 0x20000 * bank2, 0x20000); | |
| 1141 | memory_set_bank(space->machine, "bank5", bank1); | |
| 1142 | memory_set_bank(space->machine, "bank6", bank2); | |
| 1134 | 1143 | } |
| 1135 | 1144 | |
| 1136 | 1145 | static ADDRESS_MAP_START( metmqstr_sound_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r10315 | r10316 | |
| 1211 | 1220 | |
| 1212 | 1221 | static WRITE8_HANDLER( sailormn_okibank0_w ) |
| 1213 | 1222 | { |
| 1214 | UINT8 *RAM = space->machine->region("oki1")->base(); | |
| 1215 | 1223 | int bank1 = (data >> 0) & 0xf; |
| 1216 | 1224 | int bank2 = (data >> 4) & 0xf; |
| 1217 | memcpy(RAM + 0x20000 * 0, RAM + 0x40000 + 0x20000 * bank1, 0x20000); | |
| 1218 | memcpy(RAM + 0x20000 * 1, RAM + 0x40000 + 0x20000 * bank2, 0x20000); | |
| 1225 | memory_set_bank(space->machine, "bank3", bank1); | |
| 1226 | memory_set_bank(space->machine, "bank4", bank2); | |
| 1219 | 1227 | } |
| 1220 | 1228 | |
| 1221 | 1229 | static WRITE8_HANDLER( sailormn_okibank1_w ) |
| 1222 | 1230 | { |
| 1223 | UINT8 *RAM = space->machine->region("oki2")->base(); | |
| 1224 | 1231 | int bank1 = (data >> 0) & 0xf; |
| 1225 | 1232 | int bank2 = (data >> 4) & 0xf; |
| 1226 | memcpy(RAM + 0x20000 * 0, RAM + 0x40000 + 0x20000 * bank1, 0x20000); | |
| 1227 | memcpy(RAM + 0x20000 * 1, RAM + 0x40000 + 0x20000 * bank2, 0x20000); | |
| 1233 | memory_set_bank(space->machine, "bank5", bank1); | |
| 1234 | memory_set_bank(space->machine, "bank6", bank2); | |
| 1228 | 1235 | } |
| 1229 | 1236 | |
| 1230 | 1237 | static ADDRESS_MAP_START( sailormn_sound_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r10315 | r10316 | |
| 1859 | 1866 | MCFG_MACHINE_RESET(cave) |
| 1860 | 1867 | MCFG_EEPROM_93C46_ADD("eeprom") |
| 1861 | 1868 | |
| 1869 | MCFG_TIMER_ADD("int_timer", cave_vblank_start) | |
| 1870 | ||
| 1862 | 1871 | /* video hardware */ |
| 1863 | 1872 | MCFG_SCREEN_ADD("screen", RASTER) |
| 1864 | 1873 | MCFG_SCREEN_REFRESH_RATE(15625/271.5) |
| r10315 | r10316 | |
| 1900 | 1909 | MCFG_MACHINE_RESET(cave) |
| 1901 | 1910 | MCFG_EEPROM_93C46_ADD("eeprom") |
| 1902 | 1911 | |
| 1912 | MCFG_TIMER_ADD("int_timer", cave_vblank_start) | |
| 1913 | ||
| 1903 | 1914 | /* video hardware */ |
| 1904 | 1915 | MCFG_SCREEN_ADD("screen", RASTER) |
| 1905 | 1916 | MCFG_SCREEN_REFRESH_RATE(15625/271.5) |
| r10315 | r10316 | |
| 1945 | 1956 | MCFG_MACHINE_RESET(cave) |
| 1946 | 1957 | MCFG_EEPROM_93C46_ADD("eeprom") |
| 1947 | 1958 | |
| 1959 | MCFG_TIMER_ADD("int_timer", cave_vblank_start) | |
| 1960 | ||
| 1948 | 1961 | /* video hardware */ |
| 1949 | 1962 | MCFG_SCREEN_ADD("screen", RASTER) |
| 1950 | 1963 | MCFG_SCREEN_REFRESH_RATE(15625/271.5) |
| r10315 | r10316 | |
| 1990 | 2003 | MCFG_MACHINE_RESET(cave) |
| 1991 | 2004 | MCFG_EEPROM_93C46_ADD("eeprom") |
| 1992 | 2005 | |
| 2006 | MCFG_TIMER_ADD("int_timer", cave_vblank_start) | |
| 2007 | ||
| 1993 | 2008 | /* video hardware */ |
| 1994 | 2009 | MCFG_SCREEN_ADD("screen", RASTER) |
| 1995 | 2010 | MCFG_SCREEN_REFRESH_RATE(15625/271.5) |
| r10315 | r10316 | |
| 2029 | 2044 | MCFG_MACHINE_START(cave) |
| 2030 | 2045 | MCFG_MACHINE_RESET(cave) |
| 2031 | 2046 | |
| 2047 | MCFG_TIMER_ADD("int_timer", cave_vblank_start) | |
| 2048 | ||
| 2032 | 2049 | /* video hardware */ |
| 2033 | 2050 | MCFG_SCREEN_ADD("screen", RASTER) |
| 2034 | 2051 | MCFG_SCREEN_REFRESH_RATE(15625/271.5) |
| r10315 | r10316 | |
| 2069 | 2086 | MCFG_MACHINE_RESET(cave) |
| 2070 | 2087 | MCFG_EEPROM_93C46_ADD("eeprom") |
| 2071 | 2088 | |
| 2089 | MCFG_TIMER_ADD("int_timer", cave_vblank_start) | |
| 2090 | ||
| 2072 | 2091 | /* video hardware */ |
| 2073 | 2092 | MCFG_SCREEN_ADD("screen", RASTER) |
| 2074 | 2093 | MCFG_SCREEN_REFRESH_RATE(15625/271.5) |
| r10315 | r10316 | |
| 2112 | 2131 | MCFG_MACHINE_RESET(cave) |
| 2113 | 2132 | MCFG_EEPROM_93C46_ADD("eeprom") |
| 2114 | 2133 | |
| 2134 | MCFG_TIMER_ADD("int_timer", cave_vblank_start) | |
| 2135 | ||
| 2115 | 2136 | /* video hardware */ |
| 2116 | 2137 | MCFG_SCREEN_ADD("screen", RASTER) |
| 2117 | 2138 | MCFG_SCREEN_REFRESH_RATE(15625/271.5) |
| r10315 | r10316 | |
| 2144 | 2165 | MCFG_OKIM6295_ADD("oki", XTAL_1_056MHz, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified |
| 2145 | 2166 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 2146 | 2167 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 2168 | MCFG_DEVICE_ADDRESS_MAP(0, oki_map) | |
| 2147 | 2169 | MACHINE_CONFIG_END |
| 2148 | 2170 | |
| 2149 | 2171 | |
| r10315 | r10316 | |
| 2162 | 2184 | MCFG_MACHINE_RESET(cave) |
| 2163 | 2185 | MCFG_EEPROM_ADD("eeprom", eeprom_interface_93C46_8bit) |
| 2164 | 2186 | |
| 2187 | MCFG_TIMER_ADD("int_timer", cave_vblank_start) | |
| 2188 | ||
| 2165 | 2189 | /* video hardware */ |
| 2166 | 2190 | MCFG_SCREEN_ADD("screen", RASTER) |
| 2167 | 2191 | MCFG_SCREEN_REFRESH_RATE(15625/271.5) |
| r10315 | r10316 | |
| 2215 | 2239 | MCFG_MACHINE_RESET(cave) |
| 2216 | 2240 | MCFG_EEPROM_93C46_ADD("eeprom") |
| 2217 | 2241 | |
| 2242 | MCFG_TIMER_ADD("int_timer", cave_vblank_start) | |
| 2243 | ||
| 2218 | 2244 | /* video hardware */ |
| 2219 | 2245 | MCFG_SCREEN_ADD("screen", RASTER) |
| 2220 | 2246 | MCFG_SCREEN_REFRESH_RATE(15625/271.5) |
| r10315 | r10316 | |
| 2247 | 2273 | MCFG_OKIM6295_ADD("oki", XTAL_1_056MHz, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified |
| 2248 | 2274 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 2.0) |
| 2249 | 2275 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 2.0) |
| 2276 | MCFG_DEVICE_ADDRESS_MAP(0, oki_map) | |
| 2250 | 2277 | MACHINE_CONFIG_END |
| 2251 | 2278 | |
| 2252 | 2279 | |
| r10315 | r10316 | |
| 2271 | 2298 | MCFG_MACHINE_RESET(cave) /* start with the watchdog armed */ |
| 2272 | 2299 | MCFG_EEPROM_93C46_ADD("eeprom") |
| 2273 | 2300 | |
| 2301 | MCFG_TIMER_ADD("int_timer", cave_vblank_start) | |
| 2302 | ||
| 2274 | 2303 | /* video hardware */ |
| 2275 | 2304 | MCFG_SCREEN_ADD("screen", RASTER) |
| 2276 | 2305 | MCFG_SCREEN_REFRESH_RATE(15625/271.5) |
| r10315 | r10316 | |
| 2297 | 2326 | MCFG_OKIM6295_ADD("oki1", XTAL_32MHz / 16 , OKIM6295_PIN7_HIGH) |
| 2298 | 2327 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 2299 | 2328 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 2329 | MCFG_DEVICE_ADDRESS_MAP(0, oki_map) | |
| 2300 | 2330 | |
| 2301 | 2331 | MCFG_OKIM6295_ADD("oki2", XTAL_32MHz / 16 , OKIM6295_PIN7_HIGH) |
| 2302 | 2332 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 2303 | 2333 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 2334 | MCFG_DEVICE_ADDRESS_MAP(0, oki2_map) | |
| 2304 | 2335 | MACHINE_CONFIG_END |
| 2305 | 2336 | |
| 2306 | 2337 | |
| r10315 | r10316 | |
| 2323 | 2354 | MCFG_MACHINE_RESET(cave) |
| 2324 | 2355 | MCFG_EEPROM_ADD("eeprom", eeprom_interface_93C46_pacslot) |
| 2325 | 2356 | |
| 2357 | MCFG_TIMER_ADD("int_timer", cave_vblank_start) | |
| 2358 | ||
| 2326 | 2359 | /* video hardware */ |
| 2327 | 2360 | MCFG_SCREEN_ADD("screen", RASTER) |
| 2328 | 2361 | MCFG_SCREEN_REFRESH_RATE(15625/271.5) |
| r10315 | r10316 | |
| 2349 | 2382 | MCFG_OKIM6295_ADD("oki2", XTAL_28MHz / 28, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified |
| 2350 | 2383 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 2351 | 2384 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 2352 | ||
| 2353 | 2385 | MACHINE_CONFIG_END |
| 2354 | 2386 | |
| 2355 | 2387 | |
| r10315 | r10316 | |
| 2379 | 2411 | MCFG_MACHINE_RESET(cave) |
| 2380 | 2412 | MCFG_EEPROM_93C46_ADD("eeprom") |
| 2381 | 2413 | |
| 2414 | MCFG_TIMER_ADD("int_timer", cave_vblank_start) | |
| 2415 | ||
| 2382 | 2416 | /* video hardware */ |
| 2383 | 2417 | MCFG_SCREEN_ADD("screen", RASTER) |
| 2384 | 2418 | MCFG_SCREEN_REFRESH_RATE(15625/271.5) |
| r10315 | r10316 | |
| 2441 | 2475 | MCFG_MACHINE_RESET(cave) |
| 2442 | 2476 | MCFG_EEPROM_93C46_ADD("eeprom") |
| 2443 | 2477 | |
| 2478 | MCFG_TIMER_ADD("int_timer", cave_vblank_start) | |
| 2479 | ||
| 2444 | 2480 | /* video hardware */ |
| 2445 | 2481 | MCFG_SCREEN_ADD("screen", RASTER) |
| 2446 | 2482 | MCFG_SCREEN_REFRESH_RATE(15625/271.5) |
| r10315 | r10316 | |
| 2466 | 2502 | MCFG_OKIM6295_ADD("oki1", 2112000, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified |
| 2467 | 2503 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 2468 | 2504 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 2505 | MCFG_DEVICE_ADDRESS_MAP(0, oki_map) | |
| 2469 | 2506 | |
| 2470 | 2507 | MCFG_OKIM6295_ADD("oki2", 2112000, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified |
| 2471 | 2508 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 2472 | 2509 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 2510 | MCFG_DEVICE_ADDRESS_MAP(0, oki2_map) | |
| 2473 | 2511 | MACHINE_CONFIG_END |
| 2474 | 2512 | |
| 2475 | 2513 | |
| r10315 | r10316 | |
| 2492 | 2530 | MCFG_MACHINE_RESET(cave) |
| 2493 | 2531 | MCFG_EEPROM_93C46_ADD("eeprom") |
| 2494 | 2532 | |
| 2533 | MCFG_TIMER_ADD("int_timer", cave_vblank_start) | |
| 2534 | ||
| 2495 | 2535 | /* video hardware */ |
| 2496 | 2536 | MCFG_SCREEN_ADD("screen", RASTER) |
| 2497 | 2537 | MCFG_SCREEN_REFRESH_RATE(15625/271.5) |
| r10315 | r10316 | |
| 2532 | 2572 | MCFG_MACHINE_START(cave) |
| 2533 | 2573 | MCFG_EEPROM_93C46_ADD("eeprom") |
| 2534 | 2574 | |
| 2575 | MCFG_TIMER_ADD("int_timer", cave_vblank_start) | |
| 2576 | ||
| 2535 | 2577 | /* video hardware */ |
| 2536 | 2578 | MCFG_SCREEN_ADD("screen", RASTER) |
| 2537 | 2579 | MCFG_SCREEN_REFRESH_RATE(15625/271.5) |
| r10315 | r10316 | |
| 2694 | 2736 | ROM_LOAD( "bp962a.u65", 0x200000, 0x100000, CRC(135fcf9a) SHA1(2e8c89c2627bbdef160d96724d07883fb2fa1a57) ) \ |
| 2695 | 2737 | ROM_CONTINUE( 0x200000, 0x100000 ) \ |
| 2696 | 2738 | \ |
| 2697 | ROM_REGION( 0x240000, "oki1", 0 ) \ | |
| 2698 | ROM_LOAD( "bp962a.u48", 0x040000, 0x200000, CRC(ae00a1ce) SHA1(5e8c74df0ac77efb3080406870856f958be14f79) ) \ | |
| 2739 | ROM_REGION( 0x200000, "oki1", 0 ) \ | |
| 2740 | ROM_LOAD( "bp962a.u48", 0x000000, 0x200000, CRC(ae00a1ce) SHA1(5e8c74df0ac77efb3080406870856f958be14f79) ) \ | |
| 2699 | 2741 | \ |
| 2700 | ROM_REGION( 0x240000, "oki2", 0 ) \ | |
| 2701 | ROM_LOAD( "bp962a.u47", 0x040000, 0x200000, CRC(6d4e9737) SHA1(81c7ecdfc2d38d0b35e26745866f6672f566f936) ) \ | |
| 2742 | ROM_REGION( 0x200000, "oki2", 0 ) \ | |
| 2743 | ROM_LOAD( "bp962a.u47", 0x000000, 0x200000, CRC(6d4e9737) SHA1(81c7ecdfc2d38d0b35e26745866f6672f566f936) ) \ | |
| 2702 | 2744 | |
| 2703 | 2745 | /* the regions differ only in the EEPROM, hence the macro above - all EEPROMs are Factory Defaulted */ |
| 2704 | 2746 | ROM_START( agallet ) |
| r10315 | r10316 | |
| 3432 | 3474 | ROM_REGION( 0x80000, "layer2", 0 ) /* Layer 2 */ |
| 3433 | 3475 | ROM_LOAD( "mp5u64", 0x00000, 0x80000, CRC(9b26458c) SHA1(acef62422fa3f92e6ca1eba0ee6fb914cd1ee190) ) |
| 3434 | 3476 | |
| 3435 | ROM_REGION( 0xc0000, "oki", 0 ) /* Samples */ | |
| 3436 | /* Leave the 0x40000 bytes addressable by the chip empty */ | |
| 3437 | ROM_LOAD( "mp1u65", 0x40000, 0x80000, CRC(4868be1b) SHA1(32b8234b19fdbe07fa5057fa7965e36807e35e77) ) // 1xxxxxxxxxxxxxxxxxx = 0xFF, 4 x 0x20000 | |
| 3477 | ROM_REGION( 0x80000, "oki", 0 ) /* Samples */ | |
| 3478 | ROM_LOAD( "mp1u65", 0x00000, 0x80000, CRC(4868be1b) SHA1(32b8234b19fdbe07fa5057fa7965e36807e35e77) ) // 1xxxxxxxxxxxxxxxxxx = 0xFF, 4 x 0x20000 | |
| 3438 | 3479 | |
| 3439 | 3480 | ROM_REGION16_BE( 0x80, "eeprom", 0 ) |
| 3440 | 3481 | ROM_LOAD16_WORD( "eeprom-hotdogst.bin", 0x0000, 0x0080, CRC(12b4f934) SHA1(5b28d8fbd78869db78ce49e541a9d65558841966) ) |
| r10315 | r10316 | |
| 3566 | 3607 | ROM_REGION( 0x200000, "layer1", 0 ) \ |
| 3567 | 3608 | ROM_LOAD( "bp943a-0.u63", 0x000000, 0x200000, CRC(c1fed98a) SHA1(c276505f80a49b129862966a19db507f97153e45) ) \ |
| 3568 | 3609 | \ |
| 3569 | ROM_REGION( 0x0c0000, "oki", 0 ) \ | |
| 3570 | ROM_LOAD( "bp943a-4.u64", 0x040000, 0x080000, CRC(3fc7f29a) SHA1(feb21b918243c0a03dfa4a80cc80b86be4f62680) ) \ | |
| 3610 | ROM_REGION( 0x080000, "oki", 0 ) \ | |
| 3611 | ROM_LOAD( "bp943a-4.u64", 0x000000, 0x080000, CRC(3fc7f29a) SHA1(feb21b918243c0a03dfa4a80cc80b86be4f62680) ) \ | |
| 3571 | 3612 | |
| 3572 | 3613 | /* the regions differ only in the EEPROM, hence the macro above - all EEPROMs are Factory Defaulted */ |
| 3573 | 3614 | ROM_START( mazinger ) |
| r10315 | r10316 | |
| 3658 | 3699 | ROM_LOAD( "bp947a.u46", 0x000000, 0x100000, CRC(0f9c906e) SHA1(03872e8be28637df66373bddb04ed91de4f9db75) ) // FIRST AND SECOND HALF IDENTICAL |
| 3659 | 3700 | ROM_CONTINUE( 0x000000, 0x100000 ) |
| 3660 | 3701 | |
| 3661 | ROM_REGION( 0x140000, "oki1", 0 ) /* OKIM6295 #1 Samples */ | |
| 3662 | /* Leave the 0x40000 bytes addressable by the chip empty */ | |
| 3663 | ROM_LOAD( "bp947a.u42", 0x040000, 0x100000, CRC(2ce8ff2a) SHA1(8ef8c5b7d4a0e60c980c2962e75f7977faafa311) ) // FIRST AND SECOND HALF IDENTICAL | |
| 3664 | ROM_CONTINUE( 0x040000, 0x100000 ) | |
| 3702 | ROM_REGION( 0x100000, "oki1", 0 ) /* OKIM6295 #1 Samples */ | |
| 3703 | ROM_LOAD( "bp947a.u42", 0x000000, 0x100000, CRC(2ce8ff2a) SHA1(8ef8c5b7d4a0e60c980c2962e75f7977faafa311) ) // FIRST AND SECOND HALF IDENTICAL | |
| 3704 | ROM_CONTINUE( 0x000000, 0x100000 ) | |
| 3665 | 3705 | |
| 3666 | ROM_REGION( 0x140000, "oki2", 0 ) /* OKIM6295 #2 Samples */ | |
| 3667 | /* Leave the 0x40000 bytes addressable by the chip empty */ | |
| 3668 | ROM_LOAD( "bp947a.u37", 0x040000, 0x100000, CRC(c3077c8f) SHA1(0a76316a81b7de78279b859549eb5161a721ac71) ) // FIRST AND SECOND HALF IDENTICAL | |
| 3669 | ROM_CONTINUE( 0x040000, 0x100000 ) | |
| 3706 | ROM_REGION( 0x100000, "oki2", 0 ) /* OKIM6295 #2 Samples */ | |
| 3707 | ROM_LOAD( "bp947a.u37", 0x000000, 0x100000, CRC(c3077c8f) SHA1(0a76316a81b7de78279b859549eb5161a721ac71) ) // FIRST AND SECOND HALF IDENTICAL | |
| 3708 | ROM_CONTINUE( 0x000000, 0x100000 ) | |
| 3670 | 3709 | ROM_END |
| 3671 | 3710 | |
| 3672 | 3711 | ROM_START( nmaster ) |
| r10315 | r10316 | |
| 3697 | 3736 | ROM_LOAD( "bp947a.u46", 0x000000, 0x100000, CRC(0f9c906e) SHA1(03872e8be28637df66373bddb04ed91de4f9db75) ) // FIRST AND SECOND HALF IDENTICAL |
| 3698 | 3737 | ROM_CONTINUE( 0x000000, 0x100000 ) |
| 3699 | 3738 | |
| 3700 | ROM_REGION( 0x140000, "oki1", 0 ) /* OKIM6295 #1 Samples */ | |
| 3701 | /* Leave the 0x40000 bytes addressable by the chip empty */ | |
| 3702 | ROM_LOAD( "bp947a.u42", 0x040000, 0x100000, CRC(2ce8ff2a) SHA1(8ef8c5b7d4a0e60c980c2962e75f7977faafa311) ) // FIRST AND SECOND HALF IDENTICAL | |
| 3703 | ROM_CONTINUE( 0x040000, 0x100000 ) | |
| 3739 | ROM_REGION( 0x100000, "oki1", 0 ) /* OKIM6295 #1 Samples */ | |
| 3740 | ROM_LOAD( "bp947a.u42", 0x000000, 0x100000, CRC(2ce8ff2a) SHA1(8ef8c5b7d4a0e60c980c2962e75f7977faafa311) ) // FIRST AND SECOND HALF IDENTICAL | |
| 3741 | ROM_CONTINUE( 0x000000, 0x100000 ) | |
| 3704 | 3742 | |
| 3705 | ROM_REGION( 0x140000, "oki2", 0 ) /* OKIM6295 #2 Samples */ | |
| 3706 | /* Leave the 0x40000 bytes addressable by the chip empty */ | |
| 3707 | ROM_LOAD( "bp947a.u37", 0x040000, 0x100000, CRC(c3077c8f) SHA1(0a76316a81b7de78279b859549eb5161a721ac71) ) // FIRST AND SECOND HALF IDENTICAL | |
| 3708 | ROM_CONTINUE( 0x040000, 0x100000 ) | |
| 3743 | ROM_REGION( 0x100000, "oki2", 0 ) /* OKIM6295 #2 Samples */ | |
| 3744 | ROM_LOAD( "bp947a.u37", 0x000000, 0x100000, CRC(c3077c8f) SHA1(0a76316a81b7de78279b859549eb5161a721ac71) ) // FIRST AND SECOND HALF IDENTICAL | |
| 3745 | ROM_CONTINUE( 0x000000, 0x100000 ) | |
| 3709 | 3746 | ROM_END |
| 3710 | 3747 | |
| 3711 | 3748 | |
| r10315 | r10316 | |
| 4091 | 4128 | ROM_LOAD( "bpsm.u63", 0xe00000, 0x100000, CRC(d57a56b4) SHA1(e039b336887b66eba4e0630a3cb04cbd8fe14073) ) \ |
| 4092 | 4129 | ROM_CONTINUE( 0xe00000, 0x100000 ) \ |
| 4093 | 4130 | \ |
| 4094 | ROM_REGION( 0x240000, "oki1", 0 ) \ | |
| 4095 | ROM_LOAD( "bpsm.u48", 0x040000, 0x200000, CRC(498e4ed1) SHA1(28d45a41702d9e5af4e214c1800b2e513ec84d51) ) \ | |
| 4131 | ROM_REGION( 0x200000, "oki1", 0 ) \ | |
| 4132 | ROM_LOAD( "bpsm.u48", 0x000000, 0x200000, CRC(498e4ed1) SHA1(28d45a41702d9e5af4e214c1800b2e513ec84d51) ) \ | |
| 4096 | 4133 | \ |
| 4097 | ROM_REGION( 0x240000, "oki2", 0 ) \ | |
| 4098 | ROM_LOAD( "bpsm.u47", 0x040000, 0x080000, CRC(0f2901b9) SHA1(ebd3e9e39e8d2bc91688dac19b99548a28b4733c) ) \ | |
| 4099 | ROM_RELOAD( 0x0c0000, 0x080000 ) \ | |
| 4100 | ROM_RELOAD( 0x140000, 0x080000 ) \ | |
| 4101 | ROM_RELOAD( 0x1c0000, 0x080000 ) \ | |
| 4134 | ROM_REGION( 0x200000, "oki2", 0 ) \ | |
| 4135 | ROM_LOAD( "bpsm.u47", 0x000000, 0x080000, CRC(0f2901b9) SHA1(ebd3e9e39e8d2bc91688dac19b99548a28b4733c) ) \ | |
| 4136 | ROM_RELOAD( 0x080000, 0x080000 ) \ | |
| 4137 | ROM_RELOAD( 0x100000, 0x080000 ) \ | |
| 4138 | ROM_RELOAD( 0x180000, 0x080000 ) \ | |
| 4102 | 4139 | |
| 4103 | 4140 | /* the regions differ only in the EEPROM, hence the macro above - all EEPROMs are Factory Defaulted */ |
| 4104 | 4141 | ROM_START( sailormn ) |
| r10315 | r10316 | |
| 4176 | 4213 | ROM_LOAD( "bpsm.u63", 0xe00000, 0x100000, CRC(d57a56b4) SHA1(e039b336887b66eba4e0630a3cb04cbd8fe14073) ) \ |
| 4177 | 4214 | ROM_CONTINUE( 0xe00000, 0x100000 ) \ |
| 4178 | 4215 | \ |
| 4179 | ROM_REGION( 0x240000, "oki1", 0 ) \ | |
| 4180 | ROM_LOAD( "bpsm.u48", 0x040000, 0x200000, CRC(498e4ed1) SHA1(28d45a41702d9e5af4e214c1800b2e513ec84d51) ) \ | |
| 4216 | ROM_REGION( 0x200000, "oki1", 0 ) \ | |
| 4217 | ROM_LOAD( "bpsm.u48", 0x000000, 0x200000, CRC(498e4ed1) SHA1(28d45a41702d9e5af4e214c1800b2e513ec84d51) ) \ | |
| 4181 | 4218 | \ |
| 4182 | ROM_REGION( 0x240000, "oki2", 0 ) \ | |
| 4183 | ROM_LOAD( "bpsm.u47", 0x040000, 0x080000, CRC(0f2901b9) SHA1(ebd3e9e39e8d2bc91688dac19b99548a28b4733c) ) \ | |
| 4184 | ROM_RELOAD( 0x0c0000, 0x080000 ) \ | |
| 4185 | ROM_RELOAD( 0x140000, 0x080000 ) \ | |
| 4186 | ROM_RELOAD( 0x1c0000, 0x080000 ) \ | |
| 4219 | ROM_REGION( 0x200000, "oki2", 0 ) \ | |
| 4220 | ROM_LOAD( "bpsm.u47", 0x000000, 0x080000, CRC(0f2901b9) SHA1(ebd3e9e39e8d2bc91688dac19b99548a28b4733c) ) \ | |
| 4221 | ROM_RELOAD( 0x080000, 0x080000 ) \ | |
| 4222 | ROM_RELOAD( 0x100000, 0x080000 ) \ | |
| 4223 | ROM_RELOAD( 0x180000, 0x080000 ) \ | |
| 4187 | 4224 | |
| 4188 | 4225 | /* the regions differ only in the EEPROM, hence the macro above - all EEPROMs are Factory Defaulted */ |
| 4189 | 4226 | ROM_START( sailormno ) |
| r10315 | r10316 | |
| 4367 | 4404 | memory_configure_bank(machine, "bank1", 0, 0x02, &ROM[0x00000], 0x4000); |
| 4368 | 4405 | memory_configure_bank(machine, "bank1", 2, 0x1e, &ROM[0x10000], 0x4000); |
| 4369 | 4406 | |
| 4407 | ROM = machine->region("oki1")->base(); | |
| 4408 | memory_configure_bank(machine, "bank3", 0, 0x10, &ROM[0x00000], 0x20000); | |
| 4409 | memory_configure_bank(machine, "bank4", 0, 0x10, &ROM[0x00000], 0x20000); | |
| 4410 | ||
| 4411 | ROM = machine->region("oki2")->base(); | |
| 4412 | memory_configure_bank(machine, "bank5", 0, 0x10, &ROM[0x00000], 0x20000); | |
| 4413 | memory_configure_bank(machine, "bank6", 0, 0x10, &ROM[0x00000], 0x20000); | |
| 4414 | ||
| 4370 | 4415 | sailormn_unpack_tiles(machine, "layer2"); |
| 4371 | 4416 | |
| 4372 | 4417 | unpack_sprites(machine); |
| r10315 | r10316 | |
| 4458 | 4503 | memory_configure_bank(machine, "bank2", 0, 0x2, &ROM[0x00000], 0x4000); |
| 4459 | 4504 | memory_configure_bank(machine, "bank2", 2, 0xe, &ROM[0x10000], 0x4000); |
| 4460 | 4505 | |
| 4506 | ROM = machine->region("oki")->base(); | |
| 4507 | memory_configure_bank(machine, "bank3", 0, 4, &ROM[0x00000], 0x20000); | |
| 4508 | memory_configure_bank(machine, "bank4", 0, 4, &ROM[0x00000], 0x20000); | |
| 4509 | ||
| 4461 | 4510 | unpack_sprites(machine); |
| 4462 | 4511 | state->spritetype[0] = 2; // Normal sprites with different position handling |
| 4463 | 4512 | state->time_vblank_irq = 2000; /**/ |
| r10315 | r10316 | |
| 4476 | 4525 | memory_configure_bank(machine, "bank2", 0, 2, &ROM[0x00000], 0x4000); |
| 4477 | 4526 | memory_configure_bank(machine, "bank2", 2, 6, &ROM[0x10000], 0x4000); |
| 4478 | 4527 | |
| 4528 | ROM = machine->region("oki")->base(); | |
| 4529 | memory_configure_bank(machine, "bank3", 0, 4, &ROM[0x00000], 0x20000); | |
| 4530 | memory_configure_bank(machine, "bank4", 0, 4, &ROM[0x00000], 0x20000); | |
| 4531 | ||
| 4479 | 4532 | /* decrypt sprites */ |
| 4480 | 4533 | buffer = auto_alloc_array(machine, UINT8, len); |
| 4481 | 4534 | { |
| r10315 | r10316 | |
| 4506 | 4559 | memory_configure_bank(machine, "bank1", 0, 0x2, &ROM[0x00000], 0x4000); |
| 4507 | 4560 | memory_configure_bank(machine, "bank1", 2, 0xe, &ROM[0x10000], 0x4000); |
| 4508 | 4561 | |
| 4562 | ROM = machine->region("oki1")->base(); | |
| 4563 | memory_configure_bank(machine, "bank3", 0, 8, &ROM[0x00000], 0x20000); | |
| 4564 | memory_configure_bank(machine, "bank4", 0, 8, &ROM[0x00000], 0x20000); | |
| 4565 | ||
| 4566 | ROM = machine->region("oki2")->base(); | |
| 4567 | memory_configure_bank(machine, "bank5", 0, 8, &ROM[0x00000], 0x20000); | |
| 4568 | memory_configure_bank(machine, "bank6", 0, 8, &ROM[0x00000], 0x20000); | |
| 4569 | ||
| 4509 | 4570 | unpack_sprites(machine); |
| 4510 | 4571 | state->spritetype[0] = 2; // Normal sprites with different position handling |
| 4511 | 4572 | state->kludge = 3; |
| r10315 | r10316 | |
| 4575 | 4636 | memory_configure_bank(machine, "bank1", 0, 0x02, &ROM[0x00000], 0x4000); |
| 4576 | 4637 | memory_configure_bank(machine, "bank1", 2, 0x1e, &ROM[0x10000], 0x4000); |
| 4577 | 4638 | |
| 4639 | ROM = machine->region("oki1")->base(); | |
| 4640 | memory_configure_bank(machine, "bank3", 0, 0x10, &ROM[0x00000], 0x20000); | |
| 4641 | memory_configure_bank(machine, "bank4", 0, 0x10, &ROM[0x00000], 0x20000); | |
| 4642 | ||
| 4643 | ROM = machine->region("oki2")->base(); | |
| 4644 | memory_configure_bank(machine, "bank5", 0, 0x10, &ROM[0x00000], 0x20000); | |
| 4645 | memory_configure_bank(machine, "bank6", 0, 0x10, &ROM[0x00000], 0x20000); | |
| 4646 | ||
| 4578 | 4647 | /* decrypt sprites */ |
| 4579 | 4648 | buffer = auto_alloc_array(machine, UINT8, len); |
| 4580 | 4649 | { |
| r10315 | r10316 | |
| 4645 | 4714 | |
| 4646 | 4715 | ***************************************************************************/ |
| 4647 | 4716 | |
| 4648 | GAME( 1994, pwrinst2, 0, pwrinst2, metmqstr, pwrinst2, ROT0, "Atlus", "Power Instinct 2 (US, Ver. 94/04/08)", 0 ) | |
| 4649 | GAME( 1994, pwrinst2j, pwrinst2, pwrinst2, metmqstr, pwrinst2j,ROT0, "Atlus", "Gouketsuji Ichizoku 2 (Japan, Ver. 94/04/08)", 0 ) | |
| 4717 | GAME( 1994, pwrinst2, 0, pwrinst2, metmqstr, pwrinst2, ROT0, "Atlus", "Power Instinct 2 (US, Ver. 94/04/08)", GAME_SUPPORTS_SAVE ) | |
| 4718 | GAME( 1994, pwrinst2j, pwrinst2, pwrinst2, metmqstr, pwrinst2j,ROT0, "Atlus", "Gouketsuji Ichizoku 2 (Japan, Ver. 94/04/08)", GAME_SUPPORTS_SAVE ) | |
| 4650 | 4719 | |
| 4651 | 4720 | // The EEPROM determines the region, program roms are the same between sets |
| 4652 | GAME( 1994, mazinger, 0, mazinger, cave, mazinger, ROT90, "Banpresto / Dynamic Pl. Toei Animation", "Mazinger Z (World)", 0 ) | |
| 4653 | GAME( 1994, mazingerj, mazinger, mazinger, cave, mazinger, ROT90, "Banpresto / Dynamic Pl. Toei Animation", "Mazinger Z (Japan)", 0 ) | |
| 4721 | GAME( 1994, mazinger, 0, mazinger, cave, mazinger, ROT90, "Banpresto / Dynamic Pl. Toei Animation", "Mazinger Z (World)", GAME_SUPPORTS_SAVE ) | |
| 4722 | GAME( 1994, mazingerj, mazinger, mazinger, cave, mazinger, ROT90, "Banpresto / Dynamic Pl. Toei Animation", "Mazinger Z (Japan)", GAME_SUPPORTS_SAVE ) | |
| 4654 | 4723 | |
| 4655 | GAME( 1995, donpachi, 0, donpachi, cave, donpachi, ROT270, "Cave (Atlus license)", "DonPachi (US)", 0 ) | |
| 4656 | GAME( 1995, donpachij, donpachi, donpachi, cave, donpachi, ROT270, "Cave (Atlus license)", "DonPachi (Japan)", 0 ) | |
| 4657 | GAME( 1995, donpachikr, donpachi, donpachi, cave, donpachi, ROT270, "Cave (Atlus license)", "DonPachi (Korea)", 0 ) | |
| 4658 | GAME( 1995, donpachihk, donpachi, donpachi, cave, donpachi, ROT270, "Cave (Atlus license)", "DonPachi (Hong Kong)", 0 ) | |
| 4724 | GAME( 1995, donpachi, 0, donpachi, cave, donpachi, ROT270, "Cave (Atlus license)", "DonPachi (US)", GAME_SUPPORTS_SAVE ) | |
| 4725 | GAME( 1995, donpachij, donpachi, donpachi, cave, donpachi, ROT270, "Cave (Atlus license)", "DonPachi (Japan)", GAME_SUPPORTS_SAVE ) | |
| 4726 | GAME( 1995, donpachikr, donpachi, donpachi, cave, donpachi, ROT270, "Cave (Atlus license)", "DonPachi (Korea)", GAME_SUPPORTS_SAVE ) | |
| 4727 | GAME( 1995, donpachihk, donpachi, donpachi, cave, donpachi, ROT270, "Cave (Atlus license)", "DonPachi (Hong Kong)", GAME_SUPPORTS_SAVE ) | |
| 4659 | 4728 | |
| 4660 | GAME( 1995, metmqstr, 0, metmqstr, metmqstr, metmqstr, ROT0, "Banpresto / Pandorabox", "Metamoqester (International)", 0 ) | |
| 4661 | GAME( 1995, nmaster, metmqstr, metmqstr, metmqstr, metmqstr, ROT0, "Banpresto / Pandorabox", "Oni - The Ninja Master (Japan)", 0 ) | |
| 4729 | GAME( 1995, metmqstr, 0, metmqstr, metmqstr, metmqstr, ROT0, "Banpresto / Pandorabox", "Metamoqester (International)", GAME_SUPPORTS_SAVE ) | |
| 4730 | GAME( 1995, nmaster, metmqstr, metmqstr, metmqstr, metmqstr, ROT0, "Banpresto / Pandorabox", "Oni - The Ninja Master (Japan)", GAME_SUPPORTS_SAVE ) | |
| 4662 | 4731 | |
| 4663 | GAME( 1995, plegends, 0, pwrinst2, metmqstr, pwrinst2j,ROT0, "Atlus", "Gogetsuji Legends (US, Ver. 95/06/20)", 0 ) | |
| 4664 | GAME( 1995, plegendsj, plegends, pwrinst2, metmqstr, pwrinst2j,ROT0, "Atlus", "Gouketsuji Gaiden - Saikyou Densetsu (Japan, Ver. 95/06/20)", 0 ) | |
| 4732 | GAME( 1995, plegends, 0, pwrinst2, metmqstr, pwrinst2j,ROT0, "Atlus", "Gogetsuji Legends (US, Ver. 95/06/20)", GAME_SUPPORTS_SAVE ) | |
| 4733 | GAME( 1995, plegendsj, plegends, pwrinst2, metmqstr, pwrinst2j,ROT0, "Atlus", "Gouketsuji Gaiden - Saikyou Densetsu (Japan, Ver. 95/06/20)", GAME_SUPPORTS_SAVE ) | |
| 4665 | 4734 | |
| 4666 | 4735 | // The EEPROM determines the region, program roms are the same between sets |
| 4667 | GAME( 1995, sailormn, 0, sailormn, cave, sailormn, ROT0, "Banpresto", "Pretty Soldier Sailor Moon (Ver. 95/03/22B, Europe)", 0 ) | |
| 4668 | GAME( 1995, sailormnu, sailormn, sailormn, cave, sailormn, ROT0, "Banpresto", "Pretty Soldier Sailor Moon (Ver. 95/03/22B, USA)", 0 ) | |
| 4669 | GAME( 1995, sailormnj, sailormn, sailormn, cave, sailormn, ROT0, "Banpresto", "Pretty Soldier Sailor Moon (Ver. 95/03/22B, Japan)", 0 ) | |
| 4670 | GAME( 1995, sailormnk, sailormn, sailormn, cave, sailormn, ROT0, "Banpresto", "Pretty Soldier Sailor Moon (Ver. 95/03/22B, Korea)", 0 ) | |
| 4671 | GAME( 1995, sailormnt, sailormn, sailormn, cave, sailormn, ROT0, "Banpresto", "Pretty Soldier Sailor Moon (Ver. 95/03/22B, Taiwan)", 0 ) | |
| 4672 | GAME( 1995, sailormnh, sailormn, sailormn, cave, sailormn, ROT0, "Banpresto", "Pretty Soldier Sailor Moon (Ver. 95/03/22B, Hong Kong)", 0 ) | |
| 4673 | GAME( 1995, sailormno, sailormn, sailormn, cave, sailormn, ROT0, "Banpresto", "Pretty Soldier Sailor Moon (Ver. 95/03/22, Europe)", 0 ) | |
| 4674 | GAME( 1995, sailormnou, sailormn, sailormn, cave, sailormn, ROT0, "Banpresto", "Pretty Soldier Sailor Moon (Ver. 95/03/22, USA)", 0 ) | |
| 4675 | GAME( 1995, sailormnoj, sailormn, sailormn, cave, sailormn, ROT0, "Banpresto", "Pretty Soldier Sailor Moon (Ver. 95/03/22, Japan)", 0 ) | |
| 4676 | GAME( 1995, sailormnok, sailormn, sailormn, cave, sailormn, ROT0, "Banpresto", "Pretty Soldier Sailor Moon (Ver. 95/03/22, Korea)", 0 ) | |
| 4677 | GAME( 1995, sailormnot, sailormn, sailormn, cave, sailormn, ROT0, "Banpresto", "Pretty Soldier Sailor Moon (Ver. 95/03/22, Taiwan)", 0 ) | |
| 4678 | GAME( 1995, sailormnoh, sailormn, sailormn, cave, sailormn, ROT0, "Banpresto", "Pretty Soldier Sailor Moon (Ver. 95/03/22, Hong Kong)", 0 ) | |
| 4736 | GAME( 1995, sailormn, 0, sailormn, cave, sailormn, ROT0, "Banpresto", "Pretty Soldier Sailor Moon (Ver. 95/03/22B, Europe)", GAME_SUPPORTS_SAVE ) | |
| 4737 | GAME( 1995, sailormnu, sailormn, sailormn, cave, sailormn, ROT0, "Banpresto", "Pretty Soldier Sailor Moon (Ver. 95/03/22B, USA)", GAME_SUPPORTS_SAVE ) | |
| 4738 | GAME( 1995, sailormnj, sailormn, sailormn, cave, sailormn, ROT0, "Banpresto", "Pretty Soldier Sailor Moon (Ver. 95/03/22B, Japan)", GAME_SUPPORTS_SAVE ) | |
| 4739 | GAME( 1995, sailormnk, sailormn, sailormn, cave, sailormn, ROT0, "Banpresto", "Pretty Soldier Sailor Moon (Ver. 95/03/22B, Korea)", GAME_SUPPORTS_SAVE ) | |
| 4740 | GAME( 1995, sailormnt, sailormn, sailormn, cave, sailormn, ROT0, "Banpresto", "Pretty Soldier Sailor Moon (Ver. 95/03/22B, Taiwan)", GAME_SUPPORTS_SAVE ) | |
| 4741 | GAME( 1995, sailormnh, sailormn, sailormn, cave, sailormn, ROT0, "Banpresto", "Pretty Soldier Sailor Moon (Ver. 95/03/22B, Hong Kong)", GAME_SUPPORTS_SAVE ) | |
| 4742 | GAME( 1995, sailormno, sailormn, sailormn, cave, sailormn, ROT0, "Banpresto", "Pretty Soldier Sailor Moon (Ver. 95/03/22, Europe)", GAME_SUPPORTS_SAVE ) | |
| 4743 | GAME( 1995, sailormnou, sailormn, sailormn, cave, sailormn, ROT0, "Banpresto", "Pretty Soldier Sailor Moon (Ver. 95/03/22, USA)", GAME_SUPPORTS_SAVE ) | |
| 4744 | GAME( 1995, sailormnoj, sailormn, sailormn, cave, sailormn, ROT0, "Banpresto", "Pretty Soldier Sailor Moon (Ver. 95/03/22, Japan)", GAME_SUPPORTS_SAVE ) | |
| 4745 | GAME( 1995, sailormnok, sailormn, sailormn, cave, sailormn, ROT0, "Banpresto", "Pretty Soldier Sailor Moon (Ver. 95/03/22, Korea)", GAME_SUPPORTS_SAVE ) | |
| 4746 | GAME( 1995, sailormnot, sailormn, sailormn, cave, sailormn, ROT0, "Banpresto", "Pretty Soldier Sailor Moon (Ver. 95/03/22, Taiwan)", GAME_SUPPORTS_SAVE ) | |
| 4747 | GAME( 1995, sailormnoh, sailormn, sailormn, cave, sailormn, ROT0, "Banpresto", "Pretty Soldier Sailor Moon (Ver. 95/03/22, Hong Kong)", GAME_SUPPORTS_SAVE ) | |
| 4679 | 4748 | |
| 4680 | 4749 | // The EEPROM determines the region, program roms are the same between sets |
| 4681 | GAME( 1996, agallet, 0, sailormn, cave, agallet, ROT270, "Banpresto / Gazelle", "Air Gallet (Europe)", 0 ) | |
| 4682 | GAME( 1996, agalletu, agallet, sailormn, cave, agallet, ROT270, "Banpresto / Gazelle", "Air Gallet (USA)", 0 ) | |
| 4683 | GAME( 1996, agalletj, agallet, sailormn, cave, agallet, ROT270, "Banpresto / Gazelle", "Air Gallet (Japan)", 0 ) | |
| 4684 | GAME( 1996, agalletk, agallet, sailormn, cave, agallet, ROT270, "Banpresto / Gazelle", "Air Gallet (Korea)", 0 ) | |
| 4685 | GAME( 1996, agallett, agallet, sailormn, cave, agallet, ROT270, "Banpresto / Gazelle", "Air Gallet (Taiwan)", 0 ) | |
| 4686 | GAME( 1996, agalleth, agallet, sailormn, cave, agallet, ROT270, "Banpresto / Gazelle", "Air Gallet (Hong Kong)", 0 ) | |
| 4750 | GAME( 1996, agallet, 0, sailormn, cave, agallet, ROT270, "Banpresto / Gazelle", "Air Gallet (Europe)", GAME_SUPPORTS_SAVE ) | |
| 4751 | GAME( 1996, agalletu, agallet, sailormn, cave, agallet, ROT270, "Banpresto / Gazelle", "Air Gallet (USA)", GAME_SUPPORTS_SAVE ) | |
| 4752 | GAME( 1996, agalletj, agallet, sailormn, cave, agallet, ROT270, "Banpresto / Gazelle", "Akuu Gallet (Japan)", GAME_SUPPORTS_SAVE ) | |
| 4753 | GAME( 1996, agalletk, agallet, sailormn, cave, agallet, ROT270, "Banpresto / Gazelle", "Air Gallet (Korea)", GAME_SUPPORTS_SAVE ) | |
| 4754 | GAME( 1996, agallett, agallet, sailormn, cave, agallet, ROT270, "Banpresto / Gazelle", "Air Gallet (Taiwan)", GAME_SUPPORTS_SAVE ) | |
| 4755 | GAME( 1996, agalleth, agallet, sailormn, cave, agallet, ROT270, "Banpresto / Gazelle", "Air Gallet (Hong Kong)", GAME_SUPPORTS_SAVE ) | |
| 4687 | 4756 | |
| 4688 | GAME( 1996, hotdogst, 0, hotdogst, cave, hotdogst, ROT90, "Marble", "Hotdog Storm (International)", | |
| 4757 | GAME( 1996, hotdogst, 0, hotdogst, cave, hotdogst, ROT90, "Marble", "Hotdog Storm (International)", GAME_SUPPORTS_SAVE | |
| 4689 | 4758 | |
| 4690 | GAME( 1996, pacslot, 0, pacslot, pacslot, tjumpman, ROT0, "Namco", "Pac-Slot", | |
| 4759 | GAME( 1996, pacslot, 0, pacslot, pacslot, tjumpman, ROT0, "Namco", "Pac-Slot", GAME_SUPPORTS_SAVE | |
| 4691 | 4760 | |
| 4692 | GAME( 1997, ddonpach, 0, ddonpach, cave, ddonpach, ROT270, "Cave (Atlus license)", "DoDonPachi (International, Master Ver. 97/02/05)", 0 ) | |
| 4693 | GAME( 1997, ddonpachj, ddonpach, ddonpach, cave, ddonpach, ROT270, "Cave (Atlus license)", "DoDonPachi (Japan, Master Ver. 97/02/05)", 0 ) | |
| 4761 | GAME( 1997, ddonpach, 0, ddonpach, cave, ddonpach, ROT270, "Cave (Atlus license)", "DoDonPachi (International, Master Ver. 97/02/05)", GAME_SUPPORTS_SAVE ) | |
| 4762 | GAME( 1997, ddonpachj, ddonpach, ddonpach, cave, ddonpach, ROT270, "Cave (Atlus license)", "DoDonPachi (Japan, Master Ver. 97/02/05)", GAME_SUPPORTS_SAVE ) | |
| 4694 | 4763 | |
| 4695 | GAME( 1998, dfeveron, feversos, dfeveron, cave, dfeveron, ROT270, "Cave (Nihon System license)", "Dangun Feveron (Japan, Ver. 98/09/17)", 0 ) | |
| 4696 | GAME( 1998, feversos, 0, dfeveron, cave, feversos, ROT270, "Cave (Nihon System license)", "Fever SOS (International, Ver. 98/09/25)", 0 ) | |
| 4764 | GAME( 1998, dfeveron, feversos, dfeveron, cave, dfeveron, ROT270, "Cave (Nihon System license)", "Dangun Feveron (Japan, Ver. 98/09/17)", GAME_SUPPORTS_SAVE ) | |
| 4765 | GAME( 1998, feversos, 0, dfeveron, cave, feversos, ROT270, "Cave (Nihon System license)", "Fever SOS (International, Ver. 98/09/25)", GAME_SUPPORTS_SAVE ) | |
| 4697 | 4766 | |
| 4698 | GAME( 1998, esprade, 0, esprade, cave, esprade, ROT270, "Cave (Atlus license)", "ESP Ra.De. (International, Ver. 98/04/22)", 0 ) | |
| 4699 | GAME( 1998, espradej, esprade, esprade, cave, esprade, ROT270, "Cave (Atlus license)", "ESP Ra.De. (Japan, Ver. 98/04/21)", 0 ) | |
| 4700 | GAME( 1998, espradejo, esprade, esprade, cave, esprade, ROT270, "Cave (Atlus license)", "ESP Ra.De. (Japan, Ver. 98/04/14)", 0 ) | |
| 4767 | GAME( 1998, esprade, 0, esprade, cave, esprade, ROT270, "Cave (Atlus license)", "ESP Ra.De. (International, Ver. 98/04/22)", GAME_SUPPORTS_SAVE ) | |
| 4768 | GAME( 1998, espradej, esprade, esprade, cave, esprade, ROT270, "Cave (Atlus license)", "ESP Ra.De. (Japan, Ver. 98/04/21)", GAME_SUPPORTS_SAVE ) | |
| 4769 | GAME( 1998, espradejo, esprade, esprade, cave, esprade, ROT270, "Cave (Atlus license)", "ESP Ra.De. (Japan, Ver. 98/04/14)", GAME_SUPPORTS_SAVE ) | |
| 4701 | 4770 | |
| 4702 | GAME( 1998, uopoko, 0, uopoko, cave, uopoko, ROT0, "Cave (Jaleco license)", "Puzzle Uo Poko (International)", 0 ) | |
| 4703 | GAME( 1998, uopokoj, uopoko, uopoko, cave, uopoko, ROT0, "Cave (Jaleco license)", "Puzzle Uo Poko (Japan)", 0 ) | |
| 4771 | GAME( 1998, uopoko, 0, uopoko, cave, uopoko, ROT0, "Cave (Jaleco license)", "Puzzle Uo Poko (International)", GAME_SUPPORTS_SAVE ) | |
| 4772 | GAME( 1998, uopokoj, uopoko, uopoko, cave, uopoko, ROT0, "Cave (Jaleco license)", "Puzzle Uo Poko (Japan)", GAME_SUPPORTS_SAVE ) | |
| 4704 | 4773 | |
| 4705 | GAME( 1999, guwange, 0, guwange, guwange, guwange, ROT270, "Cave (Atlus license)", "Guwange (Japan, Master Ver. 99/06/24)", | |
| 4774 | GAME( 1999, guwange, 0, guwange, guwange, guwange, ROT270, "Cave (Atlus license)", "Guwange (Japan, Master Ver. 99/06/24)", GAME_SUPPORTS_SAVE ) | |
| 4706 | 4775 | |
| 4707 | GAME( 1999, gaia, 0, gaia, gaia, gaia, ROT0, "Noise Factory", "Gaia Crusaders", | |
| 4776 | GAME( 1999, gaia, 0, gaia, gaia, gaia, ROT0, "Noise Factory", "Gaia Crusaders", | |
| 4708 | 4777 | |
| 4709 | GAME( 2001, theroes, 0, gaia, theroes, gaia, ROT0, "Primetek Investments", "Thunder Heroes", | |
| 4778 | GAME( 2001, theroes, 0, gaia, theroes, gaia, ROT0, "Primetek Investments", "Thunder Heroes", GAME_SUPPORTS_SAVE | | |
| 4710 | 4779 | |
| 4711 | GAME( 1999, korokoro, 0, korokoro, korokoro, korokoro, ROT0, "Takumi", "Koro Koro Quest (Japan)", | |
| 4780 | GAME( 1999, korokoro, 0, korokoro, korokoro, korokoro, ROT0, "Takumi", "Koro Koro Quest (Japan)", GAME_SUPPORTS_SAVE | |
| 4712 | 4781 | |
| 4713 | GAME( 1999, crusherm, 0, crusherm, korokoro, korokoro, ROT0, "Takumi", "Crusher Makochan (Japan)", | |
| 4782 | GAME( 1999, crusherm, 0, crusherm, korokoro, korokoro, ROT0, "Takumi", "Crusher Makochan (Japan)", GAME_SUPPORTS_SAVE | |
| 4714 | 4783 | |
| 4715 | GAME( 1999, tjumpman, 0, tjumpman, tjumpman, tjumpman, ROT0, "Namco", "Tobikose! Jumpman", | |
| 4784 | GAME( 1999, tjumpman, 0, tjumpman, tjumpman, tjumpman, ROT0, "Namco", "Tobikose! Jumpman", GAME_SUPPORTS_SAVE |
| r10315 | r10316 | |
|---|---|---|
| 131 | 131 | case 0: /* High byte - SECIRQ is trigged on activating this latch */ |
| 132 | 132 | state->i8751_value = (state->i8751_value & 0xff) | (data << 8); |
| 133 | 133 | cpu_set_input_line(state->mcu, MCS51_INT1_LINE, ASSERT_LINE); |
| 134 | | |
| 134 | | |
| 135 | 135 | break; |
| 136 | 136 | case 1: /* Low byte */ |
| 137 | 137 | state->i8751_value = (state->i8751_value & 0xff00) | data; |
| r10315 | r10316 | |
|---|---|---|
| 487 | 487 | { |
| 488 | 488 | fuuki32_state *state = machine->driver_data<fuuki32_state>(); |
| 489 | 489 | cpu_set_input_line(state->maincpu, 1, HOLD_LINE); |
| 490 | timer_set(machine | |
| 490 | machine->scheduler().timer_set(machine | |
| 491 | 491 | } |
| 492 | 492 | |
| 493 | 493 | |
| r10315 | r10316 | |
| 495 | 495 | { |
| 496 | 496 | fuuki32_state *state = machine->driver_data<fuuki32_state>(); |
| 497 | 497 | cpu_set_input_line(state->maincpu, 3, HOLD_LINE); // VBlank IRQ |
| 498 | timer_set(machine | |
| 498 | machine->scheduler().timer_set(machine | |
| 499 | 499 | } |
| 500 | 500 | |
| 501 | 501 | |
| r10315 | r10316 | |
| 518 | 518 | state->maincpu = machine->device("maincpu"); |
| 519 | 519 | state->audiocpu = machine->device("soundcpu"); |
| 520 | 520 | |
| 521 | state->raster_interrupt_timer = timer_alloc( | |
| 521 | state->raster_interrupt_timer = machine->scheduler().timer_alloc(FUNC( | |
| 522 | 522 | |
| 523 | 523 | state_save_register_global_array(machine, state->spr_buffered_tilebank); |
| 524 | 524 | state_save_register_global_array(machine, state->shared_ram); |
| r10315 | r10316 | |
| 530 | 530 | fuuki32_state *state = machine->driver_data<fuuki32_state>(); |
| 531 | 531 | const rectangle &visarea = machine->primary_screen->visible_area(); |
| 532 | 532 | |
| 533 | timer_set(machine, machine->primary_screen->time_until_pos(248), NULL, 0, level_1_interrupt_callback); | |
| 534 | timer_set(machine, machine->primary_screen->time_until_vblank_start(), NULL, 0, vblank_interrupt_callback); | |
| 533 | machine->scheduler().timer_set(machine->primary_screen->time_until_pos(248), FUNC(level_1_interrupt_callback)); | |
| 534 | machine->scheduler().timer_set(machine->primary_screen->time_until_vblank_start(), FUNC(vblank_interrupt_callback)); | |
| 535 | 535 | timer_adjust_oneshot(state->raster_interrupt_timer, machine->primary_screen->time_until_pos(0, visarea.max_x + 1), 0); |
| 536 | 536 | } |
| 537 | 537 |
| r10315 | r10316 | |
|---|---|---|
| 633 | 633 | if (!blt_amount) |
| 634 | 634 | { |
| 635 | 635 | if(BLITLOG) mame_printf_debug("end of blit list\n"); |
| 636 | timer_set( | |
| 636 | machine->scheduler().timer_set( | |
| 637 | 637 | return; |
| 638 | 638 | } |
| 639 | 639 |
| r10315 | r10316 | |
|---|---|---|
| 238 | 238 | |
| 239 | 239 | static INTERRUPT_GEN( cadash_interrupt ) |
| 240 | 240 | { |
| 241 | | |
| 241 | | |
| 242 | 242 | cpu_set_input_line(device, 4, HOLD_LINE); /* interrupt vector 4 */ |
| 243 | 243 | } |
| 244 | 244 |
| r10315 | r10316 | |
|---|---|---|
| 72 | 72 | { |
| 73 | 73 | rollerg_state *state = space->machine->driver_data<rollerg_state>(); |
| 74 | 74 | cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, CLEAR_LINE); |
| 75 | | |
| 75 | | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | static READ8_HANDLER( pip_r ) |
| r10315 | r10316 | |
|---|---|---|
| 20 | 20 | if (scanline >= 262) |
| 21 | 21 | scanline = 0; |
| 22 | 22 | |
| 23 | timer_set(machine | |
| 23 | machine->scheduler().timer_set(machine | |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | static MACHINE_RESET( wolfpack ) |
| 28 | 28 | { |
| 29 | timer_set(machine | |
| 29 | machine->scheduler().timer_set(machine | |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 |
| r10315 | r10316 | |
|---|---|---|
| 3987 | 3987 | MCFG_OKIM6295_ADD("oki1", 8000000/8, OKIM6295_PIN7_HIGH) /* 1 Mhz, pin 7 high */ |
| 3988 | 3988 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 3989 | 3989 | |
| 3990 | MCFG_NMK112_ADD("nmk112", nmk16_nmk112_intf) | |
| 3991 | 3990 | MACHINE_CONFIG_END |
| 3992 | 3991 | |
| 3993 | 3992 | static MACHINE_CONFIG_START( strahl, driver_device ) |
| r10315 | r10316 | |
|---|---|---|
| 520 | 520 | if (param == 0) |
| 521 | 521 | { |
| 522 | 522 | cpu_set_input_line(state->maincpu, 0, ASSERT_LINE); |
| 523 | timer_set(machine | |
| 523 | machine->scheduler().timer_set(machine | |
| 524 | 524 | } |
| 525 | 525 | if (param == 1) |
| 526 | 526 | { |
| 527 | 527 | cpu_set_input_line(state->maincpu, 0, ASSERT_LINE); |
| 528 | timer_set(machine | |
| 528 | machine->scheduler().timer_set(machine | |
| 529 | 529 | } |
| 530 | 530 | if (param == -1) |
| 531 | 531 | cpu_set_input_line(state->maincpu, 0, CLEAR_LINE); |
| r10315 | r10316 | |
| 536 | 536 | static INTERRUPT_GEN( m11_interrupt ) |
| 537 | 537 | { |
| 538 | 538 | cpu_set_input_line(device, 0, ASSERT_LINE); |
| 539 | // | |
| 539 | // | |
| 540 | 540 | } |
| 541 | 541 | |
| 542 | 542 | static INTERRUPT_GEN( m10_interrupt ) |
| r10315 | r10316 | |
| 548 | 548 | static INTERRUPT_GEN( m15_interrupt ) |
| 549 | 549 | { |
| 550 | 550 | cpu_set_input_line(device, 0, ASSERT_LINE); |
| 551 | | |
| 551 | | |
| 552 | 552 | } |
| 553 | 553 | |
| 554 | 554 | /************************************* |
| r10315 | r10316 | |
|---|---|---|
| 179 | 179 | primlist.release_lock(); |
| 180 | 180 | |
| 181 | 181 | // after 5 seconds, exit |
| 182 | if ( | |
| 182 | if ( | |
| 183 | 183 | machine().schedule_exit(); |
| 184 | 184 | } |
| 185 | 185 |
| r10315 | r10316 | |
|---|---|---|
| 1906 | 1906 | if (global->execution_state != EXECUTION_STATE_STOPPED && (m_flags & (DEBUG_FLAG_STOP_TIME | DEBUG_FLAG_STOP_PC | DEBUG_FLAG_LIVE_BP)) != 0) |
| 1907 | 1907 | { |
| 1908 | 1908 | // see if we hit a target time |
| 1909 | if ((m_flags & DEBUG_FLAG_STOP_TIME) != 0 && | |
| 1909 | if ((m_flags & DEBUG_FLAG_STOP_TIME) != 0 && | |
| 1910 | 1910 | { |
| 1911 | debug_console_printf(&machine, "Stopped at time interval %.1g\n", | |
| 1911 | debug_console_printf(&machine, "Stopped at time interval %.1g\n", | |
| 1912 | 1912 | global->execution_state = EXECUTION_STATE_STOPPED; |
| 1913 | 1913 | } |
| 1914 | 1914 | |
| r10315 | r10316 | |
| 2222 | 2222 | |
| 2223 | 2223 | assert(m_exec != NULL); |
| 2224 | 2224 | |
| 2225 | m_stoptime = | |
| 2225 | m_stoptime = | |
| 2226 | 2226 | m_flags |= DEBUG_FLAG_STOP_TIME; |
| 2227 | 2227 | global->execution_state = EXECUTION_STATE_RUNNING; |
| 2228 | 2228 | } |
| r10315 | r10316 | |
|---|---|---|
| 241 | 241 | h8->direct = &h8->program->direct(); |
| 242 | 242 | h8->io = device->space(AS_IO); |
| 243 | 243 | |
| 244 | h8->timer[0] = timer_alloc(h8->device->machine, h8_timer_0_cb, h8); | |
| 245 | h8->timer[1] = timer_alloc(h8->device->machine, h8_timer_1_cb, h8); | |
| 246 | h8->timer[2] = timer_alloc(h8->device->machine, h8_timer_2_cb, h8); | |
| 247 | h8->timer[3] = timer_alloc(h8->device->machine, h8_timer_3_cb, h8); | |
| 244 | h8->timer[0] = h8->device->machine->scheduler().timer_alloc(FUNC(h8_timer_0_cb), h8); | |
| 245 | h8->timer[1] = h8->device->machine->scheduler().timer_alloc(FUNC(h8_timer_1_cb), h8); | |
| 246 | h8->timer[2] = h8->device->machine->scheduler().timer_alloc(FUNC(h8_timer_2_cb), h8); | |
| 247 | h8->timer[3] = h8->device->machine->scheduler().timer_alloc(FUNC(h8_timer_3_cb), h8); | |
| 248 | 248 | |
| 249 | 249 | state_save_register_device_item(device, 0, h8->h8err); |
| 250 | 250 | state_save_register_device_item_array(device, 0, h8->regs); |
| r10315 | r10316 | |
|---|---|---|
| 766 | 766 | |
| 767 | 767 | void h8_3007_itu_init(h83xx_state *h8) |
| 768 | 768 | { |
| 769 | h8->timer[0] = timer_alloc(h8->device->machine, h8itu_3007_timer_0_cb, h8); | |
| 770 | h8->timer[1] = timer_alloc(h8->device->machine, h8itu_3007_timer_1_cb, h8); | |
| 771 | h8->timer[2] = timer_alloc(h8->device->machine, h8itu_3007_timer_2_cb, h8); | |
| 769 | h8->timer[0] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_3007_timer_0_cb), h8); | |
| 770 | h8->timer[1] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_3007_timer_1_cb), h8); | |
| 771 | h8->timer[2] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_3007_timer_2_cb), h8); | |
| 772 | 772 | |
| 773 | 773 | h8_itu_reset(h8); |
| 774 | 774 | } |
| 775 | 775 | |
| 776 | 776 | void h8_itu_init(h83xx_state *h8) |
| 777 | 777 | { |
| 778 | h8->timer[0] = timer_alloc(h8->device->machine, h8itu_timer_0_cb, h8); | |
| 779 | h8->timer[1] = timer_alloc(h8->device->machine, h8itu_timer_1_cb, h8); | |
| 780 | h8->timer[2] = timer_alloc(h8->device->machine, h8itu_timer_2_cb, h8); | |
| 781 | h8->timer[3] = timer_alloc(h8->device->machine, h8itu_timer_3_cb, h8); | |
| 782 | h8->timer[4] = timer_alloc(h8->device->machine, h8itu_timer_4_cb, h8); | |
| 778 | h8->timer[0] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_timer_0_cb), h8); | |
| 779 | h8->timer[1] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_timer_1_cb), h8); | |
| 780 | h8->timer[2] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_timer_2_cb), h8); | |
| 781 | h8->timer[3] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_timer_3_cb), h8); | |
| 782 | h8->timer[4] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_timer_4_cb), h8); | |
| 783 | 783 | |
| 784 | 784 | h8_itu_reset(h8); |
| 785 | 785 | } |
| r10315 | r10316 | |
|---|---|---|
| 652 | 652 | } |
| 653 | 653 | |
| 654 | 654 | /* allocate a scanline timer and set it to go off at the start */ |
| 655 | tms->scantimer = | |
| 655 | tms->scantimer = | |
| 656 | 656 | timer_adjust_oneshot(tms->scantimer, attotime::zero, 0); |
| 657 | 657 | |
| 658 | 658 | /* allocate the shiftreg */ |
| r10315 | r10316 | |
| 1200 | 1200 | |
| 1201 | 1201 | /* NMI issued? */ |
| 1202 | 1202 | if (data & 0x0100) |
| 1203 | t | |
| 1203 | t | |
| 1204 | 1204 | break; |
| 1205 | 1205 | |
| 1206 | 1206 | case REG_HSTCTLL: |
| r10315 | r10316 | |
| 1235 | 1235 | |
| 1236 | 1236 | /* input interrupt? (should really be state-based, but the functions don't exist!) */ |
| 1237 | 1237 | if (!(oldreg & 0x0008) && (newreg & 0x0008)) |
| 1238 | t | |
| 1238 | t | |
| 1239 | 1239 | else if ((oldreg & 0x0008) && !(newreg & 0x0008)) |
| 1240 | 1240 | IOREG(tms, REG_INTPEND) &= ~TMS34010_HI; |
| 1241 | 1241 | break; |
| r10315 | r10316 | |
| 1351 | 1351 | |
| 1352 | 1352 | /* NMI issued? */ |
| 1353 | 1353 | if (data & 0x0100) |
| 1354 | t | |
| 1354 | t | |
| 1355 | 1355 | break; |
| 1356 | 1356 | |
| 1357 | 1357 | case REG020_HSTCTLL: |
| r10315 | r10316 | |
| 1386 | 1386 | |
| 1387 | 1387 | /* input interrupt? (should really be state-based, but the functions don't exist!) */ |
| 1388 | 1388 | if (!(oldreg & 0x0008) && (newreg & 0x0008)) |
| 1389 | t | |
| 1389 | t | |
| 1390 | 1390 | else if ((oldreg & 0x0008) && !(newreg & 0x0008)) |
| 1391 | 1391 | IOREG(tms, REG020_INTPEND) &= ~TMS34010_HI; |
| 1392 | 1392 | break; |
| r10315 | r10316 | |
|---|---|---|
| 1215 | 1215 | void upi41_master_w(device_t *_device, UINT8 a0, UINT8 data) |
| 1216 | 1216 | { |
| 1217 | 1217 | legacy_cpu_device *device = downcast<legacy_cpu_device *>(_device); |
| 1218 | | |
| 1218 | | |
| 1219 | 1219 | } |
| 1220 | 1220 | |
| 1221 | 1221 |
| r10315 | r10316 | |
|---|---|---|
| 906 | 906 | cpustate->destination = 0; |
| 907 | 907 | |
| 908 | 908 | for (i = 0; i < 8; i++) |
| 909 | cpustate->timers[i] = | |
| 909 | cpustate->timers[i] = | |
| 910 | 910 | |
| 911 | 911 | state_save_register_device_item(device, 0, cpustate->a); |
| 912 | 912 | state_save_register_device_item(device, 0, cpustate->b); |
| r10315 | r10316 | |
|---|---|---|
| 104 | 104 | { |
| 105 | 105 | sc61860_state *cpustate = get_safe_token(device); |
| 106 | 106 | cpustate->config = (sc61860_cpu_core *) device->baseconfig().static_config(); |
| 107 | | |
| 107 | | |
| 108 | 108 | cpustate->device = device; |
| 109 | 109 | cpustate->program = device->space(AS_PROGRAM); |
| 110 | 110 | cpustate->direct = &cpustate->program->direct(); |
| r10315 | r10316 | |
|---|---|---|
| 2725 | 2725 | // Timers |
| 2726 | 2726 | |
| 2727 | 2727 | for (i = 0; i < 4; i++) |
| 2728 | cpustate->timer[i] = | |
| 2728 | cpustate->timer[i] = | |
| 2729 | 2729 | |
| 2730 | cpustate->timer[4] = | |
| 2730 | cpustate->timer[4] = | |
| 2731 | 2731 | } |
| 2732 | 2732 | |
| 2733 | 2733 | static ADDRESS_MAP_START(tmp90840_mem, ADDRESS_SPACE_PROGRAM, 8) |
| r10315 | r10316 | |
|---|---|---|
| 1546 | 1546 | cpustate->program = device->space(AS_PROGRAM); |
| 1547 | 1547 | cpustate->direct = &cpustate->program->direct(); |
| 1548 | 1548 | cpustate->io = device->space(AS_IO); |
| 1549 | cpustate->timer = | |
| 1549 | cpustate->timer = | |
| 1550 | 1550 | cpustate->clock_scale_mask = scale_mask; |
| 1551 | 1551 | } |
| 1552 | 1552 |
| r10315 | r10316 | |
|---|---|---|
| 886 | 886 | |
| 887 | 887 | /* allocate serial timer */ |
| 888 | 888 | |
| 889 | cpustate->serial_timer = | |
| 889 | cpustate->serial_timer = | |
| 890 | 890 | timer_adjust_periodic(cpustate->serial_timer, attotime::zero, 0, attotime::from_hz(device->clock() / 16)); |
| 891 | 891 | |
| 892 | 892 | /* allocate counter timer */ |
| 893 | 893 | |
| 894 | 894 | if (has_counter) |
| 895 | 895 | { |
| 896 | cpustate->counter_timer = | |
| 896 | cpustate->counter_timer = | |
| 897 | 897 | timer_adjust_periodic(cpustate->counter_timer, attotime::zero, 0, attotime::from_hz(device->clock() / 16 / 4)); |
| 898 | 898 | } |
| 899 | 899 | |
| r10315 | r10316 | |
| 901 | 901 | |
| 902 | 902 | if (has_inil) |
| 903 | 903 | { |
| 904 | cpustate->inil_timer = | |
| 904 | cpustate->inil_timer = | |
| 905 | 905 | timer_adjust_periodic(cpustate->inil_timer, attotime::zero, 0, attotime::from_hz(device->clock() / 16)); |
| 906 | 906 | } |
| 907 | 907 | |
| r10315 | r10316 | |
| 909 | 909 | |
| 910 | 910 | if (cpustate->intf->microbus == COP400_MICROBUS_ENABLED) |
| 911 | 911 | { |
| 912 | cpustate->microbus_timer = | |
| 912 | cpustate->microbus_timer = | |
| 913 | 913 | timer_adjust_periodic(cpustate->microbus_timer, attotime::zero, 0, attotime::from_hz(device->clock() / 16)); |
| 914 | 914 | } |
| 915 | 915 |
| r10315 | r10316 | |
|---|---|---|
| 328 | 328 | |
| 329 | 329 | /* allocate a timer for the compare interrupt */ |
| 330 | 330 | if ((cap & PPCCAP_OEA) && (ppc->tb_divisor)) |
| 331 | ppc->decrementer_int_timer = | |
| 331 | ppc->decrementer_int_timer = | |
| 332 | 332 | |
| 333 | 333 | /* and for the 4XX interrupts if needed */ |
| 334 | 334 | if (cap & PPCCAP_4XX) |
| 335 | 335 | { |
| 336 | ppc->fit_timer = timer_alloc(device->machine, ppc4xx_fit_callback, ppc); | |
| 337 | ppc->pit_timer = timer_alloc(device->machine, ppc4xx_pit_callback, ppc); | |
| 338 | ppc->spu.timer = timer_alloc(device->machine, ppc4xx_spu_callback, ppc); | |
| 336 | ppc->fit_timer = device->machine->scheduler().timer_alloc(FUNC(ppc4xx_fit_callback), ppc); | |
| 337 | ppc->pit_timer = device->machine->scheduler().timer_alloc(FUNC(ppc4xx_pit_callback), ppc); | |
| 338 | ppc->spu.timer = device->machine->scheduler().timer_alloc(FUNC(ppc4xx_spu_callback), ppc); | |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | /* register for save states */ |
| r10315 | r10316 | |
|---|---|---|
| 947 | 947 | // !!! why is rfci here !!! |
| 948 | 948 | ppc.optable19[51] = ppc_rfci; |
| 949 | 949 | |
| 950 | ppc.spu.rx_timer = timer_alloc(device->machine, ppc403_spu_rx_callback, NULL); | |
| 951 | ppc.spu.tx_timer = timer_alloc(device->machine, ppc403_spu_tx_callback, NULL); | |
| 950 | ppc.spu.rx_timer = device->machine->scheduler().timer_alloc(FUNC(ppc403_spu_rx_callback)); | |
| 951 | ppc.spu.tx_timer = device->machine->scheduler().timer_alloc(FUNC(ppc403_spu_tx_callback)); | |
| 952 | 952 | |
| 953 | 953 | ppc.read8 = ppc403_read8; |
| 954 | 954 | ppc.read16 = ppc403_read16; |
| r10315 | r10316 | |
|---|---|---|
| 47 | 47 | #define FLAG_C 0x10 |
| 48 | 48 | |
| 49 | 49 | #define CYCLES_PASSED(X) cpustate->w.icount -= ((X) / (cpustate->w.gb_speed)); \ |
| 50 | if ( cpustate->w.timer_fired_func ) { \ | |
| 51 | cpustate->w.timer_fired_func( cpustate->w.device, X ); \ | |
| 50 | if ( cpustate->w.timer_expired_func ) { \ | |
| 51 | cpustate->w.timer_expired_func( cpustate->w.device, X ); \ | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | typedef struct { |
| r10315 | r10316 | |
| 69 | 69 | address_space *program; |
| 70 | 70 | int icount; |
| 71 | 71 | /* Timer stuff */ |
| 72 | lr35902_timer_fired_func timer_ | |
| 72 | lr35902_timer_fired_func timer_expired_func; | |
| 73 | 73 | /* Fetch & execute related */ |
| 74 | 74 | int execution_state; |
| 75 | 75 | UINT8 op; |
| r10315 | r10316 | |
| 210 | 210 | cpustate->w.HL = 0x0000; |
| 211 | 211 | cpustate->w.SP = 0x0000; |
| 212 | 212 | cpustate->w.PC = 0x0000; |
| 213 | cpustate->w.timer_ | |
| 213 | cpustate->w.timer_expired_func = NULL; | |
| 214 | 214 | cpustate->w.features = LR35902_FEATURE_HALT_BUG; |
| 215 | 215 | if (cpustate->w.config) |
| 216 | 216 | { |
| r10315 | r10316 | |
| 222 | 222 | cpustate->w.SP = cpustate->w.config->regs[4]; |
| 223 | 223 | cpustate->w.PC = cpustate->w.config->regs[5]; |
| 224 | 224 | } |
| 225 | cpustate->w.timer_ | |
| 225 | cpustate->w.timer_expired_func = cpustate->w.config->timer_expired_func; | |
| 226 | 226 | cpustate->w.features = cpustate->w.config->features; |
| 227 | 227 | } |
| 228 | 228 | cpustate->w.enable = 0; |
| r10315 | r10316 | |
|---|---|---|
| 11 | 11 | { |
| 12 | 12 | const UINT16 *regs; |
| 13 | 13 | UINT8 features; |
| 14 | lr35902_timer_fired_func timer_ | |
| 14 | lr35902_timer_fired_func timer_expired_func; | |
| 15 | 15 | }; |
| 16 | 16 | |
| 17 | 17 | enum |
| r10315 | r10316 | |
|---|---|---|
| 923 | 923 | const sh2_cpu_core *conf = (const sh2_cpu_core *)device->baseconfig().static_config(); |
| 924 | 924 | int i; |
| 925 | 925 | |
| 926 | sh2->timer = | |
| 926 | sh2->timer = | |
| 927 | 927 | timer_adjust_oneshot(sh2->timer, attotime::never, 0); |
| 928 | 928 | |
| 929 | sh2->dma_current_active_timer[0] = | |
| 929 | sh2->dma_current_active_timer[0] = | |
| 930 | 930 | timer_adjust_oneshot(sh2->dma_current_active_timer[0], attotime::never, 0); |
| 931 | 931 | |
| 932 | sh2->dma_current_active_timer[1] = | |
| 932 | sh2->dma_current_active_timer[1] = | |
| 933 | 933 | timer_adjust_oneshot(sh2->dma_current_active_timer[1], attotime::never, 0); |
| 934 | 934 | |
| 935 | 935 |
| r10315 | r10316 | |
|---|---|---|
| 295 | 295 | |
| 296 | 296 | for (tmr = 0; tmr < NUM_TIMERS_8BIT; tmr++) |
| 297 | 297 | { |
| 298 | cpustate->timer_timers[tmr] = | |
| 298 | cpustate->timer_timers[tmr] = | |
| 299 | 299 | timer_adjust_oneshot(cpustate->timer_timers[tmr], attotime::never, tmr); |
| 300 | 300 | } |
| 301 | 301 | } |
| r10315 | r10316 | |
|---|---|---|
| 149 | 149 | cpustate->data = device->space(AS_DATA); |
| 150 | 150 | cpustate->io = device->space(AS_IO); |
| 151 | 151 | |
| 152 | cpustate->serial = | |
| 152 | cpustate->serial = | |
| 153 | 153 | |
| 154 | 154 | state_save_register_device_item(device, 0, cpustate->PC); |
| 155 | 155 | state_save_register_device_item(device, 0, cpustate->PA); |
| r10315 | r10316 | |
|---|---|---|
| 1160 | 1160 | |
| 1161 | 1161 | for (i=0; i<3; i++) |
| 1162 | 1162 | { |
| 1163 | sh4->timer[i] = | |
| 1163 | sh4->timer[i] = | |
| 1164 | 1164 | timer_adjust_oneshot(sh4->timer[i], attotime::never, i); |
| 1165 | 1165 | } |
| 1166 | 1166 | |
| 1167 | 1167 | for (i=0; i<4; i++) |
| 1168 | 1168 | { |
| 1169 | sh4->dma_timer[i] = | |
| 1169 | sh4->dma_timer[i] = | |
| 1170 | 1170 | timer_adjust_oneshot(sh4->dma_timer[i], attotime::never, i); |
| 1171 | 1171 | } |
| 1172 | 1172 | |
| 1173 | sh4->refresh_timer = | |
| 1173 | sh4->refresh_timer = | |
| 1174 | 1174 | timer_adjust_oneshot(sh4->refresh_timer, attotime::never, 0); |
| 1175 | 1175 | sh4->refresh_timer_base = 0; |
| 1176 | 1176 | |
| 1177 | sh4->rtc_timer = | |
| 1177 | sh4->rtc_timer = | |
| 1178 | 1178 | timer_adjust_oneshot(sh4->rtc_timer, attotime::never, 0); |
| 1179 | 1179 | |
| 1180 | 1180 | sh4->m = auto_alloc_array(device->machine, UINT32, 16384); |
| r10315 | r10316 | |
|---|---|---|
| 430 | 430 | nec_state->config = config; |
| 431 | 431 | |
| 432 | 432 | for (int i = 0; i < 4; i++) |
| 433 | nec_state->timers[i] = | |
| 433 | nec_state->timers[i] = | |
| 434 | 434 | |
| 435 | 435 | state_save_register_device_item_array(device, 0, nec_state->ram.w); |
| 436 | 436 | state_save_register_device_item_array(device, 0, nec_state->intp_state); |
| r10315 | r10316 | |
|---|---|---|
| 105 | 105 | mips->vtlb = vtlb_alloc(device, ADDRESS_SPACE_PROGRAM, 2 * mips->tlbentries + 2, 0); |
| 106 | 106 | |
| 107 | 107 | /* allocate a timer for the compare interrupt */ |
| 108 | mips->compare_int_timer = | |
| 108 | mips->compare_int_timer = | |
| 109 | 109 | |
| 110 | 110 | /* reset the state */ |
| 111 | 111 | mips3com_reset(mips); |
| r10315 | r10316 | |
|---|---|---|
| 1298 | 1298 | cpustate->io = device->space(AS_IO); |
| 1299 | 1299 | |
| 1300 | 1300 | #if (TMS99XX_MODEL == TMS9995_ID) |
| 1301 | cpustate->timer = | |
| 1301 | cpustate->timer = | |
| 1302 | 1302 | #endif |
| 1303 | 1303 | |
| 1304 | 1304 | cpustate->idle_callback = param ? param->idle_callback : NULL; |
| r10315 | r10316 | |
|---|---|---|
| 168 | 168 | { |
| 169 | 169 | m_program = this->space(AS_PROGRAM); |
| 170 | 170 | |
| 171 | m_sec_timer = | |
| 171 | m_sec_timer = | |
| 172 | 172 | timer_adjust_periodic(m_sec_timer, attotime::from_seconds(1), 0, attotime::from_seconds(1)); |
| 173 | 173 | |
| 174 | 174 | // save state |
| r10315 | r10316 | |
|---|---|---|
| 669 | 669 | cpustate->io = device->space(AS_IO); |
| 670 | 670 | |
| 671 | 671 | /* allocate timers */ |
| 672 | cpustate->t0_timer = timer_alloc(device->machine, t0_tick, cpustate); | |
| 673 | cpustate->t1_timer = timer_alloc(device->machine, t1_tick, cpustate); | |
| 672 | cpustate->t0_timer = device->machine->scheduler().timer_alloc(FUNC(t0_tick), cpustate); | |
| 673 | cpustate->t1_timer = device->machine->scheduler().timer_alloc(FUNC(t1_tick), cpustate); | |
| 674 | 674 | |
| 675 | 675 | /* register for state saving */ |
| 676 | 676 | state_save_register_device_item(device, 0, cpustate->pc); |
| r10315 | r10316 | |
|---|---|---|
| 1201 | 1201 | cpustate->io = device->space(AS_IO); |
| 1202 | 1202 | |
| 1203 | 1203 | cpustate->clock = device->clock() / 4; |
| 1204 | cpustate->sci_timer = | |
| 1204 | cpustate->sci_timer = | |
| 1205 | 1205 | |
| 1206 | 1206 | state_register(cpustate, "m6801"); |
| 1207 | 1207 | |
| r10315 | r10316 | |
| 1251 | 1251 | cpustate->io = device->space(AS_IO); |
| 1252 | 1252 | |
| 1253 | 1253 | cpustate->clock = device->clock() / 4; |
| 1254 | cpustate->sci_timer = | |
| 1254 | cpustate->sci_timer = | |
| 1255 | 1255 | |
| 1256 | 1256 | state_register(cpustate, "m6803"); |
| 1257 | 1257 | |
| r10315 | r10316 | |
| 1309 | 1309 | cpustate->io = device->space(AS_IO); |
| 1310 | 1310 | |
| 1311 | 1311 | cpustate->clock = device->clock() / 4; |
| 1312 | cpustate->sci_timer = | |
| 1312 | cpustate->sci_timer = | |
| 1313 | 1313 | |
| 1314 | 1314 | state_register(cpustate, "hd63701"); |
| 1315 | 1315 | } |
| r10315 | r10316 | |
|---|---|---|
| 781 | 781 | int clock=vga.monitor.get_clock(); |
| 782 | 782 | int lines=vga.monitor.get_lines(); |
| 783 | 783 | int columns=vga.monitor.get_columns(); |
| 784 | int diff = ((( | |
| 784 | int diff = ((( | |
| 785 | 785 | %(lines*columns); |
| 786 | 786 | if (diff<columns*vga.monitor.get_sync_lines()) data|=8; |
| 787 | 787 | diff=diff/lines; |
| r10315 | r10316 | |
| 791 | 791 | if (vga.monitor.retrace) |
| 792 | 792 | { |
| 793 | 793 | data |= 1; |
| 794 | if (( | |
| 794 | if (( | |
| 795 | 795 | { |
| 796 | 796 | data |= 8; |
| 797 | 797 | vga.monitor.retrace=0; |
| r10315 | r10316 | |
| 799 | 799 | } |
| 800 | 800 | else |
| 801 | 801 | { |
| 802 | if (( | |
| 802 | if (( | |
| 803 | 803 | vga.monitor.retrace=1; |
| 804 | vga.monitor.start_time= | |
| 804 | vga.monitor.start_time= | |
| 805 | 805 | } |
| 806 | 806 | #else |
| 807 | 807 | // not working with ps2m30 |
| r10315 | r10316 | |
| 1056 | 1056 | vga_cpu_interface(space->machine); |
| 1057 | 1057 | |
| 1058 | 1058 | if (vga.sequencer.index == 0) |
| 1059 | vga.monitor.start_time = | |
| 1059 | vga.monitor.start_time = | |
| 1060 | 1060 | } |
| 1061 | 1061 | break; |
| 1062 | 1062 | case 6: |
| r10315 | r10316 | |
| 1325 | 1325 | vga.monitor.get_columns = ega_get_crtc_columns; |
| 1326 | 1326 | vga.monitor.get_sync_lines = vga_get_crtc_sync_lines; |
| 1327 | 1327 | vga.monitor.get_sync_columns = vga_get_crtc_sync_columns; |
| 1328 | timer_pulse( | |
| 1328 | machine->scheduler().timer_pulse( | |
| 1329 | 1329 | pc_video_start(machine, pc_ega_choosevideomode, 0); |
| 1330 | 1330 | } |
| 1331 | 1331 | |
| r10315 | r10316 | |
| 1340 | 1340 | vga.monitor.get_columns=vga_get_crtc_columns; |
| 1341 | 1341 | vga.monitor.get_sync_lines=vga_get_crtc_sync_lines; |
| 1342 | 1342 | vga.monitor.get_sync_columns=vga_get_crtc_sync_columns; |
| 1343 | timer_pulse( | |
| 1343 | machine->scheduler().timer_pulse( | |
| 1344 | 1344 | pc_video_start(machine, pc_vga_choosevideomode, 0); |
| 1345 | 1345 | } |
| 1346 | 1346 |
| r10315 | r10316 | |
|---|---|---|
| 119 | 119 | tms34061.regs[TMS34061_VERCOUNTER] = 0x0000; |
| 120 | 120 | |
| 121 | 121 | /* start vertical interrupt timer */ |
| 122 | tms34061.timer = timer_alloc( | |
| 122 | tms34061.timer = machine->scheduler().timer_alloc(FUNC( | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 |
| r10315 | r10316 | |
|---|---|---|
| 208 | 208 | mc6845_t *mc6845 = get_safe_token(device); |
| 209 | 209 | |
| 210 | 210 | if (mc6845->intf->on_update_addr_changed) |
| 211 | | |
| 211 | | |
| 212 | 212 | else |
| 213 | 213 | fatalerror("M6845: transparent memory mode without handler\n"); |
| 214 | 214 | } |
| r10315 | r10316 | |
| 889 | 889 | mc6845->screen = NULL; |
| 890 | 890 | |
| 891 | 891 | /* create the timers */ |
| 892 | mc6845->line_timer = | |
| 892 | mc6845->line_timer = | |
| 893 | 893 | |
| 894 | mc6845->de_off_timer = timer_alloc(device->machine, de_off_timer_cb, (void *)device); | |
| 895 | mc6845->upd_adr_timer = timer_alloc(device->machine, upd_adr_timer_cb, (void *)device); | |
| 894 | mc6845->de_off_timer = device->machine->scheduler().timer_alloc(FUNC(de_off_timer_cb), (void *)device); | |
| 895 | mc6845->upd_adr_timer = device->machine->scheduler().timer_alloc(FUNC(upd_adr_timer_cb), (void *)device); | |
| 896 | 896 | |
| 897 | mc6845->cur_on_timer = timer_alloc(device->machine, cur_on_timer_cb, (void *)device); | |
| 898 | mc6845->cur_off_timer = timer_alloc(device->machine, cur_off_timer_cb, (void *)device); | |
| 897 | mc6845->cur_on_timer = device->machine->scheduler().timer_alloc(FUNC(cur_on_timer_cb), (void *)device); | |
| 898 | mc6845->cur_off_timer = device->machine->scheduler().timer_alloc(FUNC(cur_off_timer_cb), (void *)device); | |
| 899 | 899 | |
| 900 | mc6845->hsync_on_timer = timer_alloc(device->machine, hsync_on_timer_cb, (void *)device); | |
| 901 | mc6845->hsync_off_timer = timer_alloc(device->machine, hsync_off_timer_cb, (void *)device); | |
| 900 | mc6845->hsync_on_timer = device->machine->scheduler().timer_alloc(FUNC(hsync_on_timer_cb), (void *)device); | |
| 901 | mc6845->hsync_off_timer = device->machine->scheduler().timer_alloc(FUNC(hsync_off_timer_cb), (void *)device); | |
| 902 | 902 | } |
| 903 | 903 | |
| 904 | mc6845->light_pen_latch_timer = | |
| 904 | mc6845->light_pen_latch_timer = | |
| 905 | 905 | |
| 906 | 906 | /* Use some large startup values */ |
| 907 | 907 | mc6845->horiz_char_total = 0xff; |
| r10315 | r10316 | |
|---|---|---|
| 523 | 523 | } |
| 524 | 524 | |
| 525 | 525 | /* allocate a VBLANK timer */ |
| 526 | f->vblank_timer = | |
| 526 | f->vblank_timer = | |
| 527 | 527 | f->vblank = FALSE; |
| 528 | 528 | |
| 529 | 529 | /* initialize the memory FIFO */ |
| r10315 | r10316 | |
| 911 | 911 | /* reset the last_op_time to now and start processing the next command */ |
| 912 | 912 | if (v->pci.op_pending) |
| 913 | 913 | { |
| 914 | v->pci.op_end_time = | |
| 914 | v->pci.op_end_time = | |
| 915 | 915 | flush_fifos(v, v->pci.op_end_time); |
| 916 | 916 | } |
| 917 | 917 | |
| 918 | 918 | /* we may be able to unstall now */ |
| 919 | 919 | if (v->pci.stall_state != NOT_STALLED) |
| 920 | check_stalled_cpu(v, | |
| 920 | check_stalled_cpu(v, | |
| 921 | 921 | |
| 922 | 922 | /* periodically log rasterizer info */ |
| 923 | 923 | v->stats.swaps++; |
| r10315 | r10316 | |
| 1016 | 1016 | if (v->pci.op_pending) |
| 1017 | 1017 | { |
| 1018 | 1018 | if (LOG_VBLANK_SWAP) logerror("---- vblank flush begin\n"); |
| 1019 | flush_fifos(v, | |
| 1019 | flush_fifos(v, | |
| 1020 | 1020 | if (LOG_VBLANK_SWAP) logerror("---- vblank flush end\n"); |
| 1021 | 1021 | } |
| 1022 | 1022 | |
| r10315 | r10316 | |
| 1034 | 1034 | swap_buffers(v); |
| 1035 | 1035 | |
| 1036 | 1036 | /* set a timer for the next off state */ |
| 1037 | timer_set( | |
| 1037 | machine->scheduler().timer_set( | |
| 1038 | 1038 | |
| 1039 | 1039 | /* set internal state and call the client */ |
| 1040 | 1040 | v->fbi.vblank = TRUE; |
| r10315 | r10316 | |
| 2003 | 2003 | if (cycles > 0) |
| 2004 | 2004 | { |
| 2005 | 2005 | v->pci.op_pending = TRUE; |
| 2006 | v->pci.op_end_time = | |
| 2006 | v->pci.op_end_time = | |
| 2007 | 2007 | |
| 2008 | 2008 | if (LOG_FIFO_VERBOSE) logerror("VOODOO.%d.FIFO:direct write start at %d.%08X%08X end at %d.%08X%08X\n", v->index, |
| 2009 | | |
| 2009 | | |
| 2010 | 2010 | v->pci.op_end_time.seconds, (UINT32)(v->pci.op_end_time.attoseconds >> 32), (UINT32)v->pci.op_end_time.attoseconds); |
| 2011 | 2011 | } |
| 2012 | 2012 | } |
| r10315 | r10316 | |
| 2023 | 2023 | |
| 2024 | 2024 | static TIMER_CALLBACK( stall_cpu_callback ) |
| 2025 | 2025 | { |
| 2026 | check_stalled_cpu((voodoo_state *)ptr, | |
| 2026 | check_stalled_cpu((voodoo_state *)ptr, | |
| 2027 | 2027 | } |
| 2028 | 2028 | |
| 2029 | 2029 | |
| r10315 | r10316 | |
| 3464 | 3464 | |
| 3465 | 3465 | /* if we have something pending, flush the FIFOs up to the current time */ |
| 3466 | 3466 | if (v->pci.op_pending) |
| 3467 | flush_fifos(v, | |
| 3467 | flush_fifos(v, | |
| 3468 | 3468 | |
| 3469 | 3469 | /* special handling for registers */ |
| 3470 | 3470 | if ((offset & 0xc00000/4) == 0) |
| r10315 | r10316 | |
| 3544 | 3544 | if (cycles) |
| 3545 | 3545 | { |
| 3546 | 3546 | v->pci.op_pending = TRUE; |
| 3547 | v->pci.op_end_time = | |
| 3547 | v->pci.op_end_time = | |
| 3548 | 3548 | |
| 3549 | 3549 | if (LOG_FIFO_VERBOSE) logerror("VOODOO.%d.FIFO:direct write start at %d.%08X%08X end at %d.%08X%08X\n", v->index, |
| 3550 | | |
| 3550 | | |
| 3551 | 3551 | v->pci.op_end_time.seconds, (UINT32)(v->pci.op_end_time.attoseconds >> 32), (UINT32)v->pci.op_end_time.attoseconds); |
| 3552 | 3552 | } |
| 3553 | 3553 | g_profiler.stop(); |
| r10315 | r10316 | |
| 3597 | 3597 | fifo_items(&v->fbi.fifo) >= 2 * 32 * FBIINIT0_MEMORY_FIFO_HWM(v->reg[fbiInit0].u)) |
| 3598 | 3598 | { |
| 3599 | 3599 | if (LOG_FIFO) logerror("VOODOO.%d.FIFO:voodoo_w hit memory FIFO HWM -- stalling\n", v->index); |
| 3600 | stall_cpu(v, STALLED_UNTIL_FIFO_LWM, | |
| 3600 | stall_cpu(v, STALLED_UNTIL_FIFO_LWM, | |
| 3601 | 3601 | } |
| 3602 | 3602 | } |
| 3603 | 3603 | |
| r10315 | r10316 | |
| 3606 | 3606 | fifo_space(&v->pci.fifo) <= 2 * FBIINIT0_PCI_FIFO_LWM(v->reg[fbiInit0].u)) |
| 3607 | 3607 | { |
| 3608 | 3608 | if (LOG_FIFO) logerror("VOODOO.%d.FIFO:voodoo_w hit PCI FIFO free LWM -- stalling\n", v->index); |
| 3609 | stall_cpu(v, STALLED_UNTIL_FIFO_LWM, | |
| 3609 | stall_cpu(v, STALLED_UNTIL_FIFO_LWM, | |
| 3610 | 3610 | } |
| 3611 | 3611 | |
| 3612 | 3612 | /* if we weren't ready, and this is a non-FIFO access, stall until the FIFOs are clear */ |
| 3613 | 3613 | if (stall) |
| 3614 | 3614 | { |
| 3615 | 3615 | if (LOG_FIFO_VERBOSE) logerror("VOODOO.%d.FIFO:voodoo_w wrote non-FIFO register -- stalling until clear\n", v->index); |
| 3616 | stall_cpu(v, STALLED_UNTIL_FIFO_EMPTY, | |
| 3616 | stall_cpu(v, STALLED_UNTIL_FIFO_EMPTY, | |
| 3617 | 3617 | } |
| 3618 | 3618 | |
| 3619 | 3619 | g_profiler.stop(); |
| r10315 | r10316 | |
| 3891 | 3891 | |
| 3892 | 3892 | /* if we have something pending, flush the FIFOs up to the current time */ |
| 3893 | 3893 | if (v->pci.op_pending) |
| 3894 | flush_fifos(v, | |
| 3894 | flush_fifos(v, | |
| 3895 | 3895 | |
| 3896 | 3896 | /* target the appropriate location */ |
| 3897 | 3897 | if (!(offset & (0xc00000/4))) |
| r10315 | r10316 | |
| 3979 | 3979 | |
| 3980 | 3980 | /* if we have something pending, flush the FIFOs up to the current time */ |
| 3981 | 3981 | if (v->pci.op_pending) |
| 3982 | flush_fifos(v, | |
| 3982 | flush_fifos(v, | |
| 3983 | 3983 | |
| 3984 | 3984 | if (offset < 0x80000/4) |
| 3985 | 3985 | result = banshee_io_r(device, offset, mem_mask); |
| r10315 | r10316 | |
| 4013 | 4013 | |
| 4014 | 4014 | /* if we have something pending, flush the FIFOs up to the current time */ |
| 4015 | 4015 | if (v->pci.op_pending) |
| 4016 | flush_fifos(v, | |
| 4016 | flush_fifos(v, | |
| 4017 | 4017 | |
| 4018 | 4018 | if (offset < v->fbi.lfb_base) |
| 4019 | 4019 | { |
| r10315 | r10316 | |
| 4274 | 4274 | |
| 4275 | 4275 | /* if we have something pending, flush the FIFOs up to the current time */ |
| 4276 | 4276 | if (v->pci.op_pending) |
| 4277 | flush_fifos(v, | |
| 4277 | flush_fifos(v, | |
| 4278 | 4278 | |
| 4279 | 4279 | if (offset < 0x80000/4) |
| 4280 | 4280 | banshee_io_w(device, offset, data, mem_mask); |
| r10315 | r10316 | |
| 4307 | 4307 | |
| 4308 | 4308 | /* if we have something pending, flush the FIFOs up to the current time */ |
| 4309 | 4309 | if (v->pci.op_pending) |
| 4310 | flush_fifos(v, | |
| 4310 | flush_fifos(v, | |
| 4311 | 4311 | |
| 4312 | 4312 | if (offset < v->fbi.lfb_base) |
| 4313 | 4313 | { |
| r10315 | r10316 | |
| 4595 | 4595 | v->pci.fifo.size = 64*2; |
| 4596 | 4596 | v->pci.fifo.in = v->pci.fifo.out = 0; |
| 4597 | 4597 | v->pci.stall_state = NOT_STALLED; |
| 4598 | v->pci.continue_timer = | |
| 4598 | v->pci.continue_timer = | |
| 4599 | 4599 | |
| 4600 | 4600 | /* allocate memory */ |
| 4601 | 4601 | tmumem0 = config->tmumem0; |
| r10315 | r10316 | |
|---|---|---|
| 2438 | 2438 | prevtime = (attotime *)state; |
| 2439 | 2439 | |
| 2440 | 2440 | /* if the time has rolled over another second, regenerate */ |
| 2441 | curtime = | |
| 2441 | curtime = | |
| 2442 | 2442 | if (prevtime->seconds != curtime.seconds) |
| 2443 | 2443 | { |
| 2444 | 2444 | ui_menu_reset(menu, UI_MENU_RESET_SELECT_FIRST); |
| r10315 | r10316 | |
|---|---|---|
| 180 | 180 | // if no screens, create a periodic timer to drive updates |
| 181 | 181 | if (machine.primary_screen == NULL) |
| 182 | 182 | { |
| 183 | m_screenless_frame_timer = timer_alloc(& | |
| 183 | m_screenless_frame_timer = machine.scheduler().timer_alloc(FUNC(& | |
| 184 | 184 | timer_adjust_periodic(m_screenless_frame_timer, screen_device::DEFAULT_FRAME_PERIOD, 0, screen_device::DEFAULT_FRAME_PERIOD); |
| 185 | 185 | } |
| 186 | 186 | } |
| r10315 | r10316 | |
| 240 | 240 | debugint_update_during_game(&m_machine); |
| 241 | 241 | |
| 242 | 242 | // if we're throttling, synchronize before rendering |
| 243 | attotime current_time = | |
| 243 | attotime current_time = | |
| 244 | 244 | if (!debug && !skipped_it && effective_throttle()) |
| 245 | 245 | update_throttle(current_time); |
| 246 | 246 | |
| r10315 | r10316 | |
| 403 | 403 | |
| 404 | 404 | // reset the state |
| 405 | 405 | m_movie_frame = 0; |
| 406 | m_movie_next_frame_time = | |
| 406 | m_movie_next_frame_time = | |
| 407 | 407 | |
| 408 | 408 | // start up an AVI recording |
| 409 | 409 | if (format == MF_AVI) |
| r10315 | r10316 | |
| 576 | 576 | |
| 577 | 577 | void video_manager::postload() |
| 578 | 578 | { |
| 579 | m_movie_next_frame_time = | |
| 579 | m_movie_next_frame_time = | |
| 580 | 580 | } |
| 581 | 581 | |
| 582 | 582 | |
| r10315 | r10316 | |
| 1229 | 1229 | |
| 1230 | 1230 | // start the profiler and get the current time |
| 1231 | 1231 | g_profiler.start(PROFILER_MOVIE_REC); |
| 1232 | attotime curtime = | |
| 1232 | attotime curtime = | |
| 1233 | 1233 | |
| 1234 | 1234 | // create the bitmap |
| 1235 | 1235 | create_snapshot_bitmap(NULL); |
| r10315 | r10316 | |
|---|---|---|
| 1536 | 1536 | /* interpolate if appropriate and if time has passed since the last update */ |
| 1537 | 1537 | if (analog->interpolate && !(analog->field->flags & ANALOG_FLAG_RESET) && portdata->last_delta_nsec != 0) |
| 1538 | 1538 | { |
| 1539 | attoseconds_t nsec_since_last = ( | |
| 1539 | attoseconds_t nsec_since_last = ( | |
| 1540 | 1540 | value = analog->previous + ((INT64)(analog->accum - analog->previous) * nsec_since_last / portdata->last_delta_nsec); |
| 1541 | 1541 | } |
| 1542 | 1542 | |
| r10315 | r10316 | |
| 2465 | 2465 | input_port_private *portdata = machine->input_port_data; |
| 2466 | 2466 | const input_field_config *mouse_field = NULL; |
| 2467 | 2467 | int ui_visible = ui_is_menu_active(); |
| 2468 | attotime curtime = | |
| 2468 | attotime curtime = | |
| 2469 | 2469 | const input_port_config *port; |
| 2470 | 2470 | render_target *mouse_target; |
| 2471 | 2471 | INT32 mouse_target_x; |
| r10315 | r10316 | |
| 4925 | 4925 | static void setup_keybuffer(running_machine *machine) |
| 4926 | 4926 | { |
| 4927 | 4927 | input_port_private *portdata = machine->input_port_data; |
| 4928 | portdata->inputx_timer = timer_alloc( | |
| 4928 | portdata->inputx_timer = machine->scheduler().timer_alloc(FUNC(in | |
| 4929 | 4929 | portdata->keybuffer = auto_alloc_clear(machine, key_buffer); |
| 4930 | 4930 | machine->add_notifier(MACHINE_NOTIFY_EXIT, clear_keybuffer); |
| 4931 | 4931 | } |
| r10315 | r10316 | |
|---|---|---|
| 672 | 672 | |
| 673 | 673 | |
| 674 | 674 | //------------------------------------------------- |
| 675 | // timer_alloc - allocate a timer for our device | |
| 676 | // callback | |
| 677 | //------------------------------------------------- | |
| 678 | ||
| 679 | emu_timer *device_t::timer_alloc(device_timer_id id, void *ptr) | |
| 680 | { | |
| 681 | return m_machine.scheduler().timer_alloc(*this, id, ptr); | |
| 682 | } | |
| 683 | ||
| 684 | ||
| 685 | //------------------------------------------------- | |
| 686 | // timer_set - set a temporary timer that will | |
| 687 | // call our device callback | |
| 688 | //------------------------------------------------- | |
| 689 | ||
| 690 | void device_t::timer_set(attotime duration, device_timer_id id, int param, void *ptr) | |
| 691 | { | |
| 692 | m_machine.scheduler().timer_set(duration, *this, id, param, ptr); | |
| 693 | } | |
| 694 | ||
| 695 | ||
| 696 | //------------------------------------------------- | |
| 675 | 697 | // find_interfaces - locate fast interfaces |
| 676 | 698 | //------------------------------------------------- |
| 677 | 699 |
| r10315 | r10316 | |
|---|---|---|
| 430 | 430 | void set_clock_scale(double clockscale); |
| 431 | 431 | attotime clocks_to_attotime(UINT64 clocks) const; |
| 432 | 432 | UINT64 attotime_to_clocks(attotime duration) const; |
| 433 | void timer_fired(emu_timer &timer, device_timer_id id, int param, void *ptr) { device_timer(timer, id, param, ptr); } | |
| 433 | ||
| 434 | // timer interfaces | |
| 435 | emu_timer *timer_alloc(device_timer_id id = 0, void *ptr = NULL); | |
| 436 | void timer_set(attotime duration, device_timer_id id = 0, int param = 0, void *ptr = NULL); | |
| 437 | void synchronize(device_timer_id id = 0, int param = 0, void *ptr = NULL) { timer_set(attotime::zero, id, param, ptr); } | |
| 438 | void timer_expired(emu_timer &timer, device_timer_id id, int param, void *ptr) { device_timer(timer, id, param, ptr); } | |
| 434 | 439 | |
| 435 | 440 | // debugging |
| 436 | 441 | device_debug *debug() const { return m_debug; } |
| r10315 | r10316 | |
|---|---|---|
| 85 | 85 | #include "disound.h" |
| 86 | 86 | #include "dinvram.h" |
| 87 | 87 | #include "didisasm.h" |
| 88 | #include "schedule.h" | |
| 88 | 89 | #include "timer.h" |
| 89 | #include "schedule.h" | |
| 90 | 90 | |
| 91 | 91 | // I/O |
| 92 | 92 | #include "input.h" |
| r10315 | r10316 | |
|---|---|---|
| 154 | 154 | sample_rate(options_get_int(&options, OPTION_SAMPLERATE)), |
| 155 | 155 | debug_flags(0), |
| 156 | 156 | ui_active(false), |
| 157 | mame_data(NULL), | |
| 158 | timer_data(NULL), | |
| 159 | 157 | state_data(NULL), |
| 160 | 158 | memory_data(NULL), |
| 161 | 159 | palette_data(NULL), |
| 162 | 160 | tilemap_data(NULL), |
| 163 | streams_data(NULL), | |
| 164 | devices_data(NULL), | |
| 165 | 161 | romload_data(NULL), |
| 166 | 162 | input_data(NULL), |
| 167 | 163 | input_port_data(NULL), |
| r10315 | r10316 | |
| 274 | 270 | m_render = auto_alloc(this, render_manager(*this)); |
| 275 | 271 | generic_machine_init(this); |
| 276 | 272 | generic_sound_init(this); |
| 273 | ||
| 274 | m_scheduler.register_for_save(); | |
| 277 | 275 | |
| 278 | // initialize the timers and allocate a soft_reset timer | |
| 279 | // this must be done before cpu_init so that CPU's can allocate timers | |
| 280 | timer_init(this); | |
| 281 | m_soft_reset_timer = timer_alloc(this, static_soft_reset, NULL); | |
| 276 | // allocate a soft_reset timer | |
| 277 | m_soft_reset_timer = m_scheduler.timer_alloc(MFUNC(timer_expired, running_machine, soft_reset), this); | |
| 282 | 278 | |
| 283 | 279 | // init the osd layer |
| 284 | 280 | m_osd.init(*this); |
| r10315 | r10316 | |
| 288 | 284 | ui_init(this); |
| 289 | 285 | |
| 290 | 286 | // initialize the base time (needed for doing record/playback) |
| 291 | time(&m_base_time); | |
| 287 | ::time(&m_base_time); | |
| 292 | 288 | |
| 293 | 289 | // initialize the input system and input ports for the game |
| 294 | 290 | // this must be done before memory_init in order to allow specifying |
| r10315 | r10316 | |
| 386 | 382 | ui_display_startup_screens(this, firstrun, !settingsloaded); |
| 387 | 383 | |
| 388 | 384 | // perform a soft reset -- this takes us to the running phase |
| 389 | soft_reset(); | |
| 385 | soft_reset(*this); | |
| 390 | 386 | |
| 391 | 387 | // run the CPUs until a reset or exit |
| 392 | 388 | m_hard_reset_pending = false; |
| r10315 | r10316 | |
| 466 | 462 | m_scheduler.eat_all_cycles(); |
| 467 | 463 | |
| 468 | 464 | // if we're autosaving on exit, schedule a save as well |
| 469 | if (options_get_bool(&m_options, OPTION_AUTOSAVE) && (m_game.flags & GAME_SUPPORTS_SAVE) && ti | |
| 465 | if (options_get_bool(&m_options, OPTION_AUTOSAVE) && (m_game.flags & GAME_SUPPORTS_SAVE) && this-> | |
| 470 | 466 | schedule_save("auto"); |
| 471 | 467 | } |
| 472 | 468 | |
| r10315 | r10316 | |
| 550 | 546 | |
| 551 | 547 | // note the start time and set a timer for the next timeslice to actually schedule it |
| 552 | 548 | m_saveload_schedule = SLS_SAVE; |
| 553 | m_saveload_schedule_time = ti | |
| 549 | m_saveload_schedule_time = this-> | |
| 554 | 550 | |
| 555 | 551 | // we can't be paused since we need to clear out anonymous timers |
| 556 | 552 | resume(); |
| r10315 | r10316 | |
| 569 | 565 | |
| 570 | 566 | // note the start time and set a timer for the next timeslice to actually schedule it |
| 571 | 567 | m_saveload_schedule = SLS_LOAD; |
| 572 | m_saveload_schedule_time = ti | |
| 568 | m_saveload_schedule_time = this-> | |
| 573 | 569 | |
| 574 | 570 | // we can't be paused since we need to clear out anonymous timers |
| 575 | 571 | resume(); |
| r10315 | r10316 | |
| 735 | 731 | |
| 736 | 732 | void running_machine::current_datetime(system_time &systime) |
| 737 | 733 | { |
| 738 | systime.set(m_base_time + ti | |
| 734 | systime.set(m_base_time + this-> | |
| 739 | 735 | } |
| 740 | 736 | |
| 741 | 737 | |
| r10315 | r10316 | |
| 783 | 779 | |
| 784 | 780 | // if there are anonymous timers, we can't save just yet, and we can't load yet either |
| 785 | 781 | // because the timers might overwrite data we have loaded |
| 786 | if ( | |
| 782 | if ( | |
| 787 | 783 | { |
| 788 | 784 | // if more than a second has passed, we're probably screwed |
| 789 | if ((ti | |
| 785 | if ((this-> | |
| 790 | 786 | { |
| 791 | 787 | popmessage("Unable to %s due to pending anonymous timers. See error.log for details.", opname); |
| 792 | 788 | goto cancel; |
| r10315 | r10316 | |
| 856 | 852 | // of the system |
| 857 | 853 | //------------------------------------------------- |
| 858 | 854 | |
| 859 | TIMER_CALLBACK( running_machine::static_soft_reset ) { machine->soft_reset(); } | |
| 860 | ||
| 861 | void running_machine::soft_reset() | |
| 855 | void running_machine::soft_reset(running_machine &machine, int param) | |
| 862 | 856 | { |
| 863 | 857 | logerror("Soft reset\n"); |
| 864 | 858 | |
| r10315 | r10316 | |
| 870 | 864 | |
| 871 | 865 | // now we're running |
| 872 | 866 | m_current_phase = MACHINE_PHASE_RUNNING; |
| 873 | ||
| 874 | // allow 0-time queued callbacks to run before any CPUs execute | |
| 875 | timer_execute_timers(this); | |
| 876 | 867 | } |
| 877 | 868 | |
| 878 | 869 |
| r10315 | r10316 | |
|---|---|---|
| 427 | 427 | m_out_char_ram_func = m_config.out_char_ram_func; |
| 428 | 428 | |
| 429 | 429 | // allocate timers |
| 430 | m_prd_timer = | |
| 430 | m_prd_timer = | |
| 431 | 431 | update_prd_changed_timer(); |
| 432 | 432 | |
| 433 | 433 | // initialize palette |
| r10315 | r10316 | |
|---|---|---|
| 1940 | 1940 | { |
| 1941 | 1941 | cymfile = fopen("2413_.cym","wb"); |
| 1942 | 1942 | if (cymfile) |
| 1943 | | |
| 1943 | | |
| 1944 | 1944 | else |
| 1945 | 1945 | logerror("Could not create file 2413_.cym\n"); |
| 1946 | 1946 | } |
| r10315 | r10316 | |
|---|---|---|
| 1048 | 1048 | } |
| 1049 | 1049 | |
| 1050 | 1050 | tms->state = CTL_STATE_INPUT; /* most probably not defined */ |
| 1051 | tms->romclk_hack_timer = | |
| 1051 | tms->romclk_hack_timer = | |
| 1052 | 1052 | |
| 1053 | 1053 | register_for_save_states(tms); |
| 1054 | 1054 | } |
| r10315 | r10316 | |
| 1421 | 1421 | tms->device = device; |
| 1422 | 1422 | tms->clock = device->clock(); |
| 1423 | 1423 | |
| 1424 | tms->romclk_timer = | |
| 1424 | tms->romclk_timer = | |
| 1425 | 1425 | timer_adjust_periodic(tms->romclk_timer, attotime::zero, 0, attotime::from_hz(tms->clock)); |
| 1426 | 1426 | |
| 1427 | 1427 | tms->bit = 0; |
| r10315 | r10316 | |
|---|---|---|
| 108 | 108 | |
| 109 | 109 | /* FM init */ |
| 110 | 110 | /* Timer Handler set */ |
| 111 | info->timer[0] = timer_alloc(device->machine, timer_callback_2612_0, info); | |
| 112 | info->timer[1] = timer_alloc(device->machine, timer_callback_2612_1, info); | |
| 111 | info->timer[0] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_2612_0), info); | |
| 112 | info->timer[1] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_2612_1), info); | |
| 113 | 113 | |
| 114 | 114 | /* stream system initialize */ |
| 115 | 115 | info->stream = device->machine->sound().stream_alloc(*device,0,2,rate,info,ym2612_stream_update); |
| r10315 | r10316 | |
|---|---|---|
| 105 | 105 | ym3526_set_irq_handler (info->chip, IRQHandler, info); |
| 106 | 106 | ym3526_set_update_handler(info->chip, _stream_update, info); |
| 107 | 107 | |
| 108 | info->timer[0] = timer_alloc(device->machine, timer_callback_0, info); | |
| 109 | info->timer[1] = timer_alloc(device->machine, timer_callback_1, info); | |
| 108 | info->timer[0] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_0), info); | |
| 109 | info->timer[1] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_1), info); | |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | static DEVICE_STOP( ym3526 ) |
| r10315 | r10316 | |
|---|---|---|
| 470 | 470 | // One or more of the registers must be the timer period |
| 471 | 471 | // And anyway, this particular frequency is probably wrong |
| 472 | 472 | // 480 hz is TRUSTED by gokuparo disco stage - the looping sample doesn't line up otherwise |
| 473 | | |
| 473 | | |
| 474 | 474 | |
| 475 | 475 | info->stream = device->machine->sound().stream_alloc(*device, 0, 2, device->clock(), info, k054539_update); |
| 476 | 476 |
| r10315 | r10316 | |
|---|---|---|
| 188 | 188 | |
| 189 | 189 | /* stream system initialize */ |
| 190 | 190 | voice->stream = device->machine->sound().stream_alloc(*device,0,1,device->clock(),voice,MSM5205_update); |
| 191 | voice->timer = | |
| 191 | voice->timer = | |
| 192 | 192 | |
| 193 | 193 | /* initialize */ |
| 194 | 194 | DEVICE_RESET_CALL(msm5205); |
| r10315 | r10316 | |
|---|---|---|
| 106 | 106 | ym3812_set_irq_handler (info->chip, IRQHandler, info); |
| 107 | 107 | ym3812_set_update_handler(info->chip, _stream_update, info); |
| 108 | 108 | |
| 109 | info->timer[0] = timer_alloc(device->machine, timer_callback_0, info); | |
| 110 | info->timer[1] = timer_alloc(device->machine, timer_callback_1, info); | |
| 109 | info->timer[0] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_0), info); | |
| 110 | info->timer[1] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_1), info); | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | static DEVICE_STOP( ym3812 ) |
| r10315 | r10316 | |
|---|---|---|
| 116 | 116 | static TIMER_CALLBACK( update_irq_state_timer_6 ); |
| 117 | 117 | static TIMER_CALLBACK( update_irq_state_timer_7 ); |
| 118 | 118 | |
| 119 | static const timer_ | |
| 119 | static const timer_expired_func update_irq_state_cb[] = | |
| 120 | 120 | { |
| 121 | 121 | update_irq_state_timer_0, |
| 122 | 122 | update_irq_state_timer_1, |
| r10315 | r10316 | |
| 205 | 205 | struct YMZ280BVoice *voice = &chip->voice[j]; |
| 206 | 206 | update_step(chip, voice); |
| 207 | 207 | if(voice->irq_schedule) |
| 208 | timer_set( | |
| 208 | machine->scheduler().timer_set( | |
| 209 | 209 | } |
| 210 | 210 | } |
| 211 | 211 | |
| r10315 | r10316 | |
| 581 | 581 | voice->playing = 0; |
| 582 | 582 | |
| 583 | 583 | /* set update_irq_state_timer. IRQ is signaled on next CPU execution. */ |
| 584 | | |
| 584 | | |
| 585 | 585 | voice->irq_schedule = 1; |
| 586 | 586 | } |
| 587 | 587 | } |
| r10315 | r10316 | |
|---|---|---|
| 145 | 145 | if(VERBOSE_LEVEL >= N) \ |
| 146 | 146 | { \ |
| 147 | 147 | if( M ) \ |
| 148 | logerror("%11.6f: %-24s", | |
| 148 | logerror("%11.6f: %-24s", | |
| 149 | 149 | logerror A; \ |
| 150 | 150 | } \ |
| 151 | 151 | } while (0) |
| r10315 | r10316 | |
| 460 | 460 | break; |
| 461 | 461 | case 6: /*lightpen horizontal */ |
| 462 | 462 | case 7: /*lightpen vertical */ |
| 463 | if (LIGHTPEN_BUTTON && (( | |
| 463 | if (LIGHTPEN_BUTTON && (( | |
| 464 | 464 | { |
| 465 | 465 | /* only 1 update each frame */ |
| 466 | 466 | /* and diode must recognize light */ |
| r10315 | r10316 | |
| 469 | 469 | mos6560->reg[6] = MOS656X_X_VALUE; |
| 470 | 470 | mos6560->reg[7] = MOS656X_Y_VALUE; |
| 471 | 471 | } |
| 472 | mos6560->lightpenreadtime = | |
| 472 | mos6560->lightpenreadtime = | |
| 473 | 473 | } |
| 474 | 474 | val = mos6560->reg[offset]; |
| 475 | 475 | break; |
| r10315 | r10316 | |
|---|---|---|
| 2268 | 2268 | { |
| 2269 | 2269 | cymfile = fopen("ymf262_.cym","wb"); |
| 2270 | 2270 | if (cymfile) |
| 2271 | | |
| 2271 | | |
| 2272 | 2272 | else |
| 2273 | 2273 | logerror("Could not create ymf262_.cym file\n"); |
| 2274 | 2274 | } |
| r10315 | r10316 | |
|---|---|---|
| 517 | 517 | } |
| 518 | 518 | } |
| 519 | 519 | |
| 520 | AICA->timerA = timer_alloc(device->machine, timerA_cb, AICA); | |
| 521 | AICA->timerB = timer_alloc(device->machine, timerB_cb, AICA); | |
| 522 | AICA->timerC = timer_alloc(device->machine, timerC_cb, AICA); | |
| 520 | AICA->timerA = device->machine->scheduler().timer_alloc(FUNC(timerA_cb), AICA); | |
| 521 | AICA->timerB = device->machine->scheduler().timer_alloc(FUNC(timerB_cb), AICA); | |
| 522 | AICA->timerC = device->machine->scheduler().timer_alloc(FUNC(timerC_cb), AICA); | |
| 523 | 523 | |
| 524 | 524 | for(i=0;i<0x400;++i) |
| 525 | 525 | { |
| r10315 | r10316 | |
|---|---|---|
| 146 | 146 | |
| 147 | 147 | k056800->irq_cb = intf->irq_cb; |
| 148 | 148 | |
| 149 | k056800->sound_cpu_timer = | |
| 149 | k056800->sound_cpu_timer = | |
| 150 | 150 | timer_adjust_periodic(k056800->sound_cpu_timer, timer_period, 0, timer_period); |
| 151 | 151 | |
| 152 | 152 | state_save_register_device_item_array(device, 0, k056800->host_reg); |
| r10315 | r10316 | |
|---|---|---|
| 655 | 655 | /* compute the ROM base or allocate a timer */ |
| 656 | 656 | chip->rom = chip->rombase = *device->region(); |
| 657 | 657 | if (chip->rom == NULL) |
| 658 | chip->timer = | |
| 658 | chip->timer = | |
| 659 | 659 | |
| 660 | 660 | /* set the DRQ callback */ |
| 661 | 661 | chip->drqcallback = intf->drqcallback; |
| r10315 | r10316 | |
|---|---|---|
| 1752 | 1752 | |
| 1753 | 1753 | static void ymf271_init(device_t *device, YMF271Chip *chip, UINT8 *rom, void (*cb)(device_t *,int), const devcb_read8 *ext_read, const devcb_write8 *ext_write) |
| 1754 | 1754 | { |
| 1755 | chip->timA = timer_alloc(device->machine, ymf271_timer_a_tick, chip); | |
| 1756 | chip->timB = timer_alloc(device->machine, ymf271_timer_b_tick, chip); | |
| 1755 | chip->timA = device->machine->scheduler().timer_alloc(FUNC(ymf271_timer_a_tick), chip); | |
| 1756 | chip->timB = device->machine->scheduler().timer_alloc(FUNC(ymf271_timer_b_tick), chip); | |
| 1757 | 1757 | |
| 1758 | 1758 | chip->rom = rom; |
| 1759 | 1759 | chip->irq_callback = cb; |
| r10315 | r10316 | |
|---|---|---|
| 651 | 651 | chip->clockmult = DIV_64; |
| 652 | 652 | chip->KBCODE = 0x09; /* Atari 800 'no key' */ |
| 653 | 653 | chip->SKCTL = SK_RESET; /* let the RNG run after reset */ |
| 654 | chip->rtimer = | |
| 654 | chip->rtimer = | |
| 655 | 655 | |
| 656 | chip->timer[0] = timer_alloc(device->machine, pokey_timer_expire, chip); | |
| 657 | chip->timer[1] = timer_alloc(device->machine, pokey_timer_expire, chip); | |
| 658 | chip->timer[2] = timer_alloc(device->machine, pokey_timer_expire, chip); | |
| 656 | chip->timer[0] = device->machine->scheduler().timer_alloc(FUNC(pokey_timer_expire), chip); | |
| 657 | chip->timer[1] = device->machine->scheduler().timer_alloc(FUNC(pokey_timer_expire), chip); | |
| 658 | chip->timer[2] = device->machine->scheduler().timer_alloc(FUNC(pokey_timer_expire), chip); | |
| 659 | 659 | |
| 660 | 660 | for (i=0; i<8; i++) |
| 661 | 661 | { |
| 662 | chip->ptimer[i] = | |
| 662 | chip->ptimer[i] = | |
| 663 | 663 | devcb_resolve_read8(&chip->pot_r[i], &chip->intf.pot_r[i], device); |
| 664 | 664 | } |
| 665 | 665 | devcb_resolve_read8(&chip->allpot_r, &chip->intf.allpot_r, device); |
| r10315 | r10316 | |
| 1141 | 1141 | * loaders from Ballblazer and Escape from Fractalus |
| 1142 | 1142 | * The real times are unknown |
| 1143 | 1143 | */ |
| 1144 | | |
| 1144 | | |
| 1145 | 1145 | /* 10 bits (assumption 1 start, 8 data and 1 stop bit) take how long? */ |
| 1146 | | |
| 1146 | | |
| 1147 | 1147 | break; |
| 1148 | 1148 | |
| 1149 | 1149 | case IRQEN_C: |
| r10315 | r10316 | |
| 1338 | 1338 | void pokey_serin_ready(device_t *device, int after) |
| 1339 | 1339 | { |
| 1340 | 1340 | pokey_state *p = get_safe_token(device); |
| 1341 | | |
| 1341 | | |
| 1342 | 1342 | } |
| 1343 | 1343 | |
| 1344 | 1344 | void pokey_break_w(device_t *device, int shift) |
| r10315 | r10316 | |
|---|---|---|
| 208 | 208 | if (sp->drq != NULL) |
| 209 | 209 | { |
| 210 | 210 | sp->drq(sp->device, ASSERT_LINE); |
| 211 | | |
| 211 | | |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | sp->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock() / CLOCK_DIVIDER, sp, sp0250_update); |
| r10315 | r10316 | |
|---|---|---|
| 159 | 159 | for (i = 0; i < FILTER_LENGTH; i++) |
| 160 | 160 | sp->composed_volume[i] = 0; |
| 161 | 161 | sp->composed_sample_index = 0; |
| 162 | sp->last_update_time = | |
| 162 | sp->last_update_time = | |
| 163 | 163 | sp->channel_sample_period = HZ_TO_ATTOSECONDS(device->machine->sample_rate); |
| 164 | 164 | sp->channel_sample_period_secfrac = ATTOSECONDS_TO_DOUBLE(sp->channel_sample_period); |
| 165 | 165 | sp->interm_sample_period = sp->channel_sample_period / RATE_MULTIPLIER; |
| r10315 | r10316 | |
| 275 | 275 | new_level = sp->num_levels - 1; |
| 276 | 276 | |
| 277 | 277 | volume = sp->levels[sp->level]; |
| 278 | time = | |
| 278 | time = | |
| 279 | 279 | |
| 280 | 280 | if (time < sp->channel_next_sample_time) |
| 281 | 281 | { |
| r10315 | r10316 | |
|---|---|---|
| 824 | 824 | if (chip->irq_enable & 0x04) |
| 825 | 825 | { |
| 826 | 826 | chip->status |= 1; |
| 827 | timer_set( | |
| 827 | machine->scheduler().timer_set( | |
| 828 | 828 | } |
| 829 | 829 | if (chip->irq_enable & 0x80) |
| 830 | 830 | chip->csm_req = 2; /* request KEY ON / KEY OFF sequence */ |
| r10315 | r10316 | |
| 837 | 837 | if (chip->irq_enable & 0x08) |
| 838 | 838 | { |
| 839 | 839 | chip->status |= 2; |
| 840 | timer_set( | |
| 840 | machine->scheduler().timer_set( | |
| 841 | 841 | } |
| 842 | 842 | } |
| 843 | 843 | #if 0 |
| r10315 | r10316 | |
| 1098 | 1098 | { |
| 1099 | 1099 | #ifdef USE_MAME_TIMERS |
| 1100 | 1100 | chip->status &= ~1; |
| 1101 | | |
| 1101 | | |
| 1102 | 1102 | #else |
| 1103 | 1103 | int oldstate = chip->status & 3; |
| 1104 | 1104 | chip->status &= ~1; |
| r10315 | r10316 | |
| 1110 | 1110 | { |
| 1111 | 1111 | #ifdef USE_MAME_TIMERS |
| 1112 | 1112 | chip->status &= ~2; |
| 1113 | | |
| 1113 | | |
| 1114 | 1114 | #else |
| 1115 | 1115 | int oldstate = chip->status & 3; |
| 1116 | 1116 | chip->status &= ~2; |
| r10315 | r10316 | |
| 1533 | 1533 | |
| 1534 | 1534 | #ifdef USE_MAME_TIMERS |
| 1535 | 1535 | /* this must be done _before_ a call to ym2151_reset_chip() */ |
| 1536 | PSG->timer_A = timer_alloc(device->machine, timer_callback_a, PSG); | |
| 1537 | PSG->timer_B = timer_alloc(device->machine, timer_callback_b, PSG); | |
| 1536 | PSG->timer_A = device->machine->scheduler().timer_alloc(FUNC(timer_callback_a), PSG); | |
| 1537 | PSG->timer_B = device->machine->scheduler().timer_alloc(FUNC(timer_callback_b), PSG); | |
| 1538 | 1538 | #else |
| 1539 | 1539 | PSG->tim_A = 0; |
| 1540 | 1540 | PSG->tim_B = 0; |
| r10315 | r10316 | |
| 1546 | 1546 | { |
| 1547 | 1547 | cymfile = fopen("2151_.cym","wb"); |
| 1548 | 1548 | if (cymfile) |
| 1549 | | |
| 1549 | | |
| 1550 | 1550 | else |
| 1551 | 1551 | logerror("Could not create file 2151_.cym\n"); |
| 1552 | 1552 | } |
| r10315 | r10316 | |
|---|---|---|
| 547 | 547 | scsp->SCSPRAM += intf->roffset; |
| 548 | 548 | } |
| 549 | 549 | |
| 550 | scsp->timerA = timer_alloc(device->machine, timerA_cb, scsp); | |
| 551 | scsp->timerB = timer_alloc(device->machine, timerB_cb, scsp); | |
| 552 | scsp->timerC = timer_alloc(device->machine, timerC_cb, scsp); | |
| 550 | scsp->timerA = device->machine->scheduler().timer_alloc(FUNC(timerA_cb), scsp); | |
| 551 | scsp->timerB = device->machine->scheduler().timer_alloc(FUNC(timerB_cb), scsp); | |
| 552 | scsp->timerC = device->machine->scheduler().timer_alloc(FUNC(timerC_cb), scsp); | |
| 553 | 553 | |
| 554 | 554 | for(i=0;i<0x400;++i) |
| 555 | 555 | { |
| r10315 | r10316 | |
|---|---|---|
| 156 | 156 | assert_always(info->psg != NULL, "Error creating YM2610/AY8910 chip"); |
| 157 | 157 | |
| 158 | 158 | /* Timer Handler set */ |
| 159 | info->timer[0] = timer_alloc(device->machine, timer_callback_0, info); | |
| 160 | info->timer[1] = timer_alloc(device->machine, timer_callback_1, info); | |
| 159 | info->timer[0] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_0), info); | |
| 160 | info->timer[1] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_1), info); | |
| 161 | 161 | |
| 162 | 162 | /* stream system initialize */ |
| 163 | 163 | info->stream = device->machine->sound().stream_alloc(*device,0,2,rate,info,(type == YM2610) ? ym2610_stream_update : ym2610b_stream_update); |
| r10315 | r10316 | |
|---|---|---|
| 1744 | 1744 | { |
| 1745 | 1745 | cymfile = fopen("3812_.cym","wb"); |
| 1746 | 1746 | if (cymfile) |
| 1747 | | |
| 1747 | | |
| 1748 | 1748 | else |
| 1749 | 1749 | logerror("Could not create file 3812_.cym\n"); |
| 1750 | 1750 | } |
| r10315 | r10316 | |
|---|---|---|
| 47 | 47 | void ics2115_device::device_start() |
| 48 | 48 | { |
| 49 | 49 | m_rom = *region(); |
| 50 | m_timer[0].timer = timer_alloc(machine, timer_cb_0, this); | |
| 51 | m_timer[1].timer = timer_alloc(machine, timer_cb_1, this); | |
| 50 | m_timer[0].timer = machine->scheduler().timer_alloc(FUNC(timer_cb_0), this); | |
| 51 | m_timer[1].timer = machine->scheduler().timer_alloc(FUNC(timer_cb_1), this); | |
| 52 | 52 | m_stream = m_machine.sound().stream_alloc(*this, 0, 2, 33075); |
| 53 | 53 | |
| 54 | 54 | //Exact formula as per patent 5809466 |
| r10315 | r10316 | |
|---|---|---|
| 42 | 42 | #if FM_BUSY_FLAG_SUPPORT |
| 43 | 43 | #define TIME_TYPE attotime |
| 44 | 44 | #define UNDEFINED_TIME attotime::zero |
| 45 | #define FM_GET_TIME_NOW(machine) | |
| 45 | #define FM_GET_TIME_NOW(machine) | |
| 46 | 46 | #define ADD_TIMES(t1, t2) ((t1) + (t2)) |
| 47 | 47 | #define COMPARE_TIMES(t1, t2) (((t1) == (t2)) ? 0 : ((t1) < (t2)) ? -1 : 1) |
| 48 | 48 | #define MULTIPLY_TIME_BY_INT(t,i) ((t) * (i)) |
| r10315 | r10316 | |
|---|---|---|
| 245 | 245 | |
| 246 | 246 | void bsmt2000_device::device_reset() |
| 247 | 247 | { |
| 248 | | |
| 248 | | |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | |
| r10315 | r10316 | |
| 312 | 312 | |
| 313 | 313 | void bsmt2000_device::write_reg(UINT16 data) |
| 314 | 314 | { |
| 315 | | |
| 315 | | |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | |
| r10315 | r10316 | |
| 323 | 323 | |
| 324 | 324 | void bsmt2000_device::write_data(UINT16 data) |
| 325 | 325 | { |
| 326 | | |
| 326 | | |
| 327 | 327 | |
| 328 | 328 | // boost the interleave on a write so that the caller detects the status more accurately |
| 329 | 329 | m_machine.scheduler().boost_interleave(attotime::from_usec(1), attotime::from_usec(10)); |
| r10315 | r10316 | |
|---|---|---|
| 152 | 152 | assert_always(info->psg != NULL, "Error creating YM2608/AY8910 chip"); |
| 153 | 153 | |
| 154 | 154 | /* Timer Handler set */ |
| 155 | info->timer[0] = timer_alloc(device->machine, timer_callback_2608_0, info); | |
| 156 | info->timer[1] = timer_alloc(device->machine, timer_callback_2608_1, info); | |
| 155 | info->timer[0] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_2608_0), info); | |
| 156 | info->timer[1] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_2608_1), info); | |
| 157 | 157 | |
| 158 | 158 | /* stream system initialize */ |
| 159 | 159 | info->stream = device->machine->sound().stream_alloc(*device,0,2,rate,info,ym2608_stream_update); |
| r10315 | r10316 | |
|---|---|---|
| 449 | 449 | cdp1864->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate, cdp1864, cdp1864_stream_update); |
| 450 | 450 | |
| 451 | 451 | /* create the timers */ |
| 452 | cdp1864->int_timer = timer_alloc(device->machine, cdp1864_int_tick, (void *)device); | |
| 453 | cdp1864->efx_timer = timer_alloc(device->machine, cdp1864_efx_tick, (void *)device); | |
| 454 | cdp1864->dma_timer = timer_alloc(device->machine, cdp1864_dma_tick, (void *)device); | |
| 452 | cdp1864->int_timer = device->machine->scheduler().timer_alloc(FUNC(cdp1864_int_tick), (void *)device); | |
| 453 | cdp1864->efx_timer = device->machine->scheduler().timer_alloc(FUNC(cdp1864_efx_tick), (void *)device); | |
| 454 | cdp1864->dma_timer = device->machine->scheduler().timer_alloc(FUNC(cdp1864_dma_tick), (void *)device); | |
| 455 | 455 | |
| 456 | 456 | /* register for state saving */ |
| 457 | 457 | state_save_register_device_item(device, 0, cdp1864->disp); |
| r10315 | r10316 | |
|---|---|---|
| 666 | 666 | { |
| 667 | 667 | chip->rom = *device->region(); |
| 668 | 668 | chip->irq_callback = cb; |
| 669 | chip->timer_a = timer_alloc(device->machine, ymf278b_timer_a_tick, chip); | |
| 670 | chip->timer_b = timer_alloc(device->machine, ymf278b_timer_b_tick, chip); | |
| 669 | chip->timer_a = device->machine->scheduler().timer_alloc(FUNC(ymf278b_timer_a_tick), chip); | |
| 670 | chip->timer_b = device->machine->scheduler().timer_alloc(FUNC(ymf278b_timer_b_tick), chip); | |
| 671 | 671 | chip->irq_line = CLEAR_LINE; |
| 672 | 672 | chip->clock = device->clock(); |
| 673 | 673 | } |
| r10315 | r10316 | |
|---|---|---|
| 258 | 258 | |
| 259 | 259 | /* setup SH1 timer if necessary */ |
| 260 | 260 | if ( ic->intf->irq ) |
| 261 | | |
| 261 | | |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | INLINE void check_bounds( k053260_state *ic, int channel ) |
| r10315 | r10316 | |
|---|---|---|
| 14 | 14 | typedef struct _k053260_interface k053260_interface; |
| 15 | 15 | struct _k053260_interface { |
| 16 | 16 | const char *rgnoverride; |
| 17 | timer_ | |
| 17 | timer_expired_func irq; /* called on SH1 complete cycle ( clock / 32 ) */ | |
| 18 | 18 | }; |
| 19 | 19 | |
| 20 | 20 |
| r10315 | r10316 | |
|---|---|---|
| 139 | 139 | y8950_set_irq_handler (info->chip, IRQHandler, info); |
| 140 | 140 | y8950_set_update_handler(info->chip, _stream_update, info); |
| 141 | 141 | |
| 142 | info->timer[0] = timer_alloc(device->machine, timer_callback_0, info); | |
| 143 | info->timer[1] = timer_alloc(device->machine, timer_callback_1, info); | |
| 142 | info->timer[0] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_0), info); | |
| 143 | info->timer[1] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_1), info); | |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | static DEVICE_STOP( y8950 ) |
| r10315 | r10316 | |
|---|---|---|
| 133 | 133 | |
| 134 | 134 | memset(m_regs, 0, sizeof(m_regs)); |
| 135 | 135 | |
| 136 | m_sync_timer = t | |
| 136 | m_sync_timer = t | |
| 137 | 137 | |
| 138 | 138 | state_save_register_device_item(this, 0, m_fifo_a_rdptr); |
| 139 | 139 | state_save_register_device_item(this, 0, m_fifo_b_rdptr); |
| r10315 | r10316 | |
|---|---|---|
| 134 | 134 | assert_always(info->psg != NULL, "Error creating YM2203/AY8910 chip"); |
| 135 | 135 | |
| 136 | 136 | /* Timer Handler set */ |
| 137 | info->timer[0] = timer_alloc(device->machine, timer_callback_2203_0, info); | |
| 138 | info->timer[1] = timer_alloc(device->machine, timer_callback_2203_1, info); | |
| 137 | info->timer[0] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_2203_0), info); | |
| 138 | info->timer[1] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_2203_1), info); | |
| 139 | 139 | |
| 140 | 140 | /* stream system initialize */ |
| 141 | 141 | info->stream = device->machine->sound().stream_alloc(*device,0,1,rate,info,ym2203_stream_update); |
| r10315 | r10316 | |
|---|---|---|
| 1696 | 1696 | tms->io_ready = 0; |
| 1697 | 1697 | update_ready_state(tms); |
| 1698 | 1698 | /* How long does /READY stay inactive, when /RS is pulled low? I believe its almost always ~16 clocks (25 usec at 800khz as shown on the datasheet) */ |
| 1699 | t | |
| 1699 | t | |
| 1700 | 1700 | } |
| 1701 | 1701 | } |
| 1702 | 1702 | } |
| r10315 | r10316 | |
| 1759 | 1759 | SET RATE (5220C only): ? cycles (probably ~16) |
| 1760 | 1760 | */ |
| 1761 | 1761 | // TODO: actually HANDLE the timing differences! currently just assuming always 16 cycles |
| 1762 | t | |
| 1762 | t | |
| 1763 | 1763 | } |
| 1764 | 1764 | } |
| 1765 | 1765 | } |
| r10315 | r10316 | |
|---|---|---|
| 259 | 259 | chip->oscillators[osc].irqpend = 0; |
| 260 | 260 | chip->oscillators[osc].accumulator = 0; |
| 261 | 261 | |
| 262 | chip->oscillators[osc].timer = | |
| 262 | chip->oscillators[osc].timer = | |
| 263 | 263 | chip->oscillators[osc].chip = (void *)chip; |
| 264 | 264 | } |
| 265 | 265 |
| r10315 | r10316 | |
|---|---|---|
| 95 | 95 | ymf262_set_irq_handler (info->chip, IRQHandler_262, info); |
| 96 | 96 | ymf262_set_update_handler(info->chip, _stream_update, info); |
| 97 | 97 | |
| 98 | info->timer[0] = timer_alloc(device->machine, timer_callback_262_0, info); | |
| 99 | info->timer[1] = timer_alloc(device->machine, timer_callback_262_1, info); | |
| 98 | info->timer[0] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_262_0), info); | |
| 99 | info->timer[1] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_262_1), info); | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | static DEVICE_STOP( ymf262 ) |
| r10315 | r10316 | |
|---|---|---|
| 187 | 187 | class debug_view_manager; |
| 188 | 188 | class osd_interface; |
| 189 | 189 | |
| 190 | typedef struct _mame_private mame_private; | |
| 191 | typedef struct _cpuexec_private cpuexec_private; | |
| 192 | typedef struct _timer_private timer_private; | |
| 193 | 190 | typedef struct _state_private state_private; |
| 194 | 191 | typedef struct _memory_private memory_private; |
| 195 | 192 | typedef struct _palette_private palette_private; |
| 196 | 193 | typedef struct _tilemap_private tilemap_private; |
| 197 | typedef struct _streams_private streams_private; | |
| 198 | typedef struct _devices_private devices_private; | |
| 199 | 194 | typedef struct _romload_private romload_private; |
| 200 | 195 | typedef struct _input_private input_private; |
| 201 | 196 | typedef struct _input_port_private input_port_private; |
| r10315 | r10316 | |
| 364 | 359 | device_scheduler &scheduler() { return m_scheduler; } |
| 365 | 360 | osd_interface &osd() const { return m_osd; } |
| 366 | 361 | screen_device *first_screen() const { return primary_screen; } |
| 362 | attotime time() const { return m_scheduler.time(); } | |
| 367 | 363 | |
| 368 | 364 | // immediate operations |
| 369 | 365 | int run(bool firstrun); |
| r10315 | r10316 | |
| 381 | 377 | void schedule_save(const char *filename); |
| 382 | 378 | void schedule_load(const char *filename); |
| 383 | 379 | |
| 384 | // time | |
| 380 | // date & time | |
| 385 | 381 | void base_datetime(system_time &systime); |
| 386 | 382 | void current_datetime(system_time &systime); |
| 387 | 383 | |
| r10315 | r10316 | |
| 444 | 440 | generic_pointers generic; // generic pointers |
| 445 | 441 | |
| 446 | 442 | // internal core information |
| 447 | mame_private * mame_data; // internal data from mame.c | |
| 448 | timer_private * timer_data; // internal data from timer.c | |
| 449 | 443 | state_private * state_data; // internal data from state.c |
| 450 | 444 | memory_private * memory_data; // internal data from memory.c |
| 451 | 445 | palette_private * palette_data; // internal data from palette.c |
| 452 | 446 | tilemap_private * tilemap_data; // internal data from tilemap.c |
| 453 | streams_private * streams_data; // internal data from streams.c | |
| 454 | devices_private * devices_data; // internal data from devices.c | |
| 455 | 447 | romload_private * romload_data; // internal data from romload.c |
| 456 | 448 | input_private * input_data; // internal data from input.c |
| 457 | 449 | input_port_private * input_port_data; // internal data from inptport.c |
| r10315 | r10316 | |
| 472 | 464 | void set_saveload_filename(const char *filename); |
| 473 | 465 | void fill_systime(system_time &systime, time_t t); |
| 474 | 466 | void handle_saveload(); |
| 467 | void soft_reset(running_machine &machine, int param = 0); | |
| 475 | 468 | |
| 476 | static TIMER_CALLBACK( static_soft_reset ); | |
| 477 | void soft_reset(); | |
| 478 | ||
| 479 | 469 | static void logfile_callback(running_machine &machine, const char *buffer); |
| 480 | 470 | |
| 481 | 471 | // notifier callbacks |
| r10315 | r10316 | |
|---|---|---|
| 50 | 50 | |
| 51 | 51 | #define LOG(x) do { if (VERBOSE) logerror x; } while (0) |
| 52 | 52 | |
| 53 | #define TEMPLOG 0 | |
| 54 | 53 | |
| 55 | 54 | |
| 56 | ||
| 57 | 55 | //************************************************************************** |
| 58 | 56 | // CONSTANTS |
| 59 | 57 | //************************************************************************** |
| r10315 | r10316 | |
| 69 | 67 | |
| 70 | 68 | |
| 71 | 69 | //************************************************************************** |
| 72 | // M | |
| 70 | // EMU TIMER | |
| 73 | 71 | //************************************************************************** |
| 74 | 72 | |
| 75 | // these are macros to ensure inlining in device_scheduler::timeslice | |
| 76 | #define ATTOTIME_LT(a,b) ((a).seconds < (b).seconds || ((a).seconds == (b).seconds && (a).attoseconds < (b).attoseconds)) | |
| 77 | #define ATTOTIME_NORMALIZE(a) do { if ((a).attoseconds >= ATTOSECONDS_PER_SECOND) { (a).seconds++; (a).attoseconds -= ATTOSECONDS_PER_SECOND; } } while (0) | |
| 73 | //------------------------------------------------- | |
| 74 | // emu_timer - constructor | |
| 75 | //------------------------------------------------- | |
| 78 | 76 | |
| 77 | emu_timer::emu_timer() | |
| 78 | : m_machine(NULL), | |
| 79 | m_next(NULL), | |
| 80 | m_prev(NULL), | |
| 81 | m_callback(NULL), | |
| 82 | m_param(0), | |
| 83 | m_ptr(NULL), | |
| 84 | m_func(NULL), | |
| 85 | m_enabled(false), | |
| 86 | m_temporary(false), | |
| 87 | m_period(attotime::zero), | |
| 88 | m_start(attotime::zero), | |
| 89 | m_expire(attotime::never), | |
| 90 | m_device(NULL), | |
| 91 | m_id(0) | |
| 92 | { | |
| 93 | } | |
| 79 | 94 | |
| 80 | 95 | |
| 96 | //------------------------------------------------- | |
| 97 | // init - completely initialize the state when | |
| 98 | // re-allocated as a non-device timer | |
| 99 | //------------------------------------------------- | |
| 100 | ||
| 101 | emu_timer &emu_timer::init(running_machine &machine, timer_expired_func callback, const char *name, void *ptr, bool temporary) | |
| 102 | { | |
| 103 | // ensure the entire timer state is clean | |
| 104 | m_machine = &machine; | |
| 105 | m_next = NULL; | |
| 106 | m_prev = NULL; | |
| 107 | m_callback = callback; | |
| 108 | m_param = 0; | |
| 109 | m_ptr = ptr; | |
| 110 | m_func = (name != NULL) ? name : "?"; | |
| 111 | m_enabled = false; | |
| 112 | m_temporary = temporary; | |
| 113 | m_period = attotime::never; | |
| 114 | m_start = machine.time(); | |
| 115 | m_expire = attotime::never; | |
| 116 | m_device = NULL; | |
| 117 | m_id = 0; | |
| 118 | ||
| 119 | // if we're not temporary, register ourselves with the save state system | |
| 120 | if (!m_temporary) | |
| 121 | register_save(); | |
| 122 | ||
| 123 | // insert into the list | |
| 124 | machine.scheduler().timer_list_insert(*this); | |
| 125 | return *this; | |
| 126 | } | |
| 127 | ||
| 128 | ||
| 129 | //------------------------------------------------- | |
| 130 | // init - completely initialize the state when | |
| 131 | // re-allocated as a device timer | |
| 132 | //------------------------------------------------- | |
| 133 | ||
| 134 | emu_timer &emu_timer::init(device_t &device, device_timer_id id, void *ptr, bool temporary) | |
| 135 | { | |
| 136 | // ensure the entire timer state is clean | |
| 137 | m_machine = device.machine; | |
| 138 | m_next = NULL; | |
| 139 | m_prev = NULL; | |
| 140 | m_callback = NULL; | |
| 141 | m_param = 0; | |
| 142 | m_ptr = ptr; | |
| 143 | m_func = NULL; | |
| 144 | m_enabled = false; | |
| 145 | m_temporary = temporary; | |
| 146 | m_period = attotime::never; | |
| 147 | m_start = machine().time(); | |
| 148 | m_expire = attotime::never; | |
| 149 | m_device = &device; | |
| 150 | m_id = id; | |
| 151 | ||
| 152 | // if we're not temporary, register ourselves with the save state system | |
| 153 | if (!m_temporary) | |
| 154 | register_save(); | |
| 155 | ||
| 156 | // insert into the list | |
| 157 | machine().scheduler().timer_list_insert(*this); | |
| 158 | return *this; | |
| 159 | } | |
| 160 | ||
| 161 | ||
| 162 | //------------------------------------------------- | |
| 163 | // release - release us from the global list | |
| 164 | // management when deallocating | |
| 165 | //------------------------------------------------- | |
| 166 | ||
| 167 | emu_timer &emu_timer::release() | |
| 168 | { | |
| 169 | // unhook us from the global list | |
| 170 | machine().scheduler().timer_list_remove(*this); | |
| 171 | return *this; | |
| 172 | } | |
| 173 | ||
| 174 | ||
| 175 | //------------------------------------------------- | |
| 176 | // enable - enable/disable a timer | |
| 177 | //------------------------------------------------- | |
| 178 | ||
| 179 | bool emu_timer::enable(bool enable) | |
| 180 | { | |
| 181 | // reschedule only if the state has changed | |
| 182 | bool old = m_enabled; | |
| 183 | if (old != enable) | |
| 184 | { | |
| 185 | // set the enable flag | |
| 186 | m_enabled = enable; | |
| 187 | ||
| 188 | // remove the timer and insert back into the list | |
| 189 | machine().scheduler().timer_list_remove(*this); | |
| 190 | machine().scheduler().timer_list_insert(*this); | |
| 191 | } | |
| 192 | return old; | |
| 193 | } | |
| 194 | ||
| 195 | ||
| 196 | //------------------------------------------------- | |
| 197 | // adjust - adjust the time when this timer will | |
| 198 | // fire and specify a period for subsequent | |
| 199 | // firings | |
| 200 | //------------------------------------------------- | |
| 201 | ||
| 202 | void emu_timer::adjust(attotime start_delay, INT32 param, attotime period) | |
| 203 | { | |
| 204 | // if this is the callback timer, mark it modified | |
| 205 | device_scheduler &scheduler = machine().scheduler(); | |
| 206 | if (scheduler.m_callback_timer == this) | |
| 207 | scheduler.m_callback_timer_modified = true; | |
| 208 | ||
| 209 | // compute the time of the next firing and insert into the list | |
| 210 | m_param = param; | |
| 211 | m_enabled = true; | |
| 212 | ||
| 213 | // clamp negative times to 0 | |
| 214 | if (start_delay.seconds < 0) | |
| 215 | start_delay = attotime::zero; | |
| 216 | ||
| 217 | // set the start and expire times | |
| 218 | m_start = scheduler.time(); | |
| 219 | m_expire = m_start + start_delay; | |
| 220 | m_period = period; | |
| 221 | ||
| 222 | // remove and re-insert the timer in its new order | |
| 223 | scheduler.timer_list_remove(*this); | |
| 224 | scheduler.timer_list_insert(*this); | |
| 225 | ||
| 226 | // if this was inserted as the head, abort the current timeslice and resync | |
| 227 | if (this == scheduler.first_timer()) | |
| 228 | scheduler.abort_timeslice(); | |
| 229 | } | |
| 230 | ||
| 231 | ||
| 232 | //------------------------------------------------- | |
| 233 | // elapsed - return the amount of time since the | |
| 234 | // timer was started | |
| 235 | //------------------------------------------------- | |
| 236 | ||
| 237 | attotime emu_timer::elapsed() const | |
| 238 | { | |
| 239 | return machine().time() - m_start; | |
| 240 | } | |
| 241 | ||
| 242 | ||
| 243 | //------------------------------------------------- | |
| 244 | // remaining - return the amount of time | |
| 245 | // remaining until the timer expires | |
| 246 | //------------------------------------------------- | |
| 247 | ||
| 248 | attotime emu_timer::remaining() const | |
| 249 | { | |
| 250 | return m_expire - machine().time(); | |
| 251 | } | |
| 252 | ||
| 253 | ||
| 254 | //------------------------------------------------- | |
| 255 | // timer_register_save - register ourself with | |
| 256 | // the save state system | |
| 257 | //------------------------------------------------- | |
| 258 | ||
| 259 | void emu_timer::register_save() | |
| 260 | { | |
| 261 | // determine our instance number and name | |
| 262 | int index = 0; | |
| 263 | astring name; | |
| 264 | ||
| 265 | // for non-device timers, it is an index based on the callback function name | |
| 266 | if (m_device == NULL) | |
| 267 | { | |
| 268 | name = m_func; | |
| 269 | for (emu_timer *curtimer = machine().scheduler().first_timer(); curtimer != NULL; curtimer = curtimer->next()) | |
| 270 | if (!curtimer->m_temporary && curtimer->m_device == NULL && strcmp(curtimer->m_func, m_func) == 0) | |
| 271 | index++; | |
| 272 | } | |
| 273 | ||
| 274 | // for device timers, it is an index based on the device and timer ID | |
| 275 | else | |
| 276 | { | |
| 277 | name.printf("%s/%d", m_device->tag(), m_id); | |
| 278 | for (emu_timer *curtimer = machine().scheduler().first_timer(); curtimer != NULL; curtimer = curtimer->next()) | |
| 279 | if (!curtimer->m_temporary && curtimer->m_device != NULL && curtimer->m_device == m_device && curtimer->m_id == m_id) | |
| 280 | index++; | |
| 281 | } | |
| 282 | ||
| 283 | // save the bits | |
| 284 | state_save_register_item(m_machine, "timer", name, index, m_param); | |
| 285 | state_save_register_item(m_machine, "timer", name, index, m_enabled); | |
| 286 | state_save_register_item(m_machine, "timer", name, index, m_period.seconds); | |
| 287 | state_save_register_item(m_machine, "timer", name, index, m_period.attoseconds); | |
| 288 | state_save_register_item(m_machine, "timer", name, index, m_start.seconds); | |
| 289 | state_save_register_item(m_machine, "timer", name, index, m_start.attoseconds); | |
| 290 | state_save_register_item(m_machine, "timer", name, index, m_expire.seconds); | |
| 291 | state_save_register_item(m_machine, "timer", name, index, m_expire.attoseconds); | |
| 292 | } | |
| 293 | ||
| 294 | ||
| 295 | //------------------------------------------------- | |
| 296 | // schedule_next_period - schedule the next | |
| 297 | // period | |
| 298 | //------------------------------------------------- | |
| 299 | ||
| 300 | void emu_timer::schedule_next_period() | |
| 301 | { | |
| 302 | // advance by one period | |
| 303 | m_start = m_expire; | |
| 304 | m_expire += m_period; | |
| 305 | ||
| 306 | // remove and re-insert us | |
| 307 | device_scheduler &scheduler = machine().scheduler(); | |
| 308 | scheduler.timer_list_remove(*this); | |
| 309 | scheduler.timer_list_insert(*this); | |
| 310 | } | |
| 311 | ||
| 312 | ||
| 313 | ||
| 81 | 314 | //************************************************************************** |
| 82 | // C | |
| 315 | // DEVIC | |
| 83 | 316 | //************************************************************************** |
| 84 | 317 | |
| 85 | 318 | //------------------------------------------------- |
| r10315 | r10316 | |
| 88 | 321 | |
| 89 | 322 | device_scheduler::device_scheduler(running_machine &machine) : |
| 90 | 323 | m_machine(machine), |
| 91 | m_quantum_set(false), | |
| 92 | 324 | m_executing_device(NULL), |
| 93 | m_execute_list(NULL) | |
| 325 | m_execute_list(NULL), | |
| 326 | m_basetime(attotime::zero), | |
| 327 | m_timer_list(NULL), | |
| 328 | m_timer_allocator(machine.m_respool), | |
| 329 | m_callback_timer(NULL), | |
| 330 | m_callback_timer_modified(false), | |
| 331 | m_callback_timer_expire_time(attotime::zero), | |
| 332 | m_quantum_list(machine.m_respool), | |
| 333 | m_quantum_allocator(machine.m_respool), | |
| 334 | m_quantum_minimum(ATTOSECONDS_IN_NSEC(1) / 1000) | |
| 94 | 335 | { |
| 336 | // append a single never-expiring timer so there is always one in the list | |
| 337 | m_timer_list = &m_timer_allocator.alloc()->init(m_machine, NULL, NULL, NULL, true); | |
| 338 | m_timer_list->adjust(attotime::never); | |
| 95 | 339 | } |
| 96 | 340 | |
| 97 | 341 | |
| 342 | // remove me once save state registration is embedded | |
| 343 | void device_scheduler::register_for_save() | |
| 344 | { | |
| 345 | // register global states | |
| 346 | state_save_register_item(&m_machine, "timer", NULL, 0, m_basetime.seconds); | |
| 347 | state_save_register_item(&m_machine, "timer", NULL, 0, m_basetime.attoseconds); | |
| 348 | state_save_register_postload(&m_machine, &state_postload_stub<device_scheduler, &device_scheduler::postload>, this); | |
| 349 | } | |
| 350 | ||
| 351 | ||
| 98 | 352 | //------------------------------------------------- |
| 99 | 353 | // device_scheduler - destructor |
| 100 | 354 | //------------------------------------------------- |
| 101 | 355 | |
| 102 | 356 | device_scheduler::~device_scheduler() |
| 103 | 357 | { |
| 358 | // remove all timers | |
| 359 | while (m_timer_list != NULL) | |
| 360 | m_timer_allocator.reclaim(m_timer_list->release()); | |
| 104 | 361 | } |
| 105 | 362 | |
| 106 | 363 | |
| 107 | 364 | //------------------------------------------------- |
| 365 | // time - return the current time | |
| 366 | //------------------------------------------------- | |
| 367 | ||
| 368 | attotime device_scheduler::time() const | |
| 369 | { | |
| 370 | // if we're currently in a callback, use the timer's expiration time as a base | |
| 371 | if (m_callback_timer != NULL) | |
| 372 | return m_callback_timer_expire_time; | |
| 373 | ||
| 374 | // if we're executing as a particular CPU, use its local time as a base | |
| 375 | // otherwise, return the global base time | |
| 376 | return (m_executing_device != NULL) ? m_executing_device->local_time() : m_basetime; | |
| 377 | } | |
| 378 | ||
| 379 | ||
| 380 | //------------------------------------------------- | |
| 381 | // can_save - return true if it's safe to save | |
| 382 | // (i.e., no temporary timers outstanding) | |
| 383 | //------------------------------------------------- | |
| 384 | ||
| 385 | bool device_scheduler::can_save() const | |
| 386 | { | |
| 387 | // if any live temporary timers exit, fail | |
| 388 | for (emu_timer *timer = m_timer_list; timer != NULL; timer = timer->next()) | |
| 389 | if (timer->m_temporary) | |
| 390 | return false; | |
| 391 | ||
| 392 | // otherwise, we're good | |
| 393 | return true; | |
| 394 | } | |
| 395 | ||
| 396 | ||
| 397 | //------------------------------------------------- | |
| 108 | 398 | // timeslice - execute all devices for a single |
| 109 | 399 | // timeslice |
| 110 | 400 | //------------------------------------------------- |
| r10315 | r10316 | |
| 112 | 402 | void device_scheduler::timeslice() |
| 113 | 403 | { |
| 114 | 404 | bool call_debugger = ((m_machine.debug_flags & DEBUG_FLAG_ENABLED) != 0); |
| 115 | timer_execution_state *timerexec = timer_get_execution_state(&m_machine); | |
| 116 | if (TEMPLOG) printf("Timeslice start\n"); | |
| 117 | 405 | |
| 118 | 406 | // build the execution list if we don't have one yet |
| 119 | 407 | if (m_execute_list == NULL) |
| 120 | 408 | rebuild_execute_list(); |
| 121 | 409 | |
| 410 | // execute timers | |
| 411 | execute_timers(); | |
| 412 | ||
| 122 | 413 | // loop until we hit the next timer |
| 123 | while ( | |
| 414 | while ( | |
| 124 | 415 | { |
| 125 | if (TEMPLOG) | |
| 126 | { | |
| 127 | void timer_print_first_timer(running_machine *machine); | |
| 128 | printf("Timeslice loop: basetime=%15.6f\n", timerexec->basetime.as_double()); | |
| 129 | timer_print_first_timer(&m_machine); | |
| 130 | } | |
| 131 | ||
| 132 | ||
| 133 | 416 | // by default, assume our target is the end of the next quantum |
| 134 | attotime target; | |
| 135 | target.seconds = timerexec->basetime.seconds; | |
| 136 | target.attoseconds = timerexec->basetime.attoseconds + timerexec->curquantum; | |
| 137 | ATTOTIME_NORMALIZE(target); | |
| 417 | attotime target = m_basetime + attotime(0, m_quantum_list.first()->m_actual); | |
| 138 | 418 | |
| 139 | 419 | // however, if the next timer is going to fire before then, override |
| 140 | assert((timerexec->nextfire - target).seconds <= 0); | |
| 141 | if (ATTOTIME_LT(timerexec->nextfire, target)) | |
| 142 | target = timerexec->nextfire; | |
| 420 | if (m_timer_list->m_expire < target) | |
| 421 | target = m_timer_list->m_expire; | |
| 143 | 422 | |
| 144 | 423 | LOG(("------------------\n")); |
| 145 | 424 | LOG(("cpu_timeslice: target = %s\n", target.as_string())); |
| r10315 | r10316 | |
| 148 | 427 | UINT32 suspendchanged = 0; |
| 149 | 428 | for (device_execute_interface *exec = m_execute_list; exec != NULL; exec = exec->m_nextexec) |
| 150 | 429 | { |
| 151 | suspendchanged |= | |
| 430 | suspendchanged |= | |
| 152 | 431 | exec->m_suspend = exec->m_nextsuspend; |
| 153 | 432 | exec->m_nextsuspend &= ~SUSPEND_REASON_TIMESLICE; |
| 154 | 433 | exec->m_eatcycles = exec->m_nexteatcycles; |
| r10315 | r10316 | |
| 185 | 464 | // note that this global variable cycles_stolen can be modified |
| 186 | 465 | // via the call to cpu_execute |
| 187 | 466 | exec->m_cycles_stolen = 0; |
| 188 | if (TEMPLOG) printf("Executing %s for %d cycles\n", exec->device().tag(), ran); | |
| 189 | 467 | m_executing_device = exec; |
| 190 | 468 | *exec->m_icountptr = exec->m_cycles_running; |
| 191 | 469 | if (!call_debugger) |
| r10315 | r10316 | |
| 204 | 482 | ran -= exec->m_cycles_stolen; |
| 205 | 483 | g_profiler.stop(); |
| 206 | 484 | } |
| 207 | else | |
| 208 | if (TEMPLOG) printf("Skipping %s for %d cycles\n", exec->device().tag(), ran); | |
| 209 | 485 | |
| 210 | 486 | // account for these cycles |
| 211 | 487 | exec->m_totalcycles += ran; |
| 212 | 488 | |
| 213 | 489 | // update the local time for this CPU |
| 214 | attoseconds_t actualdelta = exec->m_attoseconds_per_cycle * ran; | |
| 215 | exec->m_localtime.attoseconds += actualdelta; | |
| 216 | ATTOTIME_NORMALIZE(exec->m_localtime); | |
| 490 | exec->m_localtime += attotime(0, exec->m_attoseconds_per_cycle * ran); | |
| 217 | 491 | LOG((" %d ran, %d total, time = %s\n", ran, (INT32)exec->m_totalcycles, exec->m_localtime.as_string())); |
| 218 | 492 | |
| 219 | // if the new local CPU time is less than our target, move the target up | |
| 220 | if (ATTOTIME_LT(exec->m_localtime, target)) | |
| 493 | // if the new local CPU time is less than our target, move the target up, but not before the base | |
| 494 | if (exec->m_localtime < target) | |
| 221 | 495 | { |
| 222 | 496 | assert(exec->m_localtime < target); |
| 223 | target = exec->m_localtime; | |
| 224 | ||
| 225 | // however, if this puts us before the base, clamp to the base as a minimum | |
| 226 | if (ATTOTIME_LT(target, timerexec->basetime)) | |
| 227 | { | |
| 228 | assert(target < timerexec->basetime); | |
| 229 | target = timerexec->basetime; | |
| 230 | } | |
| 497 | target = max(exec->m_localtime, m_basetime); | |
| 231 | 498 | LOG((" (new target)\n")); |
| 232 | 499 | } |
| 233 | 500 | } |
| r10315 | r10316 | |
| 236 | 503 | m_executing_device = NULL; |
| 237 | 504 | |
| 238 | 505 | // update the base time |
| 239 | | |
| 506 | | |
| 240 | 507 | } |
| 241 | ||
| 508 | } | |
| 242 | 509 | |
| 243 | // execute timers | |
| 244 | timer_execute_timers(&m_machine); | |
| 510 | ||
| 511 | //------------------------------------------------- | |
| 512 | // abort_timeslice - abort execution for the | |
| 513 | // current timeslice | |
| 514 | //------------------------------------------------- | |
| 515 | ||
| 516 | void device_scheduler::abort_timeslice() | |
| 517 | { | |
| 518 | if (m_executing_device != NULL) | |
| 519 | m_executing_device->abort_timeslice(); | |
| 245 | 520 | } |
| 246 | 521 | |
| 247 | 522 | |
| 248 | 523 | //------------------------------------------------- |
| 524 | // trigger - generate a global trigger | |
| 525 | //------------------------------------------------- | |
| 526 | ||
| 527 | void device_scheduler::trigger(int trigid, attotime after) | |
| 528 | { | |
| 529 | // ensure we have a list of executing devices | |
| 530 | if (m_execute_list == NULL) | |
| 531 | rebuild_execute_list(); | |
| 532 | ||
| 533 | // if we have a non-zero time, schedule a timer | |
| 534 | if (after != attotime::zero) | |
| 535 | timer_set(after, MFUNC(timer_expired, device_scheduler, timed_trigger), trigid, this); | |
| 536 | ||
| 537 | // send the trigger to everyone who cares | |
| 538 | else | |
| 539 | for (device_execute_interface *exec = m_execute_list; exec != NULL; exec = exec->m_nextexec) | |
| 540 | exec->trigger(trigid); | |
| 541 | } | |
| 542 | ||
| 543 | ||
| 544 | //------------------------------------------------- | |
| 249 | 545 | // boost_interleave - temporarily boosts the |
| 250 | 546 | // interleave factor |
| 251 | 547 | //------------------------------------------------- |
| r10315 | r10316 | |
| 255 | 551 | // ignore timeslices > 1 second |
| 256 | 552 | if (timeslice_time.seconds > 0) |
| 257 | 553 | return; |
| 258 | | |
| 554 | | |
| 259 | 555 | } |
| 260 | 556 | |
| 261 | 557 | |
| 262 | 558 | //------------------------------------------------- |
| 263 | // eat_all_cycles - eat a ton of cycles on all | |
| 264 | // CPUs to force a quick exit | |
| 559 | // timer_alloc - allocate a global non-device | |
| 560 | // timer and return a pointer | |
| 265 | 561 | //------------------------------------------------- |
| 266 | 562 | |
| 267 | ||
| 563 | emu_timer *device_scheduler:: | |
| 268 | 564 | { |
| 269 | for (device_execute_interface *exec = m_execute_list; exec != NULL; exec = exec->m_nextexec) | |
| 270 | exec->eat_cycles(1000000000); | |
| 565 | return &m_timer_allocator.alloc()->init(m_machine, callback, name, ptr, false); | |
| 271 | 566 | } |
| 272 | 567 | |
| 273 | 568 | |
| 569 | //------------------------------------------------- | |
| 570 | // timer_set - allocate an anonymous non-device | |
| 571 | // timer and set it to go off after the given | |
| 572 | // amount of time | |
| 573 | //------------------------------------------------- | |
| 274 | 574 | |
| 275 | //************************************************************************** | |
| 276 | // GLOBAL HELPERS | |
| 277 | //************************************************************************** | |
| 575 | void device_scheduler::timer_set(attotime duration, timer_expired_func callback, const char *name, int param, void *ptr) | |
| 576 | { | |
| 577 | m_timer_allocator.alloc()->init(m_machine, callback, name, ptr, true).adjust(duration, param); | |
| 578 | } | |
| 278 | 579 | |
| 580 | ||
| 279 | 581 | //------------------------------------------------- |
| 280 | // cpuexec_abort_timeslice - abort execution | |
| 281 | // for the current timeslice | |
| 582 | // timer_pulse - allocate an anonymous non-device | |
| 583 | // timer and set it to go off at the given | |
| 584 | // frequency | |
| 282 | 585 | //------------------------------------------------- |
| 283 | 586 | |
| 284 | void device_scheduler::a | |
| 587 | void device_scheduler::timer_pulse(attotime period, t | |
| 285 | 588 | { |
| 286 | if (m_executing_device != NULL) | |
| 287 | m_executing_device->abort_timeslice(); | |
| 589 | m_timer_allocator.alloc()->init(m_machine, callback, name, ptr, true).adjust(period, param, period); | |
| 288 | 590 | } |
| 289 | 591 | |
| 290 | 592 | |
| 291 | 593 | //------------------------------------------------- |
| 292 | // trigger - generate a global trigger | |
| 594 | // timer_alloc - allocate a global device timer | |
| 595 | // and return a pointer | |
| 293 | 596 | //------------------------------------------------- |
| 294 | 597 | |
| 295 | ||
| 598 | emu_timer *device_scheduler::t | |
| 296 | 599 | { |
| 297 | // ensure we have a list of executing devices | |
| 298 | if (m_execute_list == NULL) | |
| 299 | rebuild_execute_list(); | |
| 600 | return &m_timer_allocator.alloc()->init(device, id, ptr, false); | |
| 601 | } | |
| 300 | 602 | |
| 301 | // if we have a non-zero time, schedule a timer | |
| 302 | if (after.attoseconds != 0 || after.seconds != 0) | |
| 303 | timer_set(&m_machine, after, (void *)this, trigid, static_timed_trigger); | |
| 304 | 603 | |
| 305 | // send the trigger to everyone who cares | |
| 306 | else | |
| 307 | for (device_execute_interface *exec = m_execute_list; exec != NULL; exec = exec->m_nextexec) | |
| 308 | exec->trigger(trigid); | |
| 604 | //------------------------------------------------- | |
| 605 | // timer_set - allocate an anonymous device timer | |
| 606 | // and set it to go off after the given amount of | |
| 607 | // time | |
| 608 | //------------------------------------------------- | |
| 609 | ||
| 610 | void device_scheduler::timer_set(attotime duration, device_t &device, device_timer_id id, int param, void *ptr) | |
| 611 | { | |
| 612 | m_timer_allocator.alloc()->init(device, id, ptr, true).adjust(duration, param); | |
| 309 | 613 | } |
| 310 | 614 | |
| 311 | 615 | |
| 312 | 616 | //------------------------------------------------- |
| 313 | // static_timed_trigger - generate a trigger | |
| 314 | // after a given amount of time | |
| 617 | // eat_all_cycles - eat a ton of cycles on all | |
| 618 | // CPUs to force a quick exit | |
| 315 | 619 | //------------------------------------------------- |
| 316 | 620 | |
| 317 | ||
| 621 | void | |
| 318 | 622 | { |
| 319 | reinterpret_cast<device_scheduler *>(ptr)->trigger(param); | |
| 623 | for (device_execute_interface *exec = m_execute_list; exec != NULL; exec = exec->m_nextexec) | |
| 624 | exec->eat_cycles(1000000000); | |
| 320 | 625 | } |
| 321 | 626 | |
| 322 | 627 | |
| 323 | 628 | //------------------------------------------------- |
| 629 | // timed_trigger - generate a trigger after a | |
| 630 | // given amount of time | |
| 631 | //------------------------------------------------- | |
| 632 | ||
| 633 | void device_scheduler::timed_trigger(running_machine &machine, INT32 param) | |
| 634 | { | |
| 635 | trigger(param); | |
| 636 | } | |
| 637 | ||
| 638 | ||
| 639 | //------------------------------------------------- | |
| 640 | // postload - after loading a save state | |
| 641 | //------------------------------------------------- | |
| 642 | ||
| 643 | void device_scheduler::postload() | |
| 644 | { | |
| 645 | // remove all timers and make a private list of permanent ones | |
| 646 | simple_list<emu_timer> private_list; | |
| 647 | while (m_timer_list != NULL) | |
| 648 | { | |
| 649 | emu_timer &timer = *m_timer_list; | |
| 650 | ||
| 651 | // temporary timers go away entirely | |
| 652 | if (timer.m_temporary) | |
| 653 | m_timer_allocator.reclaim(timer.release()); | |
| 654 | ||
| 655 | // permanent ones get added to our private list | |
| 656 | else | |
| 657 | private_list.append(timer_list_remove(timer)); | |
| 658 | } | |
| 659 | ||
| 660 | // now re-insert them; this effectively re-sorts them by time | |
| 661 | emu_timer *timer; | |
| 662 | while ((timer = private_list.detach_head()) != NULL) | |
| 663 | timer_list_insert(*timer); | |
| 664 | } | |
| 665 | ||
| 666 | ||
| 667 | //------------------------------------------------- | |
| 324 | 668 | // compute_perfect_interleave - compute the |
| 325 | 669 | // "perfect" interleave interval |
| 326 | 670 | //------------------------------------------------- |
| r10315 | r10316 | |
| 335 | 679 | device_execute_interface *first = m_execute_list; |
| 336 | 680 | if (first != NULL) |
| 337 | 681 | { |
| 682 | // start with a huge time factor and find the 2nd smallest cycle time | |
| 338 | 683 | attoseconds_t smallest = first->minimum_quantum(); |
| 339 | 684 | attoseconds_t perfect = ATTOSECONDS_PER_SECOND - 1; |
| 340 | ||
| 341 | // start with a huge time factor and find the 2nd smallest cycle time | |
| 342 | 685 | for (device_execute_interface *exec = first->m_nextexec; exec != NULL; exec = exec->m_nextexec) |
| 343 | 686 | { |
| 687 | // find the 2nd smallest cycle interval | |
| 344 | 688 | attoseconds_t curquantum = exec->minimum_quantum(); |
| 345 | ||
| 346 | // find the 2nd smallest cycle interval | |
| 347 | 689 | if (curquantum < smallest) |
| 348 | 690 | { |
| 349 | 691 | perfect = smallest; |
| r10315 | r10316 | |
| 353 | 695 | perfect = curquantum; |
| 354 | 696 | } |
| 355 | 697 | |
| 356 | // adjust the final value | |
| 357 | timer_set_minimum_quantum(&m_machine, perfect); | |
| 358 | ||
| 359 | LOG(("Perfect interleave = %.9f, smallest = %.9f\n", ATTOSECONDS_TO_DOUBLE(perfect), ATTOSECONDS_TO_DOUBLE(smallest))); | |
| 698 | // if this is a new minimum quantum, apply it | |
| 699 | if (m_quantum_minimum != perfect) | |
| 700 | { | |
| 701 | // adjust all the actuals; this doesn't affect the current | |
| 702 | m_quantum_minimum = perfect; | |
| 703 | for (quantum_slot *quant = m_quantum_list.first(); quant != NULL; quant = quant->next()) | |
| 704 | quant->m_actual = MAX(quant->m_requested, m_quantum_minimum); | |
| 705 | } | |
| 360 | 706 | } |
| 361 | 707 | } |
| 362 | 708 | |
| r10315 | r10316 | |
| 370 | 716 | void device_scheduler::rebuild_execute_list() |
| 371 | 717 | { |
| 372 | 718 | // if we haven't yet set a scheduling quantum, do it now |
| 373 | if ( | |
| 719 | if ( | |
| 374 | 720 | { |
| 375 | 721 | // set the core scheduling quantum |
| 376 | 722 | attotime min_quantum = m_machine.config->m_minimum_quantum; |
| r10315 | r10316 | |
| 393 | 739 | min_quantum = min(attotime(0, exec->minimum_quantum()), min_quantum); |
| 394 | 740 | } |
| 395 | 741 | |
| 742 | // make sure it's no higher than 60Hz | |
| 743 | min_quantum = min(min_quantum, attotime::from_hz(60)); | |
| 744 | ||
| 396 | 745 | // inform the timer system of our decision |
| 397 | assert(min_quantum.seconds == 0); | |
| 398 | timer_add_scheduling_quantum(&m_machine, min_quantum.attoseconds, attotime::never); | |
| 399 | if (TEMPLOG) printf("Setting quantum: %08X%08X\n", (UINT32)(min_quantum.attoseconds >> 32), (UINT32)min_quantum.attoseconds); | |
| 400 | m_quantum_set = true; | |
| 746 | add_scheduling_quantum(min_quantum, attotime::never); | |
| 401 | 747 | } |
| 402 | 748 | |
| 403 | 749 | // start with an empty list |
| r10315 | r10316 | |
| 428 | 774 | |
| 429 | 775 | // append the suspend list to the end of the active list |
| 430 | 776 | *active_tailptr = suspend_list; |
| 431 | if (TEMPLOG) | |
| 777 | } | |
| 778 | ||
| 779 | ||
| 780 | //------------------------------------------------- | |
| 781 | // timer_list_insert - insert a new timer into | |
| 782 | // the list at the appropriate location | |
| 783 | //------------------------------------------------- | |
| 784 | ||
| 785 | emu_timer &device_scheduler::timer_list_insert(emu_timer &timer) | |
| 432 | 786 | { |
| 433 | printf("Execute list:"); | |
| 434 | for (exec = m_execute_list; exec != NULL; exec = exec->m_nextexec) | |
| 435 | printf(" %s", exec->device().tag()); | |
| 436 | printf("\n"); | |
| 787 | // disabled timers sort to the end | |
| 788 | attotime expire = timer.m_enabled ? timer.m_expire : attotime::never; | |
| 789 | ||
| 790 | // loop over the timer list | |
| 791 | emu_timer *prevtimer = NULL; | |
| 792 | for (emu_timer *curtimer = m_timer_list; curtimer != NULL; prevtimer = curtimer, curtimer = curtimer->next()) | |
| 793 | { | |
| 794 | // if the current list entry expires after us, we should be inserted before it | |
| 795 | if (curtimer->m_expire > expire) | |
| 796 | { | |
| 797 | // link the new guy in before the current list entry | |
| 798 | timer.m_prev = curtimer->m_prev; | |
| 799 | timer.m_next = curtimer; | |
| 800 | ||
| 801 | if (curtimer->m_prev != NULL) | |
| 802 | curtimer->m_prev->m_next = &timer; | |
| 803 | else | |
| 804 | m_timer_list = &timer; | |
| 805 | ||
| 806 | curtimer->m_prev = &timer; | |
| 807 | return timer; | |
| 808 | } | |
| 809 | } | |
| 810 | ||
| 811 | // need to insert after the last one | |
| 812 | if (prevtimer != NULL) | |
| 813 | prevtimer->m_next = &timer; | |
| 814 | else | |
| 815 | m_timer_list = &timer; | |
| 816 | ||
| 817 | timer.m_prev = prevtimer; | |
| 818 | timer.m_next = NULL; | |
| 819 | return timer; | |
| 437 | 820 | } |
| 821 | ||
| 822 | ||
| 823 | //------------------------------------------------- | |
| 824 | // timer_list_remove - remove a timer from the | |
| 825 | // linked list | |
| 826 | //------------------------------------------------- | |
| 827 | ||
| 828 | emu_timer &device_scheduler::timer_list_remove(emu_timer &timer) | |
| 829 | { | |
| 830 | // remove it from the list | |
| 831 | if (timer.m_prev != NULL) | |
| 832 | timer.m_prev->m_next = timer.m_next; | |
| 833 | else | |
| 834 | m_timer_list = timer.m_next; | |
| 835 | ||
| 836 | if (timer.m_next != NULL) | |
| 837 | timer.m_next->m_prev = timer.m_prev; | |
| 838 | ||
| 839 | return timer; | |
| 438 | 840 | } |
| 841 | ||
| 842 | ||
| 843 | //------------------------------------------------- | |
| 844 | // execute_timers - execute timers and update | |
| 845 | // scheduling quanta | |
| 846 | //------------------------------------------------- | |
| 847 | ||
| 848 | void device_scheduler::execute_timers() | |
| 849 | { | |
| 850 | // if the current quantum has expired, find a new one | |
| 851 | while (m_basetime >= m_quantum_list.first()->m_expire) | |
| 852 | m_quantum_allocator.reclaim(m_quantum_list.detach_head()); | |
| 853 | ||
| 854 | LOG(("timer_set_global_time: new=%s head->expire=%s\n", m_basetime.as_string(), m_timer_list->m_expire.as_string())); | |
| 855 | ||
| 856 | // now process any timers that are overdue | |
| 857 | while (m_timer_list->m_expire <= m_basetime) | |
| 858 | { | |
| 859 | // if this is a one-shot timer, disable it now | |
| 860 | emu_timer &timer = *m_timer_list; | |
| 861 | bool was_enabled = timer.m_enabled; | |
| 862 | if (timer.m_period == attotime::zero || timer.m_period == attotime::never) | |
| 863 | timer.m_enabled = false; | |
| 864 | ||
| 865 | // set the global state of which callback we're in | |
| 866 | m_callback_timer_modified = false; | |
| 867 | m_callback_timer = &timer; | |
| 868 | m_callback_timer_expire_time = timer.m_expire; | |
| 869 | ||
| 870 | // call the callback | |
| 871 | if (was_enabled) | |
| 872 | { | |
| 873 | g_profiler.start(PROFILER_TIMER_CALLBACK); | |
| 874 | ||
| 875 | if (timer.m_device != NULL) | |
| 876 | timer.m_device->timer_expired(timer, timer.m_id, timer.m_param, timer.m_ptr); | |
| 877 | else if (timer.m_callback != NULL) | |
| 878 | (*timer.m_callback)(&m_machine, timer.m_ptr, timer.m_param); | |
| 879 | ||
| 880 | g_profiler.stop(); | |
| 881 | } | |
| 882 | ||
| 883 | // clear the callback timer global | |
| 884 | m_callback_timer = NULL; | |
| 885 | ||
| 886 | // reset or remove the timer, but only if it wasn't modified during the callback | |
| 887 | if (!m_callback_timer_modified) | |
| 888 | { | |
| 889 | // if the timer is temporary, remove it now | |
| 890 | if (timer.m_temporary) | |
| 891 | m_timer_allocator.reclaim(timer.release()); | |
| 892 | ||
| 893 | // otherwise, reschedule it | |
| 894 | else | |
| 895 | timer.schedule_next_period(); | |
| 896 | } | |
| 897 | } | |
| 898 | } | |
| 899 | ||
| 900 | ||
| 901 | //------------------------------------------------- | |
| 902 | // add_scheduling_quantum - add a scheduling | |
| 903 | // quantum; the smallest active one is the one | |
| 904 | // that is in use | |
| 905 | //------------------------------------------------- | |
| 906 | ||
| 907 | void device_scheduler::add_scheduling_quantum(attotime quantum, attotime duration) | |
| 908 | { | |
| 909 | assert(quantum.seconds == 0); | |
| 910 | ||
| 911 | attotime curtime = time(); | |
| 912 | attotime expire = curtime + duration; | |
| 913 | ||
| 914 | // figure out where to insert ourselves, expiring any quanta that are out-of-date | |
| 915 | quantum_slot *insert_after = NULL; | |
| 916 | quantum_slot *next; | |
| 917 | for (quantum_slot *quant = m_quantum_list.first(); quant != NULL; quant = next) | |
| 918 | { | |
| 919 | // if this quantum is expired, nuke it | |
| 920 | next = quant->next(); | |
| 921 | if (curtime >= quant->m_expire) | |
| 922 | m_quantum_allocator.reclaim(m_quantum_list.detach(*quant)); | |
| 923 | ||
| 924 | // if this quantum is shorter than us, we need to be inserted afterwards | |
| 925 | else if (quant->m_requested <= quantum.attoseconds) | |
| 926 | insert_after = quant; | |
| 927 | } | |
| 928 | ||
| 929 | // if we found an exact match, just take the maximum expiry time | |
| 930 | if (insert_after != NULL && insert_after->m_requested == quantum.attoseconds) | |
| 931 | insert_after->m_expire = max(insert_after->m_expire, expire); | |
| 932 | ||
| 933 | // otherwise, allocate a new quantum and insert it after the one we picked | |
| 934 | else | |
| 935 | { | |
| 936 | quantum_slot &quant = *m_quantum_allocator.alloc(); | |
| 937 | quant.m_requested = quantum.attoseconds; | |
| 938 | quant.m_actual = MAX(quantum.attoseconds, m_quantum_minimum); | |
| 939 | quant.m_expire = expire; | |
| 940 | m_quantum_list.insert_after(quant, insert_after); | |
| 941 | } | |
| 942 | } | |
| 943 | ||
| 944 | ||
| 945 | /*************************************************************************** | |
| 946 | // DEBUGGING | |
| 947 | ***************************************************************************/ | |
| 948 | ||
| 949 | #if 0 | |
| 950 | //------------------------------------------------- | |
| 951 | // timer_logtimers - log all the timers | |
| 952 | //------------------------------------------------- | |
| 953 | ||
| 954 | static void timer_logtimers(running_machine *machine) | |
| 955 | { | |
| 956 | emu_timer *t; | |
| 957 | ||
| 958 | logerror("===============\n"); | |
| 959 | logerror("TIMER LOG START\n"); | |
| 960 | logerror("===============\n"); | |
| 961 | ||
| 962 | logerror("Enqueued timers:\n"); | |
| 963 | for (t = global->activelist; t; t = t->next) | |
| 964 | logerror(" Start=%15.6f Exp=%15.6f Per=%15.6f Ena=%d Tmp=%d (%s:%d[%s])\n", | |
| 965 | t->start.as_double(), t->expire.as_double(), t->period.as_double(), t->enabled, t->temporary, t->file, t->line, t->func); | |
| 966 | ||
| 967 | logerror("Free timers:\n"); | |
| 968 | for (t = global->freelist; t; t = t->next) | |
| 969 | logerror(" Start=%15.6f Exp=%15.6f Per=%15.6f Ena=%d Tmp=%d (%s:%d[%s])\n", | |
| 970 | t->start.as_double(), t->expire.as_double(), t->period.as_double(), t->enabled, t->temporary, t->file, t->line, t->func); | |
| 971 | ||
| 972 | logerror("==============\n"); | |
| 973 | logerror("TIMER LOG STOP\n"); | |
| 974 | logerror("==============\n"); | |
| 975 | } | |
| 976 | ||
| 977 | ||
| 978 | void timer_print_first_timer(running_machine *machine) | |
| 979 | { | |
| 980 | emu_timer *t = global->activelist; | |
| 981 | printf(" Start=%15.6f Exp=%15.6f Per=%15.6f Ena=%d Tmp=%d (%s)\n", | |
| 982 | t->start.as_double(), t->expire.as_double(), t->period.as_double(), t->enabled, t->temporary, t->func); | |
| 983 | } | |
| 984 | ||
| 985 | ||
| 986 | #endif | |
| No newline at end of file |
| r10315 | r10316 | |
|---|---|---|
| 71 | 71 | static void cassette_update(device_t *device) |
| 72 | 72 | { |
| 73 | 73 | dev_cassette_t *cassette = get_safe_token( device ); |
| 74 | double cur_time = | |
| 74 | double cur_time = | |
| 75 | 75 | |
| 76 | 76 | if (cassette_is_motor_on(device)) |
| 77 | 77 | { |
| r10315 | r10316 | |
| 187 | 187 | position = cassette->position; |
| 188 | 188 | |
| 189 | 189 | if (cassette_is_motor_on(device)) |
| 190 | position += | |
| 190 | position += | |
| 191 | 191 | return position; |
| 192 | 192 | } |
| 193 | 193 | |
| r10315 | r10316 | |
| 302 | 302 | |
| 303 | 303 | /* reset the position */ |
| 304 | 304 | cassette->position = 0.0; |
| 305 | cassette->position_time = | |
| 305 | cassette->position_time = | |
| 306 | 306 | |
| 307 | 307 | return IMAGE_INIT_PASS; |
| 308 | 308 |
| r10315 | r10316 | |
|---|---|---|
| 214 | 214 | pDrive->flags = 0; |
| 215 | 215 | pDrive->index_pulse_callback = NULL; |
| 216 | 216 | pDrive->ready_state_change_callback = NULL; |
| 217 | pDrive->index_timer = | |
| 217 | pDrive->index_timer = | |
| 218 | 218 | pDrive->idx = 0; |
| 219 | 219 | |
| 220 | 220 | floppy_drive_set_geometry(img, ((floppy_config*)img->baseconfig().static_config())->floppy_type); |
| r10315 | r10316 | |
| 674 | 674 | else |
| 675 | 675 | next_wpt = CLEAR_LINE; |
| 676 | 676 | |
| 677 | | |
| 677 | | |
| 678 | 678 | |
| 679 | 679 | return retVal; |
| 680 | 680 | } |
| r10315 | r10316 | |
| 702 | 702 | devcb_call_write_line(&flopimg->out_wpt_func, flopimg->wpt); |
| 703 | 703 | |
| 704 | 704 | /* set timer for disk eject */ |
| 705 | | |
| 705 | | |
| 706 | 706 | } |
| 707 | 707 | |
| 708 | 708 | device_t *floppy_get_device(running_machine *machine,int drive) |
| r10315 | r10316 | |
|---|---|---|
| 344 | 344 | |
| 345 | 345 | /* output config */ |
| 346 | 346 | bi->build_count = 0; |
| 347 | bi->bitbanger_output_timer = | |
| 347 | bi->bitbanger_output_timer = | |
| 348 | 348 | |
| 349 | 349 | /* input config */ |
| 350 | bi->bitbanger_input_timer = | |
| 350 | bi->bitbanger_input_timer = | |
| 351 | 351 | bi->idle_delay = attotime::from_seconds(1); |
| 352 | 352 | bi->input_buffer_size = 0; |
| 353 | 353 | bi->input_buffer_cursor = 0; |
| r10315 | r10316 | |
| 453 | 453 | timer_adjust_periodic(bi->bitbanger_output_timer, one_point_five_baud, 0, bi->current_baud); |
| 454 | 454 | } |
| 455 | 455 | |
| 456 | //fprintf(stderr,"%s, %d\n", | |
| 456 | //fprintf(stderr,"%s, %d\n", | |
| 457 | 457 | bi->output_value = value; |
| 458 | 458 | } |
| 459 | 459 |
| r10315 | r10316 | |
|---|---|---|
| 132 | 132 | snapquick_token *token = get_token(device); |
| 133 | 133 | |
| 134 | 134 | /* allocate a timer */ |
| 135 | token->timer = | |
| 135 | token->timer = | |
| 136 | 136 | |
| 137 | 137 | } |
| 138 | 138 |
| r10315 | r10316 | |
|---|---|---|
| 51 | 51 | // MACROS |
| 52 | 52 | //************************************************************************** |
| 53 | 53 | |
| 54 | // this macro wraps a function 'x' and can be used to pass a function followed by its name | |
| 55 | #define FUNC(x) x, #x | |
| 56 | ||
| 57 | // this macro wraps a member function 'x' from class 'c' using a templatized stub of type 's' | |
| 58 | #define MFUNC(s,c,x) s##_stub<c, &c::x>, #c "::" #x | |
| 59 | ||
| 60 | ||
| 54 | 61 | // these must be macros because we are included before the running_machine |
| 55 | 62 | #define cpuexec_describe_context(mach) (mach)->describe_context() |
| 56 | 63 | #define cpuexec_boost_interleave(mach, slice, dur) (mach)->scheduler().boost_interleave(slice, dur) |
| 57 | 64 | #define cpuexec_trigger(mach, trigid) (mach)->scheduler().trigger(trigid) |
| 58 | 65 | #define cpuexec_triggertime(mach, trigid, dur) (mach)->scheduler().trigger(trigid, dur) |
| 59 | 66 | |
| 67 | // macro for the RC time constant on a 74LS123 with C > 1000pF | |
| 68 | // R is in ohms, C is in farads | |
| 69 | #define TIME_OF_74LS123(r,c) (0.45 * (double)(r) * (double)(c)) | |
| 60 | 70 | |
| 71 | // macros for the RC time constant on a 555 timer IC | |
| 72 | // R is in ohms, C is in farads | |
| 73 | #define PERIOD_OF_555_MONOSTABLE_NSEC(r,c) ((attoseconds_t)(1100000000 * (double)(r) * (double)(c))) | |
| 74 | #define PERIOD_OF_555_ASTABLE_NSEC(r1,r2,c) ((attoseconds_t)( 693000000 * ((double)(r1) + 2.0 * (double)(r2)) * (double)(c))) | |
| 75 | #define PERIOD_OF_555_MONOSTABLE(r,c) attotime::from_nsec(PERIOD_OF_555_MONOSTABLE_NSEC(r,c)) | |
| 76 | #define PERIOD_OF_555_ASTABLE(r1,r2,c) attotime::from_nsec(PERIOD_OF_555_ASTABLE_NSEC(r1,r2,c)) | |
| 61 | 77 | |
| 78 | #define TIMER_CALLBACK(name) void name(running_machine *machine, void *ptr, int param) | |
| 79 | ||
| 80 | ||
| 81 | ||
| 62 | 82 | //************************************************************************** |
| 63 | 83 | // TYPE DEFINITIONS |
| 64 | 84 | //************************************************************************** |
| 65 | 85 | |
| 86 | // timer callbacks look like this | |
| 87 | typedef void (*timer_expired_func)(running_machine *machine, void *ptr, INT32 param); | |
| 88 | ||
| 89 | // stub for when the ptr parameter points to a class | |
| 90 | template<class T, void (T::*func)(running_machine &machine, INT32 param)> | |
| 91 | void timer_expired_stub(running_machine *machine, void *ptr, INT32 param) | |
| 92 | { | |
| 93 | T *target = reinterpret_cast<T *>(ptr); | |
| 94 | (target->*func)(*machine, param); | |
| 95 | } | |
| 96 | ||
| 97 | ||
| 98 | // ======================> emu_timer | |
| 99 | ||
| 100 | class emu_timer | |
| 101 | { | |
| 102 | friend class device_scheduler; | |
| 103 | friend class simple_list<emu_timer>; | |
| 104 | friend class fixed_allocator<emu_timer>; | |
| 105 | ||
| 106 | // construction/destruction | |
| 107 | emu_timer(); | |
| 108 | ||
| 109 | // allocation and re-use | |
| 110 | emu_timer &init(running_machine &machine, timer_expired_func callback, const char *name, void *ptr, bool temporary); | |
| 111 | emu_timer &init(device_t &device, device_timer_id id, void *ptr, bool temporary); | |
| 112 | emu_timer &release(); | |
| 113 | ||
| 114 | public: | |
| 115 | // getters | |
| 116 | emu_timer *next() const { return m_next; } | |
| 117 | running_machine &machine() const { assert(m_machine != NULL); return *m_machine; } | |
| 118 | bool enabled() const { return m_enabled; } | |
| 119 | int param() const { return m_param; } | |
| 120 | void *ptr() const { return m_ptr; } | |
| 121 | ||
| 122 | // setters | |
| 123 | bool enable(bool enable = true); | |
| 124 | void set_param(int param) { m_param = param; } | |
| 125 | void set_ptr(void *ptr) { m_ptr = ptr; } | |
| 126 | ||
| 127 | // control | |
| 128 | void reset(attotime duration) { adjust(duration, m_param, m_period); } | |
| 129 | void adjust(attotime duration, INT32 param = 0, attotime periodicity = attotime::never); | |
| 130 | ||
| 131 | // timing queries | |
| 132 | attotime elapsed() const; | |
| 133 | attotime remaining() const; | |
| 134 | attotime start() const { return m_start; } | |
| 135 | attotime expire() const { return m_expire; } | |
| 136 | ||
| 137 | private: | |
| 138 | // internal helpers | |
| 139 | void register_save(); | |
| 140 | void schedule_next_period(); | |
| 141 | ||
| 142 | // internal state | |
| 143 | running_machine * m_machine; // reference to the owning machine | |
| 144 | emu_timer * m_next; // next timer in order in the list | |
| 145 | emu_timer * m_prev; // previous timer in order in the list | |
| 146 | timer_expired_func m_callback; // callback function | |
| 147 | INT32 m_param; // integer parameter | |
| 148 | void * m_ptr; // pointer parameter | |
| 149 | const char * m_func; // string name of the callback function | |
| 150 | bool m_enabled; // is the timer enabled? | |
| 151 | bool m_temporary; // is the timer temporary? | |
| 152 | attotime m_period; // the repeat frequency of the timer | |
| 153 | attotime m_start; // time when the timer was started | |
| 154 | attotime m_expire; // time when the timer will expire | |
| 155 | device_t * m_device; // for device timers, a pointer to the device | |
| 156 | device_timer_id m_id; // for device timers, the ID of the timer | |
| 157 | }; | |
| 158 | ||
| 159 | ||
| 66 | 160 | // ======================> device_scheduler |
| 67 | 161 | |
| 68 | 162 | class device_scheduler |
| 69 | 163 | { |
| 70 | 164 | friend class device_execute_interface; |
| 165 | friend class emu_timer; | |
| 71 | 166 | |
| 72 | 167 | public: |
| 168 | // construction/destruction | |
| 73 | 169 | device_scheduler(running_machine &machine); |
| 74 | 170 | ~device_scheduler(); |
| 171 | void register_for_save(); | |
| 75 | 172 | |
| 173 | // getters | |
| 174 | attotime time() const; | |
| 175 | emu_timer *first_timer() const { return m_timer_list; } | |
| 176 | device_execute_interface *currently_executing() const { return m_executing_device; } | |
| 177 | bool can_save() const; | |
| 178 | ||
| 179 | // execution | |
| 76 | 180 | void timeslice(); |
| 77 | ||
| 181 | void abort_timeslice(); | |
| 78 | 182 | void trigger(int trigid, attotime after = attotime::zero); |
| 79 | ||
| 80 | 183 | void boost_interleave(attotime timeslice_time, attotime boost_duration); |
| 81 | void abort_timeslice(); | |
| 184 | ||
| 185 | // timers, specified by callback/name | |
| 186 | emu_timer *timer_alloc(timer_expired_func callback, const char *name, void *ptr = NULL); | |
| 187 | void timer_set(attotime duration, timer_expired_func callback, const char *name, int param = 0, void *ptr = NULL); | |
| 188 | void timer_pulse(attotime period, timer_expired_func callback, const char *name, int param = 0, void *ptr = NULL); | |
| 189 | void synchronize(timer_expired_func callback = NULL, const char *name = NULL, int param = 0, void *ptr = NULL) { timer_set(attotime::zero, callback, name, param, ptr); } | |
| 82 | 190 | |
| 83 | device_execute_interface *currently_executing() const { return m_executing_device; } | |
| 191 | // timers, specified by device/id; generally devices should use the device_t methods instead | |
| 192 | emu_timer *timer_alloc(device_t &device, device_timer_id id = 0, void *ptr = NULL); | |
| 193 | void timer_set(attotime duration, device_t &device, device_timer_id id = 0, int param = 0, void *ptr = NULL); | |
| 84 | 194 | |
| 85 | // for timer system only! | |
| 86 | attotime override_local_time(attotime default_time); | |
| 87 | ||
| 88 | 195 | // for emergencies only! |
| 89 | 196 | void eat_all_cycles(); |
| 90 | 197 | |
| 91 | 198 | private: |
| 199 | // callbacks | |
| 200 | void timed_trigger(running_machine &machine, INT32 param); | |
| 201 | void postload(); | |
| 202 | ||
| 203 | // scheduling helpers | |
| 92 | 204 | void compute_perfect_interleave(); |
| 93 | 205 | void rebuild_execute_list(); |
| 206 | void add_scheduling_quantum(attotime quantum, attotime duration); | |
| 207 | ||
| 208 | // timer helpers | |
| 209 | emu_timer &timer_list_insert(emu_timer &timer); | |
| 210 | emu_timer &timer_list_remove(emu_timer &timer); | |
| 211 | void execute_timers(); | |
| 94 | 212 | |
| 95 | static TIMER_CALLBACK( static_timed_trigger ); | |
| 213 | // internal state | |
| 214 | running_machine & m_machine; // reference to our machine | |
| 215 | device_execute_interface * m_executing_device; // pointer to currently executing device | |
| 216 | device_execute_interface * m_execute_list; // list of devices to be executed | |
| 217 | attotime m_basetime; // global basetime; everything moves forward from here | |
| 96 | 218 | |
| 97 | running_machine & m_machine; // reference to our owner | |
| 98 | bool m_quantum_set; // have we set the scheduling quantum yet? | |
| 99 | device_execute_interface * m_executing_device; // pointer to currently executing device | |
| 100 | device_execute_interface * m_execute_list; // list of devices to be executed | |
| 219 | // list of active timers | |
| 220 | emu_timer * m_timer_list; // head of the active list | |
| 221 | fixed_allocator<emu_timer> m_timer_allocator; // allocator for timers | |
| 222 | ||
| 223 | // other internal states | |
| 224 | emu_timer * m_callback_timer; // pointer to the current callback timer | |
| 225 | bool m_callback_timer_modified; // true if the current callback timer was modified | |
| 226 | attotime m_callback_timer_expire_time; // the original expiration time | |
| 227 | ||
| 228 | // scheduling quanta | |
| 229 | class quantum_slot | |
| 230 | { | |
| 231 | friend class simple_list<quantum_slot>; | |
| 232 | ||
| 233 | public: | |
| 234 | quantum_slot *next() const { return m_next; } | |
| 235 | ||
| 236 | quantum_slot * m_next; | |
| 237 | attoseconds_t m_actual; // actual duration of the quantum | |
| 238 | attoseconds_t m_requested; // duration of the requested quantum | |
| 239 | attotime m_expire; // absolute expiration time of this quantum | |
| 240 | }; | |
| 241 | simple_list<quantum_slot> m_quantum_list; // list of active quanta | |
| 242 | fixed_allocator<quantum_slot> m_quantum_allocator; // allocator for quanta | |
| 243 | attoseconds_t m_quantum_minimum; // duration of minimum quantum | |
| 101 | 244 | }; |
| 102 | 245 | |
| 103 | 246 | |
| 104 | #endif /* __SCHEDULE_H__ */ | |
| 247 | ||
| 248 | ||
| 249 | // temporary stuff | |
| 250 | inline void timer_adjust_oneshot(emu_timer *which, attotime duration, INT32 param) { which->adjust(duration, param); } | |
| 251 | inline void timer_adjust_periodic(emu_timer *which, attotime start_delay, INT32 param, attotime period) { which->adjust(start_delay, param, period); } | |
| 252 | ||
| 253 | inline void timer_reset(emu_timer *which, attotime duration) { which->reset(duration); } | |
| 254 | inline int timer_enable(emu_timer *which, int enable) { return which->enable(enable); } | |
| 255 | inline int timer_enabled(emu_timer *which) { return which->enabled(); } | |
| 256 | inline int timer_get_param(emu_timer *which) { return which->param(); } | |
| 257 | inline void timer_set_param(emu_timer *which, int param) { which->set_param(param); } | |
| 258 | inline void *timer_get_ptr(emu_timer *which) { return which->ptr(); } | |
| 259 | inline void timer_set_ptr(emu_timer *which, void *ptr) { which->set_ptr(ptr); } | |
| 260 | ||
| 261 | inline attotime timer_timeelapsed(emu_timer *which) { return which->elapsed(); } | |
| 262 | inline attotime timer_timeleft(emu_timer *which) { return which->remaining(); } | |
| 263 | inline attotime timer_starttime(emu_timer *which) { return which->start(); } | |
| 264 | inline attotime timer_firetime(emu_timer *which) { return which->expire(); } | |
| 265 | ||
| 266 | #endif // __SCHEDULE_H__ */ |
| r10315 | r10316 | |
|---|---|---|
| 87 | 87 | |
| 88 | 88 | INLINE void latch_w(address_space *space, int which, UINT16 value) |
| 89 | 89 | { |
| 90 | | |
| 90 | space->machine->schedul | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 |
| r10315 | r10316 | |
|---|---|---|
| 500 | 500 | } |
| 501 | 501 | else { |
| 502 | 502 | /* do we need to reset the CPU? only schedule it if load/create is successful */ |
| 503 | if ( | |
| 503 | if ( | |
| 504 | 504 | device().machine->schedule_hard_reset(); |
| 505 | 505 | else |
| 506 | 506 | { |
| r10315 | r10316 | |
|---|---|---|
| 46 | 46 | #ifndef __DEVCPU_H__ |
| 47 | 47 | #define __DEVCPU_H__ |
| 48 | 48 | |
| 49 | #include "devlegcy.h" | |
| 49 | 50 | |
| 51 | ||
| 50 | 52 | //************************************************************************** |
| 51 | 53 | // CONSTANTS |
| 52 | 54 | //************************************************************************** |
| r10315 | r10316 | |
|---|---|---|
| 39 | 39 | void watchdog_init(running_machine *machine) |
| 40 | 40 | { |
| 41 | 41 | /* allocate a timer for the watchdog */ |
| 42 | watchdog_timer = timer_alloc( | |
| 42 | watchdog_timer = machine->scheduler().timer_alloc(FUNC( | |
| 43 | 43 | |
| 44 | 44 | machine->add_notifier(MACHINE_NOTIFY_RESET, watchdog_internal_reset); |
| 45 | 45 |
| r10315 | r10316 | |
|---|---|---|
| 801 | 801 | m_timer_clock = m_config.timer_clock; |
| 802 | 802 | |
| 803 | 803 | /* create the timers */ |
| 804 | m_timer[TIMER_A] = device_timer_alloc(*this, TIMER_A); | |
| 805 | m_timer[TIMER_B] = device_timer_alloc(*this, TIMER_B); | |
| 806 | m_timer[TIMER_C] = device_timer_alloc(*this, TIMER_C); | |
| 807 | m_timer[TIMER_D] = device_timer_alloc(*this, TIMER_D); | |
| 804 | m_timer[TIMER_A] = timer_alloc(TIMER_A); | |
| 805 | m_timer[TIMER_B] = timer_alloc(TIMER_B); | |
| 806 | m_timer[TIMER_C] = timer_alloc(TIMER_C); | |
| 807 | m_timer[TIMER_D] = timer_alloc(TIMER_D); | |
| 808 | 808 | |
| 809 | 809 | if (m_config.rx_clock > 0) |
| 810 | 810 | { |
| 811 | m_rx_timer = | |
| 811 | m_rx_timer = | |
| 812 | 812 | timer_adjust_periodic(m_rx_timer, attotime::zero, 0, attotime::from_hz(m_config.rx_clock)); |
| 813 | 813 | } |
| 814 | 814 | |
| 815 | 815 | if (m_config.tx_clock > 0) |
| 816 | 816 | { |
| 817 | m_tx_timer = | |
| 817 | m_tx_timer = | |
| 818 | 818 | timer_adjust_periodic(m_tx_timer, attotime::zero, 0, attotime::from_hz(m_config.tx_clock)); |
| 819 | 819 | } |
| 820 | 820 |
| r10315 | r10316 | |
|---|---|---|
| 227 | 227 | state_save_register_device_item( this, 0, m_century ); |
| 228 | 228 | state_save_register_device_item_pointer( this, 0, m_data, m_size ); |
| 229 | 229 | |
| 230 | timer = timer_alloc( | |
| 230 | timer = m_machine.scheduler().timer_alloc( FUNC( | |
| 231 | 231 | duration = attotime::from_seconds(1); |
| 232 | 232 | timer_adjust_periodic( timer, duration, 0, duration ); |
| 233 | 233 | } |
| r10315 | r10316 | |
|---|---|---|
| 200 | 200 | for (int t = 0; t < (sizeof(m_timer) / sizeof(m_timer[0])); t++) |
| 201 | 201 | { |
| 202 | 202 | cia_timer *timer = &m_timer[t]; |
| 203 | timer->m_timer = timer_alloc( | |
| 203 | timer->m_timer = m_machine.scheduler().timer_alloc(FUNC( | |
| 204 | 204 | timer->m_cia = this; |
| 205 | 205 | timer->m_irq = 0x01 << t; |
| 206 | 206 | } |
| r10315 | r10316 | |
| 208 | 208 | /* setup TOD timer, if appropriate */ |
| 209 | 209 | if (m_config.m_tod_clock != 0) |
| 210 | 210 | { |
| 211 | timer_pulse( | |
| 211 | m_machine.scheduler().timer_pulse( | |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | /* state save support */ |
| r10315 | r10316 | |
|---|---|---|
| 106 | 106 | |
| 107 | 107 | void ttl74123_device::device_start() |
| 108 | 108 | { |
| 109 | m_timer = timer_alloc( | |
| 109 | m_timer = m_machine.scheduler().timer_alloc(FUNC(c | |
| 110 | 110 | |
| 111 | 111 | /* start with the defaults */ |
| 112 | 112 | m_a = m_config.m_a; |
| r10315 | r10316 | |
| 202 | 202 | { |
| 203 | 203 | int output = timer_running(); |
| 204 | 204 | |
| 205 | timer_set( | |
| 205 | m_machine.scheduler().timer_set( | |
| 206 | 206 | |
| 207 | 207 | if (LOG) logerror("74123 %s: Output: %d\n", tag(), output); |
| 208 | 208 | } |
| r10315 | r10316 | |
|---|---|---|
| 258 | 258 | |
| 259 | 259 | /* set a timer */ |
| 260 | 260 | if (buffer_ready) |
| 261 | | |
| 261 | | |
| 262 | 262 | else |
| 263 | | |
| 263 | | |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | |
| r10315 | r10316 | |
| 625 | 625 | ide->status &= ~IDE_STATUS_DRIVE_READY; |
| 626 | 626 | |
| 627 | 627 | /* just set a timer and mark ourselves error */ |
| 628 | | |
| 628 | | |
| 629 | 629 | } |
| 630 | 630 | |
| 631 | 631 | |
| r10315 | r10316 | |
| 806 | 806 | seek_time = TIME_SEEK_MULTISECTOR; |
| 807 | 807 | |
| 808 | 808 | ide->cur_lba = new_lba; |
| 809 | | |
| 809 | | |
| 810 | 810 | } |
| 811 | 811 | else |
| 812 | | |
| 812 | | |
| 813 | 813 | } |
| 814 | 814 | |
| 815 | 815 | |
| r10315 | r10316 | |
| 825 | 825 | read_sector_done(ide); |
| 826 | 826 | else |
| 827 | 827 | /* just set a timer */ |
| 828 | | |
| 828 | | |
| 829 | 829 | } |
| 830 | 830 | else |
| 831 | 831 | /* just set a timer */ |
| 832 | | |
| 832 | | |
| 833 | 833 | } |
| 834 | 834 | |
| 835 | 835 | |
| r10315 | r10316 | |
| 862 | 862 | else |
| 863 | 863 | { |
| 864 | 864 | /* set a timer to do the write */ |
| 865 | | |
| 865 | | |
| 866 | 866 | } |
| 867 | 867 | } |
| 868 | 868 | else |
| 869 | 869 | { |
| 870 | 870 | /* set a timer to do the write */ |
| 871 | | |
| 871 | | |
| 872 | 872 | } |
| 873 | 873 | } |
| 874 | 874 | |
| r10315 | r10316 | |
| 1836 | 1836 | } |
| 1837 | 1837 | |
| 1838 | 1838 | /* create a timer for timing status */ |
| 1839 | ide->last_status_timer = timer_alloc(device->machine, NULL, NULL); | |
| 1840 | ide->reset_timer = timer_alloc(device->machine, reset_callback, (void *)device); | |
| 1839 | ide->last_status_timer = device->machine->scheduler().timer_alloc(FUNC(NULL)); | |
| 1840 | ide->reset_timer = device->machine->scheduler().timer_alloc(FUNC(reset_callback), (void *)device); | |
| 1841 | 1841 | |
| 1842 | 1842 | /* register ide states */ |
| 1843 | 1843 | state_save_register_device_item(device, 0, ide->adapter_control); |
| r10315 | r10316 | |
|---|---|---|
| 710 | 710 | duart68681->duart_config = (const duart68681_config *)device->baseconfig().static_config(); |
| 711 | 711 | duart68681->device = device; |
| 712 | 712 | |
| 713 | duart68681->channel[0].tx_timer = timer_alloc(device->machine, tx_timer_callback, (void*)device); | |
| 714 | duart68681->channel[1].tx_timer = timer_alloc(device->machine, tx_timer_callback, (void*)device); | |
| 715 | duart68681->duart_timer = timer_alloc(device->machine, duart_timer_callback, (void*)device); | |
| 713 | duart68681->channel[0].tx_timer = device->machine->scheduler().timer_alloc(FUNC(tx_timer_callback), (void*)device); | |
| 714 | duart68681->channel[1].tx_timer = device->machine->scheduler().timer_alloc(FUNC(tx_timer_callback), (void*)device); | |
| 715 | duart68681->duart_timer = device->machine->scheduler().timer_alloc(FUNC(duart_timer_callback), (void*)device); | |
| 716 | 716 | |
| 717 | 717 | state_save_register_device_item(device, 0, duart68681->ACR); |
| 718 | 718 | state_save_register_device_item(device, 0, duart68681->IMR); |
| r10315 | r10316 | |
|---|---|---|
| 238 | 238 | if ((offset & 0x14) == 0x14) |
| 239 | 239 | { |
| 240 | 240 | static const UINT8 timershift[4] = { 0, 3, 6, 10 }; |
| 241 | attotime curtime = | |
| 241 | attotime curtime = | |
| 242 | 242 | INT64 target; |
| 243 | 243 | |
| 244 | 244 | /* A0-A1 contain the timer divisor */ |
| r10315 | r10316 | |
| 534 | 534 | devcb_resolve_write_line(&m_irq_func, &m_config.m_irq_func, this); |
| 535 | 535 | |
| 536 | 536 | /* allocate timers */ |
| 537 | m_timer = timer_alloc( | |
| 537 | m_timer = m_machine.scheduler().timer_alloc(FUNC( | |
| 538 | 538 | |
| 539 | 539 | /* register for save states */ |
| 540 | 540 | state_save_register_device_item(this, 0, m_port[0].m_in); |
| r10315 | r10316 | |
|---|---|---|
| 169 | 169 | } |
| 170 | 170 | else |
| 171 | 171 | { |
| 172 | val = 0xffff - time_to_cycles( | |
| 172 | val = 0xffff - time_to_cycles( | |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | return val; |
| r10315 | r10316 | |
| 217 | 217 | m_t1lh = 0xb5; /* ports are not written by kernel! */ |
| 218 | 218 | m_t2ll = 0xff; /* taken from vice */ |
| 219 | 219 | m_t2lh = 0xff; |
| 220 | m_time2 = m_time1 = timer_get_time(&m_machine); | |
| 221 | m_t1 = device_timer_alloc(*this, TIMER_T1); | |
| 222 | m_t2 = device_timer_alloc(*this, TIMER_T2); | |
| 223 | m_shift_timer = device_timer_alloc(*this, TIMER_SHIFT); | |
| 220 | m_time2 = m_time1 = m_machine.time(); | |
| 221 | m_t1 = timer_alloc(TIMER_T1); | |
| 222 | m_t2 = timer_alloc(TIMER_T2); | |
| 223 | m_shift_timer = timer_alloc(TIMER_SHIFT); | |
| 224 | 224 | |
| 225 | 225 | /* Default clock is from CPU1 */ |
| 226 | 226 | if (clock() == 0) |
| r10315 | r10316 | |
| 441 | 441 | m_out_b |= 0x80; |
| 442 | 442 | } |
| 443 | 443 | m_t1_active = 0; |
| 444 | m_time1 = | |
| 444 | m_time1 = | |
| 445 | 445 | } |
| 446 | 446 | if (m_ddr_b) |
| 447 | 447 | { |
| r10315 | r10316 | |
| 458 | 458 | // t2 timeout |
| 459 | 459 | case TIMER_T2: |
| 460 | 460 | m_t2_active = 0; |
| 461 | m_time2 = | |
| 461 | m_time2 = | |
| 462 | 462 | |
| 463 | 463 | if (!(m_ifr & INT_T2)) |
| 464 | 464 | { |
| r10315 | r10316 | |
| 605 | 605 | } |
| 606 | 606 | else |
| 607 | 607 | { |
| 608 | val = (0x10000 - (time_to_cycles( | |
| 608 | val = (0x10000 - (time_to_cycles( | |
| 609 | 609 | } |
| 610 | 610 | } |
| 611 | 611 | break; |
| r10315 | r10316 | |
| 623 | 623 | } |
| 624 | 624 | else |
| 625 | 625 | { |
| 626 | val = (0x10000 - (time_to_cycles( | |
| 626 | val = (0x10000 - (time_to_cycles( | |
| 627 | 627 | } |
| 628 | 628 | } |
| 629 | 629 | break; |
| r10315 | r10316 | |
| 825 | 825 | { |
| 826 | 826 | timer_adjust_oneshot(m_t2, cycles_to_time(TIMER2_VALUE), 0); |
| 827 | 827 | m_t2_active = 1; |
| 828 | m_time2 = | |
| 828 | m_time2 = | |
| 829 | 829 | } |
| 830 | 830 | break; |
| 831 | 831 |
| r10315 | r10316 | |
|---|---|---|
| 340 | 340 | static void pr8210_init(laserdisc_state *ld) |
| 341 | 341 | { |
| 342 | 342 | astring tempstring; |
| 343 | attotime curtime = | |
| 343 | attotime curtime = | |
| 344 | 344 | ldplayer_data *player = ld->player; |
| 345 | 345 | |
| 346 | 346 | /* reset our state */ |
| r10315 | r10316 | |
| 380 | 380 | |
| 381 | 381 | /* signal VSYNC and set a timer to turn it off */ |
| 382 | 382 | player->vsync = TRUE; |
| 383 | | |
| 383 | | |
| 384 | 384 | |
| 385 | 385 | /* also set a timer to fetch the VBI data when it is ready */ |
| 386 | | |
| 386 | | |
| 387 | 387 | } |
| 388 | 388 | |
| 389 | 389 | |
| r10315 | r10316 | |
| 451 | 451 | /* handle rising edge */ |
| 452 | 452 | if (prev != ASSERT_LINE && data == ASSERT_LINE) |
| 453 | 453 | { |
| 454 | attotime curtime = | |
| 454 | attotime curtime = | |
| 455 | 455 | attotime delta, overalldelta; |
| 456 | 456 | int longpulse; |
| 457 | 457 | |
| r10315 | r10316 | |
| 840 | 840 | |
| 841 | 841 | /* on the falling edge of bit 5, start the slow timer */ |
| 842 | 842 | if (!(data & 0x20) && (prev & 0x20)) |
| 843 | player->slowtrg = | |
| 843 | player->slowtrg = | |
| 844 | 844 | |
| 845 | 845 | /* bit 6 when low triggers an IRQ on the MCU */ |
| 846 | 846 | if (player->cpu != NULL) |
| r10315 | r10316 | |
| 1119 | 1119 | if (LOG_SIMUTREK) |
| 1120 | 1120 | printf("%3d:VSYNC IRQ\n", ld->screen->vpos()); |
| 1121 | 1121 | cpu_set_input_line(player->simutrek.cpu, MCS48_INPUT_IRQ, ASSERT_LINE); |
| 1122 | | |
| 1122 | | |
| 1123 | 1123 | } |
| 1124 | 1124 | } |
| 1125 | 1125 | |
| r10315 | r10316 | |
| 1164 | 1164 | |
| 1165 | 1165 | static void simutrek_data_w(laserdisc_state *ld, UINT8 prev, UINT8 data) |
| 1166 | 1166 | { |
| 1167 | | |
| 1167 | | |
| 1168 | 1168 | if (LOG_SIMUTREK) |
| 1169 | 1169 | printf("%03d:**** Simutrek Command = %02X\n", ld->screen->vpos(), data); |
| 1170 | 1170 | } |
| r10315 | r10316 | |
|---|---|---|
| 153 | 153 | state_save_register_item(machine, "ds2401", NULL, which, c->rx ); |
| 154 | 154 | state_save_register_item(machine, "ds2401", NULL, which, c->tx ); |
| 155 | 155 | |
| 156 | c->timer = timer_alloc(machine, ds2401_tick , NULL); | |
| 157 | c->reset_timer = timer_alloc(machine, ds2401_reset , NULL); | |
| 156 | c->timer = machine->scheduler().timer_alloc(FUNC(ds2401_tick )); | |
| 157 | c->reset_timer = machine->scheduler().timer_alloc(FUNC(ds2401_reset )); | |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | void ds2401_write( running_machine *machine, int which, int data ) |
| r10315 | r10316 | |
|---|---|---|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | |
| 135 | m_timer[0] = timer_alloc(&m_machine, ptm6840_timer1_cb, (void *)this); | |
| 136 | m_timer[1] = timer_alloc(&m_machine, ptm6840_timer2_cb, (void *)this); | |
| 137 | m_timer[2] = timer_alloc(&m_machine, ptm6840_timer3_cb, (void *)this); | |
| 135 | m_timer[0] = m_machine.scheduler().timer_alloc(FUNC(ptm6840_timer1_cb), (void *)this); | |
| 136 | m_timer[1] = m_machine.scheduler().timer_alloc(FUNC(ptm6840_timer2_cb), (void *)this); | |
| 137 | m_timer[2] = m_machine.scheduler().timer_alloc(FUNC(ptm6840_timer3_cb), (void *)this); | |
| 138 | 138 | |
| 139 | 139 | for (int i = 0; i < 3; i++) |
| 140 | 140 | { |
| r10315 | r10316 | |
|---|---|---|
| 159 | 159 | case 3: // reset SCSI bus |
| 160 | 160 | scsi_regs[REG_INTSTATE] = 4; // command sent OK |
| 161 | 161 | xfer_state = 0; |
| 162 | | |
| 162 | | |
| 163 | 163 | break; |
| 164 | 164 | case 0x42: // select with ATN steps |
| 165 | | |
| 165 | | |
| 166 | 166 | if ((fifo[1] == 0) || (fifo[1] == 0x48) || (fifo[1] == 0x4b)) |
| 167 | 167 | { |
| 168 | 168 | scsi_regs[REG_INTSTATE] = 6; |
| r10315 | r10316 | |
| 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 | | |
| 195 | | |
| 196 | 196 | scsi_regs[REG_INTSTATE] = 6; // command sent OK |
| 197 | 197 | break; |
| 198 | 198 | default: |
| r10315 | r10316 | |
|---|---|---|
| 238 | 238 | devcb_resolve_write8(&m_out_iorq_func, &m_config.m_out_iorq_func, this); |
| 239 | 239 | |
| 240 | 240 | // allocate timer |
| 241 | m_timer = timer_alloc( | |
| 241 | m_timer = m_machine.scheduler().timer_alloc(FUNC( | |
| 242 | 242 | |
| 243 | 243 | // register for state saving |
| 244 | 244 | state_save_register_device_item_array(this, 0, m_regs); |
| r10315 | r10316 | |
| 876 | 876 | void z80dma_device::rdy_w(int state) |
| 877 | 877 | { |
| 878 | 878 | if (LOG) logerror("Z80DMA '%s' RDY: %d Active High: %d\n", tag(), state, READY_ACTIVE_HIGH); |
| 879 | | |
| 879 | | |
| 880 | 880 | } |
| 881 | 881 | |
| 882 | 882 |
| r10315 | r10316 | |
|---|---|---|
| 400 | 400 | duart[chip].ch[1].pending_interrupt = 0; |
| 401 | 401 | |
| 402 | 402 | // allocate transmit timers |
| 403 | duart[chip].ch[0].tx_fifo_timer = timer_alloc( | |
| 403 | duart[chip].ch[0].tx_fifo_timer = machine->scheduler().timer_alloc(FUNC( | |
| 404 | 404 | timer_adjust_oneshot(duart[chip].ch[0].tx_fifo_timer, attotime::never, (chip * 2) + 0); |
| 405 | 405 | |
| 406 | duart[chip].ch[1].tx_fifo_timer = timer_alloc( | |
| 406 | duart[chip].ch[1].tx_fifo_timer = machine->scheduler().timer_alloc(FUNC( | |
| 407 | 407 | timer_adjust_oneshot(duart[chip].ch[1].tx_fifo_timer, attotime::never, (chip * 2) + 1); |
| 408 | 408 | } |
| 409 | 409 |
| r10315 | r10316 | |
|---|---|---|
| 621 | 621 | |
| 622 | 622 | cpu_device *cpudevice = downcast<cpu_device *>(device); |
| 623 | 623 | attotime target_time = cpudevice->local_time() + cpudevice->cycles_to_attotime(cpudevice->min_cycles()); |
| 624 | | |
| 624 | | |
| 625 | 625 | } |
| 626 | 626 | |
| 627 | 627 | |
| r10315 | r10316 | |
| 638 | 638 | |
| 639 | 639 | cpu_device *cpudevice = downcast<cpu_device *>(device); |
| 640 | 640 | attotime target_time = cpudevice->local_time() + cpudevice->cycles_to_attotime(cpudevice->min_cycles()); |
| 641 | | |
| 641 | | |
| 642 | 642 | } |
| 643 | 643 | |
| 644 | 644 | |
| r10315 | r10316 | |
| 664 | 664 | |
| 665 | 665 | /* make sure there are no queued interrupts */ |
| 666 | 666 | if (enabled == 0) |
| 667 | | |
| 667 | device->machine->schedul | |
| 668 | 668 | } |
| 669 | 669 | |
| 670 | 670 |
| r10315 | r10316 | |
|---|---|---|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /* set initial values */ |
| 140 | m_timer = device_timer_alloc(*this, TIMER_OPERATION); | |
| 141 | m_msbflip_timer = device_timer_alloc(*this, TIMER_MSBFLIP); | |
| 140 | m_timer = timer_alloc(TIMER_OPERATION); | |
| 141 | m_msbflip_timer = timer_alloc(TIMER_MSBFLIP); | |
| 142 | 142 | |
| 143 | 143 | /* register for state saving */ |
| 144 | 144 | state_save_register_device_item_array(this, 0, m_address); |
| r10315 | r10316 | |
| 449 | 449 | { |
| 450 | 450 | int param = (channel << 1) | (state ? 1 : 0); |
| 451 | 451 | |
| 452 | | |
| 452 | | |
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | WRITE_LINE_DEVICE_HANDLER( i8257_hlda_w ) { } |
| r10315 | r10316 | |
|---|---|---|
| 110 | 110 | { |
| 111 | 111 | int i; |
| 112 | 112 | for (i = 0; i < 3; i++) |
| 113 | tmp68301_timer[i] = timer_alloc( | |
| 113 | tmp68301_timer[i] = machine->scheduler().timer_alloc(FUNC( | |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | MACHINE_RESET( tmp68301 ) |
| r10315 | r10316 | |
|---|---|---|
| 244 | 244 | devcb_resolve_write_line(&m_out_int_func, &m_config.m_out_int_func, this); |
| 245 | 245 | |
| 246 | 246 | // create the counter timers |
| 247 | m_timer[TIMER_A] = timer_alloc(&m_machine, static_timer_count, (void *)this); | |
| 248 | m_timer[TIMER_B] = timer_alloc(&m_machine, static_timer_count, (void *)this); | |
| 249 | m_timer[TIMER_C] = timer_alloc(&m_machine, static_timer_count, (void *)this); | |
| 250 | m_timer[TIMER_D] = timer_alloc(&m_machine, static_timer_count, (void *)this); | |
| 247 | m_timer[TIMER_A] = m_machine.scheduler().timer_alloc(FUNC(static_timer_count), (void *)this); | |
| 248 | m_timer[TIMER_B] = m_machine.scheduler().timer_alloc(FUNC(static_timer_count), (void *)this); | |
| 249 | m_timer[TIMER_C] = m_machine.scheduler().timer_alloc(FUNC(static_timer_count), (void *)this); | |
| 250 | m_timer[TIMER_D] = m_machine.scheduler().timer_alloc(FUNC(static_timer_count), (void *)this); | |
| 251 | 251 | |
| 252 | 252 | // create serial receive clock timer |
| 253 | 253 | if (m_config.m_rx_clock > 0) |
| 254 | 254 | { |
| 255 | m_rx_timer = timer_alloc( | |
| 255 | m_rx_timer = m_machine.scheduler().timer_alloc(FUNC( | |
| 256 | 256 | timer_adjust_periodic(m_rx_timer, attotime::zero, 0, attotime::from_hz(m_config.m_rx_clock)); |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | // create serial transmit clock timer |
| 260 | 260 | if (m_config.m_tx_clock > 0) |
| 261 | 261 | { |
| 262 | m_tx_timer = timer_alloc( | |
| 262 | m_tx_timer = m_machine.scheduler().timer_alloc(FUNC( | |
| 263 | 263 | timer_adjust_periodic(m_tx_timer, attotime::zero, 0, attotime::from_hz(m_config.m_tx_clock)); |
| 264 | 264 | } |
| 265 | 265 |
| r10315 | r10316 | |
|---|---|---|
| 233 | 233 | |
| 234 | 234 | /* set the ERP signal to 1 to indicate start of frame, and set a timer to turn it off */ |
| 235 | 235 | ld->player->daticerp = 1; |
| 236 | | |
| 236 | | |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | |
| r10315 | r10316 | |
| 245 | 245 | static INT32 vp931_update(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime) |
| 246 | 246 | { |
| 247 | 247 | /* set the first VBI timer to go at the start of line 16 */ |
| 248 | | |
| 248 | | |
| 249 | 249 | |
| 250 | 250 | /* play forward by default */ |
| 251 | 251 | return fieldnum; |
| r10315 | r10316 | |
| 260 | 260 | static void vp931_data_w(laserdisc_state *ld, UINT8 prev, UINT8 data) |
| 261 | 261 | { |
| 262 | 262 | /* set a timer to synchronize execution before sending the data */ |
| 263 | | |
| 263 | | |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | |
| r10315 | r10316 | |
| 335 | 335 | if (which == 0) |
| 336 | 336 | { |
| 337 | 337 | cpu_set_input_line(player->cpu, MCS48_INPUT_IRQ, ASSERT_LINE); |
| 338 | timer_set( | |
| 338 | machine->scheduler().timer_set( | |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | /* clock the data strobe on each subsequent callback */ |
| r10315 | r10316 | |
| 343 | 343 | { |
| 344 | 344 | player->daticval = code >> (8 * (3 - which)); |
| 345 | 345 | player->datastrobe = 1; |
| 346 | timer_set( | |
| 346 | machine->scheduler().timer_set( | |
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 | /* determine the next bit to fetch and reprime ourself */ |
| r10315 | r10316 | |
| 353 | 353 | line++; |
| 354 | 354 | } |
| 355 | 355 | if (line <= LASERDISC_CODE_LINE18 + 1) |
| 356 | timer_set( | |
| 356 | machine->scheduler().timer_set( | |
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 |
| r10315 | r10316 | |
|---|---|---|
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | m_timer = timer_alloc( | |
| 137 | m_timer = m_machine.scheduler().timer_alloc(FUNC( | |
| 138 | 138 | |
| 139 | 139 | state_save_register_device_item(this, 0, m_high ); |
| 140 | 140 | state_save_register_device_item(this, 0, m_low ); |
| r10315 | r10316 | |
|---|---|---|
| 128 | 128 | { |
| 129 | 129 | cpu_set_input_line(m_cpu, INPUT_LINE_IRQ2, ASSERT_LINE); |
| 130 | 130 | } |
| 131 | timer_set( | |
| 131 | m_machine.scheduler().timer_set( | |
| 132 | 132 | } |
| 133 | 133 | } |
| 134 | 134 | // else |
| r10315 | r10316 | |
|---|---|---|
| 116 | 116 | m_tx_clock = m_config.m_tx_clock; |
| 117 | 117 | m_tx_counter = 0; |
| 118 | 118 | m_rx_counter = 0; |
| 119 | m_rx_timer = timer_alloc(&m_machine, receive_event_callback, (void *)this); | |
| 120 | m_tx_timer = timer_alloc(&m_machine, transmit_event_callback, (void *)this); | |
| 119 | m_rx_timer = m_machine.scheduler().timer_alloc(FUNC(receive_event_callback), (void *)this); | |
| 120 | m_tx_timer = m_machine.scheduler().timer_alloc(FUNC(transmit_event_callback), (void *)this); | |
| 121 | 121 | m_first_reset = 1; |
| 122 | 122 | m_status_read = 0; |
| 123 | 123 | m_brk = 0; |
| r10315 | r10316 | |
|---|---|---|
| 105 | 105 | |
| 106 | 106 | void mb3773_device::device_start() |
| 107 | 107 | { |
| 108 | m_watchdog_timer = timer_alloc( | |
| 108 | m_watchdog_timer = m_machine.scheduler().timer_alloc( FUNC( | |
| 109 | 109 | reset_timer(); |
| 110 | 110 | |
| 111 | 111 | state_save_register_device_item( this, 0, m_ck ); |
| r10315 | r10316 | |
|---|---|---|
| 293 | 293 | if (m_config.m_rx_clock_a != 0) |
| 294 | 294 | { |
| 295 | 295 | // allocate channel A receive timer |
| 296 | m_rxca_timer = timer_alloc( | |
| 296 | m_rxca_timer = m_machine.scheduler().timer_alloc(FUNC( | |
| 297 | 297 | timer_adjust_periodic(m_rxca_timer, attotime::zero, 0, attotime::from_hz(m_config.m_rx_clock_a)); |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | if (m_config.m_tx_clock_a != 0) |
| 301 | 301 | { |
| 302 | 302 | // allocate channel A transmit timer |
| 303 | m_txca_timer = timer_alloc( | |
| 303 | m_txca_timer = m_machine.scheduler().timer_alloc(FUNC( | |
| 304 | 304 | timer_adjust_periodic(m_txca_timer, attotime::zero, 0, attotime::from_hz(m_config.m_tx_clock_a)); |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | if (m_config.m_rx_clock_b != 0) |
| 308 | 308 | { |
| 309 | 309 | // allocate channel B receive timer |
| 310 | m_rxcb_timer = timer_alloc( | |
| 310 | m_rxcb_timer = m_machine.scheduler().timer_alloc(FUNC( | |
| 311 | 311 | timer_adjust_periodic(m_rxcb_timer, attotime::zero, 0, attotime::from_hz(m_config.m_rx_clock_b)); |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | if (m_config.m_tx_clock_b != 0) |
| 315 | 315 | { |
| 316 | 316 | // allocate channel B transmit timer |
| 317 | m_txcb_timer = timer_alloc( | |
| 317 | m_txcb_timer = m_machine.scheduler().timer_alloc(FUNC( | |
| 318 | 318 | timer_adjust_periodic(m_txcb_timer, attotime::zero, 0, attotime::from_hz(m_config.m_tx_clock_b)); |
| 319 | 319 | } |
| 320 | 320 |
| r10315 | r10316 | |
|---|---|---|
| 352 | 352 | } |
| 353 | 353 | |
| 354 | 354 | /* queue up a service request out in the future */ |
| 355 | timer_set( | |
| 355 | machine->scheduler().timer_set( | |
| 356 | 356 | } |
| 357 | 357 | else |
| 358 | 358 | { |
| r10315 | r10316 | |
| 424 | 424 | scsi_data.busphase = PHS_MESS_IN; |
| 425 | 425 | |
| 426 | 426 | /* queue up a service request out in the future */ |
| 427 | timer_set( | |
| 427 | machine->scheduler().timer_set( | |
| 428 | 428 | } |
| 429 | 429 | } |
| 430 | 430 | else |
| r10315 | r10316 | |
| 454 | 454 | scsi_data.regs[WD_AUXILIARY_STATUS] |= ASR_CIP; |
| 455 | 455 | |
| 456 | 456 | /* the command will be completed once the data is transferred */ |
| 457 | timer_set( | |
| 457 | machine->scheduler().timer_set( | |
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 | /* Command handlers */ |
| r10315 | r10316 | |
| 795 | 795 | } |
| 796 | 796 | |
| 797 | 797 | /* allocate a timer for commands */ |
| 798 | scsi_data.cmd_timer = timer_alloc( | |
| 798 | scsi_data.cmd_timer = machine->scheduler().timer_alloc(FUNC( | |
| 799 | 799 | |
| 800 | 800 | scsi_data.temp_input = auto_alloc_array( machine, UINT8, TEMP_INPUT_LEN ); |
| 801 | 801 |
| r10315 | r10316 | |
|---|---|---|
| 406 | 406 | |
| 407 | 407 | assert(intf != NULL); |
| 408 | 408 | |
| 409 | pic8259->timer = | |
| 409 | pic8259->timer = | |
| 410 | 410 | |
| 411 | 411 | /* resolve callbacks */ |
| 412 | 412 | devcb_resolve_write_line(&pic8259->out_int_func, &intf->out_int_func, device); |
| r10315 | r10316 | |
|---|---|---|
| 292 | 292 | device_t *device = (device_t *)param; |
| 293 | 293 | laserdisc_state *ld = get_safe_token(device); |
| 294 | 294 | ldcore_data *ldcore = ld->core; |
| 295 | attotime curtime = | |
| 295 | attotime curtime = | |
| 296 | 296 | |
| 297 | 297 | /* update current track based on slider speed */ |
| 298 | 298 | update_slider_pos(ldcore, curtime); |
| r10315 | r10316 | |
| 305 | 305 | (*ldcore->intf.vsync)(ld, &ldcore->metadata[ldcore->fieldnum], ldcore->fieldnum, curtime); |
| 306 | 306 | |
| 307 | 307 | /* set a timer to begin fetching the next frame just before the VBI data would be fetched */ |
| 308 | | |
| 308 | | |
| 309 | 309 | } |
| 310 | 310 | } |
| 311 | 311 | |
| r10315 | r10316 | |
| 319 | 319 | { |
| 320 | 320 | laserdisc_state *ld = (laserdisc_state *)ptr; |
| 321 | 321 | ldcore_data *ldcore = ld->core; |
| 322 | attotime curtime = | |
| 322 | attotime curtime = | |
| 323 | 323 | |
| 324 | 324 | /* wait for previous read and decode to finish */ |
| 325 | 325 | process_track_data(ld->device); |
| r10315 | r10316 | |
| 554 | 554 | ldcore_data *ldcore = ld->core; |
| 555 | 555 | attotime vsyncperiod = ld->screen->frame_period(); |
| 556 | 556 | |
| 557 | update_slider_pos(ldcore, | |
| 557 | update_slider_pos(ldcore, | |
| 558 | 558 | |
| 559 | 559 | /* if 0, set the time to 0 */ |
| 560 | 560 | if (tracks_per_vsync == 0) |
| r10315 | r10316 | |
| 582 | 582 | { |
| 583 | 583 | ldcore_data *ldcore = ld->core; |
| 584 | 584 | |
| 585 | update_slider_pos(ldcore, | |
| 585 | update_slider_pos(ldcore, | |
| 586 | 586 | add_and_clamp_track(ldcore, numtracks); |
| 587 | 587 | if (LOG_SLIDER) |
| 588 | 588 | printf("Advance by %d\n", numtracks); |
| r10315 | r10316 | |
| 599 | 599 | ldcore_data *ldcore = ld->core; |
| 600 | 600 | |
| 601 | 601 | /* update the slider position first */ |
| 602 | update_slider_pos(ldcore, | |
| 602 | update_slider_pos(ldcore, | |
| 603 | 603 | |
| 604 | 604 | /* return the status */ |
| 605 | 605 | if (ldcore->curtrack == 1) |
| r10315 | r10316 | |
| 1549 | 1549 | static DEVICE_RESET( laserdisc ) |
| 1550 | 1550 | { |
| 1551 | 1551 | laserdisc_state *ld = get_safe_token(device); |
| 1552 | attotime curtime = | |
| 1552 | attotime curtime = | |
| 1553 | 1553 | ldcore_data *ldcore = ld->core; |
| 1554 | 1554 | int pltype, line; |
| 1555 | 1555 |
| r10315 | r10316 | |
|---|---|---|
| 268 | 268 | |
| 269 | 269 | void intelfsh_device::device_start() |
| 270 | 270 | { |
| 271 | m_timer = | |
| 271 | m_timer = | |
| 272 | 272 | |
| 273 | 273 | state_save_register_device_item( this, 0, m_status ); |
| 274 | 274 | state_save_register_device_item( this, 0, m_flash_mode ); |
| r10315 | r10316 | |
|---|---|---|
| 129 | 129 | |
| 130 | 130 | void at28c16_device::device_start() |
| 131 | 131 | { |
| 132 | m_write_timer = timer_alloc( | |
| 132 | m_write_timer = m_machine.scheduler().timer_alloc( FUNC( | |
| 133 | 133 | |
| 134 | 134 | state_save_register_device_item( this, 0, m_a9_12v ); |
| 135 | 135 | state_save_register_device_item( this, 0, m_oe_12v ); |
| r10315 | r10316 | |
|---|---|---|
| 434 | 434 | case 5: |
| 435 | 435 | |
| 436 | 436 | #if 0 |
| 437 | if (ins8250->send.active && ( | |
| 437 | if (ins8250->send.active && ( | |
| 438 | 438 | { |
| 439 | 439 | // currently polling is enough for pc1512 |
| 440 | 440 | ins8250->lsr |= 0x40; /* set TSRE */ |
| r10315 | r10316 | |
|---|---|---|
| 3168 | 3168 | { |
| 3169 | 3169 | s3c24xx_t *s3c24xx = get_token( device); |
| 3170 | 3170 | s3c24xx->iface = (const s3c24xx_interface *)device->baseconfig().static_config(); |
| 3171 | for (int i = 0; i < 5; i++) s3c24xx->pwm.timer[i] = timer_alloc( device->machine, s3c24xx_pwm_timer_exp, (void*)device); | |
| 3172 | for (int i = 0; i < 4; i++) s3c24xx->dma[i].timer = timer_alloc( device->machine, s3c24xx_dma_timer_exp, (void*)device); | |
| 3173 | s3c24xx->iic.timer = timer_alloc( device->machine, s3c24xx_iic_timer_exp, (void*)device); | |
| 3174 | s3c24xx->iis.timer = timer_alloc( device->machine, s3c24xx_iis_timer_exp, (void*)device); | |
| 3175 | s3c24xx->lcd.timer = timer_alloc( device->machine, s3c24xx_lcd_timer_exp, (void*)device); | |
| 3176 | s3c24xx->rtc.timer_tick_count = timer_alloc( device->machine, s3c24xx_rtc_timer_tick_count_exp, (void*)device); | |
| 3177 | s3c24xx->rtc.timer_update = timer_alloc( device->machine, s3c24xx_rtc_timer_update_exp, (void*)device); | |
| 3178 | s3c24xx->wdt.timer = timer_alloc( device->machine, s3c24xx_wdt_timer_exp, (void*)device); | |
| 3171 | for (int i = 0; i < 5; i++) s3c24xx->pwm.timer[i] = device->machine->scheduler().timer_alloc( FUNC(s3c24xx_pwm_timer_exp), (void*)device); | |
| 3172 | for (int i = 0; i < 4; i++) s3c24xx->dma[i].timer = device->machine->scheduler().timer_alloc( FUNC(s3c24xx_dma_timer_exp), (void*)device); | |
| 3173 | s3c24xx->iic.timer = device->machine->scheduler().timer_alloc( FUNC(s3c24xx_iic_timer_exp), (void*)device); | |
| 3174 | s3c24xx->iis.timer = device->machine->scheduler().timer_alloc( FUNC(s3c24xx_iis_timer_exp), (void*)device); | |
| 3175 | s3c24xx->lcd.timer = device->machine->scheduler().timer_alloc( FUNC(s3c24xx_lcd_timer_exp), (void*)device); | |
| 3176 | s3c24xx->rtc.timer_tick_count = device->machine->scheduler().timer_alloc( FUNC(s3c24xx_rtc_timer_tick_count_exp), (void*)device); | |
| 3177 | s3c24xx->rtc.timer_update = device->machine->scheduler().timer_alloc( FUNC(s3c24xx_rtc_timer_update_exp), (void*)device); | |
| 3178 | s3c24xx->wdt.timer = device->machine->scheduler().timer_alloc( FUNC(s3c24xx_wdt_timer_exp), (void*)device); | |
| 3179 | 3179 | timer_adjust_periodic( s3c24xx->rtc.timer_update, attotime::from_msec( 1000), 0, attotime::from_msec( 1000)); |
| 3180 | 3180 | s3c24xx_rtc_init( device); |
| 3181 | 3181 | } |
| r10315 | r10316 | |
|---|---|---|
| 279 | 279 | kbdc8042.inport = 0xa0; |
| 280 | 280 | at_8042_set_outport(machine, 0xfe, 1); |
| 281 | 281 | |
| 282 | timer_pulse( | |
| 282 | machine->scheduler().timer_pulse( | |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | static void at_8042_receive(running_machine *machine, UINT8 data) |
| r10315 | r10316 | |
|---|---|---|
| 105 | 105 | assert(offset == 0); |
| 106 | 106 | |
| 107 | 107 | if (latch8->intf->nosync != 0xff) |
| 108 | | |
| 108 | | |
| 109 | 109 | else |
| 110 | 110 | update(device, data, 0xFF); |
| 111 | 111 | } |
| r10315 | r10316 | |
| 165 | 165 | if (latch8->intf->nosync & mask) |
| 166 | 166 | update(device, masked_data, mask); |
| 167 | 167 | else |
| 168 | | |
| 168 | | |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | WRITE8_DEVICE_HANDLER( latch8_bit0_w ) { latch8_bitx_w(device, 0, offset, data); } |
| r10315 | r10316 | |
|---|---|---|
| 124 | 124 | devcb_resolve_write_line(&m_chan[i].m_out_dack_func, &m_config.m_out_dack_func[i], this); |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | m_timer = timer_alloc( | |
| 127 | m_timer = m_machine.scheduler().timer_alloc(FUNC( | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 |
| r10315 | r10316 | |
|---|---|---|
| 165 | 165 | if (device->clock() > 0) |
| 166 | 166 | { |
| 167 | 167 | /* create the scan timer */ |
| 168 | cdp1852->scan_timer = | |
| 168 | cdp1852->scan_timer = | |
| 169 | 169 | timer_adjust_periodic(cdp1852->scan_timer, attotime::zero, 0, attotime::from_hz(device->clock())); |
| 170 | 170 | } |
| 171 | 171 |
| r10315 | r10316 | |
|---|---|---|
| 524 | 524 | { |
| 525 | 525 | m_device = device; |
| 526 | 526 | m_index = index; |
| 527 | m_receive_timer = | |
| 527 | m_receive_timer = | |
| 528 | 528 | } |
| 529 | 529 | |
| 530 | 530 | |
| r10315 | r10316 | |
| 713 | 713 | |
| 714 | 714 | void z80sio_device::sio_channel::set_cts(int state) |
| 715 | 715 | { |
| 716 | | |
| 716 | | |
| 717 | 717 | } |
| 718 | 718 | |
| 719 | 719 | |
| r10315 | r10316 | |
| 723 | 723 | |
| 724 | 724 | void z80sio_device::sio_channel::set_dcd(int state) |
| 725 | 725 | { |
| 726 | | |
| 726 | | |
| 727 | 727 | } |
| 728 | 728 | |
| 729 | 729 |
| r10315 | r10316 | |
|---|---|---|
| 159 | 159 | microtouch.tx_callback = tx_cb; |
| 160 | 160 | microtouch.touch_callback = touch_cb; |
| 161 | 161 | |
| 162 | microtouch.timer = timer_alloc(m | |
| 162 | microtouch.timer = machine->scheduler().timer_alloc(FUNC(m | |
| 163 | 163 | timer_adjust_periodic(microtouch.timer, attotime::from_hz(167*5), 0, attotime::from_hz(167*5)); |
| 164 | 164 | |
| 165 | 165 | state_save_register_item(machine, "microtouch", NULL, 0, microtouch.reset_done); |
| r10315 | r10316 | |
|---|---|---|
| 336 | 336 | if (write_line != NULL) |
| 337 | 337 | devcb_resolve_write_line(&m_zc, write_line, m_device); |
| 338 | 338 | m_notimer = notimer; |
| 339 | m_timer = | |
| 339 | m_timer = | |
| 340 | 340 | |
| 341 | 341 | // register for save states |
| 342 | 342 | state_save_register_device_item(m_device, m_index, m_mode); |
| r10315 | r10316 | |
|---|---|---|
| 614 | 614 | { |
| 615 | 615 | attotime next_fire_time = timer->last_updated + cycles_to_output * attotime::from_hz( timer->clockin ); |
| 616 | 616 | |
| 617 | timer_adjust_oneshot(timer->updatetimer, next_fire_time - | |
| 617 | timer_adjust_oneshot(timer->updatetimer, next_fire_time - | |
| 618 | 618 | } |
| 619 | 619 | |
| 620 | 620 | LOG2(("pit8253: simulate2(): simulating %d cycles for %d in mode %d, bcd = %d, phase = %d, gate = %d, output %d, value = 0x%04x, cycles_to_output = %04x\n", |
| r10315 | r10316 | |
| 654 | 654 | { |
| 655 | 655 | /* With the 82C54's maximum clockin of 10MHz, 64 bits is nearly 60,000 |
| 656 | 656 | years of time. Should be enough for now. */ |
| 657 | attotime now = | |
| 657 | attotime now = | |
| 658 | 658 | attotime elapsed_time = now - timer->last_updated; |
| 659 | 659 | INT64 elapsed_cycles = elapsed_time.as_double() * timer->clockin; |
| 660 | 660 | |
| r10315 | r10316 | |
| 916 | 916 | |
| 917 | 917 | update(device, timer); |
| 918 | 918 | |
| 919 | if ( | |
| 919 | if ( | |
| 920 | 920 | { |
| 921 | 921 | middle_of_a_cycle = 1; |
| 922 | 922 | } |
| r10315 | r10316 | |
| 1081 | 1081 | |
| 1082 | 1082 | /* initialize timer */ |
| 1083 | 1083 | timer->clockin = pit8253->config->timer[timerno].clockin; |
| 1084 | timer->updatetimer = | |
| 1084 | timer->updatetimer = | |
| 1085 | 1085 | timer_adjust_oneshot(timer->updatetimer, attotime::never, timerno); |
| 1086 | 1086 | |
| 1087 | 1087 | /* resolve callbacks */ |
| r10315 | r10316 | |
| 1149 | 1149 | timer->null_count = 1; |
| 1150 | 1150 | timer->cycles_to_output = CYCLES_NEVER; |
| 1151 | 1151 | |
| 1152 | timer->last_updated = | |
| 1152 | timer->last_updated = | |
| 1153 | 1153 | |
| 1154 | 1154 | update(device, timer); |
| 1155 | 1155 | } |
| r10315 | r10316 | |
|---|---|---|
| 129 | 129 | m_rtc[3] = (current_time >> 16) & 0xff; |
| 130 | 130 | m_rtc[4] = (current_time >> 24) & 0xff; |
| 131 | 131 | |
| 132 | emu_timer *timer = timer_alloc( | |
| 132 | emu_timer *timer = m_machine.scheduler().timer_alloc(FUNC( | |
| 133 | 133 | timer_adjust_periodic(timer, attotime::from_hz(256), 0, attotime::from_hz(256)); |
| 134 | 134 | } |
| 135 | 135 |
| r10315 | r10316 | |
|---|---|---|
| 257 | 257 | |
| 258 | 258 | /* signal VSYNC and set a timer to turn it off */ |
| 259 | 259 | player->vsync = TRUE; |
| 260 | | |
| 260 | | |
| 261 | 261 | |
| 262 | 262 | /* also set a timer to fetch the VBI data when it is ready */ |
| 263 | | |
| 263 | | |
| 264 | 264 | |
| 265 | 265 | /* boost interleave for the first 1ms to improve communications */ |
| 266 | 266 | cpuexec_boost_interleave(ld->device->machine, attotime::zero, attotime::from_msec(1)); |
| r10315 | r10316 | |
|---|---|---|
| 183 | 183 | |
| 184 | 184 | void mc146818_device::device_start() |
| 185 | 185 | { |
| 186 | m_last_refresh = timer_get_time(&m_machine); | |
| 187 | emu_timer *timer = device_timer_alloc(*this); | |
| 186 | m_last_refresh = m_machine.time(); | |
| 187 | emu_timer *timer = timer_alloc(); | |
| 188 | 188 | if (m_config.m_type == mc146818_device_config::MC146818_UTC) { |
| 189 | 189 | // hack: for apollo we increase the update frequency to stay in sync with real time |
| 190 | 190 | timer_adjust_periodic(timer, attotime::from_hz(2), 0, attotime::from_hz(2)); |
| r10315 | r10316 | |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | m_updated = true; /* clock has been updated */ |
| 330 | m_last_refresh = | |
| 330 | m_last_refresh = | |
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | |
| r10315 | r10316 | |
| 436 | 436 | switch (m_index % MC146818_DATA_SIZE) { |
| 437 | 437 | case 0xa: |
| 438 | 438 | data = m_data[m_index % MC146818_DATA_SIZE]; |
| 439 | if (( | |
| 439 | if (( | |
| 440 | 440 | data |= 0x80; |
| 441 | 441 | #if 0 |
| 442 | 442 | /* for pc1512 bios realtime clock test */ |
| r10315 | r10316 | |
|---|---|---|
| 522 | 522 | state->regs[reg_A] |= reg_A_UIP; |
| 523 | 523 | |
| 524 | 524 | /* schedule end of update cycle */ |
| 525 | | |
| 525 | | |
| 526 | 526 | } |
| 527 | 527 | } |
| 528 | 528 | |
| r10315 | r10316 | |
| 688 | 688 | rtc65271_config *config = (rtc65271_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config(); |
| 689 | 689 | rtc65271_state *state = get_safe_token(device); |
| 690 | 690 | |
| 691 | state->update_timer = | |
| 691 | state->update_timer = | |
| 692 | 692 | timer_adjust_periodic(state->update_timer, attotime::from_seconds(1), 0, attotime::from_seconds(1)); |
| 693 | state->SQW_timer = | |
| 693 | state->SQW_timer = | |
| 694 | 694 | state->interrupt_callback = config->interrupt_callback; |
| 695 | 695 | |
| 696 | 696 | state_save_register_device_item_array(device, 0, state->regs); |
| r10315 | r10316 | |
|---|---|---|
| 442 | 442 | suspend_until_trigger(TRIGGER_SUSPENDTIME + timetrig, true); |
| 443 | 443 | |
| 444 | 444 | // then set a timer for it |
| 445 | | |
| 445 | | |
| 446 | 446 | timetrig = (timetrig + 1) % 256; |
| 447 | 447 | } |
| 448 | 448 | |
| r10315 | r10316 | |
| 558 | 558 | |
| 559 | 559 | // allocate timers if we need them |
| 560 | 560 | if (m_execute_config.m_vblank_interrupts_per_frame > 1) |
| 561 | m_partial_frame_timer = | |
| 561 | m_partial_frame_timer = | |
| 562 | 562 | if (m_execute_config.m_timed_interrupt_period != attotime::zero) |
| 563 | m_timedint_timer = | |
| 563 | m_timedint_timer = | |
| 564 | 564 | |
| 565 | 565 | // register for save states |
| 566 | 566 | state_save_register_device_item(&m_device, 0, m_suspend); |
| r10315 | r10316 | |
| 917 | 917 | |
| 918 | 918 | // if this is the first one, set the timer |
| 919 | 919 | if (event_index == 0) |
| 920 | | |
| 920 | | |
| 921 | 921 | } |
| 922 | 922 | } |
| 923 | 923 |
| r10315 | r10316 | |
|---|---|---|
| 428 | 428 | m_tail = tail; |
| 429 | 429 | m_count += count; |
| 430 | 430 | } |
| 431 | ||
| 432 | T &insert_after(T &object, T *insert_after) | |
| 433 | { | |
| 434 | if (insert_after == NULL) | |
| 435 | return prepend(object); | |
| 436 | object.m_next = insert_after->m_next; | |
| 437 | insert_after->m_next = &object; | |
| 438 | m_count++; | |
| 439 | return object; | |
| 440 | } | |
| 431 | 441 | |
| 432 | 442 | T *detach_head() |
| 433 | 443 | { |
| r10315 | r10316 | |
|---|---|---|
| 341 | 341 | m_container->set_user_settings(settings); |
| 342 | 342 | |
| 343 | 343 | // allocate the VBLANK timers |
| 344 | m_vblank_begin_timer = timer_alloc(machine, static_vblank_begin_callback, (void *)this); | |
| 345 | m_vblank_end_timer = timer_alloc(machine, static_vblank_end_callback, (void *)this); | |
| 344 | m_vblank_begin_timer = machine->scheduler().timer_alloc(FUNC(static_vblank_begin_callback), (void *)this); | |
| 345 | m_vblank_end_timer = machine->scheduler().timer_alloc(FUNC(static_vblank_end_callback), (void *)this); | |
| 346 | 346 | |
| 347 | 347 | // allocate a timer to reset partial updates |
| 348 | m_scanline0_timer = timer_alloc( | |
| 348 | m_scanline0_timer = machine->scheduler().timer_alloc(FUNC( | |
| 349 | 349 | |
| 350 | 350 | // allocate a timer to generate per-scanline updates |
| 351 | 351 | if ((machine->config->m_video_attributes & VIDEO_UPDATE_SCANLINE) != 0) |
| 352 | m_scanline_timer = timer_alloc( | |
| 352 | m_scanline_timer = machine->scheduler().timer_alloc(FUNC( | |
| 353 | 353 | |
| 354 | 354 | // configure the screen with the default parameters |
| 355 | 355 | configure(m_config.m_width, m_config.m_height, m_config.m_visarea, m_config.m_refresh); |
| r10315 | r10316 | |
| 467 | 467 | void screen_device::reset_origin(int beamy, int beamx) |
| 468 | 468 | { |
| 469 | 469 | // compute the effective VBLANK start/end times |
| 470 | attotime curtime = | |
| 470 | attotime curtime = | |
| 471 | 471 | m_vblank_end_time = curtime - attotime(0, beamy * m_scantime + beamx * m_pixeltime); |
| 472 | 472 | m_vblank_start_time = m_vblank_end_time - attotime(0, m_vblank_period); |
| 473 | 473 | |
| r10315 | r10316 | |
| 667 | 667 | |
| 668 | 668 | int screen_device::vpos() const |
| 669 | 669 | { |
| 670 | attoseconds_t delta = ( | |
| 670 | attoseconds_t delta = ( | |
| 671 | 671 | int vpos; |
| 672 | 672 | |
| 673 | 673 | // round to the nearest pixel |
| r10315 | r10316 | |
| 688 | 688 | |
| 689 | 689 | int screen_device::hpos() const |
| 690 | 690 | { |
| 691 | attoseconds_t delta = ( | |
| 691 | attoseconds_t delta = ( | |
| 692 | 692 | |
| 693 | 693 | // round to the nearest pixel |
| 694 | 694 | delta += m_pixeltime / 2; |
| r10315 | r10316 | |
| 724 | 724 | attoseconds_t targetdelta = (attoseconds_t)vpos * m_scantime + (attoseconds_t)hpos * m_pixeltime; |
| 725 | 725 | |
| 726 | 726 | // if we're past that time (within 1/2 of a pixel), head to the next frame |
| 727 | attoseconds_t curdelta = ( | |
| 727 | attoseconds_t curdelta = ( | |
| 728 | 728 | if (targetdelta <= curdelta + m_pixeltime / 2) |
| 729 | 729 | targetdelta += m_frame_period; |
| 730 | 730 | while (targetdelta <= curdelta) |
| r10315 | r10316 | |
| 748 | 748 | attotime target_time = m_vblank_end_time; |
| 749 | 749 | if (!vblank()) |
| 750 | 750 | target_time += attotime(0, m_frame_period); |
| 751 | return target_time - | |
| 751 | return target_time - | |
| 752 | 752 | } |
| 753 | 753 | |
| 754 | 754 | |
| r10315 | r10316 | |
| 787 | 787 | void screen_device::vblank_begin_callback() |
| 788 | 788 | { |
| 789 | 789 | // reset the starting VBLANK time |
| 790 | m_vblank_start_time = | |
| 790 | m_vblank_start_time = | |
| 791 | 791 | m_vblank_end_time = m_vblank_start_time + attotime(0, m_vblank_period); |
| 792 | 792 | |
| 793 | 793 | // call the screen specific callbacks |
| r10315 | r10316 | |
|---|---|---|
| 166 | 166 | // beam positioning and state |
| 167 | 167 | int vpos() const; |
| 168 | 168 | int hpos() const; |
| 169 | bool vblank() const { return ( | |
| 169 | bool vblank() const { return ( | |
| 170 | 170 | bool hblank() const { int curpos = hpos(); return (curpos < m_visarea.min_x || curpos > m_visarea.max_x); } |
| 171 | 171 | |
| 172 | 172 | // timing |
| r10315 | r10316 | |
|---|---|---|
| 258 | 258 | void sound_stream::update() |
| 259 | 259 | { |
| 260 | 260 | // determine the number of samples since the start of this second |
| 261 | attotime time = | |
| 261 | attotime time = | |
| 262 | 262 | INT32 update_sampindex = INT32(time.attoseconds / m_attoseconds_per_sample); |
| 263 | 263 | |
| 264 | 264 | // if we're ahead of the last update, then adjust upwards |
| r10315 | r10316 | |
| 766 | 766 | |
| 767 | 767 | sound_manager::sound_manager(running_machine &machine) |
| 768 | 768 | : m_machine(machine), |
| 769 | m_update_timer(timer_alloc( | |
| 769 | m_update_timer(machine.scheduler().timer_alloc(FUNC( | |
| 770 | 770 | m_finalmix_leftover(0), |
| 771 | 771 | m_finalmix(NULL), |
| 772 | 772 | m_leftmix(NULL), |
| r10315 | r10316 | |
| 1045 | 1045 | } |
| 1046 | 1046 | |
| 1047 | 1047 | // see if we ticked over to the next second |
| 1048 | attotime curtime = | |
| 1048 | attotime curtime = | |
| 1049 | 1049 | bool second_tick = false; |
| 1050 | 1050 | if (curtime.seconds != m_last_update.seconds) |
| 1051 | 1051 | { |
| r10315 | r10316 | |
|---|---|---|
| 2 | 2 | |
| 3 | 3 | timer.c |
| 4 | 4 | |
| 5 | Functions needed to generate timing and synchronization between several | |
| 6 | CPUs. | |
| 5 | Timer devices. | |
| 7 | 6 | |
| 8 | Copyright Nicola Salmoria and the MAME Team. | |
| 9 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | **************************************************************************** | |
| 10 | 8 | |
| 9 | Copyright Aaron Giles | |
| 10 | All rights reserved. | |
| 11 | ||
| 12 | Redistribution and use in source and binary forms, with or without | |
| 13 | modification, are permitted provided that the following conditions are | |
| 14 | met: | |
| 15 | ||
| 16 | * Redistributions of source code must retain the above copyright | |
| 17 | notice, this list of conditions and the following disclaimer. | |
| 18 | * Redistributions in binary form must reproduce the above copyright | |
| 19 | notice, this list of conditions and the following disclaimer in | |
| 20 | the documentation and/or other materials provided with the | |
| 21 | distribution. | |
| 22 | * Neither the name 'MAME' nor the names of its contributors may be | |
| 23 | used to endorse or promote products derived from this software | |
| 24 | without specific prior written permission. | |
| 25 | ||
| 26 | THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR | |
| 27 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
| 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
| 29 | DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT, | |
| 30 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |
| 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
| 32 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
| 33 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | |
| 34 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | |
| 35 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
| 36 | POSSIBILITY OF SUCH DAMAGE. | |
| 37 | ||
| 11 | 38 | ***************************************************************************/ |
| 12 | 39 | |
| 13 | 40 | #include "emu.h" |
| r10315 | r10316 | |
| 15 | 42 | |
| 16 | 43 | |
| 17 | 44 | /*************************************************************************** |
| 18 | ||
| 45 | // DEBUGGING | |
| 19 | 46 | ***************************************************************************/ |
| 20 | 47 | |
| 21 | 48 | #define VERBOSE 0 |
| r10315 | r10316 | |
| 25 | 52 | |
| 26 | 53 | |
| 27 | 54 | /*************************************************************************** |
| 28 | | |
| 55 | // DEVICE DEFINITION | |
| 29 | 56 | ***************************************************************************/ |
| 30 | 57 | |
| 31 | #define MAX_TIMERS 256 | |
| 32 | #define MAX_QUANTA 16 | |
| 33 | ||
| 34 | #define DEFAULT_MINIMUM_QUANTUM ATTOSECONDS_IN_MSEC(100) | |
| 35 | ||
| 36 | ||
| 37 | ||
| 38 | /*************************************************************************** | |
| 39 | DEVICE DEFINITIONS | |
| 40 | ***************************************************************************/ | |
| 41 | ||
| 42 | 58 | const device_type TIMER = timer_device_config::static_alloc_device_config; |
| 43 | 59 | |
| 44 | 60 | |
| 45 | 61 | |
| 46 | /*************************************************************************** | |
| 47 | TYPE DEFINITIONS | |
| 48 | ***************************************************************************/ | |
| 49 | 62 | |
| 50 | class emu_timer | |
| 51 | { | |
| 52 | public: | |
| 53 | running_machine * machine; /* pointer to the owning machine */ | |
| 54 | emu_timer * next; /* next timer in order in the list */ | |
| 55 | emu_timer * prev; /* previous timer in order in the list */ | |
| 56 | timer_fired_func callback; /* callback function */ | |
| 57 | INT32 param; /* integer parameter */ | |
| 58 | void * ptr; /* pointer parameter */ | |
| 59 | const char * file; /* file that created the timer */ | |
| 60 | int line; /* line number that created the timer */ | |
| 61 | const char * func; /* string name of the callback function */ | |
| 62 | UINT8 enabled; /* is the timer enabled? */ | |
| 63 | UINT8 temporary; /* is the timer temporary? */ | |
| 64 | attotime period; /* the repeat frequency of the timer */ | |
| 65 | attotime start; /* time when the timer was started */ | |
| 66 | attotime expire; /* time when the timer will expire */ | |
| 67 | device_t * device; /* for device timers, a pointer to the device */ | |
| 68 | device_timer_id id; /* for device timers, the ID of the timer */ | |
| 69 | }; | |
| 70 | ||
| 71 | ||
| 72 | /* a single minimum quantum */ | |
| 73 | typedef struct _quantum_slot quantum_slot; | |
| 74 | struct _quantum_slot | |
| 75 | { | |
| 76 | attoseconds_t actual; /* actual duration of the quantum */ | |
| 77 | attoseconds_t requested; /* duration of the requested quantum */ | |
| 78 | attotime expire; /* absolute expiration time of this quantum */ | |
| 79 | }; | |
| 80 | ||
| 81 | ||
| 82 | /* global private data */ | |
| 83 | /* In mame.h: typedef struct _timer_private timer_private; */ | |
| 84 | struct _timer_private | |
| 85 | { | |
| 86 | /* list of active timers */ | |
| 87 | emu_timer timers[MAX_TIMERS]; /* actual timers */ | |
| 88 | emu_timer * activelist; /* head of the active list */ | |
| 89 | emu_timer * freelist; /* head of the free list */ | |
| 90 | emu_timer * freelist_tail; /* tail of the free list */ | |
| 91 | ||
| 92 | /* execution state */ | |
| 93 | timer_execution_state exec; /* current global execution state */ | |
| 94 | ||
| 95 | /* other internal states */ | |
| 96 | emu_timer * callback_timer; /* pointer to the current callback timer */ | |
| 97 | UINT8 callback_timer_modified; /* TRUE if the current callback timer was modified */ | |
| 98 | attotime callback_timer_expire_time; /* the original expiration time */ | |
| 99 | ||
| 100 | /* scheduling quanta */ | |
| 101 | quantum_slot quantum_list[MAX_QUANTA]; /* list of scheduling quanta */ | |
| 102 | quantum_slot * quantum_current; /* current minimum quantum */ | |
| 103 | attoseconds_t quantum_minimum; /* duration of minimum quantum */ | |
| 104 | }; | |
| 105 | ||
| 106 | ||
| 107 | ||
| 108 | /*************************************************************************** | |
| 109 | FUNCTION PROTOTYPES | |
| 110 | ***************************************************************************/ | |
| 111 | ||
| 112 | static STATE_POSTLOAD( timer_postload ); | |
| 113 | static void timer_logtimers(running_machine *machine); | |
| 114 | static void timer_remove(emu_timer *which); | |
| 115 | ||
| 116 | ||
| 117 | ||
| 118 | /*************************************************************************** | |
| 119 | INLINE FUNCTIONS | |
| 120 | ***************************************************************************/ | |
| 121 | ||
| 122 | /*------------------------------------------------- | |
| 123 | get_current_time - return the current time | |
| 124 | -------------------------------------------------*/ | |
| 125 | ||
| 126 | INLINE attotime get_current_time(running_machine *machine) | |
| 127 | { | |
| 128 | timer_private *global = machine->timer_data; | |
| 129 | ||
| 130 | /* if we're currently in a callback, use the timer's expiration time as a base */ | |
| 131 | if (global->callback_timer != NULL) | |
| 132 | return global->callback_timer_expire_time; | |
| 133 | ||
| 134 | /* if we're executing as a particular CPU, use its local time as a base */ | |
| 135 | /* otherwise, return the global base time */ | |
| 136 | device_execute_interface *execdevice = machine->scheduler().currently_executing(); | |
| 137 | return (execdevice != NULL) ? execdevice->local_time() : global->exec.basetime; | |
| 138 | } | |
| 139 | ||
| 140 | ||
| 141 | /*------------------------------------------------- | |
| 142 | timer_new - allocate a new timer | |
| 143 | -------------------------------------------------*/ | |
| 144 | ||
| 145 | INLINE emu_timer *timer_new(running_machine *machine) | |
| 146 | { | |
| 147 | timer_private *global = machine->timer_data; | |
| 148 | emu_timer *timer; | |
| 149 | ||
| 150 | /* if nothing remains available, fatal error -- we should never hit this */ | |
| 151 | if (global->freelist == NULL) | |
| 152 | { | |
| 153 | timer_logtimers(machine); | |
| 154 | fatalerror("Out of timers!"); | |
| 155 | } | |
| 156 | ||
| 157 | /* pull an entry from the free list */ | |
| 158 | timer = global->freelist; | |
| 159 | global->freelist = timer->next; | |
| 160 | if (global->freelist == NULL) | |
| 161 | global->freelist_tail = NULL; | |
| 162 | ||
| 163 | /* set up the machine */ | |
| 164 | timer->machine = machine; | |
| 165 | return timer; | |
| 166 | } | |
| 167 | ||
| 168 | ||
| 169 | /*------------------------------------------------- | |
| 170 | timer_list_insert - insert a new timer into | |
| 171 | the list at the appropriate location | |
| 172 | -------------------------------------------------*/ | |
| 173 | ||
| 174 | INLINE void timer_list_insert(emu_timer *timer) | |
| 175 | { | |
| 176 | attotime expire = timer->enabled ? timer->expire : attotime::never; | |
| 177 | timer_private *global = timer->machine->timer_data; | |
| 178 | emu_timer *t, *lt = NULL; | |
| 179 | ||
| 180 | /* sanity checks for the debug build */ | |
| 181 | #ifdef MAME_DEBUG | |
| 182 | { | |
| 183 | int tnum = 0; | |
| 184 | ||
| 185 | /* loop over the timer list */ | |
| 186 | for (t = global->activelist; t; t = t->next, tnum++) | |
| 187 | { | |
| 188 | if (t == timer) | |
| 189 | fatalerror("This timer is already inserted in the list!"); | |
| 190 | if (tnum == MAX_TIMERS-1) | |
| 191 | fatalerror("Timer list is full!"); | |
| 192 | } | |
| 193 | } | |
| 194 | #endif | |
| 195 | ||
| 196 | /* loop over the timer list */ | |
| 197 | for (t = global->activelist; t != NULL; lt = t, t = t->next) | |
| 198 | { | |
| 199 | /* if the current list entry expires after us, we should be inserted before it */ | |
| 200 | if (t->expire > expire) | |
| 201 | { | |
| 202 | /* link the new guy in before the current list entry */ | |
| 203 | timer->prev = t->prev; | |
| 204 | timer->next = t; | |
| 205 | ||
| 206 | if (t->prev != NULL) | |
| 207 | t->prev->next = timer; | |
| 208 | else | |
| 209 | { | |
| 210 | global->activelist = timer; | |
| 211 | global->exec.nextfire = timer->expire; | |
| 212 | } | |
| 213 | t->prev = timer; | |
| 214 | return; | |
| 215 | } | |
| 216 | } | |
| 217 | ||
| 218 | /* need to insert after the last one */ | |
| 219 | if (lt != NULL) | |
| 220 | lt->next = timer; | |
| 221 | else | |
| 222 | { | |
| 223 | global->activelist = timer; | |
| 224 | global->exec.nextfire = timer->expire; | |
| 225 | } | |
| 226 | timer->prev = lt; | |
| 227 | timer->next = NULL; | |
| 228 | } | |
| 229 | ||
| 230 | ||
| 231 | /*------------------------------------------------- | |
| 232 | timer_list_remove - remove a timer from the | |
| 233 | linked list | |
| 234 | -------------------------------------------------*/ | |
| 235 | ||
| 236 | INLINE void timer_list_remove(emu_timer *timer) | |
| 237 | { | |
| 238 | timer_private *global = timer->machine->timer_data; | |
| 239 | ||
| 240 | /* sanity checks for the debug build */ | |
| 241 | #ifdef MAME_DEBUG | |
| 242 | { | |
| 243 | emu_timer *t; | |
| 244 | ||
| 245 | /* loop over the timer list */ | |
| 246 | for (t = global->activelist; t && t != timer; t = t->next) ; | |
| 247 | if (t == NULL) | |
| 248 | fatalerror("timer (%s from %s:%d) not found in list", timer->func, timer->file, timer->line); | |
| 249 | } | |
| 250 | #endif | |
| 251 | ||
| 252 | /* remove it from the list */ | |
| 253 | if (timer->prev != NULL) | |
| 254 | timer->prev->next = timer->next; | |
| 255 | else | |
| 256 | { | |
| 257 | global->activelist = timer->next; | |
| 258 | if (global->activelist != NULL) | |
| 259 | global->exec.nextfire = global->activelist->expire; | |
| 260 | } | |
| 261 | if (timer->next != NULL) | |
| 262 | timer->next->prev = timer->prev; | |
| 263 | } | |
| 264 | ||
| 265 | ||
| 266 | ||
| 267 | /*************************************************************************** | |
| 268 | INITIALIZATION | |
| 269 | ***************************************************************************/ | |
| 270 | ||
| 271 | /*------------------------------------------------- | |
| 272 | timer_init - initialize the timer system | |
| 273 | -------------------------------------------------*/ | |
| 274 | ||
| 275 | void timer_init(running_machine *machine) | |
| 276 | { | |
| 277 | timer_private *global; | |
| 278 | int i; | |
| 279 | ||
| 280 | /* allocate global data */ | |
| 281 | global = machine->timer_data = auto_alloc_clear(machine, timer_private); | |
| 282 | ||
| 283 | /* we need to wait until the first call to timer_cyclestorun before using real CPU times */ | |
| 284 | global->exec.basetime = attotime::zero; | |
| 285 | global->exec.nextfire = attotime::never; | |
| 286 | global->exec.curquantum = DEFAULT_MINIMUM_QUANTUM; | |
| 287 | global->callback_timer = NULL; | |
| 288 | global->callback_timer_modified = FALSE; | |
| 289 | ||
| 290 | /* register with the save state system */ | |
| 291 | state_save_register_item(machine, "timer", NULL, 0, global->exec.basetime.seconds); | |
| 292 | state_save_register_item(machine, "timer", NULL, 0, global->exec.basetime.attoseconds); | |
| 293 | state_save_register_postload(machine, timer_postload, NULL); | |
| 294 | ||
| 295 | /* initialize the lists */ | |
| 296 | global->activelist = NULL; | |
| 297 | global->freelist = &global->timers[0]; | |
| 298 | for (i = 0; i < MAX_TIMERS-1; i++) | |
| 299 | global->timers[i].next = &global->timers[i+1]; | |
| 300 | global->timers[MAX_TIMERS-1].next = NULL; | |
| 301 | global->freelist_tail = &global->timers[MAX_TIMERS-1]; | |
| 302 | ||
| 303 | /* reset the quanta */ | |
| 304 | global->quantum_list[0].requested = DEFAULT_MINIMUM_QUANTUM; | |
| 305 | global->quantum_list[0].actual = DEFAULT_MINIMUM_QUANTUM; | |
| 306 | global->quantum_list[0].expire = attotime::never; | |
| 307 | global->quantum_current = &global->quantum_list[0]; | |
| 308 | global->quantum_minimum = ATTOSECONDS_IN_NSEC(1) / 1000; | |
| 309 | } | |
| 310 | ||
| 311 | ||
| 312 | /*------------------------------------------------- | |
| 313 | timer_destructor - destruct a timer from a | |
| 314 | pool callback | |
| 315 | -------------------------------------------------*/ | |
| 316 | ||
| 317 | void timer_destructor(void *ptr, size_t size) | |
| 318 | { | |
| 319 | timer_remove((emu_timer *)ptr); | |
| 320 | } | |
| 321 | ||
| 322 | ||
| 323 | ||
| 324 | /*************************************************************************** | |
| 325 | SCHEDULING HELPERS | |
| 326 | ***************************************************************************/ | |
| 327 | ||
| 328 | /*------------------------------------------------- | |
| 329 | timer_get_execution_state - return a pointer | |
| 330 | to the execution state | |
| 331 | -------------------------------------------------*/ | |
| 332 | ||
| 333 | timer_execution_state *timer_get_execution_state(running_machine *machine) | |
| 334 | { | |
| 335 | timer_private *global = machine->timer_data; | |
| 336 | return &global->exec; | |
| 337 | } | |
| 338 | ||
| 339 | ||
| 340 | /*------------------------------------------------- | |
| 341 | timer_execute_timers - execute timers and | |
| 342 | update scheduling quanta | |
| 343 | -------------------------------------------------*/ | |
| 344 | ||
| 345 | void timer_execute_timers(running_machine *machine) | |
| 346 | { | |
| 347 | timer_private *global = machine->timer_data; | |
| 348 | emu_timer *timer; | |
| 349 | ||
| 350 | /* if the current quantum has expired, find a new one */ | |
| 351 | if (global->exec.basetime >= global->quantum_current->expire) | |
| 352 | { | |
| 353 | int curr; | |
| 354 | ||
| 355 | global->quantum_current->requested = 0; | |
| 356 | global->quantum_current = &global->quantum_list[0]; | |
| 357 | for (curr = 1; curr < ARRAY_LENGTH(global->quantum_list); curr++) | |
| 358 | if (global->quantum_list[curr].requested != 0 && global->quantum_list[curr].requested < global->quantum_current->requested) | |
| 359 | global->quantum_current = &global->quantum_list[curr]; | |
| 360 | global->exec.curquantum = global->quantum_current->actual; | |
| 361 | } | |
| 362 | ||
| 363 | LOG(("timer_set_global_time: new=%s head->expire=%s\n", global->exec.basetime.as_string(), global->activelist->expire.as_string())); | |
| 364 | ||
| 365 | /* now process any timers that are overdue */ | |
| 366 | while (global->activelist->expire <= global->exec.basetime) | |
| 367 | { | |
| 368 | int was_enabled = global->activelist->enabled; | |
| 369 | ||
| 370 | /* if this is a one-shot timer, disable it now */ | |
| 371 | timer = global->activelist; | |
| 372 | if (timer->period == attotime::zero || timer->period == attotime::never) | |
| 373 | timer->enabled = FALSE; | |
| 374 | ||
| 375 | /* set the global state of which callback we're in */ | |
| 376 | global->callback_timer_modified = FALSE; | |
| 377 | global->callback_timer = timer; | |
| 378 | global->callback_timer_expire_time = timer->expire; | |
| 379 | ||
| 380 | /* call the callback */ | |
| 381 | if (was_enabled) | |
| 382 | { | |
| 383 | if (timer->device != NULL) | |
| 384 | timer->device->timer_fired(*timer, timer->id, timer->param, timer->ptr); | |
| 385 | else if (timer->callback != NULL) | |
| 386 | { | |
| 387 | LOG(("Timer %s:%d[%s] fired (expire=%s)\n", timer->file, timer->line, timer->func, timer->expire.as_string())); | |
| 388 | g_profiler.start(PROFILER_TIMER_CALLBACK); | |
| 389 | (*timer->callback)(machine, timer->ptr, timer->param); | |
| 390 | g_profiler.stop(); | |
| 391 | } | |
| 392 | } | |
| 393 | ||
| 394 | /* clear the callback timer global */ | |
| 395 | global->callback_timer = NULL; | |
| 396 | ||
| 397 | /* reset or remove the timer, but only if it wasn't modified during the callback */ | |
| 398 | if (!global->callback_timer_modified) | |
| 399 | { | |
| 400 | /* if the timer is temporary, remove it now */ | |
| 401 | if (timer->temporary) | |
| 402 | timer_remove(timer); | |
| 403 | ||
| 404 | /* otherwise, reschedule it */ | |
| 405 | else | |
| 406 | { | |
| 407 | timer->start = timer->expire; | |
| 408 | timer->expire += timer->period; | |
| 409 | ||
| 410 | timer_list_remove(timer); | |
| 411 | timer_list_insert(timer); | |
| 412 | } | |
| 413 | } | |
| 414 | } | |
| 415 | } | |
| 416 | ||
| 417 | ||
| 418 | /*------------------------------------------------- | |
| 419 | timer_add_scheduling_quantum - add a | |
| 420 | scheduling quantum; the smallest active one | |
| 421 | is the one that is in use | |
| 422 | -------------------------------------------------*/ | |
| 423 | ||
| 424 | void timer_add_scheduling_quantum(running_machine *machine, attoseconds_t quantum, attotime duration) | |
| 425 | { | |
| 426 | timer_private *global = machine->timer_data; | |
| 427 | attotime curtime = timer_get_time(machine); | |
| 428 | attotime expire = curtime + duration; | |
| 429 | int curr, blank = -1; | |
| 430 | ||
| 431 | /* a 0 request (minimum) needs to be non-zero to occupy a slot */ | |
| 432 | if (quantum == 0) | |
| 433 | quantum = 1; | |
| 434 | ||
| 435 | /* find an equal-duration slot or an empty slot */ | |
| 436 | for (curr = 1; curr < ARRAY_LENGTH(global->quantum_list); curr++) | |
| 437 | { | |
| 438 | quantum_slot *slot = &global->quantum_list[curr]; | |
| 439 | ||
| 440 | /* look for a matching quantum and extend it */ | |
| 441 | if (slot->requested == quantum) | |
| 442 | { | |
| 443 | slot->expire = max(slot->expire, expire); | |
| 444 | return; | |
| 445 | } | |
| 446 | ||
| 447 | /* remember any empty slots in case of no match */ | |
| 448 | if (slot->requested == 0) | |
| 449 | { | |
| 450 | if (blank == -1) | |
| 451 | blank = curr; | |
| 452 | } | |
| 453 | ||
| 454 | /* otherwise, expire any expired slots */ | |
| 455 | else if (curtime >= slot->expire) | |
| 456 | slot->requested = 0; | |
| 457 | } | |
| 458 | ||
| 459 | /* fatal error if no slots left */ | |
| 460 | assert_always(blank != -1, "Out of scheduling quantum slots!"); | |
| 461 | ||
| 462 | /* fill in the item */ | |
| 463 | global->quantum_list[blank].requested = quantum; | |
| 464 | global->quantum_list[blank].actual = MAX(global->quantum_list[blank].requested, global->quantum_minimum); | |
| 465 | global->quantum_list[blank].expire = expire; | |
| 466 | ||
| 467 | /* update the minimum */ | |
| 468 | if (quantum < global->quantum_current->requested) | |
| 469 | { | |
| 470 | global->quantum_current = &global->quantum_list[blank]; | |
| 471 | global->exec.curquantum = global->quantum_current->actual; | |
| 472 | } | |
| 473 | } | |
| 474 | ||
| 475 | ||
| 476 | /*------------------------------------------------- | |
| 477 | timer_set_minimum_quantum - control the | |
| 478 | minimum useful quantum (used by cpuexec only) | |
| 479 | -------------------------------------------------*/ | |
| 480 | ||
| 481 | void timer_set_minimum_quantum(running_machine *machine, attoseconds_t quantum) | |
| 482 | { | |
| 483 | timer_private *global = machine->timer_data; | |
| 484 | int curr; | |
| 485 | ||
| 486 | /* do nothing if nothing changed */ | |
| 487 | if (global->quantum_minimum == quantum) | |
| 488 | return; | |
| 489 | global->quantum_minimum = quantum; | |
| 490 | ||
| 491 | /* adjust all the actuals; this doesn't affect the current */ | |
| 492 | for (curr = 0; curr < ARRAY_LENGTH(global->quantum_list); curr++) | |
| 493 | if (global->quantum_list[curr].requested != 0) | |
| 494 | global->quantum_list[curr].actual = MAX(global->quantum_list[curr].requested, global->quantum_minimum); | |
| 495 | ||
| 496 | /* ensure that the live current quantum is up to date */ | |
| 497 | global->exec.curquantum = global->quantum_current->actual; | |
| 498 | } | |
| 499 | ||
| 500 | ||
| 501 | ||
| 502 | /*************************************************************************** | |
| 503 | SAVE/RESTORE HELPERS | |
| 504 | ***************************************************************************/ | |
| 505 | ||
| 506 | /*------------------------------------------------- | |
| 507 | timer_register_save - register ourself with | |
| 508 | the save state system | |
| 509 | -------------------------------------------------*/ | |
| 510 | ||
| 511 | static void timer_register_save(emu_timer *timer) | |
| 512 | { | |
| 513 | timer_private *global = timer->machine->timer_data; | |
| 514 | int count = 0; | |
| 515 | emu_timer *t; | |
| 516 | ||
| 517 | /* find other timers that match our func name */ | |
| 518 | for (t = global->activelist; t; t = t->next) | |
| 519 | if (!strcmp(t->func, timer->func)) | |
| 520 | count++; | |
| 521 | ||
| 522 | /* use different instances to differentiate the bits */ | |
| 523 | state_save_register_item(timer->machine, "timer", timer->func, count, timer->param); | |
| 524 | state_save_register_item(timer->machine, "timer", timer->func, count, timer->enabled); | |
| 525 | state_save_register_item(timer->machine, "timer", timer->func, count, timer->period.seconds); | |
| 526 | state_save_register_item(timer->machine, "timer", timer->func, count, timer->period.attoseconds); | |
| 527 | state_save_register_item(timer->machine, "timer", timer->func, count, timer->start.seconds); | |
| 528 | state_save_register_item(timer->machine, "timer", timer->func, count, timer->start.attoseconds); | |
| 529 | state_save_register_item(timer->machine, "timer", timer->func, count, timer->expire.seconds); | |
| 530 | state_save_register_item(timer->machine, "timer", timer->func, count, timer->expire.attoseconds); | |
| 531 | if (timer->device != NULL) | |
| 532 | state_save_register_item(timer->machine, "timer", timer->func, count, timer->id); | |
| 533 | } | |
| 534 | ||
| 535 | ||
| 536 | /*------------------------------------------------- | |
| 537 | timer_postload - after loading a save state | |
| 538 | -------------------------------------------------*/ | |
| 539 | ||
| 540 | static STATE_POSTLOAD( timer_postload ) | |
| 541 | { | |
| 542 | timer_private *global = machine->timer_data; | |
| 543 | emu_timer *privlist = NULL; | |
| 544 | emu_timer *t; | |
| 545 | ||
| 546 | /* remove all timers and make a private list */ | |
| 547 | while (global->activelist != NULL) | |
| 548 | { | |
| 549 | t = global->activelist; | |
| 550 | ||
| 551 | /* temporary timers go away entirely */ | |
| 552 | if (t->temporary) | |
| 553 | timer_remove(t); | |
| 554 | ||
| 555 | /* permanent ones get added to our private list */ | |
| 556 | else | |
| 557 | { | |
| 558 | timer_list_remove(t); | |
| 559 | t->next = privlist; | |
| 560 | privlist = t; | |
| 561 | } | |
| 562 | } | |
| 563 | ||
| 564 | /* now add them all back in; this effectively re-sorts them by time */ | |
| 565 | while (privlist != NULL) | |
| 566 | { | |
| 567 | t = privlist; | |
| 568 | privlist = t->next; | |
| 569 | timer_list_insert(t); | |
| 570 | } | |
| 571 | } | |
| 572 | ||
| 573 | ||
| 574 | /*------------------------------------------------- | |
| 575 | timer_count_anonymous - count the number of | |
| 576 | anonymous (non-saveable) timers | |
| 577 | -------------------------------------------------*/ | |
| 578 | ||
| 579 | int timer_count_anonymous(running_machine *machine) | |
| 580 | { | |
| 581 | timer_private *global = machine->timer_data; | |
| 582 | emu_timer *t; | |
| 583 | int count = 0; | |
| 584 | ||
| 585 | logerror("timer_count_anonymous:\n"); | |
| 586 | for (t = global->activelist; t; t = t->next) | |
| 587 | if (t->temporary && t != global->callback_timer) | |
| 588 | { | |
| 589 | count++; | |
| 590 | logerror(" Temp. timer %p, file %s:%d[%s]\n", (void *) t, t->file, t->line, t->func); | |
| 591 | } | |
| 592 | logerror("%d temporary timers found\n", count); | |
| 593 | ||
| 594 | return count; | |
| 595 | } | |
| 596 | ||
| 597 | ||
| 598 | ||
| 599 | /*************************************************************************** | |
| 600 | CORE TIMER ALLOCATION | |
| 601 | ***************************************************************************/ | |
| 602 | ||
| 603 | /*------------------------------------------------- | |
| 604 | timer_alloc - allocate a permament timer that | |
| 605 | isn't primed yet | |
| 606 | -------------------------------------------------*/ | |
| 607 | ||
| 608 | INLINE emu_timer *_timer_alloc_common(running_machine *machine, device_t *device, device_timer_id id, timer_fired_func callback, void *ptr, const char *file, int line, const char *func, int temp) | |
| 609 | { | |
| 610 | attotime time = get_current_time(machine); | |
| 611 | emu_timer *timer = timer_new(machine); | |
| 612 | ||
| 613 | /* fill in the record */ | |
| 614 | timer->callback = callback; | |
| 615 | timer->ptr = ptr; | |
| 616 | timer->param = 0; | |
| 617 | timer->enabled = FALSE; | |
| 618 | timer->temporary = temp; | |
| 619 | timer->period = attotime::zero; | |
| 620 | timer->file = file; | |
| 621 | timer->line = line; | |
| 622 | timer->func = func; | |
| 623 | timer->device = device; | |
| 624 | timer->id = id; | |
| 625 | ||
| 626 | /* compute the time of the next firing and insert into the list */ | |
| 627 | timer->start = time; | |
| 628 | timer->expire = attotime::never; | |
| 629 | timer_list_insert(timer); | |
| 630 | ||
| 631 | /* if we're not temporary, register ourselves with the save state system */ | |
| 632 | if (!temp) | |
| 633 | { | |
| 634 | if (!state_save_registration_allowed(machine)) | |
| 635 | fatalerror("timer_alloc() called after save state registration closed! (file %s, line %d)\n", file, line); | |
| 636 | timer_register_save(timer); | |
| 637 | } | |
| 638 | ||
| 639 | /* return a handle */ | |
| 640 | return timer; | |
| 641 | } | |
| 642 | ||
| 643 | emu_timer *_timer_alloc_internal(running_machine *machine, timer_fired_func callback, void *ptr, const char *file, int line, const char *func) | |
| 644 | { | |
| 645 | return _timer_alloc_common(machine, NULL, 0, callback, ptr, file, line, func, FALSE); | |
| 646 | } | |
| 647 | ||
| 648 | emu_timer *device_timer_alloc(device_t &device, UINT32 id, void *ptr) | |
| 649 | { | |
| 650 | return _timer_alloc_common(device.machine, &device, id, NULL, ptr, __FILE__, __LINE__, device.tag(), FALSE); | |
| 651 | } | |
| 652 | ||
| 653 | ||
| 654 | /*------------------------------------------------- | |
| 655 | timer_remove - remove a timer from the | |
| 656 | system | |
| 657 | -------------------------------------------------*/ | |
| 658 | ||
| 659 | static void timer_remove(emu_timer *which) | |
| 660 | { | |
| 661 | timer_private *global = which->machine->timer_data; | |
| 662 | ||
| 663 | /* if this is a callback timer, note that */ | |
| 664 | if (which == global->callback_timer) | |
| 665 | global->callback_timer_modified = TRUE; | |
| 666 | ||
| 667 | /* remove it from the list */ | |
| 668 | timer_list_remove(which); | |
| 669 | ||
| 670 | /* free it up by adding it back to the free list */ | |
| 671 | if (global->freelist_tail) | |
| 672 | global->freelist_tail->next = which; | |
| 673 | else | |
| 674 | global->freelist = which; | |
| 675 | which->next = NULL; | |
| 676 | global->freelist_tail = which; | |
| 677 | } | |
| 678 | ||
| 679 | ||
| 680 | ||
| 681 | /*************************************************************************** | |
| 682 | CORE TIMER ADJUSTMENT | |
| 683 | ***************************************************************************/ | |
| 684 | ||
| 685 | /*------------------------------------------------- | |
| 686 | timer_adjust_oneshot - adjust the time when this timer | |
| 687 | will fire and disable any periodic firings | |
| 688 | -------------------------------------------------*/ | |
| 689 | ||
| 690 | void timer_adjust_oneshot(emu_timer *which, attotime duration, INT32 param) | |
| 691 | { | |
| 692 | timer_adjust_periodic(which, duration, param, attotime::never); | |
| 693 | } | |
| 694 | ||
| 695 | ||
| 696 | /*------------------------------------------------- | |
| 697 | timer_adjust_periodic - adjust the time when | |
| 698 | this timer will fire and specify a period for | |
| 699 | subsequent firings | |
| 700 | -------------------------------------------------*/ | |
| 701 | ||
| 702 | void timer_adjust_periodic(emu_timer *which, attotime start_delay, INT32 param, attotime period) | |
| 703 | { | |
| 704 | timer_private *global = which->machine->timer_data; | |
| 705 | attotime time = get_current_time(which->machine); | |
| 706 | ||
| 707 | /* if this is the callback timer, mark it modified */ | |
| 708 | if (which == global->callback_timer) | |
| 709 | global->callback_timer_modified = TRUE; | |
| 710 | ||
| 711 | /* compute the time of the next firing and insert into the list */ | |
| 712 | which->param = param; | |
| 713 | which->enabled = TRUE; | |
| 714 | ||
| 715 | /* clamp negative times to 0 */ | |
| 716 | if (start_delay.seconds < 0) | |
| 717 | start_delay = attotime::zero; | |
| 718 | ||
| 719 | /* set the start and expire times */ | |
| 720 | which->start = time; | |
| 721 | which->expire = time + start_delay; | |
| 722 | which->period = period; | |
| 723 | ||
| 724 | /* remove and re-insert the timer in its new order */ | |
| 725 | timer_list_remove(which); | |
| 726 | timer_list_insert(which); | |
| 727 | ||
| 728 | /* if this was inserted as the head, abort the current timeslice and resync */ | |
| 729 | LOG(("timer_adjust_oneshot %s.%s:%d to expire @ %s\n", which->file, which->func, which->line, which->expire.as_string())); | |
| 730 | if (which == global->activelist) | |
| 731 | which->machine->scheduler().abort_timeslice(); | |
| 732 | } | |
| 733 | ||
| 734 | ||
| 735 | ||
| 736 | /*************************************************************************** | |
| 737 | SIMPLIFIED ANONYMOUS TIMER MANAGEMENT | |
| 738 | ***************************************************************************/ | |
| 739 | ||
| 740 | void device_timer_call_after_resynch(device_t &device, device_timer_id id, INT32 param, void *ptr) | |
| 741 | { | |
| 742 | emu_timer *timer = _timer_alloc_common(device.machine, &device, id, NULL, ptr, __FILE__, __LINE__, device.tag(), TRUE); | |
| 743 | timer_adjust_oneshot(timer, attotime::zero, param); | |
| 744 | } | |
| 745 | ||
| 746 | ||
| 747 | /*------------------------------------------------- | |
| 748 | timer_pulse - allocate a pulse timer, which | |
| 749 | repeatedly calls the callback using the given | |
| 750 | period | |
| 751 | -------------------------------------------------*/ | |
| 752 | ||
| 753 | void _timer_pulse_internal(running_machine *machine, attotime period, void *ptr, INT32 param, timer_fired_func callback, const char *file, int line, const char *func) | |
| 754 | { | |
| 755 | emu_timer *timer = _timer_alloc_common(machine, NULL, 0, callback, ptr, file, line, func, FALSE); | |
| 756 | timer_adjust_periodic(timer, period, param, period); | |
| 757 | } | |
| 758 | ||
| 759 | ||
| 760 | /*------------------------------------------------- | |
| 761 | timer_set - allocate a one-shot timer, which | |
| 762 | calls the callback after the given duration | |
| 763 | -------------------------------------------------*/ | |
| 764 | ||
| 765 | void _timer_set_internal(running_machine *machine, attotime duration, void *ptr, INT32 param, timer_fired_func callback, const char *file, int line, const char *func) | |
| 766 | { | |
| 767 | emu_timer *timer = _timer_alloc_common(machine, NULL, 0, callback, ptr, file, line, func, TRUE); | |
| 768 | timer_adjust_oneshot(timer, duration, param); | |
| 769 | } | |
| 770 | ||
| 771 | ||
| 772 | ||
| 773 | /*************************************************************************** | |
| 774 | MISCELLANEOUS CONTROLS | |
| 775 | ***************************************************************************/ | |
| 776 | ||
| 777 | /*------------------------------------------------- | |
| 778 | timer_reset - reset the timing on a timer | |
| 779 | -------------------------------------------------*/ | |
| 780 | ||
| 781 | void timer_reset(emu_timer *which, attotime duration) | |
| 782 | { | |
| 783 | timer_adjust_periodic(which, duration, which->param, which->period); | |
| 784 | } | |
| 785 | ||
| 786 | ||
| 787 | /*------------------------------------------------- | |
| 788 | timer_enable - enable/disable a timer | |
| 789 | -------------------------------------------------*/ | |
| 790 | ||
| 791 | int timer_enable(emu_timer *which, int enable) | |
| 792 | { | |
| 793 | int old = which->enabled; | |
| 794 | ||
| 795 | /* reschedule only if the state has changed */ | |
| 796 | if (old != enable) | |
| 797 | { | |
| 798 | /* set the enable flag */ | |
| 799 | which->enabled = enable; | |
| 800 | ||
| 801 | /* remove the timer and insert back into the list */ | |
| 802 | timer_list_remove(which); | |
| 803 | timer_list_insert(which); | |
| 804 | } | |
| 805 | ||
| 806 | return old; | |
| 807 | } | |
| 808 | ||
| 809 | ||
| 810 | /*------------------------------------------------- | |
| 811 | timer_enabled - determine if a timer is | |
| 812 | enabled | |
| 813 | -------------------------------------------------*/ | |
| 814 | ||
| 815 | int timer_enabled(emu_timer *which) | |
| 816 | { | |
| 817 | return which->enabled; | |
| 818 | } | |
| 819 | ||
| 820 | ||
| 821 | /*------------------------------------------------- | |
| 822 | timer_get_param - returns the callback | |
| 823 | parameter of a timer | |
| 824 | -------------------------------------------------*/ | |
| 825 | ||
| 826 | int timer_get_param(emu_timer *which) | |
| 827 | { | |
| 828 | return which->param; | |
| 829 | } | |
| 830 | ||
| 831 | ||
| 832 | /*------------------------------------------------- | |
| 833 | timer_set_param - changes the callback | |
| 834 | parameter of a timer | |
| 835 | -------------------------------------------------*/ | |
| 836 | ||
| 837 | void timer_set_param(emu_timer *which, int param) | |
| 838 | { | |
| 839 | which->param = param; | |
| 840 | } | |
| 841 | ||
| 842 | ||
| 843 | /*------------------------------------------------- | |
| 844 | timer_get_ptr - returns the callback pointer | |
| 845 | of a timer | |
| 846 | -------------------------------------------------*/ | |
| 847 | ||
| 848 | void *timer_get_ptr(emu_timer *which) | |
| 849 | { | |
| 850 | return which->ptr; | |
| 851 | } | |
| 852 | ||
| 853 | ||
| 854 | /*------------------------------------------------- | |
| 855 | timer_set_ptr - changes the callback pointer | |
| 856 | of a timer | |
| 857 | -------------------------------------------------*/ | |
| 858 | ||
| 859 | void timer_set_ptr(emu_timer *which, void *ptr) | |
| 860 | { | |
| 861 | which->ptr = ptr; | |
| 862 | } | |
| 863 | ||
| 864 | ||
| 865 | ||
| 866 | /*************************************************************************** | |
| 867 | TIMING FUNCTIONS | |
| 868 | ***************************************************************************/ | |
| 869 | ||
| 870 | /*------------------------------------------------- | |
| 871 | timer_timeelapsed - return the time since the | |
| 872 | last trigger | |
| 873 | -------------------------------------------------*/ | |
| 874 | ||
| 875 | attotime timer_timeelapsed(emu_timer *which) | |
| 876 | { | |
| 877 | return get_current_time(which->machine) - which->start; | |
| 878 | } | |
| 879 | ||
| 880 | ||
| 881 | /*------------------------------------------------- | |
| 882 | timer_timeleft - return the time until the | |
| 883 | next trigger | |
| 884 | -------------------------------------------------*/ | |
| 885 | ||
| 886 | attotime timer_timeleft(emu_timer *which) | |
| 887 | { | |
| 888 | return which->expire - get_current_time(which->machine); | |
| 889 | } | |
| 890 | ||
| 891 | ||
| 892 | /*------------------------------------------------- | |
| 893 | timer_get_time - return the current time | |
| 894 | -------------------------------------------------*/ | |
| 895 | ||
| 896 | attotime timer_get_time(running_machine *machine) | |
| 897 | { | |
| 898 | return get_current_time(machine); | |
| 899 | } | |
| 900 | ||
| 901 | ||
| 902 | /*------------------------------------------------- | |
| 903 | timer_starttime - return the time when this | |
| 904 | timer started counting | |
| 905 | -------------------------------------------------*/ | |
| 906 | ||
| 907 | attotime timer_starttime(emu_timer *which) | |
| 908 | { | |
| 909 | return which->start; | |
| 910 | } | |
| 911 | ||
| 912 | ||
| 913 | /*------------------------------------------------- | |
| 914 | timer_firetime - return the time when this | |
| 915 | timer will fire next | |
| 916 | -------------------------------------------------*/ | |
| 917 | ||
| 918 | attotime timer_firetime(emu_timer *which) | |
| 919 | { | |
| 920 | return which->expire; | |
| 921 | } | |
| 922 | ||
| 923 | ||
| 924 | ||
| 925 | /*************************************************************************** | |
| 926 | DEBUGGING | |
| 927 | ***************************************************************************/ | |
| 928 | ||
| 929 | /*------------------------------------------------- | |
| 930 | timer_logtimers - log all the timers | |
| 931 | -------------------------------------------------*/ | |
| 932 | ||
| 933 | static void timer_logtimers(running_machine *machine) | |
| 934 | { | |
| 935 | timer_private *global = machine->timer_data; | |
| 936 | emu_timer *t; | |
| 937 | ||
| 938 | logerror("===============\n"); | |
| 939 | logerror("TIMER LOG START\n"); | |
| 940 | logerror("===============\n"); | |
| 941 | ||
| 942 | logerror("Enqueued timers:\n"); | |
| 943 | for (t = global->activelist; t; t = t->next) | |
| 944 | logerror(" Start=%15.6f Exp=%15.6f Per=%15.6f Ena=%d Tmp=%d (%s:%d[%s])\n", | |
| 945 | t->start.as_double(), t->expire.as_double(), t->period.as_double(), t->enabled, t->temporary, t->file, t->line, t->func); | |
| 946 | ||
| 947 | logerror("Free timers:\n"); | |
| 948 | for (t = global->freelist; t; t = t->next) | |
| 949 | logerror(" Start=%15.6f Exp=%15.6f Per=%15.6f Ena=%d Tmp=%d (%s:%d[%s])\n", | |
| 950 | t->start.as_double(), t->expire.as_double(), t->period.as_double(), t->enabled, t->temporary, t->file, t->line, t->func); | |
| 951 | ||
| 952 | logerror("==============\n"); | |
| 953 | logerror("TIMER LOG STOP\n"); | |
| 954 | logerror("==============\n"); | |
| 955 | } | |
| 956 | ||
| 957 | ||
| 958 | void timer_print_first_timer(running_machine *machine) | |
| 959 | { | |
| 960 | timer_private *global = machine->timer_data; | |
| 961 | emu_timer *t = global->activelist; | |
| 962 | printf(" Start=%15.6f Exp=%15.6f Per=%15.6f Ena=%d Tmp=%d (%s)\n", | |
| 963 | t->start.as_double(), t->expire.as_double(), t->period.as_double(), t->enabled, t->temporary, t->func); | |
| 964 | } | |
| 965 | ||
| 966 | ||
| 967 | 63 | //************************************************************************** |
| 968 | 64 | // TIMER DEVICE CONFIGURATION |
| 969 | 65 | //************************************************************************** |
| r10315 | r10316 | |
| 1187 | 283 | m_screen = downcast<screen_device *>(machine->device(m_config.m_screen)); |
| 1188 | 284 | |
| 1189 | 285 | // allocate the timer |
| 1190 | m_timer = timer_alloc( | |
| 286 | m_timer = timer_alloc( | |
| 1191 | 287 | |
| 1192 | 288 | // register for save states |
| 1193 | 289 | state_save_register_device_item(this, 0, m_first_time); |
| r10315 | r10316 | |
| 1235 | 331 | } |
| 1236 | 332 | |
| 1237 | 333 | |
| 1238 | /*------------------------------------------------- | |
| 1239 | periodic_timer_callback - calls the timer | |
| 1240 | device specific callback | |
| 1241 | -------------------------------------------------*/ | |
| 334 | //------------------------------------------------- | |
| 335 | // device_timer - handle timer expiration events | |
| 336 | //------------------------------------------------- | |
| 1242 | 337 | |
| 1243 | void timer_device:: | |
| 338 | void timer_device::device_timer(emu_timer &timer, device_timer_ | |
| 1244 | 339 | { |
| 1245 | if (m_config.m_callback != NULL) | |
| 1246 | (*m_config.m_callback)(*this, m_ptr, param); | |
| 1247 | } | |
| 340 | switch (m_config.m_type) | |
| 341 | { | |
| 342 | // general periodic timers just call through | |
| 343 | case timer_device_config::TIMER_TYPE_GENERIC: | |
| 344 | case timer_device_config::TIMER_TYPE_PERIODIC: | |
| 345 | if (m_config.m_type != timer_device_config::TIMER_TYPE_SCANLINE) | |
| 346 | { | |
| 347 | if (m_config.m_callback != NULL) | |
| 348 | (*m_config.m_callback)(*this, m_ptr, param); | |
| 349 | } | |
| 350 | break; | |
| 1248 | 351 | |
| 1249 | 352 | |
| 1250 | /*------------------------------------------------- | |
| 1251 | scanline_timer_device_timer_callback - | |
| 1252 | manages the scanline based timer's state | |
| 1253 | -------------------------------------------------*/ | |
| 353 | // scanline timers have to do some additiona bookkeeping | |
| 354 | case timer_device_config::TIMER_TYPE_SCANLINE: | |
| 355 | { | |
| 356 | // by default, we fire at the first position | |
| 357 | int next_vpos = m_config.m_first_vpos; | |
| 1254 | 358 | |
| 1255 | void timer_device::scanline_timer_callback(int scanline) | |
| 1256 | { | |
| 1257 | // by default, we fire at the first position | |
| 1258 | int next_vpos = m_config.m_first_vpos; | |
| 359 | // the first time through we just go with the default position | |
| 360 | if (!m_first_time) | |
| 361 | { | |
| 362 | // call the real callback | |
| 363 | int vpos = m_screen->vpos(); | |
| 364 | (*m_config.m_callback)(*this, m_ptr, vpos); | |
| 1259 | 365 | |
| 1260 | // the first time through we just go with the default position | |
| 1261 | if (!m_first_time) | |
| 1262 | { | |
| 1263 | // call the real callback | |
| 1264 | int vpos = m_screen->vpos(); | |
| 1265 | (*m_config.m_callback)(*this, m_ptr, vpos); | |
| 366 | // advance by the increment only if we will still be within the screen bounds | |
| 367 | if (m_config.m_increment != 0 && (vpos + m_config.m_increment) < m_screen->height()) | |
| 368 | next_vpos = vpos + m_config.m_increment; | |
| 369 | } | |
| 370 | m_first_time = false; | |
| 1266 | 371 | |
| 1267 | // advance by the increment only if we will still be within the screen bounds | |
| 1268 | if (m_config.m_increment != 0 && (vpos + m_config.m_increment) < m_screen->height()) | |
| 1269 | next_vpos = vpos + m_config.m_increment; | |
| 372 | // adjust the timer | |
| 373 | timer_adjust_oneshot(m_timer, m_screen->time_until_pos(next_vpos), 0); | |
| 374 | break; | |
| 375 | } | |
| 1270 | 376 | } |
| 1271 | m_first_time = false; | |
| 1272 | ||
| 1273 | // adjust the timer | |
| 1274 | timer_adjust_oneshot(m_timer, m_screen->time_until_pos(next_vpos), 0); | |
| 1275 | 377 | } |
| r10315 | r10316 | |
|---|---|---|
| 2 | 2 | |
| 3 | 3 | timer.h |
| 4 | 4 | |
| 5 | Functions needed to generate timing and synchronization between several | |
| 6 | CPUs. | |
| 5 | Timer devices. | |
| 7 | 6 | |
| 8 | Copyright Nicola Salmoria and the MAME Team. | |
| 9 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | **************************************************************************** | |
| 10 | 8 | |
| 9 | Copyright Aaron Giles | |
| 10 | All rights reserved. | |
| 11 | ||
| 12 | Redistribution and use in source and binary forms, with or without | |
| 13 | modification, are permitted provided that the following conditions are | |
| 14 | met: | |
| 15 | ||
| 16 | * Redistributions of source code must retain the above copyright | |
| 17 | notice, this list of conditions and the following disclaimer. | |
| 18 | * Redistributions in binary form must reproduce the above copyright | |
| 19 | notice, this list of conditions and the following disclaimer in | |
| 20 | the documentation and/or other materials provided with the | |
| 21 | distribution. | |
| 22 | * Neither the name 'MAME' nor the names of its contributors may be | |
| 23 | used to endorse or promote products derived from this software | |
| 24 | without specific prior written permission. | |
| 25 | ||
| 26 | THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR | |
| 27 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
| 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
| 29 | DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT, | |
| 30 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |
| 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
| 32 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
| 33 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | |
| 34 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | |
| 35 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
| 36 | POSSIBILITY OF SUCH DAMAGE. | |
| 37 | ||
| 11 | 38 | ***************************************************************************/ |
| 12 | 39 | |
| 13 | 40 | #pragma once |
| r10315 | r10316 | |
| 19 | 46 | #ifndef __TIMER_H__ |
| 20 | 47 | #define __TIMER_H__ |
| 21 | 48 | |
| 22 | #include "devlegcy.h" | |
| 23 | 49 | |
| 24 | 50 | |
| 25 | /*************************************************************************** | |
| 26 | MACROS | |
| 27 | ***************************************************************************/ | |
| 51 | //************************************************************************** | |
| 52 | // MACROS | |
| 53 | //************************************************************************** | |
| 28 | 54 | |
| 29 | /* macro for the RC time constant on a 74LS123 with C > 1000pF */ | |
| 30 | /* R is in ohms, C is in farads */ | |
| 31 | #define TIME_OF_74LS123(r,c) (0.45 * (double)(r) * (double)(c)) | |
| 32 | ||
| 33 | /* macros for the RC time constant on a 555 timer IC */ | |
| 34 | /* R is in ohms, C is in farads */ | |
| 35 | #define PERIOD_OF_555_MONOSTABLE_NSEC(r,c) ((attoseconds_t)(1100000000 * (double)(r) * (double)(c))) | |
| 36 | #define PERIOD_OF_555_ASTABLE_NSEC(r1,r2,c) ((attoseconds_t)( 693000000 * ((double)(r1) + 2.0 * (double)(r2)) * (double)(c))) | |
| 37 | #define PERIOD_OF_555_MONOSTABLE(r,c) attotime::from_nsec(PERIOD_OF_555_MONOSTABLE_NSEC(r,c)) | |
| 38 | #define PERIOD_OF_555_ASTABLE(r1,r2,c) attotime::from_nsec(PERIOD_OF_555_ASTABLE_NSEC(r1,r2,c)) | |
| 39 | ||
| 40 | /* macros that map all allocations to provide file/line/functions to the callee */ | |
| 41 | #define timer_alloc(m,c,ptr) _timer_alloc_internal(m, c, ptr, __FILE__, __LINE__, #c) | |
| 42 | #define timer_pulse(m,e,ptr,p,c) _timer_pulse_internal(m, e, ptr, p, c, __FILE__, __LINE__, #c) | |
| 43 | #define timer_set(m,d,ptr,p,c) _timer_set_internal(m, d, ptr, p, c, __FILE__, __LINE__, #c) | |
| 44 | #define timer_call_after_resynch(m,ptr,p,c) _timer_set_internal(m, attotime::zero, ptr, p, c, __FILE__, __LINE__, #c) | |
| 45 | ||
| 46 | /* macros for a timer callback functions */ | |
| 47 | #define TIMER_CALLBACK(name) void name(running_machine *machine, void *ptr, int param) | |
| 55 | // macros for a timer callback functions | |
| 48 | 56 | #define TIMER_DEVICE_CALLBACK(name) void name(timer_device &timer, void *ptr, INT32 param) |
| 49 | 57 | |
| 50 | 58 | |
| 51 | 59 | |
| 52 | /*************************************************************************** | |
| 53 | TYPE DEFINITIONS | |
| 54 | ***************************************************************************/ | |
| 55 | 60 | |
| 56 | // forward declarations | |
| 57 | class emu_timer; | |
| 58 | class timer_device; | |
| 59 | ||
| 60 | ||
| 61 | // a timer callback looks like this | |
| 62 | typedef void (*timer_fired_func)(running_machine *machine, void *ptr, INT32 param); | |
| 63 | typedef void (*timer_device_fired_func)(timer_device &timer, void *ptr, INT32 param); | |
| 64 | ||
| 65 | ||
| 66 | struct timer_execution_state | |
| 67 | { | |
| 68 | attotime nextfire; /* time that the head of the timer list will fire */ | |
| 69 | attotime basetime; /* global basetime; everything moves forward from here */ | |
| 70 | attoseconds_t curquantum; /* current quantum of execution */ | |
| 71 | }; | |
| 72 | ||
| 73 | ||
| 74 | ||
| 75 | 61 | //************************************************************************** |
| 76 | 62 | // TIMER DEVICE CONFIGURATION MACROS |
| 77 | 63 | //************************************************************************** |
| r10315 | r10316 | |
| 105 | 91 | |
| 106 | 92 | |
| 107 | 93 | |
| 108 | /*************************************************************************** | |
| 109 | FUNCTION PROTOTYPES | |
| 110 | ***************************************************************************/ | |
| 94 | //************************************************************************** | |
| 95 | // TYPE DEFINITIONS | |
| 96 | //************************************************************************** | |
| 111 | 97 | |
| 98 | // forward declarations | |
| 99 | class emu_timer; | |
| 100 | class timer_device; | |
| 112 | 101 | |
| 113 | /* ----- initialization ----- */ | |
| 102 | // a timer callback looks like this | |
| 103 | typedef void (*timer_device_fired_func)(timer_device &timer, void *ptr, INT32 param); | |
| 114 | 104 | |
| 115 | /* initialize the timer system */ | |
| 116 | void timer_init(running_machine *machine); | |
| 117 | 105 | |
| 118 | /* destruct a timer from a pool callback */ | |
| 119 | void timer_destructor(void *ptr, size_t size); | |
| 120 | ||
| 121 | ||
| 122 | ||
| 123 | /* ----- scheduling helpers ----- */ | |
| 124 | ||
| 125 | /* return a pointer to the execution state */ | |
| 126 | timer_execution_state *timer_get_execution_state(running_machine *machine); | |
| 127 | ||
| 128 | /* execute timers and update scheduling quanta */ | |
| 129 | void timer_execute_timers(running_machine *machine); | |
| 130 | ||
| 131 | /* add a scheduling quantum; the smallest active one is the one that is in use */ | |
| 132 | void timer_add_scheduling_quantum(running_machine *machine, attoseconds_t quantum, attotime duration); | |
| 133 | ||
| 134 | /* control the minimum useful quantum (used by cpuexec only) */ | |
| 135 | void timer_set_minimum_quantum(running_machine *machine, attoseconds_t quantum); | |
| 136 | ||
| 137 | ||
| 138 | ||
| 139 | /* ----- save/restore helpers ----- */ | |
| 140 | ||
| 141 | /* count the number of anonymous (non-saveable) timers */ | |
| 142 | int timer_count_anonymous(running_machine *machine); | |
| 143 | ||
| 144 | ||
| 145 | ||
| 146 | /* ----- core timer management ----- */ | |
| 147 | ||
| 148 | /* allocate a permament timer that isn't primed yet */ | |
| 149 | emu_timer *_timer_alloc_internal(running_machine *machine, timer_fired_func callback, void *param, const char *file, int line, const char *func); | |
| 150 | ||
| 151 | /* allocate a permament device timer that isn't primed yet */ | |
| 152 | emu_timer *device_timer_alloc(device_t &device, device_timer_id id = 0, void *ptr = NULL); | |
| 153 | ||
| 154 | /* adjust the time when this timer will fire and disable any periodic firings */ | |
| 155 | void timer_adjust_oneshot(emu_timer *which, attotime duration, INT32 param); | |
| 156 | ||
| 157 | /* adjust the time when this timer will fire and specify a period for subsequent firings */ | |
| 158 | void timer_adjust_periodic(emu_timer *which, attotime start_delay, INT32 param, attotime period); | |
| 159 | ||
| 160 | ||
| 161 | ||
| 162 | /* ----- anonymous timer management ----- */ | |
| 163 | ||
| 164 | /* request a one-shot temporary timer for a device */ | |
| 165 | void device_timer_call_after_resynch(device_t &device, device_timer_id id = 0, INT32 param = 0, void *ptr = NULL); | |
| 166 | ||
| 167 | /* allocate a one-shot timer, which calls the callback after the given duration */ | |
| 168 | void _timer_set_internal(running_machine *machine, attotime duration, void *ptr, INT32 param, timer_fired_func callback, const char *file, int line, const char *func); | |
| 169 | ||
| 170 | /* allocate a pulse timer, which repeatedly calls the callback using the given period */ | |
| 171 | void _timer_pulse_internal(running_machine *machine, attotime period, void *ptr, INT32 param, timer_fired_func callback, const char *file, int line, const char *func); | |
| 172 | ||
| 173 | ||
| 174 | ||
| 175 | /* ----- miscellaneous controls ----- */ | |
| 176 | ||
| 177 | /* reset the timing on a timer */ | |
| 178 | void timer_reset(emu_timer *which, attotime duration); | |
| 179 | ||
| 180 | /* enable/disable a timer */ | |
| 181 | int timer_enable(emu_timer *which, int enable); | |
| 182 | ||
| 183 | /* determine if a timer is enabled */ | |
| 184 | int timer_enabled(emu_timer *which); | |
| 185 | ||
| 186 | /* returns the callback parameter of a timer */ | |
| 187 | int timer_get_param(emu_timer *which); | |
| 188 | ||
| 189 | /* changes the callback parameter of a timer */ | |
| 190 | void timer_set_param(emu_timer *which, int param); | |
| 191 | ||
| 192 | /* returns the callback pointer of a timer */ | |
| 193 | void *timer_get_ptr(emu_timer *which); | |
| 194 | ||
| 195 | /* changes the callback pointer of a timer */ | |
| 196 | void timer_set_ptr(emu_timer *which, void *ptr); | |
| 197 | ||
| 198 | ||
| 199 | ||
| 200 | /* ----- timing functions ----- */ | |
| 201 | ||
| 202 | /* return the time since the last trigger */ | |
| 203 | attotime timer_timeelapsed(emu_timer *which); | |
| 204 | ||
| 205 | /* return the time until the next trigger */ | |
| 206 | attotime timer_timeleft(emu_timer *which); | |
| 207 | ||
| 208 | /* return the current time */ | |
| 209 | attotime timer_get_time(running_machine *machine); | |
| 210 | ||
| 211 | /* return the time when this timer started counting */ | |
| 212 | attotime timer_starttime(emu_timer *which); | |
| 213 | ||
| 214 | /* return the time when this timer will fire next */ | |
| 215 | attotime timer_firetime(emu_timer *which); | |
| 216 | ||
| 217 | ||
| 218 | ||
| 219 | 106 | // ======================> timer_device_config |
| 220 | 107 | |
| 221 | 108 | class timer_device_config : public device_config |
| 222 | 109 | { |
| 223 | 110 | friend class timer_device; |
| 224 | ||
| 111 | ||
| 225 | 112 | // construction/destruction |
| 226 | 113 | timer_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock); |
| 227 | 114 | |
| r10315 | r10316 | |
| 268 | 155 | }; |
| 269 | 156 | |
| 270 | 157 | |
| 271 | ||
| 272 | 158 | // ======================> timer_device |
| 273 | 159 | |
| 274 | 160 | class timer_device : public device_t |
| r10315 | r10316 | |
| 280 | 166 | |
| 281 | 167 | public: |
| 282 | 168 | // property getters |
| 283 | int param() const { return timer | |
| 169 | int param() const { return m_timer-> | |
| 284 | 170 | void *ptr() const { return m_ptr; } |
| 285 | bool enabled() const { return | |
| 171 | bool enabled() const { return m_timer->enabled( | |
| 286 | 172 | |
| 287 | 173 | // property setters |
| 288 | void set_param(int param) { assert(m_config.m_type == timer_device_config::TIMER_TYPE_GENERIC); timer | |
| 174 | void set_param(int param) { assert(m_config.m_type == timer_device_config::TIMER_TYPE_GENERIC); m_timer->set_param( | |
| 289 | 175 | void set_ptr(void *ptr) { m_ptr = ptr; } |
| 290 | void enable(bool enable = true) { timer | |
| 176 | void enable(bool enable = true) { m_timer->enable( | |
| 291 | 177 | |
| 292 | 178 | // adjustments |
| 293 | 179 | void reset() { adjust(attotime::never, 0, attotime::never); } |
| 294 | void adjust(attotime duration, INT32 param = 0, attotime period = attotime::never) { assert(m_config.m_type == timer_device_config::TIMER_TYPE_GENERIC); timer | |
| 180 | void adjust(attotime duration, INT32 param = 0, attotime period = attotime::never) { assert(m_config.m_type == timer_device_config::TIMER_TYPE_GENERIC); m_timer->adjust | |
| 295 | 181 | |
| 296 | 182 | // timing information |
| 297 | attotime time_elapsed() const { return timer_timeelapsed(m_timer); } | |
| 298 | attotime time_left() const { return timer_timeleft(m_timer); } | |
| 299 | attotime start_time() const { return timer_starttime(m_timer); } | |
| 300 | attotime fire_time() const { return timer_firetime(m_timer); } | |
| 183 | attotime time_elapsed() const { return m_timer->elapsed(); } | |
| 184 | attotime time_left() const { return m_timer->remaining(); } | |
| 185 | attotime start_time() const { return m_timer->start(); } | |
| 186 | attotime fire_time() const { return m_timer->expire(); } | |
| 301 | 187 | |
| 302 | 188 | private: |
| 303 | 189 | // device-level overrides |
| 304 | 190 | virtual void device_start(); |
| 305 | 191 | virtual void device_reset(); |
| 192 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); | |
| 306 | 193 | |
| 307 | // internal helpers | |
| 308 | static TIMER_CALLBACK( static_periodic_timer_callback ) { reinterpret_cast<timer_device *>(ptr)->periodic_timer_callback(param); } | |
| 309 | void periodic_timer_callback(int param); | |
| 310 | ||
| 311 | static TIMER_CALLBACK( static_scanline_timer_callback ) { reinterpret_cast<timer_device *>(ptr)->scanline_timer_callback(param); } | |
| 312 | void scanline_timer_callback(int scanline); | |
| 313 | ||
| 314 | 194 | // internal state |
| 315 | const timer_device_config &m_config; | |
| 316 | emu_timer * m_timer; // the backing timer | |
| 317 | void * m_ptr; // the pointer parameter passed to the timer callback | |
| 195 | const timer_device_config & m_config; | |
| 196 | emu_timer * m_timer; // the backing timer | |
| 197 | void * m_ptr; // the pointer parameter passed to the timer callback | |
| 318 | 198 | |
| 319 | 199 | // scanline timers only |
| 320 | screen_device *m_screen; // pointer to the screen | |
| 321 | bool m_first_time; // indicates that the system is starting | |
| 200 | screen_device * m_screen; // pointer to the screen | |
| 201 | bool m_first_time; // indicates that the system is starting | |
| 322 | 202 | }; |
| 323 | 203 | |
| 324 | 204 | |
| 325 | // device type definition | |
| 205 | ||
| 206 | //************************************************************************** | |
| 207 | // GLOBAL VARIABLES | |
| 208 | //************************************************************************** | |
| 209 | ||
| 326 | 210 | extern const device_type TIMER; |
| 327 | 211 | |
| 328 | 212 |
| r10315 | r10316 | |
|---|---|---|
| 332 | 332 | /* (time in seconds) / (60 sec/minute) * (rounds/minute) * (60 pulses) * (2 pulse phases) */ |
| 333 | 333 | if (cur_image) |
| 334 | 334 | { |
| 335 | result = ((int) ( | |
| 335 | result = ((int) ( | |
| 336 | 336 | } |
| 337 | 337 | break; |
| 338 | 338 | case 0x0f: /* 400k/800k: Drive installed: 0=drive connected, 1=drive not connected */ |
| r10315 | r10316 | |
|---|---|---|
| 200 | 200 | mdv->right = auto_alloc_array(device->machine, UINT8, MDV_IMAGE_LENGTH / 2); |
| 201 | 201 | |
| 202 | 202 | // allocate timers |
| 203 | mdv->bit_timer = | |
| 203 | mdv->bit_timer = | |
| 204 | 204 | timer_adjust_periodic(mdv->bit_timer, attotime::zero, 0, attotime::from_hz(MDV_BITRATE)); |
| 205 | 205 | timer_enable(mdv->bit_timer, 0); |
| 206 | 206 | } |
| r10315 | r10316 | |
|---|---|---|
| 305 | 305 | state->image = NULL; |
| 306 | 306 | state->conf = (xmodem_config*) device->baseconfig().static_config(); |
| 307 | 307 | state->machine = device->machine; |
| 308 | state->timer = | |
| 308 | state->timer = | |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | static DEVICE_RESET( xmodem ) |
| r10315 | r10316 | |
|---|---|---|
| 646 | 646 | state->image = NULL; |
| 647 | 647 | state->conf = (kermit_config*) device->baseconfig().static_config(); |
| 648 | 648 | state->machine = device->machine; |
| 649 | state->resend = | |
| 649 | state->resend = | |
| 650 | 650 | kermit_reset( state ); |
| 651 | 651 | } |
| 652 | 652 |
| r10315 | r10316 | |
|---|---|---|
| 110 | 110 | |
| 111 | 111 | for( i=0; i<TIMER_POOL; i++ ) |
| 112 | 112 | { |
| 113 | cococart->cart_line.timer[i] = timer_alloc(device->machine, cart_timer_callback, (void *) device); | |
| 114 | cococart->nmi_line.timer[i] = timer_alloc(device->machine, nmi_timer_callback, (void *) device); | |
| 115 | cococart->halt_line.timer[i] = timer_alloc(device->machine, halt_timer_callback, (void *) device); | |
| 113 | cococart->cart_line.timer[i] = device->machine->scheduler().timer_alloc(FUNC(cart_timer_callback), (void *) device); | |
| 114 | cococart->nmi_line.timer[i] = device->machine->scheduler().timer_alloc(FUNC(nmi_timer_callback), (void *) device); | |
| 115 | cococart->halt_line.timer[i] = device->machine->scheduler().timer_alloc(FUNC(halt_timer_callback), (void *) device); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | cococart->cart_line.timer_index = 0; |
| r10315 | r10316 | |
|---|---|---|
| 604 | 604 | |
| 605 | 605 | static void command_wait(running_machine *machine) |
| 606 | 606 | { |
| 607 | attotime current_time = | |
| 607 | attotime current_time = | |
| 608 | 608 | |
| 609 | 609 | if (state == STATE_READY) |
| 610 | 610 | { |
| r10315 | r10316 | |
| 648 | 648 | static void command_rawinput(running_machine *machine) |
| 649 | 649 | { |
| 650 | 650 | //int parts; |
| 651 | attotime current_time = | |
| 651 | attotime current_time = | |
| 652 | 652 | static const char *position; |
| 653 | 653 | #if 0 |
| 654 | 654 | int i; |
| r10315 | r10316 | |
| 1083 | 1083 | { |
| 1084 | 1084 | /* at the end of our test */ |
| 1085 | 1085 | state = STATE_DONE; |
| 1086 | final_time = | |
| 1086 | final_time = | |
| 1087 | 1087 | machine->schedule_exit(); |
| 1088 | 1088 | } |
| 1089 | 1089 | |
| r10315 | r10316 | |
| 1142 | 1142 | } |
| 1143 | 1143 | |
| 1144 | 1144 | /* have we hit the time limit? */ |
| 1145 | current_time = | |
| 1145 | current_time = | |
| 1146 | 1146 | time_limit = (current_testcase.time_limit != attotime::zero) ? current_testcase.time_limit |
| 1147 | 1147 | : attotime::from_seconds(600); |
| 1148 | 1148 | if (current_time > time_limit) |
| r10315 | r10316 | |
|---|---|---|
| 629 | 629 | if ((msgtype == MSG_FAILURE) && (state != STATE_ABORTED)) |
| 630 | 630 | { |
| 631 | 631 | state = STATE_ABORTED; |
| 632 | final_time = | |
| 632 | final_time = | |
| 633 | 633 | if (final_time > 0.0) |
| 634 | 634 | dump_screenshot(); |
| 635 | 635 | } |
| r10315 | r10316 | |
|---|---|---|
| 88 | 88 | if(VERBOSE_LEVEL >= N) \ |
| 89 | 89 | { \ |
| 90 | 90 | if( M ) \ |
| 91 | logerror("%11.6f: %-24s", | |
| 91 | logerror("%11.6f: %-24s", | |
| 92 | 92 | logerror A; \ |
| 93 | 93 | } \ |
| 94 | 94 | } while(0) |
| r10315 | r10316 | |
| 237 | 237 | { |
| 238 | 238 | t6721_state *t6721 = get_safe_token(device); |
| 239 | 239 | |
| 240 | t6721->timer = | |
| 240 | t6721->timer = | |
| 241 | 241 | |
| 242 | 242 | state_save_register_device_item_array(device, 0, t6721->sample_data); |
| 243 | 243 | state_save_register_device_item_array(device, 0, t6721->data); |
| r10315 | r10316 | |
|---|---|---|
| 83 | 83 | WRITE8_DEVICE_HANDLER( svision_sounddma_w ) |
| 84 | 84 | { |
| 85 | 85 | svision_sound_state *state = get_safe_token(device); |
| 86 | logerror("%.6f svision snddma write %04x %02x\n", | |
| 86 | logerror("%.6f svision snddma write %04x %02x\n", | |
| 87 | 87 | state->dma.reg[offset] = data; |
| 88 | 88 | switch (offset) |
| 89 | 89 | { |
| r10315 | r10316 | |
| 113 | 113 | WRITE8_DEVICE_HANDLER( svision_noise_w ) |
| 114 | 114 | { |
| 115 | 115 | svision_sound_state *state = get_safe_token(device); |
| 116 | // logerror("%.6f svision noise write %04x %02x\n", | |
| 116 | // logerror("%.6f svision noise write %04x %02x\n", | |
| 117 | 117 | state->noise.reg[offset]=data; |
| 118 | 118 | switch (offset) |
| 119 | 119 | { |
| r10315 | r10316 | |
|---|---|---|
| 225 | 225 | void lynx_audio_write(device_t *device, int offset, UINT8 data) |
| 226 | 226 | { |
| 227 | 227 | lynx_sound_state *state = get_safe_token(device); |
| 228 | // logerror("%.6f audio write %.2x %.2x\n", | |
| 228 | // logerror("%.6f audio write %.2x %.2x\n", | |
| 229 | 229 | LYNX_AUDIO *channel=state->audio+((offset>>3)&3); |
| 230 | 230 | state->mixer_channel->update(); |
| 231 | 231 | switch (offset) { |
| r10315 | r10316 | |
|---|---|---|
| 420 | 420 | if(VERBOSE_LEVEL >= N) \ |
| 421 | 421 | { \ |
| 422 | 422 | if( M ) \ |
| 423 | logerror("%11.6f: %-24s", | |
| 423 | logerror("%11.6f: %-24s", | |
| 424 | 424 | logerror A; \ |
| 425 | 425 | } \ |
| 426 | 426 | } while(0) |
| r10315 | r10316 | |
| 549 | 549 | static int ted7360_rastercolumn( device_t *device ) |
| 550 | 550 | { |
| 551 | 551 | ted7360_state *ted7360 = get_safe_token(device); |
| 552 | return (int) (( | |
| 552 | return (int) (( | |
| 553 | 553 | } |
| 554 | 554 | |
| 555 | 555 | static TIMER_CALLBACK(ted7360_timer_timeout) |
| r10315 | r10316 | |
| 1183 | 1183 | ted7360_state *ted7360 = get_safe_token(device); |
| 1184 | 1184 | |
| 1185 | 1185 | ted7360->rasterline++; |
| 1186 | ted7360->rastertime = | |
| 1186 | ted7360->rastertime = | |
| 1187 | 1187 | if (ted7360->rasterline >= ted7360->lines) |
| 1188 | 1188 | { |
| 1189 | 1189 | ted7360->rasterline = 0; |
| r10315 | r10316 | |
| 1404 | 1404 | |
| 1405 | 1405 | ted7360->keyboard_cb = intf->keyb_cb; |
| 1406 | 1406 | |
| 1407 | ted7360->timer1 = timer_alloc(device->machine, ted7360_timer_timeout, ted7360); | |
| 1408 | ted7360->timer2 = timer_alloc(device->machine, ted7360_timer_timeout, ted7360); | |
| 1409 | ted7360->timer3 = timer_alloc(device->machine, ted7360_timer_timeout, ted7360); | |
| 1407 | ted7360->timer1 = device->machine->scheduler().timer_alloc(FUNC(ted7360_timer_timeout), ted7360); | |
| 1408 | ted7360->timer2 = device->machine->scheduler().timer_alloc(FUNC(ted7360_timer_timeout), ted7360); | |
| 1409 | ted7360->timer3 = device->machine->scheduler().timer_alloc(FUNC(ted7360_timer_timeout), ted7360); | |
| 1410 | 1410 | |
| 1411 | 1411 | ted7360_sound_start(device); |
| 1412 | 1412 |
| r10315 | r10316 | |
|---|---|---|
| 349 | 349 | /* resolve callbacks */ |
| 350 | 350 | devcb_resolve_write_line( &state->ack_out_func, &intf->ack_callback, device ); |
| 351 | 351 | |
| 352 | state->timer = | |
| 352 | state->timer = | |
| 353 | 353 | |
| 354 | 354 | state->channel = device->machine->sound().stream_alloc( *device, 0, 1, sample_rate, state, upd1771c_update ); |
| 355 | 355 |
| r10315 | r10316 | |
|---|---|---|
| 507 | 507 | if (mea8000->bufpos == 4) |
| 508 | 508 | { |
| 509 | 509 | /* we have a successor */ |
| 510 | LOG(( "%f mea8000_timer_expire: new frame\n", | |
| 510 | LOG(( "%f mea8000_timer_expire: new frame\n", | |
| 511 | 511 | mea8000_decode_frame(mea8000); |
| 512 | 512 | mea8000_start_frame(mea8000); |
| 513 | 513 | } |
| 514 | 514 | else if (mea8000->cont) |
| 515 | 515 | { |
| 516 | 516 | /* repeat mode */ |
| 517 | LOG(( "%f mea8000_timer_expire: repeat frame\n", | |
| 517 | LOG(( "%f mea8000_timer_expire: repeat frame\n", | |
| 518 | 518 | mea8000_start_frame(mea8000); |
| 519 | 519 | } |
| 520 | 520 | /* slow stop */ |
| 521 | 521 | else if (mea8000->state == MEA8000_STARTED) |
| 522 | 522 | { |
| 523 | 523 | mea8000->ampl = 0; |
| 524 | LOG(( "%f mea8000_timer_expire: fade frame\n", | |
| 524 | LOG(( "%f mea8000_timer_expire: fade frame\n", | |
| 525 | 525 | mea8000_start_frame(mea8000); |
| 526 | 526 | mea8000->state = MEA8000_SLOWING; |
| 527 | 527 | } |
| 528 | 528 | else if (mea8000->state == MEA8000_SLOWING) |
| 529 | 529 | { |
| 530 | LOG(( "%f mea8000_timer_expire: stop frame\n", | |
| 530 | LOG(( "%f mea8000_timer_expire: stop frame\n", | |
| 531 | 531 | mea8000_stop_frame(machine, mea8000); |
| 532 | 532 | } |
| 533 | 533 | mea8000_update_req(device); |
| r10315 | r10316 | |
| 555 | 555 | case 1: |
| 556 | 556 | /* ready to accept next frame */ |
| 557 | 557 | #if 0 |
| 558 | LOG(( "$%04x %f: mea8000_r ready=%i\n", cpu_get_previouspc( device->machine->firstcpu ), | |
| 558 | LOG(( "$%04x %f: mea8000_r ready=%i\n", cpu_get_previouspc( device->machine->firstcpu ), | |
| 559 | 559 | #endif |
| 560 | 560 | return mea8000_accept_byte(mea8000) << 7; |
| 561 | 561 | |
| r10315 | r10316 | |
| 576 | 576 | { |
| 577 | 577 | /* got pitch byte before first frame */ |
| 578 | 578 | mea8000->pitch = 2 * data; |
| 579 | LOG(( "$%04x %f: mea8000_w pitch %i\n", cpu_get_previouspc( device->machine->firstcpu ), | |
| 579 | LOG(( "$%04x %f: mea8000_w pitch %i\n", cpu_get_previouspc( device->machine->firstcpu ), | |
| 580 | 580 | mea8000->state = MEA8000_WAIT_FIRST; |
| 581 | 581 | mea8000->bufpos = 0; |
| 582 | 582 | } |
| 583 | 583 | else if (mea8000->bufpos == 4) |
| 584 | 584 | { |
| 585 | 585 | /* overflow */ |
| 586 | LOG(( "$%04x %f: mea8000_w data overflow %02X\n", cpu_get_previouspc( device->machine->firstcpu ), | |
| 586 | LOG(( "$%04x %f: mea8000_w data overflow %02X\n", cpu_get_previouspc( device->machine->firstcpu ), | |
| 587 | 587 | } |
| 588 | 588 | else |
| 589 | 589 | { |
| 590 | 590 | /* enqueue frame byte */ |
| 591 | LOG(( "$%04x %f: mea8000_w data %02X in frame pos %i\n", cpu_get_previouspc( device->machine->firstcpu ), | |
| 591 | LOG(( "$%04x %f: mea8000_w data %02X in frame pos %i\n", cpu_get_previouspc( device->machine->firstcpu ), | |
| 592 | 592 | data, mea8000->bufpos )); |
| 593 | 593 | mea8000->buf[mea8000->bufpos] = data; |
| 594 | 594 | mea8000->bufpos++; |
| r10315 | r10316 | |
| 622 | 622 | mea8000_stop_frame(device->machine, mea8000); |
| 623 | 623 | |
| 624 | 624 | LOG(( "$%04x %f: mea8000_w command %02X stop=%i cont=%i roe=%i\n", |
| 625 | cpu_get_previouspc(device->machine->firstcpu), | |
| 625 | cpu_get_previouspc(device->machine->firstcpu), | |
| 626 | 626 | stop, mea8000->cont, mea8000->roe )); |
| 627 | 627 | |
| 628 | 628 | mea8000_update_req(device); |
| r10315 | r10316 | |
| 670 | 670 | |
| 671 | 671 | mea8000_init_tables(device->machine); |
| 672 | 672 | |
| 673 | mea8000->timer = | |
| 673 | mea8000->timer = | |
| 674 | 674 | |
| 675 | 675 | state_save_register_item( device->machine, "mea8000", device->tag(), 0, mea8000->state ); |
| 676 | 676 | state_save_register_item_array( device->machine, "mea8000", device->tag(), 0, mea8000->buf ); |
| r10315 | r10316 | |
|---|---|---|
| 155 | 155 | dave->one_khz_state = 0; |
| 156 | 156 | dave->fifty_hz_count = DAVE_FIFTY_HZ_COUNTER_RELOAD; |
| 157 | 157 | dave->one_hz_count = DAVE_ONE_HZ_COUNTER_RELOAD; |
| 158 | | |
| 158 | | |
| 159 | 159 | |
| 160 | 160 | for (i=0; i<3; i++) |
| 161 | 161 | { |
| r10315 | r10316 | |
|---|---|---|
| 359 | 359 | change_output_lines(device); |
| 360 | 360 | |
| 361 | 361 | /* create the timers */ |
| 362 | kr2376->scan_timer = | |
| 362 | kr2376->scan_timer = | |
| 363 | 363 | timer_adjust_periodic(kr2376->scan_timer, attotime::zero, 0, attotime::from_hz(kr2376->intf->clock)); |
| 364 | 364 | |
| 365 | 365 | /* register for state saving */ |
| r10315 | r10316 | |
|---|---|---|
| 312 | 312 | |
| 313 | 313 | machine->add_notifier(MACHINE_NOTIFY_EXIT, pdp1_machine_stop); |
| 314 | 314 | |
| 315 | state->tape_reader.timer = timer_alloc(machine, reader_callback, NULL); | |
| 316 | state->tape_puncher.timer = timer_alloc(machine, puncher_callback, NULL); | |
| 317 | state->typewriter.tyo_timer = timer_alloc(machine, tyo_callback, NULL); | |
| 318 | state->dpy_timer = timer_alloc(machine, dpy_callback, NULL); | |
| 315 | state->tape_reader.timer = machine->scheduler().timer_alloc(FUNC(reader_callback)); | |
| 316 | state->tape_puncher.timer = machine->scheduler().timer_alloc(FUNC(puncher_callback)); | |
| 317 | state->typewriter.tyo_timer = machine->scheduler().timer_alloc(FUNC(tyo_callback)); | |
| 318 | state->dpy_timer = machine->scheduler().timer_alloc(FUNC(dpy_callback)); | |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | |
| r10315 | r10316 | |
| 1027 | 1027 | |
| 1028 | 1028 | static void parallel_drum_init(pdp1_state *state) |
| 1029 | 1029 | { |
| 1030 | state->parallel_drum.rotation_timer = timer_alloc( | |
| 1030 | state->parallel_drum.rotation_timer = machine->scheduler().timer_alloc( | |
| 1031 | 1031 | timer_adjust_periodic(state->parallel_drum.rotation_timer, PARALLEL_DRUM_ROTATION_TIME, 0, PARALLEL_DRUM_ROTATION_TIME); |
| 1032 | 1032 | |
| 1033 | state->parallel_drum.il_timer = timer_alloc( | |
| 1033 | state->parallel_drum.il_timer = machine->scheduler().timer_alloc(FUNC(i | |
| 1034 | 1034 | parallel_drum_set_il(0); |
| 1035 | 1035 | } |
| 1036 | 1036 | #endif |
| r10315 | r10316 | |
|---|---|---|
| 196 | 196 | |
| 197 | 197 | memset(fdc, 0, sizeof(*fdc)); |
| 198 | 198 | fdc->type = type; |
| 199 | fdc->motor_timer = | |
| 199 | fdc->motor_timer = | |
| 200 | 200 | fdc->lines = 0x00; |
| 201 | 201 | fdc->mode = 0x1F; /* default value needed by Lisa 2 - no, I don't know if it is true */ |
| 202 | 202 | fdc->swim_mode = SWIM_MODE_IWM; |
| r10315 | r10316 | |
|---|---|---|
| 117 | 117 | { |
| 118 | 118 | hp48_state *state = machine->driver_data<hp48_state>(); |
| 119 | 119 | LOG_SERIAL(( "%f hp48_rs232_byte_recv_cb: end of receive, data=%02x\n", |
| 120 | | |
| 120 | | |
| 121 | 121 | |
| 122 | 122 | state->io[0x14] = param & 0xf; /* receive zone */ |
| 123 | 123 | state->io[0x15] = param >> 4; |
| r10315 | r10316 | |
| 136 | 136 | { |
| 137 | 137 | hp48_state *state = machine->driver_data<hp48_state>(); |
| 138 | 138 | LOG_SERIAL(( "%f hp48_rs232_start_recv_byte: start receiving, data=%02x\n", |
| 139 | | |
| 139 | | |
| 140 | 140 | |
| 141 | 141 | state->io[0x11] |= 2; /* set byte receiving */ |
| 142 | 142 | |
| r10315 | r10316 | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | /* schedule end of reception */ |
| 150 | timer_set( | |
| 150 | machine->scheduler().timer_set( | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | |
| r10315 | r10316 | |
| 159 | 159 | device_image_interface *kermit = dynamic_cast<device_image_interface *>(machine->device("rs232_k")); |
| 160 | 160 | |
| 161 | 161 | LOG_SERIAL(( "%f hp48_rs232_byte_sent_cb: end of send, data=%02x\n", |
| 162 | | |
| 162 | | |
| 163 | 163 | |
| 164 | 164 | state->io[0x12] &= ~3; /* clear byte sending and buffer full */ |
| 165 | 165 | |
| r10315 | r10316 | |
| 184 | 184 | UINT8 data = HP48_IO_8(0x16); /* byte to send */ |
| 185 | 185 | |
| 186 | 186 | LOG_SERIAL(( "%05x %f hp48_rs232_send_byte: start sending, data=%02x\n", |
| 187 | cpu_get_previouspc(machine->device("maincpu")), | |
| 187 | cpu_get_previouspc(machine->device("maincpu")), | |
| 188 | 188 | |
| 189 | 189 | /* set byte sending and send buffer full */ |
| 190 | 190 | state->io[0x12] |= 3; |
| 191 | 191 | |
| 192 | 192 | /* schedule transmission */ |
| 193 | timer_set( | |
| 193 | machine->scheduler().timer_set( | |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | |
| r10315 | r10316 | |
| 202 | 202 | UINT8 data = chardev_in( state->chardev ); |
| 203 | 203 | |
| 204 | 204 | LOG_SERIAL(( "%f hp48_chardev_byte_recv_cb: end of receive, data=%02x\n", |
| 205 | | |
| 205 | | |
| 206 | 206 | |
| 207 | 207 | state->io[0x14] = data & 0xf; /* receive zone */ |
| 208 | 208 | state->io[0x15] = data >> 4; |
| r10315 | r10316 | |
| 222 | 222 | if ( status != CHARDEV_OK ) return; |
| 223 | 223 | |
| 224 | 224 | LOG_SERIAL(( "%f hp48_chardev_start_recv_byte: start receiving\n", |
| 225 | | |
| 225 | | |
| 226 | 226 | |
| 227 | 227 | state->io[0x11] |= 2; /* set byte receiving */ |
| 228 | 228 | |
| r10315 | r10316 | |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | /* schedule end of reception */ |
| 236 | timer_set( | |
| 236 | machine->scheduler().timer_set( | |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | static void hp48_chardev_ready_to_send( running_machine *machine ) |
| r10315 | r10316 | |
| 262 | 262 | { |
| 263 | 263 | hp48_state *state = device->machine->driver_data<hp48_state>(); |
| 264 | 264 | LOG(( "%05x %f hp48_reg_out: %03x\n", |
| 265 | cpu_get_previouspc(device->machine->device("maincpu")), | |
| 265 | cpu_get_previouspc(device->machine->device("maincpu")), | |
| 266 | 266 | |
| 267 | 267 | /* bits 0-8: keyboard lines */ |
| 268 | 268 | state->out = out & 0x1ff; |
| r10315 | r10316 | |
| 300 | 300 | { |
| 301 | 301 | int in = hp48_get_in( device->machine ); |
| 302 | 302 | LOG(( "%05x %f hp48_reg_in: %04x\n", |
| 303 | cpu_get_previouspc(device->machine->device("maincpu")), | |
| 303 | cpu_get_previouspc(device->machine->device("maincpu")), | |
| 304 | 304 | return in; |
| 305 | 305 | } |
| 306 | 306 | |
| r10315 | r10316 | |
| 313 | 313 | /* interrupt on raising edge */ |
| 314 | 314 | if ( in && !state->kdn ) |
| 315 | 315 | { |
| 316 | LOG(( "%f hp48_update_kdn: interrupt\n", | |
| 316 | LOG(( "%f hp48_update_kdn: interrupt\n", | |
| 317 | 317 | state->io[0x19] |= 8; /* service request */ |
| 318 | 318 | hp48_pulse_irq( machine, SATURN_WAKEUP_LINE ); |
| 319 | 319 | hp48_pulse_irq( machine, SATURN_IRQ_LINE ); |
| r10315 | r10316 | |
| 330 | 330 | if ( input_port_read( machine, "ON" ) ) |
| 331 | 331 | { |
| 332 | 332 | LOG(( "%f hp48_kbd_cb: keyboard interrupt, on key\n", |
| 333 | | |
| 333 | | |
| 334 | 334 | state->io[0x19] |= 8; /* set service request */ |
| 335 | 335 | hp48_pulse_irq( machine, SATURN_WAKEUP_LINE ); |
| 336 | 336 | hp48_pulse_irq( machine, SATURN_NMI_LINE ); |
| r10315 | r10316 | |
| 345 | 345 | void hp48_rsi( device_t *device ) |
| 346 | 346 | { |
| 347 | 347 | hp48_state *state = device->machine->driver_data<hp48_state>(); |
| 348 | LOG(( "%05x %f hp48_rsi\n", cpu_get_previouspc(device->machine->device("maincpu")), | |
| 348 | LOG(( "%05x %f hp48_rsi\n", cpu_get_previouspc(device->machine->device("maincpu")), | |
| 349 | 349 | |
| 350 | 350 | /* enables interrupts on key repeat |
| 351 | 351 | (normally, there is only one interrupt, when the key is pressed) |
| r10315 | r10316 | |
| 389 | 389 | { |
| 390 | 390 | hp48_state *state = space->machine->driver_data<hp48_state>(); |
| 391 | 391 | LOG(( "%05x %f hp48_io_w: off=%02x data=%x\n", |
| 392 | cpu_get_previouspc(space->cpu), | |
| 392 | cpu_get_previouspc(space->cpu), | |
| 393 | 393 | |
| 394 | 394 | switch( offset ) |
| 395 | 395 | { |
| r10315 | r10316 | |
| 438 | 438 | if ( data & 1 ) |
| 439 | 439 | { |
| 440 | 440 | LOG(( "%f hp48_io_w: software interrupt requested\n", |
| 441 | | |
| 441 | | |
| 442 | 442 | hp48_pulse_irq( space->machine, SATURN_IRQ_LINE ); |
| 443 | 443 | data &= ~1; |
| 444 | 444 | } |
| r10315 | r10316 | |
| 608 | 608 | } |
| 609 | 609 | |
| 610 | 610 | LOG(( "%05x %f hp48_io_r: off=%02x data=%x\n", |
| 611 | cpu_get_previouspc(space->cpu), | |
| 611 | cpu_get_previouspc(space->cpu), | |
| 612 | 612 | return data; |
| 613 | 613 | } |
| 614 | 614 | |
| r10315 | r10316 | |
| 622 | 622 | offset &= 0x7e; |
| 623 | 623 | if ( state->bank_switch != offset ) |
| 624 | 624 | { |
| 625 | LOG(( "%05x %f hp48_bank_r: off=%03x\n", cpu_get_previouspc(space->cpu), | |
| 625 | LOG(( "%05x %f hp48_bank_r: off=%03x\n", cpu_get_previouspc(space->cpu), | |
| 626 | 626 | state->bank_switch = offset; |
| 627 | 627 | hp48_apply_modules( space->machine, NULL ); |
| 628 | 628 | } |
| r10315 | r10316 | |
| 854 | 854 | /* RESET opcode */ |
| 855 | 855 | void hp48_mem_reset( device_t *device ) |
| 856 | 856 | { |
| 857 | LOG(( "%05x %f hp48_mem_reset\n", cpu_get_previouspc(device->machine->device("maincpu")), | |
| 857 | LOG(( "%05x %f hp48_mem_reset\n", cpu_get_previouspc(device->machine->device("maincpu")), | |
| 858 | 858 | hp48_reset_modules( device->machine ); |
| 859 | 859 | } |
| 860 | 860 | |
| r10315 | r10316 | |
| 865 | 865 | hp48_state *state = device->machine->driver_data<hp48_state>(); |
| 866 | 866 | int i; |
| 867 | 867 | |
| 868 | LOG(( "%05x %f hp48_mem_config: %05x\n", cpu_get_previouspc(device->machine->device("maincpu")), | |
| 868 | LOG(( "%05x %f hp48_mem_config: %05x\n", cpu_get_previouspc(device->machine->device("maincpu")), | |
| 869 | 869 | |
| 870 | 870 | /* find the highest priority unconfigured module (except non-configurable NCE1)... */ |
| 871 | 871 | for ( i = 0; i < 5; i++ ) |
| r10315 | r10316 | |
| 897 | 897 | { |
| 898 | 898 | hp48_state *state = device->machine->driver_data<hp48_state>(); |
| 899 | 899 | int i; |
| 900 | LOG(( "%05x %f hp48_mem_unconfig: %05x\n", cpu_get_previouspc(device->machine->device("maincpu")), | |
| 900 | LOG(( "%05x %f hp48_mem_unconfig: %05x\n", cpu_get_previouspc(device->machine->device("maincpu")), | |
| 901 | 901 | |
| 902 | 902 | /* find the highest priority fully configured module at address v (except NCE1)... */ |
| 903 | 903 | for ( i = 0; i < 5; i++ ) |
| r10315 | r10316 | |
| 941 | 941 | } |
| 942 | 942 | |
| 943 | 943 | LOG(( "%05x %f hp48_mem_id = %02x\n", |
| 944 | cpu_get_previouspc(device->machine->device("maincpu")), | |
| 944 | cpu_get_previouspc(device->machine->device("maincpu")), | |
| 945 | 945 | |
| 946 | 946 | return data; /* everything is configured */ |
| 947 | 947 | } |
| r10315 | r10316 | |
| 1208 | 1208 | state->modules[5].data = rom; |
| 1209 | 1209 | |
| 1210 | 1210 | /* timers */ |
| 1211 | timer_pulse(machine, attotime::from_hz( 16 ), NULL, 0, hp48_timer1_cb ); | |
| 1212 | timer_pulse(machine, attotime::from_hz( 8192 ), NULL, 0, hp48_timer2_cb ); | |
| 1211 | machine->scheduler().timer_pulse(attotime::from_hz( 16 ), FUNC(hp48_timer1_cb)); | |
| 1212 | machine->scheduler().timer_pulse(attotime::from_hz( 8192 ), FUNC(hp48_timer2_cb)); | |
| 1213 | 1213 | |
| 1214 | 1214 | /* 1ms keyboard polling */ |
| 1215 | timer_pulse( | |
| 1215 | machine->scheduler().timer_pulse( | |
| 1216 | 1216 | |
| 1217 | 1217 | /* save state */ |
| 1218 | 1218 | state_save_register_global(machine, state->out ); |
| r10315 | r10316 | |
|---|---|---|
| 2321 | 2321 | fdc->intf = (const upd765_interface*)device->baseconfig().static_config(); |
| 2322 | 2322 | |
| 2323 | 2323 | fdc->version = (UPD765_VERSION)device_type; |
| 2324 | fdc->timer = timer_alloc(device->machine, upd765_timer_callback, (void*)device); | |
| 2325 | fdc->seek_timer = timer_alloc(device->machine, upd765_seek_timer_callback, (void*)device); | |
| 2326 | fdc->command_timer = timer_alloc(device->machine, upd765_continue_command, (void*)device); | |
| 2324 | fdc->timer = device->machine->scheduler().timer_alloc(FUNC(upd765_timer_callback), (void*)device); | |
| 2325 | fdc->seek_timer = device->machine->scheduler().timer_alloc(FUNC(upd765_seek_timer_callback), (void*)device); | |
| 2326 | fdc->command_timer = device->machine->scheduler().timer_alloc(FUNC(upd765_continue_command), (void*)device); | |
| 2327 | 2327 | |
| 2328 | 2328 | fdc->upd765_flags &= UPD765_FDD_READY; |
| 2329 | 2329 | fdc->data_buffer = auto_alloc_array(device->machine, char, 32*1024); |
| r10315 | r10316 | |
|---|---|---|
| 23 | 23 | if(VERBOSE_LEVEL >= N) \ |
| 24 | 24 | { \ |
| 25 | 25 | if( M ) \ |
| 26 | logerror("%11.6f: %-24s", | |
| 26 | logerror("%11.6f: %-24s", | |
| 27 | 27 | logerror A; \ |
| 28 | 28 | } \ |
| 29 | 29 | } while (0) |
| r10315 | r10316 | |
| 524 | 524 | switch (state->fdc.state) |
| 525 | 525 | { |
| 526 | 526 | case FDC_CMD_MOTOR_SPIN_UP: |
| 527 | if ( | |
| 527 | if ( | |
| 528 | 528 | { |
| 529 | 529 | state->fdc.state = 0; |
| 530 | 530 | state->fdc.status &= ~FDC_BUSY; |
| r10315 | r10316 | |
| 550 | 550 | case 0x20: // wait for motor spin up |
| 551 | 551 | state->fdc.status &= ~(FDC_IRQ|FDC_LOST|FDC_CRC|FDC_RNF); |
| 552 | 552 | state->fdc.status |= FDC_BUSY; |
| 553 | state->fdc.time = | |
| 553 | state->fdc.time = | |
| 554 | 554 | state->fdc.state = FDC_CMD_MOTOR_SPIN_UP; |
| 555 | 555 | break; |
| 556 | 556 | case 0: // cancel |
| r10315 | r10316 | |
|---|---|---|
| 149 | 149 | state->tms5501 = machine->device("tms5501"); |
| 150 | 150 | |
| 151 | 151 | memory_configure_bank(machine, "bank2", 0, 4, machine->region("maincpu")->base() + 0x010000, 0x1000); |
| 152 | timer_set(machine, attotime::zero, NULL, 0, dai_bootstrap_callback); | |
| 153 | timer_pulse(machine, attotime::from_hz(100),NULL,0,dai_timer); /* timer for tms5501 */ | |
| 152 | machine->scheduler().timer_set(attotime::zero, FUNC(dai_bootstrap_callback)); | |
| 153 | machine->scheduler().timer_pulse(attotime::from_hz(100), FUNC(dai_timer)); /* timer for tms5501 */ | |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | MACHINE_RESET( dai ) |
| r10315 | r10316 | |
|---|---|---|
| 287 | 287 | |
| 288 | 288 | devcb_resolve_write8(&term->teleprinter_keyboard_func, &intf->teleprinter_keyboard_func, device); |
| 289 | 289 | |
| 290 | | |
| 290 | | |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | /*------------------------------------------------- |
| r10315 | r10316 | |
|---|---|---|
| 27 | 27 | if(VERBOSE_LEVEL >= N) \ |
| 28 | 28 | { \ |
| 29 | 29 | if( M ) \ |
| 30 | logerror("%11.6f: %-24s", | |
| 30 | logerror("%11.6f: %-24s", | |
| 31 | 31 | logerror A; \ |
| 32 | 32 | } \ |
| 33 | 33 | } while (0) |
| r10315 | r10316 | |
| 313 | 313 | state->chargen = machine->region("maincpu")->base() + 0x100000; |
| 314 | 314 | /* memset(c64_memory, 0, 0xfd00); */ |
| 315 | 315 | |
| 316 | timer_pulse( | |
| 316 | machine->scheduler().timer_pulse( | |
| 317 | 317 | |
| 318 | 318 | state->p500 = 0; |
| 319 | 319 | state->cbm700 = 0; |
| r10315 | r10316 | |
| 483 | 483 | // vic2_frame_interrupt (device); |
| 484 | 484 | |
| 485 | 485 | /* for p500, check if lightpen has been chosen as input: if so, enable crosshair (but c64-like inputs for p500 are not working atm) */ |
| 486 | timer_set( | |
| 486 | machine->scheduler().timer_set( | |
| 487 | 487 | |
| 488 | 488 | set_led_status(machine, 1, input_port_read(machine, "SPECIAL") & 0x04 ? 1 : 0); /* Shift Lock */ |
| 489 | 489 | } |
| r10315 | r10316 | |
|---|---|---|
| 541 | 541 | { |
| 542 | 542 | machine_reset_common(machine); |
| 543 | 543 | memory_set_bank(machine, "boot", 1); |
| 544 | timer_set( | |
| 544 | machine->scheduler().timer_set( | |
| 545 | 545 | } |
| 546 | 546 | |
| 547 | 547 | MACHINE_RESET( mbee56 ) |
| 548 | 548 | { |
| 549 | 549 | machine_reset_common_disk(machine); |
| 550 | 550 | memory_set_bank(machine, "boot", 1); |
| 551 | timer_set( | |
| 551 | machine->scheduler().timer_set( | |
| 552 | 552 | } |
| 553 | 553 | |
| 554 | 554 | MACHINE_RESET( mbee64 ) |
| r10315 | r10316 | |
| 578 | 578 | state->mbee256_q_pos = 0; |
| 579 | 579 | mbee256_50_w(mem,0,0); // set banks to default |
| 580 | 580 | memory_set_bank(machine, "boot", 8); // boot time |
| 581 | timer_set( | |
| 581 | machine->scheduler().timer_set( | |
| 582 | 582 | } |
| 583 | 583 | |
| 584 | 584 | MACHINE_RESET( mbeett ) |
| r10315 | r10316 | |
| 590 | 590 | state->mbee256_q_pos = 0; |
| 591 | 591 | machine_reset_common(machine); |
| 592 | 592 | memory_set_bank(machine, "boot", 1); |
| 593 | timer_set( | |
| 593 | machine->scheduler().timer_set( | |
| 594 | 594 | } |
| 595 | 595 | |
| 596 | 596 | INTERRUPT_GEN( mbee_interrupt ) |
| r10315 | r10316 | |
| 757 | 757 | memory_configure_bank(machine, "bank8l", 0, 1, &RAM[0x0000], 0x0000); // rom |
| 758 | 758 | memory_configure_bank(machine, "bank8h", 0, 1, &RAM[0x0800], 0x0000); // rom |
| 759 | 759 | |
| 760 | timer_pulse(machine, attotime::from_hz(1),NULL,0,mbee_rtc_irq); /* timer for rtc */ | |
| 761 | timer_pulse(machine, attotime::from_hz(25),NULL,0,mbee256_kbd); /* timer for kbd */ | |
| 760 | machine->scheduler().timer_pulse(attotime::from_hz(1), FUNC(mbee_rtc_irq)); /* timer for rtc */ | |
| 761 | machine->scheduler().timer_pulse(attotime::from_hz(25), FUNC(mbee256_kbd)); /* timer for kbd */ | |
| 762 | 762 | |
| 763 | 763 | state->size = 0x8000; |
| 764 | 764 | } |
| r10315 | r10316 | |
| 778 | 778 | memory_set_bank(machine, "pak", 5); |
| 779 | 779 | memory_set_bank(machine, "telcom", 0); |
| 780 | 780 | |
| 781 | timer_pulse(machine, attotime::from_hz(1),NULL,0,mbee_rtc_irq); /* timer for rtc */ | |
| 782 | timer_pulse(machine, attotime::from_hz(25),NULL,0,mbee256_kbd); /* timer for kbd */ | |
| 781 | machine->scheduler().timer_pulse(attotime::from_hz(1), FUNC(mbee_rtc_irq)); /* timer for rtc */ | |
| 782 | machine->scheduler().timer_pulse(attotime::from_hz(25), FUNC(mbee256_kbd)); /* timer for kbd */ | |
| 783 | 783 | |
| 784 | 784 | state->size = 0x8000; |
| 785 | 785 | } |
| r10315 | r10316 | |
|---|---|---|
| 1568 | 1568 | memset( state->pm_reg, 0, sizeof(state->pm_reg) ); |
| 1569 | 1569 | |
| 1570 | 1570 | /* Set up timers */ |
| 1571 | state->timers.seconds_timer = timer_alloc( | |
| 1571 | state->timers.seconds_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1572 | 1572 | timer_adjust_periodic( state->timers.seconds_timer, attotime::zero, 0, attotime::from_seconds( 1 ) ); |
| 1573 | 1573 | |
| 1574 | state->timers.hz256_timer = timer_alloc( | |
| 1574 | state->timers.hz256_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1575 | 1575 | timer_adjust_periodic( state->timers.hz256_timer, attotime::zero, 0, attotime::from_hz( 256 ) ); |
| 1576 | 1576 | |
| 1577 | state->timers.timer1 = timer_alloc(machine, pokemini_timer1_callback , NULL ); | |
| 1578 | state->timers.timer1_hi = timer_alloc(machine, pokemini_timer1_hi_callback, NULL ); | |
| 1579 | state->timers.timer2 = timer_alloc(machine, pokemini_timer2_callback , NULL ); | |
| 1580 | state->timers.timer2_hi = timer_alloc(machine, pokemini_timer2_hi_callback, NULL ); | |
| 1581 | state->timers.timer3 = timer_alloc(machine, pokemini_timer3_callback , NULL ); | |
| 1582 | state->timers.timer3_hi = timer_alloc(machine, pokemini_timer3_hi_callback, NULL ); | |
| 1577 | state->timers.timer1 = machine->scheduler().timer_alloc(FUNC(pokemini_timer1_callback)); | |
| 1578 | state->timers.timer1_hi = machine->scheduler().timer_alloc(FUNC(pokemini_timer1_hi_callback)); | |
| 1579 | state->timers.timer2 = machine->scheduler().timer_alloc(FUNC(pokemini_timer2_callback)); | |
| 1580 | state->timers.timer2_hi = machine->scheduler().timer_alloc(FUNC(pokemini_timer2_hi_callback)); | |
| 1581 | state->timers.timer3 = machine->scheduler().timer_alloc(FUNC(pokemini_timer3_callback)); | |
| 1582 | state->timers.timer3_hi = machine->scheduler().timer_alloc(FUNC(pokemini_timer3_hi_callback)); | |
| 1583 | 1583 | |
| 1584 | 1584 | /* Set up the PRC */ |
| 1585 | 1585 | state->prc.max_frame_count = 2; |
| 1586 | state->prc.count_timer = timer_alloc( | |
| 1586 | state->prc.count_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1587 | 1587 | timer_adjust_periodic( state->prc.count_timer, attotime::zero, 0, machine->device<cpu_device>("maincpu")->cycles_to_attotime(55640 / 65) ); |
| 1588 | 1588 | } |
| 1589 | 1589 |
| r10315 | r10316 | |
|---|---|---|
| 126 | 126 | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 127 | 127 | |
| 128 | 128 | state->power = 1; |
| 129 | timer_set( | |
| 129 | machine->scheduler().timer_set( | |
| 130 | 130 | |
| 131 | 131 | memory_install_readwrite_bank(space, 0x6000, 0x6fff, 0, 0, "bank1"); |
| 132 | 132 | memory_set_bankptr(machine, "bank1", &ram_get_ptr(machine->device(RAM_TAG))[0x0000]); |
| r10315 | r10316 | |
|---|---|---|
| 179 | 179 | if (offset & 0x04) |
| 180 | 180 | { |
| 181 | 181 | static const UINT8 timershift[4] = { 0, 3, 6, 10 }; |
| 182 | attotime curtime = | |
| 182 | attotime curtime = | |
| 183 | 183 | INT64 target; |
| 184 | 184 | |
| 185 | 185 | /* A0-A1 contain the timer divisor */ |
| r10315 | r10316 | |
| 394 | 394 | devcb_resolve_write8(&miot->port[1].out_port_func, &intf->out_pb_func, device); |
| 395 | 395 | |
| 396 | 396 | /* allocate timers */ |
| 397 | miot->timer = | |
| 397 | miot->timer = | |
| 398 | 398 | |
| 399 | 399 | /* register for save states */ |
| 400 | 400 | state_save_register_device_item(device, 0, miot->port[0].in); |
| r10315 | r10316 | |
|---|---|---|
| 344 | 344 | peb_callback_if *topeb = (peb_callback_if *)device->baseconfig().static_config(); |
| 345 | 345 | devcb_resolve_write_line(&card->lines.ready, &topeb->ready, device); |
| 346 | 346 | |
| 347 | card->motor_on_timer = | |
| 347 | card->motor_on_timer = | |
| 348 | 348 | |
| 349 | 349 | astring *region = new astring(); |
| 350 | 350 | astring_assemble_3(region, device->tag(), ":", fdc_region); |
| r10315 | r10316 | |
|---|---|---|
| 153 | 153 | logerror("time to ready: %f -> %d\n", time_to_ready.as_double(), (int) cycles_to_ready); |
| 154 | 154 | |
| 155 | 155 | cpu_adjust_icount(device->machine->device("maincpu"),-cycles_to_ready); |
| 156 | | |
| 156 | | |
| 157 | 157 | } |
| 158 | 158 | tms5220_data_w(spsys->vsp, offset, data); |
| 159 | 159 | } |
| r10315 | r10316 | |
|---|---|---|
| 654 | 654 | devcb_resolve_write_line(&card->lines.inta, &topeb->inta, device); |
| 655 | 655 | // The HFDC does not use READY; it has on-board RAM for DMA |
| 656 | 656 | |
| 657 | card->motor_on_timer = | |
| 657 | card->motor_on_timer = | |
| 658 | 658 | card->ram = NULL; |
| 659 | 659 | card->ram_offset[0] = 0x2000; // static bank |
| 660 | 660 | card->controller = device->subdevice("smc92x4"); |
| r10315 | r10316 | |
|---|---|---|
| 482 | 482 | peb_callback_if *topeb = (peb_callback_if *)device->baseconfig().static_config(); |
| 483 | 483 | devcb_resolve_write_line(&card->lines.ready, &topeb->ready, device); |
| 484 | 484 | |
| 485 | card->motor_on_timer = | |
| 485 | card->motor_on_timer = | |
| 486 | 486 | card->controller = device->subdevice("wd1773"); |
| 487 | 487 | card->clock = device->subdevice("mm58274c"); |
| 488 | 488 | astring *region = new astring(); |
| r10315 | r10316 | |
|---|---|---|
| 341 | 341 | static DEVICE_START( ti99_handset ) |
| 342 | 342 | { |
| 343 | 343 | ti99_handset_state *handset = get_safe_token(device); |
| 344 | handset->timer = | |
| 344 | handset->timer = | |
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | static DEVICE_RESET( ti99_handset ) |
| r10315 | r10316 | |
|---|---|---|
| 162 | 162 | logerror("time to ready: %f -> %d\n", time_to_ready.as_double(), (int) cycles_to_ready); |
| 163 | 163 | |
| 164 | 164 | cpu_adjust_icount(device->machine->device("maincpu"),-cycles_to_ready); |
| 165 | | |
| 165 | | |
| 166 | 166 | } |
| 167 | 167 | tms5220_data_w(adapter->vsp, offset, data); |
| 168 | 168 | } |
| r10315 | r10316 | |
|---|---|---|
| 108 | 108 | int pulse_count; |
| 109 | 109 | int pulse1_state; |
| 110 | 110 | int pulse16_state; |
| 111 | void (*timer_ | |
| 111 | void (*timer_expired_func)(int state); | |
| 112 | 112 | void (*alarm_callback)(running_machine *machine, int state); |
| 113 | 113 | const rp5c15_intf* intf; |
| 114 | 114 | emu_timer* timer; |
| r10315 | r10316 | |
| 193 | 193 | rtc->test = 0x00; |
| 194 | 194 | rtc->pulse_count = 0; |
| 195 | 195 | |
| 196 | rtc->timer = | |
| 196 | rtc->timer = | |
| 197 | 197 | timer_adjust_periodic(rtc->timer, attotime::zero, 0, attotime::from_hz(32)); |
| 198 | 198 | } |
| 199 | 199 |
| r10315 | r10316 | |
|---|---|---|
| 1070 | 1070 | coco_state *state = machine->driver_data<coco_state>(); |
| 1071 | 1071 | cpunum_set_input_line(machine, 0, INPUT_LINE_HALT, halt_line); |
| 1072 | 1072 | if (halt_line == CLEAR_LINE) |
| 1073 | timer_set(machine | |
| 1073 | machine->scheduler().timer_set(machine | |
| 1074 | 1074 | } |
| 1075 | 1075 | #endif |
| 1076 | 1076 | |
| r10315 | r10316 | |
| 1103 | 1103 | val = val * 4160.0 + 592.0; |
| 1104 | 1104 | } |
| 1105 | 1105 | |
| 1106 | return ( | |
| 1106 | return ( | |
| 1107 | 1107 | } |
| 1108 | 1108 | |
| 1109 | 1109 | static void coco_hiresjoy_w( running_machine *machine, int data, UINT8 port ) |
| r10315 | r10316 | |
| 1127 | 1127 | |
| 1128 | 1128 | static int coco_hiresjoy_readone( running_machine *machine, attotime transitiontime ) |
| 1129 | 1129 | { |
| 1130 | return | |
| 1130 | return | |
| 1131 | 1131 | } |
| 1132 | 1132 | |
| 1133 | 1133 | static int coco_hiresjoy_rx( running_machine *machine ) |
| r10315 | r10316 | |
| 1336 | 1336 | static attotime get_relative_time( running_machine *machine, attotime absolute_time ) |
| 1337 | 1337 | { |
| 1338 | 1338 | attotime result; |
| 1339 | attotime now = | |
| 1339 | attotime now = | |
| 1340 | 1340 | |
| 1341 | 1341 | if (absolute_time > now) |
| 1342 | 1342 | result = absolute_time - now; |
| r10315 | r10316 | |
| 2277 | 2277 | static void coco3_timer_init(running_machine *machine) |
| 2278 | 2278 | { |
| 2279 | 2279 | coco3_state *state = machine->driver_data<coco3_state>(); |
| 2280 | state->gime_timer = timer_alloc( | |
| 2280 | state->gime_timer = machine->scheduler().timer_alloc(FUNC(c | |
| 2281 | 2281 | } |
| 2282 | 2282 | |
| 2283 | 2283 | |
| r10315 | r10316 | |
| 2823 | 2823 | typedef struct _machine_init_interface machine_init_interface; |
| 2824 | 2824 | struct _machine_init_interface |
| 2825 | 2825 | { |
| 2826 | timer_ | |
| 2826 | timer_expired_func recalc_interrupts_; /* recalculate inturrupts callback */ | |
| 2827 | 2827 | void (*printer_out_)(running_machine *machine, int data); /* printer output callback */ |
| 2828 | 2828 | }; |
| 2829 | 2829 | |
| r10315 | r10316 | |
| 2859 | 2859 | state->recalc_interrupts = init->recalc_interrupts_; |
| 2860 | 2860 | |
| 2861 | 2861 | /* this timer is used to schedule keyboard updating */ |
| 2862 | state->update_keyboard_timer = timer_alloc( | |
| 2862 | state->update_keyboard_timer = machine->scheduler().timer_alloc(FUNC(c | |
| 2863 | 2863 | |
| 2864 | 2864 | /* these are the timers to delay the MUX switching */ |
| 2865 | state->mux_sel1_timer = timer_alloc(machine, coco_update_sel1_timerproc, NULL); | |
| 2866 | state->mux_sel2_timer = timer_alloc(machine, coco_update_sel2_timerproc, NULL); | |
| 2865 | state->mux_sel1_timer = machine->scheduler().timer_alloc(FUNC(coco_update_sel1_timerproc)); | |
| 2866 | state->mux_sel2_timer = machine->scheduler().timer_alloc(FUNC(coco_update_sel2_timerproc)); | |
| 2867 | 2867 | |
| 2868 | 2868 | /* setup ROM */ |
| 2869 | 2869 | state->rom = machine->region("maincpu")->base(); |
| r10315 | r10316 | |
| 2935 | 2935 | generic_coco12_dragon_init(machine, &init); |
| 2936 | 2936 | |
| 2937 | 2937 | /* need to specify lightgun crosshairs */ |
| 2938 | timer_set( | |
| 2938 | machine->scheduler().timer_set( | |
| 2939 | 2939 | } |
| 2940 | 2940 | |
| 2941 | 2941 | MACHINE_START( dragon64 ) |
| r10315 | r10316 | |
| 2950 | 2950 | generic_coco12_dragon_init(machine, &init); |
| 2951 | 2951 | |
| 2952 | 2952 | /* need to specify lightgun crosshairs */ |
| 2953 | timer_set( | |
| 2953 | machine->scheduler().timer_set( | |
| 2954 | 2954 | } |
| 2955 | 2955 | |
| 2956 | 2956 | MACHINE_START( tanodr64 ) |
| r10315 | r10316 | |
| 2965 | 2965 | generic_coco12_dragon_init(machine, &init); |
| 2966 | 2966 | |
| 2967 | 2967 | /* need to specify lightgun crosshairs */ |
| 2968 | timer_set( | |
| 2968 | machine->scheduler().timer_set( | |
| 2969 | 2969 | } |
| 2970 | 2970 | |
| 2971 | 2971 | MACHINE_START( dgnalpha ) |
| r10315 | r10316 | |
| 2980 | 2980 | generic_coco12_dragon_init(machine, &init); |
| 2981 | 2981 | |
| 2982 | 2982 | /* need to specify lightgun crosshairs */ |
| 2983 | timer_set( | |
| 2983 | machine->scheduler().timer_set( | |
| 2984 | 2984 | } |
| 2985 | 2985 | |
| 2986 | 2986 | MACHINE_RESET( dgnalpha ) |
| r10315 | r10316 | |
| 2994 | 2994 | state->dgnalpha_just_reset=1; |
| 2995 | 2995 | |
| 2996 | 2996 | /* need to specify lightgun crosshairs */ |
| 2997 | timer_set( | |
| 2997 | machine->scheduler().timer_set( | |
| 2998 | 2998 | } |
| 2999 | 2999 | |
| 3000 | 3000 | const wd17xx_interface dgnalpha_wd17xx_interface = |
| r10315 | r10316 | |
| 3019 | 3019 | generic_coco12_dragon_init(machine, &init); |
| 3020 | 3020 | |
| 3021 | 3021 | /* need to specify lightgun crosshairs */ |
| 3022 | timer_set( | |
| 3022 | machine->scheduler().timer_set( | |
| 3023 | 3023 | } |
| 3024 | 3024 | |
| 3025 | 3025 | MACHINE_START( coco2 ) |
| r10315 | r10316 | |
| 3034 | 3034 | generic_coco12_dragon_init(machine, &init); |
| 3035 | 3035 | |
| 3036 | 3036 | /* need to specify lightgun crosshairs */ |
| 3037 | timer_set( | |
| 3037 | machine->scheduler().timer_set( | |
| 3038 | 3038 | } |
| 3039 | 3039 | |
| 3040 | 3040 | MACHINE_RESET( coco3 ) |
| r10315 | r10316 | |
| 3087 | 3087 | state_save_register_postload(machine, coco3_state_postload, NULL); |
| 3088 | 3088 | |
| 3089 | 3089 | /* need to specify lightgun crosshairs */ |
| 3090 | timer_set( | |
| 3090 | machine->scheduler().timer_set( | |
| 3091 | 3091 | } |
| 3092 | 3092 | |
| 3093 | 3093 |
| r10315 | r10316 | |
|---|---|---|
| 387 | 387 | { |
| 388 | 388 | tc8521_t *rtc = get_token(device); |
| 389 | 389 | memset(rtc, 0, sizeof(*rtc)); |
| 390 | | |
| 390 | | |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | 393 |
| r10315 | r10316 | |
|---|---|---|
| 296 | 296 | if ( i >= 0 ) |
| 297 | 297 | mc6854->tfifo[ i ] = data | 0x100; |
| 298 | 298 | else |
| 299 | logerror( "%f mc6854_tfifo_push: FIFO overrun\n", | |
| 299 | logerror( "%f mc6854_tfifo_push: FIFO overrun\n", | |
| 300 | 300 | |
| 301 | 301 | /* start frame, if needed */ |
| 302 | 302 | if ( ! mc6854->tstate ) |
| 303 | 303 | { |
| 304 | LOG(( "%f mc6854_tfifo_push: start frame\n", | |
| 304 | LOG(( "%f mc6854_tfifo_push: start frame\n", | |
| 305 | 305 | mc6854->tstate = 2; |
| 306 | 306 | mc6854_send_bits( device, FLAG, 8, 0 ); |
| 307 | 307 | } |
| r10315 | r10316 | |
| 355 | 355 | case 2: /* 8-bit address field */ |
| 356 | 356 | if ( ( data & 1 ) || ( ! AEX ) ) |
| 357 | 357 | mc6854->tstate = 3; |
| 358 | LOG(( "%f mc6854_tfifo_cb: address field $%02X\n", | |
| 358 | LOG(( "%f mc6854_tfifo_cb: address field $%02X\n", | |
| 359 | 359 | break; |
| 360 | 360 | |
| 361 | 361 | case 3: /* 8-bit control field */ |
| r10315 | r10316 | |
| 365 | 365 | mc6854->tstate = 5; |
| 366 | 366 | else |
| 367 | 367 | mc6854->tstate = 6; |
| 368 | LOG(( "%f mc6854_tfifo_cb: control field $%02X\n", | |
| 368 | LOG(( "%f mc6854_tfifo_cb: control field $%02X\n", | |
| 369 | 369 | break; |
| 370 | 370 | |
| 371 | 371 | case 4: /* 8-bit extended control field (optional) */ |
| r10315 | r10316 | |
| 373 | 373 | mc6854->tstate = 5; |
| 374 | 374 | else |
| 375 | 375 | mc6854->tstate = 6; |
| 376 | LOG(( "%f mc6854_tfifo_cb: control field $%02X\n", | |
| 376 | LOG(( "%f mc6854_tfifo_cb: control field $%02X\n", | |
| 377 | 377 | break; |
| 378 | 378 | |
| 379 | 379 | case 5: /* 8-bit logical control (optional) */ |
| 380 | 380 | if ( ! ( data & 0x80 ) ) |
| 381 | 381 | mc6854->tstate = 6; |
| 382 | LOG(( "%f mc6854_tfifo_cb: logical control field $%02X\n", | |
| 382 | LOG(( "%f mc6854_tfifo_cb: logical control field $%02X\n", | |
| 383 | 383 | break; |
| 384 | 384 | |
| 385 | 385 | case 6: /* variable-length data */ |
| 386 | 386 | blen = TWL; |
| 387 | LOG(( "%f mc6854_tfifo_cb: data field $%02X, %i bits\n", | |
| 387 | LOG(( "%f mc6854_tfifo_cb: data field $%02X, %i bits\n", | |
| 388 | 388 | break; |
| 389 | 389 | |
| 390 | 390 | default: |
| 391 | LOG(( "%f mc6854_tfifo_cb: state=%i\n", | |
| 391 | LOG(( "%f mc6854_tfifo_cb: state=%i\n", | |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 | if ( mc6854->flen < MAX_FRAME_LENGTH ) |
| r10315 | r10316 | |
| 401 | 401 | else |
| 402 | 402 | { |
| 403 | 403 | /* data underrun => abort */ |
| 404 | logerror( "%f mc6854_tfifo_cb: FIFO underrun\n", | |
| 404 | logerror( "%f mc6854_tfifo_cb: FIFO underrun\n", | |
| 405 | 405 | mc6854->sr1 |= TU; |
| 406 | 406 | mc6854->tstate = 0; |
| 407 | 407 | mc6854_send_bits( device, 0xffff, ABTEX ? 16 : 8, 0 ); |
| r10315 | r10316 | |
| 413 | 413 | { |
| 414 | 414 | int len = mc6854->flen; |
| 415 | 415 | |
| 416 | LOG(( "%f mc6854_tfifo_cb: end frame\n", | |
| 416 | LOG(( "%f mc6854_tfifo_cb: end frame\n", | |
| 417 | 417 | mc6854_send_bits( device, 0xdeadbeef, 16, 1 ); /* send check-sum: TODO */ |
| 418 | 418 | mc6854_send_bits( device, FLAG, 8, 0 ); /* send closing flag */ |
| 419 | 419 | |
| 420 | 420 | if ( mc6854->tfifo[ FIFO_SIZE - 1 ] & 0x100 ) |
| 421 | 421 | { |
| 422 | 422 | /* re-open frame asap */ |
| 423 | LOG(( "%f mc6854_tfifo_cb: start frame\n", | |
| 423 | LOG(( "%f mc6854_tfifo_cb: start frame\n", | |
| 424 | 424 | if ( TWOINTER ) |
| 425 | 425 | mc6854_send_bits( device, FLAG, 8, 0 ); |
| 426 | 426 | } |
| r10315 | r10316 | |
| 467 | 467 | mc6854->rstate = 3; |
| 468 | 468 | else |
| 469 | 469 | mc6854->rstate = 2; |
| 470 | LOG(( "%f mc6854_rfifo_push: address field $%02X\n", | |
| 470 | LOG(( "%f mc6854_rfifo_push: address field $%02X\n", | |
| 471 | 471 | data |= 0x400; /* address marker */ |
| 472 | 472 | break; |
| 473 | 473 | |
| r10315 | r10316 | |
| 478 | 478 | mc6854->rstate = 5; |
| 479 | 479 | else |
| 480 | 480 | mc6854->rstate = 6; |
| 481 | LOG(( "%f mc6854_rfifo_push: control field $%02X\n", | |
| 481 | LOG(( "%f mc6854_rfifo_push: control field $%02X\n", | |
| 482 | 482 | break; |
| 483 | 483 | |
| 484 | 484 | case 4: /* 8-bit extended control field (optional) */ |
| r10315 | r10316 | |
| 486 | 486 | mc6854->rstate = 5; |
| 487 | 487 | else |
| 488 | 488 | mc6854->rstate = 6; |
| 489 | LOG(( "%f mc6854_rfifo_push: control field $%02X\n", | |
| 489 | LOG(( "%f mc6854_rfifo_push: control field $%02X\n", | |
| 490 | 490 | break; |
| 491 | 491 | |
| 492 | 492 | case 5: /* 8-bit logical control (optional) */ |
| 493 | 493 | if ( ! ( data & 0x80 ) ) |
| 494 | 494 | mc6854->rstate = 6; |
| 495 | LOG(( "%f mc6854_rfifo_push: logical control field $%02X\n", | |
| 495 | LOG(( "%f mc6854_rfifo_push: logical control field $%02X\n", | |
| 496 | 496 | break; |
| 497 | 497 | |
| 498 | 498 | case 6: /* variable-length data */ |
| 499 | 499 | blen = RWL; |
| 500 | 500 | data >>= 8 - blen; |
| 501 | LOG(( "%f mc6854_rfifo_push: data field $%02X, %i bits\n", | |
| 501 | LOG(( "%f mc6854_rfifo_push: data field $%02X, %i bits\n", | |
| 502 | 502 | break; |
| 503 | 503 | } |
| 504 | 504 | |
| 505 | 505 | /* no further FIFO fill until FV is cleared! */ |
| 506 | 506 | if ( mc6854->sr2 & FV ) |
| 507 | 507 | { |
| 508 | LOG(( "%f mc6854_rfifo_push: field not pushed\n", | |
| 508 | LOG(( "%f mc6854_rfifo_push: field not pushed\n", | |
| 509 | 509 | return; |
| 510 | 510 | } |
| 511 | 511 | |
| r10315 | r10316 | |
| 525 | 525 | /* FIFO full */ |
| 526 | 526 | mc6854->sr2 |= OVRN; |
| 527 | 527 | mc6854->rfifo[ 0 ] = data; |
| 528 | logerror( "%f mc6854_rfifo_push: FIFO overrun\n", | |
| 528 | logerror( "%f mc6854_rfifo_push: FIFO overrun\n", | |
| 529 | 529 | } |
| 530 | 530 | |
| 531 | 531 | mc6854->rsize -= blen; |
| r10315 | r10316 | |
| 605 | 605 | { |
| 606 | 606 | /* only in-frame abort */ |
| 607 | 607 | mc6854->sr2 |= RABT; |
| 608 | LOG(( "%f mc6854_receive_bit: abort\n", | |
| 608 | LOG(( "%f mc6854_receive_bit: abort\n", | |
| 609 | 609 | } |
| 610 | 610 | } |
| 611 | 611 | else |
| r10315 | r10316 | |
| 635 | 635 | if ( mc6854->rsize >= fieldlen + 24 ) /* last field */ |
| 636 | 636 | mc6854_rfifo_push( device, mc6854->rreg ); |
| 637 | 637 | mc6854_rfifo_terminate( device ); |
| 638 | LOG(( "%f mc6854_receive_bit: end of frame\n", | |
| 638 | LOG(( "%f mc6854_receive_bit: end of frame\n", | |
| 639 | 639 | } |
| 640 | 640 | mc6854->rones = 0; |
| 641 | 641 | mc6854->rstate = 1; |
| r10315 | r10316 | |
| 801 | 801 | case 0: /* status register 1 */ |
| 802 | 802 | mc6854_update_sr1( mc6854 ); |
| 803 | 803 | LOG(( "%f $%04x mc6854_r: get SR1=$%02X (rda=%i,s2rq=%i,fd=%i,cts=%i,tu=%i,tdra=%i,irq=%i)\n", |
| 804 | | |
| 804 | | |
| 805 | 805 | ( mc6854->sr1 & RDA) ? 1 : 0, ( mc6854->sr1 & S2RQ) ? 1 : 0, |
| 806 | 806 | ( mc6854->sr1 & FD ) ? 1 : 0, ( mc6854->sr1 & CTS ) ? 1 : 0, |
| 807 | 807 | ( mc6854->sr1 & TU ) ? 1 : 0, ( mc6854->sr1 & TDRA) ? 1 : 0, |
| r10315 | r10316 | |
| 811 | 811 | case 1: /* status register 2 */ |
| 812 | 812 | mc6854_update_sr2( mc6854 ); |
| 813 | 813 | LOG(( "%f $%04x mc6854_r: get SR2=$%02X (ap=%i,fv=%i,ridle=%i,rabt=%i,err=%i,dcd=%i,ovrn=%i,rda2=%i)\n", |
| 814 | | |
| 814 | | |
| 815 | 815 | ( mc6854->sr2 & AP ) ? 1 : 0, ( mc6854->sr2 & FV ) ? 1 : 0, |
| 816 | 816 | ( mc6854->sr2 & RIDLE) ? 1 : 0, ( mc6854->sr2 & RABT) ? 1 : 0, |
| 817 | 817 | ( mc6854->sr2 & ERR ) ? 1 : 0, ( mc6854->sr2 & DCD ) ? 1 : 0, |
| r10315 | r10316 | |
| 823 | 823 | { |
| 824 | 824 | UINT8 data = mc6854_rfifo_pop( device ); |
| 825 | 825 | LOG(( "%f $%04x mc6854_r: get data $%02X\n", |
| 826 | | |
| 826 | | |
| 827 | 827 | return data; |
| 828 | 828 | } |
| 829 | 829 | |
| r10315 | r10316 | |
| 844 | 844 | case 0: /* control register 1 */ |
| 845 | 845 | mc6854->cr1 = data; |
| 846 | 846 | LOG(( "%f $%04x mc6854_w: set CR1=$%02X (ac=%i,irq=%c%c,%sreset=%c%c)\n", |
| 847 | | |
| 847 | | |
| 848 | 848 | AC ? 1 : 0, |
| 849 | 849 | RIE ? 'r' : '-', TIE ? 't' : '-', |
| 850 | 850 | DISCONTINUE ? "discontinue," : "", |
| r10315 | r10316 | |
| 881 | 881 | /* control register 3 */ |
| 882 | 882 | mc6854->cr3 = data; |
| 883 | 883 | LOG(( "%f $%04x mc6854_w: set CR3=$%02X (lcf=%i,aex=%i,idl=%i,fdse=%i,loop=%i,tst=%i,dtr=%i)\n", |
| 884 | | |
| 884 | | |
| 885 | 885 | LCF ? (CEX ? 16 : 8) : 0, AEX ? 1 : 0, |
| 886 | 886 | IDL0 ? 0 : 1, FDSE ? 1 : 0, LOOP ? 1 : 0, |
| 887 | 887 | TST ? 1 : 0, DTR ? 1 : 0 |
| r10315 | r10316 | |
| 900 | 900 | /* control register 2 */ |
| 901 | 901 | mc6854->cr2 = data; |
| 902 | 902 | LOG(( "%f $%04x mc6854_w: set CR2=$%02X (pse=%i,bytes=%i,fmidle=%i,%s,tlast=%i,clr=%c%c,rts=%i)\n", |
| 903 | | |
| 903 | | |
| 904 | 904 | PSE ? 1 : 0, TWOBYTES ? 2 : 1, FMIDLE ? 1 : 0, |
| 905 | 905 | FCTDRA ? "fc" : "tdra", TLAST ? 1 : 0, |
| 906 | 906 | data & 0x20 ? 'r' : '-', data & 0x40 ? 't' : '-', |
| r10315 | r10316 | |
| 931 | 931 | break; |
| 932 | 932 | |
| 933 | 933 | case 2: /* transmitter data: continue data */ |
| 934 | LOG(( "%f $%04xmc6854_w: push data=$%02X\n", | |
| 934 | LOG(( "%f $%04xmc6854_w: push data=$%02X\n", | |
| 935 | 935 | mc6854_tfifo_push( device, data ); |
| 936 | 936 | break; |
| 937 | 937 | |
| r10315 | r10316 | |
| 940 | 940 | { |
| 941 | 941 | /* control register 4 */ |
| 942 | 942 | mc6854->cr4 = data; |
| 943 | LOG(( "%f $%04x mc6854_w: set CR4=$%02X (interframe=%i,tlen=%i,rlen=%i,%s%s)\n", | |
| 943 | LOG(( "%f $%04x mc6854_w: set CR4=$%02X (interframe=%i,tlen=%i,rlen=%i,%s%s)\n", | |
| 944 | 944 | TWOINTER ? 2 : 1, |
| 945 | 945 | TWL, RWL, |
| 946 | 946 | ABT ? ( ABTEX ? "abort-ext," : "abort,") : "", |
| r10315 | r10316 | |
| 955 | 955 | else |
| 956 | 956 | { |
| 957 | 957 | /* transmitter data: last data */ |
| 958 | LOG(( "%f $%04x mc6854_w: push last-data=$%02X\n", | |
| 958 | LOG(( "%f $%04x mc6854_w: push last-data=$%02X\n", | |
| 959 | 959 | mc6854_tfifo_push( device, data ); |
| 960 | 960 | mc6854_tfifo_terminate( device ); |
| 961 | 961 | } |
| r10315 | r10316 | |
| 996 | 996 | |
| 997 | 997 | mc6854->iface = (const mc6854_interface*)device->baseconfig().static_config(); |
| 998 | 998 | |
| 999 | mc6854->ttimer = | |
| 999 | mc6854->ttimer = | |
| 1000 | 1000 | |
| 1001 | 1001 | state_save_register_item( device->machine, "mc6854", device->tag(), 0, mc6854->cr1 ); |
| 1002 | 1002 | state_save_register_item( device->machine, "mc6854", device->tag(), 0, mc6854->cr2 ); |
| r10315 | r10316 | |
|---|---|---|
| 248 | 248 | machine->add_notifier(MACHINE_NOTIFY_EXIT, gb_machine_stop); |
| 249 | 249 | |
| 250 | 250 | /* Allocate the serial timer, and disable it */ |
| 251 | state->gb_serial_timer = timer_alloc( | |
| 251 | state->gb_serial_timer = machine->scheduler().timer_alloc(FUNC( | |
| 252 | 252 | timer_enable( state->gb_serial_timer, 0 ); |
| 253 | 253 | |
| 254 | 254 | MACHINE_START_CALL( gb_video ); |
| r10315 | r10316 | |
| 260 | 260 | machine->add_notifier(MACHINE_NOTIFY_EXIT, gb_machine_stop); |
| 261 | 261 | |
| 262 | 262 | /* Allocate the serial timer, and disable it */ |
| 263 | state->gb_serial_timer = timer_alloc( | |
| 263 | state->gb_serial_timer = machine->scheduler().timer_alloc(FUNC( | |
| 264 | 264 | timer_enable( state->gb_serial_timer, 0 ); |
| 265 | 265 | |
| 266 | 266 | MACHINE_START_CALL( gbc_video ); |
| r10315 | r10316 | |
| 292 | 292 | machine->add_notifier(MACHINE_NOTIFY_EXIT, gb_machine_stop); |
| 293 | 293 | |
| 294 | 294 | /* Allocate the serial timer, and disable it */ |
| 295 | state->gb_serial_timer = timer_alloc( | |
| 295 | state->gb_serial_timer = machine->scheduler().timer_alloc(FUNC( | |
| 296 | 296 | timer_enable( state->gb_serial_timer, 0 ); |
| 297 | 297 | |
| 298 | 298 | MACHINE_START_CALL( gb_video ); |
| r10315 | r10316 | |
| 2048 | 2048 | { |
| 2049 | 2049 | gb_state *state = machine->driver_data<gb_state>(); |
| 2050 | 2050 | /* Allocate the serial timer, and disable it */ |
| 2051 | state->gb_serial_timer = timer_alloc( | |
| 2051 | state->gb_serial_timer = machine->scheduler().timer_alloc(FUNC( | |
| 2052 | 2052 | timer_enable( state->gb_serial_timer, 0 ); |
| 2053 | 2053 | |
| 2054 | 2054 | MACHINE_START_CALL( gb_video ); |
| r10315 | r10316 | |
|---|---|---|
| 560 | 560 | DRIVER_INIT( gamecom ) |
| 561 | 561 | { |
| 562 | 562 | gamecom_state *state = machine->driver_data<gamecom_state>(); |
| 563 | state->clock_timer = timer_alloc( | |
| 563 | state->clock_timer = machine->scheduler().timer_alloc(FUNC( | |
| 564 | 564 | } |
| 565 | 565 | |
| 566 | 566 | DEVICE_IMAGE_LOAD( gamecom_cart1 ) |
| r10315 | r10316 | |
|---|---|---|
| 180 | 180 | MACHINE_RESET( radio86 ) |
| 181 | 181 | { |
| 182 | 182 | radio86_state *state = machine->driver_data<radio86_state>(); |
| 183 | timer_set( | |
| 183 | machine->scheduler().timer_set( | |
| 184 | 184 | memory_set_bank(machine, "bank1", 1); |
| 185 | 185 | |
| 186 | 186 | state->keyboard_mask = 0; |
| r10315 | r10316 | |
|---|---|---|
| 84 | 84 | void ti990_hold_load(running_machine *machine) |
| 85 | 85 | { |
| 86 | 86 | cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, ASSERT_LINE); |
| 87 | timer_set( | |
| 87 | machine->scheduler().timer_set( | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /* |
| r10315 | r10316 | |
|---|---|---|
| 143 | 143 | ser->form.word_length = num_data_bits; |
| 144 | 144 | ser->form.stop_bit_count = stop_bit_count; |
| 145 | 145 | ser->form.parity = parity_code; |
| 146 | ser->timer = | |
| 146 | ser->timer = | |
| 147 | 147 | |
| 148 | 148 | serial_connection_init(device->machine,&ser->connection); |
| 149 | 149 | serial_connection_set_in_callback(device->machine,&ser->connection, serial_device_in_callback); |
| r10315 | r10316 | |
|---|---|---|
| 117 | 117 | if ( mc6846->old_cif != cif ) |
| 118 | 118 | { |
| 119 | 119 | LOG (( "%f: mc6846 interrupt %i (time=%i cp1=%i cp2=%i)\n", |
| 120 | | |
| 120 | | |
| 121 | 121 | mc6846->csr & 1, (mc6846->csr >> 1 ) & 1, (mc6846->csr >> 2 ) & 1 )); |
| 122 | 122 | mc6846->old_cif = cif; |
| 123 | 123 | } |
| r10315 | r10316 | |
| 143 | 143 | int cto = CTO; |
| 144 | 144 | if ( cto != mc6846->old_cto ) |
| 145 | 145 | { |
| 146 | LOG (( "%f: mc6846 CTO set to %i\n", | |
| 146 | LOG (( "%f: mc6846 CTO set to %i\n", | |
| 147 | 147 | mc6846->old_cto = cto; |
| 148 | 148 | } |
| 149 | 149 | if ( mc6846->iface->out_cto_func ) |
| r10315 | r10316 | |
| 156 | 156 | { |
| 157 | 157 | mc6846_t* mc6846 = get_safe_token( device ); |
| 158 | 158 | int delay = FACTOR * (mc6846->preset+1); |
| 159 | LOG (( "%f: mc6846 timer launch called, mode=%i, preset=%i (x%i)\n", | |
| 159 | LOG (( "%f: mc6846 timer launch called, mode=%i, preset=%i (x%i)\n", | |
| 160 | 160 | |
| 161 | 161 | if ( ! (mc6846->tcr & 2) ) |
| 162 | 162 | { |
| r10315 | r10316 | |
| 204 | 204 | mc6846_t* mc6846 = get_safe_token( device ); |
| 205 | 205 | int delay = FACTOR * (mc6846->latch+1); |
| 206 | 206 | |
| 207 | LOG (( "%f: mc6846 timer expire called, mode=%i, latch=%i (x%i)\n", | |
| 207 | LOG (( "%f: mc6846 timer expire called, mode=%i, latch=%i (x%i)\n", | |
| 208 | 208 | |
| 209 | 209 | /* latch => counter */ |
| 210 | 210 | mc6846->preset = mc6846->latch; |
| r10315 | r10316 | |
| 247 | 247 | { |
| 248 | 248 | device_t* device = (device_t*) ptr; |
| 249 | 249 | mc6846_t* mc6846 = get_safe_token( device ); |
| 250 | LOG (( "%f: mc6846 timer one shot called\n", | |
| 250 | LOG (( "%f: mc6846 timer one shot called\n", | |
| 251 | 251 | |
| 252 | 252 | /* 1 micro second after one-shot launch, we put cto to high */ |
| 253 | 253 | mc6846->cto = 1; |
| r10315 | r10316 | |
| 267 | 267 | case 0: |
| 268 | 268 | case 4: |
| 269 | 269 | LOG (( "$%04x %f: mc6846 CSR read $%02X intr=%i (timer=%i, cp1=%i, cp2=%i)\n", |
| 270 | cpu_get_previouspc( device->machine->firstcpu ), | |
| 270 | cpu_get_previouspc( device->machine->firstcpu ), | |
| 271 | 271 | mc6846->csr, (mc6846->csr >> 7) & 1, |
| 272 | 272 | mc6846->csr & 1, (mc6846->csr >> 1) & 1, (mc6846->csr >> 2) & 1 )); |
| 273 | 273 | mc6846->csr0_to_be_cleared = mc6846->csr & 1; |
| r10315 | r10316 | |
| 276 | 276 | return mc6846->csr; |
| 277 | 277 | |
| 278 | 278 | case 1: |
| 279 | LOG (( "$%04x %f: mc6846 PCR read $%02X\n", cpu_get_previouspc( device->machine->firstcpu ), | |
| 279 | LOG (( "$%04x %f: mc6846 PCR read $%02X\n", cpu_get_previouspc( device->machine->firstcpu ), | |
| 280 | 280 | return mc6846->pcr; |
| 281 | 281 | |
| 282 | 282 | case 2: |
| 283 | LOG (( "$%04x %f: mc6846 DDR read $%02X\n", cpu_get_previouspc( device->machine->firstcpu ), | |
| 283 | LOG (( "$%04x %f: mc6846 DDR read $%02X\n", cpu_get_previouspc( device->machine->firstcpu ), | |
| 284 | 284 | return mc6846->ddr; |
| 285 | 285 | |
| 286 | 286 | case 3: |
| 287 | LOG (( "$%04x %f: mc6846 PORT read $%02X\n", cpu_get_previouspc( device->machine->firstcpu ), | |
| 287 | LOG (( "$%04x %f: mc6846 PORT read $%02X\n", cpu_get_previouspc( device->machine->firstcpu ), | |
| 288 | 288 | if ( ! (mc6846->pcr & 0x80) ) |
| 289 | 289 | { |
| 290 | 290 | if ( mc6846->csr1_to_be_cleared ) |
| r10315 | r10316 | |
| 298 | 298 | return PORT; |
| 299 | 299 | |
| 300 | 300 | case 5: |
| 301 | LOG (( "$%04x %f: mc6846 TCR read $%02X\n",cpu_get_previouspc( device->machine->firstcpu ), | |
| 301 | LOG (( "$%04x %f: mc6846 TCR read $%02X\n",cpu_get_previouspc( device->machine->firstcpu ), | |
| 302 | 302 | return mc6846->tcr; |
| 303 | 303 | |
| 304 | 304 | case 6: |
| 305 | LOG (( "$%04x %f: mc6846 COUNTER hi read $%02X\n", cpu_get_previouspc( device->machine->firstcpu ), | |
| 305 | LOG (( "$%04x %f: mc6846 COUNTER hi read $%02X\n", cpu_get_previouspc( device->machine->firstcpu ), | |
| 306 | 306 | if ( mc6846->csr0_to_be_cleared ) |
| 307 | 307 | { |
| 308 | 308 | mc6846->csr &= ~1; |
| r10315 | r10316 | |
| 312 | 312 | return mc6846_counter( device ) >> 8; |
| 313 | 313 | |
| 314 | 314 | case 7: |
| 315 | LOG (( "$%04x %f: mc6846 COUNTER low read $%02X\n", cpu_get_previouspc( device->machine->firstcpu ), | |
| 315 | LOG (( "$%04x %f: mc6846 COUNTER low read $%02X\n", cpu_get_previouspc( device->machine->firstcpu ), | |
| 316 | 316 | if ( mc6846->csr0_to_be_cleared ) |
| 317 | 317 | { |
| 318 | 318 | mc6846->csr &= ~1; |
| r10315 | r10316 | |
| 353 | 353 | "latcged,pos-edge", "latcged,pos-edge,intr" |
| 354 | 354 | }; |
| 355 | 355 | LOG (( "$%04x %f: mc6846 PCR write $%02X reset=%i cp2=%s cp1=%s\n", |
| 356 | cpu_get_previouspc( device->machine->firstcpu ), | |
| 356 | cpu_get_previouspc( device->machine->firstcpu ), | |
| 357 | 357 | (data >> 7) & 1, cp2[ (data >> 3) & 7 ], cp1[ data & 7 ] )); |
| 358 | 358 | |
| 359 | 359 | } |
| r10315 | r10316 | |
| 381 | 381 | break; |
| 382 | 382 | |
| 383 | 383 | case 2: |
| 384 | LOG (( "$%04x %f: mc6846 DDR write $%02X\n", cpu_get_previouspc( device->machine->firstcpu ), | |
| 384 | LOG (( "$%04x %f: mc6846 DDR write $%02X\n", cpu_get_previouspc( device->machine->firstcpu ), | |
| 385 | 385 | if ( ! (mc6846->pcr & 0x80) ) |
| 386 | 386 | { |
| 387 | 387 | mc6846->ddr = data; |
| r10315 | r10316 | |
| 391 | 391 | break; |
| 392 | 392 | |
| 393 | 393 | case 3: |
| 394 | LOG (( "$%04x %f: mc6846 PORT write $%02X (mask=$%02X)\n", cpu_get_previouspc( device->machine->firstcpu ), | |
| 394 | LOG (( "$%04x %f: mc6846 PORT write $%02X (mask=$%02X)\n", cpu_get_previouspc( device->machine->firstcpu ), | |
| 395 | 395 | if ( ! (mc6846->pcr & 0x80) ) |
| 396 | 396 | { |
| 397 | 397 | mc6846->pdr = data; |
| r10315 | r10316 | |
| 400 | 400 | if ( mc6846->csr1_to_be_cleared && (mc6846->csr & 2) ) |
| 401 | 401 | { |
| 402 | 402 | mc6846->csr &= ~2; |
| 403 | LOG (( "$%04x %f: mc6846 CP1 intr reset\n", cpu_get_previouspc( device->machine->firstcpu ), | |
| 403 | LOG (( "$%04x %f: mc6846 CP1 intr reset\n", cpu_get_previouspc( device->machine->firstcpu ), | |
| 404 | 404 | } |
| 405 | 405 | if ( mc6846->csr2_to_be_cleared && (mc6846->csr & 4) ) |
| 406 | 406 | { |
| 407 | 407 | mc6846->csr &= ~4; |
| 408 | LOG (( "$%04x %f: mc6846 CP2 intr reset\n", cpu_get_previouspc( device->machine->firstcpu ), | |
| 408 | LOG (( "$%04x %f: mc6846 CP2 intr reset\n", cpu_get_previouspc( device->machine->firstcpu ), | |
| 409 | 409 | } |
| 410 | 410 | mc6846->csr1_to_be_cleared = 0; |
| 411 | 411 | mc6846->csr2_to_be_cleared = 0; |
| r10315 | r10316 | |
| 421 | 421 | "freq-cmp", "freq-cmp", "pulse-cmp", "pulse-cmp" |
| 422 | 422 | }; |
| 423 | 423 | LOG (( "$%04x %f: mc6846 TCR write $%02X reset=%i clock=%s scale=%i mode=%s out=%s\n", |
| 424 | cpu_get_previouspc( device->machine->firstcpu ), | |
| 424 | cpu_get_previouspc( device->machine->firstcpu ), | |
| 425 | 425 | (data >> 7) & 1, (data & 0x40) ? "extern" : "sys", |
| 426 | 426 | (data & 0x40) ? 1 : 8, mode[ (data >> 1) & 7 ], |
| 427 | 427 | (data & 1) ? "enabled" : "0" )); |
| r10315 | r10316 | |
| 455 | 455 | |
| 456 | 456 | case 7: |
| 457 | 457 | mc6846->latch = ( ((UINT16) mc6846->time_MSB) << 8 ) + data; |
| 458 | LOG (( "$%04x %f: mc6846 COUNT write %i\n", cpu_get_previouspc( device->machine->firstcpu ), | |
| 458 | LOG (( "$%04x %f: mc6846 COUNT write %i\n", cpu_get_previouspc( device->machine->firstcpu ), | |
| 459 | 459 | if (!(mc6846->tcr & 0x38)) |
| 460 | 460 | { |
| 461 | 461 | /* timer initialization */ |
| r10315 | r10316 | |
| 488 | 488 | if ( data == mc6846->cp1 ) |
| 489 | 489 | return; |
| 490 | 490 | mc6846->cp1 = data; |
| 491 | LOG (( "%f: mc6846 input CP1 set to %i\n", | |
| 491 | LOG (( "%f: mc6846 input CP1 set to %i\n", | |
| 492 | 492 | if (( data && (mc6846->pcr & 2)) || (!data && !(mc6846->pcr & 2))) |
| 493 | 493 | { |
| 494 | 494 | mc6846->csr |= 2; |
| r10315 | r10316 | |
| 503 | 503 | if ( data == mc6846->cp2 ) |
| 504 | 504 | return; |
| 505 | 505 | mc6846->cp2 = data; |
| 506 | LOG (( "%f: mc6846 input CP2 set to %i\n", | |
| 506 | LOG (( "%f: mc6846 input CP2 set to %i\n", | |
| 507 | 507 | if (mc6846->pcr & 0x20) |
| 508 | 508 | { |
| 509 | 509 | if (( data && (mc6846->pcr & 0x10)) || (!data && !(mc6846->pcr & 0x10))) |
| r10315 | r10316 | |
| 587 | 587 | mc6846_t* mc6846 = get_safe_token( device ); |
| 588 | 588 | |
| 589 | 589 | mc6846->iface = (const mc6846_interface*)device->baseconfig().static_config(); |
| 590 | mc6846->interval = timer_alloc( device->machine, mc6846_timer_expire , (void*) device ); | |
| 591 | mc6846->one_shot = timer_alloc( device->machine, mc6846_timer_one_shot , (void*) device ); | |
| 590 | mc6846->interval = device->machine->scheduler().timer_alloc(FUNC(mc6846_timer_expire), (void*) device ); | |
| 591 | mc6846->one_shot = device->machine->scheduler().timer_alloc(FUNC(mc6846_timer_one_shot), (void*) device ); | |
| 592 | 592 | |
| 593 | 593 | state_save_register_item( device->machine, "mc6846", device->tag(), 0, mc6846->csr ); |
| 594 | 594 | state_save_register_item( device->machine, "mc6846", device->tag(), 0, mc6846->pcr ); |
| r10315 | r10316 | |
|---|---|---|
| 174 | 174 | change_output_lines(); |
| 175 | 175 | |
| 176 | 176 | // allocate timers |
| 177 | m_scan_timer = | |
| 177 | m_scan_timer = | |
| 178 | 178 | timer_adjust_periodic(m_scan_timer, attotime::zero, 0, attotime::from_hz(clock())); |
| 179 | 179 | |
| 180 | 180 | // register for state saving |
| r10315 | r10316 | |
|---|---|---|
| 103 | 103 | if ( bitpos >= to7_k7_bitsize ) |
| 104 | 104 | bitpos = to7_k7_bitsize -1; |
| 105 | 105 | VLOG (( "$%04x %f to7_get_cassette: state=$%X pos=%f samppos=%i bit=%i\n", |
| 106 | cpu_get_previouspc(machine->device("maincpu")), | |
| 106 | cpu_get_previouspc(machine->device("maincpu")), | |
| 107 | 107 | to7_k7_bits[ bitpos ] )); |
| 108 | 108 | return to7_k7_bits[ bitpos ]; |
| 109 | 109 | } |
| r10315 | r10316 | |
| 124 | 124 | } |
| 125 | 125 | k = ( chg >= 13 ) ? 1 : 0; |
| 126 | 126 | VLOG (( "$%04x %f to7_get_cassette: state=$%X pos=%f samppos=%i bit=%i (%i)\n", |
| 127 | cpu_get_previouspc(machine->device("maincpu")), | |
| 127 | cpu_get_previouspc(machine->device("maincpu")), | |
| 128 | 128 | k, chg )); |
| 129 | 129 | return k; |
| 130 | 130 | } |
| r10315 | r10316 | |
| 152 | 152 | double pos = cassette_get_position(img); |
| 153 | 153 | |
| 154 | 154 | LOG (( "$%04x %f to7_set_cassette_motor: cassette motor %s bitpos=%i\n", |
| 155 | cpu_get_previouspc(device->machine->device("maincpu")), | |
| 155 | cpu_get_previouspc(device->machine->device("maincpu")), | |
| 156 | 156 | (int) (pos / TO7_BIT_LENGTH) )); |
| 157 | 157 | |
| 158 | 158 | if ( (state & CASSETTE_MASK_MOTOR) == CASSETTE_MOTOR_DISABLED && !data && pos > 0.3 ) |
| r10315 | r10316 | |
| 203 | 203 | hbit = hbit >= 0; |
| 204 | 204 | |
| 205 | 205 | VLOG (( "$%04x %f mo5_get_cassette: state=$%X pos=%f hbitpos=%i hbit=%i\n", |
| 206 | cpu_get_previouspc(machine->device("maincpu")), | |
| 206 | cpu_get_previouspc(machine->device("maincpu")), | |
| 207 | 207 | (int) (pos / MO5_HBIT_LENGTH), hbit )); |
| 208 | 208 | return hbit; |
| 209 | 209 | } |
| r10315 | r10316 | |
| 228 | 228 | double pos = cassette_get_position(img); |
| 229 | 229 | |
| 230 | 230 | LOG (( "$%04x %f mo5_set_cassette_motor: cassette motor %s hbitpos=%i\n", |
| 231 | cpu_get_previouspc(device->machine->device("maincpu")), | |
| 231 | cpu_get_previouspc(device->machine->device("maincpu")), | |
| 232 | 232 | (int) (pos / MO5_HBIT_LENGTH) )); |
| 233 | 233 | |
| 234 | 234 | if ( (state & CASSETTE_MASK_MOTOR) == CASSETTE_MOTOR_DISABLED && !data && pos > 0.3 ) |
| r10315 | r10316 | |
| 268 | 268 | thom_irq &= ~(1 << line); |
| 269 | 269 | |
| 270 | 270 | if ( !old && thom_irq ) |
| 271 | LOG_IRQ(( "%f thom_set_irq: irq line up %i\n", | |
| 271 | LOG_IRQ(( "%f thom_set_irq: irq line up %i\n", | |
| 272 | 272 | if ( old && !thom_irq ) |
| 273 | LOG_IRQ(( "%f thom_set_irq: irq line down %i\n", | |
| 273 | LOG_IRQ(( "%f thom_set_irq: irq line down %i\n", | |
| 274 | 274 | |
| 275 | 275 | cputag_set_input_line(machine, "maincpu", M6809_IRQ_LINE, thom_irq ? ASSERT_LINE : CLEAR_LINE); |
| 276 | 276 | } |
| r10315 | r10316 | |
| 287 | 287 | thom_firq &= ~(1 << line); |
| 288 | 288 | |
| 289 | 289 | if ( !old && thom_firq ) |
| 290 | LOG_IRQ(( "%f thom_set_firq: firq line up %i\n", | |
| 290 | LOG_IRQ(( "%f thom_set_firq: firq line up %i\n", | |
| 291 | 291 | if ( old && !thom_firq ) |
| 292 | LOG_IRQ(( "%f thom_set_firq: firq line down %i\n", | |
| 292 | LOG_IRQ(( "%f thom_set_firq: firq line down %i\n", | |
| 293 | 293 | |
| 294 | 294 | cputag_set_input_line(machine, "maincpu", M6809_FIRQ_LINE, thom_firq ? ASSERT_LINE : CLEAR_LINE); |
| 295 | 295 | } |
| r10315 | r10316 | |
| 644 | 644 | if ( ! to7_lightpen ) |
| 645 | 645 | return; |
| 646 | 646 | |
| 647 | LOG_VIDEO(( "%f to7_lightpen_cb: step=%i\n", | |
| 647 | LOG_VIDEO(( "%f to7_lightpen_cb: step=%i\n", | |
| 648 | 648 | pia6821_cb1_w( sys_pia, 1 ); |
| 649 | 649 | pia6821_cb1_w( sys_pia, 0 ); |
| 650 | 650 | to7_lightpen_step = step; |
| r10315 | r10316 | |
| 661 | 661 | device_t *sys_pia = machine->device( THOM_PIA_SYS ); |
| 662 | 662 | /* INIT signal wired to system PIA 6821 */ |
| 663 | 663 | |
| 664 | LOG_VIDEO(( "%f to7_set_init: init=%i\n", | |
| 664 | LOG_VIDEO(( "%f to7_set_init: init=%i\n", | |
| 665 | 665 | pia6821_ca1_w( sys_pia, init ); |
| 666 | 666 | } |
| 667 | 667 | |
| r10315 | r10316 | |
| 787 | 787 | device_t *io_pia = device->machine->device( THOM_PIA_IO ); |
| 788 | 788 | |
| 789 | 789 | pia6821_cb1_w( io_pia, state); |
| 790 | //LOG_IO (( "%f to7_io_ack: CENTRONICS new state $%02X (ack=%i)\n", | |
| 790 | //LOG_IO (( "%f to7_io_ack: CENTRONICS new state $%02X (ack=%i)\n", | |
| 791 | 791 | } |
| 792 | 792 | |
| 793 | 793 | |
| r10315 | r10316 | |
| 797 | 797 | int tx = data & 1; |
| 798 | 798 | int dtr = ( data & 2 ) ? 1 : 0; |
| 799 | 799 | |
| 800 | LOG_IO(( "$%04x %f to7_io_porta_out: tx=%i, dtr=%i\n", cpu_get_previouspc(device->machine->device("maincpu")), | |
| 800 | LOG_IO(( "$%04x %f to7_io_porta_out: tx=%i, dtr=%i\n", cpu_get_previouspc(device->machine->device("maincpu")), | |
| 801 | 801 | if ( dtr ) |
| 802 | 802 | to7_io_line.State |= SERIAL_STATE_DTR; |
| 803 | 803 | else |
| r10315 | r10316 | |
| 821 | 821 | else |
| 822 | 822 | cts = !centronics_busy_r(printer); |
| 823 | 823 | |
| 824 | LOG_IO(( "$%04x %f to7_io_porta_in: mode=%i cts=%i, dsr=%i, rd=%i\n", cpu_get_previouspc(device->machine->device("maincpu")), | |
| 824 | LOG_IO(( "$%04x %f to7_io_porta_in: mode=%i cts=%i, dsr=%i, rd=%i\n", cpu_get_previouspc(device->machine->device("maincpu")), | |
| 825 | 825 | |
| 826 | 826 | return (dsr ? 0x20 : 0) | (cts ? 0x40 : 0) | (rd ? 0x80: 0); |
| 827 | 827 | } |
| r10315 | r10316 | |
| 832 | 832 | { |
| 833 | 833 | device_t *printer = device->machine->device("centronics"); |
| 834 | 834 | |
| 835 | LOG_IO(( "$%04x %f to7_io_portb_out: CENTRONICS set data=$%02X\n", cpu_get_previouspc(device->machine->device("maincpu")), | |
| 835 | LOG_IO(( "$%04x %f to7_io_portb_out: CENTRONICS set data=$%02X\n", cpu_get_previouspc(device->machine->device("maincpu")), | |
| 836 | 836 | |
| 837 | 837 | /* set 8-bit data */ |
| 838 | 838 | centronics_data_w(printer, 0, data); |
| r10315 | r10316 | |
| 844 | 844 | { |
| 845 | 845 | device_t *printer = device->machine->device("centronics"); |
| 846 | 846 | |
| 847 | LOG_IO(( "$%04x %f to7_io_cb2_out: CENTRONICS set strobe=%i\n", cpu_get_previouspc(device->machine->device("maincpu")), | |
| 847 | LOG_IO(( "$%04x %f to7_io_cb2_out: CENTRONICS set strobe=%i\n", cpu_get_previouspc(device->machine->device("maincpu")), | |
| 848 | 848 | |
| 849 | 849 | /* send STROBE to printer */ |
| 850 | 850 | centronics_strobe_w(printer, data); |
| r10315 | r10316 | |
| 857 | 857 | /* our peer's state has changed */ |
| 858 | 858 | to7_io_line.input_state = state; |
| 859 | 859 | |
| 860 | LOG_IO(( "%f to7_io_in_callback: cts=%i dsr=%i rd=%i\n", | |
| 860 | LOG_IO(( "%f to7_io_in_callback: cts=%i dsr=%i rd=%i\n", | |
| 861 | 861 | } |
| 862 | 862 | |
| 863 | 863 | |
| r10315 | r10316 | |
| 1246 | 1246 | static void to7_game_init ( running_machine *machine ) |
| 1247 | 1247 | { |
| 1248 | 1248 | LOG (( "to7_game_init called\n" )); |
| 1249 | to7_game_timer = timer_alloc( | |
| 1249 | to7_game_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1250 | 1250 | timer_adjust_periodic(to7_game_timer, TO7_GAME_POLL_PERIOD, 0, TO7_GAME_POLL_PERIOD); |
| 1251 | 1251 | state_save_register_global( machine, to7_game_sound ); |
| 1252 | 1252 | state_save_register_global( machine, to7_game_mute ); |
| r10315 | r10316 | |
| 1355 | 1355 | /* bit 6: parity error (ignored) */ |
| 1356 | 1356 | /* bit 7: interrupt */ |
| 1357 | 1357 | LOG_MIDI(( "$%04x %f to7_midi_r: status $%02X (rdrf=%i, tdre=%i, ovrn=%i, irq=%i)\n", |
| 1358 | cpu_get_previouspc(space->machine->device("maincpu")), | |
| 1358 | cpu_get_previouspc(space->machine->device("maincpu")), | |
| 1359 | 1359 | (to7_midi_status & ACIA_6850_RDRF) ? 1 : 0, |
| 1360 | 1360 | (to7_midi_status & ACIA_6850_TDRE) ? 1 : 0, |
| 1361 | 1361 | (to7_midi_status & ACIA_6850_OVRN) ? 1 : 0, |
| r10315 | r10316 | |
| 1373 | 1373 | to7_midi_status &= ~ACIA_6850_OVRN; |
| 1374 | 1374 | to7_midi_overrun = 0; |
| 1375 | 1375 | LOG_MIDI(( "$%04x %f to7_midi_r: read data $%02X\n", |
| 1376 | cpu_get_previouspc(space->machine->device("maincpu")), | |
| 1376 | cpu_get_previouspc(space->machine->device("maincpu")), | |
| 1377 | 1377 | to7_midi_update_irq( space->machine ); |
| 1378 | 1378 | return data; |
| 1379 | 1379 | } |
| r10315 | r10316 | |
| 1400 | 1400 | if ( (data & 3) == 3 ) |
| 1401 | 1401 | { |
| 1402 | 1402 | /* reset */ |
| 1403 | LOG_MIDI(( "$%04x %f to7_midi_w: reset (data=$%02X)\n", cpu_get_previouspc(space->machine->device("maincpu")), | |
| 1403 | LOG_MIDI(( "$%04x %f to7_midi_w: reset (data=$%02X)\n", cpu_get_previouspc(space->machine->device("maincpu")), | |
| 1404 | 1404 | to7_midi_overrun = 0; |
| 1405 | 1405 | to7_midi_status = 2; |
| 1406 | 1406 | to7_midi_intr = 0; |
| r10315 | r10316 | |
| 1417 | 1417 | static const int stop[8] = { 2,2,1,1,2,1,1,1 }; |
| 1418 | 1418 | static const char parity[8] = { 'e','o','e','o','-','-','e','o' }; |
| 1419 | 1419 | LOG_MIDI(( "$%04x %f to7_midi_w: set control to $%02X (bits=%i, stop=%i, parity=%c, intr in=%i out=%i)\n", |
| 1420 | cpu_get_previouspc(space->machine->device("maincpu")), | |
| 1420 | cpu_get_previouspc(space->machine->device("maincpu")), | |
| 1421 | 1421 | data, |
| 1422 | 1422 | bits[ (data >> 2) & 7 ], |
| 1423 | 1423 | stop[ (data >> 2) & 7 ], |
| r10315 | r10316 | |
| 1431 | 1431 | |
| 1432 | 1432 | |
| 1433 | 1433 | case 1: /* output data */ |
| 1434 | LOG_MIDI(( "$%04x %f to7_midi_w: write data $%02X\n", cpu_get_previouspc(space->machine->device("maincpu")), | |
| 1434 | LOG_MIDI(( "$%04x %f to7_midi_w: write data $%02X\n", cpu_get_previouspc(space->machine->device("maincpu")), | |
| 1435 | 1435 | if ( data == 0x55 ) |
| 1436 | 1436 | /* cable-detect: shortcut */ |
| 1437 | 1437 | chardev_fake_in( to7_midi_chardev, 0x55 ); |
| r10315 | r10316 | |
| 2199 | 2199 | to7_io_init(machine); |
| 2200 | 2200 | to7_modem_init(machine); |
| 2201 | 2201 | to7_midi_init(machine); |
| 2202 | mo5_periodic_timer = timer_alloc( | |
| 2202 | mo5_periodic_timer = machine->scheduler().timer_alloc(FUNC(m | |
| 2203 | 2203 | |
| 2204 | 2204 | /* memory */ |
| 2205 | 2205 | thom_cart_bank = 0; |
| r10315 | r10316 | |
| 2239 | 2239 | |
| 2240 | 2240 | WRITE8_HANDLER ( to9_ieee_w ) |
| 2241 | 2241 | { |
| 2242 | logerror( "$%04x %f to9_ieee_w: unhandled write $%02X to register %i\n", cpu_get_previouspc(space->machine->device("maincpu")), | |
| 2242 | logerror( "$%04x %f to9_ieee_w: unhandled write $%02X to register %i\n", cpu_get_previouspc(space->machine->device("maincpu")), | |
| 2243 | 2243 | } |
| 2244 | 2244 | |
| 2245 | 2245 | |
| 2246 | 2246 | |
| 2247 | 2247 | READ8_HANDLER ( to9_ieee_r ) |
| 2248 | 2248 | { |
| 2249 | logerror( "$%04x %f to9_ieee_r: unhandled read from register %i\n", cpu_get_previouspc(space->machine->device("maincpu")), | |
| 2249 | logerror( "$%04x %f to9_ieee_r: unhandled read from register %i\n", cpu_get_previouspc(space->machine->device("maincpu")), | |
| 2250 | 2250 | return 0; |
| 2251 | 2251 | } |
| 2252 | 2252 | |
| r10315 | r10316 | |
| 2372 | 2372 | |
| 2373 | 2373 | WRITE8_HANDLER ( to9_vreg_w ) |
| 2374 | 2374 | { |
| 2375 | LOG_VIDEO(( "$%04x %f to9_vreg_w: off=%i ($%04X) data=$%02X\n", cpu_get_previouspc(space->machine->device("maincpu")), | |
| 2375 | LOG_VIDEO(( "$%04x %f to9_vreg_w: off=%i ($%04X) data=$%02X\n", cpu_get_previouspc(space->machine->device("maincpu")), | |
| 2376 | 2376 | |
| 2377 | 2377 | switch ( offset ) |
| 2378 | 2378 | { |
| r10315 | r10316 | |
| 2670 | 2670 | /* bit 7: interrupt */ |
| 2671 | 2671 | |
| 2672 | 2672 | LOG_KBD(( "$%04x %f to9_kbd_r: status $%02X (rdrf=%i, tdre=%i, ovrn=%i, pe=%i, irq=%i)\n", |
| 2673 | cpu_get_previouspc(space->machine->device("maincpu")), | |
| 2673 | cpu_get_previouspc(space->machine->device("maincpu")), | |
| 2674 | 2674 | (to9_kbd_status & ACIA_6850_RDRF) ? 1 : 0, |
| 2675 | 2675 | (to9_kbd_status & ACIA_6850_TDRE) ? 1 : 0, |
| 2676 | 2676 | (to9_kbd_status & ACIA_6850_OVRN) ? 1 : 0, |
| r10315 | r10316 | |
| 2685 | 2685 | else |
| 2686 | 2686 | to9_kbd_status &= ~(ACIA_6850_OVRN | ACIA_6850_RDRF); |
| 2687 | 2687 | to9_kbd_overrun = 0; |
| 2688 | LOG_KBD(( "$%04x %f to9_kbd_r: read data $%02X\n", cpu_get_previouspc(space->machine->device("maincpu")), | |
| 2688 | LOG_KBD(( "$%04x %f to9_kbd_r: read data $%02X\n", cpu_get_previouspc(space->machine->device("maincpu")), | |
| 2689 | 2689 | to9_kbd_update_irq(space->machine); |
| 2690 | 2690 | return to9_kbd_in; |
| 2691 | 2691 | |
| r10315 | r10316 | |
| 2712 | 2712 | to9_kbd_overrun = 0; |
| 2713 | 2713 | to9_kbd_status = ACIA_6850_TDRE; |
| 2714 | 2714 | to9_kbd_intr = 0; |
| 2715 | LOG_KBD(( "$%04x %f to9_kbd_w: reset (data=$%02X)\n", cpu_get_previouspc(space->machine->device("maincpu")), | |
| 2715 | LOG_KBD(( "$%04x %f to9_kbd_w: reset (data=$%02X)\n", cpu_get_previouspc(space->machine->device("maincpu")), | |
| 2716 | 2716 | } |
| 2717 | 2717 | else |
| 2718 | 2718 | { |
| r10315 | r10316 | |
| 2726 | 2726 | to9_kbd_intr = data >> 5; |
| 2727 | 2727 | |
| 2728 | 2728 | LOG_KBD(( "$%04x %f to9_kbd_w: set control to $%02X (parity=%i, intr in=%i out=%i)\n", |
| 2729 | cpu_get_previouspc(space->machine->device("maincpu")), | |
| 2729 | cpu_get_previouspc(space->machine->device("maincpu")), | |
| 2730 | 2730 | data, to9_kbd_parity, to9_kbd_intr >> 2, |
| 2731 | 2731 | (to9_kbd_intr & 3) ? 1 : 0 )); |
| 2732 | 2732 | } |
| r10315 | r10316 | |
| 2757 | 2757 | case 0xFE: to9_kbd_periph = 0; break; |
| 2758 | 2758 | |
| 2759 | 2759 | default: |
| 2760 | logerror( "$%04x %f to9_kbd_w: unknown kbd command %02X\n", cpu_get_previouspc(space->machine->device("maincpu")), | |
| 2760 | logerror( "$%04x %f to9_kbd_w: unknown kbd command %02X\n", cpu_get_previouspc(space->machine->device("maincpu")), | |
| 2761 | 2761 | } |
| 2762 | 2762 | |
| 2763 | 2763 | thom_set_caps_led( space->machine, !to9_kbd_caps ); |
| 2764 | 2764 | |
| 2765 | 2765 | LOG(( "$%04x %f to9_kbd_w: kbd command %02X (caps=%i, pad=%i, periph=%i)\n", |
| 2766 | cpu_get_previouspc(space->machine->device("maincpu")), | |
| 2766 | cpu_get_previouspc(space->machine->device("maincpu")), | |
| 2767 | 2767 | to9_kbd_caps, to9_kbd_pad, to9_kbd_periph )); |
| 2768 | 2768 | |
| 2769 | 2769 | break; |
| r10315 | r10316 | |
| 2785 | 2785 | { |
| 2786 | 2786 | /* overrun will be set when the current valid byte is read */ |
| 2787 | 2787 | to9_kbd_overrun = 1; |
| 2788 | LOG_KBD(( "%f to9_kbd_send: overrun => drop data=$%02X, parity=%i\n", | |
| 2788 | LOG_KBD(( "%f to9_kbd_send: overrun => drop data=$%02X, parity=%i\n", | |
| 2789 | 2789 | } |
| 2790 | 2790 | else |
| 2791 | 2791 | { |
| r10315 | r10316 | |
| 2796 | 2796 | to9_kbd_status &= ~ACIA_6850_PE; /* parity OK */ |
| 2797 | 2797 | else |
| 2798 | 2798 | to9_kbd_status |= ACIA_6850_PE; /* parity error */ |
| 2799 | LOG_KBD(( "%f to9_kbd_send: data=$%02X, parity=%i, status=$%02X\n", | |
| 2799 | LOG_KBD(( "%f to9_kbd_send: data=$%02X, parity=%i, status=$%02X\n", | |
| 2800 | 2800 | } |
| 2801 | 2801 | to9_kbd_update_irq(machine); |
| 2802 | 2802 | } |
| r10315 | r10316 | |
| 3012 | 3012 | static void to9_kbd_init ( running_machine *machine ) |
| 3013 | 3013 | { |
| 3014 | 3014 | LOG(( "to9_kbd_init called\n" )); |
| 3015 | to9_kbd_timer = timer_alloc( | |
| 3015 | to9_kbd_timer = machine->scheduler().timer_alloc(FUNC( | |
| 3016 | 3016 | state_save_register_global( machine, to9_kbd_parity ); |
| 3017 | 3017 | state_save_register_global( machine, to9_kbd_intr ); |
| 3018 | 3018 | state_save_register_global( machine, to9_kbd_in ); |
| r10315 | r10316 | |
| 3357 | 3357 | { |
| 3358 | 3358 | attotime d; |
| 3359 | 3359 | |
| 3360 | LOG_KBD(( "%f to8_kbd_timer_cb: step=%i ack=%i data=$%03X\n", | |
| 3360 | LOG_KBD(( "%f to8_kbd_timer_cb: step=%i ack=%i data=$%03X\n", | |
| 3361 | 3361 | |
| 3362 | 3362 | if( ! to8_kbd_step ) |
| 3363 | 3363 | { |
| r10315 | r10316 | |
| 3442 | 3442 | if ( data ) |
| 3443 | 3443 | { |
| 3444 | 3444 | double len = timer_timeelapsed( to8_kbd_signal).as_double() * 1000. - 2.; |
| 3445 | LOG_KBD(( "%f to8_kbd_set_ack: CPU end ack, len=%f\n", | |
| 3445 | LOG_KBD(( "%f to8_kbd_set_ack: CPU end ack, len=%f\n", | |
| 3446 | 3446 | if ( to8_kbd_data == 0xfff ) |
| 3447 | 3447 | { |
| 3448 | 3448 | /* end signal from CPU */ |
| 3449 | 3449 | if ( len >= 0.6 && len <= 0.8 ) |
| 3450 | 3450 | { |
| 3451 | LOG (( "%f to8_kbd_set_ack: INIT signal\n", | |
| 3451 | LOG (( "%f to8_kbd_set_ack: INIT signal\n", | |
| 3452 | 3452 | to8_kbd_last_key = 0xff; |
| 3453 | 3453 | to8_kbd_key_count = 0; |
| 3454 | 3454 | to8_kbd_caps = 1; |
| r10315 | r10316 | |
| 3463 | 3463 | timer_adjust_oneshot(to8_kbd_timer, TO8_KBD_POLL_PERIOD, 0); |
| 3464 | 3464 | if ( len >= 1.2 && len <= 1.4 ) |
| 3465 | 3465 | { |
| 3466 | LOG (( "%f to8_kbd_set_ack: CAPS on signal\n", | |
| 3466 | LOG (( "%f to8_kbd_set_ack: CAPS on signal\n", | |
| 3467 | 3467 | to8_kbd_caps = 1; |
| 3468 | 3468 | } |
| 3469 | 3469 | else if ( len >= 1.8 && len <= 2.0 ) |
| 3470 | 3470 | { |
| 3471 | LOG (( "%f to8_kbd_set_ack: CAPS off signal\n", | |
| 3471 | LOG (( "%f to8_kbd_set_ack: CAPS off signal\n", | |
| 3472 | 3472 | to8_kbd_caps = 0; |
| 3473 | 3473 | } |
| 3474 | 3474 | } |
| r10315 | r10316 | |
| 3498 | 3498 | timer_adjust_oneshot(to8_kbd_timer, attotime::from_usec( 400 ), 0); |
| 3499 | 3499 | timer_adjust_oneshot(to8_kbd_signal, attotime::never, 0); |
| 3500 | 3500 | } |
| 3501 | LOG_KBD(( "%f to8_kbd_set_ack: CPU ack, data=$%03X\n", | |
| 3501 | LOG_KBD(( "%f to8_kbd_set_ack: CPU ack, data=$%03X\n", | |
| 3502 | 3502 | } |
| 3503 | 3503 | } |
| 3504 | 3504 | |
| r10315 | r10316 | |
| 3520 | 3520 | |
| 3521 | 3521 | static void to8_kbd_init ( running_machine *machine ) |
| 3522 | 3522 | { |
| 3523 | to8_kbd_timer = timer_alloc( machine, to8_kbd_timer_cb , NULL); | |
| 3524 | to8_kbd_signal = timer_alloc( machine, NULL , NULL); | |
| 3523 | to8_kbd_timer = machine->scheduler().timer_alloc(FUNC(to8_kbd_timer_cb)); | |
| 3524 | to8_kbd_signal = machine->scheduler().timer_alloc(FUNC(NULL)); | |
| 3525 | 3525 | state_save_register_global( machine, to8_kbd_ack ); |
| 3526 | 3526 | state_save_register_global( machine, to8_kbd_data ); |
| 3527 | 3527 | state_save_register_global( machine, to8_kbd_step ); |
| r10315 | r10316 | |
| 3839 | 3839 | } |
| 3840 | 3840 | |
| 3841 | 3841 | LOG_VIDEO(( "$%04x %f to8_gatearray_r: off=%i ($%04X) res=$%02X lightpen=%i\n", |
| 3842 | cpu_get_previouspc(space->machine->device("maincpu")), | |
| 3842 | cpu_get_previouspc(space->machine->device("maincpu")), | |
| 3843 | 3843 | offset, 0xe7e4 + offset, res, to7_lightpen )); |
| 3844 | 3844 | |
| 3845 | 3845 | return res; |
| r10315 | r10316 | |
| 3850 | 3850 | WRITE8_HANDLER ( to8_gatearray_w ) |
| 3851 | 3851 | { |
| 3852 | 3852 | LOG_VIDEO(( "$%04x %f to8_gatearray_w: off=%i ($%04X) data=$%02X\n", |
| 3853 | cpu_get_previouspc(space->machine->device("maincpu")), | |
| 3853 | cpu_get_previouspc(space->machine->device("maincpu")), | |
| 3854 | 3854 | offset, 0xe7e4 + offset, data )); |
| 3855 | 3855 | |
| 3856 | 3856 | switch ( offset ) |
| r10315 | r10316 | |
| 3931 | 3931 | WRITE8_HANDLER ( to8_vreg_w ) |
| 3932 | 3932 | { |
| 3933 | 3933 | LOG_VIDEO(( "$%04x %f to8_vreg_w: off=%i ($%04X) data=$%02X\n", |
| 3934 | cpu_get_previouspc(space->machine->device("maincpu")), | |
| 3934 | cpu_get_previouspc(space->machine->device("maincpu")), | |
| 3935 | 3935 | offset, 0xe7da + offset, data )); |
| 3936 | 3936 | |
| 3937 | 3937 | switch ( offset ) |
| r10315 | r10316 | |
| 3987 | 3987 | { |
| 3988 | 3988 | int ktest = to8_kbd_ktest (device->machine); |
| 3989 | 3989 | |
| 3990 | LOG_KBD(( "$%04x %f: to8_sys_porta_in ktest=%i\n", cpu_get_previouspc(device->machine->device("maincpu")), | |
| 3990 | LOG_KBD(( "$%04x %f: to8_sys_porta_in ktest=%i\n", cpu_get_previouspc(device->machine->device("maincpu")), | |
| 3991 | 3991 | |
| 3992 | 3992 | return ktest; |
| 3993 | 3993 | } |
| r10315 | r10316 | |
| 4554 | 4554 | { |
| 4555 | 4555 | device_t *printer = device->machine->device("centronics"); |
| 4556 | 4556 | |
| 4557 | LOG (( "$%04x %f mo6_game_porta_out: CENTRONICS set data=$%02X\n", cpu_get_previouspc(device->machine->device("maincpu")), | |
| 4557 | LOG (( "$%04x %f mo6_game_porta_out: CENTRONICS set data=$%02X\n", cpu_get_previouspc(device->machine->device("maincpu")), | |
| 4558 | 4558 | |
| 4559 | 4559 | /* centronics data */ |
| 4560 | 4560 | centronics_data_w(printer, 0, data); |
| r10315 | r10316 | |
| 4566 | 4566 | { |
| 4567 | 4567 | device_t *printer = device->machine->device("centronics"); |
| 4568 | 4568 | |
| 4569 | LOG (( "$%04x %f mo6_game_cb2_out: CENTRONICS set strobe=%i\n", cpu_get_previouspc(device->machine->device("maincpu")), | |
| 4569 | LOG (( "$%04x %f mo6_game_cb2_out: CENTRONICS set strobe=%i\n", cpu_get_previouspc(device->machine->device("maincpu")), | |
| 4570 | 4570 | |
| 4571 | 4571 | /* centronics strobe */ |
| 4572 | 4572 | centronics_strobe_w(printer, data); |
| r10315 | r10316 | |
| 4617 | 4617 | static void mo6_game_init ( running_machine *machine ) |
| 4618 | 4618 | { |
| 4619 | 4619 | LOG (( "mo6_game_init called\n" )); |
| 4620 | to7_game_timer = timer_alloc( | |
| 4620 | to7_game_timer = machine->scheduler().timer_alloc(FUNC(m | |
| 4621 | 4621 | timer_adjust_periodic(to7_game_timer, TO7_GAME_POLL_PERIOD, 0, TO7_GAME_POLL_PERIOD); |
| 4622 | 4622 | state_save_register_global( machine, to7_game_sound ); |
| 4623 | 4623 | state_save_register_global( machine, to7_game_mute ); |
| r10315 | r10316 | |
| 4774 | 4774 | } |
| 4775 | 4775 | |
| 4776 | 4776 | LOG_VIDEO(( "$%04x %f mo6_gatearray_r: off=%i ($%04X) res=$%02X lightpen=%i\n", |
| 4777 | cpu_get_previouspc(space->machine->device("maincpu")), | |
| 4777 | cpu_get_previouspc(space->machine->device("maincpu")), | |
| 4778 | 4778 | offset, 0xa7e4 + offset, res, to7_lightpen )); |
| 4779 | 4779 | |
| 4780 | 4780 | return res; |
| r10315 | r10316 | |
| 4785 | 4785 | WRITE8_HANDLER ( mo6_gatearray_w ) |
| 4786 | 4786 | { |
| 4787 | 4787 | LOG_VIDEO(( "$%04x %f mo6_gatearray_w: off=%i ($%04X) data=$%02X\n", |
| 4788 | cpu_get_previouspc(space->machine->device("maincpu")), | |
| 4788 | cpu_get_previouspc(space->machine->device("maincpu")), | |
| 4789 | 4789 | offset, 0xa7e4 + offset, data )); |
| 4790 | 4790 | |
| 4791 | 4791 | switch ( offset ) |
| r10315 | r10316 | |
| 4852 | 4852 | WRITE8_HANDLER ( mo6_vreg_w ) |
| 4853 | 4853 | { |
| 4854 | 4854 | LOG_VIDEO(( "$%04x %f mo6_vreg_w: off=%i ($%04X) data=$%02X\n", |
| 4855 | cpu_get_previouspc(space->machine->device("maincpu")), | |
| 4855 | cpu_get_previouspc(space->machine->device("maincpu")), | |
| 4856 | 4856 | offset, 0xa7da + offset, data )); |
| 4857 | 4857 | |
| 4858 | 4858 | switch ( offset ) |
| r10315 | r10316 | |
| 4949 | 4949 | to9_palette_init(machine); |
| 4950 | 4950 | to7_modem_init(machine); |
| 4951 | 4951 | to7_midi_init(machine); |
| 4952 | mo5_periodic_timer = timer_alloc( | |
| 4952 | mo5_periodic_timer = machine->scheduler().timer_alloc(FUNC(m | |
| 4953 | 4953 | |
| 4954 | 4954 | /* memory */ |
| 4955 | 4955 | thom_cart_bank = 0; |
| r10315 | r10316 | |
| 5006 | 5006 | if ( to7_controller_type ) |
| 5007 | 5007 | return to7_floppy_r ( space, offset ); |
| 5008 | 5008 | |
| 5009 | logerror( "$%04x %f mo5nr_net_r: read from reg %i\n", cpu_get_previouspc(space->machine->device("maincpu")), | |
| 5009 | logerror( "$%04x %f mo5nr_net_r: read from reg %i\n", cpu_get_previouspc(space->machine->device("maincpu")), | |
| 5010 | 5010 | |
| 5011 | 5011 | return 0; |
| 5012 | 5012 | } |
| r10315 | r10316 | |
| 5019 | 5019 | to7_floppy_w ( space, offset, data ); |
| 5020 | 5020 | else |
| 5021 | 5021 | logerror( "$%04x %f mo5nr_net_w: write $%02X to reg %i\n", |
| 5022 | cpu_get_previouspc(space->machine->device("maincpu")), | |
| 5022 | cpu_get_previouspc(space->machine->device("maincpu")), | |
| 5023 | 5023 | } |
| 5024 | 5024 | |
| 5025 | 5025 | |
| r10315 | r10316 | |
| 5130 | 5130 | static void mo5nr_game_init ( running_machine* machine ) |
| 5131 | 5131 | { |
| 5132 | 5132 | LOG (( "mo5nr_game_init called\n" )); |
| 5133 | to7_game_timer = timer_alloc( | |
| 5133 | to7_game_timer = machine->scheduler().timer_alloc(FUNC(m | |
| 5134 | 5134 | timer_adjust_periodic( to7_game_timer, TO7_GAME_POLL_PERIOD, 0, TO7_GAME_POLL_PERIOD ); |
| 5135 | 5135 | state_save_register_global( machine, to7_game_sound ); |
| 5136 | 5136 | state_save_register_global( machine, to7_game_mute ); |
| r10315 | r10316 | |
| 5209 | 5209 | to9_palette_init(machine); |
| 5210 | 5210 | to7_modem_init(machine); |
| 5211 | 5211 | to7_midi_init(machine); |
| 5212 | mo5_periodic_timer = timer_alloc( | |
| 5212 | mo5_periodic_timer = machine->scheduler().timer_alloc(FUNC(m | |
| 5213 | 5213 | |
| 5214 | 5214 | /* memory */ |
| 5215 | 5215 | thom_cart_bank = 0; |
| r10315 | r10316 | |
|---|---|---|
| 225 | 225 | memset(scc, 0, sizeof(*scc)); |
| 226 | 226 | scc->clock = device->clock(); |
| 227 | 227 | |
| 228 | scc->channel[0].baudtimer = timer_alloc(device->machine, scc8530_baud_expire, (void *)device); | |
| 229 | scc->channel[1].baudtimer = timer_alloc(device->machine, scc8530_baud_expire, (void *)device); | |
| 228 | scc->channel[0].baudtimer = device->machine->scheduler().timer_alloc(FUNC(scc8530_baud_expire), (void *)device); | |
| 229 | scc->channel[1].baudtimer = device->machine->scheduler().timer_alloc(FUNC(scc8530_baud_expire), (void *)device); | |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 |
| r10315 | r10316 | |
|---|---|---|
| 866 | 866 | DIRECT_UPDATE_HANDLER(pmd85_opbaseoverride) |
| 867 | 867 | { |
| 868 | 868 | if (input_port_read(machine, "RESET") & 0x01) |
| 869 | timer_set( | |
| 869 | machine->scheduler().timer_set( | |
| 870 | 870 | return address; |
| 871 | 871 | } |
| 872 | 872 | |
| r10315 | r10316 | |
| 875 | 875 | pmd85_state *state = machine->driver_data<pmd85_state>(); |
| 876 | 876 | state->previous_level = 0; |
| 877 | 877 | state->clk_level = state->clk_level_tape = 1; |
| 878 | state->cassette_timer = timer_alloc( | |
| 878 | state->cassette_timer = machine->scheduler().timer_alloc(FUNC( | |
| 879 | 879 | timer_adjust_periodic(state->cassette_timer, attotime::zero, 0, attotime::from_hz(2400)); |
| 880 | 880 | |
| 881 | 881 | serial_connection_init(machine, &state->cassette_serial_connection); |
| r10315 | r10316 | |
| 968 | 968 | state->startup_mem_map = 1; |
| 969 | 969 | state->update_memory(machine); |
| 970 | 970 | |
| 971 | timer_set( | |
| 971 | machine->scheduler().timer_set( | |
| 972 | 972 | |
| 973 | 973 | cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(pmd85_opbaseoverride, *machine)); |
| 974 | 974 | } |
| r10315 | r10316 | |
|---|---|---|
| 510 | 510 | if (length) |
| 511 | 511 | { |
| 512 | 512 | kbd->control_status &= 0xfb; |
| 513 | timer_set( | |
| 513 | machine->scheduler().timer_set( | |
| 514 | 514 | beep_set_state(kbd->beeper, 1); |
| 515 | 515 | } |
| 516 | 516 | } |
| r10315 | r10316 | |
|---|---|---|
| 399 | 399 | static DEVICE_START( at29c040a ) |
| 400 | 400 | { |
| 401 | 401 | at29c040a_state *feeprom = get_safe_token(device); |
| 402 | feeprom->programming_timer = | |
| 402 | feeprom->programming_timer = | |
| 403 | 403 | } |
| 404 | 404 | |
| 405 | 405 | static DEVICE_STOP( at29c040a ) |
| r10315 | r10316 | |
|---|---|---|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | // allocate read timer |
| 168 | m_transfer_timer = | |
| 168 | m_transfer_timer = | |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | void mb89352_device::device_reset() |
| r10315 | r10316 | |
|---|---|---|
| 915 | 915 | bus->phase=SCSI_PHASE_BUS_FREE; |
| 916 | 916 | |
| 917 | 917 | // Setup req/ack/sel timers |
| 918 | bus->req_timer=timer_alloc(device->machine, req_timer_callback, (void *)device); | |
| 919 | bus->ack_timer=timer_alloc(device->machine, ack_timer_callback, (void *)device); | |
| 920 | bus->sel_timer=timer_alloc(device->machine, sel_timer_callback, (void *)device); | |
| 921 | bus->dataout_timer=timer_alloc(device->machine, dataout_timer_callback, (void *)device); | |
| 918 | bus->req_timer=device->machine->scheduler().timer_alloc(FUNC(req_timer_callback), (void *)device); | |
| 919 | bus->ack_timer=device->machine->scheduler().timer_alloc(FUNC(ack_timer_callback), (void *)device); | |
| 920 | bus->sel_timer=device->machine->scheduler().timer_alloc(FUNC(sel_timer_callback), (void *)device); | |
| 921 | bus->dataout_timer=device->machine->scheduler().timer_alloc(FUNC(dataout_timer_callback), (void *)device); | |
| 922 | 922 | |
| 923 | 923 | } |
| 924 | 924 |
| r10315 | r10316 | |
|---|---|---|
| 55 | 55 | MACHINE_START( tx0 ) |
| 56 | 56 | { |
| 57 | 57 | tx0_state *state = machine->driver_data<tx0_state>(); |
| 58 | state->tape_reader.timer = timer_alloc(machine, reader_callback, NULL); | |
| 59 | state->tape_puncher.timer = timer_alloc(machine, puncher_callback, NULL); | |
| 60 | state->typewriter.prt_timer = timer_alloc(machine, prt_callback, NULL); | |
| 61 | state->dis_timer = timer_alloc(machine, dis_callback, NULL); | |
| 58 | state->tape_reader.timer = machine->scheduler().timer_alloc(FUNC(reader_callback)); | |
| 59 | state->tape_puncher.timer = machine->scheduler().timer_alloc(FUNC(puncher_callback)); | |
| 60 | state->typewriter.prt_timer = machine->scheduler().timer_alloc(FUNC(prt_callback)); | |
| 61 | state->dis_timer = machine->scheduler().timer_alloc(FUNC(dis_callback)); | |
| 62 | 62 | |
| 63 | 63 | machine->add_notifier(MACHINE_NOTIFY_EXIT, tx0_machine_stop); |
| 64 | 64 | } |
| r10315 | r10316 | |
|---|---|---|
| 60 | 60 | if(VERBOSE_LEVEL >= N) \ |
| 61 | 61 | { \ |
| 62 | 62 | if( M ) \ |
| 63 | logerror("%11.6f: %-24s", | |
| 63 | logerror("%11.6f: %-24s", | |
| 64 | 64 | logerror A; \ |
| 65 | 65 | } \ |
| 66 | 66 | } while (0) |
| r10315 | r10316 | |
| 1180 | 1180 | gfx[i] = i; |
| 1181 | 1181 | |
| 1182 | 1182 | if (state->tape_on) |
| 1183 | state->datasette_timer = timer_alloc( | |
| 1183 | state->datasette_timer = machine->scheduler().timer_alloc(FUNC(c | |
| 1184 | 1184 | } |
| 1185 | 1185 | |
| 1186 | 1186 | DRIVER_INIT( c128 ) |
| r10315 | r10316 | |
|---|---|---|
| 322 | 322 | |
| 323 | 323 | /* We poll the keyboard periodically to scan the keys. This is |
| 324 | 324 | actually consistent with how the AY-3600 keyboard controller works. */ |
| 325 | timer_pulse( | |
| 325 | machine->scheduler().timer_pulse( | |
| 326 | 326 | |
| 327 | 327 | /* Set Caps Lock light to ON, since that's how we default it. */ |
| 328 | 328 | set_led_status(machine,1,1); |
| r10315 | r10316 | |
|---|---|---|
| 589 | 589 | |
| 590 | 590 | tms->intf = (const tms9901_interface*)device->baseconfig().static_config(); |
| 591 | 591 | |
| 592 | tms->timer = | |
| 592 | tms->timer = | |
| 593 | 593 | |
| 594 | 594 | tms->supported_int_mask = tms->intf->supported_int_mask; |
| 595 | 595 |
| r10315 | r10316 | |
|---|---|---|
| 1545 | 1545 | c2040->gcr = region->base() + region->bytes() - 0x800; |
| 1546 | 1546 | |
| 1547 | 1547 | /* allocate data timer */ |
| 1548 | c2040->bit_timer = | |
| 1548 | c2040->bit_timer = | |
| 1549 | 1549 | |
| 1550 | 1550 | /* register for state saving */ |
| 1551 | 1551 | state_save_register_device_item(device, 0, c2040->drive); |
| r10315 | r10316 | |
|---|---|---|
| 24 | 24 | if(VERBOSE_LEVEL >= N) \ |
| 25 | 25 | { \ |
| 26 | 26 | if( M ) \ |
| 27 | logerror("%11.6f: %-24s", | |
| 27 | logerror("%11.6f: %-24s", | |
| 28 | 28 | logerror A; \ |
| 29 | 29 | } \ |
| 30 | 30 | } while (0) |
| r10315 | r10316 | |
| 716 | 716 | } |
| 717 | 717 | |
| 718 | 718 | /* pet clock */ |
| 719 | timer_pulse( | |
| 719 | machine->scheduler().timer_pulse( | |
| 720 | 720 | |
| 721 | 721 | /* datasette */ |
| 722 | state->datasette1_timer = timer_alloc(machine, pet_tape1_timer, NULL); | |
| 723 | state->datasette2_timer = timer_alloc(machine, pet_tape2_timer, NULL); | |
| 722 | state->datasette1_timer = machine->scheduler().timer_alloc(FUNC(pet_tape1_timer)); | |
| 723 | state->datasette2_timer = machine->scheduler().timer_alloc(FUNC(pet_tape2_timer)); | |
| 724 | 724 | } |
| 725 | 725 | |
| 726 | 726 |
| r10315 | r10316 | |
|---|---|---|
| 280 | 280 | else if ( offset == 8 ) |
| 281 | 281 | return to7_5p14_select; |
| 282 | 282 | else |
| 283 | logerror ( "%f $%04x to7_5p14_r: invalid read offset %i\n", | |
| 283 | logerror ( "%f $%04x to7_5p14_r: invalid read offset %i\n", | |
| 284 | 284 | return 0; |
| 285 | 285 | } |
| 286 | 286 | |
| r10315 | r10316 | |
| 304 | 304 | case 4: drive = 2; side = 0; break; |
| 305 | 305 | case 5: drive = 3; side = 1; break; |
| 306 | 306 | default: |
| 307 | logerror( "%f $%04x to7_5p14_w: invalid drive select pattern $%02X\n", | |
| 307 | logerror( "%f $%04x to7_5p14_w: invalid drive select pattern $%02X\n", | |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | wd17xx_dden_w(fdc, BIT(data, 7)); |
| r10315 | r10316 | |
| 317 | 317 | wd17xx_set_drive( fdc, drive ); |
| 318 | 318 | wd17xx_set_side( fdc, side ); |
| 319 | 319 | LOG(( "%f $%04x to7_5p14_w: $%02X set drive=%i side=%i density=%s\n", |
| 320 | | |
| 320 | | |
| 321 | 321 | data, drive, side, (BIT(data, 7) ? "FM" : "MFM"))); |
| 322 | 322 | } |
| 323 | 323 | } |
| 324 | 324 | else |
| 325 | 325 | logerror ( "%f $%04x to7_5p14_w: invalid write offset %i (data=$%02X)\n", |
| 326 | | |
| 326 | | |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | |
| r10315 | r10316 | |
| 366 | 366 | else if ( offset >= 8 && offset <= 9 ) |
| 367 | 367 | return to7_5p14sd_select; |
| 368 | 368 | else |
| 369 | logerror ( "%f $%04x to7_5p14sd_r: invalid read offset %i\n", | |
| 369 | logerror ( "%f $%04x to7_5p14sd_r: invalid read offset %i\n", | |
| 370 | 370 | return 0; |
| 371 | 371 | } |
| 372 | 372 | |
| r10315 | r10316 | |
| 410 | 410 | mc6843_set_drive( space->machine->device("mc6843"), drive ); |
| 411 | 411 | mc6843_set_side( space->machine->device("mc6843"), side ); |
| 412 | 412 | LOG(( "%f $%04x to7_5p14sd_w: $%02X set drive=%i side=%i\n", |
| 413 | | |
| 413 | | |
| 414 | 414 | } |
| 415 | 415 | } |
| 416 | 416 | else |
| 417 | 417 | logerror ( "%f $%04x to7_5p14sd_w: invalid write offset %i (data=$%02X)\n", |
| 418 | | |
| 418 | | |
| 419 | 419 | } |
| 420 | 420 | |
| 421 | 421 | static void to7_5p14_index_pulse_callback( device_t *controller,device_t *image, int state ) |
| r10315 | r10316 | |
| 531 | 531 | to7qdd->data_size = 0; |
| 532 | 532 | } |
| 533 | 533 | |
| 534 | VLOG(( "%f to7_qdd_pulse_cb: state=%i\n", | |
| 534 | VLOG(( "%f to7_qdd_pulse_cb: state=%i\n", | |
| 535 | 535 | } |
| 536 | 536 | |
| 537 | 537 | |
| r10315 | r10316 | |
| 593 | 593 | data = to7qdd->data[ to7qdd->data_idx ]; |
| 594 | 594 | |
| 595 | 595 | VLOG(( "%f $%04x to7_qdd_read_byte: RDATA off=%i/%i data=$%02X\n", |
| 596 | | |
| 596 | | |
| 597 | 597 | to7qdd->data_idx, to7qdd->data_size, data )); |
| 598 | 598 | |
| 599 | 599 | to7qdd->data_idx++; |
| r10315 | r10316 | |
| 634 | 634 | to7qdd->data_idx++; |
| 635 | 635 | |
| 636 | 636 | VLOG (( "%f $%04x to7_qdd_write_byte: got $%02X offs=%i-%i\n", |
| 637 | | |
| 637 | | |
| 638 | 638 | to7qdd->start_idx, to7qdd->data_idx )); |
| 639 | 639 | |
| 640 | 640 | /* end of tentative id field */ |
| r10315 | r10316 | |
| 648 | 648 | UINT8 filler = 0xff; |
| 649 | 649 | |
| 650 | 650 | LOG(( "%f $%04x to7_qdd_write_byte: got id field for sector=%i\n", |
| 651 | | |
| 651 | | |
| 652 | 652 | |
| 653 | 653 | floppy_drive_format_sector( to7_qdd_image(machine), |
| 654 | 654 | 0, sector, 0, 0, sector, 128, filler ); |
| r10315 | r10316 | |
| 678 | 678 | int sector = (int) to7qdd->data[ i + 1 ] * 256 + (int) to7qdd->data[ i + 2 ]; |
| 679 | 679 | |
| 680 | 680 | LOG(( "%f $%04x to7_qdd_write_byte: goto data field for sector=%i\n", |
| 681 | | |
| 681 | | |
| 682 | 682 | |
| 683 | 683 | floppy_drive_write_sector_data( to7_qdd_image(machine), 0, sector, to7qdd->data + to7qdd->start_idx + 1, 128, 0 ); |
| 684 | 684 | thom_floppy_active( machine, 1 ); |
| r10315 | r10316 | |
| 701 | 701 | case 0: /* MC6852 status */ |
| 702 | 702 | to7_qdd_stat_update(space->machine); |
| 703 | 703 | VLOG(( "%f $%04x to7_qdd_r: STAT=$%02X irq=%i pe=%i ovr=%i und=%i tr=%i rd=%i ncts=%i\n", |
| 704 | | |
| 704 | | |
| 705 | 705 | to7qdd->status & QDD_S_IRQ ? 1 : 0, |
| 706 | 706 | to7qdd->status & QDD_S_PE ? 1 : 0, |
| 707 | 707 | to7qdd->status & QDD_S_OVR ? 1 : 0, |
| r10315 | r10316 | |
| 724 | 724 | data |= 0x40; /* disk present */ |
| 725 | 725 | if ( to7qdd->index_pulse ) |
| 726 | 726 | data |= 0x80; /* disk start */ |
| 727 | VLOG(( "%f $%04x to7_qdd_r: STATUS8 $%02X\n", | |
| 727 | VLOG(( "%f $%04x to7_qdd_r: STATUS8 $%02X\n", | |
| 728 | 728 | return data; |
| 729 | 729 | } |
| 730 | 730 | |
| 731 | 731 | default: |
| 732 | logerror ( "%f $%04x to7_qdd_r: invalid read offset %i\n", | |
| 732 | logerror ( "%f $%04x to7_qdd_r: invalid read offset %i\n", | |
| 733 | 733 | return 0; |
| 734 | 734 | } |
| 735 | 735 | } |
| r10315 | r10316 | |
| 751 | 751 | to7qdd->ctrl1 = ( data & ~(QDD_C1_RRESET | QDD_C1_TRESET) ) |( data & (QDD_C1_RRESET | QDD_C1_TRESET) & to7qdd->ctrl1 ); |
| 752 | 752 | to7_qdd_stat_update(space->machine); |
| 753 | 753 | VLOG(( "%f $%04x to7_qdd_w: CTRL1=$%02X reset=%c%c %s%sirq=%c%c\n", |
| 754 | | |
| 754 | | |
| 755 | 755 | data & QDD_C1_RRESET ? 'r' : '-', data & QDD_C1_TRESET ? 't' : '-', |
| 756 | 756 | data & QDD_C1_STRIPSYNC ? "strip-sync " : "", |
| 757 | 757 | data & QDD_C1_CLRSYNC ? "clear-sync " : "", |
| r10315 | r10316 | |
| 775 | 775 | parity = par[ (data >> 3) & 7 ]; |
| 776 | 776 | to7_qdd_stat_update(space->machine); |
| 777 | 777 | VLOG(( "%f $%04x to7_qdd_w: CTRL2=$%02X bits=%i par=%s blen=%i under=%s%s\n", |
| 778 | | |
| 778 | | |
| 779 | 779 | bits, parname[ parity ], data & QDD_C2_BLEN ? 1 : 2, |
| 780 | 780 | data & QDD_C2_TSYNC ? "sync" : "ff", |
| 781 | 781 | data & QDD_C2_EIE ? "irq-err" : "" )); |
| r10315 | r10316 | |
| 793 | 793 | to7qdd->status &= ~QDD_S_NCTS; |
| 794 | 794 | to7_qdd_stat_update(space->machine); |
| 795 | 795 | VLOG(( "%f $%04x to7_qdd_w: CTRL3=$%02X %s%ssync-len=%i sync-mode=%s\n", |
| 796 | | |
| 796 | | |
| 797 | 797 | data & QDD_C3_CLRTUF ? "clr-tuf " : "", |
| 798 | 798 | data & QDD_C3_CLRCTS ? "clr-cts " : "", |
| 799 | 799 | data & QDD_C3_SYNCLEN ? 1 : 2, |
| r10315 | r10316 | |
| 805 | 805 | break; |
| 806 | 806 | |
| 807 | 807 | case 3: /* MC6852 data out => does not seem to be used */ |
| 808 | VLOG(( "%f $%04x to7_qdd_w: ignored WDATA=$%02X\n", | |
| 808 | VLOG(( "%f $%04x to7_qdd_w: ignored WDATA=$%02X\n", | |
| 809 | 809 | break; |
| 810 | 810 | |
| 811 | 811 | } |
| r10315 | r10316 | |
| 813 | 813 | |
| 814 | 814 | case 8: /* set drive */ |
| 815 | 815 | to7qdd->drive = data; |
| 816 | VLOG(( "%f $%04x to7_qdd_w: DRIVE=$%02X\n", | |
| 816 | VLOG(( "%f $%04x to7_qdd_w: DRIVE=$%02X\n", | |
| 817 | 817 | break; |
| 818 | 818 | |
| 819 | 819 | case 12: /* motor pulse ? */ |
| 820 | 820 | thom_floppy_active( space->machine, 0 ); |
| 821 | VLOG(( "%f $%04x to7_qdd_w: MOTOR=$%02X\n", | |
| 821 | VLOG(( "%f $%04x to7_qdd_w: MOTOR=$%02X\n", | |
| 822 | 822 | break; |
| 823 | 823 | |
| 824 | 824 | default: |
| 825 | logerror ( "%f $%04x to7_qdd_w: invalid write offset %i (data=$%02X)\n", | |
| 825 | logerror ( "%f $%04x to7_qdd_w: invalid write offset %i (data=$%02X)\n", | |
| 826 | 826 | } |
| 827 | 827 | } |
| 828 | 828 | |
| r10315 | r10316 | |
| 978 | 978 | thmfc1->data_raw_idx = 0; |
| 979 | 979 | } |
| 980 | 980 | |
| 981 | VLOG(( "%f thmfc_floppy_index_pulse_cb: state=%i\n", | |
| 981 | VLOG(( "%f thmfc_floppy_index_pulse_cb: state=%i\n", | |
| 982 | 982 | } |
| 983 | 983 | |
| 984 | 984 | |
| r10315 | r10316 | |
| 1023 | 1023 | static void thmfc_floppy_cmd_complete( running_machine *machine ) |
| 1024 | 1024 | { |
| 1025 | 1025 | LOG (( "%f thmfc_floppy_cmd_complete_cb: cmd=%i off=%i/%i/%i\n", |
| 1026 | | |
| 1026 | | |
| 1027 | 1027 | thmfc1->data_finish - 1, thmfc1->data_size - 1 )); |
| 1028 | 1028 | |
| 1029 | 1029 | if ( thmfc1->op == THMFC1_OP_WRITE_SECT ) |
| r10315 | r10316 | |
| 1054 | 1054 | UINT8 data = thmfc1->data[ thmfc1->data_idx ]; |
| 1055 | 1055 | |
| 1056 | 1056 | VLOG(( "%f $%04x thmfc_floppy_read_byte: off=%i/%i/%i data=$%02X\n", |
| 1057 | | |
| 1057 | | |
| 1058 | 1058 | thmfc1->data_idx, thmfc1->data_finish - 1, thmfc1->data_size - 1, |
| 1059 | 1059 | data )); |
| 1060 | 1060 | |
| r10315 | r10316 | |
| 1097 | 1097 | data = thmfc1->data[ thmfc1->data_raw_idx ]; |
| 1098 | 1098 | |
| 1099 | 1099 | VLOG(( "%f $%04x thmfc_floppy_raw_read_byte: off=%i/%i data=$%02X\n", |
| 1100 | | |
| 1100 | | |
| 1101 | 1101 | thmfc1->data_raw_idx, thmfc1->data_raw_size, data )); |
| 1102 | 1102 | |
| 1103 | 1103 | thmfc1->data_raw_idx++; |
| r10315 | r10316 | |
| 1135 | 1135 | } |
| 1136 | 1136 | |
| 1137 | 1137 | VLOG (( "%f $%04x thmfc_floppy_qdd_write_byte: $%02X offs=%i-%i\n", |
| 1138 | | |
| 1138 | | |
| 1139 | 1139 | thmfc1->data_idx,thmfc1->data_raw_idx )); |
| 1140 | 1140 | |
| 1141 | 1141 | if ( thmfc1->data_raw_idx == thmfc1->data_idx + 3 && |
| r10315 | r10316 | |
| 1147 | 1147 | int sector = (int) thmfc1->data[ thmfc1->data_idx ] * 256 + (int) thmfc1->data[ thmfc1->data_idx + 1 ]; |
| 1148 | 1148 | UINT8 filler = 0xff; |
| 1149 | 1149 | |
| 1150 | LOG(( "%f $%04x thmfc_floppy_qdd_write_byte: id field, sector=%i\n", | |
| 1150 | LOG(( "%f $%04x thmfc_floppy_qdd_write_byte: id field, sector=%i\n", | |
| 1151 | 1151 | |
| 1152 | 1152 | floppy_drive_format_sector( thmfc_floppy_image(machine), 0, sector, 0, 0, sector, 128, filler ); |
| 1153 | 1153 | thom_floppy_active( machine, 1 ); |
| r10315 | r10316 | |
| 1177 | 1177 | (int) thmfc1->data[ i + 2 ]; |
| 1178 | 1178 | |
| 1179 | 1179 | LOG(( "%f $%04x thmfc_floppy_qdd_write_byte: data field, sector=%i\n", |
| 1180 | | |
| 1180 | | |
| 1181 | 1181 | |
| 1182 | 1182 | floppy_drive_write_sector_data( img, 0, sector, thmfc1->data + thmfc1->data_idx, 128, 0 ); |
| 1183 | 1183 | thom_floppy_active( machine, 1 ); |
| r10315 | r10316 | |
| 1192 | 1192 | else |
| 1193 | 1193 | { |
| 1194 | 1194 | thmfc1->data_raw_idx++; |
| 1195 | VLOG (( "%f $%04x thmfc_floppy_qdd_write_byte: ignored $%02X\n", | |
| 1195 | VLOG (( "%f $%04x thmfc_floppy_qdd_write_byte: ignored $%02X\n", | |
| 1196 | 1196 | } |
| 1197 | 1197 | |
| 1198 | 1198 | } |
| r10315 | r10316 | |
| 1203 | 1203 | static void thmfc_floppy_write_byte ( running_machine *machine, UINT8 data ) |
| 1204 | 1204 | { |
| 1205 | 1205 | VLOG (( "%f $%04x thmfc_floppy_write_byte: off=%i/%i data=$%02X\n", |
| 1206 | | |
| 1206 | | |
| 1207 | 1207 | thmfc1->data_idx, thmfc1->data_size - 1, data )); |
| 1208 | 1208 | |
| 1209 | 1209 | thmfc1->data_raw_size = 0; |
| r10315 | r10316 | |
| 1217 | 1217 | /* intelligent formatting */ |
| 1218 | 1218 | static void thmfc_floppy_format_byte ( running_machine *machine, UINT8 data ) |
| 1219 | 1219 | { |
| 1220 | VLOG (( "%f $%04x thmfc_floppy_format_byte: $%02X\n", | |
| 1220 | VLOG (( "%f $%04x thmfc_floppy_format_byte: $%02X\n", | |
| 1221 | 1221 | |
| 1222 | 1222 | thmfc1->data_raw_size = 0; |
| 1223 | 1223 | |
| r10315 | r10316 | |
| 1262 | 1262 | |
| 1263 | 1263 | case 0: /* STAT0 */ |
| 1264 | 1264 | thmfc1->stat0 ^= THMFC1_STAT0_SYNCHRO | THMFC1_STAT0_BYTE_READY_POL; |
| 1265 | VLOG(( "%f $%04x thmfc_floppy_r: STAT0=$%02X\n", | |
| 1265 | VLOG(( "%f $%04x thmfc_floppy_r: STAT0=$%02X\n", | |
| 1266 | 1266 | return thmfc1->stat0; |
| 1267 | 1267 | |
| 1268 | 1268 | case 1: /* STAT1 */ |
| r10315 | r10316 | |
| 1294 | 1294 | data |= 0x10; |
| 1295 | 1295 | if (!floppy_wpt_r(&img->device())) |
| 1296 | 1296 | data |= 0x04; |
| 1297 | VLOG(( "%f $%04x thmfc_floppy_r: STAT1=$%02X\n", | |
| 1297 | VLOG(( "%f $%04x thmfc_floppy_r: STAT1=$%02X\n", | |
| 1298 | 1298 | return data; |
| 1299 | 1299 | } |
| 1300 | 1300 | |
| r10315 | r10316 | |
| 1312 | 1312 | { |
| 1313 | 1313 | /* undocumented => emulate TO7 QDD controller ? */ |
| 1314 | 1314 | UINT8 data = thmfc1->ipl << 7; |
| 1315 | VLOG(( "%f $%04x thmfc_floppy_r: STAT8=$%02X\n", | |
| 1315 | VLOG(( "%f $%04x thmfc_floppy_r: STAT8=$%02X\n", | |
| 1316 | 1316 | return data; |
| 1317 | 1317 | } |
| 1318 | 1318 | |
| 1319 | 1319 | default: |
| 1320 | logerror ( "%f $%04x thmfc_floppy_r: invalid read offset %i\n", | |
| 1320 | logerror ( "%f $%04x thmfc_floppy_r: invalid read offset %i\n", | |
| 1321 | 1321 | return 0; |
| 1322 | 1322 | } |
| 1323 | 1323 | } |
| r10315 | r10316 | |
| 1335 | 1335 | chrn_id id; |
| 1336 | 1336 | thmfc1->formatting = (data >> 2) & 1; |
| 1337 | 1337 | LOG (( "%f $%04x thmfc_floppy_w: CMD0=$%02X dens=%s wsync=%i dsync=%i fmt=%i op=%i\n", |
| 1338 | | |
| 1338 | | |
| 1339 | 1339 | (BIT(data, 5) ? "FM" : "MFM"), |
| 1340 | 1340 | wsync, (data >> 3) & 1, |
| 1341 | 1341 | thmfc1->formatting, data & 3 )); |
| r10315 | r10316 | |
| 1426 | 1426 | } |
| 1427 | 1427 | |
| 1428 | 1428 | LOG (( "%f $%04x thmfc_floppy_w: CMD1=$%02X sect-size=%i comp=%i head=%i\n", |
| 1429 | | |
| 1429 | | |
| 1430 | 1430 | thmfc1->sector_size, (data >> 1) & 7, thmfc1->side )); |
| 1431 | 1431 | break; |
| 1432 | 1432 | |
| r10315 | r10316 | |
| 1455 | 1455 | thom_floppy_active( space->machine, 0 ); |
| 1456 | 1456 | |
| 1457 | 1457 | LOG (( "%f $%04x thmfc_floppy_w: CMD2=$%02X drv=%i step=%i motor=%i\n", |
| 1458 | | |
| 1458 | | |
| 1459 | 1459 | thmfc1->drive, seek, motor )); |
| 1460 | 1460 | |
| 1461 | 1461 | if ( seek ) |
| r10315 | r10316 | |
| 1486 | 1486 | { |
| 1487 | 1487 | /* TODO: implement other forms of raw track writing */ |
| 1488 | 1488 | LOG (( "%f $%04x thmfc_floppy_w: ignored raw WDATA $%02X\n", |
| 1489 | | |
| 1489 | | |
| 1490 | 1490 | } |
| 1491 | 1491 | break; |
| 1492 | 1492 | |
| r10315 | r10316 | |
| 1494 | 1494 | case 4: /* WCLK (unemulated) */ |
| 1495 | 1495 | /* clock configuration: FF for data, 0A for synchro */ |
| 1496 | 1496 | LOG (( "%f $%04x thmfc_floppy_w: WCLK=$%02X (%s)\n", |
| 1497 | | |
| 1497 | | |
| 1498 | 1498 | (data == 0xff) ? "data" : (data == 0x0A) ? "synchro" : "?" )); |
| 1499 | 1499 | break; |
| 1500 | 1500 | |
| 1501 | 1501 | case 5: /* WSECT */ |
| 1502 | 1502 | thmfc1->sector = data; |
| 1503 | 1503 | LOG (( "%f $%04x thmfc_floppy_w: WSECT=%i\n", |
| 1504 | | |
| 1504 | | |
| 1505 | 1505 | break; |
| 1506 | 1506 | |
| 1507 | 1507 | case 6: /* WTRCK */ |
| 1508 | 1508 | thmfc1->track = data; |
| 1509 | 1509 | LOG (( "%f $%04x thmfc_floppy_w: WTRCK=%i (real=%i)\n", |
| 1510 | | |
| 1510 | | |
| 1511 | 1511 | floppy_drive_get_current_track( thmfc_floppy_image(space->machine) ) )); |
| 1512 | 1512 | break; |
| 1513 | 1513 | |
| 1514 | 1514 | case 7: /* WCELL */ |
| 1515 | 1515 | /* precompensation (unemulated) */ |
| 1516 | 1516 | LOG (( "%f $%04x thmfc_floppy_w: WCELL=$%02X\n", |
| 1517 | | |
| 1517 | | |
| 1518 | 1518 | break; |
| 1519 | 1519 | |
| 1520 | 1520 | default: |
| 1521 | 1521 | logerror ( "%f $%04x thmfc_floppy_w: invalid write offset %i (data=$%02X)\n", |
| 1522 | | |
| 1522 | | |
| 1523 | 1523 | } |
| 1524 | 1524 | } |
| 1525 | 1525 | |
| r10315 | r10316 | |
| 1565 | 1565 | |
| 1566 | 1566 | thmfc1 = auto_alloc(machine, struct _thmfc1); |
| 1567 | 1567 | |
| 1568 | thmfc_floppy_cmd = timer_alloc( | |
| 1568 | thmfc_floppy_cmd = machine->scheduler().timer_alloc(FUNC( | |
| 1569 | 1569 | |
| 1570 | 1570 | state_save_register_global( machine, thmfc1->op ); |
| 1571 | 1571 | state_save_register_global( machine, thmfc1->sector ); |
| r10315 | r10316 | |
| 1604 | 1604 | |
| 1605 | 1605 | static TIMER_CALLBACK( ans4 ) |
| 1606 | 1606 | { |
| 1607 | LOG(( "%f ans4\n", | |
| 1607 | LOG(( "%f ans4\n", | |
| 1608 | 1608 | mc6854_set_cts( machine->device("mc6854"), 0 ); |
| 1609 | 1609 | } |
| 1610 | 1610 | |
| 1611 | 1611 | static TIMER_CALLBACK( ans3 ) |
| 1612 | 1612 | { |
| 1613 | LOG(( "%f ans3\n", | |
| 1613 | LOG(( "%f ans3\n", | |
| 1614 | 1614 | mc6854_set_cts( machine->device("mc6854"), 1 ); |
| 1615 | timer_set( | |
| 1615 | machine->scheduler().timer_set( | |
| 1616 | 1616 | } |
| 1617 | 1617 | |
| 1618 | 1618 | static TIMER_CALLBACK( ans2 ) |
| 1619 | 1619 | { |
| 1620 | LOG(( "%f ans2\n", | |
| 1620 | LOG(( "%f ans2\n", | |
| 1621 | 1621 | mc6854_set_cts( machine->device("mc6854"), 0 ); |
| 1622 | timer_set( | |
| 1622 | machine->scheduler().timer_set( | |
| 1623 | 1623 | } |
| 1624 | 1624 | |
| 1625 | 1625 | static TIMER_CALLBACK( ans ) |
| 1626 | 1626 | { |
| 1627 | LOG(( "%f ans\n", | |
| 1627 | LOG(( "%f ans\n", | |
| 1628 | 1628 | mc6854_set_cts( machine->device("mc6854"), 1 ); |
| 1629 | timer_set( | |
| 1629 | machine->scheduler().timer_set( | |
| 1630 | 1630 | } |
| 1631 | 1631 | /* consigne DKBOOT |
| 1632 | 1632 | |
| r10315 | r10316 | |
| 1660 | 1660 | static void to7_network_got_frame( device_t *device, UINT8* data, int length ) |
| 1661 | 1661 | { |
| 1662 | 1662 | int i; |
| 1663 | LOG(( "%f to7_network_got_frame:", | |
| 1663 | LOG(( "%f to7_network_got_frame:", | |
| 1664 | 1664 | for ( i = 0; i < length; i++ ) |
| 1665 | 1665 | LOG(( " $%02X", data[i] )); |
| 1666 | 1666 | LOG(( "\n" )); |
| r10315 | r10316 | |
| 1668 | 1668 | if ( data[1] == 0xff ) |
| 1669 | 1669 | { |
| 1670 | 1670 | LOG(( "to7_network_got_frame: %i phones %i\n", data[2], data[0] )); |
| 1671 | | |
| 1671 | | |
| 1672 | 1672 | mc6854_set_cts( device, 0 ); |
| 1673 | 1673 | } |
| 1674 | 1674 | else if ( ! data[1] ) |
| r10315 | r10316 | |
| 1720 | 1720 | { |
| 1721 | 1721 | /* network ID of the computer */ |
| 1722 | 1722 | UINT8 id = input_port_read(space->machine, "fconfig") >> 3; |
| 1723 | VLOG(( "%f $%04x to7_network_r: read id $%02X\n", | |
| 1723 | VLOG(( "%f $%04x to7_network_r: read id $%02X\n", | |
| 1724 | 1724 | return id; |
| 1725 | 1725 | } |
| 1726 | 1726 | |
| 1727 | logerror( "%f $%04x to7_network_r: invalid read offset %i\n", | |
| 1727 | logerror( "%f $%04x to7_network_r: invalid read offset %i\n", | |
| 1728 | 1728 | return 0; |
| 1729 | 1729 | } |
| 1730 | 1730 | |
| r10315 | r10316 | |
| 1737 | 1737 | else |
| 1738 | 1738 | { |
| 1739 | 1739 | logerror( "%f $%04x to7_network_w: invalid write offset %i (data=$%02X)\n", |
| 1740 | | |
| 1740 | | |
| 1741 | 1741 | } |
| 1742 | 1742 | } |
| 1743 | 1743 |
| r10315 | r10316 | |
|---|---|---|
| 245 | 245 | dmac->intf = (const upd71071_intf*)device->baseconfig().static_config(); |
| 246 | 246 | for(x=0;x<4;x++) |
| 247 | 247 | { |
| 248 | dmac->timer[x] = | |
| 248 | dmac->timer[x] = | |
| 249 | 249 | } |
| 250 | 250 | dmac->selected_channel = 0; |
| 251 | 251 | } |
| r10315 | r10316 | |
|---|---|---|
| 25 | 25 | if(VERBOSE_LEVEL >= N) \ |
| 26 | 26 | { \ |
| 27 | 27 | if( M ) \ |
| 28 | logerror("%11.6f: %-24s", | |
| 28 | logerror("%11.6f: %-24s", | |
| 29 | 29 | logerror A; \ |
| 30 | 30 | } \ |
| 31 | 31 | } while (0) |
| r10315 | r10316 | |
| 598 | 598 | if (state->sidcard) |
| 599 | 599 | { |
| 600 | 600 | /* if we are emulating the SID card, check which memory area should be accessed */ |
| 601 | | |
| 601 | | |
| 602 | 602 | #if 0 |
| 603 | 603 | /* if we are emulating the SID card, check if writes to 0xd400 have been enabled */ |
| 604 | | |
| 604 | | |
| 605 | 605 | #endif |
| 606 | 606 | } |
| 607 | 607 |
| r10315 | r10316 | |
|---|---|---|
| 1081 | 1081 | state->irqs = 0; |
| 1082 | 1082 | state->ram_0x0c000 = NULL; |
| 1083 | 1083 | |
| 1084 | timer_pulse( | |
| 1084 | machine->scheduler().timer_pulse( | |
| 1085 | 1085 | } |
| 1086 | 1086 | |
| 1087 | 1087 | MACHINE_START( oric ) |
| r10315 | r10316 | |
|---|---|---|
| 293 | 293 | memset(&europc_rtc,0,sizeof(europc_rtc)); |
| 294 | 294 | europc_rtc.data[0xf]=1; |
| 295 | 295 | |
| 296 | europc_rtc.timer = timer_alloc( | |
| 296 | europc_rtc.timer = machine->scheduler().timer_alloc(FUNC( | |
| 297 | 297 | timer_adjust_periodic(europc_rtc.timer, attotime::zero, 0, attotime(1, 0)); |
| 298 | 298 | } |
| 299 | 299 |
| r10315 | r10316 | |
|---|---|---|
| 175 | 175 | |
| 176 | 176 | MACHINE_START( vector06 ) |
| 177 | 177 | { |
| 178 | timer_pulse( | |
| 178 | machine->scheduler().timer_pulse( | |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | MACHINE_RESET( vector06 ) |
| r10315 | r10316 | |
|---|---|---|
| 349 | 349 | |
| 350 | 350 | state->ula.interrupt_status = 0x82; |
| 351 | 351 | state->ula.interrupt_control = 0x00; |
| 352 | timer_set(machine, attotime::zero, NULL, 0, setup_beep ); | |
| 353 | state->tape_timer = timer_alloc(machine, electron_tape_timer_handler, NULL ); | |
| 352 | machine->scheduler().timer_set(attotime::zero, FUNC(setup_beep)); | |
| 353 | state->tape_timer = machine->scheduler().timer_alloc(FUNC(electron_tape_timer_handler)); | |
| 354 | 354 | machine->add_notifier(MACHINE_NOTIFY_RESET, electron_reset); |
| 355 | 355 | } |
| 356 | 356 |
| r10315 | r10316 | |
|---|---|---|
| 34 | 34 | |
| 35 | 35 | MACHINE_START( irisha ) |
| 36 | 36 | { |
| 37 | timer_pulse( | |
| 37 | machine->scheduler().timer_pulse( | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | MACHINE_RESET( irisha ) |
| r10315 | r10316 | |
|---|---|---|
| 210 | 210 | error[i] = 0; |
| 211 | 211 | dip[i] = 0xff; |
| 212 | 212 | pc_hdc_dma8237 = NULL; |
| 213 | timer[i] = timer_alloc( | |
| 213 | timer[i] = machine->scheduler().timer_alloc(FUNC( | |
| 214 | 214 | if (!timer[i]) |
| 215 | 215 | return -1; |
| 216 | 216 | } |
| r10315 | r10316 | |
|---|---|---|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | // allocate read timer |
| 90 | m_transfer_timer = device_timer_alloc(*this,TIMER_TRANSFER); | |
| 91 | m_phase_timer = device_timer_alloc(*this,TIMER_PHASE); | |
| 90 | m_transfer_timer = timer_alloc(TIMER_TRANSFER); | |
| 91 | m_phase_timer = timer_alloc(TIMER_PHASE); | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | void fmscsi_device::device_reset() |
| r10315 | r10316 | |
|---|---|---|
| 406 | 406 | MACHINE_START( sorcerer ) |
| 407 | 407 | { |
| 408 | 408 | sorcerer_state *state = machine->driver_data<sorcerer_state>(); |
| 409 | state->m_cassette_timer = timer_alloc( | |
| 409 | state->m_cassette_timer = machine->scheduler().timer_alloc(FUNC( | |
| 410 | 410 | #if SORCERER_USING_RS232 |
| 411 | state->m_serial_timer = timer_alloc( | |
| 411 | state->m_serial_timer = machine->scheduler().timer_alloc(FUNC( | |
| 412 | 412 | #endif |
| 413 | 413 | |
| 414 | 414 | #if SORCERER_USING_DISKS |
| r10315 | r10316 | |
| 450 | 450 | state->sorcerer_fe_w(*space, 0, 0, 0xff); |
| 451 | 451 | |
| 452 | 452 | memory_set_bank(machine, "boot", 1); |
| 453 | timer_set( | |
| 453 | machine->scheduler().timer_set( | |
| 454 | 454 | } |
| r10315 | r10316 | |
|---|---|---|
| 139 | 139 | int id; |
| 140 | 140 | for(id=0;id<2;id++) |
| 141 | 141 | { |
| 142 | fdc->fdc_status[id].rev_timer = timer_alloc(device->machine, fdc_rev_proc, (void*)device); | |
| 143 | fdc->fdc_status[id].dma_timer = timer_alloc(device->machine, fdc_dma_proc, (void*)device); | |
| 144 | fdc->fdc_status[id].sync_timer = timer_alloc(device->machine, fdc_sync_proc, (void*)device); | |
| 142 | fdc->fdc_status[id].rev_timer = device->machine->scheduler().timer_alloc(FUNC(fdc_rev_proc), (void*)device); | |
| 143 | fdc->fdc_status[id].dma_timer = device->machine->scheduler().timer_alloc(FUNC(fdc_dma_proc), (void*)device); | |
| 144 | fdc->fdc_status[id].sync_timer = device->machine->scheduler().timer_alloc(FUNC(fdc_sync_proc), (void*)device); | |
| 145 | 145 | floppy_install_load_proc(amiga_floppy_get_device_child(device, id), amiga_load_proc); |
| 146 | 146 | floppy_install_unload_proc(amiga_floppy_get_device_child(device, id), amiga_unload_proc); |
| 147 | 147 | fdc->fdc_status[id].motor_on = 0; |
| r10315 | r10316 | |
|---|---|---|
| 68 | 68 | |
| 69 | 69 | MACHINE_START(bk0010) |
| 70 | 70 | { |
| 71 | timer_pulse( | |
| 71 | machine->scheduler().timer_pulse( | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | static IRQ_CALLBACK(bk0010_irq_callback) |
| r10315 | r10316 | |
|---|---|---|
| 1227 | 1227 | // c1541->track_buffer = auto_alloc_array(device->machine, UINT8, G64_BUFFER_SIZE); |
| 1228 | 1228 | |
| 1229 | 1229 | /* allocate data timer */ |
| 1230 | c1541->bit_timer = | |
| 1230 | c1541->bit_timer = | |
| 1231 | 1231 | |
| 1232 | 1232 | /* register for state saving */ |
| 1233 | 1233 | // state_save_register_device_item_pointer(device, 0, c1541->track_buffer, G64_BUFFER_SIZE); |
| r10315 | r10316 | |
|---|---|---|
| 103 | 103 | key_buf = auto_alloc_array(machine, UINT8, KEYBOARD_BUFFER_SIZE ); |
| 104 | 104 | key_buf_pos = 0; |
| 105 | 105 | key_cur_pos = 0; |
| 106 | kbd_timer = timer_alloc( | |
| 106 | kbd_timer = machine->scheduler().timer_alloc(FUNC( | |
| 107 | 107 | timer_reset( kbd_timer, attotime::never ); |
| 108 | 108 | } |
| 109 | 109 |
| r10315 | r10316 | |
|---|---|---|
| 69 | 69 | cd.cdrom = cd_get_cdrom_file( cdrom_device ); |
| 70 | 70 | cd.cdda = cdrom_device->machine->device(cdda_tag); |
| 71 | 71 | |
| 72 | cd.frame_timer = | |
| 72 | cd.frame_timer = | |
| 73 | 73 | |
| 74 | 74 | cd.stch_signal = 1; |
| 75 | 75 | } |
| r10315 | r10316 | |
| 273 | 273 | if ( cd.stch_signal != 0 ) |
| 274 | 274 | { |
| 275 | 275 | update_status_changed( machine, 0 ); |
| 276 | timer_set( | |
| 276 | machine->scheduler().timer_set( | |
| 277 | 277 | } |
| 278 | 278 | } |
| 279 | 279 | } |
| r10315 | r10316 | |
|---|---|---|
| 523 | 523 | const terminal_interface *intf = get_interface(device); |
| 524 | 524 | |
| 525 | 525 | devcb_resolve_write8(&term->terminal_keyboard_func, &intf->terminal_keyboard_func, device); |
| 526 | | |
| 526 | | |
| 527 | 527 | } |
| 528 | 528 | |
| 529 | 529 | /*------------------------------------------------- |
| r10315 | r10316 | |
|---|---|---|
| 402 | 402 | break; |
| 403 | 403 | case 1: /* BFF1: write delayed NMI */ |
| 404 | 404 | LOG(("microtan_bff1_w: %d <- %02x (delayed NMI)\n", offset, data)); |
| 405 | | |
| 405 | | |
| 406 | 406 | break; |
| 407 | 407 | case 2: /* BFF2: write keypad column write (what is this meant for?) */ |
| 408 | 408 | LOG(("microtan_bff2_w: %d <- %02x (keypad column)\n", offset, data)); |
| r10315 | r10316 | |
| 570 | 570 | break; |
| 571 | 571 | } |
| 572 | 572 | |
| 573 | state->timer = timer_alloc(m | |
| 573 | state->timer = machine->scheduler().timer_alloc(FUNC(m | |
| 574 | 574 | } |
| 575 | 575 | |
| 576 | 576 | MACHINE_RESET( microtan ) |
| r10315 | r10316 | |
|---|---|---|
| 640 | 640 | |
| 641 | 641 | tms9902->clock_rate = tms9902->intf->clock_rate; |
| 642 | 642 | |
| 643 | tms9902->timer = | |
| 643 | tms9902->timer = | |
| 644 | 644 | } |
| 645 | 645 | |
| 646 | 646 |
| r10315 | r10316 | |
|---|---|---|
| 102 | 102 | |
| 103 | 103 | /* trigger NMI irq */ |
| 104 | 104 | amiga_ar1_spurious = 0; |
| 105 | timer_set(machine | |
| 105 | machine->scheduler().timer_set(machine | |
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | |
| r10315 | r10316 | |
| 120 | 120 | { |
| 121 | 121 | /* trigger an NMI or spurious irq */ |
| 122 | 122 | amiga_ar1_spurious = (offset == 0x60/2) ? 0 : 1; |
| 123 | | |
| 123 | | |
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 |
| r10315 | r10316 | |
|---|---|---|
| 471 | 471 | |
| 472 | 472 | /* Configure the 6850 ACIA */ |
| 473 | 473 | // acia6850_config( 0, &osborne1_6850_config ); |
| 474 | state->video_timer = timer_alloc( | |
| 474 | state->video_timer = machine->scheduler().timer_alloc(FUNC( | |
| 475 | 475 | timer_adjust_oneshot(state->video_timer, machine->primary_screen->time_until_pos(1, 0 ), 0); |
| 476 | 476 | |
| 477 | timer_set( | |
| 477 | machine->scheduler().timer_set( | |
| 478 | 478 | } |
| 479 | 479 | |
| 480 | 480 |
| r10315 | r10316 | |
|---|---|---|
| 625 | 625 | INLINE void amstrad_update_video( running_machine *machine ) |
| 626 | 626 | { |
| 627 | 627 | amstrad_state *state = machine->driver_data<amstrad_state>(); |
| 628 | attotime now = | |
| 628 | attotime now = | |
| 629 | 629 | |
| 630 | 630 | if ( state->gate_array.draw_p ) |
| 631 | 631 | { |
| r10315 | r10316 | |
| 698 | 698 | INLINE void amstrad_plus_update_video( running_machine *machine ) |
| 699 | 699 | { |
| 700 | 700 | amstrad_state *state = machine->driver_data<amstrad_state>(); |
| 701 | attotime now = | |
| 701 | attotime now = | |
| 702 | 702 | |
| 703 | 703 | if ( state->gate_array.draw_p ) |
| 704 | 704 | { |
| r10315 | r10316 | |
| 957 | 957 | drvstate->gate_array.vsync = state ? 1 : 0; |
| 958 | 958 | |
| 959 | 959 | /* Schedule a write to PC2 */ |
| 960 | | |
| 960 | | |
| 961 | 961 | } |
| 962 | 962 | |
| 963 | 963 | |
| r10315 | r10316 | |
| 980 | 980 | drvstate->gate_array.vsync = state ? 1 : 0; |
| 981 | 981 | |
| 982 | 982 | /* Schedule a write to PC2 */ |
| 983 | | |
| 983 | | |
| 984 | 984 | } |
| 985 | 985 | |
| 986 | 986 | |
| r10315 | r10316 | |
| 2767 | 2767 | } |
| 2768 | 2768 | |
| 2769 | 2769 | /* Schedule a write to PC2 */ |
| 2770 | | |
| 2770 | | |
| 2771 | 2771 | |
| 2772 | 2772 | return data; |
| 2773 | 2773 | } |
| r10315 | r10316 | |
| 3140 | 3140 | state->gate_array.hsync = 0; |
| 3141 | 3141 | state->gate_array.vsync = 0; |
| 3142 | 3142 | |
| 3143 | timer_set( | |
| 3143 | machine->scheduler().timer_set( | |
| 3144 | 3144 | } |
| 3145 | 3145 | |
| 3146 | 3146 | |
| r10315 | r10316 | |
| 3188 | 3188 | amstrad_GateArray_write(machine, 0x081); // Epyx World of Sports requires upper ROM to be enabled by default |
| 3189 | 3189 | |
| 3190 | 3190 | // multiface_init(); |
| 3191 | timer_set( | |
| 3191 | machine->scheduler().timer_set( | |
| 3192 | 3192 | } |
| 3193 | 3193 | |
| 3194 | 3194 | MACHINE_START( gx4000 ) |
| r10315 | r10316 | |
| 3234 | 3234 | amstrad_GateArray_write(machine, 0x081); // Epyx World of Sports requires upper ROM to be enabled by default |
| 3235 | 3235 | // multiface_init(); |
| 3236 | 3236 | |
| 3237 | timer_set( | |
| 3237 | machine->scheduler().timer_set( | |
| 3238 | 3238 | } |
| 3239 | 3239 | |
| 3240 | 3240 | MACHINE_START( kccomp ) |
| r10315 | r10316 | |
| 3292 | 3292 | amstrad_common_init(machine); |
| 3293 | 3293 | amstrad_reset_machine(machine); |
| 3294 | 3294 | |
| 3295 | timer_set( | |
| 3295 | machine->scheduler().timer_set( | |
| 3296 | 3296 | } |
| 3297 | 3297 | |
| 3298 | 3298 |
| r10315 | r10316 | |
|---|---|---|
| 202 | 202 | |
| 203 | 203 | void hector_disc2_init( running_machine *machine) |
| 204 | 204 | { |
| 205 | DMA_timer = timer_alloc(machine, Callback_DMA_irq, 0); | |
| 206 | INT_timer = timer_alloc(machine, Callback_INT_irq, 0); | |
| 205 | DMA_timer = machine->scheduler().timer_alloc(FUNC(Callback_DMA_irq)); | |
| 206 | INT_timer = machine->scheduler().timer_alloc(FUNC(Callback_INT_irq)); | |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | static TIMER_CALLBACK( Callback_DMA_irq ) |
| r10315 | r10316 | |
|---|---|---|
| 2018 | 2018 | w->complete_command_delay = 12; |
| 2019 | 2019 | |
| 2020 | 2020 | /* allocate timers */ |
| 2021 | w->timer_cmd = timer_alloc(device->machine, wd17xx_command_callback, (void *)device); | |
| 2022 | w->timer_data = timer_alloc(device->machine, wd17xx_data_callback, (void *)device); | |
| 2023 | w->timer_rs = timer_alloc(device->machine, wd17xx_read_sector_callback, (void *)device); | |
| 2024 | w->timer_ws = timer_alloc(device->machine, wd17xx_write_sector_callback, (void *)device); | |
| 2021 | w->timer_cmd = device->machine->scheduler().timer_alloc(FUNC(wd17xx_command_callback), (void *)device); | |
| 2022 | w->timer_data = device->machine->scheduler().timer_alloc(FUNC(wd17xx_data_callback), (void *)device); | |
| 2023 | w->timer_rs = device->machine->scheduler().timer_alloc(FUNC(wd17xx_read_sector_callback), (void *)device); | |
| 2024 | w->timer_ws = device->machine->scheduler().timer_alloc(FUNC(wd17xx_write_sector_callback), (void *)device); | |
| 2025 | 2025 | |
| 2026 | 2026 | /* resolve callbacks */ |
| 2027 | 2027 | devcb_resolve_read_line(&w->in_dden_func, &w->intf->in_dden_func, device); |
| r10315 | r10316 | |
|---|---|---|
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | /* Check if lightgun has been chosen as input: if so, enable crosshair */ |
| 359 | timer_set( | |
| 359 | machine->scheduler().timer_set( | |
| 360 | 360 | |
| 361 | 361 | /* Player 1 */ |
| 362 | 362 | switch (input_port_read_safe(machine, "CTRLSEL", 0x00) & 0x0f) |
| r10315 | r10316 | |
| 1705 | 1705 | sms_state *state = machine->driver_data<sms_state>(); |
| 1706 | 1706 | |
| 1707 | 1707 | machine->add_notifier(MACHINE_NOTIFY_EXIT, sms_machine_stop); |
| 1708 | state->rapid_fire_timer = timer_alloc( | |
| 1708 | state->rapid_fire_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1709 | 1709 | timer_adjust_periodic(state->rapid_fire_timer, attotime::from_hz(10), 0, attotime::from_hz(10)); |
| 1710 | 1710 | |
| 1711 | state->lphaser_1_timer = timer_alloc(machine, lphaser_1_callback , NULL); | |
| 1712 | state->lphaser_2_timer = timer_alloc(machine, lphaser_2_callback , NULL); | |
| 1711 | state->lphaser_1_timer = machine->scheduler().timer_alloc(FUNC(lphaser_1_callback)); | |
| 1712 | state->lphaser_2_timer = machine->scheduler().timer_alloc(FUNC(lphaser_2_callback)); | |
| 1713 | 1713 | |
| 1714 | 1714 | state->main_cpu = machine->device("maincpu"); |
| 1715 | 1715 | state->control_cpu = machine->device("control"); |
| r10315 | r10316 | |
| 1720 | 1720 | state->right_lcd = machine->device("right_lcd"); |
| 1721 | 1721 | |
| 1722 | 1722 | /* Check if lightgun has been chosen as input: if so, enable crosshair */ |
| 1723 | timer_set( | |
| 1723 | machine->scheduler().timer_set( | |
| 1724 | 1724 | } |
| 1725 | 1725 | |
| 1726 | 1726 | #ifdef MESS |
| r10315 | r10316 | |
|---|---|---|
| 23 | 23 | { |
| 24 | 24 | poly88_state *state = space->machine->driver_data<poly88_state>(); |
| 25 | 25 | logerror("poly88_baud_rate_w %02x\n",data); |
| 26 | state->usart_timer = | |
| 26 | state->usart_timer = | |
| 27 | 27 | timer_adjust_periodic(state->usart_timer, attotime::zero, 0, attotime::from_hz(300)); |
| 28 | 28 | |
| 29 | 29 | } |
| r10315 | r10316 | |
| 209 | 209 | poly88_state *state = machine->driver_data<poly88_state>(); |
| 210 | 210 | state->previous_level = 0;; |
| 211 | 211 | state->clk_level = state->clk_level_tape = 1; |
| 212 | state->cassette_timer = timer_alloc( | |
| 212 | state->cassette_timer = machine->scheduler().timer_alloc(FUNC( | |
| 213 | 213 | timer_adjust_periodic(state->cassette_timer, attotime::zero, 0, attotime::from_hz(600)); |
| 214 | 214 | |
| 215 | 215 | serial_connection_init(machine, &state->cassette_serial_connection); |
| 216 | 216 | serial_connection_set_in_callback(machine, &state->cassette_serial_connection, poly88_cassette_write); |
| 217 | 217 | |
| 218 | timer_pulse( | |
| 218 | machine->scheduler().timer_pulse( | |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | MACHINE_RESET(poly88) |
| r10315 | r10316 | |
| 225 | 225 | state->intr = 0; |
| 226 | 226 | state->last_code = 0; |
| 227 | 227 | |
| 228 | timer_set( | |
| 228 | machine->scheduler().timer_set( | |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | INTERRUPT_GEN( poly88_interrupt ) |
| r10315 | r10316 | |
|---|---|---|
| 1029 | 1029 | else |
| 1030 | 1030 | { |
| 1031 | 1031 | state->mmc1_reg_write_enable = 0; |
| 1032 | | |
| 1032 | | |
| 1033 | 1033 | } |
| 1034 | 1034 | |
| 1035 | 1035 | if (data & 0x80) |
| r10315 | r10316 | |
|---|---|---|
| 101 | 101 | |
| 102 | 102 | MACHINE_START(llc1) |
| 103 | 103 | { |
| 104 | timer_pulse( | |
| 104 | machine->scheduler().timer_pulse( | |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | DRIVER_INIT(llc2) |
| r10315 | r10316 | |
|---|---|---|
| 337 | 337 | devcb_resolve_write_line(&rp5c01a->out_alarm_func, &intf->out_alarm_func, device); |
| 338 | 338 | |
| 339 | 339 | /* create the timers */ |
| 340 | rp5c01a->clock_timer = | |
| 340 | rp5c01a->clock_timer = | |
| 341 | 341 | timer_adjust_periodic(rp5c01a->clock_timer, attotime::zero, 0, attotime::from_hz(1)); |
| 342 | 342 | |
| 343 | rp5c01a->alarm_timer = | |
| 343 | rp5c01a->alarm_timer = | |
| 344 | 344 | timer_adjust_periodic(rp5c01a->alarm_timer, attotime::zero, 0, attotime::from_hz(16)); |
| 345 | 345 | timer_enable(rp5c01a->alarm_timer, 0); |
| 346 | 346 |
| r10315 | r10316 | |
|---|---|---|
| 229 | 229 | MACHINE_START( samcoupe ) |
| 230 | 230 | { |
| 231 | 231 | samcoupe_state *state = machine->driver_data<samcoupe_state>(); |
| 232 | state->mouse_reset = timer_alloc( | |
| 232 | state->mouse_reset = machine->scheduler().timer_alloc(FUNC( | |
| 233 | 233 | |
| 234 | 234 | /* schedule our video updates */ |
| 235 | state->video_update_timer = timer_alloc( | |
| 235 | state->video_update_timer = machine->scheduler().timer_alloc(FUNC( | |
| 236 | 236 | timer_adjust_oneshot(state->video_update_timer, machine->primary_screen->time_until_pos(0, 0), 0); |
| 237 | 237 | } |
| 238 | 238 |
| r10315 | r10316 | |
|---|---|---|
| 609 | 609 | } |
| 610 | 610 | |
| 611 | 611 | /* allocate reset timer */ |
| 612 | m_reset_timer = timer_alloc( | |
| 612 | m_reset_timer = machine->scheduler().timer_alloc(FUNC( | |
| 613 | 613 | |
| 614 | 614 | /* register for state saving */ |
| 615 | 615 | state_save_register_postload(machine, comx35_state_save_postload, NULL); |
| r10315 | r10316 | |
|---|---|---|
| 908 | 908 | state->reg_load=1; |
| 909 | 909 | state->nmi_data=0xff; |
| 910 | 910 | |
| 911 | state->cassette_data_timer = timer_alloc( | |
| 911 | state->cassette_data_timer = machine->scheduler().timer_alloc(FUNC(c | |
| 912 | 912 | timer_adjust_periodic( state->cassette_data_timer, attotime::zero, 0, attotime::from_hz(11025) ); |
| 913 | 913 | state->printer = machine->device("centronics"); |
| 914 | 914 | state->ay31015 = machine->device("tr1602"); |
| r10315 | r10316 | |
|---|---|---|
| 135 | 135 | odyssey2_state *state = space->machine->driver_data<odyssey2_state>(); |
| 136 | 136 | UINT8 data = state->p1; |
| 137 | 137 | |
| 138 | logerror("%.9f p1 read %.2x\n", | |
| 138 | logerror("%.9f p1 read %.2x\n", | |
| 139 | 139 | return data; |
| 140 | 140 | } |
| 141 | 141 | |
| r10315 | r10316 | |
| 148 | 148 | |
| 149 | 149 | odyssey2_lum_w ( space, 0, state->p1 >> 7 ); |
| 150 | 150 | |
| 151 | logerror("%.6f p1 written %.2x\n", | |
| 151 | logerror("%.6f p1 written %.2x\n", | |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | READ8_HANDLER( odyssey2_getp2 ) |
| r10315 | r10316 | |
| 183 | 183 | else |
| 184 | 184 | state->p2 = state->p2 | 0xF0; |
| 185 | 185 | |
| 186 | logerror("%.6f p2 read %.2x\n", | |
| 186 | logerror("%.6f p2 read %.2x\n", | |
| 187 | 187 | return state->p2; |
| 188 | 188 | } |
| 189 | 189 | |
| r10315 | r10316 | |
| 192 | 192 | odyssey2_state *state = space->machine->driver_data<odyssey2_state>(); |
| 193 | 193 | state->p2 = data; |
| 194 | 194 | |
| 195 | logerror("%.6f p2 written %.2x\n", | |
| 195 | logerror("%.6f p2 written %.2x\n", | |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | READ8_HANDLER( odyssey2_getbus ) |
| r10315 | r10316 | |
| 206 | 206 | if ((state->p2 & P2_KEYBOARD_SELECT_MASK) == 0) |
| 207 | 207 | data &= input_port_read(space->machine, "JOY1"); /* read joystick 2 */ |
| 208 | 208 | |
| 209 | logerror("%.6f bus read %.2x\n", | |
| 209 | logerror("%.6f bus read %.2x\n", | |
| 210 | 210 | return data; |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | WRITE8_HANDLER( odyssey2_putbus ) |
| 214 | 214 | { |
| 215 | logerror("%.6f bus written %.2x\n", | |
| 215 | logerror("%.6f bus written %.2x\n", | |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | /////////////////////////////////// |
| r10315 | r10316 | |
|---|---|---|
| 191 | 191 | |
| 192 | 192 | state->ti_calculator_model = TI_81; |
| 193 | 193 | |
| 194 | timer_pulse( | |
| 194 | machine->scheduler().timer_pulse( | |
| 195 | 195 | |
| 196 | 196 | memory_unmap_write(space, 0x0000, 0x3fff, 0, 0); |
| 197 | 197 | memory_unmap_write(space, 0x4000, 0x7fff, 0, 0); |
| r10315 | r10316 | |
| 232 | 232 | |
| 233 | 233 | state->ti_calculator_model = TI_82; |
| 234 | 234 | |
| 235 | timer_pulse( | |
| 235 | machine->scheduler().timer_pulse( | |
| 236 | 236 | |
| 237 | 237 | memory_unmap_write(space, 0x0000, 0x3fff, 0, 0); |
| 238 | 238 | memory_unmap_write(space, 0x4000, 0x7fff, 0, 0); |
| r10315 | r10316 | |
| 267 | 267 | |
| 268 | 268 | state->ti_calculator_model = TI_85; |
| 269 | 269 | |
| 270 | timer_pulse( | |
| 270 | machine->scheduler().timer_pulse( | |
| 271 | 271 | |
| 272 | 272 | memory_unmap_write(space, 0x0000, 0x3fff, 0, 0); |
| 273 | 273 | memory_unmap_write(space, 0x4000, 0x7fff, 0, 0); |
| r10315 | r10316 | |
| 333 | 333 | |
| 334 | 334 | state->ti_calculator_model = TI_83p; |
| 335 | 335 | |
| 336 | timer_pulse( | |
| 336 | machine->scheduler().timer_pulse( | |
| 337 | 337 | } |
| 338 | 338 | } |
| 339 | 339 | |
| r10315 | r10316 | |
| 374 | 374 | |
| 375 | 375 | state->ti_calculator_model = TI_86; |
| 376 | 376 | |
| 377 | timer_pulse( | |
| 377 | machine->scheduler().timer_pulse( | |
| 378 | 378 | } |
| 379 | 379 | } |
| 380 | 380 |
| r10315 | r10316 | |
|---|---|---|
| 121 | 121 | // c64h156_t *c64h156 = get_safe_token(device); |
| 122 | 122 | |
| 123 | 123 | /* allocate data timer */ |
| 124 | // c64h156->bit_timer = | |
| 124 | // c64h156->bit_timer = | |
| 125 | 125 | |
| 126 | 126 | /* register for state saving */ |
| 127 | 127 | // state_save_register_device_item(device, 0, c64h156->); |
| r10315 | r10316 | |
|---|---|---|
| 320 | 320 | devcb_resolve_write_line(&msm58321->out_busy_func, &intf->out_busy_func, device); |
| 321 | 321 | |
| 322 | 322 | /* create busy timer */ |
| 323 | msm58321->busy_timer = | |
| 323 | msm58321->busy_timer = | |
| 324 | 324 | timer_adjust_periodic(msm58321->busy_timer, attotime::zero, 0, attotime::from_hz(2)); |
| 325 | 325 | |
| 326 | 326 | /* register for state saving */ |
| r10315 | r10316 | |
|---|---|---|
| 316 | 316 | devcb_resolve_write_line(&m_out_to_func, &m_config.out_to_func, this); |
| 317 | 317 | |
| 318 | 318 | // allocate timers |
| 319 | m_timer = | |
| 319 | m_timer = | |
| 320 | 320 | |
| 321 | 321 | // register for state saving |
| 322 | 322 | state_save_register_device_item(this, 0, m_io_m); |
| r10315 | r10316 | |
|---|---|---|
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | /* create the timers */ |
| 214 | mm74c922->scan_timer = | |
| 214 | mm74c922->scan_timer = | |
| 215 | 215 | timer_adjust_periodic(mm74c922->scan_timer, attotime::zero, 0, attotime::from_hz(50)); |
| 216 | 216 | |
| 217 | 217 | /* register for state saving */ |
| r10315 | r10316 | |
|---|---|---|
| 426 | 426 | { |
| 427 | 427 | compis_state *state = device->machine->driver_data<compis_state>(); |
| 428 | 428 | if (LOG_INTERRUPTS) |
| 429 | logerror("(%f) **** Acknowledged interrupt vector %02X\n", | |
| 429 | logerror("(%f) **** Acknowledged interrupt vector %02X\n", | |
| 430 | 430 | |
| 431 | 431 | /* clear the interrupt */ |
| 432 | 432 | cpu_set_input_line(device, 0, CLEAR_LINE); |
| r10315 | r10316 | |
| 542 | 542 | state->i186.intr.pending = 1; |
| 543 | 543 | cpuexec_trigger(machine, CPU_RESUME_TRIGGER); |
| 544 | 544 | if (LOG_OPTIMIZATION) logerror(" - trigger due to interrupt pending\n"); |
| 545 | if (LOG_INTERRUPTS) logerror("(%f) **** Requesting interrupt vector %02X\n", | |
| 545 | if (LOG_INTERRUPTS) logerror("(%f) **** Requesting interrupt vector %02X\n", | |
| 546 | 546 | } |
| 547 | 547 | |
| 548 | 548 | |
| r10315 | r10316 | |
| 568 | 568 | case 0x0f: state->i186.intr.in_service &= ~0x80; break; |
| 569 | 569 | default: logerror("%05X:ERROR - 80186 EOI with unknown vector %02X\n", cpu_get_pc(machine->device("maincpu")), data & 0x1f); |
| 570 | 570 | } |
| 571 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for vector %02X\n", | |
| 571 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for vector %02X\n", | |
| 572 | 572 | } |
| 573 | 573 | |
| 574 | 574 | /* non-specific case */ |
| r10315 | r10316 | |
| 581 | 581 | if ((state->i186.intr.timer & 7) == i && (state->i186.intr.in_service & 0x01)) |
| 582 | 582 | { |
| 583 | 583 | state->i186.intr.in_service &= ~0x01; |
| 584 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for timer\n", | |
| 584 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for timer\n", | |
| 585 | 585 | return; |
| 586 | 586 | } |
| 587 | 587 | |
| r10315 | r10316 | |
| 590 | 590 | if ((state->i186.intr.dma[j] & 7) == i && (state->i186.intr.in_service & (0x04 << j))) |
| 591 | 591 | { |
| 592 | 592 | state->i186.intr.in_service &= ~(0x04 << j); |
| 593 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for DMA%d\n", | |
| 593 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for DMA%d\n", | |
| 594 | 594 | return; |
| 595 | 595 | } |
| 596 | 596 | |
| r10315 | r10316 | |
| 599 | 599 | if ((state->i186.intr.ext[j] & 7) == i && (state->i186.intr.in_service & (0x10 << j))) |
| 600 | 600 | { |
| 601 | 601 | state->i186.intr.in_service &= ~(0x10 << j); |
| 602 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for INT%d\n", | |
| 602 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for INT%d\n", | |
| 603 | 603 | return; |
| 604 | 604 | } |
| 605 | 605 | } |
| r10315 | r10316 | |
| 1324 | 1324 | { |
| 1325 | 1325 | compis_state *state = machine->driver_data<compis_state>(); |
| 1326 | 1326 | /* create timers here so they stick around */ |
| 1327 | state->i186.timer[0].int_timer = timer_alloc(machine, internal_timer_int, NULL); | |
| 1328 | state->i186.timer[1].int_timer = timer_alloc(machine, internal_timer_int, NULL); | |
| 1329 | state->i186.timer[2].int_timer = timer_alloc(machine, internal_timer_int, NULL); | |
| 1330 | state->i186.timer[0].time_timer = timer_alloc(machine, NULL, NULL); | |
| 1331 | state->i186.timer[1].time_timer = timer_alloc(machine, NULL, NULL); | |
| 1332 | state->i186.timer[2].time_timer = timer_alloc(machine, NULL, NULL); | |
| 1333 | state->i186.dma[0].finish_timer = timer_alloc(machine, dma_timer_callback, NULL); | |
| 1334 | state->i186.dma[1].finish_timer = timer_alloc(machine, dma_timer_callback, NULL); | |
| 1327 | state->i186.timer[0].int_timer = machine->scheduler().timer_alloc(FUNC(internal_timer_int)); | |
| 1328 | state->i186.timer[1].int_timer = machine->scheduler().timer_alloc(FUNC(internal_timer_int)); | |
| 1329 | state->i186.timer[2].int_timer = machine->scheduler().timer_alloc(FUNC(internal_timer_int)); | |
| 1330 | state->i186.timer[0].time_timer = machine->scheduler().timer_alloc(FUNC(NULL)); | |
| 1331 | state->i186.timer[1].time_timer = machine->scheduler().timer_alloc(FUNC(NULL)); | |
| 1332 | state->i186.timer[2].time_timer = machine->scheduler().timer_alloc(FUNC(NULL)); | |
| 1333 | state->i186.dma[0].finish_timer = machine->scheduler().timer_alloc(FUNC(dma_timer_callback)); | |
| 1334 | state->i186.dma[1].finish_timer = machine->scheduler().timer_alloc(FUNC(dma_timer_callback)); | |
| 1335 | 1335 | } |
| 1336 | 1336 | |
| 1337 | 1337 | /*-------------------------------------------------------------------------*/ |
| r10315 | r10316 | |
|---|---|---|
| 1356 | 1356 | // |
| 1357 | 1357 | // Set up timers for command completion and timeout from host |
| 1358 | 1358 | // |
| 1359 | timer_set( | |
| 1359 | machine->scheduler().timer_set( | |
| 1360 | 1360 | timer_enable(c->timeout_timer, 0); // We've received enough data, disable the timeout timer |
| 1361 | 1361 | |
| 1362 | 1362 | c->delay = 0; // Reset delay for next function |
| r10315 | r10316 | |
| 1455 | 1455 | c->xmit_bytes = 0; // We don't have anything to say to the host |
| 1456 | 1456 | c->recv_bytes = 0; // We aren't waiting on additional data from the host |
| 1457 | 1457 | |
| 1458 | c->timeout_timer = timer_alloc( | |
| 1458 | c->timeout_timer = machine->scheduler().timer_alloc(FUNC(c | |
| 1459 | 1459 | timer_adjust_oneshot(c->timeout_timer, attotime::from_seconds(4), CALLBACK_TIMEOUT); |
| 1460 | 1460 | timer_enable(c->timeout_timer, 0); // Start this timer out disabled |
| 1461 | 1461 | |
| r10315 | r10316 | |
| 1623 | 1623 | c->xmit_bytes = 0; // We don't have anything more to say |
| 1624 | 1624 | c->recv_bytes = 0; // No active commands |
| 1625 | 1625 | |
| 1626 | | |
| 1626 | | |
| 1627 | 1627 | |
| 1628 | 1628 | // c->status &= ~(CONTROLLER_DIRECTION | CONTROLLER_BUSY); // Put us in Idle, Host-to-Controller mode |
| 1629 | 1629 | } else { |
| 1630 | 1630 | // |
| 1631 | 1631 | // Not finished with this packet. Insert an interbyte delay and then let the host continue |
| 1632 | 1632 | // |
| 1633 | | |
| 1633 | | |
| 1634 | 1634 | } |
| 1635 | 1635 | |
| 1636 | 1636 | return result; |
| r10315 | r10316 | |
| 1704 | 1704 | // Make the controller busy for a few microseconds while the command is processed |
| 1705 | 1705 | // |
| 1706 | 1706 | c->status |= CONTROLLER_BUSY; |
| 1707 | | |
| 1707 | | |
| 1708 | 1708 | } |
| 1709 | 1709 | } |
| r10315 | r10316 | |
|---|---|---|
| 720 | 720 | floppy_install_load_proc(c1551->image, on_disk_change); |
| 721 | 721 | |
| 722 | 722 | /* allocate data timer */ |
| 723 | c1551->bit_timer = | |
| 723 | c1551->bit_timer = | |
| 724 | 724 | |
| 725 | 725 | /* map TPI1 to host CPU memory space */ |
| 726 | 726 | address_space *program = cpu_get_address_space(device->machine->device(config->cpu_tag), ADDRESS_SPACE_PROGRAM); |
| r10315 | r10316 | |
|---|---|---|
| 197 | 197 | state->ws_bios_bank = NULL; |
| 198 | 198 | state->system_type = TYPE_WSWAN; |
| 199 | 199 | machine->add_notifier(MACHINE_NOTIFY_EXIT, wswan_machine_stop ); |
| 200 | state->vdp.timer = timer_alloc( | |
| 200 | state->vdp.timer = machine->scheduler().timer_alloc(FUNC( | |
| 201 | 201 | timer_adjust_periodic( state->vdp.timer, attotime::from_ticks( 256, 3072000 ), 0, attotime::from_ticks( 256, 3072000 ) ); |
| 202 | 202 | |
| 203 | 203 | wswan_setup_bios(machine); |
| 204 | 204 | |
| 205 | 205 | /* Set up RTC timer */ |
| 206 | 206 | if ( state->rtc.present ) |
| 207 | timer_pulse( | |
| 207 | machine->scheduler().timer_pulse( | |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | MACHINE_START( wscolor ) |
| r10315 | r10316 | |
| 213 | 213 | state->ws_bios_bank = NULL; |
| 214 | 214 | state->system_type = TYPE_WSC; |
| 215 | 215 | machine->add_notifier(MACHINE_NOTIFY_EXIT, wswan_machine_stop ); |
| 216 | state->vdp.timer = timer_alloc( | |
| 216 | state->vdp.timer = machine->scheduler().timer_alloc(FUNC( | |
| 217 | 217 | timer_adjust_periodic( state->vdp.timer, attotime::from_ticks( 256, 3072000 ), 0, attotime::from_ticks( 256, 3072000 ) ); |
| 218 | 218 | |
| 219 | 219 | wswan_setup_bios(machine); |
| 220 | 220 | |
| 221 | 221 | /* Set up RTC timer */ |
| 222 | 222 | if ( state->rtc.present ) |
| 223 | timer_pulse( | |
| 223 | machine->scheduler().timer_pulse( | |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | MACHINE_RESET( wswan ) |
| r10315 | r10316 | |
|---|---|---|
| 151 | 151 | if ((cassette_input(space->machine->device("cassette")) < -0.75) && state->tape_bit) |
| 152 | 152 | { |
| 153 | 153 | state->tape_bit = 0x00; |
| 154 | | |
| 154 | | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | data &= ~state->tape_bit; |
| r10315 | r10316 | |
| 216 | 216 | if ((cassette_input(space->machine->device("cassette")) < -0.75) && state->tape_bit) |
| 217 | 217 | { |
| 218 | 218 | state->tape_bit = 0x00; |
| 219 | | |
| 219 | | |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | data &= ~state->tape_bit; |
| r10315 | r10316 | |
| 288 | 288 | if ((cassette_input(space->machine->device("cassette")) < -0.75) && state->tape_bit) |
| 289 | 289 | { |
| 290 | 290 | state->tape_bit = 0x00; |
| 291 | | |
| 291 | | |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | data &= ~state->tape_bit; |
| r10315 | r10316 | |
| 364 | 364 | if ((cassette_input(space->machine->device("cassette")) < -0.75) && state->tape_bit) |
| 365 | 365 | { |
| 366 | 366 | state->tape_bit = 0x00; |
| 367 | | |
| 367 | | |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | data &= ~state->tape_bit; |
| r10315 | r10316 | |
|---|---|---|
| 147 | 147 | // vic2_frame_interrupt (device); |
| 148 | 148 | |
| 149 | 149 | /* check if lightpen has been chosen as input: if so, enable crosshair */ |
| 150 | | |
| 150 | | |
| 151 | 151 | |
| 152 | 152 | set_led_status (device->machine, 1, input_port_read(device->machine, "SPECIAL") & 0x40 ? 1 : 0); /* Shift Lock */ |
| 153 | 153 | set_led_status (device->machine, 0, input_port_read(device->machine, "CTRLSEL") & 0x80 ? 1 : 0); /* Joystick Swap */ |
| r10315 | r10316 | |
|---|---|---|
| 405 | 405 | state_save_register_item( machine, "z80ne", NULL, 0, state->lx383_downsampler ); |
| 406 | 406 | state_save_register_item_array( machine, "z80ne", NULL, 0, state->lx383_key ); |
| 407 | 407 | state_save_register_item( machine, "z80ne", NULL, 0, state->nmi_delay_counter ); |
| 408 | state->cassette_timer = timer_alloc(machine, z80ne_cassette_tc, NULL); | |
| 409 | timer_pulse( machine, attotime::from_hz(1000), NULL, 0, z80ne_kbd_scan ); | |
| 408 | state->cassette_timer = machine->scheduler().timer_alloc(FUNC(z80ne_cassette_tc)); | |
| 409 | machine->scheduler().timer_pulse( attotime::from_hz(1000), FUNC(z80ne_kbd_scan)); | |
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | MACHINE_START( z80net ) |
| r10315 | r10316 | |
|---|---|---|
| 36 | 36 | void pc1401_outc(device_t *device, int data) |
| 37 | 37 | { |
| 38 | 38 | pc1401_state *state = device->machine->driver_data<pc1401_state>(); |
| 39 | //logerror("%g outc %.2x\n", | |
| 39 | //logerror("%g outc %.2x\n", | |
| 40 | 40 | state->portc = data; |
| 41 | 41 | } |
| 42 | 42 | |
| r10315 | r10316 | |
| 249 | 249 | gfx[i]=i; |
| 250 | 250 | |
| 251 | 251 | state->power = 1; |
| 252 | timer_set( | |
| 252 | machine->scheduler().timer_set( | |
| 253 | 253 | } |
| r10315 | r10316 | |
|---|---|---|
| 495 | 495 | devcb_resolve_write_line(&upd1990a->out_tp_func, &intf->out_tp_func, device); |
| 496 | 496 | |
| 497 | 497 | /* create the timers */ |
| 498 | upd1990a->clock_timer = | |
| 498 | upd1990a->clock_timer = | |
| 499 | 499 | timer_adjust_periodic(upd1990a->clock_timer, attotime::zero, 0, attotime::from_hz(1)); |
| 500 | 500 | |
| 501 | upd1990a->tp_timer = | |
| 501 | upd1990a->tp_timer = | |
| 502 | 502 | |
| 503 | upd1990a->data_out_timer = | |
| 503 | upd1990a->data_out_timer = | |
| 504 | 504 | |
| 505 | 505 | /* register for state saving */ |
| 506 | 506 | state_save_register_global_array(device->machine, upd1990a->time_counter); |
| r10315 | r10316 | |
|---|---|---|
| 148 | 148 | seconds_t current_interval; |
| 149 | 149 | |
| 150 | 150 | /* update clock_curtime */ |
| 151 | current_interval = | |
| 151 | current_interval = | |
| 152 | 152 | state->clock_curtime += current_interval - state->clock_curtime_interval; |
| 153 | 153 | state->clock_curtime_interval = current_interval; |
| 154 | 154 | |
| r10315 | r10316 | |
| 1802 | 1802 | state_save_register_item(machine, "SNDGLUADDR", NULL,0, state->sndglu_addr); |
| 1803 | 1803 | state_save_register_item(machine, "SNDGLUDUMMYRD", NULL,0, state->sndglu_dummy_read); |
| 1804 | 1804 | |
| 1805 | state->clock_timer = timer_alloc( | |
| 1805 | state->clock_timer = machine->scheduler().timer_alloc(FUNC(a | |
| 1806 | 1806 | timer_adjust_periodic(state->clock_timer, attotime::from_seconds(1), 0, attotime::from_seconds(1)); |
| 1807 | 1807 | |
| 1808 | state->qsecond_timer = timer_alloc( | |
| 1808 | state->qsecond_timer = machine->scheduler().timer_alloc(FUNC(a | |
| 1809 | 1809 | timer_adjust_periodic(state->qsecond_timer, attotime::from_usec(266700), 0, attotime::from_usec(266700)); |
| 1810 | 1810 | |
| 1811 | state->scanline_timer = timer_alloc( | |
| 1811 | state->scanline_timer = machine->scheduler().timer_alloc(FUNC(a | |
| 1812 | 1812 | timer_adjust_oneshot(state->scanline_timer, attotime::never, 0); |
| 1813 | 1813 | |
| 1814 | 1814 | // fire on scanline zero |
| r10315 | r10316 | |
|---|---|---|
| 127 | 127 | |
| 128 | 128 | sasi->req = 0; |
| 129 | 129 | sasi->status_port &= ~0x01; |
| 130 | | |
| 130 | | |
| 131 | 131 | sasi->transfer_byte_count++; |
| 132 | 132 | if(sasi->transfer_byte_count >= sasi->transfer_byte_total) |
| 133 | 133 | { |
| r10315 | r10316 | |
| 165 | 165 | // reset REQ temporarily |
| 166 | 166 | sasi->req = 0; |
| 167 | 167 | sasi->status_port &= ~0x01; |
| 168 | | |
| 168 | | |
| 169 | 169 | |
| 170 | 170 | sasi->command_byte_count++; |
| 171 | 171 | if(sasi->command_byte_count >= sasi->command_byte_total) |
| r10315 | r10316 | |
| 310 | 310 | sasi->status_port |= 0x08; |
| 311 | 311 | sasi->command_byte_count = 0; |
| 312 | 312 | sasi->command_byte_total = 0; |
| 313 | | |
| 313 | | |
| 314 | 314 | } |
| 315 | 315 | } |
| 316 | 316 | break; |
| r10315 | r10316 | |
| 362 | 362 | // reset REQ temporarily |
| 363 | 363 | sasi->req = 0; |
| 364 | 364 | sasi->status_port &= ~0x01; |
| 365 | | |
| 365 | | |
| 366 | 366 | |
| 367 | 367 | return sasi->status; |
| 368 | 368 | } |
| r10315 | r10316 | |
| 418 | 418 | |
| 419 | 419 | sasi->req = 0; |
| 420 | 420 | sasi->status_port &= ~0x01; |
| 421 | | |
| 421 | | |
| 422 | 422 | sasi->transfer_byte_count++; |
| 423 | 423 | if(sasi->transfer_byte_count >= sasi->transfer_byte_total) |
| 424 | 424 | { |
| r10315 | r10316 | |
|---|---|---|
| 728 | 728 | if (mac->m_kbd_comm == TRUE) |
| 729 | 729 | { |
| 730 | 730 | mac->m_kbd_shift_reg = data; |
| 731 | timer_set( | |
| 731 | machine->scheduler().timer_set( | |
| 732 | 732 | } |
| 733 | 733 | } |
| 734 | 734 | |
| r10315 | r10316 | |
| 741 | 741 | /* Mac pulls CB2 down to initiate communication */ |
| 742 | 742 | mac->m_kbd_comm = TRUE; |
| 743 | 743 | mac->m_kbd_receive = TRUE; |
| 744 | | |
| 744 | | |
| 745 | 745 | } |
| 746 | 746 | if (mac->m_kbd_comm == TRUE && mac->m_kbd_receive == TRUE) |
| 747 | 747 | { |
| r10315 | r10316 | |
| 3031 | 3031 | { |
| 3032 | 3032 | if (has_adb()) |
| 3033 | 3033 | { |
| 3034 | this->adb_timer = timer_alloc(mac | |
| 3034 | this->adb_timer = machine->scheduler().timer_alloc(FUNC(mac | |
| 3035 | 3035 | timer_adjust_oneshot(this->adb_timer, attotime::never, 0); |
| 3036 | 3036 | |
| 3037 | 3037 | // also allocate PMU timer |
| 3038 | 3038 | if (ADB_IS_PM_CLASS) |
| 3039 | 3039 | { |
| 3040 | m_pmu_send_timer = timer_alloc(mac | |
| 3040 | m_pmu_send_timer = machine->scheduler().timer_alloc(FUNC(mac | |
| 3041 | 3041 | timer_adjust_oneshot(this->adb_timer, attotime::never, 0); |
| 3042 | 3042 | } |
| 3043 | 3043 | |
| 3044 | 3044 | } |
| 3045 | this->scanline_timer = timer_alloc(mac | |
| 3045 | this->scanline_timer = machine->scheduler().timer_alloc(FUNC(mac | |
| 3046 | 3046 | timer_adjust_oneshot(this->scanline_timer, machine->primary_screen->time_until_pos(0, 0), 0); |
| 3047 | 3047 | |
| 3048 | m_6015_timer = timer_alloc(mac | |
| 3048 | m_6015_timer = machine->scheduler().timer_alloc(FUNC(mac | |
| 3049 | 3049 | timer_adjust_oneshot(m_6015_timer, attotime::never, 0); |
| 3050 | 3050 | } |
| 3051 | 3051 | |
| r10315 | r10316 | |
| 3230 | 3230 | /* setup keyboard */ |
| 3231 | 3231 | keyboard_init(mac); |
| 3232 | 3232 | |
| 3233 | mac->m_inquiry_timeout = timer_alloc( | |
| 3233 | mac->m_inquiry_timeout = machine->scheduler().timer_alloc(FUNC(in | |
| 3234 | 3234 | |
| 3235 | 3235 | /* save state stuff */ |
| 3236 | 3236 | state_save_register_postload(machine, mac_state_load, NULL); |
| r10315 | r10316 | |
|---|---|---|
| 90 | 90 | |
| 91 | 91 | _logerror( 0, ("pcf8593_init\n")); |
| 92 | 92 | memset( rtc, 0, sizeof(*rtc)); |
| 93 | rtc->timer = | |
| 93 | rtc->timer = | |
| 94 | 94 | timer_adjust_periodic(rtc->timer, attotime::from_seconds(1), 0, attotime::from_seconds(1)); |
| 95 | 95 | } |
| 96 | 96 |
| r10315 | r10316 | |
|---|---|---|
| 1546 | 1546 | |
| 1547 | 1547 | i8271->intf = (const i8271_interface*)device->baseconfig().static_config(); |
| 1548 | 1548 | |
| 1549 | i8271->data_timer = timer_alloc(device->machine, i8271_data_timer_callback, (void *)device); | |
| 1550 | i8271->command_complete_timer = timer_alloc(device->machine, i8271_timed_command_complete_callback, (void *)device); | |
| 1549 | i8271->data_timer = device->machine->scheduler().timer_alloc(FUNC(i8271_data_timer_callback), (void *)device); | |
| 1550 | i8271->command_complete_timer = device->machine->scheduler().timer_alloc(FUNC(i8271_timed_command_complete_callback), (void *)device); | |
| 1551 | 1551 | i8271->drive = 0; |
| 1552 | 1552 | i8271->pExecutionPhaseData = auto_alloc_array(device->machine, char, 0x4000); |
| 1553 | 1553 |
| r10315 | r10316 | |
|---|---|---|
| 176 | 176 | printer_output(centronics->printer, centronics->data); |
| 177 | 177 | |
| 178 | 178 | /* ready to receive more data, return BUSY to low */ |
| 179 | timer_set( | |
| 179 | machine->scheduler().timer_set( | |
| 180 | 180 | } |
| 181 | 181 | } |
| 182 | 182 | |
| r10315 | r10316 | |
| 193 | 193 | if (param == TRUE) |
| 194 | 194 | { |
| 195 | 195 | /* timer to turn ACK low to receive data */ |
| 196 | timer_set( | |
| 196 | machine->scheduler().timer_set( | |
| 197 | 197 | } |
| 198 | 198 | else |
| 199 | 199 | { |
| 200 | 200 | /* timer to return ACK to high state */ |
| 201 | timer_set( | |
| 201 | machine->scheduler().timer_set( | |
| 202 | 202 | } |
| 203 | 203 | } |
| 204 | 204 | |
| r10315 | r10316 | |
| 267 | 267 | if (centronics->strobe == TRUE && state == FALSE && centronics->busy == FALSE) |
| 268 | 268 | { |
| 269 | 269 | /* STROBE has gone low, data is ready */ |
| 270 | | |
| 270 | | |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | centronics->strobe = state; |
| r10315 | r10316 | |
|---|---|---|
| 516 | 516 | /* initialize the dmac */ |
| 517 | 517 | memset( &dmac_data, 0, sizeof( dmac_data ) ); |
| 518 | 518 | |
| 519 | dmac_data.dma_timer = timer_alloc(machine, dmac_dma_proc, NULL); | |
| 520 | tp6525_delayed_timer = timer_alloc(machine, tp6525_delayed_irq, NULL); | |
| 519 | dmac_data.dma_timer = machine->scheduler().timer_alloc(FUNC(dmac_dma_proc)); | |
| 520 | tp6525_delayed_timer = machine->scheduler().timer_alloc(FUNC(tp6525_delayed_irq)); | |
| 521 | 521 | |
| 522 | 522 | /* set up DMAC with autoconfig */ |
| 523 | 523 | amiga_add_autoconfig( machine, &dmac_device ); |
| r10315 | r10316 | |
|---|---|---|
| 286 | 286 | state->sound = machine->device("nessound"); |
| 287 | 287 | state->cart = machine->device("cart"); |
| 288 | 288 | |
| 289 | state->irq_timer = timer_alloc( | |
| 289 | state->irq_timer = machine->scheduler().timer_alloc(FUNC(ne | |
| 290 | 290 | nes_state_register(machine); |
| 291 | 291 | } |
| 292 | 292 | |
| r10315 | r10316 | |
| 532 | 532 | int cfg = input_port_read(space->machine, "CTRLSEL"); |
| 533 | 533 | |
| 534 | 534 | /* Check if lightgun has been chosen as input: if so, enable crosshair */ |
| 535 | | |
| 535 | | |
| 536 | 536 | |
| 537 | 537 | if ((cfg & 0x000f) >= 0x07) // for now we treat the FC keyboard separately from other inputs! |
| 538 | 538 | { |
| r10315 | r10316 | |
|---|---|---|
| 153 | 153 | if (uPD7002->status & 0x08) |
| 154 | 154 | { |
| 155 | 155 | // 12 bit conversion takes 10ms |
| 156 | | |
| 156 | | |
| 157 | 157 | } else { |
| 158 | 158 | // 8 bit conversion takes 4ms |
| 159 | | |
| 159 | | |
| 160 | 160 | } |
| 161 | 161 | break; |
| 162 | 162 |
| r10315 | r10316 | |
|---|---|---|
| 134 | 134 | */ |
| 135 | 135 | void at29c040a_init(running_machine *machine,int id) |
| 136 | 136 | { |
| 137 | at29c040a[id].programming_timer = timer_alloc( | |
| 137 | at29c040a[id].programming_timer = machine->scheduler().timer_alloc(FUNC(a | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | /* |
| r10315 | r10316 | |
|---|---|---|
| 149 | 149 | adc080x->eoc = 1; |
| 150 | 150 | |
| 151 | 151 | /* allocate cycle timer */ |
| 152 | adc080x->cycle_timer = | |
| 152 | adc080x->cycle_timer = | |
| 153 | 153 | timer_adjust_periodic(adc080x->cycle_timer, attotime::zero, 0, attotime::from_hz(device->clock())); |
| 154 | 154 | |
| 155 | 155 | /* register for state saving */ |
| r10315 | r10316 | |
|---|---|---|
| 30 | 30 | if(VERBOSE>=N) \ |
| 31 | 31 | { \ |
| 32 | 32 | if( M ) \ |
| 33 | logerror("%11.6f: %-24s", | |
| 33 | logerror("%11.6f: %-24s", | |
| 34 | 34 | logerror A; \ |
| 35 | 35 | } \ |
| 36 | 36 | } while (0) |
| r10315 | r10316 | |
|---|---|---|
| 289 | 289 | { |
| 290 | 290 | state->imager_status = param; |
| 291 | 291 | coffset = param > 1? 3: 0; |
| 292 | timer_set (machine, attotime::from_double(rtime * state->imager_angles[0]), NULL, state->imager_colors[coffset+2], vectrex_imager_change_color); | |
| 293 | timer_set (machine, attotime::from_double(rtime * state->imager_angles[1]), NULL, state->imager_colors[coffset+1], vectrex_imager_change_color); | |
| 294 | timer_set (machine, attotime::from_double(rtime * state->imager_angles[2]), NULL, state->imager_colors[coffset], vectrex_imager_change_color); | |
| 292 | machine->scheduler().timer_set (attotime::from_double(rtime * state->imager_angles[0]), FUNC(vectrex_imager_change_color), state->imager_colors[coffset+2]); | |
| 293 | machine->scheduler().timer_set (attotime::from_double(rtime * state->imager_angles[1]), FUNC(vectrex_imager_change_color), state->imager_colors[coffset+1]); | |
| 294 | machine->scheduler().timer_set (attotime::from_double(rtime * state->imager_angles[2]), FUNC(vectrex_imager_change_color), state->imager_colors[coffset]); | |
| 295 | 295 | |
| 296 | 296 | if (param == 2) |
| 297 | 297 | { |
| 298 | timer_set ( | |
| 298 | machine->scheduler().timer_set ( | |
| 299 | 299 | |
| 300 | 300 | /* Index hole sensor is connected to IO7 which triggers also CA1 of VIA */ |
| 301 | 301 | via_0->write_ca1(1); |
| 302 | 302 | via_0->write_ca1(0); |
| 303 | 303 | state->imager_pinlevel |= 0x80; |
| 304 | timer_set ( | |
| 304 | machine->scheduler().timer_set ( | |
| 305 | 305 | } |
| 306 | 306 | } |
| 307 | 307 | } |
| r10315 | r10316 | |
| 318 | 318 | if (!mcontrol && mcontrol ^ state->old_mcontrol) |
| 319 | 319 | { |
| 320 | 320 | state->old_mcontrol = mcontrol; |
| 321 | tmp = | |
| 321 | tmp = | |
| 322 | 322 | wavel = tmp - state->sl; |
| 323 | 323 | state->sl = tmp; |
| 324 | 324 | |
| r10315 | r10316 | |
| 345 | 345 | if (mcontrol && mcontrol ^ state->old_mcontrol) |
| 346 | 346 | { |
| 347 | 347 | state->old_mcontrol = mcontrol; |
| 348 | state->pwl = | |
| 348 | state->pwl = | |
| 349 | 349 | } |
| 350 | 350 | } |
| 351 | 351 |
| r10315 | r10316 | |
|---|---|---|
| 18 | 18 | { |
| 19 | 19 | UINT8 data = 0; |
| 20 | 20 | int delta; |
| 21 | attotime new_time = | |
| 21 | attotime new_time = | |
| 22 | 22 | const input_port_config *joystick_port = space->machine->m_portlist.find("pc_joy"); |
| 23 | 23 | |
| 24 | 24 | if (joystick_port != NULL) |
| r10315 | r10316 | |
| 46 | 46 | |
| 47 | 47 | WRITE8_HANDLER ( pc_JOY_w ) |
| 48 | 48 | { |
| 49 | JOY_time = | |
| 49 | JOY_time = | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 |
| r10315 | r10316 | |
|---|---|---|
| 545 | 545 | atapi_data_len = 0; |
| 546 | 546 | atapi_cdata_wait = 0; |
| 547 | 547 | |
| 548 | atapi_timer = timer_alloc( | |
| 548 | atapi_timer = machine->scheduler().timer_alloc(FUNC(a | |
| 549 | 549 | timer_adjust_oneshot(atapi_timer, attotime::never, 0); |
| 550 | 550 | |
| 551 | 551 | gdrom_device = NULL; |
| r10315 | r10316 | |
|---|---|---|
| 611 | 611 | state->COPS_Ready = 1; |
| 612 | 612 | |
| 613 | 613 | /* impulsion width : +/- 20us */ |
| 614 | timer_set( | |
| 614 | machine->scheduler().timer_set( | |
| 615 | 615 | } |
| 616 | 616 | |
| 617 | 617 | static void reset_COPS(lisa_state *state) |
| r10315 | r10316 | |
| 1044 | 1044 | MACHINE_START( lisa ) |
| 1045 | 1045 | { |
| 1046 | 1046 | lisa_state *state = machine->driver_data<lisa_state>(); |
| 1047 | state->mouse_timer = timer_alloc( | |
| 1047 | state->mouse_timer = machine->scheduler().timer_alloc(FUNC(h | |
| 1048 | 1048 | |
| 1049 | 1049 | /* read command every ms (don't know the real value) */ |
| 1050 | timer_pulse( | |
| 1050 | machine->scheduler().timer_pulse( | |
| 1051 | 1051 | } |
| 1052 | 1052 | |
| 1053 | 1053 | MACHINE_RESET( lisa ) |
| r10315 | r10316 | |
|---|---|---|
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | /* allocate a timer to refresh the led display */ |
| 298 | state->led_update = timer_alloc( | |
| 298 | state->led_update = machine->scheduler().timer_alloc(FUNC( | |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 |
| r10315 | r10316 | |
|---|---|---|
| 838 | 838 | } |
| 839 | 839 | |
| 840 | 840 | if (0) |
| 841 | timer_set(machine | |
| 841 | machine->scheduler().timer_set(machine | |
| 842 | 842 | } |
| 843 | 843 | |
| 844 | 844 | |
| r10315 | r10316 | |
| 958 | 958 | case 0x92: /* Better check this with docs! */ |
| 959 | 959 | if (state->blitter.time==attotime::zero) |
| 960 | 960 | { |
| 961 | if (space->machine->device<cpu_device>("maincpu")->attotime_to_cycles( | |
| 961 | if (space->machine->device<cpu_device>("maincpu")->attotime_to_cycles( | |
| 962 | 962 | { |
| 963 | 963 | state->suzy.data[offset] &= ~0x01; //state->blitter finished |
| 964 | 964 | state->blitter.time = attotime::zero; |
| r10315 | r10316 | |
| 1091 | 1091 | case 0x91: |
| 1092 | 1092 | if (data & 0x01) |
| 1093 | 1093 | { |
| 1094 | state->blitter.time = | |
| 1094 | state->blitter.time = | |
| 1095 | 1095 | lynx_blitter(space->machine); |
| 1096 | 1096 | } |
| 1097 | 1097 | break; |
| r10315 | r10316 | |
| 1297 | 1297 | { |
| 1298 | 1298 | lynx_state *state = machine->driver_data<lynx_state>(); |
| 1299 | 1299 | memset( &state->timer[which], 0, sizeof(LYNX_TIMER) ); |
| 1300 | state->timer[which].timer = timer_alloc( | |
| 1300 | state->timer[which].timer = machine->scheduler().timer_alloc(FUNC( | |
| 1301 | 1301 | } |
| 1302 | 1302 | |
| 1303 | 1303 | static void lynx_timer_signal_irq(running_machine *machine, int which) |
| r10315 | r10316 | |
| 1479 | 1479 | { |
| 1480 | 1480 | state->uart.data_to_send = state->uart.buffer; |
| 1481 | 1481 | state->uart.buffer_loaded = FALSE; |
| 1482 | timer_set( | |
| 1482 | machine->scheduler().timer_set( | |
| 1483 | 1483 | } |
| 1484 | 1484 | else |
| 1485 | 1485 | state->uart.sending = FALSE; |
| r10315 | r10316 | |
| 1535 | 1535 | { |
| 1536 | 1536 | state->uart.sending = TRUE; |
| 1537 | 1537 | state->uart.data_to_send = data; |
| 1538 | | |
| 1538 | | |
| 1539 | 1539 | } |
| 1540 | 1540 | break; |
| 1541 | 1541 | } |
| r10315 | r10316 | |
|---|---|---|
| 153 | 153 | memory_install_write8_handler(space, 0x4000, 0x4000 + ram_get_size(machine->device(RAM_TAG)) - 1, 0, 0, cgenie_videoram_w); |
| 154 | 154 | state->videoram = ram_get_ptr(machine->device(RAM_TAG)); |
| 155 | 155 | memory_set_bankptr(machine, "bank1", ram_get_ptr(machine->device(RAM_TAG))); |
| 156 | timer_pulse( | |
| 156 | machine->scheduler().timer_pulse( | |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | /************************************* |
| r10315 | r10316 | |
|---|---|---|
| 94 | 94 | |
| 95 | 95 | MACHINE_START(ondra) |
| 96 | 96 | { |
| 97 | timer_pulse( | |
| 97 | machine->scheduler().timer_pulse( | |
| 98 | 98 | } |
| r10315 | r10316 | |
|---|---|---|
| 327 | 327 | static WRITE_LINE_DEVICE_HANDLER( kaypro_fdc_intrq_w ) |
| 328 | 328 | { |
| 329 | 329 | if (state) |
| 330 | | |
| 330 | | |
| 331 | 331 | else |
| 332 | 332 | cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE); |
| 333 | 333 | } |
| r10315 | r10316 | |
| 335 | 335 | static WRITE_LINE_DEVICE_HANDLER( kaypro_fdc_drq_w ) |
| 336 | 336 | { |
| 337 | 337 | if (state) |
| 338 | | |
| 338 | | |
| 339 | 339 | else |
| 340 | 340 | cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE); |
| 341 | 341 |
| r10315 | r10316 | |
|---|---|---|
| 209 | 209 | { |
| 210 | 210 | super80_state *state = machine->driver_data<super80_state>(); |
| 211 | 211 | state->super80_shared=0xff; |
| 212 | timer_set( | |
| 212 | machine->scheduler().timer_set( | |
| 213 | 213 | memory_set_bank(machine, "boot", 1); |
| 214 | 214 | state->z80pio = machine->device("z80pio"); |
| 215 | 215 | state->speaker = machine->device("speaker"); |
| r10315 | r10316 | |
| 221 | 221 | { |
| 222 | 222 | UINT8 *RAM = machine->region("maincpu")->base(); |
| 223 | 223 | memory_configure_bank(machine, "boot", 0, 2, &RAM[0x0000], 0xc000); |
| 224 | timer_pulse( | |
| 224 | machine->scheduler().timer_pulse( | |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | DRIVER_INIT( super80 ) |
| 228 | 228 | { |
| 229 | timer_pulse( | |
| 229 | machine->scheduler().timer_pulse( | |
| 230 | 230 | driver_init_common(machine); |
| 231 | 231 | } |
| 232 | 232 |
| r10315 | r10316 | |
|---|---|---|
| 49 | 49 | ti->cur_val = -1; |
| 50 | 50 | ti->off_speed = off_speed; |
| 51 | 51 | ti->on_speed = on_speed; |
| 52 | timer_pulse( | |
| 52 | machine->scheduler().timer_pulse( | |
| 53 | 53 | return 0; |
| 54 | 54 | } |
| r10315 | r10316 | |
|---|---|---|
| 47 | 47 | DIRECT_UPDATE_HANDLER(lviv_directoverride) |
| 48 | 48 | { |
| 49 | 49 | if (input_port_read(machine, "RESET") & 0x01) |
| 50 | timer_set( | |
| 50 | machine->scheduler().timer_set( | |
| 51 | 51 | return address; |
| 52 | 52 | } |
| 53 | 53 | |
| r10315 | r10316 | |
| 248 | 248 | memory_set_bankptr(machine,"bank3", machine->region("maincpu")->base() + 0x010000); |
| 249 | 249 | memory_set_bankptr(machine,"bank4", machine->region("maincpu")->base() + 0x010000); |
| 250 | 250 | |
| 251 | /*timer_pulse( | |
| 251 | /*machine->scheduler().timer_pulse( | |
| 252 | 252 | |
| 253 | 253 | /*memset(ram_get_ptr(machine->device(RAM_TAG)), 0, sizeof(unsigned char)*0xffff);*/ |
| 254 | 254 | } |
| r10315 | r10316 | |
|---|---|---|
| 150 | 150 | memset(acia, 0, sizeof(*acia)); |
| 151 | 151 | /* transmit data reg is empty */ |
| 152 | 152 | acia->status_register |= (1<<4); |
| 153 | acia->timer = | |
| 153 | acia->timer = | |
| 154 | 154 | |
| 155 | 155 | serial_connection_init(device->machine, &acia->connection); |
| 156 | 156 | serial_connection_set_in_callback(device->machine, &acia->connection, acia_6551_in_callback); |
| r10315 | r10316 | |
|---|---|---|
| 697 | 697 | ay31015->tx_clock = ay31015->config->transmitter_clock; |
| 698 | 698 | ay31015->rx_clock = ay31015->config->receiver_clock; |
| 699 | 699 | |
| 700 | ay31015->rx_timer = timer_alloc(device->machine, ay31015_rx_process, (void *)device ); | |
| 701 | ay31015->tx_timer = timer_alloc(device->machine, ay31015_tx_process, (void *)device ); | |
| 700 | ay31015->rx_timer = device->machine->scheduler().timer_alloc(FUNC(ay31015_rx_process), (void *)device ); | |
| 701 | ay31015->tx_timer = device->machine->scheduler().timer_alloc(FUNC(ay31015_tx_process), (void *)device ); | |
| 702 | 702 | |
| 703 | 703 | ay31015_update_rx_timer( device ); |
| 704 | 704 | ay31015_update_tx_timer( device ); |
| r10315 | r10316 | |
|---|---|---|
| 128 | 128 | { |
| 129 | 129 | pc1403_state *state = device->machine->driver_data<pc1403_state>(); |
| 130 | 130 | state->portc = data; |
| 131 | // logerror("%g pc %.4x outc %.2x\n", | |
| 131 | // logerror("%g pc %.4x outc %.2x\n", | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | |
| r10315 | r10316 | |
| 181 | 181 | for (i=0; i<128; i++) gfx[i]=i; |
| 182 | 182 | |
| 183 | 183 | state->power = 1; |
| 184 | timer_set( | |
| 184 | machine->scheduler().timer_set( | |
| 185 | 185 | |
| 186 | 186 | memory_set_bankptr(machine, "bank1", machine->region("user1")->base()); |
| 187 | 187 | } |
| r10315 | r10316 | |
|---|---|---|
| 2800 | 2800 | |
| 2801 | 2801 | mc68328->iface = (const mc68328_interface*)device->baseconfig().static_config(); |
| 2802 | 2802 | |
| 2803 | mc68328->gptimer[0] = timer_alloc(device->machine, mc68328_timer1_hit, 0); | |
| 2804 | mc68328->gptimer[1] = timer_alloc(device->machine, mc68328_timer2_hit, 0); | |
| 2805 | mc68328->rtc = timer_alloc(device->machine, mc68328_rtc_tick, 0); | |
| 2806 | mc68328->pwm = timer_alloc(device->machine, mc68328_pwm_transition, 0); | |
| 2803 | mc68328->gptimer[0] = device->machine->scheduler().timer_alloc(FUNC(mc68328_timer1_hit)); | |
| 2804 | mc68328->gptimer[1] = device->machine->scheduler().timer_alloc(FUNC(mc68328_timer2_hit)); | |
| 2805 | mc68328->rtc = device->machine->scheduler().timer_alloc(FUNC(mc68328_rtc_tick)); | |
| 2806 | mc68328->pwm = device->machine->scheduler().timer_alloc(FUNC(mc68328_pwm_transition)); | |
| 2807 | 2807 | |
| 2808 | 2808 | mc68328_register_state_save(device); |
| 2809 | 2809 | } |
| r10315 | r10316 | |
|---|---|---|
| 118 | 118 | if (iface) |
| 119 | 119 | memcpy(&fdc->fdc_interface, iface, sizeof(fdc->fdc_interface)); |
| 120 | 120 | |
| 121 | fdc->watchdog = timer_alloc( | |
| 121 | fdc->watchdog = machine->scheduler().timer_alloc(FUNC( | |
| 122 | 122 | |
| 123 | 123 | pc_fdc_reset(machine); |
| 124 | 124 | } |
| r10315 | r10316 | |
|---|---|---|
| 159 | 159 | |
| 160 | 160 | A 120-Hz poll rate seems to be fast enough to ensure no |
| 161 | 161 | keystrokes are missed. */ |
| 162 | timer_pulse( | |
| 162 | machine->scheduler().timer_pulse( | |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | |
| r10315 | r10316 | |
| 367 | 367 | /* The keyboard will pulse its strobe line when a key is |
| 368 | 368 | pressed. A 10-usec pulse is typical. */ |
| 369 | 369 | pia6821_ca1_w(pia, 1); |
| 370 | timer_set( | |
| 370 | machine->scheduler().timer_set( | |
| 371 | 371 | } |
| 372 | 372 | } |
| 373 | 373 | |
| r10315 | r10316 | |
| 413 | 413 | write. Thus the write delay depends on the cursor position and |
| 414 | 414 | where the display is in the refresh cycle. */ |
| 415 | 415 | if (!data) |
| 416 | | |
| 416 | | |
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | static TIMER_CALLBACK(apple1_dsp_ready_start) |
| r10315 | r10316 | |
| 425 | 425 | input CB1. The end of this pulse will tell the PIA that the |
| 426 | 426 | display is ready for another write. */ |
| 427 | 427 | pia6821_cb1_w(pia, 0); |
| 428 | timer_set( | |
| 428 | machine->scheduler().timer_set( | |
| 429 | 429 | } |
| 430 | 430 | |
| 431 | 431 | static TIMER_CALLBACK(apple1_dsp_ready_end) |
| r10315 | r10316 | |
|---|---|---|
| 215 | 215 | floppy_drive_seek( img, -1 ); |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | LOG(( "%f mc6843_finish_STZ: actual=%i\n", | |
| 218 | LOG(( "%f mc6843_finish_STZ: actual=%i\n", | |
| 219 | 219 | |
| 220 | 220 | /* update state */ |
| 221 | 221 | mc6843->CTAR = 0; |
| r10315 | r10316 | |
| 237 | 237 | /* seek to track */ |
| 238 | 238 | floppy_drive_seek( img, mc6843->GCR - mc6843->CTAR ); |
| 239 | 239 | |
| 240 | LOG(( "%f mc6843_finish_SEK: from %i to %i (actual=%i)\n", | |
| 240 | LOG(( "%f mc6843_finish_SEK: from %i to %i (actual=%i)\n", | |
| 241 | 241 | |
| 242 | 242 | /* update state */ |
| 243 | 243 | mc6843->CTAR = mc6843->GCR; |
| r10315 | r10316 | |
| 260 | 260 | if ( ( ! floppy_drive_get_next_id( img, mc6843->side, id ) ) || ( id->flags & ID_FLAG_CRC_ERROR_IN_ID_FIELD ) || ( id->N != 0 ) ) |
| 261 | 261 | { |
| 262 | 262 | /* read address error */ |
| 263 | LOG(( "%f mc6843_address_search: get_next_id failed\n", | |
| 263 | LOG(( "%f mc6843_address_search: get_next_id failed\n", | |
| 264 | 264 | mc6843->STRB |= 0x0a; /* set CRC error & Sector Address Undetected */ |
| 265 | 265 | mc6843_cmd_end( device ); |
| 266 | 266 | return 0; |
| r10315 | r10316 | |
| 269 | 269 | if ( id->C != mc6843->LTAR ) |
| 270 | 270 | { |
| 271 | 271 | /* track mismatch */ |
| 272 | LOG(( "%f mc6843_address_search: track mismatch: logical=%i real=%i\n", | |
| 272 | LOG(( "%f mc6843_address_search: track mismatch: logical=%i real=%i\n", | |
| 273 | 273 | mc6843->data[0] = id->C; /* make the track number available to the CPU */ |
| 274 | 274 | mc6843->STRA |= 0x20; /* set Track Not Equal */ |
| 275 | 275 | mc6843_cmd_end( device ); |
| r10315 | r10316 | |
| 279 | 279 | if ( id->R == mc6843->SAR ) |
| 280 | 280 | { |
| 281 | 281 | /* found! */ |
| 282 | LOG(( "%f mc6843_address_search: sector %i found on track %i\n", | |
| 282 | LOG(( "%f mc6843_address_search: sector %i found on track %i\n", | |
| 283 | 283 | if ( ! (mc6843->CMR & 0x20) ) |
| 284 | 284 | { |
| 285 | 285 | mc6843->ISR |= 0x04; /* if no DMA, set Status Sense */ |
| r10315 | r10316 | |
| 293 | 293 | if ( r >= 4 ) |
| 294 | 294 | { |
| 295 | 295 | /* time-out after 3 full revolutions */ |
| 296 | LOG(( "%f mc6843_address_search: no sector %i found after 3 revolutions\n", | |
| 296 | LOG(( "%f mc6843_address_search: no sector %i found after 3 revolutions\n", | |
| 297 | 297 | mc6843->STRB |= 0x08; /* set Sector Address Undetected */ |
| 298 | 298 | mc6843_cmd_end( device ); |
| 299 | 299 | return 0; |
| r10315 | r10316 | |
| 315 | 315 | |
| 316 | 316 | if ( id->flags & ID_FLAG_CRC_ERROR_IN_DATA_FIELD ) |
| 317 | 317 | { |
| 318 | LOG(( "%f mc6843_address_search_read: data CRC error\n", | |
| 318 | LOG(( "%f mc6843_address_search_read: data CRC error\n", | |
| 319 | 319 | mc6843->STRB |= 0x06; /* set CRC error & Data Mark Undetected */ |
| 320 | 320 | mc6843_cmd_end( device ); |
| 321 | 321 | return 0; |
| r10315 | r10316 | |
| 323 | 323 | |
| 324 | 324 | if ( id->flags & ID_FLAG_DELETED_DATA ) |
| 325 | 325 | { |
| 326 | LOG(( "%f mc6843_address_search_read: deleted data\n", | |
| 326 | LOG(( "%f mc6843_address_search_read: deleted data\n", | |
| 327 | 327 | mc6843->STRA |= 0x02; /* set Delete Data Mark Detected */ |
| 328 | 328 | } |
| 329 | 329 | |
| r10315 | r10316 | |
| 392 | 392 | mc6843_t* mc6843 = get_safe_token( device ); |
| 393 | 393 | int cmd = mc6843->CMR & 0x0f; |
| 394 | 394 | |
| 395 | LOG(( "%f mc6843_cont: timer called for cmd=%s(%i)\n", | |
| 395 | LOG(( "%f mc6843_cont: timer called for cmd=%s(%i)\n", | |
| 396 | 396 | |
| 397 | 397 | timer_adjust_oneshot( mc6843->timer_cont, attotime::never, 0 ); |
| 398 | 398 | |
| r10315 | r10316 | |
| 427 | 427 | int cmd = mc6843->CMR & 0x0f; |
| 428 | 428 | |
| 429 | 429 | LOG(( "%f $%04x mc6843_r: data input cmd=%s(%i), pos=%i/%i, GCR=%i, ", |
| 430 | | |
| 430 | | |
| 431 | 431 | mc6843_cmd[cmd], cmd, mc6843->data_idx, |
| 432 | 432 | mc6843->data_size, mc6843->GCR )); |
| 433 | 433 | |
| r10315 | r10316 | |
| 491 | 491 | case 1: /* Current-Track Address Register (CTAR) */ |
| 492 | 492 | data = mc6843->CTAR; |
| 493 | 493 | LOG(( "%f $%04x mc6843_r: read CTAR %i (actual=%i)\n", |
| 494 | | |
| 494 | | |
| 495 | 495 | floppy_drive_get_current_track( mc6843_floppy_image( device ) ) )); |
| 496 | 496 | break; |
| 497 | 497 | |
| 498 | 498 | case 2: /* Interrupt Status Register (ISR) */ |
| 499 | 499 | data = mc6843->ISR; |
| 500 | 500 | LOG(( "%f $%04x mc6843_r: read ISR %02X: cmd=%scomplete settle=%scomplete sense-rq=%i STRB=%i\n", |
| 501 | | |
| 501 | | |
| 502 | 502 | (data & 1) ? "" : "not-" , (data & 2) ? "" : "not-", |
| 503 | 503 | (data >> 2) & 1, (data >> 3) & 1 )); |
| 504 | 504 | |
| r10315 | r10316 | |
| 524 | 524 | |
| 525 | 525 | data = mc6843->STRA; |
| 526 | 526 | LOG(( "%f $%04x mc6843_r: read STRA %02X: data-rq=%i del-dta=%i ready=%i t0=%i wp=%i trk-dif=%i idx=%i busy=%i\n", |
| 527 | | |
| 527 | | |
| 528 | 528 | data & 1, (data >> 1) & 1, (data >> 2) & 1, (data >> 3) & 1, |
| 529 | 529 | (data >> 4) & 1, (data >> 5) & 1, (data >> 6) & 1, (data >> 7) & 1 )); |
| 530 | 530 | break; |
| r10315 | r10316 | |
| 533 | 533 | case 4: /* Status Register B (STRB) */ |
| 534 | 534 | data = mc6843->STRB; |
| 535 | 535 | LOG(( "%f $%04x mc6843_r: read STRB %02X: data-err=%i CRC-err=%i dta--mrk-err=%i sect-mrk-err=%i seek-err=%i fi=%i wr-err=%i hard-err=%i\n", |
| 536 | | |
| 536 | | |
| 537 | 537 | data & 1, (data >> 1) & 1, (data >> 2) & 1, (data >> 3) & 1, |
| 538 | 538 | (data >> 4) & 1, (data >> 5) & 1, (data >> 6) & 1, (data >> 7) & 1 )); |
| 539 | 539 | |
| r10315 | r10316 | |
| 545 | 545 | case 7: /* Logical-Track Address Register (LTAR) */ |
| 546 | 546 | data = mc6843->LTAR; |
| 547 | 547 | LOG(( "%f $%04x mc6843_r: read LTAR %i (actual=%i)\n", |
| 548 | | |
| 548 | | |
| 549 | 549 | floppy_drive_get_current_track( mc6843_floppy_image( device ) ) )); |
| 550 | 550 | break; |
| 551 | 551 | |
| r10315 | r10316 | |
| 567 | 567 | int FWF = (mc6843->CMR >> 4) & 1; |
| 568 | 568 | |
| 569 | 569 | LOG(( "%f $%04x mc6843_w: data output cmd=%s(%i), pos=%i/%i, GCR=%i, data=%02X\n", |
| 570 | | |
| 570 | | |
| 571 | 571 | mc6843_cmd[cmd], cmd, mc6843->data_idx, |
| 572 | 572 | mc6843->data_size, mc6843->GCR, data )); |
| 573 | 573 | |
| r10315 | r10316 | |
| 584 | 584 | /* end of sector write */ |
| 585 | 585 | device_t* img = mc6843_floppy_image( device ); |
| 586 | 586 | |
| 587 | LOG(( "%f $%04x mc6843_w: write sector %i\n", | |
| 587 | LOG(( "%f $%04x mc6843_w: write sector %i\n", | |
| 588 | 588 | |
| 589 | 589 | floppy_drive_write_sector_data( |
| 590 | 590 | img, mc6843->side, mc6843->data_id, |
| r10315 | r10316 | |
| 648 | 648 | UINT8 track = mc6843->data[1]; |
| 649 | 649 | UINT8 sector = mc6843->data[3]; |
| 650 | 650 | UINT8 filler = 0xe5; /* standard Thomson filler */ |
| 651 | LOG(( "%f $%04x mc6843_w: address id detected track=%i sector=%i\n", | |
| 651 | LOG(( "%f $%04x mc6843_w: address id detected track=%i sector=%i\n", | |
| 652 | 652 | floppy_drive_format_sector( img, mc6843->side, sector, track, 0, sector, 0, filler ); |
| 653 | 653 | } |
| 654 | 654 | else |
| r10315 | r10316 | |
| 678 | 678 | case 1: /* Current-Track Address Register (CTAR) */ |
| 679 | 679 | mc6843->CTAR = data & 0x7f; |
| 680 | 680 | LOG(( "%f $%04x mc6843_w: set CTAR to %i %02X (actual=%i) \n", |
| 681 | | |
| 681 | | |
| 682 | 682 | floppy_drive_get_current_track( mc6843_floppy_image( device ) ) )); |
| 683 | 683 | break; |
| 684 | 684 | |
| r10315 | r10316 | |
| 687 | 687 | int cmd = data & 15; |
| 688 | 688 | |
| 689 | 689 | LOG(( "%f $%04x mc6843_w: set CMR to $%02X: cmd=%s(%i) FWF=%i DMA=%i ISR3-intr=%i fun-intr=%i\n", |
| 690 | | |
| 690 | | |
| 691 | 691 | data, mc6843_cmd[cmd], cmd, (data >> 4) & 1, (data >> 5) & 1, |
| 692 | 692 | (data >> 6) & 1, (data >> 7) & 1 )); |
| 693 | 693 | |
| r10315 | r10316 | |
| 734 | 734 | |
| 735 | 735 | /* assume CLK freq = 1MHz (IBM 3740 compatibility) */ |
| 736 | 736 | LOG(( "%f $%04x mc6843_w: set SUR to $%02X: head settling time=%fms, track-to-track seek time=%f\n", |
| 737 | | |
| 737 | | |
| 738 | 738 | data, 4.096 * (data & 15), 1.024 * ((data >> 4) & 15) )); |
| 739 | 739 | break; |
| 740 | 740 | |
| 741 | 741 | case 4: /* Sector Address Register (SAR) */ |
| 742 | 742 | mc6843->SAR = data & 0x1f; |
| 743 | LOG(( "%f $%04x mc6843_w: set SAR to %i (%02X)\n", | |
| 743 | LOG(( "%f $%04x mc6843_w: set SAR to %i (%02X)\n", | |
| 744 | 744 | break; |
| 745 | 745 | |
| 746 | 746 | case 5: /* General Count Register (GCR) */ |
| 747 | 747 | mc6843->GCR = data & 0x7f; |
| 748 | LOG(( "%f $%04x mc6843_w: set GCR to %i (%02X)\n", | |
| 748 | LOG(( "%f $%04x mc6843_w: set GCR to %i (%02X)\n", | |
| 749 | 749 | break; |
| 750 | 750 | |
| 751 | 751 | case 6: /* CRC Control Register (CCR) */ |
| 752 | 752 | mc6843->CCR = data & 3; |
| 753 | 753 | LOG(( "%f $%04x mc6843_w: set CCR to %02X: CRC=%s shift=%i\n", |
| 754 | | |
| 754 | | |
| 755 | 755 | (data & 1) ? "enabled" : "disabled", (data >> 1) & 1 )); |
| 756 | 756 | break; |
| 757 | 757 | |
| 758 | 758 | case 7: /* Logical-Track Address Register (LTAR) */ |
| 759 | 759 | mc6843->LTAR = data & 0x7f; |
| 760 | 760 | LOG(( "%f $%04x mc6843_w: set LTAR to %i %02X (actual=%i)\n", |
| 761 | | |
| 761 | | |
| 762 | 762 | floppy_drive_get_current_track( mc6843_floppy_image( device ) ) )); |
| 763 | 763 | break; |
| 764 | 764 | |
| r10315 | r10316 | |
| 809 | 809 | |
| 810 | 810 | mc6843->iface = (const mc6843_interface*)device->baseconfig().static_config(); |
| 811 | 811 | |
| 812 | mc6843->timer_cont = | |
| 812 | mc6843->timer_cont = | |
| 813 | 813 | |
| 814 | 814 | state_save_register_item( device->machine,"mc6843", device->tag(), 0, mc6843->CTAR ); |
| 815 | 815 | state_save_register_item( device->machine,"mc6843", device->tag(), 0, mc6843->CMR ); |
| r10315 | r10316 | |
|---|---|---|
| 471 | 471 | state_save_register_item(device->machine, "mm58274c", device->tag(), 0, mm58274c->seconds2); |
| 472 | 472 | state_save_register_item(device->machine, "mm58274c", device->tag(), 0, mm58274c->tenths); |
| 473 | 473 | |
| 474 | mm58274c->increment_rtc = | |
| 474 | mm58274c->increment_rtc = | |
| 475 | 475 | timer_adjust_periodic(mm58274c->increment_rtc, attotime::zero, 0, attotime::from_msec(100)); |
| 476 | mm58274c->interrupt_timer = | |
| 476 | mm58274c->interrupt_timer = | |
| 477 | 477 | } |
| 478 | 478 | |
| 479 | 479 |
| r10315 | r10316 | |
|---|---|---|
| 15 | 15 | if(LEVEL>=N) \ |
| 16 | 16 | { \ |
| 17 | 17 | if( M ) \ |
| 18 | logerror("%11.6f: %-24s", | |
| 18 | logerror("%11.6f: %-24s", | |
| 19 | 19 | logerror A; \ |
| 20 | 20 | } \ |
| 21 | 21 | } while (0) |
| r10315 | r10316 | |
| 112 | 112 | void pc_rtc_init(running_machine *machine) |
| 113 | 113 | { |
| 114 | 114 | memset(&pc_rtc,0,sizeof(pc_rtc)); |
| 115 | pc_rtc.timer = timer_alloc( | |
| 115 | pc_rtc.timer = machine->scheduler().timer_alloc(FUNC( | |
| 116 | 116 | timer_adjust_periodic(pc_rtc.timer, attotime::zero, 0, attotime(1, 0)); |
| 117 | 117 | } |
| 118 | 118 |
| r10315 | r10316 | |
|---|---|---|
| 779 | 779 | pot0 = pot1 = 0x40; |
| 780 | 780 | |
| 781 | 781 | /* For Cassette synchro*/ |
| 782 | Cassette_timer = timer_alloc( | |
| 782 | Cassette_timer = machine->scheduler().timer_alloc(FUN | |
| 783 | 783 | timer_adjust_periodic(Cassette_timer, attotime::from_msec(100), 0, attotime::from_usec(64));/* => real synchro scan speed for 15,624Khz*/ |
| 784 | 784 | |
| 785 | 785 | /* Sound sn76477*/ |
| r10315 | r10316 | |
|---|---|---|
| 154 | 154 | /* create the timers */ |
| 155 | 155 | if (com8116->out_fx4_func.target) |
| 156 | 156 | { |
| 157 | com8116->fx4_timer = | |
| 157 | com8116->fx4_timer = | |
| 158 | 158 | timer_adjust_periodic(com8116->fx4_timer, attotime::zero, 0, attotime::from_hz(device->clock() / 4)); |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | com8116->fr_timer = timer_alloc(device->machine, fr_tick, (void *)device); | |
| 162 | com8116->ft_timer = timer_alloc(device->machine, ft_tick, (void *)device); | |
| 161 | com8116->fr_timer = device->machine->scheduler().timer_alloc(FUNC(fr_tick), (void *)device); | |
| 162 | com8116->ft_timer = device->machine->scheduler().timer_alloc(FUNC(ft_tick), (void *)device); | |
| 163 | 163 | |
| 164 | 164 | /* register for state saving */ |
| 165 | 165 | state_save_register_global(device->machine, com8116->fr); |
| r10315 | r10316 | |
|---|---|---|
| 1088 | 1088 | state->devices.dma8237_1 = NULL; |
| 1089 | 1089 | state->devices.dma8237_2 = NULL; |
| 1090 | 1090 | |
| 1091 | timer_set( | |
| 1091 | machine->scheduler().timer_set( | |
| 1092 | 1092 | |
| 1093 | 1093 | cputag_set_input_line(machine, "ppc1", INPUT_LINE_RESET, CLEAR_LINE); |
| 1094 | 1094 | cputag_set_input_line(machine, "ppc2", INPUT_LINE_RESET, ASSERT_LINE); |
| r10315 | r10316 | |
|---|---|---|
| 215 | 215 | e0516_t *e0516 = get_safe_token(device); |
| 216 | 216 | |
| 217 | 217 | /* create the timers */ |
| 218 | e0516->clock_timer = | |
| 218 | e0516->clock_timer = | |
| 219 | 219 | timer_adjust_periodic(e0516->clock_timer, attotime::zero, 0, attotime::from_hz(device->clock() / 32768)); |
| 220 | 220 | |
| 221 | 221 | /* register for state saving */ |
| r10315 | r10316 | |
|---|---|---|
| 86 | 86 | if(VERBOSE_LEVEL >= N) \ |
| 87 | 87 | { \ |
| 88 | 88 | if( M ) \ |
| 89 | logerror("%11.6f: %-24s", | |
| 89 | logerror("%11.6f: %-24s", | |
| 90 | 90 | logerror A; \ |
| 91 | 91 | } \ |
| 92 | 92 | } while (0) |
| r10315 | r10316 | |
|---|---|---|
| 311 | 311 | WRITE16_HANDLER( intv_ram16_w ) |
| 312 | 312 | { |
| 313 | 313 | intv_state *state = space->machine->driver_data<intv_state>(); |
| 314 | //logerror("%g: WRITING TO GRAM offset = %d\n", | |
| 314 | //logerror("%g: WRITING TO GRAM offset = %d\n", | |
| 315 | 315 | //logerror("ram16_w(%x) = %x\n",offset,data); |
| 316 | 316 | state->ram16[offset] = data&0xffff; |
| 317 | 317 | } |
| r10315 | r10316 | |
| 498 | 498 | intv_state *state = device->machine->driver_data<intv_state>(); |
| 499 | 499 | cputag_set_input_line(device->machine, "maincpu", CP1610_INT_INTRM, ASSERT_LINE); |
| 500 | 500 | state->sr1_int_pending = 1; |
| 501 | | |
| 501 | | |
| 502 | 502 | intv_stic_screenrefresh(device->machine); |
| 503 | 503 | } |
| 504 | 504 |
| r10315 | r10316 | |
|---|---|---|
| 126 | 126 | |
| 127 | 127 | MACHINE_RESET( special ) |
| 128 | 128 | { |
| 129 | timer_set( | |
| 129 | machine->scheduler().timer_set( | |
| 130 | 130 | memory_set_bank(machine, "bank1", 1); |
| 131 | 131 | } |
| 132 | 132 | |
| r10315 | r10316 | |
| 275 | 275 | special_state *state = machine->driver_data<special_state>(); |
| 276 | 276 | specimx_set_bank(machine, 2,0x00); // Initiali load ROM disk |
| 277 | 277 | state->specimx_color = 0x70; |
| 278 | timer_set( | |
| 278 | machine->scheduler().timer_set( | |
| 279 | 279 | device_t *fdc = machine->device("wd1793"); |
| 280 | 280 | wd17xx_set_pause_time(fdc,12); |
| 281 | 281 | wd17xx_dden_w(fdc, 0); |
| r10315 | r10316 | |
|---|---|---|
| 346 | 346 | devcb_resolve_write_line(&mc6852->out_tuf_func, &intf->out_tuf_func, device); |
| 347 | 347 | |
| 348 | 348 | /* allocate timers */ |
| 349 | mc6852->rx_timer = timer_alloc(device->machine, receive_tick, (void *) device); | |
| 350 | mc6852->tx_timer = timer_alloc(device->machine, transmit_tick, (void *) device); | |
| 349 | mc6852->rx_timer = device->machine->scheduler().timer_alloc(FUNC(receive_tick), (void *) device); | |
| 350 | mc6852->tx_timer = device->machine->scheduler().timer_alloc(FUNC(transmit_tick), (void *) device); | |
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | /*------------------------------------------------- |
| r10315 | r10316 | |
|---|---|---|
| 85 | 85 | MACHINE_RESET( mikro80 ) |
| 86 | 86 | { |
| 87 | 87 | mikro80_state *state = machine->driver_data<mikro80_state>(); |
| 88 | timer_set( | |
| 88 | machine->scheduler().timer_set( | |
| 89 | 89 | memory_set_bank(machine, "bank1", 1); |
| 90 | 90 | state->keyboard_mask = 0; |
| 91 | 91 | } |
| r10315 | r10316 | |
|---|---|---|
| 202 | 202 | UINT16 oldreq; |
| 203 | 203 | |
| 204 | 204 | if (LOG_INTERRUPTS) |
| 205 | logerror("(%f) **** Acknowledged interrupt vector %02X\n", | |
| 205 | logerror("(%f) **** Acknowledged interrupt vector %02X\n", | |
| 206 | 206 | |
| 207 | 207 | /* clear the interrupt */ |
| 208 | 208 | cpu_set_input_line(device, 0, CLEAR_LINE); |
| r10315 | r10316 | |
| 351 | 351 | state->i186.intr.pending = 1; |
| 352 | 352 | cpuexec_trigger(machine, CPU_RESUME_TRIGGER); |
| 353 | 353 | if (LOG_OPTIMIZATION) logerror(" - trigger due to interrupt pending\n"); |
| 354 | if (LOG_INTERRUPTS) logerror("(%f) **** Requesting interrupt vector %02X\n", | |
| 354 | if (LOG_INTERRUPTS) logerror("(%f) **** Requesting interrupt vector %02X\n", | |
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | |
| r10315 | r10316 | |
| 379 | 379 | case 0x0f: state->i186.intr.in_service &= ~0x80; break; |
| 380 | 380 | default: logerror("%05X:ERROR - 80186 EOI with unknown vector %02X\n", cpu_get_pc(machine->device(MAINCPU_TAG)), data & 0x1f); |
| 381 | 381 | } |
| 382 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for vector %02X\n", | |
| 382 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for vector %02X\n", | |
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 | /* non-specific case */ |
| r10315 | r10316 | |
| 392 | 392 | if ((state->i186.intr.timer & 0x07) == Priority && (state->i186.intr.in_service & 0x01)) |
| 393 | 393 | { |
| 394 | 394 | state->i186.intr.in_service &= ~0x01; |
| 395 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for timer\n", | |
| 395 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for timer\n", | |
| 396 | 396 | handled=1; |
| 397 | 397 | } |
| 398 | 398 | |
| r10315 | r10316 | |
| 401 | 401 | if ((state->i186.intr.dma[IntNo] & 0x07) == Priority && (state->i186.intr.in_service & (0x04 << IntNo))) |
| 402 | 402 | { |
| 403 | 403 | state->i186.intr.in_service &= ~(0x04 << IntNo); |
| 404 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for DMA%d\n", | |
| 404 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for DMA%d\n", | |
| 405 | 405 | handled=1; |
| 406 | 406 | } |
| 407 | 407 | |
| r10315 | r10316 | |
| 410 | 410 | if ((state->i186.intr.ext[IntNo] & 0x07) == Priority && (state->i186.intr.in_service & (0x10 << IntNo))) |
| 411 | 411 | { |
| 412 | 412 | state->i186.intr.in_service &= ~(0x10 << IntNo); |
| 413 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for INT%d\n", | |
| 413 | if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for INT%d\n", | |
| 414 | 414 | handled=1; |
| 415 | 415 | } |
| 416 | 416 | } |
| r10315 | r10316 | |
| 818 | 818 | logerror("Machine reset\n"); |
| 819 | 819 | |
| 820 | 820 | /* create timers here so they stick around */ |
| 821 | state->i186.timer[0].int_timer = timer_alloc(machine, internal_timer_int, NULL); | |
| 822 | state->i186.timer[1].int_timer = timer_alloc(machine, internal_timer_int, NULL); | |
| 823 | state->i186.timer[2].int_timer = timer_alloc(machine, internal_timer_int, NULL); | |
| 824 | state->i186.timer[0].time_timer = timer_alloc(machine, NULL, NULL); | |
| 825 | state->i186.timer[1].time_timer = timer_alloc(machine, NULL, NULL); | |
| 826 | state->i186.timer[2].time_timer = timer_alloc(machine, NULL, NULL); | |
| 827 | state->i186.dma[0].finish_timer = timer_alloc(machine, dma_timer_callback, NULL); | |
| 828 | state->i186.dma[1].finish_timer = timer_alloc(machine, dma_timer_callback, NULL); | |
| 821 | state->i186.timer[0].int_timer = machine->scheduler().timer_alloc(FUNC(internal_timer_int)); | |
| 822 | state->i186.timer[1].int_timer = machine->scheduler().timer_alloc(FUNC(internal_timer_int)); | |
| 823 | state->i186.timer[2].int_timer = machine->scheduler().timer_alloc(FUNC(internal_timer_int)); | |
| 824 | state->i186.timer[0].time_timer = machine->scheduler().timer_alloc(FUNC(NULL)); | |
| 825 | state->i186.timer[1].time_timer = machine->scheduler().timer_alloc(FUNC(NULL)); | |
| 826 | state->i186.timer[2].time_timer = machine->scheduler().timer_alloc(FUNC(NULL)); | |
| 827 | state->i186.dma[0].finish_timer = machine->scheduler().timer_alloc(FUNC(dma_timer_callback)); | |
| 828 | state->i186.dma[1].finish_timer = machine->scheduler().timer_alloc(FUNC(dma_timer_callback)); | |
| 829 | 829 | } |
| 830 | 830 | |
| 831 | 831 | static void nimbus_cpu_reset(running_machine *machine) |
| r10315 | r10316 | |
| 1277 | 1277 | /* init cpu */ |
| 1278 | 1278 | nimbus_cpu_init(machine); |
| 1279 | 1279 | |
| 1280 | state->keyboard.keyscan_timer=timer_alloc(machine, keyscan_callback, NULL); | |
| 1281 | state->nimbus_mouse.mouse_timer=timer_alloc(machine, mouse_callback, NULL); | |
| 1280 | state->keyboard.keyscan_timer=machine->scheduler().timer_alloc(FUNC(keyscan_callback)); | |
| 1281 | state->nimbus_mouse.mouse_timer=machine->scheduler().timer_alloc(FUNC(mouse_callback)); | |
| 1282 | 1282 | |
| 1283 | 1283 | /* setup debug commands */ |
| 1284 | 1284 | if (machine->debug_flags & DEBUG_FLAG_ENABLED) |
| r10315 | r10316 | |
|---|---|---|
| 962 | 962 | floppy_install_load_proc(c1571->image, on_disk_change); |
| 963 | 963 | |
| 964 | 964 | /* allocate data timer */ |
| 965 | c1571->bit_timer = | |
| 965 | c1571->bit_timer = | |
| 966 | 966 | |
| 967 | 967 | /* register for state saving */ |
| 968 | 968 | state_save_register_device_item(device, 0, c1571->address); |
| r10315 | r10316 | |
|---|---|---|
| 415 | 415 | abc77->cpu = device->subdevice(I8035_TAG); |
| 416 | 416 | |
| 417 | 417 | /* allocate reset timer */ |
| 418 | abc77->reset_timer = | |
| 418 | abc77->reset_timer = | |
| 419 | 419 | |
| 420 | 420 | /* register for state saving */ |
| 421 | 421 | state_save_register_device_item(device, 0, abc77->keylatch); |
| r10315 | r10316 | |
|---|---|---|
| 69 | 69 | MACHINE_RESET( ut88 ) |
| 70 | 70 | { |
| 71 | 71 | ut88_state *state = machine->driver_data<ut88_state>(); |
| 72 | timer_set( | |
| 72 | machine->scheduler().timer_set( | |
| 73 | 73 | memory_set_bank(machine, "bank1", 1); |
| 74 | 74 | state->keyboard_mask = 0; |
| 75 | 75 | } |
| r10315 | r10316 | |
| 164 | 164 | } |
| 165 | 165 | MACHINE_START( ut88mini ) |
| 166 | 166 | { |
| 167 | timer_pulse( | |
| 167 | machine->scheduler().timer_pulse( | |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | MACHINE_RESET( ut88mini ) |
| r10315 | r10316 | |
|---|---|---|
| 30 | 30 | void pc_mouse_initialise(running_machine *machine) |
| 31 | 31 | { |
| 32 | 32 | pc_mouse.head = pc_mouse.tail = 0; |
| 33 | pc_mouse.timer = timer_alloc( | |
| 33 | pc_mouse.timer = machine->scheduler().timer_alloc(FUNC( | |
| 34 | 34 | pc_mouse.inputs=UART8250_HANDSHAKE_IN_DSR|UART8250_HANDSHAKE_IN_CTS; |
| 35 | 35 | pc_mouse.ins8250 = NULL; |
| 36 | 36 | } |
| r10315 | r10316 | |
|---|---|---|
| 99 | 99 | |
| 100 | 100 | /* toggle tc on read */ |
| 101 | 101 | upd765_tc_w(device, ASSERT_LINE); |
| 102 | | |
| 102 | | |
| 103 | 103 | |
| 104 | 104 | return 0xff; |
| 105 | 105 | } |
| r10315 | r10316 | |
|---|---|---|
| 350 | 350 | devcb_resolve_read_line(&m_in_raw2_func, &m_config.in_raw2_func, this); |
| 351 | 351 | |
| 352 | 352 | // allocate timers |
| 353 | m_txd_timer = device_timer_alloc(*this, TIMER_TXD); | |
| 354 | m_baudx4_timer = device_timer_alloc(*this, TIMER_BAUDX4); | |
| 355 | m_rtc_timer = device_timer_alloc(*this, TIMER_RTC); | |
| 356 | m_gap_timer = device_timer_alloc(*this, TIMER_GAP); | |
| 357 | m_ipc_timer = device_timer_alloc(*this, TIMER_IPC); | |
| 353 | m_txd_timer = timer_alloc(TIMER_TXD); | |
| 354 | m_baudx4_timer = timer_alloc(TIMER_BAUDX4); | |
| 355 | m_rtc_timer = timer_alloc(TIMER_RTC); | |
| 356 | m_gap_timer = timer_alloc(TIMER_GAP); | |
| 357 | m_ipc_timer = timer_alloc(TIMER_IPC); | |
| 358 | 358 | |
| 359 | 359 | timer_adjust_periodic(m_rtc_timer, attotime::zero, 0, attotime::from_hz(m_config.rtc_clock / 32768)); |
| 360 | 360 | timer_adjust_periodic(m_gap_timer, attotime::zero, 0, attotime::from_msec(31)); |
| r10315 | r10316 | |
|---|---|---|
| 333 | 333 | cybiko_state *state = machine->driver_data<cybiko_state>(); |
| 334 | 334 | _logerror( 0, ("cybiko_rs232_init\n")); |
| 335 | 335 | memset( &state->rs232, 0, sizeof( state->rs232)); |
| 336 | // timer_pulse( | |
| 336 | // machine->scheduler().timer_pulse( | |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | static void cybiko_rs232_exit( void) |
| r10315 | r10316 | |
|---|---|---|
| 1384 | 1384 | break; |
| 1385 | 1385 | case 0x04: |
| 1386 | 1386 | /* X Joystick 1 axis */ |
| 1387 | result = | |
| 1387 | result = | |
| 1388 | 1388 | break; |
| 1389 | 1389 | case 0x05: |
| 1390 | 1390 | /* Y Joystick 1 axis */ |
| 1391 | result = | |
| 1391 | result = | |
| 1392 | 1392 | break; |
| 1393 | 1393 | case 0x06: |
| 1394 | 1394 | /* X Joystick 2 axis */ |
| 1395 | result = | |
| 1395 | result = | |
| 1396 | 1396 | break; |
| 1397 | 1397 | case 0x07: |
| 1398 | 1398 | /* Y Joystick 2 axis */ |
| 1399 | result = | |
| 1399 | result = | |
| 1400 | 1400 | break; |
| 1401 | 1401 | default: |
| 1402 | 1402 | /* c060 Empty Cassette head read |
| r10315 | r10316 | |
| 1424 | 1424 | |
| 1425 | 1425 | if (offset == 0) |
| 1426 | 1426 | { |
| 1427 | state->joystick_x1_time = timer_get_time(space->machine).as_double() + x_calibration * input_port_read(space->machine, "joystick_1_x"); | |
| 1428 | state->joystick_y1_time = timer_get_time(space->machine).as_double() + y_calibration * input_port_read(space->machine, "joystick_1_y"); | |
| 1429 | state->joystick_x2_time = timer_get_time(space->machine).as_double() + x_calibration * input_port_read(space->machine, "joystick_2_x"); | |
| 1430 | state->joystick_y2_time = timer_get_time(space->machine).as_double() + y_calibration * input_port_read(space->machine, "joystick_2_y"); | |
| 1427 | state->joystick_x1_time = space->machine->time().as_double() + x_calibration * input_port_read(space->machine, "joystick_1_x"); | |
| 1428 | state->joystick_y1_time = space->machine->time().as_double() + y_calibration * input_port_read(space->machine, "joystick_1_y"); | |
| 1429 | state->joystick_x2_time = space->machine->time().as_double() + x_calibration * input_port_read(space->machine, "joystick_2_x"); | |
| 1430 | state->joystick_y2_time = space->machine->time().as_double() + y_calibration * input_port_read(space->machine, "joystick_2_y"); | |
| 1431 | 1431 | } |
| 1432 | 1432 | } |
| 1433 | 1433 | return 0; |
| r10315 | r10316 | |
|---|---|---|
| 34 | 34 | if(VERBOSE_LEVEL >= N) \ |
| 35 | 35 | { \ |
| 36 | 36 | if( M ) \ |
| 37 | logerror("%11.6f: %-24s", | |
| 37 | logerror("%11.6f: %-24s", | |
| 38 | 38 | logerror A; \ |
| 39 | 39 | } \ |
| 40 | 40 | } while (0) |
| r10315 | r10316 | |
| 766 | 766 | } |
| 767 | 767 | |
| 768 | 768 | if (state->tape_on) |
| 769 | state->datasette_timer = timer_alloc( | |
| 769 | state->datasette_timer = machine->scheduler().timer_alloc(FUNC(c | |
| 770 | 770 | |
| 771 | 771 | // "cyberload" tape loader check the e000-ffff ram; the init ram need to return different value |
| 772 | 772 | { |
| r10315 | r10316 | |
|---|---|---|
| 66 | 66 | // Initialise timers and registers |
| 67 | 67 | for(x=0;x<4;x++) |
| 68 | 68 | { |
| 69 | dmac->timer[x] = | |
| 69 | dmac->timer[x] = | |
| 70 | 70 | dmac->reg[x].niv = 0x0f; // defaults? |
| 71 | 71 | dmac->reg[x].eiv = 0x0f; |
| 72 | 72 | dmac->clock[x] = dmac->intf->clock[x]; |
| r10315 | r10316 | |
|---|---|---|
| 54 | 54 | if(VERBOSE_PIO>=N) \ |
| 55 | 55 | { \ |
| 56 | 56 | if( M ) \ |
| 57 | logerror("%11.6f: %-24s", | |
| 57 | logerror("%11.6f: %-24s", | |
| 58 | 58 | logerror A; \ |
| 59 | 59 | } \ |
| 60 | 60 | } while (0) |
| r10315 | r10316 | |
| 1363 | 1363 | { |
| 1364 | 1364 | pc_state *st = machine->driver_data<pc_state>(); |
| 1365 | 1365 | pc_fdc_init( machine, &pcjr_fdc_interface_nc ); |
| 1366 | pcjr_keyb.keyb_signal_timer = timer_alloc(machine, pcjr_keyb_signal_callback, NULL ); | |
| 1367 | pc_int_delay_timer = timer_alloc(machine, pcjr_delayed_pic8259_irq, NULL ); | |
| 1366 | pcjr_keyb.keyb_signal_timer = machine->scheduler().timer_alloc(FUNC(pcjr_keyb_signal_callback)); | |
| 1367 | pc_int_delay_timer = machine->scheduler().timer_alloc(FUNC(pcjr_delayed_pic8259_irq)); | |
| 1368 | 1368 | st->maincpu = machine->device("maincpu" ); |
| 1369 | 1369 | cpu_set_irq_callback(st->maincpu, pc_irq_callback); |
| 1370 | 1370 |
| r10315 | r10316 | |
|---|---|---|
| 23 | 23 | MACHINE_START( pecom ) |
| 24 | 24 | { |
| 25 | 25 | pecom_state *state = machine->driver_data<pecom_state>(); |
| 26 | state->reset_timer = timer_alloc( | |
| 26 | state->reset_timer = machine->scheduler().timer_alloc(FUNC( | |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | MACHINE_RESET( pecom ) |
| r10315 | r10316 | |
|---|---|---|
| 149 | 149 | devcb_resolve_write_line(&ay3600->out_ako_func, &intf->out_ako_func, device); |
| 150 | 150 | |
| 151 | 151 | /* create the timers */ |
| 152 | ay3600->scan_timer = | |
| 152 | ay3600->scan_timer = | |
| 153 | 153 | timer_adjust_periodic(ay3600->scan_timer, attotime::zero, 0, attotime::from_hz(60)); |
| 154 | 154 | |
| 155 | 155 | /* register for state saving */ |
| r10315 | r10316 | |
|---|---|---|
| 1269 | 1269 | } |
| 1270 | 1270 | } |
| 1271 | 1271 | |
| 1272 | pce_cd.data_timer = timer_alloc( | |
| 1272 | pce_cd.data_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1273 | 1273 | timer_adjust_oneshot(pce_cd.data_timer, attotime::never, 0); |
| 1274 | pce_cd.adpcm_dma_timer = timer_alloc( | |
| 1274 | pce_cd.adpcm_dma_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1275 | 1275 | timer_adjust_oneshot(pce_cd.adpcm_dma_timer, attotime::never, 0); |
| 1276 | 1276 | |
| 1277 | pce_cd.cdda_fadeout_timer = timer_alloc( | |
| 1277 | pce_cd.cdda_fadeout_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1278 | 1278 | timer_adjust_oneshot(pce_cd.cdda_fadeout_timer, attotime::never, 0); |
| 1279 | pce_cd.cdda_fadein_timer = timer_alloc( | |
| 1279 | pce_cd.cdda_fadein_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1280 | 1280 | timer_adjust_oneshot(pce_cd.cdda_fadein_timer, attotime::never, 0); |
| 1281 | 1281 | |
| 1282 | pce_cd.adpcm_fadeout_timer = timer_alloc( | |
| 1282 | pce_cd.adpcm_fadeout_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1283 | 1283 | timer_adjust_oneshot(pce_cd.adpcm_fadeout_timer, attotime::never, 0); |
| 1284 | pce_cd.adpcm_fadein_timer = timer_alloc( | |
| 1284 | pce_cd.adpcm_fadein_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1285 | 1285 | timer_adjust_oneshot(pce_cd.adpcm_fadein_timer, attotime::never, 0); |
| 1286 | 1286 | } |
| 1287 | 1287 | |
| r10315 | r10316 | |
| 1581 | 1581 | if ( pce_cd.scsi_IO ) |
| 1582 | 1582 | { |
| 1583 | 1583 | pce_cd.scsi_ACK = 1; |
| 1584 | timer_set(machine | |
| 1584 | machine->scheduler().timer_set(machine | |
| 1585 | 1585 | } |
| 1586 | 1586 | } |
| 1587 | 1587 | return data; |
| r10315 | r10316 | |
|---|---|---|
| 2145 | 2145 | devcb_resolve_read_line(&w->in_auxbus_func, &w->intf->in_auxbus_func, device); |
| 2146 | 2146 | |
| 2147 | 2147 | /* allocate timers */ |
| 2148 | /* w->timer_data = timer_alloc(device->machine, smc92x4_data_callback, (void *)device); */ | |
| 2149 | w->timer_rs = timer_alloc(device->machine, smc92x4_read_sector_callback, (void *)device); | |
| 2150 | w->timer_ws = timer_alloc(device->machine, smc92x4_write_sector_callback, (void *)device); | |
| 2151 | w->timer_track = timer_alloc(device->machine, smc92x4_track_callback, (void *)device); | |
| 2152 | w->timer_seek = timer_alloc(device->machine, smc92x4_seek_callback, (void *)device); | |
| 2148 | /* w->timer_data = device->machine->scheduler().timer_alloc(FUNC(smc92x4_data_callback), (void *)device); */ | |
| 2149 | w->timer_rs = device->machine->scheduler().timer_alloc(FUNC(smc92x4_read_sector_callback), (void *)device); | |
| 2150 | w->timer_ws = device->machine->scheduler().timer_alloc(FUNC(smc92x4_write_sector_callback), (void *)device); | |
| 2151 | w->timer_track = device->machine->scheduler().timer_alloc(FUNC(smc92x4_track_callback), (void *)device); | |
| 2152 | w->timer_seek = device->machine->scheduler().timer_alloc(FUNC(smc92x4_seek_callback), (void *)device); | |
| 2153 | 2153 | |
| 2154 | 2154 | w->use_real_timing = TRUE; |
| 2155 | 2155 | } |
| r10315 | r10316 | |
|---|---|---|
| 128 | 128 | for (i=0; i<128; i++) gfx[i]=i; |
| 129 | 129 | |
| 130 | 130 | state->power = 1; |
| 131 | timer_set( | |
| 131 | machine->scheduler().timer_set( | |
| 132 | 132 | } |
| 133 | 133 |
| r10315 | r10316 | |
|---|---|---|
| 625 | 625 | } |
| 626 | 626 | |
| 627 | 627 | /* create the DMA timer */ |
| 628 | i8257->dma_timer = | |
| 628 | i8257->dma_timer = | |
| 629 | 629 | timer_adjust_periodic(i8257->dma_timer, attotime::zero, 0, attotime::from_hz(device->clock())); |
| 630 | 630 | |
| 631 | 631 | /* register for state saving */ |
| r10315 | r10316 | |
|---|---|---|
| 285 | 285 | |
| 286 | 286 | for (i = 0; i < 5; i++) |
| 287 | 287 | { |
| 288 | tms->timer[i] = | |
| 288 | tms->timer[i] = | |
| 289 | 289 | timer_set_param(tms->timer[i], i); |
| 290 | 290 | } |
| 291 | 291 |
| r10315 | r10316 | |
|---|---|---|
| 490 | 490 | |
| 491 | 491 | void sgi_mc_timer_init(running_machine *machine) |
| 492 | 492 | { |
| 493 | tMC_UpdateTimer = timer_alloc(m | |
| 493 | tMC_UpdateTimer = machine->scheduler().timer_alloc(FUNC(m | |
| 494 | 494 | timer_adjust_periodic(tMC_UpdateTimer, attotime::from_hz(10000), 0, attotime::from_hz(10000)); |
| 495 | 495 | } |
| 496 | 496 |
| r10315 | r10316 | |
|---|---|---|
| 2055 | 2055 | { |
| 2056 | 2056 | bbc_state *state = machine->driver_data<bbc_state>(); |
| 2057 | 2057 | state->Master=0; |
| 2058 | state->tape_timer = timer_alloc( | |
| 2058 | state->tape_timer = machine->scheduler().timer_alloc(FUNC( | |
| 2059 | 2059 | } |
| 2060 | 2060 | DRIVER_INIT( bbcm ) |
| 2061 | 2061 | { |
| 2062 | 2062 | bbc_state *state = machine->driver_data<bbc_state>(); |
| 2063 | 2063 | state->Master=1; |
| 2064 | state->tape_timer = timer_alloc( | |
| 2064 | state->tape_timer = machine->scheduler().timer_alloc(FUNC( | |
| 2065 | 2065 | } |
| 2066 | 2066 | |
| 2067 | 2067 | MACHINE_START( bbca ) |
| r10315 | r10316 | |
|---|---|---|
| 230 | 230 | |
| 231 | 231 | static void kc_disc_interface_init(running_machine *machine) |
| 232 | 232 | { |
| 233 | timer_set( | |
| 233 | machine->scheduler().timer_set( | |
| 234 | 234 | |
| 235 | 235 | /* hold cpu at reset */ |
| 236 | 236 | cputag_set_input_line(machine, "disc", INPUT_LINE_RESET, ASSERT_LINE); |
| r10315 | r10316 | |
| 403 | 403 | static void kc_cassette_init(running_machine *machine) |
| 404 | 404 | { |
| 405 | 405 | kc_state *state = machine->driver_data<kc_state>(); |
| 406 | state->cassette_timer = timer_alloc( | |
| 406 | state->cassette_timer = machine->scheduler().timer_alloc(FUNC( | |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | static void kc_cassette_set_motor(running_machine *machine, int motor_state) |
| r10315 | r10316 | |
| 1788 | 1788 | |
| 1789 | 1789 | // from keyboard init |
| 1790 | 1790 | /* 50 Hz is just a arbitrary value - used to put scan-codes into the queue for transmitting */ |
| 1791 | timer_pulse( | |
| 1791 | machine->scheduler().timer_pulse( | |
| 1792 | 1792 | |
| 1793 | 1793 | /* timer to transmit pulses to kc base unit */ |
| 1794 | timer_pulse( | |
| 1794 | machine->scheduler().timer_pulse( | |
| 1795 | 1795 | |
| 1796 | timer_pulse(machine, attotime::from_hz(15625), (void *)machine->device("z80ctc"), 0, kc85_15khz_timer_callback); | |
| 1797 | timer_set(machine, attotime::zero, NULL, 0, kc85_reset_timer_callback); | |
| 1796 | machine->scheduler().timer_pulse(attotime::from_hz(15625), FUNC(kc85_15khz_timer_callback), 0, (void *)machine->device("z80ctc")); | |
| 1797 | machine->scheduler().timer_set(attotime::zero, FUNC(kc85_reset_timer_callback)); | |
| 1798 | 1798 | } |
| 1799 | 1799 | |
| 1800 | 1800 | static void kc85_common_init(running_machine *machine) |
| r10315 | r10316 | |
|---|---|---|
| 635 | 635 | upd3301->width = intf->width; |
| 636 | 636 | |
| 637 | 637 | /* create the timers */ |
| 638 | upd3301->vrtc_timer = timer_alloc(device->machine, vrtc_tick, (void *)device); | |
| 639 | upd3301->hrtc_timer = timer_alloc(device->machine, hrtc_tick, (void *)device); | |
| 638 | upd3301->vrtc_timer = device->machine->scheduler().timer_alloc(FUNC(vrtc_tick), (void *)device); | |
| 639 | upd3301->hrtc_timer = device->machine->scheduler().timer_alloc(FUNC(hrtc_tick), (void *)device); | |
| 640 | 640 | |
| 641 | 641 | /* register for state saving */ |
| 642 | 642 | // state_save_register_device_item(device, 0, upd3301->); |
| r10315 | r10316 | |
|---|---|---|
| 173 | 173 | for (y = state->charline_ptr; y < ARRAY_LENGTH(state->charline); y++) |
| 174 | 174 | state->charline[y] = 0; |
| 175 | 175 | |
| 176 | timer_set(machine | |
| 176 | machine->scheduler().timer_set(machine | |
| 177 | 177 | state->ula_irq_active++; |
| 178 | 178 | |
| 179 | 179 | scanline = BITMAP_ADDR16(bitmap, state->ula_scanline_count, 0); |
| r10315 | r10316 | |
| 203 | 203 | VIDEO_START( zx ) |
| 204 | 204 | { |
| 205 | 205 | zx_state *state = machine->driver_data<zx_state>(); |
| 206 | state->ula_nmi = timer_alloc( | |
| 206 | state->ula_nmi = machine->scheduler().timer_alloc(FUNC( | |
| 207 | 207 | state->ula_irq_active = 0; |
| 208 | 208 | VIDEO_START_CALL(generic_bitmapped); |
| 209 | 209 | } |
| r10315 | r10316 | |
|---|---|---|
| 1588 | 1588 | int m6847_get_horizontal_sync(running_machine *machine) |
| 1589 | 1589 | { |
| 1590 | 1590 | attotime fire_time = timer_firetime(m6847->hs_fall_timer); |
| 1591 | return fire_time > | |
| 1591 | return fire_time > | |
| 1592 | 1592 | } |
| 1593 | 1593 | |
| 1594 | 1594 | |
| r10315 | r10316 | |
| 1596 | 1596 | static void set_horizontal_sync(running_machine *machine) |
| 1597 | 1597 | { |
| 1598 | 1598 | attotime fire_time = timer_firetime(m6847->hs_fall_timer); |
| 1599 | int horizontal_sync = fire_time > | |
| 1599 | int horizontal_sync = fire_time > | |
| 1600 | 1600 | if (m6847->horizontal_sync_callback) |
| 1601 | 1601 | m6847->horizontal_sync_callback(machine, !horizontal_sync); |
| 1602 | 1602 | } |
| r10315 | r10316 | |
| 1606 | 1606 | int m6847_get_field_sync(running_machine *machine) |
| 1607 | 1607 | { |
| 1608 | 1608 | attotime fire_time = timer_firetime(m6847->fs_fall_timer); |
| 1609 | return fire_time > | |
| 1609 | return fire_time > | |
| 1610 | 1610 | } |
| 1611 | 1611 | |
| 1612 | 1612 | |
| r10315 | r10316 | |
| 1614 | 1614 | static void set_field_sync(running_machine *machine) |
| 1615 | 1615 | { |
| 1616 | 1616 | attotime fire_time = timer_firetime(m6847->fs_fall_timer); |
| 1617 | int field_sync = fire_time > | |
| 1617 | int field_sync = fire_time > | |
| 1618 | 1618 | if (m6847->field_sync_callback) |
| 1619 | 1619 | m6847->field_sync_callback(machine,field_sync); |
| 1620 | 1620 | } |
| r10315 | r10316 | |
| 1630 | 1630 | static TIMER_CALLBACK(hs_fall) |
| 1631 | 1631 | { |
| 1632 | 1632 | if (LOG_HS) |
| 1633 | logerror("hs_fall(): time=%s\n", | |
| 1633 | logerror("hs_fall(): time=%s\n", | |
| 1634 | 1634 | |
| 1635 | 1635 | set_horizontal_sync(machine); |
| 1636 | 1636 | } |
| r10315 | r10316 | |
| 1638 | 1638 | static TIMER_CALLBACK(hs_rise) |
| 1639 | 1639 | { |
| 1640 | 1640 | if (LOG_HS) |
| 1641 | logerror("hs_rise(): time=%s\n", | |
| 1641 | logerror("hs_rise(): time=%s\n", | |
| 1642 | 1642 | |
| 1643 | 1643 | timer_adjust_oneshot(m6847->hs_rise_timer, |
| 1644 | 1644 | attotime(0, m6847->scanline_period), 0); |
| r10315 | r10316 | |
| 1652 | 1652 | static TIMER_CALLBACK(fs_fall) |
| 1653 | 1653 | { |
| 1654 | 1654 | if (LOG_FS) |
| 1655 | logerror("fs_fall(): time=%s scanline=%d\n", | |
| 1655 | logerror("fs_fall(): time=%s scanline=%d\n", | |
| 1656 | 1656 | |
| 1657 | 1657 | set_field_sync(machine); |
| 1658 | 1658 | } |
| r10315 | r10316 | |
| 1660 | 1660 | static TIMER_CALLBACK(fs_rise) |
| 1661 | 1661 | { |
| 1662 | 1662 | if (LOG_FS) |
| 1663 | logerror("fs_rise(): time=%s scanline=%d\n", | |
| 1663 | logerror("fs_rise(): time=%s scanline=%d\n", | |
| 1664 | 1664 | |
| 1665 | 1665 | /* adjust field sync falling edge timer */ |
| 1666 | 1666 | timer_adjust_oneshot(m6847->fs_fall_timer, |
| r10315 | r10316 | |
| 1869 | 1869 | } |
| 1870 | 1870 | |
| 1871 | 1871 | /* allocate timers */ |
| 1872 | m6847->fs_rise_timer = timer_alloc(machine, fs_rise, NULL); | |
| 1873 | m6847->fs_fall_timer = timer_alloc(machine, fs_fall, NULL); | |
| 1874 | m6847->hs_rise_timer = timer_alloc(machine, hs_rise, NULL); | |
| 1875 | m6847->hs_fall_timer = timer_alloc(machine, hs_fall, NULL); | |
| 1872 | m6847->fs_rise_timer = machine->scheduler().timer_alloc(FUNC(fs_rise)); | |
| 1873 | m6847->fs_fall_timer = machine->scheduler().timer_alloc(FUNC(fs_fall)); | |
| 1874 | m6847->hs_rise_timer = machine->scheduler().timer_alloc(FUNC(hs_rise)); | |
| 1875 | m6847->hs_fall_timer = machine->scheduler().timer_alloc(FUNC(hs_fall)); | |
| 1876 | 1876 | |
| 1877 | 1877 | /* setup dimensions */ |
| 1878 | 1878 | m6847->top_border_scanlines = v->top_border_scanlines; |
| r10315 | r10316 | |
|---|---|---|
| 142 | 142 | int menu_start = HP48_IO_20(0x30) & ~1; /* menu bitmap address */ |
| 143 | 143 | int fg = contrast + 2; |
| 144 | 144 | |
| 145 | LOG(( "%f hp48 video_update called: ", | |
| 145 | LOG(( "%f hp48 video_update called: ", | |
| 146 | 146 | |
| 147 | 147 | if ( !display || refresh ) |
| 148 | 148 | { |
| r10315 | r10316 | |
|---|---|---|
| 735 | 735 | int clock=vga.monitor.get_clock(); |
| 736 | 736 | int lines=vga.monitor.get_lines(); |
| 737 | 737 | int columns=vga.monitor.get_columns(); |
| 738 | int diff = ((( | |
| 738 | int diff = ((( | |
| 739 | 739 | %(lines*columns); |
| 740 | 740 | if (diff<columns*vga.monitor.get_sync_lines()) data|=8; |
| 741 | 741 | diff=diff/lines; |
| r10315 | r10316 | |
| 745 | 745 | if (vga.monitor.retrace) |
| 746 | 746 | { |
| 747 | 747 | data |= 1; |
| 748 | if (( | |
| 748 | if (( | |
| 749 | 749 | { |
| 750 | 750 | data |= 8; |
| 751 | 751 | vga.monitor.retrace=0; |
| r10315 | r10316 | |
| 753 | 753 | } |
| 754 | 754 | else |
| 755 | 755 | { |
| 756 | if (( | |
| 756 | if (( | |
| 757 | 757 | vga.monitor.retrace=1; |
| 758 | vga.monitor.start_time= | |
| 758 | vga.monitor.start_time= | |
| 759 | 759 | } |
| 760 | 760 | #else |
| 761 | 761 | // not working with ps2m30 |
| r10315 | r10316 | |
| 1010 | 1010 | vga_cpu_interface(space->machine); |
| 1011 | 1011 | |
| 1012 | 1012 | if (vga.sequencer.index == 0) |
| 1013 | vga.monitor.start_time = | |
| 1013 | vga.monitor.start_time = | |
| 1014 | 1014 | } |
| 1015 | 1015 | break; |
| 1016 | 1016 | case 6: |
| r10315 | r10316 | |
| 1279 | 1279 | vga.monitor.get_columns = ega_get_crtc_columns; |
| 1280 | 1280 | vga.monitor.get_sync_lines = vga_get_crtc_sync_lines; |
| 1281 | 1281 | vga.monitor.get_sync_columns = vga_get_crtc_sync_columns; |
| 1282 | timer_pulse( | |
| 1282 | machine->scheduler().timer_pulse( | |
| 1283 | 1283 | pc_video_start(machine, NULL, pc_ega_choosevideomode, 0); |
| 1284 | 1284 | } |
| 1285 | 1285 | |
| r10315 | r10316 | |
| 1294 | 1294 | vga.monitor.get_columns=vga_get_crtc_columns; |
| 1295 | 1295 | vga.monitor.get_sync_lines=vga_get_crtc_sync_lines; |
| 1296 | 1296 | vga.monitor.get_sync_columns=vga_get_crtc_sync_columns; |
| 1297 | timer_pulse( | |
| 1297 | machine->scheduler().timer_pulse( | |
| 1298 | 1298 | pc_video_start(machine, NULL, pc_vga_choosevideomode, 0); |
| 1299 | 1299 | } |
| 1300 | 1300 |
| r10315 | r10316 | |
|---|---|---|
| 259 | 259 | else |
| 260 | 260 | vdt->cursor_address_mask = 0x7ff; /* 2 kb of RAM */ |
| 261 | 261 | |
| 262 | | |
| 262 | | |
| 263 | 263 | |
| 264 | 264 | /* set up cursor blink clock. 2Hz frequency -> .25s half-period. */ |
| 265 | /*vdt->blink_clock =*/ | |
| 265 | /*vdt->blink_clock =*/ | |
| 266 | 266 | |
| 267 | 267 | /* alloc beep timer */ |
| 268 | vdt->beep_timer = | |
| 268 | vdt->beep_timer = | |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | DEVICE_GET_INFO( vdt911 ) |
| r10315 | r10316 | |
|---|---|---|
| 1231 | 1231 | MACHINE_START( gb_video ) |
| 1232 | 1232 | { |
| 1233 | 1233 | gb_state *state = machine->driver_data<gb_state>(); |
| 1234 | state->lcd.lcd_timer = timer_alloc( | |
| 1234 | state->lcd.lcd_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1235 | 1235 | } |
| 1236 | 1236 | |
| 1237 | 1237 | MACHINE_START( gbc_video ) |
| 1238 | 1238 | { |
| 1239 | 1239 | gb_state *state = machine->driver_data<gb_state>(); |
| 1240 | state->lcd.lcd_timer = timer_alloc( | |
| 1240 | state->lcd.lcd_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1241 | 1241 | } |
| 1242 | 1242 | |
| 1243 | 1243 | void gb_video_reset( running_machine *machine, int mode ) |
| r10315 | r10316 | |
| 1311 | 1311 | memcpy( state->lcd.gb_oam->base(), mgb_oam_fingerprint, 0x100 ); |
| 1312 | 1312 | |
| 1313 | 1313 | /* Make sure the VBlank interrupt is set when the first instruction gets executed */ |
| 1314 | timer_set(machine | |
| 1314 | machine->scheduler().timer_set(machine | |
| 1315 | 1315 | |
| 1316 | 1316 | /* Initialize some video registers */ |
| 1317 | 1317 | gb_video_w( space, 0x0, 0x91 ); /* LCDCONT */ |
| r10315 | r10316 | |
|---|---|---|
| 65 | 65 | { |
| 66 | 66 | gamecom_state *state = machine->driver_data<gamecom_state>(); |
| 67 | 67 | VIDEO_START_CALL( generic_bitmapped ); |
| 68 | state->scanline_timer = timer_alloc( | |
| 68 | state->scanline_timer = machine->scheduler().timer_alloc(FUNC( | |
| 69 | 69 | timer_adjust_periodic( state->scanline_timer, machine->primary_screen->time_until_pos(0, 0 ), 0, machine->primary_screen->scan_period() ); |
| 70 | 70 | |
| 71 | 71 | } |
| r10315 | r10316 | |
|---|---|---|
| 23 | 23 | if(VERBOSE>=N) \ |
| 24 | 24 | { \ |
| 25 | 25 | if( M ) \ |
| 26 | logerror("%11.6f: %-24s", | |
| 26 | logerror("%11.6f: %-24s", | |
| 27 | 27 | logerror A; \ |
| 28 | 28 | } \ |
| 29 | 29 | } while (0) |
| r10315 | r10316 | |
|---|---|---|
| 252 | 252 | if (!state->ramp) |
| 253 | 253 | { |
| 254 | 254 | length = cputag_get_clock(machine, "maincpu") * INT_PER_CLOCK |
| 255 | * ( | |
| 255 | * ( | |
| 256 | 256 | |
| 257 | 257 | state->x_int += length * (state->analog[A_X] + state->analog[A_ZR]); |
| 258 | 258 | state->y_int += length * (state->analog[A_Y] + state->analog[A_ZR]); |
| r10315 | r10316 | |
| 265 | 265 | (*state->vector_add_point_function)(machine, state->x_int, state->y_int, state->beam_color, 2 * state->analog[A_Z]); |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | state->vector_start_time = | |
| 268 | state->vector_start_time = | |
| 269 | 269 | |
| 270 | 270 | if (ptr) |
| 271 | 271 | * (UINT8 *) ptr = param; |
| r10315 | r10316 | |
| 292 | 292 | state->imager_freq = 1; |
| 293 | 293 | |
| 294 | 294 | state->vector_add_point_function = vectrex_add_point; |
| 295 | state->imager_timer = timer_alloc( | |
| 295 | state->imager_timer = machine->scheduler().timer_alloc(FUNC( | |
| 296 | 296 | timer_adjust_periodic(state->imager_timer, |
| 297 | 297 | attotime::from_hz(state->imager_freq), |
| 298 | 298 | 2, |
| 299 | 299 | attotime::from_hz(state->imager_freq)); |
| 300 | 300 | |
| 301 | state->lp_t = timer_alloc( | |
| 301 | state->lp_t = machine->scheduler().timer_alloc(FUNC( | |
| 302 | 302 | |
| 303 | state->refresh = timer_alloc( | |
| 303 | state->refresh = machine->scheduler().timer_alloc(FUNC( | |
| 304 | 304 | |
| 305 | 305 | VIDEO_START_CALL(vector); |
| 306 | 306 | } |
| r10315 | r10316 | |
| 317 | 317 | vectrex_state *state = machine->driver_data<vectrex_state>(); |
| 318 | 318 | device_t *dac_device = machine->device("dac"); |
| 319 | 319 | |
| 320 | timer_set( | |
| 320 | machine->scheduler().timer_set( | |
| 321 | 321 | |
| 322 | 322 | if (mux == A_AUDIO) |
| 323 | 323 | dac_data_w(dac_device, state->via_out[PORTA]); |
| r10315 | r10316 | |
| 373 | 373 | if (!(data & 0x1) && (state->via_out[PORTB] & 0x1)) |
| 374 | 374 | { |
| 375 | 375 | /* MUX has been enabled */ |
| 376 | | |
| 376 | | |
| 377 | 377 | } |
| 378 | 378 | } |
| 379 | 379 | else |
| r10315 | r10316 | |
| 402 | 402 | vectrex_multiplexer (device->machine, (data >> 1) & 0x3); |
| 403 | 403 | |
| 404 | 404 | state->via_out[PORTB] = data; |
| 405 | | |
| 405 | | |
| 406 | 406 | } |
| 407 | 407 | |
| 408 | 408 | |
| r10315 | r10316 | |
| 411 | 411 | vectrex_state *state = device->machine->driver_data<vectrex_state>(); |
| 412 | 412 | /* DAC output always goes to Y integrator */ |
| 413 | 413 | state->via_out[PORTA] = data; |
| 414 | | |
| 414 | | |
| 415 | 415 | |
| 416 | 416 | if (!(state->via_out[PORTB] & 0x1)) |
| 417 | 417 | vectrex_multiplexer (device->machine, (state->via_out[PORTB] >> 1) & 0x3); |
| r10315 | r10316 | |
| 421 | 421 | static WRITE8_DEVICE_HANDLER(v_via_ca2_w) |
| 422 | 422 | { |
| 423 | 423 | if (data == 0) |
| 424 | | |
| 424 | | |
| 425 | 425 | } |
| 426 | 426 | |
| 427 | 427 | |
| r10315 | r10316 | |
| 446 | 446 | dx = abs(state->pen_x - state->x_int); |
| 447 | 447 | dy = abs(state->pen_y - state->y_int); |
| 448 | 448 | if (dx < 500000 && dy < 500000 && data > 0) |
| 449 | | |
| 449 | | |
| 450 | 450 | } |
| 451 | 451 | } |
| 452 | 452 | |
| 453 | | |
| 453 | | |
| 454 | 454 | state->cb2 = data; |
| 455 | 455 | } |
| 456 | 456 | } |
| r10315 | r10316 | |
| 490 | 490 | state->y_max = visarea.max_y << 16; |
| 491 | 491 | |
| 492 | 492 | state->vector_add_point_function = vectrex_add_point; |
| 493 | state->refresh = timer_alloc( | |
| 493 | state->refresh = machine->scheduler().timer_alloc(FUNC( | |
| 494 | 494 | |
| 495 | 495 | VIDEO_START_CALL(vector); |
| 496 | 496 | } |
| r10315 | r10316 | |
|---|---|---|
| 131 | 131 | VIDEO_START( aim65 ) |
| 132 | 132 | { |
| 133 | 133 | aim65_state *state = machine->driver_data<aim65_state>(); |
| 134 | state->print_timer = timer_alloc( | |
| 134 | state->print_timer = machine->scheduler().timer_alloc(FUNC(a | |
| 135 | 135 | |
| 136 | 136 | #if 0 |
| 137 | 137 | videoram_size = 600 * 10 * 2; |
| r10315 | r10316 | |
|---|---|---|
| 1349 | 1349 | mc6847_state *mc6847 = (mc6847_state *) ptr; |
| 1350 | 1350 | |
| 1351 | 1351 | if (LOG_HS) |
| 1352 | logerror("hs_fall(): time=%s\n", | |
| 1352 | logerror("hs_fall(): time=%s\n", | |
| 1353 | 1353 | |
| 1354 | 1354 | mc6847->hs = ASSERT_LINE; |
| 1355 | 1355 | devcb_call_write_line(&mc6847->out_hs_func, mc6847->hs); |
| r10315 | r10316 | |
| 1360 | 1360 | mc6847_state *mc6847 = (mc6847_state *) ptr; |
| 1361 | 1361 | |
| 1362 | 1362 | if (LOG_HS) |
| 1363 | logerror("hs_rise(): time=%s\n", | |
| 1363 | logerror("hs_rise(): time=%s\n", | |
| 1364 | 1364 | |
| 1365 | 1365 | timer_adjust_oneshot(mc6847->hs_rise_timer, |
| 1366 | 1366 | attotime(0, mc6847->scanline_period), 0); |
| r10315 | r10316 | |
| 1378 | 1378 | mc6847_state *mc6847 = (mc6847_state *) ptr; |
| 1379 | 1379 | |
| 1380 | 1380 | if (LOG_FS) |
| 1381 | logerror("fs_fall(): time=%s scanline=%d\n", | |
| 1381 | logerror("fs_fall(): time=%s scanline=%d\n", | |
| 1382 | 1382 | |
| 1383 | 1383 | mc6847->fs = ASSERT_LINE; |
| 1384 | 1384 | devcb_call_write_line(&mc6847->out_fs_func, mc6847->fs); |
| r10315 | r10316 | |
| 1389 | 1389 | mc6847_state *mc6847 = (mc6847_state *) ptr; |
| 1390 | 1390 | |
| 1391 | 1391 | if (LOG_FS) |
| 1392 | logerror("fs_rise(): time=%s scanline=%d\n", | |
| 1392 | logerror("fs_rise(): time=%s scanline=%d\n", | |
| 1393 | 1393 | |
| 1394 | 1394 | /* adjust field sync falling edge timer */ |
| 1395 | 1395 | timer_adjust_oneshot(mc6847->fs_fall_timer, |
| r10315 | r10316 | |
| 1865 | 1865 | } |
| 1866 | 1866 | |
| 1867 | 1867 | /* allocate timers */ |
| 1868 | mc6847->fs_rise_timer = timer_alloc(device->machine, fs_rise, mc6847); | |
| 1869 | mc6847->fs_fall_timer = timer_alloc(device->machine, fs_fall, mc6847); | |
| 1870 | mc6847->hs_rise_timer = timer_alloc(device->machine, hs_rise, mc6847); | |
| 1871 | mc6847->hs_fall_timer = timer_alloc(device->machine, hs_fall, mc6847); | |
| 1868 | mc6847->fs_rise_timer = device->machine->scheduler().timer_alloc(FUNC(fs_rise), mc6847); | |
| 1869 | mc6847->fs_fall_timer = device->machine->scheduler().timer_alloc(FUNC(fs_fall), mc6847); | |
| 1870 | mc6847->hs_rise_timer = device->machine->scheduler().timer_alloc(FUNC(hs_rise), mc6847); | |
| 1871 | mc6847->hs_fall_timer = device->machine->scheduler().timer_alloc(FUNC(hs_fall), mc6847); | |
| 1872 | 1872 | |
| 1873 | 1873 | /* setup dimensions */ |
| 1874 | 1874 | mc6847->top_border_scanlines = v->top_border_scanlines; |
| r10315 | r10316 | |
|---|---|---|
| 203 | 203 | |
| 204 | 204 | void thom_set_lightpen_callback ( running_machine *machine, int nb, void (*cb) ( running_machine *machine, int step ) ) |
| 205 | 205 | { |
| 206 | LOG (( "%f thom_set_lightpen_callback called\n", | |
| 206 | LOG (( "%f thom_set_lightpen_callback called\n", | |
| 207 | 207 | thom_lightpen_nb = nb; |
| 208 | 208 | thom_lightpen_cb = cb; |
| 209 | 209 | } |
| r10315 | r10316 | |
| 913 | 913 | rectangle lrect = { 0, xbleft - 1, 0, 0 }; |
| 914 | 914 | rectangle rrect = { xbright, xright - 1, 0, 0 }; |
| 915 | 915 | |
| 916 | //LOG (( "%f thom: video update called\n", | |
| 916 | //LOG (( "%f thom: video update called\n", | |
| 917 | 917 | |
| 918 | 918 | /* upper border */ |
| 919 | 919 | for ( y = 0; y < THOM_BORDER_HEIGHT - thom_bheight; y++ ) |
| r10315 | r10316 | |
| 1025 | 1025 | static TIMER_CALLBACK( thom_set_init ) |
| 1026 | 1026 | { |
| 1027 | 1027 | int init = param; |
| 1028 | LOG (( "%f thom_set_init: %i, at line %i col %i\n", | |
| 1028 | LOG (( "%f thom_set_init: %i, at line %i col %i\n", | |
| 1029 | 1029 | |
| 1030 | 1030 | if ( thom_init_cb ) |
| 1031 | 1031 | thom_init_cb( machine, init ); |
| r10315 | r10316 | |
| 1041 | 1041 | UINT16 b = 0; |
| 1042 | 1042 | struct thom_vsignal l = thom_get_lightpen_vsignal( machine, 0, -1, 0 ); |
| 1043 | 1043 | |
| 1044 | LOG (( "%f thom: video eof called\n", | |
| 1044 | LOG (( "%f thom: video eof called\n", | |
| 1045 | 1045 | |
| 1046 | 1046 | /* floppy indicator count */ |
| 1047 | 1047 | if ( thom_floppy_wcount ) |
| r10315 | r10316 | |
| 1153 | 1153 | state_save_register_global(machine, thom_floppy_rcount ); |
| 1154 | 1154 | output_set_value( "floppy", 0 ); |
| 1155 | 1155 | |
| 1156 | thom_video_timer = timer_alloc( | |
| 1156 | thom_video_timer = machine->scheduler().timer_alloc(F | |
| 1157 | 1157 | |
| 1158 | thom_scanline_timer = timer_alloc( | |
| 1158 | thom_scanline_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1159 | 1159 | |
| 1160 | 1160 | thom_lightpen_nb = 0; |
| 1161 | 1161 | thom_lightpen_cb = NULL; |
| 1162 | thom_lightpen_timer = timer_alloc( | |
| 1162 | thom_lightpen_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1163 | 1163 | state_save_register_global(machine, thom_lightpen_nb ); |
| 1164 | 1164 | |
| 1165 | 1165 | thom_init_cb = NULL; |
| 1166 | thom_init_timer = timer_alloc( | |
| 1166 | thom_init_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1167 | 1167 | |
| 1168 | 1168 | state_save_register_global(machine, thom_bwidth ); |
| 1169 | 1169 | state_save_register_global(machine, thom_bheight ); |
| r10315 | r10316 | |
|---|---|---|
| 287 | 287 | // end of HBlank period clears GPIP6 also? |
| 288 | 288 | end_time = machine->primary_screen->time_until_pos(scan,state->crtc.hend); |
| 289 | 289 | timer_adjust_oneshot(state->raster_irq, irq_time, scan); |
| 290 | timer_set( | |
| 290 | machine->scheduler().timer_set( | |
| 291 | 291 | logerror("GPIP6: Raster triggered at line %i (%i)\n",scan,machine->primary_screen->vpos()); |
| 292 | 292 | } |
| 293 | 293 | } |
| r10315 | r10316 | |
| 448 | 448 | if(data & 0x08) // text screen raster copy |
| 449 | 449 | { |
| 450 | 450 | x68k_crtc_text_copy(state, (state->crtc.reg[22] & 0xff00) >> 8,(state->crtc.reg[22] & 0x00ff)); |
| 451 | | |
| 451 | | |
| 452 | 452 | } |
| 453 | 453 | if(data & 0x02) // high-speed graphic screen clear |
| 454 | 454 | { |
| 455 | 455 | memset(state->gvram,0,0x40000); |
| 456 | | |
| 456 | | |
| 457 | 457 | } |
| 458 | 458 | break; |
| 459 | 459 | } |
| r10315 | r10316 | |
|---|---|---|
| 739 | 739 | |
| 740 | 740 | /* create the timers */ |
| 741 | 741 | if (crtc_ega->intf->on_de_changed != NULL) |
| 742 | crtc_ega->de_changed_timer = | |
| 742 | crtc_ega->de_changed_timer = | |
| 743 | 743 | |
| 744 | 744 | if (crtc_ega->intf->on_hsync_changed != NULL) |
| 745 | 745 | { |
| 746 | crtc_ega->hsync_on_timer = timer_alloc(device->machine, hsync_on_timer_cb, (void *)device); | |
| 747 | crtc_ega->hsync_off_timer = timer_alloc(device->machine, hsync_off_timer_cb, (void *)device); | |
| 746 | crtc_ega->hsync_on_timer = device->machine->scheduler().timer_alloc(FUNC(hsync_on_timer_cb), (void *)device); | |
| 747 | crtc_ega->hsync_off_timer = device->machine->scheduler().timer_alloc(FUNC(hsync_off_timer_cb), (void *)device); | |
| 748 | 748 | } |
| 749 | 749 | |
| 750 | 750 | if (crtc_ega->intf->on_vsync_changed != NULL) |
| 751 | 751 | { |
| 752 | crtc_ega->vsync_on_timer = timer_alloc(device->machine, vsync_on_timer_cb, (void *)device); | |
| 753 | crtc_ega->vsync_off_timer = timer_alloc(device->machine, vsync_off_timer_cb, (void *)device); | |
| 752 | crtc_ega->vsync_on_timer = device->machine->scheduler().timer_alloc(FUNC(vsync_on_timer_cb), (void *)device); | |
| 753 | crtc_ega->vsync_off_timer = device->machine->scheduler().timer_alloc(FUNC(vsync_off_timer_cb), (void *)device); | |
| 754 | 754 | } |
| 755 | 755 | |
| 756 | 756 | if (crtc_ega->intf->on_vblank_changed != NULL) |
| 757 | 757 | { |
| 758 | crtc_ega->vblank_on_timer = timer_alloc(device->machine, vblank_on_timer_cb, (void *)device); | |
| 759 | crtc_ega->vblank_off_timer = timer_alloc(device->machine, vblank_off_timer_cb, (void *)device); | |
| 758 | crtc_ega->vblank_on_timer = device->machine->scheduler().timer_alloc(FUNC(vblank_on_timer_cb), (void *)device); | |
| 759 | crtc_ega->vblank_off_timer = device->machine->scheduler().timer_alloc(FUNC(vblank_off_timer_cb), (void *)device); | |
| 760 | 760 | } |
| 761 | 761 | } |
| 762 | 762 | |
| 763 | crtc_ega->light_pen_latch_timer = | |
| 763 | crtc_ega->light_pen_latch_timer = | |
| 764 | 764 | |
| 765 | 765 | /* register for state saving */ |
| 766 | 766 |
| r10315 | r10316 | |
|---|---|---|
| 1058 | 1058 | m_mfp->i3_w(m_blitter_done); |
| 1059 | 1059 | |
| 1060 | 1060 | int nops = BLITTER_NOPS[m_blitter_op][m_blitter_hop]; // each NOP takes 4 cycles |
| 1061 | timer_set( | |
| 1061 | machine->scheduler().timer_set( | |
| 1062 | 1062 | } |
| 1063 | 1063 | } |
| 1064 | 1064 | } |
| r10315 | r10316 | |
| 1080 | 1080 | |
| 1081 | 1081 | void st_state::video_start() |
| 1082 | 1082 | { |
| 1083 | m_shifter_timer = timer_alloc(machine, atarist_shifter_tick, NULL); | |
| 1084 | m_glue_timer = timer_alloc(machine, atarist_glue_tick, NULL); | |
| 1083 | m_shifter_timer = machine->scheduler().timer_alloc(FUNC(atarist_shifter_tick)); | |
| 1084 | m_glue_timer = machine->scheduler().timer_alloc(FUNC(atarist_glue_tick)); | |
| 1085 | 1085 | |
| 1086 | 1086 | // timer_adjust_periodic(m_shifter_timer, machine->primary_screen->time_until_pos(0,0), 0, attotime::from_hz(Y2/4)); // 125 ns |
| 1087 | 1087 | timer_adjust_periodic(m_glue_timer, machine->primary_screen->time_until_pos(0,0), 0, attotime::from_hz(Y2/16)); // 500 ns |
| r10315 | r10316 | |
|---|---|---|
| 109 | 109 | int idx; |
| 110 | 110 | |
| 111 | 111 | crtc = auto_alloc_clear(machine, struct mscrtc6845); |
| 112 | crtc->cursor_time = | |
| 112 | crtc->cursor_time = | |
| 113 | 113 | crtc->config = *config; |
| 114 | 114 | mscrtc6845 = crtc; |
| 115 | 115 | |
| r10315 | r10316 | |
| 152 | 152 | double neu, ftime; |
| 153 | 153 | struct mscrtc6845_cursor cursor; |
| 154 | 154 | |
| 155 | neu = | |
| 155 | neu = | |
| 156 | 156 | |
| 157 | 157 | if (mscrtc6845_clocks_in_frame(crtc) == 0.0) |
| 158 | 158 | return; |
| r10315 | r10316 | |
|---|---|---|
| 37 | 37 | /* initialise flash timer */ |
| 38 | 38 | state->vh_state.flash_count = 0; |
| 39 | 39 | state->vh_state.flash_state = 0; |
| 40 | timer_pulse( | |
| 40 | machine->scheduler().timer_pulse( | |
| 41 | 41 | /* mode */ |
| 42 | 42 | oric_vh_update_attribute(machine,(1<<3)|(1<<4)); |
| 43 | 43 | } |
| r10315 | r10316 | |
|---|---|---|
| 1094 | 1094 | assert(upd7220->screen != NULL); |
| 1095 | 1095 | |
| 1096 | 1096 | /* create the timers */ |
| 1097 | upd7220->vsync_timer = timer_alloc(device->machine, vsync_tick, (void *)device); | |
| 1098 | upd7220->hsync_timer = timer_alloc(device->machine, hsync_tick, (void *)device); | |
| 1099 | upd7220->blank_timer = timer_alloc(device->machine, blank_tick, (void *)device); | |
| 1097 | upd7220->vsync_timer = device->machine->scheduler().timer_alloc(FUNC(vsync_tick), (void *)device); | |
| 1098 | upd7220->hsync_timer = device->machine->scheduler().timer_alloc(FUNC(hsync_tick), (void *)device); | |
| 1099 | upd7220->blank_timer = device->machine->scheduler().timer_alloc(FUNC(blank_tick), (void *)device); | |
| 1100 | 1100 | |
| 1101 | 1101 | /* set initial values */ |
| 1102 | 1102 | upd7220->fifo_ptr = -1; |
| r10315 | r10316 | |
|---|---|---|
| 106 | 106 | if(VERBOSE_LEVEL >= N) \ |
| 107 | 107 | { \ |
| 108 | 108 | if( M ) \ |
| 109 | logerror("%11.6f: %-24s", | |
| 109 | logerror("%11.6f: %-24s", | |
| 110 | 110 | logerror A; \ |
| 111 | 111 | } \ |
| 112 | 112 | } while (0) |
| r10315 | r10316 | |
| 1923 | 1923 | if (LIGHTPEN_BUTTON) |
| 1924 | 1924 | { |
| 1925 | 1925 | /* lightpen timer start */ |
| 1926 | timer_set( | |
| 1926 | machine->scheduler().timer_set( | |
| 1927 | 1927 | } |
| 1928 | 1928 | |
| 1929 | 1929 | } |
| r10315 | r10316 | |
|---|---|---|
| 546 | 546 | void crt9007_device::device_start() |
| 547 | 547 | { |
| 548 | 548 | // allocate timers |
| 549 | m_hsync_timer = device_timer_alloc(*this, TIMER_HSYNC); | |
| 550 | m_vsync_timer = device_timer_alloc(*this, TIMER_VSYNC); | |
| 551 | m_vlt_timer = device_timer_alloc(*this, TIMER_VLT); | |
| 552 | m_curs_timer = device_timer_alloc(*this, TIMER_CURS); | |
| 553 | m_drb_timer = device_timer_alloc(*this, TIMER_DRB); | |
| 554 | m_dma_timer = device_timer_alloc(*this, TIMER_DMA); | |
| 549 | m_hsync_timer = timer_alloc(TIMER_HSYNC); | |
| 550 | m_vsync_timer = timer_alloc(TIMER_VSYNC); | |
| 551 | m_vlt_timer = timer_alloc(TIMER_VLT); | |
| 552 | m_curs_timer = timer_alloc(TIMER_CURS); | |
| 553 | m_drb_timer = timer_alloc(TIMER_DRB); | |
| 554 | m_dma_timer = timer_alloc(TIMER_DMA); | |
| 555 | 555 | |
| 556 | 556 | // resolve callbacks |
| 557 | 557 | devcb_resolve_write_line(&m_out_int_func, &m_config.out_int_func, this); |
| r10315 | r10316 | |
|---|---|---|
| 46 | 46 | state->map4[i] = ( ( i & 0x10 ) >> 3 ) | ( i & 0x01 ); |
| 47 | 47 | state->map16[i] = ( ( i & 0x40 ) >> 3 ) | ( ( i & 0x10 ) >> 2 ) | ( ( i & 0x04 ) >> 1 ) | ( i & 0x01 ); |
| 48 | 48 | } |
| 49 | state->scanline_timer = timer_alloc( | |
| 49 | state->scanline_timer = machine->scheduler().timer_alloc(FUNC( | |
| 50 | 50 | timer_adjust_periodic( state->scanline_timer, machine->primary_screen->time_until_pos(0), 0, machine->primary_screen->scan_period() ); |
| 51 | 51 | } |
| 52 | 52 |
| r10315 | r10316 | |
|---|---|---|
| 184 | 184 | devcb_resolve_write_line(&m_out_vsync_func, &m_config.out_vsync_func, this); |
| 185 | 185 | |
| 186 | 186 | // allocate timers |
| 187 | m_vsync_timer = device_timer_alloc(*this, TIMER_VSYNC); | |
| 188 | m_flash_timer = device_timer_alloc(*this, TIMER_FLASH); | |
| 187 | m_vsync_timer = timer_alloc(TIMER_VSYNC); | |
| 188 | m_flash_timer = timer_alloc(TIMER_FLASH); | |
| 189 | 189 | |
| 190 | 190 | // adjust timer periods |
| 191 | 191 | timer_adjust_periodic(m_vsync_timer, attotime::zero, 0, attotime::from_hz(50)); |
| r10315 | r10316 | |
|---|---|---|
| 314 | 314 | assert(vt->gfx != NULL); |
| 315 | 315 | |
| 316 | 316 | // LBA7 is scan line frequency update |
| 317 | | |
| 317 | | |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 |
| r10315 | r10316 | |
|---|---|---|
| 378 | 378 | number of one-third-cycles elapsed, then checking the result |
| 379 | 379 | modulo 3. */ |
| 380 | 380 | |
| 381 | if (((int) ( | |
| 381 | if (((int) ( | |
| 382 | 382 | new_blink_on = 1; |
| 383 | 383 | else |
| 384 | 384 | new_blink_on = 0; |
| r10315 | r10316 | |
|---|---|---|
| 18 | 18 | if(VERBOSE_MDA>=N) \ |
| 19 | 19 | { \ |
| 20 | 20 | if( M ) \ |
| 21 | logerror("%11.6f: %-24s", | |
| 21 | logerror("%11.6f: %-24s", | |
| 22 | 22 | logerror A; \ |
| 23 | 23 | } \ |
| 24 | 24 | } while (0) |
| r10315 | r10316 | |
|---|---|---|
| 1806 | 1806 | pic8259_ir3_w(dev, 1); // IRQ11 = VSync |
| 1807 | 1807 | if(IRQ_LOG) logerror("PIC: IRQ11 (VSync) set high\n"); |
| 1808 | 1808 | state->video.towns_vblank_flag = 1; |
| 1809 | | |
| 1809 | | |
| 1810 | 1810 | if(state->video.towns_tvram_enable) |
| 1811 | 1811 | draw_text_layer(dev->machine); |
| 1812 | 1812 | if(state->video.towns_sprite_reg[1] & 0x80) |
| r10315 | r10316 | |
| 1819 | 1819 | |
| 1820 | 1820 | state->video.towns_vram_wplane = 0x00; |
| 1821 | 1821 | state->video.towns_sprite_page = 0; |
| 1822 | state->video.sprite_timer = timer_alloc( | |
| 1822 | state->video.sprite_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1823 | 1823 | } |
| 1824 | 1824 | |
| 1825 | 1825 | VIDEO_UPDATE( towns ) |
| r10315 | r10316 | |
|---|---|---|
| 111 | 111 | |
| 112 | 112 | void hd44780_device::device_start() |
| 113 | 113 | { |
| 114 | m_busy_timer = device_timer_alloc(*this, BUSY_TIMER); | |
| 115 | m_blink_timer = device_timer_alloc(*this, BLINKING_TIMER); | |
| 114 | m_busy_timer = timer_alloc(BUSY_TIMER); | |
| 115 | m_blink_timer = timer_alloc(BLINKING_TIMER); | |
| 116 | 116 | |
| 117 | 117 | timer_adjust_periodic(m_blink_timer, attotime::from_msec(409), 0, attotime::from_msec(409)); |
| 118 | 118 |
| r10315 | r10316 | |
|---|---|---|
| 59 | 59 | if (VERBOSE_LEVEL >= N) \ |
| 60 | 60 | { \ |
| 61 | 61 | if (M) \ |
| 62 | logerror("%11.6f: %-24s", | |
| 62 | logerror("%11.6f: %-24s", | |
| 63 | 63 | logerror A; \ |
| 64 | 64 | } \ |
| 65 | 65 | } while (0) |
| r10315 | r10316 | |
| 364 | 364 | { |
| 365 | 365 | vdc8563_state *vdc8563 = get_safe_token(device); |
| 366 | 366 | double newtime, ftime; |
| 367 | newtime = | |
| 367 | newtime = | |
| 368 | 368 | |
| 369 | 369 | if (vdc8563_clocks_in_frame(device) == 0.0) |
| 370 | 370 | return; |
| r10315 | r10316 | |
|---|---|---|
| 801 | 801 | } |
| 802 | 802 | |
| 803 | 803 | /* GIME field sync timer */ |
| 804 | video->gime_fs_timer = timer_alloc( | |
| 804 | video->gime_fs_timer = machine->scheduler().timer_alloc(FUNC( | |
| 805 | 805 | |
| 806 | 806 | /* initialize the CoCo video code */ |
| 807 | 807 | memset(&cfg, 0, sizeof(cfg)); |
| r10315 | r10316 | |
|---|---|---|
| 90 | 90 | if(VERBOSE_CGA>=N) \ |
| 91 | 91 | { \ |
| 92 | 92 | if( M ) \ |
| 93 | logerror("%11.6f: %-24s", | |
| 93 | logerror("%11.6f: %-24s", | |
| 94 | 94 | logerror A; \ |
| 95 | 95 | } \ |
| 96 | 96 | } while (0) |
| r10315 | r10316 | |
|---|---|---|
| 353 | 353 | { |
| 354 | 354 | if (vpos == vpos_limit) |
| 355 | 355 | { |
| 356 | timer_set(machine | |
| 356 | machine->scheduler().timer_set(machine | |
| 357 | 357 | } |
| 358 | 358 | else |
| 359 | 359 | { |
| r10315 | r10316 | |
| 362 | 362 | |
| 363 | 363 | if (vpos == vpos_limit + 1) |
| 364 | 364 | { |
| 365 | timer_set(machine, machine->primary_screen->time_until_pos(vpos, VINT_FLAG_HPOS), smsvdp, (int)STATUS_VINT, smsvdp_set_status); | |
| 366 | timer_set(machine, machine->primary_screen->time_until_pos(vpos, VINT_HPOS), smsvdp, 0, smsvdp_check_vint); | |
| 365 | machine->scheduler().timer_set(machine->primary_screen->time_until_pos(vpos, VINT_FLAG_HPOS), FUNC(smsvdp_set_status), (int)STATUS_VINT, smsvdp); | |
| 366 | machine->scheduler().timer_set(machine->primary_screen->time_until_pos(vpos, VINT_HPOS), FUNC(smsvdp_check_vint), 0, smsvdp); | |
| 367 | 367 | } |
| 368 | 368 | |
| 369 | 369 | sms_update_palette(smsvdp); |
| r10315 | r10316 | |
| 395 | 395 | smsvdp->reg9copy = smsvdp->reg[0x09]; |
| 396 | 396 | } |
| 397 | 397 | |
| 398 | timer_set(machine | |
| 398 | machine->scheduler().timer_set(machine | |
| 399 | 399 | |
| 400 | 400 | sms_update_palette(smsvdp); |
| 401 | 401 | |
| r10315 | r10316 | |
| 565 | 565 | |
| 566 | 566 | if (reg_num == 1) |
| 567 | 567 | { |
| 568 | | |
| 568 | | |
| 569 | 569 | } |
| 570 | 570 | smsvdp->addrmode = 0; |
| 571 | 571 | break; |
| r10315 | r10316 | |
| 706 | 706 | else if (line >= 0 && line < smsvdp->sms_frame_timing[ACTIVE_DISPLAY_V]) |
| 707 | 707 | { |
| 708 | 708 | /* Too many sprites per line */ |
| 709 | timer_set(machine | |
| 709 | machine->scheduler().timer_set(machine | |
| 710 | 710 | } |
| 711 | 711 | sprite_buffer_count++; |
| 712 | 712 | } |
| r10315 | r10316 | |
| 861 | 861 | } |
| 862 | 862 | } |
| 863 | 863 | if (sprite_col_occurred) |
| 864 | timer_set(machine | |
| 864 | machine->scheduler().timer_set(machine | |
| 865 | 865 | } |
| 866 | 866 | |
| 867 | 867 | /* Fill column 0 with overscan color from reg[0x07] */ |
| r10315 | r10316 | |
| 913 | 913 | else if (line >= 0 && line < smsvdp->sms_frame_timing[ACTIVE_DISPLAY_V]) |
| 914 | 914 | { |
| 915 | 915 | /* Too many sprites per line */ |
| 916 | timer_set(machine | |
| 916 | machine->scheduler().timer_set(machine | |
| 917 | 917 | } |
| 918 | 918 | sprite_buffer_count++; |
| 919 | 919 | } |
| r10315 | r10316 | |
| 1125 | 1125 | } |
| 1126 | 1126 | } |
| 1127 | 1127 | if (sprite_col_occurred) |
| 1128 | timer_set(machine | |
| 1128 | machine->scheduler().timer_set(machine | |
| 1129 | 1129 | } |
| 1130 | 1130 | } |
| 1131 | 1131 | |
| r10315 | r10316 | |
| 1446 | 1446 | /* Make temp bitmap for rendering */ |
| 1447 | 1447 | smsvdp->tmpbitmap = auto_bitmap_alloc(device->machine, width, height, BITMAP_FORMAT_INDEXED32); |
| 1448 | 1448 | |
| 1449 | smsvdp->smsvdp_display_timer = | |
| 1449 | smsvdp->smsvdp_display_timer = | |
| 1450 | 1450 | timer_adjust_periodic(smsvdp->smsvdp_display_timer, screen->time_until_pos(0, DISPLAY_CB_HPOS), 0, screen->scan_period()); |
| 1451 | 1451 | |
| 1452 | 1452 | state_save_register_device_item(device, 0, smsvdp->status); |
| r10315 | r10316 | |
|---|---|---|
| 173 | 173 | |
| 174 | 174 | assert(m_screen != NULL); |
| 175 | 175 | |
| 176 | m_busy_timer = device_timer_alloc(*this, BUSY_TIMER); | |
| 177 | m_blink_timer = device_timer_alloc(*this, BLINKING_TIMER); | |
| 176 | m_busy_timer = timer_alloc(BUSY_TIMER); | |
| 177 | m_blink_timer = timer_alloc(BLINKING_TIMER); | |
| 178 | 178 | |
| 179 | 179 | m_videoram = space(0); |
| 180 | 180 | m_charset = region(); |
| r10315 | r10316 | |
|---|---|---|
| 175 | 175 | if(VERBOSE_LEVEL >= N) \ |
| 176 | 176 | { \ |
| 177 | 177 | if( M ) \ |
| 178 | logerror("%11.6f: %-24s", | |
| 178 | logerror("%11.6f: %-24s", | |
| 179 | 179 | logerror A; \ |
| 180 | 180 | } \ |
| 181 | 181 | } while (0) |
| r10315 | r10316 | |
| 1046 | 1046 | // if (LIGHTPEN_BUTTON) |
| 1047 | 1047 | { |
| 1048 | 1048 | /* lightpen timer start */ |
| 1049 | timer_set( | |
| 1049 | machine->scheduler().timer_set( | |
| 1050 | 1050 | } |
| 1051 | 1051 | } |
| 1052 | 1052 | else |
| r10315 | r10316 | |
| 1615 | 1615 | } |
| 1616 | 1616 | |
| 1617 | 1617 | vic2->raster_x += 8; |
| 1618 | timer_set(machine | |
| 1618 | machine->scheduler().timer_set(machine | |
| 1619 | 1619 | } |
| 1620 | 1620 | |
| 1621 | 1621 | static TIMER_CALLBACK( ntsc_timer_callback ) |
| r10315 | r10316 | |
| 1637 | 1637 | // if (LIGHTPEN_BUTTON) |
| 1638 | 1638 | { |
| 1639 | 1639 | /* lightpen timer starten */ |
| 1640 | timer_set( | |
| 1640 | machine->scheduler().timer_set( | |
| 1641 | 1641 | } |
| 1642 | 1642 | } |
| 1643 | 1643 | else |
| r10315 | r10316 | |
| 2194 | 2194 | } |
| 2195 | 2195 | |
| 2196 | 2196 | vic2->raster_x += 8; |
| 2197 | timer_set(machine | |
| 2197 | machine->scheduler().timer_set(machine | |
| 2198 | 2198 | } |
| 2199 | 2199 | |
| 2200 | 2200 | |
| r10315 | r10316 | |
| 2623 | 2623 | |
| 2624 | 2624 | // immediately call the timer to handle the first line |
| 2625 | 2625 | if (vic2->type == VIC6569 || vic2->type == VIC8566) |
| 2626 | | |
| 2626 | | |
| 2627 | 2627 | else |
| 2628 | | |
| 2628 | | |
| 2629 | 2629 | |
| 2630 | 2630 | for (i = 0; i < 256; i++) |
| 2631 | 2631 | { |
| r10315 | r10316 | |
|---|---|---|
| 592 | 592 | |
| 593 | 593 | state->tmp_bitmap = auto_bitmap_alloc( machine, width, height, screen->format() ); |
| 594 | 594 | |
| 595 | state->i824x_line_timer = timer_alloc( | |
| 595 | state->i824x_line_timer = machine->scheduler().timer_alloc(FUNC(i | |
| 596 | 596 | timer_adjust_periodic( state->i824x_line_timer, machine->primary_screen->time_until_pos(1, I824X_START_ACTIVE_SCAN ), 0, machine->primary_screen->scan_period() ); |
| 597 | 597 | |
| 598 | state->i824x_hblank_timer = timer_alloc( | |
| 598 | state->i824x_hblank_timer = machine->scheduler().timer_alloc(FUNC(i | |
| 599 | 599 | timer_adjust_periodic( state->i824x_hblank_timer, machine->primary_screen->time_until_pos(1, I824X_END_ACTIVE_SCAN + 18 ), 0, machine->primary_screen->scan_period() ); |
| 600 | 600 | } |
| 601 | 601 |
| r10315 | r10316 | |
|---|---|---|
| 829 | 829 | |
| 830 | 830 | m6845_remove_vsync_set_timer(); |
| 831 | 831 | |
| 832 | //crtc.vsync_set_timer = timer_alloc(m | |
| 832 | //crtc.vsync_set_timer = machine->scheduler().timer_alloc(FUNC(m | |
| 833 | 833 | if (crtc_cycles_to_vsync_start!=-1) |
| 834 | 834 | { |
| 835 | 835 | timer_adjust_oneshot(crtc.vsync_set_timer, attotime::from_usec(crtc_cycles_to_vsync_start), 0); |
| r10315 | r10316 | |
| 846 | 846 | /* get number of cycles to end of vsync */ |
| 847 | 847 | crtc_cycles_to_vsync_end = cycles; |
| 848 | 848 | |
| 849 | //crtc.vsync_clear_timer = timer_alloc(m | |
| 849 | //crtc.vsync_clear_timer = machine->scheduler().timer_alloc(FUNC(m | |
| 850 | 850 | if (crtc_cycles_to_vsync_end!=-1) |
| 851 | 851 | { |
| 852 | 852 | timer_adjust_oneshot(crtc.vsync_clear_timer, attotime::from_usec(crtc_cycles_to_vsync_end), 0); |
| r10315 | r10316 | |
|---|---|---|
| 442 | 442 | running_machine *machine = screen->machine; |
| 443 | 443 | |
| 444 | 444 | /* calculate the state->flash value */ |
| 445 | state->flash = (( | |
| 445 | state->flash = (( | |
| 446 | 446 | |
| 447 | 447 | /* read out relevant softswitch variables; to see what has changed */ |
| 448 | 448 | new_a2 = effective_a2(state); |
| r10315 | r10316 | |
|---|---|---|
| 202 | 202 | void hd61830_device::device_start() |
| 203 | 203 | { |
| 204 | 204 | // allocate timers |
| 205 | m_busy_timer = | |
| 205 | m_busy_timer = | |
| 206 | 206 | |
| 207 | 207 | // resolve callbacks |
| 208 | 208 | devcb_resolve_read8(&m_in_rd_func, &m_config.m_in_rd_func, this); |
| r10315 | r10316 | |
|---|---|---|
| 115 | 115 | galaxy_state *state = machine->driver_data<galaxy_state>(); |
| 116 | 116 | state->gal_cnt = 0; |
| 117 | 117 | |
| 118 | state->gal_video_timer = timer_alloc( | |
| 118 | state->gal_video_timer = machine->scheduler().timer_alloc(FUNC( | |
| 119 | 119 | timer_adjust_periodic(state->gal_video_timer, attotime::zero, 0, attotime::never); |
| 120 | 120 | |
| 121 | 121 | VIDEO_START_CALL( generic_bitmapped ); |
| r10315 | r10316 | |
|---|---|---|
| 266 | 266 | cdp1861->bitmap = auto_bitmap_alloc(device->machine, cdp1861->screen->width(), cdp1861->screen->height(), cdp1861->screen->format()); |
| 267 | 267 | |
| 268 | 268 | /* create the timers */ |
| 269 | cdp1861->int_timer = timer_alloc(device->machine, cdp1861_int_tick, (void *)device); | |
| 270 | cdp1861->efx_timer = timer_alloc(device->machine, cdp1861_efx_tick, (void *)device); | |
| 271 | cdp1861->dma_timer = timer_alloc(device->machine, cdp1861_dma_tick, (void *)device); | |
| 269 | cdp1861->int_timer = device->machine->scheduler().timer_alloc(FUNC(cdp1861_int_tick), (void *)device); | |
| 270 | cdp1861->efx_timer = device->machine->scheduler().timer_alloc(FUNC(cdp1861_efx_tick), (void *)device); | |
| 271 | cdp1861->dma_timer = device->machine->scheduler().timer_alloc(FUNC(cdp1861_dma_tick), (void *)device); | |
| 272 | 272 | |
| 273 | 273 | /* register for state saving */ |
| 274 | 274 | state_save_register_device_item(device, 0, cdp1861->disp); |
| r10315 | r10316 | |
|---|---|---|
| 828 | 828 | devcb_resolve_write8( &k1ge->vblank_pin_w, &k1ge->intf->vblank_pin_w, device ); |
| 829 | 829 | devcb_resolve_write8( &k1ge->hblank_pin_w, &k1ge->intf->hblank_pin_w, device ); |
| 830 | 830 | |
| 831 | k1ge->timer = timer_alloc( device->machine, k1ge_timer_callback, (void *) device ); | |
| 832 | k1ge->hblank_on_timer = timer_alloc( device->machine, k1ge_hblank_on_timer_callback, (void *) device ); | |
| 831 | k1ge->timer = device->machine->scheduler().timer_alloc(FUNC(k1ge_timer_callback), (void *) device ); | |
| 832 | k1ge->hblank_on_timer = device->machine->scheduler().timer_alloc(FUNC(k1ge_hblank_on_timer_callback), (void *) device ); | |
| 833 | 833 | k1ge->screen = device->machine->device<screen_device>(k1ge->intf->screen_tag); |
| 834 | 834 | k1ge->vram = device->machine->region( k1ge->intf->vram_tag )->base(); |
| 835 | 835 | k1ge->bitmap = auto_bitmap_alloc( device->machine, k1ge->screen->width(), k1ge->screen->height(), k1ge->screen->format() ); |
| r10315 | r10316 | |
|---|---|---|
| 635 | 635 | |
| 636 | 636 | // set timer to disable busy flag |
| 637 | 637 | // 1/16 us for each byte changed |
| 638 | timer_set( | |
| 638 | machine->scheduler().timer_set( | |
| 639 | 639 | } |
| 640 | 640 | |
| 641 | 641 | READ8_HANDLER( fm7_vram_r ) |
| r10315 | r10316 | |
|---|---|---|
| 109 | 109 | { |
| 110 | 110 | devcb_resolve_write_line(&m_on, &m_config.m_on, this); |
| 111 | 111 | |
| 112 | m_on_timer = | |
| 112 | m_on_timer = | |
| 113 | 113 | timer_adjust_periodic(m_on_timer, attotime::from_hz(m_clock/16384), 0, attotime::from_hz(m_clock/16384)); |
| 114 | 114 | |
| 115 | 115 | state_save_register_device_item( this, 0, m_control_lines); |
| r10315 | r10316 | |
|---|---|---|
| 103 | 103 | int dgnalpha_just_reset; |
| 104 | 104 | UINT8 *bas_rom_bank; |
| 105 | 105 | UINT8 *bottom_32k; |
| 106 | timer_ | |
| 106 | timer_expired_func recalc_interrupts; | |
| 107 | 107 | int hiresjoy_ca; |
| 108 | 108 | attotime hiresjoy_xtransitiontime; |
| 109 | 109 | attotime hiresjoy_ytransitiontime; |
| r10315 | r10316 | |
|---|---|---|
| 7 | 7 | #endif |
| 8 | 8 | |
| 9 | 9 | //#define LOG(N,M,A) |
| 10 | // if(VERBOSE>=N){ if( M )logerror("%11.6f: %-24s", | |
| 10 | // if(VERBOSE>=N){ if( M )logerror("%11.6f: %-24s", | |
| 11 | 11 | |
| 12 | 12 | #define LOG(N,M,A) \ |
| 13 | 13 | if(VERBOSE>=N){ if( M )logerror("%-24s",(const char*)M ); logerror A; } |
| r10315 | r10316 | |
|---|---|---|
| 497 | 497 | { |
| 498 | 498 | memory_set_bankptr(machine, "bank1", machine->region("rom")->base()); |
| 499 | 499 | |
| 500 | m_kb_timer = timer_alloc( | |
| 500 | m_kb_timer = machine->scheduler().timer_alloc(FUNC( | |
| 501 | 501 | timer_adjust_periodic(m_kb_timer, attotime::from_hz(192), 0, attotime::from_hz(192)); |
| 502 | 502 | } |
| 503 | 503 |
| r10315 | r10316 | |
|---|---|---|
| 704 | 704 | #ifdef VERBOSE |
| 705 | 705 | if (data!= 0x8000) logerror("sample output: %04X\n", data); |
| 706 | 706 | #endif |
| 707 | timer_set( | |
| 707 | machine->scheduler().timer_set( | |
| 708 | 708 | dac_signed_data_16_w( speaker, data ); |
| 709 | 709 | } |
| 710 | 710 | |
| r10315 | r10316 | |
| 714 | 714 | dectalk_state *state = machine->driver_data<dectalk_state>(); |
| 715 | 715 | dectalk_clear_all_fifos(machine); |
| 716 | 716 | state->simulate_outfifo_error = 0; |
| 717 | timer_set( | |
| 717 | machine->scheduler().timer_set( | |
| 718 | 718 | } |
| 719 | 719 | |
| 720 | 720 | static WRITE8_DEVICE_HANDLER( dectalk_kbd_put ) |
| r10315 | r10316 | |
|---|---|---|
| 597 | 597 | memset( state->fontram, 0x00, 0x1000 ); |
| 598 | 598 | memset( state->vram, 0x00, 0x2000 ); |
| 599 | 599 | |
| 600 | state->video_timer = timer_alloc( | |
| 600 | state->video_timer = machine->scheduler().timer_alloc(FUNC( | |
| 601 | 601 | } |
| 602 | 602 | |
| 603 | 603 |
| r10315 | r10316 | |
|---|---|---|
| 184 | 184 | static MACHINE_START( tec1 ) |
| 185 | 185 | { |
| 186 | 186 | tec1_state *state = machine->driver_data<tec1_state>(); |
| 187 | state->m_kbd_timer = timer_alloc( | |
| 187 | state->m_kbd_timer = machine->scheduler().timer_alloc(FUNC( | |
| 188 | 188 | timer_adjust_periodic( state->m_kbd_timer, attotime::zero, 0, attotime::from_hz(500) ); |
| 189 | 189 | } |
| 190 | 190 |
| r10315 | r10316 | |
|---|---|---|
| 2045 | 2045 | { |
| 2046 | 2046 | pc6001_state *state = machine->driver_data<pc6001_state>(); |
| 2047 | 2047 | /* TODO: accurate timing on this */ |
| 2048 | timer_pulse( | |
| 2048 | machine->scheduler().timer_pulse( | |
| 2049 | 2049 | |
| 2050 | timer_pulse( | |
| 2050 | machine->scheduler().timer_pulse( | |
| 2051 | 2051 | |
| 2052 | 2052 | state->timer_hz_div = 3; |
| 2053 | 2053 | { |
| 2054 | 2054 | attotime period = attotime::from_hz((487.5*4)/(state->timer_hz_div+1)); |
| 2055 | state->timer_irq_timer = timer_alloc( | |
| 2055 | state->timer_irq_timer = machine->scheduler().timer_alloc(FUNC(a | |
| 2056 | 2056 | timer_adjust_periodic(state->timer_irq_timer, period, 0, period); |
| 2057 | 2057 | } |
| 2058 | 2058 | } |
| r10315 | r10316 | |
|---|---|---|
| 935 | 935 | //pc88va_state *state = space->machine->driver_data<pc88va_state>(); |
| 936 | 936 | |
| 937 | 937 | upd765_tc_w(space->machine->device("upd765"), 1); |
| 938 | | |
| 938 | | |
| 939 | 939 | return 0; |
| 940 | 940 | } |
| 941 | 941 | |
| r10315 | r10316 | |
| 1511 | 1511 | pc88va_state *state = machine->driver_data<pc88va_state>(); |
| 1512 | 1512 | cpu_set_irq_callback(machine->device("maincpu"), pc88va_irq_callback); |
| 1513 | 1513 | |
| 1514 | state->t3_mouse_timer = timer_alloc( | |
| 1514 | state->t3_mouse_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1515 | 1515 | timer_adjust_oneshot(state->t3_mouse_timer, attotime::never, 0); |
| 1516 | 1516 | } |
| 1517 | 1517 |
| r10315 | r10316 | |
|---|---|---|
| 513 | 513 | state->cassette = machine->device("cassette"); |
| 514 | 514 | state->fdc = machine->device("fdc"); |
| 515 | 515 | state->RAM = machine->region("maincpu")->base(); |
| 516 | timer_pulse( | |
| 516 | machine->scheduler().timer_pulse( | |
| 517 | 517 | } |
| 518 | 518 | |
| 519 | 519 | static MACHINE_RESET(mycom) |
| r10315 | r10316 | |
|---|---|---|
| 2342 | 2342 | static MACHINE_START( x1 ) |
| 2343 | 2343 | { |
| 2344 | 2344 | x1_state *state = machine->driver_data<x1_state>(); |
| 2345 | timer_pulse(machine, attotime::from_hz(240), NULL, 0, keyboard_callback); | |
| 2346 | timer_pulse(machine, attotime::from_hz(16), NULL, 0, cmt_wind_timer); | |
| 2345 | machine->scheduler().timer_pulse(attotime::from_hz(240), FUNC(keyboard_callback)); | |
| 2346 | machine->scheduler().timer_pulse(attotime::from_hz(16), FUNC(cmt_wind_timer)); | |
| 2347 | 2347 | |
| 2348 | 2348 | /* set up RTC */ |
| 2349 | 2349 | { |
| r10315 | r10316 | |
| 2358 | 2358 | state->rtc.min = ((systime.local_time.minute / 10)<<4) | ((systime.local_time.minute % 10) & 0xf); |
| 2359 | 2359 | state->rtc.sec = ((systime.local_time.second / 10)<<4) | ((systime.local_time.second % 10) & 0xf); |
| 2360 | 2360 | |
| 2361 | state->rtc_timer = timer_alloc( | |
| 2361 | state->rtc_timer = machine->scheduler().timer_alloc(FUNC( | |
| 2362 | 2362 | } |
| 2363 | 2363 | } |
| 2364 | 2364 |
| r10315 | r10316 | |
|---|---|---|
| 171 | 171 | |
| 172 | 172 | static MACHINE_START( mk1 ) |
| 173 | 173 | { |
| 174 | timer_pulse( | |
| 174 | machine->scheduler().timer_pulse( | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 |
| r10315 | r10316 | |
|---|---|---|
| 287 | 287 | state_save_register_item(machine, "kim1", NULL, 0, state->u2_port_b ); |
| 288 | 288 | state_save_register_item(machine, "kim1", NULL, 0, state->_311_output ); |
| 289 | 289 | state_save_register_item(machine, "kim1", NULL, 0, state->cassette_high_count ); |
| 290 | timer_pulse(machine, attotime::from_hz(60), NULL, 0, kim1_update_leds ); | |
| 291 | timer_pulse(machine, attotime::from_hz(44100), NULL, 0, kim1_cassette_input ); | |
| 290 | machine->scheduler().timer_pulse(attotime::from_hz(60), FUNC(kim1_update_leds)); | |
| 291 | machine->scheduler().timer_pulse(attotime::from_hz(44100), FUNC(kim1_cassette_input)); | |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 |
| r10315 | r10316 | |
|---|---|---|
| 276 | 276 | mboard_key_selector = 0; |
| 277 | 277 | state->irq_flag = 0; |
| 278 | 278 | state->lcd_shift_counter = 3; |
| 279 | timer_pulse(machine, attotime::from_hz(50), NULL, 0, update_nmi); | |
| 280 | timer_pulse(machine, attotime::from_hz(100), NULL, 0, mboard_update_artwork); | |
| 279 | machine->scheduler().timer_pulse(attotime::from_hz(50), FUNC(update_nmi)); | |
| 280 | machine->scheduler().timer_pulse(attotime::from_hz(100), FUNC(mboard_update_artwork)); | |
| 281 | 281 | beep_set_frequency(speaker, 44); |
| 282 | 282 | |
| 283 | 283 | mboard_savestate_register(machine); |
| r10315 | r10316 | |
| 290 | 290 | device_t *speaker = machine->device("beep"); |
| 291 | 291 | |
| 292 | 292 | state->lcd_shift_counter = 3; |
| 293 | timer_pulse(machine, attotime::from_hz(50), NULL, 0, update_nmi32); | |
| 294 | timer_pulse(machine, attotime::from_hz(100), NULL, 0, mboard_update_artwork); | |
| 293 | machine->scheduler().timer_pulse(attotime::from_hz(50), FUNC(update_nmi32)); | |
| 294 | machine->scheduler().timer_pulse(attotime::from_hz(100), FUNC(mboard_update_artwork)); | |
| 295 | 295 | beep_set_frequency(speaker, 44); |
| 296 | 296 | |
| 297 | 297 | mboard_savestate_register(machine); |
| r10315 | r10316 | |
|---|---|---|
| 105 | 105 | static MACHINE_START( tm990_189 ) |
| 106 | 106 | { |
| 107 | 107 | tm990189_state *state = machine->driver_data<tm990189_state>(); |
| 108 | state->displayena_timer = timer_alloc( | |
| 108 | state->displayena_timer = machine->scheduler().timer_alloc(F | |
| 109 | 109 | } |
| 110 | 110 | static const TMS9928a_interface tms9918_interface = |
| 111 | 111 | { |
| r10315 | r10316 | |
| 120 | 120 | tm990189_state *state = machine->driver_data<tm990189_state>(); |
| 121 | 121 | TMS9928A_configure(&tms9918_interface); |
| 122 | 122 | |
| 123 | state->displayena_timer = timer_alloc( | |
| 123 | state->displayena_timer = machine->scheduler().timer_alloc(F | |
| 124 | 124 | |
| 125 | state->joy1x_timer = timer_alloc(machine, NULL, NULL); | |
| 126 | state->joy1y_timer = timer_alloc(machine, NULL, NULL); | |
| 127 | state->joy2x_timer = timer_alloc(machine, NULL, NULL); | |
| 128 | state->joy2y_timer = timer_alloc(machine, NULL, NULL); | |
| 125 | state->joy1x_timer = machine->scheduler().timer_alloc(FUNC(NULL)); | |
| 126 | state->joy1y_timer = machine->scheduler().timer_alloc(FUNC(NULL)); | |
| 127 | state->joy2x_timer = machine->scheduler().timer_alloc(FUNC(NULL)); | |
| 128 | state->joy2y_timer = machine->scheduler().timer_alloc(FUNC(NULL)); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | static MACHINE_RESET( tm990_189_v ) |
| r10315 | r10316 | |
| 279 | 279 | tm990189_state *state = machine->driver_data<tm990189_state>(); |
| 280 | 280 | state->load_state = TRUE; |
| 281 | 281 | field_interrupts(machine); |
| 282 | timer_set( | |
| 282 | machine->scheduler().timer_set( | |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | /* |
| r10315 | r10316 | |
| 403 | 403 | { |
| 404 | 404 | tm990189_state *state = image.device().machine->driver_data<tm990189_state>(); |
| 405 | 405 | tms9902_set_dsr(image.device().machine->device("tms9902"), 1); |
| 406 | state->rs232_input_timer = | |
| 406 | state->rs232_input_timer = | |
| 407 | 407 | timer_adjust_periodic(state->rs232_input_timer, attotime::zero, 0, attotime::from_msec(10)); |
| 408 | 408 | |
| 409 | 409 | return IMAGE_INIT_PASS; |
| r10315 | r10316 | |
|---|---|---|
| 637 | 637 | for(i=0;i<0x4000;i++) |
| 638 | 638 | state->wram[i] = rom[i]; |
| 639 | 639 | |
| 640 | timer_pulse( | |
| 640 | machine->scheduler().timer_pulse( | |
| 641 | 641 | beep_set_frequency(machine->device("beeper"),300); //guesswork |
| 642 | 642 | beep_set_state(machine->device("beeper"),0); |
| 643 | 643 | } |
| r10315 | r10316 | |
|---|---|---|
| 345 | 345 | } |
| 346 | 346 | static MACHINE_START( scorpion ) |
| 347 | 347 | { |
| 348 | timer_pulse( | |
| 348 | machine->scheduler().timer_pulse( | |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 |
| r10315 | r10316 | |
|---|---|---|
| 379 | 379 | if (!state->m_key_strobe && state->m_key_data) |
| 380 | 380 | { |
| 381 | 381 | z80pio_pa_w(state->m_pio, 0, state->m_key_data); |
| 382 | timer_set( | |
| 382 | machine->scheduler().timer_set( | |
| 383 | 383 | } |
| 384 | 384 | } |
| 385 | 385 |
| r10315 | r10316 | |
|---|---|---|
| 366 | 366 | state->speaker = machine->device(SPEAKER_TAG); |
| 367 | 367 | state->cassette = machine->device(CASSETTE_TAG); |
| 368 | 368 | |
| 369 | state->led_refresh_timer = timer_alloc( | |
| 369 | state->led_refresh_timer = machine->scheduler().timer_alloc(FUNC( | |
| 370 | 370 | |
| 371 | 371 | /* register for state saving */ |
| 372 | 372 | state_save_register_global(machine, state->_break); |
| 373 | 373 | state_save_register_global(machine, state->m1); |
| 374 | 374 | state_save_register_global(machine, state->lednum); |
| 375 | 375 | |
| 376 | timer_pulse( | |
| 376 | machine->scheduler().timer_pulse( | |
| 377 | 377 | } |
| 378 | 378 | |
| 379 | 379 | static MACHINE_RESET( mpf1 ) |
| r10315 | r10316 | |
|---|---|---|
| 2270 | 2270 | cpu_set_irq_callback(m_maincpu, atarist_int_ack); |
| 2271 | 2271 | |
| 2272 | 2272 | // allocate timers |
| 2273 | m_mouse_timer = timer_alloc( | |
| 2273 | m_mouse_timer = machine->scheduler().timer_alloc(FUNC( | |
| 2274 | 2274 | timer_adjust_periodic(m_mouse_timer, attotime::zero, 0, attotime::from_hz(500)); |
| 2275 | 2275 | |
| 2276 | 2276 | // register for state saving |
| r10315 | r10316 | |
| 2315 | 2315 | cpu_set_irq_callback(m_maincpu, atarist_int_ack); |
| 2316 | 2316 | |
| 2317 | 2317 | /* allocate timers */ |
| 2318 | m_dmasound_timer = timer_alloc(machine, atariste_dmasound_tick, NULL); | |
| 2319 | m_microwire_timer = timer_alloc(machine, atariste_microwire_tick, NULL); | |
| 2318 | m_dmasound_timer = machine->scheduler().timer_alloc(FUNC(atariste_dmasound_tick)); | |
| 2319 | m_microwire_timer = machine->scheduler().timer_alloc(FUNC(atariste_microwire_tick)); | |
| 2320 | 2320 | |
| 2321 | 2321 | /* register for state saving */ |
| 2322 | 2322 | state_save(); |
| r10315 | r10316 | |
|---|---|---|
| 271 | 271 | cat_state *state = machine->driver_data<cat_state>(); |
| 272 | 272 | |
| 273 | 273 | state->duart_inp = 0x0e; |
| 274 | state->keyboard_timer = timer_alloc( | |
| 274 | state->keyboard_timer = machine->scheduler().timer_alloc(FUNC( | |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | static MACHINE_RESET(cat) |
| r10315 | r10316 | |
| 324 | 324 | |
| 325 | 325 | static MACHINE_RESET(swyft) |
| 326 | 326 | { |
| 327 | timer_set( | |
| 327 | machine->scheduler().timer_set( | |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | 330 | static VIDEO_START( swyft ) |
| r10315 | r10316 | |
|---|---|---|
| 971 | 971 | TMS9928A_configure(&tms9928a_interface); |
| 972 | 972 | |
| 973 | 973 | /* toggle light gun crosshair */ |
| 974 | timer_set( | |
| 974 | machine->scheduler().timer_set( | |
| 975 | 975 | |
| 976 | 976 | /* register for state saving */ |
| 977 | 977 | state_save_register_global(machine, m_tvdraw_data); |
| r10315 | r10316 | |
| 987 | 987 | TMS9928A_configure(&tms9928a_interface); |
| 988 | 988 | |
| 989 | 989 | /* toggle light gun crosshair */ |
| 990 | timer_set( | |
| 990 | machine->scheduler().timer_set( | |
| 991 | 991 | |
| 992 | 992 | /* register for state saving */ |
| 993 | 993 | state_save_register_global(machine, m_tvdraw_data); |
| r10315 | r10316 | |
|---|---|---|
| 1063 | 1063 | static TIMER_CALLBACK(ip22_dma) |
| 1064 | 1064 | { |
| 1065 | 1065 | //ip22_state *state = machine->driver_data<ip22_state>(); |
| 1066 | timer_set( | |
| 1066 | machine->scheduler().timer_set( | |
| 1067 | 1067 | #if 0 |
| 1068 | 1068 | if( state->nPBUS_DMA_Active ) |
| 1069 | 1069 | { |
| r10315 | r10316 | |
| 1090 | 1090 | return; |
| 1091 | 1091 | } |
| 1092 | 1092 | } |
| 1093 | timer_set( | |
| 1093 | machine->scheduler().timer_set( | |
| 1094 | 1094 | } |
| 1095 | 1095 | #endif |
| 1096 | 1096 | } |
| r10315 | r10316 | |
| 1162 | 1162 | verboselog(machine, 0, " FIFO End: Rowe %04x\n", ( data & PBUS_CTRL_FIFO_END ) >> 24 ); |
| 1163 | 1163 | if( ( data & PBUS_CTRL_DMASTART ) || ( data & PBUS_CTRL_LOAD_EN ) ) |
| 1164 | 1164 | { |
| 1165 | timer_set( | |
| 1165 | machine->scheduler().timer_set( | |
| 1166 | 1166 | state->nPBUS_DMA_Active = 1; |
| 1167 | 1167 | } |
| 1168 | 1168 | return; |
| r10315 | r10316 | |
| 1211 | 1211 | static TIMER_CALLBACK(ip22_timer) |
| 1212 | 1212 | { |
| 1213 | 1213 | sgi_mc_update(); |
| 1214 | timer_set( | |
| 1214 | machine->scheduler().timer_set( | |
| 1215 | 1215 | } |
| 1216 | 1216 | |
| 1217 | 1217 | static MACHINE_START( ip225015 ) |
| r10315 | r10316 | |
| 1229 | 1229 | RTC_REGISTERB = 0x08; |
| 1230 | 1230 | RTC_REGISTERD = 0x80; |
| 1231 | 1231 | |
| 1232 | timer_set( | |
| 1232 | machine->scheduler().timer_set( | |
| 1233 | 1233 | |
| 1234 | 1234 | // set up low RAM mirror |
| 1235 | 1235 | memory_set_bankptr(machine, "bank1", state->mainram); |
| r10315 | r10316 | |
|---|---|---|
| 1682 | 1682 | state->extra_RAM = machine->region_alloc("user2", 0x8600, ROM_REQUIRED ); |
| 1683 | 1683 | memset( state->riot_ram, 0x00, 0x80 ); |
| 1684 | 1684 | state->current_reset_bank_counter = 0xFF; |
| 1685 | state->dpc.oscillator = timer_alloc(m | |
| 1685 | state->dpc.oscillator = machine->scheduler().timer_alloc(FUNC(m | |
| 1686 | 1686 | } |
| 1687 | 1687 | |
| 1688 | 1688 | static MACHINE_START( a2600 ) |
| r10315 | r10316 | |
|---|---|---|
| 104 | 104 | |
| 105 | 105 | static MACHINE_START( mk2 ) |
| 106 | 106 | { |
| 107 | timer_pulse( | |
| 107 | machine->scheduler().timer_pulse( | |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | static READ8_DEVICE_HANDLER( mk2_read_a ) |
| r10315 | r10316 | |
|---|---|---|
| 177 | 177 | |
| 178 | 178 | state->timer_irq_flag = 1; |
| 179 | 179 | pcw_update_irqs(machine); |
| 180 | timer_set( | |
| 180 | machine->scheduler().timer_set( | |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | /* fdc interrupt callback. set/clear fdc int */ |
| r10315 | r10316 | |
| 1118 | 1118 | state->roller_ram_offset = 0; |
| 1119 | 1119 | |
| 1120 | 1120 | /* timer interrupt */ |
| 1121 | timer_pulse( | |
| 1121 | machine->scheduler().timer_pulse( | |
| 1122 | 1122 | |
| 1123 | timer_set( | |
| 1123 | machine->scheduler().timer_set( | |
| 1124 | 1124 | |
| 1125 | state->prn_stepper = timer_alloc(machine,pcw_stepper_callback,NULL); | |
| 1126 | state->prn_pins = timer_alloc(machine,pcw_pins_callback,NULL); | |
| 1125 | state->prn_stepper = machine->scheduler().timer_alloc(FUNC(pcw_stepper_callback)); | |
| 1126 | state->prn_pins = machine->scheduler().timer_alloc(FUNC(pcw_pins_callback)); | |
| 1127 | 1127 | } |
| 1128 | 1128 | |
| 1129 | 1129 |
| r10315 | r10316 | |
|---|---|---|
| 605 | 605 | |
| 606 | 606 | static DRIVER_INIT( studio2 ) |
| 607 | 607 | { |
| 608 | timer_set( | |
| 608 | machine->scheduler().timer_set( | |
| 609 | 609 | } |
| 610 | 610 | |
| 611 | 611 | /* Game Drivers */ |
| r10315 | r10316 | |
|---|---|---|
| 925 | 925 | |
| 926 | 926 | static DRIVER_INIT( c1p ) |
| 927 | 927 | { |
| 928 | timer_set( | |
| 928 | machine->scheduler().timer_set( | |
| 929 | 929 | } |
| 930 | 930 | |
| 931 | 931 |
| r10315 | r10316 | |
|---|---|---|
| 59 | 59 | if (state) |
| 60 | 60 | cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE); |
| 61 | 61 | else |
| 62 | | |
| 62 | | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | /*********************************************************** |
| r10315 | r10316 | |
|---|---|---|
| 783 | 783 | static MACHINE_START(a7000) |
| 784 | 784 | { |
| 785 | 785 | a7000_state *state = machine->driver_data<a7000_state>(); |
| 786 | state->IOMD_timer[0] = timer_alloc(machine, IOMD_timer0_callback, NULL); | |
| 787 | state->IOMD_timer[1] = timer_alloc(machine, IOMD_timer1_callback, NULL); | |
| 788 | state->flyback_timer = timer_alloc(machine, flyback_timer_callback, NULL); | |
| 786 | state->IOMD_timer[0] = machine->scheduler().timer_alloc(FUNC(IOMD_timer0_callback)); | |
| 787 | state->IOMD_timer[1] = machine->scheduler().timer_alloc(FUNC(IOMD_timer1_callback)); | |
| 788 | state->flyback_timer = machine->scheduler().timer_alloc(FUNC(flyback_timer_callback)); | |
| 789 | 789 | |
| 790 | 790 | state->io_id = 0xd4e7; |
| 791 | 791 | } |
| r10315 | r10316 | |
|---|---|---|
| 727 | 727 | memory_configure_bank(machine, "bank1", 0, 2, machine->region(CDP1802_TAG)->base(), 0x8000); |
| 728 | 728 | |
| 729 | 729 | /* allocate monitor timer */ |
| 730 | state->ef4_timer = timer_alloc( | |
| 730 | state->ef4_timer = machine->scheduler().timer_alloc(FUNC(n | |
| 731 | 731 | |
| 732 | 732 | /* find devices */ |
| 733 | 733 | state->cdp1864 = machine->device(CDP1864_TAG); |
| r10315 | r10316 | |
| 925 | 925 | |
| 926 | 926 | static DRIVER_INIT( tmc1800 ) |
| 927 | 927 | { |
| 928 | timer_set( | |
| 928 | machine->scheduler().timer_set( | |
| 929 | 929 | } |
| 930 | 930 | |
| 931 | 931 | /* System Drivers */ |
| r10315 | r10316 | |
|---|---|---|
| 1216 | 1216 | state->towns_cd.cmd_status[2] = st2; |
| 1217 | 1217 | state->towns_cd.cmd_status[3] = st3; |
| 1218 | 1218 | // wait a bit |
| 1219 | timer_set( | |
| 1219 | machine->scheduler().timer_set( | |
| 1220 | 1220 | } |
| 1221 | 1221 | |
| 1222 | 1222 | static UINT8 towns_cd_get_track(running_machine* machine) |
| r10315 | r10316 | |
| 1420 | 1420 | break; |
| 1421 | 1421 | case 0x04: // Play Audio Track |
| 1422 | 1422 | logerror("CD: Command 0x04: PLAY CD-DA\n"); |
| 1423 | | |
| 1423 | | |
| 1424 | 1424 | break; |
| 1425 | 1425 | case 0x05: // Read TOC |
| 1426 | 1426 | logerror("CD: Command 0x05: READ TOC\n"); |
| r10315 | r10316 | |
| 2271 | 2271 | state->towns_serial_rom = auto_alloc_array(machine,UINT8,256/8); |
| 2272 | 2272 | towns_init_serial_rom(machine); |
| 2273 | 2273 | towns_init_rtc(machine); |
| 2274 | state->towns_rtc_timer = timer_alloc(machine,rtc_second,NULL); | |
| 2275 | state->towns_kb_timer = timer_alloc(machine,poll_keyboard,NULL); | |
| 2276 | state->towns_mouse_timer = timer_alloc(machine,towns_mouse_timeout,NULL); | |
| 2274 | state->towns_rtc_timer = machine->scheduler().timer_alloc(FUNC(rtc_second)); | |
| 2275 | state->towns_kb_timer = machine->scheduler().timer_alloc(FUNC(poll_keyboard)); | |
| 2276 | state->towns_mouse_timer = machine->scheduler().timer_alloc(FUNC(towns_mouse_timeout)); | |
| 2277 | 2277 | |
| 2278 | 2278 | // CD-ROM init |
| 2279 | state->towns_cd.read_timer = timer_alloc( | |
| 2279 | state->towns_cd.read_timer = machine->scheduler().timer_alloc(FUNC( | |
| 2280 | 2280 | |
| 2281 | 2281 | cpu_set_irq_callback(machine->device("maincpu"), towns_irq_callback); |
| 2282 | 2282 | memory_install_ram(cputag_get_address_space(machine,"maincpu",ADDRESS_SPACE_PROGRAM),0x100000,ram_get_size(machine->device(RAM_TAG))-1,0xffffffff,0,NULL); |
| r10315 | r10316 | |
|---|---|---|
| 1388 | 1388 | state->cassette2 = machine->device(CASSETTE2_TAG); |
| 1389 | 1389 | |
| 1390 | 1390 | /* allocate reset timer */ |
| 1391 | state->reset_timer = timer_alloc( | |
| 1391 | state->reset_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1392 | 1392 | timer_adjust_oneshot(state->reset_timer, attotime::from_usec(get_reset_t()), 0); |
| 1393 | 1393 | |
| 1394 | 1394 | /* allocate power up timer */ |
| 1395 | state->pwrup_timer = timer_alloc( | |
| 1395 | state->pwrup_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1396 | 1396 | timer_adjust_oneshot(state->pwrup_timer, attotime::from_usec(get_pwrup_t()), 0); |
| 1397 | 1397 | |
| 1398 | 1398 | /* initialize variables */ |
| r10315 | r10316 | |
|---|---|---|
| 295 | 295 | |
| 296 | 296 | static MACHINE_START(tk80bs) |
| 297 | 297 | { |
| 298 | timer_pulse( | |
| 298 | machine->scheduler().timer_pulse( | |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | static MACHINE_RESET(tk80bs) |
| r10315 | r10316 | |
|---|---|---|
| 390 | 390 | |
| 391 | 391 | static MACHINE_START( fk1 ) |
| 392 | 392 | { |
| 393 | timer_pulse(machine, attotime::from_hz(24000), NULL, 0, keyboard_callback); | |
| 394 | timer_pulse(machine, attotime::from_hz(50), NULL, 0, vsync_callback); | |
| 393 | machine->scheduler().timer_pulse(attotime::from_hz(24000), FUNC(keyboard_callback)); | |
| 394 | machine->scheduler().timer_pulse(attotime::from_hz(50), FUNC(vsync_callback)); | |
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | static VIDEO_UPDATE( fk1 ) |
| r10315 | r10316 | |
|---|---|---|
| 563 | 563 | |
| 564 | 564 | static MACHINE_START(multi8) |
| 565 | 565 | { |
| 566 | timer_pulse( | |
| 566 | machine->scheduler().timer_pulse( | |
| 567 | 567 | } |
| 568 | 568 | |
| 569 | 569 | static MACHINE_RESET(multi8) |
| r10315 | r10316 | |
|---|---|---|
| 73 | 73 | state->playfield.bit=0; |
| 74 | 74 | state->playfield.started=FALSE; |
| 75 | 75 | state->playfield.signal=signal; |
| 76 | state->playfield.time= | |
| 76 | state->playfield.time= | |
| 77 | 77 | } |
| 78 | 78 | if (!signal && state->playfield.signal) { |
| 79 | attotime t= | |
| 79 | attotime t= | |
| 80 | 80 | state->playfield.high_time=t - state->playfield.time; |
| 81 | 81 | state->playfield.time=t; |
| 82 | 82 | |
| r10315 | r10316 | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | } else if (signal && !state->playfield.signal) { |
| 104 | attotime t= | |
| 104 | attotime t= | |
| 105 | 105 | state->playfield.low_time= t - state->playfield.time; |
| 106 | 106 | state->playfield.time=t; |
| 107 | 107 | state->playfield.started=TRUE; |
| r10315 | r10316 | |
|---|---|---|
| 249 | 249 | static void create_interrupt_timers( running_machine *machine ) |
| 250 | 250 | { |
| 251 | 251 | neogeo_state *state = machine->driver_data<neogeo_state>(); |
| 252 | state->display_position_interrupt_timer = timer_alloc(machine, display_position_interrupt_callback, NULL); | |
| 253 | state->display_position_vblank_timer = timer_alloc(machine, display_position_vblank_callback, NULL); | |
| 254 | state->vblank_interrupt_timer = timer_alloc(machine, vblank_interrupt_callback, NULL); | |
| 252 | state->display_position_interrupt_timer = machine->scheduler().timer_alloc(FUNC(display_position_interrupt_callback)); | |
| 253 | state->display_position_vblank_timer = machine->scheduler().timer_alloc(FUNC(display_position_vblank_callback)); | |
| 254 | state->vblank_interrupt_timer = machine->scheduler().timer_alloc(FUNC(vblank_interrupt_callback)); | |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 |
| r10315 | r10316 | |
|---|---|---|
| 458 | 458 | |
| 459 | 459 | static MACHINE_START(bml3) |
| 460 | 460 | { |
| 461 | timer_pulse( | |
| 461 | machine->scheduler().timer_pulse( | |
| 462 | 462 | beep_set_frequency(machine->device("beeper"),1200); //guesswork |
| 463 | 463 | beep_set_state(machine->device("beeper"),0); |
| 464 | 464 | } |
| r10315 | r10316 | |
|---|---|---|
| 189 | 189 | junior_state *state = machine->driver_data<junior_state>(); |
| 190 | 190 | state_save_register_item(machine, "junior", NULL, 0, state->port_a ); |
| 191 | 191 | state_save_register_item(machine, "junior", NULL, 0, state->port_b ); |
| 192 | timer_pulse( | |
| 192 | machine->scheduler().timer_pulse( | |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 |
| r10315 | r10316 | |
|---|---|---|
| 502 | 502 | if( !pad->b_ack ) |
| 503 | 503 | { |
| 504 | 504 | pad->b_ack = 1; |
| 505 | timer_set( | |
| 505 | machine->scheduler().timer_set( | |
| 506 | 506 | } |
| 507 | 507 | } |
| 508 | 508 | } |
| r10315 | r10316 | |
| 618 | 618 | if( b_ack ) |
| 619 | 619 | { |
| 620 | 620 | pad->b_ack = 0; |
| 621 | timer_set( | |
| 621 | machine->scheduler().timer_set( | |
| 622 | 622 | } |
| 623 | 623 | } |
| 624 | 624 |
| r10315 | r10316 | |
|---|---|---|
| 341 | 341 | |
| 342 | 342 | /* assert irq and a timer to set it off again */ |
| 343 | 343 | cpu_set_input_line(device, 0, ASSERT_LINE); |
| 344 | | |
| 344 | | |
| 345 | 345 | |
| 346 | 346 | /* adjust STATUS register */ |
| 347 | 347 | state->status &= ~src; |
| r10315 | r10316 | |
|---|---|---|
| 200 | 200 | static DRIVER_INIT(tutor) |
| 201 | 201 | { |
| 202 | 202 | tutor_state *state = machine->driver_data<tutor_state>(); |
| 203 | state->tape_interrupt_timer = timer_alloc( | |
| 203 | state->tape_interrupt_timer = machine->scheduler().timer_alloc(FUNC( | |
| 204 | 204 | |
| 205 | 205 | memory_configure_bank(machine, "bank1", 0, 1, machine->region("maincpu")->base() + basic_base, 0); |
| 206 | 206 | memory_configure_bank(machine, "bank1", 1, 1, machine->region("maincpu")->base() + cartridge_base, 0); |
| r10315 | r10316 | |
|---|---|---|
| 868 | 868 | int index = 0; |
| 869 | 869 | for(index = 0; index < 3; index++) |
| 870 | 870 | { |
| 871 | state->timer_regs.timer[index].timer = timer_alloc( | |
| 871 | state->timer_regs.timer[index].timer = machine->scheduler().timer_alloc(FUNC( | |
| 872 | 872 | timer_adjust_oneshot(state->timer_regs.timer[index].timer, attotime::never, index); |
| 873 | 873 | } |
| 874 | 874 | |
| 875 | 875 | state->rtc_regs.time = 0x01000000; |
| 876 | 876 | state->rtc_regs.date = 0x19990101; |
| 877 | 877 | |
| 878 | state->rtc_regs.timer = timer_alloc( | |
| 878 | state->rtc_regs.timer = machine->scheduler().timer_alloc(FUNC( | |
| 879 | 879 | timer_adjust_oneshot(state->rtc_regs.timer, attotime::from_hz(1), index); |
| 880 | 880 | |
| 881 | 881 | state_save_register_global(machine, state->ftlb_regs.control); |
| r10315 | r10316 | |
|---|---|---|
| 1339 | 1339 | |
| 1340 | 1340 | void x07_state::machine_start() |
| 1341 | 1341 | { |
| 1342 | m_rsta_clear = timer_alloc(machine, rsta_clear, 0); | |
| 1343 | m_rstb_clear = timer_alloc(machine, rstb_clear, 0); | |
| 1344 | m_beep_stop = timer_alloc(machine, beep_stop, 0); | |
| 1345 | m_k7irq = timer_alloc(machine, k7_irq, 0); | |
| 1342 | m_rsta_clear = machine->scheduler().timer_alloc(FUNC(rsta_clear)); | |
| 1343 | m_rstb_clear = machine->scheduler().timer_alloc(FUNC(rstb_clear)); | |
| 1344 | m_beep_stop = machine->scheduler().timer_alloc(FUNC(beep_stop)); | |
| 1345 | m_k7irq = machine->scheduler().timer_alloc(FUNC(k7_irq)); | |
| 1346 | 1346 | |
| 1347 | 1347 | /* Save State */ |
| 1348 | 1348 | state_save_register_global(machine, m_sleep); |
| r10315 | r10316 | |
|---|---|---|
| 416 | 416 | { |
| 417 | 417 | nanos_state *state = machine->driver_data<nanos_state>(); |
| 418 | 418 | state->key_pressed = 0xff; |
| 419 | timer_pulse( | |
| 419 | machine->scheduler().timer_pulse( | |
| 420 | 420 | } |
| 421 | 421 | |
| 422 | 422 | static MACHINE_RESET(nanos) |
| r10315 | r10316 | |
|---|---|---|
| 51 | 51 | static MACHINE_RESET(c10) |
| 52 | 52 | { |
| 53 | 53 | memory_set_bank(machine, "boot", 1); |
| 54 | timer_set( | |
| 54 | machine->scheduler().timer_set( | |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | static VIDEO_START( c10 ) |
| r10315 | r10316 | |
|---|---|---|
| 265 | 265 | { |
| 266 | 266 | beep_set_state(space->machine->device("beeper"),1); |
| 267 | 267 | logerror("timed beeper on\n"); |
| 268 | | |
| 268 | | |
| 269 | 269 | } |
| 270 | 270 | } |
| 271 | 271 | logerror("beeper state: %02x\n",data); |
| r10315 | r10316 | |
| 283 | 283 | { |
| 284 | 284 | beep_set_state(space->machine->device("beeper"),1); |
| 285 | 285 | logerror("timed beeper on\n"); |
| 286 | | |
| 286 | | |
| 287 | 287 | } |
| 288 | 288 | return 0xff; |
| 289 | 289 | } |
| r10315 | r10316 | |
| 730 | 730 | fm77av_encoder_handle_command(state); |
| 731 | 731 | |
| 732 | 732 | // wait 5us to set ACK flag |
| 733 | | |
| 733 | | |
| 734 | 734 | |
| 735 | 735 | //logerror("ENC: write 0x%02x to data register, moved to pos %i\n",data,state->encoder.position); |
| 736 | 736 | } |
| r10315 | r10316 | |
| 1695 | 1695 | fm7_state *state = machine->driver_data<fm7_state>(); |
| 1696 | 1696 | // state->shared_ram = auto_alloc_array(machine,UINT8,0x80); |
| 1697 | 1697 | state->video_ram = auto_alloc_array(machine,UINT8,0x18000); // 2 pages on some systems |
| 1698 | state->timer = timer_alloc(machine,fm7_timer_irq,NULL); | |
| 1699 | state->subtimer = timer_alloc(machine,fm7_subtimer_irq,NULL); | |
| 1700 | state->keyboard_timer = timer_alloc(machine,fm7_keyboard_poll,NULL); | |
| 1698 | state->timer = machine->scheduler().timer_alloc(FUNC(fm7_timer_irq)); | |
| 1699 | state->subtimer = machine->scheduler().timer_alloc(FUNC(fm7_subtimer_irq)); | |
| 1700 | state->keyboard_timer = machine->scheduler().timer_alloc(FUNC(fm7_keyboard_poll)); | |
| 1701 | 1701 | if(state->type != SYS_FM7) |
| 1702 | state->fm77av_vsync_timer = timer_alloc( | |
| 1702 | state->fm77av_vsync_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1703 | 1703 | cpu_set_irq_callback(machine->device("maincpu"),fm7_irq_ack); |
| 1704 | 1704 | cpu_set_irq_callback(machine->device("sub"),fm7_sub_irq_ack); |
| 1705 | 1705 | } |
| r10315 | r10316 | |
|---|---|---|
| 334 | 334 | { |
| 335 | 335 | d65010_state *state = machine->driver_data<d65010_state>(); |
| 336 | 336 | |
| 337 | state->irq_on_timer = timer_alloc( machine, d65010_irq_on_cb, NULL ); | |
| 338 | state->irq_off_timer = timer_alloc( machine, d65010_irq_off_cb, NULL ); | |
| 337 | state->irq_on_timer = machine->scheduler().timer_alloc(FUNC(d65010_irq_on_cb)); | |
| 338 | state->irq_off_timer = machine->scheduler().timer_alloc(FUNC(d65010_irq_off_cb)); | |
| 339 | 339 | state->maincpu = machine->device( "maincpu" ); |
| 340 | 340 | state->screen = machine->device<screen_device>("screen" ); |
| 341 | 341 | } |
| r10315 | r10316 | |
|---|---|---|
| 993 | 993 | machine->add_notifier(MACHINE_NOTIFY_EXIT, nc100_machine_stop); |
| 994 | 994 | |
| 995 | 995 | /* keyboard timer */ |
| 996 | state->keyboard_timer = timer_alloc( | |
| 996 | state->keyboard_timer = machine->scheduler().timer_alloc(FUNC(n | |
| 997 | 997 | timer_adjust_oneshot(state->keyboard_timer, attotime::from_msec(10), 0); |
| 998 | 998 | |
| 999 | 999 | /* dummy timer */ |
| 1000 | timer_pulse( | |
| 1000 | machine->scheduler().timer_pulse( | |
| 1001 | 1001 | |
| 1002 | 1002 | /* serial timer */ |
| 1003 | state->serial_timer = timer_alloc( | |
| 1003 | state->serial_timer = machine->scheduler().timer_alloc(FUNC(n | |
| 1004 | 1004 | } |
| 1005 | 1005 | |
| 1006 | 1006 | |
| r10315 | r10316 | |
| 1392 | 1392 | machine->add_notifier(MACHINE_NOTIFY_EXIT, nc200_machine_stop); |
| 1393 | 1393 | |
| 1394 | 1394 | /* keyboard timer */ |
| 1395 | state->keyboard_timer = timer_alloc( | |
| 1395 | state->keyboard_timer = machine->scheduler().timer_alloc(FUNC(n | |
| 1396 | 1396 | timer_adjust_oneshot(state->keyboard_timer, attotime::from_msec(10), 0); |
| 1397 | 1397 | |
| 1398 | 1398 | /* dummy timer */ |
| 1399 | timer_pulse( | |
| 1399 | machine->scheduler().timer_pulse( | |
| 1400 | 1400 | |
| 1401 | 1401 | /* serial timer */ |
| 1402 | state->serial_timer = timer_alloc( | |
| 1402 | state->serial_timer = machine->scheduler().timer_alloc(FUNC(n | |
| 1403 | 1403 | } |
| 1404 | 1404 | |
| 1405 | 1405 | /* |
| r10315 | r10316 | |
|---|---|---|
| 49 | 49 | |
| 50 | 50 | static MACHINE_RESET(okean240) |
| 51 | 51 | { |
| 52 | timer_set( | |
| 52 | machine->scheduler().timer_set( | |
| 53 | 53 | memory_set_bank(machine, "boot", 1); |
| 54 | 54 | } |
| 55 | 55 |
| r10315 | r10316 | |
|---|---|---|
| 604 | 604 | { |
| 605 | 605 | ngp_state *state = machine->driver_data<ngp_state>(); |
| 606 | 606 | |
| 607 | state->seconds_timer = timer_alloc( | |
| 607 | state->seconds_timer = machine->scheduler().timer_alloc(FUNC( | |
| 608 | 608 | timer_adjust_periodic( state->seconds_timer, attotime::from_seconds(1), 0, attotime::from_seconds(1) ); |
| 609 | 609 | } |
| 610 | 610 |
| r10315 | r10316 | |
|---|---|---|
| 299 | 299 | |
| 300 | 300 | static MACHINE_START( z88 ) |
| 301 | 301 | { |
| 302 | timer_pulse( | |
| 302 | machine->scheduler().timer_pulse( | |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | static MACHINE_RESET( z88 ) |
| r10315 | r10316 | |
|---|---|---|
| 1361 | 1361 | state->interrupt_counter = 0; |
| 1362 | 1362 | |
| 1363 | 1363 | /* video ints */ |
| 1364 | timer_pulse( | |
| 1364 | machine->scheduler().timer_pulse( | |
| 1365 | 1365 | /* rtc timer */ |
| 1366 | timer_pulse( | |
| 1366 | machine->scheduler().timer_pulse( | |
| 1367 | 1367 | /* keyboard timer */ |
| 1368 | timer_pulse( | |
| 1368 | machine->scheduler().timer_pulse( | |
| 1369 | 1369 | |
| 1370 | 1370 | |
| 1371 | 1371 | pc_fdc_init(machine, &pcw16_fdc_interface); |
| r10315 | r10316 | |
|---|---|---|
| 323 | 323 | |
| 324 | 324 | static MACHINE_START(vt100) |
| 325 | 325 | { |
| 326 | timer_pulse( | |
| 326 | machine->scheduler().timer_pulse( | |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | static MACHINE_RESET(vt100) |
| r10315 | r10316 | |
|---|---|---|
| 1198 | 1198 | floppy_drive_set_index_pulse_callback(floppy_get_device(machine, 0), prof80_fdc_index_callback); |
| 1199 | 1199 | |
| 1200 | 1200 | /* allocate floppy motor off timer */ |
| 1201 | state->floppy_motor_off_timer = timer_alloc( | |
| 1201 | state->floppy_motor_off_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1202 | 1202 | |
| 1203 | 1203 | /* bank switch */ |
| 1204 | 1204 | prof80_bankswitch(machine); |
| r10315 | r10316 | |
|---|---|---|
| 104 | 104 | |
| 105 | 105 | memset(vg230, 0, sizeof(*vg230)); |
| 106 | 106 | vg230->pmu.write_protected=TRUE; |
| 107 | timer_pulse( | |
| 107 | machine->scheduler().timer_pulse( | |
| 108 | 108 | |
| 109 | 109 | |
| 110 | 110 | machine->base_datetime(systime); |
| r10315 | r10316 | |
|---|---|---|
| 175 | 175 | state->mfp.current_irq = -1; // No current interrupt |
| 176 | 176 | |
| 177 | 177 | #if 0 |
| 178 | mfp_timer[0] = timer_alloc(machine, mfp_timer_a_callback, NULL); | |
| 179 | mfp_timer[1] = timer_alloc(machine, mfp_timer_b_callback, NULL); | |
| 180 | mfp_timer[2] = timer_alloc(machine, mfp_timer_c_callback, NULL); | |
| 181 | mfp_timer[3] = timer_alloc(machine, mfp_timer_d_callback, NULL); | |
| 182 | mfp_irq = timer_alloc(machine, mfp_update_irq, NULL); | |
| 178 | mfp_timer[0] = machine->scheduler().timer_alloc(FUNC(mfp_timer_a_callback)); | |
| 179 | mfp_timer[1] = machine->scheduler().timer_alloc(FUNC(mfp_timer_b_callback)); | |
| 180 | mfp_timer[2] = machine->scheduler().timer_alloc(FUNC(mfp_timer_c_callback)); | |
| 181 | mfp_timer[3] = machine->scheduler().timer_alloc(FUNC(mfp_timer_d_callback)); | |
| 182 | mfp_irq = machine->scheduler().timer_alloc(FUNC(mfp_update_irq)); | |
| 183 | 183 | timer_adjust_periodic(mfp_irq, attotime::zero, 0, attotime::from_usec(32)); |
| 184 | 184 | #endif |
| 185 | 185 | } |
| r10315 | r10316 | |
| 738 | 738 | static void md_6button_init(running_machine* machine) |
| 739 | 739 | { |
| 740 | 740 | x68k_state *state = machine->driver_data<x68k_state>(); |
| 741 | state->mdctrl.io_timeout1 = timer_alloc(machine,md_6button_port1_timeout,NULL); | |
| 742 | state->mdctrl.io_timeout2 = timer_alloc(machine,md_6button_port2_timeout,NULL); | |
| 741 | state->mdctrl.io_timeout1 = machine->scheduler().timer_alloc(FUNC(md_6button_port1_timeout)); | |
| 742 | state->mdctrl.io_timeout2 = machine->scheduler().timer_alloc(FUNC(md_6button_port2_timeout)); | |
| 743 | 743 | } |
| 744 | 744 | |
| 745 | 745 | static UINT8 md_6button_r(device_t* device, int port) |
| r10315 | r10316 | |
| 1729 | 1729 | offset *= 2; |
| 1730 | 1730 | if(ACCESSING_BITS_0_7) |
| 1731 | 1731 | offset++; |
| 1732 | | |
| 1732 | | |
| 1733 | 1733 | } |
| 1734 | 1734 | return 0xff; |
| 1735 | 1735 | } |
| r10315 | r10316 | |
| 1747 | 1747 | offset *= 2; |
| 1748 | 1748 | if(ACCESSING_BITS_0_7) |
| 1749 | 1749 | offset++; |
| 1750 | | |
| 1750 | | |
| 1751 | 1751 | } |
| 1752 | 1752 | } |
| 1753 | 1753 | |
| r10315 | r10316 | |
| 1764 | 1764 | offset *= 2; |
| 1765 | 1765 | if(ACCESSING_BITS_0_7) |
| 1766 | 1766 | offset++; |
| 1767 | | |
| 1767 | | |
| 1768 | 1768 | } |
| 1769 | 1769 | return 0xff; |
| 1770 | 1770 | } |
| r10315 | r10316 | |
| 1782 | 1782 | offset *= 2; |
| 1783 | 1783 | if(ACCESSING_BITS_0_7) |
| 1784 | 1784 | offset++; |
| 1785 | | |
| 1785 | | |
| 1786 | 1786 | } |
| 1787 | 1787 | } |
| 1788 | 1788 | |
| r10315 | r10316 | |
| 1797 | 1797 | offset *= 2; |
| 1798 | 1798 | if(ACCESSING_BITS_0_7) |
| 1799 | 1799 | offset++; |
| 1800 | | |
| 1800 | | |
| 1801 | 1801 | // cputag_set_input_line_and_vector(machine, "maincpu",2,ASSERT_LINE,state->current_vector[2]); |
| 1802 | 1802 | } |
| 1803 | 1803 | return 0xffff; |
| r10315 | r10316 | |
| 1814 | 1814 | offset *= 2; |
| 1815 | 1815 | if(ACCESSING_BITS_0_7) |
| 1816 | 1816 | offset++; |
| 1817 | | |
| 1817 | | |
| 1818 | 1818 | // cputag_set_input_line_and_vector(machine, "maincpu",2,ASSERT_LINE,state->current_vector[2]); |
| 1819 | 1819 | } |
| 1820 | 1820 | } |
| r10315 | r10316 | |
| 2693 | 2693 | // init keyboard |
| 2694 | 2694 | state->keyboard.delay = 500; // 3*100+200 |
| 2695 | 2695 | state->keyboard.repeat = 110; // 4^2*5+30 |
| 2696 | state->kb_timer = timer_alloc(machine, x68k_keyboard_poll,NULL); | |
| 2697 | state->scanline_timer = timer_alloc(machine, x68k_hsync,NULL); | |
| 2698 | state->raster_irq = timer_alloc(machine, x68k_crtc_raster_irq,NULL); | |
| 2699 | state->vblank_irq = timer_alloc(machine, x68k_crtc_vblank_irq,NULL); | |
| 2700 | state->mouse_timer = timer_alloc(machine, x68k_scc_ack,NULL); | |
| 2701 | state->led_timer = timer_alloc(machine, x68k_led_callback,NULL); | |
| 2696 | state->kb_timer = machine->scheduler().timer_alloc(FUNC(x68k_keyboard_poll)); | |
| 2697 | state->scanline_timer = machine->scheduler().timer_alloc(FUNC(x68k_hsync)); | |
| 2698 | state->raster_irq = machine->scheduler().timer_alloc(FUNC(x68k_crtc_raster_irq)); | |
| 2699 | state->vblank_irq = machine->scheduler().timer_alloc(FUNC(x68k_crtc_vblank_irq)); | |
| 2700 | state->mouse_timer = machine->scheduler().timer_alloc(FUNC(x68k_scc_ack)); | |
| 2701 | state->led_timer = machine->scheduler().timer_alloc(FUNC(x68k_led_callback)); | |
| 2702 | 2702 | |
| 2703 | 2703 | // Initialise timers for 6-button MD controllers |
| 2704 | 2704 | md_6button_init(machine); |
| r10315 | r10316 | |
|---|---|---|
| 242 | 242 | /* find devices */ |
| 243 | 243 | state->speaker = machine->device(SPEAKER_TAG); |
| 244 | 244 | |
| 245 | state->led_refresh_timer = timer_alloc( | |
| 245 | state->led_refresh_timer = machine->scheduler().timer_alloc(FUNC( | |
| 246 | 246 | |
| 247 | 247 | /* register for state saving */ |
| 248 | 248 | state_save_register_global(machine, state->eprom_oe); |
| r10315 | r10316 | |
|---|---|---|
| 1088 | 1088 | px4->alarm_int_enabled = TRUE; |
| 1089 | 1089 | |
| 1090 | 1090 | /* art */ |
| 1091 | px4->receive_timer = timer_alloc(machine, receive_data, NULL); | |
| 1092 | px4->transmit_timer = timer_alloc(machine, transmit_data, NULL); | |
| 1091 | px4->receive_timer = machine->scheduler().timer_alloc(FUNC(receive_data)); | |
| 1092 | px4->transmit_timer = machine->scheduler().timer_alloc(FUNC(transmit_data)); | |
| 1093 | 1093 | |
| 1094 | 1094 | /* printer */ |
| 1095 | 1095 | px4->printer = machine->device("centronics"); |
| 1096 | 1096 | |
| 1097 | 1097 | /* external cassette or barcode reader */ |
| 1098 | px4->ext_cas_timer = timer_alloc( | |
| 1098 | px4->ext_cas_timer = machine->scheduler().timer_alloc(FUNC( | |
| 1099 | 1099 | px4->ext_cas = machine->device("extcas"); |
| 1100 | 1100 | px4->ear_last_state = 0; |
| 1101 | 1101 |
| r10315 | r10316 | |
|---|---|---|
| 1385 | 1385 | |
| 1386 | 1386 | static READ8_DEVICE_HANDLER( cpu_8255_c_r ) |
| 1387 | 1387 | { |
| 1388 | | |
| 1388 | | |
| 1389 | 1389 | |
| 1390 | 1390 | return i8255_1_pc >> 4; |
| 1391 | 1391 | } |
| 1392 | 1392 | |
| 1393 | 1393 | static WRITE8_DEVICE_HANDLER( cpu_8255_c_w ) |
| 1394 | 1394 | { |
| 1395 | | |
| 1395 | | |
| 1396 | 1396 | |
| 1397 | 1397 | i8255_0_pc = data; |
| 1398 | 1398 | } |
| r10315 | r10316 | |
| 1409 | 1409 | |
| 1410 | 1410 | static READ8_DEVICE_HANDLER( fdc_8255_c_r ) |
| 1411 | 1411 | { |
| 1412 | | |
| 1412 | | |
| 1413 | 1413 | |
| 1414 | 1414 | return i8255_0_pc >> 4; |
| 1415 | 1415 | } |
| 1416 | 1416 | |
| 1417 | 1417 | static WRITE8_DEVICE_HANDLER( fdc_8255_c_w ) |
| 1418 | 1418 | { |
| 1419 | | |
| 1419 | | |
| 1420 | 1420 | |
| 1421 | 1421 | i8255_1_pc = data; |
| 1422 | 1422 | } |
| r10315 | r10316 | |
| 1457 | 1457 | |
| 1458 | 1458 | upd765_tc_w(space->machine->device("upd765"), 1); |
| 1459 | 1459 | //TODO: I'm not convinced that this works correctly with current hook-up ... 1000 usec is needed by Aploon, a bigger value breaks Alpha. |
| 1460 | | |
| 1460 | | |
| 1461 | 1461 | return 0xff; // value is meaningless |
| 1462 | 1462 | } |
| 1463 | 1463 | |
| r10315 | r10316 | |
| 1943 | 1943 | { |
| 1944 | 1944 | cpu_set_irq_callback(machine->device("maincpu"), pc8801_irq_callback); |
| 1945 | 1945 | |
| 1946 | timer_pulse( | |
| 1946 | machine->scheduler().timer_pulse( | |
| 1947 | 1947 | } |
| 1948 | 1948 | |
| 1949 | 1949 | static MACHINE_RESET( pc8801 ) |
| r10315 | r10316 | |
|---|---|---|
| 371 | 371 | { |
| 372 | 372 | /* write me: start talking */ |
| 373 | 373 | state->speech_running = 1; |
| 374 | | |
| 374 | | |
| 375 | 375 | } |
| 376 | 376 | break; |
| 377 | 377 | case 0x90: // unknown, one of these is probably read and branch |
| r10315 | r10316 | |
| 395 | 395 | if ((data&0xF) == 0) // speak |
| 396 | 396 | { |
| 397 | 397 | state->speech_running = 1; |
| 398 | | |
| 398 | | |
| 399 | 399 | } |
| 400 | 400 | else if ((data&0xF) == 8) // reset |
| 401 | 401 | { |
| r10315 | r10316 | |
| 894 | 894 | { |
| 895 | 895 | socrates_state *state = device->machine->driver_data<socrates_state>(); |
| 896 | 896 | cpu_set_input_line(device, 0, ASSERT_LINE); |
| 897 | | |
| 897 | | |
| 898 | 898 | // 44 is a complete and total guess, need to properly measure how many clocks/microseconds the int line is high for. |
| 899 | 899 | state->vblankstate = 1; |
| 900 | 900 | } |
| r10315 | r10316 | |
|---|---|---|
| 471 | 471 | jr200_state *state = machine->driver_data<jr200_state>(); |
| 472 | 472 | beep_set_frequency(machine->device("beeper"),0); |
| 473 | 473 | beep_set_state(machine->device("beeper"),0); |
| 474 | state->timer_d = timer_alloc( | |
| 474 | state->timer_d = machine->scheduler().timer_alloc(FUNC( | |
| 475 | 475 | } |
| 476 | 476 | |
| 477 | 477 | static MACHINE_RESET(jr200) |
| r10315 | r10316 | |
|---|---|---|
| 243 | 243 | static MACHINE_START( coleco ) |
| 244 | 244 | { |
| 245 | 245 | TMS9928A_configure(&tms9928a_interface); |
| 246 | timer_pulse( | |
| 246 | machine->scheduler().timer_pulse( | |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | static MACHINE_RESET( coleco ) |
| r10315 | r10316 | |
|---|---|---|
| 547 | 547 | UINT8 ctrl2 = (input_port_read(machine, "CTRLSEL") & 0xf0) >> 4; |
| 548 | 548 | |
| 549 | 549 | /* Check if lightgun has been chosen as input: if so, enable crosshair */ |
| 550 | timer_set( | |
| 550 | machine->scheduler().timer_set( | |
| 551 | 551 | |
| 552 | 552 | switch (ctrl1) |
| 553 | 553 | { |
| r10315 | r10316 | |
|---|---|---|
| 1737 | 1737 | static void s3c240x_machine_start( running_machine *machine) |
| 1738 | 1738 | { |
| 1739 | 1739 | gp32_state *state = machine->driver_data<gp32_state>(); |
| 1740 | state->s3c240x_pwm_timer[0] = timer_alloc( machine, s3c240x_pwm_timer_exp, (void *)(FPTR)0); | |
| 1741 | state->s3c240x_pwm_timer[1] = timer_alloc( machine, s3c240x_pwm_timer_exp, (void *)(FPTR)1); | |
| 1742 | state->s3c240x_pwm_timer[2] = timer_alloc( machine, s3c240x_pwm_timer_exp, (void *)(FPTR)2); | |
| 1743 | state->s3c240x_pwm_timer[3] = timer_alloc( machine, s3c240x_pwm_timer_exp, (void *)(FPTR)3); | |
| 1744 | state->s3c240x_pwm_timer[4] = timer_alloc( machine, s3c240x_pwm_timer_exp, (void *)(FPTR)4); | |
| 1745 | state->s3c240x_dma_timer[0] = timer_alloc( machine, s3c240x_dma_timer_exp, (void *)(FPTR)0); | |
| 1746 | state->s3c240x_dma_timer[1] = timer_alloc( machine, s3c240x_dma_timer_exp, (void *)(FPTR)1); | |
| 1747 | state->s3c240x_dma_timer[2] = timer_alloc( machine, s3c240x_dma_timer_exp, (void *)(FPTR)2); | |
| 1748 | state->s3c240x_dma_timer[3] = timer_alloc( machine, s3c240x_dma_timer_exp, (void *)(FPTR)3); | |
| 1749 | state->s3c240x_iic_timer = timer_alloc( machine, s3c240x_iic_timer_exp, (void *)(FPTR)0); | |
| 1750 | state->s3c240x_iis_timer = timer_alloc( machine, s3c240x_iis_timer_exp, (void *)(FPTR)0); | |
| 1751 | state->s3c240x_lcd_timer = timer_alloc( machine, s3c240x_lcd_timer_exp, (void *)(FPTR)0); | |
| 1740 | state->s3c240x_pwm_timer[0] = machine->scheduler().timer_alloc(FUNC(s3c240x_pwm_timer_exp), (void *)(FPTR)0); | |
| 1741 | state->s3c240x_pwm_timer[1] = machine->scheduler().timer_alloc(FUNC(s3c240x_pwm_timer_exp), (void *)(FPTR)1); | |
| 1742 | state->s3c240x_pwm_timer[2] = machine->scheduler().timer_alloc(FUNC(s3c240x_pwm_timer_exp), (void *)(FPTR)2); | |
| 1743 | state->s3c240x_pwm_timer[3] = machine->scheduler().timer_alloc(FUNC(s3c240x_pwm_timer_exp), (void *)(FPTR)3); | |
| 1744 | state->s3c240x_pwm_timer[4] = machine->scheduler().timer_alloc(FUNC(s3c240x_pwm_timer_exp), (void *)(FPTR)4); | |
| 1745 | state->s3c240x_dma_timer[0] = machine->scheduler().timer_alloc(FUNC(s3c240x_dma_timer_exp), (void *)(FPTR)0); | |
| 1746 | state->s3c240x_dma_timer[1] = machine->scheduler().timer_alloc(FUNC(s3c240x_dma_timer_exp), (void *)(FPTR)1); | |
| 1747 | state->s3c240x_dma_timer[2] = machine->scheduler().timer_alloc(FUNC(s3c240x_dma_timer_exp), (void *)(FPTR)2); | |
| 1748 | state->s3c240x_dma_timer[3] = machine->scheduler().timer_alloc(FUNC(s3c240x_dma_timer_exp), (void *)(FPTR)3); | |
| 1749 | state->s3c240x_iic_timer = machine->scheduler().timer_alloc(FUNC(s3c240x_iic_timer_exp), (void *)(FPTR)0); | |
| 1750 | state->s3c240x_iis_timer = machine->scheduler().timer_alloc(FUNC(s3c240x_iis_timer_exp), (void *)(FPTR)0); | |
| 1751 | state->s3c240x_lcd_timer = machine->scheduler().timer_alloc(FUNC(s3c240x_lcd_timer_exp), (void *)(FPTR)0); | |
| 1752 | 1752 | state->eeprom_data = auto_alloc_array( machine, UINT8, 0x2000); |
| 1753 | 1753 | smc_init( machine); |
| 1754 | 1754 | i2s_init( machine); |
| r10315 | r10316 | |
|---|---|---|
| 1398 | 1398 | if(LOG_SCU) logerror("DMA transfer END\n"); |
| 1399 | 1399 | |
| 1400 | 1400 | /*TODO: timing of this*/ |
| 1401 | | |
| 1401 | | |
| 1402 | 1402 | |
| 1403 | 1403 | if(scu_add_tmp & 0x80000000) |
| 1404 | 1404 | { |
| r10315 | r10316 | |
| 1499 | 1499 | |
| 1500 | 1500 | if(LOG_SCU) logerror("DMA transfer END\n"); |
| 1501 | 1501 | |
| 1502 | | |
| 1502 | | |
| 1503 | 1503 | |
| 1504 | 1504 | if(scu_add_tmp & 0x80000000) |
| 1505 | 1505 | { |
| r10315 | r10316 | |
| 1600 | 1600 | |
| 1601 | 1601 | if(LOG_SCU) logerror("DMA transfer END\n"); |
| 1602 | 1602 | |
| 1603 | | |
| 1603 | | |
| 1604 | 1604 | |
| 1605 | 1605 | if(scu_add_tmp & 0x80000000) |
| 1606 | 1606 | { |
| r10315 | r10316 | |
| 1675 | 1675 | |
| 1676 | 1676 | }while(job_done == 0); |
| 1677 | 1677 | |
| 1678 | | |
| 1678 | | |
| 1679 | 1679 | } |
| 1680 | 1680 | |
| 1681 | 1681 | static void dma_indirect_lv1(address_space *space) |
| r10315 | r10316 | |
| 1744 | 1744 | |
| 1745 | 1745 | }while(job_done == 0); |
| 1746 | 1746 | |
| 1747 | | |
| 1747 | | |
| 1748 | 1748 | } |
| 1749 | 1749 | |
| 1750 | 1750 | static void dma_indirect_lv2(address_space *space) |
| r10315 | r10316 | |
| 1812 | 1812 | |
| 1813 | 1813 | }while(job_done == 0); |
| 1814 | 1814 | |
| 1815 | | |
| 1815 | | |
| 1816 | 1816 | } |
| 1817 | 1817 | |
| 1818 | 1818 | |
| r10315 | r10316 | |
| 2168 | 2168 | |
| 2169 | 2169 | /*TODO: timing of this one (related to the VDP1 speed)*/ |
| 2170 | 2170 | /* (NOTE: value shouldn't be at h_sync/v_sync position (will break shienryu))*/ |
| 2171 | | |
| 2171 | | |
| 2172 | 2172 | } |
| 2173 | 2173 | |
| 2174 | 2174 | static void saturn_init_driver(running_machine *machine, int rgn) |
| r10315 | r10316 | |
|---|---|---|
| 1778 | 1778 | { |
| 1779 | 1779 | supracan_state *state = machine->driver_data<supracan_state>(); |
| 1780 | 1780 | |
| 1781 | state->video_timer = timer_alloc( machine, supracan_video_callback, NULL ); | |
| 1782 | state->hbl_timer = timer_alloc( machine, supracan_hbl_callback, NULL ); | |
| 1783 | state->line_on_timer = timer_alloc( machine, supracan_line_on_callback, NULL ); | |
| 1784 | state->line_off_timer = timer_alloc( machine, supracan_line_off_callback, NULL ); | |
| 1781 | state->video_timer = machine->scheduler().timer_alloc(FUNC(supracan_video_callback)); | |
| 1782 | state->hbl_timer = machine->scheduler().timer_alloc(FUNC(supracan_hbl_callback)); | |
| 1783 | state->line_on_timer = machine->scheduler().timer_alloc(FUNC(supracan_line_on_callback)); | |
| 1784 | state->line_off_timer = machine->scheduler().timer_alloc(FUNC(supracan_line_off_callback)); | |
| 1785 | 1785 | } |
| 1786 | 1786 | |
| 1787 | 1787 |
| r10315 | r10316 | |
|---|---|---|
| 137 | 137 | state->timer = 0; |
| 138 | 138 | state->dac = machine->device("dac"); |
| 139 | 139 | |
| 140 | timer_pulse( | |
| 140 | machine->scheduler().timer_pulse( | |
| 141 | 141 | |
| 142 | 142 | /* register for state saving */ |
| 143 | 143 | state_save_register_global(machine, state->timer); |
| r10315 | r10316 | |
|---|---|---|
| 47 | 47 | craft_state(running_machine &machine, const driver_device_config_base &config) |
| 48 | 48 | : driver_device(machine, config) |
| 49 | 49 | { |
| 50 | timer0_timer = timer_alloc( | |
| 50 | timer0_timer = machine.scheduler().timer_alloc(FUNC(a | |
| 51 | 51 | timer0_increment = 1; |
| 52 | 52 | |
| 53 | timer1_timer = timer_alloc( | |
| 53 | timer1_timer = machine.scheduler().timer_alloc(FUNC(a | |
| 54 | 54 | timer1_increment = 1; |
| 55 | 55 | |
| 56 | timer2_timer = timer_alloc( | |
| 56 | timer2_timer = machine.scheduler().timer_alloc(FUNC(a | |
| 57 | 57 | timer2_increment = 1; |
| 58 | 58 | } |
| 59 | 59 |
| r10315 | r10316 | |
|---|---|---|
| 284 | 284 | { |
| 285 | 285 | cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); |
| 286 | 286 | |
| 287 | timer_set( | |
| 287 | machine->scheduler().timer_set( | |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | static TIMER_DEVICE_CALLBACK( vg5k_scanline ) |
| r10315 | r10316 | |
| 304 | 304 | vg5k->printer = machine->device("printer"); |
| 305 | 305 | vg5k->cassette = machine->device("cassette"); |
| 306 | 306 | |
| 307 | timer_pulse( | |
| 307 | machine->scheduler().timer_pulse( | |
| 308 | 308 | |
| 309 | 309 | state_save_register_global(machine, vg5k->ef9345_offset); |
| 310 | 310 | } |
| r10315 | r10316 | |
|---|---|---|
| 370 | 370 | static INTERRUPT_GEN( intv_interrupt2 ) |
| 371 | 371 | { |
| 372 | 372 | cputag_set_input_line(device->machine, "keyboard", 0, ASSERT_LINE); |
| 373 | | |
| 373 | | |
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | static MACHINE_CONFIG_START( intv, intv_state ) |
| r10315 | r10316 | |
|---|---|---|
| 340 | 340 | mephisto_state *state = machine->driver_data<mephisto_state>(); |
| 341 | 341 | state->lcd_shift_counter=3; |
| 342 | 342 | |
| 343 | timer_pulse(machine, attotime::from_hz(600), NULL, 0, update_nmi); | |
| 344 | timer_pulse(machine, attotime::from_hz(100), NULL, 0, mboard_update_artwork); | |
| 343 | machine->scheduler().timer_pulse(attotime::from_hz(600), FUNC(update_nmi)); | |
| 344 | machine->scheduler().timer_pulse(attotime::from_hz(100), FUNC(mboard_update_artwork)); | |
| 345 | 345 | |
| 346 | 346 | mboard_savestate_register(machine); |
| 347 | 347 | } |
| r10315 | r10316 | |
| 352 | 352 | state->lcd_shift_counter=3; |
| 353 | 353 | state->led7=0xff; |
| 354 | 354 | |
| 355 | timer_pulse(machine, attotime::from_hz(450), NULL, 0, update_irq); | |
| 356 | timer_pulse(machine, attotime::from_hz(100), NULL, 0, mboard_update_artwork); | |
| 355 | machine->scheduler().timer_pulse(attotime::from_hz(450), FUNC(update_irq)); | |
| 356 | machine->scheduler().timer_pulse(attotime::from_hz(100), FUNC(mboard_update_artwork)); | |
| 357 | 357 | |
| 358 | 358 | mboard_savestate_register(machine); |
| 359 | 359 | } |
| r10315 | r10316 | |
|---|---|---|
| 728 | 728 | { |
| 729 | 729 | scv_state *state = machine->driver_data<scv_state>(); |
| 730 | 730 | |
| 731 | state->vb_timer = timer_alloc( | |
| 731 | state->vb_timer = machine->scheduler().timer_alloc(FUNC( | |
| 732 | 732 | } |
| 733 | 733 | |
| 734 | 734 |
| r10315 | r10316 | |
|---|---|---|
| 550 | 550 | state->led_update=TRUE; |
| 551 | 551 | state->remove_led_flag=TRUE; |
| 552 | 552 | |
| 553 | state->timer_update_irq = timer_alloc( | |
| 553 | state->timer_update_irq = machine->scheduler().timer_alloc(FUNC( | |
| 554 | 554 | timer_adjust_periodic( state->timer_update_irq, attotime::zero, 0, attotime::from_hz(1000) ); |
| 555 | 555 | |
| 556 | timer_pulse( | |
| 556 | machine->scheduler().timer_pulse( | |
| 557 | 557 | |
| 558 | 558 | state_save_register_global_array(machine,state->save_board); |
| 559 | 559 | state_save_register_postload(machine,m_board_postload,NULL); |
| r10315 | r10316 | |
|---|---|---|
| 86 | 86 | |
| 87 | 87 | UINT8 length = (offset & 0x20) ? 200 : 4; |
| 88 | 88 | beep_set_state(state->beeper, 1); |
| 89 | | |
| 89 | | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | static ADDRESS_MAP_START(h19_mem, ADDRESS_SPACE_PROGRAM, 8) |
| r10315 | r10316 | |
|---|---|---|
| 434 | 434 | { |
| 435 | 435 | /* a timer used to check status of pen */ |
| 436 | 436 | /* an interrupt is generated when the pen is pressed to the screen */ |
| 437 | timer_pulse( | |
| 437 | machine->scheduler().timer_pulse( | |
| 438 | 438 | } |
| 439 | 439 | |
| 440 | 440 |
| r10315 | r10316 | |
|---|---|---|
| 105 | 105 | svision_irq( space->machine ); |
| 106 | 106 | break; |
| 107 | 107 | default: |
| 108 | logerror("%.6f svision read %04x %02x\n", | |
| 108 | logerror("%.6f svision read %04x %02x\n", | |
| 109 | 109 | break; |
| 110 | 110 | } |
| 111 | 111 | |
| r10315 | r10316 | |
| 126 | 126 | case 3: |
| 127 | 127 | break; |
| 128 | 128 | case 0x26: /* bits 5,6 memory management for a000? */ |
| 129 | logerror("%.6f svision write %04x %02x\n", | |
| 129 | logerror("%.6f svision write %04x %02x\n", | |
| 130 | 130 | memory_set_bankptr(space->machine, "bank1", space->machine->region("user1")->base() + ((state->reg[0x26] & 0xe0) << 9)); |
| 131 | 131 | svision_irq( space->machine ); |
| 132 | 132 | break; |
| r10315 | r10316 | |
| 154 | 154 | svision_noise_w(state->sound, offset - 0x28, data); |
| 155 | 155 | break; |
| 156 | 156 | default: |
| 157 | logerror("%.6f svision write %04x %02x\n", | |
| 157 | logerror("%.6f svision write %04x %02x\n", | |
| 158 | 158 | break; |
| 159 | 159 | } |
| 160 | 160 | } |
| r10315 | r10316 | |
| 425 | 425 | static DRIVER_INIT( svision ) |
| 426 | 426 | { |
| 427 | 427 | svision_state *state = machine->driver_data<svision_state>(); |
| 428 | state->svision.timer1 = timer_alloc( | |
| 428 | state->svision.timer1 = machine->scheduler().timer_alloc(FUNC( | |
| 429 | 429 | state->sound = machine->device("custom"); |
| 430 | 430 | state->dma_finished = svision_dma_finished(state->sound); |
| 431 | 431 | state->pet.on = FALSE; |
| r10315 | r10316 | |
| 435 | 435 | static DRIVER_INIT( svisions ) |
| 436 | 436 | { |
| 437 | 437 | svision_state *state = machine->driver_data<svision_state>(); |
| 438 | state->svision.timer1 = timer_alloc( | |
| 438 | state->svision.timer1 = machine->scheduler().timer_alloc(FUNC( | |
| 439 | 439 | state->sound = machine->device("custom"); |
| 440 | 440 | state->dma_finished = svision_dma_finished(state->sound); |
| 441 | 441 | memory_set_bankptr(machine, "bank2", machine->region("user1")->base() + 0x1c000); |
| 442 | state->svision.timer1 = timer_alloc( | |
| 442 | state->svision.timer1 = machine->scheduler().timer_alloc(FUNC( | |
| 443 | 443 | state->pet.on = TRUE; |
| 444 | state->pet.timer = timer_alloc(machine, svision_pet_timer, NULL); | |
| 445 | timer_pulse(machine, attotime::from_seconds(8) * 256/cputag_get_clock(machine, "maincpu"), NULL, 0, svision_pet_timer); | |
| 444 | state->pet.timer = machine->scheduler().timer_alloc(FUNC(svision_pet_timer)); | |
| 445 | machine->scheduler().timer_pulse(attotime::from_seconds(8) * 256/cputag_get_clock(machine, "maincpu"),FUNC(svision_pet_timer),0); | |
| 446 | 446 | } |
| 447 | 447 | |
| 448 | 448 | static DEVICE_IMAGE_LOAD( svision_cart ) |
| r10315 | r10316 | |
|---|---|---|
| 461 | 461 | } |
| 462 | 462 | } |
| 463 | 463 | |
| 464 | timer_pulse( | |
| 464 | machine->scheduler().timer_pulse( | |
| 465 | 465 | |
| 466 | 466 | logerror("HW=v%x, PC=%06x, Type=%s\n", m_hw_version, m_initial_pc, (m_flash_mem) ? "Flash" : "ROM"); |
| 467 | 467 | } |
| r10315 | r10316 | |
|---|---|---|
| 194 | 194 | |
| 195 | 195 | static MACHINE_START(busicom) |
| 196 | 196 | { |
| 197 | timer_pulse( | |
| 197 | machine->scheduler().timer_pulse( | |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | static MACHINE_RESET(busicom) |
| r10315 | r10316 | |
|---|---|---|
| 466 | 466 | /* RAM banks */ |
| 467 | 467 | memory_configure_bank(machine, "bank1", 0x02, 0x07, ram_get_ptr(machine->device(RAM_TAG)), 0x8000); |
| 468 | 468 | |
| 469 | state->rtc_periodic_irq = timer_alloc( | |
| 469 | state->rtc_periodic_irq = machine->scheduler().timer_alloc(FUNC( | |
| 470 | 470 | /* register for state saving */ |
| 471 | 471 | // state_save_register_global(machine, state->); |
| 472 | 472 | } |
| r10315 | r10316 | |
|---|---|---|
| 493 | 493 | static MACHINE_START( sol20 ) |
| 494 | 494 | { |
| 495 | 495 | sol20_state *state = machine->driver_data<sol20_state>(); |
| 496 | state->m_cassette_timer = timer_alloc( | |
| 496 | state->m_cassette_timer = machine->scheduler().timer_alloc(FUNC( | |
| 497 | 497 | } |
| 498 | 498 | |
| 499 | 499 | static MACHINE_RESET( sol20 ) |
| r10315 | r10316 | |
| 546 | 546 | |
| 547 | 547 | // boot-bank |
| 548 | 548 | memory_set_bank(machine, "boot", 1); |
| 549 | timer_set( | |
| 549 | machine->scheduler().timer_set( | |
| 550 | 550 | } |
| 551 | 551 | |
| 552 | 552 | static DRIVER_INIT( sol20 ) |
| r10315 | r10316 | |
|---|---|---|
| 553 | 553 | } |
| 554 | 554 | } |
| 555 | 555 | |
| 556 | timer_set( | |
| 556 | machine->scheduler().timer_set( | |
| 557 | 557 | } |
| 558 | 558 | |
| 559 | 559 | static MACHINE_START( ip204415 ) |
| r10315 | r10316 | |
| 574 | 574 | |
| 575 | 575 | state->nRTC_Temp = 0; |
| 576 | 576 | |
| 577 | timer_set( | |
| 577 | machine->scheduler().timer_set( | |
| 578 | 578 | } |
| 579 | 579 | |
| 580 | 580 | static INPUT_PORTS_START( ip204415 ) |
| r10315 | r10316 | |
|---|---|---|
| 391 | 391 | |
| 392 | 392 | static MACHINE_START( polgar ) |
| 393 | 393 | { |
| 394 | // timer_pulse(machine, attotime::from_hz(60), NULL, 0, update_leds); | |
| 395 | timer_pulse(machine, attotime::from_hz(600), NULL, 0, update_nmi); | |
| 396 | timer_pulse(machine, attotime::from_hz(100), NULL, 0, mboard_update_artwork); | |
| 394 | // machine->scheduler().timer_pulse(attotime::from_hz(60), FUNC(update_leds)); | |
| 395 | machine->scheduler().timer_pulse(attotime::from_hz(600), FUNC(update_nmi)); | |
| 396 | machine->scheduler().timer_pulse(attotime::from_hz(100), FUNC(mboard_update_artwork)); | |
| 397 | 397 | mboard_savestate_register(machine); |
| 398 | 398 | } |
| 399 | 399 |
| r10315 | r10316 | |
|---|---|---|
| 678 | 678 | memory_set_bank(machine, "rambank", 0); |
| 679 | 679 | } |
| 680 | 680 | |
| 681 | timer_pulse( | |
| 681 | machine->scheduler().timer_pulse( | |
| 682 | 682 | |
| 683 | 683 | state_save_register_global(machine, m_kb_counter); |
| 684 | 684 | state_save_register_global(machine, m_enable_nmi); |
| r10315 | r10316 | |
|---|---|---|
| 2176 | 2176 | machine->add_notifier(MACHINE_NOTIFY_EXIT, gba_machine_stop); |
| 2177 | 2177 | |
| 2178 | 2178 | /* create a timer to fire scanline functions */ |
| 2179 | state->scan_timer = timer_alloc(machine, perform_scan, 0); | |
| 2180 | state->hbl_timer = timer_alloc(machine, perform_hbl, 0); | |
| 2179 | state->scan_timer = machine->scheduler().timer_alloc(FUNC(perform_scan)); | |
| 2180 | state->hbl_timer = machine->scheduler().timer_alloc(FUNC(perform_hbl)); | |
| 2181 | 2181 | timer_adjust_oneshot(state->scan_timer, machine->primary_screen->time_until_pos(0, 0), 0); |
| 2182 | 2182 | |
| 2183 | 2183 | /* and one for each DMA channel */ |
| 2184 | state->dma_timer[0] = timer_alloc(machine, dma_complete, 0); | |
| 2185 | state->dma_timer[1] = timer_alloc(machine, dma_complete, 0); | |
| 2186 | state->dma_timer[2] = timer_alloc(machine, dma_complete, 0); | |
| 2187 | state->dma_timer[3] = timer_alloc(machine, dma_complete, 0); | |
| 2184 | state->dma_timer[0] = machine->scheduler().timer_alloc(FUNC(dma_complete)); | |
| 2185 | state->dma_timer[1] = machine->scheduler().timer_alloc(FUNC(dma_complete)); | |
| 2186 | state->dma_timer[2] = machine->scheduler().timer_alloc(FUNC(dma_complete)); | |
| 2187 | state->dma_timer[3] = machine->scheduler().timer_alloc(FUNC(dma_complete)); | |
| 2188 | 2188 | timer_adjust_oneshot(state->dma_timer[0], attotime::never, 0); |
| 2189 | 2189 | timer_adjust_oneshot(state->dma_timer[1], attotime::never, 1); |
| 2190 | 2190 | timer_adjust_oneshot(state->dma_timer[2], attotime::never, 2); |
| 2191 | 2191 | timer_adjust_oneshot(state->dma_timer[3], attotime::never, 3); |
| 2192 | 2192 | |
| 2193 | 2193 | /* also one for each timer (heh) */ |
| 2194 | state->tmr_timer[0] = timer_alloc(machine, timer_expire, 0); | |
| 2195 | state->tmr_timer[1] = timer_alloc(machine, timer_expire, 0); | |
| 2196 | state->tmr_timer[2] = timer_alloc(machine, timer_expire, 0); | |
| 2197 | state->tmr_timer[3] = timer_alloc(machine, timer_expire, 0); | |
| 2194 | state->tmr_timer[0] = machine->scheduler().timer_alloc(FUNC(timer_expire)); | |
| 2195 | state->tmr_timer[1] = machine->scheduler().timer_alloc(FUNC(timer_expire)); | |
| 2196 | state->tmr_timer[2] = machine->scheduler().timer_alloc(FUNC(timer_expire)); | |
| 2197 | state->tmr_timer[3] = machine->scheduler().timer_alloc(FUNC(timer_expire)); | |
| 2198 | 2198 | timer_adjust_oneshot(state->tmr_timer[0], attotime::never, 0); |
| 2199 | 2199 | timer_adjust_oneshot(state->tmr_timer[1], attotime::never, 1); |
| 2200 | 2200 | timer_adjust_oneshot(state->tmr_timer[2], attotime::never, 2); |
| 2201 | 2201 | timer_adjust_oneshot(state->tmr_timer[3], attotime::never, 3); |
| 2202 | 2202 | |
| 2203 | 2203 | /* and an IRQ handling timer */ |
| 2204 | state->irq_timer = timer_alloc( | |
| 2204 | state->irq_timer = machine->scheduler().timer_alloc(FUNC(h | |
| 2205 | 2205 | timer_adjust_oneshot(state->irq_timer, attotime::never, 0); |
| 2206 | 2206 | |
| 2207 | 2207 | gba_video_start(machine); |
| r10315 | r10316 | |
|---|---|---|
| 238 | 238 | /* set a timer to go off on the next VBLANK */ |
| 239 | 239 | vblank_scanline = machine->primary_screen->visible_area().max_y + 1; |
| 240 | 240 | target = machine->primary_screen->time_until_pos(vblank_scanline); |
| 241 | timer_set( | |
| 241 | machine->scheduler().timer_set( | |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | |
| r10315 | r10316 | |
| 261 | 261 | static MACHINE_RESET( ldplayer ) |
| 262 | 262 | { |
| 263 | 263 | /* set up a timer to start playing immediately */ |
| 264 | timer_set( | |
| 264 | machine->scheduler().timer_set( | |
| 265 | 265 | |
| 266 | 266 | /* indicate the name of the file we opened */ |
| 267 | 267 | popmessage("Opened %s\n", filename.cstr()); |
| r10315 | r10316 | |
| 303 | 303 | { |
| 304 | 304 | /* assert the line and set a timer for deassertion */ |
| 305 | 305 | laserdisc_line_w(laserdisc, LASERDISC_LINE_CONTROL, ASSERT_LINE); |
| 306 | timer_set( | |
| 306 | machine->scheduler().timer_set( | |
| 307 | 307 | |
| 308 | 308 | /* space 0 bits apart by 1msec, and 1 bits by 2msec */ |
| 309 | 309 | duration = attotime::from_msec((data & 0x80) ? 2 : 1); |
| r10315 | r10316 | |
| 325 | 325 | { |
| 326 | 326 | device_t *laserdisc = machine->m_devicelist.first(LASERDISC); |
| 327 | 327 | MACHINE_START_CALL(ldplayer); |
| 328 | pr8210_bit_timer = timer_alloc( | |
| 328 | pr8210_bit_timer = machine->scheduler().timer_alloc(FUNC( | |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 |
| Previous | 15994 Revisions | Next |